@actual-app/web 24.3.0 → 24.4.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/.vite/manifest.json +27 -17
- package/build/index.html +1 -1
- package/build/kcab/{kcab.worker.fb5495b79632bd06ea0f.js → kcab.worker.d3576baccc44df86e1d9.js} +57 -57
- package/build/kcab/{kcab.worker.fb5495b79632bd06ea0f.js.map → kcab.worker.d3576baccc44df86e1d9.js.map} +1 -1
- package/build/static/js/AppliedFilters.6hw_SZMi.chunk.js +2 -0
- package/build/static/js/AppliedFilters.6hw_SZMi.chunk.js.map +1 -0
- package/build/static/js/{BackgroundImage.Jugq91td.chunk.js → BackgroundImage.UwhfLEYN.chunk.js} +2 -2
- package/build/static/js/{BackgroundImage.Jugq91td.chunk.js.map → BackgroundImage.UwhfLEYN.chunk.js.map} +1 -1
- package/build/static/js/BalanceTooltip.hDG0UB7U.chunk.js +2 -0
- package/build/static/js/BalanceTooltip.hDG0UB7U.chunk.js.map +1 -0
- package/build/static/js/ButtonLink.WYXFzja-.chunk.js +2 -0
- package/build/static/js/{ButtonLink.ElUV7DMx.chunk.js.map → ButtonLink.WYXFzja-.chunk.js.map} +1 -1
- package/build/static/js/ReportRouter.mLx3JUh2.chunk.js +66 -0
- package/build/static/js/ReportRouter.mLx3JUh2.chunk.js.map +1 -0
- package/build/static/js/import.M8LEm-Nc.chunk.js +2 -0
- package/build/static/js/import.M8LEm-Nc.chunk.js.map +1 -0
- package/build/static/js/index.MAk9r4yg.js +216 -0
- package/build/static/js/index.MAk9r4yg.js.map +1 -0
- package/build/static/js/narrow.vxy14QoE.chunk.js +108 -0
- package/build/static/js/narrow.vxy14QoE.chunk.js.map +1 -0
- package/build/static/js/wide.GDttRuTJ.chunk.js +2 -0
- package/build/static/js/wide.GDttRuTJ.chunk.js.map +1 -0
- package/build/sw.js +1 -1
- package/build/sw.js.map +1 -1
- package/package.json +3 -2
- package/build/static/js/AppliedFilters.ggJl8zjp.chunk.js +0 -2
- package/build/static/js/AppliedFilters.ggJl8zjp.chunk.js.map +0 -1
- package/build/static/js/BalanceTooltip.nSDrDsfc.chunk.js +0 -2
- package/build/static/js/BalanceTooltip.nSDrDsfc.chunk.js.map +0 -1
- package/build/static/js/ButtonLink.ElUV7DMx.chunk.js +0 -2
- package/build/static/js/ReportRouter.8mlKGqxC.chunk.js +0 -69
- package/build/static/js/ReportRouter.8mlKGqxC.chunk.js.map +0 -1
- package/build/static/js/index.O6ABAWXP.js +0 -216
- package/build/static/js/index.O6ABAWXP.js.map +0 -1
- package/build/static/js/narrow.BvCotSUP.chunk.js +0 -108
- package/build/static/js/narrow.BvCotSUP.chunk.js.map +0 -1
- package/build/static/js/wide.Puo4nQYF.chunk.js +0 -2
- package/build/static/js/wide.Puo4nQYF.chunk.js.map +0 -1
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
function Y3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var F2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function H2(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var z2={exports:{}},Ep={},U2={exports:{}},Ie={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Qc=Symbol.for("react.element"),q3=Symbol.for("react.portal"),G3=Symbol.for("react.fragment"),K3=Symbol.for("react.strict_mode"),Q3=Symbol.for("react.profiler"),X3=Symbol.for("react.provider"),Z3=Symbol.for("react.context"),J3=Symbol.for("react.forward_ref"),eR=Symbol.for("react.suspense"),tR=Symbol.for("react.memo"),nR=Symbol.for("react.lazy"),$w=Symbol.iterator;function rR(e){return e===null||typeof e!="object"?null:(e=$w&&e[$w]||e["@@iterator"],typeof e=="function"?e:null)}var W2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V2=Object.assign,Y2={};function Il(e,t,n){this.props=e,this.context=t,this.refs=Y2,this.updater=n||W2}Il.prototype.isReactComponent={};Il.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)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")};Il.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function q2(){}q2.prototype=Il.prototype;function dx(e,t,n){this.props=e,this.context=t,this.refs=Y2,this.updater=n||W2}var fx=dx.prototype=new q2;fx.constructor=dx;V2(fx,Il.prototype);fx.isPureReactComponent=!0;var Fw=Array.isArray,G2=Object.prototype.hasOwnProperty,hx={current:null},K2={key:!0,ref:!0,__self:!0,__source:!0};function Q2(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)G2.call(t,r)&&!K2.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Qc,type:e,key:i,ref:a,props:o,_owner:hx.current}}function oR(e,t){return{$$typeof:Qc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function px(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qc}function iR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Hw=/\/+/g;function hm(e,t){return typeof e=="object"&&e!==null&&e.key!=null?iR(""+e.key):t.toString(36)}function Nf(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Qc:case q3:a=!0}}if(a)return a=e,o=o(a),e=r===""?"."+hm(a,0):r,Fw(o)?(n="",e!=null&&(n=e.replace(Hw,"$&/")+"/"),Nf(o,t,n,"",function(c){return c})):o!=null&&(px(o)&&(o=oR(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(Hw,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=r===""?".":r+":",Fw(e))for(var l=0;l<e.length;l++){i=e[l];var u=r+hm(i,l);a+=Nf(i,t,n,u,o)}else if(u=rR(e),typeof u=="function")for(e=u.call(e),l=0;!(i=e.next()).done;)i=i.value,u=r+hm(i,l++),a+=Nf(i,t,n,u,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Jd(e,t,n){if(e==null)return e;var r=[],o=0;return Nf(e,r,"","",function(i){return t.call(n,i,o++)}),r}function aR(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ln={current:null},$f={transition:null},sR={ReactCurrentDispatcher:Ln,ReactCurrentBatchConfig:$f,ReactCurrentOwner:hx};Ie.Children={map:Jd,forEach:function(e,t,n){Jd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Jd(e,function(){t++}),t},toArray:function(e){return Jd(e,function(t){return t})||[]},only:function(e){if(!px(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ie.Component=Il;Ie.Fragment=G3;Ie.Profiler=Q3;Ie.PureComponent=dx;Ie.StrictMode=K3;Ie.Suspense=eR;Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sR;Ie.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=V2({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=hx.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)G2.call(t,u)&&!K2.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:Qc,type:e.type,key:o,ref:i,props:r,_owner:a}};Ie.createContext=function(e){return e={$$typeof:Z3,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:X3,_context:e},e.Consumer=e};Ie.createElement=Q2;Ie.createFactory=function(e){var t=Q2.bind(null,e);return t.type=e,t};Ie.createRef=function(){return{current:null}};Ie.forwardRef=function(e){return{$$typeof:J3,render:e}};Ie.isValidElement=px;Ie.lazy=function(e){return{$$typeof:nR,_payload:{_status:-1,_result:e},_init:aR}};Ie.memo=function(e,t){return{$$typeof:tR,type:e,compare:t===void 0?null:t}};Ie.startTransition=function(e){var t=$f.transition;$f.transition={};try{e()}finally{$f.transition=t}};Ie.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ie.useCallback=function(e,t){return Ln.current.useCallback(e,t)};Ie.useContext=function(e){return Ln.current.useContext(e)};Ie.useDebugValue=function(){};Ie.useDeferredValue=function(e){return Ln.current.useDeferredValue(e)};Ie.useEffect=function(e,t){return Ln.current.useEffect(e,t)};Ie.useId=function(){return Ln.current.useId()};Ie.useImperativeHandle=function(e,t,n){return Ln.current.useImperativeHandle(e,t,n)};Ie.useInsertionEffect=function(e,t){return Ln.current.useInsertionEffect(e,t)};Ie.useLayoutEffect=function(e,t){return Ln.current.useLayoutEffect(e,t)};Ie.useMemo=function(e,t){return Ln.current.useMemo(e,t)};Ie.useReducer=function(e,t,n){return Ln.current.useReducer(e,t,n)};Ie.useRef=function(e){return Ln.current.useRef(e)};Ie.useState=function(e){return Ln.current.useState(e)};Ie.useSyncExternalStore=function(e,t,n){return Ln.current.useSyncExternalStore(e,t,n)};Ie.useTransition=function(){return Ln.current.useTransition()};Ie.version="18.2.0";U2.exports=Ie;var g=U2.exports;const $t=mr(g),X2=Y3({__proto__:null,default:$t},[g]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var lR=g,uR=Symbol.for("react.element"),cR=Symbol.for("react.fragment"),dR=Object.prototype.hasOwnProperty,fR=lR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,hR={key:!0,ref:!0,__self:!0,__source:!0};function Z2(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)dR.call(t,r)&&!hR.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:uR,type:e,key:i,ref:a,props:o,_owner:fR.current}}Ep.Fragment=cR;Ep.jsx=Z2;Ep.jsxs=Z2;z2.exports=Ep;var s=z2.exports,pR={REACT_APP_BACKEND_WORKER_HASH:"d3576baccc44df86e1d9",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const pn=globalThis||void 0||self,pl={env:{...pR,NODE_ENV:"production",PUBLIC_URL:"/".slice(0,-1)}},gR="modulepreload",mR=function(e){return"/"+e},zw={},Dl=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){const i=document.getElementsByTagName("link");o=Promise.all(n.map(a=>{if(a=mR(a),a in zw)return;zw[a]=!0;const l=a.endsWith(".css"),u=l?'[rel="stylesheet"]':"";if(!!r)for(let d=i.length-1;d>=0;d--){const h=i[d];if(h.href===a&&(!l||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${u}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":gR,l||(f.as="script",f.crossOrigin=""),f.href=a,document.head.appendChild(f),l)return new Promise((d,h)=>{f.addEventListener("load",d),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${a}`)))})}))}return o.then(()=>t()).catch(i=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i})};function yR(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function vR(e){return(t,n,r)=>{if(yR())throw new Error("`startWorkerFromMain` should only be called from the main thread");if(typeof Worker>"u")throw new Error("Web workers not available. sqlite3 requires web workers to work.");e().then(({default:o})=>{let i=new o;i.postMessage({type:"init",buffers:[t,n]}),i.addEventListener("message",a=>{r.postMessage(a.data)})})}}function xR(e,t){const n=vR(t);return r=>{r.addEventListener("message",o=>{switch(o.data.type){case e:n(o.data.argBuffer,o.data.resultBuffer,r);break}})}}const bR=xR("__absurd:spawn-idb-worker",()=>Dl(()=>import("./indexeddb-main-thread-worker-e59fee74.bhyX5Ad6.chunk.js"),__vite__mapDeps([])));navigator.platform&&navigator.platform.toLowerCase();navigator.platform&&navigator.platform.toUpperCase().indexOf("MAC")>=0;const _l=navigator.userAgent==="playwright",gx=!0,wR="@actual-app/web",SR="24.4.0",kR="MIT",TR=["build"],CR={"@juggle/resize-observer":"^3.4.0","@playwright/test":"^1.41.1","@reach/listbox":"^0.18.0","@react-aria/focus":"^3.16.0","@react-aria/listbox":"^3.11.3","@react-aria/utils":"^3.23.0","@react-stately/collections":"^3.10.4","@react-stately/list":"^3.10.2","@rollup/plugin-inject":"^5.0.5","@svgr/cli":"^8.1.0","@swc/core":"^1.3.105","@swc/helpers":"^0.5.3","@swc/plugin-react-remove-properties":"^1.5.108","@testing-library/react":"14.1.2","@testing-library/user-event":"14.5.2","@types/react":"^18.2.0","@types/react-dom":"^18.2.1","@types/react-modal":"^3.16.0","@types/react-redux":"^7.1.25","@types/uuid":"^9.0.2","@types/webpack-bundle-analyzer":"^4.6.3","@use-gesture/react":"^10.3.0","@vitejs/plugin-basic-ssl":"^1.1.0","@vitejs/plugin-react-swc":"^3.5.0",chokidar:"^3.5.3","cross-env":"^7.0.3","date-fns":"^2.30.0",debounce:"^1.2.1",downshift:"7.6.2","focus-visible":"^4.1.5",glamor:"^2.20.40","inter-ui":"^3.19.3",jest:"^27.5.1","jest-watch-typeahead":"^2.2.2","mdast-util-newline-to-break":"^2.0.0","memoize-one":"^6.0.0",pikaday:"1.8.2",react:"18.2.0","react-dnd":"^16.0.1","react-dnd-html5-backend":"^16.0.1","react-dom":"18.2.0","react-error-boundary":"^4.0.12","react-hotkeys-hook":"^4.5.0","react-markdown":"^8.0.7","react-merge-refs":"^1.1.0","react-modal":"3.16.1","react-redux":"7.2.9","react-router-dom":"6.21.3","react-simple-pull-to-refresh":"^1.3.3","react-spring":"^9.7.3","react-virtualized-auto-sizer":"^1.0.21",recharts:"^2.10.4",redux:"^4.2.1","redux-thunk":"^2.4.2","remark-gfm":"^3.0.1","rollup-plugin-visualizer":"^5.12.0",sass:"^1.70.0","swc-loader":"^0.2.3","terser-webpack-plugin":"^5.3.10","usehooks-ts":"^3.0.1",uuid:"^9.0.1",vite:"^5.0.12","vite-plugin-pwa":"^0.19.0","vite-tsconfig-paths":"^4.3.1",vitest:"^1.2.1","webpack-bundle-analyzer":"^4.10.1",xml2js:"^0.6.2"},ER={start:"cross-env PORT=3001 vite","start:browser":"cross-env ./bin/watch-browser",watch:"cross-env BROWSER=none yarn start",build:"vite build","build:browser":"cross-env ./bin/build-browser","generate:icons":"rm src/icons/*/*.tsx; cd src/icons && svgr --template template.ts --index-template index-template.ts --typescript --expand-props start -d . .",test:"vitest",e2e:"npx playwright test --browser=chromium",vrt:"cross-env VRT=true npx playwright test --browser=chromium"},jR={name:wR,version:SR,license:kR,files:TR,devDependencies:CR,scripts:ER},IR=new URL("/static/js/browser-server.ofLkaXS2.js",import.meta.url),J2=!1,eE=_l?"99.9.9":jR.version;let Ff;function DR(){Ff=new Worker(IR),bR(Ff),window.SharedArrayBuffer&&localStorage.removeItem("SharedArrayBufferOverride"),Ff.postMessage({type:"init",version:eE,isDev:J2,publicUrl:pl.env.PUBLIC_URL,hash:pl.env.REACT_APP_BACKEND_WORKER_HASH,isSharedArrayBufferOverrideEnabled:localStorage.getItem("SharedArrayBufferOverride")})}DR();pn.Actual={IS_DEV:J2,ACTUAL_VERSION:eE,logToTerminal:(...e)=>{console.log(...e)},relaunch:()=>{window.location.reload()},openFileDialog:async({filters:e=[]})=>new Promise(t=>{let n=!1,r=document.body.querySelector('input[id="open-file-dialog-input"]');r||(n=!0,r=document.createElement("input")),r.type="file",r.id="open-file-dialog-input",r.value=null;const o=e.find(i=>i.extensions);o&&(r.accept=o.extensions.map(i=>"."+i).join(",")),r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.display="none",r.onchange=i=>{const a=i.target.files[0],l=a.name.replace(/.*(\.[^.]*)/,"file$1");if(a){const u=new FileReader;u.readAsArrayBuffer(a),u.onload=async function(c){const f=`/uploads/${l}`;window.__actionsForMenu.uploadFile(l,c.target.result).then(()=>t([f]))},u.onerror=function(){alert("Error reading file")}}},n&&document.body.appendChild(r),r.click()}),saveFile:(e,t)=>{const n=document.createElement("a");n.style="display: none",n.download=t,n.rel="noopener";const r=new Blob([e]);n.href=URL.createObjectURL(r),n.dispatchEvent(new MouseEvent("click"))},openURLInBrowser:e=>{window.open(e,"_blank")},onEventFromMain:()=>{},applyAppUpdate:()=>{},updateAppMenu:()=>{},ipcConnect:()=>{},getServerSocket:async()=>Ff,setTheme:e=>{window.__actionsForMenu.saveGlobalPrefs({theme:e})}};document.addEventListener("keydown",e=>{if(e.metaKey||e.ctrlKey){if(e.key==="o")e.preventDefault(),window.__actionsForMenu.closeBudget();else if(e.key.toLowerCase()==="z"){if(e.target.tagName==="INPUT"||e.target.tagName==="TEXTAREA"||e.target.isContentEditable)return;e.preventDefault(),e.shiftKey?window.__actionsForMenu.redo():window.__actionsForMenu.undo()}}});var tE={exports:{}},_R="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",OR=_R,AR=OR;function nE(){}function rE(){}rE.resetWarningCache=nE;var PR=function(){function e(r,o,i,a,l,u){if(u!==AR){var c=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 c.name="Invariant Violation",c}}e.isRequired=e;function t(){return 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:rE,resetWarningCache:nE};return n.PropTypes=n,n};tE.exports=PR();var mx=tE.exports;const G=mr(mx);var aa=$t.createContext(null);function MR(e){e()}var oE=MR,RR=function(t){return oE=t},BR=function(){return oE};function LR(){var e=BR(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var o=t;o;)o.callback(),o=o.next})},get:function(){for(var o=[],i=t;i;)o.push(i),i=i.next;return o},subscribe:function(o){var i=!0,a=n={callback:o,next:null,prev:n};return a.prev?a.prev.next=a:t=a,function(){!i||t===null||(i=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}var Uw={notify:function(){},get:function(){return[]}};function iE(e,t){var n,r=Uw;function o(d){return u(),r.subscribe(d)}function i(){r.notify()}function a(){f.onStateChange&&f.onStateChange()}function l(){return!!n}function u(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=LR())}function c(){n&&(n(),n=void 0,r.clear(),r=Uw)}var f={addNestedSub:o,notifyNestedSubs:i,handleChangeWrapper:a,isSubscribed:l,trySubscribe:u,tryUnsubscribe:c,getListeners:function(){return r}};return f}var Yy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?g.useLayoutEffect:g.useEffect;function NR(e){var t=e.store,n=e.context,r=e.children,o=g.useMemo(function(){var l=iE(t);return{store:t,subscription:l}},[t]),i=g.useMemo(function(){return t.getState()},[t]);Yy(function(){var l=o.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),i!==t.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[o,i]);var a=n||aa;return $t.createElement(a.Provider,{value:o},r)}function Kt(){return Kt=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},Kt.apply(this,arguments)}function iu(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var aE={exports:{}},Xe={};/** @license React v16.13.1
|
|
18
|
+
* react-is.production.min.js
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the MIT license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/var on=typeof Symbol=="function"&&Symbol.for,yx=on?Symbol.for("react.element"):60103,vx=on?Symbol.for("react.portal"):60106,jp=on?Symbol.for("react.fragment"):60107,Ip=on?Symbol.for("react.strict_mode"):60108,Dp=on?Symbol.for("react.profiler"):60114,_p=on?Symbol.for("react.provider"):60109,Op=on?Symbol.for("react.context"):60110,xx=on?Symbol.for("react.async_mode"):60111,Ap=on?Symbol.for("react.concurrent_mode"):60111,Pp=on?Symbol.for("react.forward_ref"):60112,Mp=on?Symbol.for("react.suspense"):60113,$R=on?Symbol.for("react.suspense_list"):60120,Rp=on?Symbol.for("react.memo"):60115,Bp=on?Symbol.for("react.lazy"):60116,FR=on?Symbol.for("react.block"):60121,HR=on?Symbol.for("react.fundamental"):60117,zR=on?Symbol.for("react.responder"):60118,UR=on?Symbol.for("react.scope"):60119;function yr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case yx:switch(e=e.type,e){case xx:case Ap:case jp:case Dp:case Ip:case Mp:return e;default:switch(e=e&&e.$$typeof,e){case Op:case Pp:case Bp:case Rp:case _p:return e;default:return t}}case vx:return t}}}function sE(e){return yr(e)===Ap}Xe.AsyncMode=xx;Xe.ConcurrentMode=Ap;Xe.ContextConsumer=Op;Xe.ContextProvider=_p;Xe.Element=yx;Xe.ForwardRef=Pp;Xe.Fragment=jp;Xe.Lazy=Bp;Xe.Memo=Rp;Xe.Portal=vx;Xe.Profiler=Dp;Xe.StrictMode=Ip;Xe.Suspense=Mp;Xe.isAsyncMode=function(e){return sE(e)||yr(e)===xx};Xe.isConcurrentMode=sE;Xe.isContextConsumer=function(e){return yr(e)===Op};Xe.isContextProvider=function(e){return yr(e)===_p};Xe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===yx};Xe.isForwardRef=function(e){return yr(e)===Pp};Xe.isFragment=function(e){return yr(e)===jp};Xe.isLazy=function(e){return yr(e)===Bp};Xe.isMemo=function(e){return yr(e)===Rp};Xe.isPortal=function(e){return yr(e)===vx};Xe.isProfiler=function(e){return yr(e)===Dp};Xe.isStrictMode=function(e){return yr(e)===Ip};Xe.isSuspense=function(e){return yr(e)===Mp};Xe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===jp||e===Ap||e===Dp||e===Ip||e===Mp||e===$R||typeof e=="object"&&e!==null&&(e.$$typeof===Bp||e.$$typeof===Rp||e.$$typeof===_p||e.$$typeof===Op||e.$$typeof===Pp||e.$$typeof===HR||e.$$typeof===zR||e.$$typeof===UR||e.$$typeof===FR)};Xe.typeOf=yr;aE.exports=Xe;var WR=aE.exports,lE=WR,VR={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},YR={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},uE={};uE[lE.ForwardRef]=VR;uE[lE.Memo]=YR;var it={};/** @license React v17.0.2
|
|
25
|
+
* react-is.production.min.js
|
|
26
|
+
*
|
|
27
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the MIT license found in the
|
|
30
|
+
* LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/var Lp=60103,Np=60106,Xc=60107,Zc=60108,Jc=60114,ed=60109,td=60110,nd=60112,rd=60113,bx=60120,od=60115,id=60116,cE=60121,dE=60122,fE=60117,hE=60129,pE=60131;if(typeof Symbol=="function"&&Symbol.for){var sn=Symbol.for;Lp=sn("react.element"),Np=sn("react.portal"),Xc=sn("react.fragment"),Zc=sn("react.strict_mode"),Jc=sn("react.profiler"),ed=sn("react.provider"),td=sn("react.context"),nd=sn("react.forward_ref"),rd=sn("react.suspense"),bx=sn("react.suspense_list"),od=sn("react.memo"),id=sn("react.lazy"),cE=sn("react.block"),dE=sn("react.server.block"),fE=sn("react.fundamental"),hE=sn("react.debug_trace_mode"),pE=sn("react.legacy_hidden")}function fo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Lp:switch(e=e.type,e){case Xc:case Jc:case Zc:case rd:case bx:return e;default:switch(e=e&&e.$$typeof,e){case td:case nd:case id:case od:case ed:return e;default:return t}}case Np:return t}}}var qR=ed,GR=Lp,KR=nd,QR=Xc,XR=id,ZR=od,JR=Np,eB=Jc,tB=Zc,nB=rd;it.ContextConsumer=td;it.ContextProvider=qR;it.Element=GR;it.ForwardRef=KR;it.Fragment=QR;it.Lazy=XR;it.Memo=ZR;it.Portal=JR;it.Profiler=eB;it.StrictMode=tB;it.Suspense=nB;it.isAsyncMode=function(){return!1};it.isConcurrentMode=function(){return!1};it.isContextConsumer=function(e){return fo(e)===td};it.isContextProvider=function(e){return fo(e)===ed};it.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Lp};it.isForwardRef=function(e){return fo(e)===nd};it.isFragment=function(e){return fo(e)===Xc};it.isLazy=function(e){return fo(e)===id};it.isMemo=function(e){return fo(e)===od};it.isPortal=function(e){return fo(e)===Np};it.isProfiler=function(e){return fo(e)===Jc};it.isStrictMode=function(e){return fo(e)===Zc};it.isSuspense=function(e){return fo(e)===rd};it.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Xc||e===Jc||e===hE||e===Zc||e===rd||e===bx||e===pE||typeof e=="object"&&e!==null&&(e.$$typeof===id||e.$$typeof===od||e.$$typeof===ed||e.$$typeof===td||e.$$typeof===nd||e.$$typeof===fE||e.$$typeof===cE||e[0]===dE)};it.typeOf=fo;function gE(){var e=g.useContext(aa);return e}function mE(e){e===void 0&&(e=aa);var t=e===aa?gE:function(){return g.useContext(e)};return function(){var r=t(),o=r.store;return o}}var yE=mE();function rB(e){e===void 0&&(e=aa);var t=e===aa?yE:mE(e);return function(){var r=t();return r.dispatch}}var Ft=rB(),oB=function(t,n){return t===n};function iB(e,t,n,r){var o=g.useReducer(function(m){return m+1},0),i=o[1],a=g.useMemo(function(){return iE(n,r)},[n,r]),l=g.useRef(),u=g.useRef(),c=g.useRef(),f=g.useRef(),d=n.getState(),h;try{if(e!==u.current||d!==c.current||l.current){var p=e(d);f.current===void 0||!t(p,f.current)?h=p:h=f.current}else h=f.current}catch(m){throw l.current&&(m.message+=`
|
|
32
|
+
The error may be correlated with this previous error:
|
|
33
|
+
`+l.current.stack+`
|
|
34
|
+
|
|
35
|
+
`),m}return Yy(function(){u.current=e,c.current=d,f.current=h,l.current=void 0}),Yy(function(){function m(){try{var x=n.getState();if(x===c.current)return;var k=u.current(x);if(t(k,f.current))return;f.current=k,c.current=x}catch(v){l.current=v}i()}return a.onStateChange=m,a.trySubscribe(),m(),function(){return a.tryUnsubscribe()}},[n,a]),h}function aB(e){e===void 0&&(e=aa);var t=e===aa?gE:function(){return g.useContext(e)};return function(r,o){o===void 0&&(o=oB);var i=t(),a=i.store,l=i.subscription,u=iB(r,o,a,l);return g.useDebugValue(u),u}}var Te=aB(),vE={exports:{}},vr={},xE={exports:{}},bE={};/**
|
|
36
|
+
* @license React
|
|
37
|
+
* scheduler.production.min.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/(function(e){function t(j,D){var C=j.length;j.push(D);e:for(;0<C;){var $=C-1>>>1,W=j[$];if(0<o(W,D))j[$]=D,j[C]=W,C=$;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var D=j[0],C=j.pop();if(C!==D){j[0]=C;e:for(var $=0,W=j.length,A=W>>>1;$<A;){var J=2*($+1)-1,le=j[J],ee=J+1,ie=j[ee];if(0>o(le,C))ee<W&&0>o(ie,le)?(j[$]=ie,j[ee]=C,$=ee):(j[$]=le,j[J]=C,$=J);else if(ee<W&&0>o(ie,C))j[$]=ie,j[ee]=C,$=ee;else break e}}return D}function o(j,D){var C=j.sortIndex-D.sortIndex;return C!==0?C:j.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var u=[],c=[],f=1,d=null,h=3,p=!1,m=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(j){for(var D=n(c);D!==null;){if(D.callback===null)r(c);else if(D.startTime<=j)r(c),D.sortIndex=D.expirationTime,t(u,D);else break;D=n(c)}}function w(j){if(x=!1,b(j),!m)if(n(u)!==null)m=!0,U(E);else{var D=n(c);D!==null&&P(w,D.startTime-j)}}function E(j,D){m=!1,x&&(x=!1,v(M),M=-1),p=!0;var C=h;try{for(b(D),d=n(u);d!==null&&(!(d.expirationTime>D)||j&&!N());){var $=d.callback;if(typeof $=="function"){d.callback=null,h=d.priorityLevel;var W=$(d.expirationTime<=D);D=e.unstable_now(),typeof W=="function"?d.callback=W:d===n(u)&&r(u),b(D)}else r(u);d=n(u)}if(d!==null)var A=!0;else{var J=n(c);J!==null&&P(w,J.startTime-D),A=!1}return A}finally{d=null,h=C,p=!1}}var T=!1,_=null,M=-1,B=5,O=-1;function N(){return!(e.unstable_now()-O<B)}function H(){if(_!==null){var j=e.unstable_now();O=j;var D=!0;try{D=_(!0,j)}finally{D?F():(T=!1,_=null)}}else T=!1}var F;if(typeof y=="function")F=function(){y(H)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,R=L.port2;L.port1.onmessage=H,F=function(){R.postMessage(null)}}else F=function(){k(H,0)};function U(j){_=j,T||(T=!0,F())}function P(j,D){M=k(function(){j(e.unstable_now())},D)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,U(E))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(j){switch(h){case 1:case 2:case 3:var D=3;break;default:D=h}var C=h;h=D;try{return j()}finally{h=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,D){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var C=h;h=j;try{return D()}finally{h=C}},e.unstable_scheduleCallback=function(j,D,C){var $=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?$+C:$):C=$,j){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=C+W,j={id:f++,callback:D,priorityLevel:j,startTime:C,expirationTime:W,sortIndex:-1},C>$?(j.sortIndex=C,t(c,j),n(u)===null&&j===n(c)&&(x?(v(M),M=-1):x=!0,P(w,C-$))):(j.sortIndex=W,t(u,j),m||p||(m=!0,U(E))),j},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(j){var D=h;return function(){var C=h;h=D;try{return j.apply(this,arguments)}finally{h=C}}}})(bE);xE.exports=bE;var sB=xE.exports;/**
|
|
44
|
+
* @license React
|
|
45
|
+
* react-dom.production.min.js
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the MIT license found in the
|
|
50
|
+
* LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/var wE=g,pr=sB;function te(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 SE=new Set,sc={};function us(e,t){gl(e,t),gl(e+"Capture",t)}function gl(e,t){for(sc[e]=t,e=0;e<t.length;e++)SE.add(t[e])}var ui=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qy=Object.prototype.hasOwnProperty,lB=/^[: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]*$/,Ww={},Vw={};function uB(e){return qy.call(Vw,e)?!0:qy.call(Ww,e)?!1:lB.test(e)?Vw[e]=!0:(Ww[e]=!0,!1)}function cB(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function dB(e,t,n,r){if(t===null||typeof t>"u"||cB(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Nn(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var gn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){gn[e]=new Nn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];gn[t]=new Nn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){gn[e]=new Nn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){gn[e]=new Nn(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){gn[e]=new Nn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){gn[e]=new Nn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){gn[e]=new Nn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){gn[e]=new Nn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){gn[e]=new Nn(e,5,!1,e.toLowerCase(),null,!1,!1)});var wx=/[\-:]([a-z])/g;function Sx(e){return e[1].toUpperCase()}"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(wx,Sx);gn[t]=new Nn(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(wx,Sx);gn[t]=new Nn(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(wx,Sx);gn[t]=new Nn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){gn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!1,!1)});gn.xlinkHref=new Nn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){gn[e]=new Nn(e,1,!1,e.toLowerCase(),null,!0,!0)});function kx(e,t,n,r){var o=gn.hasOwnProperty(t)?gn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(dB(t,n,o,r)&&(n=null),r||o===null?uB(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var gi=wE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ef=Symbol.for("react.element"),$s=Symbol.for("react.portal"),Fs=Symbol.for("react.fragment"),Tx=Symbol.for("react.strict_mode"),Gy=Symbol.for("react.profiler"),kE=Symbol.for("react.provider"),TE=Symbol.for("react.context"),Cx=Symbol.for("react.forward_ref"),Ky=Symbol.for("react.suspense"),Qy=Symbol.for("react.suspense_list"),Ex=Symbol.for("react.memo"),Mi=Symbol.for("react.lazy"),CE=Symbol.for("react.offscreen"),Yw=Symbol.iterator;function au(e){return e===null||typeof e!="object"?null:(e=Yw&&e[Yw]||e["@@iterator"],typeof e=="function"?e:null)}var Ct=Object.assign,pm;function Cu(e){if(pm===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);pm=t&&t[1]||""}return`
|
|
52
|
+
`+pm+e}var gm=!1;function mm(e,t){if(!e||gm)return"";gm=!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()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
|
|
53
|
+
`),i=r.stack.split(`
|
|
54
|
+
`),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(a!==1||l!==1)do if(a--,l--,0>l||o[a]!==i[l]){var u=`
|
|
55
|
+
`+o[a].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=a&&0<=l);break}}}finally{gm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Cu(e):""}function fB(e){switch(e.tag){case 5:return Cu(e.type);case 16:return Cu("Lazy");case 13:return Cu("Suspense");case 19:return Cu("SuspenseList");case 0:case 2:case 15:return e=mm(e.type,!1),e;case 11:return e=mm(e.type.render,!1),e;case 1:return e=mm(e.type,!0),e;default:return""}}function Xy(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Fs:return"Fragment";case $s:return"Portal";case Gy:return"Profiler";case Tx:return"StrictMode";case Ky:return"Suspense";case Qy:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case TE:return(e.displayName||"Context")+".Consumer";case kE:return(e._context.displayName||"Context")+".Provider";case Cx:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ex:return t=e.displayName||null,t!==null?t:Xy(e.type)||"Memo";case Mi:t=e._payload,e=e._init;try{return Xy(e(t))}catch{}}return null}function hB(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=t.render,e=e.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 Xy(t);case 8:return t===Tx?"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(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function sa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function EE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pB(e){var t=EE(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tf(e){e._valueTracker||(e._valueTracker=pB(e))}function jE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=EE(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Zy(e,t){var n=t.checked;return Ct({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function qw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=sa(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function IE(e,t){t=t.checked,t!=null&&kx(e,"checked",t,!1)}function Jy(e,t){IE(e,t);var n=sa(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?e0(e,t.type,n):t.hasOwnProperty("defaultValue")&&e0(e,t.type,sa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Gw(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function e0(e,t,n){(t!=="number"||fh(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Eu=Array.isArray;function tl(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=""+sa(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function t0(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(te(91));return Ct({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Kw(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(te(92));if(Eu(n)){if(1<n.length)throw Error(te(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:sa(n)}}function DE(e,t){var n=sa(t.value),r=sa(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Qw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function _E(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 n0(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?_E(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var nf,OE=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(nf=nf||document.createElement("div"),nf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=nf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function lc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ru={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},gB=["Webkit","ms","Moz","O"];Object.keys(Ru).forEach(function(e){gB.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ru[t]=Ru[e]})});function AE(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ru.hasOwnProperty(e)&&Ru[e]?(""+t).trim():t+"px"}function PE(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=AE(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var mB=Ct({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 r0(e,t){if(t){if(mB[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(te(62))}}function o0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 i0=null;function jx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var a0=null,nl=null,rl=null;function Xw(e){if(e=ld(e)){if(typeof a0!="function")throw Error(te(280));var t=e.stateNode;t&&(t=Up(t),a0(e.stateNode,e.type,t))}}function ME(e){nl?rl?rl.push(e):rl=[e]:nl=e}function RE(){if(nl){var e=nl,t=rl;if(rl=nl=null,Xw(e),t)for(e=0;e<t.length;e++)Xw(t[e])}}function BE(e,t){return e(t)}function LE(){}var ym=!1;function NE(e,t,n){if(ym)return e(t,n);ym=!0;try{return BE(e,t,n)}finally{ym=!1,(nl!==null||rl!==null)&&(LE(),RE())}}function uc(e,t){var n=e.stateNode;if(n===null)return null;var r=Up(n);if(r===null)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)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(te(231,t,typeof n));return n}var s0=!1;if(ui)try{var su={};Object.defineProperty(su,"passive",{get:function(){s0=!0}}),window.addEventListener("test",su,su),window.removeEventListener("test",su,su)}catch{s0=!1}function yB(e,t,n,r,o,i,a,l,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(f){this.onError(f)}}var Bu=!1,hh=null,ph=!1,l0=null,vB={onError:function(e){Bu=!0,hh=e}};function xB(e,t,n,r,o,i,a,l,u){Bu=!1,hh=null,yB.apply(vB,arguments)}function bB(e,t,n,r,o,i,a,l,u){if(xB.apply(this,arguments),Bu){if(Bu){var c=hh;Bu=!1,hh=null}else throw Error(te(198));ph||(ph=!0,l0=c)}}function cs(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function $E(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Zw(e){if(cs(e)!==e)throw Error(te(188))}function wB(e){var t=e.alternate;if(!t){if(t=cs(e),t===null)throw Error(te(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Zw(o),e;if(i===r)return Zw(o),t;i=i.sibling}throw Error(te(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,l=o.child;l;){if(l===n){a=!0,n=o,r=i;break}if(l===r){a=!0,r=o,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,r=o;break}if(l===r){a=!0,r=i,n=o;break}l=l.sibling}if(!a)throw Error(te(189))}}if(n.alternate!==r)throw Error(te(190))}if(n.tag!==3)throw Error(te(188));return n.stateNode.current===n?e:t}function FE(e){return e=wB(e),e!==null?HE(e):null}function HE(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=HE(e);if(t!==null)return t;e=e.sibling}return null}var zE=pr.unstable_scheduleCallback,Jw=pr.unstable_cancelCallback,SB=pr.unstable_shouldYield,kB=pr.unstable_requestPaint,Bt=pr.unstable_now,TB=pr.unstable_getCurrentPriorityLevel,Ix=pr.unstable_ImmediatePriority,UE=pr.unstable_UserBlockingPriority,gh=pr.unstable_NormalPriority,CB=pr.unstable_LowPriority,WE=pr.unstable_IdlePriority,$p=null,Ao=null;function EB(e){if(Ao&&typeof Ao.onCommitFiberRoot=="function")try{Ao.onCommitFiberRoot($p,e,void 0,(e.current.flags&128)===128)}catch{}}var no=Math.clz32?Math.clz32:DB,jB=Math.log,IB=Math.LN2;function DB(e){return e>>>=0,e===0?32:31-(jB(e)/IB|0)|0}var rf=64,of=4194304;function ju(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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function mh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~o;l!==0?r=ju(l):(i&=a,i!==0&&(r=ju(i)))}else a=n&~o,a!==0?r=ju(a):i!==0&&(r=ju(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-no(t),o=1<<n,r|=e[n],t&=~o;return r}function _B(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;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function OB(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-no(i),l=1<<a,u=o[a];u===-1?(!(l&n)||l&r)&&(o[a]=_B(l,t)):u<=t&&(e.expiredLanes|=l),i&=~l}}function u0(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function VE(){var e=rf;return rf<<=1,!(rf&4194240)&&(rf=64),e}function vm(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ad(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-no(t),e[t]=n}function AB(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-no(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Dx(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-no(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var Ge=0;function YE(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var qE,_x,GE,KE,QE,c0=!1,af=[],Gi=null,Ki=null,Qi=null,cc=new Map,dc=new Map,Ni=[],PB="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 eS(e,t){switch(e){case"focusin":case"focusout":Gi=null;break;case"dragenter":case"dragleave":Ki=null;break;case"mouseover":case"mouseout":Qi=null;break;case"pointerover":case"pointerout":cc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":dc.delete(t.pointerId)}}function lu(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=ld(t),t!==null&&_x(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function MB(e,t,n,r,o){switch(t){case"focusin":return Gi=lu(Gi,e,t,n,r,o),!0;case"dragenter":return Ki=lu(Ki,e,t,n,r,o),!0;case"mouseover":return Qi=lu(Qi,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return cc.set(i,lu(cc.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,dc.set(i,lu(dc.get(i)||null,e,t,n,r,o)),!0}return!1}function XE(e){var t=La(e.target);if(t!==null){var n=cs(t);if(n!==null){if(t=n.tag,t===13){if(t=$E(n),t!==null){e.blockedOn=t,QE(e.priority,function(){GE(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=d0(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);i0=r,n.target.dispatchEvent(r),i0=null}else return t=ld(n),t!==null&&_x(t),e.blockedOn=n,!1;t.shift()}return!0}function tS(e,t,n){Hf(e)&&n.delete(t)}function RB(){c0=!1,Gi!==null&&Hf(Gi)&&(Gi=null),Ki!==null&&Hf(Ki)&&(Ki=null),Qi!==null&&Hf(Qi)&&(Qi=null),cc.forEach(tS),dc.forEach(tS)}function uu(e,t){e.blockedOn===t&&(e.blockedOn=null,c0||(c0=!0,pr.unstable_scheduleCallback(pr.unstable_NormalPriority,RB)))}function fc(e){function t(o){return uu(o,e)}if(0<af.length){uu(af[0],e);for(var n=1;n<af.length;n++){var r=af[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Gi!==null&&uu(Gi,e),Ki!==null&&uu(Ki,e),Qi!==null&&uu(Qi,e),cc.forEach(t),dc.forEach(t),n=0;n<Ni.length;n++)r=Ni[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ni.length&&(n=Ni[0],n.blockedOn===null);)XE(n),n.blockedOn===null&&Ni.shift()}var ol=gi.ReactCurrentBatchConfig,yh=!0;function BB(e,t,n,r){var o=Ge,i=ol.transition;ol.transition=null;try{Ge=1,Ox(e,t,n,r)}finally{Ge=o,ol.transition=i}}function LB(e,t,n,r){var o=Ge,i=ol.transition;ol.transition=null;try{Ge=4,Ox(e,t,n,r)}finally{Ge=o,ol.transition=i}}function Ox(e,t,n,r){if(yh){var o=d0(e,t,n,r);if(o===null)Im(e,t,r,vh,n),eS(e,r);else if(MB(o,e,t,n,r))r.stopPropagation();else if(eS(e,r),t&4&&-1<PB.indexOf(e)){for(;o!==null;){var i=ld(o);if(i!==null&&qE(i),i=d0(e,t,n,r),i===null&&Im(e,t,r,vh,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Im(e,t,r,null,n)}}var vh=null;function d0(e,t,n,r){if(vh=null,e=jx(r),e=La(e),e!==null)if(t=cs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=$E(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return vh=e,null}function ZE(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(TB()){case Ix:return 1;case UE:return 4;case gh:case CB:return 16;case WE:return 536870912;default:return 16}default:return 16}}var Fi=null,Ax=null,zf=null;function JE(){if(zf)return zf;var e,t=Ax,n=t.length,r,o="value"in Fi?Fi.value:Fi.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===o[i-r];r++);return zf=o.slice(e,1<r?1-r:void 0)}function Uf(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function sf(){return!0}function nS(){return!1}function xr(e){function t(n,r,o,i,a){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?sf:nS,this.isPropagationStopped=nS,this}return Ct(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=sf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=sf)},persist:function(){},isPersistent:sf}),t}var Ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Px=xr(Ol),sd=Ct({},Ol,{view:0,detail:0}),NB=xr(sd),xm,bm,cu,Fp=Ct({},sd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mx,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==cu&&(cu&&e.type==="mousemove"?(xm=e.screenX-cu.screenX,bm=e.screenY-cu.screenY):bm=xm=0,cu=e),xm)},movementY:function(e){return"movementY"in e?e.movementY:bm}}),rS=xr(Fp),$B=Ct({},Fp,{dataTransfer:0}),FB=xr($B),HB=Ct({},sd,{relatedTarget:0}),wm=xr(HB),zB=Ct({},Ol,{animationName:0,elapsedTime:0,pseudoElement:0}),UB=xr(zB),WB=Ct({},Ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),VB=xr(WB),YB=Ct({},Ol,{data:0}),oS=xr(YB),qB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},GB={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"},KB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QB(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=KB[e])?!!t[e]:!1}function Mx(){return QB}var XB=Ct({},sd,{key:function(e){if(e.key){var t=qB[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Uf(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?GB[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mx,charCode:function(e){return e.type==="keypress"?Uf(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Uf(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ZB=xr(XB),JB=Ct({},Fp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),iS=xr(JB),e4=Ct({},sd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mx}),t4=xr(e4),n4=Ct({},Ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),r4=xr(n4),o4=Ct({},Fp,{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}),i4=xr(o4),a4=[9,13,27,32],Rx=ui&&"CompositionEvent"in window,Lu=null;ui&&"documentMode"in document&&(Lu=document.documentMode);var s4=ui&&"TextEvent"in window&&!Lu,ej=ui&&(!Rx||Lu&&8<Lu&&11>=Lu),aS=" ",sS=!1;function tj(e,t){switch(e){case"keyup":return a4.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hs=!1;function l4(e,t){switch(e){case"compositionend":return nj(t);case"keypress":return t.which!==32?null:(sS=!0,aS);case"textInput":return e=t.data,e===aS&&sS?null:e;default:return null}}function u4(e,t){if(Hs)return e==="compositionend"||!Rx&&tj(e,t)?(e=JE(),zf=Ax=Fi=null,Hs=!1,e):null;switch(e){case"paste":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 ej&&t.locale!=="ko"?null:t.data;default:return null}}var c4={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 lS(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!c4[e.type]:t==="textarea"}function rj(e,t,n,r){ME(r),t=xh(t,"onChange"),0<t.length&&(n=new Px("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Nu=null,hc=null;function d4(e){pj(e,0)}function Hp(e){var t=Ws(e);if(jE(t))return e}function f4(e,t){if(e==="change")return t}var oj=!1;if(ui){var Sm;if(ui){var km="oninput"in document;if(!km){var uS=document.createElement("div");uS.setAttribute("oninput","return;"),km=typeof uS.oninput=="function"}Sm=km}else Sm=!1;oj=Sm&&(!document.documentMode||9<document.documentMode)}function cS(){Nu&&(Nu.detachEvent("onpropertychange",ij),hc=Nu=null)}function ij(e){if(e.propertyName==="value"&&Hp(hc)){var t=[];rj(t,hc,e,jx(e)),NE(d4,t)}}function h4(e,t,n){e==="focusin"?(cS(),Nu=t,hc=n,Nu.attachEvent("onpropertychange",ij)):e==="focusout"&&cS()}function p4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hp(hc)}function g4(e,t){if(e==="click")return Hp(t)}function m4(e,t){if(e==="input"||e==="change")return Hp(t)}function y4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uo=typeof Object.is=="function"?Object.is:y4;function pc(e,t){if(uo(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)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(!qy.call(t,o)||!uo(e[o],t[o]))return!1}return!0}function dS(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fS(e,t){var n=dS(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=dS(n)}}function aj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?aj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sj(){for(var e=window,t=fh();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fh(e.document)}return t}function Bx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function v4(e){var t=sj(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&aj(n.ownerDocument.documentElement,n)){if(r!==null&&Bx(n)){if(t=r.start,e=r.end,e===void 0&&(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,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=fS(n,i);var a=fS(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.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;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var x4=ui&&"documentMode"in document&&11>=document.documentMode,zs=null,f0=null,$u=null,h0=!1;function hS(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;h0||zs==null||zs!==fh(r)||(r=zs,"selectionStart"in r&&Bx(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),$u&&pc($u,r)||($u=r,r=xh(f0,"onSelect"),0<r.length&&(t=new Px("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=zs)))}function lf(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Us={animationend:lf("Animation","AnimationEnd"),animationiteration:lf("Animation","AnimationIteration"),animationstart:lf("Animation","AnimationStart"),transitionend:lf("Transition","TransitionEnd")},Tm={},lj={};ui&&(lj=document.createElement("div").style,"AnimationEvent"in window||(delete Us.animationend.animation,delete Us.animationiteration.animation,delete Us.animationstart.animation),"TransitionEvent"in window||delete Us.transitionend.transition);function zp(e){if(Tm[e])return Tm[e];if(!Us[e])return e;var t=Us[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in lj)return Tm[e]=t[n];return e}var uj=zp("animationend"),cj=zp("animationiteration"),dj=zp("animationstart"),fj=zp("transitionend"),hj=new Map,pS="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 fa(e,t){hj.set(e,t),us(t,[e])}for(var Cm=0;Cm<pS.length;Cm++){var Em=pS[Cm],b4=Em.toLowerCase(),w4=Em[0].toUpperCase()+Em.slice(1);fa(b4,"on"+w4)}fa(uj,"onAnimationEnd");fa(cj,"onAnimationIteration");fa(dj,"onAnimationStart");fa("dblclick","onDoubleClick");fa("focusin","onFocus");fa("focusout","onBlur");fa(fj,"onTransitionEnd");gl("onMouseEnter",["mouseout","mouseover"]);gl("onMouseLeave",["mouseout","mouseover"]);gl("onPointerEnter",["pointerout","pointerover"]);gl("onPointerLeave",["pointerout","pointerover"]);us("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));us("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));us("onBeforeInput",["compositionend","keypress","textInput","paste"]);us("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));us("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));us("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Iu="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(" "),S4=new Set("cancel close invalid load scroll toggle".split(" ").concat(Iu));function gS(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,bB(r,t,void 0,e),e.currentTarget=null}function pj(e,t){t=(t&4)!==0;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],u=l.instance,c=l.currentTarget;if(l=l.listener,u!==i&&o.isPropagationStopped())break e;gS(o,l,c),i=u}else for(a=0;a<r.length;a++){if(l=r[a],u=l.instance,c=l.currentTarget,l=l.listener,u!==i&&o.isPropagationStopped())break e;gS(o,l,c),i=u}}}if(ph)throw e=l0,ph=!1,l0=null,e}function lt(e,t){var n=t[v0];n===void 0&&(n=t[v0]=new Set);var r=e+"__bubble";n.has(r)||(gj(t,e,2,!1),n.add(r))}function jm(e,t,n){var r=0;t&&(r|=4),gj(n,e,r,t)}var uf="_reactListening"+Math.random().toString(36).slice(2);function gc(e){if(!e[uf]){e[uf]=!0,SE.forEach(function(n){n!=="selectionchange"&&(S4.has(n)||jm(n,!1,e),jm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[uf]||(t[uf]=!0,jm("selectionchange",!1,t))}}function gj(e,t,n,r){switch(ZE(t)){case 1:var o=BB;break;case 4:o=LB;break;default:o=Ox}n=o.bind(null,t,n,e),o=void 0,!s0||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Im(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(a===4)for(a=r.return;a!==null;){var u=a.tag;if((u===3||u===4)&&(u=a.stateNode.containerInfo,u===o||u.nodeType===8&&u.parentNode===o))return;a=a.return}for(;l!==null;){if(a=La(l),a===null)return;if(u=a.tag,u===5||u===6){r=i=a;continue e}l=l.parentNode}}r=r.return}NE(function(){var c=i,f=jx(n),d=[];e:{var h=hj.get(e);if(h!==void 0){var p=Px,m=e;switch(e){case"keypress":if(Uf(n)===0)break e;case"keydown":case"keyup":p=ZB;break;case"focusin":m="focus",p=wm;break;case"focusout":m="blur",p=wm;break;case"beforeblur":case"afterblur":p=wm;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=rS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=FB;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=t4;break;case uj:case cj:case dj:p=UB;break;case fj:p=r4;break;case"scroll":p=NB;break;case"wheel":p=i4;break;case"copy":case"cut":case"paste":p=VB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=iS}var x=(t&4)!==0,k=!x&&e==="scroll",v=x?h!==null?h+"Capture":null:h;x=[];for(var y=c,b;y!==null;){b=y;var w=b.stateNode;if(b.tag===5&&w!==null&&(b=w,v!==null&&(w=uc(y,v),w!=null&&x.push(mc(y,w,b)))),k)break;y=y.return}0<x.length&&(h=new p(h,m,null,n,f),d.push({event:h,listeners:x}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==i0&&(m=n.relatedTarget||n.fromElement)&&(La(m)||m[ci]))break e;if((p||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?La(m):null,m!==null&&(k=cs(m),m!==k||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(x=rS,w="onMouseLeave",v="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=iS,w="onPointerLeave",v="onPointerEnter",y="pointer"),k=p==null?h:Ws(p),b=m==null?h:Ws(m),h=new x(w,y+"leave",p,n,f),h.target=k,h.relatedTarget=b,w=null,La(f)===c&&(x=new x(v,y+"enter",m,n,f),x.target=b,x.relatedTarget=k,w=x),k=w,p&&m)t:{for(x=p,v=m,y=0,b=x;b;b=js(b))y++;for(b=0,w=v;w;w=js(w))b++;for(;0<y-b;)x=js(x),y--;for(;0<b-y;)v=js(v),b--;for(;y--;){if(x===v||v!==null&&x===v.alternate)break t;x=js(x),v=js(v)}x=null}else x=null;p!==null&&mS(d,h,p,x,!1),m!==null&&k!==null&&mS(d,k,m,x,!0)}}e:{if(h=c?Ws(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var E=f4;else if(lS(h))if(oj)E=m4;else{E=p4;var T=h4}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(E=g4);if(E&&(E=E(e,c))){rj(d,E,n,f);break e}T&&T(e,h,c),e==="focusout"&&(T=h._wrapperState)&&T.controlled&&h.type==="number"&&e0(h,"number",h.value)}switch(T=c?Ws(c):window,e){case"focusin":(lS(T)||T.contentEditable==="true")&&(zs=T,f0=c,$u=null);break;case"focusout":$u=f0=zs=null;break;case"mousedown":h0=!0;break;case"contextmenu":case"mouseup":case"dragend":h0=!1,hS(d,n,f);break;case"selectionchange":if(x4)break;case"keydown":case"keyup":hS(d,n,f)}var _;if(Rx)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else Hs?tj(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(ej&&n.locale!=="ko"&&(Hs||M!=="onCompositionStart"?M==="onCompositionEnd"&&Hs&&(_=JE()):(Fi=f,Ax="value"in Fi?Fi.value:Fi.textContent,Hs=!0)),T=xh(c,M),0<T.length&&(M=new oS(M,e,null,n,f),d.push({event:M,listeners:T}),_?M.data=_:(_=nj(n),_!==null&&(M.data=_)))),(_=s4?l4(e,n):u4(e,n))&&(c=xh(c,"onBeforeInput"),0<c.length&&(f=new oS("onBeforeInput","beforeinput",null,n,f),d.push({event:f,listeners:c}),f.data=_))}pj(d,t)})}function mc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function xh(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=uc(e,n),i!=null&&r.unshift(mc(e,i,o)),i=uc(e,t),i!=null&&r.push(mc(e,i,o))),e=e.return}return r}function js(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function mS(e,t,n,r,o){for(var i=t._reactName,a=[];n!==null&&n!==r;){var l=n,u=l.alternate,c=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&c!==null&&(l=c,o?(u=uc(n,i),u!=null&&a.unshift(mc(n,u,l))):o||(u=uc(n,i),u!=null&&a.push(mc(n,u,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var k4=/\r\n?/g,T4=/\u0000|\uFFFD/g;function yS(e){return(typeof e=="string"?e:""+e).replace(k4,`
|
|
56
|
+
`).replace(T4,"")}function cf(e,t,n){if(t=yS(t),yS(e)!==t&&n)throw Error(te(425))}function bh(){}var p0=null,g0=null;function m0(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var y0=typeof setTimeout=="function"?setTimeout:void 0,C4=typeof clearTimeout=="function"?clearTimeout:void 0,vS=typeof Promise=="function"?Promise:void 0,E4=typeof queueMicrotask=="function"?queueMicrotask:typeof vS<"u"?function(e){return vS.resolve(null).then(e).catch(j4)}:y0;function j4(e){setTimeout(function(){throw e})}function Dm(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),fc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);fc(t)}function Xi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function xS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Al=Math.random().toString(36).slice(2),jo="__reactFiber$"+Al,yc="__reactProps$"+Al,ci="__reactContainer$"+Al,v0="__reactEvents$"+Al,I4="__reactListeners$"+Al,D4="__reactHandles$"+Al;function La(e){var t=e[jo];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ci]||n[jo]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xS(e);e!==null;){if(n=e[jo])return n;e=xS(e)}return t}e=n,n=e.parentNode}return null}function ld(e){return e=e[jo]||e[ci],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ws(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(te(33))}function Up(e){return e[yc]||null}var x0=[],Vs=-1;function ha(e){return{current:e}}function ct(e){0>Vs||(e.current=x0[Vs],x0[Vs]=null,Vs--)}function ot(e,t){Vs++,x0[Vs]=e.current,e.current=t}var la={},Cn=ha(la),Jn=ha(!1),Qa=la;function ml(e,t){var n=e.type.contextTypes;if(!n)return la;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function er(e){return e=e.childContextTypes,e!=null}function wh(){ct(Jn),ct(Cn)}function bS(e,t,n){if(Cn.current!==la)throw Error(te(168));ot(Cn,t),ot(Jn,n)}function mj(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(te(108,hB(e)||"Unknown",o));return Ct({},n,r)}function Sh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||la,Qa=Cn.current,ot(Cn,e),ot(Jn,Jn.current),!0}function wS(e,t,n){var r=e.stateNode;if(!r)throw Error(te(169));n?(e=mj(e,t,Qa),r.__reactInternalMemoizedMergedChildContext=e,ct(Jn),ct(Cn),ot(Cn,e)):ct(Jn),ot(Jn,n)}var ti=null,Wp=!1,_m=!1;function yj(e){ti===null?ti=[e]:ti.push(e)}function _4(e){Wp=!0,yj(e)}function pa(){if(!_m&&ti!==null){_m=!0;var e=0,t=Ge;try{var n=ti;for(Ge=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ti=null,Wp=!1}catch(o){throw ti!==null&&(ti=ti.slice(e+1)),zE(Ix,pa),o}finally{Ge=t,_m=!1}}return null}var Ys=[],qs=0,kh=null,Th=0,Er=[],jr=0,Xa=null,ii=1,ai="";function ja(e,t){Ys[qs++]=Th,Ys[qs++]=kh,kh=e,Th=t}function vj(e,t,n){Er[jr++]=ii,Er[jr++]=ai,Er[jr++]=Xa,Xa=e;var r=ii;e=ai;var o=32-no(r)-1;r&=~(1<<o),n+=1;var i=32-no(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,ii=1<<32-no(t)+o|n<<o|r,ai=i+e}else ii=1<<i|n<<o|r,ai=e}function Lx(e){e.return!==null&&(ja(e,1),vj(e,1,0))}function Nx(e){for(;e===kh;)kh=Ys[--qs],Ys[qs]=null,Th=Ys[--qs],Ys[qs]=null;for(;e===Xa;)Xa=Er[--jr],Er[jr]=null,ai=Er[--jr],Er[jr]=null,ii=Er[--jr],Er[jr]=null}var cr=null,sr=null,ht=!1,Zr=null;function xj(e,t){var n=Pr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function SS(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,cr=e,sr=Xi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,cr=e,sr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Xa!==null?{id:ii,overflow:ai}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Pr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,cr=e,sr=null,!0):!1;default:return!1}}function b0(e){return(e.mode&1)!==0&&(e.flags&128)===0}function w0(e){if(ht){var t=sr;if(t){var n=t;if(!SS(e,t)){if(b0(e))throw Error(te(418));t=Xi(n.nextSibling);var r=cr;t&&SS(e,t)?xj(r,n):(e.flags=e.flags&-4097|2,ht=!1,cr=e)}}else{if(b0(e))throw Error(te(418));e.flags=e.flags&-4097|2,ht=!1,cr=e}}}function kS(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;cr=e}function df(e){if(e!==cr)return!1;if(!ht)return kS(e),ht=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!m0(e.type,e.memoizedProps)),t&&(t=sr)){if(b0(e))throw bj(),Error(te(418));for(;t;)xj(e,t),t=Xi(t.nextSibling)}if(kS(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(te(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){sr=Xi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}sr=null}}else sr=cr?Xi(e.stateNode.nextSibling):null;return!0}function bj(){for(var e=sr;e;)e=Xi(e.nextSibling)}function yl(){sr=cr=null,ht=!1}function $x(e){Zr===null?Zr=[e]:Zr.push(e)}var O4=gi.ReactCurrentBatchConfig;function Kr(e,t){if(e&&e.defaultProps){t=Ct({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Ch=ha(null),Eh=null,Gs=null,Fx=null;function Hx(){Fx=Gs=Eh=null}function zx(e){var t=Ch.current;ct(Ch),e._currentValue=t}function S0(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function il(e,t){Eh=e,Fx=Gs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xn=!0),e.firstContext=null)}function Br(e){var t=e._currentValue;if(Fx!==e)if(e={context:e,memoizedValue:t,next:null},Gs===null){if(Eh===null)throw Error(te(308));Gs=e,Eh.dependencies={lanes:0,firstContext:e}}else Gs=Gs.next=e;return t}var Na=null;function Ux(e){Na===null?Na=[e]:Na.push(e)}function wj(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ux(t)):(n.next=o.next,o.next=n),t.interleaved=n,di(e,r)}function di(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ri=!1;function Wx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Sj(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 li(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Zi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Le&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,di(e,n)}return o=r.interleaved,o===null?(t.next=t,Ux(r)):(t.next=o.next,o.next=t),r.interleaved=t,di(e,n)}function Wf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Dx(e,n)}}function TS(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function jh(e,t,n,r){var o=e.updateQueue;Ri=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var u=l,c=u.next;u.next=null,a===null?i=c:a.next=c,a=u;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==a&&(l===null?f.firstBaseUpdate=c:l.next=c,f.lastBaseUpdate=u))}if(i!==null){var d=o.baseState;a=0,f=c=u=null,l=i;do{var h=l.lane,p=l.eventTime;if((r&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,x=l;switch(h=t,p=n,x.tag){case 1:if(m=x.payload,typeof m=="function"){d=m.call(p,d,h);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=x.payload,h=typeof m=="function"?m.call(p,d,h):m,h==null)break e;d=Ct({},d,h);break e;case 2:Ri=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(c=f=p,u=d):f=f.next=p,a|=h;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;h=l,l=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(f===null&&(u=d),o.baseState=u,o.firstBaseUpdate=c,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Ja|=a,e.lanes=a,e.memoizedState=d}}function CS(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(te(191,o));o.call(r)}}}var kj=new wE.Component().refs;function k0(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ct({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vp={isMounted:function(e){return(e=e._reactInternals)?cs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Pn(),o=ea(e),i=li(r,o);i.payload=t,n!=null&&(i.callback=n),t=Zi(e,i,o),t!==null&&(ro(t,e,o,r),Wf(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Pn(),o=ea(e),i=li(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Zi(e,i,o),t!==null&&(ro(t,e,o,r),Wf(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pn(),r=ea(e),o=li(n,r);o.tag=2,t!=null&&(o.callback=t),t=Zi(e,o,r),t!==null&&(ro(t,e,r,n),Wf(t,e,r))}};function ES(e,t,n,r,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!pc(n,r)||!pc(o,i):!0}function Tj(e,t,n){var r=!1,o=la,i=t.contextType;return typeof i=="object"&&i!==null?i=Br(i):(o=er(t)?Qa:Cn.current,r=t.contextTypes,i=(r=r!=null)?ml(e,o):la),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Vp,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function jS(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Vp.enqueueReplaceState(t,t.state,null)}function T0(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=kj,Wx(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Br(i):(i=er(t)?Qa:Cn.current,o.context=ml(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(k0(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Vp.enqueueReplaceState(o,o.state,null),jh(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function du(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(te(309));var r=n.stateNode}if(!r)throw Error(te(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=o.refs;l===kj&&(l=o.refs={}),a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(te(284));if(!n._owner)throw Error(te(290,e))}return e}function ff(e,t){throw e=Object.prototype.toString.call(t),Error(te(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function IS(e){var t=e._init;return t(e._payload)}function Cj(e){function t(v,y){if(e){var b=v.deletions;b===null?(v.deletions=[y],v.flags|=16):b.push(y)}}function n(v,y){if(!e)return null;for(;y!==null;)t(v,y),y=y.sibling;return null}function r(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function o(v,y){return v=ta(v,y),v.index=0,v.sibling=null,v}function i(v,y,b){return v.index=b,e?(b=v.alternate,b!==null?(b=b.index,b<y?(v.flags|=2,y):b):(v.flags|=2,y)):(v.flags|=1048576,y)}function a(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,y,b,w){return y===null||y.tag!==6?(y=Lm(b,v.mode,w),y.return=v,y):(y=o(y,b),y.return=v,y)}function u(v,y,b,w){var E=b.type;return E===Fs?f(v,y,b.props.children,w,b.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Mi&&IS(E)===y.type)?(w=o(y,b.props),w.ref=du(v,y,b),w.return=v,w):(w=Qf(b.type,b.key,b.props,null,v.mode,w),w.ref=du(v,y,b),w.return=v,w)}function c(v,y,b,w){return y===null||y.tag!==4||y.stateNode.containerInfo!==b.containerInfo||y.stateNode.implementation!==b.implementation?(y=Nm(b,v.mode,w),y.return=v,y):(y=o(y,b.children||[]),y.return=v,y)}function f(v,y,b,w,E){return y===null||y.tag!==7?(y=Ya(b,v.mode,w,E),y.return=v,y):(y=o(y,b),y.return=v,y)}function d(v,y,b){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Lm(""+y,v.mode,b),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ef:return b=Qf(y.type,y.key,y.props,null,v.mode,b),b.ref=du(v,null,y),b.return=v,b;case $s:return y=Nm(y,v.mode,b),y.return=v,y;case Mi:var w=y._init;return d(v,w(y._payload),b)}if(Eu(y)||au(y))return y=Ya(y,v.mode,b,null),y.return=v,y;ff(v,y)}return null}function h(v,y,b,w){var E=y!==null?y.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return E!==null?null:l(v,y,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case ef:return b.key===E?u(v,y,b,w):null;case $s:return b.key===E?c(v,y,b,w):null;case Mi:return E=b._init,h(v,y,E(b._payload),w)}if(Eu(b)||au(b))return E!==null?null:f(v,y,b,w,null);ff(v,b)}return null}function p(v,y,b,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return v=v.get(b)||null,l(y,v,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ef:return v=v.get(w.key===null?b:w.key)||null,u(y,v,w,E);case $s:return v=v.get(w.key===null?b:w.key)||null,c(y,v,w,E);case Mi:var T=w._init;return p(v,y,b,T(w._payload),E)}if(Eu(w)||au(w))return v=v.get(b)||null,f(y,v,w,E,null);ff(y,w)}return null}function m(v,y,b,w){for(var E=null,T=null,_=y,M=y=0,B=null;_!==null&&M<b.length;M++){_.index>M?(B=_,_=null):B=_.sibling;var O=h(v,_,b[M],w);if(O===null){_===null&&(_=B);break}e&&_&&O.alternate===null&&t(v,_),y=i(O,y,M),T===null?E=O:T.sibling=O,T=O,_=B}if(M===b.length)return n(v,_),ht&&ja(v,M),E;if(_===null){for(;M<b.length;M++)_=d(v,b[M],w),_!==null&&(y=i(_,y,M),T===null?E=_:T.sibling=_,T=_);return ht&&ja(v,M),E}for(_=r(v,_);M<b.length;M++)B=p(_,v,M,b[M],w),B!==null&&(e&&B.alternate!==null&&_.delete(B.key===null?M:B.key),y=i(B,y,M),T===null?E=B:T.sibling=B,T=B);return e&&_.forEach(function(N){return t(v,N)}),ht&&ja(v,M),E}function x(v,y,b,w){var E=au(b);if(typeof E!="function")throw Error(te(150));if(b=E.call(b),b==null)throw Error(te(151));for(var T=E=null,_=y,M=y=0,B=null,O=b.next();_!==null&&!O.done;M++,O=b.next()){_.index>M?(B=_,_=null):B=_.sibling;var N=h(v,_,O.value,w);if(N===null){_===null&&(_=B);break}e&&_&&N.alternate===null&&t(v,_),y=i(N,y,M),T===null?E=N:T.sibling=N,T=N,_=B}if(O.done)return n(v,_),ht&&ja(v,M),E;if(_===null){for(;!O.done;M++,O=b.next())O=d(v,O.value,w),O!==null&&(y=i(O,y,M),T===null?E=O:T.sibling=O,T=O);return ht&&ja(v,M),E}for(_=r(v,_);!O.done;M++,O=b.next())O=p(_,v,M,O.value,w),O!==null&&(e&&O.alternate!==null&&_.delete(O.key===null?M:O.key),y=i(O,y,M),T===null?E=O:T.sibling=O,T=O);return e&&_.forEach(function(H){return t(v,H)}),ht&&ja(v,M),E}function k(v,y,b,w){if(typeof b=="object"&&b!==null&&b.type===Fs&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case ef:e:{for(var E=b.key,T=y;T!==null;){if(T.key===E){if(E=b.type,E===Fs){if(T.tag===7){n(v,T.sibling),y=o(T,b.props.children),y.return=v,v=y;break e}}else if(T.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Mi&&IS(E)===T.type){n(v,T.sibling),y=o(T,b.props),y.ref=du(v,T,b),y.return=v,v=y;break e}n(v,T);break}else t(v,T);T=T.sibling}b.type===Fs?(y=Ya(b.props.children,v.mode,w,b.key),y.return=v,v=y):(w=Qf(b.type,b.key,b.props,null,v.mode,w),w.ref=du(v,y,b),w.return=v,v=w)}return a(v);case $s:e:{for(T=b.key;y!==null;){if(y.key===T)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){n(v,y.sibling),y=o(y,b.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else t(v,y);y=y.sibling}y=Nm(b,v.mode,w),y.return=v,v=y}return a(v);case Mi:return T=b._init,k(v,y,T(b._payload),w)}if(Eu(b))return m(v,y,b,w);if(au(b))return x(v,y,b,w);ff(v,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(n(v,y.sibling),y=o(y,b),y.return=v,v=y):(n(v,y),y=Lm(b,v.mode,w),y.return=v,v=y),a(v)):n(v,y)}return k}var vl=Cj(!0),Ej=Cj(!1),ud={},Po=ha(ud),vc=ha(ud),xc=ha(ud);function $a(e){if(e===ud)throw Error(te(174));return e}function Vx(e,t){switch(ot(xc,t),ot(vc,e),ot(Po,ud),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:n0(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=n0(t,e)}ct(Po),ot(Po,t)}function xl(){ct(Po),ct(vc),ct(xc)}function jj(e){$a(xc.current);var t=$a(Po.current),n=n0(t,e.type);t!==n&&(ot(vc,e),ot(Po,n))}function Yx(e){vc.current===e&&(ct(Po),ct(vc))}var bt=ha(0);function Ih(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Om=[];function qx(){for(var e=0;e<Om.length;e++)Om[e]._workInProgressVersionPrimary=null;Om.length=0}var Vf=gi.ReactCurrentDispatcher,Am=gi.ReactCurrentBatchConfig,Za=0,Tt=null,Qt=null,tn=null,Dh=!1,Fu=!1,bc=0,A4=0;function vn(){throw Error(te(321))}function Gx(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!uo(e[n],t[n]))return!1;return!0}function Kx(e,t,n,r,o,i){if(Za=i,Tt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Vf.current=e===null||e.memoizedState===null?B4:L4,e=n(r,o),Fu){i=0;do{if(Fu=!1,bc=0,25<=i)throw Error(te(301));i+=1,tn=Qt=null,t.updateQueue=null,Vf.current=N4,e=n(r,o)}while(Fu)}if(Vf.current=_h,t=Qt!==null&&Qt.next!==null,Za=0,tn=Qt=Tt=null,Dh=!1,t)throw Error(te(300));return e}function Qx(){var e=bc!==0;return bc=0,e}function ko(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Tt.memoizedState=tn=e:tn=tn.next=e,tn}function Lr(){if(Qt===null){var e=Tt.alternate;e=e!==null?e.memoizedState:null}else e=Qt.next;var t=tn===null?Tt.memoizedState:tn.next;if(t!==null)tn=t,Qt=e;else{if(e===null)throw Error(te(310));Qt=e,e={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},tn===null?Tt.memoizedState=tn=e:tn=tn.next=e}return tn}function wc(e,t){return typeof t=="function"?t(e):t}function Pm(e){var t=Lr(),n=t.queue;if(n===null)throw Error(te(311));n.lastRenderedReducer=e;var r=Qt,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=a=null,u=null,c=i;do{var f=c.lane;if((Za&f)===f)u!==null&&(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 d={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(l=u=d,a=r):u=u.next=d,Tt.lanes|=f,Ja|=f}c=c.next}while(c!==null&&c!==i);u===null?a=r:u.next=l,uo(r,t.memoizedState)||(Xn=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Tt.lanes|=i,Ja|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Mm(e){var t=Lr(),n=t.queue;if(n===null)throw Error(te(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);uo(i,t.memoizedState)||(Xn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Ij(){}function Dj(e,t){var n=Tt,r=Lr(),o=t(),i=!uo(r.memoizedState,o);if(i&&(r.memoizedState=o,Xn=!0),r=r.queue,Xx(Aj.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||tn!==null&&tn.memoizedState.tag&1){if(n.flags|=2048,Sc(9,Oj.bind(null,n,r,o,t),void 0,null),nn===null)throw Error(te(349));Za&30||_j(n,t,o)}return o}function _j(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Tt.updateQueue,t===null?(t={lastEffect:null,stores:null},Tt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Oj(e,t,n,r){t.value=n,t.getSnapshot=r,Pj(t)&&Mj(e)}function Aj(e,t,n){return n(function(){Pj(t)&&Mj(e)})}function Pj(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!uo(e,n)}catch{return!0}}function Mj(e){var t=di(e,1);t!==null&&ro(t,e,1,-1)}function DS(e){var t=ko();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:wc,lastRenderedState:e},t.queue=e,e=e.dispatch=R4.bind(null,Tt,e),[t.memoizedState,e]}function Sc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Tt.updateQueue,t===null?(t={lastEffect:null,stores:null},Tt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Rj(){return Lr().memoizedState}function Yf(e,t,n,r){var o=ko();Tt.flags|=e,o.memoizedState=Sc(1|t,n,void 0,r===void 0?null:r)}function Yp(e,t,n,r){var o=Lr();r=r===void 0?null:r;var i=void 0;if(Qt!==null){var a=Qt.memoizedState;if(i=a.destroy,r!==null&&Gx(r,a.deps)){o.memoizedState=Sc(t,n,i,r);return}}Tt.flags|=e,o.memoizedState=Sc(1|t,n,i,r)}function _S(e,t){return Yf(8390656,8,e,t)}function Xx(e,t){return Yp(2048,8,e,t)}function Bj(e,t){return Yp(4,2,e,t)}function Lj(e,t){return Yp(4,4,e,t)}function Nj(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $j(e,t,n){return n=n!=null?n.concat([e]):null,Yp(4,4,Nj.bind(null,t,e),n)}function Zx(){}function Fj(e,t){var n=Lr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gx(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Hj(e,t){var n=Lr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Gx(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function zj(e,t,n){return Za&21?(uo(n,t)||(n=VE(),Tt.lanes|=n,Ja|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xn=!0),e.memoizedState=n)}function P4(e,t){var n=Ge;Ge=n!==0&&4>n?n:4,e(!0);var r=Am.transition;Am.transition={};try{e(!1),t()}finally{Ge=n,Am.transition=r}}function Uj(){return Lr().memoizedState}function M4(e,t,n){var r=ea(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wj(e))Vj(t,n);else if(n=wj(e,t,n,r),n!==null){var o=Pn();ro(n,e,r,o),Yj(n,t,r)}}function R4(e,t,n){var r=ea(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wj(e))Vj(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(o.hasEagerState=!0,o.eagerState=l,uo(l,a)){var u=t.interleaved;u===null?(o.next=o,Ux(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}n=wj(e,t,o,r),n!==null&&(o=Pn(),ro(n,e,r,o),Yj(n,t,r))}}function Wj(e){var t=e.alternate;return e===Tt||t!==null&&t===Tt}function Vj(e,t){Fu=Dh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Yj(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Dx(e,n)}}var _h={readContext:Br,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},B4={readContext:Br,useCallback:function(e,t){return ko().memoizedState=[e,t===void 0?null:t],e},useContext:Br,useEffect:_S,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Yf(4194308,4,Nj.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yf(4,2,e,t)},useMemo:function(e,t){var n=ko();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ko();return t=n!==void 0?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=M4.bind(null,Tt,e),[r.memoizedState,e]},useRef:function(e){var t=ko();return e={current:e},t.memoizedState=e},useState:DS,useDebugValue:Zx,useDeferredValue:function(e){return ko().memoizedState=e},useTransition:function(){var e=DS(!1),t=e[0];return e=P4.bind(null,e[1]),ko().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Tt,o=ko();if(ht){if(n===void 0)throw Error(te(407));n=n()}else{if(n=t(),nn===null)throw Error(te(349));Za&30||_j(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,_S(Aj.bind(null,r,i,e),[e]),r.flags|=2048,Sc(9,Oj.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=ko(),t=nn.identifierPrefix;if(ht){var n=ai,r=ii;n=(r&~(1<<32-no(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=bc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=A4++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},L4={readContext:Br,useCallback:Fj,useContext:Br,useEffect:Xx,useImperativeHandle:$j,useInsertionEffect:Bj,useLayoutEffect:Lj,useMemo:Hj,useReducer:Pm,useRef:Rj,useState:function(){return Pm(wc)},useDebugValue:Zx,useDeferredValue:function(e){var t=Lr();return zj(t,Qt.memoizedState,e)},useTransition:function(){var e=Pm(wc)[0],t=Lr().memoizedState;return[e,t]},useMutableSource:Ij,useSyncExternalStore:Dj,useId:Uj,unstable_isNewReconciler:!1},N4={readContext:Br,useCallback:Fj,useContext:Br,useEffect:Xx,useImperativeHandle:$j,useInsertionEffect:Bj,useLayoutEffect:Lj,useMemo:Hj,useReducer:Mm,useRef:Rj,useState:function(){return Mm(wc)},useDebugValue:Zx,useDeferredValue:function(e){var t=Lr();return Qt===null?t.memoizedState=e:zj(t,Qt.memoizedState,e)},useTransition:function(){var e=Mm(wc)[0],t=Lr().memoizedState;return[e,t]},useMutableSource:Ij,useSyncExternalStore:Dj,useId:Uj,unstable_isNewReconciler:!1};function bl(e,t){try{var n="",r=t;do n+=fB(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
57
|
+
Error generating stack: `+i.message+`
|
|
58
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function Rm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function C0(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var $4=typeof WeakMap=="function"?WeakMap:Map;function qj(e,t,n){n=li(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ah||(Ah=!0,R0=r),C0(e,t)},n}function Gj(e,t,n){n=li(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){C0(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){C0(e,t),typeof r!="function"&&(Ji===null?Ji=new Set([this]):Ji.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function OS(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $4;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=J4.bind(null,e,t,n),t.then(e,e))}function AS(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function PS(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=li(-1,1),t.tag=2,Zi(n,t,1))),n.lanes|=1),e)}var F4=gi.ReactCurrentOwner,Xn=!1;function jn(e,t,n,r){t.child=e===null?Ej(t,null,n,r):vl(t,e.child,n,r)}function MS(e,t,n,r,o){n=n.render;var i=t.ref;return il(t,o),r=Kx(e,t,n,r,i,o),n=Qx(),e!==null&&!Xn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,fi(e,t,o)):(ht&&n&&Lx(t),t.flags|=1,jn(e,t,r,o),t.child)}function RS(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!a1(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Kj(e,t,i,r,o)):(e=Qf(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:pc,n(a,r)&&e.ref===t.ref)return fi(e,t,o)}return t.flags|=1,e=ta(i,r),e.ref=t.ref,e.return=t,t.child=e}function Kj(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(pc(i,r)&&e.ref===t.ref)if(Xn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Xn=!0);else return t.lanes=e.lanes,fi(e,t,o)}return E0(e,t,n,r,o)}function Qj(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ot(Qs,ir),ir|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ot(Qs,ir),ir|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ot(Qs,ir),ir|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ot(Qs,ir),ir|=r;return jn(e,t,o,n),t.child}function Xj(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function E0(e,t,n,r,o){var i=er(n)?Qa:Cn.current;return i=ml(t,i),il(t,o),n=Kx(e,t,n,r,i,o),r=Qx(),e!==null&&!Xn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,fi(e,t,o)):(ht&&r&&Lx(t),t.flags|=1,jn(e,t,n,o),t.child)}function BS(e,t,n,r,o){if(er(n)){var i=!0;Sh(t)}else i=!1;if(il(t,o),t.stateNode===null)qf(e,t),Tj(t,n,r),T0(t,n,r,o),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var u=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=Br(c):(c=er(n)?Qa:Cn.current,c=ml(t,c));var f=n.getDerivedStateFromProps,d=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||u!==c)&&jS(t,a,r,c),Ri=!1;var h=t.memoizedState;a.state=h,jh(t,r,a,o),u=t.memoizedState,l!==r||h!==u||Jn.current||Ri?(typeof f=="function"&&(k0(t,n,f,r),u=t.memoizedState),(l=Ri||ES(t,n,l,r,h,u,c))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Sj(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Kr(t.type,l),a.props=c,d=t.pendingProps,h=a.context,u=n.contextType,typeof u=="object"&&u!==null?u=Br(u):(u=er(n)?Qa:Cn.current,u=ml(t,u));var p=n.getDerivedStateFromProps;(f=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==d||h!==u)&&jS(t,a,r,u),Ri=!1,h=t.memoizedState,a.state=h,jh(t,r,a,o);var m=t.memoizedState;l!==d||h!==m||Jn.current||Ri?(typeof p=="function"&&(k0(t,n,p,r),m=t.memoizedState),(c=Ri||ES(t,n,c,r,h,m,u)||!1)?(f||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,m,u),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,m,u)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),a.props=r,a.state=m,a.context=u,r=c):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return j0(e,t,n,r,i,o)}function j0(e,t,n,r,o,i){Xj(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&wS(t,n,!1),fi(e,t,i);r=t.stateNode,F4.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=vl(t,e.child,null,i),t.child=vl(t,null,l,i)):jn(e,t,l,i),t.memoizedState=r.state,o&&wS(t,n,!0),t.child}function Zj(e){var t=e.stateNode;t.pendingContext?bS(e,t.pendingContext,t.pendingContext!==t.context):t.context&&bS(e,t.context,!1),Vx(e,t.containerInfo)}function LS(e,t,n,r,o){return yl(),$x(o),t.flags|=256,jn(e,t,n,r),t.child}var I0={dehydrated:null,treeContext:null,retryLane:0};function D0(e){return{baseLanes:e,cachePool:null,transitions:null}}function Jj(e,t,n){var r=t.pendingProps,o=bt.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ot(bt,o&1),e===null)return w0(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Kp(a,r,0,null),e=Ya(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=D0(n),t.memoizedState=I0,e):Jx(t,a));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return H4(e,t,a,r,l,o,n);if(i){i=r.fallback,a=t.mode,o=e.child,l=o.sibling;var u={mode:"hidden",children:r.children};return!(a&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=ta(o,u),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=ta(l,i):(i=Ya(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?D0(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=I0,r}return i=e.child,e=i.sibling,r=ta(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Jx(e,t){return t=Kp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function hf(e,t,n,r){return r!==null&&$x(r),vl(t,e.child,null,n),e=Jx(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function H4(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=Rm(Error(te(422))),hf(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Kp({mode:"visible",children:r.children},o,0,null),i=Ya(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&vl(t,e.child,null,a),t.child.memoizedState=D0(a),t.memoizedState=I0,i);if(!(t.mode&1))return hf(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(te(419)),r=Rm(i,r,void 0),hf(e,t,a,r)}if(l=(a&e.childLanes)!==0,Xn||l){if(r=nn,r!==null){switch(a&-a){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}o=o&(r.suspendedLanes|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,di(e,o),ro(r,e,o,-1))}return i1(),r=Rm(Error(te(421))),hf(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=eL.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,sr=Xi(o.nextSibling),cr=t,ht=!0,Zr=null,e!==null&&(Er[jr++]=ii,Er[jr++]=ai,Er[jr++]=Xa,ii=e.id,ai=e.overflow,Xa=t),t=Jx(t,r.children),t.flags|=4096,t)}function NS(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),S0(e.return,t,n)}function Bm(e,t,n,r,o){var i=e.memoizedState;i===null?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 eI(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(jn(e,t,r.children,n),r=bt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&NS(e,n,t);else if(e.tag===19)NS(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ot(bt,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Ih(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Bm(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ih(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Bm(t,!0,n,null,i);break;case"together":Bm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qf(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function fi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ja|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(te(153));if(t.child!==null){for(e=t.child,n=ta(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ta(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function z4(e,t,n){switch(t.tag){case 3:Zj(t),yl();break;case 5:jj(t);break;case 1:er(t.type)&&Sh(t);break;case 4:Vx(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ot(Ch,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ot(bt,bt.current&1),t.flags|=128,null):n&t.child.childLanes?Jj(e,t,n):(ot(bt,bt.current&1),e=fi(e,t,n),e!==null?e.sibling:null);ot(bt,bt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return eI(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ot(bt,bt.current),r)break;return null;case 22:case 23:return t.lanes=0,Qj(e,t,n)}return fi(e,t,n)}var tI,_0,nI,rI;tI=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};_0=function(){};nI=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,$a(Po.current);var i=null;switch(n){case"input":o=Zy(e,o),r=Zy(e,r),i=[];break;case"select":o=Ct({},o,{value:void 0}),r=Ct({},r,{value:void 0}),i=[];break;case"textarea":o=t0(e,o),r=t0(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=bh)}r0(n,r);var a;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var l=o[c];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(sc.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var u=r[c];if(l=o?.[c],r.hasOwnProperty(c)&&u!==l&&(u!=null||l!=null))if(c==="style")if(l){for(a in l)!l.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&l[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(i||(i=[]),i.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(i=i||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(i=i||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(sc.hasOwnProperty(c)?(u!=null&&c==="onScroll"&<("scroll",e),i||l===u||(i=[])):(i=i||[]).push(c,u))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};rI=function(e,t,n,r){n!==r&&(t.flags|=4)};function fu(e,t){if(!ht)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function xn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)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 U4(e,t,n){var r=t.pendingProps;switch(Nx(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(t),null;case 1:return er(t.type)&&wh(),xn(t),null;case 3:return r=t.stateNode,xl(),ct(Jn),ct(Cn),qx(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(df(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Zr!==null&&(N0(Zr),Zr=null))),_0(e,t),xn(t),null;case 5:Yx(t);var o=$a(xc.current);if(n=t.type,e!==null&&t.stateNode!=null)nI(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(te(166));return xn(t),null}if(e=$a(Po.current),df(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[jo]=t,r[yc]=i,e=(t.mode&1)!==0,n){case"dialog":lt("cancel",r),lt("close",r);break;case"iframe":case"object":case"embed":lt("load",r);break;case"video":case"audio":for(o=0;o<Iu.length;o++)lt(Iu[o],r);break;case"source":lt("error",r);break;case"img":case"image":case"link":lt("error",r),lt("load",r);break;case"details":lt("toggle",r);break;case"input":qw(r,i),lt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},lt("invalid",r);break;case"textarea":Kw(r,i),lt("invalid",r)}r0(n,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&cf(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&cf(r.textContent,l,e),o=["children",""+l]):sc.hasOwnProperty(a)&&l!=null&&a==="onScroll"&<("scroll",r)}switch(n){case"input":tf(r),Gw(r,i,!0);break;case"textarea":tf(r),Qw(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=bh)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=_E(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[jo]=t,e[yc]=r,tI(e,t,!1,!1),t.stateNode=e;e:{switch(a=o0(n,r),n){case"dialog":lt("cancel",e),lt("close",e),o=r;break;case"iframe":case"object":case"embed":lt("load",e),o=r;break;case"video":case"audio":for(o=0;o<Iu.length;o++)lt(Iu[o],e);o=r;break;case"source":lt("error",e),o=r;break;case"img":case"image":case"link":lt("error",e),lt("load",e),o=r;break;case"details":lt("toggle",e),o=r;break;case"input":qw(e,r),o=Zy(e,r),lt("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ct({},r,{value:void 0}),lt("invalid",e);break;case"textarea":Kw(e,r),o=t0(e,r),lt("invalid",e);break;default:o=r}r0(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var u=l[i];i==="style"?PE(e,u):i==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&OE(e,u)):i==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&lc(e,u):typeof u=="number"&&lc(e,""+u):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(sc.hasOwnProperty(i)?u!=null&&i==="onScroll"&<("scroll",e):u!=null&&kx(e,i,u,a))}switch(n){case"input":tf(e),Gw(e,r,!1);break;case"textarea":tf(e),Qw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+sa(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?tl(e,!!r.multiple,i,!1):r.defaultValue!=null&&tl(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=bh)}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)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return xn(t),null;case 6:if(e&&t.stateNode!=null)rI(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(te(166));if(n=$a(xc.current),$a(Po.current),df(t)){if(r=t.stateNode,n=t.memoizedProps,r[jo]=t,(i=r.nodeValue!==n)&&(e=cr,e!==null))switch(e.tag){case 3:cf(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&cf(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[jo]=t,t.stateNode=r}return xn(t),null;case 13:if(ct(bt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ht&&sr!==null&&t.mode&1&&!(t.flags&128))bj(),yl(),t.flags|=98560,i=!1;else if(i=df(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(te(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(te(317));i[jo]=t}else yl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;xn(t),i=!1}else Zr!==null&&(N0(Zr),Zr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||bt.current&1?Xt===0&&(Xt=3):i1())),t.updateQueue!==null&&(t.flags|=4),xn(t),null);case 4:return xl(),_0(e,t),e===null&&gc(t.stateNode.containerInfo),xn(t),null;case 10:return zx(t.type._context),xn(t),null;case 17:return er(t.type)&&wh(),xn(t),null;case 19:if(ct(bt),i=t.memoizedState,i===null)return xn(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)fu(i,!1);else{if(Xt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ih(e),a!==null){for(t.flags|=128,fu(i,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ot(bt,bt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Bt()>wl&&(t.flags|=128,r=!0,fu(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ih(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ht)return xn(t),null}else 2*Bt()-i.renderingStartTime>wl&&n!==1073741824&&(t.flags|=128,r=!0,fu(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Bt(),t.sibling=null,n=bt.current,ot(bt,r?n&1|2:n&1),t):(xn(t),null);case 22:case 23:return o1(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ir&1073741824&&(xn(t),t.subtreeFlags&6&&(t.flags|=8192)):xn(t),null;case 24:return null;case 25:return null}throw Error(te(156,t.tag))}function W4(e,t){switch(Nx(t),t.tag){case 1:return er(t.type)&&wh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xl(),ct(Jn),ct(Cn),qx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Yx(t),null;case 13:if(ct(bt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));yl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ct(bt),null;case 4:return xl(),null;case 10:return zx(t.type._context),null;case 22:case 23:return o1(),null;case 24:return null;default:return null}}var pf=!1,wn=!1,V4=typeof WeakSet=="function"?WeakSet:Set,ue=null;function Ks(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Dt(e,t,r)}else n.current=null}function O0(e,t,n){try{n()}catch(r){Dt(e,t,r)}}var $S=!1;function Y4(e,t){if(p0=yh,e=sj(),Bx(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,u=-1,c=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(l=a+o),d!==i||r!==0&&d.nodeType!==3||(u=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===n&&++c===o&&(l=a),h===i&&++f===r&&(u=a),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(g0={focusedElem:e,selectionRange:n},yh=!1,ue=t;ue!==null;)if(t=ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ue=e;else for(;ue!==null;){t=ue;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var x=m.memoizedProps,k=m.memoizedState,v=t.stateNode,y=v.getSnapshotBeforeUpdate(t.elementType===t.type?x:Kr(t.type,x),k);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(w){Dt(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ue=e;break}ue=t.return}return m=$S,$S=!1,m}function Hu(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&O0(t,n,i)}o=o.next}while(o!==r)}}function qp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==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 A0(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function oI(e){var t=e.alternate;t!==null&&(e.alternate=null,oI(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jo],delete t[yc],delete t[v0],delete t[I4],delete t[D4])),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 iI(e){return e.tag===5||e.tag===3||e.tag===4}function FS(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||iI(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function P0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bh));else if(r!==4&&(e=e.child,e!==null))for(P0(e,t,n),e=e.sibling;e!==null;)P0(e,t,n),e=e.sibling}function M0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(M0(e,t,n),e=e.sibling;e!==null;)M0(e,t,n),e=e.sibling}var dn=null,Xr=!1;function Ti(e,t,n){for(n=n.child;n!==null;)aI(e,t,n),n=n.sibling}function aI(e,t,n){if(Ao&&typeof Ao.onCommitFiberUnmount=="function")try{Ao.onCommitFiberUnmount($p,n)}catch{}switch(n.tag){case 5:wn||Ks(n,t);case 6:var r=dn,o=Xr;dn=null,Ti(e,t,n),dn=r,Xr=o,dn!==null&&(Xr?(e=dn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):dn.removeChild(n.stateNode));break;case 18:dn!==null&&(Xr?(e=dn,n=n.stateNode,e.nodeType===8?Dm(e.parentNode,n):e.nodeType===1&&Dm(e,n),fc(e)):Dm(dn,n.stateNode));break;case 4:r=dn,o=Xr,dn=n.stateNode.containerInfo,Xr=!0,Ti(e,t,n),dn=r,Xr=o;break;case 0:case 11:case 14:case 15:if(!wn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&O0(n,t,a),o=o.next}while(o!==r)}Ti(e,t,n);break;case 1:if(!wn&&(Ks(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Dt(n,t,l)}Ti(e,t,n);break;case 21:Ti(e,t,n);break;case 22:n.mode&1?(wn=(r=wn)||n.memoizedState!==null,Ti(e,t,n),wn=r):Ti(e,t,n);break;default:Ti(e,t,n)}}function HS(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new V4),t.forEach(function(r){var o=tL.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Yr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:dn=l.stateNode,Xr=!1;break e;case 3:dn=l.stateNode.containerInfo,Xr=!0;break e;case 4:dn=l.stateNode.containerInfo,Xr=!0;break e}l=l.return}if(dn===null)throw Error(te(160));aI(i,a,o),dn=null,Xr=!1;var u=o.alternate;u!==null&&(u.return=null),o.return=null}catch(c){Dt(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)sI(t,e),t=t.sibling}function sI(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Yr(t,e),xo(e),r&4){try{Hu(3,e,e.return),qp(3,e)}catch(x){Dt(e,e.return,x)}try{Hu(5,e,e.return)}catch(x){Dt(e,e.return,x)}}break;case 1:Yr(t,e),xo(e),r&512&&n!==null&&Ks(n,n.return);break;case 5:if(Yr(t,e),xo(e),r&512&&n!==null&&Ks(n,n.return),e.flags&32){var o=e.stateNode;try{lc(o,"")}catch(x){Dt(e,e.return,x)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&IE(o,i),o0(l,a);var c=o0(l,i);for(a=0;a<u.length;a+=2){var f=u[a],d=u[a+1];f==="style"?PE(o,d):f==="dangerouslySetInnerHTML"?OE(o,d):f==="children"?lc(o,d):kx(o,f,d,c)}switch(l){case"input":Jy(o,i);break;case"textarea":DE(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?tl(o,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?tl(o,!!i.multiple,i.defaultValue,!0):tl(o,!!i.multiple,i.multiple?[]:"",!1))}o[yc]=i}catch(x){Dt(e,e.return,x)}}break;case 6:if(Yr(t,e),xo(e),r&4){if(e.stateNode===null)throw Error(te(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(x){Dt(e,e.return,x)}}break;case 3:if(Yr(t,e),xo(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{fc(t.containerInfo)}catch(x){Dt(e,e.return,x)}break;case 4:Yr(t,e),xo(e);break;case 13:Yr(t,e),xo(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(n1=Bt())),r&4&&HS(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(wn=(c=wn)||f,Yr(t,e),wn=c):Yr(t,e),xo(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for(ue=e,f=e.child;f!==null;){for(d=ue=f;ue!==null;){switch(h=ue,p=h.child,h.tag){case 0:case 11:case 14:case 15:Hu(4,h,h.return);break;case 1:Ks(h,h.return);var m=h.stateNode;if(typeof m.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(x){Dt(r,n,x)}}break;case 5:Ks(h,h.return);break;case 22:if(h.memoizedState!==null){US(d);continue}}p!==null?(p.return=h,ue=p):US(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{o=d.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,u=d.memoizedProps.style,a=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=AE("display",a))}catch(x){Dt(e,e.return,x)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(x){Dt(e,e.return,x)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Yr(t,e),xo(e),r&4&&HS(e);break;case 21:break;default:Yr(t,e),xo(e)}}function xo(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(iI(n)){var r=n;break e}n=n.return}throw Error(te(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(lc(o,""),r.flags&=-33);var i=FS(e);M0(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,l=FS(e);P0(e,l,a);break;default:throw Error(te(161))}}catch(u){Dt(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function q4(e,t,n){ue=e,lI(e)}function lI(e,t,n){for(var r=(e.mode&1)!==0;ue!==null;){var o=ue,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||pf;if(!a){var l=o.alternate,u=l!==null&&l.memoizedState!==null||wn;l=pf;var c=wn;if(pf=a,(wn=u)&&!c)for(ue=o;ue!==null;)a=ue,u=a.child,a.tag===22&&a.memoizedState!==null?WS(o):u!==null?(u.return=a,ue=u):WS(o);for(;i!==null;)ue=i,lI(i),i=i.sibling;ue=o,pf=l,wn=c}zS(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ue=i):zS(e)}}function zS(e){for(;ue!==null;){var t=ue;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:wn||qp(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!wn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Kr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&CS(t,i,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}CS(t,a,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;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:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var f=c.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&fc(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(te(163))}wn||t.flags&512&&A0(t)}catch(h){Dt(t,t.return,h)}}if(t===e){ue=null;break}if(n=t.sibling,n!==null){n.return=t.return,ue=n;break}ue=t.return}}function US(e){for(;ue!==null;){var t=ue;if(t===e){ue=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ue=n;break}ue=t.return}}function WS(e){for(;ue!==null;){var t=ue;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{qp(4,t)}catch(u){Dt(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(u){Dt(t,o,u)}}var i=t.return;try{A0(t)}catch(u){Dt(t,i,u)}break;case 5:var a=t.return;try{A0(t)}catch(u){Dt(t,a,u)}}}catch(u){Dt(t,t.return,u)}if(t===e){ue=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ue=l;break}ue=t.return}}var G4=Math.ceil,Oh=gi.ReactCurrentDispatcher,e1=gi.ReactCurrentOwner,Mr=gi.ReactCurrentBatchConfig,Le=0,nn=null,Vt=null,hn=0,ir=0,Qs=ha(0),Xt=0,kc=null,Ja=0,Gp=0,t1=0,zu=null,Kn=null,n1=0,wl=1/0,Zo=null,Ah=!1,R0=null,Ji=null,gf=!1,Hi=null,Ph=0,Uu=0,B0=null,Gf=-1,Kf=0;function Pn(){return Le&6?Bt():Gf!==-1?Gf:Gf=Bt()}function ea(e){return e.mode&1?Le&2&&hn!==0?hn&-hn:O4.transition!==null?(Kf===0&&(Kf=VE()),Kf):(e=Ge,e!==0||(e=window.event,e=e===void 0?16:ZE(e.type)),e):1}function ro(e,t,n,r){if(50<Uu)throw Uu=0,B0=null,Error(te(185));ad(e,n,r),(!(Le&2)||e!==nn)&&(e===nn&&(!(Le&2)&&(Gp|=n),Xt===4&&$i(e,hn)),tr(e,r),n===1&&Le===0&&!(t.mode&1)&&(wl=Bt()+500,Wp&&pa()))}function tr(e,t){var n=e.callbackNode;OB(e,t);var r=mh(e,e===nn?hn:0);if(r===0)n!==null&&Jw(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Jw(n),t===1)e.tag===0?_4(VS.bind(null,e)):yj(VS.bind(null,e)),E4(function(){!(Le&6)&&pa()}),n=null;else{switch(YE(r)){case 1:n=Ix;break;case 4:n=UE;break;case 16:n=gh;break;case 536870912:n=WE;break;default:n=gh}n=mI(n,uI.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function uI(e,t){if(Gf=-1,Kf=0,Le&6)throw Error(te(327));var n=e.callbackNode;if(al()&&e.callbackNode!==n)return null;var r=mh(e,e===nn?hn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Mh(e,r);else{t=r;var o=Le;Le|=2;var i=dI();(nn!==e||hn!==t)&&(Zo=null,wl=Bt()+500,Va(e,t));do try{X4();break}catch(l){cI(e,l)}while(!0);Hx(),Oh.current=i,Le=o,Vt!==null?t=0:(nn=null,hn=0,t=Xt)}if(t!==0){if(t===2&&(o=u0(e),o!==0&&(r=o,t=L0(e,o))),t===1)throw n=kc,Va(e,0),$i(e,r),tr(e,Bt()),n;if(t===6)$i(e,r);else{if(o=e.current.alternate,!(r&30)&&!K4(o)&&(t=Mh(e,r),t===2&&(i=u0(e),i!==0&&(r=i,t=L0(e,i))),t===1))throw n=kc,Va(e,0),$i(e,r),tr(e,Bt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(te(345));case 2:Ia(e,Kn,Zo);break;case 3:if($i(e,r),(r&130023424)===r&&(t=n1+500-Bt(),10<t)){if(mh(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Pn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=y0(Ia.bind(null,e,Kn,Zo),t);break}Ia(e,Kn,Zo);break;case 4:if($i(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-no(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=Bt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*G4(r/1960))-r,10<r){e.timeoutHandle=y0(Ia.bind(null,e,Kn,Zo),r);break}Ia(e,Kn,Zo);break;case 5:Ia(e,Kn,Zo);break;default:throw Error(te(329))}}}return tr(e,Bt()),e.callbackNode===n?uI.bind(null,e):null}function L0(e,t){var n=zu;return e.current.memoizedState.isDehydrated&&(Va(e,t).flags|=256),e=Mh(e,t),e!==2&&(t=Kn,Kn=n,t!==null&&N0(t)),e}function N0(e){Kn===null?Kn=e:Kn.push.apply(Kn,e)}function K4(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!uo(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function $i(e,t){for(t&=~t1,t&=~Gp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-no(t),r=1<<n;e[n]=-1,t&=~r}}function VS(e){if(Le&6)throw Error(te(327));al();var t=mh(e,0);if(!(t&1))return tr(e,Bt()),null;var n=Mh(e,t);if(e.tag!==0&&n===2){var r=u0(e);r!==0&&(t=r,n=L0(e,r))}if(n===1)throw n=kc,Va(e,0),$i(e,t),tr(e,Bt()),n;if(n===6)throw Error(te(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ia(e,Kn,Zo),tr(e,Bt()),null}function r1(e,t){var n=Le;Le|=1;try{return e(t)}finally{Le=n,Le===0&&(wl=Bt()+500,Wp&&pa())}}function es(e){Hi!==null&&Hi.tag===0&&!(Le&6)&&al();var t=Le;Le|=1;var n=Mr.transition,r=Ge;try{if(Mr.transition=null,Ge=1,e)return e()}finally{Ge=r,Mr.transition=n,Le=t,!(Le&6)&&pa()}}function o1(){ir=Qs.current,ct(Qs)}function Va(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,C4(n)),Vt!==null)for(n=Vt.return;n!==null;){var r=n;switch(Nx(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&wh();break;case 3:xl(),ct(Jn),ct(Cn),qx();break;case 5:Yx(r);break;case 4:xl();break;case 13:ct(bt);break;case 19:ct(bt);break;case 10:zx(r.type._context);break;case 22:case 23:o1()}n=n.return}if(nn=e,Vt=e=ta(e.current,null),hn=ir=t,Xt=0,kc=null,t1=Gp=Ja=0,Kn=zu=null,Na!==null){for(t=0;t<Na.length;t++)if(n=Na[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=o,r.next=a}n.pending=r}Na=null}return e}function cI(e,t){do{var n=Vt;try{if(Hx(),Vf.current=_h,Dh){for(var r=Tt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Dh=!1}if(Za=0,tn=Qt=Tt=null,Fu=!1,bc=0,e1.current=null,n===null||n.return===null){Xt=1,kc=t,Vt=null;break}e:{var i=e,a=n.return,l=n,u=t;if(t=hn,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,f=l,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var p=AS(a);if(p!==null){p.flags&=-257,PS(p,a,l,i,t),p.mode&1&&OS(i,c,t),t=p,u=c;var m=t.updateQueue;if(m===null){var x=new Set;x.add(u),t.updateQueue=x}else m.add(u);break e}else{if(!(t&1)){OS(i,c,t),i1();break e}u=Error(te(426))}}else if(ht&&l.mode&1){var k=AS(a);if(k!==null){!(k.flags&65536)&&(k.flags|=256),PS(k,a,l,i,t),$x(bl(u,l));break e}}i=u=bl(u,l),Xt!==4&&(Xt=2),zu===null?zu=[i]:zu.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=qj(i,u,t);TS(i,v);break e;case 1:l=u;var y=i.type,b=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ji===null||!Ji.has(b)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=Gj(i,l,t);TS(i,w);break e}}i=i.return}while(i!==null)}hI(n)}catch(E){t=E,Vt===n&&n!==null&&(Vt=n=n.return);continue}break}while(!0)}function dI(){var e=Oh.current;return Oh.current=_h,e===null?_h:e}function i1(){(Xt===0||Xt===3||Xt===2)&&(Xt=4),nn===null||!(Ja&268435455)&&!(Gp&268435455)||$i(nn,hn)}function Mh(e,t){var n=Le;Le|=2;var r=dI();(nn!==e||hn!==t)&&(Zo=null,Va(e,t));do try{Q4();break}catch(o){cI(e,o)}while(!0);if(Hx(),Le=n,Oh.current=r,Vt!==null)throw Error(te(261));return nn=null,hn=0,Xt}function Q4(){for(;Vt!==null;)fI(Vt)}function X4(){for(;Vt!==null&&!SB();)fI(Vt)}function fI(e){var t=gI(e.alternate,e,ir);e.memoizedProps=e.pendingProps,t===null?hI(e):Vt=t,e1.current=null}function hI(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=W4(n,t),n!==null){n.flags&=32767,Vt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xt=6,Vt=null;return}}else if(n=U4(n,t,ir),n!==null){Vt=n;return}if(t=t.sibling,t!==null){Vt=t;return}Vt=t=e}while(t!==null);Xt===0&&(Xt=5)}function Ia(e,t,n){var r=Ge,o=Mr.transition;try{Mr.transition=null,Ge=1,Z4(e,t,n,r)}finally{Mr.transition=o,Ge=r}return null}function Z4(e,t,n,r){do al();while(Hi!==null);if(Le&6)throw Error(te(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(te(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(AB(e,i),e===nn&&(Vt=nn=null,hn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||gf||(gf=!0,mI(gh,function(){return al(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Mr.transition,Mr.transition=null;var a=Ge;Ge=1;var l=Le;Le|=4,e1.current=null,Y4(e,n),sI(n,e),v4(g0),yh=!!p0,g0=p0=null,e.current=n,q4(n),kB(),Le=l,Ge=a,Mr.transition=i}else e.current=n;if(gf&&(gf=!1,Hi=e,Ph=o),i=e.pendingLanes,i===0&&(Ji=null),EB(n.stateNode),tr(e,Bt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Ah)throw Ah=!1,e=R0,R0=null,e;return Ph&1&&e.tag!==0&&al(),i=e.pendingLanes,i&1?e===B0?Uu++:(Uu=0,B0=e):Uu=0,pa(),null}function al(){if(Hi!==null){var e=YE(Ph),t=Mr.transition,n=Ge;try{if(Mr.transition=null,Ge=16>e?16:e,Hi===null)var r=!1;else{if(e=Hi,Hi=null,Ph=0,Le&6)throw Error(te(331));var o=Le;for(Le|=4,ue=e.current;ue!==null;){var i=ue,a=i.child;if(ue.flags&16){var l=i.deletions;if(l!==null){for(var u=0;u<l.length;u++){var c=l[u];for(ue=c;ue!==null;){var f=ue;switch(f.tag){case 0:case 11:case 15:Hu(8,f,i)}var d=f.child;if(d!==null)d.return=f,ue=d;else for(;ue!==null;){f=ue;var h=f.sibling,p=f.return;if(oI(f),f===c){ue=null;break}if(h!==null){h.return=p,ue=h;break}ue=p}}}var m=i.alternate;if(m!==null){var x=m.child;if(x!==null){m.child=null;do{var k=x.sibling;x.sibling=null,x=k}while(x!==null)}}ue=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,ue=a;else e:for(;ue!==null;){if(i=ue,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Hu(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,ue=v;break e}ue=i.return}}var y=e.current;for(ue=y;ue!==null;){a=ue;var b=a.child;if(a.subtreeFlags&2064&&b!==null)b.return=a,ue=b;else e:for(a=y;ue!==null;){if(l=ue,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:qp(9,l)}}catch(E){Dt(l,l.return,E)}if(l===a){ue=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,ue=w;break e}ue=l.return}}if(Le=o,pa(),Ao&&typeof Ao.onPostCommitFiberRoot=="function")try{Ao.onPostCommitFiberRoot($p,e)}catch{}r=!0}return r}finally{Ge=n,Mr.transition=t}}return!1}function YS(e,t,n){t=bl(n,t),t=qj(e,t,1),e=Zi(e,t,1),t=Pn(),e!==null&&(ad(e,1,t),tr(e,t))}function Dt(e,t,n){if(e.tag===3)YS(e,e,n);else for(;t!==null;){if(t.tag===3){YS(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ji===null||!Ji.has(r))){e=bl(n,e),e=Gj(t,e,1),t=Zi(t,e,1),e=Pn(),t!==null&&(ad(t,1,e),tr(t,e));break}}t=t.return}}function J4(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Pn(),e.pingedLanes|=e.suspendedLanes&n,nn===e&&(hn&n)===n&&(Xt===4||Xt===3&&(hn&130023424)===hn&&500>Bt()-n1?Va(e,0):t1|=n),tr(e,t)}function pI(e,t){t===0&&(e.mode&1?(t=of,of<<=1,!(of&130023424)&&(of=4194304)):t=1);var n=Pn();e=di(e,t),e!==null&&(ad(e,t,n),tr(e,n))}function eL(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),pI(e,n)}function tL(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(te(314))}r!==null&&r.delete(t),pI(e,n)}var gI;gI=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Jn.current)Xn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xn=!1,z4(e,t,n);Xn=!!(e.flags&131072)}else Xn=!1,ht&&t.flags&1048576&&vj(t,Th,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;qf(e,t),e=t.pendingProps;var o=ml(t,Cn.current);il(t,n),o=Kx(null,t,r,e,o,n);var i=Qx();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,er(r)?(i=!0,Sh(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Wx(t),o.updater=Vp,t.stateNode=o,o._reactInternals=t,T0(t,r,e,n),t=j0(null,t,r,!0,i,n)):(t.tag=0,ht&&i&&Lx(t),jn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(qf(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=rL(r),e=Kr(r,e),o){case 0:t=E0(null,t,r,e,n);break e;case 1:t=BS(null,t,r,e,n);break e;case 11:t=MS(null,t,r,e,n);break e;case 14:t=RS(null,t,r,Kr(r.type,e),n);break e}throw Error(te(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Kr(r,o),E0(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Kr(r,o),BS(e,t,r,o,n);case 3:e:{if(Zj(t),e===null)throw Error(te(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Sj(e,t),jh(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=bl(Error(te(423)),t),t=LS(e,t,r,n,o);break e}else if(r!==o){o=bl(Error(te(424)),t),t=LS(e,t,r,n,o);break e}else for(sr=Xi(t.stateNode.containerInfo.firstChild),cr=t,ht=!0,Zr=null,n=Ej(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yl(),r===o){t=fi(e,t,n);break e}jn(e,t,r,n)}t=t.child}return t;case 5:return jj(t),e===null&&w0(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,m0(r,o)?a=null:i!==null&&m0(r,i)&&(t.flags|=32),Xj(e,t),jn(e,t,a,n),t.child;case 6:return e===null&&w0(t),null;case 13:return Jj(e,t,n);case 4:return Vx(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=vl(t,null,r,n):jn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Kr(r,o),MS(e,t,r,o,n);case 7:return jn(e,t,t.pendingProps,n),t.child;case 8:return jn(e,t,t.pendingProps.children,n),t.child;case 12:return jn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,ot(Ch,r._currentValue),r._currentValue=a,i!==null)if(uo(i.value,a)){if(i.children===o.children&&!Jn.current){t=fi(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=li(-1,n&-n),u.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?u.next=u:(u.next=f.next,f.next=u),c.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),S0(i.return,n,t),l.lanes|=n;break}u=u.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(te(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),S0(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}jn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,il(t,n),o=Br(o),r=r(o),t.flags|=1,jn(e,t,r,n),t.child;case 14:return r=t.type,o=Kr(r,t.pendingProps),o=Kr(r.type,o),RS(e,t,r,o,n);case 15:return Kj(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Kr(r,o),qf(e,t),t.tag=1,er(r)?(e=!0,Sh(t)):e=!1,il(t,n),Tj(t,r,o),T0(t,r,o,n),j0(null,t,r,!0,e,n);case 19:return eI(e,t,n);case 22:return Qj(e,t,n)}throw Error(te(156,t.tag))};function mI(e,t){return zE(e,t)}function nL(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 Pr(e,t,n,r){return new nL(e,t,n,r)}function a1(e){return e=e.prototype,!(!e||!e.isReactComponent)}function rL(e){if(typeof e=="function")return a1(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Cx)return 11;if(e===Ex)return 14}return 2}function ta(e,t){var n=e.alternate;return n===null?(n=Pr(e.tag,t,e.key,e.mode),n.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=e.flags&14680064,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=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Qf(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")a1(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Fs:return Ya(n.children,o,i,t);case Tx:a=8,o|=8;break;case Gy:return e=Pr(12,n,t,o|2),e.elementType=Gy,e.lanes=i,e;case Ky:return e=Pr(13,n,t,o),e.elementType=Ky,e.lanes=i,e;case Qy:return e=Pr(19,n,t,o),e.elementType=Qy,e.lanes=i,e;case CE:return Kp(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case kE:a=10;break e;case TE:a=9;break e;case Cx:a=11;break e;case Ex:a=14;break e;case Mi:a=16,r=null;break e}throw Error(te(130,e==null?e:typeof e,""))}return t=Pr(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Ya(e,t,n,r){return e=Pr(7,e,r,t),e.lanes=n,e}function Kp(e,t,n,r){return e=Pr(22,e,r,t),e.elementType=CE,e.lanes=n,e.stateNode={isHidden:!1},e}function Lm(e,t,n){return e=Pr(6,e,null,t),e.lanes=n,e}function Nm(e,t,n){return t=Pr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function oL(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=vm(0),this.expirationTimes=vm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vm(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function s1(e,t,n,r,o,i,a,l,u){return e=new oL(e,t,n,l,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Pr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wx(i),e}function iL(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$s,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function yI(e){if(!e)return la;e=e._reactInternals;e:{if(cs(e)!==e||e.tag!==1)throw Error(te(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(er(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(te(171))}if(e.tag===1){var n=e.type;if(er(n))return mj(e,n,t)}return t}function vI(e,t,n,r,o,i,a,l,u){return e=s1(n,r,!0,e,o,i,a,l,u),e.context=yI(null),n=e.current,r=Pn(),o=ea(n),i=li(r,o),i.callback=t??null,Zi(n,i,o),e.current.lanes=o,ad(e,o,r),tr(e,r),e}function Qp(e,t,n,r){var o=t.current,i=Pn(),a=ea(o);return n=yI(n),t.context===null?t.context=n:t.pendingContext=n,t=li(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Zi(o,t,a),e!==null&&(ro(e,o,a,i),Wf(e,o,a)),a}function Rh(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function qS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function l1(e,t){qS(e,t),(e=e.alternate)&&qS(e,t)}function aL(){return null}var xI=typeof reportError=="function"?reportError:function(e){console.error(e)};function u1(e){this._internalRoot=e}Xp.prototype.render=u1.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(te(409));Qp(e,t,null,null)};Xp.prototype.unmount=u1.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;es(function(){Qp(null,e,null,null)}),t[ci]=null}};function Xp(e){this._internalRoot=e}Xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=KE();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ni.length&&t!==0&&t<Ni[n].priority;n++);Ni.splice(n,0,e),n===0&&XE(e)}};function c1(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function GS(){}function sL(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=Rh(a);i.call(c)}}var a=vI(t,r,e,0,null,!1,!1,"",GS);return e._reactRootContainer=a,e[ci]=a.current,gc(e.nodeType===8?e.parentNode:e),es(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var c=Rh(u);l.call(c)}}var u=s1(e,0,!1,null,null,!1,!1,"",GS);return e._reactRootContainer=u,e[ci]=u.current,gc(e.nodeType===8?e.parentNode:e),es(function(){Qp(t,u,n,r)}),u}function Jp(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var l=o;o=function(){var u=Rh(a);l.call(u)}}Qp(t,a,e,o)}else a=sL(n,t,e,o,r);return Rh(a)}qE=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ju(t.pendingLanes);n!==0&&(Dx(t,n|1),tr(t,Bt()),!(Le&6)&&(wl=Bt()+500,pa()))}break;case 13:es(function(){var r=di(e,1);if(r!==null){var o=Pn();ro(r,e,1,o)}}),l1(e,1)}};_x=function(e){if(e.tag===13){var t=di(e,134217728);if(t!==null){var n=Pn();ro(t,e,134217728,n)}l1(e,134217728)}};GE=function(e){if(e.tag===13){var t=ea(e),n=di(e,t);if(n!==null){var r=Pn();ro(n,e,t,r)}l1(e,t)}};KE=function(){return Ge};QE=function(e,t){var n=Ge;try{return Ge=e,t()}finally{Ge=n}};a0=function(e,t,n){switch(t){case"input":if(Jy(e,n),t=n.name,n.type==="radio"&&t!=null){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=Up(r);if(!o)throw Error(te(90));jE(r),Jy(r,o)}}}break;case"textarea":DE(e,n);break;case"select":t=n.value,t!=null&&tl(e,!!n.multiple,t,!1)}};BE=r1;LE=es;var lL={usingClientEntryPoint:!1,Events:[ld,Ws,Up,ME,RE,r1]},hu={findFiberByHostInstance:La,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},uL={bundleType:hu.bundleType,version:hu.version,rendererPackageName:hu.rendererPackageName,rendererConfig:hu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:gi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=FE(e),e===null?null:e.stateNode},findFiberByHostInstance:hu.findFiberByHostInstance||aL,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mf.isDisabled&&mf.supportsFiber)try{$p=mf.inject(uL),Ao=mf}catch{}}vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lL;vr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c1(t))throw Error(te(200));return iL(e,t,null,n)};vr.createRoot=function(e,t){if(!c1(e))throw Error(te(299));var n=!1,r="",o=xI;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=s1(e,1,!1,null,null,n,!1,r,o),e[ci]=t.current,gc(e.nodeType===8?e.parentNode:e),new u1(t)};vr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(te(188)):(e=Object.keys(e).join(","),Error(te(268,e)));return e=FE(t),e=e===null?null:e.stateNode,e};vr.flushSync=function(e){return es(e)};vr.hydrate=function(e,t,n){if(!Zp(t))throw Error(te(200));return Jp(null,e,t,!0,n)};vr.hydrateRoot=function(e,t,n){if(!c1(e))throw Error(te(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=xI;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=vI(t,null,e,1,n??null,o,!1,i,a),e[ci]=t.current,gc(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Xp(t)};vr.render=function(e,t,n){if(!Zp(t))throw Error(te(200));return Jp(null,e,t,!1,n)};vr.unmountComponentAtNode=function(e){if(!Zp(e))throw Error(te(40));return e._reactRootContainer?(es(function(){Jp(null,null,e,!1,function(){e._reactRootContainer=null,e[ci]=null})}),!0):!1};vr.unstable_batchedUpdates=r1;vr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Zp(n))throw Error(te(200));if(e==null||e._reactInternals===void 0)throw Error(te(38));return Jp(e,t,n,!1,r)};vr.version="18.2.0-next-9e3b772b8-20220608";function bI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bI)}catch(e){console.error(e)}}bI(),vE.exports=vr;var Pl=vE.exports;const cL=mr(Pl);RR(Pl.unstable_batchedUpdates);var wI,KS=Pl;wI=KS.createRoot,KS.hydrateRoot;function hi(e){"@babel/helpers - typeof";return hi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hi(e)}function dL(e,t){if(hi(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(hi(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SI(e){var t=dL(e,"string");return hi(t)=="symbol"?t:String(t)}function ae(e,t,n){return t=SI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function XS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QS(Object(n),!0).forEach(function(r){ae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fn(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 ZS=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),$m=function(){return Math.random().toString(36).substring(7).split("").join(".")},Bh={INIT:"@@redux/INIT"+$m(),REPLACE:"@@redux/REPLACE"+$m(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+$m()}};function fL(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function d1(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(fn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(fn(1));return n(d1)(e,t)}if(typeof e!="function")throw new Error(fn(2));var o=e,i=t,a=[],l=a,u=!1;function c(){l===a&&(l=a.slice())}function f(){if(u)throw new Error(fn(3));return i}function d(x){if(typeof x!="function")throw new Error(fn(4));if(u)throw new Error(fn(5));var k=!0;return c(),l.push(x),function(){if(k){if(u)throw new Error(fn(6));k=!1,c();var y=l.indexOf(x);l.splice(y,1),a=null}}}function h(x){if(!fL(x))throw new Error(fn(7));if(typeof x.type>"u")throw new Error(fn(8));if(u)throw new Error(fn(9));try{u=!0,i=o(i,x)}finally{u=!1}for(var k=a=l,v=0;v<k.length;v++){var y=k[v];y()}return x}function p(x){if(typeof x!="function")throw new Error(fn(10));o=x,h({type:Bh.REPLACE})}function m(){var x,k=d;return x={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(fn(11));function b(){y.next&&y.next(f())}b();var w=k(b);return{unsubscribe:w}}},x[ZS]=function(){return this},x}return h({type:Bh.INIT}),r={dispatch:h,subscribe:d,getState:f,replaceReducer:p},r[ZS]=m,r}function hL(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:Bh.INIT});if(typeof r>"u")throw new Error(fn(12));if(typeof n(void 0,{type:Bh.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(fn(13))})}function pL(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];typeof e[o]=="function"&&(n[o]=e[o])}var i=Object.keys(n),a;try{hL(n)}catch(l){a=l}return function(u,c){if(u===void 0&&(u={}),a)throw a;for(var f=!1,d={},h=0;h<i.length;h++){var p=i[h],m=n[p],x=u[p],k=m(x,c);if(typeof k>"u")throw c&&c.type,new Error(fn(14));d[p]=k,f=f||k!==x}return f=f||i.length!==Object.keys(u).length,f?d:u}}function JS(e,t){return function(){return t(e.apply(this,arguments))}}function kI(e,t){if(typeof e=="function")return JS(e,t);if(typeof e!="object"||e===null)throw new Error(fn(16));var n={};for(var r in e){var o=e[r];typeof o=="function"&&(n[r]=JS(o,t))}return n}function gL(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(r){return r}:t.length===1?t[0]:t.reduce(function(r,o){return function(){return r(o.apply(void 0,arguments))}})}function mL(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var o=r.apply(void 0,arguments),i=function(){throw new Error(fn(15))},a={getState:o.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=t.map(function(u){return u(a)});return i=gL.apply(void 0,l)(o.dispatch),XS(XS({},o),{},{dispatch:i})}}}function TI(e){var t=function(r){var o=r.dispatch,i=r.getState;return function(a){return function(l){return typeof l=="function"?l(o,i,e):a(l)}}};return t}var CI=TI();CI.withExtraArgument=TI;const yL=CI;var vL=xL;function xL(e,t){var n,r,o,i,a=0;return function(){n=this,r=arguments;var c=new Date-a;return i||(c>=t?l():i=setTimeout(l,t-c)),o};function l(){i=0,a=+new Date,o=e.apply(n,r),n=null,r=null}}const EI=mr(vL);let yf;const bL=new Uint8Array(16);function wL(){if(!yf&&(yf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!yf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return yf(bL)}const cn=[];for(let e=0;e<256;++e)cn.push((e+256).toString(16).slice(1));function SL(e,t=0){return cn[e[t+0]]+cn[e[t+1]]+cn[e[t+2]]+cn[e[t+3]]+"-"+cn[e[t+4]]+cn[e[t+5]]+"-"+cn[e[t+6]]+cn[e[t+7]]+"-"+cn[e[t+8]]+cn[e[t+9]]+"-"+cn[e[t+10]]+cn[e[t+11]]+cn[e[t+12]]+cn[e[t+13]]+cn[e[t+14]]+cn[e[t+15]]}const kL=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ek={randomUUID:kL};function oo(e,t,n){if(ek.randomUUID&&!t&&!e)return ek.randomUUID();e=e||{};const r=e.random||(e.rng||wL)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return SL(r)}const TL=function(e){console.log("[Exception]",e)},CL=function(){},EL=40;let sl=[];const Lh={url:null,openModal:null,selectedItems:null},Tc=function(e,t){Lh[e]=t,Lh.id=oo()},jL=function(e){return Lh[e]},jI=function(e){return sl.find(t=>t.id===e)},IL=function(){const e={...Lh,id:oo()};return sl.unshift(e),sl=sl.slice(0,EL),e.id},DL=function(e){sl=sl.filter(t=>t.id!==e)},Xf=new Map,Oa=new Map;let Wu=[],II=null;class _L extends Error{url;line;column;constructor(t,n,r,o,i){super(t),this.name=this.constructor.name,this.message=t,Object.defineProperty(this,"stack",{get:function(){return"extended "+this._stack},set:function(a){this._stack=a}}),this.stack=n,this.url=r,this.line=o,this.column=i}}function OL(e){if(e.type==="error"){const{id:t}=e;Xf.delete(t)}else if(e.type==="reply"){const{id:t,result:n,mutated:r,undoTag:o}=e,i=Xf.get(t);i&&(Xf.delete(t),r||DL(o),i.resolve(n))}else if(e.type==="push"){const{name:t,args:n}=e,r=Oa.get(t);if(r)for(let o=0;o<r.length&&r[o](n)!==!0;o++);}else if(!e.type.startsWith("__"))throw new Error("Unknown message type: "+JSON.stringify(e))}function AL(e,t,n){II=e,e.onmessage=r=>{const o=r.data;o.type==="connect"?(Wu.length>0&&(Wu.forEach(i=>e.postMessage(i)),Wu=null),t()):o.type==="app-init-failure"?n(o):o.type==="capture-exception"?(TL(o.stack?new _L(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.org/contact/ so we can help debug this.")):o.type==="capture-breadcrumb"?CL(o.data):OL(o)},e instanceof MessagePort&&e.start()}const PL=async function(e){return new Promise((t,n)=>AL(e,t,n))},Y=function(e,t,{catchErrors:n=!1}={}){return new Promise((r,o)=>{const i=oo();Xf.set(i,{resolve:r,reject:o});const a={id:i,name:e,args:t,undoTag:IL(),catchErrors:n};Wu?Wu.push(a):II.postMessage(a)})},Nh=function(e,t){return Y(e,t,{catchErrors:!0})},Rt=function(e,t){return Oa.get(e)||Oa.set(e,[]),Oa.get(e).push(t),()=>{const n=Oa.get(e);Oa.set(e,n.filter(r=>r!==t))}},ML=function(e){Oa.set(e,[])},f1="SET_NEW_TRANSACTIONS",DI="UPDATE_NEW_TRANSACTIONS",_I="SET_LAST_TRANSACTION",OI="MARK_ACCOUNT_READ",AI="LOAD_ACCOUNTS",PI="UPDATE_ACCOUNT",MI="LOAD_CATEGORIES",RI="LOAD_PAYEES",h1="SET_PREFS",BI="MERGE_LOCAL_PREFS",LI="MERGE_GLOBAL_PREFS",NI="SET_BUDGETS",$I="SET_REMOTE_FILES",FI="SET_ALL_FILES",p1="CLOSE_BUDGET",g1="SET_APP_STATE",HI="PUSH_MODAL",zI="REPLACE_MODAL",UI="CLOSE_MODAL",WI="COLLAPSE_MODALS",VI="POP_MODAL",YI="ADD_NOTIFICATION",qI="REMOVE_NOTIFICATION",GI="GET_USER_DATA",KI="SET_LAST_UNDO_STATE",RL="SET_LAST_SPLIT_STATE",QI="SET_ACCOUNTS_SYNCING",BL="ACCOUNT_SYNC_STATUS",m1="SIGN_OUT";function dr(e,t){return{type:HI,modal:{name:e,options:t}}}function y1(e,t){return{type:zI,modal:{name:e,options:t}}}function LL(){return{type:VI}}function cd(){return{type:UI}}function NL(e){return{type:WI,rootModalName:e}}function ua(e){return{type:YI,notification:{...e,id:e.id||oo()}}}function XI(){return ua({type:"error",message:"Something internally went wrong. You may want to restart the app if anything looks wrong. Please report this as a new issue on Github."})}function $L(e){return{type:qI,id:e}}function FL(e,t,n){return async r=>{switch(t){case"budget-amount":await Y("budget/budget-amount",{month:e,category:n.category,amount:n.amount});break;case"copy-last":await Y("budget/copy-previous-month",{month:e});break;case"set-zero":await Y("budget/set-zero",{month:e});break;case"set-3-avg":await Y("budget/set-3month-avg",{month:e});break;case"check-templates":r(ua(await Y("budget/check-templates")));break;case"apply-goal-template":await Y("budget/apply-goal-template",{month:e});break;case"overwrite-goal-template":await Y("budget/overwrite-goal-template",{month:e});break;case"cleanup-goal-template":r(ua(await Y("budget/cleanup-goal-template",{month:e})));break;case"hold":await Y("budget/hold-for-next-month",{month:e,amount:n.amount});break;case"reset-hold":await Y("budget/reset-hold",{month:e});break;case"cover":await Y("budget/cover-overspending",{month:e,to:n.to,from:n.from});break;case"transfer-available":await Y("budget/transfer-available",{month:e,amount:n.amount,category:n.category});break;case"transfer-category":await Y("budget/transfer-category",{month:e,amount:n.amount,from:n.from,to:n.to});break;case"carryover":{await Y("budget/set-carryover",{startMonth:e,category:n.category,flag:n.flag});break}case"apply-single-category-template":await Y("budget/apply-single-template",{month:e,category:n.category});break;case"set-single-3-avg":await Y("budget/set-n-month-avg",{month:e,N:3,category:n.category});break;case"set-single-6-avg":await Y("budget/set-n-month-avg",{month:e,N:6,category:n.category});break;case"set-single-12-avg":await Y("budget/set-n-month-avg",{month:e,N:12,category:n.category});break;case"copy-single-last":await Y("budget/copy-single-month",{month:e,category:n.category});break}}}function Ho(){return async e=>{const t=await Y("get-categories");return e({type:MI,categories:t}),t}}function HL(e,t,n,r){return async o=>{const i=await Y("category-create",{name:e,groupId:t,isIncome:n,hidden:r});return o(Ho()),i}}function zL(e,t){return async n=>{const{error:r}=await Y("category-delete",{id:e,transferId:t});if(r){switch(r){case"category-type":n(ua({type:"error",message:"A category must be transferred to another of the same type (expense or income)"}));break;default:n(XI())}throw new Error(r)}else n(Ho()),n(zo())}}function UL(e){return async t=>{await Y("category-update",e),t(Ho())}}function WL(e,t,n){return async r=>{await Y("category-move",{id:e,groupId:t,targetId:n}),await r(Ho())}}function VL(e,t){return async n=>{await Y("category-group-move",{id:e,targetId:t}),await n(Ho())}}function YL(e){return async t=>{const n=await Y("category-group-create",{name:e});return t(Ho()),n}}function qL(e){const{categories:t,...n}=e;return async r=>{await Y("category-group-update",n),await r(Ho())}}function GL(e,t){return async function(n){await Y("category-group-delete",{id:e,transferId:t}),await n(Ho()),await n(zo())}}function zo(){return async e=>{const t=await Y("payees-get");return e({type:RI,payees:t}),t}}function v1(){return async(e,t)=>{if(t().queries.payees.length===0)return e(zo())}}function ZI(e){return async t=>{const n=await Y("payee-create",{name:e.trim()});return t(zo()),n}}function Uo(){return async e=>{const t=await Y("accounts-get");return e({type:AI,accounts:t}),t}}function KL(e){return async t=>{t({type:PI,account:e}),await Y("account-update",e)}}function QL(e,t,n){return async r=>{const o=await Y("account-create",{name:e,balance:t,offBudget:n});return await r(Uo()),await r(zo()),o}}function XL(e){return async(t,n)=>{const{balance:r,numTransactions:o}=await Y("account-properties",{id:e}),i=n().queries.accounts.find(a=>a.id===e);t(dr("close-account",{account:i,balance:r,canDelete:o===0}))}}function JI(e,t,n,r){return async o=>{await Y("account-close",{id:e,transferAccountId:t,categoryId:n,forced:r}),o(Uo())}}function ZL(e){return async t=>{await Y("account-reopen",{id:e}),t(Uo())}}function JL(e){return JI(e,null,null,!0)}const eN=EI(()=>Y("undo"),100),tN=EI(()=>Y("redo"),100);let x1=!0;function $0(e){x1=e}function nN(){return async()=>{x1&&eN()}}function rN(){return async()=>{x1&&tN()}}function Zf(e){return{type:QI,ids:e}}function eD(e,t,n){return{type:"ACCOUNT_SYNC_STATUS",id:e,failed:!0,errorType:t,errorCode:n}}function b1(e){return{type:"ACCOUNT_SYNC_STATUS",id:e,failed:!1}}function oN(e){return async t=>{await Y("account-unlink",{id:e}),t(b1(e)),t(Uo())}}function iN(e,t,n){return async r=>{await Y("gocardless-accounts-link",{requisitionId:e,account:t,upgradingId:n}),await r(zo()),await r(Uo())}}function aN(e,t){return async n=>{await Y("simplefin-accounts-link",{externalAccount:e,upgradingId:t}),await n(zo()),await n(Uo())}}function sN(e,t,n,r){return async o=>{const i=await Y("accounts-connect",{institution:e,publicToken:t,accountIds:n,offbudgetIds:r});return await o(zo()),await o(Uo()),i}}function tD(e){return async(t,n)=>{if(n().account.accountsSyncing.length>0)return!1;const r=e?[e]:n().queries.accounts.filter(({bank:i,closed:a,tombstone:l})=>!!i&&!a&&!l).map(({id:i})=>i);t(Zf(r));let o=!1;for(let i=0;i<r.length;i++){const a=r[i],{errors:l,newTransactions:u,matchedTransactions:c,updatedAccounts:f}=await Y("gocardless-accounts-sync",{id:a}),[d]=l;d?d.type==="SyncError"&&t(eD(a,d.category,d.code)):t(b1(a)),l.forEach(h=>{h.type==="SyncError"?t(ua({type:"error",message:h.message})):t(ua({type:"error",message:h.message,internal:h.internal}))}),t({type:f1,newTransactions:u,matchedTransactions:c,updatedAccounts:f}),t(Zf(r.slice(i+1))),(u.length>0||c.length>0)&&(o=!0)}return t(Zf([])),o}}function nD(e){return{type:_I,transaction:e}}function lN(e,t){return async()=>await Y("transactions-parse-file",{filepath:e,options:t})}function uN(e,t){return async n=>{const{errors:r=[],added:o,updated:i}=await Y("transactions-import",{accountId:e,transactions:t});return r.forEach(a=>{n(ua({type:"error",message:a.message}))}),n({type:f1,newTransactions:o,matchedTransactions:i,updatedAccounts:o.length>0?[e]:[]}),o.length>0||i.length>0}}function cN(e){return{type:DI,changedId:e}}function dN(e){return{type:OI,accountId:e}}function rD(e,t){return async n=>{await Y("account-move",{id:e,targetId:t}),n(Uo())}}function dd(){return async(e,t)=>{const n=await Y("load-prefs"),r=t().prefs.local;return n&&n.id&&!r&&e(cd()),e({type:h1,prefs:n,globalPrefs:await Y("load-global-prefs")}),n}}function oD(e){return async t=>{await Y("save-prefs",e),t({type:BI,prefs:e})}}function w1(){return async(e,t)=>{const n=await Y("load-global-prefs");return e({type:h1,prefs:t().prefs.local,globalPrefs:n}),n}}function iD(e){return async t=>{await Y("save-global-prefs",e),t({type:LI,globalPrefs:e})}}function aD({reason:e,meta:t}){switch(e){case"unauthorized":return"You are not logged in.";case"encrypt-failure":return t.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.";default:return`An internal error occurred, sorry! Visit https://actualbudget.org/contact/ for support. (ref: ${e})`}}function fN({reason:e,meta:t,fileName:n}){switch(e){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! Visit https://actualbudget.org/contact/ for support.";case"decrypt-failure":return"Unable to decrypt file "+(n||"(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:const r=t&&t.fileId?`, fileId: ${t.fileId}`:"";return`Something went wrong trying to download that file, sorry! Visit https://actualbudget.org/contact/ for support. (reason: ${e}${r})`}}function hN(e){return aD(e)}function pN({reason:e}){switch(e){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! Visit https://actualbudget.org/contact/ for support."}}function gN(e,t){return e==="out-of-sync-migrations"||e==="out-of-sync-data"?"This budget cannot be loaded with this version of the app.":e==="budget-not-found"?`Budget “${t}” not found. Check the id of your budget in the Advanced section of the settings page.`:`We had an unknown problem opening “${t}”.`}function Zn(e){return{type:g1,state:e}}function mN(){return async e=>{pn.Actual.applyAppUpdate(),e(Zn({updateInfo:null}))}}function yN(e){return{type:KI,undoState:e}}function vN(e,t){return()=>Y("upload-file-web",{filename:e,contents:t})}function xN(){return()=>Y("app-focused")}function bN(){return async e=>{const t=await Y("get-budgets");e({type:NI,budgets:t})}}function wN(){return async e=>{const t=await Y("get-remote-files");e({type:$I,files:t})}}function Ml(){return async(e,t)=>{const n=await Y("get-budgets"),r=await Y("get-remote-files");return e({type:FI,budgets:n,remoteFiles:r}),t().budgets.allFiles}}function S1(e,t="",n={}){return async r=>{r(Zn({loadingText:t}));const{error:o}=await Y("load-budget",{id:e,...n});if(o){const i=gN(o,e);o==="out-of-sync-migrations"||o==="out-of-sync-data"?typeof window.confirm<"u"?window.confirm(i+" Make sure the app is up-to-date. Do you want to load a backup?")&&r(dr("load-backup",{budgetId:e})):alert(i+" Make sure the app is up-to-date."):alert(i),r(Zn({loadingText:null}));return}r(cd()),await r(dd()),r(Zn({loadingText:null}))}}function fd(){return async(e,t)=>{const n=t().prefs.local;n&&n.id&&(e({type:p1}),e(Zn({loadingText:"Closing..."})),await Y("close-budget"),e(Zn({loadingText:null})),localStorage.getItem("SharedArrayBufferOverride")&&window.location.reload())}}function SN(){return async(e,t)=>{const n=t().prefs.local;n&&n.id&&e({type:p1})}}function kN(e,t){return async n=>{await Y("delete-budget",{id:e,cloudFileId:t}),await n(Ml())}}function k1({testMode:e=!1,demoMode:t=!1}={}){return async n=>{n(Zn({loadingText:e||t?"Making demo...":""})),t?await Y("create-demo-budget"):await Y("create-budget",{testMode:e}),n(cd()),await n(Ml()),await n(dd()),n(Zn({loadingText:null}))}}function eg(e,t){return async n=>{const{error:r}=await Y("import-budget",{filepath:e,type:t});if(r)throw new Error(r);n(cd()),await n(dd()),window.__navigate("/budget")}}function TN(e){return async t=>{const{error:n}=await Y("upload-budget",{id:e});return n?{error:n}:(await t(Ml()),{})}}function CN(e){return async t=>{t(Zn({loadingText:"Downloading..."})),await t(fd()),t($h(e,{replace:!0}))}}function $h(e,{replace:t=!1}={}){return async n=>{n(Zn({loadingText:"Downloading..."}));const{id:r,error:o}=await Y("download-budget",{fileId:e,replace:t});if(o){if(o.reason==="decrypt-failure"){const i={hasExistingKey:o.meta&&o.meta.isMissingKey,cloudFileId:e,onSuccess:()=>{n($h(e,{replace:t}))}};n(dr("fix-encryption-key",i)),n(Zn({loadingText:null}))}else{if(o.reason==="file-exists")return alert(`A file with id “${o.meta.id}” already exists with the name “${o.meta.name}.” This file will be replaced. This probably happened because files were manually moved around outside of Actual.`),n($h(e,{replace:!0}));n(Zn({loadingText:null})),alert(fN(o))}return null}else await Promise.all([n(w1()),n(Ml()),n(S1(r))]),n(Zn({loadingText:null}));return r}}function EN(e,t){return async(n,r)=>{const o=r().prefs.local;o&&o.id&&await n(fd()),await Y("backup-load",{id:e,backupId:t}),n(S1(e))}}function jN(){return async(e,t)=>{const n=t().prefs.local;n&&n.id&&await Y("backup-make",{id:n.id})}}function sD(){return async e=>{const{error:t}=await Y("sync-reset");t?(alert(aD(t)),t.reason==="encrypt-failure"&&t.meta.isMissingKey||t.reason==="file-has-new-key"?e(dr("fix-encryption-key",{onSuccess:()=>{e(sD())}})):t.reason==="encrypt-failure"&&e(dr("create-encryption-key",{recreate:!0}))):(await e(Fh()),await e(dd()))}}function Fh(){return async(e,t)=>{const n=t().prefs.local;if(n&&n.id){const r=await Y("sync");return"error"in r?{error:r.error}:{}}}}function IN(e){return async t=>{const n=await t(Fh());if(n.error)return{error:n.error};const r=await t(tD(e));if(r){const o=await t(Fh());return o.error?{error:o.error}:!0}return{hasUpdated:r}}}function T1(){return async e=>{const t=await Y("subscribe-get-user");return e({type:GI,data:t}),t}}function C1(){return async e=>{await e(T1()),e(Ml())}}function DN(){return async e=>{await Y("subscribe-sign-out"),e(T1()),e(w1()),e(fd()),e({type:m1})}}const E1=Object.freeze(Object.defineProperty({__proto__:null,addGenericErrorNotification:XI,addNotification:ua,applyBudgetAction:FL,closeAccount:JI,closeAndDownloadBudget:CN,closeBudget:fd,closeBudgetUI:SN,closeModal:cd,collapseModals:NL,connectAccounts:sN,createAccount:QL,createBudget:k1,createCategory:HL,createGroup:YL,createPayee:ZI,deleteBudget:kN,deleteCategory:zL,deleteGroup:GL,downloadBudget:$h,focused:xN,forceCloseAccount:JL,getAccounts:Uo,getCategories:Ho,getPayees:zo,getUserData:T1,importBudget:eg,importTransactions:uN,initiallyLoadPayees:v1,linkAccount:iN,linkAccountSimpleFin:aN,loadAllFiles:Ml,loadBackup:EN,loadBudget:S1,loadBudgets:bN,loadGlobalPrefs:w1,loadPrefs:dd,loadRemoteFiles:wN,loggedIn:C1,makeBackup:jN,markAccountFailed:eD,markAccountRead:dN,markAccountSuccess:b1,moveAccount:rD,moveCategory:WL,moveCategoryGroup:VL,openAccountCloseModal:XL,parseTransactions:lN,popModal:LL,pushModal:dr,redo:rN,removeNotification:$L,reopenAccount:ZL,replaceModal:y1,resetSync:sD,saveGlobalPrefs:iD,savePrefs:oD,setAccountsSyncing:Zf,setAppState:Zn,setLastTransaction:nD,setLastUndoState:yN,setUndoEnabled:$0,signOut:DN,sync:Fh,syncAccounts:tD,syncAndDownload:IN,undo:nN,unlinkAccount:oN,updateAccount:KL,updateApp:mN,updateCategory:UL,updateGroup:qL,updateNewTransactions:cN,uploadBudget:TN,uploadFile:vN},Symbol.toStringTag,{value:"Module"}));function _N(e){let t=null;return(...n)=>t||(t=e.apply(null,n).finally(()=>{t=null}),t)}class or{state;constructor(t){this.state={filterExpressions:t.filterExpressions||[],selectExpressions:t.selectExpressions||[],groupExpressions:t.groupExpressions||[],orderExpressions:t.orderExpressions||[],calculation:!1,rawMode:!1,withDead:!1,validateRefs:!0,limit:null,offset:null,...t}}filter(t){return new or({...this.state,filterExpressions:[...this.state.filterExpressions,t]})}unfilter(t){const n=new Set(t);return new or({...this.state,filterExpressions:this.state.filterExpressions.filter(r=>!n.has(Object.keys(r)[0]))})}select(t=[]){Array.isArray(t)||(t=[t]);const n=new or({...this.state,selectExpressions:t});return n.state.calculation=!1,n}calculate(t){const n=this.select({result:t});return n.state.calculation=!0,n}groupBy(t){return Array.isArray(t)||(t=[t]),new or({...this.state,groupExpressions:[...this.state.groupExpressions,...t]})}orderBy(t){return Array.isArray(t)||(t=[t]),new or({...this.state,orderExpressions:[...this.state.orderExpressions,...t]})}limit(t){return new or({...this.state,limit:t})}offset(t){return new or({...this.state,offset:t})}raw(){return new or({...this.state,rawMode:!0})}withDead(){return new or({...this.state,withDead:!0})}withoutValidatedRefs(){return new or({...this.state,validateRefs:!1})}options(t){return new or({...this.state,tableOptions:t})}serialize(){return this.state}}function ON(e,t){const n=e.serialize().orderExpressions;if(n.length===0)return t?{order:"asc",...t}:null;const r=n[0];if(typeof r=="string")return{field:r,order:"asc"};const[o]=Object.keys(r);return{field:o,order:r[o]}}function pt(e){return new or({table:e})}async function ar(e){return Y("query",e.serialize())}function Cc(e,t,n){const r=new j1(e,t,n);return r.run(),r}function Obe(e,t,n){const r=new AN(e,t,n);return r.run(),r}class j1{_unsubscribe;data;dependencies;error;listeners;mappedData;mapper;onlySync;query;inflight;inflightRequestId;restart;constructor(t,n,r={}){this.error=new Error,this.query=t,this.data=null,this.mappedData=null,this.dependencies=null,this.mapper=r.mapper,this.onlySync=r.onlySync,this.listeners=[],this.inflight=!1,this.restart=!1,n&&this.addListener(n)}addListener(t){return this.listeners.push(t),()=>{this.listeners=this.listeners.filter(n=>n!==t)}}onData=(t,n)=>{for(let r=0;r<this.listeners.length;r++)this.listeners[r](t,n)};onUpdate=t=>{(this.dependencies==null||t.find(n=>this.dependencies.has(n)))&&this.run()};run=()=>(this.subscribe(),this._fetchData(()=>ar(this.query)));_fetchData=async t=>{const n=Math.random();this.inflightRequestId=n;const{data:r,dependencies:o}=await t();if(this.dependencies==null&&(this.dependencies=new Set(o)),this.inflightRequestId===n&&this._unsubscribe){const i=this.mappedData;this.data=r,this.mappedData=this.mapData(r),this.onData(this.mappedData,i),this.inflightRequestId=null}};subscribe=()=>{this._unsubscribe==null&&(this._unsubscribe=Rt("sync-event",({type:t,tables:n})=>{(this.onlySync?["success"]:["applied","success"]).indexOf(t)!==-1&&this.onUpdate(n)}))};unsubscribe=()=>{this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=null)};mapData=t=>this.mapper?this.mapper(t):t;getQuery=()=>this.query;getData=()=>this.mappedData;getNumListeners=()=>this.listeners.length;isRunning=()=>this._unsubscribe!=null;_optimisticUpdate=(t,n)=>{this.data=t(this.data),this.mappedData=n(this.mappedData)};optimisticUpdate=(t,n)=>{const r=this.mappedData;this._optimisticUpdate(t,n),this.onData(this.mappedData,r)}}class AN extends j1{done;onPageData;pageCount;runPromise;totalCount;constructor(t,n,r={}){super(t,n,r),this.totalCount=null,this.pageCount=r.pageCount||500,this.runPromise=null,this.done=!1,this.onPageData=r.onPageData||(()=>{})}_fetchCount=()=>ar(this.query.calculate({$count:"*"})).then(({data:t})=>{this.totalCount=t});run=()=>(this.subscribe(),this.runPromise=this._fetchData(async()=>(this.done=!1,this._fetchCount(),ar(this.query.limit(this.data==null?this.pageCount:Math.max(this.data.length,this.pageCount))))),this.runPromise);refetchUpToRow=async(t,n)=>(this.runPromise=this._fetchData(async()=>{this.done=!1,this._fetchCount();const r=ON(this.query,n);if(r==null)throw new Error("refetchUpToRow requires a query with orderBy");const{field:o,order:i}=r;let a=await ar(this.query.filter({id:t}).select(o));if(a.data.length===0)return;const l=a.data[0];a=await ar(this.query.filter({[o]:{[i==="asc"?"$lte":"$gte"]:l[o]}}));const u=a.data;return a=await ar(this.query.filter({[o]:{[i==="asc"?"$gt":"$lt"]:l[o]}}).limit(this.pageCount)),{data:u.concat(a.data),dependencies:a.dependencies}}),this.runPromise);_fetchNext=async()=>{for(;this.inflightRequestId;)await this.runPromise;const t=this.data;if(!this.done){const{data:n}=await ar(this.query.limit(this.pageCount).offset(t.length));if(this.inflightRequestId||t!==this.data)return this._fetchNext();if(n.length===0)this.done=!0;else{this.done=n.length<this.pageCount,this.data=this.data.concat(n);const r=this.mappedData,o=this.mapData(n);this.mappedData=this.mappedData.concat(o),this.onPageData(o),this.onData(this.mappedData,r)}}};fetchNext=_N(this._fetchNext);isFinished=()=>this.done;getTotalCount=()=>this.totalCount;optimisticUpdate=(t,n)=>{const r=this.data,o=this.mappedData;this._optimisticUpdate(t,n),this.totalCount+=this.data.length-r.length,this.onData(this.mappedData,o)}}const PN={failedAccounts:new Map,accountsSyncing:[]};function MN(e=PN,t){switch(t.type){case QI:return{...e,accountsSyncing:t.ids};case BL:{const 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}}}return e}const lD={loadingText:null,updateInfo:null,showUpdateNotification:!0,managerHasInitialized:!1,lastUndoState:{current:null},lastSplitState:{current:null}};function RN(e=lD,t){switch(t.type){case g1:return{...e,...t.state};case KI:return e.lastUndoState.current=t.undoState,e;case RL:return e.lastSplitState.current=t.splitState,e}return e}function BN(e){return e.sort((t,n)=>{const r=t.name.toLowerCase(),o=n.name.toLowerCase();let i=r<o?-1:r>o?1:0;if(i===0){const a=t.state==="remote"?t.cloudFileId:t.id,l=t.state==="remote"?t.cloudFileId:t.id;i=a<l?-1:a>l?1:0}return i}),e}function Fm(e,t){const n=new Set,r=e.map(i=>{const{cloudFileId:a,groupId:l}=i;if(a&&l){if(t==null)return{...i,cloudFileId:a,groupId:l,deleted:!1,state:"unknown"};const u=t.find(c=>i.cloudFileId===c.fileId);return u?(n.add(u.fileId),u.groupId===i.groupId?{...i,cloudFileId:a,groupId:l,name:u.name,deleted:u.deleted,encryptKeyId:u.encryptKeyId,hasKey:u.hasKey,state:"synced"}:{...i,cloudFileId:a,groupId:l,name:u.name,deleted:u.deleted,encryptKeyId:u.encryptKeyId,hasKey:u.hasKey,state:"detached"}):{...i,cloudFileId:a,groupId:l,deleted:!1,state:"broken"}}else return{...i,deleted:!1,state:"local"}}),o=BN(r.concat((t||[]).filter(i=>!n.has(i.fileId)).map(i=>({cloudFileId:i.fileId,groupId:i.groupId,name:i.name,deleted:i.deleted,encryptKeyId:i.encryptKeyId,hasKey:i.hasKey,state:"remote"}))).filter(i=>!i.deleted));return o.filter(i=>i.state!=="broken").concat(o.filter(i=>i.state==="broken"))}const LN={budgets:[],remoteFiles:null,allFiles:null};function NN(e=LN,t){switch(t.type){case NI:return{...e,budgets:t.budgets,allFiles:Fm(t.budgets,e.remoteFiles)};case $I:return{...e,remoteFiles:t.files,allFiles:Fm(e.budgets,t.files)};case FI:return{...e,budgets:t.budgets,remoteFiles:t.remoteFiles,allFiles:Fm(t.budgets,t.remoteFiles)};case m1:return{...e,allFiles:null}}return e}const tk={modalStack:[],isHidden:!1};function $N(e=tk,t){switch(t.type){case HI:return{...e,modalStack:[...e.modalStack,t.modal]};case zI:return{...e,modalStack:[t.modal]};case VI:return{...e,modalStack:e.modalStack.slice(0,-1)};case UI:return{...e,modalStack:[]};case WI:const n=e.modalStack.findIndex(r=>r.name===t.rootModalName);return{...e,modalStack:n<0?e.modalStack:e.modalStack.slice(0,n)};case g1:if("loadingText"in t.state)return{...e,isHidden:t.state.loadingText!=null};break;case m1:return tk}return e}const FN={notifications:[]};function HN(e=FN,t){switch(t.type){case YI:return e.notifications.find(n=>n.id===t.notification.id)?e:{...e,notifications:[...e.notifications,t.notification]};case qI:return{...e,notifications:e.notifications.filter(n=>n.id!==t.id)}}return e}function zN(e){return e[e.length-1]}function uD(e,t){const n={},r=Object.keys(t);let o=!1;e.id&&(n.id=e.id);for(let i=0;i<r.length;i++){const a=r[i];e[a]!==t[a]&&(n[a]=t[a],o=!0)}return o?n:null}function F0(e,t){return t=[...t],e.added&&e.added.forEach(n=>{t.push(n)}),e.updated&&e.updated.forEach(({id:n,...r})=>{const o=t.findIndex(i=>i.id===n);t[o]={...t[o],...r}}),e.deleted&&e.deleted.forEach(n=>{const r=t.findIndex(o=>n.id===o.id);r!==-1&&t.splice(r,1)}),t}function nk(e){const t=new Map;for(let n=0;n<e.length;n++){const r=e[n];t.set(r.id,r)}return t}function H0(e,t){const n=nk(e),r=nk(t),o=[],i=[],a=e.filter(l=>!r.has(l.id)).map(l=>({id:l.id}));return t.forEach(l=>{const u=n.get(l.id);if(!u)o.push(l);else{const c=uD(u,l);c&&i.push(c)}}),{added:o,updated:i,deleted:a}}function Ec(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[r.id]=r}return t}function cD(e){return e[0].toUpperCase()+e.slice(1)}const UN=[{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"},{value:"space-dot",label:"1 000.33",labelNoFraction:"1 000"},{value:"comma-dot-in",label:"1,00,000.33",labelNoFraction:"1,00,000"}];let dD={format:"comma-dot",hideFraction:!1};function rk(e){dD=e}function pi({format:e,hideFraction:t}=dD){let n,r,o;switch(e){case"space-comma":n="en-SE",r=/[^-0-9,]/g,o=",";break;case"dot-comma":n="de-DE",r=/[^-0-9,]/g,o=",";break;case"space-dot":n="dje",r=/[^-0-9.]/g,o=".";break;case"comma-dot-in":n="en-IN",r=/[^-0-9.]/g,o=".";break;case"comma-dot":default:n="en-US",r=/[^-0-9.]/g,o="."}return{value:e,separator:o,formatter:new Intl.NumberFormat(n,{minimumFractionDigits:t?0:2,maximumFractionDigits:t?0:2}),regex:r}}const I1=2**51-1,fD=-I1;function hD(e){if(!Number.isInteger(e))throw new Error("safeNumber: number is not an integer: "+JSON.stringify(e));if(e>I1||e<fD)throw new Error("safeNumber: can’t safely perform arithmetic with number: "+e);return e}function pD(e){return Sl(WN(e)||0)}function _n(e,t=pi().formatter){return t.format(hD(e)/100)}function Bi(e){return pi().formatter.format(e)}function Abe(e){return pi({hideFraction:!0}).formatter.format(e)}function D1(e){const t=parseFloat(e.replace(pi().regex,"").replace(pi().separator,"."));return isNaN(t)?null:t}function WN(e){const t=D1(e);return t==null?null:gr(t)}function VN(e){const t=parseInt(e.replace(/[^-0-9.,]/g,""));return isNaN(t)?null:t}function gr(e){return Math.round(e*100)}function Sl(e){return parseFloat((hD(e)/100).toFixed(2))}function YN(e){function t(a){if(isNaN(a))return null;const l=a*100;return l>I1||l<fD?null:a}function n(a){return a.replace(/[^0-9-]/g,"")}e.startsWith("(")&&e.endsWith(")")&&(e=e.replace("(","-").replace(")",""));const r=e.match(/[.,][^.,]{1,2}$/);if(!r||r.index===void 0||r.index===0)return t(parseFloat(n(e)));const o=n(e.slice(0,r.index)),i=n(e.slice(r.index+1));return t(parseFloat(o+"."+i))}const qN={local:null,global:null};function GN(e=qN,t){switch(t.type){case h1:return t.prefs&&rk({format:t.prefs.numberFormat||"comma-dot",hideFraction:t.prefs.hideFraction}),{local:t.prefs,global:t.globalPrefs};case BI:return(t.prefs.numberFormat||t.prefs.hideFraction!=null)&&rk({format:t.prefs.numberFormat||e.local.numberFormat,hideFraction:t.prefs.hideFraction!=null?t.prefs.hideFraction:e.local.hideFraction}),{...e,local:{...e.local,...t.prefs}};case LI:return{...e,global:{...e.global,...t.globalPrefs}}}return e}var ok=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function KN(e,t){return!!(e===t||ok(e)&&ok(t))}function QN(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!KN(e[n],t[n]))return!1;return!0}function Mn(e,t){t===void 0&&(t=QN);var n=null;function r(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];if(n&&n.lastThis===this&&t(o,n.lastArgs))return n.lastResult;var a=e.apply(this,o);return n={lastResult:a,lastArgs:o,lastThis:this},a}return r.clear=function(){n=null},r}const XN={newTransactions:[],matchedTransactions:[],lastTransaction:null,updatedAccounts:[],accounts:[],accountsLoaded:!1,categories:{grouped:[],list:[]},categoriesLoaded:!1,payees:[],payeesLoaded:!1,earliestTransaction:null};function ZN(e=XN,t){switch(t.type){case f1:return{...e,newTransactions:t.newTransactions||[],matchedTransactions:t.matchedTransactions||[],updatedAccounts:t.updatedAccounts||[]};case DI:return{...e,newTransactions:e.newTransactions.filter(n=>n!==t.changedId),matchedTransactions:e.matchedTransactions.filter(n=>n!==t.changedId)};case _I:return{...e,lastTransaction:t.transaction};case OI:return{...e,updatedAccounts:e.updatedAccounts.filter(n=>n!==t.accountId)};case AI:return{...e,accounts:t.accounts,accountsLoaded:!0};case PI:return{...e,accounts:e.accounts.map(n=>n.id===t.account.id?{...n,...t.account}:n)};case MI:return{...e,categories:t.categories,categoriesLoaded:!0};case RI:return{...e,payees:t.payees,payeesLoaded:!0}}return e}const gD=Mn(e=>Ec(e)),mD=Mn(e=>Ec(e)),JN=Mn(e=>{const t={};return e.forEach(n=>{n.categories.forEach(r=>{t[r.id]=r})}),t}),e$=Mn((e,t)=>{const n=gD(t);return e.filter(r=>{if(r.transfer_acct){const o=n[r.transfer_acct];return o!=null&&!o.closed}return!0})}),t$={data:null};function n$(e=t$,t){switch(t.type){case GI:return{...e,data:t.data}}return e}const r$={app:RN,queries:ZN,account:MN,prefs:GN,modals:$N,notifications:HN,budgets:NN,user:n$},yD=g.createContext(null),Hm={didCatch:!1,error:null};class o$ extends g.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Hm}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(Hm)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&i$(t.resetKeys,o)){var i,a;(i=(a=this.props).onReset)===null||i===void 0||i.call(a,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Hm)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:a}=this.state;let l=t;if(i){const u={error:a,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")l=n(u);else if(r)l=g.createElement(r,u);else if(o===null||g.isValidElement(o))l=o;else throw a}return g.createElement(yD.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},l)}}function i$(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function a$(e){if(e==null||typeof e.didCatch!="boolean"||typeof e.resetErrorBoundary!="function")throw new Error("ErrorBoundaryContext not found")}function s$(){const e=g.useContext(yD);a$(e);const[t,n]=g.useState({error:null,hasError:!1}),r=g.useMemo(()=>({resetBoundary:()=>{e.resetErrorBoundary(),n({error:null,hasError:!1})},showBoundary:o=>n({error:o,hasError:!0})}),[e.resetErrorBoundary]);if(t.hasError)throw t.error;return r}function z0(){return z0=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},z0.apply(this,arguments)}var vD=["shift","alt","meta","mod","ctrl"],l$={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function zi(e){return(l$[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function u$(e){return vD.includes(e)}function zm(e,t){return t===void 0&&(t=","),e.split(t)}function Um(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(a){return zi(a)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},i=r.filter(function(a){return!vD.includes(a)});return z0({},o,{keys:i,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&xD([zi(e.key),zi(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&bD([zi(e.key),zi(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Ui.clear()})})();var Ui=new Set;function _1(e){return Array.isArray(e)}function c$(e,t){t===void 0&&(t=",");var n=_1(e)?e:e.split(t);return n.every(function(r){return Ui.has(r.trim().toLowerCase())})}function xD(e){var t=Array.isArray(e)?e:[e];Ui.has("meta")&&Ui.forEach(function(n){return!u$(n)&&Ui.delete(n.toLowerCase())}),t.forEach(function(n){return Ui.add(n.toLowerCase())})}function bD(e){var t=Array.isArray(e)?e:[e];e==="meta"?Ui.clear():t.forEach(function(n){return Ui.delete(n.toLowerCase())})}function d$(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function f$(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function h$(e){return wD(e,["input","textarea","select"])}function wD(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return _1(t)?!!(r&&t&&t.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function p$(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var g$=function(t,n,r){r===void 0&&(r=!1);var o=n.alt,i=n.meta,a=n.mod,l=n.shift,u=n.ctrl,c=n.keys,f=t.key,d=t.code,h=t.ctrlKey,p=t.metaKey,m=t.shiftKey,x=t.altKey,k=zi(d),v=f.toLowerCase();if(!(c!=null&&c.includes(k))&&!(c!=null&&c.includes(v))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(k))return!1;if(!r){if(o===!x&&v!=="alt"||l===!m&&v!=="shift")return!1;if(a){if(!p&&!h)return!1}else if(i===!p&&v!=="meta"&&v!=="os"||u===!h&&v!=="ctrl"&&v!=="control")return!1}return c&&c.length===1&&(c.includes(v)||c.includes(k))?!0:c?c$(c):!c},SD=g.createContext(void 0),m$=function(){return g.useContext(SD)};function y$(e){var t=e.addHotkey,n=e.removeHotkey,r=e.children;return s.jsx(SD.Provider,{value:{addHotkey:t,removeHotkey:n},children:r})}function O1(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&O1(e[r],t[r])},!0):e===t}var kD=g.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),TD=function(){return g.useContext(kD)},v$=function(t){var n=t.initiallyActiveScopes,r=n===void 0?["*"]:n,o=t.children,i=g.useState(r?.length>0?r:["*"]),a=i[0],l=i[1],u=g.useState([]),c=u[0],f=u[1],d=g.useCallback(function(k){l(function(v){return v.includes("*")?[k]:Array.from(new Set([].concat(v,[k])))})},[]),h=g.useCallback(function(k){l(function(v){return v.filter(function(y){return y!==k}).length===0?["*"]:v.filter(function(y){return y!==k})})},[]),p=g.useCallback(function(k){l(function(v){return v.includes(k)?v.filter(function(y){return y!==k}).length===0?["*"]:v.filter(function(y){return y!==k}):v.includes("*")?[k]:Array.from(new Set([].concat(v,[k])))})},[]),m=g.useCallback(function(k){f(function(v){return[].concat(v,[k])})},[]),x=g.useCallback(function(k){f(function(v){return v.filter(function(y){return!O1(y,k)})})},[]);return s.jsx(kD.Provider,{value:{enabledScopes:a,hotkeys:c,enableScope:d,disableScope:h,toggleScope:p},children:s.jsx(y$,{addHotkey:m,removeHotkey:x,children:o})})};function x$(e){var t=g.useRef(void 0);return O1(t.current,e)||(t.current=e),t.current}var ik=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},b$=typeof window<"u"?g.useLayoutEffect:g.useEffect;function w$(e,t,n,r){var o=g.useRef(null),i=g.useRef(!1),a=n instanceof Array?r instanceof Array?void 0:r:n,l=_1(e)?e.join(a?.splitKey):e,u=n instanceof Array?n:r instanceof Array?r:void 0,c=g.useCallback(t,u??[]),f=g.useRef(c);u?f.current=c:f.current=t;var d=x$(a),h=TD(),p=h.enabledScopes,m=m$();return b$(function(){if(!(d?.enabled===!1||!p$(p,d?.scopes))){var x=function(w,E){var T;if(E===void 0&&(E=!1),!(h$(w)&&!wD(w,d?.enableOnFormTags))){if(o.current!==null){var _=o.current.getRootNode();if((_ instanceof Document||_ instanceof ShadowRoot)&&_.activeElement!==o.current&&!o.current.contains(_.activeElement)){ik(w);return}}(T=w.target)!=null&&T.isContentEditable&&!(d!=null&&d.enableOnContentEditable)||zm(l,d?.splitKey).forEach(function(M){var B,O=Um(M,d?.combinationKey);if(g$(w,O,d?.ignoreModifiers)||(B=O.keys)!=null&&B.includes("*")){if(d!=null&&d.ignoreEventWhen!=null&&d.ignoreEventWhen(w)||E&&i.current)return;if(d$(w,O,d?.preventDefault),!f$(w,O,d?.enabled)){ik(w);return}f.current(w,O),E||(i.current=!0)}})}},k=function(w){w.key!==void 0&&(xD(zi(w.code)),(d?.keydown===void 0&&d?.keyup!==!0||d!=null&&d.keydown)&&x(w))},v=function(w){w.key!==void 0&&(bD(zi(w.code)),i.current=!1,d!=null&&d.keyup&&x(w,!0))},y=o.current||a?.document||document;return y.addEventListener("keyup",v),y.addEventListener("keydown",k),m&&zm(l,d?.splitKey).forEach(function(b){return m.addHotkey(Um(b,d?.combinationKey,d?.description))}),function(){y.removeEventListener("keyup",v),y.removeEventListener("keydown",k),m&&zm(l,d?.splitKey).forEach(function(b){return m.removeHotkey(Um(b,d?.combinationKey,d?.description))})}}},[l,d,p]),o}function Ht(){const e=Ft();return g.useMemo(()=>kI(E1,e),[e])}function dt(e){const t=Ft(),n=g.useCallback(o=>{t(oD({[e]:o}))},[e,t]);return[Te(o=>o.prefs.local?.[e]),n]}async function S$(){if(!("ResizeObserver"in window)){const e=await Dl(()=>import("./resize-observer.6FaCDon1.chunk.js"),__vite__mapDeps([]));window.ResizeObserver=e.ResizeObserver}}const Hh={prefix:String(Math.round(Math.random()*1e10)),current:0},CD=$t.createContext(Hh),k$=$t.createContext(!1);let T$=!!(typeof window<"u"&&window.document&&window.document.createElement),Wm=new WeakMap;function C$(e=!1){let t=g.useContext(CD),n=g.useRef(null);if(n.current===null&&!e){var r,o;let i=(o=$t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||o===void 0||(r=o.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(i){let a=Wm.get(i);a==null?Wm.set(i,{id:t.current,state:i.memoizedState}):i.memoizedState!==a.state&&(t.current=a.id,Wm.delete(i))}n.current=++t.current}return n.current}function E$(e){let t=g.useContext(CD);t===Hh&&!T$&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let n=C$(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function j$(e){let t=$t.useId(),[n]=g.useState(ED()),r=n?"react-aria":`react-aria${Hh.prefix}`;return e||`${r}-${t}`}const I$=typeof $t.useId=="function"?j$:E$;function D$(){return!1}function _$(){return!0}function O$(e){return()=>{}}function ED(){return typeof $t.useSyncExternalStore=="function"?$t.useSyncExternalStore(O$,D$,_$):g.useContext(k$)}function jD(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=jD(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function A$(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=jD(e))&&(r&&(r+=" "),r+=t);return r}const Rl=typeof document<"u"?$t.useLayoutEffect:()=>{};function U0(e){const t=g.useRef(null);return Rl(()=>{t.current=e},[e]),g.useCallback((...n)=>{const r=t.current;return r(...n)},[])}function P$(e){let[t,n]=g.useState(e),r=g.useRef(null),o=U0(()=>{let a=r.current.next();if(a.done){r.current=null;return}t===a.value?o():n(a.value)});Rl(()=>{r.current&&o()});let i=U0(a=>{r.current=a(t),o()});return[t,i]}let M$=!!(typeof window<"u"&&window.document&&window.document.createElement),zh=new Map;function ID(e){let[t,n]=g.useState(e),r=g.useRef(null),o=I$(t),i=g.useCallback(a=>{r.current=a},[]);return M$&&zh.set(o,i),Rl(()=>{let a=o;return()=>{zh.delete(a)}},[o]),g.useEffect(()=>{let a=r.current;a&&(r.current=null,n(a))}),o}function R$(e,t){if(e===t)return e;let n=zh.get(e);if(n)return n(t),t;let r=zh.get(t);return r?(r(e),e):t}function Pbe(e=[]){let t=ID(),[n,r]=P$(t),o=g.useCallback(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return Rl(o,[t,o,...e]),n}function B$(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const L$=e=>{var t;return(t=e?.ownerDocument)!==null&&t!==void 0?t:document},Mbe=e=>e&&"window"in e&&e.window===e?e:L$(e).defaultView||window;function Rbe(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let o in r){let i=t[o],a=r[o];typeof i=="function"&&typeof a=="function"&&o[0]==="o"&&o[1]==="n"&&o.charCodeAt(2)>=65&&o.charCodeAt(2)<=90?t[o]=B$(i,a):(o==="className"||o==="UNSAFE_className")&&typeof i=="string"&&typeof a=="string"?t[o]=A$(i,a):o==="id"&&i&&a?t.id=R$(i,a):t[o]=a!==void 0?a:i}}return t}const N$=new Set(["id"]),$$=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),F$=new Set(["href","target","rel","download","ping","referrerPolicy"]),H$=/^(data-.*)$/;function Bbe(e,t={}){let{labelable:n,isLink:r,propNames:o}=t,i={};for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(N$.has(a)||n&&$$.has(a)||r&&F$.has(a)||o?.has(a)||H$.test(a))&&(i[a]=e[a]);return i}function z$(e){if(U$())e.focus({preventScroll:!0});else{let t=W$(e);e.focus(),V$(t)}}let vf=null;function U$(){if(vf==null){vf=!1;try{var e=document.createElement("div");e.focus({get preventScroll(){return vf=!0,!0}})}catch{}}return vf}function W$(e){for(var t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;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;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function V$(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function tg(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function A1(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Uh(){return A1(/^Mac/i)}function Y$(){return A1(/^iPhone/i)}function DD(){return A1(/^iPad/i)||Uh()&&navigator.maxTouchPoints>1}function q$(){return Y$()||DD()}function Lbe(){return Uh()||q$()}function G$(){return tg(/AppleWebKit/i)&&!K$()}function K$(){return tg(/Chrome/i)}function _D(){return tg(/Android/i)}function Q$(){return tg(/Firefox/i)}const X$=g.createContext({isNative:!0,open:J$});function Nbe(){return g.useContext(X$)}function Wh(e,t,n=!0){var r,o;let{metaKey:i,ctrlKey:a,altKey:l,shiftKey:u}=t;Q$()&&(!((o=window.event)===null||o===void 0||(r=o.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(Uh()?i=!0:a=!0);let c=G$()&&Uh()&&!DD()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:i,ctrlKey:a,altKey:l,shiftKey:u}):new MouseEvent("click",{metaKey:i,ctrlKey:a,altKey:l,shiftKey:u,bubbles:!0,cancelable:!0});Wh.isOpening=n,z$(e),e.dispatchEvent(c),Wh.isOpening=!1}Wh.isOpening=!1;function Z$(e,t){if(e instanceof HTMLAnchorElement)t(e);else if(e.hasAttribute("data-href")){let n=document.createElement("a");n.href=e.getAttribute("data-href"),e.hasAttribute("data-target")&&(n.target=e.getAttribute("data-target")),e.hasAttribute("data-rel")&&(n.rel=e.getAttribute("data-rel")),e.hasAttribute("data-download")&&(n.download=e.getAttribute("data-download")),e.hasAttribute("data-ping")&&(n.ping=e.getAttribute("data-ping")),e.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=e.getAttribute("data-referrer-policy")),e.appendChild(n),t(n),e.removeChild(n)}}function J$(e,t){Z$(e,n=>Wh(n,t))}let Rs=new Map,W0=new Set;function ak(){if(typeof window>"u")return;let e=n=>{let r=Rs.get(n.target);r||(r=new Set,Rs.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{let r=Rs.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Rs.delete(n.target)),Rs.size===0)){for(let o of W0)o();W0.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?ak():document.addEventListener("DOMContentLoaded",ak));function $be(e){requestAnimationFrame(()=>{Rs.size===0?e():W0.add(e)})}function Fbe(){let e=g.useRef(new Map),t=g.useCallback((o,i,a,l)=>{let u=l?.once?(...c)=>{e.current.delete(a),a(...c)}:a;e.current.set(a,{type:i,eventTarget:o,fn:u,options:l}),o.addEventListener(i,a,l)},[]),n=g.useCallback((o,i,a,l)=>{var u;let c=((u=e.current.get(a))===null||u===void 0?void 0:u.fn)||a;o.removeEventListener(i,c,l),e.current.delete(a)},[]),r=g.useCallback(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return g.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Hbe(e,t){let{id:n,"aria-label":r,"aria-labelledby":o}=e;return n=ID(n),o&&r?o=[...new Set([n,...o.trim().split(/\s+/)])].join(" "):o&&(o=o.trim().split(/\s+/).join(" ")),!r&&!o&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":o}}function zbe(e,t){Rl(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref.current=null}})}function sk(e,t){for(lk(e,t)&&(e=e.parentElement);e&&!lk(e,t);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function lk(e,t){let n=window.getComputedStyle(e),r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&t&&(r=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),r}let Eo=typeof document<"u"&&window.visualViewport;function eF(){let e=ED(),[t,n]=g.useState(()=>e?{width:0,height:0}:uk());return g.useEffect(()=>{let r=()=>{n(o=>{let i=uk();return i.width===o.width&&i.height===o.height?o:i})};return Eo?Eo.addEventListener("resize",r):window.addEventListener("resize",r),()=>{Eo?Eo.removeEventListener("resize",r):window.removeEventListener("resize",r)}},[]),t}function uk(){return{width:Eo?.width||window.innerWidth,height:Eo?.height||window.innerHeight}}let tF=0;const Vm=new Map;function Ube(e){let[t,n]=g.useState(void 0);return Rl(()=>{if(!e)return;let r=Vm.get(e);if(r)n(r.element.id);else{let o=`react-aria-description-${tF++}`;n(o);let i=document.createElement("div");i.id=o,i.style.display="none",i.textContent=e,document.body.appendChild(i),r={refCount:0,element:i},Vm.set(e,r)}return r.refCount++,()=>{--r.refCount===0&&(r.element.remove(),Vm.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function Wbe(e,t,n,r){let o=U0(n),i=n==null;g.useEffect(()=>{if(i)return;let a=e.current;return a.addEventListener(t,o,r),()=>{a.removeEventListener(t,o,r)}},[e,t,r,i,o])}function nF(e,t){let n=ck(e,t,"left"),r=ck(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight,a=e.scrollLeft,l=e.scrollTop,{borderTopWidth:u,borderLeftWidth:c}=getComputedStyle(e),f=e.scrollLeft+parseInt(c,10),d=e.scrollTop+parseInt(u,10),h=f+e.clientWidth,p=d+e.clientHeight;n<=a?a=n-parseInt(c,10):n+o>h&&(a+=n+o-h),r<=d?l=r-parseInt(u,10):r+i>p&&(l+=r+i-p),e.scrollLeft=a,e.scrollTop=l}function ck(e,t,n){const r=n==="left"?"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}function Vbe(e,t){if(document.contains(e)){let a=document.scrollingElement||document.documentElement;if(window.getComputedStyle(a).overflow==="hidden"){let u=sk(e);for(;e&&u&&e!==a&&u!==a;)nF(u,e),e=u,u=sk(e)}else{var n;let{left:u,top:c}=e.getBoundingClientRect();e==null||(n=e.scrollIntoView)===null||n===void 0||n.call(e,{block:"nearest"});let{left:f,top:d}=e.getBoundingClientRect();if(Math.abs(u-f)>1||Math.abs(c-d)>1){var r,o,i;t==null||(o=t.containingElement)===null||o===void 0||(r=o.scrollIntoView)===null||r===void 0||r.call(o,{block:"center",inline:"center"}),(i=e.scrollIntoView)===null||i===void 0||i.call(e,{block:"nearest"})}}}}function Ybe(e){return e.mozInputSource===0&&e.isTrusted?!0:_D()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function qbe(e){return!_D()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"}var dk;(function(e){e.small="small",e.medium="medium",e.wide="wide"})(dk||(dk={}));const Oi={small:512,medium:730,wide:1100},fr=Object.entries(Oi).reduce((e,[t,n])=>({...e,[`breakpoint_${t}`]:`${n}px`}),{}),OD=g.createContext(null);function rF(e){eF();const t=document.documentElement.clientHeight,n=document.documentElement.clientWidth,r={atLeastMediumWidth:n>=Oi.medium,isNarrowWidth:n<Oi.small,isSmallWidth:n>=Oi.small&&n<Oi.medium,isMediumWidth:n>=Oi.medium&&n<Oi.wide,isWideWidth:n>=Oi.wide,height:t,width:n};return s.jsx(OD.Provider,{value:r,children:e.children})}function zt(){return g.useContext(OD)}const oF="#733309",iF="#87540d",aF="#B88115",sF="#E6BB20",lF="#F5E35D",uF="#FCF088",cF="#FFF7C4",dF="#FFFBEA",fF="#610316",hF="#8A041A",pF="#AB091E",gF="#E12D39",mF="#F86A6A",yF="#FF9B9B",vF="#FFBDBD",xF="#FFE3E3",bF="#034388",wF="#0B5FA3",SF="#1980D4",kF="#2B8FED",TF="#40A5F7",CF="#66B5FA",EF="#8BCAFD",jF="#B3D9FF",IF="#102A43",DF="#243B53",_F="#334E68",OF="#486581",AF="#627D98",PF="#829AB1",MF="#9FB3C8",RF="#BCCCDC",BF="#D9E2EC",LF="#E8ECF0",NF="#F7FAFC",$F="#014D40",FF="#0C6B58",HF="#147D64",zF="#199473",UF="#27AB83",WF="#3EBD93",VF="#65D6AD",YF="#8EEDC7",qF="#C6F7E2",GF="#EFFCF6",KF="#580A94",QF="#690CB0",XF="#7A0ECC",ZF="#8719E0",JF="#9446ED",e6="#A368FC",t6="#B990FF",n6="#DAC4FF",r6="#F2EBFE";var re={};/*
|
|
59
|
+
object-assign
|
|
60
|
+
(c) Sindre Sorhus
|
|
61
|
+
@license MIT
|
|
62
|
+
*/var fk=Object.getOwnPropertySymbols,o6=Object.prototype.hasOwnProperty,i6=Object.prototype.propertyIsEnumerable;function a6(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function s6(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var P1=s6()?Object.assign:function(e,t){for(var n,r=a6(e),o,i=1;i<arguments.length;i++){n=Object(arguments[i]);for(var a in n)o6.call(n,a)&&(r[a]=n[a]);if(fk){o=fk(n);for(var l=0;l<o.length;l++)i6.call(n,o[l])&&(r[o[l]]=n[o[l]])}}return r},M1={};Object.defineProperty(M1,"__esModule",{value:!0});M1.StyleSheet=AD;var l6=P1,u6=c6(l6);function c6(e){return e&&e.__esModule?e:{default:e}}function d6(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)}function Ym(e){return e[e.length-1]}function hk(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 Aa=typeof window<"u",f6=!1,h6=function(){if(Aa){var e=document.createElement("div");return e.innerHTML="<!--[if lt IE 10]><i></i><![endif]-->",e.getElementsByTagName("i").length===1}}();function pk(){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 AD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.speedy,n=t===void 0?!f6:t,r=e.maxLength,o=r===void 0?Aa&&h6?4e3:65e3:r;this.isSpeedy=n,this.sheet=void 0,this.tags=[],this.maxLength=o,this.ctr=0}(0,u6.default)(AD.prototype,{getSheet:function(){return hk(Ym(this.tags))},inject:function(){var t=this;if(this.injected)throw new Error("already injected stylesheet!");Aa?this.tags[0]=pk():this.sheet={cssRules:[],insertRule:function(r){t.sheet.cssRules.push({cssText:r})}},this.injected=!0},speedy:function(t){if(this.ctr!==0)throw new Error("cannot change speedy mode after inserting any rule to sheet. Either call speedy("+t+") earlier in your app, or call flush() before speedy("+t+")");this.isSpeedy=!!t},_insert:function(t){try{var n=this.getSheet();n.insertRule(t,t.indexOf("@import")!==-1?0:n.cssRules.length)}catch{}},insert:function(t){if(Aa)if(this.isSpeedy&&this.getSheet().insertRule)this._insert(t);else if(t.indexOf("@import")!==-1){var n=Ym(this.tags);n.insertBefore(document.createTextNode(t),n.firstChild)}else Ym(this.tags).appendChild(document.createTextNode(t));else this.sheet.insertRule(t,t.indexOf("@import")!==-1?0:this.sheet.cssRules.length);return this.ctr++,Aa&&this.ctr%this.maxLength===0&&this.tags.push(pk()),this.ctr-1},delete:function(t){return this.replace(t,"")},flush:function(){Aa?(this.tags.forEach(function(t){return t.parentNode.removeChild(t)}),this.tags=[],this.sheet=null,this.ctr=0):this.sheet.cssRules=[],this.injected=!1},rules:function(){if(!Aa)return this.sheet.cssRules;var t=[];return this.tags.forEach(function(n){return t.splice.apply(t,[t.length,0].concat(d6(Array.from(hk(n).cssRules))))}),t}});var Bl={},p6=/-(.)/g;function g6(e){return e.replace(p6,function(t,n){return n.toUpperCase()})}var m6=g6,y6=m6,v6=/^-ms-/;function x6(e){return y6(e.replace(v6,"ms-"))}var b6=x6,R1={},B1={};Object.defineProperty(B1,"__esModule",{value:!0});var Jf={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};function w6(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var S6=["Webkit","ms","Moz","O"];Object.keys(Jf).forEach(function(e){S6.forEach(function(t){Jf[w6(t,e)]=Jf[e]})});var k6={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}},T6={isUnitlessNumber:Jf,shorthandPropertyExpansions:k6};B1.default=T6;function ng(e){return function(){return e}}var ds=function(){};ds.thatReturns=ng;ds.thatReturnsFalse=ng(!1);ds.thatReturnsTrue=ng(!0);ds.thatReturnsNull=ng(null);ds.thatReturnsThis=function(){return this};ds.thatReturnsArgument=function(e){return e};var C6=ds,E6=C6,j6=E6,PD=j6;Object.defineProperty(R1,"__esModule",{value:!0});var I6=B1,D6=MD(I6),_6=PD;MD(_6);function MD(e){return e&&e.__esModule?e:{default:e}}var gk=D6.default.isUnitlessNumber;function O6(e,t,n){var r=t==null||typeof t=="boolean"||t==="";if(r)return"";var o=isNaN(t);return o||t===0||gk.hasOwnProperty(e)&&gk[e]?""+t:(typeof t=="string"&&(t=t.trim()),t+"px")}R1.default=O6;var A6=/([A-Z])/g;function P6(e){return e.replace(A6,"-$1").toLowerCase()}var M6=P6,R6=M6,B6=/^ms-/;function L6(e){return R6(e).replace(B6,"-ms-")}var N6=L6;function $6(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}var F6=$6;Object.defineProperty(Bl,"__esModule",{value:!0});Bl.processStyleName=void 0;Bl.createMarkupForStyles=Q6;var H6=b6;hd(H6);var z6=R1,U6=hd(z6),W6=N6,V6=hd(W6),Y6=F6,q6=hd(Y6),G6=PD;hd(G6);function hd(e){return e&&e.__esModule?e:{default:e}}var K6=Bl.processStyleName=(0,q6.default)(V6.default);function Q6(e,t){var n="";for(var r in e){var o=r.indexOf("--")===0;if(e.hasOwnProperty(r)&&r!=="label"){var i=e[r];i!=null&&(o?n+=r+":"+i+";":(n+=K6(r)+":",n+=(0,U6.default)(r,i,t)+";"))}}return n||null}var L1={};Object.defineProperty(L1,"__esModule",{value:!0});var RD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};L1.default=N1;function X6(e){return e==null||e===!1||(typeof e>"u"?"undefined":RD(e))==="object"&&Object.keys(e).length===0}function Z6(e){if(X6(e))return null;if((typeof e>"u"?"undefined":RD(e))!=="object")return e;for(var t={},n=Object.keys(e),r=!1,o=0;o<n.length;o++){var i=e[n[o]],a=N1(i);(a===null||a!==i)&&(r=!0),a!==null&&(t[n[o]]=a)}return Object.keys(t).length===0?null:r?t:e}function J6(e){var t=!1,n=[];return e.forEach(function(r){var o=N1(r);(o===null||o!==r)&&(t=!0),o!==null&&n.push(o)}),n.length==0?null:t?n:e}function N1(e){return Array.isArray(e)?J6(e):Z6(e)}var Ll={},$1={},V0={exports:{}};(function(e,t){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})(V0,V0.exports);var e7=V0.exports,Y0={exports:{}},q0={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r){return r.charAt(0).toUpperCase()+r.slice(1)}e.exports=t.default})(q0,q0.exports);var BD=q0.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=BD,r=o(n);function o(a){return a&&a.__esModule?a:{default:a}}function i(a,l,u){if(a.hasOwnProperty(l))for(var c=a[l],f=0,d=c.length;f<d;++f)u[c[f]+(0,r.default)(l)]=u[l]}e.exports=t.default})(Y0,Y0.exports);var t7=Y0.exports,G0={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r,o,i,a,l){for(var u=0,c=r.length;u<c;++u){var f=r[u](o,i,a,l);if(f)return f}}e.exports=t.default})(G0,G0.exports);var n7=G0.exports,K0={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var n=["-webkit-","-moz-",""],r={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};function o(i,a){if(i==="cursor"&&r.hasOwnProperty(a))return n.map(function(l){return l+a})}e.exports=t.default})(K0,K0.exports);var r7=K0.exports,Q0={exports:{}},X0={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var n=/-webkit-|-moz-|-ms-/;function r(o){return typeof o=="string"&&n.test(o)}e.exports=t.default})(X0,X0.exports);var pd=X0.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=pd,r=o(n);function o(l){return l&&l.__esModule?l:{default:l}}var i=["-webkit-",""];function a(l,u){if(typeof u=="string"&&!(0,r.default)(u)&&u.indexOf("cross-fade(")>-1)return i.map(function(c){return u.replace(/cross-fade\(/g,c+"cross-fade(")})}e.exports=t.default})(Q0,Q0.exports);var o7=Q0.exports,Z0={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=pd,r=o(n);function o(l){return l&&l.__esModule?l:{default:l}}var i=["-webkit-",""];function a(l,u){if(typeof u=="string"&&!(0,r.default)(u)&&u.indexOf("filter(")>-1)return i.map(function(c){return u.replace(/filter\(/g,c+"filter(")})}e.exports=t.default})(Z0,Z0.exports);var i7=Z0.exports,J0={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;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"]};function r(o,i){if(o==="display"&&n.hasOwnProperty(i))return n[i]}e.exports=t.default})(J0,J0.exports);var a7=J0.exports,ev={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;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"};function o(i,a,l){i==="flexDirection"&&typeof a=="string"&&(a.indexOf("column")>-1?l.WebkitBoxOrient="vertical":l.WebkitBoxOrient="horizontal",a.indexOf("reverse")>-1?l.WebkitBoxDirection="reverse":l.WebkitBoxDirection="normal"),r.hasOwnProperty(i)&&(l[r[i]]=n[a]||a)}e.exports=t.default})(ev,ev.exports);var s7=ev.exports,tv={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var n=pd,r=o(n);function o(u){return u&&u.__esModule?u:{default:u}}var i=["-webkit-","-moz-",""],a=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/;function l(u,c){if(typeof c=="string"&&!(0,r.default)(c)&&a.test(c))return i.map(function(f){return f+c})}e.exports=t.default})(tv,tv.exports);var l7=tv.exports,nv={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=pd,r=o(n);function o(l){return l&&l.__esModule?l:{default:l}}var i=["-webkit-",""];function a(l,u){if(typeof u=="string"&&!(0,r.default)(u)&&u.indexOf("image-set(")>-1)return i.map(function(c){return u.replace(/image-set\(/g,c+"image-set(")})}e.exports=t.default})(nv,nv.exports);var u7=nv.exports,rv={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(r,o){if(r==="position"&&o==="sticky")return["-webkit-sticky","sticky"]}e.exports=t.default})(rv,rv.exports);var c7=rv.exports,ov={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;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};function i(a,l){if(r.hasOwnProperty(a)&&o.hasOwnProperty(l))return n.map(function(u){return u+l})}e.exports=t.default})(ov,ov.exports);var d7=ov.exports,iv={exports:{}},av={exports:{}},f7=/[A-Z]/g,h7=/^ms-/,qm={};function p7(e){return"-"+e.toLowerCase()}function g7(e){if(qm.hasOwnProperty(e))return qm[e];var t=e.replace(f7,p7);return qm[e]=h7.test(t)?"-"+t:t}const m7=Object.freeze(Object.defineProperty({__proto__:null,default:g7},Symbol.toStringTag,{value:"Module"})),y7=H2(m7);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=y7,r=o(n);function o(a){return a&&a.__esModule?a:{default:a}}function i(a){return(0,r.default)(a)}e.exports=t.default})(av,av.exports);var v7=av.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=h;var n=v7,r=u(n),o=pd,i=u(o),a=BD,l=u(a);function u(p){return p&&p.__esModule?p:{default:p}}var c={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},f={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};function d(p,m){if((0,i.default)(p))return p;for(var x=p.split(/,(?![^()]*(?:\([^()]*\))?\))/g),k=0,v=x.length;k<v;++k){var y=x[k],b=[y];for(var w in m){var E=(0,r.default)(w);if(y.indexOf(E)>-1&&E!=="order")for(var T=m[w],_=0,M=T.length;_<M;++_)b.unshift(y.replace(E,f[T[_]]+E))}x[k]=b.join(",")}return x.join(",")}function h(p,m,x,k){if(typeof m=="string"&&c.hasOwnProperty(p)){var v=d(m,k),y=v.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(w){return!/-moz-|-ms-/.test(w)}).join(",");if(p.indexOf("Webkit")>-1)return y;var b=v.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(w){return!/-webkit-|-ms-/.test(w)}).join(",");return p.indexOf("Moz")>-1?b:(x["Webkit"+(0,l.default)(p)]=y,x["Moz"+(0,l.default)(p)]=b,v)}}e.exports=t.default})(iv,iv.exports);var x7=iv.exports;Object.defineProperty($1,"__esModule",{value:!0});$1.default=q7;var b7=e7,w7=br(b7),S7=t7,k7=br(S7),T7=n7,C7=br(T7),E7=r7,j7=br(E7),I7=o7,D7=br(I7),_7=i7,O7=br(_7),A7=a7,P7=br(A7),M7=s7,R7=br(M7),B7=l7,L7=br(B7),N7=u7,$7=br(N7),F7=c7,H7=br(F7),z7=d7,U7=br(z7),W7=x7,V7=br(W7);function br(e){return e&&e.__esModule?e:{default:e}}var Y7=[D7.default,j7.default,O7.default,R7.default,L7.default,$7.default,H7.default,U7.default,V7.default,P7.default],mk=w7.default.prefixMap;function q7(e){for(var t in e){var n=e[t],r=(0,C7.default)(Y7,t,n,e,mk);r&&(e[t]=r),(0,k7.default)(mk,t,e)}return e}Object.defineProperty(Ll,"__esModule",{value:!0});var sv=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};Ll.PluginSet=ND;Ll.fallbacks=J7;Ll.contentWrap=t8;Ll.prefixes=n8;var G7=P1,F1=LD(G7),K7=Bl,Q7=$1,X7=LD(Q7);function LD(e){return e&&e.__esModule?e:{default:e}}var Z7=function(e){return e==="development"||!e}("production");function ND(e){this.fns=e||[]}(0,F1.default)(ND.prototype,{add:function(){for(var t=this,n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];r.forEach(function(i){t.fns.indexOf(i)>=0?Z7&&console.warn("adding the same plugin again, ignoring"):t.fns=[i].concat(t.fns)})},remove:function(t){this.fns=this.fns.filter(function(n){return n!==t})},clear:function(){this.fns=[]},transform:function(t){return this.fns.reduce(function(n,r){return r(n)},t)}});function J7(e){var t=Object.keys(e.style).map(function(o){return Array.isArray(e.style[o])}).indexOf(!0)>=0;if(t){var n=e.style,r=Object.keys(n).reduce(function(o,i){return o[i]=Array.isArray(n[i])?n[i].join("; "+(0,K7.processStyleName)(i)+": "):n[i],o},{});return(0,F1.default)({},e,{style:r})}return e}var e8=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit"];function t8(e){if(e.style.content){var t=e.style.content;return e8.indexOf(t)>=0||/^(attr|calc|counters?|url)\(/.test(t)||t.charAt(0)===t.charAt(t.length-1)&&(t.charAt(0)==='"'||t.charAt(0)==="'")?e:sv({},e,{style:sv({},e.style,{content:'"'+t+'"'})})}return e}function n8(e){return(0,F1.default)({},e,{style:(0,X7.default)(sv({},e.style))})}var H1={};Object.defineProperty(H1,"__esModule",{value:!0});H1.default=r8;function r8(e,t){for(var n=1540483477,r=24,o=t^e.length,i=e.length,a=0;i>=4;){var l=o8(e,a);l=ka(l,n),l^=l>>>r,l=ka(l,n),o=ka(o,n),o^=l,a+=4,i-=4}switch(i){case 3:o^=yk(e,a),o^=e.charCodeAt(a+2)<<16,o=ka(o,n);break;case 2:o^=yk(e,a),o=ka(o,n);break;case 1:o^=e.charCodeAt(a),o=ka(o,n);break}return o^=o>>>13,o=ka(o,n),o^=o>>>15,o>>>0}function o8(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)+(e.charCodeAt(t++)<<16)+(e.charCodeAt(t)<<24)}function yk(e,t){return e.charCodeAt(t++)+(e.charCodeAt(t++)<<8)}function ka(e,t){e=e|0,t=t|0;var n=e&65535,r=e>>>16,o=n*t+((r*t&65535)<<16)|0;return o}var gd;Object.defineProperty(re,"__esModule",{value:!0});re.compose=re.merge=re.$=re.style=re.presets=gd=re.keyframes=re.fontFace=re.insertGlobal=re.insertRule=re.plugins=re.styleSheet=void 0;re.speedy=d8;re.simulations=f8;re.simulate=h8;re.cssLabels=p8;re.isLikeRule=Y1;re.idFor=q1;var ze=re.css=rn;re.rehydrate=I8;re.flush=D8;re.select=G1;re.parent=O8;var $D=re.media=A8;re.pseudo=ge;re.active=P8;re.any=M8;re.checked=R8;re.disabled=B8;re.empty=L8;re.enabled=N8;re._default=$8;re.first=F8;re.firstChild=H8;re.firstOfType=z8;re.fullscreen=U8;re.focus=W8;re.hover=V8;re.indeterminate=Y8;re.inRange=q8;re.invalid=G8;re.lastChild=K8;re.lastOfType=Q8;re.left=X8;re.link=Z8;re.onlyChild=J8;re.onlyOfType=eH;re.optional=tH;re.outOfRange=nH;re.readOnly=rH;re.readWrite=oH;re.required=iH;re.right=aH;re.root=sH;re.scope=lH;re.target=uH;re.valid=cH;re.visited=dH;re.dir=fH;re.lang=hH;re.not=pH;re.nthChild=gH;re.nthLastChild=mH;re.nthLastOfType=yH;re.nthOfType=vH;re.after=xH;re.before=bH;re.firstLetter=wH;re.firstLine=SH;re.selection=kH;re.backdrop=TH;re.placeholder=CH;re.cssFor=EH;re.attribsFor=jH;var i8=P1,a8=U1(i8),s8=M1,z1=Bl,l8=L1,ga=U1(l8),si=Ll,u8=H1,c8=U1(u8);function U1(e){return e&&e.__esModule?e:{default:e}}function md(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var lr=re.styleSheet=new s8.StyleSheet;lr.inject();function d8(e){return lr.speedy(e)}var yd=re.plugins=lr.plugins=new si.PluginSet([si.prefixes,si.contentWrap,si.fallbacks]);yd.media=new si.PluginSet;yd.fontFace=new si.PluginSet;yd.keyframes=new si.PluginSet([si.prefixes,si.fallbacks]);var W1=!1,rg=typeof window<"u",V1=W1,vk=!1,xk=!1;function f8(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;V1=!!e}function h8(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t=(0,ga.default)(t),t?V1?t.reduce(function(r,o){return r["data-simulate-"+Vh(o)]="",r},{}):(vk||(console.warn("can't simulate without once calling simulations(true)"),vk=!0),xk||(console.warn("don't use simulation outside dev"),xk=!0),{}):{}}var vd=W1;function p8(e){vd=!!e}function Vh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return e.toLowerCase().replace(/[^a-z0-9]/g,t)}function xd(e){var t=JSON.stringify(e),n=(0,c8.default)(t).toString(36);return e.label&&e.label.length>0&&W1?Vh(e.label.join("."),"-")+"-"+n:n}function Y1(e){var t=Object.keys(e).filter(function(n){return n!=="toString"});return t.length!==1?!1:!!/data\-css\-([a-zA-Z0-9\-_]+)/.exec(t[0])}function q1(e){var t=Object.keys(e).filter(function(o){return o!=="toString"});if(t.length!==1)throw new Error("not a rule");var n=/data\-css\-([a-zA-Z0-9\-_]+)/,r=n.exec(t[0]);if(!r)throw new Error("not a rule");return r[1]}var g8=/[(),]|"(?:\\.|[^"\n])*"|'(?:\\.|[^'\n])*'|\/\*[\s\S]*?\*\//g;function lv(e){if(e.indexOf(",")===-1)return[e];for(var t=[],n=[],r=0,o;o=g8.exec(e);)switch(o[0]){case"(":r++;break;case")":r--;break;case",":if(r)break;t.push(o.index)}for(o=t.length;o--;)n.unshift(e.slice(t[o]+1)),e=e.slice(0,t[o]);return n.unshift(e),n}function bk(e,t){if(!e)return t.replace(/\&/g,"");if(!t)return".css-"+e+",[data-css-"+e+"]";var n=lv(t).map(function(r){return r.indexOf("&")>=0?[r.replace(/\&/mg,".css-"+e),r.replace(/\&/mg,"[data-css-"+e+"]")].join(","):".css-"+e+r+",[data-css-"+e+"]"+r}).join(",");return V1&&/^\&\:/.exec(t)&&!/\s/.exec(t)&&(n+=",.css-"+e+"[data-simulate-"+Vh(t)+"],[data-css-"+e+"][data-simulate-"+Vh(t)+"]"),n}function uv(e){var t=e.selector,n=e.style,r=yd.transform({selector:t,style:n});return r.selector+"{"+(0,z1.createMarkupForStyles)(r.style)+"}"}function Yh(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||{},n[i]=e[i]):i.indexOf("@media")===0?(r=r||{},r[i]=Yh(e[i])):i.indexOf("@supports")===0?(o=o||{},o[i]=Yh(e[i])):i==="label"?e.label.length>0&&(t=t||{},t.label=vd?e.label.join("."):""):(t=t||{},t[i]=e[i])}),{plain:t,selects:n,medias:r,supports:o}}function qh(e,t){var n=[],r=t.plain,o=t.selects,i=t.medias,a=t.supports;return r&&n.push(uv({style:r,selector:bk(e)})),o&&Object.keys(o).forEach(function(l){return n.push(uv({style:o[l],selector:bk(e,l)}))}),i&&Object.keys(i).forEach(function(l){return n.push(l+"{"+qh(e,i[l]).join("")+"}")}),a&&Object.keys(a).forEach(function(l){return n.push(l+"{"+qh(e,a[l]).join("")+"}")}),n}var io=lr.inserted={};function m8(e){if(!io[e.id]){io[e.id]=!0;var t=Yh(e.style),n=qh(e.id,t);io[e.id]=rg?!0:n,n.forEach(function(r){return lr.insert(r)})}}var jc=lr.registered={};function og(e){jc[e.id]||(jc[e.id]=e)}function y8(e){if(Y1(e)){var t=jc[q1(e)];if(t==null)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}var eh={};function v8(e){if(og(e),m8(e),eh[e.id])return eh[e.id];var t=md({},"data-css-"+e.id,vd&&e.label||"");return Object.defineProperty(t,"toString",{enumerable:!1,value:function(){return"css-"+e.id}}),eh[e.id]=t,t}function x8(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}function wk(e,t){var n=lv(e).map(function(o){return o.indexOf("&")>=0?o:"&"+o}),r=lv(t).map(function(o){return o.indexOf("&")>=0?o:"&"+o});return r.reduce(function(o,i){return o.concat(n.map(function(a){return i.replace(/\&/g,a)}))},[]).join(",")}function b8(e,t){return e?"@media "+e.substring(6)+" and "+t.substring(6):t}function w8(e){return e.indexOf("@media")===0}function S8(e){return e.indexOf("@supports")===0}function k8(e,t){return e?"@supports "+e.substring(9)+" and "+t.substring(9):t}function FD(e){for(var t=[],n=0;n<e.length;n++)Array.isArray(e[n])?t=t.concat(FD(e[n])):t=t.concat(e[n]);return t}var Sk={"::placeholder":["::-webkit-input-placeholder","::-moz-placeholder","::-ms-input-placeholder"],":fullscreen":[":-webkit-full-screen",":-moz-full-screen",":-ms-fullscreen"]};function Pa(e,t){var n=t.selector,r=n===void 0?"":n,o=t.mq,i=o===void 0?"":o,a=t.supp,l=a===void 0?"":a,u=t.src,c=u===void 0?{}:u;Array.isArray(c)||(c=[c]),c=FD(c),c.forEach(function(f){if(Y1(f)){var d=y8(f);if(d.type!=="css")throw new Error("cannot merge this rule");f=d.style}f=(0,ga.default)(f),f&&f.composes&&Pa(e,{selector:r,mq:i,supp:l,src:f.composes}),Object.keys(f||{}).forEach(function(h){if(x8(h))Sk[h]&&Sk[h].forEach(function(m){return Pa(e,{selector:wk(r,m),mq:i,supp:l,src:f[h]})}),Pa(e,{selector:wk(r,h),mq:i,supp:l,src:f[h]});else if(w8(h))Pa(e,{selector:r,mq:b8(i,h),supp:l,src:f[h]});else if(S8(h))Pa(e,{selector:r,mq:i,supp:k8(l,h),src:f[h]});else if(h!=="composes"){var p=e;l&&(p[l]=p[l]||{},p=p[l]),i&&(p[i]=p[i]||{},p=p[i]),r&&(p[r]=p[r]||{},p=p[r]),h==="label"?vd&&(e.label=e.label.concat(f.label)):p[h]=f[h]}})})}function kk(e){var t={label:[]};Pa(t,{src:e});var n={id:xd(t),style:t,label:vd?t.label.join("."):"",type:"css"};return v8(n)}var Gh={};Object.defineProperty(Gh,"toString",{enumerable:!1,value:function(){return"css-nil"}});var xf=typeof WeakMap<"u"?[Gh,new WeakMap,new WeakMap,new WeakMap]:[Gh];function T8(e){return function(t){if(xf[t.length]){for(var n=xf[t.length],r=0;r<t.length-1;)n.has(t[r])||n.set(t[r],new WeakMap),n=n.get(t[r]),r++;if(n.has(t[t.length-1])){var o=n.get(t[r]);if(jc[o.toString().substring(4)])return o}}var i=e(t);if(xf[t.length]){for(var a=0,l=xf[t.length];a<t.length-1;)l=l.get(t[a]),a++;try{l.set(t[a],i)}catch{}}return i}}var C8=typeof WeakMap<"u"?T8(kk):kk;function rn(){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,ga.default)(t),t?C8(t):Gh}rn.insert=function(e){var t={id:xd(e),css:e,type:"raw"};og(t),io[t.id]||(lr.insert(t.css),io[t.id]=rg?!0:[t.css])};re.insertRule=rn.insert;rn.global=function(e,t){if(t=(0,ga.default)(t),t)return rn.insert(uv({selector:e,style:t}))};re.insertGlobal=rn.global;function E8(e){if(!io[e.id]){var t=Object.keys(e.keyframes).map(function(r){var o=yd.keyframes.transform({id:e.id,name:r,style:e.keyframes[r]});return o.name+"{"+(0,z1.createMarkupForStyles)(o.style)+"}"}).join(""),n=["-webkit-","-moz-","-o-",""].map(function(r){return"@"+r+"keyframes "+(e.name+"_"+e.id)+"{"+t+"}"});n.forEach(function(r){return lr.insert(r)}),io[e.id]=rg?!0:n}}rn.keyframes=function(e,t){t||(t=e,e="animation"),t=(0,ga.default)(t)||{};var n={id:xd({name:e,kfs:t}),type:"keyframes",name:e,keyframes:t};return og(n),E8(n),e+"_"+n.id};rn.fontFace=function(e){e=(0,ga.default)(e);var t={id:xd(e),type:"font-face",font:e};return og(t),j8(t),e.fontFamily};re.fontFace=rn.fontFace;gd=re.keyframes=rn.keyframes;function j8(e){if(!io[e.id]){var t="@font-face{"+(0,z1.createMarkupForStyles)(e.font)+"}";lr.insert(t),io[e.id]=rg?!0:[t]}}function I8(e){(0,a8.default)(io,e.reduce(function(t,n){return t[n]=!0,t},{}))}function D8(){io=lr.inserted={},jc=lr.registered={},eh={},lr.flush(),lr.inject()}re.presets={mobile:"(min-width: 400px)",Mobile:"@media (min-width: 400px)",phablet:"(min-width: 550px)",Phablet:"@media (min-width: 550px)",tablet:"(min-width: 750px)",Tablet:"@media (min-width: 750px)",desktop:"(min-width: 1000px)",Desktop:"@media (min-width: 1000px)",hd:"(min-width: 1200px)",Hd:"@media (min-width: 1200px)"};var _8=re.style=rn;function G1(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?rn(md({},e,n)):_8(n)}re.$=G1;function O8(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return rn(md({},e+" &",n))}re.merge=rn;re.compose=rn;function A8(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return rn(md({},"@media "+e,n))}function ge(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return rn(md({},e,n))}function P8(e){return ge(":active",e)}function M8(e){return ge(":any",e)}function R8(e){return ge(":checked",e)}function B8(e){return ge(":disabled",e)}function L8(e){return ge(":empty",e)}function N8(e){return ge(":enabled",e)}function $8(e){return ge(":default",e)}function F8(e){return ge(":first",e)}function H8(e){return ge(":first-child",e)}function z8(e){return ge(":first-of-type",e)}function U8(e){return ge(":fullscreen",e)}function W8(e){return ge(":focus",e)}function V8(e){return ge(":hover",e)}function Y8(e){return ge(":indeterminate",e)}function q8(e){return ge(":in-range",e)}function G8(e){return ge(":invalid",e)}function K8(e){return ge(":last-child",e)}function Q8(e){return ge(":last-of-type",e)}function X8(e){return ge(":left",e)}function Z8(e){return ge(":link",e)}function J8(e){return ge(":only-child",e)}function eH(e){return ge(":only-of-type",e)}function tH(e){return ge(":optional",e)}function nH(e){return ge(":out-of-range",e)}function rH(e){return ge(":read-only",e)}function oH(e){return ge(":read-write",e)}function iH(e){return ge(":required",e)}function aH(e){return ge(":right",e)}function sH(e){return ge(":root",e)}function lH(e){return ge(":scope",e)}function uH(e){return ge(":target",e)}function cH(e){return ge(":valid",e)}function dH(e){return ge(":visited",e)}function fH(e,t){return ge(":dir("+e+")",t)}function hH(e,t){return ge(":lang("+e+")",t)}function pH(e,t){var n=e.split(",").map(function(r){return r.trim()}).map(function(r){return":not("+r+")"});return n.length===1?ge(":not("+e+")",t):G1(n.join(""),t)}function gH(e,t){return ge(":nth-child("+e+")",t)}function mH(e,t){return ge(":nth-last-child("+e+")",t)}function yH(e,t){return ge(":nth-last-of-type("+e+")",t)}function vH(e,t){return ge(":nth-of-type("+e+")",t)}function xH(e){return ge("::after",e)}function bH(e){return ge("::before",e)}function wH(e){return ge("::first-letter",e)}function SH(e){return ge("::first-line",e)}function kH(e){return ge("::selection",e)}function TH(e){return ge("::backdrop",e)}function CH(e){return rn({"::placeholder":e})}function EH(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t=(0,ga.default)(t),t?t.map(function(r){var o={label:[]};return Pa(o,{src:r}),qh(xd(o),Yh(o)).join("")}).join(""):""}function jH(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t=(0,ga.default)(t);var r=t?t.map(function(o){q1(o);var i=Object.keys(o)[0],a=o[i];return i+'="'+(a||"")+'"'}).join(" "):"";return r}function IH(){return String(pl.env.REACT_APP_NETLIFY)==="true"}function DH(){return!1}function bd(){return IH()||DH()}function _H(){return navigator.userAgent.indexOf("Electron")>=0}function fs(e){const t=Ft(),n=g.useCallback(o=>{t(iD({[e]:o}))},[e,t]);return[Te(o=>o.prefs.global?.[e]),n]}const HD="#f6f8fa",Nl="#e8ecf0",Wo="#d4dae0",Vo="#bdc5cf",wd="#98a1ae",mi="#747c8b",yi="#4d5768",$l="#373b4a",wr="#242733",Nr="#141520",ma="#080811",Ot=NF,At=LF,rt=BF,hs=RF,$n=MF,ho=PF,En=AF,po=OF,Fn=_F,jt=DF,yt=IF,ya=jF,zD=EF,ig=CF,ag=TF,sg=kF,Fl=SF,lg=wF,ug=bF,UD=GF,cg=qF,WD=YF,VD=VF,dg=WF,$r=UF,OH=zF,YD=HF,ps=FF,fg=$F,qD=dF,GD=cF,go=uF,hg=lF,va=sF,KD=aF,Hl=iF,QD=oF,XD=xF,ZD=vF,pg=yF,xa=mF,ba=gF,JD=pF,e_=hF,t_=fF,gs=r6,Sd=n6,It=t6,Zt=e6,Pt=JF,vt=ZF,wa=XF,ms=QF,kd=KF,De="#ffffff",n_="#000000",AH=ma,PH=Nr,MH=jt,RH=wr,BH=Pt,LH=yt,NH=rt,r_=rt,$H=$n,FH=En,HH=At,zH=It,UH=Pt,WH=It,VH=Nr,YH=Pt,o_=Fn,qH=jt,GH=Fn,K1=rt,KH=K1,QH=En,XH=rt,ZH=ho,JH=En,e9=$n,t9=Fn,i_=po,n9=Pt,r9=Zt,o9=ho,i9=kd,a9=rt,s9=Fn,l9=rt,u9=yt,c9=go,d9=$r,f9=xa,h9=It,p9=Fn,g9=rt,m9=It,y9=po,v9=po,x9=En,b9=At,w9=Ot,S9=Pt,k9=vt,T9=jt,C9=Pt,E9=En,j9=yt,I9=po,D9=hs,_9=It,O9=Nr,A9=po,a_=kd,P9=rt,M9=Vo,R9="rgba(200, 200, 200, .15)",B9=Fn,L9=jt,N9=rt,$9=Pt,F9=o_,H9=lg,z9=yt,U9=De,W9=a_,V9=vt,Y9=ms,q9=vt,G9=kd,s_=hs,K9=s_,Q9="transparent",X9="rgba(200, 200, 200, .25)",Z9=En,J9=ps,ez=Hl,l_=go,tz=hg,nz=l_,u_=De,rz=u_,c_=Pt,oz=wa,iz=c_,az="rgba(0, 0, 0, 0.6)",sz=Fn,d_=ho,lz=d_,Q1=rt,uz=rt,cz=jt,dz=po,fz=$n,hz="rgba(0, 0, 0, 0.4)",pz=De,f_=wa,h_=En,gz=jt,mz=En,yz=Ot,vz=yt,xz=rt,bz=jt,wz=f_,Sz=Q1,kz=Q1,p_="transparent",Tz="rgba(200, 200, 200, .3)",Cz="rgba(200, 200, 200, .5)",Ez=h_,jz=p_,Iz=ps,Dz=fg,_z=$r,Oz=VD,Az=$r,Pz=cg,Mz=$r,Rz=ps,Bz=Hl,Lz=hg,Nz=va,$z=qD,Fz=va,Hz=e_,zz=pg,g_=ZD,Uz=g_,Wz=ba,Vz=ba,Yz=ms,qz=gs,Gz=i_,Kz=Sd,Qz=ug,Xz=jt,Zz=Fn,Jz=Pt,eU=po,tU=jt,nU=Pt,rU=rt,oU=n_,iU=rt,aU=At,sU=jt,lU=It,uU=Pt,cU=K1,dU=Zt,fU=Zt,hU=vt,pU=wr,gU=jt,mU=yt,yU=hs,vU=It,m_=Fn,xU=m_,bU=wa,wU=rt,SU=Pt,kU=xa,TU=ag,CU=r_,EU=jt,Tk=Object.freeze(Object.defineProperty({__proto__:null,buttonBareBackground:p_,buttonBareBackgroundActive:Cz,buttonBareBackgroundHover:Tz,buttonBareDisabledBackground:jz,buttonBareDisabledText:Ez,buttonBareText:Sz,buttonBareTextHover:kz,buttonMenuBackground:Q9,buttonMenuBackgroundHover:X9,buttonMenuBorder:Z9,buttonMenuSelectedBackground:l_,buttonMenuSelectedBackgroundHover:tz,buttonMenuSelectedBorder:nz,buttonMenuSelectedText:J9,buttonMenuSelectedTextHover:ez,buttonMenuText:s_,buttonMenuTextHover:K9,buttonNormalBackground:cz,buttonNormalBackgroundHover:dz,buttonNormalBorder:fz,buttonNormalDisabledBackground:gz,buttonNormalDisabledBorder:mz,buttonNormalDisabledText:h_,buttonNormalSelectedBackground:f_,buttonNormalSelectedText:pz,buttonNormalShadow:hz,buttonNormalText:Q1,buttonNormalTextHover:uz,buttonPrimaryBackground:c_,buttonPrimaryBackgroundHover:oz,buttonPrimaryBorder:iz,buttonPrimaryDisabledBackground:d_,buttonPrimaryDisabledBorder:lz,buttonPrimaryDisabledText:sz,buttonPrimaryShadow:az,buttonPrimaryText:u_,buttonPrimaryTextHover:rz,calendarBackground:vz,calendarItemBackground:bz,calendarItemText:xz,calendarSelectedBackground:wz,calendarText:yz,cardBackground:VH,cardBorder:YH,cardShadow:o_,checkboxBackgroundSelected:dU,checkboxBorderSelected:fU,checkboxShadowSelected:hU,checkboxText:cU,checkboxToggleBackground:pU,errorBackground:Hz,errorBorder:Vz,errorText:zz,errorTextDark:g_,errorTextDarker:Uz,errorTextMenu:Wz,formInputBackground:Xz,formInputBackgroundSelected:Zz,formInputBackgroundSelection:Jz,formInputBorder:eU,formInputBorderSelected:nU,formInputShadowSelected:lU,formInputText:rU,formInputTextHighlight:uU,formInputTextPlaceholder:iU,formInputTextPlaceholderSelected:aU,formInputTextReadOnlySelection:tU,formInputTextSelected:oU,formInputTextSelection:sU,formLabelBackground:Qz,formLabelText:Kz,markdownDark:q9,markdownLight:G9,markdownNormal:Y9,menuAutoCompleteBackground:j9,menuAutoCompleteBackgroundHover:I9,menuAutoCompleteText:D9,menuAutoCompleteTextHeader:_9,menuBackground:y9,menuBorder:T9,menuBorderHover:C9,menuItemBackground:v9,menuItemBackgroundHover:x9,menuItemText:b9,menuItemTextHeader:k9,menuItemTextHover:w9,menuItemTextSelected:S9,menuKeybindingText:E9,mobileAccountShadow:F9,mobileAccountText:H9,mobileConfigServerViewTheme:V9,mobileHeaderBackground:a_,mobileHeaderText:P9,mobileHeaderTextHover:R9,mobileHeaderTextSubdued:M9,mobileModalBackground:z9,mobileModalText:U9,mobileNavBackground:L9,mobileNavItem:N9,mobileNavItemSelected:$9,mobilePageBackground:B9,mobileViewTheme:W9,modalBackground:O9,modalBorder:A9,noticeBackground:Iz,noticeBackgroundDark:_z,noticeBackgroundLight:Dz,noticeBorder:Rz,noticeText:Oz,noticeTextDark:Pz,noticeTextLight:Az,noticeTextMenu:Mz,pageBackground:AH,pageBackgroundBottomRight:RH,pageBackgroundLineBottom:NH,pageBackgroundLineMid:LH,pageBackgroundLineTop:BH,pageBackgroundModalActive:PH,pageBackgroundTopLeft:MH,pageText:r_,pageTextDark:HH,pageTextLight:$H,pageTextLink:UH,pageTextLinkLight:WH,pageTextPositive:zH,pageTextSubdued:FH,pillBackground:gU,pillBackgroundLight:mU,pillBackgroundSelected:bU,pillBorder:m_,pillBorderDark:xU,pillBorderSelected:SU,pillText:yU,pillTextHighlighted:vU,pillTextSelected:wU,reportsBlue:TU,reportsInnerLabel:EU,reportsLabel:CU,reportsRed:kU,sidebarBackground:u9,sidebarItemAccentSelected:h9,sidebarItemBackgroundFailed:f9,sidebarItemBackgroundHover:p9,sidebarItemBackgroundPending:c9,sidebarItemBackgroundPositive:d9,sidebarItemText:g9,sidebarItemTextSelected:m9,tableBackground:qH,tableBorder:i_,tableBorderHover:r9,tableBorderSelected:n9,tableBorderSeparator:o9,tableHeaderBackground:t9,tableHeaderText:e9,tableRowBackgroundHighlight:i9,tableRowBackgroundHighlightText:a9,tableRowBackgroundHover:GH,tableRowHeaderBackground:s9,tableRowHeaderText:l9,tableText:K1,tableTextHover:ZH,tableTextInactive:JH,tableTextLight:KH,tableTextSelected:XH,tableTextSubdued:QH,upcomingBackground:Yz,upcomingBorder:Gz,upcomingText:qz,warningBackground:Bz,warningBorder:Fz,warningText:Lz,warningTextDark:$z,warningTextLight:Nz},Symbol.toStringTag,{value:"Module"})),jU=At,IU=hs,DU=At,_U=ya,OU=De,AU=At,PU=ya,y_="#272630",MU=En,RU=$n,BU=jt,LU=wa,NU=Fl,$U=ig,FU=De,HU=ms,zU=Fn,v_=De,UU=Ot,WU=y_,VU=ho,YU=At,qU=Fn,GU=yt,KU=En,QU=po,XU=De,ZU=At,JU=vt,eW=Pt,tW=ho,nW=ya,rW=Fn,oW=Ot,iW=jt,aW=yt,sW=go,lW=$r,uW=xa,cW=jt,dW=It,fW=rt,hW=It,pW=De,gW=Ot,mW=At,x_=yt,yW=x_,vW=Zt,xW=ho,bW=At,wW=gs,SW=ho,kW=yt,TW=po,CW=De,EW=GD,jW=De,IW=De,b_=Pt,DW=Ot,_W=Vo,OW="rgba(200, 200, 200, .15)",AW=Ot,PW=De,MW=wd,RW=vt,BW=$n,LW=lg,NW=yt,$W=De,FW=b_,HW=vt,zW=Sd,UW=Pt,WW=gs,VW=At,YW=Ot,qW="transparent",GW="rgba(200, 200, 200, .25)",KW=En,QW=ps,XW=Hl,w_=go,ZW=hg,JW=w_,S_=De,eV=S_,X1=vt,tV=X1,nV=X1,rV="rgba(0, 0, 0, 0.3)",oV=De,k_=$n,iV=k_,gg=yt,aV=gg,Z1=De,sV=Z1,T_=rt,lV="rgba(0, 0, 0, 0.2)",uV=De,cV=Fl,C_=$n,dV=Z1,fV=T_,hV=Ot,pV=yt,gV=rt,mV=jt,yV=En,vV=gg,xV=gg,E_="transparent",bV="rgba(100, 100, 100, .15)",wV="rgba(100, 100, 100, .25)",SV=C_,kV=E_,TV=cg,CV=UD,EV=$r,jV=YD,IV=$r,DV=fg,_V=WD,OV=$r,AV=go,PV=KD,MV=va,RV=QD,BV=va,LV=XD,NV=ba,$V=JD,FV=t_,HV=pg,zV=ba,UV=gs,WV=ms,VV=vt,YV=Fl,qV=zD,GV=Ot,KV=De,QV=vt,XV=rt,ZV=Ot,JV=vt,eY=yt,tY=Ot,nY=$n,rY=hs,oY=At,iY=Zt,aY=It,sY=v_,lY=sg,uY=sg,cY=ig,j_=rt,dY=j_,fY=jt,hY=wa,pY=rt,gY=$n,mY=ya,yY=ug,vY=vt,xY=xa,bY=ag,wY=yt,SY=Object.freeze(Object.defineProperty({__proto__:null,buttonBareBackground:E_,buttonBareBackgroundActive:wV,buttonBareBackgroundHover:bV,buttonBareDisabledBackground:kV,buttonBareDisabledText:SV,buttonBareText:vV,buttonBareTextHover:xV,buttonMenuBackground:qW,buttonMenuBackgroundHover:GW,buttonMenuBorder:KW,buttonMenuSelectedBackground:w_,buttonMenuSelectedBackgroundHover:ZW,buttonMenuSelectedBorder:JW,buttonMenuSelectedText:QW,buttonMenuSelectedTextHover:XW,buttonMenuText:VW,buttonMenuTextHover:YW,buttonNormalBackground:Z1,buttonNormalBackgroundHover:sV,buttonNormalBorder:T_,buttonNormalDisabledBackground:dV,buttonNormalDisabledBorder:fV,buttonNormalDisabledText:C_,buttonNormalSelectedBackground:cV,buttonNormalSelectedText:uV,buttonNormalShadow:lV,buttonNormalText:gg,buttonNormalTextHover:aV,buttonPrimaryBackground:X1,buttonPrimaryBackgroundHover:tV,buttonPrimaryBorder:nV,buttonPrimaryDisabledBackground:k_,buttonPrimaryDisabledBorder:iV,buttonPrimaryDisabledText:oV,buttonPrimaryShadow:rV,buttonPrimaryText:S_,buttonPrimaryTextHover:eV,calendarBackground:pV,calendarItemBackground:mV,calendarItemText:gV,calendarSelectedBackground:yV,calendarText:hV,cardBackground:FU,cardBorder:HU,cardShadow:zU,checkboxBackgroundSelected:lY,checkboxBorderSelected:uY,checkboxShadowSelected:cY,checkboxText:sY,errorBackground:LV,errorBorder:zV,errorText:NV,errorTextDark:$V,errorTextDarker:FV,errorTextMenu:HV,formInputBackground:GV,formInputBackgroundSelected:KV,formInputBackgroundSelection:QV,formInputBorder:XV,formInputBorderSelected:JV,formInputShadowSelected:iY,formInputText:eY,formInputTextHighlight:aY,formInputTextPlaceholder:nY,formInputTextPlaceholderSelected:rY,formInputTextReadOnlySelection:ZV,formInputTextSelected:tY,formInputTextSelection:oY,formLabelBackground:qV,formLabelText:YV,markdownDark:UW,markdownLight:WW,markdownNormal:zW,menuAutoCompleteBackground:kW,menuAutoCompleteBackgroundHover:TW,menuAutoCompleteText:CW,menuAutoCompleteTextHeader:EW,menuBackground:pW,menuBorder:bW,menuBorderHover:wW,menuItemBackground:gW,menuItemBackgroundHover:mW,menuItemText:x_,menuItemTextHeader:xW,menuItemTextHover:yW,menuItemTextSelected:vW,menuKeybindingText:SW,mobileAccountShadow:BW,mobileAccountText:LW,mobileConfigServerViewTheme:HW,mobileHeaderBackground:b_,mobileHeaderText:DW,mobileHeaderTextHover:OW,mobileHeaderTextSubdued:_W,mobileModalBackground:NW,mobileModalText:$W,mobileNavBackground:PW,mobileNavItem:MW,mobileNavItemSelected:RW,mobilePageBackground:AW,mobileViewTheme:FW,modalBackground:jW,modalBorder:IW,noticeBackground:TV,noticeBackgroundDark:EV,noticeBackgroundLight:CV,noticeBorder:OV,noticeText:jV,noticeTextDark:DV,noticeTextLight:IV,noticeTextMenu:_V,pageBackground:jU,pageBackgroundBottomRight:_U,pageBackgroundLineBottom:PU,pageBackgroundLineMid:AU,pageBackgroundLineTop:OU,pageBackgroundModalActive:IU,pageBackgroundTopLeft:DU,pageText:y_,pageTextDark:BU,pageTextLight:MU,pageTextLink:NU,pageTextLinkLight:$U,pageTextPositive:LU,pageTextSubdued:RU,pillBackground:j_,pillBackgroundLight:dY,pillBackgroundSelected:mY,pillBorder:pY,pillBorderDark:gY,pillBorderSelected:vY,pillText:fY,pillTextHighlighted:hY,pillTextSelected:yY,reportsBlue:bY,reportsLabel:wY,reportsRed:xY,sidebarBackground:aW,sidebarItemAccentSelected:dW,sidebarItemBackgroundFailed:uW,sidebarItemBackgroundHover:cW,sidebarItemBackgroundPending:sW,sidebarItemBackgroundPositive:lW,sidebarItemText:fW,sidebarItemTextSelected:hW,tableBackground:v_,tableBorder:ZU,tableBorderHover:eW,tableBorderSelected:JU,tableBorderSeparator:tW,tableHeaderBackground:XU,tableHeaderText:QU,tableRowBackgroundHighlight:nW,tableRowBackgroundHighlightText:rW,tableRowBackgroundHover:UU,tableRowHeaderBackground:oW,tableRowHeaderText:iW,tableText:WU,tableTextHover:GU,tableTextInactive:KU,tableTextLight:VU,tableTextSelected:qU,tableTextSubdued:YU,upcomingBackground:UV,upcomingBorder:VV,upcomingText:WV,warningBackground:AV,warningBorder:BV,warningText:PV,warningTextDark:RV,warningTextLight:MV},Symbol.toStringTag,{value:"Module"})),kY=At,TY=hs,CY=At,EY=ya,jY=De,IY=At,DY=ya,I_="#272630",_Y=En,OY=$n,AY=jt,PY=wa,MY=Fl,RY=ig,BY=De,LY=ms,NY=Fn,D_=De,$Y=Ot,FY=I_,HY=ho,zY=At,UY=Fn,WY=yt,VY=En,YY=po,qY=De,GY=At,KY=vt,QY=Pt,XY=ho,ZY=ya,JY=Fn,eq=Ot,tq=jt,nq=yt,rq=go,oq=$r,iq=xa,aq=jt,sq=It,lq=rt,uq=It,cq=De,dq=Ot,fq=At,__=yt,hq=__,pq=Zt,gq=ho,mq=At,yq=gs,vq=ho,xq=yt,bq=po,wq=De,Sq=GD,kq=De,Tq=De,O_=Pt,Cq=Ot,Eq=Vo,jq="rgba(200, 200, 200, .15)",Iq=Ot,Dq=De,_q=wd,Oq=vt,Aq=$n,Pq=lg,Mq=yt,Rq=De,Bq=O_,Lq=vt,Nq=Sd,$q=Pt,Fq=gs,Hq=At,zq=Ot,Uq="transparent",Wq="rgba(200, 200, 200, .25)",Vq=En,Yq=ps,qq=Hl,A_=go,Gq=hg,Kq=A_,P_=De,Qq=P_,M_=vt,Xq=Zt,Zq=M_,Jq="rgba(0, 0, 0, 0.3)",eG=De,R_=$n,tG=R_,mg=yt,nG=mg,J1=De,rG=J1,B_=rt,oG="rgba(0, 0, 0, 0.2)",iG=De,aG=Fl,L_=$n,sG=J1,lG=B_,uG=Ot,cG=yt,dG=rt,fG=jt,hG=En,pG=mg,gG=mg,N_="transparent",mG="rgba(100, 100, 100, .15)",yG="rgba(100, 100, 100, .25)",vG=L_,xG=N_,bG=cg,wG=UD,SG=$r,kG=YD,TG=$r,CG=fg,EG=WD,jG=$r,IG=go,DG=KD,_G=va,OG=QD,AG=va,PG=XD,MG=ba,RG=JD,BG=t_,LG=pg,NG=ba,$G=gs,FG=ms,HG=vt,zG=Fl,UG=zD,WG=Ot,VG=De,YG=vt,qG=rt,GG=Ot,KG=vt,QG=yt,XG=Ot,ZG=$n,JG=hs,eK=At,tK=Zt,nK=It,rK=D_,oK=sg,iK=sg,aK=ig,sK=mi,lK=rt,uK=At,cK=jt,dK=wa,fK=rt,hK=$n,pK=ya,gK=ug,mK=vt,yK=xa,vK=ag,xK=yt,bK=jt,$_=Object.freeze(Object.defineProperty({__proto__:null,buttonBareBackground:N_,buttonBareBackgroundActive:yG,buttonBareBackgroundHover:mG,buttonBareDisabledBackground:xG,buttonBareDisabledText:vG,buttonBareText:pG,buttonBareTextHover:gG,buttonMenuBackground:Uq,buttonMenuBackgroundHover:Wq,buttonMenuBorder:Vq,buttonMenuSelectedBackground:A_,buttonMenuSelectedBackgroundHover:Gq,buttonMenuSelectedBorder:Kq,buttonMenuSelectedText:Yq,buttonMenuSelectedTextHover:qq,buttonMenuText:Hq,buttonMenuTextHover:zq,buttonNormalBackground:J1,buttonNormalBackgroundHover:rG,buttonNormalBorder:B_,buttonNormalDisabledBackground:sG,buttonNormalDisabledBorder:lG,buttonNormalDisabledText:L_,buttonNormalSelectedBackground:aG,buttonNormalSelectedText:iG,buttonNormalShadow:oG,buttonNormalText:mg,buttonNormalTextHover:nG,buttonPrimaryBackground:M_,buttonPrimaryBackgroundHover:Xq,buttonPrimaryBorder:Zq,buttonPrimaryDisabledBackground:R_,buttonPrimaryDisabledBorder:tG,buttonPrimaryDisabledText:eG,buttonPrimaryShadow:Jq,buttonPrimaryText:P_,buttonPrimaryTextHover:Qq,calendarBackground:cG,calendarItemBackground:fG,calendarItemText:dG,calendarSelectedBackground:hG,calendarText:uG,cardBackground:BY,cardBorder:LY,cardShadow:NY,checkboxBackgroundSelected:oK,checkboxBorderSelected:iK,checkboxShadowSelected:aK,checkboxText:rK,checkboxToggleBackground:sK,errorBackground:PG,errorBorder:NG,errorText:MG,errorTextDark:RG,errorTextDarker:BG,errorTextMenu:LG,formInputBackground:WG,formInputBackgroundSelected:VG,formInputBackgroundSelection:YG,formInputBorder:qG,formInputBorderSelected:KG,formInputShadowSelected:tK,formInputText:QG,formInputTextHighlight:nK,formInputTextPlaceholder:ZG,formInputTextPlaceholderSelected:JG,formInputTextReadOnlySelection:GG,formInputTextSelected:XG,formInputTextSelection:eK,formLabelBackground:UG,formLabelText:zG,markdownDark:$q,markdownLight:Fq,markdownNormal:Nq,menuAutoCompleteBackground:xq,menuAutoCompleteBackgroundHover:bq,menuAutoCompleteText:wq,menuAutoCompleteTextHeader:Sq,menuBackground:cq,menuBorder:mq,menuBorderHover:yq,menuItemBackground:dq,menuItemBackgroundHover:fq,menuItemText:__,menuItemTextHeader:gq,menuItemTextHover:hq,menuItemTextSelected:pq,menuKeybindingText:vq,mobileAccountShadow:Aq,mobileAccountText:Pq,mobileConfigServerViewTheme:Lq,mobileHeaderBackground:O_,mobileHeaderText:Cq,mobileHeaderTextHover:jq,mobileHeaderTextSubdued:Eq,mobileModalBackground:Mq,mobileModalText:Rq,mobileNavBackground:Dq,mobileNavItem:_q,mobileNavItemSelected:Oq,mobilePageBackground:Iq,mobileViewTheme:Bq,modalBackground:kq,modalBorder:Tq,noticeBackground:bG,noticeBackgroundDark:SG,noticeBackgroundLight:wG,noticeBorder:jG,noticeText:kG,noticeTextDark:CG,noticeTextLight:TG,noticeTextMenu:EG,pageBackground:kY,pageBackgroundBottomRight:EY,pageBackgroundLineBottom:DY,pageBackgroundLineMid:IY,pageBackgroundLineTop:jY,pageBackgroundModalActive:TY,pageBackgroundTopLeft:CY,pageText:I_,pageTextDark:AY,pageTextLight:_Y,pageTextLink:MY,pageTextLinkLight:RY,pageTextPositive:PY,pageTextSubdued:OY,pillBackground:lK,pillBackgroundLight:uK,pillBackgroundSelected:pK,pillBorder:fK,pillBorderDark:hK,pillBorderSelected:mK,pillText:cK,pillTextHighlighted:dK,pillTextSelected:gK,reportsBlue:vK,reportsInnerLabel:bK,reportsLabel:xK,reportsRed:yK,sidebarBackground:nq,sidebarItemAccentSelected:sq,sidebarItemBackgroundFailed:iq,sidebarItemBackgroundHover:aq,sidebarItemBackgroundPending:rq,sidebarItemBackgroundPositive:oq,sidebarItemText:lq,sidebarItemTextSelected:uq,tableBackground:D_,tableBorder:GY,tableBorderHover:QY,tableBorderSelected:KY,tableBorderSeparator:XY,tableHeaderBackground:qY,tableHeaderText:YY,tableRowBackgroundHighlight:ZY,tableRowBackgroundHighlightText:JY,tableRowBackgroundHover:$Y,tableRowHeaderBackground:eq,tableRowHeaderText:tq,tableText:FY,tableTextHover:WY,tableTextInactive:VY,tableTextLight:HY,tableTextSelected:UY,tableTextSubdued:zY,upcomingBackground:$G,upcomingBorder:HG,upcomingText:FG,warningBackground:IG,warningBorder:AG,warningText:DG,warningTextDark:OG,warningTextLight:_G},Symbol.toStringTag,{value:"Module"})),wK=$l,SK=wr,kK=Nr,TK=wr,CK=Zt,EK=ma,jK=Wo,F_=Nl,IK=Vo,DK=mi,_K=Nl,OK=It,AK=Zt,PK=Zt,MK=Nr,RK=Zt,H_=ma,BK=Nr,LK=yi,eb=Wo,NK=eb,$K=yi,FK=Nr,HK=mi,zK=mi,UK=Vo,WK=ma,z_=$l,VK=Pt,YK=Zt,qK=mi,GK=Sd,KK=Nr,QK=wr,XK=Wo,ZK=ma,JK=go,eQ=dg,tQ=xa,nQ=It,rQ=wr,oQ=Nl,iQ=It,aQ=wr,sQ=Vo,lQ=yi,uQ=Nl,cQ=HD,dQ=Pt,fQ=It,hQ=Nr,pQ=Zt,gQ=yi,U_=$l,mQ=wd,yQ=Nl,vQ=It,xQ=wr,bQ=Vo,W_=ma,wQ=It,SQ=Vo,kQ="rgba(200, 200, 200, .15)",TQ=ma,CQ=$l,EQ=Wo,jQ=It,IQ=H_,DQ=lg,_Q=U_,OQ=De,AQ=W_,PQ=vt,MQ=ms,RQ=vt,BQ=kd,V_=Vo,LQ=V_,NQ=wr,$Q="rgba(200, 200, 200, .25)",FQ=yi,HQ=ps,zQ=Hl,Y_=go,UQ=wd,WQ=Y_,q_=De,VQ=q_,tb=Zt,YQ=tb,qQ=tb,GQ="rgba(0, 0, 0, 0.6)",KQ=mi,G_=wr,QQ=G_,nb=Wo,XQ=Wo,ZQ=$l,JQ=mi,eX=wd,tX="rgba(0, 0, 0, 0.4)",nX=De,K_=vt,Q_=mi,rX=wr,oX=yi,iX=HD,aX=wr,sX=Wo,lX=yi,uX=K_,cX=nb,dX=nb,X_="transparent",fX="rgba(200, 200, 200, .3)",hX="rgba(200, 200, 200, .5)",pX=Q_,gX=X_,mX=OH,yX=fg,vX=dg,xX=VD,bX=dg,wX=cg,SX=dg,kX=ps,TX=Hl,CX=go,EX=va,jX=qD,IX=va,DX=e_,_X=pg,Z_=ZD,OX=Z_,AX=ba,PX=ba,MX=kd,RX=It,BX=z_,LX=Sd,NX=ug,$X=Nr,FX=wr,HX=Pt,zX=$l,UX=Nr,WX=Zt,VX=Wo,YX=n_,qX=Wo,GX=Nl,KX=Nr,QX=Pt,XX=It,ZX=eb,JX=mi,eZ=Zt,tZ=Zt,nZ=vt,rZ=yi,oZ=ma,iZ=Vo,aZ=It,J_=yi,sZ=J_,lZ=wa,uZ=Wo,cZ=Zt,dZ=xa,fZ=ag,hZ=F_,pZ=Object.freeze(Object.defineProperty({__proto__:null,buttonBareBackground:X_,buttonBareBackgroundActive:hX,buttonBareBackgroundHover:fX,buttonBareDisabledBackground:gX,buttonBareDisabledText:pX,buttonBareText:cX,buttonBareTextHover:dX,buttonMenuBackground:NQ,buttonMenuBackgroundHover:$Q,buttonMenuBorder:FQ,buttonMenuSelectedBackground:Y_,buttonMenuSelectedBackgroundHover:UQ,buttonMenuSelectedBorder:WQ,buttonMenuSelectedText:HQ,buttonMenuSelectedTextHover:zQ,buttonMenuText:V_,buttonMenuTextHover:LQ,buttonNormalBackground:ZQ,buttonNormalBackgroundHover:JQ,buttonNormalBorder:eX,buttonNormalDisabledBackground:rX,buttonNormalDisabledBorder:oX,buttonNormalDisabledText:Q_,buttonNormalSelectedBackground:K_,buttonNormalSelectedText:nX,buttonNormalShadow:tX,buttonNormalText:nb,buttonNormalTextHover:XQ,buttonPrimaryBackground:tb,buttonPrimaryBackgroundHover:YQ,buttonPrimaryBorder:qQ,buttonPrimaryDisabledBackground:G_,buttonPrimaryDisabledBorder:QQ,buttonPrimaryDisabledText:KQ,buttonPrimaryShadow:GQ,buttonPrimaryText:q_,buttonPrimaryTextHover:VQ,calendarBackground:aX,calendarItemBackground:lX,calendarItemText:sX,calendarSelectedBackground:uX,calendarText:iX,cardBackground:MK,cardBorder:RK,cardShadow:H_,checkboxBackgroundSelected:eZ,checkboxBorderSelected:tZ,checkboxShadowSelected:nZ,checkboxText:ZX,checkboxToggleBackground:JX,errorBackground:DX,errorBorder:PX,errorText:_X,errorTextDark:Z_,errorTextDarker:OX,errorTextMenu:AX,formInputBackground:$X,formInputBackgroundSelected:FX,formInputBackgroundSelection:HX,formInputBorder:zX,formInputBorderSelected:WX,formInputShadowSelected:QX,formInputText:VX,formInputTextHighlight:XX,formInputTextPlaceholder:qX,formInputTextPlaceholderSelected:GX,formInputTextReadOnlySelection:UX,formInputTextSelected:YX,formInputTextSelection:KX,formLabelBackground:NX,formLabelText:LX,markdownDark:RQ,markdownLight:BQ,markdownNormal:MQ,menuAutoCompleteBackground:U_,menuAutoCompleteBackgroundHover:mQ,menuAutoCompleteText:yQ,menuAutoCompleteTextHeader:vQ,menuBackground:aQ,menuBorder:hQ,menuBorderHover:pQ,menuItemBackground:sQ,menuItemBackgroundHover:lQ,menuItemText:uQ,menuItemTextHeader:fQ,menuItemTextHover:cQ,menuItemTextSelected:dQ,menuKeybindingText:gQ,mobileAccountShadow:IQ,mobileAccountText:DQ,mobileConfigServerViewTheme:PQ,mobileHeaderBackground:W_,mobileHeaderText:wQ,mobileHeaderTextHover:kQ,mobileHeaderTextSubdued:SQ,mobileModalBackground:_Q,mobileModalText:OQ,mobileNavBackground:CQ,mobileNavItem:EQ,mobileNavItemSelected:jQ,mobilePageBackground:TQ,mobileViewTheme:AQ,modalBackground:xQ,modalBorder:bQ,noticeBackground:mX,noticeBackgroundDark:vX,noticeBackgroundLight:yX,noticeBorder:kX,noticeText:xX,noticeTextDark:wX,noticeTextLight:bX,noticeTextMenu:SX,pageBackground:wK,pageBackgroundBottomRight:TK,pageBackgroundLineBottom:jK,pageBackgroundLineMid:EK,pageBackgroundLineTop:CK,pageBackgroundModalActive:SK,pageBackgroundTopLeft:kK,pageText:F_,pageTextDark:_K,pageTextLight:IK,pageTextLink:AK,pageTextLinkLight:PK,pageTextPositive:OK,pageTextSubdued:DK,pillBackground:rZ,pillBackgroundLight:oZ,pillBackgroundSelected:lZ,pillBorder:J_,pillBorderDark:sZ,pillBorderSelected:cZ,pillText:iZ,pillTextHighlighted:aZ,pillTextSelected:uZ,reportsBlue:fZ,reportsLabel:hZ,reportsRed:dZ,sidebarBackground:ZK,sidebarItemAccentSelected:nQ,sidebarItemBackgroundFailed:tQ,sidebarItemBackgroundHover:rQ,sidebarItemBackgroundPending:JK,sidebarItemBackgroundPositive:eQ,sidebarItemText:oQ,sidebarItemTextSelected:iQ,tableBackground:BK,tableBorder:z_,tableBorderHover:YK,tableBorderSelected:VK,tableBorderSeparator:qK,tableHeaderBackground:WK,tableHeaderText:UK,tableRowBackgroundHighlight:GK,tableRowBackgroundHighlightText:KK,tableRowBackgroundHover:LK,tableRowHeaderBackground:QK,tableRowHeaderText:XK,tableText:eb,tableTextHover:HK,tableTextInactive:zK,tableTextLight:NK,tableTextSelected:FK,tableTextSubdued:$K,upcomingBackground:MX,upcomingBorder:BX,upcomingText:RX,warningBackground:TX,warningBorder:IX,warningText:CX,warningTextDark:jX,warningTextLight:EX},Symbol.toStringTag,{value:"Module"})),Bs={light:{name:"Light",colors:$_},dark:{name:"Dark",colors:Tk},midnight:{name:"Midnight",colors:pZ},auto:{name:"System default",colors:Tk},...bd()&&{development:{name:"Development",colors:SY}}},eO=Object.entries(Bs).map(([e,{name:t}])=>[e,t]);function rb(){const[e="light",t]=fs("theme");return[e,t]}function gZ(){const[e]=rb(),[t,n]=g.useState(void 0);if(g.useEffect(()=>{if(e==="auto"){let o=function(a){a.matches?n(Bs.dark.colors):n(Bs.light.colors)};const i=window.matchMedia("(prefers-color-scheme: dark)");return i.addEventListener("change",o),i.matches?n(Bs.dark.colors):n(Bs.light.colors),()=>{i.removeEventListener("change",o)}}else n(Bs[e].colors)},[e]),!t)return null;const r=Object.keys(t).map(o=>` --color-${o}: ${t[o]};`).join(`
|
|
63
|
+
`);return s.jsx("style",{children:`:root {
|
|
64
|
+
${r}}`})}const S=Object.fromEntries(Object.keys($_).map(e=>[e,`var(--color-${e})`])),Ck=40,X={incomeHeaderHeight:70,cardShadow:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)",monthRightPadding:5,menuBorderRadius:4,mobileMinHeight:Ck,mobileMenuItem:{fontSize:17,fontWeight:400,paddingTop:8,paddingBottom:8,height:Ck},mobileEditingPadding:12,altMenuMaxHeight:250,altMenuText:{fontSize:13},altMenuHeaderText:{fontSize:13,fontWeight:700},veryLargeText:{fontSize:30,fontWeight:600},largeText:{fontSize:20,fontWeight:700,letterSpacing:.5},mediumText:{fontSize:15,fontWeight:500},smallText:{fontSize:13},verySmallText:{fontSize:13},tinyText:{fontSize:10},page:{flex:1,"@media (max-height: 550px)":{minHeight:700},paddingTop:8,[`@media (min-width: ${fr.breakpoint_small})`]:{paddingTop:36}},pageContent:{paddingLeft:2,paddingRight:2,[`@media (min-width: ${fr.breakpoint_small})`]:{paddingLeft:20,paddingRight:20}},settingsPageContent:{padding:20,[`@media (min-width: ${fr.breakpoint_small})`]:{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:""},text:{fontSize:16},delayedFadeIn:{animationName:gd({"0%":{opacity:0},"100%":{opacity:1}}),animationDuration:"1s",animationFillMode:"both",animationDelay:"0.5s"},underlinedText:{textDecoration:"underline",textDecorationThickness:2,textDecorationColor:S.pillBorder},noTapHighlight:{WebkitTapHighlightColor:"transparent",":focus":{outline:"none"}},lineClamp:e=>({display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-word"}),lightScrollbar:null,darkScrollbar:null,scrollbarWidth:null};let ll=!1;function Ek(){X.lightScrollbar=!ll&&{"& ::-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"}},X.darkScrollbar=!ll&&{"& ::-webkit-scrollbar":{width:7,backgroundColor:"rgba(0, 0, 0, 0)"},"& ::-webkit-scrollbar-thumb:vertical":{backgroundColor:"rgba(200, 200, 200, .5)"}},X.scrollbarWidth=ll?0:13}{let e=function(){const t=document.createElement("div");t.innerHTML='<div style="width:100px;height:100px;overflow:scroll;position:absolute;top:-9999px;"/>',document.body.appendChild(t);const n=t.childNodes[0];return n.offsetWidth===n.clientWidth};ll=e(),Ek(),window.addEventListener("focus",()=>{ll=e(),Ek()})}const Gm=()=>ll,mZ=e=>{const{color:t="currentColor"}=e,[n]=g.useState("gradient-"+Math.random());return s.jsxs("svg",{...e,viewBox:"0 0 38 38",style:{...e.style},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{x1:"8.042%",y1:"0%",x2:"65.682%",y2:"23.865%",id:n,children:[s.jsx("stop",{stopColor:t,stopOpacity:0,offset:"0%"}),s.jsx("stop",{stopColor:t,stopOpacity:.631,offset:"63.146%"}),s.jsx("stop",{stopColor:t,offset:"100%"})]})}),s.jsxs("g",{transform:"translate(1 2)",fill:"none",fillRule:"evenodd",children:[s.jsx("path",{d:"M36 18c0-9.94-8.06-18-18-18",stroke:"url(#"+n+")",strokeWidth:2,fill:"none"}),s.jsx("circle",{fill:t,cx:36,cy:18,r:1})]})]})},yZ=gd({"0%":{transform:"rotate(-90deg)"},"100%":{transform:"rotate(666deg)"}});function vi(e){return s.jsx("span",{className:`${ze({animationName:yZ,animationDuration:"1.6s",animationTimingFunction:"cubic-bezier(0.17, 0.67, 0.83, 0.67)",animationIterationCount:"infinite",lineHeight:0})}`,children:s.jsx(mZ,{...e})})}function We(e){const{className:t="",style:n,innerRef:r,...o}=e;return s.jsx("div",{...o,ref:r,className:`${t} ${ze(n)}`})}const I=e=>{const{className:t="",style:n,nativeStyle:r,innerRef:o,...i}=e;return s.jsx("div",{...i,ref:o,style:r,className:`view ${t} ${ze(n)}`})};function yg(e){return s.jsx(vZ,{...e},e.name)}function vZ({name:e,message:t,importer:n}){const[r,o]=g.useState(null);return g.useEffect(()=>{n().then(i=>o(()=>i[e]))},[e,n]),r?s.jsx(r,{}):s.jsxs(I,{style:{flex:1,gap:20,justifyContent:"center",alignItems:"center",...X.delayedFadeIn},children:[t&&s.jsx(We,{style:{marginBottom:20,fontSize:18},children:t}),s.jsx(vi,{width:25,color:S.pageTextDark})]})}function xZ(){return s.jsx("div",{style:{position:"absolute",top:0,bottom:0,left:0,right:0,backgroundColor:S.pageBackground},children:s.jsxs("svg",{viewBox:"0 0 642 535",fill:"none",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"none",style:{position:"absolute",top:0,left:0,height:"100%",width:"100%"},children:[s.jsx("path",{fill:"url(#paint0_linear)",d:"M0 0h642v535H0z"}),s.jsx("defs",{children:s.jsxs("linearGradient",{id:"paint0_linear",x1:"162",y1:"23.261",x2:"468.904",y2:"520.44",gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:S.pageBackgroundTopLeft}),s.jsx("stop",{offset:"1",stopColor:S.pageBackgroundBottomRight,stopOpacity:"0.5"})]})}),s.jsx(yg,{importer:()=>Dl(()=>import("./BackgroundImage.UwhfLEYN.chunk.js"),__vite__mapDeps([])),name:"BackgroundImage"})]})})}function cv({initializing:e,loadingText:t}){return s.jsxs(s.Fragment,{children:[s.jsx(xZ,{}),(t!=null||e)&&s.jsxs(I,{className:`${ze({position:"absolute",top:0,left:0,right:0,padding:50,paddingTop:200,color:S.pageText,alignItems:"center"})}`,children:[s.jsx(We,{style:{marginBottom:20,fontSize:18},children:t}),s.jsx(vi,{width:25,color:S.pageText})]})]})}const bZ={purple:S.pageTextPositive,blue:S.pageTextLink,muted:"inherit"},Ve=g.forwardRef(({children:e,to:t,linkColor:n="blue"},r)=>s.jsx("a",{ref:r,href:t,target:"_blank",rel:"noopener noreferrer",style:{color:bZ[n]},children:e}));Ve.displayName="ExternalLink";function wZ(){return s.jsxs(I,{style:{padding:"6px 20px",display:"flex",flexDirection:"row",justifyContent:"space-between",color:S.warningText,backgroundColor:S.warningBackground,borderBottom:`1px solid ${S.warningBorder}`,zIndex:1,flexShrink:0},children:[s.jsx(I,{children:"This is a demo build of Actual."}),s.jsx(I,{children:s.jsxs(Ve,{linkColor:"purple",to:`https://github.com/actualbudget/actual/pull/${pl.env.REACT_APP_REVIEW_ID}`,children:["Open the PR: #",pl.env.REACT_APP_REVIEW_ID]})})]})}const SZ={normal:S.buttonNormalBackground,normalDisabled:S.buttonNormalDisabledBackground,primary:S.buttonPrimaryBackground,primaryDisabled:S.buttonPrimaryDisabledBackground,bare:S.buttonBareBackground,bareDisabled:S.buttonBareDisabledBackground,menu:S.buttonMenuBackground,menuSelected:S.buttonMenuSelectedBackground,link:S.buttonBareBackground},kZ={normal:S.buttonNormalBackgroundHover,primary:S.buttonPrimaryBackgroundHover,bare:S.buttonBareBackgroundHover,menu:S.buttonMenuBackgroundHover,menuSelected:S.buttonMenuSelectedBackgroundHover,link:S.buttonBareBackground},TZ={normal:S.buttonNormalBorder,normalDisabled:S.buttonNormalDisabledBorder,primary:S.buttonPrimaryBorder,primaryDisabled:S.buttonPrimaryDisabledBorder,menu:S.buttonMenuBorder,menuSelected:S.buttonMenuSelectedBorder,link:S.buttonBareBackground},CZ={normal:S.buttonNormalText,normalDisabled:S.buttonNormalDisabledText,primary:S.buttonPrimaryText,primaryDisabled:S.buttonPrimaryDisabledText,bare:S.buttonBareText,bareDisabled:S.buttonBareDisabledText,menu:S.buttonMenuText,menuSelected:S.buttonMenuSelectedText,link:S.pageTextLink},EZ={normal:S.buttonNormalTextHover,primary:S.buttonPrimaryTextHover,bare:S.buttonBareTextHover,menu:S.buttonMenuTextHover,menuSelected:S.buttonMenuSelectedTextHover},jZ={textDecoration:"underline",boxShadow:"none"},IZ=(e,t)=>{switch(e){case"bare":case"link":return"none";default:return"1px solid "+TZ[t]}},DZ=e=>{switch(e){case"bare":return"5px";case"link":return"0";default:return"5px 10px"}},_Z=(e,t)=>{switch(e){case"bare":return{backgroundColor:S.buttonBareBackgroundActive};case"link":return{transform:"none",boxShadow:"none"};default:return{transform:t?"translateY(1px)":void 0,boxShadow:`0 1px 4px 0 ${e==="primary"?S.buttonPrimaryShadow:S.buttonNormalShadow}`,transition:"none"}}},q=g.forwardRef(({children:e,pressed:t,hover:n,type:r="normal",isSubmit:o=r==="primary",color:i,style:a,disabled:l,hoveredStyle:u,activeStyle:c,bounce:f=!0,as:d="button",...h},p)=>{const m=l?`${r}Disabled`:r;u={...r!=="bare"&&X.shadow,...r==="link"&&jZ,backgroundColor:kZ[r],color:i||EZ[r],...u},c={..._Z(r,f),...c};const x=d,k={alignItems:"center",justifyContent:"center",flexShrink:0,padding:DZ(r),margin:0,overflow:"hidden",display:r==="link"?"inline":"flex",borderRadius:4,backgroundColor:SZ[m],border:IZ(r,m),color:i||CZ[m],transition:"box-shadow .25s",WebkitAppRegion:"no-drag",...X.smallText,":hover":!l&&u,":active":!l&&c,...n&&u,...t&&c,...a};return s.jsx(x,{ref:p,...typeof d=="string"?ze(k):{style:k},disabled:l,type:o?"submit":"button",...h,children:e})});q.displayName="Button";const mt=g.forwardRef((e,t)=>{const{loading:n,children:r,...o}=e;return s.jsxs(q,{...o,ref:t,style:{position:"relative",...o.style},children:[n&&s.jsx(I,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center"},children:s.jsx(vi,{style:{width:20,height:20}})}),s.jsx(I,{style:{opacity:n?0:1,flexDirection:"row",alignItems:"center"},children:r})]})});mt.displayName="ButtonWithLoading";function Ro({style:e,children:t,...n}){return s.jsx("button",{type:"button",className:`${ze([{textDecoration:"none",color:S.pageTextLink,backgroundColor:"transparent",display:"inline",border:0,cursor:"pointer",padding:0,font:"inherit",":hover":{textDecoration:"underline",boxShadow:"none"},":focus":{boxShadow:"none"}},X.smallText,e])}`,...n,children:t})}var dv={exports:{}},ts={},fv={exports:{}},mo={},hv={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;/*!
|
|
65
|
+
* Adapted from jQuery UI core
|
|
66
|
+
*
|
|
67
|
+
* http://jqueryui.com
|
|
68
|
+
*
|
|
69
|
+
* Copyright 2014 jQuery Foundation and other contributors
|
|
70
|
+
* Released under the MIT license.
|
|
71
|
+
* http://jquery.org/license
|
|
72
|
+
*
|
|
73
|
+
* http://api.jqueryui.com/category/ui-core/
|
|
74
|
+
*/var n="none",r="contents",o=/input|select|textarea|button|object|iframe/;function i(d,h){return h.getPropertyValue("overflow")!=="visible"||d.scrollWidth<=0&&d.scrollHeight<=0}function a(d){var h=d.offsetWidth<=0&&d.offsetHeight<=0;if(h&&!d.innerHTML)return!0;try{var p=window.getComputedStyle(d),m=p.getPropertyValue("display");return h?m!==r&&i(d,p):m===n}catch{return console.warn("Failed to inspect element style"),!1}}function l(d){for(var h=d,p=d.getRootNode&&d.getRootNode();h&&h!==document.body;){if(p&&h===p&&(h=p.host.parentNode),a(h))return!1;h=h.parentNode}return!0}function u(d,h){var p=d.nodeName.toLowerCase(),m=o.test(p)&&!d.disabled||p==="a"&&d.href||h;return m&&l(d)}function c(d){var h=d.getAttribute("tabindex");h===null&&(h=void 0);var p=isNaN(h);return(p||h>=0)&&u(d,!p)}function f(d){var h=[].slice.call(d.querySelectorAll("*"),0).reduce(function(p,m){return p.concat(m.shadowRoot?f(m.shadowRoot):[m])},[]);return h.filter(c)}e.exports=t.default})(hv,hv.exports);var tO=hv.exports;Object.defineProperty(mo,"__esModule",{value:!0});mo.resetState=MZ;mo.log=RZ;mo.handleBlur=Ic;mo.handleFocus=Dc;mo.markForFocusLater=BZ;mo.returnFocus=LZ;mo.popWithoutFocus=NZ;mo.setupScopedFocus=$Z;mo.teardownScopedFocus=FZ;var OZ=tO,AZ=PZ(OZ);function PZ(e){return e&&e.__esModule?e:{default:e}}var kl=[],Xs=null,pv=!1;function MZ(){kl=[]}function RZ(){}function Ic(){pv=!0}function Dc(){if(pv){if(pv=!1,!Xs)return;setTimeout(function(){if(!Xs.contains(document.activeElement)){var e=(0,AZ.default)(Xs)[0]||Xs;e.focus()}},0)}}function BZ(){kl.push(document.activeElement)}function LZ(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=null;try{kl.length!==0&&(t=kl.pop(),t.focus({preventScroll:e}));return}catch{console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}}function NZ(){kl.length>0&&kl.pop()}function $Z(e){Xs=e,window.addEventListener?(window.addEventListener("blur",Ic,!1),document.addEventListener("focus",Dc,!0)):(window.attachEvent("onBlur",Ic),document.attachEvent("onFocus",Dc))}function FZ(){Xs=null,window.addEventListener?(window.removeEventListener("blur",Ic),document.removeEventListener("focus",Dc)):(window.detachEvent("onBlur",Ic),document.detachEvent("onFocus",Dc))}var gv={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=tO,r=o(n);function o(l){return l&&l.__esModule?l:{default:l}}function i(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return l.activeElement.shadowRoot?i(l.activeElement.shadowRoot):l.activeElement}function a(l,u){var c=(0,r.default)(l);if(!c.length){u.preventDefault();return}var f=void 0,d=u.shiftKey,h=c[0],p=c[c.length-1],m=i();if(l===m){if(!d)return;f=p}if(p===m&&!d&&(f=h),h===m&&d&&(f=p),f){u.preventDefault(),f.focus();return}var x=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),k=x!=null&&x[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(k){var v=c.indexOf(m);if(v>-1&&(v+=d?-1:1),f=c[v],typeof f>"u"){u.preventDefault(),f=d?p:h,f.focus();return}u.preventDefault(),f.focus()}}e.exports=t.default})(gv,gv.exports);var HZ=gv.exports,yo={},zZ=function(){},UZ=zZ,ao={},nO={exports:{}};/*!
|
|
75
|
+
Copyright (c) 2015 Jed Watson.
|
|
76
|
+
Based on code that is Copyright 2013-2015, Facebook, Inc.
|
|
77
|
+
All rights reserved.
|
|
78
|
+
*/(function(e){(function(){var t=!!(typeof window<"u"&&window.document&&window.document.createElement),n={canUseDOM:t,canUseWorkers:typeof Worker<"u",canUseEventListeners:t&&!!(window.addEventListener||window.attachEvent),canUseViewport:t&&!!window.screen};e.exports?e.exports=n:window.ExecutionEnvironment=n})()})(nO);var WZ=nO.exports;Object.defineProperty(ao,"__esModule",{value:!0});ao.canUseDOM=ao.SafeNodeList=ao.SafeHTMLCollection=void 0;var VZ=WZ,YZ=qZ(VZ);function qZ(e){return e&&e.__esModule?e:{default:e}}var vg=YZ.default,GZ=vg.canUseDOM?window.HTMLElement:{};ao.SafeHTMLCollection=vg.canUseDOM?window.HTMLCollection:{};ao.SafeNodeList=vg.canUseDOM?window.NodeList:{};ao.canUseDOM=vg.canUseDOM;ao.default=GZ;Object.defineProperty(yo,"__esModule",{value:!0});yo.resetState=JZ;yo.log=eJ;yo.assertNodeList=rO;yo.setElement=tJ;yo.validateElement=ob;yo.hide=nJ;yo.show=rJ;yo.documentNotReadyOrSSRTesting=oJ;var KZ=UZ,QZ=ZZ(KZ),XZ=ao;function ZZ(e){return e&&e.__esModule?e:{default:e}}var Cr=null;function JZ(){Cr&&(Cr.removeAttribute?Cr.removeAttribute("aria-hidden"):Cr.length!=null?Cr.forEach(function(e){return e.removeAttribute("aria-hidden")}):document.querySelectorAll(Cr).forEach(function(e){return e.removeAttribute("aria-hidden")})),Cr=null}function eJ(){}function rO(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function tJ(e){var t=e;if(typeof t=="string"&&XZ.canUseDOM){var n=document.querySelectorAll(t);rO(n,t),t=n}return Cr=t||Cr,Cr}function ob(e){var t=e||Cr;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,QZ.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(" ")),[])}function nJ(e){var t=!0,n=!1,r=void 0;try{for(var o=ob(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.setAttribute("aria-hidden","true")}}catch(l){n=!0,r=l}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}function rJ(e){var t=!0,n=!1,r=void 0;try{for(var o=ob(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.removeAttribute("aria-hidden")}}catch(l){n=!0,r=l}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}function oJ(){Cr=null}var zl={};Object.defineProperty(zl,"__esModule",{value:!0});zl.resetState=iJ;zl.log=aJ;var Vu={},Yu={};function jk(e,t){e.classList.remove(t)}function iJ(){var e=document.getElementsByTagName("html")[0];for(var t in Vu)jk(e,Vu[t]);var n=document.body;for(var r in Yu)jk(n,Yu[r]);Vu={},Yu={}}function aJ(){}var sJ=function(t,n){return t[n]||(t[n]=0),t[n]+=1,n},lJ=function(t,n){return t[n]&&(t[n]-=1),n},uJ=function(t,n,r){r.forEach(function(o){sJ(n,o),t.add(o)})},cJ=function(t,n,r){r.forEach(function(o){lJ(n,o),n[o]===0&&t.remove(o)})};zl.add=function(t,n){return uJ(t.classList,t.nodeName.toLowerCase()=="html"?Vu:Yu,n.split(" "))};zl.remove=function(t,n){return cJ(t.classList,t.nodeName.toLowerCase()=="html"?Vu:Yu,n.split(" "))};var Ul={};Object.defineProperty(Ul,"__esModule",{value:!0});Ul.log=fJ;Ul.resetState=hJ;function dJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var oO=function e(){var t=this;dJ(this,e),this.register=function(n){t.openInstances.indexOf(n)===-1&&(t.openInstances.push(n),t.emit("register"))},this.deregister=function(n){var r=t.openInstances.indexOf(n);r!==-1&&(t.openInstances.splice(r,1),t.emit("deregister"))},this.subscribe=function(n){t.subscribers.push(n)},this.emit=function(n){t.subscribers.forEach(function(r){return r(n,t.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},Kh=new oO;function fJ(){console.log("portalOpenInstances ----------"),console.log(Kh.openInstances.length),Kh.openInstances.forEach(function(e){return console.log(e)}),console.log("end portalOpenInstances ----------")}function hJ(){Kh=new oO}Ul.default=Kh;var ib={};Object.defineProperty(ib,"__esModule",{value:!0});ib.resetState=yJ;ib.log=vJ;var pJ=Ul,gJ=mJ(pJ);function mJ(e){return e&&e.__esModule?e:{default:e}}var bn=void 0,Qr=void 0,qa=[];function yJ(){for(var e=[bn,Qr],t=0;t<e.length;t++){var n=e[t];n&&n.parentNode&&n.parentNode.removeChild(n)}bn=Qr=null,qa=[]}function vJ(){console.log("bodyTrap ----------"),console.log(qa.length);for(var e=[bn,Qr],t=0;t<e.length;t++){var n=e[t],r=n||{};console.log(r.nodeName,r.className,r.id)}console.log("edn bodyTrap ----------")}function Ik(){qa.length!==0&&qa[qa.length-1].focusContent()}function xJ(e,t){!bn&&!Qr&&(bn=document.createElement("div"),bn.setAttribute("data-react-modal-body-trap",""),bn.style.position="absolute",bn.style.opacity="0",bn.setAttribute("tabindex","0"),bn.addEventListener("focus",Ik),Qr=bn.cloneNode(),Qr.addEventListener("focus",Ik)),qa=t,qa.length>0?(document.body.firstChild!==bn&&document.body.insertBefore(bn,document.body.firstChild),document.body.lastChild!==Qr&&document.body.appendChild(Qr)):(bn.parentElement&&bn.parentElement.removeChild(bn),Qr.parentElement&&Qr.parentElement.removeChild(Qr))}gJ.default.subscribe(xJ);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(L){for(var R=1;R<arguments.length;R++){var U=arguments[R];for(var P in U)Object.prototype.hasOwnProperty.call(U,P)&&(L[P]=U[P])}return L},r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(L){return typeof L}:function(L){return L&&typeof Symbol=="function"&&L.constructor===Symbol&&L!==Symbol.prototype?"symbol":typeof L},o=function(){function L(R,U){for(var P=0;P<U.length;P++){var j=U[P];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(R,j.key,j)}}return function(R,U,P){return U&&L(R.prototype,U),P&&L(R,P),R}}(),i=g,a=mx,l=E(a),u=mo,c=w(u),f=HZ,d=E(f),h=yo,p=w(h),m=zl,x=w(m),k=ao,v=E(k),y=Ul,b=E(y);function w(L){if(L&&L.__esModule)return L;var R={};if(L!=null)for(var U in L)Object.prototype.hasOwnProperty.call(L,U)&&(R[U]=L[U]);return R.default=L,R}function E(L){return L&&L.__esModule?L:{default:L}}function T(L,R){if(!(L instanceof R))throw new TypeError("Cannot call a class as a function")}function _(L,R){if(!L)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:L}function M(L,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);L.prototype=Object.create(R&&R.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(L,R):L.__proto__=R)}var B={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},O=function(R){return R.code==="Tab"||R.keyCode===9},N=function(R){return R.code==="Escape"||R.keyCode===27},H=0,F=function(L){M(R,L);function R(U){T(this,R);var P=_(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,U));return P.setOverlayRef=function(j){P.overlay=j,P.props.overlayRef&&P.props.overlayRef(j)},P.setContentRef=function(j){P.content=j,P.props.contentRef&&P.props.contentRef(j)},P.afterClose=function(){var j=P.props,D=j.appElement,C=j.ariaHideApp,$=j.htmlOpenClassName,W=j.bodyOpenClassName,A=j.parentSelector,J=A&&A().ownerDocument||document;W&&x.remove(J.body,W),$&&x.remove(J.getElementsByTagName("html")[0],$),C&&H>0&&(H-=1,H===0&&p.show(D)),P.props.shouldFocusAfterRender&&(P.props.shouldReturnFocusAfterClose?(c.returnFocus(P.props.preventScroll),c.teardownScopedFocus()):c.popWithoutFocus()),P.props.onAfterClose&&P.props.onAfterClose(),b.default.deregister(P)},P.open=function(){P.beforeOpen(),P.state.afterOpen&&P.state.beforeClose?(clearTimeout(P.closeTimer),P.setState({beforeClose:!1})):(P.props.shouldFocusAfterRender&&(c.setupScopedFocus(P.node),c.markForFocusLater()),P.setState({isOpen:!0},function(){P.openAnimationFrame=requestAnimationFrame(function(){P.setState({afterOpen:!0}),P.props.isOpen&&P.props.onAfterOpen&&P.props.onAfterOpen({overlayEl:P.overlay,contentEl:P.content})})}))},P.close=function(){P.props.closeTimeoutMS>0?P.closeWithTimeout():P.closeWithoutTimeout()},P.focusContent=function(){return P.content&&!P.contentHasFocus()&&P.content.focus({preventScroll:!0})},P.closeWithTimeout=function(){var j=Date.now()+P.props.closeTimeoutMS;P.setState({beforeClose:!0,closesAt:j},function(){P.closeTimer=setTimeout(P.closeWithoutTimeout,P.state.closesAt-Date.now())})},P.closeWithoutTimeout=function(){P.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},P.afterClose)},P.handleKeyDown=function(j){O(j)&&(0,d.default)(P.content,j),P.props.shouldCloseOnEsc&&N(j)&&(j.stopPropagation(),P.requestClose(j))},P.handleOverlayOnClick=function(j){P.shouldClose===null&&(P.shouldClose=!0),P.shouldClose&&P.props.shouldCloseOnOverlayClick&&(P.ownerHandlesClose()?P.requestClose(j):P.focusContent()),P.shouldClose=null},P.handleContentOnMouseUp=function(){P.shouldClose=!1},P.handleOverlayOnMouseDown=function(j){!P.props.shouldCloseOnOverlayClick&&j.target==P.overlay&&j.preventDefault()},P.handleContentOnClick=function(){P.shouldClose=!1},P.handleContentOnMouseDown=function(){P.shouldClose=!1},P.requestClose=function(j){return P.ownerHandlesClose()&&P.props.onRequestClose(j)},P.ownerHandlesClose=function(){return P.props.onRequestClose},P.shouldBeClosed=function(){return!P.state.isOpen&&!P.state.beforeClose},P.contentHasFocus=function(){return document.activeElement===P.content||P.content.contains(document.activeElement)},P.buildClassName=function(j,D){var C=(typeof D>"u"?"undefined":r(D))==="object"?D:{base:B[j],afterOpen:B[j]+"--after-open",beforeClose:B[j]+"--before-close"},$=C.base;return P.state.afterOpen&&($=$+" "+C.afterOpen),P.state.beforeClose&&($=$+" "+C.beforeClose),typeof D=="string"&&D?$+" "+D:$},P.attributesFromObject=function(j,D){return Object.keys(D).reduce(function(C,$){return C[j+"-"+$]=D[$],C},{})},P.state={afterOpen:!1,beforeClose:!1},P.shouldClose=null,P.moveFromContentToOverlay=null,P}return o(R,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(P,j){this.props.isOpen&&!P.isOpen?this.open():!this.props.isOpen&&P.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!j.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var P=this.props,j=P.appElement,D=P.ariaHideApp,C=P.htmlOpenClassName,$=P.bodyOpenClassName,W=P.parentSelector,A=W&&W().ownerDocument||document;$&&x.add(A.body,$),C&&x.add(A.getElementsByTagName("html")[0],C),D&&(H+=1,p.hide(j)),b.default.register(this)}},{key:"render",value:function(){var P=this.props,j=P.id,D=P.className,C=P.overlayClassName,$=P.defaultStyles,W=P.children,A=D?{}:$.content,J=C?{}:$.overlay;if(this.shouldBeClosed())return null;var le={ref:this.setOverlayRef,className:this.buildClassName("overlay",C),style:n({},J,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},ee=n({id:j,ref:this.setContentRef,style:n({},A,this.props.style.content),className:this.buildClassName("content",D),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",n({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),ie=this.props.contentElement(ee,W);return this.props.overlayElement(le,ie)}}]),R}(i.Component);F.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},F.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(v.default),l.default.instanceOf(k.SafeHTMLCollection),l.default.instanceOf(k.SafeNodeList),l.default.arrayOf(l.default.instanceOf(v.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=F,e.exports=t.default})(fv,fv.exports);var bJ=fv.exports;function iO(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function aO(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r??null}this.setState(t.bind(this))}function sO(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}}iO.__suppressDeprecationWarning=!0;aO.__suppressDeprecationWarning=!0;sO.__suppressDeprecationWarning=!0;function wJ(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var n=null,r=null,o=null;if(typeof t.componentWillMount=="function"?n="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?o="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(o="UNSAFE_componentWillUpdate"),n!==null||r!==null||o!==null){var i=e.displayName||e.name,a=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
79
|
+
|
|
80
|
+
`+i+" uses "+a+" but also contains the following legacy lifecycles:"+(n!==null?`
|
|
81
|
+
`+n:"")+(r!==null?`
|
|
82
|
+
`+r:"")+(o!==null?`
|
|
83
|
+
`+o:"")+`
|
|
84
|
+
|
|
85
|
+
The above lifecycles should be removed. Learn more about this warning here:
|
|
86
|
+
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=iO,t.componentWillReceiveProps=aO),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=sO;var l=t.componentDidUpdate;t.componentDidUpdate=function(c,f,d){var h=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:d;l.call(this,c,f,h)}}return e}const SJ=Object.freeze(Object.defineProperty({__proto__:null,polyfill:wJ},Symbol.toStringTag,{value:"Module"})),kJ=H2(SJ);Object.defineProperty(ts,"__esModule",{value:!0});ts.bodyOpenClassName=ts.portalClassName=void 0;var Dk=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},TJ=function(){function e(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),lO=g,Qh=Td(lO),CJ=Pl,Xh=Td(CJ),EJ=mx,ve=Td(EJ),jJ=bJ,_k=Td(jJ),IJ=yo,DJ=OJ(IJ),Wi=ao,Ok=Td(Wi),_J=kJ;function OJ(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function Td(e){return e&&e.__esModule?e:{default:e}}function AJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ak(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function PJ(e,t){if(typeof t!="function"&&t!==null)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)}var MJ=ts.portalClassName="ReactModalPortal",RJ=ts.bodyOpenClassName="ReactModal__Body--open",Da=Wi.canUseDOM&&Xh.default.createPortal!==void 0,Pk=function(t){return document.createElement(t)},Mk=function(){return Da?Xh.default.createPortal:Xh.default.unstable_renderSubtreeIntoContainer};function bf(e){return e()}var Cd=function(e){PJ(t,e);function t(){var n,r,o,i;AJ(this,t);for(var a=arguments.length,l=Array(a),u=0;u<a;u++)l[u]=arguments[u];return i=(r=(o=Ak(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(l))),o),o.removePortal=function(){!Da&&Xh.default.unmountComponentAtNode(o.node);var c=bf(o.props.parentSelector);c&&c.contains(o.node)?c.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(c){o.portal=c},o.renderPortal=function(c){var f=Mk(),d=f(o,Qh.default.createElement(_k.default,Dk({defaultStyles:t.defaultStyles},c)),o.node);o.portalRef(d)},r),Ak(o,i)}return TJ(t,[{key:"componentDidMount",value:function(){if(Wi.canUseDOM){Da||(this.node=Pk("div")),this.node.className=this.props.portalClassName;var r=bf(this.props.parentSelector);r.appendChild(this.node),!Da&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(r){var o=bf(r.parentSelector),i=bf(this.props.parentSelector);return{prevParent:o,nextParent:i}}},{key:"componentDidUpdate",value:function(r,o,i){if(Wi.canUseDOM){var a=this.props,l=a.isOpen,u=a.portalClassName;r.portalClassName!==u&&(this.node.className=u);var c=i.prevParent,f=i.nextParent;f!==c&&(c.removeChild(this.node),f.appendChild(this.node)),!(!r.isOpen&&!l)&&!Da&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!Wi.canUseDOM||!this.node||!this.portal)){var r=this.portal.state,o=Date.now(),i=r.isOpen&&this.props.closeTimeoutMS&&(r.closesAt||o+this.props.closeTimeoutMS);i?(r.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,i-o)):this.removePortal()}}},{key:"render",value:function(){if(!Wi.canUseDOM||!Da)return null;!this.node&&Da&&(this.node=Pk("div"));var r=Mk();return r(Qh.default.createElement(_k.default,Dk({ref:this.portalRef,defaultStyles:t.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(r){DJ.setElement(r)}}]),t}(lO.Component);Cd.propTypes={isOpen:ve.default.bool.isRequired,style:ve.default.shape({content:ve.default.object,overlay:ve.default.object}),portalClassName:ve.default.string,bodyOpenClassName:ve.default.string,htmlOpenClassName:ve.default.string,className:ve.default.oneOfType([ve.default.string,ve.default.shape({base:ve.default.string.isRequired,afterOpen:ve.default.string.isRequired,beforeClose:ve.default.string.isRequired})]),overlayClassName:ve.default.oneOfType([ve.default.string,ve.default.shape({base:ve.default.string.isRequired,afterOpen:ve.default.string.isRequired,beforeClose:ve.default.string.isRequired})]),appElement:ve.default.oneOfType([ve.default.instanceOf(Ok.default),ve.default.instanceOf(Wi.SafeHTMLCollection),ve.default.instanceOf(Wi.SafeNodeList),ve.default.arrayOf(ve.default.instanceOf(Ok.default))]),onAfterOpen:ve.default.func,onRequestClose:ve.default.func,closeTimeoutMS:ve.default.number,ariaHideApp:ve.default.bool,shouldFocusAfterRender:ve.default.bool,shouldCloseOnOverlayClick:ve.default.bool,shouldReturnFocusAfterClose:ve.default.bool,preventScroll:ve.default.bool,parentSelector:ve.default.func,aria:ve.default.object,data:ve.default.object,role:ve.default.string,contentLabel:ve.default.string,shouldCloseOnEsc:ve.default.bool,overlayRef:ve.default.func,contentRef:ve.default.func,id:ve.default.string,overlayElement:ve.default.func,contentElement:ve.default.func};Cd.defaultProps={isOpen:!1,portalClassName:MJ,bodyOpenClassName:RJ,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(t,n){return Qh.default.createElement("div",t,n)},contentElement:function(t,n){return Qh.default.createElement("div",t,n)}};Cd.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,_J.polyfill)(Cd);ts.default=Cd;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=ts,r=o(n);function o(i){return i&&i.__esModule?i:{default:i}}t.default=r.default,e.exports=t.default})(dv,dv.exports);var BJ=dv.exports;const LJ=mr(BJ),ab=e=>s.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:[s.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"}),s.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"})]}),Ed=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.jsx("path",{fill:"none",stroke:"currentColor",d:"m2 2 20 20M22 2 2 22",strokeLinecap:"round",strokeMiterlimit:10,strokeWidth:4})}),xg=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 15",style:{color:"inherit",...e.style},children:s.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"})}),NJ=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 91 51",style:{color:"inherit",...e.style},children:s.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"})}),uO=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.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"})}),$J=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32",style:{color:"inherit",...e.style},children:s.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:10,strokeWidth:3.5,d:"M24 29h5.333M8 29H2.667M16 21l-8 8M16 21l8 8M16 2.667v18.666M16 2.667 8 9.333M16 2.667l8 6.666"})}),sb=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32",style:{color:"inherit",...e.style},children:s.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:10,strokeWidth:3.5,d:"m30 9-4-4M30 9l-4 4M6 5 2 9M2 9l4 4M10 9H3M22 9h7M16 15l6-6M16 15l-6-6M16 28V15"})});function FJ(e){return function(t){e.forEach(function(n){typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function HJ(e){let t=e;for(let n=0;n<10&&t;n++){const r="dataset"in t?t.dataset?.focusKey:void 0;if(r)return r;t=t.parentNode}return null}function zJ(e,t){if(t){const n=HJ(e);e.focus({preventScroll:n&&n===t.keyRef.current}),t.onKeyChange(n)}else e.focus();e instanceof HTMLInputElement&&e.setSelectionRange(0,1e4)}const cO=g.createContext(null);function UJ({children:e}){const t=g.useRef(null),n=g.useMemo(()=>({keyRef:t,onKeyChange:r=>{t.current=r}}),[t]);return s.jsx(cO.Provider,{value:n,children:e})}function dO(e,t=!1){const n=g.useContext(cO),r=g.useRef(null);g.useLayoutEffect(()=>{const o=r.current,i=e.current;if(i&&t&&(o===null||o===!1)){const a="input,button,div[tabindex]",l=i.matches(a)?i:i.querySelector(a);t&&l&&zJ(l,n)}r.current=t},[t])}const fO={outline:0,backgroundColor:S.tableBackground,color:S.formInputText,margin:0,padding:5,borderRadius:4,border:"1px solid "+S.formInputBorder};function Ke({style:e,inputRef:t,onEnter:n,onEscape:r,onChangeValue:o,onUpdate:i,focused:a,...l}){const u=g.useRef(null);return dO(u,a),s.jsx("input",{ref:t?FJ([t,u]):u,className:`${ze(fO,{whiteSpace:"nowrap",overflow:"hidden",flexShrink:0,":focus":{border:"1px solid "+S.formInputBorderSelected,boxShadow:"0 1px 1px "+S.formInputShadowSelected},"::placeholder":{color:S.formInputTextPlaceholder}},X.smallText,e)}`,...l,onKeyDown:c=>{c.key==="Enter"&&n&&n(c),c.key==="Escape"&&r&&r(c),l.onKeyDown?.(c)},onBlur:c=>{i?.(c.target.value),l.onBlur?.(c)},onChange:c=>{o?.(c.target.value),l.onChange?.(c)}})}function Zh(e){return s.jsx(Ke,{...e,style:{padding:10,fontSize:15,border:"none",...X.shadow,":focus":{border:"none",...X.shadow},...e.style}})}const z=e=>{const{className:t="",style:n,innerRef:r,...o}=e;return s.jsx("span",{...o,ref:r,className:`${t} ${ze(n)}`})},_e=({title:e,isCurrent:t,isHidden:n,size:r,padding:o=20,showHeader:i=!0,leftHeaderContent:a,showTitle:l=!0,editableTitle:u=!1,showClose:c=!0,showOverlay:f=!0,loading:d=!1,noAnimation:h=!1,focusAfterClose:p=!0,stackIndex:m,parent:x,style:k,titleStyle:v,contentStyle:y,overlayStyle:b,children:w,onClose:E,onTitleUpdate:T})=>{const{enableScope:_,disableScope:M}=TD(),B=`modal-${m}-${e}`;g.useEffect(()=>(_(B),()=>M(B)),[_,M,B]);const[O,N]=g.useState(!1),[H,F]=g.useState(e),L=()=>{N(!0)},R=U=>{U!==e&&T?.(U),N(!1)};return s.jsx(LJ,{isOpen:!0,onRequestClose:E,shouldCloseOnOverlayClick:!0,shouldFocusAfterRender:!0,shouldReturnFocusAfterClose:p,appElement:document.querySelector("#root"),parentSelector:x&&(()=>x),style:{content:{display:"flex",height:"fit-content",width:"fit-content",position:"absolute",top:0,left:0,right:0,bottom:0,justifyContent:"center",alignItems:"center",overflow:"visible",border:0,fontSize:14,backgroundColor:"transparent",padding:0,pointerEvents:"auto",margin:"auto",...y},overlay:{display:"flex",zIndex:3e3,backgroundColor:f&&m===0?"rgba(0, 0, 0, .1)":"none",pointerEvents:f?"auto":"none",...b,...x?{position:"absolute",top:0,left:0,right:0,bottom:0}:{}}},children:s.jsxs(WJ,{noAnimation:h,isCurrent:t,size:r,style:{willChange:"opacity, transform",maxWidth:"90vw",minWidth:"90vw",minHeight:0,borderRadius:4,color:S.pageText,backgroundColor:S.modalBackground,opacity:n?0:1,[`@media (min-width: ${fr.breakpoint_small})`]:{minWidth:fr.breakpoint_small},...X.shadowLarge,...k,...X.lightScrollbar},children:[i&&s.jsxs(I,{style:{padding:20,position:"relative",flexShrink:0},children:[s.jsx(I,{style:{position:"absolute",left:0,top:0,bottom:0,justifyContent:"center",alignItems:"center"},children:s.jsx(I,{style:{flexDirection:"row",marginLeft:15},children:a&&!O?a:null})}),l&&s.jsx(I,{style:{flex:1,alignSelf:"center",textAlign:"center",width:"calc(100% - 40px)"},children:O?s.jsx(Ke,{style:{fontSize:25,fontWeight:700,textAlign:"center"},value:H,onChange:U=>F(U.target.value),onKeyDown:U=>{U.key==="Enter"&&(U.preventDefault(),R(U.currentTarget.value))},onBlur:U=>R(U.target.value)}):s.jsx(z,{style:{fontSize:25,fontWeight:700,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",...v},...u&&{onPointerUp:L},children:H})}),s.jsx(I,{style:{position:"absolute",right:0,top:0,bottom:0,justifyContent:"center",alignItems:"center"},children:s.jsx(I,{style:{flexDirection:"row",marginRight:15},children:c&&!O&&s.jsx(q,{type:"bare",onClick:E,style:{padding:"10px 10px"},"aria-label":"Close",children:s.jsx(Ed,{width:10,style:{color:"inherit"}})})})})]}),s.jsx(I,{style:{padding:o,paddingTop:0,flex:1},children:typeof w=="function"?w({isEditingTitle:O}):w}),d&&s.jsx(I,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:S.pageBackground,alignItems:"center",justifyContent:"center",zIndex:1e3},children:s.jsx(vi,{style:{width:20,height:20},color:S.pageText})})]})})},WJ=({style:e,size:t,noAnimation:n,isCurrent:r,stackIndex:o,children:i})=>{const a=g.useRef(null),l=g.useRef(!1),u=g.useRef(Math.random()*10-5);return g.useLayoutEffect(()=>{if(a.current==null)return;function c(){r?(a.current.style.transform="translateY(0px) scale(1)",a.current.style.pointerEvents="auto"):(a.current.style.transform=`translateY(-40px) scale(.95) rotate(${u.current}deg)`,a.current.style.pointerEvents="none")}l.current?c():n?(a.current.style.opacity=1,a.current.style.transform="translateY(0px) scale(1)",setTimeout(()=>{a.current&&(a.current.style.transition="opacity .1s, transform .1s cubic-bezier(.42, 0, .58, 1)")},0)):(a.current.style.opacity=0,a.current.style.transform="translateY(10px) scale(1)",setTimeout(()=>{a.current&&(l.current=!0,a.current.style.transition="opacity .1s, transform .1s cubic-bezier(.42, 0, .58, 1)",a.current.style.opacity=1,c())},0))},[n,r,o]),s.jsx(I,{innerRef:a,style:{...e,...t&&{width:t.width,height:t.height},...n&&!r&&{display:"none"}},children:i})},ys=({style:e,leftContent:t,focusButton:n=!1,children:r})=>{const o=g.useRef(null);return g.useEffect(()=>{if(n&&o.current){const i=o.current.querySelector("button:not([data-hidden])");i&&i.focus()}},[n]),s.jsxs(I,{innerRef:o,style:{flexDirection:"row",marginTop:30,...e},children:[t,s.jsx(I,{style:{flex:1}}),r]})};function be({style:e,isLast:t,children:n,...r}){return s.jsx("div",{...r,className:`${ze(!t&&{marginBottom:15},e,{lineHeight:"1.5em"})}`,children:n})}function hO(e,t){return g.Children.toArray(t).reduce((n,r)=>r?typeof r=="object"&&"type"in r&&r.type===g.Fragment?n.concat(hO(r.key,r.props.children)):(n.push({key:e+r.key,child:r}),n):n,[])}const Pe=g.forwardRef(({direction:e="column",align:t,justify:n,spacing:r=3,children:o,debug:i,style:a,...l},u)=>{const c=e.endsWith("reverse"),f=e.startsWith("row"),d=hO("",o);return s.jsx(I,{style:{flexDirection:e,alignItems:t,justifyContent:n,...a},innerRef:u,...l,children:d.map(({key:h,child:p},m)=>{const x=d.length===m+1;let k;return f?k=c?"marginLeft":"marginRight":k=c?"marginTop":"marginBottom",g.cloneElement(typeof p=="string"?s.jsx(z,{children:p}):p,{key:h,style:{...i&&{borderWidth:1,borderColor:"red"},...x?null:{[k]:r*5},...p.props?p.props.style:null}})})})});Pe.displayName="Stack";const _c=({title:e,style:t})=>s.jsx(I,{style:{fontWeight:500,textTransform:"uppercase",color:S.formLabelText,marginBottom:5,lineHeight:"1em",...t},children:e}),eo=({style:e,title:t,id:n,htmlFor:r})=>s.jsx(z,{style:{fontSize:13,marginBottom:3,color:S.tableText,...e},children:s.jsx("label",{htmlFor:r,id:n,children:t})}),_o=({style:e,children:t})=>s.jsx(I,{style:e,children:t}),Bo=e=>s.jsx("input",{type:"checkbox",...e,className:`${ze([{position:"relative",margin:0,flexShrink:0,marginRight:6,width:15,height:15,appearance:"none",outline:0,border:"1px solid "+S.formInputBorder,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",color:S.checkboxText,backgroundColor:S.tableBackground,":checked":{border:"1px solid "+S.checkboxBorderSelected,backgroundColor:S.checkboxBackgroundSelected,"::after":{display:"block",background:S.checkboxBackgroundSelected+` 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 "+S.checkboxBorderSelected,borderRadius:6,content:" "}}}],e.style)}`});function VJ({error:e}){let t;return"IDBFailure"in e&&e.IDBFailure?t=s.jsx(z,{children:"Your browser doesn’t 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."}):"SharedArrayBufferMissing"in e&&e.SharedArrayBufferMissing?t=s.jsxs(z,{children:["Actual requires access to ",s.jsx("code",{children:"SharedArrayBuffer"})," in order to function properly. If you’re seeing this error, either your browser does not support ",s.jsx("code",{children:"SharedArrayBuffer"}),", or your server is not sending the appropriate headers, or you are not using HTTPS. See"," ",s.jsx(Ve,{linkColor:"muted",to:"https://actualbudget.org/docs/troubleshooting/shared-array-buffer",children:"our troubleshooting documentation"})," ","to learn more. ",s.jsx(qJ,{})]}):t=s.jsxs(z,{children:["There was a problem loading the app in this browser version. If this continues to be a problem, you can"," ",s.jsx(Ve,{linkColor:"muted",to:"https://github.com/actualbudget/releases",children:"download the desktop app"}),"."]}),s.jsxs(Pe,{style:{paddingBottom:15,lineHeight:"1.5em",fontSize:15},children:[s.jsx(z,{children:t}),s.jsxs(z,{children:["Please get"," ",s.jsx(Ve,{linkColor:"muted",to:"https://actualbudget.org/contact",children:"in touch"})," ","for support"]})]})}function YJ(){return s.jsxs(s.Fragment,{children:[s.jsx(be,{children:"There was an unrecoverable error in the UI. Sorry!"}),s.jsxs(be,{children:["If this error persists, please get"," ",s.jsx(Ve,{to:"https://actualbudget.org/contact",children:"in touch"})," ","so it can be investigated."]})]})}function qJ(){const[e,t]=g.useState(!1),[n,r]=g.useState(!1);return e?s.jsxs(s.Fragment,{children:[s.jsxs(be,{style:{marginTop:10},children:["Actual uses ",s.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 ",s.jsx("code",{children:"SharedArrayBuffer"}),", you may encounter data loss or notice multiple budget files being merged with each other."]}),s.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:10},children:[s.jsx(Bo,{checked:n,onChange:()=>r(!n)})," ","I understand the risks, run Actual in the unsupported fallback mode"]}),s.jsx(q,{disabled:!n,onClick:()=>{window.localStorage.setItem("SharedArrayBufferOverride","true"),window.location.reload()},children:"Open Actual"})]}):s.jsx(Ro,{onClick:()=>t(!0),style:{marginLeft:5},children:"Advanced options"})}function GJ({buttonText:e,error:t}){const[n,r]=g.useState(!1),o="type"in t&&t.type==="app-init-failure";return s.jsx(_e,{isCurrent:!0,showClose:!1,title:"Fatal Error",children:s.jsxs(I,{style:{maxWidth:500},children:[o?s.jsx(VJ,{error:t}):s.jsx(YJ,{}),s.jsx(be,{children:s.jsx(q,{onClick:()=>window.Actual?.relaunch(),children:e})}),s.jsxs(be,{isLast:!0,style:{fontSize:11},children:[s.jsx(Ro,{onClick:()=>r(!0),children:"Show Error"}),n&&s.jsx(We,{style:{marginTop:5,height:100,overflow:"auto"},children:t.stack})]})]})})}const pO=g.createContext({dragDropManager:void 0});function we(e,t,...n){if(KJ()&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){let r;if(t===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let o=0;r=new Error(t.replace(/%s/g,function(){return n[o++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function KJ(){return typeof process<"u"&&!0}function QJ(e,t,n){return t.split(".").reduce((r,o)=>r&&r[o]?r[o]:n||null,e)}function XJ(e,t){return e.filter(n=>n!==t)}function gO(e){return typeof e=="object"}function ZJ(e,t){const n=new Map,r=i=>{n.set(i,n.has(i)?n.get(i)+1:1)};e.forEach(r),t.forEach(r);const o=[];return n.forEach((i,a)=>{i===1&&o.push(a)}),o}function JJ(e,t){return e.filter(n=>t.indexOf(n)>-1)}const lb="dnd-core/INIT_COORDS",bg="dnd-core/BEGIN_DRAG",ub="dnd-core/PUBLISH_DRAG_SOURCE",wg="dnd-core/HOVER",Sg="dnd-core/DROP",kg="dnd-core/END_DRAG";function Rk(e,t){return{type:lb,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const eee={type:lb,payload:{clientOffset:null,sourceClientOffset:null}};function tee(e){return function(n=[],r={publishSource:!0}){const{publishSource:o=!0,clientOffset:i,getSourceClientOffset:a}=r,l=e.getMonitor(),u=e.getRegistry();e.dispatch(Rk(i)),nee(n,l,u);const c=iee(n,l);if(c==null){e.dispatch(eee);return}let f=null;if(i){if(!a)throw new Error("getSourceClientOffset must be defined");ree(a),f=a(c)}e.dispatch(Rk(i,f));const h=u.getSource(c).beginDrag(l,c);if(h==null)return;oee(h),u.pinSource(c);const p=u.getSourceType(c);return{type:bg,payload:{itemType:p,item:h,sourceId:c,clientOffset:i||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}}function nee(e,t,n){we(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(r){we(n.getSource(r),"Expected sourceIds to be registered.")})}function ree(e){we(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function oee(e){we(gO(e),"Item must be an object.")}function iee(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function aee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function see(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){aee(e,o,n[o])})}return e}function lee(e){return function(n={}){const r=e.getMonitor(),o=e.getRegistry();uee(r),fee(r).forEach((a,l)=>{const u=cee(a,l,o,r),c={type:Sg,payload:{dropResult:see({},n,u)}};e.dispatch(c)})}}function uee(e){we(e.isDragging(),"Cannot call drop while not dragging."),we(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function cee(e,t,n,r){const o=n.getTarget(e);let i=o?o.drop(r,e):void 0;return dee(i),typeof i>"u"&&(i=t===0?{}:r.getDropResult()),i}function dee(e){we(typeof e>"u"||gO(e),"Drop result must either be an object or undefined.")}function fee(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function hee(e){return function(){const n=e.getMonitor(),r=e.getRegistry();pee(n);const o=n.getSourceId();return o!=null&&(r.getSource(o,!0).endDrag(n,o),r.unpinSource()),{type:kg}}}function pee(e){we(e.isDragging(),"Cannot call endDrag while not dragging.")}function mv(e,t){return t===null?e===null:Array.isArray(e)?e.some(n=>n===t):e===t}function gee(e){return function(n,{clientOffset:r}={}){mee(n);const o=n.slice(0),i=e.getMonitor(),a=e.getRegistry(),l=i.getItemType();return vee(o,a,l),yee(o,i,a),xee(o,i,a),{type:wg,payload:{targetIds:o,clientOffset:r||null}}}}function mee(e){we(Array.isArray(e),"Expected targetIds to be an array.")}function yee(e,t,n){we(t.isDragging(),"Cannot call hover while not dragging."),we(!t.didDrop(),"Cannot call hover after drop.");for(let r=0;r<e.length;r++){const o=e[r];we(e.lastIndexOf(o)===r,"Expected targetIds to be unique in the passed array.");const i=n.getTarget(o);we(i,"Expected targetIds to be registered.")}}function vee(e,t,n){for(let r=e.length-1;r>=0;r--){const o=e[r],i=t.getTargetType(o);mv(i,n)||e.splice(r,1)}}function xee(e,t,n){e.forEach(function(r){n.getTarget(r).hover(t,r)})}function bee(e){return function(){if(e.getMonitor().isDragging())return{type:ub}}}function wee(e){return{beginDrag:tee(e),publishDragSource:bee(e),hover:gee(e),drop:lee(e),endDrag:hee(e)}}class See{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:n}=this.store;function r(i){return(...a)=>{const l=i.apply(t,a);typeof l<"u"&&n(l)}}const o=wee(this);return Object.keys(o).reduce((i,a)=>{const l=o[a];return i[a]=r(l),i},{})}dispatch(t){this.store.dispatch(t)}constructor(t,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}}function kee(e,t){return{x:e.x+t.x,y:e.y+t.y}}function mO(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Tee(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:mO(kee(t,r),n)}function Cee(e){const{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:mO(t,n)}const qu=[],cb=[];qu.__IS_NONE__=!0;cb.__IS_ALL__=!0;function Eee(e,t){return e===qu?!1:e===cb||typeof t>"u"?!0:JJ(t,e).length>0}class jee{subscribeToStateChange(t,n={}){const{handlerIds:r}=n;we(typeof t=="function","listener must be a function."),we(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let o=this.store.getState().stateId;const i=()=>{const a=this.store.getState(),l=a.stateId;try{l===o||l===o+1&&!Eee(a.dirtyHandlerIds,r)||t()}finally{o=l}};return this.store.subscribe(i)}subscribeToOffsetChange(t){we(typeof t=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const o=this.store.getState().dragOffset;o!==n&&(n=o,t())};return this.store.subscribe(r)}canDragSource(t){if(!t)return!1;const n=this.registry.getSource(t);return we(n,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:n.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const n=this.registry.getTarget(t);if(we(n,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(t),o=this.getItemType();return mv(r,o)&&n.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const n=this.registry.getSource(t,!0);if(we(n,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(t),o=this.getItemType();return r!==o?!1:n.isDragging(this,t)}isOverTarget(t,n={shallow:!1}){if(!t)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const o=this.registry.getTargetType(t),i=this.getItemType();if(i&&!mv(o,i))return!1;const a=this.getTargetIds();if(!a.length)return!1;const l=a.indexOf(t);return r?l===a.length-1:l>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Tee(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Cee(this.store.getState().dragOffset)}constructor(t,n){this.store=t,this.registry=n}}const Bk=typeof pn<"u"?pn:self,yO=Bk.MutationObserver||Bk.WebKitMutationObserver;function vO(e){return function(){const n=setTimeout(o,0),r=setInterval(o,50);function o(){clearTimeout(n),clearInterval(r),e()}}}function Iee(e){let t=1;const n=new yO(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const Dee=typeof yO=="function"?Iee:vO;class _ee{enqueueTask(t){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const n=this.index;if(this.index++,t[n].call(),this.index>this.capacity){for(let r=0,o=t.length-this.index;r<o;r++)t[r]=t[r+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=Dee(this.flush),this.requestErrorThrow=vO(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class Oee{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class Aee{create(t){const n=this.freeTasks,r=n.length?n.pop():new Oee(this.onError,o=>n[n.length]=o);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const xO=new _ee,Pee=new Aee(xO.registerPendingError);function Mee(e){xO.enqueueTask(Pee.create(e))}const db="dnd-core/ADD_SOURCE",fb="dnd-core/ADD_TARGET",hb="dnd-core/REMOVE_SOURCE",Tg="dnd-core/REMOVE_TARGET";function Ree(e){return{type:db,payload:{sourceId:e}}}function Bee(e){return{type:fb,payload:{targetId:e}}}function Lee(e){return{type:hb,payload:{sourceId:e}}}function Nee(e){return{type:Tg,payload:{targetId:e}}}function $ee(e){we(typeof e.canDrag=="function","Expected canDrag to be a function."),we(typeof e.beginDrag=="function","Expected beginDrag to be a function."),we(typeof e.endDrag=="function","Expected endDrag to be a function.")}function Fee(e){we(typeof e.canDrop=="function","Expected canDrop to be a function."),we(typeof e.hover=="function","Expected hover to be a function."),we(typeof e.drop=="function","Expected beginDrag to be a function.")}function yv(e,t){if(t&&Array.isArray(e)){e.forEach(n=>yv(n,!1));return}we(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ir;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ir||(Ir={}));let Hee=0;function zee(){return Hee++}function Uee(e){const t=zee().toString();switch(e){case Ir.SOURCE:return`S${t}`;case Ir.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function Lk(e){switch(e[0]){case"S":return Ir.SOURCE;case"T":return Ir.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function Nk(e,t){const n=e.entries();let r=!1;do{const{done:o,value:[,i]}=n.next();if(i===t)return!0;r=!!o}while(!r);return!1}class Wee{addSource(t,n){yv(t),$ee(n);const r=this.addHandler(Ir.SOURCE,t,n);return this.store.dispatch(Ree(r)),r}addTarget(t,n){yv(t,!0),Fee(n);const r=this.addHandler(Ir.TARGET,t,n);return this.store.dispatch(Bee(r)),r}containsHandler(t){return Nk(this.dragSources,t)||Nk(this.dropTargets,t)}getSource(t,n=!1){return we(this.isSourceId(t),"Expected a valid source ID."),n&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return we(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return we(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return we(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return Lk(t)===Ir.SOURCE}isTargetId(t){return Lk(t)===Ir.TARGET}removeSource(t){we(this.getSource(t),"Expected an existing source."),this.store.dispatch(Lee(t)),Mee(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){we(this.getTarget(t),"Expected an existing target."),this.store.dispatch(Nee(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const n=this.getSource(t);we(n,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=n}unpinSource(){we(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,n,r){const o=Uee(t);return this.types.set(o,n),t===Ir.SOURCE?this.dragSources.set(o,r):t===Ir.TARGET&&this.dropTargets.set(o,r),o}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const Vee=(e,t)=>e===t;function Yee(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function qee(e,t,n=Vee){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function Gee(e=qu,t){switch(t.type){case wg:break;case db:case fb:case Tg:case hb:return qu;case bg:case ub:case kg:case Sg:default:return cb}const{targetIds:n=[],prevTargetIds:r=[]}=t.payload,o=ZJ(n,r);if(!(o.length>0||!qee(n,r)))return qu;const a=r[r.length-1],l=n[n.length-1];return a!==l&&(a&&o.push(a),l&&o.push(l)),o}function Kee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Kee(e,o,n[o])})}return e}const $k={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Xee(e=$k,t){const{payload:n}=t;switch(t.type){case lb:case bg:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case wg:return Yee(e.clientOffset,n.clientOffset)?e:Qee({},e,{clientOffset:n.clientOffset});case kg:case Sg:return $k;default:return e}}function Zee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Is(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){Zee(e,o,n[o])})}return e}const Jee={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function ete(e=Jee,t){const{payload:n}=t;switch(t.type){case bg:return Is({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case ub:return Is({},e,{isSourcePublic:!0});case wg:return Is({},e,{targetIds:n.targetIds});case Tg:return e.targetIds.indexOf(n.targetId)===-1?e:Is({},e,{targetIds:XJ(e.targetIds,n.targetId)});case Sg:return Is({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case kg:return Is({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function tte(e=0,t){switch(t.type){case db:case fb:return e+1;case hb:case Tg:return e-1;default:return e}}function nte(e=0){return e+1}function rte(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ote(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){rte(e,o,n[o])})}return e}function ite(e={},t){return{dirtyHandlerIds:Gee(e.dirtyHandlerIds,{type:t.type,payload:ote({},t.payload,{prevTargetIds:QJ(e,"dragOperation.targetIds",[])})}),dragOffset:Xee(e.dragOffset,t),refCount:tte(e.refCount,t),dragOperation:ete(e.dragOperation,t),stateId:nte(e.stateId)}}function ate(e,t=void 0,n={},r=!1){const o=ste(r),i=new jee(o,new Wee(o)),a=new See(o,i),l=e(a,t,n);return a.receiveBackend(l),a}function ste(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return d1(ite,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function lte(e,t){if(e==null)return{};var n=ute(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ute(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}let Fk=0;const th=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var cte=g.memo(function(t){var{children:n}=t,r=lte(t,["children"]);const[o,i]=dte(r);return g.useEffect(()=>{if(i){const a=bO();return++Fk,()=>{--Fk===0&&(a[th]=null)}}},[]),s.jsx(pO.Provider,{value:o,children:n})});function dte(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=fte(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}function fte(e,t=bO(),n,r){const o=t;return o[th]||(o[th]={dragDropManager:ate(e,t,n,r)}),o[th]}function bO(){return typeof pn<"u"?pn:window}var hte=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var a=i[o];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n};const pte=mr(hte),ns=typeof window<"u"?g.useLayoutEffect:g.useEffect;function gte(e,t,n){const[r,o]=g.useState(()=>t(e)),i=g.useCallback(()=>{const a=t(e);pte(r,a)||(o(a),n&&n())},[r,e,n]);return ns(i),[r,i]}function mte(e,t,n){const[r,o]=gte(e,t,n);return ns(function(){const a=e.getHandlerId();if(a!=null)return e.subscribeToStateChange(o,{handlerIds:[a]})},[e,o]),r}function wO(e,t,n){return mte(t,e||(()=>({})),()=>n.reconnect())}function SO(e,t){const n=[...t||[]];return t==null&&typeof e!="function"&&n.push(e),g.useMemo(()=>typeof e=="function"?e():e,n)}function yte(e){return g.useMemo(()=>e.hooks.dragSource(),[e])}function vte(e){return g.useMemo(()=>e.hooks.dragPreview(),[e])}let Km=!1,Qm=!1;class xte{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){we(!Km,"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 Km=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Km=!1}}isDragging(){if(!this.sourceId)return!1;we(!Qm,"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 Qm=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Qm=!1}}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,n){return this.internalMonitor.isOverTarget(t,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let Xm=!1;class bte{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}canDrop(){if(!this.targetId)return!1;we(!Xm,"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 Xm=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Xm=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function wte(e,t,n){const r=n.getRegistry(),o=r.addTarget(e,t);return[o,()=>r.removeTarget(o)]}function Ste(e,t,n){const r=n.getRegistry(),o=r.addSource(e,t);return[o,()=>r.removeSource(o)]}function vv(e,t,n,r){let o=n?n.call(r,e,t):void 0;if(o!==void 0)return!!o;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;const l=Object.prototype.hasOwnProperty.bind(t);for(let u=0;u<i.length;u++){const c=i[u];if(!l(c))return!1;const f=e[c],d=t[c];if(o=n?n.call(r,f,d,c):void 0,o===!1||o===void 0&&f!==d)return!1}return!0}function xv(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function kte(e){if(typeof e.type=="string")return;const 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 ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function Tte(e){return(t=null,n=null)=>{if(!g.isValidElement(t)){const i=t;return e(i,n),i}const r=t;return kte(r),Cte(r,n?i=>e(i,n):e)}}function kO(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const o=Tte(r);t[n]=()=>o}}),t}function Hk(e,t){typeof e=="function"?e(t):e.current=t}function Cte(e,t){const n=e.ref;return we(typeof n!="string","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://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?g.cloneElement(e,{ref:r=>{Hk(n,r),Hk(t,r)}}):g.cloneElement(e,{ref:t})}class Ete{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?t?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),n):(this.lastConnectedDragSource=t,n):n}reconnectDragPreview(t=!1){const n=this.dragPreview,r=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!vv(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!vv(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=kO({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,xv(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,xv(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.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}}class jte{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!vv(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(t){this.hooks=kO({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,xv(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function Wl(){const{dragDropManager:e}=g.useContext(pO);return we(e!=null,"Expected drag drop context"),e}function Ite(e,t){const n=Wl(),r=g.useMemo(()=>new Ete(n.getBackend()),[n]);return ns(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),ns(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}function Dte(){const e=Wl();return g.useMemo(()=>new xte(e),[e])}class _te{beginDrag(){const t=this.spec,n=this.monitor;let r=null;return typeof t.item=="object"?r=t.item:typeof t.item=="function"?r=t.item(n):r={},r??null}canDrag(){const t=this.spec,n=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(n):!0}isDragging(t,n){const r=this.spec,o=this.monitor,{isDragging:i}=r;return i?i(o):n===t.getSourceId()}endDrag(){const t=this.spec,n=this.monitor,r=this.connector,{end:o}=t;o&&o(n.getItem(),n),r.reconnect()}constructor(t,n,r){this.spec=t,this.monitor=n,this.connector=r}}function Ote(e,t,n){const r=g.useMemo(()=>new _te(e,t,n),[t,n]);return g.useEffect(()=>{r.spec=e},[e]),r}function Ate(e){return g.useMemo(()=>{const t=e.type;return we(t!=null,"spec.type must be defined"),t},[e])}function Pte(e,t,n){const r=Wl(),o=Ote(e,t,n),i=Ate(e);ns(function(){if(i!=null){const[l,u]=Ste(i,o,r);return t.receiveHandlerId(l),n.receiveHandlerId(l),u}},[r,t,n,o,i])}function Mte(e,t){const n=SO(e,t);we(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=Dte(),o=Ite(n.options,n.previewOptions);return Pte(n,r,o),[wO(n.collect,r,o),yte(o),vte(o)]}function Rte(e){return g.useMemo(()=>e.hooks.dropTarget(),[e])}function Bte(e){const t=Wl(),n=g.useMemo(()=>new jte(t.getBackend()),[t]);return ns(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function Lte(){const e=Wl();return g.useMemo(()=>new bte(e),[e])}function Nte(e){const{accept:t}=e;return g.useMemo(()=>(we(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class $te{canDrop(){const t=this.spec,n=this.monitor;return t.canDrop?t.canDrop(n.getItem(),n):!0}hover(){const t=this.spec,n=this.monitor;t.hover&&t.hover(n.getItem(),n)}drop(){const t=this.spec,n=this.monitor;if(t.drop)return t.drop(n.getItem(),n)}constructor(t,n){this.spec=t,this.monitor=n}}function Fte(e,t){const n=g.useMemo(()=>new $te(e,t),[t]);return g.useEffect(()=>{n.spec=e},[e]),n}function Hte(e,t,n){const r=Wl(),o=Fte(e,t),i=Nte(e);ns(function(){const[l,u]=wte(i,o,r);return t.receiveHandlerId(l),n.receiveHandlerId(l),u},[r,t,o,n,i.map(a=>a.toString()).join("|")])}function zte(e,t){const n=SO(e,t),r=Lte(),o=Bte(n.options);return Hte(n,r,o),[wO(n.collect,r,o),Rte(o)]}function TO(e){let t=null;return()=>(t==null&&(t=e()),t)}function Ute(e,t){return e.filter(n=>n!==t)}function Wte(e,t){const n=new Set,r=i=>n.add(i);e.forEach(r),t.forEach(r);const o=[];return n.forEach(i=>o.push(i)),o}class Vte{enter(t){const n=this.entered.length,r=o=>this.isNodeInDocument(o)&&(!o.contains||o.contains(t));return this.entered=Wte(this.entered.filter(r),[t]),n===0&&this.entered.length>0}leave(t){const n=this.entered.length;return this.entered=Ute(this.entered.filter(this.isNodeInDocument),t),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class Yte{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const o=this.config.exposeProperties[r];o!=null&&(n[r]={value:o(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,n){return n===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const CO="__NATIVE_FILE__",EO="__NATIVE_URL__",jO="__NATIVE_TEXT__",IO="__NATIVE_HTML__",zk=Object.freeze(Object.defineProperty({__proto__:null,FILE:CO,HTML:IO,TEXT:jO,URL:EO},Symbol.toStringTag,{value:"Module"}));function Zm(e,t,n){const r=t.reduce((o,i)=>o||e.getData(i),"");return r??n}const bv={[CO]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[IO]:{exposeProperties:{html:(e,t)=>Zm(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[EO]:{exposeProperties:{urls:(e,t)=>Zm(e,t,"").split(`
|
|
87
|
+
`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[jO]:{exposeProperties:{text:(e,t)=>Zm(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function qte(e,t){const n=bv[e];if(!n)throw new Error(`native type ${e} has no configuration`);const r=new Yte(n);return r.loadDataTransfer(t),r}function Jm(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(bv).filter(n=>{const r=bv[n];return r?.matchesTypes?r.matchesTypes.some(o=>t.indexOf(o)>-1):!1})[0]||null}const Gte=TO(()=>/firefox/i.test(navigator.userAgent)),DO=TO(()=>!!window.safari);class Uk{interpolate(t){const{xs:n,ys:r,c1s:o,c2s:i,c3s:a}=this;let l=n.length-1;if(t===n[l])return r[l];let u=0,c=a.length-1,f;for(;u<=c;){f=Math.floor(.5*(u+c));const p=n[f];if(p<t)u=f+1;else if(p>t)c=f-1;else return r[f]}l=Math.max(0,c);const d=t-n[l],h=d*d;return r[l]+o[l]*d+i[l]*h+a[l]*d*h}constructor(t,n){const{length:r}=t,o=[];for(let p=0;p<r;p++)o.push(p);o.sort((p,m)=>t[p]<t[m]?-1:1);const i=[],a=[];let l,u;for(let p=0;p<r-1;p++)l=t[p+1]-t[p],u=n[p+1]-n[p],i.push(l),a.push(u/l);const c=[a[0]];for(let p=0;p<i.length-1;p++){const m=a[p],x=a[p+1];if(m*x<=0)c.push(0);else{l=i[p];const k=i[p+1],v=l+k;c.push(3*v/((v+k)/m+(v+l)/x))}}c.push(a[a.length-1]);const f=[],d=[];let h;for(let p=0;p<c.length-1;p++){h=a[p];const m=c[p],x=1/i[p],k=m+c[p+1]-h-h;f.push((h-m-k)*x),d.push(k*x*x)}this.xs=t,this.ys=n,this.c1s=c,this.c2s=f,this.c3s=d}}const Kte=1;function _O(e){const t=e.nodeType===Kte?e:e.parentElement;if(!t)return null;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function wf(e){return{x:e.clientX,y:e.clientY}}function Qte(e){var t;return e.nodeName==="IMG"&&(Gte()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function Xte(e,t,n,r){let o=e?t.width:n,i=e?t.height:r;return DO()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}function Zte(e,t,n,r,o){const i=Qte(t),l=_O(i?e:t),u={x:n.x-l.x,y:n.y-l.y},{offsetWidth:c,offsetHeight:f}=e,{anchorX:d,anchorY:h}=r,{dragPreviewWidth:p,dragPreviewHeight:m}=Xte(i,t,c,f),x=()=>{let T=new Uk([0,.5,1],[u.y,u.y/f*m,u.y+m-f]).interpolate(h);return DO()&&i&&(T+=(window.devicePixelRatio-1)*m),T},k=()=>new Uk([0,.5,1],[u.x,u.x/c*p,u.x+p-c]).interpolate(d),{offsetX:v,offsetY:y}=o,b=v===0||v,w=y===0||y;return{x:b?v:k(),y:w?y:x()}}class Jte{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,n){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=n}}function ene(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable}))),r.forEach(function(o){ene(e,o,n[o])})}return e}class tne{profile(){var t,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,n,r){return this.sourcePreviewNodeOptions.set(t,r),this.sourcePreviewNodes.set(t,n),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,n,r){this.sourceNodes.set(t,n),this.sourceNodeOptions.set(t,r);const o=a=>this.handleDragStart(a,t),i=a=>this.handleSelectStart(a);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),n.removeEventListener("dragstart",o),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}connectDropTarget(t,n){const r=a=>this.handleDragEnter(a,t),o=a=>this.handleDragOver(a,t),i=a=>this.handleDrop(a,t);return n.addEventListener("dragenter",r),n.addEventListener("dragover",o),n.addEventListener("drop",i),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",o),n.removeEventListener("drop",i)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(t);return Wk({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(t);return Wk({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(zk).some(n=>zk[n]===t)}beginDragNativeItem(t,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=qte(t,n),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,n){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(t,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(t,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(t,n){this.dropTargetIds.unshift(n)}constructor(t,n,r){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.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=o=>{const i=this.sourceNodes.get(o);return i&&_O(i)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=o=>!!(o&&this.document&&this.document.body&&this.document.body.contains(o)),this.endDragIfSourceWasRemovedFromDOM=()=>{const o=this.currentDragSourceNode;o==null||this.isNodeInDocument(o)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=o=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(o||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=o=>{if(o.defaultPrevented)return;const{dragStartSourceIds:i}=this;this.dragStartSourceIds=null;const a=wf(o);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(i||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:a});const{dataTransfer:l}=o,u=Jm(l);if(this.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){const f=this.monitor.getSourceId(),d=this.sourceNodes.get(f),h=this.sourcePreviewNodes.get(f)||d;if(h){const{anchorX:p,anchorY:m,offsetX:x,offsetY:k}=this.getCurrentSourcePreviewNodeOptions(),b=Zte(d,h,a,{anchorX:p,anchorY:m},{offsetX:x,offsetY:k});l.setDragImage(h,b.x,b.y)}}try{l?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(o.target);const{captureDraggingState:c}=this.getCurrentSourcePreviewNodeOptions();c?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(u)this.beginDragNativeItem(u);else{if(l&&!l.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=o=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(o.dataTransfer)}if(!this.enterLeaveCounter.enter(o.target)||this.monitor.isDragging())return;const{dataTransfer:l}=o,u=Jm(l);u&&this.beginDragNativeItem(u,l)},this.handleTopDragEnter=o=>{const{dragEnterTargetIds:i}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=o.altKey,i.length>0&&this.actions.hover(i,{clientOffset:wf(o)}),i.some(l=>this.monitor.canDropOnTarget(l))&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=o=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var i;(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(o.dataTransfer)}},this.handleTopDragOver=o=>{const{dragOverTargetIds:i}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}this.altKeyPressed=o.altKey,this.lastClientOffset=wf(o),this.scheduleHover(i),(i||[]).some(l=>this.monitor.canDropOnTarget(l))?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=o=>{this.isDraggingNativeItem()&&o.preventDefault(),this.enterLeaveCounter.leave(o.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=o=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var i;o.preventDefault(),(i=this.currentNativeSource)===null||i===void 0||i.loadDataTransfer(o.dataTransfer)}else Jm(o.dataTransfer)&&o.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=o=>{const{dropTargetIds:i}=this;this.dropTargetIds=[],this.actions.hover(i,{clientOffset:wf(o)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=o=>{const i=o.target;typeof i.dragDrop=="function"&&(i.tagName==="INPUT"||i.tagName==="SELECT"||i.tagName==="TEXTAREA"||i.isContentEditable||(o.preventDefault(),i.dragDrop()))},this.options=new Jte(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new Vte(this.isNodeInDocument)}}const nne=function(t,n,r){return new tne(t,n,r)};/**
|
|
88
|
+
* @remix-run/router v1.14.2
|
|
89
|
+
*
|
|
90
|
+
* Copyright (c) Remix Software Inc.
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the MIT license found in the
|
|
93
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
94
|
+
*
|
|
95
|
+
* @license MIT
|
|
96
|
+
*/function Oc(){return Oc=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},Oc.apply(this,arguments)}var Vi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Vi||(Vi={}));const Vk="popstate";function rne(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:a,hash:l}=r.location;return wv("",{pathname:i,search:a,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Jh(o)}return ine(t,n,null,e)}function gt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pb(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function one(){return Math.random().toString(36).substr(2,8)}function Yk(e,t){return{usr:e.state,key:e.key,idx:t}}function wv(e,t,n,r){return n===void 0&&(n=null),Oc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Vl(t):t,{state:n,key:t&&t.key||r||one()})}function Jh(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Vl(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}function ine(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,l=Vi.Pop,u=null,c=f();c==null&&(c=0,a.replaceState(Oc({},a.state,{idx:c}),""));function f(){return(a.state||{idx:null}).idx}function d(){l=Vi.Pop;let k=f(),v=k==null?null:k-c;c=k,u&&u({action:l,location:x.location,delta:v})}function h(k,v){l=Vi.Push;let y=wv(x.location,k,v);n&&n(y,k),c=f()+1;let b=Yk(y,c),w=x.createHref(y);try{a.pushState(b,"",w)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;o.location.assign(w)}i&&u&&u({action:l,location:x.location,delta:1})}function p(k,v){l=Vi.Replace;let y=wv(x.location,k,v);n&&n(y,k),c=f();let b=Yk(y,c),w=x.createHref(y);a.replaceState(b,"",w),i&&u&&u({action:l,location:x.location,delta:0})}function m(k){let v=o.location.origin!=="null"?o.location.origin:o.location.href,y=typeof k=="string"?k:Jh(k);return gt(v,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,v)}let x={get action(){return l},get location(){return e(o,a)},listen(k){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(Vk,d),u=k,()=>{o.removeEventListener(Vk,d),u=null}},createHref(k){return t(o,k)},createURL:m,encodeLocation(k){let v=m(k);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:p,go(k){return a.go(k)}};return x}var qk;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(qk||(qk={}));function ane(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Vl(t):t,o=Tl(r.pathname||"/",n);if(o==null)return null;let i=OO(e);sne(i);let a=null;for(let l=0;a==null&&l<i.length;++l)a=mne(i[l],vne(o));return a}function OO(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,a,l)=>{let u={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};u.relativePath.startsWith("/")&&(gt(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=na([r,u.relativePath]),f=n.concat(u);i.children&&i.children.length>0&&(gt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),OO(i.children,t,f,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:pne(c,i.index),routesMeta:f})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let u of AO(i.path))o(i,a,u)}),t}function AO(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=AO(r.join("/")),l=[];return l.push(...a.map(u=>u===""?i:[i,u].join("/"))),o&&l.push(...a),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function sne(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:gne(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const lne=/^:[\w-]+$/,une=3,cne=2,dne=1,fne=10,hne=-2,Gk=e=>e==="*";function pne(e,t){let n=e.split("/"),r=n.length;return n.some(Gk)&&(r+=hne),t&&(r+=cne),n.filter(o=>!Gk(o)).reduce((o,i)=>o+(lne.test(i)?une:i===""?dne:fne),r)}function gne(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function mne(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a<n.length;++a){let l=n[a],u=a===n.length-1,c=o==="/"?t:t.slice(o.length)||"/",f=ep({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c);if(!f)return null;Object.assign(r,f.params);let d=l.route;i.push({params:r,pathname:na([o,f.pathname]),pathnameBase:kne(na([o,f.pathnameBase])),route:d}),f.pathnameBase!=="/"&&(o=na([o,f.pathnameBase]))}return i}function ep(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=yne(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);return{params:r.reduce((c,f,d)=>{let{paramName:h,isOptional:p}=f;if(h==="*"){let x=l[d]||"";a=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const m=l[d];return p&&!m?c[h]=void 0:c[h]=xne(m||"",h),c},{}),pathname:i,pathnameBase:a,pattern:e}}function yne(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),pb(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,(a,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function vne(e){try{return decodeURI(e)}catch(t){return pb(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function xne(e,t){try{return decodeURIComponent(e)}catch(n){return pb(!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}}function Tl(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 bne(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Vl(e):e;return{pathname:n?n.startsWith("/")?n:wne(n,t):t,search:Tne(r),hash:Cne(o)}}function wne(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function ey(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Sne(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function gb(e,t){let n=Sne(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function mb(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Vl(e):(o=Oc({},e),gt(!o.pathname||!o.pathname.includes("?"),ey("?","pathname","search",o)),gt(!o.pathname||!o.pathname.includes("#"),ey("#","pathname","hash",o)),gt(!o.search||!o.search.includes("#"),ey("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,l;if(a==null)l=n;else{let d=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),d-=1;o.pathname=h.join("/")}l=d>=0?t[d]:"/"}let u=bne(o,l),c=a&&a!=="/"&&a.endsWith("/"),f=(i||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||f)&&(u.pathname+="/"),u}const na=e=>e.join("/").replace(/\/\/+/g,"/"),kne=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Tne=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Cne=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Ene(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const PO=["post","put","patch","delete"];new Set(PO);const jne=["get",...PO];new Set(jne);/**
|
|
97
|
+
* React Router v6.21.3
|
|
98
|
+
*
|
|
99
|
+
* Copyright (c) Remix Software Inc.
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the MIT license found in the
|
|
102
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
103
|
+
*
|
|
104
|
+
* @license MIT
|
|
105
|
+
*/function Ac(){return Ac=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},Ac.apply(this,arguments)}const Cg=g.createContext(null),MO=g.createContext(null),xi=g.createContext(null),Eg=g.createContext(null),bi=g.createContext({outlet:null,matches:[],isDataRoute:!1}),RO=g.createContext(null);function BO(e,t){let{relative:n}=t===void 0?{}:t;vs()||gt(!1);let{basename:r,navigator:o}=g.useContext(xi),{hash:i,pathname:a,search:l}=jg(e,{relative:n}),u=a;return r!=="/"&&(u=a==="/"?r:na([r,a])),o.createHref({pathname:u,search:l,hash:i})}function vs(){return g.useContext(Eg)!=null}function an(){return vs()||gt(!1),g.useContext(Eg).location}function yb(e){vs()||gt(!1);let{pathname:t}=an();return g.useMemo(()=>ep(e,t),[t,e])}function LO(e){g.useContext(xi).static||g.useLayoutEffect(e)}function vb(){let{isDataRoute:e}=g.useContext(bi);return e?Fne():Ine()}function Ine(){vs()||gt(!1);let e=g.useContext(Cg),{basename:t,future:n,navigator:r}=g.useContext(xi),{matches:o}=g.useContext(bi),{pathname:i}=an(),a=JSON.stringify(gb(o,n.v7_relativeSplatPath)),l=g.useRef(!1);return LO(()=>{l.current=!0}),g.useCallback(function(c,f){if(f===void 0&&(f={}),!l.current)return;if(typeof c=="number"){r.go(c);return}let d=mb(c,JSON.parse(a),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:na([t,d.pathname])),(f.replace?r.replace:r.push)(d,f.state,f)},[t,r,a,i,e])}function NO(){let{matches:e}=g.useContext(bi),t=e[e.length-1];return t?t.params:{}}function jg(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(xi),{matches:o}=g.useContext(bi),{pathname:i}=an(),a=JSON.stringify(gb(o,r.v7_relativeSplatPath));return g.useMemo(()=>mb(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function Dne(e,t){return _ne(e,t)}function _ne(e,t,n,r){vs()||gt(!1);let{navigator:o}=g.useContext(xi),{matches:i}=g.useContext(bi),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let c=an(),f;if(t){var d;let k=typeof t=="string"?Vl(t):t;u==="/"||(d=k.pathname)!=null&&d.startsWith(u)||gt(!1),f=k}else f=c;let h=f.pathname||"/",p=u==="/"?h:h.slice(u.length)||"/",m=ane(e,{pathname:p}),x=Rne(m&&m.map(k=>Object.assign({},k,{params:Object.assign({},l,k.params),pathname:na([u,o.encodeLocation?o.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?u:na([u,o.encodeLocation?o.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),i,n,r);return t&&x?g.createElement(Eg.Provider,{value:{location:Ac({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:Vi.Pop}},x):x}function One(){let e=$ne(),t=Ene(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},i=null;return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:o},n):null,i)}const Ane=g.createElement(One,null);class Pne extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(bi.Provider,{value:this.props.routeContext},g.createElement(RO.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Mne(e){let{routeContext:t,match:n,children:r}=e,o=g.useContext(Cg);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(bi.Provider,{value:t},r)}function Rne(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let a=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let f=a.findIndex(d=>d.route.id&&l?.[d.route.id]);f>=0||gt(!1),a=a.slice(0,Math.min(a.length,f+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f<a.length;f++){let d=a[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=f),d.route.id){let{loaderData:h,errors:p}=n,m=d.route.loader&&h[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||m){u=!0,c>=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((f,d,h)=>{let p,m=!1,x=null,k=null;n&&(p=l&&d.route.id?l[d.route.id]:void 0,x=d.route.errorElement||Ane,u&&(c<0&&h===0?(Hne("route-fallback",!1),m=!0,k=null):c===h&&(m=!0,k=d.route.hydrateFallbackElement||null)));let v=t.concat(a.slice(0,h+1)),y=()=>{let b;return p?b=x:m?b=k:d.route.Component?b=g.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=f,g.createElement(Mne,{match:d,routeContext:{outlet:f,matches:v,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?g.createElement(Pne,{location:n.location,revalidation:n.revalidation,component:x,error:p,children:y(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):y()},null)}var $O=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}($O||{}),tp=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(tp||{});function Bne(e){let t=g.useContext(Cg);return t||gt(!1),t}function Lne(e){let t=g.useContext(MO);return t||gt(!1),t}function Nne(e){let t=g.useContext(bi);return t||gt(!1),t}function FO(e){let t=Nne(),n=t.matches[t.matches.length-1];return n.route.id||gt(!1),n.route.id}function $ne(){var e;let t=g.useContext(RO),n=Lne(tp.UseRouteError),r=FO(tp.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Fne(){let{router:e}=Bne($O.UseNavigateStable),t=FO(tp.UseNavigateStable),n=g.useRef(!1);return LO(()=>{n.current=!0}),g.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Ac({fromRouteId:t},i)))},[e,t])}const Kk={};function Hne(e,t,n){!t&&!Kk[e]&&(Kk[e]=!0)}function np(e){let{to:t,replace:n,state:r,relative:o}=e;vs()||gt(!1);let{future:i,static:a}=g.useContext(xi),{matches:l}=g.useContext(bi),{pathname:u}=an(),c=vb(),f=mb(t,gb(l,i.v7_relativeSplatPath),u,o==="path"),d=JSON.stringify(f);return g.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:o}),[c,d,o,n,r]),null}function Ee(e){gt(!1)}function zne(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Vi.Pop,navigator:i,static:a=!1,future:l}=e;vs()&>(!1);let u=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:u,navigator:i,static:a,future:Ac({v7_relativeSplatPath:!1},l)}),[u,l,i,a]);typeof r=="string"&&(r=Vl(r));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:m="default"}=r,x=g.useMemo(()=>{let k=Tl(f,u);return k==null?null:{location:{pathname:k,search:d,hash:h,state:p,key:m},navigationType:o}},[u,f,d,h,p,m,o]);return x==null?null:g.createElement(xi.Provider,{value:c},g.createElement(Eg.Provider,{children:n,value:x}))}function Fa(e){let{children:t,location:n}=e;return Dne(Sv(t),n)}new Promise(()=>{});function Sv(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,o)=>{if(!g.isValidElement(r))return;let i=[...t,o];if(r.type===g.Fragment){n.push.apply(n,Sv(r.props.children,i));return}r.type!==Ee&>(!1),!r.props.index||!r.props.children||gt(!1);let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=Sv(r.props.children,i)),n.push(a)}),n}/**
|
|
106
|
+
* React Router DOM v6.21.3
|
|
107
|
+
*
|
|
108
|
+
* Copyright (c) Remix Software Inc.
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the MIT license found in the
|
|
111
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
112
|
+
*
|
|
113
|
+
* @license MIT
|
|
114
|
+
*/function rp(){return rp=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},rp.apply(this,arguments)}function HO(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Une(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wne(e,t){return e.button===0&&(!t||t==="_self")&&!Une(e)}const Vne=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Yne=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],qne=g.createContext({isTransitioning:!1}),Gne="startTransition",Qk=X2[Gne];function zO(e){let{basename:t,children:n,future:r,window:o}=e,i=g.useRef();i.current==null&&(i.current=rne({window:o,v5Compat:!0}));let a=i.current,[l,u]=g.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},f=g.useCallback(d=>{c&&Qk?Qk(()=>u(d)):u(d)},[u,c]);return g.useLayoutEffect(()=>a.listen(f),[a,f]),g.createElement(zne,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:r})}const Kne=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Qne=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xne=g.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:l,target:u,to:c,preventScrollReset:f,unstable_viewTransition:d}=t,h=HO(t,Vne),{basename:p}=g.useContext(xi),m,x=!1;if(typeof c=="string"&&Qne.test(c)&&(m=c,Kne))try{let b=new URL(window.location.href),w=c.startsWith("//")?new URL(b.protocol+c):new URL(c),E=Tl(w.pathname,p);w.origin===b.origin&&E!=null?c=E+w.search+w.hash:x=!0}catch{}let k=BO(c,{relative:o}),v=Jne(c,{replace:a,state:l,target:u,preventScrollReset:f,relative:o,unstable_viewTransition:d});function y(b){r&&r(b),b.defaultPrevented||v(b)}return g.createElement("a",rp({},h,{href:m||k,onClick:x||i?r:y,ref:n,target:u}))}),xb=g.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:l,to:u,unstable_viewTransition:c,children:f}=t,d=HO(t,Yne),h=jg(u,{relative:d.relative}),p=an(),m=g.useContext(MO),{navigator:x,basename:k}=g.useContext(xi),v=m!=null&&ere(h)&&c===!0,y=x.encodeLocation?x.encodeLocation(h).pathname:h.pathname,b=p.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;o||(b=b.toLowerCase(),w=w?w.toLowerCase():null,y=y.toLowerCase()),w&&k&&(w=Tl(w,k)||w);const E=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let T=b===y||!a&&b.startsWith(y)&&b.charAt(E)==="/",_=w!=null&&(w===y||!a&&w.startsWith(y)&&w.charAt(y.length)==="/"),M={isActive:T,isPending:_,isTransitioning:v},B=T?r:void 0,O;typeof i=="function"?O=i(M):O=[i,T?"active":null,_?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let N=typeof l=="function"?l(M):l;return g.createElement(Xne,rp({},d,{"aria-current":B,className:O,ref:n,style:N,to:u,unstable_viewTransition:c}),typeof f=="function"?f(M):f)});var kv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(kv||(kv={}));var Xk;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Xk||(Xk={}));function Zne(e){let t=g.useContext(Cg);return t||gt(!1),t}function Jne(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:l}=t===void 0?{}:t,u=vb(),c=an(),f=jg(e,{relative:a});return g.useCallback(d=>{if(Wne(d,n)){d.preventDefault();let h=r!==void 0?r:Jh(c)===Jh(f);u(e,{replace:h,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:l})}},[c,u,f,r,o,n,e,i,a,l])}function ere(e,t){t===void 0&&(t={});let n=g.useContext(qne);n==null&>(!1);let{basename:r}=Zne(kv.useViewTransitionState),o=jg(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Tl(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Tl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ep(o.pathname,a)!=null||ep(o.pathname,i)!=null}var ty,Zk;function tre(){return Zk||(Zk=1,ty=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),ty}var nre=Ue;Ue.Node=rs;Ue.create=Ue;function Ue(e){var t=this;if(t instanceof Ue||(t=new Ue),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(o){t.push(o)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}Ue.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};Ue.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++}};Ue.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++}};Ue.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)ore(this,arguments[e]);return this.length};Ue.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)ire(this,arguments[e]);return this.length};Ue.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}};Ue.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}};Ue.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next};Ue.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev};Ue.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};Ue.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};Ue.prototype.map=function(e,t){t=t||this;for(var n=new Ue,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};Ue.prototype.mapReverse=function(e,t){t=t||this;for(var n=new Ue,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};Ue.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=0;r!==null;o++)n=e(n,r.value,o),r=r.next;return n};Ue.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=this.length-1;r!==null;o--)n=e(n,r.value,o),r=r.prev;return n};Ue.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};Ue.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};Ue.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new Ue;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,o=this.head;o!==null&&r<e;r++)o=o.next;for(;o!==null&&r<t;r++,o=o.next)n.push(o.value);return n};Ue.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new Ue;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,o=this.tail;o!==null&&r>t;r--)o=o.prev;for(;o!==null&&r>e;r--,o=o.prev)n.push(o.value);return n};Ue.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;r!==null&&n<e;n++)r=r.next;for(var o=[],n=0;r&&n<t;n++)o.push(r.value),r=this.removeNode(r);r===null&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(var n=2;n<arguments.length;n++)r=rre(this,r,arguments[n]);return o};Ue.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function rre(e,t,n){var r=t===e.head?new rs(n,null,t,e):new rs(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function ore(e,t){e.tail=new rs(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function ire(e,t){e.head=new rs(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function rs(e,t,n,r){if(!(this instanceof rs))return new rs(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}try{tre()(Ue)}catch{}const are=nre,Ma=Symbol("max"),ni=Symbol("length"),Ds=Symbol("lengthCalculator"),Gu=Symbol("allowStale"),Ha=Symbol("maxAge"),Jo=Symbol("dispose"),Jk=Symbol("noDisposeOnSet"),en=Symbol("lruList"),Gr=Symbol("cache"),UO=Symbol("updateAgeOnGet"),ny=()=>1;class sre{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[Ma]=t.max||1/0;const n=t.length||ny;if(this[Ds]=typeof n!="function"?ny:n,this[Gu]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Ha]=t.maxAge||0,this[Jo]=t.dispose,this[Jk]=t.noDisposeOnSet||!1,this[UO]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[Ma]=t||1/0,pu(this)}get max(){return this[Ma]}set allowStale(t){this[Gu]=!!t}get allowStale(){return this[Gu]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Ha]=t,pu(this)}get maxAge(){return this[Ha]}set lengthCalculator(t){typeof t!="function"&&(t=ny),t!==this[Ds]&&(this[Ds]=t,this[ni]=0,this[en].forEach(n=>{n.length=this[Ds](n.value,n.key),this[ni]+=n.length})),pu(this)}get lengthCalculator(){return this[Ds]}get length(){return this[ni]}get itemCount(){return this[en].length}rforEach(t,n){n=n||this;for(let r=this[en].tail;r!==null;){const o=r.prev;eT(this,t,r,n),r=o}}forEach(t,n){n=n||this;for(let r=this[en].head;r!==null;){const o=r.next;eT(this,t,r,n),r=o}}keys(){return this[en].toArray().map(t=>t.key)}values(){return this[en].toArray().map(t=>t.value)}reset(){this[Jo]&&this[en]&&this[en].length&&this[en].forEach(t=>this[Jo](t.key,t.value)),this[Gr]=new Map,this[en]=new are,this[ni]=0}dump(){return this[en].map(t=>op(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[en]}set(t,n,r){if(r=r||this[Ha],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const o=r?Date.now():0,i=this[Ds](n,t);if(this[Gr].has(t)){if(i>this[Ma])return ul(this,this[Gr].get(t)),!1;const u=this[Gr].get(t).value;return this[Jo]&&(this[Jk]||this[Jo](t,u.value)),u.now=o,u.maxAge=r,u.value=n,this[ni]+=i-u.length,u.length=i,this.get(t),pu(this),!0}const a=new lre(t,n,i,o,r);return a.length>this[Ma]?(this[Jo]&&this[Jo](t,n),!1):(this[ni]+=a.length,this[en].unshift(a),this[Gr].set(t,this[en].head),pu(this),!0)}has(t){if(!this[Gr].has(t))return!1;const n=this[Gr].get(t).value;return!op(this,n)}get(t){return ry(this,t,!0)}peek(t){return ry(this,t,!1)}pop(){const t=this[en].tail;return t?(ul(this,t),t.value):null}del(t){ul(this,this[Gr].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const o=t[r],i=o.e||0;if(i===0)this.set(o.k,o.v);else{const a=i-n;a>0&&this.set(o.k,o.v,a)}}}prune(){this[Gr].forEach((t,n)=>ry(this,n,!1))}}const ry=(e,t,n)=>{const r=e[Gr].get(t);if(r){const o=r.value;if(op(e,o)){if(ul(e,r),!e[Gu])return}else n&&(e[UO]&&(r.value.now=Date.now()),e[en].unshiftNode(r));return o.value}},op=(e,t)=>{if(!t||!t.maxAge&&!e[Ha])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[Ha]&&n>e[Ha]},pu=e=>{if(e[ni]>e[Ma])for(let t=e[en].tail;e[ni]>e[Ma]&&t!==null;){const n=t.prev;ul(e,t),t=n}},ul=(e,t)=>{if(t){const n=t.value;e[Jo]&&e[Jo](n.key,n.value),e[ni]-=n.length,e[Gr].delete(n.key),e[en].removeNode(t)}};class lre{constructor(t,n,r,o,i){this.key=t,this.value=n,this.length=r,this.now=o,this.maxAge=i||0}}const eT=(e,t,n,r)=>{let o=n.value;op(e,o)&&(ul(e,n),e[Gu]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};var ure=sre;const cre=mr(ure),WO=g.createContext(void 0);function bb(){return g.useContext(WO)}function dre(){const e={},t=new cre({max:1200}),n={};let r=!1;class o{observeCell(a,l){return e[a]||(e[a]=[]),e[a].push(l),()=>{e[a]=e[a].filter(u=>u!==l),e[a].length===0&&(n[a]=null)}}disableObservers(){r=!0}enableObservers(){r=!1}prewarmCache(a,l){t.set(a,l)}listen(){return Rt("cells-changed",function(a){r||a.forEach(l=>{const u=e[l.name];u&&(u.forEach(c=>c(l)),n[l.name]=Promise.resolve(l),t.set(l.name,l))})})}bind(a="__global",l,u,c){l=typeof l=="string"?{name:l,value:null}:l;const f=`${a}!${l.name}`,d=this.observeCell(f,c);if(t.has(f)&&c(t.get(f)),n[f]!=null)n[f].then(c);else{const h=this.get(a,l.name);n[f]=h,h.then(p=>{n[f]===h&&(t.set(f,p),c(p))})}return d}get(a,l){return Y("getCell",{sheetName:a,name:l})}getCellNames(a){return Y("getCellNamesInSheet",{sheetName:a})}createQuery(a,l,u){return Y("create-query",{sheetName:a,name:l,query:u.serialize()})}}return new o}function fre({children:e}){const t=g.useMemo(()=>dre(),[]);return g.useEffect(()=>t.listen(),[t]),s.jsx(WO.Provider,{value:t,children:e})}async function hre(e,t,n,r,o){const 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.org/docs/releases")}},onClose:async()=>{await o({"flags.updateNotificationShownForVersion":i})}})}function mn(){const e=Ft(),t=Te(n=>n.queries.accountsLoaded);return g.useEffect(()=>{t||e(Uo())},[]),Te(n=>n.queries.accounts)}function Hn(){const e=an(),t=vb();return g.useCallback((n,r={})=>{if(typeof n=="number")t(n);else{const o={replace:r.replace||tT(n,e)?!0:void 0,...r,state:{...r?.state,previousLocation:e}},{previousLocation:i,...a}=e.state||{};i==null||!tT(n,i)||JSON.stringify(r?.state||{})!==JSON.stringify(a)?t(n,o):t(-1)}},[t,e])}function tT(e,t){return e===t.pathname+t.search+t.hash}function VO(){const e=Hn();return g.useLayoutEffect(()=>{window.__navigate=e},[e]),null}function nT(e){return e.replace("v","").split(".").map(t=>parseInt(t))}function YO(e,t){const n=nT(e),r=nT(t);return n[0]-r[0]||n[1]-r[1]||n[2]-r[2]}async function qO(){if(_l)return Promise.resolve("v99.9.9");try{const n=(await(await fetch("https://api.github.com/repos/actualbudget/actual/tags")).json()).map(r=>r.name).concat([`v${window.Actual?.ACTUAL_VERSION}`]);return n.sort(YO),n[n.length-1]}catch{return"unknown"}}async function GO(e){const t=window.Actual?.ACTUAL_VERSION;return e==="unknown"?Promise.resolve(!1):YO(t,e)<0}var pre=Object.defineProperty,gre=(e,t)=>{for(var n in t)pre(e,n,{get:t[n],enumerable:!0})},co={};gre(co,{assign:()=>vre,colors:()=>ra,createStringInterpolator:()=>jb,skipAnimation:()=>tA,to:()=>eA,willAdvance:()=>Ib});var wb=Id(),xe=e=>jd(e,wb),Sb=Id();xe.write=e=>jd(e,Sb);var Ig=Id();xe.onStart=e=>jd(e,Ig);var kb=Id();xe.onFrame=e=>jd(e,kb);var Tb=Id();xe.onFinish=e=>jd(e,Tb);var cl=[];xe.setTimeout=(e,t)=>{const n=xe.now()+t,r=()=>{const i=cl.findIndex(a=>a.cancel==r);~i&&cl.splice(i,1),qi-=~i?1:0},o={time:n,handler:e,cancel:r};return cl.splice(KO(n),0,o),qi+=1,QO(),o};var KO=e=>~(~cl.findIndex(t=>t.time>e)||~cl.length);xe.cancel=e=>{Ig.delete(e),kb.delete(e),Tb.delete(e),wb.delete(e),Sb.delete(e)};xe.sync=e=>{Tv=!0,xe.batchedUpdates(e),Tv=!1};xe.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...o){t=o,xe.onStart(n)}return r.handler=e,r.cancel=()=>{Ig.delete(n),t=null},r};var Cb=typeof window<"u"?window.requestAnimationFrame:()=>{};xe.use=e=>Cb=e;xe.now=typeof performance<"u"?()=>performance.now():Date.now;xe.batchedUpdates=e=>e();xe.catch=console.error;xe.frameLoop="always";xe.advance=()=>{xe.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):ZO()};var Yi=-1,qi=0,Tv=!1;function jd(e,t){Tv?(t.delete(e),e(0)):(t.add(e),QO())}function QO(){Yi<0&&(Yi=0,xe.frameLoop!=="demand"&&Cb(XO))}function mre(){Yi=-1}function XO(){~Yi&&(Cb(XO),xe.batchedUpdates(ZO))}function ZO(){const e=Yi;Yi=xe.now();const t=KO(Yi);if(t&&(JO(cl.splice(0,t),n=>n.handler()),qi-=t),!qi){mre();return}Ig.flush(),wb.flush(e?Math.min(64,Yi-e):16.667),kb.flush(),Sb.flush(),Tb.flush()}function Id(){let e=new Set,t=e;return{add(n){qi+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return qi-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,qi-=t.size,JO(t,r=>r(n)&&e.add(r)),qi+=e.size,t=e)}}}function JO(e,t){e.forEach(n=>{try{t(n)}catch(r){xe.catch(r)}})}function Cv(){}var yre=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Z={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function ei(e,t){if(Z.arr(e)){if(!Z.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var ye=(e,t)=>e.forEach(t);function Lo(e,t,n){if(Z.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(const r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var On=e=>Z.und(e)?[]:Z.arr(e)?e:[e];function Ku(e,t){if(e.size){const n=Array.from(e);e.clear(),ye(n,t)}}var Du=(e,...t)=>Ku(e,n=>n(...t)),Eb=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),jb,eA,ra=null,tA=!1,Ib=Cv,vre=e=>{e.to&&(eA=e.to),e.now&&(xe.now=e.now),e.colors!==void 0&&(ra=e.colors),e.skipAnimation!=null&&(tA=e.skipAnimation),e.createStringInterpolator&&(jb=e.createStringInterpolator),e.requestAnimationFrame&&xe.use(e.requestAnimationFrame),e.batchedUpdates&&(xe.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Ib=e.willAdvance),e.frameLoop&&(xe.frameLoop=e.frameLoop)},Qu=new Set,Ar=[],oy=[],ip=0,Dg={get idle(){return!Qu.size&&!Ar.length},start(e){ip>e.priority?(Qu.add(e),xe.onStart(xre)):(nA(e),xe(Ev))},advance:Ev,sort(e){if(ip)xe.onFrame(()=>Dg.sort(e));else{const t=Ar.indexOf(e);~t&&(Ar.splice(t,1),rA(e))}},clear(){Ar=[],Qu.clear()}};function xre(){Qu.forEach(nA),Qu.clear(),xe(Ev)}function nA(e){Ar.includes(e)||rA(e)}function rA(e){Ar.splice(bre(Ar,t=>t.priority>e.priority),0,e)}function Ev(e){const t=oy;for(let n=0;n<Ar.length;n++){const r=Ar[n];ip=r.priority,r.idle||(Ib(r),r.advance(e),r.idle||t.push(r))}return ip=0,oy=Ar,oy.length=0,Ar=t,Ar.length>0}function bre(e,t){const n=e.findIndex(t);return n<0?e.length:n}var wre=(e,t,n)=>Math.min(Math.max(n,e),t),Sre={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},to="[-+]?\\d*\\.?\\d+",ap=to+"%";function _g(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var kre=new RegExp("rgb"+_g(to,to,to)),Tre=new RegExp("rgba"+_g(to,to,to,to)),Cre=new RegExp("hsl"+_g(to,ap,ap)),Ere=new RegExp("hsla"+_g(to,ap,ap,to)),jre=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ire=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Dre=/^#([0-9a-fA-F]{6})$/,_re=/^#([0-9a-fA-F]{8})$/;function Ore(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Dre.exec(e))?parseInt(t[1]+"ff",16)>>>0:ra&&ra[e]!==void 0?ra[e]:(t=kre.exec(e))?(_s(t[1])<<24|_s(t[2])<<16|_s(t[3])<<8|255)>>>0:(t=Tre.exec(e))?(_s(t[1])<<24|_s(t[2])<<16|_s(t[3])<<8|iT(t[4]))>>>0:(t=jre.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=_re.exec(e))?parseInt(t[1],16)>>>0:(t=Ire.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Cre.exec(e))?(rT(oT(t[1]),Sf(t[2]),Sf(t[3]))|255)>>>0:(t=Ere.exec(e))?(rT(oT(t[1]),Sf(t[2]),Sf(t[3]))|iT(t[4]))>>>0:null}function iy(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function rT(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=iy(o,r,e+1/3),a=iy(o,r,e),l=iy(o,r,e-1/3);return Math.round(i*255)<<24|Math.round(a*255)<<16|Math.round(l*255)<<8}function _s(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function oT(e){return(parseFloat(e)%360+360)%360/360}function iT(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Sf(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function aT(e){let t=Ore(e);if(t===null)return e;t=t||0;const n=(t&4278190080)>>>24,r=(t&16711680)>>>16,o=(t&65280)>>>8,i=(t&255)/255;return`rgba(${n}, ${r}, ${o}, ${i})`}var Pc=(e,t,n)=>{if(Z.fun(e))return e;if(Z.arr(e))return Pc({range:e,output:t,extrapolate:n});if(Z.str(e.output[0]))return jb(e);const r=e,o=r.output,i=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",l=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||(c=>c);return c=>{const f=Pre(c,i);return Are(c,i[f],i[f+1],o[f],o[f+1],u,a,l,r.map)}};function Are(e,t,n,r,o,i,a,l,u){let c=u?u(e):e;if(c<t){if(a==="identity")return c;a==="clamp"&&(c=t)}if(c>n){if(l==="identity")return c;l==="clamp"&&(c=n)}return r===o?r:t===n?e<=t?r:o:(t===-1/0?c=-c:n===1/0?c=c-t:c=(c-t)/(n-t),c=i(c),r===-1/0?c=-c:o===1/0?c=c+r:c=c*(o-r)+r,c)}function Pre(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var Mre=(e,t="end")=>n=>{n=t==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*e,o=t==="end"?Math.floor(r):Math.ceil(r);return wre(0,1,o/e)},sp=1.70158,kf=sp*1.525,sT=sp+1,lT=2*Math.PI/3,uT=2*Math.PI/4.5,Tf=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Rre={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>sT*e*e*e-sp*e*e,easeOutBack:e=>1+sT*Math.pow(e-1,3)+sp*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((kf+1)*2*e-kf)/2:(Math.pow(2*e-2,2)*((kf+1)*(e*2-2)+kf)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*lT),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*lT)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*uT))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*uT)/2+1,easeInBounce:e=>1-Tf(1-e),easeOutBounce:Tf,easeInOutBounce:e=>e<.5?(1-Tf(1-2*e))/2:(1+Tf(2*e-1))/2,steps:Mre},Mc=Symbol.for("FluidValue.get"),Cl=Symbol.for("FluidValue.observers"),Dr=e=>!!(e&&e[Mc]),Yn=e=>e&&e[Mc]?e[Mc]():e,cT=e=>e[Cl]||null;function Bre(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Rc(e,t){const n=e[Cl];n&&n.forEach(r=>{Bre(r,t)})}var oA=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Lre(this,e)}},Lre=(e,t)=>iA(e,Mc,t);function Yl(e,t){if(e[Mc]){let n=e[Cl];n||iA(e,Cl,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Bc(e,t){const n=e[Cl];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[Cl]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var iA=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),nh=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Nre=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,dT=new RegExp(`(${nh.source})(%|[a-z]+)`,"i"),$re=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Og=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,aA=e=>{const[t,n]=Fre(e);if(!t||Eb())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){const o=window.getComputedStyle(document.documentElement).getPropertyValue(n);return o||e}else{if(n&&Og.test(n))return aA(n);if(n)return n}return e},Fre=e=>{const t=Og.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},ay,Hre=(e,t,n,r,o)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,sA=e=>{ay||(ay=ra?new RegExp(`(${Object.keys(ra).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(i=>Yn(i).replace(Og,aA).replace(Nre,aT).replace(ay,aT)),n=t.map(i=>i.match(nh).map(Number)),o=n[0].map((i,a)=>n.map(l=>{if(!(a in l))throw Error('The arity of each "output" value must be equal');return l[a]})).map(i=>Pc({...e,output:i}));return i=>{const a=!dT.test(t[0])&&t.find(u=>dT.test(u))?.replace(nh,"");let l=0;return t[0].replace(nh,()=>`${o[l++](i)}${a||""}`).replace($re,Hre)}},Db="react-spring: ",lA=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${Db}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},zre=lA(console.warn);function Ure(){zre(`${Db}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var Wre=lA(console.warn);function Vre(){Wre(`${Db}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Ag(e){return Z.str(e)&&(e[0]=="#"||/\d/.test(e)||!Eb()&&Og.test(e)||e in(ra||{}))}var za=Eb()?g.useEffect:g.useLayoutEffect,Yre=()=>{const e=g.useRef(!1);return za(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function _b(){const e=g.useState()[1],t=Yre();return()=>{t.current&&e(Math.random())}}function qre(e,t){const[n]=g.useState(()=>({inputs:t,result:e()})),r=g.useRef(),o=r.current;let i=o;return i?t&&i.inputs&&Gre(t,i.inputs)||(i={inputs:t,result:e()}):i=n,g.useEffect(()=>{r.current=i,o==n&&(n.inputs=n.result=void 0)},[i]),i.result}function Gre(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Ob=e=>g.useEffect(e,Kre),Kre=[];function jv(e){const t=g.useRef();return g.useEffect(()=>{t.current=e}),t.current}var Lc=Symbol.for("Animated:node"),Qre=e=>!!e&&e[Lc]===e,Co=e=>e&&e[Lc],Ab=(e,t)=>yre(e,Lc,t),Pg=e=>e&&e[Lc]&&e[Lc].getPayload(),uA=class{constructor(){Ab(this,this)}getPayload(){return this.payload||[]}},Dd=class extends uA{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,Z.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Dd(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Z.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Z.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Nc=class extends Dd{constructor(e){super(0),this._string=null,this._toString=Pc({output:[e,e]})}static create(e){return new Nc(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(Z.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Pc({output:[this.getValue(),e]})),this._value=0,super.reset()}},lp={dependencies:null},Mg=class extends uA{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Lo(this.source,(n,r)=>{Qre(n)?t[r]=n.getValue(e):Dr(n)?t[r]=Yn(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&ye(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return Lo(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){lp.dependencies&&Dr(e)&&lp.dependencies.add(e);const t=Pg(e);t&&ye(t,n=>this.add(n))}},cA=class extends Mg{constructor(e){super(e)}static create(e){return new cA(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,r)=>n.setValue(e[r])).some(Boolean):(super.setValue(e.map(Xre)),!0)}};function Xre(e){return(Ag(e)?Nc:Dd).create(e)}function Iv(e){const t=Co(e);return t?t.constructor:Z.arr(e)?cA:Ag(e)?Nc:Dd}var fT=(e,t)=>{const n=!Z.fun(e)||e.prototype&&e.prototype.isReactComponent;return g.forwardRef((r,o)=>{const i=g.useRef(null),a=n&&g.useCallback(m=>{i.current=eoe(o,m)},[o]),[l,u]=Jre(r,t),c=_b(),f=()=>{const m=i.current;if(n&&!m)return;(m?t.applyAnimatedValues(m,l.getValue(!0)):!1)===!1&&c()},d=new Zre(f,u),h=g.useRef();za(()=>(h.current=d,ye(u,m=>Yl(m,d)),()=>{h.current&&(ye(h.current.deps,m=>Bc(m,h.current)),xe.cancel(h.current.update))})),g.useEffect(f,[]),Ob(()=>()=>{const m=h.current;ye(m.deps,x=>Bc(x,m))});const p=t.getComponentProps(l.getValue());return g.createElement(e,{...p,ref:a})})},Zre=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&xe.write(this.update)}};function Jre(e,t){const n=new Set;return lp.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Mg(e),lp.dependencies=null,[e,n]}function eoe(e,t){return e&&(Z.fun(e)?e(t):e.current=t),t}var hT=Symbol.for("AnimatedComponent"),toe=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=o=>new Mg(o),getComponentProps:r=o=>o}={})=>{const o={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},i=a=>{const l=pT(a)||"Anonymous";return Z.str(a)?a=i[a]||(i[a]=fT(a,o)):a=a[hT]||(a[hT]=fT(a,o)),a.displayName=`Animated(${l})`,a};return Lo(e,(a,l)=>{Z.arr(e)&&(l=pT(a)),i[l]=i(a)}),{animated:i}},pT=e=>Z.str(e)?e:e&&Z.str(e.displayName)?e.displayName:Z.fun(e)&&e.name||null;function qn(e,...t){return Z.fun(e)?e(...t):e}var Xu=(e,t)=>e===!0||!!(t&&e&&(Z.fun(e)?e(t):On(e).includes(t))),dA=(e,t)=>Z.obj(e)?t&&e[t]:e,fA=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,noe=e=>e,Rg=(e,t=noe)=>{let n=roe;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));const r={};for(const o of n){const i=t(e[o],o);Z.und(i)||(r[o]=i)}return r},roe=["config","onProps","onStart","onChange","onPause","onResume","onRest"],ooe={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function ioe(e){const t={};let n=0;if(Lo(e,(r,o)=>{ooe[o]||(t[o]=r,n++)}),n)return t}function Pb(e){const t=ioe(e);if(t){const n={to:t};return Lo(e,(r,o)=>o in t||(n[o]=r)),n}return{...e}}function $c(e){return e=Yn(e),Z.arr(e)?e.map($c):Ag(e)?co.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function hA(e){for(const t in e)return!0;return!1}function Dv(e){return Z.fun(e)||Z.arr(e)&&Z.obj(e[0])}function _v(e,t){e.ref?.delete(e),t?.delete(e)}function pA(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var _u={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},Ov={..._u.default,mass:1,damping:1,easing:Rre.linear,clamp:!1},aoe=class{constructor(){this.velocity=0,Object.assign(this,Ov)}};function soe(e,t,n){n&&(n={...n},gT(n,t),t={...n,...t}),gT(e,t),Object.assign(e,t);for(const a in Ov)e[a]==null&&(e[a]=Ov[a]);let{frequency:r,damping:o}=e;const{mass:i}=e;return Z.und(r)||(r<.01&&(r=.01),o<0&&(o=0),e.tension=Math.pow(2*Math.PI/r,2)*i,e.friction=4*Math.PI*o*i/r),e}function gT(e,t){if(!Z.und(t.decay))e.duration=void 0;else{const n=!Z.und(t.tension)||!Z.und(t.friction);(n||!Z.und(t.frequency)||!Z.und(t.damping)||!Z.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var mT=[],loe=class{constructor(){this.changed=!1,this.values=mT,this.toValues=null,this.fromValues=mT,this.config=new aoe,this.immediate=!1}};function gA(e,{key:t,props:n,defaultProps:r,state:o,actions:i}){return new Promise((a,l)=>{let u,c,f=Xu(n.cancel??r?.cancel,t);if(f)p();else{Z.und(n.pause)||(o.paused=Xu(n.pause,t));let m=r?.pause;m!==!0&&(m=o.paused||Xu(m,t)),u=qn(n.delay||0,t),m?(o.resumeQueue.add(h),i.pause()):(i.resume(),h())}function d(){o.resumeQueue.add(h),o.timeouts.delete(c),c.cancel(),u=c.time-xe.now()}function h(){u>0&&!co.skipAnimation?(o.delayed=!0,c=xe.setTimeout(p,u),o.pauseQueue.add(d),o.timeouts.add(c)):p()}function p(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(c),e<=(o.cancelId||0)&&(f=!0);try{i.start({...n,callId:e,cancel:f},a)}catch(m){l(m)}}})}var Mb=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?dl(e.get()):t.every(n=>n.noop)?mA(e.get()):Jr(e.get(),t.every(n=>n.finished)),mA=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Jr=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),dl=e=>({value:e,cancelled:!0,finished:!1});function yA(e,t,n,r){const{callId:o,parentId:i,onRest:a}=t,{asyncTo:l,promise:u}=n;return!i&&e===l&&!t.reset?u:n.promise=(async()=>{n.asyncId=o,n.asyncTo=e;const c=Rg(t,(k,v)=>v==="onRest"?void 0:k);let f,d;const h=new Promise((k,v)=>(f=k,d=v)),p=k=>{const v=o<=(n.cancelId||0)&&dl(r)||o!==n.asyncId&&Jr(r,!1);if(v)throw k.result=v,d(k),k},m=(k,v)=>{const y=new yT,b=new vT;return(async()=>{if(co.skipAnimation)throw Fc(n),b.result=Jr(r,!1),d(b),b;p(y);const w=Z.obj(k)?{...k}:{...v,to:k};w.parentId=o,Lo(c,(T,_)=>{Z.und(w[_])&&(w[_]=T)});const E=await r.start(w);return p(y),n.paused&&await new Promise(T=>{n.resumeQueue.add(T)}),E})()};let x;if(co.skipAnimation)return Fc(n),Jr(r,!1);try{let k;Z.arr(e)?k=(async v=>{for(const y of v)await m(y)})(e):k=Promise.resolve(e(m,r.stop.bind(r))),await Promise.all([k.then(f),h]),x=Jr(r.get(),!0,!1)}catch(k){if(k instanceof yT)x=k.result;else if(k instanceof vT)x=k.result;else throw k}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?l:void 0,n.promise=i?u:void 0)}return Z.fun(a)&&xe.batchedUpdates(()=>{a(x,r,r.item)}),x})()}function Fc(e,t){Ku(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var yT=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},vT=class extends Error{constructor(){super("SkipAnimationSignal")}},Av=e=>e instanceof Rb,uoe=1,Rb=class extends oA{constructor(){super(...arguments),this.id=uoe++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Co(this);return e&&e.getValue()}to(...e){return co.to(this,e)}interpolate(...e){return Ure(),co.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Rc(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Dg.sort(this),Rc(this,{type:"priority",parent:this,priority:e})}},os=Symbol.for("SpringPhase"),vA=1,Pv=2,Mv=4,sy=e=>(e[os]&vA)>0,Ci=e=>(e[os]&Pv)>0,gu=e=>(e[os]&Mv)>0,xT=(e,t)=>t?e[os]|=Pv|vA:e[os]&=~Pv,bT=(e,t)=>t?e[os]|=Mv:e[os]&=~Mv,coe=class extends Rb{constructor(e,t){if(super(),this.animation=new loe,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Z.und(e)||!Z.und(t)){const n=Z.obj(e)?{...e}:{...t,from:e};Z.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Ci(this)||this._state.asyncTo)||gu(this)}get goal(){return Yn(this.animation.to)}get velocity(){const e=Co(this);return e instanceof Dd?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return sy(this)}get isAnimating(){return Ci(this)}get isPaused(){return gu(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{toValues:o}=r;const{config:i}=r,a=Pg(r.to);!a&&Dr(r.to)&&(o=On(Yn(r.to))),r.values.forEach((c,f)=>{if(c.done)return;const d=c.constructor==Nc?1:a?a[f].lastPosition:o[f];let h=r.immediate,p=d;if(!h){if(p=c.lastPosition,i.tension<=0){c.done=!0;return}let m=c.elapsedTime+=e;const x=r.fromValues[f],k=c.v0!=null?c.v0:c.v0=Z.arr(i.velocity)?i.velocity[f]:i.velocity;let v;const y=i.precision||(x==d?.005:Math.min(1,Math.abs(d-x)*.001));if(Z.und(i.duration))if(i.decay){const b=i.decay===!0?.998:i.decay,w=Math.exp(-(1-b)*m);p=x+k/(1-b)*(1-w),h=Math.abs(c.lastPosition-p)<=y,v=k*w}else{v=c.lastVelocity==null?k:c.lastVelocity;const b=i.restVelocity||y/10,w=i.clamp?0:i.bounce,E=!Z.und(w),T=x==d?c.v0>0:x<d;let _,M=!1;const B=1,O=Math.ceil(e/B);for(let N=0;N<O&&(_=Math.abs(v)>b,!(!_&&(h=Math.abs(d-p)<=y,h)));++N){E&&(M=p==d||p>d==T,M&&(v=-v*w,p=d));const H=-i.tension*1e-6*(p-d),F=-i.friction*.001*v,L=(H+F)/i.mass;v=v+L*B,p=p+v*B}}else{let b=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,c.durationProgress>0&&(c.elapsedTime=i.duration*c.durationProgress,m=c.elapsedTime+=e)),b=(i.progress||0)+m/this._memoizedDuration,b=b>1?1:b<0?0:b,c.durationProgress=b),p=x+i.easing(b)*(d-x),v=(p-c.lastPosition)/e,h=b==1}c.lastVelocity=v,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),h=!0)}a&&!a[f].done&&(h=!1),h?c.done=!0:t=!1,c.setValue(p,i.round)&&(n=!0)});const l=Co(this),u=l.getValue();if(t){const c=Yn(r.to);(u!==c||n)&&!i.decay?(l.setValue(c),this._onChange(c)):n&&i.decay&&this._onChange(u),this._stop()}else n&&this._onChange(u)}set(e){return xe.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Ci(this)){const{to:e,config:t}=this.animation;xe.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Z.und(e)?(n=this.queue||[],this.queue=[]):n=[Z.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>Mb(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Fc(this._state,e&&this._lastCallId),xe.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=Z.obj(n)?n[t]:n,(n==null||Dv(n))&&(n=void 0),r=Z.obj(r)?r[t]:r,r==null&&(r=void 0);const o={to:n,from:r};return sy(this)||(e.reverse&&([n,r]=[r,n]),r=Yn(r),Z.und(r)?Co(this)||this._set(n):this._set(r)),o}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,Rg(e,(a,l)=>/^on/.test(l)?dA(a,n):a)),ST(this,e,"onProps"),yu(this,"onProps",e,this);const o=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return gA(++this._lastCallId,{key:n,props:e,defaultProps:r,state:i,actions:{pause:()=>{gu(this)||(bT(this,!0),Du(i.pauseQueue),yu(this,"onPause",Jr(this,mu(this,this.animation.to)),this))},resume:()=>{gu(this)&&(bT(this,!1),Ci(this)&&this._resume(),Du(i.resumeQueue),yu(this,"onResume",Jr(this,mu(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then(a=>{if(e.loop&&a.finished&&!(t&&a.noop)){const l=xA(e);if(l)return this._update(l,!0)}return a})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(dl(this));const r=!Z.und(e.to),o=!Z.und(e.from);if(r||o)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(dl(this));const{key:i,defaultProps:a,animation:l}=this,{to:u,from:c}=l;let{to:f=u,from:d=c}=e;o&&!r&&(!t.default||Z.und(f))&&(f=d),t.reverse&&([f,d]=[d,f]);const h=!ei(d,c);h&&(l.from=d),d=Yn(d);const p=!ei(f,u);p&&this._focus(f);const m=Dv(t.to),{config:x}=l,{decay:k,velocity:v}=x;(r||o)&&(x.velocity=0),t.config&&!m&&soe(x,qn(t.config,i),t.config!==a.config?qn(a.config,i):void 0);let y=Co(this);if(!y||Z.und(f))return n(Jr(this,!0));const b=Z.und(t.reset)?o&&!t.default:!Z.und(d)&&Xu(t.reset,i),w=b?d:this.get(),E=$c(f),T=Z.num(E)||Z.arr(E)||Ag(E),_=!m&&(!T||Xu(a.immediate||t.immediate,i));if(p){const N=Iv(f);if(N!==y.constructor)if(_)y=this._set(E);else throw Error(`Cannot animate between ${y.constructor.name} and ${N.name}, as the "to" prop suggests`)}const M=y.constructor;let B=Dr(f),O=!1;if(!B){const N=b||!sy(this)&&h;(p||N)&&(O=ei($c(w),E),B=!O),(!ei(l.immediate,_)&&!_||!ei(x.decay,k)||!ei(x.velocity,v))&&(B=!0)}if(O&&Ci(this)&&(l.changed&&!b?B=!0:B||this._stop(u)),!m&&((B||Dr(u))&&(l.values=y.getPayload(),l.toValues=Dr(f)?null:M==Nc?[1]:On(E)),l.immediate!=_&&(l.immediate=_,!_&&!b&&this._set(u)),B)){const{onRest:N}=l;ye(foe,F=>ST(this,t,F));const H=Jr(this,mu(this,u));Du(this._pendingCalls,H),this._pendingCalls.add(n),l.changed&&xe.batchedUpdates(()=>{l.changed=!b,N?.(H,this),b?qn(a.onRest,H):l.onStart?.(H,this)})}b&&this._set(w),m?n(yA(t.to,t,this._state,this)):B?this._start():Ci(this)&&!p?this._pendingCalls.add(n):n(mA(w))}_focus(e){const t=this.animation;e!==t.to&&(cT(this)&&this._detach(),t.to=e,cT(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Dr(t)&&(Yl(t,this),Av(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Dr(e)&&Bc(e,this)}_set(e,t=!0){const n=Yn(e);if(!Z.und(n)){const r=Co(this);if(!r||!ei(n,r.getValue())){const o=Iv(n);!r||r.constructor!=o?Ab(this,o.create(n)):r.setValue(n),r&&xe.batchedUpdates(()=>{this._onChange(n,t)})}}return Co(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,yu(this,"onStart",Jr(this,mu(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),qn(this.animation.onChange,e,this)),qn(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Co(this).reset(Yn(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),Ci(this)||(xT(this,!0),gu(this)||this._resume())}_resume(){co.skipAnimation?this.finish():Dg.start(this)}_stop(e,t){if(Ci(this)){xT(this,!1);const n=this.animation;ye(n.values,o=>{o.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Rc(this,{type:"idle",parent:this});const r=t?dl(this.get()):Jr(this.get(),mu(this,e??n.to));Du(this._pendingCalls,r),n.changed&&(n.changed=!1,yu(this,"onRest",r,this))}}};function mu(e,t){const n=$c(t),r=$c(e.get());return ei(r,n)}function xA(e,t=e.loop,n=e.to){const r=qn(t);if(r){const o=r!==!0&&Pb(r),i=(o||e).reverse,a=!o||o.reset;return Hc({...e,loop:t,default:!1,pause:void 0,to:!i||Dv(n)?n:void 0,from:a?e.from:void 0,reset:a,...o})}}function Hc(e){const{to:t,from:n}=e=Pb(e),r=new Set;return Z.obj(t)&&wT(t,r),Z.obj(n)&&wT(n,r),e.keys=r.size?Array.from(r):null,e}function doe(e){const t=Hc(e);return Z.und(t.default)&&(t.default=Rg(t)),t}function wT(e,t){Lo(e,(n,r)=>n!=null&&t.add(r))}var foe=["onStart","onRest","onChange","onPause","onResume"];function ST(e,t,n){e.animation[n]=t[n]!==fA(t,n)?dA(t[n],e.key):void 0}function yu(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var hoe=["onStart","onChange","onRest"],poe=1,bA=class{constructor(t,n){this.id=poe++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),t&&this.start({default:!0,...t})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((n,r)=>t[r]=n.get()),t}set(t){for(const n in t){const r=t[n];Z.und(r)||this.springs[n].set(r)}}update(t){return t&&this.queue.push(Hc(t)),this}start(t){let{queue:n}=this;return t?n=On(t).map(Hc):this.queue=[],this._flush?this._flush(this,n):(CA(this,n),Rv(this,n))}stop(t,n){if(t!==!!t&&(n=t),n){const r=this.springs;ye(On(n),o=>r[o].stop(!!t))}else Fc(this._state,this._lastAsyncId),this.each(r=>r.stop(!!t));return this}pause(t){if(Z.und(t))this.start({pause:!0});else{const n=this.springs;ye(On(t),r=>n[r].pause())}return this}resume(t){if(Z.und(t))this.start({pause:!1});else{const n=this.springs;ye(On(t),r=>n[r].resume())}return this}each(t){Lo(this.springs,t)}_onFrame(){const{onStart:t,onChange:n,onRest:r}=this._events,o=this._active.size>0,i=this._changed.size>0;(o&&!this._started||i&&!this._started)&&(this._started=!0,Ku(t,([u,c])=>{c.value=this.get(),u(c,this,this._item)}));const a=!o&&this._started,l=i||a&&r.size?this.get():null;i&&n.size&&Ku(n,([u,c])=>{c.value=l,u(c,this,this._item)}),a&&(this._started=!1,Ku(r,([u,c])=>{c.value=l,u(c,this,this._item)}))}eventObserved(t){if(t.type=="change")this._changed.add(t.parent),t.idle||this._active.add(t.parent);else if(t.type=="idle")this._active.delete(t.parent);else return;xe.onFrame(this._onFrame)}};function Rv(e,t){return Promise.all(t.map(n=>wA(e,n))).then(n=>Mb(e,n))}async function wA(e,t,n){const{keys:r,to:o,from:i,loop:a,onRest:l,onResolve:u}=t,c=Z.obj(t.default)&&t.default;a&&(t.loop=!1),o===!1&&(t.to=null),i===!1&&(t.from=null);const f=Z.arr(o)||Z.fun(o)?o:void 0;f?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):ye(hoe,x=>{const k=t[x];if(Z.fun(k)){const v=e._events[x];t[x]=({finished:y,cancelled:b})=>{const w=v.get(k);w?(y||(w.finished=!1),b&&(w.cancelled=!0)):v.set(k,{value:null,finished:y||!1,cancelled:b||!1})},c&&(c[x]=t[x])}});const d=e._state;t.pause===!d.paused?(d.paused=t.pause,Du(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const h=(r||Object.keys(e.springs)).map(x=>e.springs[x].start(t)),p=t.cancel===!0||fA(t,"cancel")===!0;(f||p&&d.asyncId)&&h.push(gA(++e._lastAsyncId,{props:t,state:d,actions:{pause:Cv,resume:Cv,start(x,k){p?(Fc(d,e._lastAsyncId),k(dl(e))):(x.onRest=l,k(yA(f,x,d,e)))}}})),d.paused&&await new Promise(x=>{d.resumeQueue.add(x)});const m=Mb(e,await Promise.all(h));if(a&&m.finished&&!(n&&m.noop)){const x=xA(t,a,o);if(x)return CA(e,[x]),wA(e,x,!0)}return u&&xe.batchedUpdates(()=>u(m,e,e.item)),m}function Bv(e,t){const n={...e.springs};return t&&ye(On(t),r=>{Z.und(r.keys)&&(r=Hc(r)),Z.obj(r.to)||(r={...r,to:void 0}),TA(n,r,o=>kA(o))}),SA(e,n),n}function SA(e,t){Lo(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,Yl(n,e))})}function kA(e,t){const n=new coe;return n.key=e,t&&Yl(n,t),n}function TA(e,t,n){t.keys&&ye(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function CA(e,t){ye(t,n=>{TA(e.springs,n,r=>kA(r,e))})}var _d=({children:e,...t})=>{const n=g.useContext(up),r=t.pause||!!n.pause,o=t.immediate||!!n.immediate;t=qre(()=>({pause:r,immediate:o}),[r,o]);const{Provider:i}=up;return g.createElement(i,{value:t},e)},up=goe(_d,{});_d.Provider=up.Provider;_d.Consumer=up.Consumer;function goe(e,t){return Object.assign(e,g.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var EA=()=>{const e=[],t=function(r){Vre();const o=[];return ye(e,(i,a)=>{if(Z.und(r))o.push(i.start());else{const l=n(r,i,a);l&&o.push(i.start(l))}}),o};t.current=e,t.add=function(r){e.includes(r)||e.push(r)},t.delete=function(r){const o=e.indexOf(r);~o&&e.splice(o,1)},t.pause=function(){return ye(e,r=>r.pause(...arguments)),this},t.resume=function(){return ye(e,r=>r.resume(...arguments)),this},t.set=function(r){ye(e,(o,i)=>{const a=Z.fun(r)?r(i,o):r;a&&o.set(a)})},t.start=function(r){const o=[];return ye(e,(i,a)=>{if(Z.und(r))o.push(i.start());else{const l=this._getProps(r,i,a);l&&o.push(i.start(l))}}),o},t.stop=function(){return ye(e,r=>r.stop(...arguments)),this},t.update=function(r){return ye(e,(o,i)=>o.update(this._getProps(r,o,i))),this};const n=function(r,o,i){return Z.fun(r)?r(i,o):r};return t._getProps=n,t};function moe(e,t,n){const r=Z.fun(t)&&t;r&&!n&&(n=[]);const o=g.useMemo(()=>r||arguments.length==3?EA():void 0,[]),i=g.useRef(0),a=_b(),l=g.useMemo(()=>({ctrls:[],queue:[],flush(v,y){const b=Bv(v,y);return i.current>0&&!l.queue.length&&!Object.keys(b).some(E=>!v.springs[E])?Rv(v,y):new Promise(E=>{SA(v,b),l.queue.push(()=>{E(Rv(v,y))}),a()})}}),[]),u=g.useRef([...l.ctrls]),c=[],f=jv(e)||0;g.useMemo(()=>{ye(u.current.slice(e,f),v=>{_v(v,o),v.stop(!0)}),u.current.length=e,d(f,e)},[e]),g.useMemo(()=>{d(0,Math.min(f,e))},n);function d(v,y){for(let b=v;b<y;b++){const w=u.current[b]||(u.current[b]=new bA(null,l.flush)),E=r?r(b,w):t[b];E&&(c[b]=doe(E))}}const h=u.current.map((v,y)=>Bv(v,c[y])),p=g.useContext(_d),m=jv(p),x=p!==m&&hA(p);za(()=>{i.current++,l.ctrls=u.current;const{queue:v}=l;v.length&&(l.queue=[],ye(v,y=>y())),ye(u.current,(y,b)=>{o?.add(y),x&&y.start({default:p});const w=c[b];w&&(pA(y,w.ref),y.ref?y.queue.push(w):y.start(w))})}),Ob(()=>()=>{ye(l.ctrls,v=>v.stop(!0))});const k=h.map(v=>({...v}));return o?[k,o]:k}function yoe(e,t){const n=Z.fun(e),[[r],o]=moe(1,n?e:[e],n?t||[]:t);return n||arguments.length==2?[r,o]:r}function voe(e,t,n){const r=Z.fun(t)&&t,{reset:o,sort:i,trail:a=0,expires:l=!0,exitBeforeEnter:u=!1,onDestroyed:c,ref:f,config:d}=r?r():t,h=g.useMemo(()=>r||arguments.length==3?EA():void 0,[]),p=On(e),m=[],x=g.useRef(null),k=o?null:x.current;za(()=>{x.current=m}),Ob(()=>(ye(m,L=>{h?.add(L.ctrl),L.ctrl.ref=h}),()=>{ye(x.current,L=>{L.expired&&clearTimeout(L.expirationId),_v(L.ctrl,h),L.ctrl.stop(!0)})}));const v=boe(p,r?r():t,k),y=o&&x.current||[];za(()=>ye(y,({ctrl:L,item:R,key:U})=>{_v(L,h),qn(c,R,U)}));const b=[];if(k&&ye(k,(L,R)=>{L.expired?(clearTimeout(L.expirationId),y.push(L)):(R=b[R]=v.indexOf(L.key),~R&&(m[R]=L))}),ye(p,(L,R)=>{m[R]||(m[R]={key:v[R],item:L,phase:"mount",ctrl:new bA},m[R].ctrl.item=L)}),b.length){let L=-1;const{leave:R}=r?r():t;ye(b,(U,P)=>{const j=k[P];~U?(L=m.indexOf(j),m[L]={...j,item:p[U]}):R&&m.splice(++L,0,j)})}Z.fun(i)&&m.sort((L,R)=>i(L.item,R.item));let w=-a;const E=_b(),T=Rg(t),_=new Map,M=g.useRef(new Map),B=g.useRef(!1);ye(m,(L,R)=>{const U=L.key,P=L.phase,j=r?r():t;let D,C;const $=qn(j.delay||0,U);if(P=="mount")D=j.enter,C="enter";else{const le=v.indexOf(U)<0;if(P!="leave")if(le)D=j.leave,C="leave";else if(D=j.update)C="update";else return;else if(!le)D=j.enter,C="enter";else return}if(D=qn(D,L.item,R),D=Z.obj(D)?Pb(D):{to:D},!D.config){const le=d||T.config;D.config=qn(le,L.item,R,C)}w+=a;const W={...T,delay:$+w,ref:f,immediate:j.immediate,reset:!1,...D};if(C=="enter"&&Z.und(W.from)){const le=r?r():t,ee=Z.und(le.initial)||k?le.from:le.initial;W.from=qn(ee,L.item,R)}const{onResolve:A}=W;W.onResolve=le=>{qn(A,le);const ee=x.current,ie=ee.find(V=>V.key===U);if(ie&&!(le.cancelled&&ie.phase!="update")&&ie.ctrl.idle){const V=ee.every(Q=>Q.ctrl.idle);if(ie.phase=="leave"){const Q=qn(l,ie.item);if(Q!==!1){const ce=Q===!0?0:Q;if(ie.expired=!0,!V&&ce>0){ce<=2147483647&&(ie.expirationId=setTimeout(E,ce));return}}}V&&ee.some(Q=>Q.expired)&&(M.current.delete(ie),u&&(B.current=!0),E())}};const J=Bv(L.ctrl,W);C==="leave"&&u?M.current.set(L,{phase:C,springs:J,payload:W}):_.set(L,{phase:C,springs:J,payload:W})});const O=g.useContext(_d),N=jv(O),H=O!==N&&hA(O);za(()=>{H&&ye(m,L=>{L.ctrl.start({default:O})})},[O]),ye(_,(L,R)=>{if(M.current.size){const U=m.findIndex(P=>P.key===R.key);m.splice(U,1)}}),za(()=>{ye(M.current.size?M.current:_,({phase:L,payload:R},U)=>{const{ctrl:P}=U;U.phase=L,h?.add(P),H&&L=="enter"&&P.start({default:O}),R&&(pA(P,R.ref),(P.ref||h)&&!B.current?P.update(R):(P.start(R),B.current&&(B.current=!1)))})},o?void 0:n);const F=L=>g.createElement(g.Fragment,null,m.map((R,U)=>{const{springs:P}=_.get(R)||R.ctrl,j=L({...P},R.item,R,U);return j&&j.type?g.createElement(j.type,{...j.props,key:Z.str(R.key)||Z.num(R.key)?R.key:R.ctrl.id,ref:j.ref}):j}));return h?[F,h]:F}var xoe=1;function boe(e,{key:t,keys:n=t},r){if(n===null){const o=new Set;return e.map(i=>{const a=r&&r.find(l=>l.item===i&&l.phase!=="leave"&&!o.has(l));return a?(o.add(a),a.key):xoe++})}return Z.und(n)?e:Z.fun(n)?e.map(n):On(n)}var woe=class extends Rb{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Pc(...t);const n=this._get(),r=Iv(n);Ab(this,r.create(n))}advance(e){const t=this._get(),n=this.get();ei(t,n)||(Co(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&kT(this._active)&&ly(this)}_get(){const e=Z.arr(this.source)?this.source.map(Yn):On(Yn(this.source));return this.calc(...e)}_start(){this.idle&&!kT(this._active)&&(this.idle=!1,ye(Pg(this),e=>{e.done=!1}),co.skipAnimation?(xe.batchedUpdates(()=>this.advance()),ly(this)):Dg.start(this))}_attach(){let e=1;ye(On(this.source),t=>{Dr(t)&&Yl(t,this),Av(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){ye(On(this.source),e=>{Dr(e)&&Bc(e,this)}),this._active.clear(),ly(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=On(this.source).reduce((t,n)=>Math.max(t,(Av(n)?n.priority:0)+1),0))}};function Soe(e){return e.idle!==!1}function kT(e){return!e.size||Array.from(e).every(Soe)}function ly(e){e.idle||(e.idle=!0,ye(Pg(e),t=>{t.done=!0}),Rc(e,{type:"idle",parent:e}))}co.assign({createStringInterpolator:sA,to:(e,t)=>new woe(e,t)});var jA=/^--/;function koe(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!jA.test(e)&&!(Zu.hasOwnProperty(e)&&Zu[e])?t+"px":(""+t).trim()}var TT={};function Toe(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{style:r,children:o,scrollTop:i,scrollLeft:a,viewBox:l,...u}=t,c=Object.values(u),f=Object.keys(u).map(d=>n||e.hasAttribute(d)?d:TT[d]||(TT[d]=d.replace(/([A-Z])/g,h=>"-"+h.toLowerCase())));o!==void 0&&(e.textContent=o);for(const d in r)if(r.hasOwnProperty(d)){const h=koe(d,r[d]);jA.test(d)?e.style.setProperty(d,h):e.style[d]=h}f.forEach((d,h)=>{e.setAttribute(d,c[h])}),i!==void 0&&(e.scrollTop=i),a!==void 0&&(e.scrollLeft=a),l!==void 0&&e.setAttribute("viewBox",l)}var Zu={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},Coe=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Eoe=["Webkit","Ms","Moz","O"];Zu=Object.keys(Zu).reduce((e,t)=>(Eoe.forEach(n=>e[Coe(n,t)]=e[t]),e),Zu);var joe=/^(matrix|translate|scale|rotate|skew)/,Ioe=/^(translate)/,Doe=/^(rotate|skew)/,uy=(e,t)=>Z.num(e)&&e!==0?e+t:e,rh=(e,t)=>Z.arr(e)?e.every(n=>rh(n,t)):Z.num(e)?e===t:parseFloat(e)===t,_oe=class extends Mg{constructor({x:e,y:t,z:n,...r}){const o=[],i=[];(e||t||n)&&(o.push([e||0,t||0,n||0]),i.push(a=>[`translate3d(${a.map(l=>uy(l,"px")).join(",")})`,rh(a,0)])),Lo(r,(a,l)=>{if(l==="transform")o.push([a||""]),i.push(u=>[u,u===""]);else if(joe.test(l)){if(delete r[l],Z.und(a))return;const u=Ioe.test(l)?"px":Doe.test(l)?"deg":"";o.push(On(a)),i.push(l==="rotate3d"?([c,f,d,h])=>[`rotate3d(${c},${f},${d},${uy(h,u)})`,rh(h,0)]:c=>[`${l}(${c.map(f=>uy(f,u)).join(",")})`,rh(c,l.startsWith("scale")?1:0)])}}),o.length&&(r.transform=new Ooe(o,i)),super(r)}},Ooe=class extends oA{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return ye(this.inputs,(n,r)=>{const o=Yn(n[0]),[i,a]=this.transforms[r](Z.arr(o)?o:n.map(Yn));e+=" "+i,t=t&&a}),t?"none":e}observerAdded(e){e==1&&ye(this.inputs,t=>ye(t,n=>Dr(n)&&Yl(n,this)))}observerRemoved(e){e==0&&ye(this.inputs,t=>ye(t,n=>Dr(n)&&Bc(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Rc(this,e)}},Aoe=["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"];co.assign({batchedUpdates:Pl.unstable_batchedUpdates,createStringInterpolator:sA,colors:Sre});var Poe=toe(Aoe,{applyAnimatedValues:Toe,createAnimatedStyle:e=>new _oe(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),IA=Poe.animated;const xs=e=>s.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:[s.jsx("path",{fill:"currentColor",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",className:"path"}),s.jsx("path",{fill:"currentColor",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",className:"path"})]}),Moe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),Roe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),Boe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.jsx("path",{d:"m0 11 2-2 5 5L18 3l2 2L7 18z",fill:"currentColor"})}),Loe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),Noe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),$oe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),Foe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),Hoe=e=>s.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:[s.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"}),s.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"})]}),zoe=e=>s.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:[s.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"}),s.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"})]}),DA=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),Od=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),Bb=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),Uoe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.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"})}),_A=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),Woe=e=>s.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:[s.jsx("g",{clipPath:"url(#a)",children:s.jsx("path",{fill:"currentColor",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"})}),s.jsx("defs",{children:s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"currentColor",d:"M0 0h20v20H0z"})})})]}),Voe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.jsx("path",{d:"M11 12h6v-1l-3-1V2l3-1V0H3v1l3 1v8l-3 1v1h6v7l1 1 1-1v-7z",fill:"currentColor"})}),Yoe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),qoe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),OA=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),Goe=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 23 3",style:{color:"inherit",...e.style},children:s.jsx("path",{fill:"currentColor",fillRule:"nonzero",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"})}),Bg=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.jsx("path",{d:"m6 2 2-2h4l2 2h4v2H2V2h4zM3 6h14l-1 14H4L3 6zm5 2v10h1V8H8zm3 0v10h1V8h-1z",fill:"currentColor"})}),AA=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.jsx("path",{d:"M17 16v4h-2v-4h-2v-3h6v3h-2zM1 9h6v3H1V9zm6-4h6v3H7V5zM3 0h2v8H3V0zm12 0h2v12h-2V0zM9 0h2v4H9V0zM3 12h2v8H3v-8zm6-4h2v12H9V8z",fill:"currentColor"})}),PA=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.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"})}),Koe=gd({"0%":{transform:"rotateZ(0deg)"},"100%":{transform:"rotateZ(360deg)"}});function Lv({animating:e,iconStyle:t,width:n,height:r}){return s.jsx(I,{style:{animation:e?`${Koe} 1s infinite linear`:null},children:s.jsx(Yoe,{width:n||14,height:r||14,style:t})})}function Qoe(){const t=Te(r=>r.account.accountsSyncing).length,n=voe(t>0?"syncing":null,{from:{opacity:0,transform:"translateY(-100px)"},enter:{opacity:1,transform:"translateY(0)"},leave:{opacity:0,transform:"translateY(-100px)"},unique:!0});return s.jsx(I,{style:{position:"absolute",top:0,left:0,right:0,marginTop:5,alignItems:"center",zIndex:501},children:n((r,o)=>o&&s.jsx(IA.div,{style:r,children:s.jsxs(I,{style:{borderRadius:4,backgroundColor:S.pillBackgroundSelected,color:S.pillTextSelected,padding:"5px 13px",flexDirection:"row",alignItems:"center",...X.shadow},children:[s.jsx(Lv,{animating:!0,iconStyle:{color:S.pillTextSelected}}),s.jsxs(z,{style:{marginLeft:5},children:["Syncing... ",t," account",t>1&&"s"," remaining"]})]})},o))})}const MA=g.createContext(null);function Xoe({children:e}){const[t,n]=g.useState(1);return s.jsx(MA.Provider,{value:{displayMax:t,setDisplayMax:n},children:e})}function Zoe(){return g.useContext(MA)}function Joe(){return Hn(),g.useEffect(()=>{const e=t=>{};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),null}const CT={date:{ops:["is","isapprox","gt","gte","lt","lte"],nullable:!1},id:{ops:["is","contains","oneOf","isNot","doesNotContain","notOneOf"],nullable:!0},saved:{ops:[],nullable:!1},string:{ops:["is","contains","oneOf","isNot","doesNotContain","notOneOf"],nullable:!0},number:{ops:["is","isapprox","isbetween","gt","gte","lt","lte"],nullable:!1},boolean:{ops:["is"],nullable:!1}},Ju=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",reconciled:"boolean",saved:"saved"})),RA={"fixed-amount":"a fixed amount","fixed-percent":"a fixed percent",remainder:"an equal portion of the remainder"};function oa(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 so(e,t){switch(e){case"oneOf":return"one of";case"notOneOf":return"not one of";case"is":return"is";case"isNot":return"is not";case"isapprox":return"is approx";case"isbetween":return"is between";case"contains":return"contains";case"doesNotContain":return"does not contain";case"gt":return t==="date"?"is after":"is greater than";case"gte":return t==="date"?"is after or equals":"is greater than or equals";case"lt":return t==="date"?"is before":"is less than";case"lte":return t==="date"?"is before or equals":"is less than or equals";case"true":return"is true";case"false":return"is false";case"set":return"set";case"set-split-amount":return"allocate";case"link-schedule":return"link schedule";case"and":return"and";case"or":return"or";default:return""}}function Kbe(e){return e==="amount-inflow"?{field:"amount",options:{inflow:!0}}:e==="amount-outflow"?{field:"amount",options:{outflow:!0}}:{field:e}}function eie(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.org/contact/ for support"}}function ET(e){if(e.op==="set-split-amount")return e.options.method==="fixed-amount"?{...e,value:e.value&&Sl(e.value)}:e;switch(e.type){case"number":{let t=e.value;return e.field==="amount"&&e.op!=="isbetween"&&t!=null&&(t=Sl(t)),{...e,value:t}}case"string":{const t=e.value==null?"":e.value;return{...e,value:t}}case"boolean":{const t=e.value;return{...e,value:t}}}return{...e,error:null}}function Nv({error:e,inputKey:t,...n}){if(n.op==="set-split-amount")return n.options.method==="fixed-amount"?{...n,value:n.value&&gr(n.value)}:n.options.method==="fixed-percent"?{...n,value:n.value&&parseFloat(n.value)}:n;switch(n.type){case"number":{let r=n.value;return n.field==="amount"&&n.op!=="isbetween"&&(r=gr(r)),{...n,value:r}}case"string":{const r=n.value==null?"":n.value;return{...n,value:r}}case"boolean":{const r=n.value==null?!1:n.value;return{...n,value:r}}}return n}function Ta(e,t){switch(t.type){case"number":{if(t.op!=="isbetween")return{...t,error:null,value:e&&D1(String(e))||0};break}}return{...t,error:null,value:e}}function Yt(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Ne(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function nt(e){Ne(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||hi(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(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 zc(e,t){Ne(2,arguments);var n=nt(e),r=Yt(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function Lb(e,t){Ne(2,arguments);var n=nt(e),r=Yt(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());i.setMonth(n.getMonth()+r+1,0);var a=i.getDate();return o>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}function tie(e,t){Ne(2,arguments);var n=nt(e).getTime(),r=Yt(t);return new Date(n+r)}var nie={};function ql(){return nie}function cp(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()}function jT(e){Ne(1,arguments);var t=nt(e);return t.setHours(0,0,0,0),t}var rie=864e5;function oie(e,t){Ne(2,arguments);var n=jT(e),r=jT(t),o=n.getTime()-cp(n),i=r.getTime()-cp(r);return Math.round((o-i)/rie)}function iie(e,t){Ne(2,arguments);var n=Yt(t),r=n*7;return zc(e,r)}var Nb=6e4,$b=36e5,aie=1e3;function sie(e){return Ne(1,arguments),e instanceof Date||hi(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Oo(e){if(Ne(1,arguments),!sie(e)&&typeof e!="number")return!1;var t=nt(e);return!isNaN(Number(t))}function lie(e,t){Ne(2,arguments);var n=nt(e),r=nt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function uie(e){Ne(1,arguments);var t=nt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function cie(e){Ne(1,arguments);var t=nt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function BA(e,t){Ne(2,arguments);var n=Yt(t);return tie(e,-n)}var die=864e5;function fie(e){Ne(1,arguments);var t=nt(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/die)+1}function El(e){Ne(1,arguments);var t=1,n=nt(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function LA(e){Ne(1,arguments);var t=nt(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=El(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=El(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function hie(e){Ne(1,arguments);var t=LA(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=El(n);return r}var pie=6048e5;function NA(e){Ne(1,arguments);var t=nt(e),n=El(t).getTime()-hie(t).getTime();return Math.round(n/pie)+1}function is(e,t){var n,r,o,i,a,l,u,c;Ne(1,arguments);var f=ql(),d=Yt((n=(r=(o=(i=t?.weekStartsOn)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&r!==void 0?r:(u=f.locale)===null||u===void 0||(c=u.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=nt(e),p=h.getUTCDay(),m=(p<d?7:0)+p-d;return h.setUTCDate(h.getUTCDate()-m),h.setUTCHours(0,0,0,0),h}function Fb(e,t){var n,r,o,i,a,l,u,c;Ne(1,arguments);var f=nt(e),d=f.getUTCFullYear(),h=ql(),p=Yt((n=(r=(o=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&o!==void 0?o:h.firstWeekContainsDate)!==null&&r!==void 0?r:(u=h.locale)===null||u===void 0||(c=u.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(d+1,0,p),m.setUTCHours(0,0,0,0);var x=is(m,t),k=new Date(0);k.setUTCFullYear(d,0,p),k.setUTCHours(0,0,0,0);var v=is(k,t);return f.getTime()>=x.getTime()?d+1:f.getTime()>=v.getTime()?d:d-1}function gie(e,t){var n,r,o,i,a,l,u,c;Ne(1,arguments);var f=ql(),d=Yt((n=(r=(o=(i=t?.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(a=t.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.firstWeekContainsDate)!==null&&o!==void 0?o:f.firstWeekContainsDate)!==null&&r!==void 0?r:(u=f.locale)===null||u===void 0||(c=u.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&n!==void 0?n:1),h=Fb(e,t),p=new Date(0);p.setUTCFullYear(h,0,d),p.setUTCHours(0,0,0,0);var m=is(p,t);return m}var mie=6048e5;function $A(e,t){Ne(1,arguments);var n=nt(e),r=is(n,t).getTime()-gie(n,t).getTime();return Math.round(r/mie)+1}function qe(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var yie={y:function(t,n){var r=t.getUTCFullYear(),o=r>0?r:1-r;return qe(n==="yy"?o%100:o,n.length)},M:function(t,n){var r=t.getUTCMonth();return n==="M"?String(r+1):qe(r+1,2)},d:function(t,n){return qe(t.getUTCDate(),n.length)},a:function(t,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,n){return qe(t.getUTCHours()%12||12,n.length)},H:function(t,n){return qe(t.getUTCHours(),n.length)},m:function(t,n){return qe(t.getUTCMinutes(),n.length)},s:function(t,n){return qe(t.getUTCSeconds(),n.length)},S:function(t,n){var r=n.length,o=t.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,r-3));return qe(i,n.length)}};const Ei=yie;var Os={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vie={G:function(t,n,r){var o=t.getUTCFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(t,n,r){if(n==="yo"){var o=t.getUTCFullYear(),i=o>0?o:1-o;return r.ordinalNumber(i,{unit:"year"})}return Ei.y(t,n)},Y:function(t,n,r,o){var i=Fb(t,o),a=i>0?i:1-i;if(n==="YY"){var l=a%100;return qe(l,2)}return n==="Yo"?r.ordinalNumber(a,{unit:"year"}):qe(a,n.length)},R:function(t,n){var r=LA(t);return qe(r,n.length)},u:function(t,n){var r=t.getUTCFullYear();return qe(r,n.length)},Q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"Q":return String(o);case"QQ":return qe(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,n,r){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(n){case"q":return String(o);case"qq":return qe(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,n,r){var o=t.getUTCMonth();switch(n){case"M":case"MM":return Ei.M(t,n);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(t,n,r){var o=t.getUTCMonth();switch(n){case"L":return String(o+1);case"LL":return qe(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(t,n,r,o){var i=$A(t,o);return n==="wo"?r.ordinalNumber(i,{unit:"week"}):qe(i,n.length)},I:function(t,n,r){var o=NA(t);return n==="Io"?r.ordinalNumber(o,{unit:"week"}):qe(o,n.length)},d:function(t,n,r){return n==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):Ei.d(t,n)},D:function(t,n,r){var o=fie(t);return n==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):qe(o,n.length)},E:function(t,n,r){var o=t.getUTCDay();switch(n){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(t,n,r,o){var i=t.getUTCDay(),a=(i-o.weekStartsOn+8)%7||7;switch(n){case"e":return String(a);case"ee":return qe(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(t,n,r,o){var i=t.getUTCDay(),a=(i-o.weekStartsOn+8)%7||7;switch(n){case"c":return String(a);case"cc":return qe(a,n.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(t,n,r){var o=t.getUTCDay(),i=o===0?7:o;switch(n){case"i":return String(i);case"ii":return qe(i,n.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(t,n,r){var o=t.getUTCHours(),i=o/12>=1?"pm":"am";switch(n){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,n,r){var o=t.getUTCHours(),i;switch(o===12?i=Os.noon:o===0?i=Os.midnight:i=o/12>=1?"pm":"am",n){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,n,r){var o=t.getUTCHours(),i;switch(o>=17?i=Os.evening:o>=12?i=Os.afternoon:o>=4?i=Os.morning:i=Os.night,n){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,n,r){if(n==="ho"){var o=t.getUTCHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return Ei.h(t,n)},H:function(t,n,r){return n==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Ei.H(t,n)},K:function(t,n,r){var o=t.getUTCHours()%12;return n==="Ko"?r.ordinalNumber(o,{unit:"hour"}):qe(o,n.length)},k:function(t,n,r){var o=t.getUTCHours();return o===0&&(o=24),n==="ko"?r.ordinalNumber(o,{unit:"hour"}):qe(o,n.length)},m:function(t,n,r){return n==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Ei.m(t,n)},s:function(t,n,r){return n==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Ei.s(t,n)},S:function(t,n){return Ei.S(t,n)},X:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();if(a===0)return"Z";switch(n){case"X":return DT(a);case"XXXX":case"XX":return _a(a);case"XXXXX":case"XXX":default:return _a(a,":")}},x:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(n){case"x":return DT(a);case"xxxx":case"xx":return _a(a);case"xxxxx":case"xxx":default:return _a(a,":")}},O:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+IT(a,":");case"OOOO":default:return"GMT"+_a(a,":")}},z:function(t,n,r,o){var i=o._originalDate||t,a=i.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+IT(a,":");case"zzzz":default:return"GMT"+_a(a,":")}},t:function(t,n,r,o){var i=o._originalDate||t,a=Math.floor(i.getTime()/1e3);return qe(a,n.length)},T:function(t,n,r,o){var i=o._originalDate||t,a=i.getTime();return qe(a,n.length)}};function IT(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(i===0)return n+String(o);var a=t||"";return n+String(o)+a+qe(i,2)}function DT(e,t){if(e%60===0){var n=e>0?"-":"+";return n+qe(Math.abs(e)/60,2)}return _a(e,t)}function _a(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e),i=qe(Math.floor(o/60),2),a=qe(o%60,2);return r+i+n+a}var _T=function(t,n){switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},FA=function(t,n){switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},xie=function(t,n){var r=t.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return _T(t,n);var a;switch(o){case"P":a=n.dateTime({width:"short"});break;case"PP":a=n.dateTime({width:"medium"});break;case"PPP":a=n.dateTime({width:"long"});break;case"PPPP":default:a=n.dateTime({width:"full"});break}return a.replace("{{date}}",_T(o,n)).replace("{{time}}",FA(i,n))},$v={p:FA,P:xie},bie=["D","DD"],wie=["YY","YYYY"];function HA(e){return bie.indexOf(e)!==-1}function zA(e){return wie.indexOf(e)!==-1}function dp(e,t,n){if(e==="YYYY")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(e==="YY")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(e==="D")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(e==="DD")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 Sie={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"}},kie=function(t,n,r){var o,i=Sie[t];return typeof i=="string"?o=i:n===1?o=i.one:o=i.other.replace("{{count}}",n.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};const Tie=kie;function cy(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth,r=e.formats[n]||e.formats[e.defaultWidth];return r}}var Cie={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Eie={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},jie={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Iie={date:cy({formats:Cie,defaultWidth:"full"}),time:cy({formats:Eie,defaultWidth:"full"}),dateTime:cy({formats:jie,defaultWidth:"full"})};const Die=Iie;var _ie={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Oie=function(t,n,r,o){return _ie[t]};const Aie=Oie;function vu(e){return function(t,n){var r=n!=null&&n.context?String(n.context):"standalone",o;if(r==="formatting"&&e.formattingValues){var i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;o=e.formattingValues[a]||e.formattingValues[i]}else{var l=e.defaultWidth,u=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[u]||e.values[l]}var c=e.argumentCallback?e.argumentCallback(t):t;return o[c]}}var Pie={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Mie={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Rie={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"]},Bie={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"]},Lie={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"}},Nie={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"}},$ie=function(t,n){var r=Number(t),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Fie={ordinalNumber:$ie,era:vu({values:Pie,defaultWidth:"wide"}),quarter:vu({values:Mie,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:vu({values:Rie,defaultWidth:"wide"}),day:vu({values:Bie,defaultWidth:"wide"}),dayPeriod:vu({values:Lie,defaultWidth:"wide",formattingValues:Nie,defaultFormattingWidth:"wide"})};const Hie=Fie;function xu(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?Uie(l,function(d){return d.test(a)}):zie(l,function(d){return d.test(a)}),c;c=e.valueCallback?e.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;var f=t.slice(a.length);return{value:c,rest:f}}}function zie(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}function Uie(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}function Wie(e){return function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var a=e.valueCallback?e.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;var l=t.slice(o.length);return{value:a,rest:l}}}var Vie=/^(\d+)(th|st|nd|rd)?/i,Yie=/\d+/i,qie={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},Gie={any:[/^b/i,/^(a|c)/i]},Kie={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Qie={any:[/1/i,/2/i,/3/i,/4/i]},Xie={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},Zie={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]},Jie={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},eae={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]},tae={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},nae={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}},rae={ordinalNumber:Wie({matchPattern:Vie,parsePattern:Yie,valueCallback:function(t){return parseInt(t,10)}}),era:xu({matchPatterns:qie,defaultMatchWidth:"wide",parsePatterns:Gie,defaultParseWidth:"any"}),quarter:xu({matchPatterns:Kie,defaultMatchWidth:"wide",parsePatterns:Qie,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:xu({matchPatterns:Xie,defaultMatchWidth:"wide",parsePatterns:Zie,defaultParseWidth:"any"}),day:xu({matchPatterns:Jie,defaultMatchWidth:"wide",parsePatterns:eae,defaultParseWidth:"any"}),dayPeriod:xu({matchPatterns:tae,defaultMatchWidth:"any",parsePatterns:nae,defaultParseWidth:"any"})};const oae=rae;var iae={code:"en-US",formatDistance:Tie,formatLong:Die,formatRelative:Aie,localize:Hie,match:oae,options:{weekStartsOn:0,firstWeekContainsDate:1}};const UA=iae;var aae=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sae=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lae=/^'([^]*?)'?$/,uae=/''/g,cae=/[a-zA-Z]/;function ke(e,t,n){var r,o,i,a,l,u,c,f,d,h,p,m,x,k,v,y,b,w;Ne(2,arguments);var E=String(t),T=ql(),_=(r=(o=n?.locale)!==null&&o!==void 0?o:T.locale)!==null&&r!==void 0?r:UA,M=Yt((i=(a=(l=(u=n?.firstWeekContainsDate)!==null&&u!==void 0?u:n==null||(c=n.locale)===null||c===void 0||(f=c.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&l!==void 0?l:T.firstWeekContainsDate)!==null&&a!==void 0?a:(d=T.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(M>=1&&M<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var B=Yt((p=(m=(x=(k=n?.weekStartsOn)!==null&&k!==void 0?k:n==null||(v=n.locale)===null||v===void 0||(y=v.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&x!==void 0?x:T.weekStartsOn)!==null&&m!==void 0?m:(b=T.locale)===null||b===void 0||(w=b.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(B>=0&&B<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!_.localize)throw new RangeError("locale must contain localize property");if(!_.formatLong)throw new RangeError("locale must contain formatLong property");var O=nt(e);if(!Oo(O))throw new RangeError("Invalid time value");var N=cp(O),H=BA(O,N),F={firstWeekContainsDate:M,weekStartsOn:B,locale:_,_originalDate:O},L=E.match(sae).map(function(R){var U=R[0];if(U==="p"||U==="P"){var P=$v[U];return P(R,_.formatLong)}return R}).join("").match(aae).map(function(R){if(R==="''")return"'";var U=R[0];if(U==="'")return dae(R);var P=vie[U];if(P)return!(n!=null&&n.useAdditionalWeekYearTokens)&&zA(R)&&dp(R,t,String(e)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&HA(R)&&dp(R,t,String(e)),P(H,R,_.localize,F);if(U.match(cae))throw new RangeError("Format string contains an unescaped latin alphabet character `"+U+"`");return R}).join("");return L}function dae(e){var t=e.match(lae);return t?t[1].replace(uae,"'"):e}function fae(e,t){if(e==null)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 hae(e,t){Ne(2,arguments);var n=nt(e),r=nt(t);return n.getTime()>r.getTime()}function Hb(e,t){Ne(2,arguments);var n=nt(e),r=nt(t);return n.getTime()<r.getTime()}function OT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pae(e,t){if(e){if(typeof e=="string")return OT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OT(e,t)}}function AT(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=pae(e))||t&&e&&typeof e.length=="number"){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(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
115
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,l;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return i=c.done,c},e:function(c){a=!0,l=c},f:function(){try{!i&&n.return!=null&&n.return()}finally{if(a)throw l}}}}function se(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fp(e,t){return fp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},fp(e,t)}function $e(e,t){if(typeof t!="function"&&t!==null)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&&fp(e,t)}function hp(e){return hp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hp(e)}function WA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WA=function(){return!!e})()}function gae(e,t){if(t&&(hi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return se(e)}function Fe(e){var t=WA();return function(){var r=hp(e),o;if(t){var i=hp(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return gae(this,o)}}function Oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PT(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,SI(r.key),r)}}function Ae(e,t,n){return t&&PT(e.prototype,t),n&&PT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var mae=10,VA=function(){function e(){Oe(this,e),ae(this,"priority",void 0),ae(this,"subPriority",0)}return Ae(e,[{key:"validate",value:function(n,r){return!0}}]),e}(),yae=function(e){$e(n,e);var t=Fe(n);function n(r,o,i,a,l){var u;return Oe(this,n),u=t.call(this),u.value=r,u.validateValue=o,u.setValue=i,u.priority=a,l&&(u.subPriority=l),u}return Ae(n,[{key:"validate",value:function(o,i){return this.validateValue(o,this.value,i)}},{key:"set",value:function(o,i,a){return this.setValue(o,i,this.value,a)}}]),n}(VA),vae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",mae),ae(se(r),"subPriority",-1),r}return Ae(n,[{key:"set",value:function(o,i){if(i.timestampIsSet)return o;var a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}}]),n}(VA),Ye=function(){function e(){Oe(this,e),ae(this,"incompatibleTokens",void 0),ae(this,"priority",void 0),ae(this,"subPriority",void 0)}return Ae(e,[{key:"run",value:function(n,r,o,i){var a=this.parse(n,r,o,i);return a?{setter:new yae(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}},{key:"validate",value:function(n,r,o){return!0}}]),e}(),xae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",140),ae(se(r),"incompatibleTokens",["R","u","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"G":case"GG":case"GGG":return a.era(o,{width:"abbreviated"})||a.era(o,{width:"narrow"});case"GGGGG":return a.era(o,{width:"narrow"});case"GGGG":default:return a.era(o,{width:"wide"})||a.era(o,{width:"abbreviated"})||a.era(o,{width:"narrow"})}}},{key:"set",value:function(o,i,a){return i.era=a,o.setUTCFullYear(a,0,1),o.setUTCHours(0,0,0,0),o}}]),n}(Ye),Lt={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}/},Io={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Nt(e,t){return e&&{value:t(e.value),rest:e.rest}}function St(e,t){var n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Do(e,t){var n=t.match(e);if(!n)return null;if(n[0]==="Z")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*$b+i*Nb+a*aie),rest:t.slice(n[0].length)}}function YA(e){return St(Lt.anyDigitsSigned,e)}function _t(e,t){switch(e){case 1:return St(Lt.singleDigit,t);case 2:return St(Lt.twoDigits,t);case 3:return St(Lt.threeDigits,t);case 4:return St(Lt.fourDigits,t);default:return St(new RegExp("^\\d{1,"+e+"}"),t)}}function pp(e,t){switch(e){case 1:return St(Lt.singleDigitSigned,t);case 2:return St(Lt.twoDigitsSigned,t);case 3:return St(Lt.threeDigitsSigned,t);case 4:return St(Lt.fourDigitsSigned,t);default:return St(new RegExp("^-?\\d{1,"+e+"}"),t)}}function zb(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function qA(e,t){var n=t>0,r=n?t:1-t,o;if(r<=50)o=e||100;else{var i=r+50,a=Math.floor(i/100)*100,l=e>=i%100;o=e+a-(l?100:0)}return n?o:1-o}function GA(e){return e%400===0||e%4===0&&e%100!==0}var bae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",130),ae(se(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){var l=function(c){return{year:c,isTwoDigitYear:i==="yy"}};switch(i){case"y":return Nt(_t(4,o),l);case"yo":return Nt(a.ordinalNumber(o,{unit:"year"}),l);default:return Nt(_t(i.length,o),l)}}},{key:"validate",value:function(o,i){return i.isTwoDigitYear||i.year>0}},{key:"set",value:function(o,i,a){var l=o.getUTCFullYear();if(a.isTwoDigitYear){var u=qA(a.year,l);return o.setUTCFullYear(u,0,1),o.setUTCHours(0,0,0,0),o}var c=!("era"in i)||i.era===1?a.year:1-a.year;return o.setUTCFullYear(c,0,1),o.setUTCHours(0,0,0,0),o}}]),n}(Ye),wae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",130),ae(se(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){var l=function(c){return{year:c,isTwoDigitYear:i==="YY"}};switch(i){case"Y":return Nt(_t(4,o),l);case"Yo":return Nt(a.ordinalNumber(o,{unit:"year"}),l);default:return Nt(_t(i.length,o),l)}}},{key:"validate",value:function(o,i){return i.isTwoDigitYear||i.year>0}},{key:"set",value:function(o,i,a,l){var u=Fb(o,l);if(a.isTwoDigitYear){var c=qA(a.year,u);return o.setUTCFullYear(c,0,l.firstWeekContainsDate),o.setUTCHours(0,0,0,0),is(o,l)}var f=!("era"in i)||i.era===1?a.year:1-a.year;return o.setUTCFullYear(f,0,l.firstWeekContainsDate),o.setUTCHours(0,0,0,0),is(o,l)}}]),n}(Ye),Sae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",130),ae(se(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i){return pp(i==="R"?4:i.length,o)}},{key:"set",value:function(o,i,a){var l=new Date(0);return l.setUTCFullYear(a,0,4),l.setUTCHours(0,0,0,0),El(l)}}]),n}(Ye),kae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",130),ae(se(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i){return pp(i==="u"?4:i.length,o)}},{key:"set",value:function(o,i,a){return o.setUTCFullYear(a,0,1),o.setUTCHours(0,0,0,0),o}}]),n}(Ye),Tae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",120),ae(se(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"Q":case"QQ":return _t(i.length,o);case"Qo":return a.ordinalNumber(o,{unit:"quarter"});case"QQQ":return a.quarter(o,{width:"abbreviated",context:"formatting"})||a.quarter(o,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(o,{width:"wide",context:"formatting"})||a.quarter(o,{width:"abbreviated",context:"formatting"})||a.quarter(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=1&&i<=4}},{key:"set",value:function(o,i,a){return o.setUTCMonth((a-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),n}(Ye),Cae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",120),ae(se(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"q":case"qq":return _t(i.length,o);case"qo":return a.ordinalNumber(o,{unit:"quarter"});case"qqq":return a.quarter(o,{width:"abbreviated",context:"standalone"})||a.quarter(o,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(o,{width:"wide",context:"standalone"})||a.quarter(o,{width:"abbreviated",context:"standalone"})||a.quarter(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=1&&i<=4}},{key:"set",value:function(o,i,a){return o.setUTCMonth((a-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),n}(Ye),Eae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),ae(se(r),"priority",110),r}return Ae(n,[{key:"parse",value:function(o,i,a){var l=function(c){return c-1};switch(i){case"M":return Nt(St(Lt.month,o),l);case"MM":return Nt(_t(2,o),l);case"Mo":return Nt(a.ordinalNumber(o,{unit:"month"}),l);case"MMM":return a.month(o,{width:"abbreviated",context:"formatting"})||a.month(o,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(o,{width:"wide",context:"formatting"})||a.month(o,{width:"abbreviated",context:"formatting"})||a.month(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=11}},{key:"set",value:function(o,i,a){return o.setUTCMonth(a,1),o.setUTCHours(0,0,0,0),o}}]),n}(Ye),jae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",110),ae(se(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){var l=function(c){return c-1};switch(i){case"L":return Nt(St(Lt.month,o),l);case"LL":return Nt(_t(2,o),l);case"Lo":return Nt(a.ordinalNumber(o,{unit:"month"}),l);case"LLL":return a.month(o,{width:"abbreviated",context:"standalone"})||a.month(o,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(o,{width:"wide",context:"standalone"})||a.month(o,{width:"abbreviated",context:"standalone"})||a.month(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=11}},{key:"set",value:function(o,i,a){return o.setUTCMonth(a,1),o.setUTCHours(0,0,0,0),o}}]),n}(Ye);function Iae(e,t,n){Ne(2,arguments);var r=nt(e),o=Yt(t),i=$A(r,n)-o;return r.setUTCDate(r.getUTCDate()-i*7),r}var Dae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",100),ae(se(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"w":return St(Lt.week,o);case"wo":return a.ordinalNumber(o,{unit:"week"});default:return _t(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=53}},{key:"set",value:function(o,i,a,l){return is(Iae(o,a,l),l)}}]),n}(Ye);function _ae(e,t){Ne(2,arguments);var n=nt(e),r=Yt(t),o=NA(n)-r;return n.setUTCDate(n.getUTCDate()-o*7),n}var Oae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",100),ae(se(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"I":return St(Lt.week,o);case"Io":return a.ordinalNumber(o,{unit:"week"});default:return _t(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=53}},{key:"set",value:function(o,i,a){return El(_ae(o,a))}}]),n}(Ye),Aae=[31,28,31,30,31,30,31,31,30,31,30,31],Pae=[31,29,31,30,31,30,31,31,30,31,30,31],Mae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",90),ae(se(r),"subPriority",1),ae(se(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"d":return St(Lt.date,o);case"do":return a.ordinalNumber(o,{unit:"date"});default:return _t(i.length,o)}}},{key:"validate",value:function(o,i){var a=o.getUTCFullYear(),l=GA(a),u=o.getUTCMonth();return l?i>=1&&i<=Pae[u]:i>=1&&i<=Aae[u]}},{key:"set",value:function(o,i,a){return o.setUTCDate(a),o.setUTCHours(0,0,0,0),o}}]),n}(Ye),Rae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",90),ae(se(r),"subpriority",1),ae(se(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"D":case"DD":return St(Lt.dayOfYear,o);case"Do":return a.ordinalNumber(o,{unit:"date"});default:return _t(i.length,o)}}},{key:"validate",value:function(o,i){var a=o.getUTCFullYear(),l=GA(a);return l?i>=1&&i<=366:i>=1&&i<=365}},{key:"set",value:function(o,i,a){return o.setUTCMonth(0,a),o.setUTCHours(0,0,0,0),o}}]),n}(Ye);function Ub(e,t,n){var r,o,i,a,l,u,c,f;Ne(2,arguments);var d=ql(),h=Yt((r=(o=(i=(a=n?.weekStartsOn)!==null&&a!==void 0?a:n==null||(l=n.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&i!==void 0?i:d.weekStartsOn)!==null&&o!==void 0?o:(c=d.locale)===null||c===void 0||(f=c.options)===null||f===void 0?void 0:f.weekStartsOn)!==null&&r!==void 0?r:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=nt(e),m=Yt(t),x=p.getUTCDay(),k=m%7,v=(k+7)%7,y=(v<h?7:0)+m-x;return p.setUTCDate(p.getUTCDate()+y),p}var Bae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",90),ae(se(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"E":case"EE":case"EEE":return a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(o,{width:"wide",context:"formatting"})||a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,a,l){return o=Ub(o,a,l),o.setUTCHours(0,0,0,0),o}}]),n}(Ye),Lae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",90),ae(se(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a,l){var u=function(f){var d=Math.floor((f-1)/7)*7;return(f+l.weekStartsOn+6)%7+d};switch(i){case"e":case"ee":return Nt(_t(i.length,o),u);case"eo":return Nt(a.ordinalNumber(o,{unit:"day"}),u);case"eee":return a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case"eeeee":return a.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(o,{width:"wide",context:"formatting"})||a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,a,l){return o=Ub(o,a,l),o.setUTCHours(0,0,0,0),o}}]),n}(Ye),Nae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",90),ae(se(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a,l){var u=function(f){var d=Math.floor((f-1)/7)*7;return(f+l.weekStartsOn+6)%7+d};switch(i){case"c":case"cc":return Nt(_t(i.length,o),u);case"co":return Nt(a.ordinalNumber(o,{unit:"day"}),u);case"ccc":return a.day(o,{width:"abbreviated",context:"standalone"})||a.day(o,{width:"short",context:"standalone"})||a.day(o,{width:"narrow",context:"standalone"});case"ccccc":return a.day(o,{width:"narrow",context:"standalone"});case"cccccc":return a.day(o,{width:"short",context:"standalone"})||a.day(o,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(o,{width:"wide",context:"standalone"})||a.day(o,{width:"abbreviated",context:"standalone"})||a.day(o,{width:"short",context:"standalone"})||a.day(o,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(o,i){return i>=0&&i<=6}},{key:"set",value:function(o,i,a,l){return o=Ub(o,a,l),o.setUTCHours(0,0,0,0),o}}]),n}(Ye);function $ae(e,t){Ne(2,arguments);var n=Yt(t);n%7===0&&(n=n-7);var r=1,o=nt(e),i=o.getUTCDay(),a=n%7,l=(a+7)%7,u=(l<r?7:0)+n-i;return o.setUTCDate(o.getUTCDate()+u),o}var Fae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",90),ae(se(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){var l=function(c){return c===0?7:c};switch(i){case"i":case"ii":return _t(i.length,o);case"io":return a.ordinalNumber(o,{unit:"day"});case"iii":return Nt(a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"}),l);case"iiiii":return Nt(a.day(o,{width:"narrow",context:"formatting"}),l);case"iiiiii":return Nt(a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"}),l);case"iiii":default:return Nt(a.day(o,{width:"wide",context:"formatting"})||a.day(o,{width:"abbreviated",context:"formatting"})||a.day(o,{width:"short",context:"formatting"})||a.day(o,{width:"narrow",context:"formatting"}),l)}}},{key:"validate",value:function(o,i){return i>=1&&i<=7}},{key:"set",value:function(o,i,a){return o=$ae(o,a),o.setUTCHours(0,0,0,0),o}}]),n}(Ye),Hae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",80),ae(se(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"a":case"aa":case"aaa":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})||a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,a){return o.setUTCHours(zb(a),0,0,0),o}}]),n}(Ye),zae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",80),ae(se(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"b":case"bb":case"bbb":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})||a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,a){return o.setUTCHours(zb(a),0,0,0),o}}]),n}(Ye),Uae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",80),ae(se(r),"incompatibleTokens",["a","b","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"B":case"BB":case"BBB":return a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(o,{width:"wide",context:"formatting"})||a.dayPeriod(o,{width:"abbreviated",context:"formatting"})||a.dayPeriod(o,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(o,i,a){return o.setUTCHours(zb(a),0,0,0),o}}]),n}(Ye),Wae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",70),ae(se(r),"incompatibleTokens",["H","K","k","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"h":return St(Lt.hour12h,o);case"ho":return a.ordinalNumber(o,{unit:"hour"});default:return _t(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=12}},{key:"set",value:function(o,i,a){var l=o.getUTCHours()>=12;return l&&a<12?o.setUTCHours(a+12,0,0,0):!l&&a===12?o.setUTCHours(0,0,0,0):o.setUTCHours(a,0,0,0),o}}]),n}(Ye),Vae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",70),ae(se(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"H":return St(Lt.hour23h,o);case"Ho":return a.ordinalNumber(o,{unit:"hour"});default:return _t(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=23}},{key:"set",value:function(o,i,a){return o.setUTCHours(a,0,0,0),o}}]),n}(Ye),Yae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",70),ae(se(r),"incompatibleTokens",["h","H","k","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"K":return St(Lt.hour11h,o);case"Ko":return a.ordinalNumber(o,{unit:"hour"});default:return _t(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=11}},{key:"set",value:function(o,i,a){var l=o.getUTCHours()>=12;return l&&a<12?o.setUTCHours(a+12,0,0,0):o.setUTCHours(a,0,0,0),o}}]),n}(Ye),qae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",70),ae(se(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"k":return St(Lt.hour24h,o);case"ko":return a.ordinalNumber(o,{unit:"hour"});default:return _t(i.length,o)}}},{key:"validate",value:function(o,i){return i>=1&&i<=24}},{key:"set",value:function(o,i,a){var l=a<=24?a%24:a;return o.setUTCHours(l,0,0,0),o}}]),n}(Ye),Gae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",60),ae(se(r),"incompatibleTokens",["t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"m":return St(Lt.minute,o);case"mo":return a.ordinalNumber(o,{unit:"minute"});default:return _t(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=59}},{key:"set",value:function(o,i,a){return o.setUTCMinutes(a,0,0),o}}]),n}(Ye),Kae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",50),ae(se(r),"incompatibleTokens",["t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i,a){switch(i){case"s":return St(Lt.second,o);case"so":return a.ordinalNumber(o,{unit:"second"});default:return _t(i.length,o)}}},{key:"validate",value:function(o,i){return i>=0&&i<=59}},{key:"set",value:function(o,i,a){return o.setUTCSeconds(a,0),o}}]),n}(Ye),Qae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",30),ae(se(r),"incompatibleTokens",["t","T"]),r}return Ae(n,[{key:"parse",value:function(o,i){var a=function(u){return Math.floor(u*Math.pow(10,-i.length+3))};return Nt(_t(i.length,o),a)}},{key:"set",value:function(o,i,a){return o.setUTCMilliseconds(a),o}}]),n}(Ye),Xae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",10),ae(se(r),"incompatibleTokens",["t","T","x"]),r}return Ae(n,[{key:"parse",value:function(o,i){switch(i){case"X":return Do(Io.basicOptionalMinutes,o);case"XX":return Do(Io.basic,o);case"XXXX":return Do(Io.basicOptionalSeconds,o);case"XXXXX":return Do(Io.extendedOptionalSeconds,o);case"XXX":default:return Do(Io.extended,o)}}},{key:"set",value:function(o,i,a){return i.timestampIsSet?o:new Date(o.getTime()-a)}}]),n}(Ye),Zae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",10),ae(se(r),"incompatibleTokens",["t","T","X"]),r}return Ae(n,[{key:"parse",value:function(o,i){switch(i){case"x":return Do(Io.basicOptionalMinutes,o);case"xx":return Do(Io.basic,o);case"xxxx":return Do(Io.basicOptionalSeconds,o);case"xxxxx":return Do(Io.extendedOptionalSeconds,o);case"xxx":default:return Do(Io.extended,o)}}},{key:"set",value:function(o,i,a){return i.timestampIsSet?o:new Date(o.getTime()-a)}}]),n}(Ye),Jae=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",40),ae(se(r),"incompatibleTokens","*"),r}return Ae(n,[{key:"parse",value:function(o){return YA(o)}},{key:"set",value:function(o,i,a){return[new Date(a*1e3),{timestampIsSet:!0}]}}]),n}(Ye),ese=function(e){$e(n,e);var t=Fe(n);function n(){var r;Oe(this,n);for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r=t.call.apply(t,[this].concat(i)),ae(se(r),"priority",20),ae(se(r),"incompatibleTokens","*"),r}return Ae(n,[{key:"parse",value:function(o){return YA(o)}},{key:"set",value:function(o,i,a){return[new Date(a),{timestampIsSet:!0}]}}]),n}(Ye),tse={G:new xae,y:new bae,Y:new wae,R:new Sae,u:new kae,Q:new Tae,q:new Cae,M:new Eae,L:new jae,w:new Dae,I:new Oae,d:new Mae,D:new Rae,E:new Bae,e:new Lae,c:new Nae,i:new Fae,a:new Hae,b:new zae,B:new Uae,h:new Wae,H:new Vae,K:new Yae,k:new qae,m:new Gae,s:new Kae,S:new Qae,X:new Xae,x:new Zae,t:new Jae,T:new ese},nse=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rse=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ose=/^'([^]*?)'?$/,ise=/''/g,ase=/\S/,sse=/[a-zA-Z]/;function Sn(e,t,n,r){var o,i,a,l,u,c,f,d,h,p,m,x,k,v,y,b,w,E;Ne(3,arguments);var T=String(e),_=String(t),M=ql(),B=(o=(i=r?.locale)!==null&&i!==void 0?i:M.locale)!==null&&o!==void 0?o:UA;if(!B.match)throw new RangeError("locale must contain match property");var O=Yt((a=(l=(u=(c=r?.firstWeekContainsDate)!==null&&c!==void 0?c:r==null||(f=r.locale)===null||f===void 0||(d=f.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&u!==void 0?u:M.firstWeekContainsDate)!==null&&l!==void 0?l:(h=M.locale)===null||h===void 0||(p=h.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var N=Yt((m=(x=(k=(v=r?.weekStartsOn)!==null&&v!==void 0?v:r==null||(y=r.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&k!==void 0?k:M.weekStartsOn)!==null&&x!==void 0?x:(w=M.locale)===null||w===void 0||(E=w.options)===null||E===void 0?void 0:E.weekStartsOn)!==null&&m!==void 0?m:0);if(!(N>=0&&N<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(_==="")return T===""?nt(n):new Date(NaN);var H={firstWeekContainsDate:O,weekStartsOn:N,locale:B},F=[new vae],L=_.match(rse).map(function(V){var Q=V[0];if(Q in $v){var ce=$v[Q];return ce(V,B.formatLong)}return V}).join("").match(nse),R=[],U=AT(L),P;try{var j=function(){var Q=P.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&zA(Q)&&dp(Q,_,e),!(r!=null&&r.useAdditionalDayOfYearTokens)&&HA(Q)&&dp(Q,_,e);var ce=Q[0],He=tse[ce];if(He){var Re=He.incompatibleTokens;if(Array.isArray(Re)){var me=R.find(function(qt){return Re.includes(qt.token)||qt.token===ce});if(me)throw new RangeError("The format string mustn't contain `".concat(me.fullToken,"` and `").concat(Q,"` at the same time"))}else if(He.incompatibleTokens==="*"&&R.length>0)throw new RangeError("The format string mustn't contain `".concat(Q,"` and any other token at the same time"));R.push({token:ce,fullToken:Q});var ft=He.run(T,Q,B.match,H);if(!ft)return{v:new Date(NaN)};F.push(ft.setter),T=ft.rest}else{if(ce.match(sse))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ce+"`");if(Q==="''"?Q="'":ce==="'"&&(Q=lse(Q)),T.indexOf(Q)===0)T=T.slice(Q.length);else return{v:new Date(NaN)}}};for(U.s();!(P=U.n()).done;){var D=j();if(hi(D)==="object")return D.v}}catch(V){U.e(V)}finally{U.f()}if(T.length>0&&ase.test(T))return new Date(NaN);var C=F.map(function(V){return V.priority}).sort(function(V,Q){return Q-V}).filter(function(V,Q,ce){return ce.indexOf(V)===Q}).map(function(V){return F.filter(function(Q){return Q.priority===V}).sort(function(Q,ce){return ce.subPriority-Q.subPriority})}).map(function(V){return V[0]}),$=nt(n);if(isNaN($.getTime()))return new Date(NaN);var W=BA($,cp($)),A={},J=AT(C),le;try{for(J.s();!(le=J.n()).done;){var ee=le.value;if(!ee.validate(W,H))return new Date(NaN);var ie=ee.set(W,A,H);Array.isArray(ie)?(W=ie[0],fae(A,ie[1])):W=ie}}catch(V){J.e(V)}finally{J.f()}return W}function lse(e){return e.match(ose)[1].replace(ise,"'")}function Fv(e,t){Ne(2,arguments);var n=Yt(t);return zc(e,-n)}function Mo(e,t){var n;Ne(1,arguments);var r=Yt((n=t?.additionalDigits)!==null&&n!==void 0?n:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var o=fse(e),i;if(o.date){var a=hse(o.date,r);i=pse(a.restDateString,a.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var l=i.getTime(),u=0,c;if(o.time&&(u=gse(o.time),isNaN(u)))return new Date(NaN);if(o.timezone){if(c=mse(o.timezone),isNaN(c))return new Date(NaN)}else{var f=new Date(l+u),d=new Date(0);return d.setFullYear(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()),d.setHours(f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds()),d}return new Date(l+u+c)}var Cf={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},use=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,cse=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dse=/^([+-])(\d{2})(?::?(\d{2}))?$/;function fse(e){var t={},n=e.split(Cf.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Cf.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Cf.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){var o=Cf.timezone.exec(r);o?(t.time=r.replace(o[1],""),t.timezone=o[1]):t.time=r}return t}function hse(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:i===null?o:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function pse(e,t){if(t===null)return new Date(NaN);var n=e.match(use);if(!n)return new Date(NaN);var r=!!n[4],o=bu(n[1]),i=bu(n[2])-1,a=bu(n[3]),l=bu(n[4]),u=bu(n[5])-1;if(r)return wse(t,l,u)?yse(t,l,u):new Date(NaN);var c=new Date(0);return!xse(t,i,a)||!bse(t,o)?new Date(NaN):(c.setUTCFullYear(t,i,Math.max(o,a)),c)}function bu(e){return e?parseInt(e):1}function gse(e){var t=e.match(cse);if(!t)return NaN;var n=dy(t[1]),r=dy(t[2]),o=dy(t[3]);return Sse(n,r,o)?n*$b+r*Nb+o*1e3:NaN}function dy(e){return e&&parseFloat(e.replace(",","."))||0}function mse(e){if(e==="Z")return 0;var t=e.match(dse);if(!t)return 0;var n=t[1]==="+"?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return kse(r,o)?n*(r*$b+o*Nb):NaN}function yse(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,i=(t-1)*7+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}var vse=[31,null,31,30,31,30,31,31,30,31,30,31];function KA(e){return e%400===0||e%4===0&&e%100!==0}function xse(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(vse[t]||(KA(e)?29:28))}function bse(e,t){return t>=1&&t<=(KA(e)?366:365)}function wse(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Sse(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function kse(e,t){return t>=0&&t<=59}function Wb(e,t){Ne(2,arguments);var n=Yt(t);return Lb(e,-n)}function Qe(e){if(typeof e=="string"){const[t,n,r]=e.split("-");return r!=null?new Date(parseInt(t),parseInt(n)-1,parseInt(r),12):n!=null?new Date(parseInt(t),parseInt(n)-1,1,12):new Date(parseInt(t),0,1,12)}return typeof e=="number"?new Date(e):e}const Tse=Qe;function Cse(e){return ke(Qe(e),"yyyy")}function QA(e){return ke(Qe(e),"yyyy-MM")}function ca(e){return ke(Qe(e),"yyyy-MM-dd")}function XA(){return pn.IS_TESTING||_l?pn.currentMonth||"2017-01":ke(new Date,"yyyy-MM")}function Hv(){return pn.IS_TESTING||_l?Sn(Qn(),"yyyy-MM-dd",new Date):new Date}function Qn(){return pn.IS_TESTING||_l?"2017-01-01":ke(new Date,"yyyy-MM-dd")}function Ese(e){return ke(Lb(Qe(e),1),"yyyy-MM")}function jse(e){return ke(Wb(Qe(e),12),"yyyy-MM")}function ZA(e){return ke(Wb(Qe(e),1),"yyyy-MM")}function Lg(e,t){return ke(Lb(Qe(e),t),"yyyy-MM")}function Ise(e,t){return ke(iie(Qe(e),t),"yyyy-MM-dd")}function Dse(e,t){return lie(Qe(e),Qe(t))}function _se(e,t){return oie(Qe(e),Qe(t))}function JA(e,t){return ke(Wb(Qe(e),t),"yyyy-MM")}function Vb(e,t){return ke(zc(Qe(e),t),"yyyy-MM-dd")}function eP(e,t){return ke(Fv(Qe(e),t),"yyyy-MM-dd")}function Ose(e,t){return Hb(Qe(e),Qe(t))}function tP(e,t){return hae(Qe(e),Qe(t))}function Ase(e){return{start:parseInt(ke(cie(Qe(e)),"yyyyMMdd")),end:parseInt(ke(uie(Qe(e)),"yyyyMMdd"))}}function Yb(e,t,n=!1){const r=[];let o=QA(e);for(;Hb(Qe(o),Qe(t));)r.push(o),o=Lg(o,1);return n&&r.push(o),r}function Pse(e,t){return Yb(e,t)}function qb(e,t){return Yb(e,t,!0)}function Gb(e,t,n=!1){const r=[];let o=e;for(;Hb(Qe(o),Qe(t));)r.push(ca(o)),o=Vb(o,1);return n&&r.push(ca(o)),r}function Mse(e,t){return Gb(e,t)}function Rse(e,t){return Gb(e,t,!0)}function Bse(e,t){const n=`${t+1}`.padStart(2,"0");return`${e}-${n}`}function Lse(e){return parseInt(e.slice(5,7))-1}function Kb(e){return e.slice(0,4)}function Nse(e){return e.slice(0,7)}function $se(e){return Kb(e)+"-01"}function Fse(e){return Kb(e)+"-12"}function Qb(e){return"budget"+e.replace("-","")}function Hse(e){return ke(Qe(e),"MMMM 'yy")}function An(e,t){return ke(Qe(e),t)}const zse=Mn(e=>new RegExp(e.replace(/d+/g,"\\d{1,2}").replace(/M+/g,"\\d{1,2}").replace(/y+/g,"\\d{4}"))),Ng=Mn(e=>e.replace(/y+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"")),$g=Mn(e=>{const 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+"$")}),Xb=Mn(e=>e.replace(/d+/g,"").replace(/[^\w]$/,"").replace(/^[^\w]/,"").replace(/\/\//,"/").replace(/\.\./,".").replace(/--/,"-")),Use=Mn(e=>{const 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+"$")}),Zb=Mn(e=>e.replace(/y+/g,"yy")),Jb=Mn(e=>{const 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+"$")}),Qbe=Object.freeze(Object.defineProperty({__proto__:null,_dayRange:Gb,_parse:Qe,_range:Yb,addDays:Vb,addMonths:Lg,addWeeks:Ise,bounds:Ase,currentDate:Hv,currentDay:Qn,currentMonth:XA,dayFromDate:ca,dayRange:Mse,dayRangeInclusive:Rse,differenceInCalendarDays:_se,differenceInCalendarMonths:Dse,format:An,getDateFormatRegex:zse,getDayMonthFormat:Ng,getDayMonthRegex:$g,getMonth:Nse,getMonthFromIndex:Bse,getMonthIndex:Lse,getMonthYearFormat:Xb,getMonthYearRegex:Use,getShortYearFormat:Zb,getShortYearRegex:Jb,getYear:Kb,getYearEnd:Fse,getYearStart:$se,isAfter:tP,isBefore:Ose,monthFromDate:QA,nameForMonth:Hse,nextMonth:Ese,parseDate:Tse,prevMonth:ZA,prevYear:jse,range:Pse,rangeInclusive:qb,sheetForMonth:Qb,subDays:eP,subMonths:JA,yearFromDate:Cse},Symbol.toStringTag,{value:"Module"}));function Wse(e,t,n){const r=Qn();return t?"completed":n?"paid":e===r?"due":e>r&&e<=Vb(r,7)?"upcoming":e<r?"missed":"scheduled"}function Vse(e){const t=e.map(n=>{const r=n._conditions.find(o=>o.field==="date");return{$and:{schedule:n.id,date:{$gte:r&&r.op==="is"?n.next_date:eP(n.next_date,2)}}}});return pt("transactions").options({splits:"grouped"}).filter({$or:t}).orderBy({date:"desc"}).select(["schedule","date"])}function MT(e){return An(new Date(2020,0,e,12),"do")}function RT(e){return{SU:"Sunday",MO:"Monday",TU:"Tuesday",WE:"Wednesday",TH:"Thursday",FR:"Friday",SA:"Saturday"}[e]}function ew(e,t){const n=e.interval||1;let r="";switch(e.endMode){case"after_n_occurrences":e.endOccurrences===1?r=", once":r=`, ${e.endOccurrences} times`;break;case"on_date":r=`, until ${An(e.endDate,t)}`;break}const o=e.skipWeekend?` (${e.weekendSolveMode} weekend) `:"",i=r+o;switch(e.frequency){case"daily":{let a="Every ";return a+=n!==1?`${n} days`:"day",a+i}case"weekly":{let a="Every ";return a+=n!==1?`${n} weeks`:"week",a+=" on "+An(e.start,"EEEE"),a+i}case"monthly":{let a="Every ";if(a+=n!==1?`${n} months`:"month",e.patterns&&e.patterns.length>0){let l=[...e.patterns].sort((d,h)=>{const p=(d.type==="day"?1:0)-(h.type==="day"?1:0),m=d.value-h.value;return p===0?m:p}).filter(d=>d.value!==-1);l=l.concat(e.patterns.filter(d=>d.value===-1)),a+=" on the ";const u=[],c=new Set(l.map(d=>d.type)),f=c.size===1&&!c.has("day");for(const d of l)if(d.type==="day")d.value===-1?u.push("last day"):u.push(MT(d.value));else{const h=f?"":" "+RT(d.type);d.value===-1?u.push("last"+h):u.push(MT(d.value)+h)}u.length>2?(a+=u.slice(0,u.length-1).join(", "),a+=", and ",a+=u[u.length-1]):a+=u.join(" and "),f&&(a+=" "+RT(l[0].type))}else a+=" on the "+An(e.start,"do");return a+i}case"yearly":{let a="Every ";return a+=n!==1?`${n} years`:"year",a+=" on "+An(e.start,"LLL do"),a+i}default:return"Recurring error"}}function nP(e){return{payee:e.find(t=>t.op==="is"&&t.field==="payee")||e.find(t=>t.op==="is"&&t.field==="description")||null,account:e.find(t=>t.op==="is"&&t.field==="account")||e.find(t=>t.op==="is"&&t.field==="acct")||null,amount:e.find(t=>(t.op==="is"||t.op==="isapprox"||t.op==="isbetween")&&t.field==="amount")||null,date:e.find(t=>(t.op==="is"||t.op==="isapprox")&&t.field==="date")||null}}function rP(e){return e&&typeof e!="number"?Math.round((e.num1+e.num2)/2):e}function oP(e,t){return t?`${t.name} (${e.next_date})`:`Next: ${e.next_date}`}function Fr(){const e=Ft(),t=Te(n=>n.queries.categoriesLoaded);return g.useEffect(()=>{t||e(Ho())},[]),Te(n=>n.queries.categories)}function Hr(){const e=Ft(),t=Te(n=>n.queries.payeesLoaded);return g.useEffect(()=>{t||e(zo())},[]),Te(n=>n.queries.payees)}function BT(e,t){const n=Math.min(e.start,e.end),r=Math.max(e.start,e.end);for(let o=n;o<=r;o++)t(o)}function Gl(e,t,n,r){const[o,i]=g.useReducer((u,c)=>{switch(c.type){case"select":{const{selectedRange:d}=u,h=new Set(u.selectedItems),{id:p,event:m}=c;if(m.shiftKey&&d){const x=t.findIndex(w=>w.id===p),k=t.findIndex(w=>w.id===d.start),v=t.findIndex(w=>w.id===d.end);let y,b;return v===-1?y={start:k,end:x}:v<k?x<=k?(y={start:k,end:x},x>v&&(b={start:x-1,end:v})):y={start:v,end:x}:x>=k?(y={start:k,end:x},x<v&&(b={start:x+1,end:v})):y={start:v,end:x},BT(y,w=>h.add(t[w].id)),b&&BT(b,w=>h.delete(t[w].id)),{...u,selectedItems:h,selectedRange:{start:t[y.start].id,end:t[y.end].id}}}else{let x=null;return h.delete(p)||(h.add(p),x={start:p,end:null}),{...u,selectedItems:h,selectedRange:x}}}case"select-none":return{...u,selectedItems:new Set};case"select-all":let f=[];if(c.ids&&t&&r){const d=new Set(t.filter(r).map(h=>h.id));f=c.ids.filter(h=>d.has(h))}else t&&r?f=t.filter(r).map(d=>d.id):f=c.ids||t.map(d=>d.id);return{...u,selectedItems:new Set(f),selectedRange:c.ids&&c.ids.length===1?{start:c.ids[0],end:null}:null};default:throw new Error("Unexpected action: "+JSON.stringify(c))}},null,()=>({selectedItems:new Set(n||[]),selectedRange:n&&n.length===1?{start:n[0],end:null}:null})),a=g.useRef(t);g.useEffect(()=>{if(o.selectedItems.size>0){const u=new Set(t.map(f=>f.id));if(!(a.current.length===t.length&&a.current.every(f=>u.has(f.id)))){const f=[...o.selectedItems],d=f.filter(h=>u.has(h));f.length!==d.length&&i({type:"select-all",ids:d})}}a.current=t},[t,o.selectedItems]),g.useEffect(()=>{const u=jL("selectedItems");return Tc("selectedItems",{name:e,items:o.selectedItems}),()=>Tc("selectedItems",u)},[o.selectedItems]);const l=Te(u=>u.app.lastUndoState);return g.useEffect(()=>{function u({messages:c,undoTag:f}){const d=jI(f),h=new Set(c.filter(p=>p.column==="tombstone"&&p.value===1).map(p=>p.row));d?.selectedItems?.name===e&&i({type:"select-all",ids:[...d.selectedItems.items].filter(p=>!h.has(p))})}return l&&l.current&&u(l.current),Rt("undo-event",u)},[]),{items:o.selectedItems,dispatch:i}}const iP=g.createContext(null),aP=g.createContext(null);function bs(){return g.useContext(iP)}function Kl(){return g.useContext(aP)}function Ql({instance:e,fetchAllIds:t,children:n}){const r=g.useRef(null);g.useEffect(()=>{r.current=e.items},[e.items]);const o=g.useCallback(async i=>{if(!i.event&&bd())throw new Error("SelectedDispatch actions must have an event");return i.type==="select-all"?r.current&&r.current.size>0?e.dispatch({type:"select-none",event:i.event}):t?e.dispatch({type:"select-all",ids:await t(),event:i.event}):e.dispatch({type:"select-all",event:i.event}):e.dispatch(i)},[e.dispatch,t]);return s.jsx(aP.Provider,{value:e.items,children:s.jsx(iP.Provider,{value:o,children:n})})}function Xbe({name:e,items:t,initialSelectedIds:n,fetchAllIds:r,registerDispatch:o,selectAllFilter:i,children:a}){const l=Gl(e,t,n,i);return g.useEffect(()=>{o?.(l.dispatch)},[o]),s.jsx(Ql,{instance:l,fetchAllIds:r,children:a})}const Yse=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.jsx("path",{d:"M4 16h16V5H4v11Zm9 2v2h4v2H7v-2h4v-2H2.992A.998.998 0 0 1 2 16.992V4.008C2 3.451 2.455 3 2.992 3h18.016c.548 0 .992.449.992 1.007v12.985c0 .557-.455 1.008-.992 1.008H13Z",fill:"currentColor"})}),zv=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.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"})}),qse=e=>s.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:[s.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"}),s.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"})]}),Gse=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.jsx("g",{fill:"#000",children:s.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"})})}),fl=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.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"})}),Kse=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.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"})}),Qse=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.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"})}),sP=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.jsx("path",{fill:"currentColor",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"})}),Xse=e=>s.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:[s.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"}),s.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"})]}),Zse=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.jsx("path",{fill:"currentColor",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"})}),Jse=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.jsx("path",{fill:"currentColor",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"})}),ele=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.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"})}),tle=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.jsx("path",{d:"M4 8V6a6 6 0 1 1 12 0v2h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-8c0-1.1.9-2 2-2h1zm5 6.73V17h2v-2.27a2 2 0 1 0-2 0zM7 6v2h6V6a3 3 0 0 0-6 0z",fill:"currentColor"})}),LT=e=>s.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:"bi bi-moon-stars",viewBox:"0 0 16 16",style:{color:"inherit",...e.style},children:[s.jsx("path",{d:"M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z",fill:"currentColor"}),s.jsx("path",{d:"M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z",fill:"currentColor"})]}),nle=e=>s.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:[s.jsx("rect",{width:23,height:3,x:.5,y:2.5,rx:1,ry:1,fill:"currentColor"}),s.jsx("rect",{width:23,height:3,x:.5,y:10.5,rx:1,ry:1,fill:"currentColor"}),s.jsx("rect",{width:23,height:3,x:.5,y:18.5,rx:1,ry:1,fill:"currentColor"})]}),lP=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.jsx("path",{d:"M22 0H2a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h14a1 1 0 0 0 .707-.293l7-7A1 1 0 0 0 24 16V2a2 2 0 0 0-2-2ZM2 2.5a.5.5 0 0 1 .5-.5h19a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5h-4a2 2 0 0 0-2 2v4a.5.5 0 0 1-.5.5H2.5a.5.5 0 0 1-.5-.5Z",fill:"currentColor"})}),rle=e=>s.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:[s.jsx("path",{d:"M20 11.491a1 1 0 0 0-1 1v8.5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-17a1 1 0 0 1 1-1h10a1 1 0 0 0 0-2H3a3 3 0 0 0-3 3v17a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3v-8.5a1 1 0 0 0-1-1Z",fill:"currentColor"}),s.jsx("path",{d:"M18.818 3.051a.516.516 0 0 0-.707 0L10.3 10.865a.5.5 0 0 0-.111.168l-1.416 3.535a.5.5 0 0 0 .111.539.519.519 0 0 0 .539.11l3.535-1.417a.5.5 0 0 0 .168-.111L20.94 5.88a.5.5 0 0 0 0-.707ZM23.415.577a2.047 2.047 0 0 0-2.828 0l-1.061 1.06a.5.5 0 0 0 0 .707l2.12 2.121a.5.5 0 0 0 .707 0l1.061-1.06a2 2 0 0 0 0-2.828Z",fill:"currentColor"})]}),ole=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.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"})}),uP=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.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"})}),ile=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.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"})}),NT=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:"bi bi-sun",viewBox:"0 0 16 16",style:{color:"inherit",...e.style},children:s.jsx("path",{d:"M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z",fill:"currentColor"})}),ale=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{color:"inherit",...e.style},children:s.jsx("path",{fill:"currentColor",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"})}),tw=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.jsx("path",{d:"m12.81 4.36-1.77 1.78a4 4 0 0 0-4.9 4.9l-2.76 2.75C2.06 12.79.96 11.49.2 10a11 11 0 0 1 12.6-5.64zm3.8 1.85c1.33 1 2.43 2.3 3.2 3.79a11 11 0 0 1-12.62 5.64l1.77-1.78a4 4 0 0 0 4.9-4.9l2.76-2.75zm-.25-3.99 1.42 1.42L3.64 17.78l-1.42-1.42L16.36 2.22z",fill:"currentColor"})}),nw=e=>s.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",style:{color:"inherit",...e.style},children:s.jsx("path",{d:"M.2 10a11 11 0 0 1 19.6 0A11 11 0 0 1 .2 10zm9.8 4a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0-2a2 2 0 1 1 0-4 2 2 0 0 1 0 4z",fill:"currentColor"})});function cP({leftContent:e,rightContent:t,inputStyle:n,focusStyle:r,style:o,getStyle:i,...a}){const[l,u]=g.useState(a.focused??!1);return s.jsxs(I,{style:{...fO,padding:0,flexDirection:"row",alignItems:"center",...o,...l&&(r??{boxShadow:"0 0 0 1px "+S.formInputShadowSelected}),...i?.(l)},children:[e,s.jsx(Ke,{...a,focused:l,style:{...n,flex:1,"&, &:focus, &:hover":{border:0,backgroundColor:"transparent",boxShadow:"none",color:"inherit"}},onFocus:c=>{u(!0),a.onFocus?.(c)},onBlur:c=>{u(!1),a.onBlur?.(c)}}),t]})}function rw({inputRef:e,value:t,onChange:n,placeholder:r,isInModal:o=!1,width:i=250}){return s.jsx(cP,{inputRef:e,style:{width:i,flex:"",borderColor:o?void 0:"transparent",backgroundColor:o?void 0:S.formInputBackground},focusStyle:o?void 0:{boxShadow:"0 0 0 1px "+S.formInputShadowSelected,backgroundColor:S.formInputBackgroundSelected},leftContent:s.jsx(ile,{style:{width:13,height:13,flexShrink:0,color:t?S.menuItemTextSelected:"inherit",margin:5,marginRight:0}}),rightContent:t&&s.jsx(q,{type:"bare",style:{padding:8},onClick:()=>n(""),title:"Clear search term",children:s.jsx(uP,{style:{width:8,height:8}})}),inputStyle:{"::placeholder":{color:S.formInputTextPlaceholder,transition:"color .25s"},":focus":o?null:{"::placeholder":{color:S.formInputTextPlaceholderSelected}}},value:t,placeholder:r,onKeyDown:a=>{a.key==="Escape"&&n("")},onChangeValue:a=>n(a)})}let Rr;typeof window<"u"?Rr=window:typeof self<"u"?Rr=self:Rr=pn;let Uv=null,Wv=null;const $T=20,fy=Rr.clearTimeout,FT=Rr.setTimeout,hy=Rr.cancelAnimationFrame||Rr.mozCancelAnimationFrame||Rr.webkitCancelAnimationFrame,HT=Rr.requestAnimationFrame||Rr.mozRequestAnimationFrame||Rr.webkitRequestAnimationFrame;hy==null||HT==null?(Uv=fy,Wv=function(t){return FT(t,$T)}):(Uv=function([t,n]){hy(t),fy(n)},Wv=function(t){const n=HT(function(){fy(r),t()}),r=FT(function(){hy(n),t()},$T);return[n,r]});function sle(e){let t,n,r,o,i,a,l;const u=typeof document<"u"&&document.attachEvent;if(!u){a=function(v){const y=v.__resizeTriggers__,b=y.firstElementChild,w=y.lastElementChild,E=b.firstElementChild;w.scrollLeft=w.scrollWidth,w.scrollTop=w.scrollHeight,E.style.width=b.offsetWidth+1+"px",E.style.height=b.offsetHeight+1+"px",b.scrollLeft=b.scrollWidth,b.scrollTop=b.scrollHeight},i=function(v){return v.offsetWidth!==v.__resizeLast__.width||v.offsetHeight!==v.__resizeLast__.height},l=function(v){if(v.target.className&&typeof v.target.className.indexOf=="function"&&v.target.className.indexOf("contract-trigger")<0&&v.target.className.indexOf("expand-trigger")<0)return;const y=this;a(this),this.__resizeRAF__&&Uv(this.__resizeRAF__),this.__resizeRAF__=Wv(function(){i(y)&&(y.__resizeLast__.width=y.offsetWidth,y.__resizeLast__.height=y.offsetHeight,y.__resizeListeners__.forEach(function(E){E.call(y,v)}))})};let h=!1,p="";r="animationstart";const m="Webkit Moz O ms".split(" ");let x="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),k="";{const v=document.createElement("fakeelement");if(v.style.animationName!==void 0&&(h=!0),h===!1){for(let y=0;y<m.length;y++)if(v.style[m[y]+"AnimationName"]!==void 0){k=m[y],p="-"+k.toLowerCase()+"-",r=x[y],h=!0;break}}}n="resizeanim",t="@"+p+"keyframes "+n+" { from { opacity: 0; } to { opacity: 0; } } ",o=p+"animation: 1ms "+n+"; "}const c=function(h){if(!h.getElementById("detectElementResize")){const p=(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%; }',m=h.head||h.getElementsByTagName("head")[0],x=h.createElement("style");x.id="detectElementResize",x.type="text/css",e!=null&&x.setAttribute("nonce",e),x.styleSheet?x.styleSheet.cssText=p:x.appendChild(h.createTextNode(p)),m.appendChild(x)}};return{addResizeListener:function(h,p){if(u)h.attachEvent("onresize",p);else{if(!h.__resizeTriggers__){const m=h.ownerDocument,x=Rr.getComputedStyle(h);x&&x.position==="static"&&(h.style.position="relative"),c(m),h.__resizeLast__={},h.__resizeListeners__=[],(h.__resizeTriggers__=m.createElement("div")).className="resize-triggers";const k=m.createElement("div");k.className="expand-trigger",k.appendChild(m.createElement("div"));const v=m.createElement("div");v.className="contract-trigger",h.__resizeTriggers__.appendChild(k),h.__resizeTriggers__.appendChild(v),h.appendChild(h.__resizeTriggers__),a(h),h.addEventListener("scroll",l,!0),r&&(h.__resizeTriggers__.__animationListener__=function(b){b.animationName===n&&a(h)},h.__resizeTriggers__.addEventListener(r,h.__resizeTriggers__.__animationListener__))}h.__resizeListeners__.push(p)}},removeResizeListener:function(h,p){if(u)h.detachEvent("onresize",p);else if(h.__resizeListeners__.splice(h.__resizeListeners__.indexOf(p),1),!h.__resizeListeners__.length){h.removeEventListener("scroll",l,!0),h.__resizeTriggers__.__animationListener__&&(h.__resizeTriggers__.removeEventListener(r,h.__resizeTriggers__.__animationListener__),h.__resizeTriggers__.__animationListener__=null);try{h.__resizeTriggers__=!h.removeChild(h.__resizeTriggers__)}catch{}}}}}class lle extends g.Component{constructor(...t){super(...t),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:n,disableWidth:r,onResize:o}=this.props;if(this._parentNode){var i,a,l,u;const c=window.getComputedStyle(this._parentNode)||{},f=parseFloat((i=c.paddingLeft)!==null&&i!==void 0?i:"0"),d=parseFloat((a=c.paddingRight)!==null&&a!==void 0?a:"0"),h=parseFloat((l=c.paddingTop)!==null&&l!==void 0?l:"0"),p=parseFloat((u=c.paddingBottom)!==null&&u!==void 0?u:"0"),m=this._parentNode.getBoundingClientRect(),x=m.height-h-p,k=m.width-f-d,v=this._parentNode.offsetHeight-h-p,y=this._parentNode.offsetWidth-f-d;(!n&&(this.state.height!==v||this.state.scaledHeight!==x)||!r&&(this.state.width!==y||this.state.scaledWidth!==k))&&(this.setState({height:v,width:y,scaledHeight:x,scaledWidth:k}),typeof o=="function"&&o({height:v,scaledHeight:x,scaledWidth:k,width:y}))}},this._setRef=n=>{this._autoSizer=n}}componentDidMount(){const{nonce:t}=this.props;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._parentNode!=null&&(typeof ResizeObserver<"u"?(this._resizeObserver=new ResizeObserver(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(this._parentNode)):(this._detectElementResize=sle(t),this._detectElementResize.addResizeListener(this._parentNode,this._onResize)),this._onResize()))}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),this._timeoutId!==null&&clearTimeout(this._timeoutId),this._resizeObserver&&(this._resizeObserver.observe(this._parentNode),this._resizeObserver.disconnect()))}render(){const{children:t,defaultHeight:n,defaultWidth:r,disableHeight:o=!1,disableWidth:i=!1,nonce:a,onResize:l,style:u={},tagName:c="div",...f}=this.props,{height:d,scaledHeight:h,scaledWidth:p,width:m}=this.state,x={overflow:"visible"},k={};let v=!1;return o||(d===0&&(v=!0),x.height=0,k.height=d,k.scaledHeight=h),i||(m===0&&(v=!0),x.width=0,k.width=m,k.scaledWidth=p),g.createElement(c,{ref:this._setRef,style:{...x,...u},...f},!v&&t(k))}}const ule=({id:e,checked:t,onToggle:n,onColor:r,style:o})=>s.jsxs("div",{style:{marginTop:-20,...o},children:[s.jsx("input",{id:e,checked:t,onChange:n,className:`${ze({height:0,width:0,visibility:"hidden"})}`,type:"checkbox"}),s.jsx("label",{style:{background:t?r:S.checkboxToggleBackground},className:`${ze({display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",width:"32px",height:"16px",borderRadius:"100px",position:"relative",transition:"background-color .2s"})}`,htmlFor:e,children:s.jsx("span",{className:`${ze({content:"",position:"absolute",top:"2px",left:"2px",width:"12px",height:"12px",borderRadius:"100px",transition:"0.2s",background:"#fff",boxShadow:"0 0 2px 0 rgba(10, 10, 10, 0.29)"},t&&{left:"calc(100% - 2px)",transform:"translateX(-100%)"})}`})})]}),cle=Symbol("menu-line");wt.line=cle;wt.label=Symbol("menu-label");function dle({keyName:e}){return s.jsx(z,{style:{fontSize:10,color:S.menuKeybindingText},children:e})}function wt({header:e,footer:t,items:n,onMenuSelect:r,style:o}){const i=g.useRef(null),a=n.filter(c=>c),[l,u]=g.useState(null);return g.useEffect(()=>{const c=i.current;c?.focus();const f=d=>{const h=a.filter(x=>x&&x!==wt.line&&x.type!==wt.label),p=h.indexOf(a[l||0]),m=x=>a.indexOf(h[x]);switch(d.key){case"ArrowUp":d.preventDefault(),u(l===null?0:m(Math.max(p-1,0)));break;case"ArrowDown":d.preventDefault(),u(l===null?0:m(Math.min(p+1,h.length-1)));break;case"Enter":d.preventDefault();const x=a[l||0];l!==null&&x!==wt.line&&r?.(x.name);break}};return c?.addEventListener("keydown",f),()=>{c?.removeEventListener("keydown",f)}},[l]),s.jsxs(I,{style:{outline:"none",borderRadius:4,overflow:"hidden",...o},tabIndex:1,innerRef:i,children:[e,a.map((c,f)=>{if(c===wt.line)return s.jsx(I,{style:{margin:"3px 0px"},children:s.jsx(I,{style:{borderTop:"1px solid "+S.menuBorder}})},f);if(c.type===wt.label)return s.jsx(z,{style:{color:S.menuItemTextHeader,fontSize:11,lineHeight:"1em",textTransform:"uppercase",margin:"3px 9px",marginTop:5},children:c.name},c.name);const d=a[f-1];return s.jsxs(I,{role:"button",style:{cursor:"default",padding:"9px 10px",marginTop:f===0||d===wt.line||d.type===wt.label?0:-3,flexDirection:"row",alignItems:"center",color:S.menuItemText,...c.disabled&&{color:S.buttonBareDisabledText},...!c.disabled&&l===f&&{backgroundColor:S.menuItemBackgroundHover,color:S.menuItemTextHover},...c.style},onMouseEnter:()=>u(f),onMouseLeave:()=>u(null),onClick:()=>!c.disabled&&r&&c.toggle===void 0&&r(c.name),children:[c.toggle===void 0?s.jsxs(s.Fragment,{children:[s.jsx(z,{style:{lineHeight:0},children:c.icon&&g.createElement(c.icon,{width:c.iconSize||10,height:c.iconSize||10,style:{marginRight:7,width:c.iconSize||10}})}),s.jsx(z,{title:c.tooltip,children:c.text}),s.jsx(I,{style:{flex:1}})]}):s.jsxs(s.Fragment,{children:[s.jsx("label",{htmlFor:c.name,title:c.tooltip,children:c.text}),s.jsx(I,{style:{flex:1}}),s.jsx(ule,{id:c.name,checked:c.toggle,onColor:S.pageTextPositive,style:{marginLeft:5,...c.style},onToggle:()=>!c.disabled&&r&&c.toggle!==void 0&&r(c.name)})]}),c.key&&s.jsx(dle,{keyName:c.key})]},c.name)}),t]})}const fle=150,zT=e=>e;class hle extends g.PureComponent{_outerRef;_resetIsScrollingTimeoutId=null;lastPositions;needsAnimationRerender;animationEnabled;requestScrollUpdateHandled;anchored=null;rerenderTimeout;static defaultProps={direction:"ltr",renderRow:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1,headerHeight:0};constructor(t){super(t),this.lastPositions=g.createRef(),this.lastPositions.current=new Map,this.needsAnimationRerender=g.createRef(),this.needsAnimationRerender.current=!1,this.animationEnabled=!1,this.state={isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof this.props.initialScrollOffset=="number"?this.props.initialScrollOffset:0,scrollUpdateWasRequested:!1}}scrollTo(t){t=Math.max(0,t),this.setState(n=>n.scrollOffset===t?null:(this.requestScrollUpdateHandled=!1,{scrollDirection:n.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!0}),this._resetIsScrollingDebounced)}scrollToItem(t,n="auto"){const{itemCount:r}=this.props,{scrollOffset:o}=this.state;t=Math.max(0,Math.min(t,r-1)),this.scrollTo(this.getOffsetForIndexAndAlignment(t,n,o))}componentDidMount(){const{initialScrollOffset:t}=this.props;if(typeof t=="number"&&this._outerRef!=null){let n=this._outerRef;n=this._outerRef,n.scrollTop=t}this._callPropsCallbacks()}getAnchoredScrollPos(){if(this.anchored&&this.props.indexForKey&&this._outerRef!=null){const t=this.props.indexForKey(this.anchored.key);return this.getOffsetForIndexAndAlignment(t,"start")+this.anchored.offset}return null}componentDidUpdate(){const{scrollOffset:t,scrollUpdateWasRequested:n}=this.state,r=this.getAnchoredScrollPos();if(r!=null){const o=this._outerRef;o.scrollTop=r}else if(n&&!this.requestScrollUpdateHandled&&this._outerRef!=null){this.requestScrollUpdateHandled=!0;const o=this._outerRef;o.scrollTop=t}this.needsAnimationRerender.current&&(this.needsAnimationRerender.current=!1,this.rerenderTimeout=setTimeout(()=>{this.forceUpdate()},10)),this._callPropsCallbacks()}componentWillUnmount(){this._resetIsScrollingTimeoutId!==null&&clearTimeout(this._resetIsScrollingTimeoutId)}render(){const{className:t,height:n,header:r,innerRef:o,itemCount:i,renderRow:a,itemKey:l=zT,useIsScrolling:u,width:c}=this.props,{isScrolling:f}=this.state,[d,h]=this._getRangeToRender(),p=new Map,m=[];if(i>0)for(let k=d;k<=h;k++){const v=l(k);let y=this._getItemStyle(k);const b=this.lastPositions.current.get(v);let w=!1;p.set(v,y.top),this.animationEnabled&&b!=null&&b!==y.top&&(y={...y,top:b},this.needsAnimationRerender.current=!0,w=!0),m.push(a({index:k,key:v,style:y,isScrolling:u?f:void 0,isAnimating:w}))}this.lastPositions.current=p;const x=this.getEstimatedTotalSize();return s.jsxs("div",{className:t,onScroll:this._onScrollVertical,ref:this._outerRefSetter,style:{height:n,width:c,overflow:"hidden auto"},children:[s.jsx(I,{children:r}),s.jsx("div",{ref:o,style:{position:"relative",height:x,width:"100%",pointerEvents:f?"none":void 0},children:m})]})}setRowAnimation=t=>{this.animationEnabled=t;const n=this._outerRef;n&&(this.animationEnabled?n.classList.add("animated"):n.classList.remove("animated"))};anchor(){const t=this.props.itemKey||zT,n=this._outerRef,r=n?n.scrollTop:0,o=this.getStartIndexForOffset(r),i=t(o);this.anchored={key:i,offset:r-this.getItemOffset(o)}}unanchor(){this.anchored=null}isAnchored(){return this.anchored!=null}getItemOffset=t=>t*this.props.itemSize;getItemSize=()=>this.props.itemSize;getEstimatedTotalSize=()=>this.props.itemSize*this.props.itemCount;getOffsetForIndexAndAlignment=(t,n,r)=>{const o=this.props.height,i=Math.max(0,this.props.itemCount*this.props.itemSize-o),a=Math.min(i,t*this.props.itemSize),l=Math.max(0,t*this.props.itemSize-o+this.props.itemSize);switch(n==="smart"&&(r>=l-o&&r<=a+o?n="auto":n="center"),n){case"start":return a;case"end":return l;case"center":{const u=Math.round(l+(a-l)/2);return u<Math.ceil(o/2)?0:u>i+Math.floor(o/2)?i:u}case"auto":default:return r>=l&&r<=a?r:r<l?l:a}};getStartIndexForOffset=t=>Math.max(0,Math.min(this.props.itemCount-1,Math.floor(t/this.props.itemSize)));getStopIndexForStartIndex=(t,n)=>{const r=t*this.props.itemSize,o=this.props.height,i=Math.ceil((o+n-r)/this.props.itemSize);return Math.max(0,Math.min(this.props.itemCount-1,t+i-1))};_callOnItemsRendered=Mn((t,n,r,o)=>this.props.onItemsRendered({overscanStartIndex:t,overscanStopIndex:n,visibleStartIndex:r,visibleStopIndex:o}));_callOnScroll=Mn((t,n,r)=>this.props.onScroll({scrollDirection:t,scrollOffset:n,scrollUpdateWasRequested:r}));_callPropsCallbacks(){if(typeof this.props.onItemsRendered=="function"){const{itemCount:t}=this.props;if(t>0){const[n,r,o,i]=this._getRangeToRender();this._callOnItemsRendered(n,r,o,i)}}if(typeof this.props.onScroll=="function"){const{scrollDirection:t,scrollOffset:n,scrollUpdateWasRequested:r}=this.state;this._callOnScroll(t,n,r)}}_getItemStyle=t=>{const{direction:n,itemSize:r,layout:o}=this.props,i=this._getItemStyleCache(r,o,n);let a;if(i.hasOwnProperty(t))a=i[t];else{const l=this.getItemOffset(t),u=this.getItemSize();i[t]=a={position:"absolute",left:0,top:l,height:u,width:"100%"}}return a};_getItemStyleCache=Mn((t,n,r)=>({}));_getRangeToRender(){const{itemCount:t,overscanCount:n}=this.props,{isScrolling:r,scrollDirection:o,scrollOffset:i}=this.state,a=this.getAnchoredScrollPos();let l=i;if(a!=null&&(l=a),t===0)return[0,0,0,0];const u=this.getStartIndexForOffset(l),c=this.getStopIndexForStartIndex(u,l),f=!r||o==="backward"?Math.max(1,n):1,d=!r||o==="forward"?Math.max(1,n):1;return[Math.max(0,u-f),Math.max(0,Math.min(t-1,c+d)),u,c]}_onScrollVertical=t=>{const{scrollTop:n}=t.currentTarget;this.setState(r=>{if(r.scrollOffset===n)return null;const o=n;return{isScrolling:!0,scrollDirection:r.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!1}},this._resetIsScrollingDebounced)};_outerRefSetter=t=>{const{outerRef:n}=this.props;this._outerRef=t,n!=null&&typeof n=="object"&&n.hasOwnProperty("current")&&(n.current=t)};_resetIsScrollingDebounced=()=>{this._resetIsScrollingTimeoutId!==null&&clearTimeout(this._resetIsScrollingTimeoutId),this._resetIsScrollingTimeoutId=setTimeout(this._resetIsScrolling,fle)};_resetIsScrolling=()=>{this._resetIsScrollingTimeoutId=null,this.setState({isScrolling:!1},()=>{this._getItemStyleCache(-1,null)})}}function ple(){return Te(e=>e.prefs.local?.isPrivacyEnabled??!1)}function dP({children:e,privacyFilter:t,defaultPrivacyFilterProps:n}){return t?typeof t=="boolean"?s.jsx(Uc,{...n,children:e}):((o,i)=>s.jsx(Uc,{...i,children:o}))(e,fP(n,t)):s.jsx(s.Fragment,{children:g.Children.toArray(e)})}function Uc({activationFilters:e,blurIntensity:t,children:n,...r}){const o=ple(),{isNarrowWidth:i}=zt(),a=o&&!i&&(!e||e.every(u=>typeof u=="boolean"?u:u())),l=t!=null?`${t}px`:"3px";return a?s.jsx(gle,{blurIntensity:l,...r,children:n}):s.jsx(s.Fragment,{children:g.Children.toArray(n)})}function gle({blurIntensity:e,children:t,...n}){const[r,o]=g.useState(!1),i=g.useCallback(()=>o(!0),[o]),a=g.useCallback(()=>o(!1),[o]),l={...!r&&{filter:`blur(${e})`,WebkitFilter:`blur(${e})`,transform:"translate3d(0, 0, 0)"}},{style:u,...c}=n;return s.jsx(I,{style:{display:u?.display?u.display:"inline-flex",...l,...u},onPointerEnter:i,onPointerLeave:a,...c,children:t})}function fP(e={},t){return t==null||t===!1?t:t===!0?e:hP(e,t)}function hP(e,...t){return t.reduce((n,r)=>(Object.keys(r).forEach(o=>{const i=n[o],a=r[o];Array.isArray(i)&&Array.isArray(a)?n[o]=i.concat(...a):UT(i)&&UT(a)?n[o]=hP(i,a):n[o]=a}),n),e)}function UT(e){return e&&typeof e=="object"}var gp="NOT_FOUND";function mle(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:gp},put:function(r,o){t={key:r,value:o}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function yle(e,t){var n=[];function r(l){var u=n.findIndex(function(f){return t(l,f.key)});if(u>-1){var c=n[u];return u>0&&(n.splice(u,1),n.unshift(c)),c.value}return gp}function o(l,u){r(l)===gp&&(n.unshift({key:l,value:u}),n.length>e&&n.pop())}function i(){return n}function a(){n=[]}return{get:r,put:o,getEntries:i,clear:a}}var vle=function(t,n){return t===n};function xle(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,i=0;i<o;i++)if(!e(n[i],r[i]))return!1;return!0}}function ble(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,o=r===void 0?vle:r,i=n.maxSize,a=i===void 0?1:i,l=n.resultEqualityCheck,u=xle(o),c=a===1?mle(u):yle(a,u);function f(){var d=c.get(arguments);if(d===gp){if(d=e.apply(null,arguments),l){var h=c.getEntries(),p=h.find(function(m){return l(m.value,d)});p&&(d=p.value)}c.put(arguments,d)}return d}return f.clearCache=function(){return c.clear()},f}function wle(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function Sle(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=function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];var c=0,f,d={memoizeOptions:void 0},h=l.pop();if(typeof h=="object"&&(d=h,h=l.pop()),typeof h!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof h+"]");var p=d,m=p.memoizeOptions,x=m===void 0?n:m,k=Array.isArray(x)?x:[x],v=wle(l),y=e.apply(void 0,[function(){return c++,h.apply(null,arguments)}].concat(k)),b=e(function(){for(var E=[],T=v.length,_=0;_<T;_++)E.push(v[_].apply(null,arguments));return f=y.apply(null,E),f});return Object.assign(b,{resultFunc:h,memoizedResultFunc:y,dependencies:v,lastResult:function(){return f},recomputations:function(){return c},resetRecomputations:function(){return c=0}}),b};return o}var ow=Sle(ble);const kle=e=>e,Tle=ow(kle,e=>e.prefs),Cle=ow(Tle,e=>e.local),Ele=ow(Cle,e=>pi({format:e.numberFormat,hideFraction:e.hideFraction}));function pP(e,t="string",n){switch(t){case"string":const r=JSON.stringify(e);return r.charAt(0)==='"'&&r.charAt(r.length-1)==='"'?r.slice(1,-1):r;case"number":return""+e;case"financial-with-sign":const o=pP(e,"financial",n);return typeof e=="number"&&e>=0?"+"+o:o;case"financial":if(e==null||e===""||e===0)return _n(0,n);if(typeof e=="string"){const i=parseFloat(e);e=isNaN(i)?0:i}if(typeof e!="number")throw new Error("Value is not a number ("+typeof e+"): "+e);return _n(e,n);default:throw new Error("Unknown format type: "+t)}}function Xl(){const e=Te(Ele);return g.useCallback((t,n="string")=>pP(t,n,e.formatter),[e])}const Ad=g.createContext(void 0);function jle(e){const t=e.indexOf("!");return t!==-1?{sheet:e.slice(0,t),name:e.slice(t+1)}:{sheet:null,name:e}}function iw(e){if(!e)throw new Error("Sheet binding is required");const t=typeof e=="string";let n=t?e:e.name;if(pn.IS_TESTING&&!t&&!n&&(n=e.value.toString()),n==null)throw new Error("Binding name is now required");let r=g.useContext(Ad)||"__global";const o=jle(n);return o.sheet&&(r=o.sheet,n=o.name),{sheetName:r,bindingName:n,fullSheetName:`${r}!${n}`}}function No(e,t){const{sheetName:n,fullSheetName:r}=iw(e),o=typeof e=="string"?{name:e,value:null}:e,i=bb(),[a,l]=g.useState({name:r,value:o.value===void 0?null:o.value,query:o.query}),u=g.useRef(t),c=g.useRef(a.value);return g.useLayoutEffect(()=>{u.current=t,c.current=a.value}),g.useLayoutEffect(()=>(o.query&&i.createQuery(n,o.name,o.query),i.bind(n,e,null,f=>{u.current&&u.current(f),f.value!==c.current&&l(f)})),[n,o.name]),a.value}const gP=g.createContext(null);function Ile(){const[e,t]=g.useState(!1);return{getOpenEvents:(n={})=>({onClick:r=>{r.stopPropagation(),n.onClick?.(r),t(!0)}}),isOpen:e,open:()=>t(!0),close:()=>t(!1)}}class Et extends g.Component{static contextType=gP;position;contentRef;cleanup;target;context=this.context;constructor(t){super(t),this.position=t.position||"bottom-right",this.contentRef=g.createRef()}isHTMLElement(t){return t instanceof HTMLElement}setup(){this.layout();const t=r=>{let o=r.target;for(;o&&o!==document.documentElement&&!(o.dataset.istooltip||o.dataset.reachPopover!=null);)o=o.parentNode;o===document.documentElement&&this.props.onClose?.()},n=r=>{r.key==="Escape"&&this.props.onClose?.()};window.document.addEventListener("pointerdown",t,!1),this.contentRef.current?.addEventListener("keydown",n,!1),this.cleanup=()=>{window.document.removeEventListener("pointerdown",t,!1),this.contentRef.current?.removeEventListener("keydown",n,!1)}}componentDidMount(){this.getContainer()?this.setup():this.forceUpdate(()=>{this.getContainer()?this.setup():console.log("Warning: could not mount tooltip, container missing")})}componentDidUpdate(t){(t.targetRect!==this.props.targetRect||t.forceTop!==this.props.forceTop||this.props.forceLayout)&&this.layout()}getContainer(){const{ignoreBoundary:t=!1}=this.props;return!t&&this.context?this.context.current:document.body}getBoundsContainer(){const t=this.getContainer();return t.parentNode&&this.isHTMLElement(t.parentNode)&&t.parentNode.style.overflow==="auto"?t.parentNode:t}layout(){const{targetRect:t,offset:n=0}=this.props,r=this.contentRef.current;if(!r)return;const o=r.getBoundingClientRect(),i=this.target.parentNode;let a=t||(this.isHTMLElement(i)?i?.getBoundingClientRect():void 0);if(!a)return;a={top:a.top,left:a.left,width:a.width,height:a.height};const l=this.getBoundsContainer();if(!l)return;const u=l.getBoundingClientRect();if(a.left-=u.left,a.top-=u.top,this.props.forceTop)a.top=this.props.forceTop;else{const f=o.height+n,d=a.top-f,h=a.top+a.height+f;(this.position.indexOf("top")!==-1&&d<u.top||this.position.indexOf("bottom")!==-1&&h>u.height&&d>0)&&(this.position=this.getOppositePosition(this.position)),a.top+=l.scrollTop}const c=this.getStyleForPosition(this.position,o,a,this.getContainer().getBoundingClientRect(),n);r.style.top=c.top,r.style.bottom=c.bottom,r.style.left=c.left,r.style.right=c.right,r.style.width=c.width}componentWillUnmount(){this.cleanup&&this.cleanup()}getOppositePosition(t){switch(t){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(t,n,r,o,i){const a={top:"inherit",bottom:"inherit",left:"inherit",right:"inherit",width:void 0};if(t==="top"||t==="top-right"||t==="top-left")a.top=r.top-n.height-i+"px",t==="top-right"?a.left=r.left+(r.width-n.width)+"px":a.left=r.left+"px";else if(t==="bottom"||t==="bottom-right"||t==="bottom-left")a.top=r.top+r.height+i+"px",t==="bottom-right"?a.left=r.left+(r.width-n.width)+"px":a.left=r.left+"px";else if(t==="bottom-center")a.top=r.top+r.height+i+"px",a.left=r.left-(n.width-r.width)/2+"px";else if(t==="top-center")a.top=r.top-n.height-i+"px",a.left=r.left-(n.width-r.width)/2+"px";else if(t==="left-center")a.top=r.top-(n.height-r.height)/2+"px",a.left=r.left-n.width+"px";else if(t==="top-stretch")a.bottom=o.height-r.top+i+"px",a.left=r.left+"px",a.width=r.width+"px";else if(t==="bottom-stretch")a.top=r.top+r.height+i+"px",a.left=r.left+"px",a.width=r.width+"px";else if(t==="right")a.top=r.top+"px",a.left=r.left+r.width+i+"px";else throw new Error("Invalid position for Tooltip: "+t);return a}render(){const{children:t,width:n,style:r}=this.props,o={position:"absolute",zIndex:3e3,padding:5,width:n,...X.shadowLarge,borderRadius:4,backgroundColor:S.menuBackground,color:S.menuItemText};return this.getContainer()?s.jsx("div",{ref:i=>this.target=i,children:cL.createPortal(s.jsx("div",{className:`${ze(o,r,X.darkScrollbar)}`,ref:this.contentRef,"data-testid":this.props["data-testid"]||"tooltip","data-istooltip":!0,onClick:i=>{i.stopPropagation()},children:t}),this.getContainer())}):null}}const mp=32;function mP(e,t){document.hasFocus()?e?.(t):t.stopPropagation()}const he=g.forwardRef(function({width:t,name:n,truncate:r=!0,children:o,style:i,contentStyle:a,...l},u){return s.jsx(I,{innerRef:u,...l,style:{...t==="flex"?{flex:1,flexBasis:0}:{width:t},borderTopWidth:1,borderBottomWidth:1,borderColor:S.tableBorder,...X.smallText,...i},"data-testid":n,children:s.jsx(I,{style:{flex:1,padding:"0 5px",justifyContent:"center",...a},children:r?s.jsx(z,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:o}):o})})});function Dle({value:e,formatter:t}){return s.jsx(z,{style:{flexGrow:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t?t(e):e})}function Bn({width:e,name:t,exposed:n,focused:r,value:o,formatter:i,textAlign:a,alignItems:l,onExpose:u,children:c,plain:f,style:d,valueStyle:h,unexposedContent:p,privacyFilter:m,...x}){const k=g.useRef(null),v=g.useRef(null);dO(v,r!==void 0?r:n);const y=e==="flex"?{flex:1,flexBasis:0}:{width:e},b={position:"relative",textAlign:a||"left",justifyContent:"center",borderTopWidth:1,borderBottomWidth:1,borderColor:S.tableBorder,alignItems:l},w=g.useMemo(()=>s.jsx(dP,{privacyFilter:fP({activationFilters:[!r,!n],style:{position:"absolute",width:"100%",height:"100%"}},m),children:f?c:n?c():s.jsx(I,{style:{flexDirection:"row",flex:1,padding:"0 5px",alignItems:"center",...X.smallText,...h},onMouseDown:E=>k.current=[E.clientX,E.clientY],onClick:pn.IS_TESTING?()=>u?.(t):E=>{k.current&&Math.abs(E.clientX-k.current[0])<5&&Math.abs(E.clientY-k.current[1])<5&&u?.(t)},children:p||s.jsx(Dle,{value:o,formatter:i})})}),[m,r,n,c,f,n,h,u,t,p,o,i]);return s.jsx(I,{innerRef:v,style:{...y,...b,...d},...x,"data-testid":t,children:w})}function $o({inset:e=0,collapsed:t,children:n,height:r,style:o,...i}){return s.jsxs(I,{style:{flexDirection:"row",height:r||mp,flex:"0 0 "+(r||mp)+"px",userSelect:"text",...t&&{marginTop:-1},...o},"data-testid":"row",...i,children:[e!==0&&s.jsx(he,{width:e}),n,e!==0&&s.jsx(he,{width:e})]})}const yP={padding:"5px 3px",margin:"0 1px"},_le={backgroundColor:"transparent","::selection":{backgroundColor:S.formInputTextReadOnlySelection}};function vP({value:e,onUpdate:t,onBlur:n,...r}){const[o,i]=g.useState(e);function a(u){n&&mP(n,u)}function l(u){u.key!=="Enter"&&u.key!=="Tab"&&u.stopPropagation(),u.key==="Escape"?o!==e&&i(e):Vv(u)&&t?.(o)}return s.jsx(Ke,{...r,value:o,onChangeValue:u=>i(u),onBlur:a,onUpdate:t,onKeyDown:l,style:{...yP,...r.readOnly?_le:null,...r.style}})}function Ole({inputProps:e,onUpdate:t,onBlur:n,textAlign:r,error:o,...i}){return s.jsx(Bn,{textAlign:r,...i,children:()=>s.jsxs(s.Fragment,{children:[s.jsx(vP,{value:i.value,onUpdate:t,onBlur:n,style:{textAlign:r,...e&&e.style},...e}),o&&s.jsx(Et,{targetHeight:mp,width:180,position:"bottom-left",children:o},"error")]})})}function Vv(e){switch(e.key){case"Tab":case"Enter":return e.preventDefault(),!0}}function Zbe({value:e,children:t,onUpdate:n,onBlur:r,...o}){const[i,a]=g.useState(e),[l,u]=g.useState(e);l!==e&&(a(e),u(e));function c(d){document.hasFocus()&&(n?.(i),mP(r,d))}function f(d){Vv(d)&&n?.(i)}return s.jsx(Bn,{...o,value:e,children:()=>t({onBlur:c,onKeyDown:f,onUpdate:d=>a(d),onSave:d=>{a(d),n?.(d)},shouldSaveFromKey:Vv,inputStyle:yP})})}function Jbe({onDelete:e,style:t,...n}){return s.jsx(Bn,{...n,name:"delete",width:20,style:{alignItems:"center",userSelect:"none",...t},onClick:r=>{r.stopPropagation(),e?.()},children:()=>s.jsx(Ed,{width:7,height:7})})}const Fg=g.forwardRef(({children:e,style:t,primary:n,bare:r,disabled:o,clickBehavior:i,onSelect:a,onEdit:l,className:u},c)=>s.jsx(I,{innerRef:c,className:u,tabIndex:0,onKeyDown:f=>{(f.key==="x"||f.key===" ")&&(f.preventDefault(),o||a?.(f))},style:{flexDirection:"row",alignItems:"center",cursor:"default",transition:"box-shadow .15s",backgroundColor:r?"transparent":o?S.buttonNormalDisabledBackground:n?S.buttonPrimaryBackground:S.buttonNormalBackground,border:r?"none":"1px solid "+(o?S.buttonNormalDisabledBorder:n?S.buttonPrimaryBorder:S.buttonNormalBorder),color:r?"inherit":o?S.buttonNormalDisabledText:n?S.buttonPrimaryText:S.buttonNormalText,":focus":r?null:{outline:0,boxShadow:`1px 1px 2px ${S.buttonNormalShadow}`},...t},onFocus:()=>l&&l(),"data-testid":"cell-button",onClick:i==="none"?null:f=>{o||(a?.(f),l?.())},children:e}));Fg.displayName="CellButton";function da({focused:e,selected:t,style:n,onSelect:r,onEdit:o,buttonProps:i={},...a}){return s.jsx(Bn,{...a,focused:e,name:"select",width:20,style:{alignItems:"center",userSelect:"none",...n},onClick:l=>{l.stopPropagation(),r?.(l),o?.()},children:()=>s.jsx(Fg,{style:{width:12,height:12,justifyContent:"center",alignItems:"center",borderRadius:3,border:t?"1px solid "+S.checkboxBorderSelected:"1px solid "+S.formInputBorder,color:S.checkboxText,backgroundColor:t?S.checkboxBackgroundSelected:S.tableBackground,":focus":{border:"1px solid "+S.checkboxBorderSelected,boxShadow:"0 1px 2px "+S.checkboxShadowSelected}},onEdit:o,onSelect:r,clickBehavior:"none",...i,children:t&&s.jsx(Boe,{width:6,height:6})})})}function ewe({valueProps:e,valueStyle:t,inputProps:n,textAlign:r,onSave:o,...i}){const{binding:a,type:l,getValueStyle:u,formatExpr:c,unformatExpr:f,privacyFilter:d}=e,h=No(a,m=>{i.exposed&&n&&n.onBlur&&n.onBlur(m)}),p=Xl();return s.jsx(Bn,{valueStyle:u?{...t,...u(h)}:t,textAlign:r,...i,value:h,formatter:m=>i.formatter?i.formatter(m,l):p(m,l),privacyFilter:d??(l==="financial"?!0:void 0),"data-cellname":h,children:()=>s.jsx(vP,{value:c?c(h):h,onUpdate:m=>{o(f?f(m):m)},...n,style:{textAlign:r,...n?.style||{}}})})}function ws({headers:e,children:t,...n}){return s.jsx(I,{style:{borderRadius:"6px 6px 0 0",overflow:"hidden",flexShrink:0},children:s.jsx($o,{collapsed:!0,...n,style:{color:S.tableHeaderText,backgroundColor:S.tableHeaderBackground,zIndex:200,fontWeight:500,...n.style},children:e?e.map(r=>s.jsx(Bn,{value:r.name,width:r.width,style:r.style,valueStyle:r.valueStyle},r.name)):t})})}function Ale({name:e,items:t,onSelect:n}){const r=Kl(),[o,i]=g.useState(null);return r.size===0?null:s.jsxs(I,{style:{marginLeft:10,flexShrink:0},children:[s.jsxs(q,{type:"bare",style:{color:S.pageTextPositive},onClick:()=>i(!0),"data-testid":e+"-select-button",children:[s.jsx(xg,{width:8,height:8,style:{marginRight:5,color:S.pageText}}),r.size," ",e]}),o&&s.jsx(Et,{position:"bottom-right",width:200,style:{padding:0,backgroundColor:S.menuBackground},onClose:()=>i(!1),"data-testid":e+"-select-tooltip",children:s.jsx(wt,{onMenuSelect:a=>{n(a,[...r]),i(!1)},items:t})})]})}const Ple={position:"absolute",willChange:"transform",width:"100%"};function Mle({fields:e,...t}){const n=xP(t.items,e);return s.jsx(Ss,{...t,navigator:n})}const Ss=g.forwardRef(({items:e,count:t,headers:n,contentHeader:r,loading:o,rowHeight:i=mp,backgroundColor:a=S.tableHeaderBackground,renderItem:l,renderEmpty:u,getItemKey:c,loadMore:f,style:d,navigator:h,onScroll:p,allowPopupsEscape:m,isSelected:x,saveScrollWidth:k,...v},y)=>{h||(h={onEdit:()=>{},editingId:null,focusedField:null,getNavigatorProps:P=>P});const{onEdit:b,editingId:w,focusedField:E,getNavigatorProps:T}=h,_=g.useRef(null),M=g.useRef(null),B=g.useRef(null),O=g.useRef(null),N=g.useRef(!1);g.useImperativeHandle(y,()=>({scrollTo:(P,j="smart")=>{const D=e.findIndex(C=>C.id===P);D!==-1&&(_.current?_.current.scrollToItem(D,j):O.current=D)},scrollToTop:()=>{_.current?.scrollTo(0)},getScrolledItem:()=>{if(B.current){const P=B.current.scrollTop,j=_.current.getStartIndexForOffset(P);return e[j].id}return 0},setRowAnimation:P=>{_.current?.setRowAnimation(P)},edit(P,j,D){b(P,j),P&&D&&y.scrollTo(P)},anchor(){_.current?.anchor()},unanchor(){_.current?.unanchor()},isAnchored(){return _.current&&_.current.isAnchored()}})),g.useLayoutEffect(()=>{!N.current&&M.current&&(_.current?.setRowAnimation(!0),N.current=!0),B.current&&k&&k(B.current.offsetParent?B.current.offsetParent.clientWidth:0,B.current?B.current.clientWidth:0)});function H({index:P,style:j,key:D}){const C=e[P],$=w===C.id,W=x&&x(C.id),A=l({item:C,editing:$,focusedField:$&&E,onEdit:b,index:P,position:j.top});return s.jsx(I,{style:{...Ple,zIndex:$||W?101:"auto",transform:"translateY(var(--pos))"},nativeStyle:{"--pos":`${j.top-1}px`},"data-focus-key":C.id,children:A},D)}function F(P,j){return j*(i-1)+(i-1)/2-P/2+(i-1)*2}function L({overscanStopIndex:P}){f&&P>e.length-100&&f()}function R(P){return P==null?null:typeof P=="function"?P():s.jsx(I,{style:{justifyContent:"center",alignItems:"center",fontStyle:"italic",color:S.tableText,flex:1},children:P})}if(o)return s.jsx(I,{style:{flex:1,justifyContent:"center",alignItems:"center",backgroundColor:a},children:s.jsx(vi,{width:25,color:S.tableText})});const U=(t||e.length)===0;return s.jsxs(I,{style:{flex:1,outline:"none",...d},tabIndex:1,...T(v),"data-testid":"table",children:[n&&s.jsx(ws,{height:i,...Array.isArray(n)?{headers:n}:{children:n}}),s.jsx(I,{style:{flex:`1 1 ${i*Math.max(2,e.length)}px`,backgroundColor:a},children:U?R(u):s.jsx(lle,{children:({width:P,height:j})=>P===0||j===0?null:s.jsx(gP.Provider,{value:!m&&M,children:s.jsx(UJ,{children:s.jsx(hle,{ref:_,header:r,innerRef:M,outerRef:B,width:P,height:j,renderRow:H,itemCount:t||e.length,itemSize:i-1,itemKey:c||(D=>e[D].id),indexForKey:D=>e.findIndex(C=>C.id===D),initialScrollOffset:O.current?F(j,O.current):0,overscanCount:5,onItemsRendered:L,onScroll:p})})})})})]})});Ss.displayName="Table";function xP(e,t){const n=typeof t!="function"?()=>t:t,[r,o]=g.useState(null),[i,a]=g.useState(null),l=g.useRef(),u=yE(),c=g.useRef(0),f=g.useCallback((y,b)=>{o(y),a(y?b:null)},[]);g.useEffect(()=>{c.current=u.getState().modals.modalStack.length},[]);function d(){l.current.focus(),f(null),setTimeout(()=>{f(r,i)},100)}function h(){const y=e.findIndex(b=>b.id===r);if(y>0){const b=e[y-1],w=n(b);f(b.id,w[w.length-1])}else d()}function p(){const y=e.findIndex(b=>b.id===r);if(y<e.length-1){const b=e[y+1],w=n(b);f(b.id,w[0])}else d()}function m(y){if(r){const b=n(e.find(E=>E.id===r)),w=b.indexOf(i)+y;w<0?h():w>=b.length?p():a(b[w])}}function x(y){if(r){let w=e.findIndex(E=>E.id===r);for(;;)if(w=w+y,w>=0&&w<e.length){const E=e[w];if(n(E).includes(i)){f(E.id,i);break}}else{d();break}}}function k(y){switch(y){case"left":m(-1);break;case"right":m(1);break;case"up":x(-1);break;case"down":x(1);break;default:throw new Error("Unknown direction: "+y)}}function v(y){return{...y,innerRef:l,onKeyDown:b=>{if(y?.onKeyDown?.(b),!b.isPropagationStopped())switch(b.key){case"ArrowUp":case"k":b.target.tagName!=="INPUT"&&k("up");break;case"ArrowDown":case"j":b.target.tagName!=="INPUT"&&k("down");break;case"Enter":case"Tab":b.preventDefault(),b.stopPropagation(),k(b.key==="Enter"?b.shiftKey?"up":"down":b.shiftKey?"left":"right");break}},onBlur:b=>{const w=c.current,E=u.getState().modals.modalStack.length;document.hasFocus()&&(b.relatedTarget==null||!l.current.contains(b.relatedTarget)||l.current===b.relatedTarget)&&w===E&&f(null)}}}return{onEdit:f,editingId:r,focusedField:i,getNavigatorProps:v}}function Rle(){const e=Kl(),t=bs();return s.jsxs(ws,{style:{},children:[s.jsx(da,{exposed:!0,focused:!1,selected:e.size>0,onSelect:n=>t({type:"select-all",event:n})}),s.jsx(Bn,{value:"Stage",width:50}),s.jsx(Bn,{value:"Rule",width:"flex"})]})}function Ble(e,t,n){const r=new n(e,null,t),o=g.createContext(null);function i({children:l}){const[u,c]=g.useState(r.getData()),f=g.useMemo(()=>({data:u,query:r}),[u,r]);return g.useEffect(()=>{if(r.getNumListeners()!==0)throw new Error("Query already has listeners. You cannot use the same query context `Provider` twice");const d=r.addListener(h=>c(h));return r.isRunning()||r.run(),c(r.getData()),()=>{d(),r.unsubscribe()}},[]),s.jsx(o.Provider,{value:f,children:l})}function a(){const l=g.useContext(o);if(l==null)throw new Error("`useQuery` tried to access a query that hasn’t been run. You need to put its `Provider` in a parent component");return l}return{Provider:i,useQuery:a}}function Lle(e,t){return Ble(e,t,j1)}function Pd(e,t){const[n,r]=g.useState(null),o=g.useMemo(e,t);return g.useEffect(()=>{let i=Cc(o,async a=>{i&&r(a)});return()=>{i.unsubscribe(),i=null}},[o]),n}const aw=Lle(pt("schedules").select("*"));function nr(){return Te(e=>e.prefs.local?.dateFormat)}function Hg({value:e,field:t,valueIsRaw:n,inline:r=!1,data:o,describe:i=l=>l.name,style:a}){const l=nr()||"MM/dd/yyyy",u=Hr(),{list:c}=Fr(),f=mn(),d={color:S.pageTextPositive,...a},h=o||(t==="payee"?u:t==="category"?c:t==="account"?f:[]),[p,m]=g.useState(!1);function x(v){v.preventDefault(),m(!0)}function k(v){if(v==null||v==="")return"(nothing)";if(typeof v=="boolean")return v?"true":"false";switch(t){case"amount":return _n(v);case"date":return v?v.frequency?ew(v,l):ke(Mo(v),l):null;case"month":return v?ke(Mo(v),Xb(l)):null;case"year":return v?ke(Mo(v),"yyyy"):null;case"notes":case"imported_payee":return v;case"payee":case"category":case"account":case"rule":if(n)return v;if(h&&Array.isArray(h)){const y=h.find(b=>b.id===v);return y?i(y):"(deleted)"}return"…";default:throw new Error(`Unknown field ${t}`)}}if(Array.isArray(e)){if(e.length===0)return s.jsx(z,{style:d,children:"(empty)"});if(e.length===1)return s.jsxs(z,{children:["[",s.jsx(z,{style:d,children:k(e[0])}),"]"]});let v=e;!p&&e.length>4&&(v=e.slice(0,3));const y=e.length-v.length;return s.jsxs(z,{style:{color:S.tableText},children:["[",v.map((b,w)=>{const E=s.jsx(z,{style:d,children:k(b)});let T;return r?T=w!==0?" ":"":T=s.jsxs(s.Fragment,{children:[w===0&&s.jsx("br",{})," "]}),s.jsxs(z,{children:[T,E,w===e.length-1?"":",",!r&&s.jsx("br",{})]},w)}),y>0&&s.jsxs(z,{style:d,children:[" ",s.jsxs(Ro,{onClick:x,style:d,children:[y," more items..."]}),!r&&s.jsx("br",{})]}),"]"]})}else if(e&&e.num1!=null&&e.num2!=null){const{num1:v,num2:y}=e;return s.jsxs(z,{children:[s.jsx(z,{style:d,children:k(v)})," and"," ",s.jsx(z,{style:d,children:k(y)})]})}else return s.jsx(z,{style:d,children:k(e)})}function Nle({value:e}){const t=Hr(),n=mD(t),{data:r}=aw.useQuery();return s.jsx(Hg,{value:e,field:"rule",data:r,describe:o=>oP(o,n[o._payee])})}const ec={color:S.pillTextHighlighted};function WT({style:e,...t}){return s.jsx(I,{style:{display:"block",maxWidth:"100%",color:S.pillText,backgroundColor:S.pillBackgroundLight,borderRadius:4,padding:"3px 5px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",...e},children:t.op==="set"?s.jsx($le,{...t}):t.op==="set-split-amount"?s.jsx(Fle,{...t}):t.op==="link-schedule"?s.jsx(Hle,{...t}):null})}function $le({op:e,field:t,value:n,options:r}){return s.jsxs(s.Fragment,{children:[s.jsx(z,{children:so(e)})," ",s.jsx(z,{style:ec,children:oa(t,r)})," ",s.jsx(z,{children:"to "}),s.jsx(Hg,{style:ec,value:n,field:t})]})}function Fle({op:e,value:t,options:n}){const r=n?.method;return r?s.jsxs(s.Fragment,{children:[s.jsx(z,{children:so(e)})," ",s.jsx(z,{style:ec,children:RA[r]}),r!=="remainder"&&": ",r==="fixed-amount"&&s.jsx(Hg,{style:ec,value:t,field:"amount"}),r==="fixed-percent"&&s.jsxs(z,{style:ec,children:[t,"%"]})]}):null}function Hle({op:e,value:t}){return s.jsxs(s.Fragment,{children:[s.jsx(z,{children:so(e)})," ",s.jsx(Nle,{value:t})]})}const VT={color:S.pillTextHighlighted};function zle({field:e,op:t,value:n,options:r,prefix:o,style:i,inline:a}){return s.jsxs(I,{style:{display:"block",maxWidth:"100%",color:S.pillText,backgroundColor:S.pillBackgroundLight,borderRadius:4,padding:"3px 5px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",...i},children:[o&&s.jsxs(z,{children:[o," "]}),s.jsx(z,{style:VT,children:oa(e,r)})," ",s.jsx(z,{children:so(t)})," ",s.jsx(Hg,{style:VT,value:n,field:e,inline:a})]})}const bP=g.memo(({rule:e,hovered:t,selected:n,onHover:r,onEditRule:o})=>{const i=bs(),a=n?S.tableBorderSelected:"none",l=t,u=e.actions.reduce((f,d)=>{const h=d.options?.splitIndex??0;return f[h]=f[h]??{id:oo(),actions:[]},f[h].actions.push(d),f},[]),c=u.length>1;return s.jsxs($o,{height:"auto",style:{fontSize:13,zIndex:n?101:"auto",borderColor:a,backgroundColor:n?S.tableRowBackgroundHighlight:l?S.tableRowBackgroundHover:S.tableBackground},collapsed:!0,onMouseEnter:()=>r&&r(e.id),onMouseLeave:()=>r&&r(null),children:[s.jsx(da,{exposed:t||n,focused:!0,onSelect:f=>{i({type:"select",id:e.id,event:f})},selected:n}),s.jsx(Bn,{name:"stage",width:50,plain:!0,style:{color:S.tableText},children:e.stage&&s.jsx(I,{style:{alignSelf:"flex-start",margin:5,backgroundColor:S.pillBackgroundSelected,color:S.pillTextSelected,borderRadius:4,padding:"3px 5px"},children:e.stage})}),s.jsx(he,{width:"flex",style:{padding:"15px 0"},truncate:!1,children:s.jsxs(Pe,{direction:"row",align:"center",children:[s.jsx(I,{style:{flex:1,alignItems:"flex-start"},"data-testid":"conditions",children:e.conditions.map((f,d)=>s.jsx(zle,{field:f.field,op:f.op,inline:!0,value:f.value,options:f.options,prefix:d>0?so(e.conditionsOp):null,style:d!==0&&{marginTop:3}},d))}),s.jsx(z,{children:s.jsx(NJ,{style:{width:12,height:12,color:S.tableText}})}),s.jsx(I,{style:{flex:1,alignItems:"flex-start"},"data-testid":"actions",children:c?u.map((f,d)=>s.jsxs(I,{style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start",marginTop:d>0?3:0,padding:"5px",borderColor:S.tableBorder,borderWidth:"1px",borderRadius:"5px"},children:[s.jsx(z,{style:{...X.verySmallText,color:S.pageTextLight,marginBottom:6},children:d?`Split ${d}`:"Before split"}),f.actions.map((h,p)=>s.jsx(WT,{...h,style:p!==0&&{marginTop:3}},p))]},f.id)):e.actions.map((f,d)=>s.jsx(WT,{...f,style:d!==0&&{marginTop:3}},d))})]})}),s.jsx(Bn,{name:"edit",plain:!0,style:{padding:"0 15px",paddingLeft:5},children:s.jsx(q,{as:Fg,onSelect:()=>o(e),children:"Edit"})})]})});bP.displayName="RuleRow";function Ule({rules:e,selectedItems:t,hoveredRule:n,onHover:r,onEditRule:o}){return e.length===0?null:s.jsx(I,{children:e.map(i=>{const a=n===i.id,l=t.has(i.id);return s.jsx(bP,{rule:i,hovered:a,selected:l,onHover:r,onEditRule:o},i.id)})})}function Wle({loadMore:e,style:t,onHoverLeave:n,children:r}){const o=g.useRef(),i=g.useRef();function a(l){e&&Math.abs(l.currentTarget.scrollHeight-l.currentTarget.clientHeight-l.currentTarget.scrollTop)<1&&e()}return s.jsx(I,{style:{flex:1,outline:"none","& .animated .animated-row":{transition:".25s transform"},...t},tabIndex:1,"data-testid":"table",children:s.jsx(I,{innerRef:i,style:{maxWidth:"100%",overflow:"auto"},onScroll:a,children:s.jsx("div",{ref:o,onMouseLeave:n,children:r})})})}function py(e,t,{payees:n,categories:r,accounts:o}){if(!t)return"";let i=null;if(e==="payee")i=n.find(a=>a.id===t);else if(e==="category")i=r.find(a=>a.id===t);else if(e==="account")i=o.find(a=>a.id===t);else return t;return i?i.name:"(deleted)"}function Vle(e,t){const n=e.conditions.flatMap(o=>[oa(o.field),so(o.op),o.op==="oneOf"||o.op==="notOneOf"?o.value.map(i=>py(o.field,i,t)).join(", "):py(o.field,o.value,t)]),r=e.actions.flatMap(o=>{if(o.op==="set")return[so(o.op),oa(o.field),"to",py(o.field,o.value,t)];if(o.op==="link-schedule"){const i=t.schedules.find(a=>a.id===o.value);return[so(o.op),oP(i,t.payees.find(a=>a.id===i._payee))]}else return[]});return(e.stage||"")+" "+n.join(" ")+" "+r.join(" ")}function Yle({isModal:e,payeeId:t,setLoading:n}){const[r,o]=g.useState([]),[i,a]=g.useState(0),[l,u]=g.useState(""),c=Ft(),{data:f}=aw.useQuery(),{list:d}=Fr(),h=Hr(),p=mn(),m={payees:h,accounts:p,schedules:f},x=g.useMemo(()=>({...m,categories:d}),[m,d]),k=g.useMemo(()=>(l===""?r:r.filter(N=>Vle(N,x).toLowerCase().includes(l.toLowerCase()))).slice(0,100+i*50),[r,l,x,i]),v=Gl("manage-rules",r,[]),[y,b]=g.useState(null),w=g.useCallback(N=>{u(N),a(0)},[u]);async function E(){n(!0);let N=null;return t?N=await Y("payees-get-rules",{id:t}):N=await Y("rules-get"),o(N),N}g.useEffect(()=>{async function N(){await E(),n(!1),await c(v1())}return t&&Tc("openModal","manage-rules"),N(),()=>{Tc("openModal",null)}},[]);function T(){a(N=>N+1)}async function _(){n(!0);const{someDeletionsFailed:N}=await Y("rule-delete-all",[...v.items]);N&&alert("Some rules were not deleted because they are linked to schedules"),await E(),v.dispatch({type:"select-none"}),n(!1)}const M=g.useCallback(N=>{c(dr("edit-rule",{rule:N,onSave:async()=>{await E(),n(!1)}}))},[]);function B(){c(dr("edit-rule",{rule:{stage:null,conditionsOp:"and",conditions:[{field:"payee",op:"is",value:t||null,type:"id"}],actions:[{op:"set",field:"category",value:null,type:"id"}]},onSave:async()=>{await E(),n(!1)}}))}const O=g.useCallback(N=>{b(N)},[]);return s.jsx(Ql,{instance:v,children:s.jsxs(I,{children:[s.jsxs(I,{style:{flexDirection:"row",alignItems:"center",padding:e?"0 13px 15px":"0 0 15px",flexShrink:0},children:[s.jsx(I,{style:{color:S.pageTextLight,flexDirection:"row",alignItems:"center",width:"50%"},children:s.jsxs(z,{children:["Rules are always run in the order that you see them."," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/budgeting/rules/",linkColor:"muted",children:"Learn more"})]})}),s.jsx(I,{style:{flex:1}}),s.jsx(rw,{placeholder:"Filter rules...",value:l,onChange:w})]}),s.jsxs(I,{style:{flex:1},children:[s.jsx(Rle,{}),s.jsx(Wle,{loadMore:T,style:{marginBottom:-1},children:k.length===0?s.jsx(qle,{text:"No rules",style:{marginTop:15}}):s.jsx(Ule,{rules:k,selectedItems:v.items,hoveredRule:y,onHover:O,onEditRule:M})})]}),s.jsx(I,{style:{paddingBlock:15,paddingInline:e?13:0,borderTop:e&&"1px solid "+S.pillBorder,flexShrink:0},children:s.jsxs(Pe,{direction:"row",align:"center",justify:"flex-end",spacing:2,children:[v.items.size>0&&s.jsxs(q,{onClick:_,children:["Delete ",v.items.size," rules"]}),s.jsx(q,{type:"primary",onClick:B,children:"Create new rule"})]})})]})})}function qle({text:e,style:t}){return s.jsx(I,{style:{textAlign:"center",color:S.pageTextSubdued,fontStyle:"italic",fontSize:13,marginTop:5,style:t},children:e})}function wP({isModal:e,payeeId:t,setLoading:n=()=>{}}){return s.jsx(aw.Provider,{children:s.jsx(Yle,{isModal:e,payeeId:t,setLoading:n})})}const Gle=50;function Kle({title:e,titleContainerProps:t,style:n,leftContentContainerProps:r,leftContent:o,rightContentContainerProps:i,rightContent:a}){const{isNarrowWidth:l}=zt();return l?s.jsxs(I,{style:{alignItems:"center",backgroundColor:S.mobileHeaderBackground,color:S.mobileHeaderText,flexDirection:"row",flexShrink:0,height:Gle,...n},children:[s.jsx(I,{...r,style:{flexBasis:"25%",justifyContent:"flex-start",flexDirection:"row",...r?.style},children:o}),s.jsx(I,{role:"heading",...t,style:{textAlign:"center",alignItems:"center",justifyContent:"center",flexDirection:"row",flexBasis:"50%",fontSize:17,fontWeight:500,overflowY:"auto",...t?.style},children:e}),s.jsx(I,{...i,style:{flexBasis:"25%",justifyContent:"flex-end",flexDirection:"row",...i?.style},children:a})]}):s.jsx(z,{style:{fontSize:25,fontWeight:500,marginBottom:15,...n},children:e})}function zg({titleContainerProps:e,title:t,headerStyle:n,headerLeftContentContainerProps:r,headerLeftContent:o,headerRightContentContainerProps:i,headerRightContent:a,style:l,padding:u,childrenContainerProps:c,children:f,footer:d}){const{isNarrowWidth:h}=zt(),p=u??(h?10:20);return s.jsxs(I,{style:{...!h&&X.page,...l},children:[s.jsx(Kle,{title:t,titleContainerProps:e,leftContentContainerProps:r,leftContent:o,rightContentContainerProps:i,rightContent:a,style:{...!h&&{paddingInline:p},...n}}),h?s.jsx(I,{...c,style:{flex:1,overflowY:"auto",padding:p,...c?.style},children:f}):s.jsx(I,{...c,style:{flex:1,paddingLeft:p,paddingRight:p,...c?.style},children:f}),d]})}function Qle(){return s.jsx(zg,{title:"Rules",children:s.jsx(wP,{isModal:!1,payeeId:null})})}function Xle(e,t,n){return Math.max(t,Math.min(e,n))}const kn={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function YT(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function qT(e,t,n,r=.15){return r===0?Xle(e,t,n):e<t?-YT(t-e,n-t,r)+t:e>n?+YT(e-n,n-t,r)+n:e}function Zle(e,[t,n],[r,o]){const[[i,a],[l,u]]=e;return[qT(t,i,a,r),qT(n,l,u,o)]}function Jle(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eue(e){var t=Jle(e,"string");return typeof t=="symbol"?t:String(t)}function Vn(e,t,n){return t=eue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function kt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GT(Object(n),!0).forEach(function(r){Vn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const SP={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function KT(e){return e?e[0].toUpperCase()+e.slice(1):""}const tue=["enter","leave"];function nue(e=!1,t){return e&&!tue.includes(t)}function rue(e,t="",n=!1){const r=SP[e],o=r&&r[t]||t;return"on"+KT(e)+KT(o)+(nue(n,o)?"Capture":"")}const oue=["gotpointercapture","lostpointercapture"];function iue(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=oue.includes(t)?"capturecapture":"capture",o=!!~t.indexOf(r);return o&&(t=t.replace("capture","")),{device:t,capture:o,passive:n}}function aue(e,t=""){const n=SP[e],r=n&&n[t]||t;return e+r}function Ug(e){return"touches"in e}function kP(e){return Ug(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function sue(e){return Array.from(e.touches).filter(t=>{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function lue(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function TP(e){return Ug(e)?lue(e)[0]:e}function uue(e){return sue(e).map(t=>t.identifier)}function gy(e){const t=TP(e);return Ug(e)?t.identifier:t.pointerId}function QT(e){const t=TP(e);return[t.clientX,t.clientY]}function cue(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}function yp(e,...t){return typeof e=="function"?e(...t):e}function due(){}function fue(...e){return e.length===0?due:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function XT(e,t){return Object.assign({},t,e||{})}const hue=32;class pue{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:o}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=o,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?yp(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:o}=this;n.args=this.args;let i=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,o.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,o.locked=!!document.pointerLockElement,Object.assign(o,cue(t)),o.down=o.pressed=o.buttons%2===1||o.touches>0,i=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const T=n._delta.map(Math.abs);kn.addTo(n._distance,T)}this.axisIntent&&this.axisIntent(t);const[a,l]=n._movement,[u,c]=r.threshold,{_step:f,values:d}=n;if(r.hasCustomTransform?(f[0]===!1&&(f[0]=Math.abs(a)>=u&&d[0]),f[1]===!1&&(f[1]=Math.abs(l)>=c&&d[1])):(f[0]===!1&&(f[0]=Math.abs(a)>=u&&Math.sign(a)*u),f[1]===!1&&(f[1]=Math.abs(l)>=c&&Math.sign(l)*c)),n.intentional=f[0]!==!1||f[1]!==!1,!n.intentional)return;const h=[0,0];if(r.hasCustomTransform){const[T,_]=d;h[0]=f[0]!==!1?T-f[0]:0,h[1]=f[1]!==!1?_-f[1]:0}else h[0]=f[0]!==!1?a-f[0]:0,h[1]=f[1]!==!1?l-f[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(h);const p=n.offset,m=n._active&&!n._blocked||n.active;m&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=o[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=yp(r.bounds,n)),this.setup&&this.setup()),n.movement=h,this.computeOffset()));const[x,k]=n.offset,[[v,y],[b,w]]=n._bounds;n.overflow=[x<v?-1:x>y?1:0,k<b?-1:k>w?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const E=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=Zle(n._bounds,n.offset,E),n.delta=kn.sub(n.offset,p),this.computeMovement(),m&&(!n.last||i>hue)){n.delta=kn.sub(n.offset,p);const T=n.delta.map(Math.abs);kn.addTo(n.distance,T),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&i>0&&(n.velocity=[T[0]/i,T[1]/i],n.timeDelta=i)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const o=this.handler(kt(kt(kt({},n),t),{},{[this.aliasKey]:t.values}));o!==void 0&&(t.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function gue([e,t],n){const r=Math.abs(e),o=Math.abs(t);if(r>o&&r>n)return"x";if(o>r&&o>n)return"y"}class mue extends pue{constructor(...t){super(...t),Vn(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=kn.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=kn.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const o=typeof r.axisThreshold=="object"?r.axisThreshold[kP(t)]:r.axisThreshold;n.axis=gue(n._movement,o)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const yue=e=>e,ZT=.15,CP={enabled(e=!0){return e},eventOptions(e,t,n){return kt(kt({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[ZT,ZT];case!1:return[0,0];default:return kn.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return kn.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||yue},threshold(e){return kn.toVector(e,0)}},vue=0,Md=kt(kt({},CP),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=vue){return e},bounds(e={}){if(typeof e=="function")return i=>Md.bounds(e(i));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),JT={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class xue extends mue{constructor(...t){super(...t),Vn(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),o={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=Md.bounds(o)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const o=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(o&&o.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=gy(t),r._pointerActive=!0,this.computeValues(QT(t)),this.computeInitial(),n.preventScrollAxis&&kP(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const o=gy(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;const i=QT(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=kn.sub(i,n._values),this.computeValues(i)),kn.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const o=gy(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[i,a]=n._distance;if(n.tap=i<=r.tapsThreshold&&a<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[l,u]=n._delta,[c,f]=n._movement,[d,h]=r.swipe.velocity,[p,m]=r.swipe.distance,x=r.swipe.duration;if(n.elapsedTime<x){const k=Math.abs(l/n.timeDelta),v=Math.abs(u/n.timeDelta);k>d&&Math.abs(c)>p&&(n.swipe[0]=Math.sign(l)),v>h&&Math.abs(f)>m&&(n.swipe[1]=Math.sign(u))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,bue(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=JT[t.key];if(n){const r=this.state,o=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,o),r._keyboardActive=!0,kn.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in JT&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function bue(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const Rd=typeof window<"u"&&window.document&&window.document.createElement;function EP(){return Rd&&"ontouchstart"in window}function wue(){return EP()||Rd&&window.navigator.maxTouchPoints>1}function Sue(){return Rd&&"onpointerdown"in window}function kue(){return Rd&&"exitPointerLock"in window.document}function Tue(){try{return"constructor"in GestureEvent}catch{return!1}}const _r={isBrowser:Rd,gesture:Tue(),touch:EP(),touchscreen:wue(),pointer:Sue(),pointerLock:kue()},Cue=250,Eue=180,jue=.5,Iue=50,Due=250,_ue=10,eC={mouse:0,touch:0,pen:8},Oue=kt(kt({},Md),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&_r.pointerLock,_r.touch&&n?"touch":this.pointerLock?"mouse":_r.pointer&&!o?"pointer":_r.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?Cue:void 0,!(!_r.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o=void 0}){const i=kn.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=jue,distance:t=Iue,duration:n=Due}={}){return{velocity:this.transform(kn.toVector(e)),distance:this.transform(kn.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return Eue;case!1:return 0;default:return e}},axisThreshold(e){return e?kt(kt({},eC),e):eC},keyboardDisplacement(e=_ue){return e}});kt(kt({},CP),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!_r.touch&&_r.gesture)return"gesture";if(_r.touch&&r)return"touch";if(_r.touchscreen){if(_r.pointer)return"pointer";if(_r.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=a=>{const l=XT(yp(n,a),{min:-1/0,max:1/0});return[l.min,l.max]},i=a=>{const l=XT(yp(r,a),{min:-1/0,max:1/0});return[l.min,l.max]};return typeof n!="function"&&typeof r!="function"?[o(),i()]:a=>[o(a),i(a)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",kn.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});kt(kt({},Md),{},{mouseOnly:(e=!0)=>e});kt(kt({},Md),{},{mouseOnly:(e=!0)=>e});const jP=new Map,Yv=new Map;function Aue(e){jP.set(e.key,e.engine),Yv.set(e.key,e.resolver)}const Pue={key:"drag",engine:xue,resolver:Oue};function Mue(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Rue(e,t){if(e==null)return{};var n=Mue(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const Bue={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=_r.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},Lue=["target","eventOptions","window","enabled","transform"];function oh(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=oh(e[r],o);break;case"boolean":o&&(n[r]=e[r]);break}return n}function Nue(e,t,n={}){const r=e,{target:o,eventOptions:i,window:a,enabled:l,transform:u}=r,c=Rue(r,Lue);if(n.shared=oh({target:o,eventOptions:i,window:a,enabled:l,transform:u},Bue),t){const f=Yv.get(t);n[t]=oh(kt({shared:n.shared},c),f)}else for(const f in c){const d=Yv.get(f);d&&(n[f]=oh(kt({shared:n.shared},c[f]),d))}return n}class IP{constructor(t,n){Vn(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,o,i){const a=this._listeners,l=aue(n,r),u=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=kt(kt({},u),i);t.addEventListener(l,o,c);const f=()=>{t.removeEventListener(l,o,c),a.delete(f)};return a.add(f),f}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class $ue{constructor(){Vn(this,"_timeouts",new Map)}add(t,n,r=140,...o){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...o))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class Fue{constructor(t){Vn(this,"gestures",new Set),Vn(this,"_targetEventStore",new IP(this)),Vn(this,"gestureEventStores",{}),Vn(this,"gestureTimeoutStores",{}),Vn(this,"handlers",{}),Vn(this,"config",{}),Vn(this,"pointerIds",new Set),Vn(this,"touchIds",new Set),Vn(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Hue(this,t)}setEventIds(t){if(Ug(t))return this.touchIds=new Set(uue(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=Nue(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let o;if(!(n.target&&(o=n.target(),!o))){if(n.enabled){for(const a of this.gestures){const l=this.config[a],u=tC(r,l.eventOptions,!!o);if(l.enabled){const c=jP.get(a);new c(this,t,a).bind(u)}}const i=tC(r,n.eventOptions,!!o);for(const a in this.nativeHandlers)i(a,"",l=>this.nativeHandlers[a](kt(kt({},this.state.shared),{},{event:l,args:t})),void 0,!0)}for(const i in r)r[i]=fue(...r[i]);if(!o)return r;for(const i in r){const{device:a,capture:l,passive:u}=iue(i);this._targetEventStore.add(o,a,"",r[i],{capture:l,passive:u})}}}}function As(e,t){e.gestures.add(t),e.gestureEventStores[t]=new IP(e,t),e.gestureTimeoutStores[t]=new $ue}function Hue(e,t){t.drag&&As(e,"drag"),t.wheel&&As(e,"wheel"),t.scroll&&As(e,"scroll"),t.move&&As(e,"move"),t.pinch&&As(e,"pinch"),t.hover&&As(e,"hover")}const tC=(e,t,n)=>(r,o,i,a={},l=!1)=>{var u,c;const f=(u=a.capture)!==null&&u!==void 0?u:t.capture,d=(c=a.passive)!==null&&c!==void 0?c:t.passive;let h=l?r:rue(r,o,f);n&&d&&(h+="Passive"),e[h]=e[h]||[],e[h].push(i)};function zue(e,t={},n,r){const o=$t.useMemo(()=>new Fue(e),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),$t.useEffect(o.effect.bind(o)),$t.useEffect(()=>o.clean.bind(o),[]),t.target===void 0)return o.bind.bind(o)}function Uue(e,t){return Aue(Pue),zue({drag:e},t||{},"drag")}function Wue(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}function qv(e,t,n){var r,o,i,a,l;t==null&&(t=100);function u(){var f=Date.now()-a;f<t&&f>=0?r=setTimeout(u,t-f):(r=null,n||(l=e.apply(i,o),i=o=null))}var c=function(){i=this,o=arguments,a=Date.now();var f=n&&!r;return r||(r=setTimeout(u,t)),f&&(l=e.apply(i,o),i=o=null),l};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(l=e.apply(i,o),i=o=null,clearTimeout(r),r=null)},c}qv.debounce=qv;var Vue=qv;const Yue=mr(Vue),DP=g.createContext(void 0);function que({children:e}){const[t,n]=g.useState(void 0),[r,o]=g.useState(void 0),[i,a]=g.useState(void 0),l=g.useCallback((u=1)=>r-t<=i+u,[i,r,t]);return g.useEffect(()=>{const u=Yue(c=>{const f=c.target;n(f?.scrollTop||0),o(f?.scrollHeight||0),a(f?.clientHeight||0)},10);return window.addEventListener("scroll",u,{capture:!0,passive:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})},[]),s.jsx(DP.Provider,{value:{scrollY:t,hasScrolledToBottom:l},children:e})}function Gue(){return g.useContext(DP)}const Ef=3,_P=15,Ls=70,twe=Ls+_P;function my(){const{isNarrowWidth:e}=zt(),{scrollY:t}=Gue(),n={flex:`1 1 ${100/Ef}%`,height:Ls,padding:10},r=[{name:"Budget",path:"/budget",style:n,Icon:PA},{name:"Transaction",path:"/transactions/new",style:n,Icon:xs},{name:"Accounts",path:"/accounts",style:n,Icon:Woe},{name:"Schedules (Soon)",path:"/schedules/soon",style:n,Icon:fl},{name:"Payees (Soon)",path:"/payees/soon",style:n,Icon:OA},{name:"Rules (Soon)",path:"/rules/soon",style:n,Icon:AA},{name:"Settings",path:"/settings",style:n,Icon:DA}].map(v=>s.jsx(Kue,{...v},v.path)),o=Ef-r.length%Ef,i=Array.from({length:o}).map((v,y)=>s.jsx("div",{style:n},y)),a=Ls*Ef,l=0,u=a-Ls,c=a,[{y:f},d]=yoe(()=>({y:a})),h=({canceled:v})=>{d.start({y:l,immediate:!1,config:v?_u.wobbly:_u.stiff})},p=(v=0)=>{d.start({y:u,immediate:!1,config:{..._u.stiff,velocity:v}})},m=(v=0)=>{d.start({y:c,immediate:!1,config:{..._u.stiff,velocity:v}})},x=Wue(t);g.useEffect(()=>{t&&x&&t>x&&x!==0?m():p()},[t]);const k=Uue(({last:v,velocity:[,y],direction:[,b],offset:[,w],cancel:E,canceled:T})=>{w<0&&E(),v?w>Ls*.5||y>.5&&b>0?p(y):h({canceled:T}):d.start({y:w,immediate:!0})},{from:()=>[0,f.get()],filterTaps:!0,bounds:{top:-a,bottom:a-Ls},axis:"y",rubberband:!0});return s.jsx(IA.div,{role:"navigation",...k(),style:{y:f,touchAction:"pan-x",backgroundColor:S.mobileNavBackground,borderTop:`1px solid ${S.menuBorder}`,...X.shadow,height:a+_P,width:"100%",position:"fixed",zIndex:100,bottom:0,...!e&&{display:"none"}},children:s.jsxs(I,{children:[s.jsx("div",{style:{background:S.pillBorder,borderRadius:10,width:30,marginTop:5,marginBottom:5,padding:2,alignSelf:"center"}}),s.jsx(I,{style:{flexDirection:"row",flexWrap:"wrap",height:a,width:"100%"},children:[r,i]})]})})}function Kue({Icon:e,name:t,path:n,style:r}){return s.jsxs(xb,{to:n,style:({isActive:o})=>({...X.noTapHighlight,alignItems:"center",color:o?S.mobileNavItemSelected:S.mobileNavItem,display:"flex",flexDirection:"column",textDecoration:"none",textAlign:"center",...r}),children:[s.jsx(e,{width:22,height:22}),t]})}function nwe(e){return e.indexOf("temp")!==-1}function rwe(e){return e.indexOf("preview/")!==-1}function Wc(e){return typeof e=="number"?e:0}function OP(e,t){return{type:"SplitTransactionError",version:1,difference:Wc(t.amount)-e}}function sw(e,t){const n=e.id==="temp"?"temp":"";return{amount:0,...t,payee:"payee"in t?t.payee:e.payee,id:"id"in t?t.id:n+oo(),account:e.account,date:e.date,cleared:e.cleared!=null?e.cleared:null,starting_balance_flag:e.starting_balance_flag!=null?e.starting_balance_flag:null,is_child:!0,parent_id:e.id,error:null}}function AP(e){const t=(e.subtransactions||[]).reduce((n,r)=>n+Wc(r.amount),0);return{...e,error:t===Wc(e.amount)?null:OP(t,e)}}function Que(e,t){for(;t>=0;){if(e[t].is_parent)return t;t--}return null}function Xue(e,t){const n=[e[t]];let r=t+1;for(;r<e.length&&e[r].is_child;)n.push(e[r]),r++;return n}function PP(e){return e.reduce((t,n)=>{const{subtransactions:r,...o}=n,i=r||[];t.push(o);for(let a=0;a<i.length;a++)t.push(i[a]);return t},[])}function MP(e){return{...e[0],subtransactions:e.slice(1)}}function Gv(e){return e==null?null:PP([e])}function owe(e,t){return MP(F0(t,Gv(e)||[]))}function Wg(e,t,n){const r=e.findIndex(a=>a.id===t),o=e[r],i=[...e];if(r===-1)throw new Error("Tried to edit unknown transaction id: "+t);if(o.is_parent||o.is_child){const a=Que(e,r);if(a==null)return console.log("Cannot find parent index"),{data:[],diff:{deleted:[],updated:[]}};const l=Xue(e,a);let u=n(MP(l));const c=Gv(u);let f;return c==null?(f={deleted:[{id:l[0].id}],updated:[]},u={...l[0],_deleted:!0},i.splice(a,l.length)):(f=H0(l,c),i.splice(a,l.length,...c)),{data:i,newTransaction:u,diff:f}}else{const a=n(o),l=Gv(a)||[];return a&&(a.subtransactions=a.subtransactions||[]),i.splice(r,1,...l),{data:i,newTransaction:a||{...o,_deleted:!0},diff:H0([o],l)}}}function Zue(e,t){return Wg(e,t,n=>{if(!n.is_parent)return n;const r=zN(n.subtransactions||[]);return n.subtransactions?.push(sw(n,{amount:0,sort_order:Wc(r&&r.sort_order)-1})),n})}function Jue(e,t){return Wg(e,t.id,n=>{if(n.is_parent){const r=n.id===t.id?t:n,o=n.subtransactions?.map(i=>{let a=i;return n.id===t.id?a={...i,payee:i.payee===n.payee?t.payee:i.payee}:i.id===t.id&&(a=t),sw(r,a)});return AP({...r,subtransactions:o})}else return t})}function ece(e,t){return Wg(e,t,n=>{if(n.is_parent){if(n.id===t)return null;if(n.subtransactions?.length===1)return{...n,subtransactions:void 0,is_parent:!1,error:null};{const r=n.subtransactions?.filter(o=>o.id!==t);return AP({...n,subtransactions:r})}}else return null})}function tce(e,t){return Wg(e,t,n=>n.is_parent||n.is_child?n:{...n,is_parent:!0,error:Wc(n.amount)===0?null:OP(0,n),subtransactions:[sw(n,{amount:0,sort_order:-1})]})}function nce(e){const t={...e.find(r=>!r.is_child),id:oo()},n=e.filter(r=>r.is_child);return[t,...n.map(r=>({...r,id:oo(),parent_id:t.id}))]}const nC=/^var\((--.*)\)$/;function lw(e){g.useEffect(()=>{rce(oce(e))},[e])}function rce(e){[...document.getElementsByTagName("meta")].find(r=>r.name==="theme-color").setAttribute("content",e)}function oce(e){return nC.test(e)?window.getComputedStyle(document.documentElement).getPropertyValue(e.match(nC)[1]):e}const RP=g.createContext(void 0);function ice({formName:e,children:t}){const[n,r]=g.useState(null),o=g.useRef(null),i=()=>{const f=o.current;typeof f=="function"&&f?.(),o.current=null},a=f=>{o.current=f?.()},l=f=>{setTimeout(()=>{i(),r(null)},f)},u=(f,d)=>{a(d),r(f)},c=(f,d,h)=>{n!==f&&(n?l(h?.clearActiveEditDelayMs):u(f,d))};return s.jsx(RP.Provider,{value:{formName:e,editingField:n,onRequestActiveEdit:c,onClearActiveEdit:l},children:t})}function BP(){const e=g.useContext(RP);return e?{formName:e.formName,editingField:e.editingField,onRequestActiveEdit:e.onRequestActiveEdit,onClearActiveEdit:e.onClearActiveEdit}:null}function ace({style:e}){const t=Hn();return s.jsxs(q,{type:"bare",style:{color:S.mobileHeaderText,justifyContent:"center",margin:10,paddingLeft:5,paddingRight:3,...e},hoveredStyle:{color:S.mobileHeaderText,background:S.mobileHeaderTextHover},onPointerUp:()=>t(-1),children:[s.jsx(Noe,{style:{width:30,height:30,margin:-10,marginLeft:-5}}),s.jsx(z,{style:{...X.text,fontWeight:500,marginLeft:5,marginRight:5},children:"Back"})]})}function LP(e,t){throw new Error(t+": "+JSON.stringify(e.str.slice(e.index,10)))}function oi(e){return e.str[e.index]}function Ua(e){if(e.index>=e.str.length)return null;const t=oi(e);return e.index++,t}function sce(e,t){return oi(e)===t?(Ua(e),!0):!1}function lce(e){const t=oi(e)==="-";t&&Ua(e),/\p{Sc}/u.test(oi(e))&&Ua(e);let n="";for(;oi(e)&&oi(e).match(/[0-9,.]/);){const o=pi().separator===","?".":",";oi(e)===o?Ua(e):n+=Ua(e)}n===""&&LP(e,"Unexpected character");const r=parseFloat(n.replace(pi().separator,"."));return t?-r:r}function uce(e){if(oi(e)==="("){Ua(e);const t=NP(e);return oi(e)!==")"&&LP(e,"Unbalanced parentheses"),Ua(e),t}return lce(e)}function cce(...e){return e.reduce((t,n)=>r=>{let o=t(r);for(;sce(r,n);)o={op:n,left:o,right:t(r)};return o},uce)}const NP=cce("^","/","*","-","+");function dce(e){const t={str:e.replace(/\s/g,""),index:0};return NP(t)}function qr(e){if(typeof e=="number")return e;const{left:t,right:n,op:r}=e;switch(r){case"+":return qr(t)+qr(n);case"-":return qr(t)-qr(n);case"*":return qr(t)*qr(n);case"/":return qr(t)/qr(n);case"^":return Math.pow(qr(t),qr(n));default:throw new Error("Unknown operator: "+r)}}function uw(e,t=null){if(e==="")return t;let n;try{n=qr(dce(e))}catch{return t}return isNaN(n)?t:n}function cw(e,t){return g.useMemo(()=>{function n(r){[e,t].forEach(o=>{typeof o=="function"?o(r):o!=null&&(o.current=r)})}return n},[e,t])}function vp({id:e,inputRef:t,value:n,zeroSign:r="-",onFocus:o,onBlur:i,onChangeValue:a,onUpdate:l,style:u,textStyle:c,focused:f,disabled:d=!1}){const h=Xl(),p=n===0&&r==="-"||n<0,m=h(Math.abs(n||0),"financial"),[x,k]=g.useState(m);g.useEffect(()=>k(m),[m]);const v=g.useRef(),y=g.useRef(null),b=cw(t,y);g.useEffect(()=>{f&&y.current?.focus()},[f]);function w(){_(!p)}function E(B){const O=Math.abs(gr(uw(x)));return B?O*-1:O}function T(B){k(B||""),a?.(B)}function _(B){l?.(E(B))}function M(B){y.current?.contains(B.relatedTarget)||_(p),i?.(B)}return s.jsx(cP,{id:e,inputRef:b,inputMode:"decimal",leftContent:s.jsx(q,{type:"bare",disabled:d,"aria-label":`Make ${p?"positive":"negative"}`,style:{padding:"0 7px"},onPointerUp:w,onPointerDown:B=>B.preventDefault(),ref:v,children:p?s.jsx(Goe,{style:{width:8,height:8,color:"inherit"}}):s.jsx(xs,{style:{width:8,height:8,color:"inherit"}})}),value:x,disabled:d,focused:f,style:{flex:1,alignItems:"stretch",...u},inputStyle:{paddingLeft:0,...c},onKeyUp:B=>{B.key==="Enter"&&_(p)},onChangeValue:T,onBlur:M,onFocus:o})}function $P({defaultValue:e,onChange:t}){const[n,r]=g.useState(e.num1),[o,i]=g.useState(e.num2);return s.jsxs(I,{style:{flexDirection:"row",alignItems:"center"},children:[s.jsx(vp,{value:n,onUpdate:a=>{r(a),t({num1:a,num2:o})},style:{color:S.formInputText}}),s.jsx(I,{style:{margin:"0 5px"},children:"and"}),s.jsx(vp,{value:o,onUpdate:a=>{i(a),t({num1:n,num2:a})},style:{color:S.formInputText}})]})}const fce=40;function Tr({title:e,flush:t,style:n}){return s.jsx(z,{style:{marginBottom:5,marginTop:t?0:25,fontSize:13,color:S.tableRowHeaderText,padding:`0 ${X.mobileEditingPadding}px`,textTransform:"uppercase",userSelect:"none",...n},children:e})}const FP={borderWidth:1,borderColor:S.formInputBorder,marginLeft:8,marginRight:8,height:fce},Kv=g.forwardRef(function({disabled:t,style:n,onUpdate:r,...o},i){return s.jsx(Ke,{inputRef:i,autoCorrect:"false",autoCapitalize:"none",disabled:t,onUpdate:r,style:{...FP,...n,color:t?S.tableTextInactive:S.tableText,backgroundColor:t?S.formInputTextReadOnlySelection:S.tableBackground},...o})});function tc({value:e,children:t,disabled:n,rightContent:r,style:o,textStyle:i,onClick:a,...l}){return s.jsxs(q,{as:I,onClick:n?void 0:a,style:{flexDirection:"row",alignItems:"center",...o,...FP,backgroundColor:S.tableBackground,...n&&{backgroundColor:S.formInputTextReadOnlySelection}},bounce:!1,activeStyle:{opacity:.5,boxShadow:"none"},hoveredStyle:{boxShadow:"none"},...l,children:[t||s.jsx(z,{style:{flex:1,userSelect:"none",...i},children:e}),!n&&r]})}function rC({checked:e,onUpdate:t,style:n,disabled:r=!1}){return s.jsx("input",{disabled:r?!0:void 0,type:"checkbox",checked:e,onChange:o=>t(o.target.checked),className:`${ze([{marginInline:X.mobileEditingPadding,flexShrink:0,appearance:"none",outline:0,border:"1px solid "+S.formInputBorder,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",color:S.checkboxText,backgroundColor:S.tableBackground,":checked":{border:"1px solid "+S.checkboxBorderSelected,backgroundColor:S.checkboxBackgroundSelected,"::after":{display:"block",background:S.checkboxBackgroundSelected+` 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>') 15px 15px`,width:15,height:15,content:" "}}},n])}`})}const hce=g.memo(function({focused:t,style:n,textStyle:r,...o}){const[i,a]=g.useState(!1),[l,u]=g.useState(""),[c,f]=g.useState(0),d=g.useRef(),h=cw(o.inputRef,d),p=Math.abs(o.value);g.useEffect(()=>{t&&d.current?.focus()},[t]),g.useEffect(()=>{a(!1),u(""),f(p)},[p]);const m=()=>pD(l.replace(/[,.]/,pi().separator)),x=E=>{E.key==="Backspace"&&l===""&&a(!0)},k=()=>{const E=m(),T=i?E:c;return f(Math.abs(T)),a(!1),u(""),T},v=E=>{o.onFocus?.(E)},y=E=>{const T=k();o.onUpdate?.(T),o.onBlur?.(E)},b=E=>{a(!0),u(E),o.onChange?.(E)},w=s.jsx("input",{type:"text",ref:h,value:l,inputMode:"decimal",autoCapitalize:"none",onChange:E=>b(E.target.value),onFocus:v,onBlur:y,onKeyUp:x,"data-testid":"amount-input",style:{flex:1,textAlign:"center",position:"absolute"}});return s.jsxs(I,{style:{justifyContent:"center",borderWidth:1,borderColor:S.pillBorderSelected,borderRadius:4,padding:5,backgroundColor:S.tableBackground,...n},children:[s.jsx(I,{style:{overflowY:"auto",overflowX:"hidden"},children:w}),s.jsx(z,{style:r,"data-testid":"amount-fake-input",pointerEvents:"none",children:i?l:Bi(c)})]})}),pce=g.memo(function({value:t,sign:n,zeroSign:r,focused:o,textStyle:i,style:a,focusedStyle:l,buttonProps:u,onFocus:c,onBlur:f,...d}){const[h,p]=g.useState(!0);g.useEffect(()=>{n?p(n==="-"):(t>0||r!=="-"&&t===0)&&p(!1)},[n,t,r]);const m=()=>{p(!h),d.onUpdate?.(x(t,!h))},x=(v,y)=>{const b=Math.abs(v);return y?-b:b},k=v=>{d.onUpdate?.(x(v,h))};return s.jsxs(I,{children:[s.jsx(hce,{...d,value:t,onFocus:c,onBlur:f,onUpdate:k,focused:o,style:{width:80,justifyContent:"center",...a,...l,...!o&&{display:"none"}},textStyle:{fontSize:15,textAlign:"right",...i}}),s.jsxs(I,{children:[!o&&s.jsx(q,{style:{position:"absolute",right:"calc(100% + 5px)",top:"8px"},onClick:m,children:h?"-":"+"}),s.jsx(q,{onClick:c,...u,style:{...u&&u.style,...o&&{display:"none"},":hover":{backgroundColor:"transparent"}},type:"bare",children:s.jsx(I,{style:{borderBottomWidth:1,borderColor:"#e0e0e0",justifyContent:"center",transform:[{translateY:.5}],...a},children:s.jsx(z,{style:{fontSize:15,userSelect:"none",...i},children:Bi(Math.abs(t))})})})]})]})});function In(e,t){return`${t}-${e}`}function oC(e,t,n){const{amount:r}=e;return n?`Transfer ${r>0?"from":"to"} ${n.name}`:t?t.name:""}function iC(e,t){const{date:n,amount:r}=e;return{...e,date:ke(Mo(n),t),amount:Sl(r||0)}}function gce(e,t,n){const{amount:r,date:o,...i}=e,a=$g(n);let l=o;if(a.test(l)){const u=Sn(l,Ng(n),new Date);Oo(u)?l=ca(u):l=null}else{const u=Sn(l,n,new Date);u.getFullYear()>2e3&&Oo(u)?l=ca(u):l=null}return l==null&&(l=t&&t.date||Qn()),{...i,date:l,amount:gr(r||0)}}function mce(e,t){return t?e.find(n=>n.id===t)?.name:null}function iwe({status:e}){let t;switch(e){case"missed":t=S.errorText;break;case"due":t=S.warningText;break;case"upcoming":t=S.tableHeaderText;break}return s.jsx(z,{style:{fontSize:11,color:t,fontStyle:"italic",textAlign:"left"},children:cD(e)})}function yce({transactions:e,adding:t,onAdd:n,onSave:r,onSplit:o,onAddSplit:i,onEmptySplitFound:a,editingField:l}){const[u,...c]=e,f=()=>{if(c.length===0)o(u.id);else{const d=c.find(h=>h.amount===0);d?a?.(d.id):i(u.id)}};return s.jsx(I,{style:{paddingLeft:X.mobileEditingPadding,paddingRight:X.mobileEditingPadding,paddingTop:10,paddingBottom:10,backgroundColor:S.tableHeaderBackground,borderTopWidth:1,borderColor:S.tableBorder},children:u.error?.type==="SplitTransactionError"?s.jsxs(q,{type:"primary",style:{height:40},disabled:l,onClick:f,onPointerDown:d=>d.preventDefault(),children:[s.jsx(sb,{width:17,height:17}),s.jsxs(z,{style:{...X.text,marginLeft:6},children:["Amount left:"," ",_n(u.amount>0?u.error.difference:-u.error.difference)]})]}):t?s.jsxs(q,{type:"primary",style:{height:40},disabled:l,onClick:n,onPointerDown:d=>d.preventDefault(),children:[s.jsx(xs,{width:17,height:17}),s.jsx(z,{style:{...X.text,marginLeft:5},children:"Add transaction"})]}):s.jsxs(q,{type:"primary",style:{height:40},disabled:l,onClick:r,onPointerDown:d=>d.preventDefault(),children:[s.jsx(rle,{width:16,height:16}),s.jsx(z,{style:{...X.text,marginLeft:6},children:"Save changes"})]})})}const HP=g.forwardRef(({transaction:e,amountSign:t,getCategory:n,getPrettyPayee:r,isOffBudget:o,isBudgetTransfer:i,onClick:a,onEdit:l,onDelete:u},c)=>{const{editingField:f,onRequestActiveEdit:d,onClearActiveEdit:h}=BP();return s.jsxs(I,{innerRef:c,style:{backgroundColor:S.tableBackground,borderColor:e.amount===0?S.tableBorderSelected:S.tableBorder,borderWidth:"1px",borderRadius:"5px",padding:"5px",margin:"10px"},children:[s.jsxs(I,{style:{flexDirection:"row"},children:[s.jsxs(I,{style:{flexBasis:"75%"},children:[s.jsx(Tr,{title:"Payee"}),s.jsx(tc,{disabled:f&&f!==In(e.id,"payee"),value:r(e),onClick:()=>a(e.id,"payee"),"data-testid":`payee-field-${e.id}`})]}),s.jsxs(I,{style:{flexBasis:"25%"},children:[s.jsx(Tr,{title:"Amount",style:{padding:0}}),s.jsx(vp,{disabled:f&&f!==In(e.id,"amount"),focused:e.amount===0,value:gr(e.amount),zeroSign:t,style:{marginRight:8},textStyle:{...X.smallText,textAlign:"right"},onFocus:()=>d(In(e.id,"amount")),onUpdate:p=>{const m=Sl(p);e.amount!==m?l(e,"amount",m):h()}})]})]}),s.jsxs(I,{children:[s.jsx(Tr,{title:"Category"}),s.jsx(tc,{style:{...(o||i(e))&&{fontStyle:"italic",color:S.pageTextSubdued,fontWeight:300}},value:n(e,o),disabled:f&&f!==In(e.id,"category")||o||i(e),onClick:()=>a(e.id,"category"),"data-testid":`category-field-${e.id}`})]}),s.jsxs(I,{children:[s.jsx(Tr,{title:"Notes"}),s.jsx(Kv,{disabled:f&&f!==In(e.id,"notes"),defaultValue:e.notes,onFocus:()=>d(In(e.id,"notes")),onUpdate:p=>l(e,"notes",p)})]}),s.jsx(I,{style:{alignItems:"center"},children:s.jsxs(q,{onClick:()=>u(e.id),onPointerDown:p=>p.preventDefault(),style:{height:40,borderWidth:0,marginLeft:X.mobileEditingPadding,marginRight:X.mobileEditingPadding,marginTop:10,backgroundColor:"transparent"},type:"bare",children:[s.jsx(Bg,{width:17,height:17,style:{color:S.errorText}}),s.jsx(z,{style:{color:S.errorText,marginLeft:5,userSelect:"none"},children:"Delete split"})]})})]})});HP.displayName="ChildTransactionEdit";const vce=g.memo(function({adding:t,accounts:n,categories:r,payees:o,dateFormat:i,transactions:a,navigate:l,...u}){const c=Ft(),f=g.useMemo(()=>a.map(V=>iC(V,i))||[],[a,i]),[d,...h]=f,{editingField:p,onRequestActiveEdit:m,onClearActiveEdit:x}=BP(),[k,v]=g.useState(!1),y=g.useRef({}),b=g.useMemo(()=>Ec(o),[o]),w=g.useMemo(()=>Ec(n),[n]),E=()=>{m?.(In(d.id,"amount"),()=>(v(!0),()=>v(!1)))};g.useEffect(()=>{t&&E()},[]);const T=V=>V?.account&&w?.[V.account],_=V=>V?.payee&&b?.[V.payee],M=V=>{const Q=V&&_(V);return Q?.transfer_acct&&w?.[Q.transfer_acct]},B=V=>{const Q=V&&_(V),ce=V&&M(V);return oC(V,Q,ce)},O=V=>{const Q=V&&M(V);return Q&&!Q.offbudget},N=(V,Q)=>Q?"Off Budget":O(V)?"Transfer":mce(r,V.category),H=V=>{d.amount!==V?R(d,"amount",V.toString()):x()},F=async()=>{const[V]=a,Q=async()=>{const{account:ce}=V,He=w[ce];if(a.find(me=>me.account==null))return;let Re=a;t&&(Re=nce(a)),u.onSave(Re),l(`/accounts/${He.id}`,{replace:!0})};V.reconciled?c(dr("confirm-transaction-edit",{onConfirm:Q,confirmReason:"editReconciled"})):Q()},L=()=>{F()},R=async(V,Q,ce)=>{const He={...V,[Q]:ce};await u.onEdit(He),x()},U=(V,Q)=>{m?.(In(d.id,"payee"),()=>{c(dr("edit-field",{name:Q,onSubmit:(ce,He)=>{const Re=a.find(me=>me.id===V);R(iC(Re,i),ce,He)},onClose:()=>{x()}}))})},P=V=>{const[Q,...ce]=a,He=()=>{if(u.onDelete(V),Q.id!==V){x();return}const{account:Re}=Q;Re?l(`/accounts/${Re}`,{replace:!0}):l(-1)};Q.reconciled?c(dr("confirm-transaction-edit",{onConfirm:He,confirmReason:"deleteReconciled"})):He()},j=V=>{y.current?.[V]?.scrollIntoView({behavior:"smooth"})},D=V=>{u.onAddSplit(V)},C=V=>{u.onSplit(V)},$=V=>{j(V)};g.useEffect(()=>{const V=h.find(Q=>Q.amount===0);V&&j(V.id)},[h]);const W=d.amount<=0?"-":"+",A=T(d),J=A&&!!A.offbudget,le=oC(d,_(d),M(d)),ee=Sn(d.date,i,new Date),ie=ca(ee);return s.jsx(zg,{title:d.payee==null?t?"New Transaction":"Transaction":le,titleStyle:{fontSize:16,fontWeight:500},style:{flex:1,backgroundColor:S.mobilePageBackground},headerLeftContent:s.jsx(ace,{}),footer:s.jsx(yce,{transactions:f,adding:t,onAdd:L,onSave:F,onSplit:C,onAddSplit:D,onEmptySplitFound:$,editingField:p}),padding:0,children:s.jsxs(I,{style:{flexShrink:0,marginTop:20,marginBottom:20},children:[s.jsxs(I,{style:{alignItems:"center"},children:[s.jsx(Tr,{title:"Amount",flush:!0,style:{marginBottom:0}}),s.jsx(pce,{value:d.amount,zeroSign:"-",focused:k,onFocus:E,onUpdate:H,focusedStyle:{width:"auto",padding:"5px",paddingLeft:"20px",paddingRight:"20px",minWidth:120,transform:[{translateY:-.5}]},textStyle:{fontSize:30,textAlign:"center"}})]}),s.jsxs(I,{children:[s.jsx(Tr,{title:"Payee"}),s.jsx(tc,{disabled:p&&p!==In(d.id,"payee"),value:B(d),onClick:()=>U(d.id,"payee"),"data-testid":"payee-field"})]}),!d.is_parent&&s.jsxs(I,{children:[s.jsx(Tr,{title:"Category"}),s.jsx(tc,{style:{...(J||O(d))&&{fontStyle:"italic",color:S.pageTextSubdued,fontWeight:300}},value:N(d,J),disabled:p&&p!==In(d.id,"category")||J||O(d),onClick:()=>U(d.id,"category"),"data-testid":"category-field"})]}),h.map(V=>s.jsx(HP,{transaction:V,amountSign:W,ref:Q=>{y.current={...y.current,[V.id]:Q}},isOffBudget:J,getCategory:N,getPrettyPayee:B,isBudgetTransfer:O,onEdit:R,onClick:U,onDelete:P},V.id)),d.amount!==0&&h.length===0&&s.jsx(I,{style:{alignItems:"center"},children:s.jsxs(q,{disabled:p,style:{height:40,borderWidth:0,marginLeft:X.mobileEditingPadding,marginRight:X.mobileEditingPadding,marginTop:10,backgroundColor:"transparent"},onClick:()=>C(d.id),type:"bare",children:[s.jsx(sb,{width:17,height:17,style:{color:S.formLabelText}}),s.jsx(z,{style:{marginLeft:5,userSelect:"none",color:S.formLabelText},children:"Split"})]})}),s.jsxs(I,{children:[s.jsx(Tr,{title:"Account"}),s.jsx(tc,{disabled:!t||p&&p!==In(d.id,"account"),value:A?.name,onClick:()=>U(d.id,"account"),"data-testid":"account-field"})]}),s.jsxs(I,{style:{flexDirection:"row"},children:[s.jsxs(I,{style:{flex:1},children:[s.jsx(Tr,{title:"Date"}),s.jsx(Kv,{type:"date",disabled:p&&p!==In(d.id,"date"),required:!0,style:{color:S.tableText,minWidth:"150px"},defaultValue:ie,onFocus:()=>m(In(d.id,"date")),onUpdate:V=>R(d,"date",ke(Mo(V),i))})]}),d.reconciled?s.jsxs(I,{style:{marginLeft:0,marginRight:8},children:[s.jsx(Tr,{title:"Reconciled"}),s.jsx(rC,{disabled:!0,checked:!0,style:{margin:"auto",width:22,height:22}})]}):s.jsxs(I,{style:{marginLeft:0,marginRight:8},children:[s.jsx(Tr,{title:"Cleared"}),s.jsx(rC,{disabled:p,checked:d.cleared,onUpdate:V=>R(d,"cleared",V),style:{margin:"auto",width:22,height:22}})]})]}),s.jsxs(I,{children:[s.jsx(Tr,{title:"Notes"}),s.jsx(Kv,{disabled:p&&p!==In(d.id,"notes"),defaultValue:d.notes,onFocus:()=>{m(In(d.id,"notes"))},onUpdate:V=>R(d,"notes",V)})]}),!t&&s.jsx(I,{style:{alignItems:"center"},children:s.jsxs(q,{onClick:()=>P(d.id),style:{height:40,borderWidth:0,marginLeft:X.mobileEditingPadding,marginRight:X.mobileEditingPadding,marginTop:10,backgroundColor:"transparent"},type:"bare",children:[s.jsx(Bg,{width:17,height:17,style:{color:S.errorText}}),s.jsx(z,{style:{color:S.errorText,marginLeft:5,userSelect:"none"},children:"Delete transaction"})]})})]})})});function xce(e){return e.id.indexOf("temp")===0}function bce(e,t){return[{id:"temp",date:t||Qn(),account:e,amount:0,cleared:!1}]}function wce(e){const{categories:t,accounts:n,payees:r,lastTransaction:o,dateFormat:i}=e,{id:a,transactionId:l}=NO(),u=Hn(),c=Ft(),[f,d]=g.useState([]),[h,p]=g.useState([]),m=g.useRef(!1),x=g.useRef(!1);if(lw(S.mobileViewTheme),g.useEffect(()=>{async function E(){const{data:T}=await ar(pt("transactions").filter({id:l}).select("*").options({splits:"grouped"})),_=PP(T);d(_),p(_)}l?E():m.current=!0},[l]),g.useEffect(()=>{m.current&&d(bce(a||o?.account||null,o?.date))},[a,o]),t.length===0||n.length===0||f.length===0)return null;const k=async E=>{const T=gce(E,null,i);if(xce(T)){const M=await Y("rules-run",{transaction:T}),B=uD(T,M);B&&Object.keys(B).forEach(O=>{T[O]==null&&(T[O]=B[O])})}const{data:_}=Jue(f,T);d(_)},v=async E=>{if(x.current)return;const T=H0(h||[],E);(T.added.length>0||T.updated.length>0||T.deleted.length)&&await Y("transactions-batch-update",{added:T.added,deleted:T.deleted,updated:T.updated}),m.current&&c(nD(E[0]))},y=async E=>{const T=ece(f,E);m.current?x.current=!0:await Y("transactions-batch-update",{deleted:T.diff.deleted}),d(T.data)},b=E=>{const T=Zue(f,E);d(T.data)},w=E=>{const T=tce(f,E);d(T.data)};return s.jsx(I,{style:{flex:1,backgroundColor:S.pageBackground},children:s.jsx(vce,{transactions:f,adding:m.current,categories:t,accounts:n,payees:r,navigate:u,dateFormat:i,onEdit:k,onSave:v,onDelete:y,onSplit:w,onAddSplit:b})})}const yy=e=>{const{list:t}=Fr(),n=Hr(),r=Te(a=>a.queries.lastTransaction),o=mn(),i=nr()||"MM/dd/yyyy";return s.jsx(ice,{formName:"mobile-transaction",children:s.jsx(wce,{...e,categories:t,payees:n,lastTransaction:r,accounts:o,dateFormat:i})})},Vg=g.createContext({url:null,version:"",setURL:()=>Promise.reject(new Error("ServerContext not initialized"))}),Zl=()=>g.useContext(Vg).url,zP=()=>g.useContext(Vg).version,UP=()=>g.useContext(Vg).setURL;async function aC(){const e=await Y("get-server-version");return"version"in e?e.version:""}function Sce({children:e}){const[t,n]=g.useState(""),[r,o]=g.useState("");g.useEffect(()=>{async function a(){n(await Y("get-server-url")),o(await aC())}a()},[]);const i=g.useCallback(async(a,l={})=>{const{error:u}=await Y("set-server-url",{...l,url:a});return u||(n(await Y("get-server-url")),o(await aC())),{error:u}},[n]);return s.jsx(Vg.Provider,{value:{url:t,setURL:i,version:r?`v${r}`:"N/A"},children:e})}function dw(){const e=Zl(),t=Te(n=>n.user.data);return e?!t||t.offline?"offline":"online":"no-server"}const sC=["http","https","mailto","tel"];function kce(e){const t=(e||"").trim(),n=t.charAt(0);if(n==="#"||n==="/")return t;const r=t.indexOf(":");if(r===-1)return t;let o=-1;for(;++o<sC.length;){const i=sC[o];if(r===i.length&&t.slice(0,i.length).toLowerCase()===i)return t}return o=t.indexOf("?"),o!==-1&&r>o||(o=t.indexOf("#"),o!==-1&&r>o)?t:"javascript:void(0)"}/*!
|
|
116
|
+
* Determine if an object is a Buffer
|
|
117
|
+
*
|
|
118
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
119
|
+
* @license MIT
|
|
120
|
+
*/var Tce=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)};const WP=mr(Tce);function nc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?lC(e.position):"start"in e||"end"in e?lC(e):"line"in e||"column"in e?Qv(e):""}function Qv(e){return uC(e&&e.line)+":"+uC(e&&e.column)}function lC(e){return Qv(e&&e.start)+"-"+Qv(e&&e.end)}function uC(e){return e&&typeof e=="number"?e:1}class zr extends Error{constructor(t,n,r){const o=[null,null];let i={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const a=r.indexOf(":");a===-1?o[1]=r:(o[0]=r.slice(0,a),o[1]=r.slice(a+1))}n&&("type"in n||"position"in n?n.position&&(i=n.position):"start"in n||"end"in n?i=n:("line"in n||"column"in n)&&(i.start=n)),this.name=nc(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=i.start.line,this.column=i.start.column,this.position=i,this.source=o[0],this.ruleId=o[1],this.file,this.actual,this.expected,this.url,this.note}}zr.prototype.file="";zr.prototype.name="";zr.prototype.reason="";zr.prototype.message="";zr.prototype.stack="";zr.prototype.fatal=null;zr.prototype.column=null;zr.prototype.line=null;zr.prototype.source=null;zr.prototype.ruleId=null;zr.prototype.position=null;const To={basename:Cce,dirname:Ece,extname:jce,join:Ice,sep:"/"};function Cce(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Bd(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.charCodeAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,l=t.length-1;for(;o--;)if(e.charCodeAt(o)===47){if(i){n=o+1;break}}else a<0&&(i=!0,a=o+1),l>-1&&(e.charCodeAt(o)===t.charCodeAt(l--)?l<0&&(r=o):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function Ece(e){if(Bd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function jce(e){Bd(e);let t=e.length,n=-1,r=0,o=-1,i=0,a;for(;t--;){const l=e.charCodeAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function Ice(...e){let t=-1,n;for(;++t<e.length;)Bd(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Dce(n)}function Dce(e){Bd(e);const t=e.charCodeAt(0)===47;let n=_ce(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _ce(e,t){let n="",r=0,o=-1,i=0,a=-1,l,u;for(;++a<=e.length;){if(a<e.length)l=e.charCodeAt(a);else{if(l===47)break;l=47}if(l===47){if(!(o===a-1||i===1))if(o!==a-1&&i===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),o=a,i=0;continue}}else if(n.length>0){n="",r=0,o=a,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),r=a-o-1;o=a,i=0}else l===46&&i>-1?i++:i=-1}return n}function Bd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Oce={cwd:Ace};function Ace(){return"/"}function Xv(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function Pce(e){if(typeof e=="string")e=new URL(e);else if(!Xv(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Mce(e)}function Mce(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.charCodeAt(n)===37&&t.charCodeAt(n+1)===50){const r=t.charCodeAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const vy=["history","path","basename","stem","extname","dirname"];class VP{constructor(t){let n;t?typeof t=="string"||Rce(t)?n={value:t}:Xv(t)?n={path:t}:n=t:n={},this.data={},this.messages=[],this.history=[],this.cwd=Oce.cwd(),this.value,this.stored,this.result,this.map;let r=-1;for(;++r<vy.length;){const i=vy[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)vy.includes(o)||(this[o]=n[o])}get path(){return this.history[this.history.length-1]}set path(t){Xv(t)&&(t=Pce(t)),by(t,"path"),this.path!==t&&this.history.push(t)}get dirname(){return typeof this.path=="string"?To.dirname(this.path):void 0}set dirname(t){cC(this.basename,"dirname"),this.path=To.join(t||"",this.basename)}get basename(){return typeof this.path=="string"?To.basename(this.path):void 0}set basename(t){by(t,"basename"),xy(t,"basename"),this.path=To.join(this.dirname||"",t)}get extname(){return typeof this.path=="string"?To.extname(this.path):void 0}set extname(t){if(xy(t,"extname"),cC(this.dirname,"extname"),t){if(t.charCodeAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=To.join(this.dirname,this.stem+(t||""))}get stem(){return typeof this.path=="string"?To.basename(this.path,this.extname):void 0}set stem(t){by(t,"stem"),xy(t,"stem"),this.path=To.join(this.dirname||"",t+(this.extname||""))}toString(t){return(this.value||"").toString(t||void 0)}message(t,n,r){const o=new zr(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=null,o}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}}function xy(e,t){if(e&&e.includes(To.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+To.sep+"`")}function by(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function cC(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Rce(e){return WP(e)}function dC(e){if(e)throw e}var ih=Object.prototype.hasOwnProperty,YP=Object.prototype.toString,fC=Object.defineProperty,hC=Object.getOwnPropertyDescriptor,pC=function(t){return typeof Array.isArray=="function"?Array.isArray(t):YP.call(t)==="[object Array]"},gC=function(t){if(!t||YP.call(t)!=="[object Object]")return!1;var n=ih.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&ih.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||ih.call(t,o)},mC=function(t,n){fC&&n.name==="__proto__"?fC(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},yC=function(t,n){if(n==="__proto__")if(ih.call(t,n)){if(hC)return hC(t,n).value}else return;return t[n]},Bce=function e(){var t,n,r,o,i,a,l=arguments[0],u=1,c=arguments.length,f=!1;for(typeof l=="boolean"&&(f=l,l=arguments[1]||{},u=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)r=yC(l,n),o=yC(t,n),l!==o&&(f&&o&&(gC(o)||(i=pC(o)))?(i?(i=!1,a=r&&pC(r)?r:[]):a=r&&gC(r)?r:{},mC(l,{name:n,newValue:e(f,a,o)})):typeof o<"u"&&mC(l,{name:n,newValue:o}));return l};const vC=mr(Bce);function Zv(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Lce(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const a=o.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);l(null,...o);function l(u,...c){const f=e[++i];let d=-1;if(u){a(u);return}for(;++d<o.length;)(c[d]===null||c[d]===void 0)&&(c[d]=o[d]);o=c,f?Nce(f,l)(...c):a(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function Nce(e,t){let n;return r;function r(...a){const l=e.length>a.length;let u;l&&a.push(o);try{u=e.apply(this,a)}catch(c){const f=c;if(l&&n)throw f;return o(f)}l||(u instanceof Promise?u.then(i,o):u instanceof Error?o(u):i(u))}function o(a,...l){n||(n=!0,t(a,...l))}function i(a){o(null,a)}}const $ce=GP().freeze(),qP={}.hasOwnProperty;function GP(){const e=Lce(),t=[];let n={},r,o=-1;return i.data=a,i.Parser=void 0,i.Compiler=void 0,i.freeze=l,i.attachers=t,i.use=u,i.parse=c,i.stringify=f,i.run=d,i.runSync=h,i.process=p,i.processSync=m,i;function i(){const x=GP();let k=-1;for(;++k<t.length;)x.use(...t[k]);return x.data(vC(!0,{},n)),x}function a(x,k){return typeof x=="string"?arguments.length===2?(ky("data",r),n[x]=k,i):qP.call(n,x)&&n[x]||null:x?(ky("data",r),n=x,i):n}function l(){if(r)return i;for(;++o<t.length;){const[x,...k]=t[o];if(k[0]===!1)continue;k[0]===!0&&(k[0]=void 0);const v=x.call(i,...k);typeof v=="function"&&e.use(v)}return r=!0,o=Number.POSITIVE_INFINITY,i}function u(x,...k){let v;if(ky("use",r),x!=null)if(typeof x=="function")E(x,...k);else if(typeof x=="object")Array.isArray(x)?w(x):b(x);else throw new TypeError("Expected usable value, not `"+x+"`");return v&&(n.settings=Object.assign(n.settings||{},v)),i;function y(T){if(typeof T=="function")E(T);else if(typeof T=="object")if(Array.isArray(T)){const[_,...M]=T;E(_,...M)}else b(T);else throw new TypeError("Expected usable value, not `"+T+"`")}function b(T){w(T.plugins),T.settings&&(v=Object.assign(v||{},T.settings))}function w(T){let _=-1;if(T!=null)if(Array.isArray(T))for(;++_<T.length;){const M=T[_];y(M)}else throw new TypeError("Expected a list of plugins, not `"+T+"`")}function E(T,_){let M=-1,B;for(;++M<t.length;)if(t[M][0]===T){B=t[M];break}B?(Zv(B[1])&&Zv(_)&&(_=vC(!0,B[1],_)),B[1]=_):t.push([...arguments])}}function c(x){i.freeze();const k=wu(x),v=i.Parser;return wy("parse",v),xC(v,"parse")?new v(String(k),k).parse():v(String(k),k)}function f(x,k){i.freeze();const v=wu(k),y=i.Compiler;return Sy("stringify",y),bC(x),xC(y,"compile")?new y(x,v).compile():y(x,v)}function d(x,k,v){if(bC(x),i.freeze(),!v&&typeof k=="function"&&(v=k,k=void 0),!v)return new Promise(y);y(null,v);function y(b,w){e.run(x,wu(k),E);function E(T,_,M){_=_||x,T?w(T):b?b(_):v(null,_,M)}}}function h(x,k){let v,y;return i.run(x,k,b),wC("runSync","run",y),v;function b(w,E){dC(w),v=E,y=!0}}function p(x,k){if(i.freeze(),wy("process",i.Parser),Sy("process",i.Compiler),!k)return new Promise(v);v(null,k);function v(y,b){const w=wu(x);i.run(i.parse(w),w,(T,_,M)=>{if(T||!_||!M)E(T);else{const B=i.stringify(_,M);B==null||(zce(B)?M.value=B:M.result=B),E(T,M)}});function E(T,_){T||!_?b(T):y?y(_):k(null,_)}}}function m(x){let k;i.freeze(),wy("processSync",i.Parser),Sy("processSync",i.Compiler);const v=wu(x);return i.process(v,y),wC("processSync","process",k),v;function y(b){k=!0,dC(b)}}}function xC(e,t){return typeof e=="function"&&e.prototype&&(Fce(e.prototype)||t in e.prototype)}function Fce(e){let t;for(t in e)if(qP.call(e,t))return!0;return!1}function wy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function Sy(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function ky(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function bC(e){if(!Zv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function wC(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function wu(e){return Hce(e)?e:new VP(e)}function Hce(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function zce(e){return typeof e=="string"||WP(e)}const Uce={};function Wce(e,t){const n=t||Uce,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return KP(e,r,o)}function KP(e,t,n){if(Vce(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return SC(e.children,t,n)}return Array.isArray(e)?SC(e,t,n):""}function SC(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=KP(e[o],t,n);return r.join("")}function Vce(e){return!!(e&&typeof e=="object")}function hr(e,t,n,r){const o=e.length;let i=0,a;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function Or(e,t){return e.length>0?(hr(e,e.length,0,t),e):t}const kC={}.hasOwnProperty;function QP(e){const t={};let n=-1;for(;++n<e.length;)Yce(t,e[n]);return t}function Yce(e,t){let n;for(n in t){const o=(kC.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let a;if(i)for(a in i){kC.call(o,a)||(o[a]=[]);const l=i[a];qce(o[a],Array.isArray(l)?l:l?[l]:[])}}}function qce(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);hr(e,0,0,r)}const Gce=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,Dn=Sa(/[A-Za-z]/),Tn=Sa(/[\dA-Za-z]/),Kce=Sa(/[#-'*+\--9=?A-Z^-~]/);function xp(e){return e!==null&&(e<32||e===127)}const Jv=Sa(/\d/),Qce=Sa(/[\dA-Fa-f]/),Xce=Sa(/[!-/:-@[-`{-~]/);function fe(e){return e!==null&&e<-2}function tt(e){return e!==null&&(e<0||e===32)}function je(e){return e===-2||e===-1||e===32}const Yg=Sa(Gce),as=Sa(/\s/);function Sa(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function Me(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(u){return je(u)?(e.enter(n),l(u)):t(u)}function l(u){return je(u)&&i++<o?(e.consume(u),l):(e.exit(n),t(u))}}const Zce={tokenize:Jce};function Jce(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Me(e,t,"linePrefix")}function o(l){return e.enter("paragraph"),i(l)}function i(l){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(l)}function a(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return fe(l)?(e.consume(l),e.exit("chunkText"),i):(e.consume(l),a)}}const ede={tokenize:tde},TC={tokenize:nde};function tde(e){const t=this,n=[];let r=0,o,i,a;return l;function l(b){if(r<n.length){const w=n[r];return t.containerState=w[1],e.attempt(w[0].continuation,u,c)(b)}return c(b)}function u(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&y();const w=t.events.length;let E=w,T;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){T=t.events[E][1].end;break}v(r);let _=w;for(;_<t.events.length;)t.events[_][1].end=Object.assign({},T),_++;return hr(t.events,E+1,0,t.events.slice(w)),t.events.length=_,c(b)}return l(b)}function c(b){if(r===n.length){if(!o)return h(b);if(o.currentConstruct&&o.currentConstruct.concrete)return m(b);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(TC,f,d)(b)}function f(b){return o&&y(),v(r),h(b)}function d(b){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,m(b)}function h(b){return t.containerState={},e.attempt(TC,p,m)(b)}function p(b){return r++,n.push([t.currentConstruct,t.containerState]),h(b)}function m(b){if(b===null){o&&y(),v(0),e.consume(b);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:o}),x(b)}function x(b){if(b===null){k(e.exit("chunkFlow"),!0),v(0),e.consume(b);return}return fe(b)?(e.consume(b),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(b),x)}function k(b,w){const E=t.sliceStream(b);if(w&&E.push(null),b.previous=i,i&&(i.next=b),i=b,o.defineSkip(b.start),o.write(E),t.parser.lazy[b.start.line]){let T=o.events.length;for(;T--;)if(o.events[T][1].start.offset<a&&(!o.events[T][1].end||o.events[T][1].end.offset>a))return;const _=t.events.length;let M=_,B,O;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(B){O=t.events[M][1].end;break}B=!0}for(v(r),T=_;T<t.events.length;)t.events[T][1].end=Object.assign({},O),T++;hr(t.events,M+1,0,t.events.slice(_)),t.events.length=T}}function v(b){let w=n.length;for(;w-- >b;){const E=n[w];t.containerState=E[1],E[0].exit.call(t,e)}n.length=b}function y(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function nde(e,t,n){return Me(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bp(e){if(e===null||tt(e)||as(e))return 1;if(Yg(e))return 2}function qg(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const ex={name:"attention",tokenize:ode,resolveAll:rde};function rde(e,t){let n=-1,r,o,i,a,l,u,c,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);CC(d,-u),CC(h,u),a={type:u>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},l={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},i={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o={type:u>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},l.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},l.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Or(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Or(c,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",i,t]]),c=Or(c,qg(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Or(c,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,c=Or(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,hr(e,r-1,n-r+3,c),n=r+c.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function ode(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=bp(r);let i;return a;function a(u){return i=u,e.enter("attentionSequence"),l(u)}function l(u){if(u===i)return e.consume(u),l;const c=e.exit("attentionSequence"),f=bp(u),d=!f||f===2&&o||n.includes(u),h=!o||o===2&&f||n.includes(r);return c._open=!!(i===42?d:d&&(o||!h)),c._close=!!(i===42?h:h&&(f||!d)),t(u)}}function CC(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ide={name:"autolink",tokenize:ade};function ade(e,t,n){let r=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return Dn(p)?(e.consume(p),a):c(p)}function a(p){return p===43||p===45||p===46||Tn(p)?(r=1,l(p)):c(p)}function l(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||Tn(p))&&r++<32?(e.consume(p),l):(r=0,c(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||xp(p)?n(p):(e.consume(p),u)}function c(p){return p===64?(e.consume(p),f):Kce(p)?(e.consume(p),c):n(p)}function f(p){return Tn(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||Tn(p))&&r++<63){const m=p===45?h:d;return e.consume(p),m}return n(p)}}const Ld={tokenize:sde,partial:!0};function sde(e,t,n){return r;function r(i){return je(i)?Me(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||fe(i)?t(i):n(i)}}const XP={name:"blockQuote",tokenize:lde,continuation:{tokenize:ude},exit:cde};function lde(e,t,n){const r=this;return o;function o(a){if(a===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return n(a)}function i(a){return je(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function ude(e,t,n){const r=this;return o;function o(a){return je(a)?Me(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt(XP,t,n)(a)}}function cde(e){e.exit("blockQuote")}const ZP={name:"characterEscape",tokenize:dde};function dde(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return Xce(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const EC=document.createElement("i");function fw(e){const t="&"+e+";";EC.innerHTML=t;const n=EC.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}const JP={name:"characterReference",tokenize:fde};function fde(e,t,n){const r=this;let o=0,i,a;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,a=Tn,f(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=Qce,f):(e.enter("characterReferenceValue"),i=7,a=Jv,f(d))}function f(d){if(d===59&&o){const h=e.exit("characterReferenceValue");return a===Tn&&!fw(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&o++<i?(e.consume(d),f):n(d)}}const jC={tokenize:pde,partial:!0},IC={name:"codeFenced",tokenize:hde,concrete:!0};function hde(e,t,n){const r=this,o={tokenize:E,partial:!0};let i=0,a=0,l;return u;function u(T){return c(T)}function c(T){const _=r.events[r.events.length-1];return i=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,l=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(T)}function f(T){return T===l?(a++,e.consume(T),f):a<3?n(T):(e.exit("codeFencedFenceSequence"),je(T)?Me(e,d,"whitespace")(T):d(T))}function d(T){return T===null||fe(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(jC,x,w)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===null||fe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(T)):je(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Me(e,p,"whitespace")(T)):T===96&&T===l?n(T):(e.consume(T),h)}function p(T){return T===null||fe(T)?d(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(T))}function m(T){return T===null||fe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(T)):T===96&&T===l?n(T):(e.consume(T),m)}function x(T){return e.attempt(o,w,k)(T)}function k(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),v}function v(T){return i>0&&je(T)?Me(e,y,"linePrefix",i+1)(T):y(T)}function y(T){return T===null||fe(T)?e.check(jC,x,w)(T):(e.enter("codeFlowValue"),b(T))}function b(T){return T===null||fe(T)?(e.exit("codeFlowValue"),y(T)):(e.consume(T),b)}function w(T){return e.exit("codeFenced"),t(T)}function E(T,_,M){let B=0;return O;function O(R){return T.enter("lineEnding"),T.consume(R),T.exit("lineEnding"),N}function N(R){return T.enter("codeFencedFence"),je(R)?Me(T,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):H(R)}function H(R){return R===l?(T.enter("codeFencedFenceSequence"),F(R)):M(R)}function F(R){return R===l?(B++,T.consume(R),F):B>=a?(T.exit("codeFencedFenceSequence"),je(R)?Me(T,L,"whitespace")(R):L(R)):M(R)}function L(R){return R===null||fe(R)?(T.exit("codeFencedFence"),_(R)):M(R)}}}function pde(e,t,n){const r=this;return o;function o(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ty={name:"codeIndented",tokenize:mde},gde={tokenize:yde,partial:!0};function mde(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),Me(e,i,"linePrefix",5)(c)}function i(c){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?u(c):fe(c)?e.attempt(gde,a,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||fe(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function yde(e,t,n){const r=this;return o;function o(a){return r.parser.lazy[r.now().line]?n(a):fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):Me(e,i,"linePrefix",5)(a)}function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):fe(a)?o(a):n(a)}}const vde={name:"codeText",tokenize:wde,resolve:xde,previous:bde};function xde(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function bde(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wde(e,t,n){let r=0,o,i;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),r++,l):(e.exit("codeTextSequence"),u(d))}function u(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),u):d===96?(i=e.enter("codeTextSequence"),o=0,f(d)):fe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||fe(d)?(e.exit("codeTextData"),u(d)):(e.consume(d),c)}function f(d){return d===96?(e.consume(d),o++,f):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}function e5(e){const t={};let n=-1,r,o,i,a,l,u,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,i=0,i<u.length&&u[i][1].type==="lineEndingBlank"&&(i+=2),i<u.length&&u[i][1].type==="content"))for(;++i<u.length&&u[i][1].type!=="content";)u[i][1].type==="chunkText"&&(u[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Sde(e,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--&&(a=e[i],a[1].type==="lineEnding"||a[1].type==="lineEndingBlank");)a[0]==="enter"&&(o&&(e[o][1].type="lineEndingBlank"),a[1].type="lineEnding",o=i);o&&(r[1].end=Object.assign({},e[o][1].start),l=e.slice(o,n),l.unshift(r),hr(e,o,n-o+1,l))}}return!c}function Sde(e,t){const n=e[t][1],r=e[t][2];let o=t-1;const i=[],a=n._tokenizer||r.parser[n.contentType](n.start),l=a.events,u=[],c={};let f,d,h=-1,p=n,m=0,x=0;const k=[x];for(;p;){for(;e[++o][1]!==p;);i.push(o),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),d&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(f),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(x=h+1,k.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):k.pop(),h=k.length;h--;){const v=l.slice(k[h],k[h+1]),y=i.pop();u.unshift([y,y+v.length-1]),hr(e,y,2,v)}for(h=-1;++h<u.length;)c[m+u[h][0]]=m+u[h][1],m+=u[h][1]-u[h][0]-1;return c}const kde={tokenize:Ede,resolve:Cde},Tde={tokenize:jde,partial:!0};function Cde(e){return e5(e),e}function Ede(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(l)}function o(l){return l===null?i(l):fe(l)?e.check(Tde,a,i)(l):(e.consume(l),o)}function i(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function a(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function jde(e,t,n){const r=this;return o;function o(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Me(e,i,"linePrefix")}function i(a){if(a===null||fe(a))return n(a);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function t5(e,t,n,r,o,i,a,l,u){const c=u||Number.POSITIVE_INFINITY;let f=0;return d;function d(v){return v===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(v),e.exit(i),h):v===null||v===32||v===41||xp(v)?n(v):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),x(v))}function h(v){return v===62?(e.enter(i),e.consume(v),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===62?(e.exit("chunkString"),e.exit(l),h(v)):v===null||v===60||fe(v)?n(v):(e.consume(v),v===92?m:p)}function m(v){return v===60||v===62||v===92?(e.consume(v),p):p(v)}function x(v){return!f&&(v===null||v===41||tt(v))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(v)):f<c&&v===40?(e.consume(v),f++,x):v===41?(e.consume(v),f--,x):v===null||v===32||v===40||xp(v)?n(v):(e.consume(v),v===92?k:x)}function k(v){return v===40||v===41||v===92?(e.consume(v),x):x(v)}}function n5(e,t,n,r,o,i){const a=this;let l=0,u;return c;function c(p){return e.enter(r),e.enter(o),e.consume(p),e.exit(o),e.enter(i),f}function f(p){return l>999||p===null||p===91||p===93&&!u||p===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(i),e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):fe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||fe(p)||l++>999?(e.exit("chunkString"),f(p)):(e.consume(p),u||(u=!je(p)),p===92?h:d)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}function r5(e,t,n,r,o,i){let a;return l;function l(h){return h===34||h===39||h===40?(e.enter(r),e.enter(o),e.consume(h),e.exit(o),a=h===40?41:h,u):n(h)}function u(h){return h===a?(e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):(e.enter(i),c(h))}function c(h){return h===a?(e.exit(i),u(a)):h===null?n(h):fe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Me(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===a||h===null||fe(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:f)}function d(h){return h===a||h===92?(e.consume(h),f):f(h)}}function rc(e,t){let n;return r;function r(o){return fe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):je(o)?Me(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}function lo(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ide={name:"definition",tokenize:_de},Dde={tokenize:Ode,partial:!0};function _de(e,t,n){const r=this;let o;return i;function i(p){return e.enter("definition"),a(p)}function a(p){return n5.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return o=lo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return tt(p)?rc(e,c)(p):c(p)}function c(p){return t5(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(Dde,d,d)(p)}function d(p){return je(p)?Me(e,h,"whitespace")(p):h(p)}function h(p){return p===null||fe(p)?(e.exit("definition"),r.parser.defined.push(o),t(p)):n(p)}}function Ode(e,t,n){return r;function r(l){return tt(l)?rc(e,o)(l):n(l)}function o(l){return r5(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return je(l)?Me(e,a,"whitespace")(l):a(l)}function a(l){return l===null||fe(l)?t(l):n(l)}}const Ade={name:"hardBreakEscape",tokenize:Pde};function Pde(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return fe(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const Mde={name:"headingAtx",tokenize:Bde,resolve:Rde};function Rde(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},hr(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function Bde(e,t,n){let r=0;return o;function o(f){return e.enter("atxHeading"),i(f)}function i(f){return e.enter("atxHeadingSequence"),a(f)}function a(f){return f===35&&r++<6?(e.consume(f),a):f===null||tt(f)?(e.exit("atxHeadingSequence"),l(f)):n(f)}function l(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||fe(f)?(e.exit("atxHeading"),t(f)):je(f)?Me(e,l,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),l(f))}function c(f){return f===null||f===35||tt(f)?(e.exit("atxHeadingText"),l(f)):(e.consume(f),c)}}const Lde=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],DC=["pre","script","style","textarea"],Nde={name:"htmlFlow",tokenize:zde,resolveTo:Hde,concrete:!0},$de={tokenize:Wde,partial:!0},Fde={tokenize:Ude,partial:!0};function Hde(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function zde(e,t,n){const r=this;let o,i,a,l,u;return c;function c(A){return f(A)}function f(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),i=!0,x):A===63?(e.consume(A),o=3,r.interrupt?t:C):Dn(A)?(e.consume(A),a=String.fromCharCode(A),k):n(A)}function h(A){return A===45?(e.consume(A),o=2,p):A===91?(e.consume(A),o=5,l=0,m):Dn(A)?(e.consume(A),o=4,r.interrupt?t:C):n(A)}function p(A){return A===45?(e.consume(A),r.interrupt?t:C):n(A)}function m(A){const J="CDATA[";return A===J.charCodeAt(l++)?(e.consume(A),l===J.length?r.interrupt?t:H:m):n(A)}function x(A){return Dn(A)?(e.consume(A),a=String.fromCharCode(A),k):n(A)}function k(A){if(A===null||A===47||A===62||tt(A)){const J=A===47,le=a.toLowerCase();return!J&&!i&&DC.includes(le)?(o=1,r.interrupt?t(A):H(A)):Lde.includes(a.toLowerCase())?(o=6,J?(e.consume(A),v):r.interrupt?t(A):H(A)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):i?y(A):b(A))}return A===45||Tn(A)?(e.consume(A),a+=String.fromCharCode(A),k):n(A)}function v(A){return A===62?(e.consume(A),r.interrupt?t:H):n(A)}function y(A){return je(A)?(e.consume(A),y):O(A)}function b(A){return A===47?(e.consume(A),O):A===58||A===95||Dn(A)?(e.consume(A),w):je(A)?(e.consume(A),b):O(A)}function w(A){return A===45||A===46||A===58||A===95||Tn(A)?(e.consume(A),w):E(A)}function E(A){return A===61?(e.consume(A),T):je(A)?(e.consume(A),E):b(A)}function T(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),u=A,_):je(A)?(e.consume(A),T):M(A)}function _(A){return A===u?(e.consume(A),u=null,B):A===null||fe(A)?n(A):(e.consume(A),_)}function M(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||tt(A)?E(A):(e.consume(A),M)}function B(A){return A===47||A===62||je(A)?b(A):n(A)}function O(A){return A===62?(e.consume(A),N):n(A)}function N(A){return A===null||fe(A)?H(A):je(A)?(e.consume(A),N):n(A)}function H(A){return A===45&&o===2?(e.consume(A),U):A===60&&o===1?(e.consume(A),P):A===62&&o===4?(e.consume(A),$):A===63&&o===3?(e.consume(A),C):A===93&&o===5?(e.consume(A),D):fe(A)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check($de,W,F)(A)):A===null||fe(A)?(e.exit("htmlFlowData"),F(A)):(e.consume(A),H)}function F(A){return e.check(Fde,L,W)(A)}function L(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),R}function R(A){return A===null||fe(A)?F(A):(e.enter("htmlFlowData"),H(A))}function U(A){return A===45?(e.consume(A),C):H(A)}function P(A){return A===47?(e.consume(A),a="",j):H(A)}function j(A){if(A===62){const J=a.toLowerCase();return DC.includes(J)?(e.consume(A),$):H(A)}return Dn(A)&&a.length<8?(e.consume(A),a+=String.fromCharCode(A),j):H(A)}function D(A){return A===93?(e.consume(A),C):H(A)}function C(A){return A===62?(e.consume(A),$):A===45&&o===2?(e.consume(A),C):H(A)}function $(A){return A===null||fe(A)?(e.exit("htmlFlowData"),W(A)):(e.consume(A),$)}function W(A){return e.exit("htmlFlow"),t(A)}}function Ude(e,t,n){const r=this;return o;function o(a){return fe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function Wde(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ld,t,n)}}const Vde={name:"htmlText",tokenize:Yde};function Yde(e,t,n){const r=this;let o,i,a;return l;function l(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),u}function u(C){return C===33?(e.consume(C),c):C===47?(e.consume(C),E):C===63?(e.consume(C),b):Dn(C)?(e.consume(C),M):n(C)}function c(C){return C===45?(e.consume(C),f):C===91?(e.consume(C),i=0,m):Dn(C)?(e.consume(C),y):n(C)}function f(C){return C===45?(e.consume(C),p):n(C)}function d(C){return C===null?n(C):C===45?(e.consume(C),h):fe(C)?(a=d,P(C)):(e.consume(C),d)}function h(C){return C===45?(e.consume(C),p):d(C)}function p(C){return C===62?U(C):C===45?h(C):d(C)}function m(C){const $="CDATA[";return C===$.charCodeAt(i++)?(e.consume(C),i===$.length?x:m):n(C)}function x(C){return C===null?n(C):C===93?(e.consume(C),k):fe(C)?(a=x,P(C)):(e.consume(C),x)}function k(C){return C===93?(e.consume(C),v):x(C)}function v(C){return C===62?U(C):C===93?(e.consume(C),v):x(C)}function y(C){return C===null||C===62?U(C):fe(C)?(a=y,P(C)):(e.consume(C),y)}function b(C){return C===null?n(C):C===63?(e.consume(C),w):fe(C)?(a=b,P(C)):(e.consume(C),b)}function w(C){return C===62?U(C):b(C)}function E(C){return Dn(C)?(e.consume(C),T):n(C)}function T(C){return C===45||Tn(C)?(e.consume(C),T):_(C)}function _(C){return fe(C)?(a=_,P(C)):je(C)?(e.consume(C),_):U(C)}function M(C){return C===45||Tn(C)?(e.consume(C),M):C===47||C===62||tt(C)?B(C):n(C)}function B(C){return C===47?(e.consume(C),U):C===58||C===95||Dn(C)?(e.consume(C),O):fe(C)?(a=B,P(C)):je(C)?(e.consume(C),B):U(C)}function O(C){return C===45||C===46||C===58||C===95||Tn(C)?(e.consume(C),O):N(C)}function N(C){return C===61?(e.consume(C),H):fe(C)?(a=N,P(C)):je(C)?(e.consume(C),N):B(C)}function H(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),o=C,F):fe(C)?(a=H,P(C)):je(C)?(e.consume(C),H):(e.consume(C),L)}function F(C){return C===o?(e.consume(C),o=void 0,R):C===null?n(C):fe(C)?(a=F,P(C)):(e.consume(C),F)}function L(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||tt(C)?B(C):(e.consume(C),L)}function R(C){return C===47||C===62||tt(C)?B(C):n(C)}function U(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function P(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),j}function j(C){return je(C)?Me(e,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):D(C)}function D(C){return e.enter("htmlTextData"),a(C)}}const hw={name:"labelEnd",tokenize:Zde,resolveTo:Xde,resolveAll:Qde},qde={tokenize:Jde},Gde={tokenize:efe},Kde={tokenize:tfe};function Qde(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function Xde(e,t){let n=e.length,r=0,o,i,a,l;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(a=n);const u={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[a][1].end)},f={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[a-2][1].start)};return l=[["enter",u,t],["enter",c,t]],l=Or(l,e.slice(i+1,i+r+3)),l=Or(l,[["enter",f,t]]),l=Or(l,qg(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),l=Or(l,[["exit",f,t],e[a-2],e[a-1],["exit",c,t]]),l=Or(l,e.slice(a+1)),l=Or(l,[["exit",u,t]]),hr(e,i,e.length,l),e}function Zde(e,t,n){const r=this;let o=r.events.length,i,a;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return l;function l(h){return i?i._inactive?d(h):(a=r.parser.defined.includes(lo(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(qde,f,a?f:d)(h):h===91?e.attempt(Gde,f,a?c:d)(h):a?f(h):d(h)}function c(h){return e.attempt(Kde,f,d)(h)}function f(h){return t(h)}function d(h){return i._balanced=!0,n(h)}}function Jde(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),o}function o(d){return tt(d)?rc(e,i)(d):i(d)}function i(d){return d===41?f(d):t5(e,a,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return tt(d)?rc(e,u)(d):f(d)}function l(d){return n(d)}function u(d){return d===34||d===39||d===40?r5(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function c(d){return tt(d)?rc(e,f)(d):f(d)}function f(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function efe(e,t,n){const r=this;return o;function o(l){return n5.call(r,e,i,a,"reference","referenceMarker","referenceString")(l)}function i(l){return r.parser.defined.includes(lo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function a(l){return n(l)}}function tfe(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const nfe={name:"labelStartImage",tokenize:rfe,resolveAll:hw.resolveAll};function rfe(e,t,n){const r=this;return o;function o(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),i}function i(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),a):n(l)}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const ofe={name:"labelStartLink",tokenize:ife,resolveAll:hw.resolveAll};function ife(e,t,n){const r=this;return o;function o(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Cy={name:"lineEnding",tokenize:afe};function afe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Me(e,t,"linePrefix")}}const ah={name:"thematicBreak",tokenize:sfe};function sfe(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),a(c)}function a(c){return o=c,l(c)}function l(c){return c===o?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||fe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===o?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),je(c)?Me(e,l,"whitespace")(c):l(c))}}const Wn={name:"list",tokenize:cfe,continuation:{tokenize:dfe},exit:hfe},lfe={tokenize:pfe,partial:!0},ufe={tokenize:ffe,partial:!0};function cfe(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,a=0;return l;function l(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Jv(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ah,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return Jv(p)&&++a<10?(e.consume(p),u):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ld,r.interrupt?n:f,e.attempt(lfe,h,d))}function f(p){return r.containerState.initialBlankLine=!0,i++,h(p)}function d(p){return je(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function dfe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ld,o,i);function o(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Me(e,t,"listItemIndent",r.containerState.size+1)(l)}function i(l){return r.containerState.furtherBlankLines||!je(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ufe,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Me(e,e.attempt(Wn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function ffe(e,t,n){const r=this;return Me(e,o,"listItemIndent",r.containerState.size+1);function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(i):n(i)}}function hfe(e){e.exit(this.containerState.type)}function pfe(e,t,n){const r=this;return Me(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const a=r.events[r.events.length-1];return!je(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const _C={name:"setextUnderline",tokenize:mfe,resolveTo:gfe};function gfe(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",a,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=a,e.push(["exit",a,t]),e}function mfe(e,t,n){const r=this;let o;return i;function i(c){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),o=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===o?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),je(c)?Me(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||fe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const yfe={tokenize:vfe};function vfe(e){const t=this,n=e.attempt(Ld,r,e.attempt(this.parser.constructs.flowInitial,o,Me(e,e.attempt(this.parser.constructs.flow,o,e.attempt(kde,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const xfe={resolveAll:i5()},bfe=o5("string"),wfe=o5("text");function o5(e){return{tokenize:t,resolveAll:i5(e==="text"?Sfe:void 0)};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,a,l);return a;function a(f){return c(f)?i(f):l(f)}function l(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return c(f)?(n.exit("data"),i(f)):(n.consume(f),u)}function c(f){if(f===null)return!0;const d=o[f];let h=-1;if(d)for(;++h<d.length;){const p=d[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function i5(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function Sfe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,a=-1,l=0,u;for(;i--;){const c=o[i];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)l++,a--;if(a)break;a=-1}else if(c===-2)u=!0,l++;else if(c!==-1){i++;break}}if(l){const c={type:n===e.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-l,offset:r.end.offset-l,_index:r.start._index+i,_bufferIndex:i?a:r.start._bufferIndex+a},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function kfe(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},i=[];let a=[],l=[];const u={consume:y,enter:b,exit:w,attempt:_(E),check:_(T),interrupt:_(T,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:h,now:m,defineSkip:x,write:d};let f=t.tokenize.call(c,u);return t.resolveAll&&i.push(t),c;function d(N){return a=Or(a,N),k(),a[a.length-1]!==null?[]:(M(t,0),c.events=qg(i,c.events,c),c.events)}function h(N,H){return Cfe(p(N),H)}function p(N){return Tfe(a,N)}function m(){const{line:N,column:H,offset:F,_index:L,_bufferIndex:R}=r;return{line:N,column:H,offset:F,_index:L,_bufferIndex:R}}function x(N){o[N.line]=N.column,O()}function k(){let N;for(;r._index<a.length;){const H=a[r._index];if(typeof H=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<H.length;)v(H.charCodeAt(r._bufferIndex));else v(H)}}function v(N){f=f(N)}function y(N){fe(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,O()):N!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=N}function b(N,H){const F=H||{};return F.type=N,F.start=m(),c.events.push(["enter",F,c]),l.push(F),F}function w(N){const H=l.pop();return H.end=m(),c.events.push(["exit",H,c]),H}function E(N,H){M(N,H.from)}function T(N,H){H.restore()}function _(N,H){return F;function F(L,R,U){let P,j,D,C;return Array.isArray(L)?W(L):"tokenize"in L?W([L]):$(L);function $(ee){return ie;function ie(V){const Q=V!==null&&ee[V],ce=V!==null&&ee.null,He=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(ce)?ce:ce?[ce]:[]];return W(He)(V)}}function W(ee){return P=ee,j=0,ee.length===0?U:A(ee[j])}function A(ee){return ie;function ie(V){return C=B(),D=ee,ee.partial||(c.currentConstruct=ee),ee.name&&c.parser.constructs.disable.null.includes(ee.name)?le():ee.tokenize.call(H?Object.assign(Object.create(c),H):c,u,J,le)(V)}}function J(ee){return N(D,C),R}function le(ee){return C.restore(),++j<P.length?A(P[j]):U}}}function M(N,H){N.resolveAll&&!i.includes(N)&&i.push(N),N.resolve&&hr(c.events,H,c.events.length-H,N.resolve(c.events.slice(H),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function B(){const N=m(),H=c.previous,F=c.currentConstruct,L=c.events.length,R=Array.from(l);return{restore:U,from:L};function U(){r=N,c.previous=H,c.currentConstruct=F,c.events.length=L,l=R,O()}}function O(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function Tfe(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let a;if(n===o)a=[e[n].slice(r,i)];else{if(a=e.slice(n,o),r>-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}function Cfe(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
|
|
121
|
+
`;break}case-3:{a=`\r
|
|
122
|
+
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&o)continue;a=" ";break}default:a=String.fromCharCode(i)}o=i===-2,r.push(a)}return r.join("")}const Efe={42:Wn,43:Wn,45:Wn,48:Wn,49:Wn,50:Wn,51:Wn,52:Wn,53:Wn,54:Wn,55:Wn,56:Wn,57:Wn,62:XP},jfe={91:Ide},Ife={[-2]:Ty,[-1]:Ty,32:Ty},Dfe={35:Mde,42:ah,45:[_C,ah],60:Nde,61:_C,95:ah,96:IC,126:IC},_fe={38:JP,92:ZP},Ofe={[-5]:Cy,[-4]:Cy,[-3]:Cy,33:nfe,38:JP,42:ex,60:[ide,Vde],91:ofe,92:[Ade,ZP],93:hw,95:ex,96:vde},Afe={null:[ex,xfe]},Pfe={null:[42,95]},Mfe={null:[]},Rfe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Pfe,contentInitial:jfe,disable:Mfe,document:Efe,flow:Dfe,flowInitial:Ife,insideSpan:Afe,string:_fe,text:Ofe},Symbol.toStringTag,{value:"Module"}));function Bfe(e){const n=QP([Rfe,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(Zce),document:o(ede),flow:o(yfe),string:o(bfe),text:o(wfe)};return r;function o(i){return a;function a(l){return kfe(r,i,l)}}}const OC=/[\0\t\n\r]/g;function Lfe(){let e=1,t="",n=!0,r;return o;function o(i,a,l){const u=[];let c,f,d,h,p;for(i=t+i.toString(a),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(OC.lastIndex=d,c=OC.exec(i),h=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(h),!c){t=i.slice(d);break}if(p===10&&d===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),d<h&&(u.push(i.slice(d,h)),e+=h-d),p){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return l&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}function Nfe(e){for(;!e5(e););return e}function a5(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const $fe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function s5(e){return e.replace($fe,Ffe)}function Ffe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return a5(n.slice(i?2:1),i?16:10)}return fw(n)||e}const l5={}.hasOwnProperty,Hfe=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),zfe(n)(Nfe(Bfe(n).document().write(Lfe()(e,t,!0))))};function zfe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Sr),autolinkProtocol:N,autolinkEmail:N,atxHeading:l(Be),blockQuote:l(He),characterEscape:N,characterReference:N,codeFenced:l(Re),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:l(Re,u),codeText:l(me,u),codeTextData:N,data:N,codeFlowValue:N,definition:l(ft),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:l(qt),hardBreakEscape:l(Ce),hardBreakTrailing:l(Ce),htmlFlow:l(xt,u),htmlFlowData:N,htmlText:l(xt,u),htmlTextData:N,image:l(Ut),label:u,link:l(Sr),listItem:l(kr),listItemValue:m,listOrdered:l(yn,p),listUnordered:l(yn),paragraph:l(Cs),reference:le,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:l(Be),strong:l(Es),thematicBreak:l(nu)},exit:{atxHeading:f(),atxHeadingSequence:_,autolink:f(),autolinkEmail:ce,autolinkProtocol:Q,blockQuote:f(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:V,codeFenced:f(y),codeFencedFence:v,codeFencedFenceInfo:x,codeFencedFenceMeta:k,codeFlowValue:H,codeIndented:f(b),codeText:f(P),codeTextData:H,data:H,definition:f(),definitionDestinationString:T,definitionLabelString:w,definitionTitleString:E,emphasis:f(),hardBreakEscape:f(L),hardBreakTrailing:f(L),htmlFlow:f(R),htmlFlowData:H,htmlText:f(U),htmlTextData:H,image:f(D),label:$,labelText:C,lineEnding:F,link:f(j),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:ee,resourceDestinationString:W,resourceTitleString:A,resource:J,setextHeading:f(O),setextHeadingLineSequence:B,setextHeadingText:M,strong:f(),thematicBreak:f()}};u5(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(K){let oe={type:"root",children:[]};const pe={stack:[oe],tokenStack:[],config:t,enter:c,exit:d,buffer:u,resume:h,setData:i,getData:a},Je=[];let et=-1;for(;++et<K.length;)if(K[et][1].type==="listOrdered"||K[et][1].type==="listUnordered")if(K[et][0]==="enter")Je.push(et);else{const Vr=Je.pop();et=o(K,Vr,et)}for(et=-1;++et<K.length;){const Vr=t[K[et][0]];l5.call(Vr,K[et][1].type)&&Vr[K[et][1].type].call(Object.assign({sliceSerialize:K[et][2].sliceSerialize},pe),K[et][1])}if(pe.tokenStack.length>0){const Vr=pe.tokenStack[pe.tokenStack.length-1];(Vr[1]||AC).call(pe,void 0,Vr[0])}for(oe.position={start:ji(K.length>0?K[0][1].start:{line:1,column:1,offset:0}),end:ji(K.length>0?K[K.length-2][1].end:{line:1,column:1,offset:0})},et=-1;++et<t.transforms.length;)oe=t.transforms[et](oe)||oe;return oe}function o(K,oe,pe){let Je=oe-1,et=-1,Vr=!1,ki,Go,ru,ou;for(;++Je<=pe;){const Mt=K[Je];if(Mt[1].type==="listUnordered"||Mt[1].type==="listOrdered"||Mt[1].type==="blockQuote"?(Mt[0]==="enter"?et++:et--,ou=void 0):Mt[1].type==="lineEndingBlank"?Mt[0]==="enter"&&(ki&&!ou&&!et&&!ru&&(ru=Je),ou=void 0):Mt[1].type==="linePrefix"||Mt[1].type==="listItemValue"||Mt[1].type==="listItemMarker"||Mt[1].type==="listItemPrefix"||Mt[1].type==="listItemPrefixWhitespace"||(ou=void 0),!et&&Mt[0]==="enter"&&Mt[1].type==="listItemPrefix"||et===-1&&Mt[0]==="exit"&&(Mt[1].type==="listUnordered"||Mt[1].type==="listOrdered")){if(ki){let fm=Je;for(Go=void 0;fm--;){const Ko=K[fm];if(Ko[1].type==="lineEnding"||Ko[1].type==="lineEndingBlank"){if(Ko[0]==="exit")continue;Go&&(K[Go][1].type="lineEndingBlank",Vr=!0),Ko[1].type="lineEnding",Go=fm}else if(!(Ko[1].type==="linePrefix"||Ko[1].type==="blockQuotePrefix"||Ko[1].type==="blockQuotePrefixWhitespace"||Ko[1].type==="blockQuoteMarker"||Ko[1].type==="listItemIndent"))break}ru&&(!Go||ru<Go)&&(ki._spread=!0),ki.end=Object.assign({},Go?K[Go][1].start:Mt[1].end),K.splice(Go||Je,0,["exit",ki,Mt[2]]),Je++,pe++}Mt[1].type==="listItemPrefix"&&(ki={type:"listItem",_spread:!1,start:Object.assign({},Mt[1].start),end:void 0},K.splice(Je,0,["enter",ki,Mt[2]]),Je++,pe++,ru=void 0,ou=!0)}}return K[oe][1]._spread=Vr,pe}function i(K,oe){n[K]=oe}function a(K){return n[K]}function l(K,oe){return pe;function pe(Je){c.call(this,K(Je),Je),oe&&oe.call(this,Je)}}function u(){this.stack.push({type:"fragment",children:[]})}function c(K,oe,pe){return this.stack[this.stack.length-1].children.push(K),this.stack.push(K),this.tokenStack.push([oe,pe]),K.position={start:ji(oe.start)},K}function f(K){return oe;function oe(pe){K&&K.call(this,pe),d.call(this,pe)}}function d(K,oe){const pe=this.stack.pop(),Je=this.tokenStack.pop();if(Je)Je[0].type!==K.type&&(oe?oe.call(this,K,Je[0]):(Je[1]||AC).call(this,K,Je[0]));else throw new Error("Cannot close `"+K.type+"` ("+nc({start:K.start,end:K.end})+"): it’s not open");return pe.position.end=ji(K.end),pe}function h(){return Wce(this.stack.pop())}function p(){i("expectingFirstListItemValue",!0)}function m(K){if(a("expectingFirstListItemValue")){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(K),10),i("expectingFirstListItemValue")}}function x(){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=K}function k(){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=K}function v(){a("flowCodeInside")||(this.buffer(),i("flowCodeInside",!0))}function y(){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.value=K.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),i("flowCodeInside")}function b(){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.value=K.replace(/(\r?\n|\r)$/g,"")}function w(K){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.label=oe,pe.identifier=lo(this.sliceSerialize(K)).toLowerCase()}function E(){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.title=K}function T(){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.url=K}function _(K){const oe=this.stack[this.stack.length-1];if(!oe.depth){const pe=this.sliceSerialize(K).length;oe.depth=pe}}function M(){i("setextHeadingSlurpLineEnding",!0)}function B(K){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(K).charCodeAt(0)===61?1:2}function O(){i("setextHeadingSlurpLineEnding")}function N(K){const oe=this.stack[this.stack.length-1];let pe=oe.children[oe.children.length-1];(!pe||pe.type!=="text")&&(pe=Zd(),pe.position={start:ji(K.start)},oe.children.push(pe)),this.stack.push(pe)}function H(K){const oe=this.stack.pop();oe.value+=this.sliceSerialize(K),oe.position.end=ji(K.end)}function F(K){const oe=this.stack[this.stack.length-1];if(a("atHardBreak")){const pe=oe.children[oe.children.length-1];pe.position.end=ji(K.end),i("atHardBreak");return}!a("setextHeadingSlurpLineEnding")&&t.canContainEols.includes(oe.type)&&(N.call(this,K),H.call(this,K))}function L(){i("atHardBreak",!0)}function R(){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.value=K}function U(){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.value=K}function P(){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.value=K}function j(){const K=this.stack[this.stack.length-1];if(a("inReference")){const oe=a("referenceType")||"shortcut";K.type+="Reference",K.referenceType=oe,delete K.url,delete K.title}else delete K.identifier,delete K.label;i("referenceType")}function D(){const K=this.stack[this.stack.length-1];if(a("inReference")){const oe=a("referenceType")||"shortcut";K.type+="Reference",K.referenceType=oe,delete K.url,delete K.title}else delete K.identifier,delete K.label;i("referenceType")}function C(K){const oe=this.sliceSerialize(K),pe=this.stack[this.stack.length-2];pe.label=s5(oe),pe.identifier=lo(oe).toLowerCase()}function $(){const K=this.stack[this.stack.length-1],oe=this.resume(),pe=this.stack[this.stack.length-1];if(i("inReference",!0),pe.type==="link"){const Je=K.children;pe.children=Je}else pe.alt=oe}function W(){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.url=K}function A(){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.title=K}function J(){i("inReference")}function le(){i("referenceType","collapsed")}function ee(K){const oe=this.resume(),pe=this.stack[this.stack.length-1];pe.label=oe,pe.identifier=lo(this.sliceSerialize(K)).toLowerCase(),i("referenceType","full")}function ie(K){i("characterReferenceType",K.type)}function V(K){const oe=this.sliceSerialize(K),pe=a("characterReferenceType");let Je;pe?(Je=a5(oe,pe==="characterReferenceMarkerNumeric"?10:16),i("characterReferenceType")):Je=fw(oe);const et=this.stack.pop();et.value+=Je,et.position.end=ji(K.end)}function Q(K){H.call(this,K);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(K)}function ce(K){H.call(this,K);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(K)}function He(){return{type:"blockquote",children:[]}}function Re(){return{type:"code",lang:null,meta:null,value:""}}function me(){return{type:"inlineCode",value:""}}function ft(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qt(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:void 0,children:[]}}function Ce(){return{type:"break"}}function xt(){return{type:"html",value:""}}function Ut(){return{type:"image",title:null,url:"",alt:null}}function Sr(){return{type:"link",title:null,url:"",children:[]}}function yn(K){return{type:"list",ordered:K.type==="listOrdered",start:null,spread:K._spread,children:[]}}function kr(K){return{type:"listItem",spread:K._spread,checked:null,children:[]}}function Cs(){return{type:"paragraph",children:[]}}function Es(){return{type:"strong",children:[]}}function Zd(){return{type:"text",value:""}}function nu(){return{type:"thematicBreak"}}}function ji(e){return{line:e.line,column:e.column,offset:e.offset}}function u5(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?u5(e,r):Ufe(e,r)}}function Ufe(e,t){let n;for(n in t)if(l5.call(t,n)){if(n==="canContainEols"){const r=t[n];r&&e[n].push(...r)}else if(n==="transforms"){const r=t[n];r&&e[n].push(...r)}else if(n==="enter"||n==="exit"){const r=t[n];r&&Object.assign(e[n],r)}}}function AC(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+nc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+nc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+nc({start:t.start,end:t.end})+") is still open")}function Wfe(e){Object.assign(this,{Parser:n=>{const r=this.data("settings");return Hfe(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function Vfe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Yfe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
123
|
+
`}]}function qfe(e,t){const n=t.value?t.value+`
|
|
124
|
+
`:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,o={};r&&(o.className=["language-"+r]);let i={type:"element",tagName:"code",properties:o,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function Gfe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Kfe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jl(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let a="";if(i===37&&Tn(e.charCodeAt(n+1))&&Tn(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const l=e.charCodeAt(n+1);i<56320&&l>56319&&l<57344?(a=String.fromCharCode(i,l),o=1):a="�"}else a=String.fromCharCode(i);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+o+1,a=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function c5(e,t){const n=String(t.identifier).toUpperCase(),r=Jl(n.toLowerCase()),o=e.footnoteOrder.indexOf(n);let i;o===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,i=e.footnoteOrder.length):(e.footnoteCounts[n]++,i=o+1);const a=e.footnoteCounts[n],l={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function Qfe(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const o=String(r);return n[o]={type:"footnoteDefinition",identifier:o,children:[{type:"paragraph",children:t.children}],position:t.position},c5(e,{type:"footnoteReference",identifier:o,position:t.position})}function Xfe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Zfe(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function d5(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return{type:"text",value:"!["+t.alt+r};const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const a=o[o.length-1];return a&&a.type==="text"?a.value+=r:o.push({type:"text",value:r}),o}function Jfe(e,t){const n=e.definition(t.identifier);if(!n)return d5(e,t);const r={src:Jl(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,o),e.applyData(t,o)}function ehe(e,t){const n={src:Jl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function the(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function nhe(e,t){const n=e.definition(t.identifier);if(!n)return d5(e,t);const r={href:Jl(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const o={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function rhe(e,t){const n={href:Jl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ohe(e,t,n){const r=e.all(t),o=n?ihe(n):f5(t),i={},a=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const f=r[l];(o||l!==0||f.type!=="element"||f.tagName!=="p")&&a.push({type:"text",value:`
|
|
125
|
+
`}),f.type==="element"&&f.tagName==="p"&&!o?a.push(...f.children):a.push(f)}const u=r[r.length-1];u&&(o||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
|
|
126
|
+
`});const c={type:"element",tagName:"li",properties:i,children:a};return e.patch(t,c),e.applyData(t,c)}function ihe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=f5(n[r])}return t}function f5(e){const t=e.spread;return t??e.children.length>1}function ahe(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const a=r[o];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function she(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lhe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function uhe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const pw=h5("start"),gw=h5("end");function che(e){return{start:pw(e),end:gw(e)}}function h5(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};return{line:r.line||null,column:r.column||null,offset:r.offset>-1?r.offset:null}}}function dhe(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),o.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=pw(t.children[1]),u=gw(t.children[t.children.length-1]);l.line&&u.line&&(a.position={start:l,end:u}),o.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function fhe(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let u=-1;const c=[];for(;++u<l;){const d=t.children[u],h={},p=a?a[u]:void 0;p&&(h.align=p);let m={type:"element",tagName:i,properties:h,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(t,m)),c.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,f),e.applyData(t,f)}function hhe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const PC=9,MC=32;function phe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(RC(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(RC(t.slice(o),o>0,!1)),i.join("")}function RC(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===PC||i===MC;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===PC||i===MC;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function ghe(e,t){const n={type:"text",value:phe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function mhe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const yhe={blockquote:Vfe,break:Yfe,code:qfe,delete:Gfe,emphasis:Kfe,footnoteReference:c5,footnote:Qfe,heading:Xfe,html:Zfe,imageReference:Jfe,image:ehe,inlineCode:the,linkReference:nhe,link:rhe,listItem:ohe,list:ahe,paragraph:she,root:lhe,strong:uhe,table:dhe,tableCell:hhe,tableRow:fhe,text:ghe,thematicBreak:mhe,toml:jf,yaml:jf,definition:jf,footnoteDefinition:jf};function jf(){return null}const mw=function(e){if(e==null)return whe;if(typeof e=="string")return bhe(e);if(typeof e=="object")return Array.isArray(e)?vhe(e):xhe(e);if(typeof e=="function")return Gg(e);throw new Error("Expected function, string, or object as test")};function vhe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=mw(e[n]);return Gg(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].call(this,...o))return!0;return!1}}function xhe(e){return Gg(t);function t(n){let r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function bhe(e){return Gg(t);function t(n){return n&&n.type===e}}function Gg(e){return t;function t(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&e.call(this,n,...r))}}function whe(){return!0}const She=!0,BC=!1,khe="skip",p5=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null);const o=mw(t),i=r?-1:1;a(e,void 0,[])();function a(l,u,c){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return d;function d(){let h=[],p,m,x;if((!t||o(l,u,c[c.length-1]||null))&&(h=The(n(l,c)),h[0]===BC))return h;if(l.children&&h[0]!==khe)for(m=(r?l.children.length:-1)+i,x=c.concat(l);m>-1&&m<l.children.length;){if(p=a(l.children[m],m,x)(),p[0]===BC)return p;m=typeof p[1]=="number"?p[1]:m+i}return h}}};function The(e){return Array.isArray(e)?e:typeof e=="number"?[She,e]:[e]}const yw=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),p5(e,t,o,r);function o(i,a){const l=a[a.length-1];return n(i,l?l.children.indexOf(i):null,l)}};function Che(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column}const LC={}.hasOwnProperty;function Ehe(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return yw(e,"definition",r=>{const o=NC(r.identifier);o&&!LC.call(t,o)&&(t[o]=r)}),n;function n(r){const o=NC(r);return o&&LC.call(t,o)?t[o]:null}}function NC(e){return String(e||"").toUpperCase()}const wp={}.hasOwnProperty;function jhe(e,t){const n=t||{},r=n.allowDangerousHtml||!1,o={};return a.dangerous=r,a.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,a.footnoteLabel=n.footnoteLabel||"Footnotes",a.footnoteLabelTagName=n.footnoteLabelTagName||"h2",a.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},a.footnoteBackLabel=n.footnoteBackLabel||"Back to content",a.unknownHandler=n.unknownHandler,a.passThrough=n.passThrough,a.handlers={...yhe,...n.handlers},a.definition=Ehe(e),a.footnoteById=o,a.footnoteOrder=[],a.footnoteCounts={},a.patch=Ihe,a.applyData=Dhe,a.one=l,a.all=u,a.wrap=Ohe,a.augment=i,yw(e,"footnoteDefinition",c=>{const f=String(c.identifier).toUpperCase();wp.call(o,f)||(o[f]=c)}),a;function i(c,f){if(c&&"data"in c&&c.data){const d=c.data;d.hName&&(f.type!=="element"&&(f={type:"element",tagName:"",properties:{},children:[]}),f.tagName=d.hName),f.type==="element"&&d.hProperties&&(f.properties={...f.properties,...d.hProperties}),"children"in f&&f.children&&d.hChildren&&(f.children=d.hChildren)}if(c){const d="type"in c?c:{position:c};Che(d)||(f.position={start:pw(d),end:gw(d)})}return f}function a(c,f,d,h){return Array.isArray(d)&&(h=d,d={}),i(c,{type:"element",tagName:f,properties:d||{},children:h||[]})}function l(c,f){return g5(a,c,f)}function u(c){return vw(a,c)}}function Ihe(e,t){e.position&&(t.position=che(e))}function Dhe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&i&&(n.properties={...n.properties,...i}),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function g5(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return wp.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:vw(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):_he(e,t)}function vw(e,t){const n=[];if("children"in t){const r=t.children;let o=-1;for(;++o<r.length;){const i=g5(e,r[o],t);if(i){if(o&&r[o-1].type==="break"&&(!Array.isArray(i)&&i.type==="text"&&(i.value=i.value.replace(/^\s+/,"")),!Array.isArray(i)&&i.type==="element")){const a=i.children[0];a&&a.type==="text"&&(a.value=a.value.replace(/^\s+/,""))}Array.isArray(i)?n.push(...i):n.push(i)}}}return n}function _he(e,t){const n=t.data||{},r="value"in t&&!(wp.call(n,"hProperties")||wp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:vw(e,t)};return e.patch(t,r),e.applyData(t,r)}function Ohe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
127
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
128
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
129
|
+
`}),n}function Ahe(e){const t=[];let n=-1;for(;++n<e.footnoteOrder.length;){const r=e.footnoteById[e.footnoteOrder[n]];if(!r)continue;const o=e.all(r),i=String(r.identifier).toUpperCase(),a=Jl(i.toLowerCase());let l=0;const u=[];for(;++l<=e.footnoteCounts[i];){const d={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fnref-"+a+(l>1?"-"+l:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"↩"}]};l>1&&d.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(l)}]}),u.length>0&&u.push({type:"text",value:" "}),u.push(d)}const c=o[o.length-1];if(c&&c.type==="element"&&c.tagName==="p"){const d=c.children[c.children.length-1];d&&d.type==="text"?d.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...u)}else o.push(...u);const f={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+a},children:e.wrap(o,!0)};e.patch(r,f),t.push(f)}if(t.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:e.footnoteLabel}]},{type:"text",value:`
|
|
130
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(t,!0)},{type:"text",value:`
|
|
131
|
+
`}]}}function m5(e,t){const n=jhe(e,t),r=n.one(e,null),o=Ahe(n);return o&&r.children.push({type:"text",value:`
|
|
132
|
+
`},o),Array.isArray(r)?{type:"root",children:r}:r}const Phe=function(e,t){return e&&"run"in e?Rhe(e,t):Bhe(e||t)},Mhe=Phe;function Rhe(e,t){return(n,r,o)=>{e.run(m5(n,t),r,i=>{o(i)})}}function Bhe(e){return t=>m5(t,e)}class Nd{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Nd.prototype.property={};Nd.prototype.normal={};Nd.prototype.space=null;function y5(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new Nd(n,r,t)}function tx(e){return e.toLowerCase()}class Ur{constructor(t,n){this.property=t,this.attribute=n}}Ur.prototype.space=null;Ur.prototype.boolean=!1;Ur.prototype.booleanish=!1;Ur.prototype.overloadedBoolean=!1;Ur.prototype.number=!1;Ur.prototype.commaSeparated=!1;Ur.prototype.spaceSeparated=!1;Ur.prototype.commaOrSpaceSeparated=!1;Ur.prototype.mustUseProperty=!1;Ur.prototype.defined=!1;let Lhe=0;const Se=ks(),Wt=ks(),v5=ks(),ne=ks(),ut=ks(),hl=ks(),rr=ks();function ks(){return 2**++Lhe}const nx=Object.freeze(Object.defineProperty({__proto__:null,boolean:Se,booleanish:Wt,commaOrSpaceSeparated:rr,commaSeparated:hl,number:ne,overloadedBoolean:v5,spaceSeparated:ut},Symbol.toStringTag,{value:"Module"})),Ey=Object.keys(nx);class xw extends Ur{constructor(t,n,r,o){let i=-1;if(super(t,n),$C(this,"space",o),typeof r=="number")for(;++i<Ey.length;){const a=Ey[i];$C(this,Ey[i],(r&nx[a])===nx[a])}}}xw.prototype.defined=!0;function $C(e,t,n){n&&(e[t]=n)}const Nhe={}.hasOwnProperty;function eu(e){const t={},n={};let r;for(r in e.properties)if(Nhe.call(e.properties,r)){const o=e.properties[r],i=new xw(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[tx(r)]=r,n[tx(i.attribute)]=r}return new Nd(t,n,e.space)}const x5=eu({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),b5=eu({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function w5(e,t){return t in e?e[t]:t}function S5(e,t){return w5(e,t.toLowerCase())}const k5=eu({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:S5,properties:{xmlns:null,xmlnsXLink:null}}),T5=eu({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Wt,ariaAutoComplete:null,ariaBusy:Wt,ariaChecked:Wt,ariaColCount:ne,ariaColIndex:ne,ariaColSpan:ne,ariaControls:ut,ariaCurrent:null,ariaDescribedBy:ut,ariaDetails:null,ariaDisabled:Wt,ariaDropEffect:ut,ariaErrorMessage:null,ariaExpanded:Wt,ariaFlowTo:ut,ariaGrabbed:Wt,ariaHasPopup:null,ariaHidden:Wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ut,ariaLevel:ne,ariaLive:null,ariaModal:Wt,ariaMultiLine:Wt,ariaMultiSelectable:Wt,ariaOrientation:null,ariaOwns:ut,ariaPlaceholder:null,ariaPosInSet:ne,ariaPressed:Wt,ariaReadOnly:Wt,ariaRelevant:null,ariaRequired:Wt,ariaRoleDescription:ut,ariaRowCount:ne,ariaRowIndex:ne,ariaRowSpan:ne,ariaSelected:Wt,ariaSetSize:ne,ariaSort:null,ariaValueMax:ne,ariaValueMin:ne,ariaValueNow:ne,ariaValueText:null,role:null}}),$he=eu({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:S5,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:hl,acceptCharset:ut,accessKey:ut,action:null,allow:null,allowFullScreen:Se,allowPaymentRequest:Se,allowUserMedia:Se,alt:null,as:null,async:Se,autoCapitalize:null,autoComplete:ut,autoFocus:Se,autoPlay:Se,capture:Se,charSet:null,checked:Se,cite:null,className:ut,cols:ne,colSpan:null,content:null,contentEditable:Wt,controls:Se,controlsList:ut,coords:ne|hl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Se,defer:Se,dir:null,dirName:null,disabled:Se,download:v5,draggable:Wt,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Se,formTarget:null,headers:ut,height:ne,hidden:Se,high:ne,href:null,hrefLang:null,htmlFor:ut,httpEquiv:ut,id:null,imageSizes:null,imageSrcSet:null,inputMode:null,integrity:null,is:null,isMap:Se,itemId:null,itemProp:ut,itemRef:ut,itemScope:Se,itemType:ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Se,low:ne,manifest:null,max:null,maxLength:ne,media:null,method:null,min:null,minLength:ne,multiple:Se,muted:Se,name:null,nonce:null,noModule:Se,noValidate:Se,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Se,optimum:ne,pattern:null,ping:ut,placeholder:null,playsInline:Se,poster:null,preload:null,readOnly:Se,referrerPolicy:null,rel:ut,required:Se,reversed:Se,rows:ne,rowSpan:ne,sandbox:ut,scope:null,scoped:Se,seamless:Se,selected:Se,shape:null,size:ne,sizes:null,slot:null,span:ne,spellCheck:Wt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ne,step:null,style:null,tabIndex:ne,target:null,title:null,translate:null,type:null,typeMustMatch:Se,useMap:null,value:Wt,width:ne,wrap:null,align:null,aLink:null,archive:ut,axis:null,background:null,bgColor:null,border:ne,borderColor:null,bottomMargin:ne,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Se,declare:Se,event:null,face:null,frame:null,frameBorder:null,hSpace:ne,leftMargin:ne,link:null,longDesc:null,lowSrc:null,marginHeight:ne,marginWidth:ne,noResize:Se,noHref:Se,noShade:Se,noWrap:Se,object:null,profile:null,prompt:null,rev:null,rightMargin:ne,rules:null,scheme:null,scrolling:Wt,standby:null,summary:null,text:null,topMargin:ne,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ne,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Se,disableRemotePlayback:Se,prefix:null,property:null,results:ne,security:null,unselectable:null}}),Fhe=eu({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:w5,properties:{about:rr,accentHeight:ne,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ne,amplitude:ne,arabicForm:null,ascent:ne,attributeName:null,attributeType:null,azimuth:ne,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ne,by:null,calcMode:null,capHeight:ne,className:ut,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ne,diffuseConstant:ne,direction:null,display:null,dur:null,divisor:ne,dominantBaseline:null,download:Se,dx:null,dy:null,edgeMode:null,editable:null,elevation:ne,enableBackground:null,end:null,event:null,exponent:ne,externalResourcesRequired:null,fill:null,fillOpacity:ne,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:hl,g2:hl,glyphName:hl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ne,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ne,horizOriginX:ne,horizOriginY:ne,id:null,ideographic:ne,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ne,k:ne,k1:ne,k2:ne,k3:ne,k4:ne,kernelMatrix:rr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ne,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ne,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ne,overlineThickness:ne,paintOrder:null,panose1:null,path:null,pathLength:ne,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ne,pointsAtY:ne,pointsAtZ:ne,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rr,rev:rr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rr,requiredFeatures:rr,requiredFonts:rr,requiredFormats:rr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ne,specularExponent:ne,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ne,strikethroughThickness:ne,string:null,stroke:null,strokeDashArray:rr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ne,strokeOpacity:ne,strokeWidth:null,style:null,surfaceScale:ne,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rr,tabIndex:ne,tableValues:null,target:null,targetX:ne,targetY:ne,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rr,to:null,transform:null,u1:null,u2:null,underlinePosition:ne,underlineThickness:ne,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ne,values:null,vAlphabetic:ne,vMathematical:ne,vectorEffect:null,vHanging:ne,vIdeographic:ne,version:null,vertAdvY:ne,vertOriginX:ne,vertOriginY:ne,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ne,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Hhe=/^data[-\w.:]+$/i,FC=/-[a-z]/g,zhe=/[A-Z]/g;function Uhe(e,t){const n=tx(t);let r=t,o=Ur;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Hhe.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(FC,Vhe);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!FC.test(i)){let a=i.replace(zhe,Whe);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=xw}return new o(r,t)}function Whe(e){return"-"+e.toLowerCase()}function Vhe(e){return e.charAt(1).toUpperCase()}const HC={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Yhe=y5([b5,x5,k5,T5,$he],"html"),qhe=y5([b5,x5,k5,T5,Fhe],"svg");function Ghe(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{yw(t,"element",(n,r,o)=>{const i=o;let a;if(e.allowedElements?a=!e.allowedElements.includes(n.tagName):e.disallowedElements&&(a=e.disallowedElements.includes(n.tagName)),!a&&e.allowElement&&typeof r=="number"&&(a=!e.allowElement(n,r,i)),a&&typeof r=="number")return e.unwrapDisallowed&&n.children?i.children.splice(r,1,...n.children):i.children.splice(r,1),r})}}var C5={exports:{}},Ze={};/**
|
|
133
|
+
* @license React
|
|
134
|
+
* react-is.production.min.js
|
|
135
|
+
*
|
|
136
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the MIT license found in the
|
|
139
|
+
* LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/var bw=Symbol.for("react.element"),ww=Symbol.for("react.portal"),Kg=Symbol.for("react.fragment"),Qg=Symbol.for("react.strict_mode"),Xg=Symbol.for("react.profiler"),Zg=Symbol.for("react.provider"),Jg=Symbol.for("react.context"),Khe=Symbol.for("react.server_context"),em=Symbol.for("react.forward_ref"),tm=Symbol.for("react.suspense"),nm=Symbol.for("react.suspense_list"),rm=Symbol.for("react.memo"),om=Symbol.for("react.lazy"),Qhe=Symbol.for("react.offscreen"),E5;E5=Symbol.for("react.module.reference");function Wr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case bw:switch(e=e.type,e){case Kg:case Xg:case Qg:case tm:case nm:return e;default:switch(e=e&&e.$$typeof,e){case Khe:case Jg:case em:case om:case rm:case Zg:return e;default:return t}}case ww:return t}}}Ze.ContextConsumer=Jg;Ze.ContextProvider=Zg;Ze.Element=bw;Ze.ForwardRef=em;Ze.Fragment=Kg;Ze.Lazy=om;Ze.Memo=rm;Ze.Portal=ww;Ze.Profiler=Xg;Ze.StrictMode=Qg;Ze.Suspense=tm;Ze.SuspenseList=nm;Ze.isAsyncMode=function(){return!1};Ze.isConcurrentMode=function(){return!1};Ze.isContextConsumer=function(e){return Wr(e)===Jg};Ze.isContextProvider=function(e){return Wr(e)===Zg};Ze.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===bw};Ze.isForwardRef=function(e){return Wr(e)===em};Ze.isFragment=function(e){return Wr(e)===Kg};Ze.isLazy=function(e){return Wr(e)===om};Ze.isMemo=function(e){return Wr(e)===rm};Ze.isPortal=function(e){return Wr(e)===ww};Ze.isProfiler=function(e){return Wr(e)===Xg};Ze.isStrictMode=function(e){return Wr(e)===Qg};Ze.isSuspense=function(e){return Wr(e)===tm};Ze.isSuspenseList=function(e){return Wr(e)===nm};Ze.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Kg||e===Xg||e===Qg||e===tm||e===nm||e===Qhe||typeof e=="object"&&e!==null&&(e.$$typeof===om||e.$$typeof===rm||e.$$typeof===Zg||e.$$typeof===Jg||e.$$typeof===em||e.$$typeof===E5||e.getModuleId!==void 0)};Ze.typeOf=Wr;C5.exports=Ze;var Xhe=C5.exports;const Zhe=mr(Xhe);function Jhe(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}function epe(e){return e.join(" ").trim()}function tpe(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}var Sw={exports:{}},zC=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,npe=/\n/g,rpe=/^\s*/,ope=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ipe=/^:\s*/,ape=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,spe=/^[;\s]*/,lpe=/^\s+|\s+$/g,upe=`
|
|
141
|
+
`,UC="/",WC="*",Ra="",cpe="comment",dpe="declaration",fpe=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(m){var x=m.match(npe);x&&(n+=x.length);var k=m.lastIndexOf(upe);r=~k?m.length-k:r+m.length}function i(){var m={line:n,column:r};return function(x){return x.position=new a(m),c(),x}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function l(m){var x=new Error(t.source+":"+n+":"+r+": "+m);if(x.reason=m,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function u(m){var x=m.exec(e);if(x){var k=x[0];return o(k),e=e.slice(k.length),x}}function c(){u(rpe)}function f(m){var x;for(m=m||[];x=d();)x!==!1&&m.push(x);return m}function d(){var m=i();if(!(UC!=e.charAt(0)||WC!=e.charAt(1))){for(var x=2;Ra!=e.charAt(x)&&(WC!=e.charAt(x)||UC!=e.charAt(x+1));)++x;if(x+=2,Ra===e.charAt(x-1))return l("End of comment missing");var k=e.slice(2,x-2);return r+=2,o(k),e=e.slice(x),r+=2,m({type:cpe,comment:k})}}function h(){var m=i(),x=u(ope);if(x){if(d(),!u(ipe))return l("property missing ':'");var k=u(ape),v=m({type:dpe,property:VC(x[0].replace(zC,Ra)),value:k?VC(k[0].replace(zC,Ra)):Ra});return u(spe),v}}function p(){var m=[];f(m);for(var x;x=h();)x!==!1&&(m.push(x),f(m));return m}return c(),p()};function VC(e){return e?e.replace(lpe,Ra):Ra}var hpe=fpe;function j5(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,o=hpe(e),i=typeof t=="function",a,l,u=0,c=o.length;u<c;u++)r=o[u],a=r.property,l=r.value,i?t(a,l,r):l&&(n||(n={}),n[a]=l);return n}Sw.exports=j5;Sw.exports.default=j5;var ppe=Sw.exports;const gpe=mr(ppe),rx={}.hasOwnProperty,mpe=new Set(["table","thead","tbody","tfoot","tr"]);function I5(e,t){const n=[];let r=-1,o;for(;++r<t.children.length;)o=t.children[r],o.type==="element"?n.push(ype(e,o,r,t)):o.type==="text"?(t.type!=="element"||!mpe.has(t.tagName)||!Jhe(o))&&n.push(o.value):o.type==="raw"&&!e.options.skipHtml&&n.push(o.value);return n}function ype(e,t,n,r){const o=e.options,i=o.transformLinkUri===void 0?kce:o.transformLinkUri,a=e.schema,l=t.tagName,u={};let c=a,f;if(a.space==="html"&&l==="svg"&&(c=qhe,e.schema=c),t.properties)for(f in t.properties)rx.call(t.properties,f)&&xpe(u,f,t.properties[f],e);(l==="ol"||l==="ul")&&e.listDepth++;const d=I5(e,t);(l==="ol"||l==="ul")&&e.listDepth--,e.schema=a;const h=t.position||{start:{line:null,column:null,offset:null},end:{line:null,column:null,offset:null}},p=o.components&&rx.call(o.components,l)?o.components[l]:l,m=typeof p=="string"||p===$t.Fragment;if(!Zhe.isValidElementType(p))throw new TypeError(`Component for name \`${l}\` not defined or is not renderable`);if(u.key=n,l==="a"&&o.linkTarget&&(u.target=typeof o.linkTarget=="function"?o.linkTarget(String(u.href||""),t.children,typeof u.title=="string"?u.title:null):o.linkTarget),l==="a"&&i&&(u.href=i(String(u.href||""),t.children,typeof u.title=="string"?u.title:null)),!m&&l==="code"&&r.type==="element"&&r.tagName!=="pre"&&(u.inline=!0),!m&&(l==="h1"||l==="h2"||l==="h3"||l==="h4"||l==="h5"||l==="h6")&&(u.level=Number.parseInt(l.charAt(1),10)),l==="img"&&o.transformImageUri&&(u.src=o.transformImageUri(String(u.src||""),String(u.alt||""),typeof u.title=="string"?u.title:null)),!m&&l==="li"&&r.type==="element"){const x=vpe(t);u.checked=x&&x.properties?!!x.properties.checked:null,u.index=jy(r,t),u.ordered=r.tagName==="ol"}return!m&&(l==="ol"||l==="ul")&&(u.ordered=l==="ol",u.depth=e.listDepth),(l==="td"||l==="th")&&(u.align&&(u.style||(u.style={}),u.style.textAlign=u.align,delete u.align),m||(u.isHeader=l==="th")),!m&&l==="tr"&&r.type==="element"&&(u.isHeader=r.tagName==="thead"),o.sourcePos&&(u["data-sourcepos"]=Spe(h)),!m&&o.rawSourcePos&&(u.sourcePosition=t.position),!m&&o.includeElementIndex&&(u.index=jy(r,t),u.siblingCount=jy(r)),m||(u.node=t),d.length>0?$t.createElement(p,u,d):$t.createElement(p,u)}function vpe(e){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n.type==="element"&&n.tagName==="input")return n}return null}function jy(e,t){let n=-1,r=0;for(;++n<e.children.length&&e.children[n]!==t;)e.children[n].type==="element"&&r++;return r}function xpe(e,t,n,r){const o=Uhe(r.schema,t);let i=n;i==null||i!==i||(Array.isArray(i)&&(i=o.commaSeparated?tpe(i):epe(i)),o.property==="style"&&typeof i=="string"&&(i=bpe(i)),o.space&&o.property?e[rx.call(HC,o.property)?HC[o.property]:o.property]=i:o.attribute&&(e[o.attribute]=i))}function bpe(e){const t={};try{gpe(e,n)}catch{}return t;function n(r,o){const i=r.slice(0,4)==="-ms-"?`ms-${r.slice(4)}`:r;t[i.replace(/-([a-z])/g,wpe)]=o}}function wpe(e,t){return t.toUpperCase()}function Spe(e){return[e.start.line,":",e.start.column,"-",e.end.line,":",e.end.column].map(String).join("")}const YC={}.hasOwnProperty,kpe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",If={plugins:{to:"remarkPlugins",id:"change-plugins-to-remarkplugins"},renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function D5(e){for(const i in If)if(YC.call(If,i)&&YC.call(e,i)){const a=If[i];console.warn(`[react-markdown] Warning: please ${a.to?`use \`${a.to}\` instead of`:"remove"} \`${i}\` (see <${kpe}#${a.id}> for more info)`),delete If[i]}const t=$ce().use(Wfe).use(e.remarkPlugins||[]).use(Mhe,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(Ghe,e),n=new VP;typeof e.children=="string"?n.value=e.children:e.children!==void 0&&e.children!==null&&console.warn(`[react-markdown] Warning: please pass a string as \`children\` (not: \`${e.children}\`)`);const r=t.runSync(t.parse(n),n);if(r.type!=="root")throw new TypeError("Expected a `root` node");let o=$t.createElement($t.Fragment,{},I5({options:e,schema:Yhe,listDepth:0},r));return e.className&&(o=$t.createElement("div",{className:e.className},o)),o}D5.propTypes={children:G.string,className:G.string,allowElement:G.func,allowedElements:G.arrayOf(G.string),disallowedElements:G.arrayOf(G.string),unwrapDisallowed:G.bool,remarkPlugins:G.arrayOf(G.oneOfType([G.object,G.func,G.arrayOf(G.oneOfType([G.bool,G.string,G.object,G.func,G.arrayOf(G.any)]))])),rehypePlugins:G.arrayOf(G.oneOfType([G.object,G.func,G.arrayOf(G.oneOfType([G.bool,G.string,G.object,G.func,G.arrayOf(G.any)]))])),sourcePos:G.bool,rawSourcePos:G.bool,skipHtml:G.bool,includeElementIndex:G.bool,transformLinkUri:G.oneOfType([G.func,G.bool]),linkTarget:G.oneOfType([G.func,G.string]),transformImageUri:G.func,components:G.object};const Tpe={tokenize:_pe,partial:!0},_5={tokenize:Ope,partial:!0},O5={tokenize:Ape,partial:!0},A5={tokenize:Ppe,partial:!0},Cpe={tokenize:Mpe,partial:!0},P5={tokenize:Ipe,previous:R5},M5={tokenize:Dpe,previous:B5},wi={tokenize:jpe,previous:L5},Yo={},Epe={text:Yo};let Ca=48;for(;Ca<123;)Yo[Ca]=wi,Ca++,Ca===58?Ca=65:Ca===91&&(Ca=97);Yo[43]=wi;Yo[45]=wi;Yo[46]=wi;Yo[95]=wi;Yo[72]=[wi,M5];Yo[104]=[wi,M5];Yo[87]=[wi,P5];Yo[119]=[wi,P5];function jpe(e,t,n){const r=this;let o,i;return a;function a(d){return!ox(d)||!L5.call(r,r.previous)||kw(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(d))}function l(d){return ox(d)?(e.consume(d),l):d===64?(e.consume(d),u):n(d)}function u(d){return d===46?e.check(Cpe,f,c)(d):d===45||d===95||Tn(d)?(i=!0,e.consume(d),u):f(d)}function c(d){return e.consume(d),o=!0,u}function f(d){return i&&o&&Dn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function Ipe(e,t,n){const r=this;return o;function o(a){return a!==87&&a!==119||!R5.call(r,r.previous)||kw(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Tpe,e.attempt(_5,e.attempt(O5,i),n),n)(a))}function i(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Dpe(e,t,n){const r=this;let o="",i=!1;return a;function a(d){return(d===72||d===104)&&B5.call(r,r.previous)&&!kw(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(d),e.consume(d),l):n(d)}function l(d){if(Dn(d)&&o.length<5)return o+=String.fromCodePoint(d),e.consume(d),l;if(d===58){const h=o.toLowerCase();if(h==="http"||h==="https")return e.consume(d),u}return n(d)}function u(d){return d===47?(e.consume(d),i?c:(i=!0,u)):n(d)}function c(d){return d===null||xp(d)||tt(d)||as(d)||Yg(d)?n(d):e.attempt(_5,e.attempt(O5,f),n)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function _pe(e,t,n){let r=0;return o;function o(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),o):a===46&&r===3?(e.consume(a),i):n(a)}function i(a){return a===null?n(a):t(a)}}function Ope(e,t,n){let r,o,i;return a;function a(c){return c===46||c===95?e.check(A5,u,l)(c):c===null||tt(c)||as(c)||c!==45&&Yg(c)?u(c):(i=!0,e.consume(c),a)}function l(c){return c===95?r=!0:(o=r,r=void 0),e.consume(c),a}function u(c){return o||r||!i?n(c):t(c)}}function Ape(e,t){let n=0,r=0;return o;function o(a){return a===40?(n++,e.consume(a),o):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(A5,t,i)(a):a===null||tt(a)||as(a)?t(a):(e.consume(a),o)}function i(a){return a===41&&r++,e.consume(a),o}}function Ppe(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),i):l===93?(e.consume(l),o):l===60||l===null||tt(l)||as(l)?t(l):n(l)}function o(l){return l===null||l===40||l===91||tt(l)||as(l)?t(l):r(l)}function i(l){return Dn(l)?a(l):n(l)}function a(l){return l===59?(e.consume(l),r):Dn(l)?(e.consume(l),a):n(l)}}function Mpe(e,t,n){return r;function r(i){return e.consume(i),o}function o(i){return Tn(i)?n(i):t(i)}}function R5(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||tt(e)}function B5(e){return!Dn(e)}function L5(e){return!(e===47||ox(e))}function ox(e){return e===43||e===45||e===46||e===95||Tn(e)}function kw(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Rpe={tokenize:Upe,partial:!0};function Bpe(){return{document:{91:{tokenize:Fpe,continuation:{tokenize:Hpe},exit:zpe}},text:{91:{tokenize:$pe},93:{add:"after",tokenize:Lpe,resolveTo:Npe}}}}function Lpe(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;o--;){const u=r.events[o][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!a||!a._balanced)return n(u);const c=lo(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!i.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function Npe(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function $pe(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return l;function l(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),u}function u(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(i>999||d===93&&!a||d===null||d===91||tt(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return o.includes(lo(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return tt(d)||(a=!0),i++,e.consume(d),d===92?f:c}function f(d){return d===91||d===92||d===93?(e.consume(d),i++,c):c(d)}}function Fpe(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,l;return u;function u(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(a>999||m===93&&!l||m===null||m===91||tt(m))return n(m);if(m===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return i=lo(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return tt(m)||(l=!0),a++,e.consume(m),m===92?d:f}function d(m){return m===91||m===92||m===93?(e.consume(m),a++,f):f(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),o.includes(i)||o.push(i),Me(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function Hpe(e,t,n){return e.check(Ld,t,e.attempt(Rpe,t,n))}function zpe(e){e.exit("gfmFootnoteDefinition")}function Upe(e,t,n){const r=this;return Me(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(i):n(i)}}function Wpe(e){let n=(e||{}).singleTilde;const r={tokenize:i,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(a,l){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let c=u;for(;c--;)if(a[c][0]==="exit"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[c][1].end.offset-a[c][1].start.offset){a[u][1].type="strikethroughSequence",a[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},a[c][1].start),end:Object.assign({},a[u][1].end)},d={type:"strikethroughText",start:Object.assign({},a[c][1].end),end:Object.assign({},a[u][1].start)},h=[["enter",f,l],["enter",a[c][1],l],["exit",a[c][1],l],["enter",d,l]],p=l.parser.constructs.insideSpan.null;p&&hr(h,h.length,0,qg(p,a.slice(c+1,u),l)),hr(h,h.length,0,[["exit",d,l],["enter",a[u][1],l],["exit",a[u][1],l],["exit",f,l]]),hr(a,c-1,u-c+3,h),u=c+h.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function i(a,l,u){const c=this.previous,f=this.events;let d=0;return h;function h(m){return c===126&&f[f.length-1][1].type!=="characterEscape"?u(m):(a.enter("strikethroughSequenceTemporary"),p(m))}function p(m){const x=bp(c);if(m===126)return d>1?u(m):(a.consume(m),d++,p);if(d<2&&!n)return u(m);const k=a.exit("strikethroughSequenceTemporary"),v=bp(m);return k._open=!v||v===2&&!!x,k._close=!x||x===2&&!!v,l(m)}}}class Vpe{constructor(){this.map=[]}add(t,n,r){Ype(this,t,n,r)}consume(t){if(this.map.sort((i,a)=>i[0]-a[0]),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1])),r.push(this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let o=r.pop();for(;o;)t.push(...o),o=r.pop();this.map.length=0}}function Ype(e,t,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=n,e.map[o][2].push(...r);return}o+=1}e.map.push([t,n,r])}}function qpe(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}const Gpe={flow:{null:{tokenize:Kpe,resolveAll:Qpe}}};function Kpe(e,t,n){const r=this;let o=0,i=0,a;return l;function l(O){let N=r.events.length-1;for(;N>-1;){const L=r.events[N][1].type;if(L==="lineEnding"||L==="linePrefix")N--;else break}const H=N>-1?r.events[N][1].type:null,F=H==="tableHead"||H==="tableRow"?T:u;return F===T&&r.parser.lazy[r.now().line]?n(O):F(O)}function u(O){return e.enter("tableHead"),e.enter("tableRow"),c(O)}function c(O){return O===124||(a=!0,i+=1),f(O)}function f(O){return O===null?n(O):fe(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),p):n(O):je(O)?Me(e,f,"whitespace")(O):(i+=1,a&&(a=!1,o+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,f):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||tt(O)?(e.exit("data"),f(O)):(e.consume(O),O===92?h:d)}function h(O){return O===92||O===124?(e.consume(O),d):d(O)}function p(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(e.enter("tableDelimiterRow"),a=!1,je(O)?Me(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):m(O))}function m(O){return O===45||O===58?k(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),x):E(O)}function x(O){return je(O)?Me(e,k,"whitespace")(O):k(O)}function k(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),v):O===45?(i+=1,v(O)):O===null||fe(O)?w(O):E(O)}function v(O){return O===45?(e.enter("tableDelimiterFiller"),y(O)):E(O)}function y(O){return O===45?(e.consume(O),y):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(O))}function b(O){return je(O)?Me(e,w,"whitespace")(O):w(O)}function w(O){return O===124?m(O):O===null||fe(O)?!a||o!==i?E(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(O)):E(O)}function E(O){return n(O)}function T(O){return e.enter("tableRow"),_(O)}function _(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),_):O===null||fe(O)?(e.exit("tableRow"),t(O)):je(O)?Me(e,_,"whitespace")(O):(e.enter("data"),M(O))}function M(O){return O===null||O===124||tt(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?B:M)}function B(O){return O===92||O===124?(e.consume(O),M):M(O)}}function Qpe(e,t){let n=-1,r=!0,o=0,i=[0,0,0,0],a=[0,0,0,0],l=!1,u=0,c,f,d;const h=new Vpe;for(;++n<e.length;){const p=e[n],m=p[1];p[0]==="enter"?m.type==="tableHead"?(l=!1,u!==0&&(qC(h,t,u,c,f),f=void 0,u=0),c={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",c,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,d=void 0,i=[0,0,0,0],a=[0,n+1,0,0],l&&(l=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",f,t]])),o=m.type==="tableDelimiterRow"?2:f?3:1):o&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],d=Df(h,t,i,o,void 0,d),i=[0,0,0,0]),a[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],d=Df(h,t,i,o,void 0,d)),i=a,a=[i[1],n,0,0])):m.type==="tableHead"?(l=!0,u=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=n,i[1]!==0?(a[0]=a[1],d=Df(h,t,i,o,n,d)):a[1]!==0&&(d=Df(h,t,a,o,n,d)),o=0):o&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&qC(h,t,u,c,f),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=qpe(t.events,n))}return e}function Df(e,t,n,r,o,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(i.end=Object.assign({},Ns(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const u=Ns(t.events,n[1]);if(i={type:a,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",i,t]]),n[2]!==0){const c=Ns(t.events,n[2]),f=Ns(t.events,n[3]),d={type:l,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,x=n[3]-n[2]-1;e.add(m,x,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return o!==void 0&&(i.end=Object.assign({},Ns(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function qC(e,t,n,r,o){const i=[],a=Ns(t.events,n);o&&(o.end=Object.assign({},a),i.push(["exit",o,t])),r.end=Object.assign({},a),i.push(["exit",r,t]),e.add(n+1,0,i)}function Ns(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Xpe={tokenize:Jpe},Zpe={text:{91:Xpe}};function Jpe(e,t,n){const r=this;return o;function o(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),i)}function i(u){return tt(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return fe(u)?t(u):je(u)?e.check({tokenize:ege},t,n)(u):n(u)}}function ege(e,t,n){return Me(e,r,"whitespace");function r(o){return o===null?n(o):t(o)}}function tge(e){return QP([Epe,Bpe(),Wpe(e),Gpe,Zpe])}function GC(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function nge(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const rge={}.hasOwnProperty,oge=function(e,t,n,r){let o,i;typeof t=="string"||t instanceof RegExp?(i=[[t,n]],o=r):(i=t,o=n),o||(o={});const a=mw(o.ignore||[]),l=ige(i);let u=-1;for(;++u<l.length;)p5(e,"text",c);return e;function c(d,h){let p=-1,m;for(;++p<h.length;){const x=h[p];if(a(x,m?m.children.indexOf(x):void 0,m))return;m=x}if(m)return f(d,h)}function f(d,h){const p=h[h.length-1],m=l[u][0],x=l[u][1];let k=0;const v=p.children.indexOf(d);let y=!1,b=[];m.lastIndex=0;let w=m.exec(d.value);for(;w;){const E=w.index,T={index:w.index,input:w.input,stack:[...h,d]};let _=x(...w,T);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_!==!1&&(k!==E&&b.push({type:"text",value:d.value.slice(k,E)}),Array.isArray(_)?b.push(..._):_&&b.push(_),k=E+w[0].length,y=!0),!m.global)break;w=m.exec(d.value)}return y?(k<d.value.length&&b.push({type:"text",value:d.value.slice(k)}),p.children.splice(v,1,...b)):b=[d],v+b.length}};function ige(e){const t=[];if(typeof e!="object")throw new TypeError("Expected array or object as schema");if(Array.isArray(e)){let n=-1;for(;++n<e.length;)t.push([KC(e[n][0]),QC(e[n][1])])}else{let n;for(n in e)rge.call(e,n)&&t.push([KC(n),QC(e[n])])}return t}function KC(e){return typeof e=="string"?new RegExp(nge(e),"g"):e}function QC(e){return typeof e=="function"?e:()=>e}const Iy="phrasing",Dy=["autolink","link","image","label"],age={transforms:[hge],enter:{literalAutolink:lge,literalAutolinkEmail:_y,literalAutolinkHttp:_y,literalAutolinkWww:_y},exit:{literalAutolink:fge,literalAutolinkEmail:dge,literalAutolinkHttp:uge,literalAutolinkWww:cge}},sge={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Iy,notInConstruct:Dy},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Iy,notInConstruct:Dy},{character:":",before:"[ps]",after:"\\/",inConstruct:Iy,notInConstruct:Dy}]};function lge(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function _y(e){this.config.enter.autolinkProtocol.call(this,e)}function uge(e){this.config.exit.autolinkProtocol.call(this,e)}function cge(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}function dge(e){this.config.exit.autolinkEmail.call(this,e)}function fge(e){this.exit(e)}function hge(e){oge(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,pge],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,gge]],{ignore:["link","linkReference"]})}function pge(e,t,n,r,o){let i="";if(!N5(o)||(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!mge(n)))return!1;const a=yge(n+r);if(!a[0])return!1;const l={type:"link",title:null,url:i+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[l,{type:"text",value:a[1]}]:l}function gge(e,t,n,r){return!N5(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function mge(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function yge(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=GC(e,"(");let i=GC(e,")");for(;r!==-1&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}function N5(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||as(n)||Yg(n))&&(!t||n!==47)}function $5(e){return e.label||!e.identifier?e.label||"":s5(e.identifier)}function vge(e,t,n){const r=t.indexStack,o=e.children||[],i=t.createTracker(n),a=[];let l=-1;for(r.push(-1);++l<o.length;){const u=o[l];r[r.length-1]=l,a.push(i.move(t.handle(u,e,t,{before:`
|
|
142
|
+
`,after:`
|
|
143
|
+
`,...i.current()}))),u.type!=="list"&&(t.bulletLastUsed=void 0),l<o.length-1&&a.push(i.move(xge(u,o[l+1],e,t)))}return r.pop(),a.join("")}function xge(e,t,n,r){let o=r.join.length;for(;o--;){const i=r.join[o](e,t,n,r);if(i===!0||i===1)break;if(typeof i=="number")return`
|
|
144
|
+
`.repeat(1+i);if(i===!1)return`
|
|
145
|
+
|
|
146
|
+
<!---->
|
|
147
|
+
|
|
148
|
+
`}return`
|
|
149
|
+
|
|
150
|
+
`}const bge=/\r?\n|\r/g;function wge(e,t){const n=[];let r=0,o=0,i;for(;i=bge.exec(e);)a(e.slice(r,i.index)),n.push(i[0]),r=i.index+i[0].length,o++;return a(e.slice(r)),n.join("");function a(l){n.push(t(l,o,!l))}}function F5(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function Sge(e,t){return XC(e,t.inConstruct,!0)&&!XC(e,t.notInConstruct,!1)}function XC(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function H5(e,t,n){const r=(n.before||"")+(t||"")+(n.after||""),o=[],i=[],a={};let l=-1;for(;++l<e.unsafe.length;){const f=e.unsafe[l];if(!Sge(e.stack,f))continue;const d=F5(f);let h;for(;h=d.exec(r);){const p="before"in f||!!f.atBreak,m="after"in f,x=h.index+(p?h[1].length:0);o.includes(x)?(a[x].before&&!p&&(a[x].before=!1),a[x].after&&!m&&(a[x].after=!1)):(o.push(x),a[x]={before:p,after:m})}}o.sort(kge);let u=n.before?n.before.length:0;const c=r.length-(n.after?n.after.length:0);for(l=-1;++l<o.length;){const f=o[l];f<u||f>=c||f+1<c&&o[l+1]===f+1&&a[f].after&&!a[f+1].before&&!a[f+1].after||o[l-1]===f-1&&a[f].before&&!a[f-1].before&&!a[f-1].after||(u!==f&&i.push(ZC(r.slice(u,f),"\\")),u=f,/[!-/:-@[-`{-~]/.test(r.charAt(f))&&(!n.encode||!n.encode.includes(r.charAt(f)))?i.push("\\"):(i.push("&#x"+r.charCodeAt(f).toString(16).toUpperCase()+";"),u++))}return i.push(ZC(r.slice(u,c),n.after)),i.join("")}function kge(e,t){return e-t}function ZC(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],o=[],i=e+t;let a=-1,l=0,u;for(;u=n.exec(i);)r.push(u.index);for(;++a<r.length;)l!==r[a]&&o.push(e.slice(l,r[a])),o.push("\\"),l=r[a];return o.push(e.slice(l)),o.join("")}function im(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,o=n.line||1,i=n.column||1;return{move:u,current:a,shift:l};function a(){return{now:{line:o,column:i},lineShift:r}}function l(c){r+=c}function u(c){const f=c||"",d=f.split(/\r?\n|\r/g),h=d[d.length-1];return o+=d.length-1,i=d.length===1?i+h.length:1+h.length+r,f}}z5.peek=Mge;function Tge(){return{enter:{gfmFootnoteDefinition:Ege,gfmFootnoteDefinitionLabelString:jge,gfmFootnoteCall:_ge,gfmFootnoteCallString:Oge},exit:{gfmFootnoteDefinition:Dge,gfmFootnoteDefinitionLabelString:Ige,gfmFootnoteCall:Pge,gfmFootnoteCallString:Age}}}function Cge(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:Rge,footnoteReference:z5}}}function Ege(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function jge(){this.buffer()}function Ige(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=lo(this.sliceSerialize(e)).toLowerCase()}function Dge(e){this.exit(e)}function _ge(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Oge(){this.buffer()}function Age(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=lo(this.sliceSerialize(e)).toLowerCase()}function Pge(e){this.exit(e)}function z5(e,t,n,r){const o=im(r);let i=o.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return i+=o.move(H5(n,$5(e),{...o.current(),before:i,after:"]"})),l(),a(),i+=o.move("]"),i}function Mge(){return"["}function Rge(e,t,n,r){const o=im(r);let i=o.move("[^");const a=n.enter("footnoteDefinition"),l=n.enter("label");return i+=o.move(H5(n,$5(e),{...o.current(),before:i,after:"]"})),l(),i+=o.move("]:"+(e.children&&e.children.length>0?" ":"")),o.shift(4),i+=o.move(wge(vge(e,n,o.current()),Bge)),a(),i}function Bge(e,t,n){return t===0?e:(n?"":" ")+e}function U5(e,t,n){const r=t.indexStack,o=e.children||[],i=[];let a=-1,l=n.before;r.push(-1);let u=t.createTracker(n);for(;++a<o.length;){const c=o[a];let f;if(r[r.length-1]=a,a+1<o.length){let d=t.handle.handlers[o[a+1].type];d&&d.peek&&(d=d.peek),f=d?d(o[a+1],e,t,{before:"",after:"",...u.current()}).charAt(0):""}else f=n.after;i.length>0&&(l==="\r"||l===`
|
|
151
|
+
`)&&c.type==="html"&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),l=" ",u=t.createTracker(n),u.move(i.join(""))),i.push(u.move(t.handle(c,e,t,{...u.current(),before:l,after:f}))),l=i[i.length-1].slice(-1)}return r.pop(),i.join("")}const Lge=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];W5.peek=zge;const Nge={canContainEols:["delete"],enter:{strikethrough:Fge},exit:{strikethrough:Hge}},$ge={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Lge}],handlers:{delete:W5}};function Fge(e){this.enter({type:"delete",children:[]},e)}function Hge(e){this.exit(e)}function W5(e,t,n,r){const o=im(r),i=n.enter("strikethrough");let a=o.move("~~");return a+=U5(e,n,{...o.current(),before:a,after:"~"}),a+=o.move("~~"),i(),a}function zge(){return"~"}V5.peek=Uge;function V5(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],l=F5(a);let u;if(a.atBreak)for(;u=l.exec(r);){let c=u.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(u.index+1)}}return o+r+o}function Uge(){return"`"}function Wge(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||Yge,o=[],i=[],a=[],l=[];let u=0,c=-1;for(;++c<e.length;){const m=[],x=[];let k=-1;for(e[c].length>u&&(u=e[c].length);++k<e[c].length;){const v=Vge(e[c][k]);if(t.alignDelimiters!==!1){const y=r(v);x[k]=y,(l[k]===void 0||y>l[k])&&(l[k]=y)}m.push(v)}i[c]=m,a[c]=x}let f=-1;if(typeof n=="object"&&"length"in n)for(;++f<u;)o[f]=JC(n[f]);else{const m=JC(n);for(;++f<u;)o[f]=m}f=-1;const d=[],h=[];for(;++f<u;){const m=o[f];let x="",k="";m===99?(x=":",k=":"):m===108?x=":":m===114&&(k=":");let v=t.alignDelimiters===!1?1:Math.max(1,l[f]-x.length-k.length);const y=x+"-".repeat(v)+k;t.alignDelimiters!==!1&&(v=x.length+v+k.length,v>l[f]&&(l[f]=v),h[f]=v),d[f]=y}i.splice(1,0,d),a.splice(1,0,h),c=-1;const p=[];for(;++c<i.length;){const m=i[c],x=a[c];f=-1;const k=[];for(;++f<u;){const v=m[f]||"";let y="",b="";if(t.alignDelimiters!==!1){const w=l[f]-(x[f]||0),E=o[f];E===114?y=" ".repeat(w):E===99?w%2?(y=" ".repeat(w/2+.5),b=" ".repeat(w/2-.5)):(y=" ".repeat(w/2),b=y):b=" ".repeat(w)}t.delimiterStart!==!1&&!f&&k.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||f)&&k.push(" "),t.alignDelimiters!==!1&&k.push(y),k.push(v),t.alignDelimiters!==!1&&k.push(b),t.padding!==!1&&k.push(" "),(t.delimiterEnd!==!1||f!==u-1)&&k.push("|")}p.push(t.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return p.join(`
|
|
152
|
+
`)}function Vge(e){return e==null?"":String(e)}function Yge(e){return e.length}function JC(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const qge={enter:{table:Gge,tableData:e2,tableHeader:e2,tableRow:Qge},exit:{codeText:Xge,table:Kge,tableData:Oy,tableHeader:Oy,tableRow:Oy}};function Gge(e){const t=e._align;this.enter({type:"table",align:t.map(n=>n==="none"?null:n),children:[]},e),this.setData("inTable",!0)}function Kge(e){this.exit(e),this.setData("inTable")}function Qge(e){this.enter({type:"tableRow",children:[]},e)}function Oy(e){this.exit(e)}function e2(e){this.enter({type:"tableCell",children:[]},e)}function Xge(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,Zge));const n=this.stack[this.stack.length-1];n.value=t,this.exit(e)}function Zge(e,t){return t==="|"?t:e}function Jge(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
153
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:a,tableRow:l,tableCell:u,inlineCode:h}};function a(p,m,x,k){return c(f(p,x,k),p.align)}function l(p,m,x,k){const v=d(p,x,k),y=c([v]);return y.slice(0,y.indexOf(`
|
|
154
|
+
`))}function u(p,m,x,k){const v=x.enter("tableCell"),y=x.enter("phrasing"),b=U5(p,x,{...k,before:i,after:i});return y(),v(),b}function c(p,m){return Wge(p,{align:m,alignDelimiters:r,padding:n,stringLength:o})}function f(p,m,x){const k=p.children;let v=-1;const y=[],b=m.enter("table");for(;++v<k.length;)y[v]=d(k[v],m,x);return b(),y}function d(p,m,x){const k=p.children;let v=-1;const y=[],b=m.enter("tableRow");for(;++v<k.length;)y[v]=u(k[v],p,m,x);return b(),y}function h(p,m,x){let k=V5(p,m,x);return x.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function eme(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function tme(e){const t=e.options.listItemIndent||"tab";if(t===1||t==="1")return"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function nme(e,t,n,r){const o=tme(n);let i=n.bulletCurrent||eme(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let a=i.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(r);l.move(i+" ".repeat(a-i.length)),l.shift(a);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,l.current()),f);return u(),c;function f(d,h,p){return h?(p?"":" ".repeat(a))+d:(p?i:i+" ".repeat(a-i.length))+d}}const rme={exit:{taskListCheckValueChecked:t2,taskListCheckValueUnchecked:t2,paragraph:ime}},ome={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ame}};function t2(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function ime(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1],r=n.children[0];if(r&&r.type==="text"){const o=t.children;let i=-1,a;for(;++i<o.length;){const l=o[i];if(l.type==="paragraph"){a=l;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function ame(e,t,n,r){const o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",l=im(r);i&&l.move(a);let u=nme(e,t,n,{...r,...l.current()});return i&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),u;function c(f){return f+a}}function sme(){return[age,Tge(),Nge,qge,rme]}function lme(e){return{extensions:[sge,Cge(),$ge,Jge(e),ome]}}function ume(e={}){const t=this.data();n("micromarkExtensions",tge(e)),n("fromMarkdownExtensions",sme()),n("toMarkdownExtensions",lme(e));function n(r,o){(t[r]?t[r]:t[r]=[]).push(o)}}function cme(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Tw=function(e){if(e==null)return pme;if(typeof e=="function")return am(e);if(typeof e=="object")return Array.isArray(e)?dme(e):fme(e);if(typeof e=="string")return hme(e);throw new Error("Expected function, string, or object as test")};function dme(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Tw(e[n]);return am(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function fme(e){const t=e;return am(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function hme(e){return am(t);function t(n){return n&&n.type===e}}function am(e){return t;function t(n,r,o){return!!(gme(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function pme(){return!0}function gme(e){return e!==null&&typeof e=="object"&&"type"in e}const Y5=[],mme=!0,n2=!1,yme="skip";function vme(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=Tw(o),a=r?-1:1;l(e,void 0,[])();function l(u,c,f){const d=u&&typeof u=="object"?u:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Y5,m,x,k;if((!t||i(u,c,f[f.length-1]||void 0))&&(p=xme(n(u,f)),p[0]===n2))return p;if("children"in u&&u.children){const v=u;if(v.children&&p[0]!==yme)for(x=(r?v.children.length:-1)+a,k=f.concat(v);x>-1&&x<v.children.length;){const y=v.children[x];if(m=l(y,x,k)(),m[0]===n2)return m;x=typeof m[1]=="number"?m[1]:x+a}}return p}}}function xme(e){return Array.isArray(e)?e:typeof e=="number"?[mme,e]:e==null?Y5:[e]}function bme(e,t,n){const o=Tw((n||{}).ignore||[]),i=wme(t);let a=-1;for(;++a<i.length;)vme(e,"text",l);function l(c,f){let d=-1,h;for(;++d<f.length;){const p=f[d],m=h?h.children:void 0;if(o(p,m?m.indexOf(p):void 0,h))return;h=p}if(h)return u(c,f)}function u(c,f){const d=f[f.length-1],h=i[a][0],p=i[a][1];let m=0;const k=d.children.indexOf(c);let v=!1,y=[];h.lastIndex=0;let b=h.exec(c.value);for(;b;){const w=b.index,E={index:b.index,input:b.input,stack:[...f,c]};let T=p(...b,E);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T!==!1&&(m!==w&&y.push({type:"text",value:c.value.slice(m,w)}),Array.isArray(T)?y.push(...T):T&&y.push(T),m=w+b[0].length,v=!0),!h.global)break;b=h.exec(c.value)}return v?(m<c.value.length&&y.push({type:"text",value:c.value.slice(m)}),d.children.splice(k,1,...y)):y=[c],k+y.length}}function wme(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const o=n[r];t.push([Sme(o[0]),kme(o[1])])}return t}function Sme(e){return typeof e=="string"?new RegExp(cme(e),"g"):e}function kme(e){return typeof e=="function"?e:function(){return e}}function Tme(e){bme(e,[/\r?\n|\r/g,Cme])}function Cme(){return{type:"break"}}function Eme(){const e=this.data();function t(n,r){(e[n]?e[n]:e[n]=[]).push(r)}t("fromMarkdownExtensions",{enter:{lineEndingBlank:function(r){this.enter({type:"break",value:"",data:{},children:[]},r)}},exit:{lineEndingBlank:function(r){this.exit(r)}}})}function jme(){return Tme}const Ime=[Eme,ume,jme],Dme=ze({display:"block",maxWidth:350,padding:8,overflowWrap:"break-word","& p":{margin:0,":not(:first-child)":{marginTop:"0.25rem"}},"& ul, & ol":{listStylePosition:"inside",margin:0,paddingLeft:0},"&>* ul, &>* ol":{marginLeft:"1.5rem"},"& li>p":{display:"contents"},"& blockquote":{paddingLeft:"0.75rem",borderLeft:"3px solid "+S.markdownDark,margin:0},"& hr":{borderTop:"none",borderLeft:"none",borderRight:"none",borderBottom:"1px solid "+S.markdownNormal},"& code":{backgroundColor:S.markdownLight,padding:"0.1rem 0.5rem",borderRadius:"0.25rem"},"& pre":{padding:"0.5rem",backgroundColor:S.markdownLight,borderRadius:"0.5rem",margin:0,":not(:first-child)":{marginTop:"0.25rem"},"& code":{background:"inherit",padding:0,borderRadius:0}},"& table, & th, & td":{border:"1px solid "+S.markdownNormal},"& table":{borderCollapse:"collapse",wordBreak:"break-word"},"& td":{padding:"0.25rem 0.75rem"}});function Cw({notes:e,editable:t,focused:n,onChange:r,onBlur:o,getStyle:i}){const{isNarrowWidth:a}=zt(),l=c=>{r?.(c)},u=g.useRef();return g.useEffect(()=>{n&&t&&u.current.focus()},[n,t]),t?s.jsx("textarea",{ref:u,className:`${ze({border:"1px solid "+S.buttonNormalBorder,padding:7,...!a&&{minWidth:350,minHeight:120},outline:"none",backgroundColor:S.tableBackground,color:S.tableText,...i?.(t)})}`,value:e||"",onChange:c=>l(c.target.value),onBlur:c=>o?.(c.target.value),placeholder:"Notes (markdown supported)"}):s.jsx(z,{...Dme,style:{...i?.(t)},children:s.jsx(D5,{remarkPlugins:Ime,linkTarget:"_blank",children:e})})}const q5=40;function _me({modalProps:e,groupId:t,onSave:n,onAddCategory:r,onEditNotes:o,onDelete:i,onClose:a}){const{grouped:l}=Fr(),u=l.find(b=>b.id===t),c=Pd(()=>pt("notes").filter({id:u.id}).select("*"),[u.id]),f=c&&c.length>0?c[0].note:null;function d(){e?.onClose(),a?.()}function h(b){b!==u.name&&n?.({...u,name:b})}function p(){r?.(u.id,u.is_income)}function m(){o?.(u.id)}function x(){n?.({...u,hidden:!u.hidden}),d()}function k(){i?.(u.id)}function v(b){h(b)}const y={...X.mediumText,height:q5,color:S.formLabelText,flexBasis:"48%",marginLeft:"1%",marginRight:"1%"};return s.jsx(_e,{title:u.name,showHeader:!0,focusAfterClose:!1,...e,onClose:d,padding:0,style:{flex:1,height:"45vh",padding:"0 10px",borderRadius:"6px"},editableTitle:!0,titleStyle:X.underlinedText,onTitleUpdate:v,leftHeaderContent:s.jsx(Ome,{group:u,onDelete:k,onToggleVisibility:x}),children:({isEditingTitle:b})=>s.jsxs(I,{style:{flex:1,flexDirection:"column"},children:[s.jsx(I,{style:{overflowY:"auto",flex:1},children:s.jsx(Cw,{notes:f?.length>0?f:"No notes",editable:!1,focused:!1,getStyle:()=>({...X.mediumText,borderRadius:6,...(!f||f.length===0)&&{justifySelf:"center",alignSelf:"center",color:S.pageTextSubdued}})})}),s.jsxs(I,{style:{flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between",alignContent:"space-between",paddingTop:10,paddingBottom:10},children:[s.jsxs(q,{disabled:b,style:{...y,display:b?"none":void 0},onClick:p,children:[s.jsx(xs,{width:17,height:17,style:{paddingRight:5}}),"Add category"]}),s.jsxs(q,{style:{...y,display:b?"none":void 0},onClick:m,children:[s.jsx(lP,{width:20,height:20,style:{paddingRight:5}}),"Edit notes"]})]})]})})}function Ome({group:e,onDelete:t,onToggleVisibility:n}){const[r,o]=g.useState(!1),i={...X.mediumText,height:q5};return s.jsx(I,{children:s.jsxs(q,{type:"bare","aria-label":"Menu",onClick:()=>{o(!0)},children:[s.jsx(Od,{width:17,height:17,style:{color:"currentColor"}}),r&&s.jsx(Et,{position:"bottom-left",style:{padding:0},onClose:()=>{o(!1)},children:s.jsx(wt,{style:{...X.mediumText,color:S.formLabelText},items:[{name:"toggleVisibility",text:e.hidden?"Show":"Hide",icon:e.hidden?nw:tw,iconSize:16,style:i},...!e.is_income&&[wt.line,{name:"delete",text:"Delete",icon:Bg,iconSize:15,style:i}]].filter(a=>a!=null),onMenuSelect:a=>{o(!1),a==="delete"?t():a==="toggleVisibility"&&n()}})})]})})}const G5=40;function Ame({modalProps:e,categoryId:t,onSave:n,onEditNotes:r,onDelete:o,onClose:i}){const{list:a}=Fr(),l=a.find(v=>v.id===t),u=Pd(()=>pt("notes").filter({id:l.id}).select("*"),[l.id]),c=u&&u.length>0?u[0].note:null;function f(){e?.onClose(),i?.()}function d(v){v!==l.name&&n?.({...l,name:v})}function h(){n?.({...l,hidden:!l.hidden}),f()}function p(){r?.(l.id)}function m(){o?.(l.id)}function x(v){d(v)}const k={...X.mediumText,height:G5,color:S.formLabelText,flexBasis:"100%"};return s.jsx(_e,{title:l.name,titleStyle:X.underlinedText,showHeader:!0,focusAfterClose:!1,...e,onClose:f,padding:0,style:{flex:1,height:"45vh",padding:"0 10px",borderRadius:"6px"},editableTitle:!0,onTitleUpdate:x,leftHeaderContent:s.jsx(Pme,{category:l,onDelete:m,onToggleVisibility:h}),children:({isEditingTitle:v})=>s.jsxs(I,{style:{flex:1,flexDirection:"column"},children:[s.jsx(I,{style:{overflowY:"auto",flex:1},children:s.jsx(Cw,{notes:c?.length>0?c:"No notes",editable:!1,focused:!1,getStyle:()=>({borderRadius:6,...(!c||c.length===0)&&{justifySelf:"center",alignSelf:"center",color:S.pageTextSubdued}})})}),s.jsx(I,{style:{flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between",alignContent:"space-between",margin:"10px 0"},children:s.jsxs(q,{style:{...k,display:v?"none":void 0},onClick:p,children:[s.jsx(lP,{width:20,height:20,style:{paddingRight:5}}),"Edit notes"]})})]})})}function Pme({category:e,onDelete:t,onToggleVisibility:n}){const[r,o]=g.useState(!1),i={...X.mediumText,height:G5};return s.jsx(I,{children:s.jsxs(q,{type:"bare","aria-label":"Menu",onClick:()=>{o(!0)},children:[s.jsx(Od,{width:17,height:17,style:{color:"currentColor"}}),r&&s.jsx(Et,{position:"bottom-left",style:{padding:0},onClose:()=>{o(!1)},children:s.jsx(wt,{items:[{name:"toggleVisibility",text:e.hidden?"Show":"Hide",icon:e.hidden?nw:tw,iconSize:16,style:i},wt.line,{name:"delete",text:"Delete",icon:Bg,iconSize:15,style:i}],onMenuSelect:a=>{o(!1),a==="delete"?t():a==="toggleVisibility"&&n()}})})]})})}function Ew({children:e,...t}){return s.jsx(z,{...t,style:{...t.style,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:e})}function Mme(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,fp(e,t)}var at={};/** @license React v17.0.2
|
|
155
|
+
* react-is.production.min.js
|
|
156
|
+
*
|
|
157
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the MIT license found in the
|
|
160
|
+
* LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/var sm=60103,lm=60106,$d=60107,Fd=60108,Hd=60114,zd=60109,Ud=60110,Wd=60112,Vd=60113,jw=60120,Yd=60115,qd=60116,K5=60121,Q5=60122,X5=60117,Z5=60129,J5=60131;if(typeof Symbol=="function"&&Symbol.for){var ln=Symbol.for;sm=ln("react.element"),lm=ln("react.portal"),$d=ln("react.fragment"),Fd=ln("react.strict_mode"),Hd=ln("react.profiler"),zd=ln("react.provider"),Ud=ln("react.context"),Wd=ln("react.forward_ref"),Vd=ln("react.suspense"),jw=ln("react.suspense_list"),Yd=ln("react.memo"),qd=ln("react.lazy"),K5=ln("react.block"),Q5=ln("react.server.block"),X5=ln("react.fundamental"),Z5=ln("react.debug_trace_mode"),J5=ln("react.legacy_hidden")}function vo(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case sm:switch(e=e.type,e){case $d:case Hd:case Fd:case Vd:case jw:return e;default:switch(e=e&&e.$$typeof,e){case Ud:case Wd:case qd:case Yd:case zd:return e;default:return t}}case lm:return t}}}var Rme=zd,Bme=sm,Lme=Wd,Nme=$d,$me=qd,Fme=Yd,Hme=lm,zme=Hd,Ume=Fd,Wme=Vd;at.ContextConsumer=Ud;at.ContextProvider=Rme;at.Element=Bme;at.ForwardRef=Lme;at.Fragment=Nme;at.Lazy=$me;at.Memo=Fme;at.Portal=Hme;at.Profiler=zme;at.StrictMode=Ume;at.Suspense=Wme;at.isAsyncMode=function(){return!1};at.isConcurrentMode=function(){return!1};at.isContextConsumer=function(e){return vo(e)===Ud};at.isContextProvider=function(e){return vo(e)===zd};at.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===sm};at.isForwardRef=function(e){return vo(e)===Wd};at.isFragment=function(e){return vo(e)===$d};at.isLazy=function(e){return vo(e)===qd};at.isMemo=function(e){return vo(e)===Yd};at.isPortal=function(e){return vo(e)===lm};at.isProfiler=function(e){return vo(e)===Hd};at.isStrictMode=function(e){return vo(e)===Fd};at.isSuspense=function(e){return vo(e)===Vd};at.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===$d||e===Hd||e===Z5||e===Fd||e===Vd||e===jw||e===J5||typeof e=="object"&&e!==null&&(e.$$typeof===qd||e.$$typeof===Yd||e.$$typeof===zd||e.$$typeof===Ud||e.$$typeof===Wd||e.$$typeof===X5||e.$$typeof===K5||e[0]===Q5)};at.typeOf=vo;let r2=e=>typeof e=="object"&&e!=null&&e.nodeType===1,o2=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",Ay=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return o2(n.overflowY,t)||o2(n.overflowX,t)||(r=>{let o=(i=>{if(!i.ownerDocument||!i.ownerDocument.defaultView)return null;try{return i.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!o&&(o.clientHeight<r.scrollHeight||o.clientWidth<r.scrollWidth)})(e)}return!1},_f=(e,t,n,r,o,i,a,l)=>i<e&&a>t||i>e&&a<t?0:i<=e&&l<=n||a>=t&&l>=n?i-e-r:a>t&&l<n||i<e&&l>n?a-t+o:0,Vme=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)};var Yme=(e,t)=>{var n,r,o,i,a,l;if(typeof document>"u")return[];let{scrollMode:u,block:c,inline:f,boundary:d,skipOverflowHiddenElements:h}=t,p=typeof d=="function"?d:L=>L!==d;if(!r2(e))throw new TypeError("Invalid target");let m=document.scrollingElement||document.documentElement,x=[],k=e;for(;r2(k)&&p(k);){if(k=Vme(k),k===m){x.push(k);break}k!=null&&k===document.body&&Ay(k)&&!Ay(document.documentElement)||k!=null&&Ay(k,h)&&x.push(k)}let v=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,y=(i=(o=window.visualViewport)==null?void 0:o.height)!=null?i:innerHeight,b=(a=window.scrollX)!=null?a:pageXOffset,w=(l=window.scrollY)!=null?l:pageYOffset,{height:E,width:T,top:_,right:M,bottom:B,left:O}=e.getBoundingClientRect(),N=c==="start"||c==="nearest"?_:c==="end"?B:_+E/2,H=f==="center"?O+T/2:f==="end"?M:O,F=[];for(let L=0;L<x.length;L++){let R=x[L],{height:U,width:P,top:j,right:D,bottom:C,left:$}=R.getBoundingClientRect();if(u==="if-needed"&&_>=0&&O>=0&&B<=y&&M<=v&&_>=j&&B<=C&&O>=$&&M<=D)return F;let W=getComputedStyle(R),A=parseInt(W.borderLeftWidth,10),J=parseInt(W.borderTopWidth,10),le=parseInt(W.borderRightWidth,10),ee=parseInt(W.borderBottomWidth,10),ie=0,V=0,Q="offsetWidth"in R?R.offsetWidth-R.clientWidth-A-le:0,ce="offsetHeight"in R?R.offsetHeight-R.clientHeight-J-ee:0,He="offsetWidth"in R?R.offsetWidth===0?0:P/R.offsetWidth:0,Re="offsetHeight"in R?R.offsetHeight===0?0:U/R.offsetHeight:0;if(m===R)ie=c==="start"?N:c==="end"?N-y:c==="nearest"?_f(w,w+y,y,J,ee,w+N,w+N+E,E):N-y/2,V=f==="start"?H:f==="center"?H-v/2:f==="end"?H-v:_f(b,b+v,v,A,le,b+H,b+H+T,T),ie=Math.max(0,ie+w),V=Math.max(0,V+b);else{ie=c==="start"?N-j-J:c==="end"?N-C+ee+ce:c==="nearest"?_f(j,C,U,J,ee+ce,N,N+E,E):N-(j+U/2)+ce/2,V=f==="start"?H-$-A:f==="center"?H-($+P/2)+Q/2:f==="end"?H-D+le+Q:_f($,D,P,A,le+Q,H,H+T,T);let{scrollLeft:me,scrollTop:ft}=R;ie=Math.max(0,Math.min(ft+ie/Re,R.scrollHeight-U/Re+ce)),V=Math.max(0,Math.min(me+V/He,R.scrollWidth-P/He+Q)),N+=ft-ie,H+=me-V}F.push({el:R,top:ie,left:V})}return F},Sp=function(){return Sp=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Sp.apply(this,arguments)};var qme=0;function i2(e){return typeof e=="function"?e:Ai}function Ai(){}function eM(e,t){if(e){var n=Yme(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});n.forEach(function(r){var o=r.el,i=r.top,a=r.left;o.scrollTop=i,o.scrollLeft=a})}}function a2(e,t,n){var r=e===t||t instanceof n.Node&&e.contains&&e.contains(t);return r}function Iw(e,t){var n;function r(){n&&clearTimeout(n)}function o(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];r(),n=setTimeout(function(){n=null,e.apply(void 0,a)},t)}return o.cancel=r,o}function bo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return t.some(function(l){return l&&l.apply(void 0,[r].concat(i)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function s2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){t.forEach(function(o){typeof o=="function"?o(r):o&&(o.current=r)})}}function Gme(){return String(qme++)}function tM(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?n+" result"+(n===1?" is":"s are")+" available, use up and down arrow keys to navigate. Press Enter key to select.":"":"No results are available.":""}function l2(e,t){return e=Array.isArray(e)?e[0]:e,!e&&t?t:e}function Kme(e){return typeof e.type=="string"}function Qme(e){return e.props}var Xme=["highlightedIndex","inputValue","isOpen","selectedItem","type"];function Of(e){e===void 0&&(e={});var t={};return Xme.forEach(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}function Zme(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=ix(t,r)?t[r]:e[r],n},{})}function ix(e,t){return e[t]!==void 0}function u2(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function Py(e,t,n,r,o){if(o===void 0&&(o=!0),n===0)return-1;var i=n-1;(typeof t!="number"||t<0||t>=n)&&(t=e>0?-1:i+1);var a=t+e;a<0?a=o?i:0:a>i&&(a=o?0:i);var l=Vc(e,a,n,r,o);return l===-1?t>=n?-1:t:l}function Vc(e,t,n,r,o){var i=r(t);if(!i||!i.hasAttribute("disabled"))return t;if(e>0){for(var a=t+1;a<n;a++)if(!r(a).hasAttribute("disabled"))return a}else for(var l=t-1;l>=0;l--)if(!r(l).hasAttribute("disabled"))return l;return o?e>0?Vc(1,0,n,r,!1):Vc(-1,n-1,n,r,!1):-1}function c2(e,t,n,r){return r===void 0&&(r=!0),t.some(function(o){return o&&(a2(o,e,n)||r&&a2(o,n.document.activeElement,n))})}var Jme=Iw(function(e){rM(e).textContent=""},500);function nM(e,t){var n=rM(t);e&&(n.textContent=e,Jme(t))}function rM(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var oM=0,iM=1,aM=2,sh=3,lh=4,sM=5,lM=6,uM=7,cM=8,dM=9,fM=10,hM=11,pM=12,gM=13,mM=14,yM=15,vM=16,eye=Object.freeze({__proto__:null,unknown:oM,mouseUp:iM,itemMouseEnter:aM,keyDownArrowUp:sh,keyDownArrowDown:lh,keyDownEscape:sM,keyDownEnter:lM,keyDownHome:uM,keyDownEnd:cM,clickItem:dM,blurInput:fM,changeInput:hM,keyDownSpaceButton:pM,clickButton:gM,blurButton:mM,controlledPropUpdatedSelectedItem:yM,touchEnd:vM}),tye=["refKey","ref"],nye=["onClick","onPress","onKeyDown","onKeyUp","onBlur"],rye=["onKeyDown","onBlur","onChange","onInput","onChangeText"],oye=["refKey","ref"],iye=["onMouseMove","onMouseDown","onClick","onPress","index","item"],aye=function(){var e=function(t){Mme(n,t);function n(o){var i;i=t.call(this,o)||this,i.id=i.props.id||"downshift-"+Gme(),i.menuId=i.props.menuId||i.id+"-menu",i.labelId=i.props.labelId||i.id+"-label",i.inputId=i.props.inputId||i.id+"-input",i.getItemId=i.props.getItemId||function(y){return i.id+"-item-"+y},i.input=null,i.items=[],i.itemCount=null,i.previousResultCount=0,i.timeoutIds=[],i.internalSetTimeout=function(y,b){var w=setTimeout(function(){i.timeoutIds=i.timeoutIds.filter(function(E){return E!==w}),y()},b);i.timeoutIds.push(w)},i.setItemCount=function(y){i.itemCount=y},i.unsetItemCount=function(){i.itemCount=null},i.setHighlightedIndex=function(y,b){y===void 0&&(y=i.props.defaultHighlightedIndex),b===void 0&&(b={}),b=Of(b),i.internalSetState(Kt({highlightedIndex:y},b))},i.clearSelection=function(y){i.internalSetState({selectedItem:null,inputValue:"",highlightedIndex:i.props.defaultHighlightedIndex,isOpen:i.props.defaultIsOpen},y)},i.selectItem=function(y,b,w){b=Of(b),i.internalSetState(Kt({isOpen:i.props.defaultIsOpen,highlightedIndex:i.props.defaultHighlightedIndex,selectedItem:y,inputValue:i.props.itemToString(y)},b),w)},i.selectItemAtIndex=function(y,b,w){var E=i.items[y];E!=null&&i.selectItem(E,b,w)},i.selectHighlightedItem=function(y,b){return i.selectItemAtIndex(i.getState().highlightedIndex,y,b)},i.internalSetState=function(y,b){var w,E,T={},_=typeof y=="function";return!_&&y.hasOwnProperty("inputValue")&&i.props.onInputValueChange(y.inputValue,Kt({},i.getStateAndHelpers(),y)),i.setState(function(M){M=i.getState(M);var B=_?y(M):y;B=i.props.stateReducer(M,B),w=B.hasOwnProperty("selectedItem");var O={};return w&&B.selectedItem!==M.selectedItem&&(E=B.selectedItem),B.type=B.type||oM,Object.keys(B).forEach(function(N){M[N]!==B[N]&&(T[N]=B[N]),N!=="type"&&(B[N],ix(i.props,N)||(O[N]=B[N]))}),_&&B.hasOwnProperty("inputValue")&&i.props.onInputValueChange(B.inputValue,Kt({},i.getStateAndHelpers(),B)),O},function(){i2(b)();var M=Object.keys(T).length>1;M&&i.props.onStateChange(T,i.getStateAndHelpers()),w&&i.props.onSelect(y.selectedItem,i.getStateAndHelpers()),E!==void 0&&i.props.onChange(E,i.getStateAndHelpers()),i.props.onUserAction(T,i.getStateAndHelpers())})},i.rootRef=function(y){return i._rootNode=y},i.getRootProps=function(y,b){var w,E=y===void 0?{}:y,T=E.refKey,_=T===void 0?"ref":T,M=E.ref,B=iu(E,tye),O=b===void 0?{}:b,N=O.suppressRefError,H=N===void 0?!1:N;i.getRootProps.called=!0,i.getRootProps.refKey=_,i.getRootProps.suppressRefError=H;var F=i.getState(),L=F.isOpen;return Kt((w={},w[_]=s2(M,i.rootRef),w.role="combobox",w["aria-expanded"]=L,w["aria-haspopup"]="listbox",w["aria-owns"]=L?i.menuId:null,w["aria-labelledby"]=i.labelId,w),B)},i.keyDownHandlers={ArrowDown:function(b){var w=this;if(b.preventDefault(),this.getState().isOpen){var E=b.shiftKey?5:1;this.moveHighlightedIndex(E,{type:lh})}else this.internalSetState({isOpen:!0,type:lh},function(){var T=w.getItemCount();if(T>0){var _=w.getState(),M=_.highlightedIndex,B=Py(1,M,T,function(O){return w.getItemNodeFromIndex(O)});w.setHighlightedIndex(B,{type:lh})}})},ArrowUp:function(b){var w=this;if(b.preventDefault(),this.getState().isOpen){var E=b.shiftKey?-5:-1;this.moveHighlightedIndex(E,{type:sh})}else this.internalSetState({isOpen:!0,type:sh},function(){var T=w.getItemCount();if(T>0){var _=w.getState(),M=_.highlightedIndex,B=Py(-1,M,T,function(O){return w.getItemNodeFromIndex(O)});w.setHighlightedIndex(B,{type:sh})}})},Enter:function(b){if(b.which!==229){var w=this.getState(),E=w.isOpen,T=w.highlightedIndex;if(E&&T!=null){b.preventDefault();var _=this.items[T],M=this.getItemNodeFromIndex(T);if(_==null||M&&M.hasAttribute("disabled"))return;this.selectHighlightedItem({type:lM})}}},Escape:function(b){b.preventDefault(),this.reset(Kt({type:sM},!this.state.isOpen&&{selectedItem:null,inputValue:""}))}},i.buttonKeyDownHandlers=Kt({},i.keyDownHandlers,{" ":function(b){b.preventDefault(),this.toggleMenu({type:pM})}}),i.inputKeyDownHandlers=Kt({},i.keyDownHandlers,{Home:function(b){var w=this,E=this.getState(),T=E.isOpen;if(T){b.preventDefault();var _=this.getItemCount();if(!(_<=0||!T)){var M=Vc(1,0,_,function(B){return w.getItemNodeFromIndex(B)},!1);this.setHighlightedIndex(M,{type:uM})}}},End:function(b){var w=this,E=this.getState(),T=E.isOpen;if(T){b.preventDefault();var _=this.getItemCount();if(!(_<=0||!T)){var M=Vc(-1,_-1,_,function(B){return w.getItemNodeFromIndex(B)},!1);this.setHighlightedIndex(M,{type:cM})}}}}),i.getToggleButtonProps=function(y){var b=y===void 0?{}:y,w=b.onClick;b.onPress;var E=b.onKeyDown,T=b.onKeyUp,_=b.onBlur,M=iu(b,nye),B=i.getState(),O=B.isOpen,N={onClick:bo(w,i.buttonHandleClick),onKeyDown:bo(E,i.buttonHandleKeyDown),onKeyUp:bo(T,i.buttonHandleKeyUp),onBlur:bo(_,i.buttonHandleBlur)},H=M.disabled?{}:N;return Kt({type:"button",role:"button","aria-label":O?"close menu":"open menu","aria-haspopup":!0,"data-toggle":!0},H,M)},i.buttonHandleKeyUp=function(y){y.preventDefault()},i.buttonHandleKeyDown=function(y){var b=u2(y);i.buttonKeyDownHandlers[b]&&i.buttonKeyDownHandlers[b].call(se(i),y)},i.buttonHandleClick=function(y){y.preventDefault(),i.props.environment.document.activeElement===i.props.environment.document.body&&y.target.focus(),i.internalSetTimeout(function(){return i.toggleMenu({type:gM})})},i.buttonHandleBlur=function(y){var b=y.target;i.internalSetTimeout(function(){!i.isMouseDown&&(i.props.environment.document.activeElement==null||i.props.environment.document.activeElement.id!==i.inputId)&&i.props.environment.document.activeElement!==b&&i.reset({type:mM})})},i.getLabelProps=function(y){return Kt({htmlFor:i.inputId,id:i.labelId},y)},i.getInputProps=function(y){var b=y===void 0?{}:y,w=b.onKeyDown,E=b.onBlur,T=b.onChange,_=b.onInput;b.onChangeText;var M=iu(b,rye),B,O={};B="onChange";var N=i.getState(),H=N.inputValue,F=N.isOpen,L=N.highlightedIndex;if(!M.disabled){var R;O=(R={},R[B]=bo(T,_,i.inputHandleChange),R.onKeyDown=bo(w,i.inputHandleKeyDown),R.onBlur=bo(E,i.inputHandleBlur),R)}return Kt({"aria-autocomplete":"list","aria-activedescendant":F&&typeof L=="number"&&L>=0?i.getItemId(L):null,"aria-controls":F?i.menuId:null,"aria-labelledby":M&&M["aria-label"]?void 0:i.labelId,autoComplete:"off",value:H,id:i.inputId},O,M)},i.inputHandleKeyDown=function(y){var b=u2(y);b&&i.inputKeyDownHandlers[b]&&i.inputKeyDownHandlers[b].call(se(i),y)},i.inputHandleChange=function(y){i.internalSetState({type:hM,isOpen:!0,inputValue:y.target.value,highlightedIndex:i.props.defaultHighlightedIndex})},i.inputHandleBlur=function(){i.internalSetTimeout(function(){var y=i.props.environment.document&&!!i.props.environment.document.activeElement&&!!i.props.environment.document.activeElement.dataset&&i.props.environment.document.activeElement.dataset.toggle&&i._rootNode&&i._rootNode.contains(i.props.environment.document.activeElement);!i.isMouseDown&&!y&&i.reset({type:fM})})},i.menuRef=function(y){i._menuNode=y},i.getMenuProps=function(y,b){var w,E=y===void 0?{}:y,T=E.refKey,_=T===void 0?"ref":T,M=E.ref,B=iu(E,oye),O=b===void 0?{}:b,N=O.suppressRefError,H=N===void 0?!1:N;return i.getMenuProps.called=!0,i.getMenuProps.refKey=_,i.getMenuProps.suppressRefError=H,Kt((w={},w[_]=s2(M,i.menuRef),w.role="listbox",w["aria-labelledby"]=B&&B["aria-label"]?null:i.labelId,w.id=i.menuId,w),B)},i.getItemProps=function(y){var b,w=y===void 0?{}:y,E=w.onMouseMove,T=w.onMouseDown,_=w.onClick;w.onPress;var M=w.index,B=w.item,O=B===void 0?void 0:B,N=iu(w,iye);M===void 0?(i.items.push(O),M=i.items.indexOf(O)):i.items[M]=O;var H="onClick",F=_,L=(b={onMouseMove:bo(E,function(){M!==i.getState().highlightedIndex&&(i.setHighlightedIndex(M,{type:aM}),i.avoidScrolling=!0,i.internalSetTimeout(function(){return i.avoidScrolling=!1},250))}),onMouseDown:bo(T,function(U){U.preventDefault()})},b[H]=bo(F,function(){i.selectItemAtIndex(M,{type:dM})}),b),R=N.disabled?{onMouseDown:L.onMouseDown}:L;return Kt({id:i.getItemId(M),role:"option","aria-selected":i.getState().highlightedIndex===M},R,N)},i.clearItems=function(){i.items=[]},i.reset=function(y,b){y===void 0&&(y={}),y=Of(y),i.internalSetState(function(w){var E=w.selectedItem;return Kt({isOpen:i.props.defaultIsOpen,highlightedIndex:i.props.defaultHighlightedIndex,inputValue:i.props.itemToString(E)},y)},b)},i.toggleMenu=function(y,b){y===void 0&&(y={}),y=Of(y),i.internalSetState(function(w){var E=w.isOpen;return Kt({isOpen:!E},E&&{highlightedIndex:i.props.defaultHighlightedIndex},y)},function(){var w=i.getState(),E=w.isOpen,T=w.highlightedIndex;E&&i.getItemCount()>0&&typeof T=="number"&&i.setHighlightedIndex(T,y),i2(b)()})},i.openMenu=function(y){i.internalSetState({isOpen:!0},y)},i.closeMenu=function(y){i.internalSetState({isOpen:!1},y)},i.updateStatus=Iw(function(){var y=i.getState(),b=i.items[y.highlightedIndex],w=i.getItemCount(),E=i.props.getA11yStatusMessage(Kt({itemToString:i.props.itemToString,previousResultCount:i.previousResultCount,resultCount:w,highlightedItem:b},y));i.previousResultCount=w,nM(E,i.props.environment.document)},200);var a=i.props,l=a.defaultHighlightedIndex,u=a.initialHighlightedIndex,c=u===void 0?l:u,f=a.defaultIsOpen,d=a.initialIsOpen,h=d===void 0?f:d,p=a.initialInputValue,m=p===void 0?"":p,x=a.initialSelectedItem,k=x===void 0?null:x,v=i.getState({highlightedIndex:c,isOpen:h,inputValue:m,selectedItem:k});return v.selectedItem!=null&&i.props.initialInputValue===void 0&&(v.inputValue=i.props.itemToString(v.selectedItem)),i.state=v,i}var r=n.prototype;return r.internalClearTimeouts=function(){this.timeoutIds.forEach(function(i){clearTimeout(i)}),this.timeoutIds=[]},r.getState=function(i){return i===void 0&&(i=this.state),Zme(i,this.props)},r.getItemCount=function(){var i=this.items.length;return this.itemCount!=null?i=this.itemCount:this.props.itemCount!==void 0&&(i=this.props.itemCount),i},r.getItemNodeFromIndex=function(i){return this.props.environment.document.getElementById(this.getItemId(i))},r.scrollHighlightedItemIntoView=function(){{var i=this.getItemNodeFromIndex(this.getState().highlightedIndex);this.props.scrollIntoView(i,this._menuNode)}},r.moveHighlightedIndex=function(i,a){var l=this,u=this.getItemCount(),c=this.getState(),f=c.highlightedIndex;if(u>0){var d=Py(i,f,u,function(h){return l.getItemNodeFromIndex(h)});this.setHighlightedIndex(d,a)}},r.getStateAndHelpers=function(){var i=this.getState(),a=i.highlightedIndex,l=i.inputValue,u=i.selectedItem,c=i.isOpen,f=this.props.itemToString,d=this.id,h=this.getRootProps,p=this.getToggleButtonProps,m=this.getLabelProps,x=this.getMenuProps,k=this.getInputProps,v=this.getItemProps,y=this.openMenu,b=this.closeMenu,w=this.toggleMenu,E=this.selectItem,T=this.selectItemAtIndex,_=this.selectHighlightedItem,M=this.setHighlightedIndex,B=this.clearSelection,O=this.clearItems,N=this.reset,H=this.setItemCount,F=this.unsetItemCount,L=this.internalSetState;return{getRootProps:h,getToggleButtonProps:p,getLabelProps:m,getMenuProps:x,getInputProps:k,getItemProps:v,reset:N,openMenu:y,closeMenu:b,toggleMenu:w,selectItem:E,selectItemAtIndex:T,selectHighlightedItem:_,setHighlightedIndex:M,clearSelection:B,clearItems:O,setItemCount:H,unsetItemCount:F,setState:L,itemToString:f,id:d,highlightedIndex:a,inputValue:l,isOpen:c,selectedItem:u}},r.componentDidMount=function(){var i=this;{var a=function(){i.isMouseDown=!0},l=function(p){i.isMouseDown=!1;var m=c2(p.target,[i._rootNode,i._menuNode],i.props.environment);!m&&i.getState().isOpen&&i.reset({type:iM},function(){return i.props.onOuterClick(i.getStateAndHelpers())})},u=function(){i.isTouchMove=!1},c=function(){i.isTouchMove=!0},f=function(p){var m=c2(p.target,[i._rootNode,i._menuNode],i.props.environment,!1);!i.isTouchMove&&!m&&i.getState().isOpen&&i.reset({type:vM},function(){return i.props.onOuterClick(i.getStateAndHelpers())})},d=this.props.environment;d.addEventListener("mousedown",a),d.addEventListener("mouseup",l),d.addEventListener("touchstart",u),d.addEventListener("touchmove",c),d.addEventListener("touchend",f),this.cleanup=function(){i.internalClearTimeouts(),i.updateStatus.cancel(),d.removeEventListener("mousedown",a),d.removeEventListener("mouseup",l),d.removeEventListener("touchstart",u),d.removeEventListener("touchmove",c),d.removeEventListener("touchend",f)}}},r.shouldScroll=function(i,a){var l=this.props.highlightedIndex===void 0?this.getState():this.props,u=l.highlightedIndex,c=a.highlightedIndex===void 0?i:a,f=c.highlightedIndex,d=u&&this.getState().isOpen&&!i.isOpen,h=u!==f;return d||h},r.componentDidUpdate=function(i,a){ix(this.props,"selectedItem")&&this.props.selectedItemChanged(i.selectedItem,this.props.selectedItem)&&this.internalSetState({type:yM,inputValue:this.props.itemToString(this.props.selectedItem)}),!this.avoidScrolling&&this.shouldScroll(a,i)&&this.scrollHighlightedItemIntoView(),this.updateStatus()},r.componentWillUnmount=function(){this.cleanup()},r.render=function(){var i=l2(this.props.children,Ai);this.clearItems(),this.getRootProps.called=!1,this.getRootProps.refKey=void 0,this.getRootProps.suppressRefError=void 0,this.getMenuProps.called=!1,this.getMenuProps.refKey=void 0,this.getMenuProps.suppressRefError=void 0,this.getLabelProps.called=!1,this.getInputProps.called=!1;var a=l2(i(this.getStateAndHelpers()));if(!a)return null;if(this.getRootProps.called||this.props.suppressRefError)return a;if(Kme(a))return g.cloneElement(a,this.getRootProps(Qme(a)))},n}(g.Component);return e.defaultProps={defaultHighlightedIndex:null,defaultIsOpen:!1,getA11yStatusMessage:tM,itemToString:function(n){return n==null?"":String(n)},onStateChange:Ai,onInputValueChange:Ai,onUserAction:Ai,onChange:Ai,onSelect:Ai,onOuterClick:Ai,selectedItemChanged:function(n,r){return n!==r},environment:typeof window>"u"?{}:window,stateReducer:function(n,r){return r},suppressRefError:!1,scrollIntoView:eM},e.stateChangeTypes=eye,e}(),wo=aye;function sye(e,t){return t.changes}function lye(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""}Iw(function(e,t){nM(e(),t)},200);function uye(e){return e?String(e):""}var oc={itemToString:uye,stateReducer:sye,getA11ySelectionMessage:lye,scrollIntoView:eM,environment:typeof window>"u"?{}:window};G.array.isRequired,G.func,G.func,G.func,G.number,G.number,G.number,G.bool,G.bool,G.bool,G.any,G.any,G.any,G.string,G.string,G.string,G.func,G.string,G.func,G.func,G.func,G.func,G.func,G.shape({addEventListener:G.func,removeEventListener:G.func,document:G.shape({getElementById:G.func,activeElement:G.any,body:G.any})});function cye(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(n===1?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}Sp(Sp({},oc),{getA11yStatusMessage:cye});G.array.isRequired,G.func,G.func,G.func,G.func,G.number,G.number,G.number,G.bool,G.bool,G.bool,G.any,G.any,G.any,G.string,G.string,G.string,G.string,G.string,G.string,G.func,G.string,G.string,G.func,G.func,G.func,G.func,G.func,G.func,G.shape({addEventListener:G.func,removeEventListener:G.func,document:G.shape({getElementById:G.func,activeElement:G.any,body:G.any})});Kt({},oc,{selectedItemChanged:function(t,n){return t!==n},getA11yStatusMessage:tM});function dye(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+" has been removed."}G.array,G.array,G.array,G.func,G.func,G.func,G.number,G.number,G.number,G.func,G.func,G.string,G.string,G.shape({addEventListener:G.func,removeEventListener:G.func,document:G.shape({getElementById:G.func,activeElement:G.any,body:G.any})});oc.itemToString,oc.stateReducer,oc.environment;const d2={};function Ou(e,t,n){if(e){const r=t.findIndex(o=>o.id===n);return r===-1?null:t[r]}return n}function Ga(e){return e==null?"":typeof e=="string"?e:e.name||""}function Wa(e){return typeof e=="string"?e:e?e.id:null}function Dw(e,t){return Ga(e).toLowerCase().includes(t.toLowerCase())}function fye(e,t){return e.filter(n=>Dw(n,t))}function Af(e,t,n,r,o){let i=null;if(!t)i=o;else if(r==null){const a=n.find(l=>l.id===o);a&&(i=a.id)}else r<n.length&&(i=n[r].id);e?.(i,o)}function hye(e){return s.jsx(Ke,{...e})}function pye(e,t,n){return s.jsx("div",{children:e.map((r,o)=>{const i=Ga(r);return g.createElement("div",{...t({item:r}),role:"button",key:i,className:`${ze({padding:5,cursor:"default",backgroundColor:n===o?S.menuAutoCompleteBackgroundHover:null})}`},i)})})}function gye(e){return e.code==="Enter"}function mye(e){return e?Ga(e):""}function yye({focused:e,embedded:t=!1,containerProps:n,labelProps:r={},inputProps:o={},suggestions:i,tooltipStyle:a,tooltipProps:l,renderInput:u=hye,renderItems:c=pye,itemToString:f=mye,shouldSaveFromKey:d=gye,filterSuggestions:h=fye,openOnFocus:p=!0,getHighlightedIndex:m,highlightFirst:x,onUpdate:k,strict:v,onSelect:y,clearOnBlur:b=!0,clearOnSelect:w=!1,closeOnBlur:E=!0,onClose:T,value:_}){const[M,B]=g.useState(()=>Ou(v,i,_)),[O,N]=g.useState(M?Ga(M):""),[H,F]=g.useState(!1),[L,R]=g.useState(M),U=g.useMemo(()=>h(i,O),[h,i,O]),[P,j]=g.useState(null),[D,C]=g.useState(t),$=()=>C(!0),W=()=>{C(!1),T?.()},{isNarrowWidth:A}=zt(),J=A?{...X.mobileMenuItem}:{};o={...o,style:{...J,...o.style}},g.useEffect(()=>{B(Ou(v,i,_))},[_,i,v]);function le(V){const ce=Ou(v,i,V===void 0?_:V);B(ce),N(ce?Ga(ce):""),R(ce),j(null),C(t),F(!1)}function ee(){N(""),B(null),j(null),F(!1)}const ie=H&&U||i;return s.jsx(wo,{onSelect:(V,{inputValue:Q})=>{B(V),j(null),w?N(""):W(),y&&setTimeout(()=>{y(Wa(V),Q)},0)},highlightedIndex:P,selectedItem:M instanceof Object?M:null,itemToString:f,inputValue:O,isOpen:D,onInputValueChange:(V,Q)=>{if(!document.hasFocus()||[wo.stateChangeTypes.controlledPropUpdatedSelectedItem,wo.stateChangeTypes.touchEnd].includes(Q.type))return;const ce=h(i,V);if(V==="")Q.type!==wo.stateChangeTypes.clickItem&&Af(k,v,ce,null,null),j(null);else{const Re=(m||(me=>x&&me.length?0:null))(ce);Q.type!==wo.stateChangeTypes.clickItem&&Af(k,v,ce,Re,V),j(Re)}N(V),F(!0),$()},onStateChange:V=>{!b&&V.type===wo.stateChangeTypes.mouseUp||("highlightedIndex"in V&&V.type!==wo.stateChangeTypes.changeInput&&j(V.highlightedIndex),"selectedItem"in V&&B(V.selectedItem),D&&(V.type===wo.stateChangeTypes.keyDownArrowUp||V.type===wo.stateChangeTypes.keyDownArrowDown)&&Af(k,v,U||i,V.highlightedIndex!=null?V.highlightedIndex:P,O),d2.lastChangeType=V.type)},labelId:r?.id,children:({getInputProps:V,getItemProps:Q,isOpen:ce,inputValue:He,highlightedIndex:Re})=>s.jsxs("div",{className:`view ${ze({display:"flex"})}`,...n,children:[u(V({focused:e,...o,onFocus:me=>{o.onFocus?.(me),p&&$()},onBlur:me=>{if(me.preventDownshiftDefault=!0,o.onBlur?.(me),!!E)if(b){if(me.target.value===""){y?.(null,me.target.value),B(null),W();return}const ft=M?Wa(M):null;le(ft)}else W()},onKeyDown:me=>{const{onKeyDown:ft}=o||{};if(ce)if(me.key==="Enter")if(Re!=null)d2.lastChangeType===wo.stateChangeTypes.itemMouseEnter?me.preventDefault():me.stopPropagation();else if(v)me.preventDefault(),ft?.(me);else return me.stopPropagation(),y(O,me.target.value),ee();else d(me)&&(me.preventDefault(),ft?.(me));me.key==="Escape"&&(me.nativeEvent.preventDownshiftDefault=!0,t||me.stopPropagation(),Af(k,v,i,null,Wa(L)),N(Ga(L)),B(Ou(v,i,L)),j(null),t?$():W())},onChange:me=>{const{onChange:ft}=o||{};ft?.(me.target.value)}})),ce&&ie.length>0&&(t?s.jsx(I,{style:{marginTop:5},"data-testid":"autocomplete",children:c(ie,Q,Re,He)}):s.jsx(Et,{position:"bottom-stretch",offset:2,style:{padding:0,backgroundColor:S.menuAutoCompleteBackground,color:S.menuAutoCompleteText,minWidth:200,...a},...l,"data-testid":"autocomplete",children:c(ie,Q,Re,He)}))]})})}function vye({name:e,onRemove:t}){return s.jsxs(I,{style:{alignItems:"center",flexDirection:"row",backgroundColor:S.pillBackgroundSelected,padding:"2px 4px",margin:"2px",borderRadius:4},children:[e,s.jsx(q,{type:"bare",style:{marginLeft:1},onClick:t,children:s.jsx(uP,{style:{width:8,height:8}})})]})}function xye({value:e=[],onSelect:t,suggestions:n,strict:r,clearOnBlur:o=!0,...i}){const[a,l]=g.useState(!1),u=g.useRef(),c=e.map(Wa);g.useEffect(()=>{u.current=e});function f(p){const m=c.filter(x=>x!==p);t(m)}function d(p){p&&(p=p.trim(),t([...c,p],p))}function h(p,m){p.key==="Backspace"&&p.currentTarget.value===""&&f(c[e.length-1]),m?.(p)}return s.jsx(Fo,{...i,type:"single",value:null,clearOnBlur:o,clearOnSelect:!0,suggestions:n.filter(p=>!c.includes(Wa(p))),onSelect:d,highlightFirst:!0,strict:r,tooltipProps:{forceLayout:u.current!==e},renderInput:p=>s.jsxs(I,{style:{display:"flex",flexWrap:"wrap",flexDirection:"row",alignItems:"center",backgroundColor:S.tableBackground,borderRadius:4,border:"1px solid "+S.formInputBorder,...a&&{border:"1px solid "+S.formInputBorderSelected,boxShadow:"0 1px 1px "+S.formInputShadowSelected}},children:[e.map((m,x)=>(m=Ou(r,n,m),m&&s.jsx(vye,{name:Ga(m),onRemove:()=>f(Wa(m))},Wa(m)||x))),s.jsx(Ke,{...p,onKeyDown:m=>h(m,p.onKeyDown),onFocus:m=>{l(!0),p.onFocus(m)},onBlur:m=>{l(!1),p.onBlur(m)},style:{flex:1,minWidth:30,border:0,":focus":{border:0,boxShadow:"none"},...p.style}})]})})}function bye({show:e=!0,embedded:t,children:n}){return e?s.jsx(I,{style:{flexShrink:0,...t?{paddingTop:5}:{padding:5}},onMouseDown:r=>r.preventDefault(),children:n}):null}function Fo({...e}){return e.type==="multi"?s.jsx(xye,{...e}):s.jsx(yye,{...e})}function ia({title:e,style:t,type:n,...r}){const{isNarrowWidth:o}=zt(),i=o?{...X.largeText,color:S.menuItemTextHeader,paddingTop:10,paddingBottom:10}:{};return s.jsx("div",{style:{color:S.menuAutoCompleteTextHeader,padding:"4px 9px",...i,...t},"data-testid":`${e}-${n}-item-group`,...r,children:e})}function wye({items:e,getItemProps:t,highlightedIndex:n,embedded:r,renderAccountItemGroupHeader:o=Sye,renderAccountItem:i=kye}){let a=null;return s.jsx(I,{children:s.jsx(I,{style:{overflow:"auto",padding:"5px 0",...!r&&{maxHeight:175}},children:e.map((l,u)=>{const c=a?l.offbudget!==a.offbudget&&!l.closed||l.closed!==a.closed&&!l.offbudget:!0,f=`${l.closed?"Closed Accounts":l.offbudget?"Off Budget":"For Budget"}`;return a=l,[c?s.jsx(g.Fragment,{children:o({title:f})},f):null,s.jsx(g.Fragment,{children:i({...t?t({item:l}):null,item:l,highlighted:n===u,embedded:r})},l.id)]})})})}function um({embedded:e,includeClosedAccounts:t=!0,renderAccountItemGroupHeader:n,renderAccountItem:r,closeOnBlur:o,...i}){const l=(mn()||[]).filter(u=>t?u:!u.closed).sort((u,c)=>u.closed===c.closed?u.offbudget===c.offbudget?0:u.offbudget?1:-1:u.closed?1:-1);return s.jsx(Fo,{strict:!0,highlightFirst:!0,embedded:e,closeOnBlur:o,suggestions:l,renderItems:(u,c,f)=>s.jsx(wye,{items:u,getItemProps:c,highlightedIndex:f,embedded:e,renderAccountItemGroupHeader:n,renderAccountItem:r}),...i})}function Sye(e){return s.jsx(ia,{...e,type:"account"})}function xM({item:e,className:t,highlighted:n,embedded:r,...o}){const{isNarrowWidth:i}=zt(),a=i?{...X.mobileMenuItem,borderRadius:0,borderTop:`1px solid ${S.pillBorder}`}:{};return s.jsx("div",{role:"button",className:`${t} ${ze([{backgroundColor:n?S.menuAutoCompleteBackgroundHover:"transparent",padding:4,paddingLeft:20,borderRadius:r?4:0,...a}])}`,"data-testid":`${e.name}-account-item`,"data-highlighted":n||void 0,...o,children:s.jsx(Ew,{children:e.name})})}function kye(e){return s.jsx(xM,{...e})}function Tye({items:e,getItemProps:t,highlightedIndex:n,embedded:r,footer:o,renderSplitTransactionButton:i=jye,renderCategoryItemGroupHeader:a=Cye,renderCategoryItem:l=Iye,showHiddenItems:u}){let c=null;return s.jsxs(I,{children:[s.jsx(I,{style:{overflow:"auto",padding:"5px 0",...!r&&{maxHeight:175}},children:e.map((f,d)=>{if(f.id==="split")return i({key:"split",...t?t({item:f}):null,highlighted:n===d,embedded:r});if((f.hidden||f.group?.hidden)&&!u)return s.jsx(g.Fragment,{},f.id);const h=f.cat_group!==c,p=`${f.group?.name}${f.group?.hidden?" (hidden)":""}`;return c=f.cat_group,s.jsxs(g.Fragment,{children:[h&&f.group?.name&&s.jsx(g.Fragment,{children:a({title:p,style:{...u&&f.group?.hidden&&{color:S.pageTextSubdued}}})},f.group.name),s.jsx(g.Fragment,{children:l({...t?t({item:f}):null,item:f,highlighted:n===d,embedded:r,style:{...u&&f.hidden&&{color:S.pageTextSubdued}}})},f.id)]},f.id)})}),o]})}function Gd({categoryGroups:e,showSplitOption:t,embedded:n,closeOnBlur:r,renderSplitTransactionButton:o,renderCategoryItemGroupHeader:i,renderCategoryItem:a,showHiddenCategories:l,...u}){const c=g.useMemo(()=>e.reduce((f,d)=>f.concat((d.categories||[]).filter(h=>h.cat_group===d.id).map(h=>({...h,group:d}))),t?[{id:"split",name:""}]:[]),[t,e]);return s.jsx(Fo,{strict:!0,highlightFirst:!0,embedded:n,closeOnBlur:r,getHighlightedIndex:f=>f.length===0?null:f[0].id==="split"?f.length>1?1:null:0,filterSuggestions:(f,d)=>f.filter(h=>h.id==="split"||Dw(h,d)),suggestions:c,renderItems:(f,d,h)=>s.jsx(Tye,{items:f,embedded:n,getItemProps:d,highlightedIndex:h,renderSplitTransactionButton:o,renderCategoryItemGroupHeader:i,renderCategoryItem:a,showHiddenItems:l}),...u})}function Cye(e){return s.jsx(ia,{...e,type:"category"})}function Eye({Icon:e,highlighted:t,embedded:n,style:r,...o}){return s.jsxs(I,{role:"button",style:{backgroundColor:t?S.menuAutoCompleteBackgroundHover:"transparent",borderRadius:n?4:0,flexShrink:0,flexDirection:"row",alignItems:"center",fontSize:11,fontWeight:500,color:S.noticeTextMenu,padding:"6px 8px",":active":{backgroundColor:"rgba(100, 100, 100, .25)"},...r},"data-testid":"split-transaction-button",...o,children:[s.jsx(z,{style:{lineHeight:0},children:e?s.jsx(e,{style:{marginRight:5}}):s.jsx(sb,{width:10,height:10,style:{marginRight:5}})}),"Split Transaction"]})}function jye(e){return s.jsx(Eye,{...e})}function bM({item:e,className:t,style:n,highlighted:r,embedded:o,...i}){const{isNarrowWidth:a}=zt(),l=a?{...X.mobileMenuItem,borderRadius:0,borderTop:`1px solid ${S.pillBorder}`}:{};return s.jsx("div",{style:n,role:"button",className:`${t} ${ze([{backgroundColor:r?S.menuAutoCompleteBackgroundHover:"transparent",padding:4,paddingLeft:20,borderRadius:o?4:0,...l}])}`,"data-testid":`${e.name}-category-item`,"data-highlighted":r||void 0,...i,children:s.jsxs(Ew,{children:[e.name,e.hidden?" (hidden)":null]})})}function Iye(e){return s.jsx(bM,{...e})}function Yc({style:e,children:t}){return s.jsx(I,{style:{color:"red",fontSize:13,...e},children:t})}function f2(e,t,n){const r=n.find(i=>i.id===t),o=r&&r.offbudget===1;return e.offbudget===0&&o}function Dye({account:e,balance:t,canDelete:n,actions:r,modalProps:o}){const[i,a]=g.useState(!1),[l,u]=g.useState(""),[c,f]=g.useState(""),[d,h]=g.useState(!1),[p,m]=g.useState(!1),x=mn().filter(v=>v.closed===0),{grouped:k}=Fr();return s.jsx(_e,{title:"Close Account",...o,style:{flex:0},loading:i,children:()=>s.jsxs(I,{children:[s.jsxs(be,{children:["Are you sure you want to close ",s.jsx("strong",{children:e.name}),"?"," ",n?s.jsx("span",{children:"This account has no transactions so it will be permanently deleted."}):s.jsx("span",{children:"This account has transactions so we can’t permanently delete it."})]}),s.jsxs("form",{onSubmit:v=>{v.preventDefault();const y=t!==0&&l==="";h(y);const b=f2(e,l,x)&&c==="";m(b),!y&&!b&&(a(!0),r.closeAccount(e.id,l||null,c||null).then(()=>{o.onClose()}))},children:[t!==0&&s.jsxs(I,{children:[s.jsxs(be,{children:["This account has a balance of"," ",s.jsx("strong",{children:_n(t)}),". To close this account, select a different account to transfer this balance to:"]}),s.jsx(I,{style:{marginBottom:15},children:s.jsx(um,{includeClosedAccounts:!1,value:l,inputProps:{placeholder:"Select account..."},onSelect:v=>{u(v),d&&v&&h(!1)}})}),d&&s.jsx(Yc,{style:{marginBottom:15},children:"Transfer is required"}),f2(e,l,x)&&s.jsxs(I,{style:{marginBottom:15},children:[s.jsx(be,{children:"Since you are transferring the balance from a budgeted account to an off-budget account, this transaction must be categorized. Select a category:"}),s.jsx(Gd,{categoryGroups:k,value:c,inputProps:{placeholder:"Select category..."},onSelect:v=>{f(v),p&&v&&m(!1)},showHiddenCategories:!0}),p&&s.jsx(Yc,{children:"Category is required"})]})]}),!n&&s.jsx(I,{style:{marginBottom:15},children:s.jsxs(z,{style:{fontSize:12},children:["You can also"," ",s.jsx(Ro,{onClick:()=>{a(!0),r.forceCloseAccount(e.id).then(()=>o.onClose())},style:{color:S.errorText},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."]})}),s.jsxs(I,{style:{flexDirection:"row",justifyContent:"flex-end"},children:[s.jsx(q,{style:{marginRight:10},onClick:o.onClose,children:"Cancel"}),s.jsx(q,{type:"primary",children:"Close Account"})]})]})]})})}function _ye({modalProps:e,group:t,category:n,onDelete:r}){const[o,i]=g.useState(null),[a,l]=g.useState(null),{grouped:u,list:c}=Fr(),f=u.find(m=>m.id===t),d=c.find(m=>m.id===n),h=m=>{let x;switch(m){case"required-transfer":x="You must select a category";break;default:x="Something bad happened, sorry!"}return s.jsx(z,{style:{marginTop:15,color:S.errorText},children:x})},p=!!(d||f).is_income;return s.jsx(_e,{title:"Confirm Delete",...e,style:{flex:0},children:()=>s.jsxs(I,{style:{lineHeight:1.5},children:[f?s.jsxs(We,{children:["Categories in the group ",s.jsx("strong",{children:f.name})," are used by existing transaction",!p&&" or it has a positive leftover balance currently","."," ",s.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.jsxs(We,{children:[s.jsx("strong",{children:d.name})," is used by existing transactions",!p&&" or it has a positive leftover balance currently","."," ",s.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."]}),a&&h(a),s.jsxs(I,{style:{marginTop:20,flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[s.jsx(z,{children:"Transfer to:"}),s.jsx(I,{style:{flex:1,marginLeft:10,marginRight:30},children:s.jsx(Gd,{categoryGroups:f?u.filter(m=>m.id!==f.id&&!!m.is_income===p):u.filter(m=>!!m.is_income===p).map(m=>({...m,categories:m.categories.filter(x=>x.id!==d.id)})),value:o,inputProps:{placeholder:"Select category..."},onSelect:m=>i(m),showHiddenCategories:!0})}),s.jsx(q,{type:"primary",onClick:()=>{o?(r(o),e.onClose()):l("required-transfer")},children:"Delete"})]})]})})}function Oye({modalProps:e,onConfirm:t,confirmReason:n}){return s.jsx(_e,{title:"Reconciled Transaction",...e,style:{flex:0},children:()=>s.jsxs(I,{style:{lineHeight:1.5},children:[n==="batchDeleteWithReconciled"?s.jsx(We,{children:"Deleting reconciled transactions may bring your reconciliation out of balance."}):n==="batchEditWithReconciled"?s.jsx(We,{children:"Editing reconciled transactions may bring your reconciliation out of balance."}):n==="batchDuplicateWithReconciled"?s.jsx(We,{children:"Duplicating reconciled transactions may bring your reconciliation out of balance."}):n==="editReconciled"?s.jsx(We,{children:"Saving your changes to this reconciled transaction may bring your reconciliation out of balance."}):n==="unlockReconciled"?s.jsx(We,{children:"Unlocking this transaction means you won‘t be warned about changes that can impact your reconciled balance. (Changes to amount, account, payee, etc)."}):n==="deleteReconciled"?s.jsx(We,{children:"Deleting this reconciled transaction may bring your reconciliation out of balance."}):s.jsx(We,{children:"Are you sure you want to edit this transaction?"}),s.jsx(I,{style:{marginTop:20,flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:s.jsxs(I,{style:{flexDirection:"row",justifyContent:"flex-end"},children:[s.jsx(q,{style:{marginRight:10},onClick:e.onClose,children:"Cancel"}),s.jsx(q,{type:"primary",onClick:()=>{e.onClose(),t()},children:"Confirm"})]})})]})})}function Aye({modalProps:e,accountName:t,onUnlink:n}){return s.jsx(_e,{title:"Confirm Unlink",...e,style:{flex:0},children:()=>s.jsxs(I,{style:{lineHeight:1.5},children:[s.jsxs(be,{children:["Are you sure you want to unlink ",s.jsx("strong",{children:t}),"?"]}),s.jsx(be,{children:"Transactions will no longer be synchronized with this account and must be manually entered."}),s.jsxs(I,{style:{flexDirection:"row",justifyContent:"flex-end"},children:[s.jsx(q,{style:{marginRight:10},onClick:e.onClose,children:"Cancel"}),s.jsx(q,{type:"primary",onClick:()=>{n(),e.onClose()},children:"Unlink"})]})]})})}function Pye(e,t,{onSuccess:n,onClose:r}){e("gocardless-external-msg",{onMoveExternal:async({institutionId:o})=>{const i=await Y("gocardless-create-web-token",{upgradingAccountId:t,institutionId:o,accessValidForDays:30});if("error"in i)return i;const{link:a,requisitionId:l}=i;return window.Actual?.openURLInBrowser(a),Y("gocardless-poll-web-token",{upgradingAccountId:t,requisitionId:l})},onClose:r,onSuccess:n})}async function ax(e,{upgradingAccountId:t}={}){Pye(e,t,{onSuccess:async n=>{e("select-linked-accounts",{accounts:n.accounts,requisitionId:n.id,upgradingAccountId:t,syncSource:"goCardless"})}})}const Mye={reportBudget:!1,goalTemplatesEnabled:!1,customReports:!1,simpleFinSync:!1,splitsInRules:!1};function Kd(e){return Te(t=>{const n=t.prefs.local[`flags.${e}`];return n===void 0?Mye[e]||!1:n})}function wM(){const[e,t]=g.useState(null),[n,r]=g.useState(!1),o=dw();return g.useEffect(()=>{async function i(){r(!0);const a=await Y("gocardless-status");t(a.configured||!1),r(!1)}o==="online"&&i()},[o]),{configuredGoCardless:e,isLoading:n}}function Rye(){const[e,t]=g.useState(null),[n,r]=g.useState(!1),o=dw();return g.useEffect(()=>{async function i(){r(!0);const a=await Y("simplefin-status");t(a.configured||!1),r(!1)}o==="online"&&i()},[o]),{configuredSimpleFin:e,isLoading:n}}function Bye({modalProps:e,syncServerStatus:t,upgradingAccountId:n}){const r=Ht(),[o,i]=g.useState(null),[a,l]=g.useState(null),u=()=>{if(!o){f();return}n==null?ax(r.pushModal):ax(r.pushModal,{upgradingAccountId:n})},c=async()=>{if(!a){d();return}if(k)return;v(!0);const b=await Y("simplefin-accounts"),w=[];for(const E of b.accounts){const T={account_id:E.id,name:E.name,institution:E.org.name,orgDomain:E.org.domain};w.push(T)}r.pushModal("select-linked-accounts",{accounts:w,syncSource:"simpleFin"}),v(!1)},f=()=>{r.pushModal("gocardless-init",{onSuccess:()=>i(!0)})},d=()=>{r.pushModal("simplefin-init",{onSuccess:()=>l(!0)})},h=()=>{r.pushModal("add-local-account")},{configuredGoCardless:p}=wM();g.useEffect(()=>{i(p)},[p]);const{configuredSimpleFin:m}=Rye();g.useEffect(()=>{l(m)},[m]);let x="Add Account";const[k,v]=g.useState(!1);n!=null&&(x="Link Account");const y=Kd("simpleFinSync");return s.jsx(_e,{title:x,...e,children:()=>s.jsxs(I,{style:{maxWidth:500,gap:30,color:S.pageText},children:[n==null&&s.jsxs(I,{style:{gap:10},children:[s.jsx(q,{type:"primary",style:{padding:"10px 0",fontSize:15,fontWeight:600},onClick:h,children:"Create local account"}),s.jsx(I,{style:{lineHeight:"1.4em",fontSize:15},children:s.jsxs(z,{children:[s.jsx("strong",{children:"Create a local account"})," if you want to add transactions manually. You can also"," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/transactions/importing",linkColor:"muted",children:"import QIF/OFX/QFX files into a local account"}),"."]})})]}),s.jsx(I,{style:{gap:10},children:t==="online"?s.jsxs(s.Fragment,{children:[s.jsx(mt,{disabled:t!=="online",style:{padding:"10px 0",fontSize:15,fontWeight:600,flex:1},onClick:u,children:o?"Link bank account with GoCardless":"Set up GoCardless for bank sync"}),s.jsxs(z,{style:{lineHeight:"1.4em",fontSize:15},children:[s.jsxs("strong",{children:["Link a ",s.jsx("u",{children:"European"})," bank account"]})," ","to automatically download transactions. GoCardless provides reliable, up-to-date information from hundreds of banks."]}),y===!0&&s.jsxs(s.Fragment,{children:[s.jsx(mt,{disabled:t!=="online",loading:k,style:{marginTop:"18px",padding:"10px 0",fontSize:15,fontWeight:600,flex:1},onClick:c,children:a?"Link bank account with SimpleFIN":"Set up SimpleFIN for bank sync"}),s.jsxs(z,{style:{lineHeight:"1.4em",fontSize:15},children:[s.jsxs("strong",{children:["Link a ",s.jsx("u",{children:"North American"})," bank account"]})," ","to automatically download transactions. SimpleFIN provides reliable, up-to-date information from hundreds of banks."]})]})]}):s.jsxs(s.Fragment,{children:[s.jsx(q,{disabled:!0,style:{padding:"10px 0",fontSize:15,fontWeight:600},children:"Set up bank sync"}),s.jsxs(be,{style:{fontSize:15},children:["Connect to an Actual server to set up"," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/advanced/bank-sync",linkColor:"muted",children:"automatic syncing."}),"."]})]})})]})})}function Ts({children:e}){const t=g.useRef(null);return g.useEffect(()=>{t.current&&setTimeout(()=>{t.current&&(t.current.focus(),t.current.setSelectionRange(0,1e4))},0)},[]),typeof e=="function"?e(t):g.cloneElement(e,{inputRef:t})}function SM({modalProps:e,actions:t,options:n={}}){const[r,o]=g.useState(""),[i,a]=g.useState(!1),[l,u]=g.useState(""),[c,f]=g.useState(!1),d=n.recreate;async function h(){if(r!==""&&!i){a(!0),u(null);const p=await Y("key-make",{password:r});if(p.error){a(null),u(hN(p.error));return}t.loadGlobalPrefs(),t.loadAllFiles(),t.sync(),a(!1),t.popModal()}}return s.jsx(_e,{...e,style:{width:600},title:d?"Generate new key":"Enable encryption",onClose:()=>t.popModal(),children:()=>s.jsxs(s.Fragment,{children:[d?s.jsxs(s.Fragment,{children:[s.jsxs(be,{style:{marginTop:5},children:["This will generate a new key for encrypting your data."," ",s.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."," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",linkColor:"purple",children:"Learn more"})]}),s.jsx(be,{children:"Key generation is randomized. The same password will create different keys, so this will change your key regardless of the password being different."})]}):s.jsxs(s.Fragment,{children:[s.jsxs(be,{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. ",s.jsx("strong",{children:"This requires a sync reset"})," and all other devices will have to revert to this version of your data."," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",linkColor:"purple",children:"Learn more"})]}),s.jsx(be,{children:s.jsxs("ul",{className:`${ze({marginTop:0,"& li":{marginBottom:8}})}`,children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Important:"})," if you forget this password"," ",s.jsx("em",{children:"and"})," you don’t have any local copies of your data, you will lose access to all your data. The data cannot be decrypted without the password."]}),s.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."}),s.jsx("li",{children:"If you’ve already downloaded your data on other devices, you will need to reset them. Actual will automatically take you through this process."}),s.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."})]})})]}),s.jsxs("form",{onSubmit:p=>{p.preventDefault(),h()},children:[s.jsxs(I,{style:{alignItems:"center"},children:[s.jsx(z,{style:{fontWeight:600,marginBottom:3},children:"Password"}),l&&s.jsx(I,{style:{color:S.errorText,textAlign:"center",fontSize:13,marginBottom:3},children:l}),s.jsx(Ts,{children:s.jsx(Ke,{type:c?"text":"password",style:{width:300},onChange:p=>o(p.target.value)})}),s.jsx(z,{style:{marginTop:5},children:s.jsxs("label",{style:{userSelect:"none"},children:[s.jsx("input",{type:"checkbox",onClick:()=>f(!c)})," ","Show password"]})})]}),s.jsx(ys,{style:{marginTop:20},children:s.jsx(mt,{loading:i,type:"primary",children:"Enable"})})]})]})})}function h2({label:e,labelWidth:t,children:n,width:r,style:o}){return s.jsxs("label",{className:`${ze({display:"flex",flexDirection:"row",alignItems:"center",margin:"7px 0",width:r},o)}`,children:[s.jsxs("div",{style:{width:t||75,textAlign:"right",paddingRight:10},children:[e,":"]}),n]})}function Lye({modalProps:e,actions:t}){const n=Hn(),[r,o]=g.useState(""),[i,a]=g.useState(!1),[l,u]=g.useState("0"),[c,f]=g.useState(!1),[d,h]=g.useState(!1),p=m=>!isNaN(parseFloat(m));return s.jsx(_e,{title:"Create Local Account",...e,children:()=>s.jsx(I,{children:s.jsxs("form",{onSubmit:async m=>{m.preventDefault();const x=!r;f(x);const k=!p(l);if(h(k),!x&&!k){t.closeModal();const v=await t.createAccount(r,pD(l),i);n("/accounts/"+v)}},children:[s.jsx(h2,{label:"Name",width:"75%",children:s.jsx(Ts,{children:s.jsx(Ke,{name:"name",value:r,onChange:m=>o(m.target.value),onBlur:m=>{const x=m.target.value.trim();o(x),x&&c&&f(!1)},style:{flex:1}})})}),c&&s.jsx(Yc,{style:{marginLeft:75},children:"Name is required"}),s.jsx(I,{style:{width:"75%",flexDirection:"row",justifyContent:"flex-end"},children:s.jsxs(I,{style:{flexDirection:"column"},children:[s.jsxs(I,{style:{flexDirection:"row",justifyContent:"flex-end"},children:[s.jsx(Bo,{id:"offbudget",name:"offbudget",checked:i,onChange:()=>a(!i)}),s.jsx("label",{htmlFor:"offbudget",style:{userSelect:"none",verticalAlign:"center"},children:"Off-budget"})]}),s.jsx("div",{style:{textAlign:"right",fontSize:"0.7em",color:S.pageTextLight,marginTop:3},children:s.jsxs(z,{children:["This cannot be changed later. ",s.jsx("br",{})," ",`
|
|
162
|
+
`,"See"," ",s.jsx(Ve,{linkColor:"muted",to:"https://actualbudget.org/docs/accounts/#off-budget-accounts",children:"Accounts Overview"})," ","for more information."]})})]})}),s.jsx(h2,{label:"Balance",width:"75%",children:s.jsx(Ke,{name:"balance",inputMode:"decimal",value:l,onChange:m=>u(m.target.value),onBlur:m=>{const x=m.target.value.trim();u(x),p(x)&&d&&h(!1)},style:{flex:1}})}),d&&s.jsx(Yc,{style:{marginLeft:75},children:"Balance must be a number"}),s.jsxs(ys,{children:[s.jsx(q,{onClick:()=>e.onBack(),children:"Back"}),s.jsx(q,{type:"primary",style:{marginLeft:10},children:"Create"})]})]})})})}function Nye(e,t,n){let r=n?e$(e,n):e;return t&&r&&(r=r.filter(o=>!!o.transfer_acct)),r||[]}function p2(e,t){return e==="new"&&!t.startsWith("new:")?"new:"+t:e}function $ye(e){return typeof e=="string"&&e.startsWith("new:")?"new":e}function Fye({items:e,getItemProps:t,highlightedIndex:n,embedded:r,inputValue:o,renderCreatePayeeButton:i=TM,renderPayeeItemGroupHeader:a=CM,renderPayeeItem:l=jM,footer:u}){let c=null;if(e=[...e],e[0].id==="new"){const[h,...p]=e;c=h,e=p}const f=c?1:0;let d=null;return s.jsxs(I,{children:[s.jsxs(I,{style:{overflow:"auto",padding:"5px 0",...!r&&{maxHeight:175}},children:[c&&i({...t?t({item:c}):null,payeeName:o,highlighted:n===0,embedded:r}),e.map((h,p)=>{const m=h.transfer_acct?"account":"payee";let x;m==="payee"&&d!==m?x="Payees":m==="account"&&d!==m&&(x="Transfer To/From");const k=p===e.length-1&&e.length>100;return d=m,s.jsxs(g.Fragment,{children:[x&&s.jsx(g.Fragment,{children:a({title:x})},`title-${p}`),s.jsx(g.Fragment,{children:l({...t?t({item:h}):null,item:h,highlighted:n===p+f,embedded:r})},h.id),k&&s.jsx("div",{style:{fontSize:11,padding:5,color:S.pageTextLight,textAlign:"center"},children:"More payees are available, search to find them"})]},h.id)})]}),u]})}function _w({value:e,inputProps:t,showMakeTransfer:n=!0,showManagePayees:r=!1,clearOnBlur:o=!0,closeOnBlur:i,embedded:a,onUpdate:l,onSelect:u,onManagePayees:c,renderCreatePayeeButton:f=TM,renderPayeeItemGroupHeader:d=CM,renderPayeeItem:h=jM,accounts:p,payees:m,...x}){const k=Hr();m||(m=k);const v=mn();p||(p=v);const[y,b]=g.useState(!1),[w,E]=g.useState(""),T=!!w,_=g.useMemo(()=>{const H=Nye(m,y,p);return T?[{id:"new",name:""},...H]:H},[m,y,p,T]),M=Ft();async function B(H,F){if(!o)u?.(p2(H,F),F);else{const L=R=>M(ZI(R));Array.isArray(H)?H=await Promise.all(H.map(R=>R==="new"?L(F):R)):H==="new"&&(H=await L(F)),u?.(H,F)}}const[O,N]=g.useState(!1);return s.jsx(Fo,{strict:!0,embedded:a,value:$ye(e),suggestions:_,clearOnBlur:o,closeOnBlur:i,itemToString:H=>{if(H){if(H.id==="new")return w}else return"";return H.name},focused:O,inputProps:{...t,onBlur:()=>{E(""),N(!1)},onFocus:()=>N(!0),onChange:E},onUpdate:(H,F)=>l?.(H,p2(H,F)),onSelect:B,getHighlightedIndex:H=>H.length>1&&H[0].id==="new"?1:0,filterSuggestions:(H,F)=>{let L=H.filter(R=>R.id==="new"?!(!F||F===""||y):Dw(R,F));return L.sort((R,U)=>{const P=R.name.toLowerCase().startsWith(F.toLowerCase()),j=U.name.toLowerCase().startsWith(F.toLowerCase()),D=R.name.toLowerCase()===F.toLowerCase(),C=U.name.toLowerCase()===F.toLowerCase();return R.id==="new"?-1:U.id==="new"?1:D&&!C?-1:!D&&C?1:P===j?0:P&&!j?-1:1}),L=L.slice(0,100),L.length>=2&&L[0].id==="new"&&L[1].name.toLowerCase()===F.toLowerCase()&&!L[1].transfer_acct?L.slice(1):L},renderItems:(H,F,L,R)=>s.jsx(Fye,{items:H,getItemProps:F,highlightedIndex:L,inputValue:R,embedded:a,renderCreatePayeeButton:f,renderPayeeItemGroupHeader:d,renderPayeeItem:h,footer:s.jsxs(bye,{embedded:a,children:[n&&s.jsx(q,{type:y?"menuSelected":"menu",style:r&&{marginBottom:5},onClick:()=>{l?.(null,null),b(!y)},children:"Make Transfer"}),r&&s.jsx(q,{type:"menu",onClick:()=>c(),children:"Manage Payees"})]})}),...x},y?"transfers":"all")}function kM({Icon:e,payeeName:t,highlighted:n,embedded:r,style:o,...i}){const{isNarrowWidth:a}=zt(),l=a?{...X.mobileMenuItem}:{},u=a?14:8;return s.jsxs(I,{"data-testid":"create-payee-button",style:{display:"block",flexShrink:0,color:r&&a?S.menuItemText:S.noticeTextMenu,borderRadius:r?4:0,fontSize:11,fontWeight:500,padding:"6px 9px",backgroundColor:n?S.menuAutoCompleteBackgroundHover:"transparent",":active":{backgroundColor:"rgba(100, 100, 100, .25)"},...l,...o},...i,children:[e?s.jsx(e,{style:{marginRight:5,display:"inline-block"}}):s.jsx(xs,{width:u,height:u,style:{marginRight:5,display:"inline-block"}}),"Create Payee “",t,"”"]})}function TM(e){return s.jsx(kM,{...e})}function CM(e){return s.jsx(ia,{...e,type:"payee"})}function EM({item:e,className:t,highlighted:n,embedded:r,...o}){const{isNarrowWidth:i}=zt(),a=i?{...X.mobileMenuItem,borderRadius:0,borderTop:`1px solid ${S.pillBorder}`}:{};return s.jsx("div",{role:"button",className:`${t} ${ze([{backgroundColor:n?S.menuAutoCompleteBackgroundHover:"transparent",borderRadius:r?4:0,padding:4,paddingLeft:20,...a}])}`,"data-testid":`${e.name}-payee-item`,"data-highlighted":n||void 0,...o,children:s.jsx(Ew,{children:e.name})})}function jM(e){return s.jsx(EM,{...e})}var IM={exports:{}};/*!
|
|
163
|
+
* Pikaday
|
|
164
|
+
*
|
|
165
|
+
* Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
|
|
166
|
+
*/(function(e,t){(function(n,r){var o;{try{o=require("moment")}catch{}e.exports=r(o)}})(F2,function(n){var r=typeof n=="function",o=!!window.addEventListener,i=window.document,a=window.setTimeout,l=function(j,D,C,$){o?j.addEventListener(D,C,!!$):j.attachEvent("on"+D,C)},u=function(j,D,C,$){o?j.removeEventListener(D,C,!!$):j.detachEvent("on"+D,C)},c=function(j){return j.trim?j.trim():j.replace(/^\s+|\s+$/g,"")},f=function(j,D){return(" "+j.className+" ").indexOf(" "+D+" ")!==-1},d=function(j,D){f(j,D)||(j.className=j.className===""?D:j.className+" "+D)},h=function(j,D){j.className=c((" "+j.className+" ").replace(" "+D+" "," "))},p=function(j){return/Array/.test(Object.prototype.toString.call(j))},m=function(j){return/Date/.test(Object.prototype.toString.call(j))&&!isNaN(j.getTime())},x=function(j){var D=j.getDay();return D===0||D===6},k=function(j){return j%4===0&&j%100!==0||j%400===0},v=function(j,D){return[31,k(j)?29:28,31,30,31,30,31,31,30,31,30,31][D]},y=function(j){m(j)&&j.setHours(0,0,0,0)},b=function(j,D){return j.getTime()===D.getTime()},w=function(j,D,C){var $,W;for($ in D)W=j[$]!==void 0,W&&typeof D[$]=="object"&&D[$]!==null&&D[$].nodeName===void 0?m(D[$])?C&&(j[$]=new Date(D[$].getTime())):p(D[$])?C&&(j[$]=D[$].slice(0)):j[$]=w({},D[$],C):(C||!W)&&(j[$]=D[$]);return j},E=function(j,D,C){var $;i.createEvent?($=i.createEvent("HTMLEvents"),$.initEvent(D,!0,!1),$=w($,C),j.dispatchEvent($)):i.createEventObject&&($=i.createEventObject(),$=w($,C),j.fireEvent("on"+D,$))},T=function(j){return j.month<0&&(j.year-=Math.ceil(Math.abs(j.month)/12),j.month+=12),j.month>11&&(j.year+=Math.floor(Math.abs(j.month)/12),j.month-=12),j},_={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,firstWeekOfYearMinDays:4,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},M=function(j,D,C){for(D+=j.firstDay;D>=7;)D-=7;return C?j.i18n.weekdaysShort[D]:j.i18n.weekdays[D]},B=function(j){var D=[],C="false";if(j.isEmpty)if(j.showDaysInNextAndPreviousMonths)D.push("is-outside-current-month"),j.enableSelectionDaysInNextAndPreviousMonths||D.push("is-selection-disabled");else return'<td class="is-empty"></td>';return j.isDisabled&&D.push("is-disabled"),j.isToday&&D.push("is-today"),j.isSelected&&(D.push("is-selected"),C="true"),j.hasEvent&&D.push("has-event"),j.isInRange&&D.push("is-inrange"),j.isStartRange&&D.push("is-startrange"),j.isEndRange&&D.push("is-endrange"),'<td data-day="'+j.day+'" class="'+D.join(" ")+'" aria-selected="'+C+'"><button class="pika-button pika-day" type="button" data-pika-year="'+j.year+'" data-pika-month="'+j.month+'" data-pika-day="'+j.day+'">'+j.day+"</button></td>"},O=function(j,D){j.setHours(0,0,0,0);var C=j.getDate(),$=j.getDay(),W=D,A=W-1,J=7,le=function(ce){return(ce+J-1)%J};j.setDate(C+A-le($));var ee=new Date(j.getFullYear(),0,W),ie=24*60*60*1e3,V=(j.getTime()-ee.getTime())/ie,Q=1+Math.round((V-A+le(ee.getDay()))/J);return Q},N=function(j,D,C,$){var W=new Date(C,D,j),A=r?n(W).isoWeek():O(W,$);return'<td class="pika-week">'+A+"</td>"},H=function(j,D,C,$){return'<tr class="pika-row'+(C?" pick-whole-week":"")+($?" is-selected":"")+'">'+(D?j.reverse():j).join("")+"</tr>"},F=function(j){return"<tbody>"+j.join("")+"</tbody>"},L=function(j){var D,C=[];for(j.showWeekNumber&&C.push("<th></th>"),D=0;D<7;D++)C.push('<th scope="col"><abbr title="'+M(j,D)+'">'+M(j,D,!0)+"</abbr></th>");return"<thead><tr>"+(j.isRTL?C.reverse():C).join("")+"</tr></thead>"},R=function(j,D,C,$,W,A){var J,le,ee,ie=j._o,V=C===ie.minYear,Q=C===ie.maxYear,ce='<div id="'+A+'" class="pika-title" role="heading" aria-live="assertive">',He,Re,me=!0,ft=!0;for(ee=[],J=0;J<12;J++)ee.push('<option value="'+(C===W?J-D:12+J-D)+'"'+(J===$?' selected="selected"':"")+(V&&J<ie.minMonth||Q&&J>ie.maxMonth?' disabled="disabled"':"")+">"+ie.i18n.months[J]+"</option>");for(He='<div class="pika-label">'+ie.i18n.months[$]+'<select class="pika-select pika-select-month" tabindex="-1">'+ee.join("")+"</select></div>",p(ie.yearRange)?(J=ie.yearRange[0],le=ie.yearRange[1]+1):(J=C-ie.yearRange,le=1+C+ie.yearRange),ee=[];J<le&&J<=ie.maxYear;J++)J>=ie.minYear&&ee.push('<option value="'+J+'"'+(J===C?' selected="selected"':"")+">"+J+"</option>");return Re='<div class="pika-label">'+C+ie.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+ee.join("")+"</select></div>",ie.showMonthAfterYear?ce+=Re+He:ce+=He+Re,V&&($===0||ie.minMonth>=$)&&(me=!1),Q&&($===11||ie.maxMonth<=$)&&(ft=!1),D===0&&(ce+='<button class="pika-prev'+(me?"":" is-disabled")+'" type="button">'+ie.i18n.previousMonth+"</button>"),D===j._o.numberOfMonths-1&&(ce+='<button class="pika-next'+(ft?"":" is-disabled")+'" type="button">'+ie.i18n.nextMonth+"</button>"),ce+="</div>"},U=function(j,D,C){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+C+'">'+L(j)+F(D)+"</table>"},P=function(j){var D=this,C=D.config(j);D._onMouseDown=function(W){if(D._v){W=W||window.event;var A=W.target||W.srcElement;if(A)if(f(A,"is-disabled")||(f(A,"pika-button")&&!f(A,"is-empty")&&!f(A.parentNode,"is-disabled")?(D.setDate(new Date(A.getAttribute("data-pika-year"),A.getAttribute("data-pika-month"),A.getAttribute("data-pika-day"))),C.bound&&a(function(){D.hide(),C.blurFieldOnSelect&&C.field&&C.field.blur()},100)):f(A,"pika-prev")?D.prevMonth():f(A,"pika-next")&&D.nextMonth()),f(A,"pika-select"))D._c=!0;else if(W.preventDefault)W.preventDefault();else return W.returnValue=!1,!1}},D._onChange=function(W){W=W||window.event;var A=W.target||W.srcElement;A&&(f(A,"pika-select-month")?D.gotoMonth(A.value):f(A,"pika-select-year")&&D.gotoYear(A.value))},D._onKeyChange=function(W){if(W=W||window.event,D.isVisible())switch(W.keyCode){case 13:case 27:C.field&&C.field.blur();break;case 37:D.adjustDate("subtract",1);break;case 38:D.adjustDate("subtract",7);break;case 39:D.adjustDate("add",1);break;case 40:D.adjustDate("add",7);break;case 8:case 46:D.setDate(null);break}},D._parseFieldValue=function(){if(C.parse)return C.parse(C.field.value,C.format);if(r){var W=n(C.field.value,C.format,C.formatStrict);return W&&W.isValid()?W.toDate():null}else return new Date(Date.parse(C.field.value))},D._onInputChange=function(W){var A;W.firedBy!==D&&(A=D._parseFieldValue(),m(A)&&D.setDate(A),D._v||D.show())},D._onInputFocus=function(){D.show()},D._onInputClick=function(){D.show()},D._onInputBlur=function(){var W=i.activeElement;do if(f(W,"pika-single"))return;while(W=W.parentNode);D._c||(D._b=a(function(){D.hide()},50)),D._c=!1},D._onClick=function(W){W=W||window.event;var A=W.target||W.srcElement,J=A;if(A){!o&&f(A,"pika-select")&&(A.onchange||(A.setAttribute("onchange","return;"),l(A,"change",D._onChange)));do if(f(J,"pika-single")||J===C.trigger)return;while(J=J.parentNode);D._v&&A!==C.trigger&&J!==C.trigger&&D.hide()}},D.el=i.createElement("div"),D.el.className="pika-single"+(C.isRTL?" is-rtl":"")+(C.theme?" "+C.theme:""),l(D.el,"mousedown",D._onMouseDown,!0),l(D.el,"touchend",D._onMouseDown,!0),l(D.el,"change",D._onChange),C.keyboardInput&&l(i,"keydown",D._onKeyChange),C.field&&(C.container?C.container.appendChild(D.el):C.bound?i.body.appendChild(D.el):C.field.parentNode.insertBefore(D.el,C.field.nextSibling),l(C.field,"change",D._onInputChange),C.defaultDate||(C.defaultDate=D._parseFieldValue(),C.setDefaultDate=!0));var $=C.defaultDate;m($)?C.setDefaultDate?D.setDate($,!0):D.gotoDate($):D.gotoDate(new Date),C.bound?(this.hide(),D.el.className+=" is-bound",l(C.trigger,"click",D._onInputClick),l(C.trigger,"focus",D._onInputFocus),l(C.trigger,"blur",D._onInputBlur)):this.show()};return P.prototype={config:function(j){this._o||(this._o=w({},_,!0));var D=w(this._o,j,!0);D.isRTL=!!D.isRTL,D.field=D.field&&D.field.nodeName?D.field:null,D.theme=typeof D.theme=="string"&&D.theme?D.theme:null,D.bound=!!(D.bound!==void 0?D.field&&D.bound:D.field),D.trigger=D.trigger&&D.trigger.nodeName?D.trigger:D.field,D.disableWeekends=!!D.disableWeekends,D.disableDayFn=typeof D.disableDayFn=="function"?D.disableDayFn:null;var C=parseInt(D.numberOfMonths,10)||1;if(D.numberOfMonths=C>4?4:C,m(D.minDate)||(D.minDate=!1),m(D.maxDate)||(D.maxDate=!1),D.minDate&&D.maxDate&&D.maxDate<D.minDate&&(D.maxDate=D.minDate=!1),D.minDate&&this.setMinDate(D.minDate),D.maxDate&&this.setMaxDate(D.maxDate),p(D.yearRange)){var $=new Date().getFullYear()-10;D.yearRange[0]=parseInt(D.yearRange[0],10)||$,D.yearRange[1]=parseInt(D.yearRange[1],10)||$}else D.yearRange=Math.abs(parseInt(D.yearRange,10))||_.yearRange,D.yearRange>100&&(D.yearRange=100);return D},toString:function(j){return j=j||this._o.format,m(this._d)?this._o.toString?this._o.toString(this._d,j):r?n(this._d).format(j):this._d.toDateString():""},getMoment:function(){return r?n(this._d):null},setMoment:function(j,D){r&&n.isMoment(j)&&this.setDate(j.toDate(),D)},getDate:function(){return m(this._d)?new Date(this._d.getTime()):null},setDate:function(j,D){if(!j)return this._d=null,this._o.field&&(this._o.field.value="",E(this._o.field,"change",{firedBy:this})),this.draw();if(typeof j=="string"&&(j=new Date(Date.parse(j))),!!m(j)){var C=this._o.minDate,$=this._o.maxDate;m(C)&&j<C?j=C:m($)&&j>$&&(j=$),this._d=new Date(j.getTime()),y(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),E(this._o.field,"change",{firedBy:this})),!D&&typeof this._o.onSelect=="function"&&this._o.onSelect.call(this,this.getDate())}},clear:function(){this.setDate(null)},gotoDate:function(j){var D=!0;if(m(j)){if(this.calendars){var C=new Date(this.calendars[0].year,this.calendars[0].month,1),$=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),W=j.getTime();$.setMonth($.getMonth()+1),$.setDate($.getDate()-1),D=W<C.getTime()||$.getTime()<W}D&&(this.calendars=[{month:j.getMonth(),year:j.getFullYear()}],this._o.mainCalendar==="right"&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(j,D){var C=this.getDate()||new Date,$=parseInt(D)*24*60*60*1e3,W;j==="add"?W=new Date(C.valueOf()+$):j==="subtract"&&(W=new Date(C.valueOf()-$)),this.setDate(W)},adjustCalendars:function(){this.calendars[0]=T(this.calendars[0]);for(var j=1;j<this._o.numberOfMonths;j++)this.calendars[j]=T({month:this.calendars[0].month+j,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(j){isNaN(j)||(this.calendars[0].month=parseInt(j,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(j){isNaN(j)||(this.calendars[0].year=parseInt(j,10),this.adjustCalendars())},setMinDate:function(j){j instanceof Date?(y(j),this._o.minDate=j,this._o.minYear=j.getFullYear(),this._o.minMonth=j.getMonth()):(this._o.minDate=_.minDate,this._o.minYear=_.minYear,this._o.minMonth=_.minMonth,this._o.startRange=_.startRange),this.draw()},setMaxDate:function(j){j instanceof Date?(y(j),this._o.maxDate=j,this._o.maxYear=j.getFullYear(),this._o.maxMonth=j.getMonth()):(this._o.maxDate=_.maxDate,this._o.maxYear=_.maxYear,this._o.maxMonth=_.maxMonth,this._o.endRange=_.endRange),this.draw()},setStartRange:function(j){this._o.startRange=j},setEndRange:function(j){this._o.endRange=j},draw:function(j){if(!(!this._v&&!j)){var D=this._o,C=D.minYear,$=D.maxYear,W=D.minMonth,A=D.maxMonth,J="",le;this._y<=C&&(this._y=C,!isNaN(W)&&this._m<W&&(this._m=W)),this._y>=$&&(this._y=$,!isNaN(A)&&this._m>A&&(this._m=A));for(var ee=0;ee<D.numberOfMonths;ee++)le="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),J+='<div class="pika-lendar">'+R(this,ee,this.calendars[ee].year,this.calendars[ee].month,this.calendars[0].year,le)+this.render(this.calendars[ee].year,this.calendars[ee].month,le)+"</div>";this.el.innerHTML=J,D.bound&&D.field.type!=="hidden"&&a(function(){D.trigger.focus()},1),typeof this._o.onDraw=="function"&&this._o.onDraw(this),D.bound&&D.field.setAttribute("aria-label",D.ariaLabel)}},adjustPosition:function(){var j,D,C,$,W,A,J,le,ee,ie,V,Q;if(!this._o.container){if(this.el.style.position="absolute",j=this._o.trigger,D=j,C=this.el.offsetWidth,$=this.el.offsetHeight,W=window.innerWidth||i.documentElement.clientWidth,A=window.innerHeight||i.documentElement.clientHeight,J=window.pageYOffset||i.body.scrollTop||i.documentElement.scrollTop,V=!0,Q=!0,typeof j.getBoundingClientRect=="function")ie=j.getBoundingClientRect(),le=ie.left+window.pageXOffset,ee=ie.bottom+window.pageYOffset;else for(le=D.offsetLeft,ee=D.offsetTop+D.offsetHeight;D=D.offsetParent;)le+=D.offsetLeft,ee+=D.offsetTop;(this._o.reposition&&le+C>W||this._o.position.indexOf("right")>-1&&le-C+j.offsetWidth>0)&&(le=le-C+j.offsetWidth,V=!1),(this._o.reposition&&ee+$>A+J||this._o.position.indexOf("top")>-1&&ee-$-j.offsetHeight>0)&&(ee=ee-$-j.offsetHeight,Q=!1),this.el.style.left=le+"px",this.el.style.top=ee+"px",d(this.el,V?"left-aligned":"right-aligned"),d(this.el,Q?"bottom-aligned":"top-aligned"),h(this.el,V?"right-aligned":"left-aligned"),h(this.el,Q?"top-aligned":"bottom-aligned")}},render:function(j,D,C){var $=this._o,W=new Date,A=v(j,D),J=new Date(j,D,1).getDay(),le=[],ee=[];y(W),$.firstDay>0&&(J-=$.firstDay,J<0&&(J+=7));for(var ie=D===0?11:D-1,V=D===11?0:D+1,Q=D===0?j-1:j,ce=D===11?j+1:j,He=v(Q,ie),Re=A+J,me=Re;me>7;)me-=7;Re+=7-me;for(var ft=!1,qt=0,Be=0;qt<Re;qt++){var Ce=new Date(j,D,1+(qt-J)),xt=m(this._d)?b(Ce,this._d):!1,Ut=b(Ce,W),Sr=$.events.indexOf(Ce.toDateString())!==-1,yn=qt<J||qt>=A+J,kr=1+(qt-J),Cs=D,Es=j,Zd=$.startRange&&b($.startRange,Ce),nu=$.endRange&&b($.endRange,Ce),K=$.startRange&&$.endRange&&$.startRange<Ce&&Ce<$.endRange,oe=$.minDate&&Ce<$.minDate||$.maxDate&&Ce>$.maxDate||$.disableWeekends&&x(Ce)||$.disableDayFn&&$.disableDayFn(Ce);yn&&(qt<J?(kr=He+kr,Cs=ie,Es=Q):(kr=kr-A,Cs=V,Es=ce));var pe={day:kr,month:Cs,year:Es,hasEvent:Sr,isSelected:xt,isToday:Ut,isDisabled:oe,isEmpty:yn,isStartRange:Zd,isEndRange:nu,isInRange:K,showDaysInNextAndPreviousMonths:$.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:$.enableSelectionDaysInNextAndPreviousMonths};$.pickWholeWeek&&xt&&(ft=!0),ee.push(B(pe)),++Be===7&&($.showWeekNumber&&ee.unshift(N(qt-J,D,j,$.firstWeekOfYearMinDays)),le.push(H(ee,$.isRTL,$.pickWholeWeek,ft)),ee=[],Be=0,ft=!1)}return U($,le,C)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),h(this.el,"is-hidden"),this._o.bound&&(l(i,"click",this._onClick),this.adjustPosition()),typeof this._o.onOpen=="function"&&this._o.onOpen.call(this))},hide:function(){var j=this._v;j!==!1&&(this._o.bound&&u(i,"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),d(this.el,"is-hidden"),this._v=!1,j!==void 0&&typeof this._o.onClose=="function"&&this._o.onClose.call(this))},destroy:function(){var j=this._o;this.hide(),u(this.el,"mousedown",this._onMouseDown,!0),u(this.el,"touchend",this._onMouseDown,!0),u(this.el,"change",this._onChange),j.keyboardInput&&u(i,"keydown",this._onKeyChange),j.field&&(u(j.field,"change",this._onInputChange),j.bound&&(u(j.trigger,"click",this._onInputClick),u(j.trigger,"focus",this._onInputFocus),u(j.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},P})})(IM);var Hye=IM.exports;const zye=mr(Hye),Uye="/static/img/DateSelect.left.8M4UgGR3.png",Wye="/static/img/DateSelect.right.l4PtomY-.png",Vye={"& .pika-single.actual-date-picker":{color:S.calendarText,background:S.calendarBackground,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:S.calendarBackground},"& .pika-prev":{backgroundImage:`url(${Uye})`},"& .pika-next":{backgroundImage:`url(${Wye})`},"& .pika-table th":{color:S.calendarItemText,"& abbr":{textDecoration:"none"}},"& .pika-button":{backgroundColor:S.calendarItemBackground,color:S.calendarItemText},"& .is-today .pika-button":{textDecoration:"underline"},"& .is-selected .pika-button":{backgroundColor:S.calendarSelectedBackground,boxShadow:"none"}}},DM=g.forwardRef(({value:e,firstDayOfWeekIdx:t,dateFormat:n,onUpdate:r,onSelect:o},i)=>{const a=g.useRef(null),l=g.useRef(null);return g.useImperativeHandle(i,()=>({handleInputKeyDown(u){let c=null;switch(u.key){case"ArrowLeft":u.preventDefault(),c=Fv(a.current.getDate(),1);break;case"ArrowUp":u.preventDefault(),c=Fv(a.current.getDate(),7);break;case"ArrowRight":u.preventDefault(),c=zc(a.current.getDate(),1);break;case"ArrowDown":u.preventDefault(),c=zc(a.current.getDate(),7);break}c&&(a.current.setDate(c,!0),r?.(c))}}),[]),g.useLayoutEffect(()=>(a.current=new zye({theme:"actual-date-picker",keyboardInput:!1,firstDay:VN(t),defaultDate:e?Sn(e,n,Hv()):Hv(),setDefaultDate:!0,toString(u){return ke(u,n)},parse(u){return Sn(u,n,new Date)},onSelect:o}),l.current.appendChild(a.current.el),()=>{a.current.destroy()}),[]),g.useEffect(()=>{a.current.getDate()!==e&&a.current.setDate(Sn(e,n,new Date),!0)},[e,n]),s.jsx(I,{style:{...Vye,flex:1},innerRef:l})});DM.displayName="DatePicker";function Yye(e){return e.key==="Enter"}function qc({containerProps:e,inputProps:t,tooltipStyle:n,value:r,isOpen:o,embedded:i,dateFormat:a="yyyy-MM-dd",focused:l,openOnFocus:u=!0,inputRef:c,shouldSaveFromKey:f=Yye,clearOnBlur:d=!0,onUpdate:h,onSelect:p}){const m=g.useMemo(()=>{if(r){const F=Mo(r);if(Oo(F))return ke(F,a)}return""},[r,a]),x=g.useRef(null),[k,v]=g.useState(m),[y,b]=g.useState(i||o||!1),w=g.useRef(null);g.useLayoutEffect(()=>{c&&(c.current=w.current)},[]);const[E,T]=g.useState(k),_=g.useRef(E),[M]=dt("firstDayOfWeekIdx"),B=M||"0";g.useEffect(()=>{_.current=k},[k]),g.useEffect(()=>v(m),[m]),g.useEffect(()=>{if($g(a).test(k)){const F=Sn(k,Ng(a),new Date);Oo(F)&&(h?.(ke(F,"yyyy-MM-dd")),T(ke(F,a)))}else if(Jb(a).test(k)){const F=Sn(k,Zb(a),new Date);Oo(F)&&(h?.(ke(F,"yyyy-MM-dd")),T(ke(F,a)))}else{const F=Sn(k,a,new Date);if(Oo(F)){const L=ke(F,"yyyy-MM-dd");h?.(L),T(k)}}},[k]);function O(F){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(F.key)&&!F.shiftKey&&!F.metaKey&&!F.altKey&&y)x.current.handleInputKeyDown(F);else if(F.key==="Escape")v(m),T(m),m===k?y&&(i||F.stopPropagation(),b(!1)):(b(!0),h?.(r));else if(f(F)){v(E),b(!1);const L=Sn(E,a,new Date);p(ke(L,"yyyy-MM-dd")),y&&F.key==="Enter"&&(F.stopPropagation(),F.preventDefault());const{onKeyDown:R}=t||{};R?.(F)}else y||(b(!0),w.current&&w.current.setSelectionRange(0,1e4))}function N(F){v(F.target.value)}const H=F=>i?F:s.jsx(Et,{position:"bottom-left",offset:2,style:{padding:0,minWidth:225,...n},"data-testid":"date-select-tooltip",children:F});return s.jsxs(I,{...e,children:[s.jsx(Ke,{focused:l,...t,inputRef:w,value:k,onPointerUp:()=>{i||b(!0)},onKeyDown:O,onChange:N,onFocus:F=>{!i&&u&&b(!0),t?.onFocus?.(F)},onBlur:F=>{if(i||b(!1),t?.onBlur?.(F),d)if(k==="")T(null),p(null);else{v(E||"");const L=Sn(E,a,new Date);L instanceof Date&&!isNaN(L.valueOf())&&p(ke(L,"yyyy-MM-dd"))}}}),y&&H(s.jsx(DM,{ref:x,value:E,firstDayOfWeekIdx:B,dateFormat:a,onUpdate:F=>{T(ke(F,a)),h?.(ke(F,"yyyy-MM-dd"))},onSelect:F=>{v(ke(F,a)),p(ke(F,"yyyy-MM-dd")),b(!1)}}))]})}function qye(e){return s.jsx(xs,{...e,width:14,height:14})}function Gye({modalProps:e,name:t,onSubmit:n,onClose:r}){const o=nr()||"MM/dd/yyyy",{grouped:i}=Fr(),a=mn(),l=Hr(),{createPayee:u}=Ht(),c=()=>{e.onClose(),r?.()};function f(y){y!=null&&(t==="amount"&&(y=gr(y)),n(t,y)),c()}const d={fontSize:17,fontWeight:400,paddingTop:8,paddingBottom:8},{isNarrowWidth:h}=zt();let p,m,x;const k={":focus":{boxShadow:0},...h&&d},v={inputProps:{style:k},containerProps:{style:{height:h?"90vh":275}}};switch(t){case"date":{const y=Qn();p="Date",x=350,m=s.jsx(qc,{value:ke(Mo(y),o),dateFormat:o,focused:!0,embedded:!0,onUpdate:()=>{},onSelect:b=>{f(ca(Sn(b,"yyyy-MM-dd",new Date)))}});break}case"account":p="Account",m=s.jsx(um,{value:null,accounts:a,focused:!0,embedded:!0,closeOnBlur:!1,onSelect:y=>{y&&f(y)},...h&&{renderAccountItemGroupHeader:y=>s.jsx(ia,{...y,style:{...X.largeText,color:S.menuItemTextHeader,paddingTop:10,paddingBottom:10}}),renderAccountItem:y=>s.jsx(xM,{...y,style:{...d,color:S.menuItemText,borderRadius:0,borderTop:`1px solid ${S.pillBorder}`}})},...v});break;case"payee":p="Payee",m=s.jsx(_w,{payees:l,accounts:a,value:null,focused:!0,embedded:!0,closeOnBlur:!1,showManagePayees:!1,showMakeTransfer:!h,onSelect:async y=>{y&&y.startsWith("new:")&&(y=await u(y.slice(4))),f(y)},...h&&{renderCreatePayeeButton:y=>s.jsx(kM,{...y,Icon:qye,style:d}),renderPayeeItemGroupHeader:y=>s.jsx(ia,{...y,style:{...X.largeText,color:S.menuItemTextHeader,paddingTop:10,paddingBottom:10}}),renderPayeeItem:y=>s.jsx(EM,{...y,style:{...d,color:S.menuItemText,borderRadius:0,borderTop:`1px solid ${S.pillBorder}`}})},...v});break;case"notes":p="Notes",m=s.jsx(Ke,{focused:!0,onEnter:y=>f(y.target.value),style:k});break;case"category":p="Category",m=s.jsx(Gd,{categoryGroups:i,value:null,focused:!0,embedded:!0,closeOnBlur:!1,showSplitOption:!1,onUpdate:()=>{},onSelect:y=>{f(y)},...h&&{renderCategoryItemGroupHeader:y=>s.jsx(ia,{...y,style:{...X.largeText,color:S.menuItemTextHeader,paddingTop:10,paddingBottom:10}}),renderCategoryItem:y=>s.jsx(bM,{...y,style:{...d,color:S.menuItemText,borderRadius:0,borderTop:`1px solid ${S.pillBorder}`}})},...v,showHiddenItems:!1});break;case"amount":p="Amount",m=s.jsx(Ke,{focused:!0,onEnter:y=>f(y.target.value),style:k});break}return s.jsx(_e,{title:p,noAnimation:!h,showHeader:h,focusAfterClose:!1,...e,onClose:c,padding:0,style:{flex:0,height:h?"85vh":275,padding:"15px 10px",borderRadius:"6px",...x&&{minWidth:x},...!h&&{backgroundColor:S.mobileModalBackground,color:S.mobileModalText}},children:()=>s.jsxs(I,{children:[!h&&s.jsx(_c,{title:p,style:{alignSelf:"center",color:S.mobileModalText,marginBottom:10}}),s.jsx(I,{style:{flex:1},children:m})]})})}function Kye(e,t){return Cc(Vse(e),t,{mapper:n=>{const r=new Set(n.filter(Boolean).map(o=>o.schedule));return new Map(e.map(o=>[o.id,Wse(o.next_date,o.completed,r.has(o.id))]))}})}function Ow({transform:e}={}){const[t,n]=g.useState(null);return g.useEffect(()=>{const r=pt("schedules").select("*");let o;const i=Cc(e?e(r):r,async a=>{i&&(o&&o.unsubscribe(),o=Kye(a,l=>n({schedules:a,statuses:l})))});return()=>{i&&i.unsubscribe(),o&&o.unsubscribe()}},[e]),t}const _M=g.createContext(null);function awe({transform:e,children:t}){const n=Ow({transform:e});return s.jsx(_M.Provider,{value:n,children:t})}function swe(){return g.useContext(_M)}/**
|
|
167
|
+
* @reach/utils v0.18.0
|
|
168
|
+
*
|
|
169
|
+
* Copyright (c) 2018-2022, React Training LLC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the MIT license found in the
|
|
172
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
173
|
+
*
|
|
174
|
+
* @license MIT
|
|
175
|
+
*/function OM(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Gn(e,t){return n=>{if(e&&e(n),!n.defaultPrevented)return t(n)}}function sx(e){return typeof e=="boolean"}function ss(e){return!!(e&&{}.toString.call(e)=="[object Function]")}function AM(e){return typeof e=="string"}function Qye(e,t){if(e!=null)if(ss(e))e(t);else try{e.current=t}catch{throw new Error(`Cannot assign value "${t}" to ref "${e}"`)}}function tu(...e){return g.useCallback(t=>{for(let n of e)Qye(n,t)},e)}function PM(e){return OM()?e?e.ownerDocument:document:null}function MM(e,t){let n=g.createContext(t);return n.displayName=e,n}function Xye(e,t,n){{let r=g.useRef(e!=null),o=g.useRef({componentName:n,controlledPropName:t});g.useEffect(()=>{o.current={componentName:n,controlledPropName:t}},[n,t]),g.useEffect(()=>{let{current:i}=r,{componentName:a,controlledPropName:l}=o.current,u=e!=null;i!==u&&console.error(`A component is changing an ${i?"":"un"}controlled \`${l}\` state of ${a} to be ${i?"un":""}controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled ${a} element for the lifetime of the component.
|
|
176
|
+
More info: https://fb.me/react-controlled-components`)},[e])}}function ic(e){return"which"in e?e.which===3:"button"in e?e.button===2:!1}function Qd(...e){return e.filter(t=>t!=null).join("--")}function RM(){}function BM(e){const t=g.useRef();return t.current||(t.current={v:e()}),t.current.v}function LM(){let[,e]=g.useState(Object.create(null));return g.useCallback(()=>{e(Object.create(null))},[])}var Ka=OM()?g.useLayoutEffect:g.useEffect;function Zye(e,t){let n=g.useRef(t);return e(()=>{n.current=t}),g.useCallback((...r)=>{n.current&&n.current(...r)},[])}function Jye(e){return Zye(g.useEffect,e)}function e0e(e,t){let[n,r]=g.useState(t),o=g.useCallback(i=>{e.current=i,r(i)},[]);return[n,o]}var My=!1,t0e=0;function g2(){return++t0e}var m2=X2.useId;function NM(e){if(m2!==void 0){let o=m2();return e??o}let t=e??(My?g2():null),[n,r]=g.useState(t);return Ka(()=>{n===null&&r(g2())},[]),g.useEffect(()=>{My===!1&&(My=!0)},[]),e??n??void 0}var n0e=({children:e,type:t="reach-portal",containerRef:n})=>{let r=g.useRef(null),o=g.useRef(null),i=LM();return g.useEffect(()=>{n!=null&&(typeof n!="object"||!("current"in n)?console.warn("@reach/portal: Invalid value passed to the `containerRef` of a `Portal`. The portal will be appended to the document body, but if you want to attach it to another DOM node you must pass a valid React ref object to `containerRef`."):n.current==null&&console.warn("@reach/portal: A ref was passed to the `containerRef` prop of a `Portal`, but no DOM node was attached to it. Be sure to pass the ref to a DOM component.\n\nIf you are forwarding the ref from another component, be sure to use the React.forwardRef API. See https://reactjs.org/docs/forwarding-refs.html."))},[n]),Ka(()=>{if(!r.current)return;let a=r.current.ownerDocument,l=n?.current||a.body;return o.current=a?.createElement(t),l.appendChild(o.current),i(),()=>{o.current&&l&&l.removeChild(o.current)}},[t,i,n]),o.current?Pl.createPortal(e,o.current):g.createElement("span",{ref:r})},$M=({unstable_skipInitialRender:e,...t})=>{let[n,r]=g.useState(!1);return g.useEffect(()=>{e&&r(!0)},[e]),e&&!n?null:g.createElement(n0e,{...t})};$M.displayName="Portal";var r0e=["bottom","height","left","right","top","width"],o0e=function(t,n){return t===void 0&&(t={}),n===void 0&&(n={}),r0e.some(function(r){return t[r]!==n[r]})},Pi=new Map,FM,i0e=function e(){var t=[];Pi.forEach(function(n,r){var o=r.getBoundingClientRect();o0e(o,n.rect)&&(n.rect=o,t.push(n))}),t.forEach(function(n){n.callbacks.forEach(function(r){return r(n.rect)})}),FM=window.requestAnimationFrame(e)};function a0e(e,t){return{observe:function(){var r=Pi.size===0;Pi.has(e)?Pi.get(e).callbacks.push(t):Pi.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),r&&i0e()},unobserve:function(){var r=Pi.get(e);if(r){var o=r.callbacks.indexOf(t);o>=0&&r.callbacks.splice(o,1),r.callbacks.length||Pi.delete(e),Pi.size||cancelAnimationFrame(FM)}}}}function y2(e,t,n){let r,o;sx(t)?r=t:(r=t?.observe??!0,o=t?.onChange),ss(n)&&(o=n),g.useEffect(()=>{sx(t)&&console.warn("Passing `observe` as the second argument to `useRect` is deprecated and will be removed in a future version of Reach UI. Instead, you can pass an object of options with an `observe` property as the second argument (`useRect(ref, { observe })`).\nSee https://reach.tech/rect#userect-observe")},[t]),g.useEffect(()=>{ss(n)&&console.warn("Passing `onChange` as the third argument to `useRect` is deprecated and will be removed in a future version of Reach UI. Instead, you can pass an object of options with an `onChange` property as the second argument (`useRect(ref, { onChange })`).\nSee https://reach.tech/rect#userect-onchange")},[n]);let[i,a]=g.useState(e.current),l=g.useRef(!1),u=g.useRef(!1),[c,f]=g.useState(null),d=g.useRef(o);return Ka(()=>{d.current=o,e.current!==i&&a(e.current)}),Ka(()=>{i&&!l.current&&(l.current=!0,f(i.getBoundingClientRect()))},[i]),Ka(()=>{if(!r)return;let h=i;if(u.current||(u.current=!0,h=e.current),!h){console.warn("You need to place the ref");return}let p=a0e(h,m=>{d.current?.(m),f(m)});return p.observe(),()=>{p.unobserve()}},[r,i,e]),c}/*!
|
|
177
|
+
* tabbable 5.3.3
|
|
178
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
179
|
+
*/var s0e=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],lx=s0e.join(","),HM=typeof Element>"u",Gc=HM?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ux=!HM&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument},l0e=function(t,n,r){var o=Array.prototype.slice.apply(t.querySelectorAll(lx));return n&&Gc.call(t,lx)&&o.unshift(t),o=o.filter(r),o},u0e=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(a.tagName==="SLOT"){var l=a.assignedElements(),u=l.length?l:a.children,c=e(u,!0,r);r.flatten?o.push.apply(o,c):o.push({scope:a,candidates:c})}else{var f=Gc.call(a,lx);f&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var d=a.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(a),h=!r.shadowRootFilter||r.shadowRootFilter(a);if(d&&h){var p=e(d===!0?a.children:d.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scope:a,candidates:p})}else i.unshift.apply(i,a.children)}}return o},zM=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||t.isContentEditable)&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},c0e=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},UM=function(t){return t.tagName==="INPUT"},d0e=function(t){return UM(t)&&t.type==="hidden"},f0e=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},h0e=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},p0e=function(t){if(!t.name)return!0;var n=t.form||ux(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=h0e(o,t.form);return!i||i===t},g0e=function(t){return UM(t)&&t.type==="radio"},m0e=function(t){return g0e(t)&&!p0e(t)},v2=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},y0e=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=Gc.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(Gc.call(a,"details:not([open]) *"))return!0;var l=ux(t).host,u=l?.ownerDocument.contains(l)||t.ownerDocument.contains(t);if(!r||r==="full"){if(typeof o=="function"){for(var c=t;t;){var f=t.parentElement,d=ux(t);if(f&&!f.shadowRoot&&o(f)===!0)return v2(t);t.assignedSlot?t=t.assignedSlot:!f&&d!==t.ownerDocument?t=d.host:t=f}t=c}if(u)return!t.getClientRects().length}else if(r==="non-zero-area")return v2(t);return!1},v0e=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Gc.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},x0e=function(t,n){return!(n.disabled||d0e(n)||y0e(n,t)||f0e(n)||v0e(n))},x2=function(t,n){return!(m0e(n)||zM(n)<0||!x0e(t,n))},b0e=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},w0e=function e(t){var n=[],r=[];return t.forEach(function(o,i){var a=!!o.scope,l=a?o.scope:o,u=zM(l,a),c=a?e(o.candidates):l;u===0?a?n.push.apply(n,c):n.push(l):r.push({documentOrder:i,tabIndex:u,item:o,isScope:a,content:c})}),r.sort(c0e).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Qo=function(t,n){n=n||{};var r;return n.getShadowRoot?r=u0e([t],n.includeContainer,{filter:x2.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:b0e}):r=l0e(t,n.includeContainer,x2.bind(null,n)),w0e(r)},WM=g.forwardRef(function({unstable_skipInitialPortalRender:t,...n},r){return g.createElement($M,{unstable_skipInitialRender:t},g.createElement(VM,{ref:r,...n}))});WM.displayName="Popover";var VM=g.forwardRef(function({as:t="div",targetRef:n,position:r=k0e,unstable_observableRefs:o=[],...i},a){const l=g.useRef(null),u=y2(l,{observe:!i.hidden}),c=y2(n,{observe:!0}),f=tu(l,a);return C0e(n,l),g.createElement(t,{"data-reach-popover":"",ref:f,...i,style:{position:"absolute",...S0e(r,c,u,...o),...i.style}})});VM.displayName="PopoverImpl";function S0e(e,t,n,...r){return n?e(t,n,...r.map(o=>o.current)):{visibility:"hidden"}}function YM(e,t,n){return{top:n?`${e.top-t.height+window.pageYOffset}px`:`${e.top+e.height+window.pageYOffset}px`}}var k0e=(e,t)=>{if(!e||!t)return{};const{directionRight:n,directionUp:r}=qM(e,t);return{left:n?`${e.right-t.width+window.pageXOffset}px`:`${e.left+window.pageXOffset}px`,...YM(e,t,r)}},T0e=(e,t)=>{if(!e||!t)return{};const{directionUp:n}=qM(e,t);return{width:e.width,left:e.left,...YM(e,t,n)}};function qM(e,t,n=0,r=0){const 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},i=o.right&&!o.left,a=o.left&&!o.right,l=o.bottom&&!o.top,u=o.top&&!o.bottom;return{directionRight:i,directionLeft:a,directionUp:l,directionDown:u}}function C0e(e,t){const n=PM(e.current);function r(y){y.key==="Tab"&&t.current&&Qo(t.current).length===0||(y.key==="Tab"&&y.shiftKey?c(y)?f(y):d(y)?h(y):m(y)&&k():y.key==="Tab"&&(i()?a(y):l()?u(y):p(y)&&k()))}g.useEffect(()=>(n.addEventListener("keydown",r),()=>{n.removeEventListener("keydown",r)}),[]);function o(){const y=Qo(n),b=y&&e.current?y.indexOf(e.current):-1,w=y&&y[b+1];return t.current&&t.current.contains(w||null)?!1:w}function i(){return e.current?e.current===n.activeElement:!1}function a(y){const b=t.current&&Qo(t.current);b&&b[0]&&(y.preventDefault(),b[0].focus())}function l(){if(t.current?t.current.contains(n.activeElement||null):!1){const b=t.current&&Qo(t.current);return!!(b&&b[b.length-1]===n.activeElement)}return!1}function u(y){const b=o();b&&(y.preventDefault(),b.focus())}function c(y){if(!y.shiftKey)return;const b=o();return y.target===b}function f(y){const b=t.current&&Qo(t.current),w=b&&b[b.length-1];w&&(y.preventDefault(),w.focus())}function d(y){const b=t.current&&Qo(t.current);return b?b.length===0?!1:y.target===b[0]:!1}function h(y){y.preventDefault(),e.current?.focus()}function p(y){const b=t.current?Qo(n).filter(w=>!t.current.contains(w)):null;return b?y.target===b[b.length-1]:!1}function m(y){return y.target===Qo(n)[0]}let x=[];function k(){const y=t.current&&Qo(t.current);y&&(y.forEach(b=>{x.push([b,b.tabIndex]),b.tabIndex=-1}),n.addEventListener("focusin",v))}function v(){n.removeEventListener("focusin",v),x.forEach(([y,b])=>{y.tabIndex=b})}}function E0e(e,t={}){const n=[];let r=g.createContext({descendants:n,registerDescendant:()=>RM,...t});return r.displayName=e,r}function j0e(e,t,n){let r=LM(),{registerDescendant:o,descendants:i}=g.useContext(t),a=n??i.findIndex(l=>l.element===e.element);return Ka(()=>(e.element||r(),o({...e,index:a})),[e,r,a,o,...Object.values(e)]),a}function I0e(){return g.useState([])}function D0e(e){return g.useContext(e).descendants}function _0e({context:e,children:t,items:n,set:r}){let o=g.useCallback(({element:i,index:a,...l})=>i?(r(u=>{if(a!=null&&a!==-1)return b2(u,{element:i,index:a,...l},a);if(u.length===0)return[{...l,element:i,index:0}];if(u.find(d=>d.element===i))return console.warn(`[reach-ui]: \`useDescendant\` was called with an element that was already registered.
|
|
180
|
+
|
|
181
|
+
If you are using the \`@reach/descendants\` package directly, make sure to only register descendants once. Registering a descendant more than once will lead to bugs in your app.
|
|
182
|
+
|
|
183
|
+
If you are using another \`reach-ui\` package, this is probably our bug!
|
|
184
|
+
|
|
185
|
+
To report a bug, open a new issue:
|
|
186
|
+
|
|
187
|
+
https://github.com/reach/reach-ui/issues/new?assignees=&labels=&template=Bug_report.md
|
|
188
|
+
|
|
189
|
+
IMPORTANT: this check will only run in the development build, so if you see this warning please be aware that your app may crash when deployed.`),P0e(u);let c=A0e(u,i),f;return c===-1?f=[...u,{...l,element:i,index:u.length}]:f=b2(u,{...l,element:i,index:c},c),f}),()=>{i&&r(u=>u.filter(c=>i!==c.element))}):RM,[]);return g.createElement(e.Provider,{value:g.useMemo(()=>({descendants:n,registerDescendant:o}),[n,o])},t)}function O0e(e,t){let{descendants:n}=g.useContext(e),{callback:r,currentIndex:o,filter:i,key:a="index",orientation:l="vertical",rotate:u=!0,rtl:c=!1}=t;return function(d){if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(d.key))return;let h=o??-1,p=i?n.filter(i):n;if(!p.length)return;let m=p.findIndex(b=>b.index===o);function x(){return h===y().index?u?v():p[m]:p[(m+1)%p.length]}function k(){return h===v().index?u?y():p[m]:p[(m-1+p.length)%p.length]}function v(){return p[0]}function y(){return p[p.length-1]}switch(d.key){case"ArrowDown":if(l==="vertical"||l==="both"){d.preventDefault();let _=x();r(a==="option"?_:_[a])}break;case"ArrowUp":if(l==="vertical"||l==="both"){d.preventDefault();let _=k();r(a==="option"?_:_[a])}break;case"ArrowLeft":if(l==="horizontal"||l==="both"){d.preventDefault();let _=(c?x:k)();r(a==="option"?_:_[a])}break;case"ArrowRight":if(l==="horizontal"||l==="both"){d.preventDefault();let _=(c?k:x)();r(a==="option"?_:_[a])}break;case"PageUp":d.preventDefault();let b=(d.ctrlKey?k:v)();r(a==="option"?b:b[a]);break;case"Home":d.preventDefault();let w=v();r(a==="option"?w:w[a]);break;case"PageDown":d.preventDefault();let E=(d.ctrlKey?x:y)();r(a==="option"?E:E[a]);break;case"End":d.preventDefault();let T=y();r(a==="option"?T:T[a]);break}}}function GM(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function A0e(e,t){if(!t||!e.length)return-1;let n=e.length;for(;n--;){let r=e[n].element;if(r&&GM(r,t))return n+1}return-1}function b2(e,t,n){return n==null||!(n in e)?[...e,t]:[...e.slice(0,n),t,...e.slice(n)]}function P0e(e){return e.sort((t,n)=>!t.element||!n.element?0:GM(t.element,n.element)?-1:1).map((t,n)=>({...t,index:n}))}/*! *****************************************************************************
|
|
190
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
192
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
193
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
194
|
+
|
|
195
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
196
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
197
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
198
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
199
|
+
|
|
200
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
201
|
+
and limitations under the License.
|
|
202
|
+
***************************************************************************** */var Zs;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Zs||(Zs={}));var M0e={type:"xstate.init"};function w2(e){return e===void 0?[]:[].concat(e)}function qo(e){return{type:"xstate.assign",assignment:e}}function S2(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function cx(e){return function(t){return e===t}}function KM(e){return typeof e=="string"?{type:e}:e}function k2(e,t){return{value:e,context:t,actions:[],changed:!1,matches:cx(e)}}function R0e(e,t){t===void 0&&(t={});var n={config:e,_options:t,initialState:{value:e.initial,actions:w2(e.states[e.initial].entry).map(function(r){return S2(r,t.actions)}),context:e.context,matches:cx(e.initial)},transition:function(r,o){var i,a,l=typeof r=="string"?{value:r,context:e.context}:r,u=l.value,c=l.context,f=KM(o),d=e.states[u];if(d.on){var h=w2(d.on[f.type]),p=function(v){if(v===void 0)return{value:k2(u,c)};var y=typeof v=="string"?{target:v}:v,b=y.target,w=b===void 0?u:b,E=y.actions,T=E===void 0?[]:E,_=y.cond,M=c;if((_===void 0?function(){return!0}:_)(c,f)){var B=e.states[w],O=!1,N=[].concat(d.exit,T,B.entry).filter(function(H){return H}).map(function(H){return S2(H,n._options.actions)}).filter(function(H){if(H.type==="xstate.assign"){O=!0;var F=Object.assign({},M);return typeof H.assignment=="function"?F=H.assignment(M,f):Object.keys(H.assignment).forEach(function(L){F[L]=typeof H.assignment[L]=="function"?H.assignment[L](M,f):H.assignment[L]}),M=F,!1}return!0});return{value:{value:w,context:M,actions:N,changed:w!==u||N.length>0||O,matches:cx(w)}}}};try{for(var m=function(v){var y=typeof Symbol=="function"&&v[Symbol.iterator],b=0;return y?y.call(v):{next:function(){return v&&b>=v.length&&(v=void 0),{value:v&&v[b++],done:!v}}}}(h),x=m.next();!x.done;x=m.next()){var k=p(x.value);if(typeof k=="object")return k.value}}catch(v){i={error:v}}finally{try{x&&!x.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}}return k2(u,c)}};return n}var T2=function(e,t){return e.actions.forEach(function(n){var r=n.exec;return r&&r(e.context,t)})};function B0e(e){var t=e.initialState,n=Zs.NotStarted,r=new Set,o={_machine:e,send:function(i){n===Zs.Running&&(t=e.transition(t,i),T2(t,KM(i)),r.forEach(function(a){return a(t)}))},subscribe:function(i){return r.add(i),i(t),{unsubscribe:function(){return r.delete(i)}}},start:function(){return n=Zs.Running,T2(t,M0e),o},stop:function(){return n=Zs.Stopped,r.clear(),o},get state(){return t},get status(){return n}};return o}var L0e=e=>{let t;return e.subscribe(n=>{t=n}).unsubscribe(),t};function N0e(e,t,n){let r=g.useRef(e),o=BM(()=>B0e(r.current).start()),i=g.useRef(null),[a,l]=g.useState(()=>L0e(o)),u=g.useCallback(f=>{let d=AM(f)?{type:f}:f,h=$0e(t);o.send({...d,lastEventType:i.current,refs:h}),i.current=d.type,n&&(console.group("Event Sent"),console.log("Event:",d),console.groupEnd())},[n]);return g.useEffect(()=>(o.subscribe(function(d){d.changed&&l(d)}),()=>{o.stop()}),[o]),g.useEffect(()=>{n&&a.changed&&(console.group("State Updated"),console.log("State:",a),console.groupEnd())},[n,a]),[g.useMemo(()=>({...a,matches:f=>f===a.value}),[a.changed,a.context,a.value]),u,o]}function $0e(e){return Object.entries(e).reduce((t,[n,r])=>(t[n]=r.current,t),{})}function F0e(e,t){return BM(()=>R0e(e,t))}var Su=qo({navigationValue:null}),de=qo({typeaheadQuery:null}),Jt=qo({value:(e,t)=>t.value}),H0e=qo({value:(e,t)=>e.initialValue}),zn=qo({navigationValue:(e,t)=>t.value}),Ea=qo({navigationValue:e=>{let t=Y0e(e.value,e.options);return t&&!t.disabled?e.value:e.options.find(n=>!n.disabled)?.value||null}});function Pf(e,t){if(t.type==="BLUR"){let{list:n,popover:r}=t.refs,{relatedTarget:o}=t,i=PM(r);return!!(i?.activeElement!==n&&r&&!r.contains(o||i?.activeElement))}return!1}function Ii(e,t){if(t.type==="OUTSIDE_MOUSE_DOWN"||t.type==="OUTSIDE_MOUSE_UP"){let{button:n,popover:r}=t.refs,{relatedTarget:o}=t;return!!(o!==n&&n&&!n.contains(o)&&r&&!r.contains(o))}return!1}function Xo(e,t){return!!e.options.find(n=>n.value===e.navigationValue)}function Mf(e,t){let{popover:n,list:r}=t.refs,{relatedTarget:o}=t;return n&&o&&n.contains(o)&&o!==r?!1:Xo(e)}function Un(e,t){requestAnimationFrame(()=>{t.refs.list&&t.refs.list.focus()})}function st(e,t){t.refs.button&&t.refs.button.focus()}function Ps(e,t){return!t.disabled}function z0e(e,t){return"isControlled"in t?!t.isControlled:!1}function So(e,t){return!(t.type==="OPTION_TOUCH_START"&&t&&t.disabled)}function un(e,t){return"disabled"in t&&t.disabled?!1:"value"in t?t.value!=null:e.navigationValue!=null}function Gt(e,t){t.callback&&t.callback(t.value)}function U0e(e,t){if(t.type!=="KEY_DOWN_ENTER")return;let{hiddenInput:n}=t.refs;if(n&&n.form){let r=n.form.querySelector("button:not([type]),[type='submit']");r&&r.click()}}var Rf=qo({typeaheadQuery:(e,t)=>(e.typeaheadQuery||"")+t.query}),W0e=qo({value:(e,t)=>{if(t.type==="UPDATE_AFTER_TYPEAHEAD"&&t.query){let n=QM(e.options,t.query);if(n&&!n.disabled)return t.callback&&t.callback(n.value),n.value}return e.value}}),Ry=qo({navigationValue:(e,t)=>{if(t.type==="UPDATE_AFTER_TYPEAHEAD"&&t.query){let n=QM(e.options,t.query);if(n&&!n.disabled)return n.value}return e.navigationValue}}),ku={GET_DERIVED_DATA:{actions:qo((e,t)=>({...e,...t.data}))},VALUE_CHANGE:{actions:[Jt,Gt]}},V0e=({value:e})=>({id:"listbox",initial:"IDLE",context:{initialValue:e,value:e,options:[],navigationValue:null,typeaheadQuery:null},states:{IDLE:{on:{...ku,BUTTON_MOUSE_DOWN:{target:"OPEN",actions:[Ea],cond:Ps},KEY_DOWN_SPACE:{target:"NAVIGATING",actions:[Ea,Un],cond:Ps},KEY_DOWN_SEARCH:{target:"IDLE",actions:Rf,cond:Ps},UPDATE_AFTER_TYPEAHEAD:{target:"IDLE",actions:[W0e],cond:Ps},CLEAR_TYPEAHEAD:{target:"IDLE",actions:de},KEY_DOWN_NAVIGATE:{target:"NAVIGATING",actions:[Ea,de,Un],cond:Ps},KEY_DOWN_ENTER:{actions:[U0e],cond:Ps},RESET_VALUE:{actions:[H0e,Gt],cond:z0e}}},INTERACTING:{entry:[Su],on:{...ku,CLEAR_NAV_SELECTION:{actions:[Su,Un]},KEY_DOWN_ENTER:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},KEY_DOWN_SPACE:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},BUTTON_MOUSE_DOWN:{target:"IDLE",actions:[st]},KEY_DOWN_ESCAPE:{target:"IDLE",actions:[st]},OPTION_MOUSE_DOWN:{target:"DRAGGING"},OUTSIDE_MOUSE_DOWN:[{target:"IDLE",cond:Ii,actions:de},{target:"DRAGGING",actions:de,cond:Xo}],OUTSIDE_MOUSE_UP:[{target:"IDLE",cond:Ii,actions:de},{target:"NAVIGATING",cond:Xo},{target:"INTERACTING",actions:de}],KEY_DOWN_ENTER:"INTERACTING",BLUR:[{target:"IDLE",cond:Pf,actions:de},{target:"NAVIGATING",cond:Mf},{target:"INTERACTING",actions:de}],OPTION_TOUCH_START:{target:"NAVIGATING",actions:[zn,de],cond:So},OPTION_CLICK:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},OPTION_PRESS:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},OPTION_MOUSE_ENTER:{target:"NAVIGATING",actions:[zn,de],cond:So},KEY_DOWN_NAVIGATE:{target:"NAVIGATING",actions:[zn,de,Un]}}},OPEN:{on:{...ku,CLEAR_NAV_SELECTION:{actions:[Su]},KEY_DOWN_ENTER:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},KEY_DOWN_SPACE:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},BUTTON_MOUSE_DOWN:{target:"IDLE",actions:[st]},KEY_DOWN_ESCAPE:{target:"IDLE",actions:[st]},OPTION_MOUSE_DOWN:{target:"DRAGGING"},OUTSIDE_MOUSE_DOWN:[{target:"IDLE",cond:Ii,actions:de},{target:"DRAGGING",cond:Xo},{target:"INTERACTING",actions:de}],OUTSIDE_MOUSE_UP:[{target:"IDLE",cond:Ii,actions:de},{target:"NAVIGATING",cond:Xo},{target:"INTERACTING",actions:de}],BLUR:[{target:"IDLE",cond:Pf,actions:de},{target:"NAVIGATING",cond:Mf},{target:"INTERACTING",actions:de}],BUTTON_MOUSE_UP:{target:"NAVIGATING",actions:[Ea,Un]},LIST_MOUSE_UP:{target:"NAVIGATING",actions:[Ea,Un]},OPTION_TOUCH_START:{target:"NAVIGATING",actions:[zn,de],cond:So},OPTION_CLICK:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},OPTION_PRESS:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},KEY_DOWN_NAVIGATE:{target:"NAVIGATING",actions:[zn,de,Un]},KEY_DOWN_SEARCH:{target:"NAVIGATING",actions:Rf},UPDATE_AFTER_TYPEAHEAD:{actions:[Ry]},CLEAR_TYPEAHEAD:{actions:de},OPTION_MOUSE_MOVE:[{target:"DRAGGING",actions:[zn],cond:So},{target:"DRAGGING"}]}},DRAGGING:{on:{...ku,CLEAR_NAV_SELECTION:{actions:[Su]},KEY_DOWN_ENTER:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},KEY_DOWN_SPACE:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},BUTTON_MOUSE_DOWN:{target:"IDLE",actions:[st]},KEY_DOWN_ESCAPE:{target:"IDLE",actions:[st]},OPTION_MOUSE_DOWN:{target:"DRAGGING"},OUTSIDE_MOUSE_DOWN:[{target:"IDLE",cond:Ii,actions:de},{target:"NAVIGATING",cond:Xo},{target:"INTERACTING",actions:de}],OUTSIDE_MOUSE_UP:[{target:"IDLE",cond:Ii,actions:de},{target:"NAVIGATING",cond:Xo,actions:Un},{target:"INTERACTING",actions:[de,Un]}],BLUR:[{target:"IDLE",cond:Pf,actions:de},{target:"NAVIGATING",cond:Mf},{target:"INTERACTING",actions:de}],BUTTON_MOUSE_UP:{target:"NAVIGATING",actions:[Ea,Un]},OPTION_TOUCH_START:{target:"NAVIGATING",actions:[zn,de],cond:So},OPTION_CLICK:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},OPTION_PRESS:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},OPTION_MOUSE_ENTER:{target:"DRAGGING",actions:[zn,de],cond:So},KEY_DOWN_NAVIGATE:{target:"NAVIGATING",actions:[zn,de,Un]},KEY_DOWN_SEARCH:{target:"NAVIGATING",actions:Rf},UPDATE_AFTER_TYPEAHEAD:{actions:[Ry]},CLEAR_TYPEAHEAD:{actions:de},OPTION_MOUSE_MOVE:[{target:"NAVIGATING",actions:[zn],cond:So},{target:"NAVIGATING"}],OPTION_MOUSE_UP:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un}}},NAVIGATING:{on:{...ku,CLEAR_NAV_SELECTION:{actions:[Su,Un]},KEY_DOWN_ENTER:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},KEY_DOWN_SPACE:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},BUTTON_MOUSE_DOWN:{target:"IDLE",actions:[st]},KEY_DOWN_ESCAPE:{target:"IDLE",actions:[st]},OPTION_MOUSE_DOWN:{target:"DRAGGING"},OUTSIDE_MOUSE_DOWN:[{target:"IDLE",cond:Ii,actions:de},{target:"NAVIGATING",cond:Xo},{target:"INTERACTING",actions:de}],OUTSIDE_MOUSE_UP:[{target:"IDLE",cond:Ii,actions:de},{target:"NAVIGATING",cond:Xo},{target:"INTERACTING",actions:de}],BLUR:[{target:"IDLE",cond:Pf,actions:de},{target:"NAVIGATING",cond:Mf},{target:"INTERACTING",actions:de}],BUTTON_MOUSE_UP:{target:"NAVIGATING",actions:[Ea,Un]},OPTION_TOUCH_START:{target:"NAVIGATING",actions:[zn,de],cond:So},OPTION_CLICK:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},OPTION_PRESS:{target:"IDLE",actions:[Jt,de,st,Gt],cond:un},OPTION_MOUSE_ENTER:{target:"NAVIGATING",actions:[zn,de],cond:So},KEY_DOWN_NAVIGATE:{target:"NAVIGATING",actions:[zn,de,Un]},KEY_DOWN_SEARCH:{target:"NAVIGATING",actions:Rf},UPDATE_AFTER_TYPEAHEAD:{actions:[Ry]},CLEAR_TYPEAHEAD:{actions:de},OPTION_MOUSE_MOVE:[{target:"NAVIGATING",actions:[zn],cond:So},{target:"NAVIGATING"}]}}}});function QM(e,t=""){return t&&e.find(r=>!r.disabled&&r.label&&r.label.toLowerCase().startsWith(t.toLowerCase()))||null}function Y0e(e,t){return e?t.find(n=>n.value===e):void 0}var q0e=!1,kp=E0e("ListboxDescendantContext"),Si=MM("ListboxContext",{}),XM=MM("ListboxGroupContext",{}),Aw=g.forwardRef(function({as:t="div","aria-labelledby":n,"aria-label":r,children:o,defaultValue:i,disabled:a=!1,form:l,name:u,onChange:c,required:f,value:d,__componentName:h="ListboxInput",...p},m){let x=g.useRef(d!=null),[k,v]=I0e(),y=g.useRef(null),b=g.useRef(null),w=g.useRef(null),E=g.useRef(null),T=g.useRef(null),_=g.useRef(null),M=g.useRef(null),B=F0e(V0e({value:(x.current?d:i)||null})),[O,N]=N0e(B,{button:y,hiddenInput:b,highlightedOption:w,input:E,list:T,popover:_,selectedOption:M},q0e);function H(C){C!==O.context.value&&c?.(C)}let F=NM(p.id),L=p.id||Qd("listbox-input",F),R=tu(E,m),U=g.useMemo(()=>{let C=k.find($=>$.value===O.context.value);return C?C.label:null},[k,O.context.value]),P=X0e(O.value),j={ariaLabel:r,ariaLabelledBy:n,buttonRef:y,disabled:a,highlightedOptionRef:w,isExpanded:P,listboxId:L,listboxValueLabel:U,listRef:T,onValueChange:H,popoverRef:_,selectedOptionRef:M,send:N,state:O.value,stateData:O.context},D=g.useRef(!1);if(!x.current&&i==null&&!D.current&&k.length){D.current=!0;let C=k.find($=>!$.disabled);C&&C.value&&N({type:"VALUE_CHANGE",value:C.value})}return Xye(d,"value",h),Z0e(d,O.context.value,()=>{N({type:"VALUE_CHANGE",value:d})}),Ka(()=>{N({type:"GET_DERIVED_DATA",data:{options:k}})},[k,N]),g.useEffect(()=>{function C($){let{target:W,relatedTarget:A}=$;C2(_.current,W)||N({type:"OUTSIDE_MOUSE_DOWN",relatedTarget:A||W})}return P&&window.addEventListener("mousedown",C),()=>{window.removeEventListener("mousedown",C)}},[N,P]),g.useEffect(()=>{function C($){let{target:W,relatedTarget:A}=$;C2(_.current,W)||N({type:"OUTSIDE_MOUSE_UP",relatedTarget:A||W})}return P&&window.addEventListener("mouseup",C),()=>{window.removeEventListener("mouseup",C)}},[N,P]),g.useEffect(()=>{let C=b.current?.form;if(!C)return;function $(W){N({type:"RESET_VALUE",isControlled:x.current})}return C.addEventListener("reset",$),()=>{C?.removeEventListener("reset",$)}},[E,x,N]),g.createElement(t,{...p,ref:R,"data-reach-listbox-input":"","data-state":P?"expanded":"closed","data-value":O.context.value,id:L},g.createElement(Si.Provider,{value:j},g.createElement(_0e,{context:kp,items:k,set:v},ss(o)?o({id:L,isExpanded:P,value:O.context.value,selectedOptionRef:M,highlightedOptionRef:w,valueLabel:U,expanded:P}):o,(l||u||f)&&g.createElement("input",{ref:b,"data-reach-listbox-hidden-input":"",disabled:a,form:l,name:u,readOnly:!0,required:f,tabIndex:-1,type:"hidden",value:O.context.value||""}))))});Aw.displayName="ListboxInput";var G0e=g.forwardRef(function({arrow:t="▼",button:n,children:r,portal:o=!0,...i},a){return g.createElement(Aw,{...i,__componentName:"Listbox",ref:a},({value:l,valueLabel:u})=>g.createElement(g.Fragment,null,g.createElement(JM,{arrow:t,children:n?ss(n)?n({value:l,label:u}):n:void 0}),g.createElement(n3,{portal:o},g.createElement(Tp,null,r))))});G0e.displayName="Listbox";var ZM=g.forwardRef(function({"aria-label":t,arrow:n=!1,as:r="span",children:o,onKeyDown:i,onMouseDown:a,onMouseUp:l,...u},c){let{buttonRef:f,send:d,ariaLabelledBy:h,disabled:p,isExpanded:m,listboxId:x,stateData:k,listboxValueLabel:v}=g.useContext(Si),y=k.value,b=tu(f,c),w=o3();function E(B){ic(B.nativeEvent)||(B.preventDefault(),B.stopPropagation(),d({type:"BUTTON_MOUSE_DOWN",disabled:p}))}function T(B){ic(B.nativeEvent)||(B.preventDefault(),B.stopPropagation(),d({type:"BUTTON_MOUSE_UP"}))}let _=Qd("button",x),M=g.useMemo(()=>{if(o){if(ss(o))return o({isExpanded:m,label:v,value:y,expanded:m})}else return v;return o},[o,v,m,y]);return g.createElement(r,{"aria-disabled":p||void 0,"aria-expanded":m||void 0,"aria-haspopup":"listbox","aria-labelledby":t?void 0:[h,_].filter(Boolean).join(" "),"aria-label":t,role:"button",tabIndex:p?-1:0,...u,ref:b,"data-reach-listbox-button":"",id:_,onKeyDown:Gn(i,w),onMouseDown:Gn(a,E),onMouseUp:Gn(l,T)},M,n&&g.createElement(K0e,null,sx(n)?null:n))});ZM.displayName="ListboxButton";var JM=g.memo(ZM),e3=g.forwardRef(function({as:t="span",children:n,...r},o){let{isExpanded:i}=g.useContext(Si);return g.createElement(t,{"aria-hidden":!0,...r,ref:o,"data-reach-listbox-arrow":"","data-expanded":i?"":void 0},ss(n)?n({isExpanded:i,expanded:i}):n||"▼")});e3.displayName="ListboxArrow";var K0e=g.memo(e3),t3=g.forwardRef(function({as:t="div",position:n=T0e,onBlur:r,onKeyDown:o,onMouseUp:i,portal:a=!0,unstable_observableRefs:l,...u},c){let{isExpanded:f,buttonRef:d,popoverRef:h,send:p}=g.useContext(Si),m=tu(h,c),x=o3();function k(){p({type:"LIST_MOUSE_UP"})}let v={hidden:!f,tabIndex:-1,...u,ref:m,"data-reach-listbox-popover":"",onMouseUp:Gn(i,k),onBlur:Gn(r,y),onKeyDown:Gn(o,x)};function y(b){let{nativeEvent:w}=b;requestAnimationFrame(()=>{p({type:"BLUR",relatedTarget:w.relatedTarget||w.target})})}return a?g.createElement(WM,{...v,as:t,targetRef:d,position:n,unstable_observableRefs:l,unstable_skipInitialPortalRender:!0}):g.createElement(t,{...v})});t3.displayName="ListboxPopover";var n3=g.memo(t3),Tp=g.forwardRef(function({as:t="ul",...n},r){let{listRef:o,ariaLabel:i,ariaLabelledBy:a,isExpanded:l,listboxId:u,stateData:{value:c,navigationValue:f}}=g.useContext(Si),d=tu(r,o);return g.createElement(t,{"aria-activedescendant":i3(l?f:c),"aria-labelledby":i?void 0:a,"aria-label":i,role:"listbox",tabIndex:-1,...n,ref:d,"data-reach-listbox-list":"",id:Qd("listbox",u)})});Tp.displayName="ListboxList";var uh=g.forwardRef(function({as:t="li",children:n,disabled:r,index:o,label:i,onClick:a,onMouseDown:l,onMouseEnter:u,onMouseLeave:c,onMouseMove:f,onMouseUp:d,onTouchStart:h,value:p,...m},x){let{highlightedOptionRef:k,selectedOptionRef:v,send:y,isExpanded:b,onValueChange:w,state:E,stateData:{value:T,navigationValue:_}}=g.useContext(Si),[M,B]=g.useState(i),O=i||M||"",N=g.useRef(null),[H,F]=e0e(N,null),L=g.useMemo(()=>({element:H,value:p,label:O,disabled:!!r}),[r,H,O,p]);j0e(L,kp,o);let R=g.useCallback(ee=>{!i&&ee&&B(ie=>ee.textContent&&ie!==ee.textContent?ee.textContent:ie||"")},[i]),U=_?_===p:!1,P=T===p,j=tu(R,x,F,P?v:null,U?k:null);function D(){y({type:"OPTION_MOUSE_ENTER",value:p,disabled:!!r})}function C(){y({type:"OPTION_TOUCH_START",value:p,disabled:!!r})}function $(){y({type:"CLEAR_NAV_SELECTION"})}function W(ee){ic(ee.nativeEvent)||(ee.preventDefault(),y({type:"OPTION_MOUSE_DOWN"}))}function A(ee){ic(ee.nativeEvent)||y({type:"OPTION_MOUSE_UP",value:p,callback:w,disabled:!!r})}function J(ee){ic(ee.nativeEvent)||y({type:"OPTION_CLICK",value:p,callback:w,disabled:!!r})}function le(){(E==="OPEN"||_!==p)&&y({type:"OPTION_MOUSE_MOVE",value:p,disabled:!!r})}return g.createElement(t,{"aria-selected":(b?U:P)||void 0,"aria-disabled":r||void 0,role:"option",...m,ref:j,id:i3(p),"data-reach-listbox-option":"","data-current-nav":U?"":void 0,"data-current-selected":P?"":void 0,"data-label":O,"data-value":p,onClick:Gn(a,J),onMouseDown:Gn(l,W),onMouseEnter:Gn(u,D),onMouseLeave:Gn(c,$),onMouseMove:Gn(f,le),onMouseUp:Gn(d,A),onTouchStart:Gn(h,C)},n)});uh.displayName="ListboxOption";var Q0e=g.forwardRef(function({as:t="div",label:n,children:r,...o},i){let{listboxId:a}=g.useContext(Si),l=Qd("label",NM(o.id),a);return g.createElement(XM.Provider,{value:{labelId:l}},g.createElement(t,{"aria-labelledby":l,role:"group",...o,"data-reach-listbox-group":"",ref:i},n&&g.createElement(r3,null,n),r))});Q0e.displayName="ListboxGroup";var r3=g.forwardRef(function({as:t="span",...n},r){let{labelId:o}=g.useContext(XM);return g.createElement(t,{role:"presentation",...n,ref:r,"data-reach-listbox-group-label":"",id:o})});r3.displayName="ListboxGroupLabel";function X0e(e){return["NAVIGATING","OPEN","DRAGGING","INTERACTING"].includes(e)}function o3(){let{send:e,disabled:t,onValueChange:n,stateData:{navigationValue:r,typeaheadQuery:o}}=g.useContext(Si),i=D0e(kp),a=Jye(n);g.useEffect(()=>{o&&e({type:"UPDATE_AFTER_TYPEAHEAD",query:o,callback:a});let c=window.setTimeout(()=>{o!=null&&e({type:"CLEAR_TYPEAHEAD"})},1e3);return()=>{window.clearTimeout(c)}},[a,e,o]);let l=i.findIndex(({value:c})=>c===r);return Gn(function(c){let{key:f}=c,d=AM(f)&&f.length===1,h=i.find(p=>p.value===r);switch(f){case"Enter":e({type:"KEY_DOWN_ENTER",value:r,callback:n,disabled:!!(h?.disabled||t)});return;case" ":c.preventDefault(),e({type:"KEY_DOWN_SPACE",value:r,callback:n,disabled:!!(h?.disabled||t)});return;case"Escape":e({type:"KEY_DOWN_ESCAPE"});return;case"Tab":let p=c.shiftKey?"KEY_DOWN_SHIFT_TAB":"KEY_DOWN_TAB";e({type:p});return;default:d&&e({type:"KEY_DOWN_SEARCH",query:f,disabled:t});return}},O0e(kp,{currentIndex:l,orientation:"vertical",key:"index",rotate:!0,filter:c=>!c.disabled,callback(c){e({type:"KEY_DOWN_NAVIGATE",value:i[c].value,disabled:t})}}))}function i3(e){let{listboxId:t}=g.useContext(Si);return e?Qd(`option-${e}`,t):void 0}function C2(e,t){return!!(e&&e.contains(t))}function Z0e(e,t,n){let{current:r}=g.useRef(e!=null);r&&e!==t&&n()}function Rn({bare:e,options:t,value:n,defaultLabel:r="",onChange:o,style:i,wrapperStyle:a,line:l,disabled:u,disabledKeys:c=[]}){const d=i?.minHeight?i.minHeight:"18px",h=t.filter(p=>p[0]===n);return s.jsxs(Aw,{value:n,onChange:o,disabled:u,style:{color:e?"inherit":S.formInputText,backgroundColor:e?"transparent":S.cardBackground,borderRadius:X.menuBorderRadius,border:e?"none":"1px solid "+S.formInputBorder,lineHeight:"1em",...a},children:[s.jsx(JM,{className:`${ze([{borderWidth:0,padding:5,borderRadius:4},i])}`,arrow:s.jsx(xg,{style:{width:7,height:7,color:"inherit"}}),children:s.jsx("span",{style:{display:"flex",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"calc(100% - 12px)",alignItems:"center",minHeight:d},children:h.length!==0?h[0][1]:r})}),s.jsx(n3,{style:{zIndex:1e4,outline:0,borderRadius:X.menuBorderRadius,backgroundColor:S.menuBackground,color:S.menuItemText,boxShadow:X.cardShadow,border:"1px solid "+S.menuBorder},className:`${ze({"[data-reach-listbox-option]":{background:S.menuItemBackground,color:S.menuItemText},"[data-reach-listbox-option][data-current-nav]":{background:S.menuItemBackgroundHover,color:S.menuItemTextHover}})}`,children:l?s.jsxs(Tp,{style:{maxHeight:250,overflowY:"auto"},children:[t.slice(0,l).map(([p,m])=>s.jsx(uh,{value:p,disabled:c.includes(p),children:m},p)),s.jsx("div",{style:{padding:"2px",marginTop:5,borderTop:"1px solid "+S.menuBorder}}),t.slice(l,t.length).map(([p,m])=>s.jsx(uh,{value:p,disabled:c.includes(p),children:m},p))]}):s.jsx(Tp,{style:{maxHeight:250,overflowY:"auto"},children:t.map(([p,m])=>s.jsx(uh,{value:p,disabled:c.includes(p),children:m},p))})})]})}function J0e(e){switch(e){case"missed":return{color:S.errorTextDarker,backgroundColor:S.errorBackground,Icon:Zse};case"due":return{color:S.warningTextDark,backgroundColor:S.warningBackground,Icon:zv};case"upcoming":return{color:S.upcomingText,backgroundColor:S.upcomingBackground,Icon:fl};case"paid":return{color:S.noticeText,backgroundColor:S.noticeBackgroundLight,Icon:ale};case"completed":return{color:S.tableHeaderText,backgroundColor:S.tableRowHeaderBackground,Icon:Jse};case"pending":return{color:S.noticeTextLight,backgroundColor:S.noticeBackgroundLight,Icon:fl};case"scheduled":return{color:S.tableRowHeaderText,backgroundColor:S.tableRowHeaderBackground,Icon:fl};case"cleared":return{color:S.noticeTextLight,backgroundColor:S.tableRowHeaderBackground,Icon:Kse};case"reconciled":return{color:S.noticeTextLight,backgroundColor:S.tableRowHeaderBackground,Icon:tle};default:return{color:S.buttonNormalDisabledText,backgroundColor:S.tableRowHeaderBackground,Icon:Qse}}}function a3({status:e}){const{color:t,backgroundColor:n,Icon:r}=J0e(e);return s.jsxs(I,{style:{color:t,backgroundColor:n,padding:"6px 8px",borderRadius:4,flexDirection:"row",alignItems:"center",flexShrink:0},children:[s.jsx(r,{style:{width:13,height:13,marginRight:7}}),s.jsx(z,{style:{lineHeight:"1em"},children:cD(e)})]})}function eve(e){const t=mn();return g.useMemo(()=>t.find(n=>n.id===e),[e,t])}function tve(e){const t=Hr();return g.useMemo(()=>t.find(n=>n.id===e),[e,t])}function ls({type:e,id:t,noneColor:n=S.pageTextSubdued}){return e==="accounts"?s.jsx(nve,{id:t,noneColor:n}):s.jsx(rve,{id:t,noneColor:n})}function nve({id:e,noneColor:t}){const n=eve(e);return s.jsx(z,{style:n==null?{color:t}:null,title:n?n.name:"None",children:n?n.name:"None"})}function rve({id:e,noneColor:t}){const n=tve(e);return s.jsx(z,{style:n==null?{color:t}:null,title:n?n.name:"None",children:n?n.name:"None"})}function ove(e,t){let{date:n}=e;return Oo(Mo(n))||(n=null),{...e,date:n?ke(Mo(n),t):null}}const ive=g.memo(function({transaction:t,fields:n,categories:r,accounts:o,selected:i}){const a=JN(r)[t.category],l=gD(o)[t.account],u=bs();return s.jsxs($o,{style:{color:S.tableText},children:[s.jsx(da,{exposed:!0,focused:!1,onSelect:c=>{u({type:"select",id:t.id,event:c})},selected:i}),n.map((c,f)=>{switch(c){case"date":return s.jsx(he,{width:100,children:t.date},f);case"imported_payee":return s.jsx(he,{width:"flex",children:t.imported_payee},f);case"payee":return s.jsx(Bn,{width:"flex",exposed:!0,style:{flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},children:()=>s.jsxs(s.Fragment,{children:[t.schedule&&s.jsx(Gse,{style:{width:13,height:13,margin:"0 5px"}}),s.jsx(ls,{type:"payees",id:t.payee})]})},f);case"category":return s.jsx(he,{width:"flex",title:a&&a.name,children:a?a.name:""},f);case"account":return s.jsx(he,{width:"flex",title:l.name,children:l.name},f);case"notes":return s.jsx(he,{width:"flex",title:t.notes,children:t.notes},f);case"amount":return s.jsx(he,{width:75,style:{textAlign:"right",...X.tnum},children:_n(t.amount)},f);default:return null}})]})});function s3({transactions:e,renderEmpty:t,fields:n=["date","payee","amount"],style:r}){const{grouped:o}=Fr(),i=Hr(),a=mn(),l=nr()||"MM/dd/yyyy",u=Kl(),c=bs(),f=g.useMemo(()=>n,[JSON.stringify(n)]),d=g.useMemo(()=>e.map(p=>ove(p,l)),[e]),h=g.useCallback(({item:p})=>s.jsx(ive,{transaction:p,payees:i,categories:o,accounts:a,fields:f,selected:u&&u.has(p.id)}),[i,o,f,u]);return s.jsx(Ss,{style:r,items:d,renderEmpty:t,headers:s.jsxs(s.Fragment,{children:[s.jsx(da,{exposed:!0,focused:!1,selected:u.size>0,width:20,onSelect:p=>c({type:"select-all",event:p})}),n.map((p,m)=>{switch(p){case"date":return s.jsx(he,{width:100,children:"Date"},m);case"imported_payee":return s.jsx(he,{width:"flex",children:"Imported payee"},m);case"payee":return s.jsx(he,{width:"flex",children:"Payee"},m);case"category":return s.jsx(he,{width:"flex",children:"Category"},m);case"account":return s.jsx(he,{width:"flex",children:"Account"},m);case"notes":return s.jsx(he,{width:"flex",children:"Notes"},m);case"amount":return s.jsx(he,{width:75,style:{textAlign:"right"},children:"Amount"},m);default:return null}})]}),renderItem:h})}function ave(e){return e.map(n=>({id:n.id,name:n.name,startDate:n.start_date,endDate:n.end_date,isDateStatic:n.date_static===1,dateRange:n.date_range,mode:n.mode,groupBy:n.group_by,interval:n.interval,balanceType:n.balance_type,showEmpty:n.show_empty===1,showOffBudget:n.show_offbudget===1,showHiddenCategories:n.show_hidden===1,showUncategorized:n.show_uncategorized===1,selectedCategories:n.selected_categories,graphType:n.graph_type,conditions:n.conditions,conditionsOp:n.conditions_op??"and",data:n.metadata}))}function l3(){const e=ave(Pd(()=>pt("custom_reports").select("*"),[])||[]);function t(n){return n.sort((r,o)=>r.name&&o.name?r.name.trim().localeCompare(o.name.trim(),void 0,{ignorePunctuation:!0}):0)}return g.useMemo(()=>t(e),[e])}function sve(e){return e.map(n=>({...n.fields,id:n.id,name:n.name,tombstone:n.tombstone,conditionsOp:n.conditions_op,conditions:n.conditions}))}function lve(){const e=sve(Pd(()=>pt("transaction_filters").select("*"),[])||[]);function t(n){return n.sort((r,o)=>r.name.trim().localeCompare(o.name.trim(),{ignorePunctuation:!0}))}return g.useMemo(()=>t(e),[e])}function uve({items:e,getItemProps:t,highlightedIndex:n,embedded:r}){return s.jsx(I,{children:s.jsxs(I,{style:{overflow:"auto",padding:"5px 0",...!r&&{maxHeight:175}},children:[s.jsx(ia,{title:"Saved Filters",type:"filter"}),e.map((o,i)=>[g.createElement("div",{...t?t({item:o}):null,key:o.id,style:{backgroundColor:n===i?S.menuAutoCompleteBackgroundHover:"transparent",padding:4,paddingLeft:20,borderRadius:r?4:0},"data-testid":`${o.name}-filter-item`,"data-highlighted":n===i||void 0},o.name)])]})})}function cve({embedded:e,...t}){const n=lve()||[];return s.jsx(Fo,{strict:!0,highlightFirst:!0,embedded:e,suggestions:n,renderItems:(r,o,i)=>s.jsx(uve,{items:r,getItemProps:o,highlightedIndex:i,embedded:e}),...t})}function dve({items:e,getItemProps:t,highlightedIndex:n,embedded:r}){return s.jsx(I,{children:s.jsxs(I,{style:{overflow:"auto",padding:"5px 0",...!r&&{maxHeight:175}},children:[s.jsx(g.Fragment,{children:ia({title:"Saved Reports"})}),e.map((o,i)=>[g.createElement("div",{...t?t({item:o}):null,key:o.id,style:{backgroundColor:n===i?S.menuAutoCompleteBackgroundHover:"transparent",padding:4,paddingLeft:20,borderRadius:r?4:0},"data-highlighted":n===i||void 0},o.name)])]})})}function fve({embedded:e,...t}){const n=l3()||[];return s.jsx(Fo,{strict:!0,highlightFirst:!0,embedded:e,suggestions:n,renderItems:(r,o,i)=>s.jsx(dve,{items:r,getItemProps:o,highlightedIndex:i,embedded:e}),...t})}const By=5,hve=[{id:"daily",name:"Days"},{id:"weekly",name:"Weeks"},{id:"monthly",name:"Months"},{id:"yearly",name:"Years"}],pve=[...Array(31).keys()].map(e=>e+1),gve=[{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 mve(e){return e==="last"?-1:Number(e)}function E2(e){return e||{start:Qn(),interval:1,frequency:"monthly",patterns:[u3(Qn())],skipWeekend:!1,weekendSolveMode:"before",endMode:"never",endOccurrences:"1",endDate:Qn()}}function j2(e){return{...e,interval:I2(e.interval),endOccurrences:I2(e.endOccurrences)}}function u3(e){return{value:parseInt(An(e,"d")),type:"day"}}function yve({field:e,value:t,recurrence:n}){return e==="value"&&n.type!=="day"&&t>By||e==="type"&&t!=="day"&&n.value>By?{[e]:t,value:By}:{[e]:t}}function vve(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:e.config.frequency!=="monthly"?[]:e.config.patterns}};case"update-recurrence":return{...e,config:{...e.config,patterns:e.config.patterns.map(n=>n===t.recurrence?{...t.recurrence,...yve(t)}:n)}};case"add-recurrence":return{...e,config:{...e.config,patterns:[...e.config.patterns||[],u3(e.config.start)]}};case"remove-recurrence":return{...e,config:{...e.config,patterns:e.config.patterns.filter(n=>n!==t.recurrence)}};case"set-skip-weekend":return{...e,config:{...e.config,skipWeekend:t.skipWeekend}};case"set-weekend-solve":return{...e,config:{...e.config,weekendSolveMode:t.value}};default:return e}}function xve({previewDates:e}){const t=(nr()||"MM/dd/yyyy").replace("MM","M").replace("dd","d");if(!e)return null;let n=null;return typeof e=="string"?n=s.jsx(z,{children:e}):n=s.jsxs(I,{children:[s.jsx(z,{style:{fontWeight:600},children:"Upcoming dates"}),s.jsx(Pe,{direction:"row",spacing:4,style:{marginTop:10},children:e.map((r,o)=>s.jsxs(I,{children:[s.jsx(z,{children:An(r,t)}),s.jsx(z,{children:An(r,"EEEE")})]},o))})]}),s.jsx(Pe,{direction:"column",spacing:1,style:{marginTop:15,color:S.tableText},children:n})}function I2(e){const t=parseInt(e);return Number.isInteger(t)&&t>0?t:1}function bve({config:e,dispatch:t}){const n=(r,o,i)=>t({type:"update-recurrence",recurrence:r,field:o,value:i});return s.jsx(Pe,{spacing:2,style:{marginTop:10},children:e.patterns.map((r,o)=>s.jsxs(I,{style:{display:"flex",flexDirection:"row"},children:[s.jsx(Rn,{options:[[-1,"Last"],["-","---"],...pve.map(i=>[i,i])],value:r.value,onChange:i=>n(r,"value",mve(i)),disabledKeys:["-"],wrapperStyle:{flex:1,marginRight:10},style:{minHeight:"1px",width:"100%"}}),s.jsx(Rn,{options:[["day","Day"],["-","---"],...gve.map(i=>[i.id,i.name])],value:r.type,onChange:i=>n(r,"type",i),disabledKeys:["-"],wrapperStyle:{flex:1,marginRight:10},style:{minHeight:"1px",width:"100%"}}),s.jsx(q,{type:"bare","aria-label":"Remove recurrence",style:{padding:7},onClick:()=>t({type:"remove-recurrence",recurrence:r}),children:s.jsx(uO,{style:{width:8,height:8}})}),s.jsx(q,{type:"bare","aria-label":"Add recurrence",style:{padding:7,marginLeft:5},onClick:()=>t({type:"add-recurrence"}),children:s.jsx(ab,{style:{width:10,height:10}})})]},o))})}function wve({config:e,onClose:t,onSave:n}){const[r,o]=g.useState(null),[i,a]=g.useReducer(vve,{config:E2(e)}),l=i.config.hasOwnProperty("skipWeekend")?i.config.skipWeekend:!1,u=nr()||"MM/dd/yyyy";g.useEffect(()=>{a({type:"replace-config",config:E2(e)})},[e]);const{config:c}=i,f=(d,h)=>a({type:"change-field",field:d,value:h});return g.useEffect(()=>{async function d(){const{data:h,error:p}=await Nh("schedule/get-upcoming-dates",{config:j2(c),count:4});o(p?"Invalid rule":h)}d()},[c]),r==null?null:s.jsxs(Et,{style:{padding:10,width:380},offset:1,position:"bottom-left",onClose:t,children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[s.jsx("label",{htmlFor:"start",children:"From"}),s.jsx(qc,{id:"start",inputProps:{placeholder:"Start Date"},value:c.start,onSelect:d=>f("start",d),containerProps:{style:{width:100}},dateFormat:u}),s.jsx(Rn,{id:"repeat_end_dropdown",bare:!0,options:[["never","indefinitely"],["after_n_occurrences","for"],["on_date","until"]],value:c.endMode,onChange:d=>f("endMode",d),style:{border:"1px solid "+S.formInputBorder,height:27.5}}),c.endMode==="after_n_occurrences"&&s.jsxs(s.Fragment,{children:[s.jsx(Ke,{id:"end_occurrences",style:{width:40},type:"number",min:1,onChange:d=>f("endOccurrences",d.target.value),defaultValue:c.endOccurrences||1}),s.jsxs(z,{children:["occurrence",c.endOccurrences==="1"?"":"s"]})]}),c.endMode==="on_date"&&s.jsx(qc,{id:"end_date",inputProps:{placeholder:"End Date"},value:c.endDate,onSelect:d=>f("endDate",d),containerProps:{style:{width:100}},dateFormat:u})]}),s.jsxs(Pe,{direction:"row",align:"center",justify:"flex-start",style:{marginTop:10},spacing:1,children:[s.jsx(z,{style:{whiteSpace:"nowrap"},children:"Repeat every"}),s.jsx(Ke,{id:"interval",style:{width:40},type:"number",min:1,onChange:d=>f("interval",d.target.value),defaultValue:c.interval||1}),s.jsx(Rn,{bare:!0,options:hve.map(d=>[d.id,d.name]),value:c.frequency,onChange:d=>f("frequency",d),style:{border:"1px solid "+S.formInputBorder,height:27.5}}),c.frequency==="monthly"&&(c.patterns==null||c.patterns.length===0)?s.jsx(q,{style:{backgroundColor:S.tableBackground,":hover":{backgroundColor:S.tableBackground}},onClick:()=>a({type:"add-recurrence"}),children:"Add specific days"}):null]}),c.frequency==="monthly"&&c.patterns&&c.patterns.length>0&&s.jsx(bve,{config:c,dispatch:a}),s.jsx(Pe,{direction:"column",style:{marginTop:5},children:s.jsxs(I,{style:{marginTop:5,flex:1,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[s.jsx(Bo,{id:"form_skipwe",checked:l,onChange:d=>{a({type:"set-skip-weekend",skipWeekend:d.target.checked})}}),s.jsxs("label",{htmlFor:"form_skipwe",style:{userSelect:"none",marginRight:5},children:["Move schedule"," "]}),s.jsx(Rn,{id:"solve_dropdown",options:[["before","before"],["after","after"]],value:i.config.weekendSolveMode,onChange:d=>a({type:"set-weekend-solve",value:d}),disabled:!l,style:{backgroundColor:S.tableBackground,minHeight:"1px",width:"5rem"}}),s.jsxs("label",{htmlFor:"solve_dropdown",style:{userSelect:"none",marginLeft:5},children:[" ","weekend"]})]})}),s.jsx(xve,{previewDates:r}),s.jsxs("div",{style:{display:"flex",marginTop:15,justifyContent:"flex-end"},children:[s.jsx(q,{onClick:t,children:"Cancel"}),s.jsx(q,{type:"primary",onClick:()=>n(j2(c)),style:{marginLeft:10},children:"Apply"})]})]})}function c3({value:e,buttonStyle:t,onChange:n}){const{isOpen:r,close:o,getOpenEvents:i}=Ile(),a=nr()||"MM/dd/yyyy";function l(u){n(u),o()}return s.jsxs(I,{children:[s.jsx(q,{...i(),style:{textAlign:"left",...t},children:e?ew(e,a):"No recurring date"}),r&&s.jsx(wve,{config:e,onClose:o,onSave:l})]})}function Cp({field:e,subfield:t,type:n,multi:r,value:o,inputRef:i,style:a,onChange:l}){const{grouped:u}=Fr(),c=l3(),f=Te(x=>x.queries.saved),d=nr()||"MM/dd/yyyy";if(r&&!Array.isArray(o))o=[];else if(!r&&Array.isArray(o))return null;const h=r?o.length===0:!0,p=r?"multi":"single";let m;switch(n){case"id":switch(e){case"payee":m=s.jsx(_w,{type:p,showMakeTransfer:!1,openOnFocus:!0,value:o,onSelect:l,inputProps:{inputRef:i,...h?{placeholder:"nothing"}:null}});break;case"account":m=s.jsx(um,{type:p,value:o,openOnFocus:!0,onSelect:l,inputProps:{inputRef:i,...h?{placeholder:"nothing"}:null}});break;case"category":m=s.jsx(Gd,{type:p,categoryGroups:u,value:o,openOnFocus:!0,onSelect:l,showHiddenCategories:!1,inputProps:{inputRef:i,...h?{placeholder:"nothing"}:null}});break}break;case"saved":switch(e){case"saved":m=s.jsx(cve,{type:p,saved:f,value:o,openOnFocus:!0,onSelect:l,inputProps:{inputRef:i,...h?{placeholder:"nothing"}:null}});break;case"report":m=s.jsx(fve,{type:p,saved:c,value:o,openOnFocus:!0,onSelect:l,inputProps:{inputRef:i,...h?{placeholder:"nothing"}:null}});break}break;case"date":switch(t){case"month":m=s.jsx(Ke,{inputRef:i,defaultValue:o||"",placeholder:Xb(d).toLowerCase(),onEnter:x=>l(x.target.value),onBlur:x=>l(x.target.value)});break;case"year":m=s.jsx(Ke,{inputRef:i,defaultValue:o||"",placeholder:"yyyy",onEnter:x=>l(x.target.value),onBlur:x=>l(x.target.value)});break;default:o&&o.frequency?m=s.jsx(c3,{value:o,buttonStyle:{justifyContent:"flex-start"},onChange:l}):m=s.jsx(qc,{value:o,dateFormat:d,openOnFocus:!1,inputRef:i,inputProps:{placeholder:d.toLowerCase()},onSelect:l});break}break;case"boolean":m=s.jsx(Bo,{checked:o,value:o,onChange:()=>l(!o)});break;default:r?m=s.jsx(Fo,{type:p,suggestions:[],value:o,inputProps:{inputRef:i},onSelect:l}):m=s.jsx(Ke,{inputRef:i,defaultValue:o||"",placeholder:"nothing",onEnter:x=>l(x.target.value),onBlur:x=>l(x.target.value)});break}return s.jsx(I,{style:{flex:1,...a},children:m})}function d3(e,t,n){return e.map(r=>r===t?n():r)}function D2(e,t){return e.map((n,r)=>({...n,error:t[r]}))}function Sve(e,t){const n=["date"];return e.find(r=>r.field==="imported_payee")&&n.push("imported_payee"),n.push("payee"),t.find(r=>r.field==="category")?n.push("category"):t.length>0&&!["payee","date","amount"].includes(t[0].field)&&n.push(t[0].field),n.push("amount"),n}function Pw({fields:e,style:t,value:n,onChange:r}){return s.jsx(I,{style:{color:S.pageTextPositive,...t},children:s.jsx(Rn,{bare:!0,options:e,value:n,onChange:o=>r("field",o)})})}function f3({ops:e,type:t,style:n,wrapperStyle:r,value:o,formatOp:i=so,onChange:a}){let l;return t==="id"&&(e=e.filter(u=>u!=="contains"&&u!=="doesNotContain"),l=e.length/2),t==="string"&&(l=e.length/2),s.jsx(Rn,{bare:!0,options:e.map(u=>[u,i(u,t)]),value:o,onChange:u=>a("op",u),line:l,style:{minHeight:"1px",...n},wrapperStyle:r})}function kve({options:e,style:t,value:n,onChange:r}){return s.jsx(I,{style:{color:S.pageTextPositive,...t},children:s.jsx(Rn,{bare:!0,options:e,value:n,onChange:o=>r("method",o)})})}function h3({onAdd:e,onDelete:t}){return s.jsxs(s.Fragment,{children:[t&&s.jsx(q,{type:"bare",onClick:t,style:{padding:7},"aria-label":"Delete entry",children:s.jsx(uO,{style:{width:8,height:8,color:"inherit"}})}),e&&s.jsx(q,{type:"bare",onClick:e,style:{padding:7},"aria-label":"Add entry",children:s.jsx(ab,{style:{width:10,height:10,color:"inherit"}})})]})}function Tve({type:e}){return s.jsx(z,{style:{fontSize:12,textAlign:"center",color:S.errorText,marginBottom:5},children:eie(e)})}function p3({error:e,style:t,children:n}){return s.jsxs(I,{style:t,"data-testid":"editor-row",children:[s.jsx(Pe,{direction:"row",align:"center",spacing:1,style:{padding:"3px 5px"},children:n}),e&&s.jsx(Tve,{type:e})]})}function Cve({ops:e,condition:t,editorStyle:n,isSchedule:r,onChange:o,onDelete:i,onAdd:a}){const{field:l,op:u,value:c,type:f,options:d,error:h}=t;let p=l;p==="amount"&&d&&(d.inflow?p="amount-inflow":d.outflow&&(p="amount-outflow"));let m;return f==="number"&&u==="isbetween"?m=s.jsx($P,{defaultValue:c,onChange:x=>o("value",x)}):m=s.jsx(Cp,{field:p,type:f,value:c,multi:u==="oneOf"||u==="notOneOf",onChange:x=>o("value",x)}),s.jsxs(p3,{style:n,error:h,children:[s.jsx(Pw,{fields:m3,value:p,onChange:o}),s.jsx(f3,{ops:e,value:u,type:f,onChange:o}),s.jsx(I,{style:{flex:1},children:m}),s.jsx(Pe,{direction:"row",children:s.jsx(h3,{onAdd:a,onDelete:r&&p==="date"?null:i})})]})}function Eve(e){return e?typeof e=="number"?_n(e):`${_n(e.num1)} to ${_n(e.num2)}`:_n(0)}function jve({id:e}){const t=nr()||"MM/dd/yyyy",n=Ow({transform:g.useCallback(i=>i.filter({id:e}),[])});if(n==null)return null;if(n.schedules.length===0)return s.jsx(I,{style:{flex:1},children:e});const[r]=n.schedules,o=r&&n.statuses.get(r.id);return s.jsxs(I,{style:{flex:1,flexDirection:"row",alignItems:"center"},children:[s.jsxs(I,{style:{marginRight:15,flexDirection:"row"},children:[s.jsxs(z,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:["Payee:"," ",s.jsx(ls,{type:"payees",id:r._payee,noneColor:S.pageTextLight})]}),s.jsx(z,{style:{margin:"0 5px"},children:" — "}),s.jsxs(z,{style:{flexShrink:0},children:["Amount: ",Eve(r._amount)]}),s.jsx(z,{style:{margin:"0 5px"},children:" — "}),s.jsxs(z,{style:{flexShrink:0},children:["Next: ",An(r.next_date,t)]})]}),s.jsx(a3,{status:o})]})}const Mw=["category","payee","notes","cleared","account","date","amount"].map(e=>[e,oa(e)]),Ive=["amount","cleared","account","date"],g3=Mw.filter(([e])=>!Ive.includes(e)),Dve=Object.entries(RA);function _ve({action:e,editorStyle:t,onChange:n,onDelete:r,onAdd:o}){const{field:i,op:a,value:l,type:u,error:c,inputKey:f="initial",options:d}=e;return s.jsxs(p3,{style:t,error:c,children:[a==="set"?s.jsxs(s.Fragment,{children:[s.jsx(I,{style:{padding:"5px 10px",lineHeight:"1em"},children:so(a)}),s.jsx(Pw,{fields:d?.splitIndex?g3:Mw,value:i,onChange:n}),s.jsx(I,{style:{flex:1},children:s.jsx(Cp,{field:i,type:u,op:a,value:l,onChange:h=>n("value",h)},f)})]}):a==="set-split-amount"?s.jsxs(s.Fragment,{children:[s.jsx(I,{style:{padding:"5px 10px",lineHeight:"1em"},children:"allocate"}),s.jsx(kve,{options:Dve,value:d.method,onChange:n}),s.jsx(I,{style:{flex:1},children:d.method!=="remainder"&&s.jsx(Cp,{field:i,type:"number",value:l,onChange:h=>n("value",h)},f)})]}):a==="link-schedule"?s.jsxs(s.Fragment,{children:[s.jsx(I,{style:{padding:"5px 10px",color:S.pageTextPositive},children:so(a)}),s.jsx(jve,{id:l||null})]}):null,s.jsx(Pe,{direction:"row",children:s.jsx(h3,{onAdd:o,onDelete:a==="set"&&r})})]})}function Ove(){const[e,t]=g.useState();return s.jsxs(I,{style:{position:"relative",marginLeft:5},children:[s.jsx(I,{onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1),children:s.jsx(_A,{style:{width:11,height:11,color:S.pageTextLight}})}),e&&s.jsx(Et,{position:"bottom-left",style:{padding:10,color:S.pageTextLight,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 Ly({selected:e,children:t,style:n,onSelect:r}){return s.jsx(q,{type:"bare",style:{fontSize:"inherit",...e&&{backgroundColor:S.pillBackgroundSelected,":hover":{backgroundColor:S.pillBackgroundSelected}},...n},onClick:r,children:t})}function Js(e){return{...e,inputKey:""+Math.random()}}function Ave({conditionsOp:e,conditions:t,editorStyle:n,isSchedule:r,onChangeConditions:o}){function i(c){let f=m3.map(p=>p[0]).filter(p=>p!=="amount-inflow"&&p!=="amount-outflow");t.length&&e==="or"?f=[t[0].field]:f=f.filter(p=>!t.some(m=>m.field.includes(p)||p.includes(m.field)));const d=f[0]||"payee",h=[...t];h.splice(c+1,0,{type:Ju.get(d),field:d,op:"is",value:null}),o(h)}function a(){i(-1)}function l(c){o(t.filter(f=>f!==c))}function u(c,f,d){o(d3(t,c,()=>{if(f==="field"){const h={field:d};d==="amount-inflow"?(h.field="amount",h.options={inflow:!0}):d==="amount-outflow"&&(h.field="amount",h.options={outflow:!0}),h.type=Ju.get(h.field);const p=Ju.get(c.field);return(p==="string"||p==="number")&&p===h.type&&c.op!=="isbetween"?(h.op=c.op,Js(Ta(c.value,h))):(h.op=CT[h.type].ops[0],Js(Ta(null,h)))}else if(f==="op"){const h=d;return c.op!=="oneOf"&&c.op!=="notOneOf"&&(h==="oneOf"||h==="notOneOf")?Js(Ta(c.value!=null?[c.value]:[],{...c,op:d})):(c.op==="oneOf"||c.op==="notOneOf")&&h!=="oneOf"&&h!=="notOneOf"?Js(Ta(c.value.length>0?c.value[0]:null,{...c,op:d})):c.op!=="isbetween"&&h==="isbetween"?Ta({num1:gr(c.value),num2:gr(c.value)},{...c,op:d}):c.op==="isbetween"&&h!=="isbetween"?Ta(Sl(c.value.num1||0),{...c,op:d}):{...c,op:d}}else if(f==="value")return Ta(d,c);return c}))}return t.length===0?s.jsx(q,{style:{alignSelf:"flex-start"},onClick:a,children:"Add condition"}):s.jsx(Pe,{spacing:2,"data-testid":"condition-list",children:t.map((c,f)=>{let d=CT[c.type].ops;return c.type==="date"&&c.value&&c.value.frequency?d=["is","isapprox"]:c.options&&(c.options.inflow||c.options.outflow)&&(d=d.filter(h=>h!=="isbetween")),s.jsx(I,{children:s.jsx(Cve,{editorStyle:n,ops:d,condition:c,isSchedule:r,onChange:(h,p)=>{u(c,h,p)},onDelete:()=>l(c),onAdd:()=>i(f)})},f)})})}const ch=e=>e.flatMap(t=>t.actions),_2=e=>ch(e).map(Nv),m3=["imported_payee","account","category","date","payee","notes","amount"].map(e=>[e,oa(e)]).concat([["amount-inflow",oa("amount",{inflow:!0})],["amount-outflow",oa("amount",{outflow:!0})]]);function Pve({modalProps:e,defaultRule:t,onSave:n}){const r=Kd("splitsInRules"),[o,i]=g.useState(t.conditions.map(ET)),[a,l]=g.useState(()=>t.actions.map(ET).reduce((L,R)=>{const U=R.options?.splitIndex??0;return L[U]=L[U]??{id:oo(),actions:[]},L[U].actions.push(R),L},[{id:oo(),actions:[]}])),[u,c]=g.useState(t.stage),[f,d]=g.useState(t.conditionsOp),[h,p]=g.useState([]),m=Ft(),x=g.useRef(),k=ch(a).some(F=>F.op==="link-schedule");g.useEffect(()=>(m(v1()),$0(!1),()=>$0(!0)),[]),g.useEffect(()=>{if(x.current){const L=x.current,R=L.scrollTop;L.scrollTop=R+1,L.scrollTop=R}async function F(){const{filters:L}=await Y("make-filters-from-conditions",{conditions:o.map(Nv)});if(L.length>0){const R=f==="or"?"$or":"$and",U=a.length>1?{is_child:!1}:{},{data:P}=await ar(pt("transactions").filter({[R]:L,...U}).select("*"));p(P)}else p([])}F()},[a,o,f]);const v=Gl("transactions",h,[]);function y(){b(0,-1)}function b(F,L){let R;if(F&&!a[F]?.actions?.length)a[F]={id:oo(),actions:[]},R={op:"set-split-amount",options:{method:"remainder",splitIndex:F},value:null};else{let D=(F===0?Mw:g3).map($=>$[0]);for(const $ of a[F].actions)D=D.filter(W=>W!==$.field);const C=D[0]||"category";R={type:Ju.get(C),field:C,op:"set",value:null,options:{splitIndex:F}}}const U=[...a[F].actions];U.splice(L+1,0,R);const P=[...a];P[F]={...a[F],actions:U},l(P)}function w(F,L,R){l(a.map(({id:U,actions:P})=>({id:U,actions:d3(P,F,()=>{const j={...F};if(L==="method")j.options={...j.options,method:R};else{if(j[L]=R,L==="field")return j.type=Ju.get(j.field),j.value=null,Js(j);if(L==="op")return j.value=null,j.inputKey=""+Math.random(),Js(j)}return j})})))}function E(F){c(F)}function T(F,L){d(L)}function _(F){l(L=>L.map(({id:R,actions:U})=>({id:R,actions:U.filter(P=>P!==F)})))}function M(F){l(L=>{const R=[];return L.forEach(({id:U},P)=>{P!==F&&R.push({id:U,actions:[]})}),ch(L).forEach(U=>{const P=U.options?.splitIndex??0;if(P===F)return;const j=P>F?P-1:P;R[j].actions.push({...U,options:{...U.options,splitIndex:j}})}),R})}function B(){const F=h.filter(({id:L})=>v.items.has(L));Y("rule-apply-actions",{transactions:F,actions:_2(a)}).then(()=>{l([...a])})}async function O(){const F={...t,stage:u,conditionsOp:f,conditions:o.map(Nv),actions:_2(a)},L=F.id?"rule-update":"rule-add",{error:R,id:U}=await Y(L,F);R?(R.conditionErrors&&i(D2(o,R.conditionErrors)),R.actionErrors&&l(D2(a,R.actionErrors))):(U&&(F.id=U),n?.(F),e.onClose())}const N={color:S.pillText,backgroundColor:S.pillBackground,borderRadius:4},H=r?a.length>0:a.length>1;return s.jsx(_e,{title:"Rule",padding:0,...e,style:{...e.style,flex:"inherit"},children:()=>s.jsxs(I,{style:{maxWidth:"100%",width:900,height:"80vh",flexGrow:0,flexShrink:0,flexBasis:"auto",overflow:"hidden",color:S.pageTextLight},children:[s.jsxs(I,{style:{flexDirection:"row",alignItems:"center",marginBottom:15,padding:"0 20px"},children:[s.jsx(z,{style:{marginRight:15},children:"Stage of rule:"}),s.jsxs(Pe,{direction:"row",align:"center",spacing:1,children:[s.jsx(Ly,{selected:u==="pre",onSelect:()=>E("pre"),children:"Pre"}),s.jsx(Ly,{selected:u===null,onSelect:()=>E(null),children:"Default"}),s.jsx(Ly,{selected:u==="post",onSelect:()=>E("post"),children:"Post"}),s.jsx(Ove,{})]})]}),s.jsx(I,{innerRef:x,style:{borderBottom:"1px solid "+S.tableBorder,padding:20,overflow:"auto",maxHeight:"calc(100% - 300px)"},children:s.jsxs(I,{style:{flexShrink:0},children:[s.jsxs(I,{style:{marginBottom:30},children:[s.jsxs(z,{style:{marginBottom:15},children:["If",s.jsx(Pw,{"data-testid":"conditions-op",style:{display:"inline-flex"},fields:[["and","all"],["or","any"]],value:f,onChange:T}),"of these conditions match:"]}),s.jsx(Ave,{conditionsOp:f,conditions:o,editorStyle:N,isSchedule:k,onChangeConditions:F=>i(F)})]}),s.jsx(z,{style:{marginBottom:15},children:"Then apply these actions:"}),s.jsxs(I,{style:{flex:1},children:[a.length===0&&s.jsx(q,{style:{alignSelf:"flex-start"},onClick:y,children:"Add action"}),s.jsx(Pe,{spacing:2,"data-testid":"action-split-list",children:a.map(({id:F,actions:L},R)=>s.jsxs(I,{nativeStyle:a.length>1?{borderColor:S.tableBorder,borderWidth:"1px",borderRadius:"5px",padding:"5px"}:{},children:[a.length>1&&s.jsxs(Pe,{direction:"row",justify:"space-between",spacing:1,children:[s.jsx(z,{style:{...X.verySmallText,marginBottom:"10px"},children:R===0?"Before split":`Split ${R}`}),R&&s.jsx(q,{type:"bare",onClick:()=>M(R),style:{width:20,height:20},"aria-label":"Delete split",children:s.jsx(Ed,{style:{width:8,height:8,color:"inherit"}})})]}),s.jsx(Pe,{spacing:2,"data-testid":"action-list",children:L.map((U,P)=>s.jsx(I,{children:s.jsx(_ve,{ops:["set","link-schedule"],action:U,editorStyle:N,onChange:(j,D)=>{w(U,j,D)},onDelete:()=>_(U),onAdd:()=>b(R,P)})},P))}),L.length===0&&s.jsx(q,{style:{alignSelf:"flex-start",marginTop:5},onClick:()=>b(R,-1),children:"Add action"})]},F))}),H&&s.jsx(q,{style:{alignSelf:"flex-start",marginTop:15},onClick:()=>{b(a.length,-1)},children:a.length>1?"Add another split":"Split into multiple transactions"})]})]})}),s.jsx(Ql,{instance:v,children:s.jsxs(I,{style:{padding:"20px",flex:1},children:[s.jsxs(I,{style:{flexDirection:"row",alignItems:"center",marginBottom:12},children:[s.jsx(z,{style:{color:S.pageTextLight,marginBottom:0},children:"This rule applies to these transactions:"}),s.jsx(I,{style:{flex:1}}),s.jsxs(q,{disabled:v.items.size===0,onClick:B,children:["Apply actions (",v.items.size,")"]})]}),s.jsx(s3,{transactions:h,fields:Sve(o,ch(a)),style:{border:"1px solid "+S.tableBorder,borderRadius:"6px 6px 0 0"}}),s.jsxs(Pe,{direction:"row",justify:"flex-end",style:{marginTop:20},children:[s.jsx(q,{onClick:()=>e.onClose(),children:"Cancel"}),s.jsx(q,{type:"primary",onClick:()=>O(),children:"Save"})]})]})})]})})}function y3({modalProps:e,actions:t,options:n={}}){const{hasExistingKey:r,cloudFileId:o,onSuccess:i}=n,[a,l]=g.useState(""),[u,c]=g.useState(""),[f,d]=g.useState(!1),[h,p]=g.useState(!1);async function m(){if(a!==""&&!f){d(!0),c(null);const{error:x}=await Y("key-test",{password:a,fileId:o});if(x){c(pN(x)),d(!1);return}t.popModal(),i?.()}}return s.jsx(_e,{...e,showHeader:!1,style:{width:600},children:()=>s.jsxs(I,{style:{flex:1},children:[s.jsx(z,{style:{fontSize:25,fontWeight:700,color:S.pageTextDark,margin:"20px 0"},children:r?"Unable to decrypt file":"This file is encrypted"}),r?s.jsxs(be,{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."," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",children:"Learn more"})]}):s.jsxs(be,{children:["We don’t have a key that encrypts or decrypts this file. Enter the password for this file to create the key for encryption."," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",children:"Learn more"})]}),s.jsxs("form",{onSubmit:x=>{x.preventDefault(),m()},children:[s.jsxs(I,{style:{marginTop:15,flexDirection:"column",alignItems:"center"},children:[s.jsx(z,{style:{fontWeight:600,marginBottom:5},children:"Password"})," ",u&&s.jsx(I,{style:{color:S.errorText,textAlign:"center",fontSize:13,marginBottom:3},children:u}),s.jsx(Ts,{children:s.jsx(Ke,{type:h?"text":"password",style:{width:"50%"},onChange:x=>l(x.target.value)})}),s.jsx(z,{style:{marginTop:5},children:s.jsxs("label",{style:{userSelect:"none"},children:[s.jsx("input",{type:"checkbox",onClick:()=>p(!h)})," ","Show password"]})})]}),s.jsxs(ys,{style:{marginTop:20},children:[s.jsx(q,{style:{marginRight:10},onClick:()=>e.onBack(),type:"normal",children:"Back"}),s.jsx(mt,{type:"primary",loading:f,onClick:m,children:r?"Update key":"Create key"})]})]})]})})}const Rw=({icon:e,color:t,backgroundColor:n,style:r,children:o})=>s.jsxs(I,{style:{color:t,fontSize:13,...X.shadow,borderRadius:4,backgroundColor:n,padding:10,flexDirection:"row","& a, & a:active, & a:visited":{color:S.formLabelText},...r},children:[s.jsx(I,{style:{paddingLeft:2,paddingTop:".11em",alignSelf:"stretch",flexShrink:0,marginRight:5},children:s.jsx(e,{width:13,style:{marginTop:2}})}),s.jsx(z,{style:{zIndex:1,lineHeight:1.5},children:o})]}),Mve=({style:e,children:t})=>s.jsx(Rw,{icon:_A,color:S.pageTextLight,backgroundColor:"transparent",style:{...e,boxShadow:"none",padding:5},children:t}),Rve=({style:e,children:t})=>s.jsx(Rw,{icon:Bb,color:S.warningText,backgroundColor:S.warningBackground,style:e,children:t}),Xd=({style:e,children:t})=>s.jsx(Rw,{icon:Bb,color:S.errorTextDarker,backgroundColor:S.errorBackground,style:e,children:t}),Bve=[{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 Lve(e){const[t,n]=g.useState([]),[r,o]=g.useState(!1),[i,a]=g.useState(!1);return g.useEffect(()=>{async function l(){if(a(!1),!e){n([]),o(!1);return}o(!0);const{data:u,error:c}=await Nh("gocardless-get-banks",e);c?(a(!0),n([])):n(u),o(!1)}l()},[n,o,e]),{data:t,isLoading:r,isError:i}}function Nve(e){return s.jsx(Xd,{style:{alignSelf:"center"},children:e==="timeout"?"Timed out. Please try again.":"An error occurred while linking your account, sorry!"})}function $ve({modalProps:e,onMoveExternal:t,onSuccess:n,onClose:r}){const o=Ft(),[i,a]=g.useState(null),[l,u]=g.useState(!1),[c,f]=g.useState(),[d,h]=g.useState(),[p,m]=g.useState(null),[x,k]=g.useState(null),[v,y]=g.useState(!1),b=g.useRef(null),{data:w,isLoading:E,isError:T}=Lve(d),{configuredGoCardless:_,isLoading:M}=wM();async function B(){m(null),a("browser");const L=await t({institutionId:c});if(L.error){m(L.error),a(null);return}b.current=L.data,a(null),u(!0)}function O(){r?.(),e.onClose()}async function N(){a("accounts"),await n(b.current),a(null)}const H=()=>{o(dr("gocardless-init",{onSuccess:()=>k(!0)}))},F=()=>s.jsxs(I,{style:{gap:10},children:[s.jsxs(_o,{children:[s.jsx(eo,{title:"Choose your country:",htmlFor:"country-field"}),s.jsx(Fo,{strict:!0,highlightFirst:!0,suggestions:Bve,onSelect:h,value:d,inputProps:{id:"country-field",placeholder:"(please select)"}})]}),T?s.jsxs(Xd,{children:["Failed loading available banks: GoCardless access credentials might be misconfigured. Please"," ",s.jsx(Ro,{onClick:H,style:{color:S.formLabelText,display:"inline"},children:"set them up"})," ","again."]}):d&&(E?"Loading banks...":s.jsxs(_o,{children:[s.jsx(eo,{title:"Choose your bank:",htmlFor:"bank-field"}),s.jsx(Fo,{focused:!0,strict:!0,highlightFirst:!0,suggestions:w,onSelect:f,value:c,inputProps:{id:"bank-field",placeholder:"(please select)"}})]})),s.jsxs(Rve,{children:["By enabling bank-sync, you will be granting GoCardless (a third party service) read-only access to your entire account’s transaction history. This service is not affiliated with Actual in any way. Make sure you’ve read and understand GoCardless’s"," ",s.jsx(Ve,{to:"https://gocardless.com/privacy/",linkColor:"purple",children:"Privacy Policy"})," ","before proceeding."]}),s.jsxs(I,{style:{flexDirection:"row",gap:10,alignItems:"center"},children:[s.jsx(q,{type:"primary",style:{padding:"10px 0",fontSize:15,fontWeight:600,flexGrow:1},onClick:B,disabled:!c||!d,children:"Link bank in browser →"}),s.jsxs(q,{type:"bare",onClick:()=>y(!0),"aria-label":"Menu",children:[s.jsx(Od,{width:15,height:15,style:{transform:"rotateZ(90deg)"}}),v&&s.jsx(Et,{position:"bottom-right",width:200,style:{padding:0},onClose:()=>y(!1),children:s.jsx(wt,{onMenuSelect:L=>{L==="reconfigure"&&H()},items:[{name:"reconfigure",text:"Set new API secrets"}]})})]})]})]});return s.jsx(_e,{title:"Link Your Bank",...e,onClose:O,style:{flex:0},children:()=>s.jsxs(I,{children:[s.jsx(be,{style:{fontSize:15},children:"To link your bank account, you will be redirected to a new page where GoCardless will ask to connect to your bank. GoCardless will not be able to withdraw funds from your accounts."}),p&&Nve(p),i||M?s.jsxs(I,{style:{alignItems:"center",marginTop:15},children:[s.jsx(vi,{color:S.pageTextDark,style:{width:20,height:20}}),s.jsx(I,{style:{marginTop:10,color:S.pageText},children:M?"Checking GoCardless configuration..":i==="browser"?"Waiting on GoCardless...":i==="accounts"?"Loading accounts...":null}),i==="browser"&&s.jsx(Ro,{onClick:B,style:{marginTop:10},children:"(Account linking not opening in a new tab? Click here)"})]}):l?s.jsx(q,{type:"primary",style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10},onClick:N,children:"Success! Click to continue →"}):_||x?F():s.jsxs(s.Fragment,{children:[s.jsx(be,{style:{color:S.errorText},children:"GoCardless integration has not yet been configured."}),s.jsx(q,{type:"primary",onClick:H,children:"Configure GoCardless integration"})]})]})})}const Fve=({modalProps:e,onSuccess:t})=>{const[n,r]=g.useState(""),[o,i]=g.useState(""),[a,l]=g.useState(!0),[u,c]=g.useState(!1),f=async()=>{if(!n||!o){l(!1);return}c(!0),await Promise.all([Y("secret-set",{name:"gocardless_secretId",value:n}),Y("secret-set",{name:"gocardless_secretKey",value:o})]),t(),e.onClose(),c(!1)};return s.jsxs(_e,{title:"Set-up GoCardless",size:{width:300},...e,children:[s.jsxs(I,{style:{display:"flex",gap:10},children:[s.jsxs(z,{children:["In order to enable bank-sync via GoCardless (only for EU banks) you will need to create access credentials. This can be done by creating an account with"," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/advanced/bank-sync/",linkColor:"purple",children:"GoCardless"}),"."]}),s.jsxs(_o,{children:[s.jsx(eo,{title:"Secret ID:",htmlFor:"secret-id-field"}),s.jsx(Ke,{id:"secret-id-field",type:"password",value:n,onChangeValue:d=>{r(d),l(!0)}})]}),s.jsxs(_o,{children:[s.jsx(eo,{title:"Secret Key:",htmlFor:"secret-key-field"}),s.jsx(Ke,{id:"secret-key-field",type:"password",value:o,onChangeValue:d=>{i(d),l(!0)}})]}),!a&&s.jsx(Xd,{children:"It is required to provide both the secret id and secret key."})]}),s.jsx(ys,{children:s.jsx(mt,{type:"primary",loading:u,onClick:f,children:"Save and continue"})})]})};function Hve(){return Te(e=>e.prefs.local)}const v3=[{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 Bw(e,t){if(typeof e!="string")return null;function n(d){return d&&d.length===1?"0"+d:d}const r=(d,h)=>p=>{const m=p.replace(/\bjan(\.|uary)?\b/i,"01").replace(/\bfeb(\.|ruary)?\b/i,"02").replace(/\bmar(\.|ch)?\b/i,"03").replace(/\bapr(\.|il)?\b/i,"04").replace(/\bmay\.?\b/i,"05").replace(/\bjun(\.|e)?\b/i,"06").replace(/\bjul(\.|y)?\b/i,"07").replace(/\baug(\.|ust)?\b/i,"08").replace(/\bsep(\.|tember)?\b/i,"09").replace(/\boct(\.|ober)?\b/i,"10").replace(/\bnov(\.|ember)?\b/i,"11").replace(/\bdec(\.|ember)?\b/i,"12").replace(/^[^\d]+/,"").replace(/[^\d]+$/,"").split(/[^\d]+/);if(m.length>=3)return m.slice(0,3);const x=p.replace(/[^\d]/g,"");return[x.slice(0,d),x.slice(d,d+h),x.slice(d+h)]},o=r(4,2),i=r(2,2);let a,l,u,c;switch(t){case"dd mm yyyy":a=i(e),l=a[2],u=a[1],c=a[0];break;case"dd mm yy":a=i(e),l=`20${a[2]}`,u=a[1],c=a[0];break;case"yyyy mm dd":a=o(e),l=a[0],u=a[1],c=a[2];break;case"yy mm dd":a=i(e),l=`20${a[0]}`,u=a[1],c=a[2];break;case"mm dd yy":a=i(e),l=`20${a[2]}`,u=a[0],c=a[1];break;default:case"mm dd yyyy":a=i(e),l=a[2],u=a[0],c=a[1]}const f=`${l}-${n(u)}-${n(c)}`;return Oo(Mo(f))?f:null}function x3(e,t){if(!e)return null;try{return An(e,t)}catch{}return null}function Ny(e){const t=e.match(/\.([^.]*)$/);if(!t)return"ofx";const n=t[1].toLowerCase();return n==="tsv"?"csv":n}function zve({parseDateFormat:e,dateFormat:t,date:n}){const r=n&&x3(e?Bw(n,e):n,t);return s.jsxs(z,{children:[s.jsxs(z,{children:[n||s.jsx(z,{style:{color:S.pageTextLight,fontStyle:"italic"},children:"Empty"})," ","→"," "]}),s.jsx(z,{style:{color:r?S.noticeTextLight:S.errorText},children:r||"Invalid"})]})}function O2(e,t){if(e.length===0||t.date==null)return"yyyy mm dd";const r=e[0][t.date],o=r==null?null:v3.find(i=>Bw(r,i.format)!=null);return o?o.format:"mm dd yyyy"}function A2(e){if(e.length===0)return{};const t=e[0],n=Object.entries(t);function r(f){return f?f[0]:null}const o=r(n.find(([f])=>f.toLowerCase().includes("date"))||n.find(([,f])=>f.match(/^\d+[-/]\d+[-/]\d+$/))),i=r(n.find(([f])=>f.toLowerCase().includes("amount"))||n.find(([,f])=>f.match(/^-?[.,\d]+$/))),a=r(n.find(([f])=>f.toLowerCase().includes("category"))),l=r(n.find(([f])=>f!==o&&f!==i&&f!==a)),u=r(n.find(([f])=>f!==o&&f!==i&&f!==a&&f!==l)),c=r(n.find(([f])=>f!==o&&f!==i&&f!==l&&f!==u));return{date:o,amount:i,payee:l,notes:u,inOut:c,category:a}}function b3(e,t){const n={};for(const[r,o]of Object.entries(t)){let i=r;i==="payee"&&(i="payee_name"),n[i]=e[o||i]}return n}function Bf(e,t,n){if(e==null)return null;const r=typeof e=="string"?YN(e):e;return r===null?null:t(r)*n}function w3(e,t,n,r,o,i){const a=parseFloat(i)||1;if(t){const l=Bf(e.outflow,c=>-Math.abs(c),a),u=l?0:Bf(e.inflow,c=>Math.abs(c),a);return{amount:l||u,outflow:l,inflow:u}}return n?{amount:Bf(e.amount,l=>e.inOut===r?Math.abs(l)*-1:Math.abs(l),a),outflow:null,inflow:null}:{amount:Bf(e.amount,l=>o?l*-1:l,a),outflow:null,inflow:null}}function Uve(e,t){let n=null;return t.forEach(r=>{if(r.id===e.category)return null;r.name===e.category&&(n=r.id)}),n}function Wve({transaction:e,fieldMappings:t,showParsed:n,parseDateFormat:r,dateFormat:o,splitMode:i,inOutMode:a,outValue:l,flipAmount:u,multiplierAmount:c,categories:f}){const d=f.map(k=>k.name),h=g.useMemo(()=>t?b3(e,t):e,[e,t]),{amount:p,outflow:m,inflow:x}=w3(h,i,a,l,u,c);return s.jsxs($o,{style:{backgroundColor:S.tableBackground},children:[s.jsx(he,{width:200,children:n?s.jsx(zve,{parseDateFormat:r,dateFormat:o,date:h.date}):x3(h.date,o)}),s.jsx(he,{width:"flex",title:h.imported_payee||h.payee_name,children:h.payee_name}),s.jsx(he,{width:"flex",title:h.notes,children:h.notes}),s.jsx(he,{width:"flex",title:d.includes(h.category)?h.category:void 0,children:d.includes(h.category)&&h.category}),i?s.jsxs(s.Fragment,{children:[s.jsx(he,{width:90,contentStyle:{textAlign:"right",...X.tnum,...x===null&&m===null?{color:S.errorText}:{}},title:x===null&&m===null?"Invalid: unable to parse the value":Bi(m),children:Bi(m)}),s.jsx(he,{width:90,contentStyle:{textAlign:"right",...X.tnum,...x===null&&m===null?{color:S.errorText}:{}},title:x===null&&m===null?"Invalid: unable to parse the value":Bi(x),children:Bi(x)})]}):s.jsxs(s.Fragment,{children:[a&&s.jsx(he,{width:90,contentStyle:{textAlign:"left",...X.tnum},title:h.inOut,children:h.inOut}),s.jsx(he,{width:90,contentStyle:{textAlign:"right",...X.tnum,...p===null?{color:S.errorText}:{}},title:p===null?`Invalid: unable to parse the value (${h.amount})`:Bi(p),children:Bi(p)})]})]})}function Di({title:e}){return s.jsx(z,{style:{fontSize:13,marginBottom:3,color:S.pageText},children:e})}function _i({style:e,options:t,value:n,onChange:r,hasHeaderRow:o,firstTransaction:i}){return s.jsx(Rn,{options:[["choose-field","Choose field..."],...t.map(a=>[a,o?a:`Column ${parseInt(a)+1} (${i[a]})`])],value:n===null?"choose-field":n,style:{width:"100%"},wrapperStyle:e,onChange:a=>r(a)})}function Vve({transactions:e,fieldMappings:t,parseDateFormat:n,onChange:r}){let o="-";if(e.length>0&&t&&t.date!=null){const i=e[0][t.date],a=i&&i.match(/[/.,-/\\]/);o=a?a[0]:" "}return s.jsxs(I,{style:{width:120},children:[s.jsx(_c,{title:"Date format"}),s.jsx(Rn,{options:v3.map(i=>[i.format,i.label.replace(/ /g,o)]),value:n||"",onChange:i=>r(i),style:{width:"100%"}})]})}function Ba({id:e,checked:t,disabled:n,onChange:r,children:o,style:i}){return s.jsxs(I,{style:{flex:1,flexDirection:"row",alignItems:"center",userSelect:"none",minHeight:28,...i},children:[s.jsx(Bo,{id:e,checked:t,disabled:n,onChange:r}),s.jsx("label",{htmlFor:e,style:{userSelect:"none",color:n?S.pageTextSubdued:null},children:o})]})}function Yve({multiplierEnabled:e,multiplierAmount:t,onToggle:n,onChangeAmount:r}){return s.jsxs(I,{style:{flexDirection:"row",gap:10,height:28},children:[s.jsx(Ba,{id:"add_multiplier",checked:e,onChange:n,children:"Add multiplier"}),s.jsx(Ke,{type:"text",style:{display:e?"inherit":"none"},value:t,placeholder:"Multiplier",onChangeValue:r})]})}function qve({inOutMode:e,outValue:t,disabled:n,onToggle:r,onChangeText:o}){return s.jsxs(I,{style:{flexDirection:"row",gap:10,height:28},children:[s.jsx(Ba,{id:"form_inOut",checked:e,disabled:n,onChange:r,children:e?"in/out identifier":"Select column to specify if amount goes in/out"}),e&&s.jsx(Ke,{type:"text",value:t,onChangeValue:o,placeholder:"Value for out rows, i.e. Credit"})]})}function Gve({transactions:e,mappings:t,onChange:n,splitMode:r,inOutMode:o,hasHeaderRow:i}){if(e.length===0)return null;const a=Object.keys(e[0]);return t=t||{},s.jsxs(I,{children:[s.jsx(_c,{title:"CSV FIELDS"}),s.jsxs(Pe,{direction:"row",align:"flex-start",spacing:1,style:{marginTop:5},children:[s.jsxs(I,{style:{flex:1},children:[s.jsx(Di,{title:"Date"}),s.jsx(_i,{options:a,value:t.date,style:{marginRight:5},onChange:l=>n("date",l),hasHeaderRow:i,firstTransaction:e[0]})]}),s.jsxs(I,{style:{flex:1},children:[s.jsx(Di,{title:"Payee"}),s.jsx(_i,{options:a,value:t.payee,style:{marginRight:5},onChange:l=>n("payee",l),hasHeaderRow:i,firstTransaction:e[0]})]}),s.jsxs(I,{style:{flex:1},children:[s.jsx(Di,{title:"Notes"}),s.jsx(_i,{options:a,value:t.notes,style:{marginRight:5},onChange:l=>n("notes",l),hasHeaderRow:i,firstTransaction:e[0]})]}),s.jsxs(I,{style:{flex:1},children:[s.jsx(Di,{title:"Category"}),s.jsx(_i,{options:a,value:t.category,style:{marginRight:5},onChange:l=>n("category",l),hasHeaderRow:i,firstTransaction:e[0]})]}),r?s.jsxs(s.Fragment,{children:[s.jsxs(I,{style:{flex:.5},children:[s.jsx(Di,{title:"Outflow"}),s.jsx(_i,{options:a,value:t.outflow,onChange:l=>n("outflow",l),hasHeaderRow:i,firstTransaction:e[0]})]}),s.jsxs(I,{style:{flex:.5},children:[s.jsx(Di,{title:"Inflow"}),s.jsx(_i,{options:a,value:t.inflow,onChange:l=>n("inflow",l),hasHeaderRow:i,firstTransaction:e[0]})]})]}):s.jsxs(s.Fragment,{children:[o&&s.jsxs(I,{style:{flex:1},children:[s.jsx(Di,{title:"In/Out"}),s.jsx(_i,{options:a,value:t.inOut,onChange:l=>n("inOut",l),hasHeaderRow:i,firstTransaction:e[0]})]}),s.jsxs(I,{style:{flex:1},children:[s.jsx(Di,{title:"Amount"}),s.jsx(_i,{options:a,value:t.amount,onChange:l=>n("amount",l),hasHeaderRow:i,firstTransaction:e[0]})]})]})]})]})}function Kve({modalProps:e,options:t}){const n=nr()||"MM/dd/yyyy",r=Hve(),{parseTransactions:o,importTransactions:i,getPayees:a,savePrefs:l}=Ht(),[u,c]=g.useState(""),[f,d]=g.useState("parsing"),[h,p]=g.useState(null),[m,x]=g.useState(t.filename),[k,v]=g.useState([]),[y,b]=g.useState(null),[w,E]=g.useState(null),[T,_]=g.useState(!1),[M,B]=g.useState(!1),[O,N]=g.useState(""),[H,F]=g.useState(!1),[L,R]=g.useState(!1),{accountId:U,categories:P,onImported:j}=t,[D,C]=g.useState(r[`csv-delimiter-${U}`]||(m.endsWith(".tsv")?" ":",")),[$,W]=g.useState(r[`csv-has-header-${U}`]??!0),[A,J]=g.useState(r[`ofx-fallback-missing-payee-${U}`]??!0),[le,ee]=g.useState(null),[ie,V]=g.useState(!0);async function Q(Be,Ce){d("parsing");const xt=Ny(Be);x(Be),b(xt);const{errors:Ut,transactions:Sr}=await o(Be,Ce);if(d(null),p(null),Ut.length>0)p({parsed:!0,message:Ut[0].message||"Internal error"});else{if((xt==="csv"||xt==="qif")&&F(r[`flip-amount-${U}-${xt}`]||!1),xt==="csv"){let yn=r[`csv-mappings-${U}`];yn=yn?JSON.parse(yn):A2(Sr),E(yn);const kr=!!(yn.outflow||yn.inflow);_(kr),ee(r[`parse-date-${U}-${xt}`]||O2(Sr,yn))}else xt==="qif"?ee(r[`parse-date-${U}-${xt}`]||O2(Sr,{date:"date"})):(E(null),ee(null));v(Sr.reverse())}}function ce(Be){const Ce=Be;(!Ce||Ce.match(/^\d{1,}(\.\d{0,4})?$/))&&c(Ce)}g.useEffect(()=>{const Be=Ny(t.filename),Ce=Tu(Be,{delimiter:D,hasHeaderRow:$,fallbackMissingPayeeToMemo:A});Q(t.filename,Ce)},[o,t.filename]);function He(){if(w==null)return;H===!0&&F(!H);const Be=!T;_(Be),B(!1),F(!1);const Ce=A2(k),xt=Be?{amount:null,outflow:Ce.amount,inflow:null}:{amount:Ce.amount,outflow:null,inflow:null};E({...w,...xt})}async function Re(){const Be=await window.Actual?.openFileDialog({filters:[{name:"Financial Files",extensions:["qif","ofx","qfx","csv","tsv"]}]}),Ce=Ny(Be[0]),xt=Tu(Ce,{delimiter:D,hasHeaderRow:$,fallbackMissingPayeeToMemo:A});Q(Be[0],xt)}function me(Be,Ce){E({...w,[Be]:Ce===""?null:Ce})}async function ft(){d("importing");const Be=[];let Ce;for(let Ut of k){Ut=w?b3(Ut,w):Ut;const Sr=Au(y)?Ut.date:Bw(Ut.date,le);if(Sr==null){Ce=`Unable to parse date ${Ut.date||"(empty)"} with given date format`;break}const{amount:yn}=w3(Ut,T,M,O,H,u);if(yn==null){Ce=`Transaction on ${Ut.date} has no amount`;break}const kr=Uve(Ut,P.list);kr!=null&&(Ut.category=kr);const{inflow:Cs,outflow:Es,inOut:Zd,...nu}=Ut;Be.push({...nu,date:Sr,amount:gr(yn),cleared:ie})}if(Ce){d(null),p({parsed:!1,message:Ce});return}if(!Au(y)){const Ut=`parse-date-${U}-${y}`;l({[Ut]:le})}Au(y)&&l({[`ofx-fallback-missing-payee-${U}`]:A}),y==="csv"&&(l({[`csv-mappings-${U}`]:JSON.stringify(w)}),l({[`csv-delimiter-${U}`]:D})),(y==="csv"||y==="qif")&&l({[`flip-amount-${U}-${y}`]:H});const xt=await i(U,Be);xt&&await a(),j&&j(xt),e.onClose()}const qt=[{name:"Date",width:200},{name:"Payee",width:"flex"},{name:"Notes",width:"flex"},{name:"Category",width:"flex"}];return M&&qt.push({name:"In/Out",width:90,style:{textAlign:"left"}}),T?(qt.push({name:"Outflow",width:90,style:{textAlign:"right"}}),qt.push({name:"Inflow",width:90,style:{textAlign:"right"}})):qt.push({name:"Amount",width:90,style:{textAlign:"right"}}),s.jsxs(_e,{title:"Import transactions"+(y?` (${y.toUpperCase()})`:""),...e,loading:f==="parsing",style:{width:800},children:[h&&!h.parsed&&s.jsx(I,{style:{alignItems:"center",marginBottom:15},children:s.jsxs(z,{style:{marginRight:10,color:S.errorText},children:[s.jsx("strong",{children:"Error:"})," ",h.message]})}),(!h||!h.parsed)&&s.jsxs(I,{style:{flex:"unset",height:300,border:"1px solid "+S.tableBorder},children:[s.jsx(ws,{headers:qt}),s.jsx(Mle,{items:k,fields:["payee","category","amount"],style:{backgroundColor:S.tableHeaderBackground},getItemKey:Be=>Be,renderEmpty:()=>s.jsx(I,{style:{textAlign:"center",marginTop:25,color:S.tableHeaderText,fontStyle:"italic"},children:"No transactions found"}),renderItem:({key:Be,style:Ce,item:xt})=>s.jsx(I,{style:Ce,children:s.jsx(Wve,{transaction:xt,showParsed:y==="csv"||y==="qif",parseDateFormat:le,dateFormat:n,fieldMappings:w,splitMode:T,inOutMode:M,outValue:O,flipAmount:H,multiplierAmount:u,categories:P.list})},Be)})]}),h&&h.parsed&&s.jsxs(I,{style:{color:S.errorText,alignItems:"center",marginTop:10},children:[s.jsxs(z,{style:{maxWidth:450,marginBottom:15},children:[s.jsx("strong",{children:"Error:"})," ",h.message]}),h.parsed&&s.jsx(q,{onClick:()=>Re(),children:"Select new file..."})]}),y==="csv"&&s.jsx(I,{style:{marginTop:25},children:s.jsx(Gve,{transactions:k,onChange:me,mappings:w,splitMode:T,inOutMode:M,hasHeaderRow:$})}),Au(y)&&s.jsx(Ba,{id:"form_fallback_missing_payee",checked:A,onChange:()=>{J(Be=>!Be),Q(m,Tu("ofx",{fallbackMissingPayeeToMemo:!A}))},children:"Use Memo as a fallback for empty Payees"}),(y==="qif"||y==="csv")&&s.jsx(I,{style:{marginTop:25},children:s.jsxs(Pe,{direction:"row",align:"flex-start",spacing:1,style:{marginTop:5},children:[s.jsx(I,{children:(y==="qif"||y==="csv")&&s.jsx(Vve,{transactions:k,fieldMappings:w,parseDateFormat:le,onChange:ee})}),y==="csv"&&s.jsxs(I,{style:{marginLeft:25,gap:5},children:[s.jsx(_c,{title:"CSV OPTIONS"}),s.jsxs("label",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"baseline"},children:["Delimiter:",s.jsx(Rn,{options:[[",",","],[";",";"],["|","|"],[" ","tab"]],value:D,onChange:Be=>{C(Be),Q(m,Tu("csv",{delimiter:Be,hasHeaderRow:$}))},style:{width:50}})]}),s.jsx(Ba,{id:"form_has_header",checked:$,onChange:()=>{W(!$),Q(m,Tu("csv",{delimiter:D,hasHeaderRow:!$}))},children:"File has header row"}),s.jsx(Ba,{id:"clear_on_import",checked:ie,onChange:()=>{V(!ie)},children:"Clear transactions on import"})]}),s.jsx(I,{style:{flex:1}}),s.jsxs(I,{style:{marginRight:25,gap:5},children:[s.jsx(_c,{title:"AMOUNT OPTIONS"}),s.jsx(Ba,{id:"form_flip",checked:H,disabled:T||M,onChange:()=>F(!H),children:"Flip amount"}),y==="csv"&&s.jsxs(s.Fragment,{children:[s.jsx(Ba,{id:"form_split",checked:T,disabled:M||H,onChange:He,children:"Split amount into separate inflow/outflow columns"}),s.jsx(qve,{inOutMode:M,outValue:O,disabled:T||H,onToggle:()=>B(!M),onChangeText:N})]}),s.jsx(Yve,{multiplierEnabled:L,multiplierAmount:u,onToggle:()=>{R(!L),c("")},onChangeAmount:ce})]})]})}),s.jsx(I,{style:{flexDirection:"row",marginTop:5},children:s.jsx(I,{style:{alignSelf:"flex-end",flexDirection:"row",alignItems:"center"},children:s.jsxs(mt,{type:"primary",disabled:k.length===0,loading:f==="importing",onClick:ft,children:["Import ",k.length," transactions"]})})})]})}function Tu(e,t={}){if(e==="csv"){const{delimiter:n,hasHeaderRow:r}=t;return{delimiter:n,hasHeaderRow:r}}else if(Au(e)){const{fallbackMissingPayeeToMemo:n}=t;return{fallbackMissingPayeeToMemo:n}}return{}}function Au(e){return e==="ofx"||e==="qfx"}class Qve extends g.Component{state={hoveredBackup:null};onHover=t=>{this.setState({hoveredBackup:t})};render(){const{backups:t,onSelect:n}=this.props,{hoveredBackup:r}=this.state;return s.jsx(I,{style:{flex:1,maxHeight:200,overflow:"auto"},onMouseLeave:()=>this.onHover(null),children:t.map((o,i)=>s.jsx($o,{collapsed:i!==0,focused:r===o.id,onMouseEnter:()=>this.onHover(o.id),onClick:()=>n(o.id),style:{cursor:"pointer"},children:s.jsx(Bn,{width:"flex",value:o.date?o.date:"Revert to Latest",valueStyle:{paddingLeft:20}})},o.id))})}}function S3({budgetId:e,watchUpdates:t,backupDisabled:n,actions:r,modalProps:o}){const[i,a]=g.useState([]),[l]=dt("id"),u=e||l;g.useEffect(()=>{Y("backups-get",{id:u}).then(a)},[u]),g.useEffect(()=>{if(t)return Rt("backups-updated",a),()=>ML("backups-updated")},[t]);const c=i.find(d=>d.isLatest),f=i.filter(d=>!d.isLatest);return s.jsx(_e,{title:"Load Backup",padding:0,...o,style:{flex:0},children:()=>s.jsxs(I,{style:{marginBottom:30},children:[s.jsx(I,{style:{margin:20,marginTop:0,marginBottom:15,lineHeight:1.5},children:c?s.jsxs(We,{children:[s.jsxs(We,{style:{marginBottom:10},children:[s.jsx(z,{style:{fontWeight:600},children:"You are currently working from a backup."})," ","You can load a different backup or revert to the original version below."]}),s.jsx(q,{type:"primary",onClick:()=>r.loadBackup(u,c.id),children:"Revert to original version"})]}):s.jsxs(I,{style:{alignItems:"flex-start"},children:[s.jsxs(We,{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."," ",s.jsx(z,{style:{fontWeight:600},children:"If you use a backup, you will have to setup all your devices to sync from the new budget."})]}),s.jsx(q,{type:"primary",disabled:n,onClick:()=>r.makeBackup(),children:"Backup Now"})]})}),f.length===0?s.jsx(We,{style:{color:S.tableTextLight,marginLeft:20},children:"No backups available"}):s.jsx(Qve,{backups:f,onSelect:d=>r.loadBackup(u,d)})]})})}function Xve({modalProps:e,payeeId:t}){const[n,r]=g.useState(!0),o=an();if(bd()&&o.pathname!=="/payees")throw new Error(`Possibly invalid use of ManageRulesModal, add the current url \`${o.pathname}\` to the allowlist if you’re confident the modal can never appear on top of the \`/rules\` page.`);return s.jsx(_e,{title:"Rules",padding:0,loading:n,...e,style:{flex:1},children:()=>s.jsx(wP,{isModal:!0,payeeId:t,setLoading:r})})}const Lf={color:S.pageTextPositive};function Zve({modalProps:e,payeeIds:t,targetPayeeId:n}){const r=Hr(),i=!!Te(m=>m.modals.modalStack).find(m=>m.name==="edit-rule"),a=Ft(),[l,u]=g.useState(!0),c=g.useRef(null);g.useEffect(()=>{if(c.current){const m=c.current,x=m.scrollTop;m.scrollTop=x+1,m.scrollTop=x}},[c.current,!0]);const[f]=g.useState(()=>t.map(m=>r.find(x=>x.id===m))),d=r.find(m=>m.id===n);if(!d)return null;async function h(){await Y("payees-merge",{targetId:d.id,mergeIds:f.map(x=>x.id)});let m;return l&&!i&&(m=await Y("rule-add-payee-rename",{fromNames:f.map(k=>k.name),to:d.id})),e.onClose(),m}async function p(){const m=await h();if(m){const x=await Y("rule-get",{id:m});a(y1("edit-rule",{rule:x}))}}return s.jsx(_e,{title:"Merge payee?",padding:0,showHeader:!1,...e,style:e.style,children:()=>s.jsx(I,{style:{padding:20,maxWidth:500},children:s.jsxs(I,{children:[s.jsx(be,{style:{marginBottom:10,fontWeight:500},children:f.length===1?s.jsxs(s.Fragment,{children:["The payee ",s.jsx(z,{style:Lf,children:f[0].name})," ","is not used by transactions any more. Would like to merge it with ",s.jsx(z,{style:Lf,children:d.name}),"?"]}):s.jsxs(s.Fragment,{children:["The following payees are not used by transactions any more. Would like to merge them with"," ",s.jsx(z,{style:Lf,children:d.name}),"?",s.jsx("ul",{ref:c,style:{margin:0,marginTop:10,maxHeight:140,overflow:"auto"},children:f.map(m=>s.jsx("li",{children:s.jsx(z,{style:Lf,children:m.name})},m.id))})]})}),s.jsxs(Mve,{children:["Merging will remove the payee and transfer any existing rules to the new payee.",!i&&s.jsxs(s.Fragment,{children:[" ","If checked below, a rule will be created to do this rename while importing transactions."]})]}),!i&&s.jsxs("label",{style:{fontSize:13,marginTop:10,color:S.pageTextLight,userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:[s.jsx("input",{type:"checkbox",checked:l,onChange:m=>u(m.target.checked)}),s.jsxs(z,{style:{marginLeft:3},children:["Automatically rename"," ",f.length===1?"this payee":"these payees"," in the future"]})]}),s.jsxs(ys,{style:{marginTop:20},focusButton:!0,children:[s.jsx(q,{type:"primary",isSubmit:!1,style:{marginRight:10},onClick:h,children:"Merge"}),!i&&s.jsx(q,{style:{marginRight:10},onClick:p,children:"Merge and edit rule"}),s.jsx(q,{style:{marginRight:10},onClick:()=>e.onBack(),children:"Do nothing"})]})]})})})}function Jve({modalProps:e,id:t,name:n,onSave:r}){const o=Pd(()=>pt("notes").filter({id:t}).select("*"),[t]),i=o&&o.length>0?o[0].note:null,[a,l]=g.useState(i);g.useEffect(()=>l(i),[i]);function u(){e?.onClose()}function c(){a!==i&&r?.(t,a),u()}return s.jsx(_e,{title:`Notes: ${n}`,showHeader:!0,focusAfterClose:!1,...e,onClose:u,padding:0,style:{flex:1,height:"50vh",padding:"0 10px",borderRadius:"6px"},children:()=>s.jsxs(I,{style:{flex:1,flexDirection:"column"},children:[s.jsx(Cw,{notes:a,editable:!0,focused:!0,getStyle:()=>({borderRadius:6,flex:1,minWidth:0}),onChange:l}),s.jsx(I,{style:{flexDirection:"column",alignItems:"center",justifyItems:"center",width:"100%",paddingTop:10,paddingBottom:10},children:s.jsxs(q,{type:"primary",style:{fontSize:17,fontWeight:400,width:"100%"},onClick:c,children:[s.jsx(sP,{width:17,height:17,style:{paddingRight:5}}),"Save notes"]})})]})})}function exe(e){return s.jsx(Xd,{style:{alignSelf:"center"},children:e==="timeout"?"Timed out. Please try again.":"An error occurred while linking your account, sorry!"})}function txe({modalProps:e,onMoveExternal:t,onSuccess:n,onClose:r}){const[o,i]=g.useState(null),[a,l]=g.useState(!1),[u,c]=g.useState(null),f=g.useRef(null);async function d(){c(null),i("browser");const m=await t();if(m.error){c(m.error),i(null);return}f.current=m.data,i(null),l(!0)}function h(){r?.(),e.onClose()}async function p(){i("accounts"),await n(f.current),i(null)}return s.jsx(_e,{title:"Link Your Bank",...e,onClose:h,style:{flex:0},children:()=>s.jsxs(I,{children:[s.jsx(be,{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’s credentials."}),u&&exe(u),o?s.jsxs(I,{style:{alignItems:"center",marginTop:15},children:[s.jsx(vi,{color:S.pageTextDark,style:{width:20,height:20}}),s.jsx(I,{style:{marginTop:10,color:S.pageText},children:o==="browser"?"Waiting on browser...":o==="accounts"?"Loading accounts...":null})]}):a?s.jsx(q,{type:"primary",style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10},onClick:p,children:"Success! Click to continue →"}):s.jsx(q,{type:"primary",style:{padding:"10px 0",fontSize:15,fontWeight:600,marginTop:10},onClick:d,children:"Link bank in browser →"}),s.jsx("div",{style:{marginTop:o?30:35},children:s.jsx(z,{style:{color:S.pageText,fontWeight:600},children:"Why not link it in the app?"})}),s.jsx(z,{style:{marginTop:10,color:S.pageText,fontSize:13,"& a, & a:visited":{color:S.pageText}},children:"Typing your bank’s 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]"}),s.jsx(ys,{style:{marginTop:10},children:s.jsx(q,{onClick:()=>e.onBack(),children:"Back"})})]})})}function nxe(e,t="account"){return e?e==="budgeted"?{$and:[{[`${t}.offbudget`]:!1},{[`${t}.closed`]:!1}]}:e==="offbudget"?{$and:[{[`${t}.offbudget`]:!0},{[`${t}.closed`]:!1}]}:e==="uncategorized"?{[`${t}.offbudget`]:!1,category:null,is_parent:!1,$or:[{"payee.transfer_acct.offbudget":!0,"payee.transfer_acct":null}]}:{[t]:e}:null}function lwe(e){let t=pt("transactions").options({splits:"grouped"});const n=nxe(e);return n&&(t=t.filter(n)),t}function uwe(e,t,n){const r=D1(t);let o;return $g(n).test(t)?o=Sn(t,Ng(n),new Date):Jb(n).test(t)?o=Sn(t,Zb(n),new Date):o=Sn(t,n,new Date),e.filter({$or:{"payee.name":{$like:`%${t}%`},notes:{$like:`%${t}%`},"category.name":{$like:`%${t}%`},"account.name":{$like:`%${t}%`},$or:[Oo(o)&&{date:ca(o)},r!=null&&{amount:{$transform:"$abs",$eq:gr(r)}},r!=null&&Number.isInteger(r)&&{amount:{$transform:{$abs:{$idiv:["$",100]}},$eq:r}}].filter(Boolean)}})}function $y(e){return{name:`balance-${e.id}`,query:pt("transactions").filter({account:e.id}).options({splits:"none"}).calculate({$sum:"$amount"})}}function cwe(e){return{name:`balanceCleared-${e.id}`,query:pt("transactions").filter({account:e.id,cleared:!0}).options({splits:"none"}).calculate({$sum:"$amount"})}}function dwe(e){return{name:`balanceUncleared-${e.id}`,query:pt("transactions").filter({account:e.id,cleared:!1}).options({splits:"none"}).calculate({$sum:"$amount"})}}function rxe(){return{query:pt("transactions").filter({"account.closed":!1}).calculate({$sum:"$amount"}),name:"accounts-balance"}}function oxe(){return{name:"budgeted-accounts-balance",query:pt("transactions").filter({"account.offbudget":!1,"account.closed":!1}).calculate({$sum:"$amount"})}}function ixe(){return{name:"offbudget-accounts-balance",query:pt("transactions").filter({"account.offbudget":!0,"account.closed":!1}).calculate({$sum:"$amount"})}}const axe=pt("transactions").filter({"account.offbudget":!1,category:null,$or:[{"payee.transfer_acct.offbudget":!0,"payee.transfer_acct":null}]});function sxe(){return{name:"uncategorized-amount",query:axe.calculate({$count:"$id"})}}const Li={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}`,catGoal:e=>`goal-${e}`},jl={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}`,catGoal:e=>`goal-${e}`};function ri({binding:e,type:t,formatter:n,style:r,getStyle:o,privacyFilter:i,"data-testid":a,...l}){const{fullSheetName:u}=iw(e),c=No(e),f=Xl();return s.jsx(dP,{privacyFilter:i??(t==="financial"?!0:void 0),children:s.jsx(z,{style:{...t==="financial"&&X.tnum,...r,...o&&o(c)},"data-testid":a||u,"data-cellname":u,...l,children:n?n(c):f(c,t)})})}function k3({title:e,current:t,target:n,ProgressComponent:r,style:o}){return s.jsxs(I,{style:{lineHeight:1.5,flexDirection:"row",alignItems:"center",fontSize:14,...o},children:[s.jsx(r,{current:t,target:n}),s.jsxs(I,{style:{marginLeft:10},children:[s.jsx(I,{children:s.jsx(z,{style:{color:S.pageTextLight},children:e})}),s.jsxs(z,{children:[s.jsx(ri,{binding:t,type:"financial"}),s.jsxs(z,{style:{color:S.pageTextSubdued,fontStyle:"italic"},children:[" of ",s.jsx(ri,{binding:n,type:"financial",style:X.notFixed})]})]})]})]})}function T3(e,t){return t===0?e>0?1:0:e/t}function C3({style:e,progress:t,color:n,backgroundColor:r}){const i=2*Math.PI*4,a=t*i,l=i;return s.jsxs("svg",{viewBox:"0 0 20 20",style:e,children:[s.jsx("circle",{r:"10",cx:"10",cy:"10",fill:r}),s.jsx("circle",{r:4,cx:"10",cy:"10",fill:"none",stroke:n,strokeWidth:4*2,strokeDasharray:`${a} ${l}`,transform:"rotate(-90) translate(-20)"})," "]})}function lxe({current:e,target:t}){let n=No(e)||0;const r=No(t)||0;n=Math.max(-n,0);let o,i=!1;return n>r?(o=(n-r)/r,i=!0):o=T3(n,r),s.jsx(C3,{progress:o,color:i?S.errorText:S.noticeTextLight,backgroundColor:i?S.errorBackground:S.tableBackground,style:{width:20,height:20}})}function uxe({style:e}){return s.jsx(k3,{title:"Expenses",current:jl.totalSpent,target:jl.totalBudgetedExpense,ProgressComponent:lxe,style:e})}function cxe({current:e,target:t}){let n=No(e)||0;const r=No(t)||0;let o=!1;n<0&&(o=!0,n=-n);const i=T3(n,r);return s.jsx(C3,{progress:i,color:o?S.errorText:S.noticeTextLight,backgroundColor:o?S.errorBackground:S.tableBackground,style:{width:20,height:20}})}function dxe({style:e}){return s.jsx(k3,{title:"Income",current:jl.totalIncome,target:jl.totalBudgetedIncome,ProgressComponent:cxe,style:e})}function Kc({left:e,right:t,style:n,leftStyle:r,rightStyle:o,truncate:i="left",...a}){const l={textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"};return s.jsxs(I,{style:{flexDirection:"row",alignItems:"center",...n},...a,children:[s.jsx(We,{style:{marginRight:10,...i==="left"&&l,...r},children:e}),s.jsx(We,{style:{flex:1,textAlign:"right",...i==="right"&&l,...o},children:t})]})}function Lw({style:e,contentStyle:t,children:n,renderContent:r,disabled:o}){const[i,a]=g.useState(!1),l=g.useCallback(()=>{o||a(!0)},[o]),u=g.useCallback(()=>{o||a(!1)},[o]);return g.useEffect(()=>{o&&i&&a(!1)},[o,i]),s.jsxs(I,{style:e,children:[s.jsx(I,{onPointerEnter:l,onPointerLeave:u,style:t,children:n}),i&&r()]})}function E3(e,t,n){return{start:t<e.start?e.start:t,end:n>e.end?e.end:n}}const fxe=g.createContext(null);function fwe({startMonth:e,numMonths:t,monthBounds:n,type:r,children:o}){const i=Lg(e,t-1),a=E3(n,e,i),l=qb(a.start,a.end);return s.jsx(fxe.Provider,{value:{months:l,type:r},children:o})}function hxe(e){return[{id:"to-be-budgeted",name:"To Be Budgeted",categories:[{id:"to-be-budgeted",name:"To Be Budgeted",cat_group:"to-be-budgeted",group:{id:"to-be-budgeted",name:"To Be Budgeted"}}]},...e]}function hwe(e){return[e.filter(t=>!t.is_income),e.find(t=>t.is_income)]}function pxe(e){return e===0||e==="0"||e===""||e==null?{color:S.tableTextSubdued}:null}function pwe(e,t,n){if(e<0)return{color:S.errorText};if(t==null){const r=pxe(e);if(r)return r}else return n<t?{color:S.warningText}:{color:S.noticeText}}function P2(e){return{color:e<0?S.errorText:e===0?S.tableTextSubdued:S.noticeText}}function gwe(e,t,n){if(t==="top")return{targetId:n};{const r=e.findIndex(i=>i.id===n);if(r===-1)throw new Error("findSort: item not found: "+n);const o=r+1;return o<e.length-1?{targetId:e[o].id}:{targetId:null}}}function mwe(e,t,n){if(t==="bottom")return{targetId:n};{const r=e.findIndex(i=>i.id===n);if(r===-1)throw new Error("findSort: item not found: "+n);const o=r-1;return o>=0?{targetId:e[o].id}:{targetId:null}}}function ywe(){return Math.max(X.scrollbarWidth-2,0)}async function gxe(e,t,n){const o=await Y(e==="report"?"report-budget-month":"rollover-budget-month",{month:n});for(const i of o)t.prewarmCache(i.name,i)}async function mxe(e,t,n,r){n=E3(n,JA(r,1),Lg(r,4));const i=qb(n.start,n.end);await Promise.all(i.map(a=>gxe(e,t,a)))}async function vwe(e,t,n,r,o){t.disableObservers(),await Y("budget-set-type",{type:e}),await mxe(e,t,n,r),t.enableObservers(),await o?.()}function yxe({projected:e,style:t}){const n=No(jl.totalBudgetedSaved)||0,r=No(jl.totalSaved)||0,o=Xl(),i=e?n:r,a=i<0;return s.jsxs(I,{style:{alignItems:"center",fontSize:14,...t},children:[e?s.jsx(z,{style:{color:S.pageTextLight},children:"Projected Savings:"}):s.jsx(I,{style:{color:S.pageTextLight},children:a?"Overspent:":"Saved:"}),s.jsx(Lw,{renderContent:()=>{if(!e){const l=r-n;return s.jsxs(Et,{position:"bottom-center",style:{padding:10,fontSize:14},children:[s.jsx(Kc,{left:"Projected Savings:",right:s.jsx(z,{style:{...P2(n),...X.tnum},children:o(n,"financial-with-sign")})}),s.jsx(Kc,{left:"Difference:",right:s.jsx(z,{style:{...P2(l),...X.tnum},children:o(l,"financial-with-sign")})})]})}return null},children:s.jsx(I,{className:`${ze([{fontSize:25,color:e?S.warningText:a?S.errorTextDark:S.upcomingText}])}`,children:s.jsx(Uc,{blurIntensity:7,children:o(i,"financial")})})})]})}function vxe({month:e,modalProps:t}){const n=XA();return s.jsx(_e,{title:"Budget Summary",...t,children:()=>s.jsxs(Ad.Provider,{value:Qb(e),children:[s.jsxs(Pe,{spacing:2,style:{alignSelf:"center",backgroundColor:"transparent",borderRadius:4},children:[s.jsx(dxe,{style:{...X.mediumText}}),s.jsx(uxe,{style:{...X.mediumText}})]}),s.jsx(yxe,{projected:e>=n,style:{...X.mediumText,marginTop:20}})]})})}function xxe({onSubmit:e,onClose:t,position:n="bottom-right",...r}){const o=bb(),i=g.useContext(Ad),[a,l]=g.useState(null);g.useEffect(()=>{(async()=>{const c=await o.get(i,"to-budget");l(_n(Math.max(c.value,0)))})()},[]);function u(c){const f=uw(c);f&&e(gr(f)),t()}return a===null?null:s.jsxs(Et,{position:n,width:200,style:{padding:10},onClose:t,...r,children:[s.jsx(I,{style:{marginBottom:5},children:"Hold this amount:"}),s.jsx(I,{children:s.jsx(Ts,{children:s.jsx(Ke,{value:a,onChange:c=>l(c.target.value),onEnter:()=>u(a)})})}),s.jsx(I,{style:{alignItems:"flex-end",marginTop:10},children:s.jsx(q,{type:"primary",style:{fontSize:12,paddingTop:3,paddingBottom:3},onClick:()=>u(a),children:"Hold"})})]})}function bxe({initialAmount:e=0,initialAmountName:t,showToBeBudgeted:n,onSubmit:r,onClose:o,position:i="bottom-right",...a}){const l=bb(),u=g.useContext(Ad);let{grouped:c}=Fr();c=c.filter(x=>!x.is_income),n&&(c=hxe(c));const[f,d]=g.useState(null),[h,p]=g.useState(null);g.useEffect(()=>{(async()=>{if(t){const x=await l.get(u,t);d(_n(Math.max(x.value,0)))}else d(_n(Math.max(e,0)))})()},[]);function m(x){const k=uw(x);k&&h&&(r(gr(k),h),o())}return f===null?null:s.jsxs(Et,{position:i,width:200,style:{padding:10},onClose:o,...a,children:[s.jsx(I,{style:{marginBottom:5},children:"Transfer this amount:"}),s.jsx(I,{children:s.jsx(Ts,{children:s.jsx(Ke,{value:f,onChange:x=>d(x.target.value),onEnter:()=>m(f)})})}),s.jsx(I,{style:{margin:"10px 0 5px 0"},children:"To:"}),s.jsx(Gd,{categoryGroups:c,value:null,openOnFocus:!0,onUpdate:()=>{},onSelect:x=>p(x||null),inputProps:{onEnter:()=>m(f),placeholder:"(none)"},showHiddenCategories:!0}),s.jsx(I,{style:{alignItems:"flex-end",marginTop:10},children:s.jsx(q,{type:"primary",style:{fontSize:12,paddingTop:3,paddingBottom:3},onClick:()=>m(f),children:"Transfer"})})]})}function j3({prevMonthName:e,style:t}){const n=Xl();return s.jsxs(I,{style:{flexDirection:"row",lineHeight:1.5,justifyContent:"center",...X.smallText,...t},children:[s.jsxs(I,{style:{textAlign:"right",marginRight:10,minWidth:50},children:[s.jsx(Lw,{style:{flexShrink:0},renderContent:()=>s.jsxs(Et,{width:200,style:{lineHeight:1.5,padding:"6px 10px"},children:[s.jsx(Kc,{left:"Income:",right:s.jsx(ri,{binding:Li.totalIncome,type:"financial",privacyFilter:!1})}),s.jsx(Kc,{left:"From Last Month:",right:s.jsx(ri,{binding:Li.fromLastMonth,type:"financial",privacyFilter:!1})})]}),children:s.jsx(ri,{binding:Li.incomeAvailable,type:"financial",style:{fontWeight:600}})}),s.jsx(ri,{binding:Li.lastMonthOverspent,type:"financial",formatter:r=>{const o=n(r,"financial");return r>0?"+"+o:r===0?"-"+o:o},style:{fontWeight:600,...X.tnum}}),s.jsx(ri,{binding:Li.totalBudgeted,type:"financial",formatter:r=>{const o=n(r,"financial");return r>0?"+"+o:r===0?"-"+o:o},style:{fontWeight:600,...X.tnum}}),s.jsx(ri,{binding:Li.forNextMonth,type:"financial",formatter:r=>{const o=parseInt(r)||0,i=n(Math.abs(o),"financial");return o>=0?"-"+i:"+"+i},style:{fontWeight:600,...X.tnum}})]}),s.jsxs(I,{children:[s.jsx(We,{children:"Available Funds"}),s.jsxs(We,{children:["Overspent in ",e]}),s.jsx(We,{children:"Budgeted"}),s.jsx(We,{children:"For Next Month"})]})]})}function wxe({month:e,prevMonthName:t,showTotalsTooltipOnHover:n,onBudgetAction:r,style:o,amountStyle:i,menuTooltipProps:a,totalsTooltipProps:l,holdTooltipProps:u,transferTooltipProps:c}){const[f,d]=g.useState(null),h=iw(Li.toBudget),p=No({name:Li.toBudget,value:0}),m=Xl(),x=parseInt(p),k=isNaN(x)?0:x,v=k<0;return s.jsxs(I,{style:{alignItems:"center",...o},children:[s.jsx(We,{children:v?"Overbudgeted:":"To Budget:"}),s.jsxs(I,{children:[s.jsx(Lw,{disabled:!n||!!f,renderContent:()=>s.jsx(Et,{position:"bottom-center",...l,children:s.jsx(j3,{prevMonthName:t,style:{padding:7}})}),children:s.jsx(Uc,{blurIntensity:7,children:s.jsx(We,{onClick:()=>d("actions"),"data-cellname":h,className:`${ze([X.veryLargeText,{fontWeight:400,userSelect:"none",cursor:"pointer",color:v?S.errorText:S.pageTextPositive,marginBottom:-1,borderBottom:"1px solid transparent",":hover":{borderColor:v?S.errorBorder:S.pageTextPositive}},i])}`,children:m(k,"financial")})})}),f==="actions"&&s.jsx(Et,{position:"bottom-center",width:200,style:{padding:0},onClose:()=>d(null),...a,children:s.jsx(wt,{onMenuSelect:y=>{y==="reset-buffer"?(r(e,"reset-hold"),d(null)):d(y)},items:[{name:"transfer",text:"Move to a category"},{name:"buffer",text:"Hold for next month"},{name:"reset-buffer",text:"Reset next month’s buffer"}]})}),f==="buffer"&&s.jsx(xxe,{onClose:()=>d(null),onSubmit:y=>{r(e,"hold",{amount:y})},...u}),f==="transfer"&&s.jsx(bxe,{initialAmount:x,onClose:()=>d(null),onSubmit:(y,b)=>{r(e,"transfer-available",{amount:y,category:b})},...c})]})]})}function Sxe({month:e,onBudgetAction:t,modalProps:n}){const r=An(ZA(e),"MMM");return s.jsx(_e,{title:"Budget Summary",...n,children:()=>s.jsxs(Ad.Provider,{value:Qb(e),children:[s.jsx(j3,{prevMonthName:r,style:{...X.mediumText}}),s.jsx(wxe,{month:e,prevMonthName:r,onBudgetAction:t,style:{...X.mediumText,marginTop:15},amountStyle:{...X.underlinedText},totalsTooltipProps:{position:"bottom-center"},holdTooltipProps:{position:"bottom-center"},transferTooltipProps:{position:"bottom-center"}})]})})}const el={id:"new",name:"Create new account"};function kxe({modalProps:e,requisitionId:t,externalAccounts:n,actions:r,syncSource:o}){const i=mn().filter(d=>d.closed===0),[a,l]=g.useState(()=>Object.fromEntries(i.filter(d=>d.account_id).map(d=>[d.account_id,d.id])));async function u(){const d=Object.values(a);i.filter(h=>h.account_id).filter(h=>!d.includes(h.id)).forEach(h=>r.unlinkAccount(h.id)),Object.entries(a).forEach(([h,p])=>{const m=n.find(x=>x.account_id===h);m&&(o==="simpleFin"?r.linkAccountSimpleFin(m,p!==el.id?p:void 0):r.linkAccount(t,m,p!==el.id?p:void 0))}),r.closeModal()}const c=i.filter(d=>!Object.values(a).includes(d.id));function f(d,h){l(p=>{const m={...p};return h?m[d.account_id]=h:delete m[d.account_id],m})}return s.jsx(_e,{title:"Link Accounts",...e,style:{width:800},children:()=>s.jsxs(s.Fragment,{children:[s.jsx(z,{style:{marginBottom:10},children:"We found the following accounts. Select which ones you want to add:"}),s.jsxs(I,{style:{flex:"unset",height:300,border:"1px solid "+S.tableBorder},children:[s.jsx(ws,{headers:[{name:"Bank Account To Sync",width:200},{name:"Account in Actual",width:"flex"},{name:"Actions",width:"flex"}]}),s.jsx(Ss,{items:n,style:{backgroundColor:S.tableHeaderBackground},getItemKey:d=>d,renderItem:({key:d,item:h})=>s.jsx(I,{children:s.jsx(Txe,{externalAccount:h,chosenAccount:a[h.account_id]===el.id?el:i.find(p=>a[h.account_id]===p.id),unlinkedAccounts:c,onSetLinkedAccount:f})},d)})]}),s.jsx(I,{style:{flexDirection:"row",justifyContent:"flex-end",marginTop:10},children:s.jsx(q,{type:"primary",onClick:u,disabled:!Object.keys(a).length,children:"Link accounts"})})]})})}function Txe({externalAccount:e,chosenAccount:t,unlinkedAccounts:n,onSetLinkedAccount:r}){const[o,i]=g.useState(null),a=[...n,t?.id!==el.id&&t,el].filter(Boolean);return s.jsxs($o,{style:{backgroundColor:S.tableBackground},children:[s.jsx(he,{width:200,children:e.name}),s.jsx(he,{width:"flex",truncate:o!=="account",onClick:()=>i("account"),children:o==="account"?s.jsx(Fo,{focused:!0,strict:!0,highlightFirst:!0,suggestions:a,onSelect:l=>{r(e,l)},inputProps:{onBlur:()=>i(null)},value:t?.id}):t?.name}),s.jsx(he,{width:"flex",children:t?s.jsx(q,{onClick:()=>{r(e,null)},style:{float:"right"},children:"Remove bank-sync"}):s.jsx(q,{type:"primary",onClick:()=>{i("account")},style:{float:"right"},children:"Setup bank-sync"})})]})}const Cxe=({modalProps:e,onSuccess:t})=>{const[n,r]=g.useState(""),[o,i]=g.useState(!0),[a,l]=g.useState(!1),u=async()=>{if(!n){i(!1);return}l(!0),await Y("secret-set",{name:"simplefin_token",value:n}),t(),e.onClose(),l(!1)};return s.jsxs(_e,{title:"Set-up SimpleFIN",size:{width:300},...e,children:[s.jsxs(I,{style:{display:"flex",gap:10},children:[s.jsxs(z,{children:["In order to enable bank-sync via SimpleFIN (only for North American banks) you will need to create a token. This can be done by creating an account with"," ",s.jsx(Ve,{to:"https://beta-bridge.simplefin.org/",linkColor:"purple",children:"SimpleFIN"}),"."]}),s.jsxs(_o,{children:[s.jsx(eo,{title:"Token:",htmlFor:"token-field"}),s.jsx(Ke,{id:"token-field",type:"password",value:n,onChangeValue:c=>{r(c),i(!0)}})]}),!o&&s.jsx(Xd,{children:"It is required to provide a token."})]}),s.jsx(ys,{children:s.jsx(mt,{type:"primary",loading:a,onClick:u,children:"Save and continue"})})]})};function M2({modalProps:e,title:t,buttonText:n,onSubmit:r,onValidate:o,inputPlaceholder:i}){const[a,l]=g.useState(""),[u,c]=g.useState(null),f=d=>{const h=o?.(d);if(h){c(h);return}r?.(d),e.onClose()};return s.jsx(_e,{title:t,...e,children:()=>s.jsxs(s.Fragment,{children:[s.jsx(I,{style:{flexDirection:"row",justifyContent:"center",paddingBottom:15},children:s.jsxs(I,{style:{flexDirection:"column",flex:1},children:[s.jsx(Ts,{children:s.jsx(Ke,{placeholder:i,style:{...X.mediumText},value:a,onChangeValue:l,onEnter:d=>f(d.currentTarget.value)})}),u&&s.jsxs(Yc,{style:{paddingTop:5},children:["* ",u]})]})}),s.jsx(I,{style:{flexDirection:"row",alignContent:"center",justifyContent:"center"},children:s.jsx(q,{type:"primary",style:{...X.mediumText,flexBasis:"50%"},onPointerUp:()=>f(a),children:n})})]})})}function Exe({modalProps:e,onSwitch:t}){const[n]=dt("budgetType");return s.jsx(_e,{title:"Switch budget type?",...e,children:()=>s.jsxs(s.Fragment,{children:[s.jsxs(be,{children:["You are currently using a"," ",s.jsxs(z,{style:{fontWeight:600},children:[n==="report"?"Report budget":"Rollover budget","."]})," ","Switching will not lose any data and you can always switch back."]}),s.jsxs(q,{type:"primary",onClick:()=>{t(),e.onClose?.()},children:["Switch to a"," ",n==="report"?"Rollover budget":"Report budget"]}),s.jsx(be,{isLast:!0,style:{marginTop:10},children:s.jsx(Ve,{to:"https://actualbudget.org/docs/experimental/report-budget",linkColor:"muted",children:"How do these types of budgeting work?"})})]})})}function jxe(e,t,n){const[r,o]=g.useState(null),[i,a]=g.useState(null);return g.useEffect(()=>{async function l(){a(!0),o(await Y(e,t,n)),a(!1)}l()},[e,t,n]),{data:r,isLoading:i}}const Pu=43;function Ixe({schedule:e,status:t,onAction:n}){const[r,o]=g.useState(!1),i=()=>{const a=[];return a.push({name:"post-transaction",text:"Post transaction"}),t==="completed"?a.push({name:"restart",text:"Restart"}):a.push({name:"skip",text:"Skip next date"},{name:"complete",text:"Complete"}),a.push({name:"delete",text:"Delete"}),a};return s.jsxs(I,{children:[s.jsx(q,{type:"bare","aria-label":"Menu",onClick:a=>{a.stopPropagation(),o(!0)},children:s.jsx(Od,{width:15,height:15,style:{transform:"rotateZ(90deg)"}})}),r&&s.jsx(Et,{position:"bottom-right",width:150,style:{padding:0},onClose:()=>o(!1),children:s.jsx(wt,{onMenuSelect:a=>{n(a,e.id),o(!1)},items:i()})})]})}function I3({amount:e,op:t}){const n=rP(e),r=_n(Math.abs(n||0)),o=t==="isapprox"||t==="isbetween";return s.jsxs(Bn,{width:100,plain:!0,style:{textAlign:"right",flexDirection:"row",alignItems:"center",padding:"0 5px"},name:"amount",children:[o&&s.jsx(I,{style:{textAlign:"left",color:S.pageTextSubdued,lineHeight:"1em",marginRight:10},title:(o?"Approximately ":"")+r,children:"~"}),s.jsx(z,{style:{flex:1,color:n>0?S.noticeTextLight:S.tableText,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:(o?"Approximately ":"")+r,children:s.jsx(Uc,{children:n>0?`+${r}`:`${r}`})})]})}function Dxe({schedules:e,statuses:t,filter:n,minimal:r,allowCompleted:o,style:i,onSelect:a,onAction:l,tableStyle:u}){const c=nr()||"MM/dd/yyyy",[f,d]=g.useState(!1),h=Hr(),p=mn(),m=g.useMemo(()=>{if(!n)return e;const y=b=>b?b.toLowerCase().includes(n.toLowerCase())||n.toLowerCase().includes(b.toLowerCase()):!1;return e.filter(b=>{const w=h.find(B=>b._payee===B.id),E=p.find(B=>b._account===B.id),T=rP(b._amount),_=(b._amountOp==="isapprox"||b._amountOp==="isbetween"?"~":"")+(T>0?"+":"")+_n(Math.abs(T||0)),M=b.next_date?An(b.next_date,c):null;return y(b.name)||y(w&&w.name)||y(E&&E.name)||y(_)||y(t.get(b.id))||y(M)})},[h,p,e,n,t]),x=g.useMemo(()=>{const y=m.filter(w=>!w.completed);return o?f?m:m.find(w=>w.completed)?[...y,{id:"show-completed"}]:y:y},[m,f,o]);function k({schedule:y}){return s.jsxs($o,{height:Pu,inset:15,onClick:()=>a(y.id),style:{cursor:"pointer",backgroundColor:S.tableBackground,color:S.tableText,":hover":{backgroundColor:S.tableRowBackgroundHover}},children:[s.jsx(he,{width:"flex",name:"name",children:s.jsx(z,{style:y.name==null?{color:S.buttonNormalDisabledText}:null,title:y.name?y.name:"",children:y.name?y.name:"None"})}),s.jsx(he,{width:"flex",name:"payee",children:s.jsx(ls,{type:"payees",id:y._payee})}),s.jsx(he,{width:"flex",name:"account",children:s.jsx(ls,{type:"accounts",id:y._account})}),s.jsx(he,{width:110,name:"date",children:y.next_date?An(y.next_date,c):null}),s.jsx(he,{width:120,name:"status",style:{alignItems:"flex-start"},children:s.jsx(a3,{status:t.get(y.id)})}),s.jsx(I3,{amount:y._amount,op:y._amountOp}),!r&&s.jsx(he,{width:80,style:{textAlign:"center"},children:y._date&&y._date.frequency&&s.jsx(sP,{style:{width:13,height:13}})}),!r&&s.jsx(he,{width:40,name:"actions",children:s.jsx(Ixe,{schedule:y,status:t.get(y.id),onAction:l})})]})}function v({item:y}){return y.id==="show-completed"?s.jsx($o,{height:Pu,inset:15,style:{cursor:"pointer",backgroundColor:"transparent",":hover":{backgroundColor:S.tableRowBackgroundHover}},onClick:()=>d(!0),children:s.jsx(he,{width:"flex",style:{fontStyle:"italic",textAlign:"center",color:S.tableText},children:"Show completed schedules"})}):k({schedule:y})}return s.jsxs(I,{style:{flex:1,...u},children:[s.jsxs(ws,{height:Pu,inset:15,children:[s.jsx(he,{width:"flex",children:"Name"}),s.jsx(he,{width:"flex",children:"Payee"}),s.jsx(he,{width:"flex",children:"Account"}),s.jsx(he,{width:110,children:"Next date"}),s.jsx(he,{width:120,children:"Status"}),s.jsx(he,{width:100,style:{textAlign:"right"},children:"Amount"}),!r&&s.jsx(he,{width:80,style:{textAlign:"center"},children:"Recurring"}),!r&&s.jsx(he,{width:40})]}),s.jsx(Ss,{rowHeight:Pu,backgroundColor:"transparent",style:{flex:1,backgroundColor:"transparent",...i},items:x,renderItem:v,renderEmpty:n?"No matching schedules":"No schedules",allowPopupsEscape:x.length<6})]})}const Fy=43;function _xe({schedules:e,loading:t}){const n=Kl(),r=bs(),o=nr()||"MM/dd/yyyy";function i({item:a}){const l=n.has(a.id),u=a._conditions.find(f=>f.field==="amount").op,c=ew(a.date,o);return s.jsxs($o,{height:Fy,inset:15,onClick:f=>{r({type:"select",id:a.id,event:f})},style:{borderColor:l?S.tableBorderSelected:S.tableBorder,cursor:"pointer",color:l?S.tableRowBackgroundHighlightText:S.tableText,backgroundColor:l?S.tableRowBackgroundHighlight:S.tableBackground,":hover":{backgroundColor:S.tableRowBackgroundHover,color:S.tableText}},children:[s.jsx(da,{exposed:!0,focused:!1,selected:l,onSelect:f=>{r({type:"select",id:a.id,event:f})}}),s.jsx(he,{width:"flex",children:s.jsx(ls,{type:"payees",id:a.payee})}),s.jsx(he,{width:"flex",children:s.jsx(ls,{type:"accounts",id:a.account})}),s.jsx(he,{width:"auto",title:c,style:{flex:1.5},children:c}),s.jsx(I3,{amount:a.amount,op:u})]})}return s.jsxs(I,{style:{flex:1},children:[s.jsxs(ws,{height:Fy,inset:15,children:[s.jsx(da,{exposed:!t,focused:!1,selected:n.size>0,onSelect:a=>r({type:"select-all",event:a})}),s.jsx(he,{width:"flex",children:"Payee"}),s.jsx(he,{width:"flex",children:"Account"}),s.jsx(he,{width:"auto",style:{flex:1.5},children:"When"}),s.jsx(he,{width:100,style:{textAlign:"right"},children:"Amount"})]}),s.jsx(Ss,{rowHeight:Fy,style:{flex:1,backgroundColor:"transparent"},items:e,loading:t,isSelected:a=>n.has(a),renderItem:i,renderEmpty:"No schedules found"})]})}function Oxe({modalProps:e,actions:t}){const{data:n,isLoading:r}=jxe("schedule/discover"),o=n||[],[i,a]=g.useState(!1),l=Gl("discover-schedules",o,[]);async function u(){const c=o.filter(f=>l.items.has(f.id));a(!0);for(const f of c){const d=await Y("schedule/create",{conditions:f._conditions,schedule:{}}),{filters:h}=await Y("make-filters-from-conditions",{conditions:f._conditions});if(h.length>0){const{data:p}=await ar(pt("transactions").filter({$and:h}).select("id"));await Y("transactions-batch-update",{updated:p.map(m=>({id:m.id,schedule:d}))})}}a(!1),t.popModal()}return s.jsxs(_e,{title:"Found schedules",size:{width:850,height:650},...e,children:[s.jsx(be,{children:"We found some possible schedules in your current transactions. Select the ones you want to create."}),s.jsx(be,{children:"If you expected a schedule here and don’t see it, it might be because the payees of the transactions don’t match. Make sure you rename payees on all transactions for a schedule to be the same payee."}),s.jsx(Ql,{instance:l,children:s.jsx(_xe,{loading:r,schedules:o})}),s.jsx(Pe,{direction:"row",align:"center",justify:"flex-end",style:{paddingTop:20,paddingBottom:0},children:s.jsx(mt,{type:"primary",loading:i,disabled:l.items.size===0,onClick:u,children:"Create schedules"})})]})}function Axe({modalProps:e,actions:t}){const n=an(),r=n.state&&n.state.payees||[],o=r.length>1;async function i(){await Y("schedule/force-run-service"),t.popModal()}return s.jsxs(_e,{title:"Post transactions?",size:"small",...e,children:[s.jsxs(be,{children:[r.length>0?s.jsxs(z,{children:["The ",o?"payees ":"payee ",r.map((a,l)=>s.jsxs(z,{children:[s.jsx(z,{style:{color:S.pageTextPositive},children:s.jsx(ls,{id:a,type:"payees"})}),l===r.length-1?" ":l===r.length-2?", and ":", "]},a))]}):s.jsxs(z,{children:["There ",o?"are payees ":"is a payee "," that "]}),s.jsxs(z,{children:[o?"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."]})]}),s.jsx(be,{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."}),s.jsx(be,{children:"You can always manually post a transaction later for a due schedule by selecting the schedule and clicking “Post transaction” in the action menu."}),s.jsxs(Pe,{direction:"row",justify:"flex-end",style:{marginTop:20},spacing:2,children:[s.jsx(q,{onClick:t.popModal,children:"Decide later"}),s.jsx(q,{type:"primary",onClick:i,children:"Post transactions"})]})]})}function R2(e,t){const n=nP(e._conditions),r=(o,i,a,l)=>o?{...o,value:l}:l!=null?{op:i,field:a,value:l}:null;return t.date==null?{error:"Date is required"}:t.amount==null?{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 Pxe({modalProps:e,actions:t,id:n,transaction:r}){const o=n==null,i=r!=null,a=mD(Hr()),l=Ft(),u=nr()||"MM/dd/yyyy",[c,f]=g.useReducer((w,E)=>{switch(E.type){case"set-schedule":{const _=E.schedule,M=nP(_._conditions),B=new Set(Object.values(M)),O=_._conditions.find(N=>!B.has(N))||_._actions.find(N=>N.op!=="link-schedule");return{...w,schedule:E.schedule,isCustom:O,fields:{payee:_._payee,account:_._account,amount:_._amount||-1e3,amountOp:_._amountOp||"isapprox",date:_._date,posts_transaction:E.schedule.posts_transaction,name:_.name}}}case"set-field":if(!(E.field in w.fields))throw new Error("Unknown field: "+E.field);const T={[E.field]:E.value};return E.field==="amountOp"&&E.value!==w.fields.amountOp&&(E.value==="isbetween"?T.amount=typeof w.fields.amount=="number"?{num1:w.fields.amount,num2:w.fields.amount}:{num1:0,num2:0}:w.fields.amountOp==="isbetween"&&(T.amount=typeof w.fields.amount=="number"?w.fields.amount:w.fields.amount.num1)),{...w,fields:{...w.fields,...T}};case"set-transactions":return i&&E.transactions&&E.transactions.sort(_=>r.id===_.id?-1:1),{...w,transactions:E.transactions};case"set-repeats":return{...w,fields:{...w.fields,date:E.repeats?{frequency:"monthly",start:Qn(),patterns:[]}:Qn()}};case"set-upcoming-dates":return{...w,upcomingDates:E.dates};case"form-error":return{...w,error:E.error};case"switch-transactions":return{...w,transactionsMode:E.mode};default:throw new Error("Unknown action: "+E.type)}},{schedule:null,upcomingDates:null,error:null,fields:{payee:null,account:null,amount:null,amountOp:null,date:null,posts_transaction:!1,name:null},transactions:[],transactionsMode:o?"matched":"linked"});async function d(){const{data:w}=await ar(pt("schedules").filter({id:n}).select("*"));return w[0]}g.useEffect(()=>{async function w(){if(o){const E={start:Qn(),frequency:"monthly",patterns:[],skipWeekend:!1,weekendSolveMode:"after",endMode:"never",endOccurrences:"1",endDate:Qn()},T=i?{posts_transaction:!1,_conditions:[{op:"isapprox",field:"date",value:E}],_actions:[],_account:r.account,_amount:r.amount,_amountOp:"is",name:r.payee?a[r.payee].name:"",_payee:r.payee?r.payee:"",_date:{...E,frequency:"monthly",start:r.date,patterns:[]}}:{posts_transaction:!1,_date:E,_conditions:[{op:"isapprox",field:"date",value:E}],_actions:[]};f({type:"set-schedule",schedule:T})}else{const E=await d();E&&c.schedule==null&&f({type:"set-schedule",schedule:E})}}w()},[]),g.useEffect(()=>{async function w(){const E=c.fields.date;if(E==null)f({type:"set-upcoming-dates",dates:null});else if(E.frequency){const{data:T}=await Nh("schedule/get-upcoming-dates",{config:E,count:3});f({type:"set-upcoming-dates",dates:T})}else{const T=Qn();E===T||tP(E,T)?f({type:"set-upcoming-dates",dates:[E]}):f({type:"set-upcoming-dates",dates:null})}}w()},[c.fields.date]),g.useEffect(()=>{if(c.schedule&&c.schedule.id&&c.transactionsMode==="linked")return Cc(pt("transactions").filter({schedule:c.schedule.id}).select("*").options({splits:"all"}),E=>f({type:"set-transactions",transactions:E})).unsubscribe},[c.schedule,c.transactionsMode]),g.useEffect(()=>{let w=!0,E;if(c.schedule&&c.transactionsMode==="matched"){const{error:T,conditions:_}=R2(c.schedule,c.fields);if(T){f({type:"form-error",error:T});return}const M=_.map(B=>B.field==="description"?{...B,field:"payee"}:B.field==="acct"?{...B,field:"account"}:B);Y("make-filters-from-conditions",{conditions:M}).then(({filters:B})=>{w&&(E=Cc(pt("transactions").filter({$and:B}).select("*").options({splits:"all"}),N=>f({type:"set-transactions",transactions:N})).unsubscribe)})}return()=>{w=!1,E&&E()}},[c.schedule,c.transactionsMode,c.fields]);const h=Gl("transactions",c.transactions,r?[r.id]:[]);async function p(){if(f({type:"form-error",error:null}),c.fields.name){const{data:_}=await ar(pt("schedules").filter({name:c.fields.name}).select("id"));if(_.length>0&&_[0].id!==c.schedule.id){f({type:"form-error",error:"There is already a schedule with this name"});return}}const{error:w,conditions:E}=R2(c.schedule,c.fields);if(w){f({type:"form-error",error:w});return}const T=await Nh(o?"schedule/create":"schedule/update",{schedule:{id:c.schedule.id,posts_transaction:c.fields.posts_transaction,name:c.fields.name},conditions:E});T.error?f({type:"form-error",error:"An error occurred while saving. Please visit https://actualbudget.org/contact/ for support."}):(o&&await x([...h.items],T.data),t.popModal())}async function m(w){const E=await Y("rule-get",{id:w||c.schedule.rule});l(dr("edit-rule",{rule:E,onSave:async()=>{const T=await d();f({type:"set-schedule",schedule:T})}}))}async function x(w,E){await Y("transactions-batch-update",{updated:w.map(T=>({id:T,schedule:E||c.schedule.id}))}),h.dispatch({type:"select-none"})}async function k(w){await Y("transactions-batch-update",{updated:w.map(E=>({id:E,schedule:null}))}),h.dispatch({type:"select-none"})}if(c.schedule==null)return null;function v(w){f({type:"switch-transactions",mode:w}),h.dispatch({type:"select-none"})}const y=a?a[c.fields.payee]:null,b=c.fields.date?!!c.fields.date.frequency:!1;return s.jsxs(_e,{title:y?`Schedule: ${y.name}`:"Schedule",size:"medium",...e,children:[s.jsx(Pe,{direction:"row",style:{marginTop:10},children:s.jsxs(_o,{style:{flex:1},children:[s.jsx(eo,{title:"Schedule Name",htmlFor:"name-field"}),s.jsx(Cp,{field:"string",type:"string",value:c.fields.name,multi:!1,onChange:w=>{f({type:"set-field",field:"name",value:w})}})]})}),s.jsxs(Pe,{direction:"row",style:{marginTop:20},children:[s.jsxs(_o,{style:{flex:1},children:[s.jsx(eo,{title:"Payee",id:"payee-label",htmlFor:"payee-field"}),s.jsx(_w,{value:c.fields.payee,labelProps:{id:"payee-label"},inputProps:{id:"payee-field",placeholder:"(none)"},onSelect:w=>f({type:"set-field",field:"payee",value:w})})]}),s.jsxs(_o,{style:{flex:1},children:[s.jsx(eo,{title:"Account",id:"account-label",htmlFor:"account-field"}),s.jsx(um,{includeClosedAccounts:!1,value:c.fields.account,labelProps:{id:"account-label"},inputProps:{id:"account-field",placeholder:"(none)"},onSelect:w=>f({type:"set-field",field:"account",value:w})})]}),s.jsxs(_o,{style:{flex:1},children:[s.jsxs(Pe,{direction:"row",align:"center",style:{marginBottom:3},children:[s.jsx(eo,{title:"Amount",htmlFor:"amount-field",style:{margin:0,flex:1}}),s.jsx(f3,{ops:["isapprox","is","isbetween"],value:c.fields.amountOp,formatOp:w=>{switch(w){case"is":return"is exactly";case"isapprox":return"is approximately";case"isbetween":return"is between";default:throw new Error("Invalid op for select: "+w)}},style:{padding:"0 10px",color:S.pageTextLight,fontSize:12},onChange:(w,E)=>f({type:"set-field",field:"amountOp",value:E})})]}),c.fields.amountOp==="isbetween"?s.jsx($P,{defaultValue:c.fields.amount,onChange:w=>f({type:"set-field",field:"amount",value:w})}):s.jsx(vp,{id:"amount-field",value:c.fields.amount,onUpdate:w=>f({type:"set-field",field:"amount",value:w})})]})]}),s.jsx(I,{style:{marginTop:20},children:s.jsx(eo,{title:"Date"})}),s.jsxs(Pe,{direction:"row",align:"flex-start",justify:"space-between",children:[s.jsxs(I,{style:{width:"13.44rem"},children:[b?s.jsx(c3,{value:c.fields.date,onChange:w=>f({type:"set-field",field:"date",value:w})}):s.jsx(qc,{value:c.fields.date,onSelect:w=>f({type:"set-field",field:"date",value:w}),dateFormat:u}),c.upcomingDates&&s.jsxs(I,{style:{fontSize:13,marginTop:20},children:[s.jsx(z,{style:{color:S.pageTextLight,fontWeight:600},children:"Upcoming dates"}),s.jsx(Pe,{direction:"column",spacing:1,style:{marginTop:10,color:S.pageTextLight},children:c.upcomingDates.map(w=>s.jsx(I,{children:An(w,`${u} EEEE`)},w))})]})]}),s.jsxs(I,{style:{marginTop:5,flexDirection:"row",alignItems:"center",userSelect:"none"},children:[s.jsx(Bo,{id:"form_repeats",checked:b,onChange:w=>{f({type:"set-repeats",repeats:w.target.checked})}}),s.jsx("label",{htmlFor:"form_repeats",style:{userSelect:"none"},children:"Repeats"})]}),s.jsxs(Pe,{align:"flex-end",children:[s.jsxs(I,{style:{marginTop:5,flexDirection:"row",alignItems:"center",userSelect:"none",justifyContent:"flex-end"},children:[s.jsx(Bo,{id:"form_posts_transaction",checked:c.fields.posts_transaction,onChange:w=>{f({type:"set-field",field:"posts_transaction",value:w.target.checked})}}),s.jsx("label",{htmlFor:"form_posts_transaction",style:{userSelect:"none"},children:"Automatically add transaction"})]}),s.jsx(z,{style:{width:350,textAlign:"right",color:S.pageTextLight,marginTop:10,fontSize:13,lineHeight:"1.4em"},children:"If checked, the schedule will automatically create transactions for you in the specified account"}),!o&&c.schedule.rule&&s.jsxs(Pe,{direction:"row",align:"center",style:{marginTop:20},children:[c.isCustom&&s.jsx(z,{style:{color:S.pageTextLight,fontSize:13,textAlign:"right",width:350},children:"This schedule has custom conditions and actions"}),s.jsx(q,{onClick:()=>m(),disabled:o,children:"Edit as rule"})]})]})]}),s.jsx(I,{style:{marginTop:30,flex:1},children:s.jsxs(Ql,{instance:h,children:[o?s.jsxs(I,{style:{flexDirection:"row",padding:"5px 0"},children:[s.jsx(z,{style:{color:S.pageTextLight},children:"These transactions match this schedule:"}),s.jsx(I,{style:{flex:1}}),s.jsx(z,{style:{color:S.pageTextLight},children:"Select transactions to link on save"})]}):s.jsxs(I,{style:{flexDirection:"row",alignItems:"center"},children:[s.jsx(q,{type:"bare",style:{color:c.transactionsMode==="linked"?S.pageTextLink:S.pageTextSubdued,marginRight:10,fontSize:14},onClick:()=>v("linked"),children:"Linked transactions"})," ",s.jsx(q,{type:"bare",style:{color:c.transactionsMode==="matched"?S.pageTextLink:S.pageTextSubdued,fontSize:14},onClick:()=>v("matched"),children:"Find matching transactions"}),s.jsx(I,{style:{flex:1}}),s.jsx(Ale,{name:"transactions",items:c.transactionsMode==="linked"?[{name:"unlink",text:"Unlink from schedule"}]:[{name:"link",text:"Link to schedule"}],onSelect:(w,E)=>{switch(w){case"link":x(E);break;case"unlink":k(E);break}}})]}),s.jsx(s3,{renderEmpty:s.jsx(Mxe,{error:c.error,transactionsMode:c.transactionsMode}),transactions:c.transactions,fields:["date","payee","amount"],style:{border:"1px solid "+S.tableBorder,borderRadius:4,overflow:"hidden",marginTop:5,maxHeight:200}})]})}),s.jsxs(Pe,{direction:"row",justify:"flex-end",align:"center",style:{marginTop:20},children:[c.error&&s.jsx(z,{style:{color:S.errorText},children:c.error}),s.jsx(q,{style:{marginRight:10},onClick:t.popModal,children:"Cancel"}),s.jsx(q,{type:"primary",onClick:p,children:o?"Add":"Save"})]})]})}function Mxe(e){return s.jsx(I,{style:{padding:20,color:S.pageTextLight,textAlign:"center"},children:e.error?s.jsxs(z,{style:{color:S.errorText},children:["Could not search: ",e.error]}):e.transactionsMode==="matched"?"No matching transactions":"No linked transactions"})}function Rxe({modalProps:e,actions:t,transactionIds:n,getTransaction:r,pushModal:o}){const[i,a]=g.useState(""),l=Ow({transform:g.useCallback(p=>p.filter({completed:!1}),[])}),u=g.useRef(null);if(l==null)return null;const{schedules:c,statuses:f}=l;async function d(p){n?.length>0&&await Y("transactions-batch-update",{updated:n.map(m=>({id:m,schedule:p}))}),t.popModal()}async function h(){t.popModal(),o("schedule-edit",{id:null,transaction:r(n[0])})}return s.jsxs(_e,{title:"Link Schedule",size:{width:600},...e,children:[s.jsxs(I,{style:{flexDirection:"row",gap:4,marginBottom:20,alignItems:"center"},children:[s.jsxs(z,{children:["Choose the schedule"," ",n?.length>1?`these ${n.length} transactions belong`:"this transaction belongs"," ","to:"]}),s.jsx(rw,{inputRef:u,isInModal:!0,width:300,placeholder:"Filter schedules…",value:i,onChange:a}),n.length===1&&s.jsxs(q,{type:"primary",style:{marginLeft:15,padding:"4px 10px"},onClick:h,children:[s.jsx(ab,{style:{width:"20",padding:"3"}}),"Create New"]})]}),s.jsx(I,{style:{flex:`1 1 ${(Pu-1)*(Math.max(c.length,1)+1)}px`,marginTop:15,maxHeight:"50vh"},children:s.jsx(Dxe,{allowCompleted:!1,filter:i,minimal:!0,onAction:()=>{},onSelect:d,schedules:c,statuses:f,style:null,tableStyle:{marginInline:-20}})})]})}function Bxe(){const e=Te(a=>a.modals.modalStack),t=Te(a=>a.modals.isHidden),n=Ht(),r=an();g.useEffect(()=>{e.length>0&&n.closeModal()},[r]);const o=dw(),i=e.map(({name:a,options:l},u)=>{const c={onClose:n.popModal,onBack:n.popModal,showBack:u>0,isCurrent:u===e.length-1,isHidden:t,stackIndex:u};switch(a){case"import-transactions":return s.jsx(Kve,{modalProps:c,options:l});case"add-account":return s.jsx(Bye,{modalProps:c,syncServerStatus:o,upgradingAccountId:l?.upgradingAccountId});case"add-local-account":return s.jsx(Lye,{modalProps:c,actions:n});case"close-account":return s.jsx(Dye,{modalProps:c,account:l.account,balance:l.balance,canDelete:l.canDelete,actions:n});case"select-linked-accounts":return s.jsx(kxe,{modalProps:c,externalAccounts:l.accounts,requisitionId:l.requisitionId,actions:n,syncSource:l.syncSource});case"confirm-category-delete":return s.jsx(_ye,{modalProps:c,category:l.category,group:l.group,onDelete:l.onDelete});case"confirm-unlink-account":return s.jsx(Aye,{modalProps:c,accountName:l.accountName,onUnlink:l.onUnlink});case"confirm-transaction-edit":return s.jsx(Oye,{modalProps:c,onConfirm:l.onConfirm,confirmReason:l.confirmReason});case"load-backup":return s.jsx(S3,{watchUpdates:!0,budgetId:l.budgetId,modalProps:c,actions:n,backupDisabled:!1});case"manage-rules":return s.jsx(Xve,{modalProps:c,payeeId:l?.payeeId});case"edit-rule":return s.jsx(Pve,{modalProps:c,defaultRule:l.rule,onSave:l.onSave});case"merge-unused-payees":return s.jsx(Zve,{modalProps:c,payeeIds:l.payeeIds,targetPayeeId:l.targetPayeeId});case"plaid-external-msg":return s.jsx(txe,{modalProps:c,onMoveExternal:l.onMoveExternal,onClose:()=>{l.onClose?.(),Y("poll-web-token-stop")},onSuccess:l.onSuccess});case"gocardless-init":return s.jsx(Fve,{modalProps:c,onSuccess:l.onSuccess});case"simplefin-init":return s.jsx(Cxe,{modalProps:c,onSuccess:l.onSuccess});case"gocardless-external-msg":return s.jsx($ve,{modalProps:c,onMoveExternal:l.onMoveExternal,onClose:()=>{l.onClose?.(),Y("gocardless-poll-web-token-stop")},onSuccess:l.onSuccess});case"create-encryption-key":return s.jsx(SM,{modalProps:c,actions:n,options:l},a);case"fix-encryption-key":return s.jsx(y3,{modalProps:c,actions:n,options:l},a);case"edit-field":return s.jsx(Gye,{modalProps:c,name:l.name,onSubmit:l.onSubmit,onClose:l.onClose},a);case"new-category":return s.jsx(M2,{modalProps:c,title:"New Category",inputPlaceholder:"Category name",buttonText:"Add",onValidate:l.onValidate,onSubmit:l.onSubmit});case"new-category-group":return s.jsx(M2,{modalProps:c,title:"New Category Group",inputPlaceholder:"Category group name",buttonText:"Add",onValidate:l.onValidate,onSubmit:l.onSubmit});case"rollover-budget-summary":return s.jsx(Sxe,{modalProps:c,month:l.month,onBudgetAction:l.onBudgetAction},a);case"report-budget-summary":return s.jsx(vxe,{modalProps:c,month:l.month},a);case"schedule-edit":return s.jsx(Pxe,{modalProps:c,id:l?.id||null,actions:n,transaction:l?.transaction||null},a);case"schedule-link":return s.jsx(Rxe,{modalProps:c,actions:n,transactionIds:l?.transactionIds,getTransaction:l?.getTransaction,pushModal:l?.pushModal},a);case"schedules-discover":return s.jsx(Oxe,{modalProps:c,actions:n},a);case"schedule-posts-offline-notification":return s.jsx(Axe,{modalProps:c,actions:n},a);case"switch-budget-type":return s.jsx(Exe,{modalProps:c,onSwitch:l?.onSwitch},a);case"category-menu":return s.jsx(Ame,{modalProps:c,categoryId:l.categoryId,onSave:l.onSave,onEditNotes:l.onEditNotes,onDelete:l.onDelete,onClose:l.onClose},a);case"category-group-menu":return s.jsx(_me,{modalProps:c,groupId:l.groupId,onSave:l.onSave,onAddCategory:l.onAddCategory,onEditNotes:l.onEditNotes,onSaveNotes:l.onSaveNotes,onDelete:l.onDelete,onClose:l.onClose},a);case"notes":return s.jsx(Jve,{modalProps:c,id:l.id,name:l.name,onSave:l.onSave},a);default:return console.error("Unknown modal:",a),null}}).map((a,l)=>s.jsx($t.Fragment,{children:a},e[l].name));return s.jsx(s.Fragment,{children:i})}function Lxe(e,t,n,r){return s.jsx(Pe,{spacing:2,children:e.split(/\n\n/).map((o,i)=>{const a=o.split(/(\[[^\]]*\]\([^)]*\))/g);return s.jsx(z,{style:{lineHeight:"1.4em"},children:a.map((l,u)=>{const c=l.match(/\[([^\]]*)\]\(([^)]*)\)/);if(c){const[f,d,h]=c;if(h[0]==="#"){const p=h.slice(1);return s.jsx(Ro,{onClick:async m=>{m.preventDefault(),t[p]&&(n(!0),await t[p](),r())},children:d},u)}return s.jsx(Ve,{linkColor:"purple",to:c[2],children:c[1]},u)}return s.jsx(z,{children:l},u)})},i)})})}function Nxe({notification:e,onRemove:t}){const{type:n,title:r,message:o,pre:i,messageActions:a,sticky:l,internal:u,button:c}=e,[f,d]=g.useState(!1),[h,p]=g.useState(!1);g.useEffect(()=>{n==="error"&&u&&console.error("Internal error:",u),l||setTimeout(t,6500)},[]);const m=n==="message",x=n==="error",k=g.useMemo(()=>Lxe(o,a,p,t),[o,a]);return s.jsxs(I,{style:{marginTop:10,color:m?S.noticeText:x?S.errorTextDark:S.warningTextDark},children:[s.jsxs(Pe,{align:"center",direction:"row",style:{padding:"14px 14px",fontSize:14,backgroundColor:m?S.noticeBackgroundLight:x?S.errorBackground:S.warningBackground,borderTop:`3px solid ${m?S.noticeBorder:x?S.errorBorder:S.warningBorder}`,...X.shadowLarge,maxWidth:550,"& a":{color:"currentColor"}},children:[s.jsxs(Pe,{align:"flex-start",children:[r&&s.jsx(I,{style:{fontWeight:700,marginBottom:10},children:r}),s.jsx(I,{children:k}),i?i.split(`
|
|
203
|
+
|
|
204
|
+
`).map((v,y)=>s.jsx(I,{style:{whiteSpace:"pre-wrap",fontFamily:"monospace",fontSize:12,backgroundColor:"rgba(0, 0, 0, .05)",padding:10,borderRadius:4},children:v},y)):null,c&&s.jsx(mt,{type:"bare",loading:f,onClick:async()=>{d(!0),await c.action(),t(),d(!1)},style:{backgroundColor:"transparent",border:`1px solid ${m?S.noticeBorder:x?S.errorBorder:S.warningBorder}`,color:"currentColor",fontSize:14,flexShrink:0,"&:hover, &:active":{backgroundColor:m?S.noticeBackground:x?S.errorBackground:S.warningBackground}},children:c.title})]}),l&&s.jsx(q,{type:"bare","aria-label":"Close",style:{flexShrink:0,color:"currentColor"},onClick:t,children:s.jsx(Ed,{style:{width:9,height:9,color:"currentColor"}})})]}),h&&s.jsx(I,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:S.tableBackground,alignItems:"center",justifyContent:"center"},children:s.jsx(vi,{style:{width:20,height:20,color:"currentColor"}})})]})}function D3({style:e}){const{removeNotification:t}=Ht(),n=Te(r=>r.notifications.notifications);return s.jsx(I,{style:{position:"fixed",bottom:20,right:13,zIndex:1e4,...e},children:n.map(r=>s.jsx(Nxe,{notification:r,onRemove:()=>{r.onClose&&r.onClose(),t(r.id)}},r.id))})}function $xe(e){const t=g.useRef(),n=g.useCallback((...r)=>t.current&&t.current(...r),[]);return g.useLayoutEffect(()=>{t.current=e}),n}function Fxe({payeesById:e,selectedPayees:t,onDelete:n,onMerge:r,onClose:o}){const i=[...t].some(a=>e[a]==null||e[a].transfer_acct);return s.jsx(Et,{position:"bottom",width:250,style:{padding:0},onClose:o,children:s.jsx(wt,{onMenuSelect:a=>{switch(o(),a){case"delete":n();break;case"merge":r();break}},footer:s.jsx(I,{style:{padding:3,fontSize:11,fontStyle:"italic",color:S.pageTextSubdued},children:[...t].slice(0,4).map(a=>e[a].name).join(", ")+(t.size>4?", and more":"")}),items:[{icon:Ed,name:"delete",text:"Delete",disabled:i},{icon:$J,iconSize:9,name:"merge",text:"Merge",disabled:i||t.size<2},wt.line]})})}function Hxe({ruleCount:e,focused:t,onEdit:n,onClick:r}){return s.jsx(Bn,{name:"rule-count",width:"auto",focused:t,style:{padding:"0 10px"},plain:!0,children:s.jsxs(Fg,{style:{borderRadius:4,padding:"3px 6px",backgroundColor:S.noticeBackground,border:"1px solid "+S.noticeBackground,color:S.noticeTextDark,fontSize:12},onEdit:n,onSelect:r,children:[s.jsx(z,{style:{paddingRight:5},children:e>0?s.jsxs(s.Fragment,{children:[e," associated ",e===1?"rule":"rules"]}):s.jsx(s.Fragment,{children:"Create rule"})}),s.jsx(Roe,{style:{width:8,height:8}})]})})}const _3=g.memo(({payee:e,ruleCount:t,selected:n,hovered:r,editing:o,focusedField:i,onViewRules:a,onCreateRule:l,onHover:u,onEdit:c,onUpdate:f,style:d})=>{const{id:h}=e,p=bs(),m=n?S.tableBorderSelected:S.tableBorder,x=r||i==="select";return s.jsxs($o,{style:{alignItems:"stretch",...d,borderColor:m,backgroundColor:r?S.tableRowBackgroundHover:n?S.tableRowBackgroundHighlight:x?S.tableRowBackgroundHover:S.tableBackground,...n&&{backgroundColor:S.tableRowBackgroundHighlight,zIndex:100}},"data-focus-key":e.id,onMouseEnter:()=>u&&u(e.id),children:[s.jsx(da,{exposed:e.transfer_acct==null&&(r||n||o),focused:i==="select",selected:n,onSelect:k=>{p({type:"select",id:e.id,event:k})}}),s.jsx(Ole,{value:(e.transfer_acct?"Transfer: ":"")+e.name,valueStyle:!n&&e.transfer_acct&&{color:S.pageTextSubdued}||!n&&!e.transfer_acct&&{color:S.tableText}||n&&{color:S.tableTextSelected},exposed:i==="name",width:"flex",onUpdate:k=>!e.transfer_acct&&f(h,"name",k),onExpose:()=>c(h,"name"),inputProps:{readOnly:!!e.transfer_acct}}),s.jsx(Hxe,{ruleCount:t,focused:i==="rule-count",onEdit:()=>c(h,"rule-count"),onClick:()=>t>0?a(e.id):l(e.id)})]})});_3.displayName="PayeeTableRow";const O3=g.forwardRef(({payees:e,ruleCounts:t,navigator:n,onUpdate:r,onViewRules:o,onCreateRule:i},a)=>{const[l,u]=g.useState(null),c=Kl();g.useLayoutEffect(()=>{const d=[...c][0];typeof a!="function"&&a.current.scrollTo(d,"center"),n.onEdit(d,"select")},[]);const f=g.useCallback(d=>{u(d)},[]);return s.jsx(I,{style:{flex:1},onMouseLeave:()=>u(null),children:s.jsx(Ss,{ref:a,items:e,navigator:n,renderItem:({item:d,editing:h,focusedField:p,onEdit:m})=>s.jsx(_3,{payee:d,ruleCount:t.get(d.id)||0,selected:c.has(d.id),editing:h,focusedField:p,hovered:l===d.id,onHover:f,onEdit:m,onUpdate:r,onViewRules:o,onCreateRule:i})})})});O3.displayName="PayeeTable";const zxe=Mn(e=>Ec(e));function Uxe(e,t,n){return e===1?t:n}function Wxe(){const e=S.tableborder,t=bs(),n=Kl();return s.jsx(I,{children:s.jsxs(ws,{style:{borderColor:e,backgroundColor:S.tableBackground,color:S.pageTextLight,zIndex:200,userSelect:"none"},collapsed:!0,children:[s.jsx(da,{exposed:!0,focused:!1,selected:n.size>0,onSelect:r=>t({type:"select-all",event:r})}),s.jsx(Bn,{value:"Name",width:"flex"})]})})}function Vxe({text:e,style:t}){return s.jsx(I,{style:{textAlign:"center",color:S.pageTextSubdued,fontStyle:"italic",fontSize:13,marginTop:5,style:t},children:e})}const A3=g.forwardRef(({payees:e,ruleCounts:t,orphanedPayees:n,categoryGroups:r,initialSelectedIds:o,ruleActions:i,onBatchChange:a,onViewRules:l,onCreateRule:u,...c},f)=>{const[d,h]=g.useState(null),[p,m]=g.useState(""),x=g.useRef(null),k=g.useRef(null),v=g.useRef(!1),[y,b]=g.useState(!1),w=g.useMemo(()=>{let P=e;return p&&(P=P.filter(j=>j.name.toLowerCase().includes(p.toLowerCase()))),y&&(P=P.filter(j=>n.map(D=>D.id).includes(j.id))),P},[e,p,y]),E=Gl("payees",w,o);function T(P){p!==P&&(x.current?.setRowAnimation(!1),m(P),v.current=!0)}function _(P){T(""),k.current=P}g.useEffect(()=>{v.current&&(setTimeout(()=>{x.current?.setRowAnimation(!0)},0),v.current=!1)}),g.useImperativeHandle(f,()=>({selectRows:(P,j)=>{F.onEdit(null),E.dispatch({type:"select-all",ids:P}),h(null),j&&P.length>0&&_(P[0])},highlightRow:P=>{F.onEdit(null),h(new Set([P])),_(P)}})),g.useEffect(()=>{d&&h(null)},[d]),g.useLayoutEffect(()=>{k.current&&(x.current.scrollTo(k.current),k.current=null)});const M=$xe((P,j,D)=>{e.find($=>$.id===P)[j]!==D&&a({updated:[{id:P,[j]:D}]})}),B=g.useCallback(()=>w.filter(P=>P.transfer_acct==null).map(P=>P.id),[w]);function O(){a({deleted:[...E.items].map(P=>({id:P}))}),E.dispatch({type:"select-none"})}async function N(){const P=[...E.items];await c.onMerge(P),F.onEdit(P[0],"name"),E.dispatch({type:"select-none"}),_(P[0])}const H=E.items.size===0,F=xP(w,P=>["select","name","rule-count"].filter(j=>{switch(j){case"select":return P.transfer_acct==null;default:return!0}})),L=zxe(e),[R,U]=g.useState(!1);return s.jsxs(I,{style:{height:"100%"},children:[s.jsxs(I,{style:{flexDirection:"row",alignItems:"center",padding:"0 0 15px"},children:[s.jsxs(I,{style:{flexShrink:0},children:[s.jsxs(q,{type:"bare",style:{marginRight:10},disabled:H,onClick:()=>U(!0),children:[H?"No payees selected":E.items.size+" "+Uxe(E.items.size,"payee","payees"),s.jsx(xg,{width:8,height:8,style:{marginLeft:5}})]}),R&&s.jsx(Fxe,{payeesById:L,selectedPayees:E.items,onClose:()=>U(!1),onDelete:O,onMerge:N})]}),s.jsx(I,{style:{flexShrink:0},children:(y||n&&n.length>0)&&s.jsx(q,{type:"bare",style:{marginRight:10},onClick:()=>{b(!y),T(p),F.onEdit(null)},children:y?"Show all payees":`Show ${n.length===1?"1 unused payee":`${n.length} unused payees`}`})}),s.jsx(I,{style:{flex:1}}),s.jsx(rw,{id:"filter-input",placeholder:"Filter payees...",value:p,onChange:T})]}),s.jsx(Ql,{instance:E,fetchAllIds:B,children:s.jsxs(I,{style:{flex:1,border:"1px solid "+S.tableBorder,borderTopLeftRadius:4,borderTopRightRadius:4,overflow:"hidden"},children:[s.jsx(Wxe,{}),w.length===0?s.jsx(Vxe,{text:"No payees",style:{marginTop:15}}):s.jsx(O3,{ref:x,payees:w,ruleCounts:t,categoryGroups:r,navigator:F,onUpdate:M,onViewRules:l,onCreateRule:u})]})})]})});A3.displayName="ManagePayees";function Yxe({initialSelectedIds:e}){const t=Hr(),n=Te(w=>w.app.lastUndoState),{grouped:r}=Fr(),{initiallyLoadPayees:o,getPayees:i,setLastUndoState:a,pushModal:l}=Ht(),[u,c]=g.useState(t),[f,d]=g.useState({value:new Map}),[h,p]=g.useState({value:new Map}),m=g.useRef();async function x(){const w=await Y("payees-get-orphaned");p(w)}async function k(){let w=await Y("payees-get-rule-counts");w=new Map(Object.entries(w)),d({value:w})}g.useEffect(()=>{async function w(){const T=await o();await new Promise(_=>setTimeout(_,100)),T&&c(T),k(),x()}w();const E=Rt("sync-event",async({type:T,tables:_})=>{T==="applied"&&_.includes("rules")&&k()});return()=>{E()}},[]);async function v({tables:w,messages:E,meta:T}){!w.includes("payees")&&!w.includes("payee_mapping")||(c(await i()),x(),(T&&T.targetId||E.find(_=>_.dataset==="rules"))&&k(),a(null))}g.useEffect(()=>(n.current&&v(n.current),Rt("undo-event",v)),[]);function y(w){l("manage-rules",{payeeId:w})}function b(w){l("edit-rule",{rule:{stage:null,conditionsOp:"and",conditions:[{field:"payee",op:"is",value:w,type:"id"}],actions:[{op:"set",field:"category",value:null,type:"id"}]}})}return s.jsx(A3,{ref:m,payees:u,ruleCounts:f.value,orphanedPayees:h,categoryGroups:r,initialSelectedIds:e,lastUndoState:n,onBatchChange:w=>{Y("payees-batch-change",w),c(F0(w,u)),p(F0(w,h))},onMerge:async([w,...E])=>{await Y("payees-merge",{targetId:w,mergeIds:E});const T=h.map(O=>O.id).includes(w),_=E.filter(O=>h.map(N=>N.id).includes(O));let M=h;T&&_.length!==E.length&&(M=M.filter(O=>O.id!==w)),M=M.filter(O=>!E.includes(O.id));const B=u.filter(O=>!E.includes(O.id));E.forEach(O=>{const N=f.value.get(O)||0;f.value.set(w,(f.value.get(w)||0)+N)}),c(B),p(M),d({value:f.value})},onViewRules:y,onCreateRule:b})}function qxe(){const e=an();return s.jsx(zg,{title:"Payees",children:s.jsx(Yxe,{initialSelectedIds:e.state&&e.state.selectedPayee?[e.state.selectedPayee]:null})})}function Gxe(){return s.jsx(I,{style:{flex:1},"data-testid":"reports-page",children:s.jsx(yg,{name:"ReportRouter",message:"Loading reports...",importer:()=>Dl(()=>import("./ReportRouter.mLx3JUh2.chunk.js"),__vite__mapDeps([0,1,2,3]))})})}const Kxe=()=>Dl(()=>import("./narrow.vxy14QoE.chunk.js"),__vite__mapDeps([4,5,3,2])),P3=()=>Dl(()=>import("./wide.GDttRuTJ.chunk.js"),__vite__mapDeps([6,5,1,2]));function B2({name:e}){return s.jsx(yg,{name:e,importer:P3})}function Hy({name:e}){const{isNarrowWidth:t}=zt();return s.jsx(yg,{name:e,importer:t?Kxe:P3})}function Qxe(){const[e,t]=g.useState(!1),n=M3();return g.useEffect(()=>{(async()=>t(await GO(n)))()},[n]),e}function M3(){const[e,t]=g.useState("");return g.useEffect(()=>{(async()=>t(await qO()))()},[]),e}const ur=({primaryAction:e,style:t,children:n})=>s.jsxs(I,{className:`${ze([{backgroundColor:S.pillBackground,alignSelf:"flex-start",alignItems:"flex-start",padding:15,borderRadius:4,border:"1px solid "+S.pillBorderDark,width:"100%"},t])}`,children:[s.jsx(I,{style:{marginBottom:e?10:0,lineHeight:1.5,gap:10},children:n}),e||null]}),Xxe=({children:e})=>{const t=an(),[n,r]=g.useState(t.hash==="#advanced");return n?s.jsxs(I,{id:"advanced",style:{gap:20,alignItems:"flex-start",marginBottom:25,width:"100%"},className:`${$D(`(min-width: ${fr.breakpoint_small})`,{width:"auto"})}`,innerRef:o=>{o&&t.hash==="#advanced"&&o.scrollIntoView(!0)},children:[s.jsx(I,{style:{fontSize:20,fontWeight:500,flexShrink:0},children:"Advanced Settings"}),e]}):s.jsx(q,{id:"advanced",type:"link",onClick:()=>r(!0),style:{flexShrink:0,alignSelf:"flex-start",color:S.pageTextPositive,marginBottom:25},children:"Show advanced settings"})};function Zxe(){const{pushModal:e}=Ht(),t=Zl(),[n]=dt("encryptKeyId"),r=!(window.crypto&&crypto.subtle);function o(){e("create-encryption-key",{recreate:!0})}return n?s.jsx(ur,{primaryAction:s.jsx(q,{onClick:o,children:"Generate new key"}),children:s.jsxs(z,{children:[s.jsx(z,{style:{color:S.noticeTextLight,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."," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",linkColor:"purple",children:"Learn more…"})]})}):r?s.jsx(ur,{primaryAction:s.jsx(q,{disabled:!0,children:"Enable encryption…"}),children:s.jsxs(z,{children:[s.jsx("strong",{children:"End-to-end encryption"})," is not available when making an unencrypted connection to a remote server. You’ll 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."," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/config/https",linkColor:"purple",children:"Learn more…"})]})}):t?s.jsx(ur,{primaryAction:s.jsx(q,{onClick:()=>e("create-encryption-key"),children:"Enable encryption…"}),children:s.jsxs(z,{children:[s.jsx("strong",{children:"End-to-end encryption"})," is not enabled. Any data on the server is still protected by the server password, but it’s 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."," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",linkColor:"purple",children:"Learn more…"})]})}):s.jsx(ur,{primaryAction:s.jsx(q,{disabled:!0,children:"Enable encryption…"}),children:s.jsxs(z,{children:[s.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."," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/getting-started/sync/#end-to-end-encryption",linkColor:"purple",children:"Learn more…"})]})})}function Mu({flag:e,disableToggle:t=!1,error:n,children:r}){const o=Kd(e),[i,a]=dt(`flags.${e}`);return s.jsxs("label",{style:{display:"flex"},children:[s.jsx(Bo,{checked:o,onChange:()=>{a(!o)},disabled:t}),s.jsxs(I,{style:{color:t?S.pageTextSubdued:"inherit"},children:[r,t&&s.jsx(z,{style:{color:S.errorText,fontWeight:500},children:n})]})]})}function Jxe(){const[e]=dt("budgetType"),t=Kd("reportBudget"),n=e==="report"&&t;return s.jsx(Mu,{flag:"reportBudget",disableToggle:n,error:"Switch to a rollover budget before turning off this feature",children:"Budget mode toggle"})}function e1e(){const[e,t]=g.useState(!1);return s.jsx(ur,{primaryAction:e?s.jsxs(I,{style:{gap:"1em"},children:[s.jsx(Mu,{flag:"customReports",children:"Custom reports"}),s.jsx(Jxe,{}),s.jsx(Mu,{flag:"goalTemplatesEnabled",children:"Goal templates"}),s.jsx(Mu,{flag:"simpleFinSync",children:"SimpleFIN sync"}),s.jsx(Mu,{flag:"splitsInRules",children:"Splits in rules"})]}):s.jsx(Ro,{onClick:()=>t(!0),style:{flexShrink:0,alignSelf:"flex-start",color:S.pageTextPositive},children:"I understand the risks, show experimental features"}),children:s.jsxs(z,{children:[s.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 t1e(){const[e,t]=g.useState(!1),[n,r]=g.useState(null),[o]=dt("id"),[i]=dt("encryptKeyId");async function a(){t(!0),r(null);const l=await Y("export-budget");if("error"in l){r(l.error),t(!1),console.log("Export error code:",l.error);return}window.Actual?.saveFile(l.data,`${ke(new Date,"yyyy-MM-dd")}-${o}.zip`,"Export budget"),t(!1)}return s.jsxs(ur,{primaryAction:s.jsxs(s.Fragment,{children:[s.jsx(mt,{onClick:a,loading:e,children:"Export data"}),n&&s.jsx(We,{style:{color:S.errorText,marginTop:15},children:"An unknown error occurred while exporting. Please report this as a new issue on Github."})]}),children:[s.jsxs(z,{children:[s.jsx("strong",{children:"Export"})," your data as a zip file containing"," ",s.jsx("code",{children:"db.sqlite"})," and ",s.jsx("code",{children:"metadata.json"})," files. It can be imported into another Actual instance by closing an open file (if any), then clicking the “Import file” button, then choosing “Actual.”"]}),i?s.jsx(z,{children:"Even though encryption is enabled, the exported zip file will not have any encryption."}):null]})}function n1e(e){const{numBlankPayees:t,numCleared:n,numDeleted:r}=e;let o="";return t===0&&n===0&&r===0?o="No split transactions found needing repair.":(t>0&&(o+=`Fixed ${t} splits with a blank payee.`),n>0&&(o!==""&&(o+=`
|
|
205
|
+
`),o+=`Fixed ${n} splits with the wrong cleared flag.`),r>0&&(o!==""&&(o+=`
|
|
206
|
+
`),o+=`Fixed ${r} splits that weren’t properly deleted.`)),s.jsx(be,{style:{color:S.noticeTextLight,marginBottom:0,marginLeft:"1em",textAlign:"right",whiteSpace:"pre-wrap"},children:o})}function r1e(){const[e,t]=g.useState(!1),[n,r]=g.useState(null);async function o(){t(!0);const i=await Y("tools/fix-split-transactions");r(i),t(!1)}return s.jsxs(ur,{primaryAction:s.jsxs(I,{style:{flexDirection:"row",justifyContent:"space-between",maxWidth:500,width:"100%",alignItems:"center"},children:[s.jsx(mt,{loading:e,onClick:o,children:"Repair split transactions"}),n&&n1e(n)]}),children:[s.jsxs(z,{children:[s.jsx("strong",{children:"Repair split transactions"})," if you are experiencing bugs relating to split transactions and the “Reset budget cache” button above does not help, this tool may fix them. Some examples of bugs include seeing blank payees on splits or incorrect account balances. This tool does two things:"]}),s.jsxs("ul",{style:{margin:0,paddingLeft:"1.5em"},children:[s.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."}),s.jsx("li",{children:"Sync the payee and cleared flag of a split transaction to the main or “parent” transaction, if appropriate. The payee will only be set if it currently doesn’t have one."})]})]})}const R3=g.createContext(null);function o1e({children:e}){const[t]=fs("floatingSidebar"),[n,r]=g.useState(!0),{width:o}=zt(),i=o<668,a=t||i;return s.jsx(R3.Provider,{value:{hidden:n,setHidden:r,floating:a,alwaysFloats:i},children:e})}function cm(){const{hidden:e,setHidden:t,floating:n,alwaysFloats:r}=g.useContext(R3);return g.useMemo(()=>({hidden:e,setHidden:t,floating:n,alwaysFloats:r}),[e,t,n,r])}const i1e=[{value:"0",label:"Sunday"},{value:"1",label:"Monday"},{value:"2",label:"Tuesday"},{value:"3",label:"Wednesday"},{value:"4",label:"Thursday"},{value:"5",label:"Friday"},{value:"6",label:"Saturday"}],a1e=[{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 zy({title:e,children:t}){return s.jsxs(I,{style:{alignItems:"flex-start",flexGrow:1,gap:"0.5em",width:"100%"},children:[s.jsx(z,{style:{fontWeight:500},children:e}),s.jsx(I,{style:{alignItems:"flex-start",gap:"1em"},children:t})]})}function s1e(){const e=cm(),[t,n]=dt("firstDayOfWeekIdx"),r=t||"0",o=nr()||"MM/dd/yyyy",[,i]=dt("dateFormat"),[a,l]=dt("numberFormat"),u=a||"comma-dot",[c=!1,f]=dt("hideFraction");return s.jsx(ur,{primaryAction:s.jsxs(I,{style:{flexDirection:"column",gap:"1em",width:"100%",[`@media (min-width: ${e.floating?fr.breakpoint_small:fr.breakpoint_medium})`]:{flexDirection:"row"}},children:[s.jsxs(zy,{title:"Numbers",children:[s.jsx(q,{bounce:!1,style:{padding:0},children:s.jsx(Rn,{bare:!0,value:u,onChange:d=>l(d),options:UN.map(d=>[d.value,c?d.labelNoFraction:d.label]),style:{padding:"2px 10px",fontSize:15}},String(c))}),s.jsxs(z,{style:{display:"flex"},children:[s.jsx(Bo,{id:"settings-textDecimal",checked:!!c,onChange:d=>f(d.currentTarget.checked)}),s.jsx("label",{htmlFor:"settings-textDecimal",children:"Hide decimal places"})]})]}),s.jsx(zy,{title:"Dates",children:s.jsx(q,{bounce:!1,style:{padding:0},children:s.jsx(Rn,{bare:!0,value:o,onChange:d=>i(d),options:a1e.map(d=>[d.value,d.label]),style:{padding:"2px 10px",fontSize:15}})})}),s.jsx(zy,{title:"First day of the week",children:s.jsx(q,{bounce:!1,style:{padding:0},children:s.jsx(Rn,{bare:!0,value:r,onChange:d=>n(d),options:i1e.map(d=>[d.value,d.label]),style:{padding:"2px 10px",fontSize:15}})})})]}),children:s.jsxs(z,{children:[s.jsx("strong",{children:"Formatting"})," does not affect how budget data is stored, and can be changed at any time."]})})}function l1e(){const[e,t]=g.useState(!1);async function n(){t(!0),await Y("reset-budget-cache"),t(!1)}return s.jsx(ur,{primaryAction:s.jsx(mt,{loading:e,onClick:n,children:"Reset budget cache"}),children:s.jsxs(z,{children:[s.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’t see correct values. There is no danger in resetting the cache. Hopefully you never have to do this."]})})}function u1e(){const[e]=dt("groupId"),t=!!e,{resetSync:n}=Ht(),[r,o]=g.useState(!1);async function i(){o(!0),await n(),o(!1)}return s.jsx(ur,{primaryAction:s.jsx(mt,{loading:r,disabled:!t,onClick:i,children:"Reset sync"}),children:t?s.jsxs(z,{children:[s.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."]}):s.jsxs(z,{children:[s.jsx("strong",{children:"Reset sync"})," is only available when syncing is enabled."]})})}function c1e(){const[e,t]=rb();return s.jsx(ur,{primaryAction:s.jsx(q,{bounce:!1,style:{padding:0},children:s.jsx(Rn,{bare:!0,onChange:n=>{t(n)},value:e,options:eO,style:{padding:"2px 10px",fontSize:15}})}),children:s.jsxs(z,{children:[s.jsx("strong",{children:"Themes"})," change the user interface colors."]})})}function d1e(){const e=zP(),t=M3(),n=Qxe();return s.jsxs(ur,{children:[s.jsxs(z,{children:[s.jsx("strong",{children:"Actual"})," is a super fast privacy-focused app for managing your finances."]}),s.jsxs(I,{style:{flexDirection:"column",gap:10},className:`${$D(`(min-width: ${fr.breakpoint_small})`,{display:"grid",gridTemplateRows:"1fr 1fr",gridTemplateColumns:"50% 50%",columnGap:"2em",gridAutoFlow:"column"})}`,"data-vrt-mask":!0,children:[s.jsxs(z,{children:["Client version: v",window.Actual?.ACTUAL_VERSION]}),s.jsxs(z,{children:["Server version: ",e]}),n?s.jsxs(Ve,{to:"https://actualbudget.org/docs/releases",linkColor:"purple",children:["New version available: ",t]}):s.jsx(z,{style:{color:S.noticeText,fontWeight:600},children:"You’re up to date!"}),s.jsx(z,{children:s.jsx(Ve,{to:"https://actualbudget.org/docs/releases",linkColor:"purple",children:"Release Notes"})})]})]})}function L2({children:e}){return s.jsx(z,{style:{fontWeight:500},children:e})}function f1e(){const[e]=dt("id"),[t]=dt("groupId");return s.jsxs(ur,{children:[s.jsxs(z,{children:[s.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."]}),s.jsxs(z,{children:[s.jsx(L2,{children:"Budget ID:"})," ",e]}),s.jsxs(z,{style:{color:S.pageText},children:[s.jsx(L2,{children:"Sync ID:"})," ",t||"(none)"]})]})}function h1e(){const[e]=fs("floatingSidebar"),[t]=dt("budgetName"),{loadPrefs:n,closeBudget:r}=Ht();g.useEffect(()=>{const i=Rt("prefs-updated",()=>{n()});return n(),()=>i()},[n]);const{isNarrowWidth:o}=zt();return lw(S.mobileViewTheme),s.jsx(zg,{title:"Settings",style:{backgroundColor:o?S.mobilePageBackground:void 0,marginInline:e&&!o?"auto":0},children:s.jsxs(I,{style:{flexShrink:0,maxWidth:530,gap:30},children:[o&&s.jsxs(I,{style:{gap:10,flexDirection:"row",alignItems:"flex-end"},children:[s.jsxs(_o,{children:[s.jsx(eo,{title:"Budget Name"}),s.jsx(Ke,{value:t,disabled:!0,style:{color:S.buttonNormalDisabledText}})]}),s.jsx(q,{onClick:r,children:"Close Budget"})]}),s.jsx(d1e,{}),!gx,s.jsx(c1e,{}),s.jsx(s1e,{}),s.jsx(Zxe,{}),s.jsx(t1e,{}),s.jsxs(Xxe,{children:[s.jsx(f1e,{}),s.jsx(l1e,{}),s.jsx(u1e,{}),s.jsx(r1e,{}),s.jsx(e1e,{})]})]})})}function p1e(){const e=mn();return g.useMemo(()=>e.filter(t=>t.closed===0&&t.offbudget===0),[e])}function g1e(){const e=mn();return g.useMemo(()=>e.filter(t=>t.closed===1),[e])}function m1e(){return Te(e=>e.account.failedAccounts)}function y1e(){const e=mn();return g.useMemo(()=>e.filter(t=>t.closed===0&&t.offbudget===1),[e])}function v1e(){return Te(e=>e.queries.updatedAccounts)}function B3({to:e,style:t,activeStyle:n,children:r,report:o}){const i=yb({path:e});return s.jsx(xb,{to:e,state:o?{report:o}:{},className:`${ze([X.smallText,t,i?n:null])}`,children:r})}function x1e({item:e,type:t,canDrag:n,onDragChange:r}){const o=g.useRef(r),[,i]=Mte({type:t,item:()=>(o.current({state:"start-preview",type:t,item:e}),setTimeout(()=>{o.current({state:"start"})},0),{type:t,item:e}),collect:a=>({isDragging:a.isDragging()}),end(a){o.current({state:"end",type:t,item:a.item})},canDrag(){return n}});return g.useLayoutEffect(()=>{o.current=r}),{dragRef:i}}function b1e({types:e,id:t,onDrop:n,onLongHover:r}){const o=g.useRef(null),[i,a]=g.useState(null),[{isOver:l},u]=zte({accept:e,drop({item:c}){n(c.id,i,t)},hover(c,f){const d=o.current.getBoundingClientRect(),h=(d.bottom-d.top)/2,x=f.getClientOffset().y-d.top<h?"top":"bottom";a(x)},collect(c){return{isOver:c.isOver()}}});return g.useEffect(()=>{let c;return r&&l&&(c=setTimeout(r,700)),()=>c&&clearTimeout(c)},[l]),{dropRef:cw(u,o),dropPos:l?i:null}}const w1e=g.createContext(null);function S1e({pos:e,offset:t}){const n=g.useContext(w1e);if(e==null)return null;const r=(n==="first"?2:0)+(t?.top||0),o=(n==="last"?2:0)+(t?.bottom||0),i=e==="top"?{top:-2+r}:{bottom:-1+o};return s.jsx(I,{style:{position:"absolute",left:2,right:2,borderRadius:3,height:3,background:S.pageTextLink,zIndex:1e4,pointerEvents:"none",...i}})}const L3={marginTop:-2,marginBottom:2,paddingTop:4,paddingBottom:4,paddingRight:15,paddingLeft:10,textDecoration:"none",color:S.sidebarItemText,":hover":{backgroundColor:S.sidebarItemBackgroundHover},...X.smallText};function Ms({name:e,account:t,connected:n,pending:r=!1,failed:o,updated:i,to:a,query:l,style:u,outerStyle:c,onDragChange:f,onDrop:d}){const h=t?t.closed?"account-closed":t.offbudget?"account-offbudget":"account-onbudget":"title",{dragRef:p}=x1e({type:h,onDragChange:f,item:{id:t&&t.id},canDrag:t!=null}),{dropRef:m,dropPos:x}=b1e({types:t?[h]:[],id:t&&t.id,onDrop:d});return s.jsx(I,{innerRef:m,style:{flexShrink:0,...c},children:s.jsxs(I,{children:[s.jsx(S1e,{pos:x}),s.jsx(I,{innerRef:p,children:s.jsxs(B3,{to:a,style:{...L3,...u,position:"relative",borderLeft:"4px solid transparent",...i&&{fontWeight:700}},activeStyle:{borderColor:S.sidebarItemAccentSelected,color:S.sidebarItemTextSelected,fontWeight:u&&u.fontWeight||"normal","& .dot":{backgroundColor:S.sidebarItemAccentSelected,transform:"translateX(-4.5px)"}},children:[s.jsx(I,{style:{position:"absolute",left:0,top:0,bottom:0,flexDirection:"row",alignItems:"center"},children:s.jsx("div",{className:`dot ${ze({marginRight:3,width:5,height:5,borderRadius:5,backgroundColor:r?S.sidebarItemBackgroundPending:o?S.sidebarItemBackgroundFailed:S.sidebarItemBackgroundPositive,marginLeft:2,transition:"transform .3s",opacity:n?1:0})}`})}),s.jsx(Kc,{left:e,right:s.jsx(ri,{binding:l,type:"financial"})})]})})]})})}function N3({style:e,to:t,onClick:n,activeStyle:r,forceActive:o,children:i}){return n?s.jsx(I,{role:"button",tabIndex:0,style:{...e,touchAction:"auto",userSelect:"none",userDrag:"none",cursor:"pointer",...o?r:{}},onClick:n,children:i}):s.jsx(B3,{to:t,style:e,activeStyle:r,children:i})}const N2=600;function ac({Icon:e,title:t,style:n,to:r,onClick:o,bold:i,indent:a=0}){const l=s.jsxs(I,{style:{flexDirection:"row",alignItems:"center",height:16},children:[e&&s.jsx(e,{width:12,height:12}),s.jsx(We,{style:{marginLeft:e?8:0,color:"inherit"},children:t})]});return s.jsx(I,{style:{flexShrink:0,...n},children:s.jsx(N3,{style:{...L3,color:S.sidebarItemText,paddingLeft:14+a,fontWeight:i?N2:null,":hover":{backgroundColor:S.sidebarItemBackgroundHover}},to:r,onClick:o,activeStyle:{borderLeft:"4px solid "+S.sidebarItemTextSelected,paddingLeft:10+a,color:S.sidebarItemTextSelected,fontWeight:i?N2:null},children:l})})}const Uy=600;function k1e({onAddAccount:e,onToggleClosedAccounts:t,onReorder:n}){const[r,o]=g.useState(!1),i=m1e(),a=v1e(),l=y1e(),u=p1e(),c=g1e(),f=Te(x=>x.account.accountsSyncing),d=x=>`/accounts/${x.id}`,[h]=dt("ui.showClosedAccounts");function p(x){o(x.state==="start")}const m=x=>x===0?{paddingTop:r?15:0,marginTop:r?-15:0}:null;return s.jsxs(I,{children:[s.jsx(Ms,{name:"All accounts",to:"/accounts",query:rxe(),style:{fontWeight:Uy,marginTop:15}}),u.length>0&&s.jsx(Ms,{name:"For budget",to:"/accounts/budgeted",query:oxe(),style:{fontWeight:Uy,marginTop:13}}),u.map((x,k)=>s.jsx(Ms,{name:x.name,account:x,connected:!!x.bank,pending:f.includes(x.id),failed:i&&i.has(x.id),updated:a&&a.includes(x.id),to:d(x),query:$y(x),onDragChange:p,onDrop:n,outerStyle:m(k)},x.id)),l.length>0&&s.jsx(Ms,{name:"Off budget",to:"/accounts/offbudget",query:ixe(),style:{fontWeight:Uy,marginTop:13}}),l.map((x,k)=>s.jsx(Ms,{name:x.name,account:x,connected:!!x.bank,pending:f.includes(x.id),failed:i&&i.has(x.id),updated:a&&a.includes(x.id),to:d(x),query:$y(x),onDragChange:p,onDrop:n,outerStyle:m(k)},x.id)),c.length>0&&s.jsx(ac,{style:{marginTop:15},title:"Closed accounts"+(h?"":"..."),onClick:t,bold:!0}),h&&c.map(x=>s.jsx(Ms,{name:x.name,account:x,to:d(x),query:$y(x),onDragChange:p,onDrop:n},x.id)),s.jsx(ac,{style:{marginTop:15,marginBottom:9},onClick:e,Icon:xs,title:"Add account"})]})}function dh({children:e,Icon:t,title:n,style:r,to:o,onClick:i,indent:a=0,forceHover:l=!1,forceActive:u=!1}){const c={backgroundColor:S.sidebarItemBackgroundHover},f=s.jsxs(I,{style:{flexDirection:"row",alignItems:"center",height:20},children:[s.jsx(t,{width:15,height:15}),s.jsx(We,{style:{marginLeft:8},children:n}),s.jsx(I,{style:{flex:1}})]});return s.jsxs(I,{style:{flexShrink:0,...r},children:[s.jsx(N3,{style:{...X.mediumText,paddingTop:9,paddingBottom:9,paddingLeft:19+a,paddingRight:10,textDecoration:"none",color:S.sidebarItemText,...l?c:{},":hover":c},to:o,onClick:i,activeStyle:{borderLeft:"4px solid "+S.sidebarItemTextSelected,paddingLeft:19+a-4,color:S.sidebarItemTextSelected},forceActive:u,children:f}),e?s.jsx(I,{style:{marginTop:5},children:e}):null]})}function T1e({style:e,isFloating:t,onFloat:n}){return s.jsx(I,{className:"float",style:{...e,flexShrink:0},children:s.jsx(q,{type:"bare","aria-label":`${t?"Pin":"Unpin"} sidebar`,onClick:n,color:S.buttonMenuBorder,children:t?s.jsx(Voe,{style:{margin:-2,width:15,height:15,transform:"rotate(45deg)"}}):s.jsx(qse,{style:{width:13,height:13}})})})}function C1e(){const[e,t]=g.useState(!1),n=g.useCallback(()=>t(i=>!i),[]),r=an(),o=["/payees","/rules","/settings","/tools"].some(i=>r.pathname.startsWith(i));return g.useEffect(()=>{o&&t(!0)},[r.pathname]),s.jsxs(I,{style:{flexShrink:0},children:[s.jsx(dh,{title:"More",Icon:e?Loe:$oe,onClick:n,style:{marginBottom:e?8:0},forceActive:!e&&o}),e&&s.jsxs(s.Fragment,{children:[s.jsx(ac,{title:"Payees",Icon:OA,to:"/payees",indent:15}),s.jsx(ac,{title:"Rules",Icon:AA,to:"/rules",indent:15}),s.jsx(ac,{title:"Settings",Icon:DA,to:"/settings",indent:15})]})]})}const $3=240;function E1e(){const e=!gx,t=Ft(),n=cm(),r=mn(),[o,i]=dt("ui.showClosedAccounts"),[a=!1,l]=fs("floatingSidebar");async function u(h,p,m){let x=m;if(p==="bottom"){const k=r.findIndex(v=>v.id===m)+1;x=k<r.length?r[k].id:null}t(rD(h,x))}const c=()=>{l(!a)},f=()=>{t(y1("add-account"))},d=()=>{i(!o)};return s.jsxs(I,{style:{width:$3,color:S.sidebarItemText,backgroundColor:S.sidebarBackground,"& .float":{opacity:a?1:0,transition:"opacity .25s, width .25s",width:a?null:0},"&:hover .float":{opacity:1,width:"auto"},flex:1,...X.darkScrollbar},children:[s.jsxs(I,{style:{paddingTop:35,height:30,flexDirection:"row",alignItems:"center",margin:"0 8px 23px 20px",transition:"padding .4s",...e},children:[s.jsx(j1e,{}),s.jsx(I,{style:{flex:1,flexDirection:"row"}}),!n.alwaysFloats&&s.jsx(T1e,{isFloating:a,onFloat:c})]}),s.jsxs(I,{style:{overflow:"auto"},children:[s.jsx(dh,{title:"Budget",Icon:PA,to:"/budget"}),s.jsx(dh,{title:"Reports",Icon:qoe,to:"/reports"}),s.jsx(dh,{title:"Schedules",Icon:fl,to:"/schedules"}),s.jsx(C1e,{}),s.jsx(I,{style:{height:1,backgroundColor:S.sidebarItemBackgroundHover,marginTop:15,flexShrink:0}}),s.jsx(k1e,{onAddAccount:f,onToggleClosedAccounts:d,onReorder:u})]})]})}function j1e(){const e=Ft(),t=Hn(),[n,r]=dt("budgetName"),[o,i]=g.useState(!1),[a,l]=g.useState(!1);function u(f){switch(l(!1),f){case"rename":i(!0);break;case"settings":t("/settings");break;case"help":window.open("https://actualbudget.org/docs/","_blank");break;case"close":e(fd());break}}const c=[{name:"rename",text:"Rename budget"},{name:"settings",text:"Settings"},{name:"help",text:"Help"},{name:"close",text:"Close file"}];return o?s.jsx(Ts,{children:s.jsx(Ke,{style:{width:160,fontSize:16,fontWeight:500},defaultValue:n,onEnter:async f=>{const h=f.target.value;h.trim()!==""&&(r(h),i(!1))},onBlur:()=>i(!1)})}):s.jsxs(q,{type:"bare",color:S.buttonNormalBorder,style:{fontSize:16,fontWeight:500,marginLeft:-5,flex:"0 auto"},onClick:()=>l(!0),children:[s.jsx(z,{style:{whiteSpace:"nowrap",overflow:"hidden"},children:n||"A budget has no name"}),s.jsx(xg,{width:7,height:7,style:{marginLeft:5}}),a&&s.jsx(Et,{position:"bottom-left",style:{padding:0},onClose:()=>l(!1),children:s.jsx(wt,{onMenuSelect:u,items:c})})]})}function I1e(){const[e]=fs("floatingSidebar"),t=cm(),{isNarrowWidth:n}=zt(),r=e||t.alwaysFloats;return n?null:s.jsx(I,{onMouseOver:r?o=>{o.stopPropagation(),t.setHidden(!1)}:void 0,onMouseLeave:r?()=>t.setHidden(!0):void 0,style:{position:r?"absolute":void 0,top:12,bottom:r?12:-50,zIndex:1001,borderRadius:r?"0 6px 6px 0":0,overflow:"hidden",boxShadow:!r||t.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)
|
|
207
|
+
translateX(${r&&t.hidden?-$3:0}px)`,transition:"transform .5s, box-shadow .5s, border-radius .5s, bottom .5s"},children:s.jsx(E1e,{})})}function D1e(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":switch(t.toUpperCase()){case"INVALID_ACCESS_TOKEN":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 s.jsxs(s.Fragment,{children:["An internal error occurred. Try to login again, or get"," ",s.jsx(Ve,{to:"https://actualbudget.org/contact/",children:"in touch"})," ","for support."]})}function _1e(){const e=mn(),t=Te(m=>m.account.failedAccounts),{unlinkAccount:n,pushModal:r}=Ht(),{id:o}=NO(),[i,a]=g.useState(!1);if(!t)return null;const l=t.get(o);if(!l)return null;const u=e.find(m=>m.id===o),{type:c,code:f}=l,d=c==="ITEM_ERROR"&&f==="ITEM_LOGIN_REQUIRED"||c==="INVALID_INPUT"&&f==="INVALID_ACCESS_TOKEN";function h(){a(!1),ax(r,{upgradingAccountId:u.account_id})}async function p(){n(u.id),a(!1)}return s.jsxs(I,{children:[s.jsxs(q,{type:"bare",style:{flexDirection:"row",alignItems:"center",color:S.errorText,backgroundColor:S.errorBackground,padding:"4px 8px",borderRadius:4},onClick:()=>a(!0),children:[s.jsx(Bb,{style:{width:14,height:14,marginRight:5}})," ","This account is experiencing connection problems. Let’s fix it."]}),i&&s.jsxs(Et,{position:"bottom-left",onClose:()=>a(!1),style:{fontSize:14,padding:15,maxWidth:400},children:[s.jsx("div",{style:{marginBottom:"1.15em"},children:"The server returned the following error:"}),s.jsx("div",{style:{marginBottom:"1.25em",color:S.errorText},children:D1e(l.type,l.code)}),s.jsx(I,{style:{justifyContent:"flex-end",flexDirection:"row"},children:d?s.jsxs(s.Fragment,{children:[s.jsx(q,{onClick:p,children:"Unlink"}),s.jsx(q,{type:"primary",onClick:h,style:{marginLeft:5},children:"Reauthorize"})]}):s.jsx(q,{onClick:p,children:"Unlink account"})})]})]})}function O1e({color:e,onClick:t}){return s.jsx(fl,{style:{width:13,height:13,color:e,marginRight:5},onClick:t})}function A1e({maxMonths:e,onChange:t}){const{displayMax:n}=Zoe();if(n<=1)return null;const r=[];for(let o=1;o<=n;o++)r.push(s.jsx(O1e,{color:e>=o?S.pageTextLight:S.pageTextSubdued,onClick:()=>t(o)},o));return s.jsx(I,{style:{flexDirection:"row",marginRight:20,marginTop:-1,WebkitAppRegion:"no-drag","& svg":{transition:"transform .15s"},"& svg:hover":{transform:"scale(1.2)"}},title:"Choose the number of months shown at a time",children:r})}const P1e=({to:e,style:t,activeStyle:n,onClick:r,...o})=>{const i=Hn(),a=yb({path:e}),l=u=>{r?.(u),i(e)};return s.jsx(q,{style:{...t,...a?n:{}},activeStyle:n,...o,onClick:l})},M1e=({to:e,style:t,activeStyle:n,children:r})=>{const o=yb({path:e});return s.jsx(xb,{to:e,className:`${ze([X.smallText,t,o?n:null])}`,children:r})};function F3({variant:e="anchor",...t}){switch(e){case"anchor":return s.jsx(M1e,{...t});case"button":return s.jsx(P1e,{...t});default:throw new Error(`Unrecognised link type: ${e}`)}}function H3({hideIfNoServer:e,style:t,color:n}){const r=Te(x=>x.user.data),{getUserData:o,signOut:i,closeBudget:a}=Ht(),[l,u]=g.useState(!0),[c,f]=g.useState(!1),d=Zl();g.useEffect(()=>{o().then(()=>u(!1))},[]);async function h(){await a(),window.__navigate("/change-password")}async function p(x){switch(f(!1),x){case"change-password":h();break;case"sign-in":await a(),window.__navigate("/login");break;case"sign-out":i();break;case"config-server":await a(),window.__navigate("/config-server");break}}function m(){return d?r?.offline?"Server offline":"Server online":"No server"}return e&&!d?null:l&&d?s.jsx(z,{style:{color:S.pageTextLight,fontStyle:"italic",...X.delayedFadeIn,...t},children:"Connecting..."}):s.jsxs(I,{style:{flexDirection:"row",alignItems:"center",...t},children:[s.jsx(q,{type:"bare",onClick:()=>f(!0),style:n&&{color:n},children:m()}),c&&s.jsx(Et,{position:"bottom-right",style:{padding:0},onClose:()=>f(!1),children:s.jsx(wt,{onMenuSelect:p,items:[d&&!r?.offline&&{name:"change-password",text:"Change password"},d&&{name:"sign-out",text:"Sign out"},{name:"config-server",text:d?"Change server URL":"Start using a server"}]})})]})}function R1e({style:e}){const[t,n]=rb(),[r,o]=g.useState(!1),{isNarrowWidth:i}=zt(),a={light:NT,dark:LT,auto:Yse,midnight:LT};function l(c){o(!1),n(c)}const u=a[t]||NT;return i?null:s.jsxs(q,{type:"bare","aria-label":"Switch theme",onClick:()=>o(!0),style:e,children:[s.jsx(u,{style:{width:13,height:13,color:"inherit"}}),r&&s.jsx(Et,{position:"bottom-right",style:{padding:0},onClose:()=>o(!1),children:s.jsx(wt,{onMenuSelect:l,items:eO.map(([c,f])=>({name:c,text:f}))})})]})}const B1e="budget/switch-type",z3=g.createContext({sendEvent(){throw new Error("TitlebarContext not initialized")},subscribe(){throw new Error("TitlebarContext not initialized")}});function L1e({children:e}){const t=g.useRef([]);function n(o){t.current.forEach(i=>i(o))}function r(o){return t.current.push(o),()=>t.current=t.current.filter(i=>i!==o)}return s.jsx(z3.Provider,{value:{sendEvent:n,subscribe:r},children:e})}function N1e(){const e=No(sxe());return e===null||e<=0?null:s.jsxs(F3,{variant:"button",type:"bare",to:"/accounts/uncategorized",style:{color:S.errorText},children:[e," uncategorized ",e===1?"transaction":"transactions"]})}function $1e({style:e}){const[t,n]=dt("isPrivacyEnabled"),r={width:15,height:15};return s.jsx(q,{type:"bare","aria-label":`${t?"Disable":"Enable"} privacy mode`,onClick:()=>n(!t),style:e,children:t?s.jsx(tw,{style:r}):s.jsx(nw,{style:r})})}function F1e({style:e,isMobile:t=!1}){const[n]=dt("cloudFileId"),{sync:r}=Ht(),[o,i]=g.useState(!1),[a,l]=g.useState(null);g.useEffect(()=>Rt("sync-event",({type:x,subtype:k,syncDisabled:v})=>{x==="start"?(i(!0),l(null)):setTimeout(()=>{i(!1)},200),x==="error"?l(k==="network"?"offline":n?"error":"local"):x==="success"&&l(v?"disabled":null)}),[]);const u=a==="error"?S.errorText:a==="disabled"||a==="offline"||a==="local"?S.mobileHeaderTextSubdued:S.mobileHeaderText,c=a==="error"?S.errorTextDark:a==="disabled"||a==="offline"||a==="local"?S.tableTextLight:"inherit",f=t?{color:u}:{},d=t?{color:u,background:S.mobileHeaderTextHover}:{},h={color:u,justifyContent:"center",margin:10,paddingLeft:5,paddingRight:3},p={...X.text,fontWeight:500,marginLeft:2,marginRight:5};return w$("ctrl+s, cmd+s, meta+s",r,{enableOnFormTags:!0,preventDefault:!0,scopes:["app"]},[r]),s.jsxs(q,{type:"bare","aria-label":"Sync",style:t?{...e,WebkitAppRegion:"none",...h}:{...e,WebkitAppRegion:"none",color:c},hoveredStyle:d,activeStyle:f,onClick:r,children:[t?a==="error"?s.jsx(zv,{width:14,height:14}):s.jsx(Lv,{width:18,height:18,animating:o}):a==="error"?s.jsx(zv,{width:13}):s.jsx(Lv,{animating:o}),s.jsx(z,{style:t?{...p}:{marginLeft:3},children:a==="disabled"?"Disabled":a==="offline"?"Offline":"Sync"})]})}function H1e(){const[e,t]=fs("maxMonths"),[n]=dt("budgetType"),{sendEvent:r}=g.useContext(z3),[o,i]=g.useState(!1),[a,l]=g.useState(!1),u=Kd("reportBudget");function c(){i(!0),o||r({type:B1e,payload:{newBudgetType:n==="rollover"?"report":"rollover"}})}return g.useEffect(()=>{i(!1)},[n]),s.jsxs(I,{style:{flexDirection:"row",alignItems:"center"},children:[s.jsx(A1e,{maxMonths:e||1,onChange:f=>t(f)}),u&&s.jsxs(I,{style:{marginLeft:-5},children:[s.jsx(mt,{type:"bare",loading:o,style:{alignSelf:"flex-start",padding:"4px 7px"},title:"Learn more about budgeting",onClick:()=>l(!0),children:n==="report"?"Report budget":"Rollover budget"}),a&&s.jsxs(Et,{position:"bottom-left",onClose:()=>l(!1),style:{padding:10,maxWidth:400},children:[s.jsxs(be,{children:["You are currently using a"," ",s.jsxs(z,{style:{fontWeight:600},children:[n==="report"?"Report budget":"Rollover budget","."]})," ","Switching will not lose any data and you can always switch back."]}),s.jsx(be,{children:s.jsxs(mt,{type:"primary",loading:o,onClick:c,children:["Switch to a"," ",n==="report"?"Rollover budget":"Report budget"]})}),s.jsx(be,{isLast:!0,children:s.jsx(Ve,{to:"https://actualbudget.org/docs/experimental/report-budget",linkColor:"muted",children:"How do these types of budgeting work?"})})]})]})]})}function z1e({style:e}){const t=Hn(),n=an(),r=cm(),{isNarrowWidth:o}=zt(),i=Zl(),[a]=fs("floatingSidebar");return o?null:s.jsxs(I,{style:{flexDirection:"row",alignItems:"center",padding:"0 15px",height:36,pointerEvents:"none","& *":{pointerEvents:"auto"},...!gx,...e},children:[(a||r.alwaysFloats)&&s.jsx(q,{type:"bare",style:{marginRight:8},onPointerEnter:l=>{l.pointerType==="mouse"&&r.setHidden(!1)},onPointerLeave:l=>{l.pointerType==="mouse"&&r.setHidden(!0)},onPointerUp:l=>{l.pointerType!=="mouse"&&r.setHidden(!r.hidden)},children:s.jsx(nle,{className:"menu",style:{width:15,height:15,color:S.pageText,left:0}})}),s.jsxs(Fa,{children:[s.jsx(Ee,{path:"/accounts",element:n.state?.goBack?s.jsxs(q,{type:"bare",onClick:()=>t(-1),children:[s.jsx(Moe,{width:10,height:10,style:{marginRight:5,color:"currentColor"}})," ","Back"]}):null}),s.jsx(Ee,{path:"/accounts/:id",element:s.jsx(_1e,{})}),s.jsx(Ee,{path:"/budget",element:s.jsx(H1e,{})}),s.jsx(Ee,{path:"*",element:null})]}),s.jsx(I,{style:{flex:1}}),s.jsx(N1e,{}),s.jsx(R1e,{style:{marginLeft:10}}),s.jsx($1e,{style:{marginLeft:10}}),i?s.jsx(F1e,{style:{marginLeft:10}}):null,s.jsx(H3,{style:{marginLeft:10}})]})}function Wy({redirectTo:e="/budget",children:t}){const{isNarrowWidth:n}=zt(),r=Hn();return g.useEffect(()=>{n&&r(e)},[n,r,e]),n?null:t}function Vy({children:e,redirectTo:t="/budget"}){const{isNarrowWidth:n}=zt(),r=Hn();return g.useEffect(()=>{n||r(t)},[n,r,t]),n?e:null}function U1e(){const e=Hn(),t=mn(),n=Te(i=>i.queries.accountsLoaded);g.useEffect(()=>{n&&t.length===0&&e("/accounts")},[n,t]);const r=an(),o=BO(r);return g.useEffect(()=>{Tc("url",o)},[o]),null}function W1e(){const e=Ht();return g.useEffect(()=>{setTimeout(async()=>{await e.sync(),await hre(e.addNotification,GO,qO,e.loadPrefs,e.savePrefs)},100)},[]),s.jsxs(zO,{children:[s.jsx(U1e,{}),s.jsx(VO,{}),s.jsxs(I,{style:{height:"100%"},children:[s.jsx(Joe,{}),s.jsxs(I,{style:{flexDirection:"row",backgroundColor:S.pageBackground,flex:1},children:[s.jsx(I1e,{}),s.jsxs(I,{style:{color:S.pageText,backgroundColor:S.pageBackground,flex:1,overflow:"hidden",width:"100%"},children:[s.jsxs("div",{style:{flex:1,display:"flex",overflow:"auto",position:"relative"},children:[s.jsx(z1e,{style:{WebkitAppRegion:"drag",position:"absolute",top:0,left:0,right:0,zIndex:1e3}}),s.jsx(D3,{}),s.jsx(Qoe,{}),s.jsxs(Fa,{children:[s.jsx(Ee,{path:"/",element:s.jsx(np,{to:"/budget",replace:!0})}),s.jsx(Ee,{path:"/reports/*",element:s.jsx(Wy,{children:s.jsx(Gxe,{})})}),s.jsx(Ee,{path:"/budget",element:s.jsx(Hy,{name:"Budget"})}),s.jsx(Ee,{path:"/schedules",element:s.jsx(Wy,{children:s.jsx(B2,{name:"Schedules"})})}),s.jsx(Ee,{path:"/payees",element:s.jsx(qxe,{})}),s.jsx(Ee,{path:"/rules",element:s.jsx(Qle,{})}),s.jsx(Ee,{path:"/settings",element:s.jsx(h1e,{})}),s.jsx(Ee,{path:"/gocardless/link",element:s.jsx(Wy,{children:s.jsx(B2,{name:"GoCardlessLink"})})}),s.jsx(Ee,{path:"/accounts",element:s.jsx(Hy,{name:"Accounts"})}),s.jsx(Ee,{path:"/accounts/:id",element:s.jsx(Hy,{name:"Account"})}),s.jsx(Ee,{path:"/accounts/:id/transactions/:transactionId",element:s.jsx(Vy,{children:s.jsx(yy,{})})}),s.jsx(Ee,{path:"/accounts/:id/transactions/new",element:s.jsx(Vy,{children:s.jsx(yy,{})})}),s.jsx(Ee,{path:"/transactions/new",element:s.jsx(Vy,{children:s.jsx(yy,{})})}),s.jsx(Ee,{path:"/*",element:s.jsx(np,{to:"/budget",replace:!0})})]}),s.jsx(Bxe,{})]}),s.jsxs(Fa,{children:[s.jsx(Ee,{path:"/budget",element:s.jsx(my,{})}),s.jsx(Ee,{path:"/accounts",element:s.jsx(my,{})}),s.jsx(Ee,{path:"/settings",element:s.jsx(my,{})}),s.jsx(Ee,{path:"*",element:null})]})]})]})]})]})}function V1e(){const e=g.useMemo(()=>s.jsx(W1e,{}),[]);return s.jsx(fre,{children:s.jsx(L1e,{children:s.jsx(o1e,{children:s.jsx(Xoe,{children:s.jsx(cte,{backend:nne,children:s.jsx(que,{children:e})})})})})})}function Y1e(e){return e.state==="unknown"?"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 q1e({onDelete:e,onClose:t}){function n(o){switch(t(),o){case"delete":e();break}}const r=[{name:"delete",text:"Delete"}];return s.jsx(wt,{onMenuSelect:n,items:r})}function G1e({state:e,onDelete:t}){const[n,r]=g.useState(!1);return s.jsxs(I,{children:[s.jsx(q,{type:"bare","aria-label":"Menu",onClick:o=>{o.stopPropagation(),r(!0)},children:s.jsx(Od,{style:{width:16,height:16}})}),n&&s.jsx(Et,{position:"bottom-right",style:{padding:0},onClose:()=>r(!1),children:s.jsx(q1e,{state:e,onDelete:t,onClose:()=>r(!1)})})]})}function K1e({file:e}){let t,n,r;switch(e.state){case"unknown":t=Xse,n="Network unavailable",r=S.buttonNormalDisabledText;break;case"remote":t=zoe,n="Available for download";break;case"local":case"broken":t=Uoe,n="Local";break;default:t=Hoe,n="Syncing";break}return s.jsxs(I,{style:{color:r,alignItems:"center",flexDirection:"row",marginTop:8},children:[s.jsx(t,{style:{width:18,height:18,color:"currentColor"}}),s.jsx(z,{style:{marginLeft:5},children:n})]})}function Q1e({file:e,onSelect:t,onDelete:n}){const r=g.useRef(!1);async function o(i){r.current||(r.current=!0,await t(i),r.current=!1)}return s.jsxs(I,{onClick:()=>o(e),title:Y1e(e),style:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",...X.shadow,margin:10,padding:"12px 15px",backgroundColor:S.buttonNormalBackground,borderRadius:6,flexShrink:0,cursor:"pointer",":hover":{backgroundColor:S.hover}},children:[s.jsxs(I,{style:{alignItems:"flex-start"},children:[s.jsx(z,{style:{fontSize:16,fontWeight:700},children:e.name}),s.jsx(K1e,{file:e})]}),s.jsxs(I,{style:{flex:"0 0 auto",flexDirection:"row",alignItems:"center"},children:[e.encryptKeyId&&s.jsx(ele,{style:{width:13,height:13,marginRight:8,color:e.hasKey?S.formLabelText:S.buttonNormalDisabledText}}),s.jsx(G1e,{state:e.state,onDelete:()=>n(e)})]})]})}function X1e({files:e,onSelect:t,onDelete:n}){return s.jsx(I,{style:{flexGrow:1,[`@media (min-width: ${fr.breakpoint_small})`]:{flexGrow:0,maxHeight:310},overflow:"auto","& *":{userSelect:"none"}},children:e.map(r=>s.jsx(Q1e,{file:r,onSelect:t,onDelete:n},r.id||r.cloudFileId))})}function Z1e({onRefresh:e}){const[t,n]=g.useState(!1);async function r(){n(!0),await e(),n(!1)}const o=t?vi:ole;return s.jsx(q,{type:"bare","aria-label":"Refresh",style:{padding:10,marginRight:5},onClick:r,children:s.jsx(o,{style:{width:18,height:18}})})}function J1e(){const e=Te(f=>f.budgets.allFiles||[]),{getUserData:t,loadAllFiles:n,pushModal:r,loadBudget:o,createBudget:i,downloadBudget:a}=Ht(),[l,u]=g.useState(!1),c=({testMode:f}={})=>{l||(u(!0),i({testMode:f}))};return s.jsxs(I,{style:{flex:1,justifyContent:"center",marginInline:-20,marginTop:20,width:"100vw",[`@media (min-width: ${fr.breakpoint_small})`]:{maxWidth:fr.breakpoint_small,width:"100%"}},children:[s.jsxs(I,{children:[s.jsx(z,{style:{...X.veryLargeText,margin:20},children:"Files"}),s.jsx(I,{style:{position:"absolute",right:0,top:0,bottom:0,justifyContent:"center",marginRight:5},children:s.jsx(Z1e,{onRefresh:()=>{t(),n()}})})]}),s.jsx(X1e,{files:e,actions:E1,onSelect:f=>{f.state==="remote"?a(f.cloudFileId):o(f.id)},onDelete:f=>r("delete-budget",{file:f})}),s.jsxs(I,{style:{flexDirection:"row",justifyContent:"flex-end",padding:25,paddingLeft:5},children:[s.jsx(q,{type:"bare",style:{marginLeft:10,color:S.pageTextLight},onClick:f=>{f.preventDefault(),r("import")},children:"Import file"}),s.jsx(q,{type:"primary",onClick:c,style:{marginLeft:15},children:"Create new file"}),bd()&&s.jsx(q,{type:"primary",isSubmit:!1,onClick:()=>c({testMode:!0}),style:{marginLeft:15},children:"Create test file"})]})]})}function U3(){const[e,t]=g.useState(!1),n=Hn(),r=an(),o=UP();return g.useEffect(()=>{async function i(){const a=c=>{r.pathname!==c?n(c):t(!0)},l=await Y("get-server-url"),u=await Y("get-did-bootstrap");if(l==null&&!u){const c=window.location.origin,f=await Y("subscribe-needs-bootstrap",{url:c});if("error"in f||!f.hasServer){console.log("error"in f&&f.error),n("/config-server");return}await o(c,{validate:!1}),f.bootstrapped?a("/login"):a("/bootstrap")}else{const c=await Y("subscribe-needs-bootstrap");"error"in c?n("/error",{state:{error:c.error}}):c.bootstrapped?a("/login"):a("/bootstrap")}}i()},[r]),{checked:e}}function dm({text:e}){return s.jsx("h1",{style:{fontSize:40,fontWeight:700,color:S.pageTextPositive,marginBottom:20},children:e})}function $2(){lw(S.mobileConfigServerViewTheme);const{createBudget:e,signOut:t,loggedIn:n}=Ht(),r=Hn(),[o,i]=g.useState(""),a=Zl(),l=UP();g.useEffect(()=>{i(a)},[a]);const[u,c]=g.useState(!1),[f,d]=g.useState(null);function h(v){switch(v){case"network-failure":return"Server is not running at this URL. Make sure you have HTTPS set up properly.";default:return"Server does not look like an Actual server. Is it set up correctly?"}}async function p(){if(o===""||u)return;d(null),c(!0);const{error:v}=await l(o);if(["network-failure","get-server-failure"].includes(v)&&!o.startsWith("http://")&&!o.startsWith("https://")){const{error:y}=await l("https://"+o);y?(i("https://"+o),d(y)):(await t(),r("/")),c(!1)}else v?(c(!1),d(v)):(c(!1),await t(),r("/"))}function m(){i(window.location.origin)}async function x(){await l(null),await n(),r("/")}async function k(){await l(null),await e({testMode:!0}),window.__navigate("/")}return s.jsxs(I,{style:{maxWidth:500,marginTop:-30},children:[s.jsx(dm,{text:"Where’s the server?"}),s.jsx(z,{style:{fontSize:16,color:S.tableRowHeaderText,lineHeight:1.5},children:a?s.jsx(s.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."}):s.jsx(s.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."})}),f&&s.jsx(z,{style:{marginTop:20,color:S.errorText,borderRadius:4,fontSize:15},children:h(f)}),s.jsxs("form",{style:{display:"flex",flexDirection:"row",marginTop:30},onSubmit:v=>{v.preventDefault(),p()},children:[s.jsx(Zh,{autoFocus:!0,placeholder:"https://example.com",value:o||"",onChangeValue:i,style:{flex:1,marginRight:10}}),s.jsx(mt,{type:"primary",loading:u,style:{fontSize:15},children:"OK"}),a&&s.jsx(q,{type:"bare",style:{fontSize:15,marginLeft:10},onClick:()=>r(-1),children:"Cancel"})]}),s.jsx(I,{style:{flexDirection:"row",flexFlow:"row wrap",justifyContent:"center",marginTop:15},children:a?s.jsx(q,{type:"bare",style:{color:S.pageTextLight},onClick:x,children:"Stop using a server"}):s.jsxs(s.Fragment,{children:[!_H()&&s.jsx(q,{type:"bare",style:{color:S.pageTextLight,margin:5,marginRight:15},onClick:m,children:"Use current domain"}),s.jsx(q,{type:"bare",style:{color:S.pageTextLight,margin:5},onClick:x,children:"Don’t use a server"}),bd()&&s.jsx(q,{type:"primary",style:{marginLeft:15},onClick:k,children:"Create test file"})]})})]})}function ebe({modalProps:e,actions:t,file:n}){const r="cloudFileId"in n&&n.state!=="broken",[o,i]=g.useState(null);return s.jsx(_e,{...e,title:"Delete "+n.name,padding:0,showOverlay:!1,onClose:e.onBack,children:()=>s.jsxs(I,{style:{padding:15,gap:15,paddingTop:0,paddingBottom:25,maxWidth:512,lineHeight:"1.5em"},children:[r&&s.jsxs(s.Fragment,{children:[s.jsxs(z,{children:["This is a ",s.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."]}),s.jsx(mt,{type:"primary",loading:o==="cloud",style:{backgroundColor:S.errorText,alignSelf:"center",border:0,padding:"10px 30px",fontSize:14},onClick:async()=>{i("cloud"),await t.deleteBudget("id"in n?n.id:void 0,n.cloudFileId),i(null),e.onBack()},children:"Delete file from all devices"})]}),"id"in n&&s.jsxs(s.Fragment,{children:[r?s.jsx(z,{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."}):s.jsxs(z,{children:[n.state==="broken"?s.jsxs(s.Fragment,{children:["This is a ",s.jsx("strong",{children:"hosted file"})," but it was created by another user. You can only delete the local copy."]}):s.jsxs(s.Fragment,{children:["This a ",s.jsx("strong",{children:"local file"})," which is not stored on a server."]})," ","Deleting it will remove it and all of its backups permanently."]}),s.jsx(mt,{type:r?"normal":"primary",loading:o==="local",style:{alignSelf:"center",marginTop:10,padding:"10px 30px",fontSize:14,...r?{color:S.errorText,borderColor:S.errorText}:{border:0,backgroundColor:S.errorText}},onClick:async()=>{i("local"),await t.deleteBudget(n.id),i(null),e.onBack()},children:"Delete file locally"})]})]})})}function tbe(e){switch(e){case"not-ynab4":return"This file is not valid. Please select a .ynab4 file";default:return"An unknown error occurred while importing. Please report this as a new issue on Github."}}function nbe({modalProps:e,actions:t}){const[n]=g.useState(!1);function r(i){switch(i){case"ynab4":t.pushModal("import-ynab4");break;case"ynab5":t.pushModal("import-ynab5");break;case"actual":t.pushModal("import-actual");break}}const o={padding:10,border:"1px solid "+S.tableBorder,borderRadius:6,marginBottom:10,display:"block"};return s.jsx(_e,{...e,title:"Import From",style:{width:400},children:()=>s.jsxs(I,{style:{...X.smallText,lineHeight:1.5},children:[n&&s.jsx(We,{style:{color:S.errorText,marginBottom:15},children:tbe(n)}),s.jsx(z,{style:{marginBottom:15},children:"Select an app to import from, and we’ll guide you through the process."}),s.jsxs(q,{style:o,onClick:()=>r("ynab4"),children:[s.jsx("span",{style:{fontWeight:700},children:"YNAB4"}),s.jsx(I,{style:{color:S.pageTextLight},children:"The old unsupported desktop app"})]}),s.jsxs(q,{style:o,onClick:()=>r("ynab5"),children:[s.jsx("span",{style:{fontWeight:700},children:"nYNAB"}),s.jsx(I,{style:{color:S.pageTextLight},children:s.jsx("div",{children:"The newer web app"})})]}),s.jsxs(q,{style:o,onClick:()=>r("actual"),children:[s.jsx("span",{style:{fontWeight:700},children:"Actual"}),s.jsx(I,{style:{color:S.pageTextLight},children:s.jsx("div",{children:"Import a file exported from Actual"})})]})]})})}function rbe(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. Please report this as a new issue on Github."}}function obe({modalProps:e}){const t=Ft(),[n,r]=g.useState(null),[o,i]=g.useState(!1);async function a(){const l=await window.Actual?.openFileDialog({properties:["openFile"],filters:[{name:"actual",extensions:["zip","blob"]}]});if(l){i(!0),r(null);try{await t(eg(l[0],"actual"))}catch(u){r(u.message)}finally{i(!1)}}}return s.jsx(_e,{...e,title:"Import from Actual export",style:{width:400},children:()=>s.jsxs(I,{style:{...X.smallText,lineHeight:1.5,marginTop:20},children:[n&&s.jsx(We,{style:{color:S.errorText,marginBottom:15},children:rbe(n)}),s.jsxs(I,{style:{"& > div":{lineHeight:"1.7em"}},children:[s.jsxs(be,{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"," ",s.jsx("code",{children:"db.sqlite"})," and ",s.jsx("code",{children:"metadata.json"})," files."]}),s.jsx(be,{children:"Select one of these compressed files and import it here."}),s.jsx(I,{style:{alignSelf:"center"},children:s.jsx(mt,{type:"primary",loading:o,onClick:a,children:"Select file..."})})]})]})})}function ibe(e){switch(e){case"not-ynab4":return"This file is not valid. Please select a compressed ynab4 zip file.";default:return"An unknown error occurred while importing. Please report this as a new issue on Github."}}function abe({modalProps:e}){const t=Ft(),[n,r]=g.useState(null),[o,i]=g.useState(!1);async function a(){const l=await window.Actual?.openFileDialog({properties:["openFile"],filters:[{name:"ynab",extensions:["zip"]}]});if(l){i(!0),r(null);try{await t(eg(l[0],"ynab4"))}catch(u){r(u.message)}finally{i(!1)}}}return s.jsx(_e,{...e,title:"Import from YNAB4",style:{width:400},children:()=>s.jsxs(I,{style:{...X.smallText,lineHeight:1.5,marginTop:20},children:[n&&s.jsx(We,{style:{color:S.errorText,marginBottom:15},children:ibe(n)}),s.jsxs(I,{style:{alignItems:"center"},children:[s.jsxs(be,{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 ",s.jsx("code",{children:".ynab4"})," suffix."]}),s.jsxs(be,{children:["When you’ve located your data,"," ",s.jsx("strong",{children:"compress it into a zip file"}),". On macOS, right-click the folder and select “Compress”. On Windows, right-click and select “Send to → Compressed (zipped) folder”. Upload the zipped folder for importing."]}),s.jsx(I,{children:s.jsx(mt,{type:"primary",loading:o,onClick:a,children:"Select zip file..."})})]})]})})}function sbe(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. Please report this as a new issue on Github."}}function lbe({modalProps:e}){const t=Ft(),[n,r]=g.useState(null),[o,i]=g.useState(!1);async function a(){const l=await window.Actual?.openFileDialog({properties:["openFile"],filters:[{name:"ynab",extensions:["json"]}]});if(l){i(!0),r(null);try{await t(eg(l[0],"ynab5"))}catch(u){r(u.message)}finally{i(!1)}}}return s.jsx(_e,{...e,title:"Import from nYNAB",style:{width:400},children:()=>s.jsxs(I,{style:{...X.smallText,lineHeight:1.5,marginTop:20},children:[n&&s.jsx(We,{style:{color:S.errorText,marginBottom:15},children:sbe(n)}),s.jsxs(I,{style:{alignItems:"center","& > div":{lineHeight:"1.7em"}},children:[s.jsxs(be,{children:[s.jsx(Ve,{to:"https://actualbudget.org/docs/migration/nynab",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."]}),s.jsx(be,{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."}),s.jsx(I,{children:s.jsx(mt,{type:"primary",loading:o,onClick:a,children:"Select file..."})})]})]})})}function ube(){const e=Te(o=>o.modals.modalStack),t=Te(o=>o.modals.isHidden),n=Ht(),r=e.map(({name:o,options:i={}},a)=>{const l={onClose:n.popModal,onPush:n.pushModal,onBack:n.popModal,isCurrent:a===e.length-1,isHidden:t,stackIndex:a};switch(o){case"delete-budget":return s.jsx(ebe,{modalProps:l,actions:n,file:i.file},o);case"import":return s.jsx(nbe,{modalProps:l,actions:n},o);case"import-ynab4":return s.jsx(abe,{modalProps:l,actions:n},o);case"import-ynab5":return s.jsx(lbe,{modalProps:l,actions:n},o);case"import-actual":return s.jsx(obe,{modalProps:l,actions:n},o);case"load-backup":return s.jsx(S3,{budgetId:i.budgetId,modalProps:{...l,onClose:n.popModal},backupDisabled:!0,actions:n});case"create-encryption-key":return s.jsx(SM,{modalProps:l,actions:n,options:i},o);case"fix-encryption-key":return s.jsx(y3,{modalProps:l,actions:n,options:i},o);default:throw new Error("Unknown modal: "+o)}});return s.jsx(I,{style:{flex:1,padding:50},children:r})}function cbe(){const e=Zl();return s.jsxs(I,{style:{position:"absolute",bottom:0,left:0,right:0,justifyContent:"center",flexDirection:"row",marginBottom:15,zIndex:5e3},children:[s.jsx(z,{children:e?s.jsxs(s.Fragment,{children:["Using server: ",s.jsx("strong",{children:e})]}):s.jsx("strong",{children:"No server configured"})}),s.jsx(F3,{to:"/config-server",style:{marginLeft:15},children:"Change"})]})}function W3({buttons:e,onSetPassword:t,onError:n}){const[r,o]=g.useState(""),[i,a]=g.useState(""),[l,u]=g.useState(!1),[c,f]=g.useState(!1);async function d(p){p.preventDefault(),!c&&(r===i?(f(!0),await t(r),f(!1)):n("password-match"))}function h(p){u(p.target.checked)}return s.jsxs("form",{style:{display:"flex",flexDirection:"column",alignItems:"stretch",marginTop:30},onSubmit:d,children:[s.jsx(Zh,{autoFocus:!0,placeholder:"Password",type:l?"text":"password",value:r,onChange:p=>o(p.target.value),onEnter:d}),s.jsx(Zh,{placeholder:"Confirm password",type:l?"text":"password",value:i,onChange:p=>a(p.target.value),style:{marginTop:10},onEnter:d}),s.jsxs(I,{style:{flexDirection:"row",alignItems:"center",fontSize:15,marginTop:20},children:[s.jsxs("label",{style:{userSelect:"none"},children:[s.jsx("input",{type:"checkbox",onChange:h})," Show password"]}),s.jsx(I,{style:{flex:1}}),e,s.jsx(mt,{type:"primary",loading:c,children:"OK"})]})]})}function dbe(){const e=Ft(),[t,n]=g.useState(null),{checked:r}=U3();function o(l){switch(l){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: ${l}`}}async function i(l){n(null);const{error:u}=await Y("subscribe-bootstrap",{password:l});u?n(u):e(C1())}async function a(){await e(k1({demoMode:!0}))}return r?s.jsxs(I,{style:{maxWidth:450,marginTop:-30},children:[s.jsx(dm,{text:"Welcome to Actual!"}),s.jsx(be,{style:{fontSize:16,color:S.pageTextDark},children:"Actual is a super fast privacy-focused app for managing your finances. To secure your data, you’ll need to set a password for your server."}),s.jsxs(be,{isLast:!0,style:{fontSize:16,color:S.pageTextDark},children:["Consider opening"," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/tour/",children:"our tour"})," ","in a new tab for some guidance on what to do when you’ve set your password."]}),t&&s.jsx(z,{style:{marginTop:20,color:S.errorText,borderRadius:4,fontSize:15},children:o(t)}),s.jsx(W3,{buttons:s.jsx(q,{type:"bare",style:{fontSize:15,color:S.pageTextLink,marginRight:15},onClick:a,children:"Try Demo"}),onSetPassword:i,onError:n})]}):null}function fbe(){const e=Hn(),[t,n]=g.useState(null),[r,o]=g.useState(null);function i(l){switch(l){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"}}async function a(l){n(null);const{error:u}=await Y("subscribe-change-password",{password:l});u?n(u):(o("Password successfully changed"),await Y("subscribe-sign-in",{password:l}),e("/"))}return s.jsxs(I,{style:{maxWidth:500,marginTop:-30},children:[s.jsx(dm,{text:"Change server password"}),s.jsx(z,{style:{fontSize:16,color:S.pageTextDark,lineHeight:1.4},children:"This will change the password for this server instance. All existing sessions will stay logged in."}),t&&s.jsx(z,{style:{marginTop:20,color:S.errorText,borderRadius:4,fontSize:15},children:i(t)}),r&&s.jsx(z,{style:{marginTop:20,color:S.noticeTextLight,borderRadius:4,fontSize:15},children:r}),s.jsx(W3,{buttons:s.jsx(q,{type:"bare",style:{fontSize:15,marginRight:10},onClick:()=>e("/"),children:"Cancel"}),onSetPassword:a,onError:n})]})}function hbe(e){switch(e){case"network-failure":return"Unable to access server. Make sure the configured URL for the server is accessible.";default:return"Server returned an error while checking its status."}}function pbe(){const e=Hn(),t=an(),{error:n}=t.state||{};function r(){e("/")}return s.jsxs(I,{style:{alignItems:"center",color:S.pageText},children:[s.jsx(z,{style:{fontSize:16,color:S.pageTextDark,lineHeight:1.4},children:hbe(n)}),s.jsx(q,{onClick:r,style:{marginTop:20},children:"Try again"})]})}function gbe(){const e=Ft(),[t,n]=g.useState(""),[r,o]=g.useState(!1),[i,a]=g.useState(null),{checked:l}=U3();function u(d){switch(d){case"invalid-password":return"Invalid password";case"network-failure":return"Unable to contact the server";default:return`An unknown error occurred: ${d}`}}async function c(d){if(d.preventDefault(),t===""||r)return;a(null),o(!0);const{error:h}=await Y("subscribe-sign-in",{password:t});o(!1),h?a(h):e(C1())}async function f(){await e(k1({demoMode:!0}))}return l?s.jsxs(I,{style:{maxWidth:450,marginTop:-30,color:S.pageText},children:[s.jsx(dm,{text:"Sign in to this Actual instance"}),s.jsx(z,{style:{fontSize:16,color:S.pageTextDark,lineHeight:1.4},children:"If you lost your password, you likely still have access to your server to manually reset it."}),i&&s.jsx(z,{style:{marginTop:20,color:S.errorText,borderRadius:4,fontSize:15},children:u(i)}),s.jsxs("form",{style:{display:"flex",flexDirection:"row",marginTop:30},onSubmit:c,children:[s.jsx(Zh,{autoFocus:!0,placeholder:"Password",type:"password",onChange:d=>n(d.target.value),style:{flex:1,marginRight:10}}),s.jsx(mt,{type:"primary",loading:r,style:{fontSize:15},children:"Sign in"})]}),s.jsx(I,{style:{flexDirection:"row",justifyContent:"center",marginTop:15},children:s.jsx(q,{type:"bare",style:{fontSize:15,color:S.pageTextLink,marginLeft:10},onClick:f,children:"Try Demo →"})})]}):null}function mbe(){const{createBudget:e,pushModal:t}=Ht();return s.jsxs(I,{style:{gap:10,maxWidth:500,fontSize:15,maxHeight:"100vh",marginBlock:20},children:[s.jsx(z,{style:X.veryLargeText,children:"Let’s get started!"}),s.jsxs(I,{style:{overflowY:"auto"},children:[s.jsxs(be,{children:["Actual is a personal finance tool that focuses on beautiful design and a slick user experience."," ",s.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."]}),s.jsxs(be,{children:["Currently, Actual implements budgeting based on a"," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/budgeting/",linkColor:"purple",children:"monthly envelope system"}),". Consider taking our"," ",s.jsx(Ve,{to:"https://actualbudget.org/docs/tour/",linkColor:"purple",children:"guided tour"})," ","to help you get your bearings, and check out the rest of the documentation while you’re there to learn more about advanced topics."]}),s.jsx(be,{style:{color:S.pageTextLight},children:"Get started by importing an existing budget file from Actual or another budgeting app, create a demo budget file, or start fresh with an empty budget. You can always create or import another budget later."})]}),s.jsxs(I,{style:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-end",flexShrink:0},children:[s.jsx(q,{onClick:()=>t("import"),children:"Import my budget"}),s.jsxs(I,{style:{flexDirection:"row",justifyContent:"space-between",gap:10},children:[s.jsx(q,{onClick:()=>e({testMode:!0}),children:"View demo"}),s.jsx(q,{type:"primary",onClick:()=>e(),children:"Start fresh"})]})]})]})}function ybe(){const e=zP();return s.jsx(z,{style:{color:S.pageTextSubdued,":hover":{color:S.pageText},margin:15,marginLeft:17,[`@media (min-width: ${fr.breakpoint_small})`]:{position:"absolute",bottom:0,right:0,marginLeft:15,marginRight:17,zIndex:5001}},children:`App: v${window.Actual?.ACTUAL_VERSION} | Server: ${e}`})}function vbe({isLoading:e}){const t=Te(l=>l.budgets.allFiles),n=Te(l=>l.user.data),r=Te(l=>l.app.managerHasInitialized),{setAppState:o,getUserData:i,loadAllFiles:a}=Ht();return g.useEffect(()=>{r||e||o({loadingText:""});async function l(){await i()&&await a(),o({managerHasInitialized:!0,...e?null:{loadingText:null}})}l()},[]),!r||e?null:s.jsxs(zO,{children:[s.jsx(VO,{}),s.jsxs(I,{style:{height:"100%",color:S.pageText},children:[s.jsx(I,{style:{position:"absolute",top:0,left:0,right:0,height:40,WebkitAppRegion:"drag"}}),s.jsx(I,{style:{position:"absolute",bottom:40,right:15},children:s.jsx(D3,{style:{position:"relative",left:"initial",right:"initial"}})}),r&&s.jsx(I,{style:{alignItems:"center",bottom:0,justifyContent:"center",left:0,padding:20,position:"absolute",right:0,top:0},children:n&&t?s.jsxs(s.Fragment,{children:[s.jsxs(Fa,{children:[s.jsx(Ee,{path:"/config-server",element:s.jsx($2,{})}),s.jsx(Ee,{path:"/change-password",element:s.jsx(fbe,{})}),t&&t.length>0?s.jsx(Ee,{path:"/",element:s.jsx(J1e,{})}):s.jsx(Ee,{path:"/",element:s.jsx(mbe,{})}),s.jsx(Ee,{path:"/*",element:s.jsx(np,{to:"/"})})]}),s.jsx(I,{style:{position:"absolute",top:0,right:0,padding:"6px 10px",zIndex:4e3},children:s.jsxs(Fa,{children:[s.jsx(Ee,{path:"/config-server",element:null}),s.jsx(Ee,{path:"/*",element:s.jsx(H3,{hideIfNoServer:!0,style:{padding:"4px 7px"}})})]})})]}):s.jsxs(Fa,{children:[s.jsx(Ee,{path:"/login",element:s.jsx(gbe,{})}),s.jsx(Ee,{path:"/error",element:s.jsx(pbe,{})}),s.jsx(Ee,{path:"/config-server",element:s.jsx($2,{})}),s.jsx(Ee,{path:"/bootstrap",element:s.jsx(dbe,{})}),s.jsx(Ee,{path:"/*",element:s.jsx(np,{to:"/bootstrap",replace:!0})})]})}),s.jsxs(Fa,{children:[s.jsx(Ee,{path:"/config-server",element:null}),s.jsx(Ee,{path:"/*",element:s.jsx(cbe,{})})]}),s.jsx(ybe,{})]}),s.jsx(ube,{})]})}const xbe={border:0,fontSize:15,padding:"10px 13px"};function bbe(){const[e=!0,t]=dt("hideMobileMessage"),{isNarrowWidth:n}=zt(),[r,o]=g.useState(n&&!e&&!document.cookie.match(/hideMobileMessage=true/)),[i,a]=g.useState(!1);function l(){if(o(!1),i)t(!0);else{const u=new Date;u.setTime(u.getTime()+1e3*60*5),document.cookie="hideMobileMessage=true;path=/;expires="+u.toUTCString()}}return r?s.jsxs(I,{style:{position:"absolute",bottom:0,left:0,right:0,backgroundColor:S.mobileModalBackground,color:S.mobileModalText,padding:10,margin:10,borderRadius:6,zIndex:1e4,fontSize:15,...X.shadowLarge},children:[s.jsxs(z,{style:{lineHeight:"1.5em"},children:[s.jsx("strong",{children:"Actual features are limited on small screens."}),s.jsx("br",{}),s.jsx("span",{children:"While we work to improve this experience, you may find the full Actual feature set on devices with larger screens."})]}),s.jsxs(I,{style:{gap:16,marginTop:20,justifyContent:"center"},children:[s.jsx(q,{style:xbe,onClick:l,children:"Try it anyway"}),s.jsxs(I,{style:{alignItems:"center",flexDirection:"row",justifyContent:"flex-end"},children:[s.jsx(Bo,{id:"dont_remind_me",checked:i,onChange:()=>{a(!i)}}),s.jsx("label",{htmlFor:"dont_remind_me",style:{userSelect:"none"},children:"Don’t remind me again"})]})]})]}):null}function wbe(){const e=Te(o=>o.app.updateInfo),t=Te(o=>o.app.showUpdateNotification),{updateApp:n,setAppState:r}=Ht();if(e&&t){const o=e.releaseNotes;return s.jsxs(I,{style:{position:"absolute",bottom:0,right:0,margin:"15px 17px",backgroundColor:S.pageTextPositive,color:S.tableBackground,padding:"7px 10px",borderRadius:4,zIndex:1e4,maxWidth:450},children:[s.jsxs(I,{style:{flexDirection:"row",alignItems:"center"},children:[s.jsx(I,{style:{marginRight:10,fontWeight:700},children:s.jsxs(z,{children:["App updated to ",e.version]})}),s.jsx(I,{style:{flex:1}}),s.jsx(I,{style:{marginTop:-1},children:s.jsxs(z,{children:[s.jsx(Ro,{onClick:n,style:{color:S.buttonPrimaryText,textDecoration:"underline"},children:"Restart"})," ","(",s.jsx(Ro,{style:{color:S.buttonPrimaryText,textDecoration:"underline"},onClick:()=>window.Actual?.openURLInBrowser("https://actualbudget.org/docs/releases"),children:"notes"}),")",s.jsx(q,{type:"bare","aria-label":"Close",style:{display:"inline",padding:"1px 7px 2px 7px"},onClick:()=>{r({updateInfo:null,showUpdateNotification:!1})},children:s.jsx(Foe,{width:9,style:{color:S.buttonPrimaryText}})})]})})]}),o&&s.jsx(I,{style:{marginTop:10,fontWeight:500},children:o})]})}return null}function Sbe({budgetId:e,cloudFileId:t}){const[n,r]=g.useState(!0),{showBoundary:o}=s$(),i=Te(f=>f.app.loadingText),{loadBudget:a,closeBudget:l,loadGlobalPrefs:u}=Ht();async function c(){const f=await pn.Actual.getServerSocket();await PL(f),await u();const d=await Y("get-last-opened-backup");d&&(await a(d),Y("get-remote-files").then(h=>{if(h){const p=h.find(m=>m.fileId===t);p&&p.deleted&&l()}}))}return g.useEffect(()=>{async function f(){await Promise.all([S$(),c()]),r(!1)}f().catch(o)},[]),g.useEffect(()=>{pn.Actual.updateAppMenu(!!e)},[e]),s.jsxs(s.Fragment,{children:[n?s.jsx(cv,{initializing:n,loadingText:i}):e?s.jsx(V1e,{}):s.jsxs(s.Fragment,{children:[s.jsx(cv,{initializing:n,loadingText:i}),s.jsx(vbe,{isLoading:i!=null})]}),s.jsx(wbe,{}),s.jsx(bbe,{})]})}function kbe({error:e}){return s.jsxs(s.Fragment,{children:[s.jsx(cv,{}),s.jsx(GJ,{error:e,buttonText:"Restart app"})]})}function Tbe(){const[e]=dt("id"),[t]=dt("cloudFileId"),{sync:n}=Ht(),[r,o]=g.useState(Gm());return g.useEffect(()=>{function i(){r!==Gm()&&o(Gm())}let a=!1;async function l(){a||(console.debug("triggering sync because of visibility change"),a=!0,await n(),a=!1)}return window.addEventListener("focus",i),window.addEventListener("visibilitychange",l),()=>{window.removeEventListener("focus",i),window.removeEventListener("visibilitychange",l)}},[n]),s.jsx(v$,{initiallyActiveScopes:["*"],children:s.jsx(rF,{children:s.jsx(I,{style:{height:"100%",display:"flex",flexDirection:"column"},children:s.jsxs(I,{style:{flexGrow:1,overflow:"hidden",...X.lightScrollbar},children:[s.jsxs(o$,{FallbackComponent:kbe,children:[pl.env.REACT_APP_REVIEW_ID&&!_l&&s.jsx(wZ,{}),s.jsx(Sbe,{budgetId:e,cloudFileId:t})]}),s.jsx(gZ,{})]},r?"hidden-scrollbars":"scrollbars")})})})}function Cbe(e,t){let n=!1;Rt("sync-event",r=>{const{type:o,subtype:i,meta:a,tables:l}=r,u=t.getState().prefs.local;if(!(!u||!u.id)){if(o==="success")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(o==="error"){let c=null;const f="[Learn more](https://actualbudget.org/docs/getting-started/sync/#debugging-sync-issues)",d="https://github.com/actualbudget/actual/issues/new?assignees=&labels=bug&template=bug-report.yml&title=%5BBug%5D%3A+";switch(i){case"out-of-sync":n?c={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. "+f,sticky:!0,id:"reset-sync",button:{title:"Reset sync",action:e.resetSync}}:c={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. "+f,type:"warning",sticky:!0,id:"repair-sync",button:{title:"Repair",action:async()=>{n=!0,await Y("sync-repair"),e.sync()}}};break;case"file-old-version":c={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.org/docs/getting-started/sync/#what-does-resetting-sync-mean).
|
|
208
|
+
|
|
209
|
+
Old 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":c={title:"Your encryption key need to be reset",message:"Something went wrong when registering your encryption key id. You need to recreate your key. "+f,sticky:!0,id:"invalid-key-state",button:{title:"Reset key",action:()=>e.pushModal("create-encryption-key")}};break;case"file-not-found":c={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. "+f,type:"warning",sticky:!0,id:"register-file",button:{title:"Register",action:async()=>{await e.uploadBudget(),e.sync(),e.loadPrefs()}}};break;case"file-needs-upload":c={title:"File needs upload",message:"Something went wrong when creating this cloud file. You need to upload this file to fix it. "+f,sticky:!0,id:"upload-file",button:{title:"Upload",action:e.resetSync}};break;case"file-has-reset":case"file-has-new-key":const{cloudFileId:h}=t.getState().prefs.local;c={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. "+f,messageActions:{upload:e.resetSync},sticky:!0,id:"needs-revert",button:{title:"Revert",action:()=>e.closeAndDownloadBudget(h)}};break;case"encrypt-failure":case"decrypt-failure":a.isMissingKey?c={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()})}}:c={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),c={title:"Update required",message:"We couldn’t 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),c={message:`We couldn’t apply that change to the database. Please report this as a bug by [opening a Github issue](${d}).`};break;case"network":break;default:console.trace("unkown error",r),c={message:`We had problems syncing your changes. Please report this as a bug by [opening a Github issue](${d}).`}}c&&e.addNotification({type:"error",...c})}}})}function Ebe(e,t){pn.Actual.onEventFromMain("update-downloaded",(n,r)=>{e.setAppState({updateInfo:r})}),pn.Actual.onEventFromMain("update-error",()=>{}),Rt("server-error",()=>{e.addGenericErrorNotification()}),Rt("orphaned-payees",({orphanedIds:n,updatedPayeeIds:r})=>{e.pushModal("merge-unused-payees",{payeeIds:n,targetPayeeId:r[0]})}),Rt("schedules-offline",({payees:n})=>{e.pushModal("schedule-posts-offline-notification",{payees:n})}),Rt("sync-event",async({type:n,tables:r})=>{const o=t.getState().prefs.local;o&&o.id&&n==="applied"&&(r.includes("payees")||r.includes("payee_mapping"))&&e.getPayees()}),Rt("sync-event",async({type:n})=>{n==="unauthorized"&&e.addNotification({type:"warning",message:"Unable to authenticate with server",sticky:!0,id:"auth-issue"})}),Cbe(e,t),Rt("undo-event",n=>{const{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());const a=jI(o);a&&Promise.all(i).then(()=>{if(e.setLastUndoState(n),a.openModal){const{modalStack:l}=t.getState().modals;(l.length===0||l[l.length-1].name!==a.openModal)&&e.replaceModal(a.openModal)}else if(e.closeModal(),window.location.href.replace(window.location.origin,"")!==a.url)return window.__navigate(a.url),!0})}),Rt("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."})}),Rt("start-load",()=>{e.closeBudgetUI(),e.setAppState({loadingText:""})}),Rt("finish-load",()=>{e.closeModal(),e.setAppState({loadingText:null}),e.loadPrefs()}),Rt("start-import",()=>{e.closeBudgetUI()}),Rt("finish-import",()=>{e.closeModal(),e.setAppState({loadingText:null}),e.loadPrefs()}),Rt("show-budgets",()=>{e.closeBudgetUI(),e.setAppState({loadingText:null})})}(function(e,t){(function(n,r){r()})(F2,function(){function n(){var o=!0,i=!1,a=null,l={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 u(w){return!!(w&&w!==document&&w.nodeName!=="HTML"&&w.nodeName!=="BODY"&&"classList"in w&&"contains"in w.classList)}function c(w){var E=w.type,T=w.tagName;return!!(T=="INPUT"&&l[E]&&!w.readOnly||T=="TEXTAREA"&&!w.readOnly||w.isContentEditable)}function f(w){w.classList.contains("focus-visible")||(w.classList.add("focus-visible"),w.setAttribute("data-focus-visible-added",""))}function d(w){w.hasAttribute("data-focus-visible-added")&&(w.classList.remove("focus-visible"),w.removeAttribute("data-focus-visible-added"))}function h(w){u(document.activeElement)&&f(document.activeElement),o=!0}function p(w){o=!1}function m(w){u(w.target)&&(o||c(w.target))&&f(w.target)}function x(w){u(w.target)&&(w.target.classList.contains("focus-visible")||w.target.hasAttribute("data-focus-visible-added"))&&(i=!0,window.clearTimeout(a),a=window.setTimeout(function(){i=!1,window.clearTimeout(a)},100),d(w.target))}function k(w){document.visibilityState=="hidden"&&(i&&(o=!0),v())}function v(){document.addEventListener("mousemove",b),document.addEventListener("mousedown",b),document.addEventListener("mouseup",b),document.addEventListener("pointermove",b),document.addEventListener("pointerdown",b),document.addEventListener("pointerup",b),document.addEventListener("touchmove",b),document.addEventListener("touchstart",b),document.addEventListener("touchend",b)}function y(){document.removeEventListener("mousemove",b),document.removeEventListener("mousedown",b),document.removeEventListener("mouseup",b),document.removeEventListener("pointermove",b),document.removeEventListener("pointerdown",b),document.removeEventListener("pointerup",b),document.removeEventListener("touchmove",b),document.removeEventListener("touchstart",b),document.removeEventListener("touchend",b)}function b(w){w.target.nodeName.toLowerCase()!=="html"&&(o=!1,y())}document.addEventListener("keydown",h,!0),document.addEventListener("mousedown",p,!0),document.addEventListener("pointerdown",p,!0),document.addEventListener("touchstart",p,!0),document.addEventListener("focus",m,!0),document.addEventListener("blur",x,!0),document.addEventListener("visibilitychange",k,!0),v(),document.body.classList.add("js-focus-visible")}function r(o){var i;function a(){i||(i=!0,o())}["interactive","complete"].indexOf(document.readyState)>=0?o():(i=!1,document.addEventListener("DOMContentLoaded",a,!1),window.addEventListener("load",a,!1))}typeof document<"u"&&r(n)})})();const jbe=pL(r$);function Ibe(e,t){return t.type===p1&&(e={budgets:e.budgets,user:e.user,prefs:{local:null,global:e.prefs.global},app:{...lD,updateInfo:e.updateInfo,showUpdateNotification:e.showUpdateNotification,managerHasInitialized:e.app.managerHasInitialized,loadingText:e.app.loadingText}}),jbe(e,t)}const Nw=d1(Ibe,void 0,mL(yL)),V3=kI(E1,Nw.dispatch);Ebe(V3,Nw);window.__actionsForMenu=V3;window.$send=Y;window.$query=ar;window.$q=pt;const Dbe=document.getElementById("root"),_be=wI(Dbe);_be.render(s.jsx(NR,{store:Nw,children:s.jsx(Sce,{children:s.jsx(Tbe,{})})}));export{$t as $,vi as A,We as B,lle as C,ple as D,ze as E,_o as F,Bi as G,Abe as H,Ke as I,gr as J,Bn as K,JA as L,Qbe as M,o$ as N,Hr as O,G as P,mn as Q,$o as R,Pe as S,z as T,Fr as U,I as V,wt as W,Nh as X,l3 as Y,Kd as Z,Vb as _,WR as a,Te as a$,QA as a0,eP as a1,Lg as a2,an as a3,Moe as a4,Rn as a5,An as a6,oie as a7,be as a8,Lw as a9,No as aA,Mn as aB,ice as aC,dr as aD,BP as aE,pxe as aF,Lse as aG,vp as aH,Bse as aI,Kb as aJ,lw as aK,Rt as aL,Ho as aM,Fh as aN,gxe as aO,FL as aP,YL as aQ,NL as aR,HL as aS,qL as aT,GL as aU,UL as aV,zL as aW,WL as aX,VL as aY,vwe as aZ,dd as a_,Et as aa,nw as ab,tw as ac,Bo as ad,Fse as ae,jse as af,Hv as ag,$se as ah,Cp as ai,xg as aj,dt as ak,Fa as al,Ee as am,zt as an,Xl as ao,Ft as ap,Ad as aq,Qb as ar,zg as as,Li as at,ri as au,jl as av,twe as aw,Ile as ax,Od as ay,Roe as az,A$ as b,S1e as b$,Hn as b0,$y as b1,oxe as b2,ixe as b3,m1e as b4,xs as b5,y1 as b6,IN as b7,Ew as b8,ID as b9,Kse as bA,ace as bB,cP as bC,ile as bD,Hve as bE,nr as bF,NO as bG,lwe as bH,Obe as bI,uwe as bJ,cwe as bK,dwe as bL,awe as bM,nxe as bN,swe as bO,PP as bP,zo as bQ,dN as bR,yb as bS,ywe as bT,fxe as bU,Pd as bV,Cw as bW,Loe as bX,Ole as bY,x1e as bZ,b1e as b_,Hbe as ba,ED as bb,Nbe as bc,Wbe as bd,nF as be,Vbe as bf,Rbe as bg,lk as bh,Wh as bi,z$ as bj,Lbe as bk,Uh as bl,Pl as bm,Bbe as bn,Pbe as bo,G$ as bp,Gue as bq,Wue as br,Ec as bs,rwe as bt,rP as bu,mce as bv,oC as bw,Gse as bx,iwe as by,tle as bz,F2 as c,Ts as c$,mp as c0,hwe as c1,w1e as c2,yoe as c3,IA as c4,fwe as c5,gP as c6,mwe as c7,gwe as c8,Zoe as c9,nwe as cA,MP as cB,Jue as cC,ece as cD,tce as cE,Zue as cF,Ss as cG,mD as cH,gD as cI,Jbe as cJ,qc as cK,um as cL,cD as cM,Fg as cN,JN as cO,Gd as cP,Oo as cQ,J0e as cR,_w as cS,fl as cT,NJ as cU,nce as cV,uD as cW,owe as cX,F0 as cY,w$ as cZ,Ale as c_,dxe as ca,uxe as cb,yxe as cc,ewe as cd,uw as ce,he as cf,ZA as cg,wxe as ch,j3 as ci,z3 as cj,fs as ck,B1e as cl,mxe as cm,ua as cn,Ht as co,Ow as cp,rw as cq,Dxe as cr,_e as cs,bs as ct,da as cu,Zbe as cv,Dle as cw,cw as cx,xP as cy,Kl as cz,B3 as d,WN as d0,dw as d1,Lv as d2,lve as d3,kI as d4,E1 as d5,Vue as d6,np as d7,Xbe as d8,Gv as d9,$be as dA,zbe as dB,Pw as da,so as db,Ta as dc,Ju as dd,oa as de,Kbe as df,CT as dg,Nv as dh,Sn as di,Xb as dj,eie as dk,Hg as dl,Ed as dm,pwe as dn,hxe as dp,bxe as dq,Rl as dr,U0 as ds,Ybe as dt,Fbe as du,qbe as dv,L$ as dw,Mbe as dx,Ube as dy,q$ as dz,ar as e,ke as f,mr as g,Y as h,_n as i,s as j,qb as k,Nse as l,Rse as m,Kc as n,Sl as o,Mo as p,pt as q,g as r,X as s,S as t,bb as u,Qn as v,XA as w,Uc as x,eo as y,q as z};
|
|
210
|
+
function __vite__mapDeps(indexes) {
|
|
211
|
+
if (!__vite__mapDeps.viteFileDeps) {
|
|
212
|
+
__vite__mapDeps.viteFileDeps = ["static/js/ReportRouter.mLx3JUh2.chunk.js","static/js/AppliedFilters.6hw_SZMi.chunk.js","static/js/import.M8LEm-Nc.chunk.js","static/js/ButtonLink.WYXFzja-.chunk.js","static/js/narrow.vxy14QoE.chunk.js","static/js/BalanceTooltip.hDG0UB7U.chunk.js","static/js/wide.GDttRuTJ.chunk.js"]
|
|
213
|
+
}
|
|
214
|
+
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=index.MAk9r4yg.js.map
|