@fleox-agent-crm/agentcrm 0.3.2 → 0.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/README.md +16 -16
- package/changelog.json +24 -0
- package/dist/admin/admin-files.json +7 -7
- package/dist/admin/assets/{chartsImpl-qlHW3VOv.js → chartsImpl-zjsXDhuy.js} +1 -1
- package/dist/admin/assets/firebase-C3h9mF8O.js +2 -0
- package/dist/admin/assets/{gitJson-wy2Tytfd.js → gitJson-nrOYgX0x.js} +1 -1
- package/dist/admin/assets/{index-BpaxrJx9.js → index-0ejjkW0z.js} +6 -6
- package/dist/admin/assets/{lucide-react.min-Djrg16BH.js → lucide-react.min-CI5dCsSm.js} +1 -1
- package/dist/admin/assets/{sdk-mu08RFtk.js → sdk-mepKXtVl.js} +135 -120
- package/dist/admin/index.html +1 -1
- package/dist/agent/agentcrm.mjs +29 -16
- package/dist/agent/chunks/api-BEl_EKwf.mjs +79 -0
- package/dist/agent/chunks/{firebase-BciZWdc6.mjs → firebase-Bknru2pE.mjs} +242 -63
- package/dist/agent/chunks/firebaseCache-sK4jA0ru.mjs +39 -0
- package/dist/agent/chunks/{firebaseRules-iori-s7U.mjs → firebaseRules-Jq85MBBN.mjs} +14 -3
- package/dist/agent/chunks/{hosting-Dnn1k3cV.mjs → hosting-C_UDyMkm.mjs} +1 -1
- package/dist/agent/chunks/{index-rut-KC39.mjs → index-DWecFbTi.mjs} +1 -1
- package/dist/agent/chunks/{install-BBTA4nMm.mjs → install-BLNflFes.mjs} +3 -3
- package/dist/agent/chunks/{sdk-CYgNyuoK.mjs → sdk-NYUHv7WG.mjs} +493 -214
- package/dist/version.json +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/skills/agentcrm-admin/SKILL.md +67 -67
- package/plugin/skills/agentcrm-admin/references/records.md +5 -5
- package/plugin/skills/agentcrm-admin/references/schema.md +19 -19
- package/plugin/skills/agentcrm-extensions/SKILL.md +8 -8
- package/plugin/skills/agentcrm-extensions/references/module-recipes.md +2 -2
- package/plugin/skills/agentcrm-extensions/references/testing.md +14 -14
- package/plugin/skills/agentcrm-extensions/references/theme-recipes.md +3 -3
- package/plugin/skills/agentcrm-install/SKILL.md +13 -13
- package/plugin/skills/agentcrm-install/references/firebase.md +1 -1
- package/plugin/skills/agentcrm-install/references/github.md +1 -1
- package/plugin/skills/agentcrm-install/references/mcp.md +2 -2
- package/plugin/skills/agentcrm-install/references/plans.md +1 -1
- package/plugin/skills/agentcrm-install/references/s3.md +1 -1
- package/plugin/skills/agentcrm-manage/SKILL.md +15 -15
- package/plugin/skills/agentcrm-sales/SKILL.md +18 -18
- package/dist/admin/assets/firebase-U38f5kc9.js +0 -2
- package/dist/agent/chunks/api-Dwb4xz1k.mjs +0 -27
package/README.md
CHANGED
|
@@ -52,14 +52,14 @@ The `agentcrm-install` skill asks where the data lives, then where the admin is
|
|
|
52
52
|
### By hand
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
56
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
57
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
58
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
59
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
55
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 options # backends, locations, hostings, plan format
|
|
56
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 credentials set s3:main # hidden prompt
|
|
57
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 install --plan plan.json --dry-run
|
|
58
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 install --plan plan.json
|
|
59
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 doctor --site acme
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Or try it without any account: `npx -y @fleox-agent-crm/agentcrm@0.
|
|
62
|
+
Or try it without any account: `npx -y @fleox-agent-crm/agentcrm@0.4.0 serve` opens the setup wizard; pick **This browser** (optionally with demo data).
|
|
63
63
|
|
|
64
64
|
## Features
|
|
65
65
|
|
|
@@ -85,8 +85,8 @@ Everything you can customise in the admin, an AI agent can do too (CLI, MCP tool
|
|
|
85
85
|
Settings → **Modules** switches built-in features off for the whole workspace: dashboard, deals & pipelines, reports, lead forms, tasks, automations, email & calendar, AI assistant. Disabling hides pages, navigation, widgets and owned objects; it never deletes data. Dependencies are checked (cascade on request). [docs/modules.md](docs/modules.md)
|
|
86
86
|
|
|
87
87
|
```bash
|
|
88
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
89
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
88
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 modules list --site acme
|
|
89
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 modules disable forms --site acme --yes
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
### Appearance — make it yours
|
|
@@ -94,9 +94,9 @@ npx -y @fleox-agent-crm/agentcrm@0.3.2 modules disable forms --site acme --yes
|
|
|
94
94
|
Settings → **Appearance**: one accent color generates the whole palette; neutral grays, radius, density, font (system or Google fonts), sidebar style, accent or neutral buttons, high contrast, default light / dark mode, logo, favicon, custom CSS, seven presets (default, ocean, forest, sunset, graphite, rose, high-contrast) and theme extensions. [docs/appearance.md](docs/appearance.md)
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
98
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
99
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
97
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 appearance set --accent "#0f766e" --neutral stone --buttons accent --site acme --yes
|
|
98
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 appearance logo ./logo.svg --site acme --yes
|
|
99
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 appearance preset ocean --site acme --yes
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
### Extensions — add features without rebuilding
|
|
@@ -104,10 +104,10 @@ npx -y @fleox-agent-crm/agentcrm@0.3.2 appearance preset ocean --site acme --yes
|
|
|
104
104
|
Modules (pages, record tabs, dashboard widgets, settings pages, AI tools, automation actions, hooks) and themes are ZIPs installed from Settings → Modules → **Installed extensions** or the CLI, stored in the CRM's own data and loaded at runtime by every admin — and by the CLI / MCP server, so their AI tools and automation actions work there too. Installing runs code with admin rights: the admin and the CLI always show who made it and what it adds first; safe mode (`?safe=1`, or `--safe`) starts without extensions. [docs/extensions.md](docs/extensions.md)
|
|
105
105
|
|
|
106
106
|
```bash
|
|
107
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
107
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 ext new module acme-projects # scaffold (Vite + typings + en/fr)
|
|
108
108
|
cd acme-projects && npm install && npm run build
|
|
109
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
110
|
-
npx -y @fleox-agent-crm/agentcrm@0.
|
|
109
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 ext check . # validate + load it like the admin
|
|
110
|
+
npx -y @fleox-agent-crm/agentcrm@0.4.0 ext install . --site acme --yes # install (plan without --yes)
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
Guides: [creating a module](docs/creating-a-module.md), [creating a theme](docs/creating-a-theme.md), [runtime API reference](docs/runtime-api-reference.md). Examples: [`external/`](external).
|
|
@@ -157,7 +157,7 @@ S3 / R2 / OVH / Scaleway buckets (HTTPS), GitHub Pages, GitLab Pages, Cloudflare
|
|
|
157
157
|
|
|
158
158
|
## CLI
|
|
159
159
|
|
|
160
|
-
`agentcrm` runs on Node.js 20+ (`npx -y @fleox-agent-crm/agentcrm@0.
|
|
160
|
+
`agentcrm` runs on Node.js 20+ (`npx -y @fleox-agent-crm/agentcrm@0.4.0 <command>`). Every command accepts `--json` and prints exactly one `{ ok, data }` / `{ ok: false, error: { code, message, hint } }` object; destructive commands print a plan unless `--yes`.
|
|
161
161
|
|
|
162
162
|
| Area | Commands |
|
|
163
163
|
|---|---|
|
|
@@ -176,7 +176,7 @@ Full reference: [docs/cli.md](docs/cli.md).
|
|
|
176
176
|
## MCP server
|
|
177
177
|
|
|
178
178
|
```bash
|
|
179
|
-
claude mcp add agentcrm -- npx -y @fleox-agent-crm/agentcrm@0.
|
|
179
|
+
claude mcp add agentcrm -- npx -y @fleox-agent-crm/agentcrm@0.4.0 mcp --site acme
|
|
180
180
|
```
|
|
181
181
|
|
|
182
182
|
Tools = the shared AI catalog (search, list, get, create, update, delete, merge records, notes, activities, tasks, deal stages, reports, CSV import, automations…), resources = schema, pipelines, modules and appearance, plus the tools of the site's enabled extension modules; prompts = pipeline review, follow-up email, lead qualification. `--read-only` hides every tool that writes. Claude Desktop / Cursor config: [docs/mcp.md](docs/mcp.md).
|
package/changelog.json
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"versions": [
|
|
3
|
+
{
|
|
4
|
+
"version": "0.4.0",
|
|
5
|
+
"date": "2026-11-04",
|
|
6
|
+
"breaking": false,
|
|
7
|
+
"changes": [
|
|
8
|
+
"Firebase: incremental loading. Each client keeps a local copy of the dataset (admin: IndexedDB, CLI: ~/.agentcrm/cache/, mode 0600, per project and user) and reads only the documents written since its last open; live updates listen to those changes only. Before, every open of the admin read the whole dataset twice and every CLI command once, which the free Spark plan (50k reads a day) could not hold for a CRM of a few thousand records. A full read still happens once a week.",
|
|
9
|
+
"Firebase: every write stamps a server time (`_ts`) and every delete leaves a tombstone in `deletions/{collection}__{id}`, in the same batch.",
|
|
10
|
+
"doctor reports the Firestore reads of the load (`firestore-reads`); the admin exposes the same figure as `__AGENTCRM_FIRESTORE__` in the browser console."
|
|
11
|
+
],
|
|
12
|
+
"actions": [
|
|
13
|
+
"Firebase CRMs: publish the new Firestore rules (Settings → Data backend → Firestore security rules, or `agentcrm options --firebase-rules <bootstrap admin email>`). Until then every delete is refused (its tombstone has no rule) and self profile edits fail."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"version": "0.3.3",
|
|
18
|
+
"date": "2026-11-04",
|
|
19
|
+
"breaking": false,
|
|
20
|
+
"changes": [
|
|
21
|
+
"Firebase: users added from the CLI / MCP get their invitation again. The store mirrors invitations only for an admin caller and the CLI never resolved its identity when the site has a recorded --user, so `users add` created the user without `invites/{email}` and that person could not sign in."
|
|
22
|
+
],
|
|
23
|
+
"actions": [
|
|
24
|
+
"Users added from the CLI on a Firebase CRM with 0.3.1 or 0.3.2: re-save them once (e.g. `agentcrm users role <email> <role>`) to write the missing invitation."
|
|
25
|
+
]
|
|
26
|
+
},
|
|
3
27
|
{
|
|
4
28
|
"version": "0.3.2",
|
|
5
29
|
"date": "2026-11-04",
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.4.0",
|
|
3
3
|
"dataSchema": 1,
|
|
4
4
|
"files": [
|
|
5
|
-
"assets/chartsImpl-
|
|
6
|
-
"assets/firebase-
|
|
7
|
-
"assets/gitJson-
|
|
8
|
-
"assets/index-
|
|
5
|
+
"assets/chartsImpl-zjsXDhuy.js",
|
|
6
|
+
"assets/firebase-C3h9mF8O.js",
|
|
7
|
+
"assets/gitJson-nrOYgX0x.js",
|
|
8
|
+
"assets/index-0ejjkW0z.js",
|
|
9
9
|
"assets/index-TcjySLVg.css",
|
|
10
10
|
"assets/index.esm-BFc7vwnl.js",
|
|
11
11
|
"assets/index.esm-CtEQZRb1.js",
|
|
12
12
|
"assets/index.esm-Dum0J07z.js",
|
|
13
13
|
"assets/index.esm2017-EOzKbpUS.js",
|
|
14
|
-
"assets/lucide-react.min-
|
|
15
|
-
"assets/sdk-
|
|
14
|
+
"assets/lucide-react.min-CI5dCsSm.js",
|
|
15
|
+
"assets/sdk-mepKXtVl.js",
|
|
16
16
|
"favicon.svg",
|
|
17
17
|
"index.html",
|
|
18
18
|
"runtime/agentcrm-runtime.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Hb=Object.defineProperty;var Vb=(e,t,r)=>t in e?Hb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Wi=(e,t,r)=>Vb(e,typeof t!="symbol"?t+"":t,r);import{E as v,H as te,b as Cu,I as Tu,g as qb,R as Yb,J as hi,K as N,L as Ic,M as Gb,N as Xb,O as Uv,P as Ft}from"./index-BpaxrJx9.js";var Zb=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Mu(e){if(typeof e!="string")return!1;var t=Zb;return t.includes(e)}var Qb=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Jb=new Set(Qb);function Hv(e){return typeof e!="string"?!1:Jb.has(e)}function Vv(e){return typeof e=="string"&&e.startsWith("data-")}function pt(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Hv(r)||Vv(r))&&(t[r]=e[r]);return t}function vi(e){if(e==null)return null;if(v.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return pt(t)}return typeof e=="object"&&!Array.isArray(e)?pt(e):null}function Xe(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Hv(r)||Vv(r)||Mu(r))&&(t[r]=e[r]);return t}function ex(e){return e==null?null:v.isValidElement(e)?Xe(e.props):typeof e=="object"&&!Array.isArray(e)?Xe(e):null}var tx=["children","width","height","viewBox","className","style","title","desc"];function Ll(){return Ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ll.apply(null,arguments)}function rx(e,t){if(e==null)return{};var r,n,i=nx(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function nx(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Du=v.forwardRef((e,t)=>{var r=e.children,n=e.width,i=e.height,a=e.viewBox,o=e.className,l=e.style,u=e.title,s=e.desc,c=rx(e,tx),f=a||{width:n,height:i,x:0,y:0},d=te("recharts-surface",o);return v.createElement("svg",Ll({},Xe(c),{className:d,width:n,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),v.createElement("title",null,u),v.createElement("desc",null,s),r)}),ix=["children","className"];function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rl.apply(null,arguments)}function ax(e,t){if(e==null)return{};var r,n,i=ox(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function ox(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Ze=v.forwardRef((e,t)=>{var r=e.children,n=e.className,i=ax(e,ix),a=te("recharts-layer",n);return v.createElement("g",Rl({className:a},Xe(i),{ref:t}),r)});function zl(e){return e==="__proto__"}const lx=Object.prototype.hasOwnProperty;function dn(e,t){return lx.call(e,t)}const ux=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function qv(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e===""||e.startsWith(".")||e.endsWith(".")?!1:ux.test(e);default:return!1}}function no(e){var t;return typeof e=="string"||typeof e=="symbol"?e:Object.is(e==null||(t=e.valueOf)===null||t===void 0?void 0:t.call(e),-0)?"-0":String(e)}function $u(e){return typeof e=="symbol"||e instanceof Symbol}function Yv(e){if(typeof e=="string")return e;if(Array.isArray(e)){let r="";for(let n=0;n<e.length;n++)n>0&&(r+=","),r+=Yv(e[n]);return r}if($u(e))return e.toString();const t=e+"";return t==="0"&&Object.is(Number(e),-0)?"-0":t}function sx(e){return e==null?"":Yv(e)}function Nu(e){if(Array.isArray(e))return e.map(no);if(typeof e=="symbol")return[e];e=sx(e);const t=[],r=e.length;if(r===0)return t;let n=0,i="",a="",o=!1,l=!1;const u=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push("");n<r;){const s=e[n];if(a)s==="\\"&&n+1<r?(n++,i+=e[n]):s===a?a="":i+=s;else if(o)if(s==='"'||s==="'")a=s,l=!0;else if(s==="]"){if(o=!1,!l&&i.includes(".")&&!u.test(i)){const c=i.split(".");for(let f=0;f<c.length;f++)c[f]!==""&&t.push(c[f])}else t.push(i);i=""}else i+=s;else if(s==="[")o=!0,l=!1,i&&(t.push(i),i="");else if(s==="."){i&&(t.push(i),i="");const c=e[n+1];(c===void 0||c===".")&&t.push("")}else i+=s;n++}return i&&t.push(i),t}function Ht(e,t,r){if(e==null)return r;switch(typeof t){case"string":{if(zl(t))return r;const n=e[t];return n===void 0?qv(t)&&!dn(e,t)?Ht(e,Nu(t),r):r:n}case"number":case"symbol":{typeof t=="number"&&(t=no(t));const n=e[t];return n===void 0?r:n}default:{if(Array.isArray(t))return cx(e,t,r);if(Object.is(t==null?void 0:t.valueOf(),-0)?t="-0":t=String(t),zl(t))return r;const n=e[t];return n===void 0?r:n}}}function cx(e,t,r){if(t.length===0)return r;let n=e;for(let i=0;i<t.length;i++){if(n==null||zl(t[i]))return r;n=n[t[i]]}return n===void 0?r:n}var fx=4;function Rt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fx,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function ke(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((i,a,o)=>{var l=r[o-1];return typeof l=="string"?i+l+a:l!==void 0?i+Rt(l)+a:i+a},"")}var Ke=e=>e===0?0:e>0?1:-1,jt=e=>typeof e=="number"&&e!=+e,Tr=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,T=e=>(typeof e=="number"||e instanceof Number)&&!jt(e),Ct=e=>T(e)||typeof e=="string",dx=0,ti=e=>{var t=++dx;return"".concat(e||"").concat(t)},mt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!T(t)&&typeof t!="string")return n;var a;if(Tr(t)){if(r==null)return n;var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return jt(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},Gv=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[String(e[n])])r[String(e[n])]=!0;else return!0;return!1};function ve(e,t,r){return T(e)&&T(t)?Rt(e+r*(t-e)):t}function Xv(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):Ht(n,t))===r)}var ue=e=>e===null||typeof e>"u",pi=e=>ue(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Ue(e){return e!=null}function Wr(){}function Lu(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function kc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kc(Object(r),!0).forEach(function(n){hx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hx(e,t,r){return(t=vx(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vx(e){var t=px(e,"string");return typeof t=="symbol"?t:t+""}function px(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zv=e=>{var t=e.viewBox,r=e.position,n=e.offset,i=n===void 0?0:n,a=e.parentViewBox,o=e.clamp,l=Lu(t),u=l.x,s=l.y,c=l.height,f=l.upperWidth,d=l.lowerWidth,h=u,p=u+(f-d)/2,y=(h+p)/2,m=(f+d)/2,g=h+f/2,b=c>=0?1:-1,x=b*i,A=b>0?"end":"start",P=b>0?"start":"end",w=f>=0?1:-1,_=w*i,E=w>0?"end":"start",j=w>0?"start":"end",k=a;if(r==="top"){var I={x:h+f/2,y:s-x,horizontalAnchor:"middle",verticalAnchor:A};return o&&k&&(I.height=Math.max(s-k.y,0),I.width=f),I}if(r==="bottom"){var S={x:p+d/2,y:s+c+x,horizontalAnchor:"middle",verticalAnchor:P};return o&&k&&(S.height=Math.max(k.y+k.height-(s+c),0),S.width=d),S}if(r==="left"){var z={x:y-_,y:s+c/2,horizontalAnchor:E,verticalAnchor:"middle"};return o&&k&&(z.width=Math.max(z.x-k.x,0),z.height=c),z}if(r==="right"){var L={x:y+m+_,y:s+c/2,horizontalAnchor:j,verticalAnchor:"middle"};return o&&k&&(L.width=Math.max(k.x+k.width-L.x,0),L.height=c),L}var R=o&&k?{width:m,height:c}:{};return r==="insideLeft"?wt({x:y+_,y:s+c/2,horizontalAnchor:j,verticalAnchor:"middle"},R):r==="insideRight"?wt({x:y+m-_,y:s+c/2,horizontalAnchor:E,verticalAnchor:"middle"},R):r==="insideTop"?wt({x:h+f/2,y:s+x,horizontalAnchor:"middle",verticalAnchor:P},R):r==="insideBottom"?wt({x:p+d/2,y:s+c-x,horizontalAnchor:"middle",verticalAnchor:A},R):r==="insideTopLeft"?wt({x:h+_,y:s+x,horizontalAnchor:j,verticalAnchor:P},R):r==="insideTopRight"?wt({x:h+f-_,y:s+x,horizontalAnchor:E,verticalAnchor:P},R):r==="insideBottomLeft"?wt({x:p+_,y:s+c-x,horizontalAnchor:j,verticalAnchor:A},R):r==="insideBottomRight"?wt({x:p+d-_,y:s+c-x,horizontalAnchor:E,verticalAnchor:A},R):r&&typeof r=="object"&&(T(r.x)||Tr(r.x))&&(T(r.y)||Tr(r.y))?wt({x:u+mt(r.x,m),y:s+mt(r.y,c),horizontalAnchor:"end",verticalAnchor:"end"},R):wt({x:g,y:s+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},mx=["top","left","right","bottom"];function Ru(e){return e==null?!1:typeof e=="object"?!0:mx.includes(e)}var Qv=v.createContext(null),yx=()=>v.useContext(Qv);const qn=Math.PI,Bl=2*qn,xr=1e-6,gx=Bl-xr;function Jv(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function bx(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Jv;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}function ep(e,t,r,n){return e===r&&t===n}function xx(e){const t=Math.floor(e);if(!(t<=15))return ep;const r=10**t,n=function(i){return Math.round(i*r)};return function(i,a,o,l){return n(i)===n(o)&&n(a)===n(l)}}class wx{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Jv:bx(t),this._equal=t==null?ep:xx(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,o){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,u=n-t,s=i-r,c=o-t,f=l-r,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(d>xr)if(!(Math.abs(f*u-s*c)>xr)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,p=i-l,y=u*u+s*s,m=h*h+p*p,g=Math.sqrt(y),b=Math.sqrt(d),x=a*Math.tan((qn-Math.acos((y+d-m)/(2*g*b)))/2),A=x/b,P=x/g;Math.abs(A-1)>xr&&this._append`L${t+A*c},${r+A*f}`,this._append`A${a},${a},0,0,${+(f*h>c*p)},${this._x1=t+P*u},${this._y1=r+P*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),u=n*Math.sin(i),s=t+l,c=r+u,f=1^o,d=o?i-a:a-i;if(this._x1===null?this._append`M${s},${c}`:(Math.abs(this._x1-s)>xr||Math.abs(this._y1-c)>xr)&&this._append`L${s},${c}`,!!n){if(d<0&&(d=d%Bl+Bl),d>gx)this._append`A${n},${n},0,1,${f},${t-l},${r-u}A${n},${n},0,1,${f},${this._x1=s},${this._y1=c}`;else if(d>xr){const h=t+n*Math.cos(a),p=r+n*Math.sin(a);if(d>=qn&&this._equal(s,c,h,p)){d/=2;let y=i+d;this._append`A${n},${n},0,${+(d>=qn)},${f},${t+n*Math.cos(y)},${r+n*Math.sin(y)}`}this._append`A${n},${n},0,${+(d>=qn)},${f},${this._x1=h},${this._y1=p}`}}}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function ne(e){return function(){return e}}const tp=Math.cos,ca=Math.sin,gt=Math.sqrt,jc=1e-12,fa=Math.PI,io=2*fa;function zu(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new wx(t)}function Bu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rp(e){this._context=e}rp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ao(e){return new rp(e)}function np(e){return e[0]}function ip(e){return e[1]}function ap(e,t){var r=ne(!0),n=null,i=ao,a=null,o=zu(l);e=typeof e=="function"?e:e===void 0?np:ne(e),t=typeof t=="function"?t:t===void 0?ip:ne(t);function l(u){var s,c=(u=Bu(u)).length,f,d=!1,h;for(n==null&&(a=i(h=o())),s=0;s<=c;++s)!(s<c&&r(f=u[s],s,u))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(f,s,u),+t(f,s,u));if(h)return a=null,h+""||null}return l.x=function(u){return arguments.length?(e=typeof u=="function"?u:ne(+u),l):e},l.y=function(u){return arguments.length?(t=typeof u=="function"?u:ne(+u),l):t},l.defined=function(u){return arguments.length?(r=typeof u=="function"?u:ne(!!u),l):r},l.curve=function(u){return arguments.length?(i=u,n!=null&&(a=i(n)),l):i},l.context=function(u){return arguments.length?(u==null?n=a=null:a=i(n=u),l):n},l}function Fi(e,t,r){var n=null,i=ne(!0),a=null,o=ao,l=null,u=zu(s);e=typeof e=="function"?e:e===void 0?np:ne(+e),t=typeof t=="function"?t:ne(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?ip:ne(+r);function s(f){var d,h,p,y=(f=Bu(f)).length,m,g=!1,b,x=new Array(y),A=new Array(y);for(a==null&&(l=o(b=u())),d=0;d<=y;++d){if(!(d<y&&i(m=f[d],d,f))===g)if(g=!g)h=d,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),p=d-1;p>=h;--p)l.point(x[p],A[p]);l.lineEnd(),l.areaEnd()}g&&(x[d]=+e(m,d,f),A[d]=+t(m,d,f),l.point(n?+n(m,d,f):x[d],r?+r(m,d,f):A[d]))}if(b)return l=null,b+""||null}function c(){return ap().defined(i).curve(o).context(a)}return s.x=function(f){return arguments.length?(e=typeof f=="function"?f:ne(+f),n=null,s):e},s.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ne(+f),s):e},s.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ne(+f),s):n},s.y=function(f){return arguments.length?(t=typeof f=="function"?f:ne(+f),r=null,s):t},s.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ne(+f),s):t},s.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ne(+f),s):r},s.lineX0=s.lineY0=function(){return c().x(e).y(t)},s.lineY1=function(){return c().x(e).y(r)},s.lineX1=function(){return c().x(n).y(t)},s.defined=function(f){return arguments.length?(i=typeof f=="function"?f:ne(!!f),s):i},s.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),s):o},s.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),s):a},s}class op{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Ax(e){return new op(e,!0)}function Px(e){return new op(e,!1)}var Wu={draw(e,t){const r=gt(t/fa);e.moveTo(r,0),e.arc(0,0,r,0,io)}},Ox={draw(e,t){const r=gt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}};const lp=gt(1/3),_x=lp*2;var Sx={draw(e,t){const r=gt(t/_x),n=r*lp;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Ex={draw(e,t){const r=gt(t),n=-r/2;e.rect(n,n,r,r)}};const Ix=.8908130915292852,up=ca(fa/10)/ca(7*fa/10),kx=ca(io/10)*up,jx=-tp(io/10)*up;var Cx={draw(e,t){const r=gt(t*Ix),n=kx*r,i=jx*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=io*a/5,l=tp(o),u=ca(o);e.lineTo(u*r,-l*r),e.lineTo(l*n-u*i,u*n+l*i)}e.closePath()}};const Zo=gt(3);var Tx={draw(e,t){const r=-gt(t/(Zo*3));e.moveTo(0,r*2),e.lineTo(-Zo*r,-r),e.lineTo(Zo*r,-r),e.closePath()}};const Je=-.5,et=gt(3)/2,Wl=1/gt(12),Mx=(Wl/2+1)*3;var Dx={draw(e,t){const r=gt(t/Mx),n=r/2,i=r*Wl,a=n,o=r*Wl+r,l=-a,u=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(l,u),e.lineTo(Je*n-et*i,et*n+Je*i),e.lineTo(Je*a-et*o,et*a+Je*o),e.lineTo(Je*l-et*u,et*l+Je*u),e.lineTo(Je*n+et*i,Je*i-et*n),e.lineTo(Je*a+et*o,Je*o-et*a),e.lineTo(Je*l+et*u,Je*u-et*l),e.closePath()}};function $x(e,t){let r=null,n=zu(i);e=typeof e=="function"?e:ne(e||Wu),t=typeof t=="function"?t:ne(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:ne(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:ne(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function ur(){}function da(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function oo(e){this._context=e}oo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:da(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nx(e){return new oo(e)}function sp(e){this._context=e}sp.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Lx(e){return new sp(e)}function cp(e){this._context=e}cp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rx(e){return new cp(e)}function fp(e,t){this._basis=new oo(e),this._beta=t}fp.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],a=e[r]-n,o=t[r]-i,l=-1,u;++l<=r;)u=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(n+u*a),this._beta*t[l]+(1-this._beta)*(i+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};(function e(t){function r(n){return t===1?new oo(n):new fp(n,t)}return r.beta=function(n){return e(+n)},r})(.85);function ha(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Fu(e,t){this._context=e,this._k=(1-t)/6}Fu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ha(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Fu(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Ku(e,t){this._context=e,this._k=(1-t)/6}Ku.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Ku(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Uu(e,t){this._context=e,this._k=(1-t)/6}Uu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Uu(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Hu(e,t,r){var n=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>jc){var l=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*l-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*l-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>jc){var s=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*s+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*s+e._y1*e._l23_2a-r*e._l12_2a)/c}e._context.bezierCurveTo(n,i,a,o,e._x2,e._y2)}function dp(e,t){this._context=e,this._alpha=t}dp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new dp(n,t):new Fu(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function hp(e,t){this._context=e,this._alpha=t}hp.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new hp(n,t):new Ku(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function vp(e,t){this._context=e,this._alpha=t}vp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new vp(n,t):new Uu(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function pp(e){this._context=e}pp.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function zx(e){return new pp(e)}function Cc(e){return e<0?-1:1}function Tc(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(a*i+o*n)/(n+i);return(Cc(a)+Cc(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function Mc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Qo(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-n)/3;e._context.bezierCurveTo(n+l,i+l*t,a-l,o-l*r,a,o)}function va(e){this._context=e}va.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Qo(this,this._t0,Mc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Qo(this,Mc(this,r=Tc(this,e,t)),r);break;default:Qo(this,this._t0,r=Tc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function mp(e){this._context=new yp(e)}(mp.prototype=Object.create(va.prototype)).point=function(e,t){va.prototype.point.call(this,t,e)};function yp(e){this._context=e}yp.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function Bx(e){return new va(e)}function Wx(e){return new mp(e)}function gp(e){this._context=e}gp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Dc(e),i=Dc(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Dc(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Fx(e){return new gp(e)}function lo(e,t){this._context=e,this._t=t}lo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Kx(e){return new lo(e,.5)}function Ux(e){return new lo(e,0)}function Hx(e){return new lo(e,1)}function Mr(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,l=a.length;r<o;++r)for(i=a,a=e[t[r]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Fl(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Vx(e,t){return e[t]}function qx(e){const t=[];return t.key=e,t}function Yx(){var e=ne([]),t=Fl,r=Mr,n=Vx;function i(a){var o=Array.from(e.apply(this,arguments),qx),l,u=o.length,s=-1,c;for(const f of a)for(l=0,++s;l<u;++l)(o[l][s]=[0,+n(f,o[l].key,s,a)]).data=f;for(l=0,c=Bu(t(o));l<u;++l)o[c[l]].index=l;return r(o,c),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:ne(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:ne(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?Fl:typeof a=="function"?a:ne(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??Mr,i):r},i}function Gx(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,o;i<a;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}Mr(e,t)}}function Xx(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var o=0,l=0;o<i;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}Mr(e,t)}}function Zx(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n<a;++n){for(var l=0,u=0,s=0;l<o;++l){for(var c=e[t[l]],f=c[n][1]||0,d=c[n-1][1]||0,h=(f-d)/2,p=0;p<l;++p){var y=e[t[p]],m=y[n][1]||0,g=y[n-1][1]||0;h+=m-g}u+=f,s+=h*f}i[n-1][1]+=i[n-1][0]=r,u&&(r-=s/u)}i[n-1][1]+=i[n-1][0]=r,Mr(e,t)}}var Qx=["type","size","sizeType"];function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kl.apply(null,arguments)}function $c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Nc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$c(Object(r),!0).forEach(function(n){Jx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$c(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jx(e,t,r){return(t=ew(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ew(e){var t=tw(e,"string");return typeof t=="symbol"?t:t+""}function tw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rw(e,t){if(e==null)return{};var r,n,i=nw(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function nw(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var bp={symbolCircle:Wu,symbolCross:Ox,symbolDiamond:Sx,symbolSquare:Ex,symbolStar:Cx,symbolTriangle:Tx,symbolWye:Dx},iw=Math.PI/180,aw=e=>{var t="symbol".concat(pi(e));return bp[t]||Wu},ow=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*iw;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},lw=(e,t)=>{bp["symbol".concat(pi(e))]=t},xp=e=>{var t=e.type,r=t===void 0?"circle":t,n=e.size,i=n===void 0?64:n,a=e.sizeType,o=a===void 0?"area":a,l=rw(e,Qx),u=Nc(Nc({},l),{},{type:r,size:i,sizeType:o}),s="circle";typeof r=="string"&&(s=r);var c=()=>{var y=aw(s),m=$x().type(y).size(ow(i,o,s)),g=m();if(g!==null)return g},f=u.className,d=u.cx,h=u.cy,p=Xe(u);return T(d)&&T(h)&&T(i)?v.createElement("path",Kl({},p,{className:te("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:c()})):null};xp.registerSymbol=lw;var wp=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Vu=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(v.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Mu(i)&&typeof r[i]=="function"&&(n[i]=(a=>r[i](r,a)))}),n},uw=(e,t,r)=>n=>(e(t,r,n),null),uo=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];Mu(i)&&typeof a=="function"&&(n||(n={}),n[i]=uw(a,t,r))}),n};function Lc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lc(Object(r),!0).forEach(function(n){cw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cw(e,t,r){return(t=fw(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fw(e){var t=dw(e,"string");return typeof t=="symbol"?t:t+""}function dw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ne(e,t){var r=sw({},e),n=t,i=Object.keys(t),a=i.reduce((o,l)=>(o[l]===void 0&&n[l]!==void 0&&(o[l]=n[l]),o),r);return a}function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pa.apply(null,arguments)}function Rc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ap(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rc(Object(r),!0).forEach(function(n){hw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hw(e,t,r){return(t=vw(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vw(e){var t=pw(e,"string");return typeof t=="symbol"?t:t+""}function pw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rt=32,mw={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function yw(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function gw(e){var t=e.data,r=e.iconType,n=e.inactiveColor,i=rt/2,a=rt/6,o=rt/3,l=t.inactive?n:t.color,u=r??t.type;if(u==="none")return null;if(u==="plainline")return v.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:yw(t.payload),x1:0,y1:i,x2:rt,y2:i,className:"recharts-legend-icon"});if(u==="line")return v.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(o,`
|
|
1
|
+
var Hb=Object.defineProperty;var Vb=(e,t,r)=>t in e?Hb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Wi=(e,t,r)=>Vb(e,typeof t!="symbol"?t+"":t,r);import{E as v,H as te,r as Cu,I as Tu,g as qb,R as Yb,J as hi,K as N,L as Ic,M as Gb,N as Xb,O as Uv,P as Ft}from"./index-0ejjkW0z.js";var Zb=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Mu(e){if(typeof e!="string")return!1;var t=Zb;return t.includes(e)}var Qb=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Jb=new Set(Qb);function Hv(e){return typeof e!="string"?!1:Jb.has(e)}function Vv(e){return typeof e=="string"&&e.startsWith("data-")}function pt(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Hv(r)||Vv(r))&&(t[r]=e[r]);return t}function vi(e){if(e==null)return null;if(v.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return pt(t)}return typeof e=="object"&&!Array.isArray(e)?pt(e):null}function Xe(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Hv(r)||Vv(r)||Mu(r))&&(t[r]=e[r]);return t}function ex(e){return e==null?null:v.isValidElement(e)?Xe(e.props):typeof e=="object"&&!Array.isArray(e)?Xe(e):null}var tx=["children","width","height","viewBox","className","style","title","desc"];function Ll(){return Ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ll.apply(null,arguments)}function rx(e,t){if(e==null)return{};var r,n,i=nx(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function nx(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Du=v.forwardRef((e,t)=>{var r=e.children,n=e.width,i=e.height,a=e.viewBox,o=e.className,l=e.style,u=e.title,s=e.desc,c=rx(e,tx),f=a||{width:n,height:i,x:0,y:0},d=te("recharts-surface",o);return v.createElement("svg",Ll({},Xe(c),{className:d,width:n,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),v.createElement("title",null,u),v.createElement("desc",null,s),r)}),ix=["children","className"];function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rl.apply(null,arguments)}function ax(e,t){if(e==null)return{};var r,n,i=ox(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function ox(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Ze=v.forwardRef((e,t)=>{var r=e.children,n=e.className,i=ax(e,ix),a=te("recharts-layer",n);return v.createElement("g",Rl({className:a},Xe(i),{ref:t}),r)});function zl(e){return e==="__proto__"}const lx=Object.prototype.hasOwnProperty;function dn(e,t){return lx.call(e,t)}const ux=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function qv(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e===""||e.startsWith(".")||e.endsWith(".")?!1:ux.test(e);default:return!1}}function no(e){var t;return typeof e=="string"||typeof e=="symbol"?e:Object.is(e==null||(t=e.valueOf)===null||t===void 0?void 0:t.call(e),-0)?"-0":String(e)}function $u(e){return typeof e=="symbol"||e instanceof Symbol}function Yv(e){if(typeof e=="string")return e;if(Array.isArray(e)){let r="";for(let n=0;n<e.length;n++)n>0&&(r+=","),r+=Yv(e[n]);return r}if($u(e))return e.toString();const t=e+"";return t==="0"&&Object.is(Number(e),-0)?"-0":t}function sx(e){return e==null?"":Yv(e)}function Nu(e){if(Array.isArray(e))return e.map(no);if(typeof e=="symbol")return[e];e=sx(e);const t=[],r=e.length;if(r===0)return t;let n=0,i="",a="",o=!1,l=!1;const u=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push("");n<r;){const s=e[n];if(a)s==="\\"&&n+1<r?(n++,i+=e[n]):s===a?a="":i+=s;else if(o)if(s==='"'||s==="'")a=s,l=!0;else if(s==="]"){if(o=!1,!l&&i.includes(".")&&!u.test(i)){const c=i.split(".");for(let f=0;f<c.length;f++)c[f]!==""&&t.push(c[f])}else t.push(i);i=""}else i+=s;else if(s==="[")o=!0,l=!1,i&&(t.push(i),i="");else if(s==="."){i&&(t.push(i),i="");const c=e[n+1];(c===void 0||c===".")&&t.push("")}else i+=s;n++}return i&&t.push(i),t}function Ht(e,t,r){if(e==null)return r;switch(typeof t){case"string":{if(zl(t))return r;const n=e[t];return n===void 0?qv(t)&&!dn(e,t)?Ht(e,Nu(t),r):r:n}case"number":case"symbol":{typeof t=="number"&&(t=no(t));const n=e[t];return n===void 0?r:n}default:{if(Array.isArray(t))return cx(e,t,r);if(Object.is(t==null?void 0:t.valueOf(),-0)?t="-0":t=String(t),zl(t))return r;const n=e[t];return n===void 0?r:n}}}function cx(e,t,r){if(t.length===0)return r;let n=e;for(let i=0;i<t.length;i++){if(n==null||zl(t[i]))return r;n=n[t[i]]}return n===void 0?r:n}var fx=4;function Rt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fx,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function ke(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((i,a,o)=>{var l=r[o-1];return typeof l=="string"?i+l+a:l!==void 0?i+Rt(l)+a:i+a},"")}var Ke=e=>e===0?0:e>0?1:-1,jt=e=>typeof e=="number"&&e!=+e,Tr=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,T=e=>(typeof e=="number"||e instanceof Number)&&!jt(e),Ct=e=>T(e)||typeof e=="string",dx=0,ti=e=>{var t=++dx;return"".concat(e||"").concat(t)},mt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!T(t)&&typeof t!="string")return n;var a;if(Tr(t)){if(r==null)return n;var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return jt(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},Gv=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[String(e[n])])r[String(e[n])]=!0;else return!0;return!1};function ve(e,t,r){return T(e)&&T(t)?Rt(e+r*(t-e)):t}function Xv(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):Ht(n,t))===r)}var ue=e=>e===null||typeof e>"u",pi=e=>ue(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Ue(e){return e!=null}function Wr(){}function Lu(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function kc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kc(Object(r),!0).forEach(function(n){hx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hx(e,t,r){return(t=vx(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vx(e){var t=px(e,"string");return typeof t=="symbol"?t:t+""}function px(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zv=e=>{var t=e.viewBox,r=e.position,n=e.offset,i=n===void 0?0:n,a=e.parentViewBox,o=e.clamp,l=Lu(t),u=l.x,s=l.y,c=l.height,f=l.upperWidth,d=l.lowerWidth,h=u,p=u+(f-d)/2,y=(h+p)/2,m=(f+d)/2,g=h+f/2,b=c>=0?1:-1,x=b*i,A=b>0?"end":"start",P=b>0?"start":"end",w=f>=0?1:-1,_=w*i,E=w>0?"end":"start",j=w>0?"start":"end",k=a;if(r==="top"){var I={x:h+f/2,y:s-x,horizontalAnchor:"middle",verticalAnchor:A};return o&&k&&(I.height=Math.max(s-k.y,0),I.width=f),I}if(r==="bottom"){var S={x:p+d/2,y:s+c+x,horizontalAnchor:"middle",verticalAnchor:P};return o&&k&&(S.height=Math.max(k.y+k.height-(s+c),0),S.width=d),S}if(r==="left"){var z={x:y-_,y:s+c/2,horizontalAnchor:E,verticalAnchor:"middle"};return o&&k&&(z.width=Math.max(z.x-k.x,0),z.height=c),z}if(r==="right"){var L={x:y+m+_,y:s+c/2,horizontalAnchor:j,verticalAnchor:"middle"};return o&&k&&(L.width=Math.max(k.x+k.width-L.x,0),L.height=c),L}var R=o&&k?{width:m,height:c}:{};return r==="insideLeft"?wt({x:y+_,y:s+c/2,horizontalAnchor:j,verticalAnchor:"middle"},R):r==="insideRight"?wt({x:y+m-_,y:s+c/2,horizontalAnchor:E,verticalAnchor:"middle"},R):r==="insideTop"?wt({x:h+f/2,y:s+x,horizontalAnchor:"middle",verticalAnchor:P},R):r==="insideBottom"?wt({x:p+d/2,y:s+c-x,horizontalAnchor:"middle",verticalAnchor:A},R):r==="insideTopLeft"?wt({x:h+_,y:s+x,horizontalAnchor:j,verticalAnchor:P},R):r==="insideTopRight"?wt({x:h+f-_,y:s+x,horizontalAnchor:E,verticalAnchor:P},R):r==="insideBottomLeft"?wt({x:p+_,y:s+c-x,horizontalAnchor:j,verticalAnchor:A},R):r==="insideBottomRight"?wt({x:p+d-_,y:s+c-x,horizontalAnchor:E,verticalAnchor:A},R):r&&typeof r=="object"&&(T(r.x)||Tr(r.x))&&(T(r.y)||Tr(r.y))?wt({x:u+mt(r.x,m),y:s+mt(r.y,c),horizontalAnchor:"end",verticalAnchor:"end"},R):wt({x:g,y:s+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},mx=["top","left","right","bottom"];function Ru(e){return e==null?!1:typeof e=="object"?!0:mx.includes(e)}var Qv=v.createContext(null),yx=()=>v.useContext(Qv);const qn=Math.PI,Bl=2*qn,xr=1e-6,gx=Bl-xr;function Jv(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function bx(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Jv;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}function ep(e,t,r,n){return e===r&&t===n}function xx(e){const t=Math.floor(e);if(!(t<=15))return ep;const r=10**t,n=function(i){return Math.round(i*r)};return function(i,a,o,l){return n(i)===n(o)&&n(a)===n(l)}}class wx{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Jv:bx(t),this._equal=t==null?ep:xx(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,o){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,u=n-t,s=i-r,c=o-t,f=l-r,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(d>xr)if(!(Math.abs(f*u-s*c)>xr)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let h=n-o,p=i-l,y=u*u+s*s,m=h*h+p*p,g=Math.sqrt(y),b=Math.sqrt(d),x=a*Math.tan((qn-Math.acos((y+d-m)/(2*g*b)))/2),A=x/b,P=x/g;Math.abs(A-1)>xr&&this._append`L${t+A*c},${r+A*f}`,this._append`A${a},${a},0,0,${+(f*h>c*p)},${this._x1=t+P*u},${this._y1=r+P*s}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),u=n*Math.sin(i),s=t+l,c=r+u,f=1^o,d=o?i-a:a-i;if(this._x1===null?this._append`M${s},${c}`:(Math.abs(this._x1-s)>xr||Math.abs(this._y1-c)>xr)&&this._append`L${s},${c}`,!!n){if(d<0&&(d=d%Bl+Bl),d>gx)this._append`A${n},${n},0,1,${f},${t-l},${r-u}A${n},${n},0,1,${f},${this._x1=s},${this._y1=c}`;else if(d>xr){const h=t+n*Math.cos(a),p=r+n*Math.sin(a);if(d>=qn&&this._equal(s,c,h,p)){d/=2;let y=i+d;this._append`A${n},${n},0,${+(d>=qn)},${f},${t+n*Math.cos(y)},${r+n*Math.sin(y)}`}this._append`A${n},${n},0,${+(d>=qn)},${f},${this._x1=h},${this._y1=p}`}}}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function ne(e){return function(){return e}}const tp=Math.cos,ca=Math.sin,gt=Math.sqrt,jc=1e-12,fa=Math.PI,io=2*fa;function zu(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new wx(t)}function Bu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rp(e){this._context=e}rp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ao(e){return new rp(e)}function np(e){return e[0]}function ip(e){return e[1]}function ap(e,t){var r=ne(!0),n=null,i=ao,a=null,o=zu(l);e=typeof e=="function"?e:e===void 0?np:ne(e),t=typeof t=="function"?t:t===void 0?ip:ne(t);function l(u){var s,c=(u=Bu(u)).length,f,d=!1,h;for(n==null&&(a=i(h=o())),s=0;s<=c;++s)!(s<c&&r(f=u[s],s,u))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(f,s,u),+t(f,s,u));if(h)return a=null,h+""||null}return l.x=function(u){return arguments.length?(e=typeof u=="function"?u:ne(+u),l):e},l.y=function(u){return arguments.length?(t=typeof u=="function"?u:ne(+u),l):t},l.defined=function(u){return arguments.length?(r=typeof u=="function"?u:ne(!!u),l):r},l.curve=function(u){return arguments.length?(i=u,n!=null&&(a=i(n)),l):i},l.context=function(u){return arguments.length?(u==null?n=a=null:a=i(n=u),l):n},l}function Fi(e,t,r){var n=null,i=ne(!0),a=null,o=ao,l=null,u=zu(s);e=typeof e=="function"?e:e===void 0?np:ne(+e),t=typeof t=="function"?t:ne(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?ip:ne(+r);function s(f){var d,h,p,y=(f=Bu(f)).length,m,g=!1,b,x=new Array(y),A=new Array(y);for(a==null&&(l=o(b=u())),d=0;d<=y;++d){if(!(d<y&&i(m=f[d],d,f))===g)if(g=!g)h=d,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),p=d-1;p>=h;--p)l.point(x[p],A[p]);l.lineEnd(),l.areaEnd()}g&&(x[d]=+e(m,d,f),A[d]=+t(m,d,f),l.point(n?+n(m,d,f):x[d],r?+r(m,d,f):A[d]))}if(b)return l=null,b+""||null}function c(){return ap().defined(i).curve(o).context(a)}return s.x=function(f){return arguments.length?(e=typeof f=="function"?f:ne(+f),n=null,s):e},s.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ne(+f),s):e},s.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ne(+f),s):n},s.y=function(f){return arguments.length?(t=typeof f=="function"?f:ne(+f),r=null,s):t},s.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ne(+f),s):t},s.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ne(+f),s):r},s.lineX0=s.lineY0=function(){return c().x(e).y(t)},s.lineY1=function(){return c().x(e).y(r)},s.lineX1=function(){return c().x(n).y(t)},s.defined=function(f){return arguments.length?(i=typeof f=="function"?f:ne(!!f),s):i},s.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),s):o},s.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),s):a},s}class op{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Ax(e){return new op(e,!0)}function Px(e){return new op(e,!1)}var Wu={draw(e,t){const r=gt(t/fa);e.moveTo(r,0),e.arc(0,0,r,0,io)}},Ox={draw(e,t){const r=gt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}};const lp=gt(1/3),_x=lp*2;var Sx={draw(e,t){const r=gt(t/_x),n=r*lp;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Ex={draw(e,t){const r=gt(t),n=-r/2;e.rect(n,n,r,r)}};const Ix=.8908130915292852,up=ca(fa/10)/ca(7*fa/10),kx=ca(io/10)*up,jx=-tp(io/10)*up;var Cx={draw(e,t){const r=gt(t*Ix),n=kx*r,i=jx*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=io*a/5,l=tp(o),u=ca(o);e.lineTo(u*r,-l*r),e.lineTo(l*n-u*i,u*n+l*i)}e.closePath()}};const Zo=gt(3);var Tx={draw(e,t){const r=-gt(t/(Zo*3));e.moveTo(0,r*2),e.lineTo(-Zo*r,-r),e.lineTo(Zo*r,-r),e.closePath()}};const Je=-.5,et=gt(3)/2,Wl=1/gt(12),Mx=(Wl/2+1)*3;var Dx={draw(e,t){const r=gt(t/Mx),n=r/2,i=r*Wl,a=n,o=r*Wl+r,l=-a,u=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(l,u),e.lineTo(Je*n-et*i,et*n+Je*i),e.lineTo(Je*a-et*o,et*a+Je*o),e.lineTo(Je*l-et*u,et*l+Je*u),e.lineTo(Je*n+et*i,Je*i-et*n),e.lineTo(Je*a+et*o,Je*o-et*a),e.lineTo(Je*l+et*u,Je*u-et*l),e.closePath()}};function $x(e,t){let r=null,n=zu(i);e=typeof e=="function"?e:ne(e||Wu),t=typeof t=="function"?t:ne(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:ne(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:ne(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function ur(){}function da(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function oo(e){this._context=e}oo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:da(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nx(e){return new oo(e)}function sp(e){this._context=e}sp.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Lx(e){return new sp(e)}function cp(e){this._context=e}cp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:da(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rx(e){return new cp(e)}function fp(e,t){this._basis=new oo(e),this._beta=t}fp.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n=e[0],i=t[0],a=e[r]-n,o=t[r]-i,l=-1,u;++l<=r;)u=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(n+u*a),this._beta*t[l]+(1-this._beta)*(i+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};(function e(t){function r(n){return t===1?new oo(n):new fp(n,t)}return r.beta=function(n){return e(+n)},r})(.85);function ha(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Fu(e,t){this._context=e,this._k=(1-t)/6}Fu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ha(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Fu(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Ku(e,t){this._context=e,this._k=(1-t)/6}Ku.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Ku(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Uu(e,t){this._context=e,this._k=(1-t)/6}Uu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ha(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return new Uu(n,t)}return r.tension=function(n){return e(+n)},r})(0);function Hu(e,t,r){var n=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>jc){var l=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*l-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*l-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>jc){var s=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*s+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*s+e._y1*e._l23_2a-r*e._l12_2a)/c}e._context.bezierCurveTo(n,i,a,o,e._x2,e._y2)}function dp(e,t){this._context=e,this._alpha=t}dp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new dp(n,t):new Fu(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function hp(e,t){this._context=e,this._alpha=t}hp.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new hp(n,t):new Ku(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function vp(e,t){this._context=e,this._alpha=t}vp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Hu(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};(function e(t){function r(n){return t?new vp(n,t):new Uu(n,0)}return r.alpha=function(n){return e(+n)},r})(.5);function pp(e){this._context=e}pp.prototype={areaStart:ur,areaEnd:ur,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function zx(e){return new pp(e)}function Cc(e){return e<0?-1:1}function Tc(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(a*i+o*n)/(n+i);return(Cc(a)+Cc(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function Mc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Qo(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-n)/3;e._context.bezierCurveTo(n+l,i+l*t,a-l,o-l*r,a,o)}function va(e){this._context=e}va.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Qo(this,this._t0,Mc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Qo(this,Mc(this,r=Tc(this,e,t)),r);break;default:Qo(this,this._t0,r=Tc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function mp(e){this._context=new yp(e)}(mp.prototype=Object.create(va.prototype)).point=function(e,t){va.prototype.point.call(this,t,e)};function yp(e){this._context=e}yp.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function Bx(e){return new va(e)}function Wx(e){return new mp(e)}function gp(e){this._context=e}gp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Dc(e),i=Dc(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Dc(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),o=new Array(r);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Fx(e){return new gp(e)}function lo(e,t){this._context=e,this._t=t}lo.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Kx(e){return new lo(e,.5)}function Ux(e){return new lo(e,0)}function Hx(e){return new lo(e,1)}function Mr(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,l=a.length;r<o;++r)for(i=a,a=e[t[r]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Fl(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Vx(e,t){return e[t]}function qx(e){const t=[];return t.key=e,t}function Yx(){var e=ne([]),t=Fl,r=Mr,n=Vx;function i(a){var o=Array.from(e.apply(this,arguments),qx),l,u=o.length,s=-1,c;for(const f of a)for(l=0,++s;l<u;++l)(o[l][s]=[0,+n(f,o[l].key,s,a)]).data=f;for(l=0,c=Bu(t(o));l<u;++l)o[c[l]].index=l;return r(o,c),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:ne(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:ne(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?Fl:typeof a=="function"?a:ne(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??Mr,i):r},i}function Gx(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,o;i<a;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}Mr(e,t)}}function Xx(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var o=0,l=0;o<i;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}Mr(e,t)}}function Zx(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n<a;++n){for(var l=0,u=0,s=0;l<o;++l){for(var c=e[t[l]],f=c[n][1]||0,d=c[n-1][1]||0,h=(f-d)/2,p=0;p<l;++p){var y=e[t[p]],m=y[n][1]||0,g=y[n-1][1]||0;h+=m-g}u+=f,s+=h*f}i[n-1][1]+=i[n-1][0]=r,u&&(r-=s/u)}i[n-1][1]+=i[n-1][0]=r,Mr(e,t)}}var Qx=["type","size","sizeType"];function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kl.apply(null,arguments)}function $c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Nc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$c(Object(r),!0).forEach(function(n){Jx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$c(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jx(e,t,r){return(t=ew(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ew(e){var t=tw(e,"string");return typeof t=="symbol"?t:t+""}function tw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rw(e,t){if(e==null)return{};var r,n,i=nw(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function nw(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var bp={symbolCircle:Wu,symbolCross:Ox,symbolDiamond:Sx,symbolSquare:Ex,symbolStar:Cx,symbolTriangle:Tx,symbolWye:Dx},iw=Math.PI/180,aw=e=>{var t="symbol".concat(pi(e));return bp[t]||Wu},ow=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*iw;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},lw=(e,t)=>{bp["symbol".concat(pi(e))]=t},xp=e=>{var t=e.type,r=t===void 0?"circle":t,n=e.size,i=n===void 0?64:n,a=e.sizeType,o=a===void 0?"area":a,l=rw(e,Qx),u=Nc(Nc({},l),{},{type:r,size:i,sizeType:o}),s="circle";typeof r=="string"&&(s=r);var c=()=>{var y=aw(s),m=$x().type(y).size(ow(i,o,s)),g=m();if(g!==null)return g},f=u.className,d=u.cx,h=u.cy,p=Xe(u);return T(d)&&T(h)&&T(i)?v.createElement("path",Kl({},p,{className:te("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(h,")"),d:c()})):null};xp.registerSymbol=lw;var wp=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Vu=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(v.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Mu(i)&&typeof r[i]=="function"&&(n[i]=(a=>r[i](r,a)))}),n},uw=(e,t,r)=>n=>(e(t,r,n),null),uo=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];Mu(i)&&typeof a=="function"&&(n||(n={}),n[i]=uw(a,t,r))}),n};function Lc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lc(Object(r),!0).forEach(function(n){cw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cw(e,t,r){return(t=fw(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fw(e){var t=dw(e,"string");return typeof t=="symbol"?t:t+""}function dw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ne(e,t){var r=sw({},e),n=t,i=Object.keys(t),a=i.reduce((o,l)=>(o[l]===void 0&&n[l]!==void 0&&(o[l]=n[l]),o),r);return a}function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pa.apply(null,arguments)}function Rc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ap(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Rc(Object(r),!0).forEach(function(n){hw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rc(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hw(e,t,r){return(t=vw(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vw(e){var t=pw(e,"string");return typeof t=="symbol"?t:t+""}function pw(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rt=32,mw={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function yw(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function gw(e){var t=e.data,r=e.iconType,n=e.inactiveColor,i=rt/2,a=rt/6,o=rt/3,l=t.inactive?n:t.color,u=r??t.type;if(u==="none")return null;if(u==="plainline")return v.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:yw(t.payload),x1:0,y1:i,x2:rt,y2:i,className:"recharts-legend-icon"});if(u==="line")return v.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(o,`
|
|
2
2
|
A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
|
|
3
3
|
H`).concat(rt,"M").concat(2*o,",").concat(i,`
|
|
4
4
|
A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(u==="rect")return v.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(rt/8,"h").concat(rt,"v").concat(rt*3/4,"h").concat(-rt,"z"),className:"recharts-legend-icon"});if(v.isValidElement(t.legendIcon)){var s=Ap({},t);return delete s.legendIcon,v.cloneElement(t.legendIcon,s)}return v.createElement(xp,{fill:l,cx:i,cy:i,size:rt,sizeType:"diameter",type:u})}function bw(e){var t=e.payload,r=e.iconSize,n=e.layout,i=e.formatter,a=e.inactiveColor,o=e.iconType,l=e.labelStyle,u={x:0,y:0,width:rt,height:rt},s={display:n==="horizontal"?"inline-block":"block",marginRight:10,whiteSpace:"nowrap"},c={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((f,d)=>{var h,p,y=f.formatter||i,m=te({"recharts-legend-item":!0,["legend-item-".concat(d)]:!0,inactive:f.inactive});if(f.type==="none")return null;var g=typeof l=="object"?Ap({},l):{};g.color=f.inactive?a:g.color||f.color,(h=g.whiteSpace)!==null&&h!==void 0||(g.whiteSpace="normal"),(p=g.overflowWrap)!==null&&p!==void 0||(g.overflowWrap="break-word");var b=y?y(f.value,f,d):f.value;return v.createElement("li",pa({className:m,style:s,key:"legend-item-".concat(d)},uo(e,f,d)),v.createElement(Du,{width:r,height:r,viewBox:u,style:c,"aria-label":f.value==null?"legend icon":"".concat(f.value," legend icon")},v.createElement(gw,{data:f,iconType:o,inactiveColor:a})),v.createElement("span",{className:"recharts-legend-item-text",style:g},b))})}var xw=e=>{var t=Ne(e,mw),r=t.payload,n=t.layout,i=t.align;if(!r||!r.length)return null;var a={padding:0,margin:0,textAlign:n==="horizontal"?i:"left"};return v.createElement("ul",{className:"recharts-default-legend",style:a},v.createElement(bw,pa({},t,{payload:r})))};function ww(e,t){const r=new Map;for(let n=0;n<e.length;n++){const i=e[n],a=t(i,n,e);r.has(a)||r.set(a,i)}return Array.from(r.values())}function Aw(e,t){return function(...r){return e.apply(this,r.slice(0,t))}}function Pp(e){return e}function Pw(e){return Number.isSafeInteger(e)&&e>=0}function qu(e){return e!=null&&typeof e!="function"&&Pw(e.length)}function Ow(e){return function(t){return Ht(t,e)}}function Op(e){return e==null||typeof e!="object"&&typeof e!="function"}function Er(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const _p="[object RegExp]",Yu="[object String]",Gu="[object Number]",Xu="[object Boolean]",Sp="[object Arguments]",Ep="[object Symbol]",Ip="[object Date]",kp="[object Map]",jp="[object Set]",Cp="[object Array]",_w="[object Function]",Tp="[object ArrayBuffer]",aa="[object Object]",Sw="[object Error]",Mp="[object DataView]",Dp="[object Uint8Array]",$p="[object Uint8ClampedArray]",Np="[object Uint16Array]",Lp="[object Uint32Array]",Ew="[object BigUint64Array]",Rp="[object Int8Array]",zp="[object Int16Array]",Bp="[object Int32Array]",Iw="[object BigInt64Array]",Wp="[object Float32Array]",Fp="[object Float64Array]";function Zn(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function Kp(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function Up(e,t,r){return typeof r!="function"?Up(e,t,()=>{}):Ul(e,t,function n(i,a,o,l,u,s){const c=r(i,a,o,l,u,s);return c!==void 0?!!c:Ul(i,a,n,s,!1)},new Map,!0)}function Ul(e,t,r,n,i=!1){if(t===e)return!0;switch(typeof t){case"object":return kw(e,t,r,n,i);case"function":return Object.keys(t).length>0?Ul(e,Object.assign({},t),r,n,i):Zn(e,t);default:return Kp(e)&&i?typeof t=="string"?t==="":!0:Zn(e,t)}}function kw(e,t,r,n,i=!1){if(t==null)return!0;if(Array.isArray(t))return Hp(e,t,r,n);if(t instanceof Map)return jw(e,t,r,n);if(t instanceof Set)return Cw(e,t,r,n);const a=Object.keys(t);if(e==null)return i&&a.length===0;if(i)Op(e)&&(e=Object(e));else{if(Er(t)==="[object Error]")return Er(e)==="[object Error]"&&e.name===t.name&&e.message===t.message;const o=Er(e);if(o!=="[object Object]"&&o!=="[object Arguments]")return!1}if(a.length===0)return!0;if(n!=null&&n.has(t))return n.get(t)===e;n==null||n.set(t,e);try{for(let o=0;o<a.length;o++){const l=a[o];if(!(l in e)||t[l]===void 0&&e[l]!==void 0||t[l]===null&&e[l]!==null||!r(e[l],t[l],l,e,t,n))return!1}return!0}finally{n==null||n.delete(t)}}function jw(e,t,r,n){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(const[i,a]of t.entries())if(r(e.get(i),a,i,e,t,n)===!1)return!1;return!0}function Hp(e,t,r,n){if(t.length===0)return!0;if(!Array.isArray(e))return!1;const i=new Set;for(let a=0;a<t.length;a++){const o=t[a];let l=!1;for(let u=0;u<e.length;u++){if(i.has(u))continue;const s=e[u];let c=!1;if(r(s,o,a,e,t,n)&&(c=!0),c){i.add(u),l=!0;break}}if(!l)return!1}return!0}function Cw(e,t,r,n){return t.size===0?!0:e instanceof Set?Hp([...e],[...t],r,n):!1}function Vp(e,t){return Up(e,t,()=>{})}function Hl(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}const zc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Vl(e){return typeof zc.Buffer<"u"&&zc.Buffer.isBuffer(e)}function Tw(e){return Vl(e)}function Mw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Dw(e){return Mw(e)}function $w(e,t){return an(e,void 0,e,new Map)}function an(e,t,r,n,i){if(Op(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const o=new Array(e.length);n.set(e,o);for(let l=0;l<e.length;l++)o[l]=an(e[l],l,r,n);return dn(e,"index")&&(o.index=e.index),dn(e,"input")&&(o.input=e.input),o}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const o=new RegExp(e.source,e.flags);return o.lastIndex=e.lastIndex,o}if(e instanceof Map){const o=new Map;return n.set(e,o),e.forEach((l,u)=>{o.set(u,an(l,u,r,n))}),o}if(e instanceof Set){const o=new Set;return n.set(e,o),e.forEach(l=>{o.add(an(l,void 0,r,n))}),o}if(Tw(e))return e.subarray();if(Dw(e)){const o=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,o);for(let l=0;l<e.length;l++)o[l]=an(e[l],l,r,n);return o}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const o=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,o),Yr(o,e,r,n),o}if(typeof File<"u"&&e instanceof File){const o=new File([e],e.name,{type:e.type});return n.set(e,o),Yr(o,e,r,n),o}if(typeof Blob<"u"&&e instanceof Blob){const o=new Blob([e],{type:e.type});return n.set(e,o),Yr(o,e,r,n),o}const a=Er(e);if(a==="[object Error]")return e===r?{}:e;switch(a){case Gu:case Yu:case Xu:{const o=new e.constructor(e.valueOf());return n.set(e,o),Yr(o,e,r,n),o}case Sp:{const o={};return n.set(e,o),Yr(o,e,r,n),o.length=e.length,o[Symbol.iterator]=e[Symbol.iterator],o}}if(typeof e=="object"&&Nw(a)){const o=a==="[object Object]"&&typeof e.constructor!="function"?{}:Object.create(Object.getPrototypeOf(e));return n.set(e,o),Yr(o,e,r,n),o}return e}function Yr(e,t,r,n,i){const a=[...Object.keys(t),...Hl(t)];for(let o=0;o<a.length;o++){const l=a[o],u=Object.getOwnPropertyDescriptor(e,l);(u==null||u.writable)&&(e[l]=an(t[l],l,r,n))}}function Nw(e){switch(e){case Sp:case Cp:case Tp:case Mp:case Xu:case Ip:case Wp:case Fp:case Rp:case zp:case Bp:case kp:case Gu:case aa:case _p:case jp:case Yu:case Ep:case Dp:case $p:case Np:case Lp:return!0;default:return!1}}function qp(e){return $w(e)}function Lw(e){return e=qp(e),t=>Vp(t,e)}const Rw=/^(?:0|[1-9]\d*)$/;function Yp(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return Rw.test(e)}}function zw(e){return e!==null&&typeof e=="object"&&Er(e)==="[object Arguments]"}function Bw(e,t){let r;if(Array.isArray(t)?r=t:typeof t=="string"&&qv(t)&&!(t in Object(e))?r=Nu(t):r=[t],r.length===0)return!1;let n=e;for(let i=0;i<r.length;i++){const a=no(r[i]);if((n==null||!dn(n,a))&&!((Array.isArray(n)||zw(n))&&Yp(a)&&Number(a)<n.length))return!1;n=n[a]}return!0}function Ww(e,t){switch(typeof e){case"object":Object.is(e==null?void 0:e.valueOf(),-0)&&(e="-0");break;case"number":e=no(e)}return t=qp(t),function(r){const n=Ht(r,e);return n===void 0?Bw(r,e):t===void 0?n===void 0:Vp(n,t)}}function Fw(e){if(e==null)return Pp;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?Ww(e[0],e[1]):Lw(e);default:return Ow(e)}}function Kw(e){return e===0?0:e}function Bc(e,t=Pp){return qu(e)?ww(Array.from(e),Aw(Fw(t),1)).map(Kw):[]}function Gp(e,t,r){return t===!0?Bc(e,r):typeof t=="function"?Bc(e,t):e}var Jo={exports:{}},el={},tl={exports:{}},rl={};/**
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./sdk-mepKXtVl.js","./index-0ejjkW0z.js","./index-TcjySLVg.css","./index.esm-Dum0J07z.js","./index.esm2017-EOzKbpUS.js","./index.esm-CtEQZRb1.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{C as Q,c as Ie,w as Oe,_ as Te,p as we,e as ke,n as Ae,a as Le,F as de,b as je}from"./index-0ejjkW0z.js";const Fe=Symbol("deleteField"),Y="_ts",Z="deletions",pe=Symbol("serverTimestamp");let ne=new Set;function Re(e){ne=new Set(e)}function xe(e,t){return`${e}__${t}`}function nt(e){const t=[];for(const n of e)ne.has(n.collection)?n.type==="delete"?t.push(n,{type:"set",collection:Z,id:xe(n.collection,n.id),data:{collection:n.collection,id:n.id,[Y]:pe}}):t.push({...n,data:{...n.data,[Y]:pe}}):t.push(n);return t}function ot(e,t){const{[Y]:n,...o}=t;return typeof n=="number"?{id:e,data:o,ts:n}:{id:e,data:o}}function ye(e){return(e==null?void 0:e.code)??""}function O(e){const t=ye(e);return t==="permission-denied"||t==="firestore/permission-denied"}const De=500;function Me(e){const t=[];let n=[],o=0;for(const s of e){const c=s.type==="delete"&&ne.has(s.collection)?2:1;o+c>De&&(t.push(n),n=[],o=0),n.push(s),o+=c}return n.length&&t.push(n),t}const ge=1,Ne=168*3600*1e3;function Ue(e,t){return`${e}:${t}`}function Pe(e,t){return!!e&&e.v===ge&&typeof e.cursor=="number"&&t-e.fullAt<Ne}const $e="agentcrm-firebase-cache",ee="datasets";function Be(){return new Promise((e,t)=>{const n=indexedDB.open($e,1);n.onupgradeneeded=()=>n.result.createObjectStore(ee),n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}function X(e,t){return Be().then(n=>new Promise((o,s)=>{const c=n.transaction(ee,e),u=t(c.objectStore(ee));c.oncomplete=()=>{n.close(),o(u.result)},c.onerror=()=>{n.close(),s(c.error)}}))}function Ke(){return typeof indexedDB>"u"?null:{async read(e){try{return await X("readonly",t=>t.get(e))??null}catch{return null}},async write(e,t){try{await X("readwrite",n=>n.put(t,e))}catch{}},async clear(e){try{await X("readwrite",t=>t.delete(e))}catch{}}}}const R="invites",x="extensionChunks",F=3e5,L=[...Q,x];Re(L);const Ve=["admin","member","viewer"];class N extends Error{constructor(t,n,o){super(n),this.reason=t,this.email=o,this.name="FirebaseAccessError"}}function it(e){return e.kind==="firebase"&&typeof e.accessError=="function"}function be(e){const{id:t,...n}=we(e);return n}function He(e){return Ae({...e.data,id:e.id})}function U(e){return typeof e=="string"&&Ve.includes(e)}function _(e){return typeof e=="string"?e.trim().toLowerCase():""}function he(e){return!!e&&!e.authUid&&!!_(e.email)}function qe(e,t,n){const o=new Map;for(const s of e){if(s.collection!=="users")continue;const c=s.op==="set"?s.doc.id:s.id,u=t(c),m=n.users.get(c),w=he(u)?_(u.email):"",y=he(m)?_(m.email):"";w&&w!==y&&o.set(w,{type:"delete",collection:R,id:w}),y&&m&&(m.disabled?o.set(y,{type:"delete",collection:R,id:y}):o.set(y,{type:"set",collection:R,id:y,data:{role:U(m.role)?m.role:"member",userId:c,email:y}}))}return[...o.values()]}const te=(e,t,n)=>`${e}__${t}__${n}`;function Ee(e){const t=(e==null?void 0:e.files)??{},n={};for(const[o,s]of Object.entries(t))typeof s=="string"&&(n[o]=Math.ceil(s.length/F));return n}function We(e,t){const n=e.files??{},o=Object.values(n).reduce((m,w)=>m+(typeof w=="string"?w.length:0),0),s=[],c={},u=be(e);if(o>F){for(const[m,w]of Object.entries(n)){if(typeof w!="string")continue;const y=Math.ceil(w.length/F);c[m]=y;for(let b=0;b<y;b++)s.push({type:"set",collection:x,id:te(e.id,m,b),data:{ext:e.id,file:m,index:b,data:w.slice(b*F,(b+1)*F)}})}u.files={},u.chunks=c}for(const[m,w]of Object.entries(Ee(t)))for(let y=c[m]??0;y<w;y++)s.push({type:"delete",collection:x,id:te(e.id,m,y)});return s.unshift({type:"set",collection:"extensions",id:e.id,data:u}),s}function Ge(e,t){const n=new Map;for(const o of t){const s=String(o.data.ext??"");n.set(s,[...n.get(s)??[],o])}return e.map(o=>{const s=o.data.chunks;if(!s||typeof s!="object")return o;const c={},u=n.get(o.id)??[];for(const[y,b]of Object.entries(s)){const D=u.filter(T=>T.data.file===y).sort((T,B)=>Number(T.data.index)-Number(B.data.index));D.length===b&&(c[y]=D.map(T=>String(T.data.data??"")).join(""))}const{chunks:m,...w}=o.data;return{id:o.id,data:{...w,files:c}}})}function ze(e,t){const n=[];for(const o of e)if(o.op==="set"&&o.collection==="extensions")n.push(...We(o.doc,t.extensions.get(o.doc.id)));else if(o.op==="set")n.push({type:"set",collection:o.collection,id:o.doc.id,data:be(o.doc)});else if(o.op==="delete"){if(n.push({type:"delete",collection:o.collection,id:o.id}),o.collection==="extensions")for(const[s,c]of Object.entries(Ee(t.extensions.get(o.id))))for(let u=0;u<c;u++)n.push({type:"delete",collection:x,id:te(o.id,s,u)})}else{if(!t[o.collection].has(o.id))continue;const s={};for(const[c,u]of Object.entries(o.fields))c==="id"||c.startsWith("id.")||(s[c]=u===void 0?Fe:we(u));Object.keys(s).length&&n.push({type:"update",collection:o.collection,id:o.id,data:s})}return n}const Xe="files",me="Firebase Storage isn't enabled for this project: enable it in the Firebase console (Build → Storage), add `storageBucket` to the web config and deploy the storage rules (docs/files.md).";function Je(e){const t=()=>{if(!e.storage)throw new de(me);return e.storage},n=s=>(je(s),`${Xe}/${s}`),o=async s=>{try{return await s()}catch(c){const u=ye(c);throw u==="storage/unknown"||u==="storage/bucket-not-found"||u==="storage/no-default-bucket"?new de(me):c}};return{kind:"firebase",put:(s,c,u)=>o(()=>t().put(n(s),c,u==null?void 0:u.mime)),async putMany(s){for(const c of s)await o(()=>{var u;return t().put(n(c.id),c.bytes,(u=c.meta)==null?void 0:u.mime)})},get:s=>o(()=>t().get(n(s))),delete:s=>o(()=>t().delete(n(s)))}}function Qe(e){var ue;const t=e.api,n=e.requireVerifiedEmail!==!1,o=e.now??Date.now;let s=null,c=null,u=null,m=new Map,w=!1;const y=t.auth.onChange(i=>{(!i||i.uid!==(c==null?void 0:c.uid))&&(s=null,c=null)});function b(i,r){const l=ke();for(const d of Q){const p=d==="extensions"?Ge(i.get(d)??[],r):i.get(d)??[];for(const f of p)l[d].set(f.id,He(f))}m=new Map(l.users);for(const d of[...l.users.values()])typeof d.replaces=="string"&&d.replaces!==d.id&&l.users.delete(d.replaces);return l}async function D(i){try{return await t.listCollection(i)}catch(r){if(O(r))return[];throw r}}async function T(i){const r=_(i.email);let l=null;try{l=await t.getDoc("users",i.uid)}catch(a){if(!O(a))throw a}if(l)return U(l.role)?l.role:"viewer";if(n&&!i.emailVerified)throw new N("unverified","Verify your email address to continue.",r);const d={email:r,name:i.displayName||r.split("@")[0]||"User",authUid:i.uid,createdAt:o(),updatedAt:o(),...i.photoURL?{avatarUrl:i.photoURL}:{}},p=(a,g={})=>t.commit([{type:"set",collection:"users",id:i.uid,data:{...d,...g,role:a}}]);try{return await p("admin"),"admin"}catch(a){if(!O(a))throw a}let f=null;try{f=r?await t.getDoc(R,r):null}catch(a){if(!O(a))throw a}const h=f&&U(f.role)?f.role:"member";try{return await p(h,f&&typeof f.userId=="string"?{replaces:f.userId}:{}),h}catch(a){if(!O(a))throw a}throw new N("notInvited","This account has not been invited to this CRM. Ask an admin to add your email in Settings → Users.",r)}async function B(){const i=await t.auth.currentUser();if(!i)return u=null,null;try{const r=await T(i);return u=null,{uid:i.uid,email:_(i.email),displayName:i.displayName||_(i.email),role:r}}catch(r){return u=r instanceof N?r:new N("error",r.message,_(i.email)),null}}function oe(){return s||(s=B().then(i=>(c=i,i||(s=null),i))),s}async function Se(i,r,l){const d=ze(i,r);!c&&i.some(p=>p.collection==="users")&&await oe(),(c==null?void 0:c.role)==="admin"&&d.push(...qe(i,p=>r.users.get(p)??m.get(p),l));for(const p of Me(d))await t.commit(p);for(const p of i){if(p.collection!=="users")continue;const f=p.op==="set"?p.doc.id:p.id,h=l.users.get(f);h?m.set(f,h):m.delete(f)}}const E=new Map(L.map(i=>[i,new Map]));let C=0,K=0,k=null,V=null,ie=()=>{};const ve=new Promise(i=>ie=i);let v=null;const se=i=>{typeof i.ts=="number"&&i.ts>C&&(C=i.ts)};function H(i,r){const l=E.get(i);for(const d of r)l.set(d.id,d),se(d)}function re(i){var r;for(const l of i){se(l);const d=l.data.collection,p=l.data.id;typeof d=="string"&&typeof p=="string"&&((r=E.get(d))==null||r.delete(p))}}function ce(){const i=new Map(Q.map(r=>[r,[...E.get(r).values()]]));return b(i,[...E.get(x).values()])}async function q(){if(!e.cache||!k)return;const i=Object.fromEntries(L.map(r=>[r,[...E.get(r).values()]]));await e.cache.write(k,{v:ge,cursor:C,fullAt:K,collections:i})}function _e(){var i;v||(v=setTimeout(()=>{v=null,q()},1e3),(i=v.unref)==null||i.call(v))}async function ae(i,r){try{return await t.listSince(i,r)}catch(l){if(O(l))return null;throw l}}const S=Ie({kind:"firebase",async load(){const i=t.readCount(),r=await t.auth.currentUser();k=e.cache&&e.projectId&&r?Ue(e.projectId,r.uid):null;const l=k?await e.cache.read(k):null;let d="full";if(Pe(l,o())){d="incremental",C=l.cursor,K=l.fullAt;for(const a of L)E.set(a,new Map((l.collections[a]??[]).map(g=>[g.id,g])));const f=C,h=await Promise.all(L.map(async a=>[a,await ae(a,f)]));for(const[a,g]of h)g===null?E.set(a,new Map):H(a,g);re(await ae(Z,f)??[])}else{C=0;const f=await Promise.all(L.map(async h=>[h,await D(h)]));for(const[h,a]of f)E.set(h,new Map),H(h,a);K=o()}V={mode:d,reads:t.readCount()-i},globalThis.__AGENTCRM_FIRESTORE__={...V,cursor:C,totalReads:t.readCount},await q(),ie();const p=ce();return le(),p},persist:(i,r,l)=>Se(i,r,l),watch(i){let r=[],l=!1;const d=()=>{i(ce()),le(),_e()};return ve.then(()=>{if(l)return;const p=C;r=L.map(f=>t.watchSince(f,p,h=>{H(f,h.upserts);for(const a of h.removed)E.get(f).delete(a);d()},h=>{O(h)?(E.set(f,new Map),d()):console.warn(`[firebase] live updates of ${f} stopped:`,h)})),r.push(t.watchSince(Z,p,f=>{re(f.upserts),d()},f=>{O(f)||console.warn("[firebase] live deletions stopped:",f)}))}),()=>{l=!0,r.forEach(p=>p())}},identity:oe,close(){y()}});function le(){if((c==null?void 0:c.role)!=="admin"||w)return;const i=[...m.values()].filter(r=>typeof r.replaces=="string");i.length&&(w=!0,setTimeout(()=>{Ce(i).finally(()=>w=!1)},0))}async function Ce(i){var f;const r=[],l=[],d=S.list("objects"),p=new Map(d.map(h=>[h.id,(h.fields??[]).filter(a=>a.type==="user").map(a=>a.id)]));for(const h of i){const a=h.replaces,g=h.id,A=m.get(a);for(const I of S.list("records")){const j={};I.ownerId===a&&(j.ownerId=g),I.createdBy===a&&(j.createdBy=g);for(const z of p.get(I.object)??[]){const M=(f=I.fields)==null?void 0:f[z];M===a?j[`fields.${z}`]=g:Array.isArray(M)&&M.includes(a)&&(j[`fields.${z}`]=M.map(fe=>fe===a?g:fe))}Object.keys(j).length&&r.push({op:"patch",collection:"records",id:I.id,fields:j})}for(const I of S.list("activities"))I.assigneeId===a&&r.push({op:"patch",collection:"activities",id:I.id,fields:{assigneeId:g}});const G=S.get("settings","general");(G==null?void 0:G.ownerUserId)===a&&r.push({op:"patch",collection:"settings",id:"general",fields:{ownerUserId:g}}),A&&(r.push({op:"delete",collection:"users",id:a}),_(A.email)&&l.push({type:"delete",collection:R,id:_(A.email)})),r.push({op:"patch",collection:"users",id:g,fields:{replaces:void 0,...A&&A.role!==h.role&&U(A.role)?{role:A.role}:{}}})}try{await S.write(r,{message:"Link invited users"}),l.length&&await t.commit(l)}catch(h){console.warn("[firebase] could not link invited users:",h)}}const W=(ue=S.close)==null?void 0:ue.bind(S);return S.close=()=>{v&&(clearTimeout(v),v=null,q()),W==null||W()},Oe(S,Je(t)),$=async()=>{e.cache&&k&&await e.cache.clear(k)},Object.assign(S,{api:t,readCount:()=>t.readCount(),lastLoad:()=>V,accessError:()=>u,resetSession(){s=null,c=null,u=null}})}const J=new Map;function Ye(e){const t=e.firebase.projectId??"default";let n=J.get(t);return n||(n=Te(()=>import("./sdk-mepKXtVl.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(o=>o.createSdkFirebaseApi(e.firebase)),J.set(t,n),n.catch(()=>J.delete(t))),n}let P=null,$=null;Le("firebase",{async signOut(){await($==null?void 0:$()),await(P==null?void 0:P.auth.signOut())}});function Ze(e){const t=typeof(e==null?void 0:e.email)=="string"?e.email.trim():"",n=typeof(e==null?void 0:e.password)=="string"?e.password:"";return t&&n?{email:t,password:n}:null}async function et(e,t){const n=Ze(t);if(!n)return null;const o=await e.auth.currentUser();return o!=null&&o.email&&o.email.toLowerCase()===n.email.toLowerCase()?o:(o&&await e.auth.signOut(),e.auth.signInWithPassword(n.email,n.password))}async function st(e,t={}){var c;const n=e;if(!((c=n.firebase)!=null&&c.apiKey)||!n.firebase.projectId)throw new Error("The Firebase web config (apiKey, projectId) is missing.");const o=await Ye(n);P=o,await et(o,t.secrets);const s=t.firebaseCache===void 0?Ke():t.firebaseCache;return Qe({api:o,cache:s,projectId:n.firebase.projectId})}export{Fe as DELETE_FIELD,Z as DELETIONS_COLLECTION,x as EXTENSION_CHUNKS_COLLECTION,F as EXTENSION_CHUNK_CHARS,De as FIRESTORE_BATCH_LIMIT,N as FirebaseAccessError,R as INVITES_COLLECTION,pe as SERVER_TIMESTAMP,Xe as STORAGE_FILES_DIR,me as STORAGE_NOT_ENABLED,Y as TS_FIELD,Ge as assembleExtensionDocs,Me as chunkForCommit,st as createFirebaseStore,Qe as createFirebaseStoreWith,_ as emailKey,ye as errorCode,Ye as firebaseApiFor,Je as firebaseFileStore,qe as inviteOps,it as isFirebaseStore,O as isPermissionDenied,ze as mutationOps,Re as setTrackedCollections,et as signInWithSecrets,ot as splitTs,xe as tombstoneId,nt as withChangeTracking};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{i as V,e as X,n as Q,s as U,d as G,f as Z,S as tt,C as et,j as O,c as nt,w as st,h as ot,G as J,
|
|
1
|
+
import{i as V,e as X,n as Q,s as U,d as G,f as Z,S as tt,C as et,j as O,c as nt,w as st,h as ot,G as J,b as L,k as rt,D as C,l as it,m as at,o as ct,q as lt,t as ft,u as B,v as ut,x as P,y as ht,z as dt,A as pt}from"./index-0ejjkW0z.js";import{B as Dt}from"./index-0ejjkW0z.js";const gt="agentcrm-git-json",yt=1,v="agentcrm.json";function D(t,e){return`${t}/${e}`}function A(t){return encodeURIComponent(t).replace(/\./g,"%2E")}function mt(t){try{return decodeURIComponent(t)}catch{return t}}function wt(t,e){if(t==="records"){const s=typeof e.object=="string"&&e.object?e.object:"_";return`records/${A(s)}/${A(e.id)}.json`}return`${t}/${A(e.id)}.json`}function H(t){const e=t.split("/"),[s]=e;if(!V(s))return null;const a=e[e.length-1];if(!a.endsWith(".json")||(s==="records"?e.length!==3:e.length!==2))return null;const i=mt(a.slice(0,-5));return i?{collection:s,id:i}:null}function K(t){return t===v||H(t)!==null}function bt(t){return JSON.stringify(t,null,2)+`
|
|
2
2
|
`}function R(t,e,s){if(Array.isArray(t))return t.map((i,o)=>R(i,[...e,String(o)],s));if(!t||typeof t!="object")return t;const a={};for(const[i,o]of Object.entries(t)){if(tt.has(i)&&typeof o=="string"){o&&(s[[...e,i].join(".")]=o);continue}a[i]=R(o,[...e,i],s)}return a}function St(t){const e={};return{doc:R(t,[],e),secrets:e}}function Tt(t,e){if(!e)return t;let s={...t};for(const[a,i]of Object.entries(e)){const o=U(a);G(s,o.slice(0,-1))===void 0&&o.length>1||(s=Z(s,o,i))}return s}function jt(t,e={}){const s=X(),a=new Map,i=[];for(const[o,f]of t){const l=H(o);if(!l)continue;let n;try{const c=JSON.parse(f);if(!c||typeof c!="object"||Array.isArray(c))throw new Error("not an object");n={...c,id:l.id}}catch(c){i.push(`${o}: ${c.message}`);continue}l.collection==="config"&&(n=Tt(n,e[l.id])),s[l.collection].set(l.id,Q(n)),a.set(D(l.collection,l.id),o)}return{snapshot:s,index:a,errors:i}}function $t(t,e,s,a,i){const o=new Map(s),f=new Map(a),l={...i},n=new Map,c=new Set;for(const[T,d]of t){const b=D(T,d);if(c.has(b))continue;c.add(b);const w=f.get(b),j=e[T].get(d);if(!j){w&&(n.set(w,{type:"delete",path:w}),o.delete(w),f.delete(b)),T==="config"&&delete l[d];continue}let M=j;if(T==="config"){const I=St(j);M=I.doc,Object.keys(I.secrets).length?l[d]=I.secrets:delete l[d]}const $=wt(T,M),_=bt(M);w&&w!==$&&(n.set(w,{type:"delete",path:w}),o.delete(w)),o.get($)!==_&&n.set($,{type:"put",path:$,content:_}),o.set($,_),f.set(b,$)}return{changes:[...n.values()],files:o,index:f,secrets:l}}function W(){return JSON.stringify({format:gt,version:yt},null,2)+`
|
|
3
3
|
`}function Lt(t){return et.includes(t)}const z=3e4,xt=1e4,kt=3;function At(t){return t.kind==="git-json"&&typeof t.resetSession=="function"}function Et(t){return t.isAdmin?"admin":t.canWrite?"member":"viewer"}function Y(t,e,s){const a=e.kind==="github"?`${t.login}@users.noreply.github.com`:e.kind==="gitlab"?`${t.login}@users.noreply.gitlab.com`:"local@localhost";return{uid:e.kind==="local"?"local":`${e.kind}:${t.login}`,email:(s==null?void 0:s.trim().toLowerCase())||a,displayName:t.login,role:e.kind==="local"?"admin":Et(t)}}const F="files",Mt=5*1024*1024;function q(t){return[t.collection,t.op==="set"?t.doc.id:t.id]}const N=(t,e)=>JSON.stringify(t??null)===JSON.stringify(e??null);function Ot(t,e,s,a="Someone else changed this document — reload to see their version."){for(const i of t){const[o,f]=q(i),l=e[o].get(f),n=s[o].get(f);if(!N(l,n)){if(i.op==="patch"){if(!n)throw new C(a,o,f);for(const[c,T]of Object.entries(i.fields)){const d=U(c),b=G(l,d),w=G(n,d);if(!N(b,w)&&!N(w,T))throw new C(a,o,f);for(let j=1;j<d.length;j++){const M=G(l,d.slice(0,j)),$=G(n,d.slice(0,j));if(M===void 0!=($===void 0))throw new C(a,o,f)}}continue}if(!(i.op==="set"&&N(n,i.doc))&&!(i.op==="delete"&&!n))throw new C(a,o,f)}}}function _t(t){const e=t.dir.replace(/^\/+|\/+$/g,""),s=r=>e?r.slice(e.length+1):r,a=r=>!e||r.startsWith(e+"/"),i=t.messageSuffix??" — AgentCRM [skip ci]",o=t.secrets??{read:()=>({}),write:()=>{}};let f=null,l=null,n=null,c=!1;async function T(){return f||(f=await t.openTransport()),f}async function d(){const r=await T();if(!r)throw new Error("Not connected to the data repository on this browser (missing token or folder access).");return r}async function b(){const r=await d(),u=await r.listTree(),p=u.entries.filter(E=>a(E.path)&&K(s(E.path))),h=await r.readTexts(p),S=new Map;for(const[E,m]of h)S.set(s(E),m);const{snapshot:y,index:g,errors:x}=jt(S,o.read());x.length&&console.warn("[git-json] unreadable files:",x);const k=new Map;for(const E of u.entries){if(!a(E.path))continue;const m=s(E.path);m.startsWith(`${F}/`)&&m.endsWith(".bin")&&k.set(m,E)}return{head:u.headSha,blobs:k,files:S,index:g,snapshot:y,errors:x}}async function w(r,u,p,h){const S=await d();n||(n=await b());for(let y=0;;y++){const g=n;Ot(r,u,g.snapshot);const{next:x}=ot(g.snapshot,r),k=$t(r.map(q),x,g.files,g.index,o.read());if(g.files.has(v)||(k.changes.push({type:"put",path:v,content:W()}),k.files.set(v,W())),k.changes.length===0)return;const E=k.changes.map(m=>m.type==="put"?{type:"put",path:O(e,m.path),content:m.content??""}:{type:"delete",path:O(e,m.path)});try{const m=await S.commit(E,{message:`${h}${i}`,expectedHeadSha:g.head});o.write(k.secrets),n={head:m,blobs:g.blobs,files:k.files,index:k.index,snapshot:x,errors:g.errors},g.snapshot!==u&&y>0&&(c=!0);return}catch(m){if(!(m instanceof J)||y>=kt)throw m}n=await b(),c=!0}}const j=nt({kind:"git-json",pollIntervalMs:t.pollIntervalMs??z,async load(){return n=await b(),c=!1,n.snapshot},persist:w,async poll(){const r=await T();return!r||!n||await r.headSha()===n.head&&!c?null:(n=await b(),c=!1,n.snapshot)},identity(){return l||(l=(async()=>{const r=await T();if(!r)return null;try{const u=await r.permissions();return t.identityFor?t.identityFor(u,r):Y(u,r)}catch(u){return console.warn("[git-json] permission check failed:",u),null}})(),l.then(r=>{r||(l=null,f=null)})),l}}),M=r=>`${F}/${r}.bin`;async function $(r,u){const p=await d(),h=r.map(y=>({...y,path:O(e,y.path)})),S=`${u}${i}`;if(n)try{const y=await p.commit(h,{message:S,expectedHeadSha:n.head}),g=new Map(n.blobs);for(const x of r)x.type==="put"?g.set(x.path,{path:O(e,x.path),sha:""}):g.delete(x.path);n={...n,head:y,blobs:g};return}catch(y){if(!(y instanceof J))throw y}await p.commit(h,{message:S}),c=!0}async function _(r){const u=M(r);let p=n==null?void 0:n.blobs.get(u);if(!p||!p.sha){const S=await(await d()).listTree(),y=O(e,u);p=S.entries.find(g=>g.path===y),p&&n&&n.blobs.set(u,p)}return p??null}const I={kind:"git-json",async put(r,u){await I.putMany([{id:r,bytes:u}])},async putMany(r){var p;if(!r.length)return;for(const h of r)L(h.id);const u=r.reduce((h,S)=>h+S.bytes.length,0);u>Mt&&console.warn(`[git-json] committing ${Math.round(u/1024)} KB of files: git history keeps them forever and large repos get slow.`),await $(r.map(h=>({type:"put",path:M(h.id),content:rt(h.bytes),encoding:"base64"})),`Upload ${r.length===1?((p=r[0].meta)==null?void 0:p.name)??"a file":`${r.length} files`}`)},async get(r){L(r);const u=await _(r);return u?(await d()).readBytes(u):null},async delete(r){L(r),await _(r)&&await $([{type:"delete",path:M(r)}],"Purge a file")},async list(){const u=await(await d()).listTree(),p=O(e,`${F}/`);return u.entries.filter(h=>h.path.startsWith(p)&&h.path.endsWith(".bin")).map(h=>h.path.slice(p.length,-4)).filter(h=>!h.includes("/")).sort()}};return st(j,I),Object.assign(j,{resetSession(){f=null,l=null,n=null,c=!1},loadErrors:()=>(n==null?void 0:n.errors)??[],headSha:()=>(n==null?void 0:n.head)??null})}async function Ft(t,e){const s=e.replace(/^\/+|\/+$/g,""),a=await t.listTree(),i=a.entries.map(c=>s?c.path.startsWith(s+"/")?c.path.slice(s.length+1):null:c.path).filter(c=>c!==null),o=i.filter(c=>c!==v&&K(c)),f=i.includes(v)||o.some(c=>c.startsWith("objects/"));let l;const n=a.entries.find(c=>c.path===O(s,"settings/general.json"));if(n){const c=(await t.readTexts([n])).get(n.path);try{l=c?JSON.parse(c).name:void 0}catch{}}return{exists:f,documents:o.length,hasUsers:o.some(c=>c.startsWith("users/")),name:l}}function Jt(t={}){return{head:"c0",files:new Map(Object.entries(t)),commits:[]}}function It(t){let e=2166136261;for(let s=0;s<t.length;s++)e^=t.charCodeAt(s),e=Math.imul(e,16777619);return`b${(e>>>0).toString(16)}-${t.length}`}function Rt(t,e={}){const s={kind:e.kind??"github",label:"memory/repo@main",reads:0,async headSha(){return t.head},async listTree(){const a=[...t.files.entries()].map(([i,o])=>({path:i,sha:It(o),size:o.length})).sort((i,o)=>i.path.localeCompare(o.path));return{headSha:t.head,entries:a}},async readTexts(a){s.reads++;const i=new Map;for(const o of a){const f=t.files.get(o.path);f!==void 0&&i.set(o.path,f)}return i},async readBytes(a){return new TextEncoder().encode(t.files.get(a.path)??"")},async commit(a,i){var f;if((f=e.beforeCommit)==null||f.call(e,t),i.expectedHeadSha&&i.expectedHeadSha!==t.head)throw new J("Branch moved",t.head);for(const l of a)l.type==="delete"?t.files.delete(l.path):t.files.set(l.path,l.encoding==="base64"?it(l.content):l.content);const o=`c${t.commits.length+1}`;return t.commits.push({sha:o,message:i.message,changes:a}),t.head=o,o},async permissions(){return{login:"octocat",canWrite:!0,isAdmin:!0,visibility:"private",...e.permissions}}};return s}const vt="git-json-folder";async function Gt(t,e){if(t.provider==="local"){const a=await at(vt);return!a||!await ct(a,!1)?null:lt(a)}const s=e??ft(t);return s?t.provider==="github"?B({provider:"github",owner:t.owner??"",repo:t.repo??"",branch:t.branch,token:s,apiBaseUrl:t.apiBaseUrl}):B({provider:"gitlab",project:t.project??"",branch:t.branch,token:s,apiBaseUrl:t.apiBaseUrl}):null}function Ct(t){return ht(`gitEmail:${P(t)}`)}function Pt(t,e){ut(`gitEmail:${P(t)}`,(e==null?void 0:e.trim().toLowerCase())||null)}function Bt(t,e={}){var f,l;const s=t.git,a=typeof((f=e.secrets)==null?void 0:f.token)=="string"?e.secrets.token:null,i=typeof((l=e.secrets)==null?void 0:l.email)=="string"?e.secrets.email:null,o=`gitSecrets:${P(t)}`;return _t({dir:s.dir,openTransport:()=>Gt(s,a),identityFor:(n,c)=>Y(n,c,i??Ct(t)),secrets:{read:()=>pt(o)??{},write:n=>dt(o,n)},pollIntervalMs:e.pollIntervalMs??(s.provider==="local"?xt:z)})}export{gt as GIT_JSON_FORMAT,yt as GIT_JSON_VERSION,vt as LOCAL_GIT_HANDLE_KEY,v as MARKER_FILE,Ot as checkRebase,Bt as createGitJsonStore,_t as createGitJsonStoreWith,Rt as createMemoryGitTransport,Jt as createMemoryRepo,D as docKey,wt as docPath,jt as filesToSnapshot,ft as getGitToken,Ct as getGitUserEmail,Ft as inspectGitJsonFolder,Lt as isCollectionFolder,At as isGitJsonStore,K as isLayoutFile,W as markerContent,Tt as mergeDocSecrets,Gt as openGitJsonTransport,H as parseDocPath,$t as planChanges,Et as roleFromPermissions,bt as serializeDoc,Dt as setGitToken,Pt as setGitUserEmail,St as stripDocSecrets};
|