ima2-gen 3.15.1 → 3.16.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/CHANGELOG.md +11 -1
- package/README.md +7 -6
- package/bin/commands/grok.js +150 -64
- package/bin/commands/service.js +5 -4
- package/bin/ima2.js +3 -3
- package/bin/lib/doctor-providers.js +6 -1
- package/bin/lib/doctor-runtime.js +1 -1
- package/config.js +0 -9
- package/docs/API.md +7 -7
- package/docs/API.zh-CN.md +7 -7
- package/docs/API.zh-TW.md +7 -7
- package/docs/CLI.md +9 -8
- package/docs/CLI.zh-CN.md +8 -8
- package/docs/CLI.zh-TW.md +8 -8
- package/docs/README.ko.md +5 -6
- package/docs/README.zh-CN.md +6 -5
- package/docs/README.zh-TW.md +6 -5
- package/docs/migration/runtime-test-inventory.md +4 -6
- package/lib/agentPlannerModel.js +17 -16
- package/lib/capabilities.js +3 -2
- package/lib/errors/providerMap.js +13 -0
- package/lib/grokImageCore.js +9 -16
- package/lib/grokImagePlanner.js +15 -3
- package/lib/grokRuntime.js +47 -16
- package/lib/grokVideoAdapter.js +23 -7
- package/lib/grokVideoPoll.js +3 -3
- package/lib/grokVideoShared.js +6 -13
- package/lib/promptBuilder/router.js +22 -6
- package/lib/providers/adapters/grokExecution.js +15 -14
- package/lib/providers/adapters/grokMultimodeOperations.js +9 -7
- package/lib/providers/adapters/grokOperations.js +19 -12
- package/lib/providers/execution/admission.js +20 -4
- package/lib/providers/registry.js +1 -1
- package/lib/runtimeContext.js +0 -12
- package/lib/videoExtendI2vOperation.js +5 -1
- package/lib/xaiAuth.js +369 -0
- package/lib/xaiDeviceLogin.js +157 -0
- package/package.json +2 -4
- package/routes/auth.js +18 -26
- package/routes/grok.js +25 -19
- package/routes/health.js +4 -5
- package/routes/models.js +12 -26
- package/routes/quota.js +2 -1
- package/routes/video.js +7 -2
- package/routes/videoExtended.js +37 -24
- package/server.js +7 -58
- package/skills/ima2/SKILL.md +2 -2
- package/ui/dist/.vite/manifest.json +56 -56
- package/ui/dist/assets/{AgentWorkspace-CLJDCRMQ.js → AgentWorkspace-DlLaTsPK.js} +1 -1
- package/ui/dist/assets/{App-DkvU6Sex.js → App-BfpvLzSs.js} +4 -4
- package/ui/dist/assets/{AssetGenWorkspace-BepUrz23.js → AssetGenWorkspace-C8eIs-bS.js} +2 -2
- package/ui/dist/assets/{AssetsWorkspace-IipC1FdD.js → AssetsWorkspace-BcbAM8uC.js} +1 -1
- package/ui/dist/assets/{CardNewsWorkspace-ZXDwYz4l.js → CardNewsWorkspace-CM5hwbRV.js} +1 -1
- package/ui/dist/assets/{GenerationRequestLogPanel-BL2C0DcW.js → GenerationRequestLogPanel-CTs8OymS.js} +1 -1
- package/ui/dist/assets/{HomeWorkspace-DFfrwS9a.js → HomeWorkspace-KGUtIZyG.js} +1 -1
- package/ui/dist/assets/{KeyingPanel-BQkEMTe9.js → KeyingPanel-D8ZHmWcC.js} +1 -1
- package/ui/dist/assets/{NodeCanvas-5u8IO1MA.js → NodeCanvas-D2N3m-1s.js} +1 -1
- package/ui/dist/assets/{PromptBuilderPanel-DNt7LHMi.js → PromptBuilderPanel-BolZnOa7.js} +1 -1
- package/ui/dist/assets/{PromptImportDialog-Bl-SB4mK.js → PromptImportDialog-DBpe7Vkj.js} +2 -2
- package/ui/dist/assets/{PromptImportDiscoverySection-DdZAdRMW.js → PromptImportDiscoverySection-Dk6v6lUZ.js} +1 -1
- package/ui/dist/assets/{PromptImportFolderSection-DLHQKl9T.js → PromptImportFolderSection-BE7Nfq9Y.js} +1 -1
- package/ui/dist/assets/{PromptLibraryPanel-PLWyvEz1.js → PromptLibraryPanel-Qdujpb4L.js} +2 -2
- package/ui/dist/assets/{SettingsWorkspace-Etfeu2IF.js → SettingsWorkspace-Dm4wezu_.js} +1 -1
- package/ui/dist/assets/{SpriteRecipeWorkspace-D7H5seOM.js → SpriteRecipeWorkspace-D9do9V7F.js} +1 -1
- package/ui/dist/assets/index-CfGRmfFv.js +22 -0
- package/ui/dist/assets/{index-BAkbTbUC.js → index-CfrOcJIe.js} +3 -3
- package/ui/dist/assets/{pptxgen.es-Apxh5DQ9.js → pptxgen.es-BLI_YKez.js} +1 -1
- package/ui/dist/assets/{promptBuilderStore-prvdLIUP.js → promptBuilderStore-BMiudG9n.js} +1 -1
- package/ui/dist/assets/useAgentDialogFocus-CCj5EYE9.js +1 -0
- package/ui/dist/index.html +1 -1
- package/lib/grokProxyLauncher.js +0 -279
- package/node_modules/array-flatten/LICENSE +0 -21
- package/node_modules/array-flatten/README.md +0 -43
- package/node_modules/array-flatten/array-flatten.js +0 -64
- package/node_modules/array-flatten/package.json +0 -39
- package/node_modules/bundle-name/index.js +0 -5
- package/node_modules/bundle-name/license +0 -9
- package/node_modules/bundle-name/package.json +0 -45
- package/node_modules/bundle-name/readme.md +0 -23
- package/node_modules/bytes/History.md +0 -97
- package/node_modules/bytes/LICENSE +0 -23
- package/node_modules/bytes/Readme.md +0 -152
- package/node_modules/bytes/index.js +0 -170
- package/node_modules/bytes/package.json +0 -42
- package/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
- package/node_modules/call-bind-apply-helpers/.nycrc +0 -9
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
- package/node_modules/call-bind-apply-helpers/LICENSE +0 -21
- package/node_modules/call-bind-apply-helpers/README.md +0 -62
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
- package/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
- package/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
- package/node_modules/call-bind-apply-helpers/index.js +0 -15
- package/node_modules/call-bind-apply-helpers/package.json +0 -85
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
- package/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
- package/node_modules/call-bind-apply-helpers/test/index.js +0 -63
- package/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
- package/node_modules/call-bound/.eslintrc +0 -13
- package/node_modules/call-bound/.github/FUNDING.yml +0 -12
- package/node_modules/call-bound/.nycrc +0 -9
- package/node_modules/call-bound/CHANGELOG.md +0 -42
- package/node_modules/call-bound/LICENSE +0 -21
- package/node_modules/call-bound/README.md +0 -53
- package/node_modules/call-bound/index.d.ts +0 -94
- package/node_modules/call-bound/index.js +0 -19
- package/node_modules/call-bound/package.json +0 -99
- package/node_modules/call-bound/test/index.js +0 -61
- package/node_modules/call-bound/tsconfig.json +0 -10
- package/node_modules/commander/LICENSE +0 -22
- package/node_modules/commander/Readme.md +0 -1149
- package/node_modules/commander/esm.mjs +0 -16
- package/node_modules/commander/index.js +0 -24
- package/node_modules/commander/lib/argument.js +0 -149
- package/node_modules/commander/lib/command.js +0 -2662
- package/node_modules/commander/lib/error.js +0 -39
- package/node_modules/commander/lib/help.js +0 -709
- package/node_modules/commander/lib/option.js +0 -367
- package/node_modules/commander/lib/suggestSimilar.js +0 -101
- package/node_modules/commander/package-support.json +0 -16
- package/node_modules/commander/package.json +0 -82
- package/node_modules/commander/typings/esm.d.mts +0 -3
- package/node_modules/commander/typings/index.d.ts +0 -1045
- package/node_modules/content-type/HISTORY.md +0 -29
- package/node_modules/content-type/LICENSE +0 -22
- package/node_modules/content-type/README.md +0 -94
- package/node_modules/content-type/index.js +0 -225
- package/node_modules/content-type/package.json +0 -42
- package/node_modules/cookie/LICENSE +0 -24
- package/node_modules/cookie/README.md +0 -317
- package/node_modules/cookie/SECURITY.md +0 -25
- package/node_modules/cookie/index.js +0 -335
- package/node_modules/cookie/package.json +0 -44
- package/node_modules/default-browser/index.d.ts +0 -29
- package/node_modules/default-browser/index.js +0 -34
- package/node_modules/default-browser/license +0 -9
- package/node_modules/default-browser/package.json +0 -54
- package/node_modules/default-browser/readme.md +0 -24
- package/node_modules/default-browser/windows.js +0 -57
- package/node_modules/default-browser-id/index.js +0 -25
- package/node_modules/default-browser-id/license +0 -9
- package/node_modules/default-browser-id/package.json +0 -41
- package/node_modules/default-browser-id/readme.md +0 -19
- package/node_modules/define-lazy-prop/index.d.ts +0 -31
- package/node_modules/define-lazy-prop/index.js +0 -18
- package/node_modules/define-lazy-prop/license +0 -9
- package/node_modules/define-lazy-prop/package.json +0 -51
- package/node_modules/define-lazy-prop/readme.md +0 -55
- package/node_modules/depd/History.md +0 -103
- package/node_modules/depd/LICENSE +0 -22
- package/node_modules/depd/Readme.md +0 -280
- package/node_modules/depd/index.js +0 -538
- package/node_modules/depd/lib/browser/index.js +0 -77
- package/node_modules/depd/package.json +0 -45
- package/node_modules/destroy/LICENSE +0 -23
- package/node_modules/destroy/README.md +0 -63
- package/node_modules/destroy/index.js +0 -209
- package/node_modules/destroy/package.json +0 -48
- package/node_modules/dunder-proto/.eslintrc +0 -5
- package/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
- package/node_modules/dunder-proto/.nycrc +0 -13
- package/node_modules/dunder-proto/CHANGELOG.md +0 -24
- package/node_modules/dunder-proto/LICENSE +0 -21
- package/node_modules/dunder-proto/README.md +0 -54
- package/node_modules/dunder-proto/get.d.ts +0 -5
- package/node_modules/dunder-proto/get.js +0 -30
- package/node_modules/dunder-proto/package.json +0 -76
- package/node_modules/dunder-proto/set.d.ts +0 -5
- package/node_modules/dunder-proto/set.js +0 -35
- package/node_modules/dunder-proto/test/get.js +0 -34
- package/node_modules/dunder-proto/test/index.js +0 -4
- package/node_modules/dunder-proto/test/set.js +0 -50
- package/node_modules/dunder-proto/tsconfig.json +0 -9
- package/node_modules/ee-first/LICENSE +0 -22
- package/node_modules/ee-first/README.md +0 -80
- package/node_modules/ee-first/index.js +0 -95
- package/node_modules/ee-first/package.json +0 -29
- package/node_modules/encodeurl/LICENSE +0 -22
- package/node_modules/encodeurl/README.md +0 -109
- package/node_modules/encodeurl/index.js +0 -60
- package/node_modules/encodeurl/package.json +0 -40
- package/node_modules/es-define-property/.eslintrc +0 -13
- package/node_modules/es-define-property/.github/FUNDING.yml +0 -12
- package/node_modules/es-define-property/.nycrc +0 -9
- package/node_modules/es-define-property/CHANGELOG.md +0 -29
- package/node_modules/es-define-property/LICENSE +0 -21
- package/node_modules/es-define-property/README.md +0 -49
- package/node_modules/es-define-property/index.d.ts +0 -3
- package/node_modules/es-define-property/index.js +0 -14
- package/node_modules/es-define-property/package.json +0 -81
- package/node_modules/es-define-property/test/index.js +0 -56
- package/node_modules/es-define-property/tsconfig.json +0 -10
- package/node_modules/es-errors/.eslintrc +0 -5
- package/node_modules/es-errors/.github/FUNDING.yml +0 -12
- package/node_modules/es-errors/CHANGELOG.md +0 -40
- package/node_modules/es-errors/LICENSE +0 -21
- package/node_modules/es-errors/README.md +0 -55
- package/node_modules/es-errors/eval.d.ts +0 -3
- package/node_modules/es-errors/eval.js +0 -4
- package/node_modules/es-errors/index.d.ts +0 -3
- package/node_modules/es-errors/index.js +0 -4
- package/node_modules/es-errors/package.json +0 -80
- package/node_modules/es-errors/range.d.ts +0 -3
- package/node_modules/es-errors/range.js +0 -4
- package/node_modules/es-errors/ref.d.ts +0 -3
- package/node_modules/es-errors/ref.js +0 -4
- package/node_modules/es-errors/syntax.d.ts +0 -3
- package/node_modules/es-errors/syntax.js +0 -4
- package/node_modules/es-errors/test/index.js +0 -19
- package/node_modules/es-errors/tsconfig.json +0 -49
- package/node_modules/es-errors/type.d.ts +0 -3
- package/node_modules/es-errors/type.js +0 -4
- package/node_modules/es-errors/uri.d.ts +0 -3
- package/node_modules/es-errors/uri.js +0 -4
- package/node_modules/es-object-atoms/.eslintrc +0 -16
- package/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
- package/node_modules/es-object-atoms/CHANGELOG.md +0 -37
- package/node_modules/es-object-atoms/LICENSE +0 -21
- package/node_modules/es-object-atoms/README.md +0 -63
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
- package/node_modules/es-object-atoms/ToObject.d.ts +0 -7
- package/node_modules/es-object-atoms/ToObject.js +0 -10
- package/node_modules/es-object-atoms/index.d.ts +0 -3
- package/node_modules/es-object-atoms/index.js +0 -4
- package/node_modules/es-object-atoms/isObject.d.ts +0 -3
- package/node_modules/es-object-atoms/isObject.js +0 -6
- package/node_modules/es-object-atoms/package.json +0 -80
- package/node_modules/es-object-atoms/test/index.js +0 -38
- package/node_modules/es-object-atoms/tsconfig.json +0 -6
- package/node_modules/escape-html/LICENSE +0 -24
- package/node_modules/escape-html/Readme.md +0 -43
- package/node_modules/escape-html/index.js +0 -78
- package/node_modules/escape-html/package.json +0 -24
- package/node_modules/etag/HISTORY.md +0 -83
- package/node_modules/etag/LICENSE +0 -22
- package/node_modules/etag/README.md +0 -159
- package/node_modules/etag/index.js +0 -131
- package/node_modules/etag/package.json +0 -47
- package/node_modules/forwarded/HISTORY.md +0 -21
- package/node_modules/forwarded/LICENSE +0 -22
- package/node_modules/forwarded/README.md +0 -57
- package/node_modules/forwarded/index.js +0 -90
- package/node_modules/forwarded/package.json +0 -45
- package/node_modules/function-bind/.eslintrc +0 -21
- package/node_modules/function-bind/.github/FUNDING.yml +0 -12
- package/node_modules/function-bind/.github/SECURITY.md +0 -3
- package/node_modules/function-bind/.nycrc +0 -13
- package/node_modules/function-bind/CHANGELOG.md +0 -136
- package/node_modules/function-bind/LICENSE +0 -20
- package/node_modules/function-bind/README.md +0 -46
- package/node_modules/function-bind/implementation.js +0 -84
- package/node_modules/function-bind/index.js +0 -5
- package/node_modules/function-bind/package.json +0 -87
- package/node_modules/function-bind/test/.eslintrc +0 -9
- package/node_modules/function-bind/test/index.js +0 -252
- package/node_modules/get-intrinsic/.eslintrc +0 -42
- package/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
- package/node_modules/get-intrinsic/.nycrc +0 -9
- package/node_modules/get-intrinsic/CHANGELOG.md +0 -186
- package/node_modules/get-intrinsic/LICENSE +0 -21
- package/node_modules/get-intrinsic/README.md +0 -71
- package/node_modules/get-intrinsic/index.js +0 -378
- package/node_modules/get-intrinsic/package.json +0 -97
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
- package/node_modules/get-proto/.eslintrc +0 -10
- package/node_modules/get-proto/.github/FUNDING.yml +0 -12
- package/node_modules/get-proto/.nycrc +0 -9
- package/node_modules/get-proto/CHANGELOG.md +0 -21
- package/node_modules/get-proto/LICENSE +0 -21
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
- package/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
- package/node_modules/get-proto/README.md +0 -50
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
- package/node_modules/get-proto/index.d.ts +0 -5
- package/node_modules/get-proto/index.js +0 -27
- package/node_modules/get-proto/package.json +0 -81
- package/node_modules/get-proto/test/index.js +0 -68
- package/node_modules/get-proto/tsconfig.json +0 -9
- package/node_modules/gopd/.eslintrc +0 -16
- package/node_modules/gopd/.github/FUNDING.yml +0 -12
- package/node_modules/gopd/CHANGELOG.md +0 -45
- package/node_modules/gopd/LICENSE +0 -21
- package/node_modules/gopd/README.md +0 -40
- package/node_modules/gopd/gOPD.d.ts +0 -1
- package/node_modules/gopd/gOPD.js +0 -4
- package/node_modules/gopd/index.d.ts +0 -5
- package/node_modules/gopd/index.js +0 -15
- package/node_modules/gopd/package.json +0 -77
- package/node_modules/gopd/test/index.js +0 -36
- package/node_modules/gopd/tsconfig.json +0 -9
- package/node_modules/has-symbols/.eslintrc +0 -11
- package/node_modules/has-symbols/.github/FUNDING.yml +0 -12
- package/node_modules/has-symbols/.nycrc +0 -9
- package/node_modules/has-symbols/CHANGELOG.md +0 -91
- package/node_modules/has-symbols/LICENSE +0 -21
- package/node_modules/has-symbols/README.md +0 -46
- package/node_modules/has-symbols/index.d.ts +0 -3
- package/node_modules/has-symbols/index.js +0 -14
- package/node_modules/has-symbols/package.json +0 -111
- package/node_modules/has-symbols/shams.d.ts +0 -3
- package/node_modules/has-symbols/shams.js +0 -45
- package/node_modules/has-symbols/test/index.js +0 -22
- package/node_modules/has-symbols/test/shams/core-js.js +0 -29
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
- package/node_modules/has-symbols/test/tests.js +0 -58
- package/node_modules/has-symbols/tsconfig.json +0 -10
- package/node_modules/hasown/.github/FUNDING.yml +0 -12
- package/node_modules/hasown/.nycrc +0 -13
- package/node_modules/hasown/CHANGELOG.md +0 -51
- package/node_modules/hasown/LICENSE +0 -21
- package/node_modules/hasown/README.md +0 -40
- package/node_modules/hasown/eslint.config.mjs +0 -6
- package/node_modules/hasown/index.d.ts +0 -4
- package/node_modules/hasown/index.js +0 -8
- package/node_modules/hasown/package.json +0 -92
- package/node_modules/hasown/tsconfig.json +0 -6
- package/node_modules/http-errors/HISTORY.md +0 -186
- package/node_modules/http-errors/LICENSE +0 -23
- package/node_modules/http-errors/README.md +0 -169
- package/node_modules/http-errors/index.js +0 -290
- package/node_modules/http-errors/package.json +0 -54
- package/node_modules/inherits/LICENSE +0 -16
- package/node_modules/inherits/README.md +0 -42
- package/node_modules/inherits/inherits.js +0 -9
- package/node_modules/inherits/inherits_browser.js +0 -27
- package/node_modules/inherits/package.json +0 -29
- package/node_modules/ipaddr.js/LICENSE +0 -19
- package/node_modules/ipaddr.js/README.md +0 -233
- package/node_modules/ipaddr.js/ipaddr.min.js +0 -1
- package/node_modules/ipaddr.js/lib/ipaddr.js +0 -673
- package/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +0 -68
- package/node_modules/ipaddr.js/package.json +0 -35
- package/node_modules/is-docker/cli.js +0 -5
- package/node_modules/is-docker/index.d.ts +0 -13
- package/node_modules/is-docker/index.js +0 -29
- package/node_modules/is-docker/license +0 -9
- package/node_modules/is-docker/package.json +0 -44
- package/node_modules/is-docker/readme.md +0 -27
- package/node_modules/is-inside-container/cli.js +0 -5
- package/node_modules/is-inside-container/index.d.ts +0 -13
- package/node_modules/is-inside-container/index.js +0 -23
- package/node_modules/is-inside-container/license +0 -9
- package/node_modules/is-inside-container/package.json +0 -51
- package/node_modules/is-inside-container/readme.md +0 -36
- package/node_modules/is-wsl/index.d.ts +0 -15
- package/node_modules/is-wsl/index.js +0 -36
- package/node_modules/is-wsl/license +0 -9
- package/node_modules/is-wsl/package.json +0 -58
- package/node_modules/is-wsl/readme.md +0 -21
- package/node_modules/math-intrinsics/.eslintrc +0 -16
- package/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
- package/node_modules/math-intrinsics/CHANGELOG.md +0 -24
- package/node_modules/math-intrinsics/LICENSE +0 -21
- package/node_modules/math-intrinsics/README.md +0 -50
- package/node_modules/math-intrinsics/abs.d.ts +0 -1
- package/node_modules/math-intrinsics/abs.js +0 -4
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxValue.js +0 -5
- package/node_modules/math-intrinsics/floor.d.ts +0 -1
- package/node_modules/math-intrinsics/floor.js +0 -4
- package/node_modules/math-intrinsics/isFinite.d.ts +0 -3
- package/node_modules/math-intrinsics/isFinite.js +0 -12
- package/node_modules/math-intrinsics/isInteger.d.ts +0 -3
- package/node_modules/math-intrinsics/isInteger.js +0 -16
- package/node_modules/math-intrinsics/isNaN.d.ts +0 -1
- package/node_modules/math-intrinsics/isNaN.js +0 -6
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
- package/node_modules/math-intrinsics/isNegativeZero.js +0 -6
- package/node_modules/math-intrinsics/max.d.ts +0 -1
- package/node_modules/math-intrinsics/max.js +0 -4
- package/node_modules/math-intrinsics/min.d.ts +0 -1
- package/node_modules/math-intrinsics/min.js +0 -4
- package/node_modules/math-intrinsics/mod.d.ts +0 -3
- package/node_modules/math-intrinsics/mod.js +0 -9
- package/node_modules/math-intrinsics/package.json +0 -86
- package/node_modules/math-intrinsics/pow.d.ts +0 -1
- package/node_modules/math-intrinsics/pow.js +0 -4
- package/node_modules/math-intrinsics/round.d.ts +0 -1
- package/node_modules/math-intrinsics/round.js +0 -4
- package/node_modules/math-intrinsics/sign.d.ts +0 -3
- package/node_modules/math-intrinsics/sign.js +0 -11
- package/node_modules/math-intrinsics/test/index.js +0 -192
- package/node_modules/math-intrinsics/tsconfig.json +0 -3
- package/node_modules/methods/HISTORY.md +0 -29
- package/node_modules/methods/LICENSE +0 -24
- package/node_modules/methods/README.md +0 -51
- package/node_modules/methods/index.js +0 -69
- package/node_modules/methods/package.json +0 -36
- package/node_modules/mime/.npmignore +0 -0
- package/node_modules/mime/CHANGELOG.md +0 -164
- package/node_modules/mime/LICENSE +0 -21
- package/node_modules/mime/README.md +0 -90
- package/node_modules/mime/cli.js +0 -8
- package/node_modules/mime/mime.js +0 -108
- package/node_modules/mime/package.json +0 -44
- package/node_modules/mime/src/build.js +0 -53
- package/node_modules/mime/src/test.js +0 -60
- package/node_modules/mime/types.json +0 -1
- package/node_modules/ms/index.js +0 -162
- package/node_modules/ms/license.md +0 -21
- package/node_modules/ms/package.json +0 -38
- package/node_modules/ms/readme.md +0 -59
- package/node_modules/object-inspect/.eslintrc +0 -53
- package/node_modules/object-inspect/.github/FUNDING.yml +0 -12
- package/node_modules/object-inspect/.nycrc +0 -13
- package/node_modules/object-inspect/CHANGELOG.md +0 -424
- package/node_modules/object-inspect/LICENSE +0 -21
- package/node_modules/object-inspect/example/all.js +0 -23
- package/node_modules/object-inspect/example/circular.js +0 -6
- package/node_modules/object-inspect/example/fn.js +0 -5
- package/node_modules/object-inspect/example/inspect.js +0 -10
- package/node_modules/object-inspect/index.js +0 -544
- package/node_modules/object-inspect/package-support.json +0 -20
- package/node_modules/object-inspect/package.json +0 -105
- package/node_modules/object-inspect/readme.markdown +0 -84
- package/node_modules/object-inspect/test/bigint.js +0 -58
- package/node_modules/object-inspect/test/browser/dom.js +0 -15
- package/node_modules/object-inspect/test/circular.js +0 -16
- package/node_modules/object-inspect/test/deep.js +0 -12
- package/node_modules/object-inspect/test/element.js +0 -53
- package/node_modules/object-inspect/test/err.js +0 -48
- package/node_modules/object-inspect/test/fakes.js +0 -29
- package/node_modules/object-inspect/test/fn.js +0 -76
- package/node_modules/object-inspect/test/global.js +0 -17
- package/node_modules/object-inspect/test/has.js +0 -15
- package/node_modules/object-inspect/test/holes.js +0 -15
- package/node_modules/object-inspect/test/indent-option.js +0 -271
- package/node_modules/object-inspect/test/inspect.js +0 -139
- package/node_modules/object-inspect/test/lowbyte.js +0 -12
- package/node_modules/object-inspect/test/number.js +0 -58
- package/node_modules/object-inspect/test/quoteStyle.js +0 -26
- package/node_modules/object-inspect/test/toStringTag.js +0 -40
- package/node_modules/object-inspect/test/undef.js +0 -12
- package/node_modules/object-inspect/test/values.js +0 -261
- package/node_modules/object-inspect/test-core-js.js +0 -26
- package/node_modules/object-inspect/util.inspect.js +0 -1
- package/node_modules/on-finished/HISTORY.md +0 -98
- package/node_modules/on-finished/LICENSE +0 -23
- package/node_modules/on-finished/README.md +0 -162
- package/node_modules/on-finished/index.js +0 -234
- package/node_modules/on-finished/package.json +0 -39
- package/node_modules/open/index.d.ts +0 -158
- package/node_modules/open/index.js +0 -366
- package/node_modules/open/license +0 -9
- package/node_modules/open/node_modules/wsl-utils/index.d.ts +0 -21
- package/node_modules/open/node_modules/wsl-utils/index.js +0 -57
- package/node_modules/open/node_modules/wsl-utils/license +0 -9
- package/node_modules/open/node_modules/wsl-utils/package.json +0 -46
- package/node_modules/open/node_modules/wsl-utils/readme.md +0 -50
- package/node_modules/open/package.json +0 -68
- package/node_modules/open/readme.md +0 -183
- package/node_modules/open/xdg-open +0 -1267
- package/node_modules/parseurl/HISTORY.md +0 -58
- package/node_modules/parseurl/LICENSE +0 -24
- package/node_modules/parseurl/README.md +0 -133
- package/node_modules/parseurl/index.js +0 -158
- package/node_modules/parseurl/package.json +0 -40
- package/node_modules/progrok/LICENSE +0 -21
- package/node_modules/progrok/README.md +0 -331
- package/node_modules/progrok/THIRD_PARTY_NOTICES.md +0 -13
- package/node_modules/progrok/dist/index.js +0 -1626
- package/node_modules/progrok/dist/index.js.map +0 -1
- package/node_modules/progrok/dist/public/app.js +0 -529
- package/node_modules/progrok/dist/public/index.html +0 -47
- package/node_modules/progrok/dist/public/style.css +0 -392
- package/node_modules/progrok/node_modules/accepts/HISTORY.md +0 -243
- package/node_modules/progrok/node_modules/accepts/LICENSE +0 -23
- package/node_modules/progrok/node_modules/accepts/README.md +0 -140
- package/node_modules/progrok/node_modules/accepts/index.js +0 -238
- package/node_modules/progrok/node_modules/accepts/package.json +0 -47
- package/node_modules/progrok/node_modules/body-parser/HISTORY.md +0 -686
- package/node_modules/progrok/node_modules/body-parser/LICENSE +0 -23
- package/node_modules/progrok/node_modules/body-parser/README.md +0 -476
- package/node_modules/progrok/node_modules/body-parser/index.js +0 -156
- package/node_modules/progrok/node_modules/body-parser/lib/read.js +0 -205
- package/node_modules/progrok/node_modules/body-parser/lib/types/json.js +0 -243
- package/node_modules/progrok/node_modules/body-parser/lib/types/raw.js +0 -101
- package/node_modules/progrok/node_modules/body-parser/lib/types/text.js +0 -121
- package/node_modules/progrok/node_modules/body-parser/lib/types/urlencoded.js +0 -299
- package/node_modules/progrok/node_modules/body-parser/package.json +0 -55
- package/node_modules/progrok/node_modules/content-disposition/HISTORY.md +0 -60
- package/node_modules/progrok/node_modules/content-disposition/LICENSE +0 -22
- package/node_modules/progrok/node_modules/content-disposition/README.md +0 -142
- package/node_modules/progrok/node_modules/content-disposition/index.js +0 -458
- package/node_modules/progrok/node_modules/content-disposition/package.json +0 -44
- package/node_modules/progrok/node_modules/cookie-signature/History.md +0 -42
- package/node_modules/progrok/node_modules/cookie-signature/Readme.md +0 -42
- package/node_modules/progrok/node_modules/cookie-signature/index.js +0 -51
- package/node_modules/progrok/node_modules/cookie-signature/package.json +0 -18
- package/node_modules/progrok/node_modules/debug/.coveralls.yml +0 -1
- package/node_modules/progrok/node_modules/debug/.eslintrc +0 -11
- package/node_modules/progrok/node_modules/debug/.npmignore +0 -9
- package/node_modules/progrok/node_modules/debug/.travis.yml +0 -14
- package/node_modules/progrok/node_modules/debug/CHANGELOG.md +0 -362
- package/node_modules/progrok/node_modules/debug/LICENSE +0 -19
- package/node_modules/progrok/node_modules/debug/Makefile +0 -50
- package/node_modules/progrok/node_modules/debug/README.md +0 -312
- package/node_modules/progrok/node_modules/debug/component.json +0 -19
- package/node_modules/progrok/node_modules/debug/karma.conf.js +0 -70
- package/node_modules/progrok/node_modules/debug/node.js +0 -1
- package/node_modules/progrok/node_modules/debug/node_modules/ms/index.js +0 -152
- package/node_modules/progrok/node_modules/debug/node_modules/ms/license.md +0 -21
- package/node_modules/progrok/node_modules/debug/node_modules/ms/package.json +0 -37
- package/node_modules/progrok/node_modules/debug/node_modules/ms/readme.md +0 -51
- package/node_modules/progrok/node_modules/debug/package.json +0 -49
- package/node_modules/progrok/node_modules/debug/src/browser.js +0 -185
- package/node_modules/progrok/node_modules/debug/src/debug.js +0 -202
- package/node_modules/progrok/node_modules/debug/src/index.js +0 -10
- package/node_modules/progrok/node_modules/debug/src/inspector-log.js +0 -15
- package/node_modules/progrok/node_modules/debug/src/node.js +0 -248
- package/node_modules/progrok/node_modules/express/History.md +0 -3676
- package/node_modules/progrok/node_modules/express/LICENSE +0 -24
- package/node_modules/progrok/node_modules/express/Readme.md +0 -260
- package/node_modules/progrok/node_modules/express/index.js +0 -11
- package/node_modules/progrok/node_modules/express/lib/application.js +0 -661
- package/node_modules/progrok/node_modules/express/lib/express.js +0 -116
- package/node_modules/progrok/node_modules/express/lib/middleware/init.js +0 -43
- package/node_modules/progrok/node_modules/express/lib/middleware/query.js +0 -47
- package/node_modules/progrok/node_modules/express/lib/request.js +0 -525
- package/node_modules/progrok/node_modules/express/lib/response.js +0 -1179
- package/node_modules/progrok/node_modules/express/lib/router/index.js +0 -673
- package/node_modules/progrok/node_modules/express/lib/router/layer.js +0 -181
- package/node_modules/progrok/node_modules/express/lib/router/route.js +0 -230
- package/node_modules/progrok/node_modules/express/lib/utils.js +0 -304
- package/node_modules/progrok/node_modules/express/lib/view.js +0 -182
- package/node_modules/progrok/node_modules/express/package.json +0 -102
- package/node_modules/progrok/node_modules/finalhandler/HISTORY.md +0 -216
- package/node_modules/progrok/node_modules/finalhandler/LICENSE +0 -22
- package/node_modules/progrok/node_modules/finalhandler/README.md +0 -147
- package/node_modules/progrok/node_modules/finalhandler/SECURITY.md +0 -25
- package/node_modules/progrok/node_modules/finalhandler/index.js +0 -341
- package/node_modules/progrok/node_modules/finalhandler/package.json +0 -47
- package/node_modules/progrok/node_modules/fresh/HISTORY.md +0 -70
- package/node_modules/progrok/node_modules/fresh/LICENSE +0 -23
- package/node_modules/progrok/node_modules/fresh/README.md +0 -119
- package/node_modules/progrok/node_modules/fresh/index.js +0 -137
- package/node_modules/progrok/node_modules/fresh/package.json +0 -46
- package/node_modules/progrok/node_modules/iconv-lite/Changelog.md +0 -162
- package/node_modules/progrok/node_modules/iconv-lite/LICENSE +0 -21
- package/node_modules/progrok/node_modules/iconv-lite/README.md +0 -156
- package/node_modules/progrok/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -555
- package/node_modules/progrok/node_modules/iconv-lite/encodings/dbcs-data.js +0 -176
- package/node_modules/progrok/node_modules/iconv-lite/encodings/index.js +0 -22
- package/node_modules/progrok/node_modules/iconv-lite/encodings/internal.js +0 -188
- package/node_modules/progrok/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -72
- package/node_modules/progrok/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
- package/node_modules/progrok/node_modules/iconv-lite/encodings/sbcs-data.js +0 -174
- package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
- package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
- package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
- package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
- package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
- package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
- package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -55
- package/node_modules/progrok/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
- package/node_modules/progrok/node_modules/iconv-lite/encodings/utf16.js +0 -177
- package/node_modules/progrok/node_modules/iconv-lite/encodings/utf7.js +0 -290
- package/node_modules/progrok/node_modules/iconv-lite/lib/bom-handling.js +0 -52
- package/node_modules/progrok/node_modules/iconv-lite/lib/extend-node.js +0 -217
- package/node_modules/progrok/node_modules/iconv-lite/lib/index.d.ts +0 -24
- package/node_modules/progrok/node_modules/iconv-lite/lib/index.js +0 -153
- package/node_modules/progrok/node_modules/iconv-lite/lib/streams.js +0 -121
- package/node_modules/progrok/node_modules/iconv-lite/package.json +0 -46
- package/node_modules/progrok/node_modules/media-typer/HISTORY.md +0 -22
- package/node_modules/progrok/node_modules/media-typer/LICENSE +0 -22
- package/node_modules/progrok/node_modules/media-typer/README.md +0 -81
- package/node_modules/progrok/node_modules/media-typer/index.js +0 -270
- package/node_modules/progrok/node_modules/media-typer/package.json +0 -26
- package/node_modules/progrok/node_modules/merge-descriptors/HISTORY.md +0 -21
- package/node_modules/progrok/node_modules/merge-descriptors/LICENSE +0 -23
- package/node_modules/progrok/node_modules/merge-descriptors/README.md +0 -49
- package/node_modules/progrok/node_modules/merge-descriptors/index.js +0 -60
- package/node_modules/progrok/node_modules/merge-descriptors/package.json +0 -39
- package/node_modules/progrok/node_modules/mime-db/HISTORY.md +0 -507
- package/node_modules/progrok/node_modules/mime-db/LICENSE +0 -23
- package/node_modules/progrok/node_modules/mime-db/README.md +0 -100
- package/node_modules/progrok/node_modules/mime-db/db.json +0 -8519
- package/node_modules/progrok/node_modules/mime-db/index.js +0 -12
- package/node_modules/progrok/node_modules/mime-db/package.json +0 -60
- package/node_modules/progrok/node_modules/mime-types/HISTORY.md +0 -397
- package/node_modules/progrok/node_modules/mime-types/LICENSE +0 -23
- package/node_modules/progrok/node_modules/mime-types/README.md +0 -113
- package/node_modules/progrok/node_modules/mime-types/index.js +0 -188
- package/node_modules/progrok/node_modules/mime-types/package.json +0 -44
- package/node_modules/progrok/node_modules/negotiator/HISTORY.md +0 -108
- package/node_modules/progrok/node_modules/negotiator/LICENSE +0 -24
- package/node_modules/progrok/node_modules/negotiator/README.md +0 -203
- package/node_modules/progrok/node_modules/negotiator/index.js +0 -82
- package/node_modules/progrok/node_modules/negotiator/lib/charset.js +0 -169
- package/node_modules/progrok/node_modules/negotiator/lib/encoding.js +0 -184
- package/node_modules/progrok/node_modules/negotiator/lib/language.js +0 -179
- package/node_modules/progrok/node_modules/negotiator/lib/mediaType.js +0 -294
- package/node_modules/progrok/node_modules/negotiator/package.json +0 -42
- package/node_modules/progrok/node_modules/path-to-regexp/LICENSE +0 -21
- package/node_modules/progrok/node_modules/path-to-regexp/Readme.md +0 -35
- package/node_modules/progrok/node_modules/path-to-regexp/index.js +0 -158
- package/node_modules/progrok/node_modules/path-to-regexp/package.json +0 -30
- package/node_modules/progrok/node_modules/raw-body/LICENSE +0 -22
- package/node_modules/progrok/node_modules/raw-body/README.md +0 -223
- package/node_modules/progrok/node_modules/raw-body/index.d.ts +0 -87
- package/node_modules/progrok/node_modules/raw-body/index.js +0 -336
- package/node_modules/progrok/node_modules/raw-body/package.json +0 -47
- package/node_modules/progrok/node_modules/send/HISTORY.md +0 -538
- package/node_modules/progrok/node_modules/send/LICENSE +0 -23
- package/node_modules/progrok/node_modules/send/README.md +0 -327
- package/node_modules/progrok/node_modules/send/SECURITY.md +0 -24
- package/node_modules/progrok/node_modules/send/index.js +0 -1142
- package/node_modules/progrok/node_modules/send/package.json +0 -62
- package/node_modules/progrok/node_modules/serve-static/HISTORY.md +0 -493
- package/node_modules/progrok/node_modules/serve-static/LICENSE +0 -25
- package/node_modules/progrok/node_modules/serve-static/README.md +0 -257
- package/node_modules/progrok/node_modules/serve-static/index.js +0 -209
- package/node_modules/progrok/node_modules/serve-static/package.json +0 -42
- package/node_modules/progrok/node_modules/type-is/HISTORY.md +0 -259
- package/node_modules/progrok/node_modules/type-is/LICENSE +0 -23
- package/node_modules/progrok/node_modules/type-is/README.md +0 -170
- package/node_modules/progrok/node_modules/type-is/index.js +0 -266
- package/node_modules/progrok/node_modules/type-is/package.json +0 -45
- package/node_modules/progrok/package.json +0 -52
- package/node_modules/progrok/skills/progrok/SKILL.md +0 -293
- package/node_modules/proxy-addr/HISTORY.md +0 -161
- package/node_modules/proxy-addr/LICENSE +0 -22
- package/node_modules/proxy-addr/README.md +0 -139
- package/node_modules/proxy-addr/index.js +0 -327
- package/node_modules/proxy-addr/package.json +0 -47
- package/node_modules/qs/.editorconfig +0 -46
- package/node_modules/qs/.github/FUNDING.yml +0 -12
- package/node_modules/qs/.github/SECURITY.md +0 -11
- package/node_modules/qs/.github/THREAT_MODEL.md +0 -78
- package/node_modules/qs/.nycrc +0 -13
- package/node_modules/qs/CHANGELOG.md +0 -822
- package/node_modules/qs/LICENSE.md +0 -29
- package/node_modules/qs/README.md +0 -758
- package/node_modules/qs/dist/qs.js +0 -141
- package/node_modules/qs/eslint.config.mjs +0 -57
- package/node_modules/qs/lib/formats.js +0 -23
- package/node_modules/qs/lib/index.js +0 -11
- package/node_modules/qs/lib/parse.js +0 -403
- package/node_modules/qs/lib/stringify.js +0 -363
- package/node_modules/qs/lib/utils.js +0 -342
- package/node_modules/qs/package.json +0 -94
- package/node_modules/qs/test/empty-keys-cases.js +0 -267
- package/node_modules/qs/test/parse.js +0 -1703
- package/node_modules/qs/test/stringify.js +0 -1448
- package/node_modules/qs/test/utils.js +0 -432
- package/node_modules/range-parser/HISTORY.md +0 -56
- package/node_modules/range-parser/LICENSE +0 -23
- package/node_modules/range-parser/README.md +0 -84
- package/node_modules/range-parser/index.js +0 -162
- package/node_modules/range-parser/package.json +0 -44
- package/node_modules/run-applescript/index.d.ts +0 -66
- package/node_modules/run-applescript/index.js +0 -37
- package/node_modules/run-applescript/license +0 -9
- package/node_modules/run-applescript/package.json +0 -42
- package/node_modules/run-applescript/readme.md +0 -78
- package/node_modules/safe-buffer/LICENSE +0 -21
- package/node_modules/safe-buffer/README.md +0 -584
- package/node_modules/safe-buffer/index.d.ts +0 -187
- package/node_modules/safe-buffer/index.js +0 -65
- package/node_modules/safe-buffer/package.json +0 -51
- package/node_modules/safer-buffer/LICENSE +0 -21
- package/node_modules/safer-buffer/Porting-Buffer.md +0 -268
- package/node_modules/safer-buffer/Readme.md +0 -156
- package/node_modules/safer-buffer/dangerous.js +0 -58
- package/node_modules/safer-buffer/package.json +0 -34
- package/node_modules/safer-buffer/safer.js +0 -77
- package/node_modules/safer-buffer/tests.js +0 -406
- package/node_modules/setprototypeof/LICENSE +0 -13
- package/node_modules/setprototypeof/README.md +0 -31
- package/node_modules/setprototypeof/index.d.ts +0 -2
- package/node_modules/setprototypeof/index.js +0 -17
- package/node_modules/setprototypeof/package.json +0 -38
- package/node_modules/setprototypeof/test/index.js +0 -24
- package/node_modules/side-channel/.editorconfig +0 -9
- package/node_modules/side-channel/.eslintrc +0 -12
- package/node_modules/side-channel/.github/FUNDING.yml +0 -12
- package/node_modules/side-channel/.nycrc +0 -13
- package/node_modules/side-channel/CHANGELOG.md +0 -110
- package/node_modules/side-channel/LICENSE +0 -21
- package/node_modules/side-channel/README.md +0 -61
- package/node_modules/side-channel/index.d.ts +0 -14
- package/node_modules/side-channel/index.js +0 -43
- package/node_modules/side-channel/package.json +0 -85
- package/node_modules/side-channel/test/index.js +0 -104
- package/node_modules/side-channel/tsconfig.json +0 -9
- package/node_modules/side-channel-list/.editorconfig +0 -9
- package/node_modules/side-channel-list/.eslintrc +0 -11
- package/node_modules/side-channel-list/.github/FUNDING.yml +0 -12
- package/node_modules/side-channel-list/.nycrc +0 -13
- package/node_modules/side-channel-list/CHANGELOG.md +0 -36
- package/node_modules/side-channel-list/LICENSE +0 -21
- package/node_modules/side-channel-list/README.md +0 -62
- package/node_modules/side-channel-list/index.d.ts +0 -13
- package/node_modules/side-channel-list/index.js +0 -111
- package/node_modules/side-channel-list/list.d.ts +0 -14
- package/node_modules/side-channel-list/package.json +0 -77
- package/node_modules/side-channel-list/test/index.js +0 -154
- package/node_modules/side-channel-list/tsconfig.json +0 -9
- package/node_modules/side-channel-map/.editorconfig +0 -9
- package/node_modules/side-channel-map/.eslintrc +0 -11
- package/node_modules/side-channel-map/.github/FUNDING.yml +0 -12
- package/node_modules/side-channel-map/.nycrc +0 -13
- package/node_modules/side-channel-map/CHANGELOG.md +0 -22
- package/node_modules/side-channel-map/LICENSE +0 -21
- package/node_modules/side-channel-map/README.md +0 -62
- package/node_modules/side-channel-map/index.d.ts +0 -15
- package/node_modules/side-channel-map/index.js +0 -68
- package/node_modules/side-channel-map/package.json +0 -80
- package/node_modules/side-channel-map/test/index.js +0 -114
- package/node_modules/side-channel-map/tsconfig.json +0 -9
- package/node_modules/side-channel-weakmap/.editorconfig +0 -9
- package/node_modules/side-channel-weakmap/.eslintrc +0 -12
- package/node_modules/side-channel-weakmap/.github/FUNDING.yml +0 -12
- package/node_modules/side-channel-weakmap/.nycrc +0 -13
- package/node_modules/side-channel-weakmap/CHANGELOG.md +0 -28
- package/node_modules/side-channel-weakmap/LICENSE +0 -21
- package/node_modules/side-channel-weakmap/README.md +0 -62
- package/node_modules/side-channel-weakmap/index.d.ts +0 -15
- package/node_modules/side-channel-weakmap/index.js +0 -84
- package/node_modules/side-channel-weakmap/package.json +0 -87
- package/node_modules/side-channel-weakmap/test/index.js +0 -114
- package/node_modules/side-channel-weakmap/tsconfig.json +0 -9
- package/node_modules/statuses/HISTORY.md +0 -87
- package/node_modules/statuses/LICENSE +0 -23
- package/node_modules/statuses/README.md +0 -139
- package/node_modules/statuses/codes.json +0 -65
- package/node_modules/statuses/index.js +0 -146
- package/node_modules/statuses/package.json +0 -49
- package/node_modules/toidentifier/HISTORY.md +0 -9
- package/node_modules/toidentifier/LICENSE +0 -21
- package/node_modules/toidentifier/README.md +0 -61
- package/node_modules/toidentifier/index.js +0 -32
- package/node_modules/toidentifier/package.json +0 -38
- package/node_modules/unpipe/HISTORY.md +0 -4
- package/node_modules/unpipe/LICENSE +0 -22
- package/node_modules/unpipe/README.md +0 -43
- package/node_modules/unpipe/index.js +0 -69
- package/node_modules/unpipe/package.json +0 -27
- package/node_modules/utils-merge/.npmignore +0 -9
- package/node_modules/utils-merge/LICENSE +0 -20
- package/node_modules/utils-merge/README.md +0 -34
- package/node_modules/utils-merge/index.js +0 -23
- package/node_modules/utils-merge/package.json +0 -40
- package/node_modules/vary/HISTORY.md +0 -39
- package/node_modules/vary/LICENSE +0 -22
- package/node_modules/vary/README.md +0 -101
- package/node_modules/vary/index.js +0 -149
- package/node_modules/vary/package.json +0 -43
- package/ui/dist/assets/index-DYtUJ4t0.js +0 -22
- package/ui/dist/assets/useAgentDialogFocus-B2snKbzK.js +0 -1
- package/vendor/progrok-0.2.0.tgz +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as Gr,n as Ua,R as qa,f as E,j as p}from"./index-DYtUJ4t0.js";import{u as ce,a as Q,i as Vt,S as Ka,f as Qa,g as Ja,b as ec,n as tc,c as nc,w as oc,d as rc,e as Ur,h as ic,l as sc,j as ac,k as cc,m as lc,o as Ct,p as uc}from"./App-DkvU6Sex.js";function se(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=se(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var dc={value:()=>{}};function an(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Ft(n)}function Ft(e){this._=e}function fc(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Ft.prototype=an.prototype={constructor:Ft,on:function(e,t){var n=this._,o=fc(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=hc(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=Ao(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Ao(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ft(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function hc(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function Ao(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=dc,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var zn="http://www.w3.org/1999/xhtml";const Po={svg:"http://www.w3.org/2000/svg",xhtml:zn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function cn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Po.hasOwnProperty(t)?{space:Po[t],local:e}:e}function pc(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===zn&&t.documentElement.namespaceURI===zn?t.createElement(e):t.createElementNS(n,e)}}function gc(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function qr(e){var t=cn(e);return(t.local?gc:pc)(t)}function mc(){}function oo(e){return e==null?mc:function(){return this.querySelector(e)}}function yc(e){typeof e!="function"&&(e=oo(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),c,l,u=0;u<s;++u)(c=i[u])&&(l=e.call(c,c.__data__,u,i))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new de(o,this._parents)}function xc(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function wc(){return[]}function Kr(e){return e==null?wc:function(){return this.querySelectorAll(e)}}function vc(e){return function(){return xc(e.apply(this,arguments))}}function bc(e){typeof e=="function"?e=vc(e):e=Kr(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(o.push(e.call(c,c.__data__,l,s)),r.push(c));return new de(o,r)}function Qr(e){return function(){return this.matches(e)}}function Jr(e){return function(t){return t.matches(e)}}var _c=Array.prototype.find;function Sc(e){return function(){return _c.call(this.children,e)}}function Nc(){return this.firstElementChild}function Ec(e){return this.select(e==null?Nc:Sc(typeof e=="function"?e:Jr(e)))}var Cc=Array.prototype.filter;function Ic(){return Array.from(this.children)}function Mc(e){return function(){return Cc.call(this.children,e)}}function kc(e){return this.selectAll(e==null?Ic:Mc(typeof e=="function"?e:Jr(e)))}function Tc(e){typeof e!="function"&&(e=Qr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new de(o,this._parents)}function ei(e){return new Array(e.length)}function Ac(){return new de(this._enter||this._groups.map(ei),this._parents)}function Ut(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ut.prototype={constructor:Ut,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Pc(e){return function(){return e}}function Dc(e,t,n,o,r,i){for(var s=0,a,c=t.length,l=i.length;s<l;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Ut(e,i[s]);for(;s<c;++s)(a=t[s])&&(r[s]=a)}function $c(e,t,n,o,r,i,s){var a,c,l=new Map,u=t.length,f=i.length,d=new Array(u),h;for(a=0;a<u;++a)(c=t[a])&&(d[a]=h=s.call(c,c.__data__,a,t)+"",l.has(h)?r[a]=c:l.set(h,c));for(a=0;a<f;++a)h=s.call(e,i[a],a,i)+"",(c=l.get(h))?(o[a]=c,c.__data__=i[a],l.delete(h)):n[a]=new Ut(e,i[a]);for(a=0;a<u;++a)(c=t[a])&&l.get(d[a])===c&&(r[a]=c)}function jc(e){return e.__data__}function Rc(e,t){if(!arguments.length)return Array.from(this,jc);var n=t?$c:Dc,o=this._parents,r=this._groups;typeof e!="function"&&(e=Pc(e));for(var i=r.length,s=new Array(i),a=new Array(i),c=new Array(i),l=0;l<i;++l){var u=o[l],f=r[l],d=f.length,h=Hc(e.call(u,u&&u.__data__,l,o)),m=h.length,v=a[l]=new Array(m),x=s[l]=new Array(m),y=c[l]=new Array(d);n(u,f,v,x,y,h,t);for(var w=0,g=0,b,C;w<m;++w)if(b=v[w]){for(w>=g&&(g=w+1);!(C=x[g])&&++g<m;);b._next=C||null}}return s=new de(s,o),s._enter=a,s._exit=c,s}function Hc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Oc(){return new de(this._exit||this._groups.map(ei),this._parents)}function zc(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function Lc(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),c=0;c<s;++c)for(var l=n[c],u=o[c],f=l.length,d=a[c]=new Array(f),h,m=0;m<f;++m)(h=l[m]||u[m])&&(d[m]=h);for(;c<r;++c)a[c]=n[c];return new de(a,this._parents)}function Bc(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Vc(e){e||(e=Fc);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,c=r[i]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(t)}return new de(r,this._parents).order()}function Fc(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Yc(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xc(){return Array.from(this)}function Wc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function Zc(){let e=0;for(const t of this)++e;return e}function Gc(){return!this.node()}function Uc(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function qc(e){return function(){this.removeAttribute(e)}}function Kc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qc(e,t){return function(){this.setAttribute(e,t)}}function Jc(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function el(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function tl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function nl(e,t){var n=cn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Kc:qc:typeof t=="function"?n.local?tl:el:n.local?Jc:Qc)(n,t))}function ti(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ol(e){return function(){this.style.removeProperty(e)}}function rl(e,t,n){return function(){this.style.setProperty(e,t,n)}}function il(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function sl(e,t,n){return arguments.length>1?this.each((t==null?ol:typeof t=="function"?il:rl)(e,t,n??"")):ot(this.node(),e)}function ot(e,t){return e.style.getPropertyValue(t)||ti(e).getComputedStyle(e,null).getPropertyValue(t)}function al(e){return function(){delete this[e]}}function cl(e,t){return function(){this[e]=t}}function ll(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ul(e,t){return arguments.length>1?this.each((t==null?al:typeof t=="function"?ll:cl)(e,t)):this.node()[e]}function ni(e){return e.trim().split(/^|\s+/)}function ro(e){return e.classList||new oi(e)}function oi(e){this._node=e,this._names=ni(e.getAttribute("class")||"")}oi.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ri(e,t){for(var n=ro(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function ii(e,t){for(var n=ro(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function dl(e){return function(){ri(this,e)}}function fl(e){return function(){ii(this,e)}}function hl(e,t){return function(){(t.apply(this,arguments)?ri:ii)(this,e)}}function pl(e,t){var n=ni(e+"");if(arguments.length<2){for(var o=ro(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?hl:t?dl:fl)(n,t))}function gl(){this.textContent=""}function ml(e){return function(){this.textContent=e}}function yl(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function xl(e){return arguments.length?this.each(e==null?gl:(typeof e=="function"?yl:ml)(e)):this.node().textContent}function wl(){this.innerHTML=""}function vl(e){return function(){this.innerHTML=e}}function bl(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function _l(e){return arguments.length?this.each(e==null?wl:(typeof e=="function"?bl:vl)(e)):this.node().innerHTML}function Sl(){this.nextSibling&&this.parentNode.appendChild(this)}function Nl(){return this.each(Sl)}function El(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cl(){return this.each(El)}function Il(e){var t=typeof e=="function"?e:qr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ml(){return null}function kl(e,t){var n=typeof e=="function"?e:qr(e),o=t==null?Ml:typeof t=="function"?t:oo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Tl(){var e=this.parentNode;e&&e.removeChild(this)}function Al(){return this.each(Tl)}function Pl(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Dl(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $l(e){return this.select(e?Dl:Pl)}function jl(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Rl(e){return function(t){e.call(this,t,this.__data__)}}function Hl(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Ol(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function zl(e,t,n){return function(){var o=this.__on,r,i=Rl(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Ll(e,t,n){var o=Hl(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(r=0,u=a[c];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?zl:Ol,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function si(e,t,n){var o=ti(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Bl(e,t){return function(){return si(this,e,t)}}function Vl(e,t){return function(){return si(this,e,t.apply(this,arguments))}}function Fl(e,t){return this.each((typeof t=="function"?Vl:Bl)(e,t))}function*Yl(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var ai=[null];function de(e,t){this._groups=e,this._parents=t}function It(){return new de([[document.documentElement]],ai)}function Xl(){return this}de.prototype=It.prototype={constructor:de,select:yc,selectAll:bc,selectChild:Ec,selectChildren:kc,filter:Tc,data:Rc,enter:Ac,exit:Oc,join:zc,merge:Lc,selection:Xl,order:Bc,sort:Vc,call:Yc,nodes:Xc,node:Wc,size:Zc,empty:Gc,each:Uc,attr:nl,style:sl,property:ul,classed:pl,text:xl,html:_l,raise:Nl,lower:Cl,append:Il,insert:kl,remove:Al,clone:$l,datum:jl,on:Ll,dispatch:Fl,[Symbol.iterator]:Yl};function ue(e){return typeof e=="string"?new de([[document.querySelector(e)]],[document.documentElement]):new de([[e]],ai)}function Wl(e){let t;for(;t=e.sourceEvent;)e=t;return e}function he(e,t){if(e=Wl(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Zl={passive:!1},yt={capture:!0,passive:!1};function Sn(e){e.stopImmediatePropagation()}function tt(e){e.preventDefault(),e.stopImmediatePropagation()}function ci(e){var t=e.document.documentElement,n=ue(e).on("dragstart.drag",tt,yt);"onselectstart"in t?n.on("selectstart.drag",tt,yt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function li(e,t){var n=e.document.documentElement,o=ue(e).on("dragstart.drag",null);t&&(o.on("click.drag",tt,yt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Dt=e=>()=>e;function Ln(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Ln.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Gl(e){return!e.ctrlKey&&!e.button}function Ul(){return this.parentNode}function ql(e,t){return t??{x:e.x,y:e.y}}function Kl(){return navigator.maxTouchPoints||"ontouchstart"in this}function ui(){var e=Gl,t=Ul,n=ql,o=Kl,r={},i=an("start","drag","end"),s=0,a,c,l,u,f=0;function d(b){b.on("mousedown.drag",h).filter(o).on("touchstart.drag",x).on("touchmove.drag",y,Zl).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(b,C){if(!(u||!e.call(this,b,C))){var S=g(this,t.call(this,b,C),b,C,"mouse");S&&(ue(b.view).on("mousemove.drag",m,yt).on("mouseup.drag",v,yt),ci(b.view),Sn(b),l=!1,a=b.clientX,c=b.clientY,S("start",b))}}function m(b){if(tt(b),!l){var C=b.clientX-a,S=b.clientY-c;l=C*C+S*S>f}r.mouse("drag",b)}function v(b){ue(b.view).on("mousemove.drag mouseup.drag",null),li(b.view,l),tt(b),r.mouse("end",b)}function x(b,C){if(e.call(this,b,C)){var S=b.changedTouches,N=t.call(this,b,C),k=S.length,A,B;for(A=0;A<k;++A)(B=g(this,N,b,C,S[A].identifier,S[A]))&&(Sn(b),B("start",b,S[A]))}}function y(b){var C=b.changedTouches,S=C.length,N,k;for(N=0;N<S;++N)(k=r[C[N].identifier])&&(tt(b),k("drag",b,C[N]))}function w(b){var C=b.changedTouches,S=C.length,N,k;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),N=0;N<S;++N)(k=r[C[N].identifier])&&(Sn(b),k("end",b,C[N]))}function g(b,C,S,N,k,A){var B=i.copy(),T=he(A||S,C),O,H,_;if((_=n.call(b,new Ln("beforestart",{sourceEvent:S,target:d,identifier:k,active:s,x:T[0],y:T[1],dx:0,dy:0,dispatch:B}),N))!=null)return O=_.x-T[0]||0,H=_.y-T[1]||0,function I(M,P,$){var j=T,z;switch(M){case"start":r[k]=I,z=s++;break;case"end":delete r[k],--s;case"drag":T=he($||P,C),z=s;break}B.call(M,b,new Ln(M,{sourceEvent:P,subject:_,target:d,identifier:k,active:z,x:T[0]+O,y:T[1]+H,dx:T[0]-j[0],dy:T[1]-j[1],dispatch:B}),N)}}return d.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Dt(!!b),d):e},d.container=function(b){return arguments.length?(t=typeof b=="function"?b:Dt(b),d):t},d.subject=function(b){return arguments.length?(n=typeof b=="function"?b:Dt(b),d):n},d.touchable=function(b){return arguments.length?(o=typeof b=="function"?b:Dt(!!b),d):o},d.on=function(){var b=i.on.apply(i,arguments);return b===i?d:b},d.clickDistance=function(b){return arguments.length?(f=(b=+b)*b,d):Math.sqrt(f)},d}function io(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function di(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Mt(){}var xt=.7,qt=1/xt,nt="\\s*([+-]?\\d+)\\s*",wt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Se="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ql=/^#([0-9a-f]{3,8})$/,Jl=new RegExp(`^rgb\\(${nt},${nt},${nt}\\)$`),eu=new RegExp(`^rgb\\(${Se},${Se},${Se}\\)$`),tu=new RegExp(`^rgba\\(${nt},${nt},${nt},${wt}\\)$`),nu=new RegExp(`^rgba\\(${Se},${Se},${Se},${wt}\\)$`),ou=new RegExp(`^hsl\\(${wt},${Se},${Se}\\)$`),ru=new RegExp(`^hsla\\(${wt},${Se},${Se},${wt}\\)$`),Do={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};io(Mt,Xe,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$o,formatHex:$o,formatHex8:iu,formatHsl:su,formatRgb:jo,toString:jo});function $o(){return this.rgb().formatHex()}function iu(){return this.rgb().formatHex8()}function su(){return fi(this).formatHsl()}function jo(){return this.rgb().formatRgb()}function Xe(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ql.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ro(t):n===3?new le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$t(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$t(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Jl.exec(e))?new le(t[1],t[2],t[3],1):(t=eu.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tu.exec(e))?$t(t[1],t[2],t[3],t[4]):(t=nu.exec(e))?$t(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ou.exec(e))?zo(t[1],t[2]/100,t[3]/100,1):(t=ru.exec(e))?zo(t[1],t[2]/100,t[3]/100,t[4]):Do.hasOwnProperty(e)?Ro(Do[e]):e==="transparent"?new le(NaN,NaN,NaN,0):null}function Ro(e){return new le(e>>16&255,e>>8&255,e&255,1)}function $t(e,t,n,o){return o<=0&&(e=t=n=NaN),new le(e,t,n,o)}function au(e){return e instanceof Mt||(e=Xe(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function Bn(e,t,n,o){return arguments.length===1?au(e):new le(e,t,n,o??1)}function le(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}io(le,Bn,di(Mt,{brighter(e){return e=e==null?qt:Math.pow(qt,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xt:Math.pow(xt,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new le(Fe(this.r),Fe(this.g),Fe(this.b),Kt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ho,formatHex:Ho,formatHex8:cu,formatRgb:Oo,toString:Oo}));function Ho(){return`#${Ve(this.r)}${Ve(this.g)}${Ve(this.b)}`}function cu(){return`#${Ve(this.r)}${Ve(this.g)}${Ve(this.b)}${Ve((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oo(){const e=Kt(this.opacity);return`${e===1?"rgb(":"rgba("}${Fe(this.r)}, ${Fe(this.g)}, ${Fe(this.b)}${e===1?")":`, ${e})`}`}function Kt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ve(e){return e=Fe(e),(e<16?"0":"")+e.toString(16)}function zo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pe(e,t,n,o)}function fi(e){if(e instanceof pe)return new pe(e.h,e.s,e.l,e.opacity);if(e instanceof Mt||(e=Xe(e)),!e)return new pe;if(e instanceof pe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,c=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=c<.5?i+r:2-i-r,s*=60):a=c>0&&c<1?0:s,new pe(s,a,c,e.opacity)}function lu(e,t,n,o){return arguments.length===1?fi(e):new pe(e,t,n,o??1)}function pe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}io(pe,lu,di(Mt,{brighter(e){return e=e==null?qt:Math.pow(qt,e),new pe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xt:Math.pow(xt,e),new pe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new le(Nn(e>=240?e-240:e+120,r,o),Nn(e,r,o),Nn(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new pe(Lo(this.h),jt(this.s),jt(this.l),Kt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Kt(this.opacity);return`${e===1?"hsl(":"hsla("}${Lo(this.h)}, ${jt(this.s)*100}%, ${jt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Lo(e){return e=(e||0)%360,e<0?e+360:e}function jt(e){return Math.max(0,Math.min(1,e||0))}function Nn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const so=e=>()=>e;function uu(e,t){return function(n){return e+n*t}}function du(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function fu(e){return(e=+e)==1?hi:function(t,n){return n-t?du(t,n,e):so(isNaN(t)?n:t)}}function hi(e,t){var n=t-e;return n?uu(e,n):so(isNaN(e)?t:e)}const Qt=(function e(t){var n=fu(t);function o(r,i){var s=n((r=Bn(r)).r,(i=Bn(i)).r),a=n(r.g,i.g),c=n(r.b,i.b),l=hi(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=c(u),r.opacity=l(u),r+""}}return o.gamma=e,o})(1);function hu(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function pu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gu(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=pt(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function mu(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function _e(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function yu(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=pt(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var Vn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,En=new RegExp(Vn.source,"g");function xu(e){return function(){return e}}function wu(e){return function(t){return e(t)+""}}function pi(e,t){var n=Vn.lastIndex=En.lastIndex=0,o,r,i,s=-1,a=[],c=[];for(e=e+"",t=t+"";(o=Vn.exec(e))&&(r=En.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,c.push({i:s,x:_e(o,r)})),n=En.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?c[0]?wu(c[0].x):xu(t):(t=c.length,function(l){for(var u=0,f;u<t;++u)a[(f=c[u]).i]=f.x(l);return a.join("")})}function pt(e,t){var n=typeof t,o;return t==null||n==="boolean"?so(t):(n==="number"?_e:n==="string"?(o=Xe(t))?(t=o,Qt):pi:t instanceof Xe?Qt:t instanceof Date?mu:pu(t)?hu:Array.isArray(t)?gu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?yu:_e)(e,t)}var Bo=180/Math.PI,Fn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gi(e,t,n,o,r,i){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*o)&&(n-=e*c,o-=t*c),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,c/=a),e*o<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Bo,skewX:Math.atan(c)*Bo,scaleX:s,scaleY:a}}var Rt;function vu(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Fn:gi(t.a,t.b,t.c,t.d,t.e,t.f)}function bu(e){return e==null||(Rt||(Rt=document.createElementNS("http://www.w3.org/2000/svg","g")),Rt.setAttribute("transform",e),!(e=Rt.transform.baseVal.consolidate()))?Fn:(e=e.matrix,gi(e.a,e.b,e.c,e.d,e.e,e.f))}function mi(e,t,n,o){function r(l){return l.length?l.pop()+" ":""}function i(l,u,f,d,h,m){if(l!==f||u!==d){var v=h.push("translate(",null,t,null,n);m.push({i:v-4,x:_e(l,f)},{i:v-2,x:_e(u,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(l,u,f,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:f.push(r(f)+"rotate(",null,o)-2,x:_e(l,u)})):u&&f.push(r(f)+"rotate("+u+o)}function a(l,u,f,d){l!==u?d.push({i:f.push(r(f)+"skewX(",null,o)-2,x:_e(l,u)}):u&&f.push(r(f)+"skewX("+u+o)}function c(l,u,f,d,h,m){if(l!==f||u!==d){var v=h.push(r(h)+"scale(",null,",",null,")");m.push({i:v-4,x:_e(l,f)},{i:v-2,x:_e(u,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(l,u){var f=[],d=[];return l=e(l),u=e(u),i(l.translateX,l.translateY,u.translateX,u.translateY,f,d),s(l.rotate,u.rotate,f,d),a(l.skewX,u.skewX,f,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,d),l=u=null,function(h){for(var m=-1,v=d.length,x;++m<v;)f[(x=d[m]).i]=x.x(h);return f.join("")}}}var _u=mi(vu,"px, ","px)","deg)"),Su=mi(bu,", ",")",")"),Nu=1e-12;function Vo(e){return((e=Math.exp(e))+1/e)/2}function Eu(e){return((e=Math.exp(e))-1/e)/2}function Cu(e){return((e=Math.exp(2*e))-1)/(e+1)}const Yt=(function e(t,n,o){function r(i,s){var a=i[0],c=i[1],l=i[2],u=s[0],f=s[1],d=s[2],h=u-a,m=f-c,v=h*h+m*m,x,y;if(v<Nu)y=Math.log(d/l)/t,x=function(N){return[a+N*h,c+N*m,l*Math.exp(t*N*y)]};else{var w=Math.sqrt(v),g=(d*d-l*l+o*v)/(2*l*n*w),b=(d*d-l*l-o*v)/(2*d*n*w),C=Math.log(Math.sqrt(g*g+1)-g),S=Math.log(Math.sqrt(b*b+1)-b);y=(S-C)/t,x=function(N){var k=N*y,A=Vo(C),B=l/(n*w)*(A*Cu(t*k+C)-Eu(C));return[a+B*h,c+B*m,l*A/Vo(t*k+C)]}}return x.duration=y*1e3*t/Math.SQRT2,x}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return e(s,a,c)},r})(Math.SQRT2,2,4);var rt=0,ft=0,lt=0,yi=1e3,Jt,ht,en=0,We=0,ln=0,vt=typeof performance=="object"&&performance.now?performance:Date,xi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ao(){return We||(xi(Iu),We=vt.now()+ln)}function Iu(){We=0}function tn(){this._call=this._time=this._next=null}tn.prototype=wi.prototype={constructor:tn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ao():+n)+(t==null?0:+t),!this._next&&ht!==this&&(ht?ht._next=this:Jt=this,ht=this),this._call=e,this._time=n,Yn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yn())}};function wi(e,t,n){var o=new tn;return o.restart(e,t,n),o}function Mu(){ao(),++rt;for(var e=Jt,t;e;)(t=We-e._time)>=0&&e._call.call(void 0,t),e=e._next;--rt}function Fo(){We=(en=vt.now())+ln,rt=ft=0;try{Mu()}finally{rt=0,Tu(),We=0}}function ku(){var e=vt.now(),t=e-en;t>yi&&(ln-=t,en=e)}function Tu(){for(var e,t=Jt,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Jt=n);ht=e,Yn(o)}function Yn(e){if(!rt){ft&&(ft=clearTimeout(ft));var t=e-We;t>24?(e<1/0&&(ft=setTimeout(Fo,e-vt.now()-ln)),lt&&(lt=clearInterval(lt))):(lt||(en=vt.now(),lt=setInterval(ku,yi)),rt=1,xi(Fo))}}function Yo(e,t,n){var o=new tn;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Au=an("start","end","cancel","interrupt"),Pu=[],vi=0,Xo=1,Xn=2,Xt=3,Wo=4,Wn=5,Wt=6;function un(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Du(e,n,{name:t,index:o,group:r,on:Au,tween:Pu,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:vi})}function co(e,t){var n=xe(e,t);if(n.state>vi)throw new Error("too late; already scheduled");return n}function Ne(e,t){var n=xe(e,t);if(n.state>Xt)throw new Error("too late; already running");return n}function xe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Du(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=wi(i,0,n.time);function i(l){n.state=Xo,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,f,d,h;if(n.state!==Xo)return c();for(u in o)if(h=o[u],h.name===n.name){if(h.state===Xt)return Yo(s);h.state===Wo?(h.state=Wt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[u]):+u<t&&(h.state=Wt,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[u])}if(Yo(function(){n.state===Xt&&(n.state=Wo,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Xn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Xn){for(n.state=Xt,r=new Array(d=n.tween.length),u=0,f=-1;u<d;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++f]=h);r.length=f+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Wn,1),f=-1,d=r.length;++f<d;)r[f].call(e,u);n.state===Wn&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Wt,n.timer.stop(),delete o[t];for(var l in o)return;delete e.__transition}}function Zt(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>Xn&&o.state<Wn,o.state=Wt,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function $u(e){return this.each(function(){Zt(this,e)})}function ju(e,t){var n,o;return function(){var r=Ne(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function Ru(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=Ne(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},c=0,l=r.length;c<l;++c)if(r[c].name===t){r[c]=a;break}c===l&&r.push(a)}i.tween=r}}function Hu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=xe(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?ju:Ru)(n,e,t))}function lo(e,t,n){var o=e._id;return e.each(function(){var r=Ne(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return xe(r,o).value[t]}}function bi(e,t){var n;return(typeof t=="number"?_e:t instanceof Xe?Qt:(n=Xe(t))?(t=n,Qt):pi)(e,t)}function Ou(e){return function(){this.removeAttribute(e)}}function zu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Lu(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function Bu(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function Vu(e,t,n){var o,r,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a)))}}function Fu(e,t,n){var o,r,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a)))}}function Yu(e,t){var n=cn(e),o=n==="transform"?Su:bi;return this.attrTween(e,typeof t=="function"?(n.local?Fu:Vu)(n,o,lo(this,"attr."+e,t)):t==null?(n.local?zu:Ou)(n):(n.local?Bu:Lu)(n,o,t))}function Xu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Wu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Zu(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Wu(e,i)),n}return r._value=t,r}function Gu(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Xu(e,i)),n}return r._value=t,r}function Uu(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=cn(e);return this.tween(n,(o.local?Zu:Gu)(o,t))}function qu(e,t){return function(){co(this,e).delay=+t.apply(this,arguments)}}function Ku(e,t){return t=+t,function(){co(this,e).delay=t}}function Qu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qu:Ku)(t,e)):xe(this.node(),t).delay}function Ju(e,t){return function(){Ne(this,e).duration=+t.apply(this,arguments)}}function ed(e,t){return t=+t,function(){Ne(this,e).duration=t}}function td(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ju:ed)(t,e)):xe(this.node(),t).duration}function nd(e,t){if(typeof t!="function")throw new Error;return function(){Ne(this,e).ease=t}}function od(e){var t=this._id;return arguments.length?this.each(nd(t,e)):xe(this.node(),t).ease}function rd(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ne(this,e).ease=n}}function id(e){if(typeof e!="function")throw new Error;return this.each(rd(this._id,e))}function sd(e){typeof e!="function"&&(e=Qr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new Pe(o,this._parents,this._name,this._id)}function ad(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var c=t[a],l=n[a],u=c.length,f=s[a]=new Array(u),d,h=0;h<u;++h)(d=c[h]||l[h])&&(f[h]=d);for(;a<o;++a)s[a]=t[a];return new Pe(s,this._parents,this._name,this._id)}function cd(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function ld(e,t,n){var o,r,i=cd(t)?co:Ne;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function ud(e,t){var n=this._id;return arguments.length<2?xe(this.node(),n).on.on(e):this.each(ld(n,e,t))}function dd(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function fd(){return this.on("end.remove",dd(this._id))}function hd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=oo(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],c=a.length,l=i[s]=new Array(c),u,f,d=0;d<c;++d)(u=a[d])&&(f=e.call(u,u.__data__,d,a))&&("__data__"in u&&(f.__data__=u.__data__),l[d]=f,un(l[d],t,n,d,l,xe(u,n)));return new Pe(i,this._parents,t,n)}function pd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Kr(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var c=o[a],l=c.length,u,f=0;f<l;++f)if(u=c[f]){for(var d=e.call(u,u.__data__,f,c),h,m=xe(u,n),v=0,x=d.length;v<x;++v)(h=d[v])&&un(h,t,n,v,d,m);i.push(d),s.push(u)}return new Pe(i,s,t,n)}var gd=It.prototype.constructor;function md(){return new gd(this._groups,this._parents)}function yd(e,t){var n,o,r;return function(){var i=ot(this,e),s=(this.style.removeProperty(e),ot(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function _i(e){return function(){this.style.removeProperty(e)}}function xd(e,t,n){var o,r=n+"",i;return function(){var s=ot(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function wd(e,t,n){var o,r,i;return function(){var s=ot(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),ot(this,e))),s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a))}}function vd(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var c=Ne(this,e),l=c.on,u=c.value[i]==null?a||(a=_i(t)):void 0;(l!==n||r!==u)&&(o=(n=l).copy()).on(s,r=u),c.on=o}}function bd(e,t,n){var o=(e+="")=="transform"?_u:bi;return t==null?this.styleTween(e,yd(e,o)).on("end.style."+e,_i(e)):typeof t=="function"?this.styleTween(e,wd(e,o,lo(this,"style."+e,t))).each(vd(this._id,e)):this.styleTween(e,xd(e,o,t),n).on("end.style."+e,null)}function _d(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Sd(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&_d(e,s,n)),o}return i._value=t,i}function Nd(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,Sd(e,t,n??""))}function Ed(e){return function(){this.textContent=e}}function Cd(e){return function(){var t=e(this);this.textContent=t??""}}function Id(e){return this.tween("text",typeof e=="function"?Cd(lo(this,"text",e)):Ed(e==null?"":e+""))}function Md(e){return function(t){this.textContent=e.call(this,t)}}function kd(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Md(r)),t}return o._value=e,o}function Td(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,kd(e))}function Ad(){for(var e=this._name,t=this._id,n=Si(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=xe(c,t);un(c,e,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Pe(o,this._parents,e,n)}function Pd(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--r===0&&i()}};n.each(function(){var l=Ne(this,o),u=l.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),l.on=t}),r===0&&i()})}var Dd=0;function Pe(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Si(){return++Dd}var ke=It.prototype;Pe.prototype={constructor:Pe,select:hd,selectAll:pd,selectChild:ke.selectChild,selectChildren:ke.selectChildren,filter:sd,merge:ad,selection:md,transition:Ad,call:ke.call,nodes:ke.nodes,node:ke.node,size:ke.size,empty:ke.empty,each:ke.each,on:ud,attr:Yu,attrTween:Uu,style:bd,styleTween:Nd,text:Id,textTween:Td,remove:fd,tween:Hu,delay:Qu,duration:td,ease:od,easeVarying:id,end:Pd,[Symbol.iterator]:ke[Symbol.iterator]};function $d(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var jd={time:null,delay:0,duration:250,ease:$d};function Rd(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Hd(e){var t,n;e instanceof Pe?(t=e._id,e=e._name):(t=Si(),(n=jd).time=ao(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&un(c,e,t,l,s,n||Rd(c,t));return new Pe(o,this._parents,e,t)}It.prototype.interrupt=$u;It.prototype.transition=Hd;const Ht=e=>()=>e;function Od(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Te(e,t,n){this.k=e,this.x=t,this.y=n}Te.prototype={constructor:Te,scale:function(e){return e===1?this:new Te(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Te(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var dn=new Te(1,0,0);Ni.prototype=Te.prototype;function Ni(e){for(;!e.__zoom;)if(!(e=e.parentNode))return dn;return e.__zoom}function Cn(e){e.stopImmediatePropagation()}function ut(e){e.preventDefault(),e.stopImmediatePropagation()}function zd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Ld(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Zo(){return this.__zoom||dn}function Bd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Vd(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fd(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Ei(){var e=zd,t=Ld,n=Fd,o=Bd,r=Vd,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=Yt,l=an("start","zoom","end"),u,f,d,h=500,m=150,v=0,x=10;function y(_){_.property("__zoom",Zo).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",B).filter(r).on("touchstart.zoom",T).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(_,I,M,P){var $=_.selection?_.selection():_;$.property("__zoom",Zo),_!==$?C(_,I,M,P):$.interrupt().each(function(){S(this,arguments).event(P).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(_,I,M,P){y.scaleTo(_,function(){var $=this.__zoom.k,j=typeof I=="function"?I.apply(this,arguments):I;return $*j},M,P)},y.scaleTo=function(_,I,M,P){y.transform(_,function(){var $=t.apply(this,arguments),j=this.__zoom,z=M==null?b($):typeof M=="function"?M.apply(this,arguments):M,V=j.invert(z),L=typeof I=="function"?I.apply(this,arguments):I;return n(g(w(j,L),z,V),$,s)},M,P)},y.translateBy=function(_,I,M,P){y.transform(_,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),s)},null,P)},y.translateTo=function(_,I,M,P,$){y.transform(_,function(){var j=t.apply(this,arguments),z=this.__zoom,V=P==null?b(j):typeof P=="function"?P.apply(this,arguments):P;return n(dn.translate(V[0],V[1]).scale(z.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof M=="function"?-M.apply(this,arguments):-M),j,s)},P,$)};function w(_,I){return I=Math.max(i[0],Math.min(i[1],I)),I===_.k?_:new Te(I,_.x,_.y)}function g(_,I,M){var P=I[0]-M[0]*_.k,$=I[1]-M[1]*_.k;return P===_.x&&$===_.y?_:new Te(_.k,P,$)}function b(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function C(_,I,M,P){_.on("start.zoom",function(){S(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(P).end()}).tween("zoom",function(){var $=this,j=arguments,z=S($,j).event(P),V=t.apply($,j),L=M==null?b(V):typeof M=="function"?M.apply($,j):M,W=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),Y=$.__zoom,Z=typeof I=="function"?I.apply($,j):I,J=c(Y.invert(L).concat(W/Y.k),Z.invert(L).concat(W/Z.k));return function(R){if(R===1)R=Z;else{var D=J(R),F=W/D[2];R=new Te(F,L[0]-D[0]*F,L[1]-D[1]*F)}z.zoom(null,R)}})}function S(_,I,M){return!M&&_.__zooming||new N(_,I)}function N(_,I){this.that=_,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,I),this.taps=0}N.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,I){return this.mouse&&_!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var I=ue(this.that).datum();l.call(_,this.that,new Od(_,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:l}),I)}};function k(_,...I){if(!e.apply(this,arguments))return;var M=S(this,I).event(_),P=this.__zoom,$=Math.max(i[0],Math.min(i[1],P.k*Math.pow(2,o.apply(this,arguments)))),j=he(_);if(M.wheel)(M.mouse[0][0]!==j[0]||M.mouse[0][1]!==j[1])&&(M.mouse[1]=P.invert(M.mouse[0]=j)),clearTimeout(M.wheel);else{if(P.k===$)return;M.mouse=[j,P.invert(j)],Zt(this),M.start()}ut(_),M.wheel=setTimeout(z,m),M.zoom("mouse",n(g(w(P,$),M.mouse[0],M.mouse[1]),M.extent,s));function z(){M.wheel=null,M.end()}}function A(_,...I){if(d||!e.apply(this,arguments))return;var M=_.currentTarget,P=S(this,I,!0).event(_),$=ue(_.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",W,!0),j=he(_,M),z=_.clientX,V=_.clientY;ci(_.view),Cn(_),P.mouse=[j,this.__zoom.invert(j)],Zt(this),P.start();function L(Y){if(ut(Y),!P.moved){var Z=Y.clientX-z,J=Y.clientY-V;P.moved=Z*Z+J*J>v}P.event(Y).zoom("mouse",n(g(P.that.__zoom,P.mouse[0]=he(Y,M),P.mouse[1]),P.extent,s))}function W(Y){$.on("mousemove.zoom mouseup.zoom",null),li(Y.view,P.moved),ut(Y),P.event(Y).end()}}function B(_,...I){if(e.apply(this,arguments)){var M=this.__zoom,P=he(_.changedTouches?_.changedTouches[0]:_,this),$=M.invert(P),j=M.k*(_.shiftKey?.5:2),z=n(g(w(M,j),P,$),t.apply(this,I),s);ut(_),a>0?ue(this).transition().duration(a).call(C,z,P,_):ue(this).call(y.transform,z,P,_)}}function T(_,...I){if(e.apply(this,arguments)){var M=_.touches,P=M.length,$=S(this,I,_.changedTouches.length===P).event(_),j,z,V,L;for(Cn(_),z=0;z<P;++z)V=M[z],L=he(V,this),L=[L,this.__zoom.invert(L),V.identifier],$.touch0?!$.touch1&&$.touch0[2]!==L[2]&&($.touch1=L,$.taps=0):($.touch0=L,j=!0,$.taps=1+!!u);u&&(u=clearTimeout(u)),j&&($.taps<2&&(f=L[0],u=setTimeout(function(){u=null},h)),Zt(this),$.start())}}function O(_,...I){if(this.__zooming){var M=S(this,I).event(_),P=_.changedTouches,$=P.length,j,z,V,L;for(ut(_),j=0;j<$;++j)z=P[j],V=he(z,this),M.touch0&&M.touch0[2]===z.identifier?M.touch0[0]=V:M.touch1&&M.touch1[2]===z.identifier&&(M.touch1[0]=V);if(z=M.that.__zoom,M.touch1){var W=M.touch0[0],Y=M.touch0[1],Z=M.touch1[0],J=M.touch1[1],R=(R=Z[0]-W[0])*R+(R=Z[1]-W[1])*R,D=(D=J[0]-Y[0])*D+(D=J[1]-Y[1])*D;z=w(z,Math.sqrt(R/D)),V=[(W[0]+Z[0])/2,(W[1]+Z[1])/2],L=[(Y[0]+J[0])/2,(Y[1]+J[1])/2]}else if(M.touch0)V=M.touch0[0],L=M.touch0[1];else return;M.zoom("touch",n(g(z,V,L),M.extent,s))}}function H(_,...I){if(this.__zooming){var M=S(this,I).event(_),P=_.changedTouches,$=P.length,j,z;for(Cn(_),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),j=0;j<$;++j)z=P[j],M.touch0&&M.touch0[2]===z.identifier?delete M.touch0:M.touch1&&M.touch1[2]===z.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(z=he(z,this),Math.hypot(f[0]-z[0],f[1]-z[1])<x)){var V=ue(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return y.wheelDelta=function(_){return arguments.length?(o=typeof _=="function"?_:Ht(+_),y):o},y.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Ht(!!_),y):e},y.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:Ht(!!_),y):r},y.extent=function(_){return arguments.length?(t=typeof _=="function"?_:Ht([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),y):t},y.scaleExtent=function(_){return arguments.length?(i[0]=+_[0],i[1]=+_[1],y):[i[0],i[1]]},y.translateExtent=function(_){return arguments.length?(s[0][0]=+_[0][0],s[1][0]=+_[1][0],s[0][1]=+_[0][1],s[1][1]=+_[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(_){return arguments.length?(n=_,y):n},y.duration=function(_){return arguments.length?(a=+_,y):a},y.interpolate=function(_){return arguments.length?(c=_,y):c},y.on=function(){var _=l.on.apply(l,arguments);return _===l?y:_},y.clickDistance=function(_){return arguments.length?(v=(_=+_)*_,y):Math.sqrt(v)},y.tapDistance=function(_){return arguments.length?(x=+_,y):x},y}const ye={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},bt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ci=["Enter"," ","Escape"],Ii={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Ze;(function(e){e.Strict="strict",e.Loose="loose"})(Ze||(Ze={}));var Ye;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ye||(Ye={}));var _t;(function(e){e.Partial="partial",e.Full="full"})(_t||(_t={}));const Mi={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Re;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Re||(Re={}));var nn;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(nn||(nn={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const Go={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top},ki=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,Yd=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),uo=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),kt=(e,t=[0,0])=>{const{width:n,height:o}=we(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},Xd=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const o=e.reduce((r,i)=>{const s=typeof i=="string";let a=!t.nodeLookup&&!s?i:void 0;return t.nodeLookup&&(a=s?t.nodeLookup.get(i):uo(i)?i:t.nodeLookup.get(i.id)),a?(n=!0,fn(r,on(a,t.nodeOrigin))):r},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?hn(o):{x:0,y:0,width:0,height:0}},Tt=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=fn(n,on(r)),o=!0)}),o?hn(n):{x:0,y:0,width:0,height:0}},fo=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a=(t.x-n)/r,c=(t.y-o)/r,l=t.width/r,u=t.height/r,f=[];for(const d of e.values()){const{measured:h,selectable:m=!0,hidden:v=!1}=d;if(s&&!m||v)continue;const x=h.width??d.width??d.initialWidth??0,y=h.height??d.height??d.initialHeight??0,{x:w,y:g}=d.internals.positionAbsolute,b=Di(a,c,l,u,w,g,x,y),C=x*y,S=i&&b>0;(!d.internals.handleBounds||S||b>=C||d.dragging)&&f.push(d)}return f},Wd=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function Zd(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{let i;if(t?.includeHiddenNodes){const{width:s,height:a}=we(r);i=s>0&&a>0}else i=!!(r.measured.width&&r.measured.height&&!r.hidden);i&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function Gd({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return!0;const a=Zd(e,s),c=Tt(a),l=po(c,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(l,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0}function Ti({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:c,y:l}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??o;let f=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",ye.error005());else{const{width:h,height:m}=we(a);h&&m&&(f=[[c,l],[c+h,l+m]])}else a&&Ue(s.extent)&&(f=[[s.extent[0][0]+c,s.extent[0][1]+l],[s.extent[1][0]+c,s.extent[1][1]+l]]);const d=Ue(f)?Ge(t,f,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",ye.error015()),{position:{x:d.x-c+(s.measured.width??0)*u[0],y:d.y-l+(s.measured.height??0)*u[1]},positionAbsolute:d}}async function Ud({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(d=>d.id)),s=[];for(const d of n){if(d.deletable===!1)continue;const h=i.has(d.id),m=!h&&d.parentId&&s.find(v=>v.id===d.parentId);(h||m)&&s.push(d)}const a=new Set(t.map(d=>d.id)),c=o.filter(d=>d.deletable!==!1),u=Wd(s,c);for(const d of c)a.has(d.id)&&!u.find(m=>m.id===d.id)&&u.push(d);if(!r)return{edges:u,nodes:s};const f=await r({nodes:s,edges:u});return typeof f=="boolean"?f?{edges:u,nodes:s}:{edges:[],nodes:[]}:f}const it=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ge=(e={x:0,y:0},t,n)=>({x:it(e.x,t[0][0],t[1][0]-(n?.width??0)),y:it(e.y,t[0][1],t[1][1]-(n?.height??0))});function Ai(e,t,n){const{width:o,height:r}=we(n),{x:i,y:s}=n.internals.positionAbsolute;return Ge(e,[[i,s],[i+o,s+r]],t)}const Uo=(e,t,n)=>e<t?it(Math.abs(e-t),1,t)/t:e>n?-it(Math.abs(e-n),1,t)/t:0,ho=(e,t,n=15,o=40)=>{const r=Uo(e.x,o,t.width-o)*n,i=Uo(e.y,o,t.height-o)*n;return[r,i]},fn=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Zn=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),hn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),St=(e,t=[0,0])=>{const{x:n,y:o}=uo(e)?e.internals.positionAbsolute:kt(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},on=(e,t=[0,0])=>{const{x:n,y:o}=uo(e)?e.internals.positionAbsolute:kt(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},Pi=(e,t)=>hn(fn(Zn(e),Zn(t))),Di=(e,t,n,o,r,i,s,a)=>{const c=Math.max(0,Math.min(e+n,r+s)-Math.max(e,r)),l=Math.max(0,Math.min(t+o,i+a)-Math.max(t,i));return Math.ceil(c*l)},rn=(e,t)=>Di(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),qo=e=>ge(e.width)&&ge(e.height)&&ge(e.x)&&ge(e.y),ge=e=>!isNaN(e)&&isFinite(e),$i=(e,t)=>(n,o)=>{},At=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Pt=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?At(a,s):a},st=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Qe(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function qd(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Qe(e,n),r=Qe(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Qe(e.top??e.y??0,n),r=Qe(e.bottom??e.y??0,n),i=Qe(e.left??e.x??0,t),s=Qe(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Kd(e,t,n,o,r,i){const{x:s,y:a}=st(e,[t,n,o]),{x:c,y:l}=st({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-c,f=i-l;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(f)}}const po=(e,t,n,o,r,i)=>{const s=qd(i,t,n),a=(t-s.x)/e.width,c=(n-s.y)/e.height,l=Math.min(a,c),u=it(l,o,r),f=e.x+e.width/2,d=e.y+e.height/2,h=t/2-f*u,m=n/2-d*u,v=Kd(e,h,m,u,t,n),x={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:h-x.left+x.right,y:m-x.top+x.bottom,zoom:u}},Nt=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Ue(e){return e!=null&&e!=="parent"}function we(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ji(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Ri(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Ko(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Qd(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function Jd(e){return{...Ii,...e||{}}}function Hi(e){return e===null?null:e?"valid":"invalid"}function gt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=me(e),a=Pt({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:c,y:l}=n?At(a,t):a;return{xSnapped:c,ySnapped:l,...a}}const go=e=>({width:e.offsetWidth,height:e.offsetHeight}),Oi=e=>e?.getRootNode?.()||window?.document,ef=["INPUT","SELECT","TEXTAREA"];function zi(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:ef.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Li=e=>"clientX"in e,me=(e,t)=>{const n=Li(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Qo=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...go(s)}})};function Bi({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const c=e*.125+r*.375+s*.375+n*.125,l=t*.125+i*.375+a*.375+o*.125,u=Math.abs(c-e),f=Math.abs(l-t);return[c,l,u,f]}function Ot(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Jo({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case X.Left:return[t-Ot(t-o,i),n];case X.Right:return[t+Ot(o-t,i),n];case X.Top:return[t,n-Ot(n-r,i)];case X.Bottom:return[t,n+Ot(r-n,i)]}}function Vi({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top,curvature:s=.25}){const[a,c]=Jo({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[l,u]=Jo({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[f,d,h,m]=Bi({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${c} ${l},${u} ${o},${r}`,f,d,h,m]}function Fi({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function tf({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const s=r&&n?o+1e3:o,a=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return s+a}function nf({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=fn(on(e),on(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return rn(s,hn(i))>0}const of=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,rf=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),sf=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",ye.error006()),t;const o=n.getEdgeId||of;let r;return ki(e)?r={...e}:r={...e,id:o(e)},rf(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function Yi({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=Fi({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const er={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},af=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},tr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function cf({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:o=X.Top,center:r,offset:i,stepPosition:s}){const a=er[t],c=er[o],l={x:e.x+a.x*i,y:e.y+a.y*i},u={x:n.x+c.x*i,y:n.y+c.y*i},f=af({source:l,sourcePosition:t,target:u}),d=f.x!==0?"x":"y",h=f[d];let m=[],v,x;const y={x:0,y:0},w={x:0,y:0},[,,g,b]=Fi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*c[d]===-1){d==="x"?(v=r.x??l.x+(u.x-l.x)*s,x=r.y??(l.y+u.y)/2):(v=r.x??(l.x+u.x)/2,x=r.y??l.y+(u.y-l.y)*s);const k=[{x:v,y:l.y},{x:v,y:u.y}],A=[{x:l.x,y:x},{x:u.x,y:x}];a[d]===h?m=d==="x"?k:A:m=d==="x"?A:k}else{const k=[{x:l.x,y:u.y}],A=[{x:u.x,y:l.y}];if(d==="x"?m=a.x===h?A:k:m=a.y===h?k:A,t===o){const _=Math.abs(e[d]-n[d]);if(_<=i){const I=Math.min(i-1,i-_);a[d]===h?y[d]=(l[d]>e[d]?-1:1)*I:w[d]=(u[d]>n[d]?-1:1)*I}}if(t!==o){const _=d==="x"?"y":"x",I=a[d]===c[_],M=l[_]>u[_],P=l[_]<u[_];(a[d]===1&&(!I&&M||I&&P)||a[d]!==1&&(!I&&P||I&&M))&&(m=d==="x"?k:A)}const B={x:l.x+y.x,y:l.y+y.y},T={x:u.x+w.x,y:u.y+w.y},O=Math.max(Math.abs(B.x-m[0].x),Math.abs(T.x-m[0].x)),H=Math.max(Math.abs(B.y-m[0].y),Math.abs(T.y-m[0].y));O>=H?(v=(B.x+T.x)/2,x=m[0].y):(v=m[0].x,x=(B.y+T.y)/2)}const C={x:l.x+y.x,y:l.y+y.y},S={x:u.x+w.x,y:u.y+w.y};return[[e,...C.x!==m[0].x||C.y!==m[0].y?[C]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],v,x,g,b]}function lf(e,t,n,o){const r=Math.min(tr(e,t)/2,tr(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const l=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*l},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${s+r*c}Q ${i},${s} ${i+r*a},${s}`}function Gn({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top,borderRadius:s=5,centerX:a,centerY:c,offset:l=20,stepPosition:u=.5}){const[f,d,h,m,v]=cf({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:c},offset:l,stepPosition:u});let x=`M${f[0].x} ${f[0].y}`;for(let y=1;y<f.length-1;y++)x+=lf(f[y-1],f[y],f[y+1],s);return x+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[x,d,h,m,v]}function nr(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function uf(e){const{sourceNode:t,targetNode:n}=e;if(!nr(t)||!nr(n))return null;const o=t.internals.handleBounds||or(t.handles),r=n.internals.handleBounds||or(n.handles),i=rr(o?.source??[],e.sourceHandle),s=rr(e.connectionMode===Ze.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",ye.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||X.Bottom,c=s?.position||X.Top,l=qe(t,i,a),u=qe(n,s,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:c}}function or(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function qe(e,t,n=X.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??we(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case X.Top:return{x:r+s/2,y:i};case X.Right:return{x:r+s,y:i+a/2};case X.Bottom:return{x:r+s/2,y:i+a};case X.Left:return{x:r,y:i+a/2}}}function rr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Un(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function df(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const l=Un(c,t);i.has(l)||(s.push({id:l,color:c.color||n,...c}),i.add(l))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Xi=1e3,ff=10,mo={nodeOrigin:[0,0],nodeExtent:bt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},hf={...mo,checkEquality:!0};function yo(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function pf(e,t,n){const o=yo(mo,n);for(const r of e.values())if(r.parentId)wo(r,e,t,o);else{const i=kt(r,o.nodeOrigin),s=Ue(r.extent)?r.extent:o.nodeExtent,a=Ge(i,s,we(r));r.internals.positionAbsolute=a}}function gf(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function xo(e){return e==="manual"}function qn(e,t,n,o={}){const r=yo(hf,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!xo(r.zIndexMode)?Xi:0;let c=e.length>0,l=!1;t.clear(),n.clear();for(const u of e){let f=s.get(u.id);if(r.checkEquality&&u===f?.internals.userNode)t.set(u.id,f);else{const d=kt(u,r.nodeOrigin),h=Ue(u.extent)?u.extent:r.nodeExtent,m=Ge(d,h,we(u));f={...r.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:m,handleBounds:gf(u,f),z:Wi(u,a,r.zIndexMode),userNode:u}},t.set(u.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(c=!1),u.parentId&&wo(f,t,n,o,i),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function mf(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function wo(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:c}=yo(mo,o),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}mf(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&c==="auto"&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*ff),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const f=i&&!xo(c)?Xi:0,{x:d,y:h,z:m}=yf(e,u,s,a,f,c),{positionAbsolute:v}=e.internals,x=d!==v.x||h!==v.y;(x||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:d,y:h}:v,z:m}})}function Wi(e,t,n){const o=ge(e.zIndex)?e.zIndex:0;return xo(n)?o:o+(e.selected?t:0)}function yf(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,c=we(e),l=kt(e,n),u=Ue(e.extent)?Ge(l,e.extent,c):l;let f=Ge({x:s+u.x,y:a+u.y},o,c);e.extent==="parent"&&(f=Ai(f,c,t));const d=Wi(e,r,i),h=t.internals.z??0;return{x:f.x,y:f.y,z:h>=d?h+1:d}}function vo(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const c=i.get(s.parentId)?.expandedRect??St(a),l=Pi(c,s.rect);i.set(s.parentId,{expandedRect:l,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},c)=>{const l=a.internals.positionAbsolute,u=we(a),f=a.origin??o,d=s.x<l.x?Math.round(Math.abs(l.x-s.x)):0,h=s.y<l.y?Math.round(Math.abs(l.y-s.y)):0,m=Math.max(u.width,Math.round(s.width)),v=Math.max(u.height,Math.round(s.height)),x=(m-u.width)*f[0],y=(v-u.height)*f[1];(d>0||h>0||x||y)&&(r.push({id:c,type:"position",position:{x:a.position.x-d+x,y:a.position.y-h+y}}),n.get(c)?.forEach(w=>{e.some(g=>g.id===w.id)||r.push({id:w.id,type:"position",position:{x:w.position.x+d,y:w.position.y+h}})})),(u.width<s.width||u.height<s.height||d||h)&&r.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:m+(d?f[0]*d-x:0),height:v+(h?f[1]*h-y:0)}})}),r}function xf(e,t,n,o,r,i,s){const a=o?.querySelector(".xyflow__viewport");let c=!1;if(!a)return{changes:[],updatedInternals:c};const l=[],u=window.getComputedStyle(a),{m22:f}=new window.DOMMatrixReadOnly(u.transform),d=[];for(const h of e.values()){const m=t.get(h.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),c=!0;continue}const v=go(h.nodeElement),x=m.measured.width!==v.width||m.measured.height!==v.height;if(!!(v.width&&v.height&&(x||!m.internals.handleBounds||h.force))){const w=h.nodeElement.getBoundingClientRect(),g=Ue(m.extent)?m.extent:i;let{positionAbsolute:b}=m.internals;if(m.parentId&&m.extent==="parent"){const S=t.get(m.parentId);S&&(b=Ai(b,v,S))}else g&&(b=Ge(b,g,v));const C={...m,measured:v,internals:{...m.internals,positionAbsolute:b,handleBounds:{source:Qo("source",h.nodeElement,w,f,m.id),target:Qo("target",h.nodeElement,w,f,m.id)}}};t.set(m.id,C),m.parentId&&wo(C,t,n,{nodeOrigin:r,zIndexMode:s}),c=!0,x&&(l.push({id:m.id,type:"dimensions",dimensions:v}),m.expandParent&&m.parentId&&d.push({id:m.id,parentId:m.parentId,rect:St(C,r)}))}}if(d.length>0){const h=vo(d,t,n,r);l.push(...h)}return{changes:l,updatedInternals:c}}async function wf({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function ir(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const c=o.get(s)||new Map;if(o.set(s,c.set(n,t)),i){s=`${r}-${e}-${i}`;const l=o.get(s)||new Map;o.set(s,l.set(n,t))}}function Zi(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,c={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},l=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;ir("source",c,u,e,r,s),ir("target",c,l,e,i,a),t.set(o.id,o)}}function Gi(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Gi(n,t):!1}function sr(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function vf(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!Gi(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function In({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const c=n.get(s)?.internals.userNode;c&&r.push({...c,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function bf({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=At(i,t);return{x:s.x-i.x,y:s.y-i.y}}function _f({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,c=!1,l={x:0,y:0},u=null,f=!1,d=null,h=!1,m=!1,v=null;function x({noDragClassName:w,handleSelector:g,domNode:b,isSelectable:C,nodeId:S,nodeClickDistance:N=0}){d=ue(b);function k({x:O,y:H}){const{nodeLookup:_,nodeExtent:I,snapGrid:M,snapToGrid:P,nodeOrigin:$,onNodeDrag:j,onSelectionDrag:z,onError:V,updateNodePositions:L}=t();i={x:O,y:H};let W=!1;const Y=a.size>1,Z=Y&&I?Zn(Tt(a)):null,J=Y&&P?bf({dragItems:a,snapGrid:M,x:O,y:H}):null;for(const[R,D]of a){if(!_.has(R))continue;let F={x:O-D.distance.x,y:H-D.distance.y};P&&(F=J?{x:Math.round(F.x+J.x),y:Math.round(F.y+J.y)}:At(F,M));let U=null;if(Y&&I&&!D.extent&&Z){const{positionAbsolute:q}=D.internals,ee=q.x-Z.x+I[0][0],ne=q.x+D.measured.width-Z.x2+I[1][0],oe=q.y-Z.y+I[0][1],ae=q.y+D.measured.height-Z.y2+I[1][1];U=[[ee,oe],[ne,ae]]}const{position:K,positionAbsolute:G}=Ti({nodeId:R,nextPosition:F,nodeLookup:_,nodeExtent:U||I,nodeOrigin:$,onError:V});W=W||D.position.x!==K.x||D.position.y!==K.y,D.position=K,D.internals.positionAbsolute=G}if(m=m||W,!!W&&(L(a,!0),v&&(o||j||!S&&z))){const[R,D]=In({nodeId:S,dragItems:a,nodeLookup:_});o?.(v,a,R,D),j?.(v,R,D),S||z?.(v,D)}}async function A(){if(!u)return;const{transform:O,panBy:H,autoPanSpeed:_,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(s);return}const[M,P]=ho(l,u,_);(M!==0||P!==0)&&(i.x=(i.x??0)-M/O[2],i.y=(i.y??0)-P/O[2],await H({x:M,y:P})&&k(i)),s=requestAnimationFrame(A)}function B(O){const{nodeLookup:H,multiSelectionActive:_,nodesDraggable:I,transform:M,snapGrid:P,snapToGrid:$,selectNodesOnDrag:j,onNodeDragStart:z,onSelectionDragStart:V,unselectNodesAndEdges:L}=t();f=!0,(!j||!C)&&!_&&S&&(H.get(S)?.selected||L()),C&&j&&S&&e?.(S);const W=gt(O.sourceEvent,{transform:M,snapGrid:P,snapToGrid:$,containerBounds:u});if(i=W,a=vf(H,I,W,S),a.size>0&&(n||z||!S&&V)){const[Y,Z]=In({nodeId:S,dragItems:a,nodeLookup:H});n?.(O.sourceEvent,a,Y,Z),z?.(O.sourceEvent,Y,Z),S||V?.(O.sourceEvent,Z)}}const T=ui().clickDistance(N).on("start",O=>{const{domNode:H,nodeDragThreshold:_,transform:I,snapGrid:M,snapToGrid:P}=t();u=H?.getBoundingClientRect()||null,h=!1,m=!1,v=O.sourceEvent,_===0&&B(O),i=gt(O.sourceEvent,{transform:I,snapGrid:M,snapToGrid:P,containerBounds:u}),l=me(O.sourceEvent,u)}).on("drag",O=>{const{autoPanOnNodeDrag:H,transform:_,snapGrid:I,snapToGrid:M,nodeDragThreshold:P,nodeLookup:$}=t(),j=gt(O.sourceEvent,{transform:_,snapGrid:I,snapToGrid:M,containerBounds:u});if(v=O.sourceEvent,(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1||S&&!$.has(S))&&(h=!0),!h){if(!c&&H&&f&&(c=!0,A()),!f){const z=me(O.sourceEvent,u),V=z.x-l.x,L=z.y-l.y;Math.sqrt(V*V+L*L)>P&&B(O)}(i.x!==j.xSnapped||i.y!==j.ySnapped)&&a&&f&&(l=me(O.sourceEvent,u),k(j))}}).on("end",O=>{if(!f||h){h&&a.size>0&&t().updateNodePositions(a,!1);return}if(c=!1,f=!1,cancelAnimationFrame(s),a.size>0){const{nodeLookup:H,updateNodePositions:_,onNodeDragStop:I,onSelectionDragStop:M}=t();if(m&&(_(a,!1),m=!1),r||I||!S&&M){const[P,$]=In({nodeId:S,dragItems:a,nodeLookup:H,dragging:!1});r?.(O.sourceEvent,a,P,$),I?.(O.sourceEvent,P,$),S||M?.(O.sourceEvent,$)}}}).filter(O=>{const H=O.target;return!O.button&&(!w||!sr(H,`.${w}`,b))&&(!g||sr(H,g,b))});d.call(T)}function y(){d?.on(".drag",null)}return{update:x,destroy:y}}function Sf(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())rn(r,St(i))>0&&o.push(i);return o}const Nf=250;function Ef(e,t,n,o){let r=[],i=1/0;const s=Sf(e,n,t+Nf);for(const a of s){const c=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const l of c){if(o.nodeId===l.nodeId&&o.type===l.type&&o.id===l.id)continue;const{x:u,y:f}=qe(a,l,l.position,!0),d=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(f-e.y,2));d>t||(d<i?(r=[{...l,x:u,y:f}],i=d):d===i&&r.push({...l,x:u,y:f}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(c=>c.type===a)??r[0]}return r[0]}function Ui(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],c=(n?a?.find(l=>l.id===n):a?.[0])??null;return c&&i?{...c,...qe(s,c,c.position,!0)}:c}function qi(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Cf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Ki=()=>!0;function If(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:f,panBy:d,cancelConnection:h,onConnectStart:m,onConnect:v,onConnectEnd:x,isValidConnection:y=Ki,onReconnectEnd:w,updateConnection:g,getTransform:b,getFromHandle:C,autoPanSpeed:S,dragThreshold:N=1,handleDomNode:k}){const A=Oi(e.target);let B=0,T;const{x:O,y:H}=me(e),_=qi(i,k),I=a?.getBoundingClientRect();let M=!1;if(!I||!_)return;const P=Ui(r,_,o,c,t);if(!P)return;let $=me(e,I),j=!1,z=null,V=!1,L=null;function W(){if(!u||!I)return;const[K,G]=ho($,I,S);d({x:K,y:G}),B=requestAnimationFrame(W)}const Y={...P,nodeId:r,type:_,position:P.position},Z=c.get(r);let R={inProgress:!0,isValid:null,from:qe(Z,Y,X.Left,!0),fromHandle:Y,fromPosition:Y.position,fromNode:Z,to:$,toHandle:null,toPosition:Go[Y.position],toNode:null,pointer:$};function D(){M=!0,g(R),m?.(e,{nodeId:r,handleId:o,handleType:_})}N===0&&D();function F(K){if(!M){const{x:ae,y:Ee}=me(K),ve=ae-O,be=Ee-H;if(!(ve*ve+be*be>N*N))return;D()}if(!C()||!Y){U(K);return}const G=b();$=me(K,I),T=Ef(Pt($,G,!1,[1,1]),n,c,Y),j||(W(),j=!0);const q=Qi(K,{handle:T,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:y,doc:A,lib:l,flowId:f,nodeLookup:c});L=q.handleDomNode,z=q.connection,V=Cf(!!T,q.isValid);const ee=c.get(r),ne=ee?qe(ee,Y,X.Left,!0):R.from,oe={...R,from:ne,isValid:V,to:q.toHandle&&V?st({x:q.toHandle.x,y:q.toHandle.y},G):$,toHandle:q.toHandle,toPosition:V&&q.toHandle?q.toHandle.position:Go[Y.position],toNode:q.toHandle?c.get(q.toHandle.nodeId):null,pointer:$};g(oe),R=oe}function U(K){if(!("touches"in K&&K.touches.length>0)){if(M){(T||L)&&z&&V&&v?.(z);const{inProgress:G,...q}=R,ee={...q,toPosition:R.toHandle?R.toPosition:null};x?.(K,ee),i&&w?.(K,ee)}h(),cancelAnimationFrame(B),j=!1,V=!1,z=null,L=null,A.removeEventListener("mousemove",F),A.removeEventListener("mouseup",U),A.removeEventListener("touchmove",F),A.removeEventListener("touchend",U)}}A.addEventListener("mousemove",F),A.addEventListener("mouseup",U),A.addEventListener("touchmove",F),A.addEventListener("touchend",U)}function Qi(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:c,isValidConnection:l=Ki,nodeLookup:u}){const f=i==="target",d=t?s.querySelector(`.${a}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:m}=me(e),v=s.elementFromPoint(h,m),x=v?.classList.contains(`${a}-flow__handle`)?v:d,y={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const w=qi(void 0,x),g=x.getAttribute("data-nodeid"),b=x.getAttribute("data-handleid"),C=x.classList.contains("connectable"),S=x.classList.contains("connectableend");if(!g||!w)return y;const N={source:f?g:o,sourceHandle:f?b:r,target:f?o:g,targetHandle:f?r:b};y.connection=N;const A=C&&S&&(n===Ze.Strict?f&&w==="source"||!f&&w==="target":g!==o||b!==r);y.isValid=A&&l(N),y.toHandle=Ui(g,w,b,u,n,!0)}return y}const Kn={onPointerDown:If,isValid:Qi};function Mf({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=ue(e);function i({translateExtent:a,width:c,height:l,zoomStep:u=1,pannable:f=!0,zoomable:d=!0,inversePan:h=!1}){const m=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const b=n(),C=g.sourceEvent.ctrlKey&&Nt()?10:1,S=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*u,N=b[2]*Math.pow(2,S*C);t.scaleTo(N)};let v=[0,0];const x=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},y=g=>{const b=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const C=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],S=[C[0]-v[0],C[1]-v[1]];v=C;const N=o()*Math.max(b[2],Math.log(b[2]))*(h?-1:1),k={x:b[0]-S[0]*N,y:b[1]-S[1]*N},A=[[0,0],[c,l]];t.setViewportConstrained({x:k.x,y:k.y,zoom:b[2]},A,a)},w=Ei().on("start",x).on("zoom",f?y:null).on("zoom.wheel",d?m:null);r.call(w,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:he}}const pn=e=>({x:e.x,y:e.y,zoom:e.k}),Mn=({x:e,y:t,zoom:n})=>dn.translate(e,t).scale(n),je=(e,t)=>e.target.closest(`.${t}`),Ji=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),kf=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,kn=(e,t=0,n=kf,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},es=e=>{const t=e.ctrlKey&&Nt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Tf({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(je(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(u.ctrlKey&&s){const x=he(u),y=es(u),w=f*Math.pow(2,y);o.scaleTo(n,w,x,u);return}const d=u.deltaMode===1?20:1;let h=r===Ye.Vertical?0:u.deltaX*d,m=r===Ye.Horizontal?0:u.deltaY*d;!Nt()&&u.shiftKey&&r!==Ye.Vertical&&(h=u.deltaY*d,m=0),o.translateBy(n,-(h/f)*i,-(m/f)*i,{internal:!0});const v=pn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,v):(e.isPanScrolling=!0,a?.(u,v)),e.panScrollTimeout=setTimeout(()=>{l?.(u,v),e.isPanScrolling=!1},150)}}function Af({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=je(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Pf({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=pn(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function Df({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Ji(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,pn(i.transform))}}function $f({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Ji(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=pn(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function jf({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:o,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:f}){return d=>{const h=t||n,m=o&&d.ctrlKey,v=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(je(d,`${u}-flow__node`)||je(d,`${u}-flow__edge`)||je(d,`${u}-flow__selection`)||je(d,`${u}-flow__nodesselection`)))return!0;if(!r&&!h&&!i&&!s&&!o||a||f&&!v||je(d,c)&&v||je(d,l)&&(!v||i&&v&&!t)||!o&&d.ctrlKey&&v)return!1;if(!o&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!h&&!i&&!m&&v||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const x=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||v||e)&&x}}function Rf({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:c}){const l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect();let f=[[0,0],[u.width,u.height]];(typeof ResizeObserver<"u"?new ResizeObserver(H=>{const _=H[0];_&&(f=[[0,0],[_.contentRect.width,_.contentRect.height]])}):null)?.observe(e);const h=Ei().extent(()=>f).scaleExtent([t,n]).translateExtent(o),m=ue(e).call(h);b({x:r.x,y:r.y,zoom:it(r.zoom,t,n)},[[0,0],[u.width,u.height]],o);const v=m.on("wheel.zoom"),x=m.on("dblclick.zoom");h.wheelDelta(es);async function y(H,_){return m?new Promise(I=>{h?.interpolate(_?.interpolate==="linear"?pt:Yt).transform(kn(m,_?.duration,_?.ease,()=>I(!0)),H)}):!1}function w({noWheelClassName:H,noPanClassName:_,onPaneContextMenu:I,userSelectionActive:M,panOnScroll:P,panOnDrag:$,panOnScrollMode:j,panOnScrollSpeed:z,preventScrolling:V,zoomOnPinch:L,zoomOnScroll:W,zoomOnDoubleClick:Y,panActivationKeyPressed:Z=!1,zoomActivationKeyPressed:J,lib:R,onTransformChange:D,connectionInProgress:F,paneClickDistance:U,selectionOnDrag:K}){M&&!l.isZoomingOrPanning&&g();const G=P&&!J&&!M;h.clickDistance(K?1/0:!ge(U)||U<0?0:U);const q=G?Tf({zoomPanValues:l,noWheelClassName:H,d3Selection:m,d3Zoom:h,panOnScrollMode:j,panOnScrollSpeed:z,zoomOnPinch:L,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):Af({noWheelClassName:H,preventScrolling:V,d3ZoomHandler:v});m.on("wheel.zoom",q,{passive:!1});const ee=Pf({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:s});h.on("start",ee);const ne=Df({zoomPanValues:l,panOnDrag:$,onPaneContextMenu:!!I,onPanZoom:i,onTransformChange:D});h.on("zoom",ne);const oe=$f({zoomPanValues:l,panOnDrag:$,panOnScroll:P,onPaneContextMenu:I,onPanZoomEnd:a,onDraggingChange:c});h.on("end",oe);const ae=jf({panActivationKeyPressed:Z,zoomActivationKeyPressed:J,panOnDrag:$,zoomOnScroll:W,panOnScroll:P,zoomOnDoubleClick:Y,zoomOnPinch:L,userSelectionActive:M,noPanClassName:_,noWheelClassName:H,lib:R,connectionInProgress:F});h.filter(ae),Y?m.on("dblclick.zoom",x):m.on("dblclick.zoom",null)}function g(){h.on("zoom",null)}async function b(H,_,I){const M=Mn(H),P=h?.constrain()(M,_,I);return P&&await y(P),P}async function C(H,_){const I=Mn(H);return await y(I,_),I}function S(H){if(m){const _=Mn(H),I=m.property("__zoom");(I.k!==H.zoom||I.x!==H.x||I.y!==H.y)&&h?.transform(m,_,null,{sync:!0})}}function N(){const H=m?Ni(m.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}async function k(H,_){return m?new Promise(I=>{h?.interpolate(_?.interpolate==="linear"?pt:Yt).scaleTo(kn(m,_?.duration,_?.ease,()=>I(!0)),H)}):!1}async function A(H,_){return m?new Promise(I=>{h?.interpolate(_?.interpolate==="linear"?pt:Yt).scaleBy(kn(m,_?.duration,_?.ease,()=>I(!0)),H)}):!1}function B(H){h?.scaleExtent(H)}function T(H){h?.translateExtent(H)}function O(H){const _=!ge(H)||H<0?0:H;h?.clickDistance(_)}return{update:w,destroy:g,setViewport:C,setViewportConstrained:b,getViewport:N,scaleTo:k,scaleBy:A,setScaleExtent:B,setTranslateExtent:T,syncViewport:S,setClickDistance:O}}var at;(function(e){e.Line="line",e.Handle="handle"})(at||(at={}));function Hf({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,c=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function ar(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function De(e,t){return Math.max(0,t-e)}function $e(e,t){return Math.max(0,e-t)}function zt(e,t,n){return Math.max(0,t-e,e-n)}function cr(e,t){return e?!t:t}function Of(e,t,n,o,r,i,s,a){let{affectsX:c,affectsY:l}=t;const{isHorizontal:u,isVertical:f}=t,d=u&&f,{xSnapped:h,ySnapped:m}=n,{minWidth:v,maxWidth:x,minHeight:y,maxHeight:w}=o,{x:g,y:b,width:C,height:S,aspectRatio:N}=e;let k=Math.floor(u?h-e.pointerX:0),A=Math.floor(f?m-e.pointerY:0);const B=C+(c?-k:k),T=S+(l?-A:A),O=-i[0]*C,H=-i[1]*S;let _=zt(B,v,x),I=zt(T,y,w);if(s){let $=0,j=0;c&&k<0?$=De(g+k+O,s[0][0]):!c&&k>0&&($=$e(g+B+O,s[1][0])),l&&A<0?j=De(b+A+H,s[0][1]):!l&&A>0&&(j=$e(b+T+H,s[1][1])),_=Math.max(_,$),I=Math.max(I,j)}if(a){let $=0,j=0;c&&k>0?$=$e(g+k,a[0][0]):!c&&k<0&&($=De(g+B,a[1][0])),l&&A>0?j=$e(b+A,a[0][1]):!l&&A<0&&(j=De(b+T,a[1][1])),_=Math.max(_,$),I=Math.max(I,j)}if(r){if(u){const $=zt(B/N,y,w)*N;if(_=Math.max(_,$),s){let j=0;!c&&!l||c&&!l&&d?j=$e(b+H+B/N,s[1][1])*N:j=De(b+H+(c?k:-k)/N,s[0][1])*N,_=Math.max(_,j)}if(a){let j=0;!c&&!l||c&&!l&&d?j=De(b+B/N,a[1][1])*N:j=$e(b+(c?k:-k)/N,a[0][1])*N,_=Math.max(_,j)}}if(f){const $=zt(T*N,v,x)/N;if(I=Math.max(I,$),s){let j=0;!c&&!l||l&&!c&&d?j=$e(g+T*N+O,s[1][0])/N:j=De(g+(l?A:-A)*N+O,s[0][0])/N,I=Math.max(I,j)}if(a){let j=0;!c&&!l||l&&!c&&d?j=De(g+T*N,a[1][0])/N:j=$e(g+(l?A:-A)*N,a[0][0])/N,I=Math.max(I,j)}}}A=A+(A<0?I:-I),k=k+(k<0?_:-_),r&&(d?B>T*N?A=(cr(c,l)?-k:k)/N:k=(cr(c,l)?-A:A)*N:u?(A=k/N,l=c):(k=A*N,c=l));const M=c?g+k:g,P=l?b+A:b;return{width:C+(c?-k:k),height:S+(l?-A:A),x:i[0]*k*(c?-1:1)+M,y:i[1]*A*(l?-1:1)+P}}const ts={width:0,height:0,x:0,y:0},zf={...ts,pointerX:0,pointerY:0,aspectRatio:1};function Lf(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,c=n[1]*s;return[[o-a,r-c],[o+i-a,r+s-c]]}function Bf({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=ue(e);let s={controlDirection:ar("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:l,boundaries:u,keepAspectRatio:f,resizeDirection:d,onResizeStart:h,onResize:m,onResizeEnd:v,shouldResize:x}){let y={...ts},w={...zf};s={boundaries:u,resizeDirection:d,keepAspectRatio:f,controlDirection:ar(l)};let g,b=null,C=[],S,N,k,A=!1;const B=ui().on("start",T=>{const{nodeLookup:O,transform:H,snapGrid:_,snapToGrid:I,nodeOrigin:M,paneDomNode:P}=n();if(g=O.get(t),!g)return;b=P?.getBoundingClientRect()??null;const{xSnapped:$,ySnapped:j}=gt(T.sourceEvent,{transform:H,snapGrid:_,snapToGrid:I,containerBounds:b});y={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},w={...y,pointerX:$,pointerY:j,aspectRatio:y.width/y.height},S=void 0,N=Ue(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(S=O.get(g.parentId)),S&&g.extent==="parent"&&(N=[[0,0],[S.measured.width,S.measured.height]]),C=[],k=void 0;for(const[z,V]of O)if(V.parentId===t&&(C.push({id:z,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const L=Lf(V,g,V.origin??M);k?k=[[Math.min(L[0][0],k[0][0]),Math.min(L[0][1],k[0][1])],[Math.max(L[1][0],k[1][0]),Math.max(L[1][1],k[1][1])]]:k=L}h?.(T,{...y})}).on("drag",T=>{const{transform:O,snapGrid:H,snapToGrid:_,nodeOrigin:I}=n(),M=gt(T.sourceEvent,{transform:O,snapGrid:H,snapToGrid:_,containerBounds:b}),P=[];if(!g)return;const{x:$,y:j,width:z,height:V}=y,L={},W=g.origin??I,{width:Y,height:Z,x:J,y:R}=Of(w,s.controlDirection,M,s.boundaries,s.keepAspectRatio,W,N,k),D=Y!==z,F=Z!==V,U=J!==$&&D,K=R!==j&&F;if(!U&&!K&&!D&&!F)return;if((U||K||W[0]===1||W[1]===1)&&(L.x=U?J:y.x,L.y=K?R:y.y,y.x=L.x,y.y=L.y,C.length>0)){const ne=J-$,oe=R-j;for(const ae of C)ae.position={x:ae.position.x-ne+W[0]*(Y-z),y:ae.position.y-oe+W[1]*(Z-V)},P.push(ae)}if((D||F)&&(L.width=D&&(!s.resizeDirection||s.resizeDirection==="horizontal")?Y:y.width,L.height=F&&(!s.resizeDirection||s.resizeDirection==="vertical")?Z:y.height,y.width=L.width,y.height=L.height),S&&g.expandParent){const ne=W[0]*(L.width??0);L.x&&L.x<ne&&(y.x=ne,w.x=w.x-(L.x-ne));const oe=W[1]*(L.height??0);L.y&&L.y<oe&&(y.y=oe,w.y=w.y-(L.y-oe))}const G=Hf({width:y.width,prevWidth:z,height:y.height,prevHeight:V,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),q={...y,direction:G};x?.(T,q)!==!1&&(A=!0,m?.(T,q),o(L,P))}).on("end",T=>{A&&(v?.(T,{...y}),r?.({...y}),A=!1)});i.call(B)}function c(){i.on(".drag",null)}return{update:a,destroy:c}}var Tn={exports:{}},An={},Pn={exports:{}},Dn={};var lr;function Vf(){if(lr)return Dn;lr=1;var e=Gr();function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(f,d){var h=d(),m=o({inst:{value:h,getSnapshot:d}}),v=m[0].inst,x=m[1];return i(function(){v.value=h,v.getSnapshot=d,c(v)&&x({inst:v})},[f,h,d]),r(function(){return c(v)&&x({inst:v}),f(function(){c(v)&&x({inst:v})})},[f]),s(h),h}function c(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function l(f,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return Dn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Dn}var ur;function Ff(){return ur||(ur=1,Pn.exports=Vf()),Pn.exports}var dr;function Yf(){if(dr)return An;dr=1;var e=Gr(),t=Ff();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;return An.useSyncExternalStoreWithSelector=function(l,u,f,d,h){var m=i(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function y(S){if(!w){if(w=!0,g=S,S=d(S),h!==void 0&&v.hasValue){var N=v.value;if(h(N,S))return b=N}return b=S}if(N=b,o(g,S))return N;var k=d(S);return h!==void 0&&h(N,k)?(g=S,N):(g=S,b=k)}var w=!1,g,b,C=f===void 0?null:f;return[function(){return y(u())},C===null?void 0:function(){return y(C())}]},[u,f,d,h]);var x=r(l,m[0],m[1]);return s(function(){v.hasValue=!0,v.value=x},[x]),c(x),x},An}var fr;function Xf(){return fr||(fr=1,Tn.exports=Yf()),Tn.exports}var Wf=Xf();const Zf=Ua(Wf),Gf={},hr=e=>{let t;const n=new Set,o=(u,f)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const h=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(m=>m(t,h))}},r=()=>t,c={setState:o,getState:r,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(Gf?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=t=e(o,r,c);return c},Uf=e=>e?hr(e):hr,{useDebugValue:qf}=qa,{useSyncExternalStoreWithSelector:Kf}=Zf,Qf=e=>e;function ns(e,t=Qf,n){const o=Kf(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return qf(o),o}const pr=(e,t)=>{const n=Uf(e),o=(r,i=t)=>ns(n,r,i);return Object.assign(o,n),o},Jf=(e,t)=>e?pr(e,t):pr;function ie(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const gn=E.createContext(null),eh=gn.Provider,os=ye.error001("react");function te(e,t){const n=E.useContext(gn);if(n===null)throw new Error(os);return ns(n,e,t)}function re(){const e=E.useContext(gn);if(e===null)throw new Error(os);return E.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const gr={display:"none"},th={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},rs="react-flow__node-desc",is="react-flow__edge-desc",nh="react-flow__aria-live",oh=e=>e.ariaLiveMessage,rh=e=>e.ariaLabelConfig;function ih({rfId:e}){const t=te(oh);return p.jsx("div",{id:`${nh}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:th,children:t})}function sh({rfId:e,disableKeyboardA11y:t}){const n=te(rh);return p.jsxs(p.Fragment,{children:[p.jsx("div",{id:`${rs}-${e}`,style:gr,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),p.jsx("div",{id:`${is}-${e}`,style:gr,children:n["edge.a11yDescription.default"]}),!t&&p.jsx(ih,{rfId:e})]})}const Ke=E.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return p.jsx("div",{className:se(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});Ke.displayName="Panel";const mr="https://reactflow.dev?utm_source=attribution";function ah({proOptions:e,position:t="bottom-right"}){return E.useEffect(()=>{},[]),e?.hideAttribution?null:p.jsx(Ke,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${mr}`,children:p.jsx("a",{href:mr,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ch=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},Lt=e=>e.id;function lh(e,t){return ie(e.selectedNodes.map(Lt),t.selectedNodes.map(Lt))&&ie(e.selectedEdges.map(Lt),t.selectedEdges.map(Lt))}function uh({onSelectionChange:e}){const t=re(),{selectedNodes:n,selectedEdges:o}=te(ch,lh);return E.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const dh=e=>!!e.onSelectionChangeHandlers;function fh({onSelectionChange:e}){const t=te(dh);return e||t?p.jsx(uh,{onSelectionChange:e}):null}const ss=[0,0],hh={x:0,y:0,zoom:1},ph=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],yr=[...ph,"rfId"],gh=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),xr={translateExtent:bt,nodeOrigin:ss,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function mh(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:c}=te(gh,ie),l=re();E.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=xr,a()}),[]);const u=E.useRef(xr);return E.useEffect(()=>{for(const f of yr){const d=e[f],h=u.current[f];d!==h&&(typeof e[f]>"u"||(f==="nodes"?t(d):f==="edges"?n(d):f==="minZoom"?o(d):f==="maxZoom"?r(d):f==="translateExtent"?i(d):f==="nodeExtent"?s(d):f==="ariaLabelConfig"?l.setState({ariaLabelConfig:Jd(d)}):f==="fitView"?l.setState({fitViewQueued:d}):f==="fitViewOptions"?l.setState({fitViewOptions:d}):l.setState({[f]:d})))}u.current=e},yr.map(f=>e[f])),null}function wr(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function yh(e){const[t,n]=E.useState(e==="system"?null:e);return E.useEffect(()=>{if(e!=="system"){n(e);return}const o=wr(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:wr()?.matches?"dark":"light"}const vr=typeof document<"u"?document:null;function Et(e=null,t={target:vr,actInsideInputWithModifier:!0}){const[n,o]=E.useState(!1),r=E.useRef(!1),i=E.useRef(new Set([])),[s,a]=E.useMemo(()=>{if(e!==null){const l=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace(/\+/g,`
|
|
1
|
+
import{m as Gr,n as Ua,R as qa,f as E,j as p}from"./index-CfGRmfFv.js";import{u as ce,a as Q,i as Vt,S as Ka,f as Qa,g as Ja,b as ec,n as tc,c as nc,w as oc,d as rc,e as Ur,h as ic,l as sc,j as ac,k as cc,m as lc,o as Ct,p as uc}from"./App-BfpvLzSs.js";function se(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=se(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var dc={value:()=>{}};function an(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Ft(n)}function Ft(e){this._=e}function fc(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Ft.prototype=an.prototype={constructor:Ft,on:function(e,t){var n=this._,o=fc(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=hc(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=Ao(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Ao(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ft(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function hc(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function Ao(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=dc,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var zn="http://www.w3.org/1999/xhtml";const Po={svg:"http://www.w3.org/2000/svg",xhtml:zn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function cn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Po.hasOwnProperty(t)?{space:Po[t],local:e}:e}function pc(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===zn&&t.documentElement.namespaceURI===zn?t.createElement(e):t.createElementNS(n,e)}}function gc(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function qr(e){var t=cn(e);return(t.local?gc:pc)(t)}function mc(){}function oo(e){return e==null?mc:function(){return this.querySelector(e)}}function yc(e){typeof e!="function"&&(e=oo(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),c,l,u=0;u<s;++u)(c=i[u])&&(l=e.call(c,c.__data__,u,i))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new de(o,this._parents)}function xc(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function wc(){return[]}function Kr(e){return e==null?wc:function(){return this.querySelectorAll(e)}}function vc(e){return function(){return xc(e.apply(this,arguments))}}function bc(e){typeof e=="function"?e=vc(e):e=Kr(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(o.push(e.call(c,c.__data__,l,s)),r.push(c));return new de(o,r)}function Qr(e){return function(){return this.matches(e)}}function Jr(e){return function(t){return t.matches(e)}}var _c=Array.prototype.find;function Sc(e){return function(){return _c.call(this.children,e)}}function Nc(){return this.firstElementChild}function Ec(e){return this.select(e==null?Nc:Sc(typeof e=="function"?e:Jr(e)))}var Cc=Array.prototype.filter;function Ic(){return Array.from(this.children)}function Mc(e){return function(){return Cc.call(this.children,e)}}function kc(e){return this.selectAll(e==null?Ic:Mc(typeof e=="function"?e:Jr(e)))}function Tc(e){typeof e!="function"&&(e=Qr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new de(o,this._parents)}function ei(e){return new Array(e.length)}function Ac(){return new de(this._enter||this._groups.map(ei),this._parents)}function Ut(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ut.prototype={constructor:Ut,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Pc(e){return function(){return e}}function Dc(e,t,n,o,r,i){for(var s=0,a,c=t.length,l=i.length;s<l;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Ut(e,i[s]);for(;s<c;++s)(a=t[s])&&(r[s]=a)}function $c(e,t,n,o,r,i,s){var a,c,l=new Map,u=t.length,f=i.length,d=new Array(u),h;for(a=0;a<u;++a)(c=t[a])&&(d[a]=h=s.call(c,c.__data__,a,t)+"",l.has(h)?r[a]=c:l.set(h,c));for(a=0;a<f;++a)h=s.call(e,i[a],a,i)+"",(c=l.get(h))?(o[a]=c,c.__data__=i[a],l.delete(h)):n[a]=new Ut(e,i[a]);for(a=0;a<u;++a)(c=t[a])&&l.get(d[a])===c&&(r[a]=c)}function jc(e){return e.__data__}function Rc(e,t){if(!arguments.length)return Array.from(this,jc);var n=t?$c:Dc,o=this._parents,r=this._groups;typeof e!="function"&&(e=Pc(e));for(var i=r.length,s=new Array(i),a=new Array(i),c=new Array(i),l=0;l<i;++l){var u=o[l],f=r[l],d=f.length,h=Hc(e.call(u,u&&u.__data__,l,o)),m=h.length,v=a[l]=new Array(m),x=s[l]=new Array(m),y=c[l]=new Array(d);n(u,f,v,x,y,h,t);for(var w=0,g=0,b,C;w<m;++w)if(b=v[w]){for(w>=g&&(g=w+1);!(C=x[g])&&++g<m;);b._next=C||null}}return s=new de(s,o),s._enter=a,s._exit=c,s}function Hc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Oc(){return new de(this._exit||this._groups.map(ei),this._parents)}function zc(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function Lc(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),c=0;c<s;++c)for(var l=n[c],u=o[c],f=l.length,d=a[c]=new Array(f),h,m=0;m<f;++m)(h=l[m]||u[m])&&(d[m]=h);for(;c<r;++c)a[c]=n[c];return new de(a,this._parents)}function Bc(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Vc(e){e||(e=Fc);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,c=r[i]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(t)}return new de(r,this._parents).order()}function Fc(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Yc(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Xc(){return Array.from(this)}function Wc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function Zc(){let e=0;for(const t of this)++e;return e}function Gc(){return!this.node()}function Uc(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function qc(e){return function(){this.removeAttribute(e)}}function Kc(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qc(e,t){return function(){this.setAttribute(e,t)}}function Jc(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function el(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function tl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function nl(e,t){var n=cn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Kc:qc:typeof t=="function"?n.local?tl:el:n.local?Jc:Qc)(n,t))}function ti(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ol(e){return function(){this.style.removeProperty(e)}}function rl(e,t,n){return function(){this.style.setProperty(e,t,n)}}function il(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function sl(e,t,n){return arguments.length>1?this.each((t==null?ol:typeof t=="function"?il:rl)(e,t,n??"")):ot(this.node(),e)}function ot(e,t){return e.style.getPropertyValue(t)||ti(e).getComputedStyle(e,null).getPropertyValue(t)}function al(e){return function(){delete this[e]}}function cl(e,t){return function(){this[e]=t}}function ll(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ul(e,t){return arguments.length>1?this.each((t==null?al:typeof t=="function"?ll:cl)(e,t)):this.node()[e]}function ni(e){return e.trim().split(/^|\s+/)}function ro(e){return e.classList||new oi(e)}function oi(e){this._node=e,this._names=ni(e.getAttribute("class")||"")}oi.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ri(e,t){for(var n=ro(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function ii(e,t){for(var n=ro(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function dl(e){return function(){ri(this,e)}}function fl(e){return function(){ii(this,e)}}function hl(e,t){return function(){(t.apply(this,arguments)?ri:ii)(this,e)}}function pl(e,t){var n=ni(e+"");if(arguments.length<2){for(var o=ro(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?hl:t?dl:fl)(n,t))}function gl(){this.textContent=""}function ml(e){return function(){this.textContent=e}}function yl(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function xl(e){return arguments.length?this.each(e==null?gl:(typeof e=="function"?yl:ml)(e)):this.node().textContent}function wl(){this.innerHTML=""}function vl(e){return function(){this.innerHTML=e}}function bl(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function _l(e){return arguments.length?this.each(e==null?wl:(typeof e=="function"?bl:vl)(e)):this.node().innerHTML}function Sl(){this.nextSibling&&this.parentNode.appendChild(this)}function Nl(){return this.each(Sl)}function El(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cl(){return this.each(El)}function Il(e){var t=typeof e=="function"?e:qr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ml(){return null}function kl(e,t){var n=typeof e=="function"?e:qr(e),o=t==null?Ml:typeof t=="function"?t:oo(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function Tl(){var e=this.parentNode;e&&e.removeChild(this)}function Al(){return this.each(Tl)}function Pl(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Dl(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $l(e){return this.select(e?Dl:Pl)}function jl(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Rl(e){return function(t){e.call(this,t,this.__data__)}}function Hl(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Ol(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function zl(e,t,n){return function(){var o=this.__on,r,i=Rl(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Ll(e,t,n){var o=Hl(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(r=0,u=a[c];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?zl:Ol,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function si(e,t,n){var o=ti(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Bl(e,t){return function(){return si(this,e,t)}}function Vl(e,t){return function(){return si(this,e,t.apply(this,arguments))}}function Fl(e,t){return this.each((typeof t=="function"?Vl:Bl)(e,t))}function*Yl(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var ai=[null];function de(e,t){this._groups=e,this._parents=t}function It(){return new de([[document.documentElement]],ai)}function Xl(){return this}de.prototype=It.prototype={constructor:de,select:yc,selectAll:bc,selectChild:Ec,selectChildren:kc,filter:Tc,data:Rc,enter:Ac,exit:Oc,join:zc,merge:Lc,selection:Xl,order:Bc,sort:Vc,call:Yc,nodes:Xc,node:Wc,size:Zc,empty:Gc,each:Uc,attr:nl,style:sl,property:ul,classed:pl,text:xl,html:_l,raise:Nl,lower:Cl,append:Il,insert:kl,remove:Al,clone:$l,datum:jl,on:Ll,dispatch:Fl,[Symbol.iterator]:Yl};function ue(e){return typeof e=="string"?new de([[document.querySelector(e)]],[document.documentElement]):new de([[e]],ai)}function Wl(e){let t;for(;t=e.sourceEvent;)e=t;return e}function he(e,t){if(e=Wl(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Zl={passive:!1},yt={capture:!0,passive:!1};function Sn(e){e.stopImmediatePropagation()}function tt(e){e.preventDefault(),e.stopImmediatePropagation()}function ci(e){var t=e.document.documentElement,n=ue(e).on("dragstart.drag",tt,yt);"onselectstart"in t?n.on("selectstart.drag",tt,yt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function li(e,t){var n=e.document.documentElement,o=ue(e).on("dragstart.drag",null);t&&(o.on("click.drag",tt,yt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Dt=e=>()=>e;function Ln(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Ln.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Gl(e){return!e.ctrlKey&&!e.button}function Ul(){return this.parentNode}function ql(e,t){return t??{x:e.x,y:e.y}}function Kl(){return navigator.maxTouchPoints||"ontouchstart"in this}function ui(){var e=Gl,t=Ul,n=ql,o=Kl,r={},i=an("start","drag","end"),s=0,a,c,l,u,f=0;function d(b){b.on("mousedown.drag",h).filter(o).on("touchstart.drag",x).on("touchmove.drag",y,Zl).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(b,C){if(!(u||!e.call(this,b,C))){var S=g(this,t.call(this,b,C),b,C,"mouse");S&&(ue(b.view).on("mousemove.drag",m,yt).on("mouseup.drag",v,yt),ci(b.view),Sn(b),l=!1,a=b.clientX,c=b.clientY,S("start",b))}}function m(b){if(tt(b),!l){var C=b.clientX-a,S=b.clientY-c;l=C*C+S*S>f}r.mouse("drag",b)}function v(b){ue(b.view).on("mousemove.drag mouseup.drag",null),li(b.view,l),tt(b),r.mouse("end",b)}function x(b,C){if(e.call(this,b,C)){var S=b.changedTouches,N=t.call(this,b,C),k=S.length,A,B;for(A=0;A<k;++A)(B=g(this,N,b,C,S[A].identifier,S[A]))&&(Sn(b),B("start",b,S[A]))}}function y(b){var C=b.changedTouches,S=C.length,N,k;for(N=0;N<S;++N)(k=r[C[N].identifier])&&(tt(b),k("drag",b,C[N]))}function w(b){var C=b.changedTouches,S=C.length,N,k;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),N=0;N<S;++N)(k=r[C[N].identifier])&&(Sn(b),k("end",b,C[N]))}function g(b,C,S,N,k,A){var B=i.copy(),T=he(A||S,C),O,H,_;if((_=n.call(b,new Ln("beforestart",{sourceEvent:S,target:d,identifier:k,active:s,x:T[0],y:T[1],dx:0,dy:0,dispatch:B}),N))!=null)return O=_.x-T[0]||0,H=_.y-T[1]||0,function I(M,P,$){var j=T,z;switch(M){case"start":r[k]=I,z=s++;break;case"end":delete r[k],--s;case"drag":T=he($||P,C),z=s;break}B.call(M,b,new Ln(M,{sourceEvent:P,subject:_,target:d,identifier:k,active:z,x:T[0]+O,y:T[1]+H,dx:T[0]-j[0],dy:T[1]-j[1],dispatch:B}),N)}}return d.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Dt(!!b),d):e},d.container=function(b){return arguments.length?(t=typeof b=="function"?b:Dt(b),d):t},d.subject=function(b){return arguments.length?(n=typeof b=="function"?b:Dt(b),d):n},d.touchable=function(b){return arguments.length?(o=typeof b=="function"?b:Dt(!!b),d):o},d.on=function(){var b=i.on.apply(i,arguments);return b===i?d:b},d.clickDistance=function(b){return arguments.length?(f=(b=+b)*b,d):Math.sqrt(f)},d}function io(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function di(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Mt(){}var xt=.7,qt=1/xt,nt="\\s*([+-]?\\d+)\\s*",wt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Se="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ql=/^#([0-9a-f]{3,8})$/,Jl=new RegExp(`^rgb\\(${nt},${nt},${nt}\\)$`),eu=new RegExp(`^rgb\\(${Se},${Se},${Se}\\)$`),tu=new RegExp(`^rgba\\(${nt},${nt},${nt},${wt}\\)$`),nu=new RegExp(`^rgba\\(${Se},${Se},${Se},${wt}\\)$`),ou=new RegExp(`^hsl\\(${wt},${Se},${Se}\\)$`),ru=new RegExp(`^hsla\\(${wt},${Se},${Se},${wt}\\)$`),Do={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};io(Mt,Xe,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$o,formatHex:$o,formatHex8:iu,formatHsl:su,formatRgb:jo,toString:jo});function $o(){return this.rgb().formatHex()}function iu(){return this.rgb().formatHex8()}function su(){return fi(this).formatHsl()}function jo(){return this.rgb().formatRgb()}function Xe(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ql.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ro(t):n===3?new le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$t(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$t(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Jl.exec(e))?new le(t[1],t[2],t[3],1):(t=eu.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tu.exec(e))?$t(t[1],t[2],t[3],t[4]):(t=nu.exec(e))?$t(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ou.exec(e))?zo(t[1],t[2]/100,t[3]/100,1):(t=ru.exec(e))?zo(t[1],t[2]/100,t[3]/100,t[4]):Do.hasOwnProperty(e)?Ro(Do[e]):e==="transparent"?new le(NaN,NaN,NaN,0):null}function Ro(e){return new le(e>>16&255,e>>8&255,e&255,1)}function $t(e,t,n,o){return o<=0&&(e=t=n=NaN),new le(e,t,n,o)}function au(e){return e instanceof Mt||(e=Xe(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function Bn(e,t,n,o){return arguments.length===1?au(e):new le(e,t,n,o??1)}function le(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}io(le,Bn,di(Mt,{brighter(e){return e=e==null?qt:Math.pow(qt,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?xt:Math.pow(xt,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new le(Fe(this.r),Fe(this.g),Fe(this.b),Kt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ho,formatHex:Ho,formatHex8:cu,formatRgb:Oo,toString:Oo}));function Ho(){return`#${Ve(this.r)}${Ve(this.g)}${Ve(this.b)}`}function cu(){return`#${Ve(this.r)}${Ve(this.g)}${Ve(this.b)}${Ve((isNaN(this.opacity)?1:this.opacity)*255)}`}function Oo(){const e=Kt(this.opacity);return`${e===1?"rgb(":"rgba("}${Fe(this.r)}, ${Fe(this.g)}, ${Fe(this.b)}${e===1?")":`, ${e})`}`}function Kt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ve(e){return e=Fe(e),(e<16?"0":"")+e.toString(16)}function zo(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pe(e,t,n,o)}function fi(e){if(e instanceof pe)return new pe(e.h,e.s,e.l,e.opacity);if(e instanceof Mt||(e=Xe(e)),!e)return new pe;if(e instanceof pe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,c=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=c<.5?i+r:2-i-r,s*=60):a=c>0&&c<1?0:s,new pe(s,a,c,e.opacity)}function lu(e,t,n,o){return arguments.length===1?fi(e):new pe(e,t,n,o??1)}function pe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}io(pe,lu,di(Mt,{brighter(e){return e=e==null?qt:Math.pow(qt,e),new pe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?xt:Math.pow(xt,e),new pe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new le(Nn(e>=240?e-240:e+120,r,o),Nn(e,r,o),Nn(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new pe(Lo(this.h),jt(this.s),jt(this.l),Kt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Kt(this.opacity);return`${e===1?"hsl(":"hsla("}${Lo(this.h)}, ${jt(this.s)*100}%, ${jt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Lo(e){return e=(e||0)%360,e<0?e+360:e}function jt(e){return Math.max(0,Math.min(1,e||0))}function Nn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const so=e=>()=>e;function uu(e,t){return function(n){return e+n*t}}function du(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function fu(e){return(e=+e)==1?hi:function(t,n){return n-t?du(t,n,e):so(isNaN(t)?n:t)}}function hi(e,t){var n=t-e;return n?uu(e,n):so(isNaN(e)?t:e)}const Qt=(function e(t){var n=fu(t);function o(r,i){var s=n((r=Bn(r)).r,(i=Bn(i)).r),a=n(r.g,i.g),c=n(r.b,i.b),l=hi(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=c(u),r.opacity=l(u),r+""}}return o.gamma=e,o})(1);function hu(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function pu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gu(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=pt(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function mu(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function _e(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function yu(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=pt(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var Vn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,En=new RegExp(Vn.source,"g");function xu(e){return function(){return e}}function wu(e){return function(t){return e(t)+""}}function pi(e,t){var n=Vn.lastIndex=En.lastIndex=0,o,r,i,s=-1,a=[],c=[];for(e=e+"",t=t+"";(o=Vn.exec(e))&&(r=En.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,c.push({i:s,x:_e(o,r)})),n=En.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?c[0]?wu(c[0].x):xu(t):(t=c.length,function(l){for(var u=0,f;u<t;++u)a[(f=c[u]).i]=f.x(l);return a.join("")})}function pt(e,t){var n=typeof t,o;return t==null||n==="boolean"?so(t):(n==="number"?_e:n==="string"?(o=Xe(t))?(t=o,Qt):pi:t instanceof Xe?Qt:t instanceof Date?mu:pu(t)?hu:Array.isArray(t)?gu:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?yu:_e)(e,t)}var Bo=180/Math.PI,Fn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gi(e,t,n,o,r,i){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*o)&&(n-=e*c,o-=t*c),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,c/=a),e*o<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Bo,skewX:Math.atan(c)*Bo,scaleX:s,scaleY:a}}var Rt;function vu(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Fn:gi(t.a,t.b,t.c,t.d,t.e,t.f)}function bu(e){return e==null||(Rt||(Rt=document.createElementNS("http://www.w3.org/2000/svg","g")),Rt.setAttribute("transform",e),!(e=Rt.transform.baseVal.consolidate()))?Fn:(e=e.matrix,gi(e.a,e.b,e.c,e.d,e.e,e.f))}function mi(e,t,n,o){function r(l){return l.length?l.pop()+" ":""}function i(l,u,f,d,h,m){if(l!==f||u!==d){var v=h.push("translate(",null,t,null,n);m.push({i:v-4,x:_e(l,f)},{i:v-2,x:_e(u,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(l,u,f,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:f.push(r(f)+"rotate(",null,o)-2,x:_e(l,u)})):u&&f.push(r(f)+"rotate("+u+o)}function a(l,u,f,d){l!==u?d.push({i:f.push(r(f)+"skewX(",null,o)-2,x:_e(l,u)}):u&&f.push(r(f)+"skewX("+u+o)}function c(l,u,f,d,h,m){if(l!==f||u!==d){var v=h.push(r(h)+"scale(",null,",",null,")");m.push({i:v-4,x:_e(l,f)},{i:v-2,x:_e(u,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(l,u){var f=[],d=[];return l=e(l),u=e(u),i(l.translateX,l.translateY,u.translateX,u.translateY,f,d),s(l.rotate,u.rotate,f,d),a(l.skewX,u.skewX,f,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,d),l=u=null,function(h){for(var m=-1,v=d.length,x;++m<v;)f[(x=d[m]).i]=x.x(h);return f.join("")}}}var _u=mi(vu,"px, ","px)","deg)"),Su=mi(bu,", ",")",")"),Nu=1e-12;function Vo(e){return((e=Math.exp(e))+1/e)/2}function Eu(e){return((e=Math.exp(e))-1/e)/2}function Cu(e){return((e=Math.exp(2*e))-1)/(e+1)}const Yt=(function e(t,n,o){function r(i,s){var a=i[0],c=i[1],l=i[2],u=s[0],f=s[1],d=s[2],h=u-a,m=f-c,v=h*h+m*m,x,y;if(v<Nu)y=Math.log(d/l)/t,x=function(N){return[a+N*h,c+N*m,l*Math.exp(t*N*y)]};else{var w=Math.sqrt(v),g=(d*d-l*l+o*v)/(2*l*n*w),b=(d*d-l*l-o*v)/(2*d*n*w),C=Math.log(Math.sqrt(g*g+1)-g),S=Math.log(Math.sqrt(b*b+1)-b);y=(S-C)/t,x=function(N){var k=N*y,A=Vo(C),B=l/(n*w)*(A*Cu(t*k+C)-Eu(C));return[a+B*h,c+B*m,l*A/Vo(t*k+C)]}}return x.duration=y*1e3*t/Math.SQRT2,x}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return e(s,a,c)},r})(Math.SQRT2,2,4);var rt=0,ft=0,lt=0,yi=1e3,Jt,ht,en=0,We=0,ln=0,vt=typeof performance=="object"&&performance.now?performance:Date,xi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ao(){return We||(xi(Iu),We=vt.now()+ln)}function Iu(){We=0}function tn(){this._call=this._time=this._next=null}tn.prototype=wi.prototype={constructor:tn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ao():+n)+(t==null?0:+t),!this._next&&ht!==this&&(ht?ht._next=this:Jt=this,ht=this),this._call=e,this._time=n,Yn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yn())}};function wi(e,t,n){var o=new tn;return o.restart(e,t,n),o}function Mu(){ao(),++rt;for(var e=Jt,t;e;)(t=We-e._time)>=0&&e._call.call(void 0,t),e=e._next;--rt}function Fo(){We=(en=vt.now())+ln,rt=ft=0;try{Mu()}finally{rt=0,Tu(),We=0}}function ku(){var e=vt.now(),t=e-en;t>yi&&(ln-=t,en=e)}function Tu(){for(var e,t=Jt,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Jt=n);ht=e,Yn(o)}function Yn(e){if(!rt){ft&&(ft=clearTimeout(ft));var t=e-We;t>24?(e<1/0&&(ft=setTimeout(Fo,e-vt.now()-ln)),lt&&(lt=clearInterval(lt))):(lt||(en=vt.now(),lt=setInterval(ku,yi)),rt=1,xi(Fo))}}function Yo(e,t,n){var o=new tn;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var Au=an("start","end","cancel","interrupt"),Pu=[],vi=0,Xo=1,Xn=2,Xt=3,Wo=4,Wn=5,Wt=6;function un(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Du(e,n,{name:t,index:o,group:r,on:Au,tween:Pu,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:vi})}function co(e,t){var n=xe(e,t);if(n.state>vi)throw new Error("too late; already scheduled");return n}function Ne(e,t){var n=xe(e,t);if(n.state>Xt)throw new Error("too late; already running");return n}function xe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Du(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=wi(i,0,n.time);function i(l){n.state=Xo,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,f,d,h;if(n.state!==Xo)return c();for(u in o)if(h=o[u],h.name===n.name){if(h.state===Xt)return Yo(s);h.state===Wo?(h.state=Wt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[u]):+u<t&&(h.state=Wt,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[u])}if(Yo(function(){n.state===Xt&&(n.state=Wo,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Xn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Xn){for(n.state=Xt,r=new Array(d=n.tween.length),u=0,f=-1;u<d;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++f]=h);r.length=f+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Wn,1),f=-1,d=r.length;++f<d;)r[f].call(e,u);n.state===Wn&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=Wt,n.timer.stop(),delete o[t];for(var l in o)return;delete e.__transition}}function Zt(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>Xn&&o.state<Wn,o.state=Wt,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function $u(e){return this.each(function(){Zt(this,e)})}function ju(e,t){var n,o;return function(){var r=Ne(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function Ru(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=Ne(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},c=0,l=r.length;c<l;++c)if(r[c].name===t){r[c]=a;break}c===l&&r.push(a)}i.tween=r}}function Hu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=xe(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?ju:Ru)(n,e,t))}function lo(e,t,n){var o=e._id;return e.each(function(){var r=Ne(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return xe(r,o).value[t]}}function bi(e,t){var n;return(typeof t=="number"?_e:t instanceof Xe?Qt:(n=Xe(t))?(t=n,Qt):pi)(e,t)}function Ou(e){return function(){this.removeAttribute(e)}}function zu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Lu(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function Bu(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function Vu(e,t,n){var o,r,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a)))}}function Fu(e,t,n){var o,r,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a)))}}function Yu(e,t){var n=cn(e),o=n==="transform"?Su:bi;return this.attrTween(e,typeof t=="function"?(n.local?Fu:Vu)(n,o,lo(this,"attr."+e,t)):t==null?(n.local?zu:Ou)(n):(n.local?Bu:Lu)(n,o,t))}function Xu(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Wu(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Zu(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Wu(e,i)),n}return r._value=t,r}function Gu(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Xu(e,i)),n}return r._value=t,r}function Uu(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=cn(e);return this.tween(n,(o.local?Zu:Gu)(o,t))}function qu(e,t){return function(){co(this,e).delay=+t.apply(this,arguments)}}function Ku(e,t){return t=+t,function(){co(this,e).delay=t}}function Qu(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qu:Ku)(t,e)):xe(this.node(),t).delay}function Ju(e,t){return function(){Ne(this,e).duration=+t.apply(this,arguments)}}function ed(e,t){return t=+t,function(){Ne(this,e).duration=t}}function td(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ju:ed)(t,e)):xe(this.node(),t).duration}function nd(e,t){if(typeof t!="function")throw new Error;return function(){Ne(this,e).ease=t}}function od(e){var t=this._id;return arguments.length?this.each(nd(t,e)):xe(this.node(),t).ease}function rd(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ne(this,e).ease=n}}function id(e){if(typeof e!="function")throw new Error;return this.each(rd(this._id,e))}function sd(e){typeof e!="function"&&(e=Qr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new Pe(o,this._parents,this._name,this._id)}function ad(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var c=t[a],l=n[a],u=c.length,f=s[a]=new Array(u),d,h=0;h<u;++h)(d=c[h]||l[h])&&(f[h]=d);for(;a<o;++a)s[a]=t[a];return new Pe(s,this._parents,this._name,this._id)}function cd(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function ld(e,t,n){var o,r,i=cd(t)?co:Ne;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function ud(e,t){var n=this._id;return arguments.length<2?xe(this.node(),n).on.on(e):this.each(ld(n,e,t))}function dd(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function fd(){return this.on("end.remove",dd(this._id))}function hd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=oo(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],c=a.length,l=i[s]=new Array(c),u,f,d=0;d<c;++d)(u=a[d])&&(f=e.call(u,u.__data__,d,a))&&("__data__"in u&&(f.__data__=u.__data__),l[d]=f,un(l[d],t,n,d,l,xe(u,n)));return new Pe(i,this._parents,t,n)}function pd(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Kr(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var c=o[a],l=c.length,u,f=0;f<l;++f)if(u=c[f]){for(var d=e.call(u,u.__data__,f,c),h,m=xe(u,n),v=0,x=d.length;v<x;++v)(h=d[v])&&un(h,t,n,v,d,m);i.push(d),s.push(u)}return new Pe(i,s,t,n)}var gd=It.prototype.constructor;function md(){return new gd(this._groups,this._parents)}function yd(e,t){var n,o,r;return function(){var i=ot(this,e),s=(this.style.removeProperty(e),ot(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function _i(e){return function(){this.style.removeProperty(e)}}function xd(e,t,n){var o,r=n+"",i;return function(){var s=ot(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function wd(e,t,n){var o,r,i;return function(){var s=ot(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),ot(this,e))),s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a))}}function vd(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var c=Ne(this,e),l=c.on,u=c.value[i]==null?a||(a=_i(t)):void 0;(l!==n||r!==u)&&(o=(n=l).copy()).on(s,r=u),c.on=o}}function bd(e,t,n){var o=(e+="")=="transform"?_u:bi;return t==null?this.styleTween(e,yd(e,o)).on("end.style."+e,_i(e)):typeof t=="function"?this.styleTween(e,wd(e,o,lo(this,"style."+e,t))).each(vd(this._id,e)):this.styleTween(e,xd(e,o,t),n).on("end.style."+e,null)}function _d(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function Sd(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&_d(e,s,n)),o}return i._value=t,i}function Nd(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,Sd(e,t,n??""))}function Ed(e){return function(){this.textContent=e}}function Cd(e){return function(){var t=e(this);this.textContent=t??""}}function Id(e){return this.tween("text",typeof e=="function"?Cd(lo(this,"text",e)):Ed(e==null?"":e+""))}function Md(e){return function(t){this.textContent=e.call(this,t)}}function kd(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Md(r)),t}return o._value=e,o}function Td(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,kd(e))}function Ad(){for(var e=this._name,t=this._id,n=Si(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=xe(c,t);un(c,e,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Pe(o,this._parents,e,n)}function Pd(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--r===0&&i()}};n.each(function(){var l=Ne(this,o),u=l.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),l.on=t}),r===0&&i()})}var Dd=0;function Pe(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Si(){return++Dd}var ke=It.prototype;Pe.prototype={constructor:Pe,select:hd,selectAll:pd,selectChild:ke.selectChild,selectChildren:ke.selectChildren,filter:sd,merge:ad,selection:md,transition:Ad,call:ke.call,nodes:ke.nodes,node:ke.node,size:ke.size,empty:ke.empty,each:ke.each,on:ud,attr:Yu,attrTween:Uu,style:bd,styleTween:Nd,text:Id,textTween:Td,remove:fd,tween:Hu,delay:Qu,duration:td,ease:od,easeVarying:id,end:Pd,[Symbol.iterator]:ke[Symbol.iterator]};function $d(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var jd={time:null,delay:0,duration:250,ease:$d};function Rd(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Hd(e){var t,n;e instanceof Pe?(t=e._id,e=e._name):(t=Si(),(n=jd).time=ao(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&un(c,e,t,l,s,n||Rd(c,t));return new Pe(o,this._parents,e,t)}It.prototype.interrupt=$u;It.prototype.transition=Hd;const Ht=e=>()=>e;function Od(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function Te(e,t,n){this.k=e,this.x=t,this.y=n}Te.prototype={constructor:Te,scale:function(e){return e===1?this:new Te(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Te(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var dn=new Te(1,0,0);Ni.prototype=Te.prototype;function Ni(e){for(;!e.__zoom;)if(!(e=e.parentNode))return dn;return e.__zoom}function Cn(e){e.stopImmediatePropagation()}function ut(e){e.preventDefault(),e.stopImmediatePropagation()}function zd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Ld(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Zo(){return this.__zoom||dn}function Bd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Vd(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fd(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Ei(){var e=zd,t=Ld,n=Fd,o=Bd,r=Vd,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=Yt,l=an("start","zoom","end"),u,f,d,h=500,m=150,v=0,x=10;function y(_){_.property("__zoom",Zo).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",B).filter(r).on("touchstart.zoom",T).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(_,I,M,P){var $=_.selection?_.selection():_;$.property("__zoom",Zo),_!==$?C(_,I,M,P):$.interrupt().each(function(){S(this,arguments).event(P).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(_,I,M,P){y.scaleTo(_,function(){var $=this.__zoom.k,j=typeof I=="function"?I.apply(this,arguments):I;return $*j},M,P)},y.scaleTo=function(_,I,M,P){y.transform(_,function(){var $=t.apply(this,arguments),j=this.__zoom,z=M==null?b($):typeof M=="function"?M.apply(this,arguments):M,V=j.invert(z),L=typeof I=="function"?I.apply(this,arguments):I;return n(g(w(j,L),z,V),$,s)},M,P)},y.translateBy=function(_,I,M,P){y.transform(_,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),s)},null,P)},y.translateTo=function(_,I,M,P,$){y.transform(_,function(){var j=t.apply(this,arguments),z=this.__zoom,V=P==null?b(j):typeof P=="function"?P.apply(this,arguments):P;return n(dn.translate(V[0],V[1]).scale(z.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof M=="function"?-M.apply(this,arguments):-M),j,s)},P,$)};function w(_,I){return I=Math.max(i[0],Math.min(i[1],I)),I===_.k?_:new Te(I,_.x,_.y)}function g(_,I,M){var P=I[0]-M[0]*_.k,$=I[1]-M[1]*_.k;return P===_.x&&$===_.y?_:new Te(_.k,P,$)}function b(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function C(_,I,M,P){_.on("start.zoom",function(){S(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(P).end()}).tween("zoom",function(){var $=this,j=arguments,z=S($,j).event(P),V=t.apply($,j),L=M==null?b(V):typeof M=="function"?M.apply($,j):M,W=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),Y=$.__zoom,Z=typeof I=="function"?I.apply($,j):I,J=c(Y.invert(L).concat(W/Y.k),Z.invert(L).concat(W/Z.k));return function(R){if(R===1)R=Z;else{var D=J(R),F=W/D[2];R=new Te(F,L[0]-D[0]*F,L[1]-D[1]*F)}z.zoom(null,R)}})}function S(_,I,M){return!M&&_.__zooming||new N(_,I)}function N(_,I){this.that=_,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,I),this.taps=0}N.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,I){return this.mouse&&_!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var I=ue(this.that).datum();l.call(_,this.that,new Od(_,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:l}),I)}};function k(_,...I){if(!e.apply(this,arguments))return;var M=S(this,I).event(_),P=this.__zoom,$=Math.max(i[0],Math.min(i[1],P.k*Math.pow(2,o.apply(this,arguments)))),j=he(_);if(M.wheel)(M.mouse[0][0]!==j[0]||M.mouse[0][1]!==j[1])&&(M.mouse[1]=P.invert(M.mouse[0]=j)),clearTimeout(M.wheel);else{if(P.k===$)return;M.mouse=[j,P.invert(j)],Zt(this),M.start()}ut(_),M.wheel=setTimeout(z,m),M.zoom("mouse",n(g(w(P,$),M.mouse[0],M.mouse[1]),M.extent,s));function z(){M.wheel=null,M.end()}}function A(_,...I){if(d||!e.apply(this,arguments))return;var M=_.currentTarget,P=S(this,I,!0).event(_),$=ue(_.view).on("mousemove.zoom",L,!0).on("mouseup.zoom",W,!0),j=he(_,M),z=_.clientX,V=_.clientY;ci(_.view),Cn(_),P.mouse=[j,this.__zoom.invert(j)],Zt(this),P.start();function L(Y){if(ut(Y),!P.moved){var Z=Y.clientX-z,J=Y.clientY-V;P.moved=Z*Z+J*J>v}P.event(Y).zoom("mouse",n(g(P.that.__zoom,P.mouse[0]=he(Y,M),P.mouse[1]),P.extent,s))}function W(Y){$.on("mousemove.zoom mouseup.zoom",null),li(Y.view,P.moved),ut(Y),P.event(Y).end()}}function B(_,...I){if(e.apply(this,arguments)){var M=this.__zoom,P=he(_.changedTouches?_.changedTouches[0]:_,this),$=M.invert(P),j=M.k*(_.shiftKey?.5:2),z=n(g(w(M,j),P,$),t.apply(this,I),s);ut(_),a>0?ue(this).transition().duration(a).call(C,z,P,_):ue(this).call(y.transform,z,P,_)}}function T(_,...I){if(e.apply(this,arguments)){var M=_.touches,P=M.length,$=S(this,I,_.changedTouches.length===P).event(_),j,z,V,L;for(Cn(_),z=0;z<P;++z)V=M[z],L=he(V,this),L=[L,this.__zoom.invert(L),V.identifier],$.touch0?!$.touch1&&$.touch0[2]!==L[2]&&($.touch1=L,$.taps=0):($.touch0=L,j=!0,$.taps=1+!!u);u&&(u=clearTimeout(u)),j&&($.taps<2&&(f=L[0],u=setTimeout(function(){u=null},h)),Zt(this),$.start())}}function O(_,...I){if(this.__zooming){var M=S(this,I).event(_),P=_.changedTouches,$=P.length,j,z,V,L;for(ut(_),j=0;j<$;++j)z=P[j],V=he(z,this),M.touch0&&M.touch0[2]===z.identifier?M.touch0[0]=V:M.touch1&&M.touch1[2]===z.identifier&&(M.touch1[0]=V);if(z=M.that.__zoom,M.touch1){var W=M.touch0[0],Y=M.touch0[1],Z=M.touch1[0],J=M.touch1[1],R=(R=Z[0]-W[0])*R+(R=Z[1]-W[1])*R,D=(D=J[0]-Y[0])*D+(D=J[1]-Y[1])*D;z=w(z,Math.sqrt(R/D)),V=[(W[0]+Z[0])/2,(W[1]+Z[1])/2],L=[(Y[0]+J[0])/2,(Y[1]+J[1])/2]}else if(M.touch0)V=M.touch0[0],L=M.touch0[1];else return;M.zoom("touch",n(g(z,V,L),M.extent,s))}}function H(_,...I){if(this.__zooming){var M=S(this,I).event(_),P=_.changedTouches,$=P.length,j,z;for(Cn(_),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),j=0;j<$;++j)z=P[j],M.touch0&&M.touch0[2]===z.identifier?delete M.touch0:M.touch1&&M.touch1[2]===z.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(z=he(z,this),Math.hypot(f[0]-z[0],f[1]-z[1])<x)){var V=ue(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return y.wheelDelta=function(_){return arguments.length?(o=typeof _=="function"?_:Ht(+_),y):o},y.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Ht(!!_),y):e},y.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:Ht(!!_),y):r},y.extent=function(_){return arguments.length?(t=typeof _=="function"?_:Ht([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),y):t},y.scaleExtent=function(_){return arguments.length?(i[0]=+_[0],i[1]=+_[1],y):[i[0],i[1]]},y.translateExtent=function(_){return arguments.length?(s[0][0]=+_[0][0],s[1][0]=+_[1][0],s[0][1]=+_[0][1],s[1][1]=+_[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(_){return arguments.length?(n=_,y):n},y.duration=function(_){return arguments.length?(a=+_,y):a},y.interpolate=function(_){return arguments.length?(c=_,y):c},y.on=function(){var _=l.on.apply(l,arguments);return _===l?y:_},y.clickDistance=function(_){return arguments.length?(v=(_=+_)*_,y):Math.sqrt(v)},y.tapDistance=function(_){return arguments.length?(x=+_,y):x},y}const ye={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},bt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ci=["Enter"," ","Escape"],Ii={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Ze;(function(e){e.Strict="strict",e.Loose="loose"})(Ze||(Ze={}));var Ye;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ye||(Ye={}));var _t;(function(e){e.Partial="partial",e.Full="full"})(_t||(_t={}));const Mi={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Re;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Re||(Re={}));var nn;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(nn||(nn={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const Go={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top},ki=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,Yd=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),uo=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),kt=(e,t=[0,0])=>{const{width:n,height:o}=we(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},Xd=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const o=e.reduce((r,i)=>{const s=typeof i=="string";let a=!t.nodeLookup&&!s?i:void 0;return t.nodeLookup&&(a=s?t.nodeLookup.get(i):uo(i)?i:t.nodeLookup.get(i.id)),a?(n=!0,fn(r,on(a,t.nodeOrigin))):r},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?hn(o):{x:0,y:0,width:0,height:0}},Tt=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=fn(n,on(r)),o=!0)}),o?hn(n):{x:0,y:0,width:0,height:0}},fo=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a=(t.x-n)/r,c=(t.y-o)/r,l=t.width/r,u=t.height/r,f=[];for(const d of e.values()){const{measured:h,selectable:m=!0,hidden:v=!1}=d;if(s&&!m||v)continue;const x=h.width??d.width??d.initialWidth??0,y=h.height??d.height??d.initialHeight??0,{x:w,y:g}=d.internals.positionAbsolute,b=Di(a,c,l,u,w,g,x,y),C=x*y,S=i&&b>0;(!d.internals.handleBounds||S||b>=C||d.dragging)&&f.push(d)}return f},Wd=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function Zd(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{let i;if(t?.includeHiddenNodes){const{width:s,height:a}=we(r);i=s>0&&a>0}else i=!!(r.measured.width&&r.measured.height&&!r.hidden);i&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function Gd({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return!0;const a=Zd(e,s),c=Tt(a),l=po(c,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(l,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0}function Ti({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:c,y:l}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??o;let f=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",ye.error005());else{const{width:h,height:m}=we(a);h&&m&&(f=[[c,l],[c+h,l+m]])}else a&&Ue(s.extent)&&(f=[[s.extent[0][0]+c,s.extent[0][1]+l],[s.extent[1][0]+c,s.extent[1][1]+l]]);const d=Ue(f)?Ge(t,f,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",ye.error015()),{position:{x:d.x-c+(s.measured.width??0)*u[0],y:d.y-l+(s.measured.height??0)*u[1]},positionAbsolute:d}}async function Ud({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(d=>d.id)),s=[];for(const d of n){if(d.deletable===!1)continue;const h=i.has(d.id),m=!h&&d.parentId&&s.find(v=>v.id===d.parentId);(h||m)&&s.push(d)}const a=new Set(t.map(d=>d.id)),c=o.filter(d=>d.deletable!==!1),u=Wd(s,c);for(const d of c)a.has(d.id)&&!u.find(m=>m.id===d.id)&&u.push(d);if(!r)return{edges:u,nodes:s};const f=await r({nodes:s,edges:u});return typeof f=="boolean"?f?{edges:u,nodes:s}:{edges:[],nodes:[]}:f}const it=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ge=(e={x:0,y:0},t,n)=>({x:it(e.x,t[0][0],t[1][0]-(n?.width??0)),y:it(e.y,t[0][1],t[1][1]-(n?.height??0))});function Ai(e,t,n){const{width:o,height:r}=we(n),{x:i,y:s}=n.internals.positionAbsolute;return Ge(e,[[i,s],[i+o,s+r]],t)}const Uo=(e,t,n)=>e<t?it(Math.abs(e-t),1,t)/t:e>n?-it(Math.abs(e-n),1,t)/t:0,ho=(e,t,n=15,o=40)=>{const r=Uo(e.x,o,t.width-o)*n,i=Uo(e.y,o,t.height-o)*n;return[r,i]},fn=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Zn=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),hn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),St=(e,t=[0,0])=>{const{x:n,y:o}=uo(e)?e.internals.positionAbsolute:kt(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},on=(e,t=[0,0])=>{const{x:n,y:o}=uo(e)?e.internals.positionAbsolute:kt(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},Pi=(e,t)=>hn(fn(Zn(e),Zn(t))),Di=(e,t,n,o,r,i,s,a)=>{const c=Math.max(0,Math.min(e+n,r+s)-Math.max(e,r)),l=Math.max(0,Math.min(t+o,i+a)-Math.max(t,i));return Math.ceil(c*l)},rn=(e,t)=>Di(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),qo=e=>ge(e.width)&&ge(e.height)&&ge(e.x)&&ge(e.y),ge=e=>!isNaN(e)&&isFinite(e),$i=(e,t)=>(n,o)=>{},At=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Pt=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?At(a,s):a},st=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Qe(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function qd(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Qe(e,n),r=Qe(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Qe(e.top??e.y??0,n),r=Qe(e.bottom??e.y??0,n),i=Qe(e.left??e.x??0,t),s=Qe(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Kd(e,t,n,o,r,i){const{x:s,y:a}=st(e,[t,n,o]),{x:c,y:l}=st({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-c,f=i-l;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(f)}}const po=(e,t,n,o,r,i)=>{const s=qd(i,t,n),a=(t-s.x)/e.width,c=(n-s.y)/e.height,l=Math.min(a,c),u=it(l,o,r),f=e.x+e.width/2,d=e.y+e.height/2,h=t/2-f*u,m=n/2-d*u,v=Kd(e,h,m,u,t,n),x={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:h-x.left+x.right,y:m-x.top+x.bottom,zoom:u}},Nt=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Ue(e){return e!=null&&e!=="parent"}function we(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ji(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Ri(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Ko(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Qd(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function Jd(e){return{...Ii,...e||{}}}function Hi(e){return e===null?null:e?"valid":"invalid"}function gt(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=me(e),a=Pt({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:c,y:l}=n?At(a,t):a;return{xSnapped:c,ySnapped:l,...a}}const go=e=>({width:e.offsetWidth,height:e.offsetHeight}),Oi=e=>e?.getRootNode?.()||window?.document,ef=["INPUT","SELECT","TEXTAREA"];function zi(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:ef.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Li=e=>"clientX"in e,me=(e,t)=>{const n=Li(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Qo=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...go(s)}})};function Bi({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const c=e*.125+r*.375+s*.375+n*.125,l=t*.125+i*.375+a*.375+o*.125,u=Math.abs(c-e),f=Math.abs(l-t);return[c,l,u,f]}function Ot(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Jo({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case X.Left:return[t-Ot(t-o,i),n];case X.Right:return[t+Ot(o-t,i),n];case X.Top:return[t,n-Ot(n-r,i)];case X.Bottom:return[t,n+Ot(r-n,i)]}}function Vi({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top,curvature:s=.25}){const[a,c]=Jo({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[l,u]=Jo({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[f,d,h,m]=Bi({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${c} ${l},${u} ${o},${r}`,f,d,h,m]}function Fi({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function tf({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const s=r&&n?o+1e3:o,a=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return s+a}function nf({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=fn(on(e),on(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return rn(s,hn(i))>0}const of=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,rf=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),sf=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",ye.error006()),t;const o=n.getEdgeId||of;let r;return ki(e)?r={...e}:r={...e,id:o(e)},rf(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function Yi({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=Fi({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const er={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},af=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},tr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function cf({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:o=X.Top,center:r,offset:i,stepPosition:s}){const a=er[t],c=er[o],l={x:e.x+a.x*i,y:e.y+a.y*i},u={x:n.x+c.x*i,y:n.y+c.y*i},f=af({source:l,sourcePosition:t,target:u}),d=f.x!==0?"x":"y",h=f[d];let m=[],v,x;const y={x:0,y:0},w={x:0,y:0},[,,g,b]=Fi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*c[d]===-1){d==="x"?(v=r.x??l.x+(u.x-l.x)*s,x=r.y??(l.y+u.y)/2):(v=r.x??(l.x+u.x)/2,x=r.y??l.y+(u.y-l.y)*s);const k=[{x:v,y:l.y},{x:v,y:u.y}],A=[{x:l.x,y:x},{x:u.x,y:x}];a[d]===h?m=d==="x"?k:A:m=d==="x"?A:k}else{const k=[{x:l.x,y:u.y}],A=[{x:u.x,y:l.y}];if(d==="x"?m=a.x===h?A:k:m=a.y===h?k:A,t===o){const _=Math.abs(e[d]-n[d]);if(_<=i){const I=Math.min(i-1,i-_);a[d]===h?y[d]=(l[d]>e[d]?-1:1)*I:w[d]=(u[d]>n[d]?-1:1)*I}}if(t!==o){const _=d==="x"?"y":"x",I=a[d]===c[_],M=l[_]>u[_],P=l[_]<u[_];(a[d]===1&&(!I&&M||I&&P)||a[d]!==1&&(!I&&P||I&&M))&&(m=d==="x"?k:A)}const B={x:l.x+y.x,y:l.y+y.y},T={x:u.x+w.x,y:u.y+w.y},O=Math.max(Math.abs(B.x-m[0].x),Math.abs(T.x-m[0].x)),H=Math.max(Math.abs(B.y-m[0].y),Math.abs(T.y-m[0].y));O>=H?(v=(B.x+T.x)/2,x=m[0].y):(v=m[0].x,x=(B.y+T.y)/2)}const C={x:l.x+y.x,y:l.y+y.y},S={x:u.x+w.x,y:u.y+w.y};return[[e,...C.x!==m[0].x||C.y!==m[0].y?[C]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],v,x,g,b]}function lf(e,t,n,o){const r=Math.min(tr(e,t)/2,tr(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const l=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*l},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${s+r*c}Q ${i},${s} ${i+r*a},${s}`}function Gn({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:o,targetY:r,targetPosition:i=X.Top,borderRadius:s=5,centerX:a,centerY:c,offset:l=20,stepPosition:u=.5}){const[f,d,h,m,v]=cf({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:c},offset:l,stepPosition:u});let x=`M${f[0].x} ${f[0].y}`;for(let y=1;y<f.length-1;y++)x+=lf(f[y-1],f[y],f[y+1],s);return x+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[x,d,h,m,v]}function nr(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function uf(e){const{sourceNode:t,targetNode:n}=e;if(!nr(t)||!nr(n))return null;const o=t.internals.handleBounds||or(t.handles),r=n.internals.handleBounds||or(n.handles),i=rr(o?.source??[],e.sourceHandle),s=rr(e.connectionMode===Ze.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",ye.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||X.Bottom,c=s?.position||X.Top,l=qe(t,i,a),u=qe(n,s,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:c}}function or(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function qe(e,t,n=X.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??we(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case X.Top:return{x:r+s/2,y:i};case X.Right:return{x:r+s,y:i+a/2};case X.Bottom:return{x:r+s/2,y:i+a};case X.Left:return{x:r,y:i+a/2}}}function rr(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Un(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function df(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const l=Un(c,t);i.has(l)||(s.push({id:l,color:c.color||n,...c}),i.add(l))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Xi=1e3,ff=10,mo={nodeOrigin:[0,0],nodeExtent:bt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},hf={...mo,checkEquality:!0};function yo(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function pf(e,t,n){const o=yo(mo,n);for(const r of e.values())if(r.parentId)wo(r,e,t,o);else{const i=kt(r,o.nodeOrigin),s=Ue(r.extent)?r.extent:o.nodeExtent,a=Ge(i,s,we(r));r.internals.positionAbsolute=a}}function gf(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function xo(e){return e==="manual"}function qn(e,t,n,o={}){const r=yo(hf,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!xo(r.zIndexMode)?Xi:0;let c=e.length>0,l=!1;t.clear(),n.clear();for(const u of e){let f=s.get(u.id);if(r.checkEquality&&u===f?.internals.userNode)t.set(u.id,f);else{const d=kt(u,r.nodeOrigin),h=Ue(u.extent)?u.extent:r.nodeExtent,m=Ge(d,h,we(u));f={...r.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:m,handleBounds:gf(u,f),z:Wi(u,a,r.zIndexMode),userNode:u}},t.set(u.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(c=!1),u.parentId&&wo(f,t,n,o,i),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function mf(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function wo(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:c}=yo(mo,o),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}mf(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&c==="auto"&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*ff),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const f=i&&!xo(c)?Xi:0,{x:d,y:h,z:m}=yf(e,u,s,a,f,c),{positionAbsolute:v}=e.internals,x=d!==v.x||h!==v.y;(x||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:d,y:h}:v,z:m}})}function Wi(e,t,n){const o=ge(e.zIndex)?e.zIndex:0;return xo(n)?o:o+(e.selected?t:0)}function yf(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,c=we(e),l=kt(e,n),u=Ue(e.extent)?Ge(l,e.extent,c):l;let f=Ge({x:s+u.x,y:a+u.y},o,c);e.extent==="parent"&&(f=Ai(f,c,t));const d=Wi(e,r,i),h=t.internals.z??0;return{x:f.x,y:f.y,z:h>=d?h+1:d}}function vo(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const c=i.get(s.parentId)?.expandedRect??St(a),l=Pi(c,s.rect);i.set(s.parentId,{expandedRect:l,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},c)=>{const l=a.internals.positionAbsolute,u=we(a),f=a.origin??o,d=s.x<l.x?Math.round(Math.abs(l.x-s.x)):0,h=s.y<l.y?Math.round(Math.abs(l.y-s.y)):0,m=Math.max(u.width,Math.round(s.width)),v=Math.max(u.height,Math.round(s.height)),x=(m-u.width)*f[0],y=(v-u.height)*f[1];(d>0||h>0||x||y)&&(r.push({id:c,type:"position",position:{x:a.position.x-d+x,y:a.position.y-h+y}}),n.get(c)?.forEach(w=>{e.some(g=>g.id===w.id)||r.push({id:w.id,type:"position",position:{x:w.position.x+d,y:w.position.y+h}})})),(u.width<s.width||u.height<s.height||d||h)&&r.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:m+(d?f[0]*d-x:0),height:v+(h?f[1]*h-y:0)}})}),r}function xf(e,t,n,o,r,i,s){const a=o?.querySelector(".xyflow__viewport");let c=!1;if(!a)return{changes:[],updatedInternals:c};const l=[],u=window.getComputedStyle(a),{m22:f}=new window.DOMMatrixReadOnly(u.transform),d=[];for(const h of e.values()){const m=t.get(h.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),c=!0;continue}const v=go(h.nodeElement),x=m.measured.width!==v.width||m.measured.height!==v.height;if(!!(v.width&&v.height&&(x||!m.internals.handleBounds||h.force))){const w=h.nodeElement.getBoundingClientRect(),g=Ue(m.extent)?m.extent:i;let{positionAbsolute:b}=m.internals;if(m.parentId&&m.extent==="parent"){const S=t.get(m.parentId);S&&(b=Ai(b,v,S))}else g&&(b=Ge(b,g,v));const C={...m,measured:v,internals:{...m.internals,positionAbsolute:b,handleBounds:{source:Qo("source",h.nodeElement,w,f,m.id),target:Qo("target",h.nodeElement,w,f,m.id)}}};t.set(m.id,C),m.parentId&&wo(C,t,n,{nodeOrigin:r,zIndexMode:s}),c=!0,x&&(l.push({id:m.id,type:"dimensions",dimensions:v}),m.expandParent&&m.parentId&&d.push({id:m.id,parentId:m.parentId,rect:St(C,r)}))}}if(d.length>0){const h=vo(d,t,n,r);l.push(...h)}return{changes:l,updatedInternals:c}}async function wf({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function ir(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const c=o.get(s)||new Map;if(o.set(s,c.set(n,t)),i){s=`${r}-${e}-${i}`;const l=o.get(s)||new Map;o.set(s,l.set(n,t))}}function Zi(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,c={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},l=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;ir("source",c,u,e,r,s),ir("target",c,l,e,i,a),t.set(o.id,o)}}function Gi(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Gi(n,t):!1}function sr(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function vf(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!Gi(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function In({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const c=n.get(s)?.internals.userNode;c&&r.push({...c,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function bf({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=At(i,t);return{x:s.x-i.x,y:s.y-i.y}}function _f({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,c=!1,l={x:0,y:0},u=null,f=!1,d=null,h=!1,m=!1,v=null;function x({noDragClassName:w,handleSelector:g,domNode:b,isSelectable:C,nodeId:S,nodeClickDistance:N=0}){d=ue(b);function k({x:O,y:H}){const{nodeLookup:_,nodeExtent:I,snapGrid:M,snapToGrid:P,nodeOrigin:$,onNodeDrag:j,onSelectionDrag:z,onError:V,updateNodePositions:L}=t();i={x:O,y:H};let W=!1;const Y=a.size>1,Z=Y&&I?Zn(Tt(a)):null,J=Y&&P?bf({dragItems:a,snapGrid:M,x:O,y:H}):null;for(const[R,D]of a){if(!_.has(R))continue;let F={x:O-D.distance.x,y:H-D.distance.y};P&&(F=J?{x:Math.round(F.x+J.x),y:Math.round(F.y+J.y)}:At(F,M));let U=null;if(Y&&I&&!D.extent&&Z){const{positionAbsolute:q}=D.internals,ee=q.x-Z.x+I[0][0],ne=q.x+D.measured.width-Z.x2+I[1][0],oe=q.y-Z.y+I[0][1],ae=q.y+D.measured.height-Z.y2+I[1][1];U=[[ee,oe],[ne,ae]]}const{position:K,positionAbsolute:G}=Ti({nodeId:R,nextPosition:F,nodeLookup:_,nodeExtent:U||I,nodeOrigin:$,onError:V});W=W||D.position.x!==K.x||D.position.y!==K.y,D.position=K,D.internals.positionAbsolute=G}if(m=m||W,!!W&&(L(a,!0),v&&(o||j||!S&&z))){const[R,D]=In({nodeId:S,dragItems:a,nodeLookup:_});o?.(v,a,R,D),j?.(v,R,D),S||z?.(v,D)}}async function A(){if(!u)return;const{transform:O,panBy:H,autoPanSpeed:_,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(s);return}const[M,P]=ho(l,u,_);(M!==0||P!==0)&&(i.x=(i.x??0)-M/O[2],i.y=(i.y??0)-P/O[2],await H({x:M,y:P})&&k(i)),s=requestAnimationFrame(A)}function B(O){const{nodeLookup:H,multiSelectionActive:_,nodesDraggable:I,transform:M,snapGrid:P,snapToGrid:$,selectNodesOnDrag:j,onNodeDragStart:z,onSelectionDragStart:V,unselectNodesAndEdges:L}=t();f=!0,(!j||!C)&&!_&&S&&(H.get(S)?.selected||L()),C&&j&&S&&e?.(S);const W=gt(O.sourceEvent,{transform:M,snapGrid:P,snapToGrid:$,containerBounds:u});if(i=W,a=vf(H,I,W,S),a.size>0&&(n||z||!S&&V)){const[Y,Z]=In({nodeId:S,dragItems:a,nodeLookup:H});n?.(O.sourceEvent,a,Y,Z),z?.(O.sourceEvent,Y,Z),S||V?.(O.sourceEvent,Z)}}const T=ui().clickDistance(N).on("start",O=>{const{domNode:H,nodeDragThreshold:_,transform:I,snapGrid:M,snapToGrid:P}=t();u=H?.getBoundingClientRect()||null,h=!1,m=!1,v=O.sourceEvent,_===0&&B(O),i=gt(O.sourceEvent,{transform:I,snapGrid:M,snapToGrid:P,containerBounds:u}),l=me(O.sourceEvent,u)}).on("drag",O=>{const{autoPanOnNodeDrag:H,transform:_,snapGrid:I,snapToGrid:M,nodeDragThreshold:P,nodeLookup:$}=t(),j=gt(O.sourceEvent,{transform:_,snapGrid:I,snapToGrid:M,containerBounds:u});if(v=O.sourceEvent,(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1||S&&!$.has(S))&&(h=!0),!h){if(!c&&H&&f&&(c=!0,A()),!f){const z=me(O.sourceEvent,u),V=z.x-l.x,L=z.y-l.y;Math.sqrt(V*V+L*L)>P&&B(O)}(i.x!==j.xSnapped||i.y!==j.ySnapped)&&a&&f&&(l=me(O.sourceEvent,u),k(j))}}).on("end",O=>{if(!f||h){h&&a.size>0&&t().updateNodePositions(a,!1);return}if(c=!1,f=!1,cancelAnimationFrame(s),a.size>0){const{nodeLookup:H,updateNodePositions:_,onNodeDragStop:I,onSelectionDragStop:M}=t();if(m&&(_(a,!1),m=!1),r||I||!S&&M){const[P,$]=In({nodeId:S,dragItems:a,nodeLookup:H,dragging:!1});r?.(O.sourceEvent,a,P,$),I?.(O.sourceEvent,P,$),S||M?.(O.sourceEvent,$)}}}).filter(O=>{const H=O.target;return!O.button&&(!w||!sr(H,`.${w}`,b))&&(!g||sr(H,g,b))});d.call(T)}function y(){d?.on(".drag",null)}return{update:x,destroy:y}}function Sf(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())rn(r,St(i))>0&&o.push(i);return o}const Nf=250;function Ef(e,t,n,o){let r=[],i=1/0;const s=Sf(e,n,t+Nf);for(const a of s){const c=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const l of c){if(o.nodeId===l.nodeId&&o.type===l.type&&o.id===l.id)continue;const{x:u,y:f}=qe(a,l,l.position,!0),d=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(f-e.y,2));d>t||(d<i?(r=[{...l,x:u,y:f}],i=d):d===i&&r.push({...l,x:u,y:f}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(c=>c.type===a)??r[0]}return r[0]}function Ui(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],c=(n?a?.find(l=>l.id===n):a?.[0])??null;return c&&i?{...c,...qe(s,c,c.position,!0)}:c}function qi(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Cf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Ki=()=>!0;function If(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:f,panBy:d,cancelConnection:h,onConnectStart:m,onConnect:v,onConnectEnd:x,isValidConnection:y=Ki,onReconnectEnd:w,updateConnection:g,getTransform:b,getFromHandle:C,autoPanSpeed:S,dragThreshold:N=1,handleDomNode:k}){const A=Oi(e.target);let B=0,T;const{x:O,y:H}=me(e),_=qi(i,k),I=a?.getBoundingClientRect();let M=!1;if(!I||!_)return;const P=Ui(r,_,o,c,t);if(!P)return;let $=me(e,I),j=!1,z=null,V=!1,L=null;function W(){if(!u||!I)return;const[K,G]=ho($,I,S);d({x:K,y:G}),B=requestAnimationFrame(W)}const Y={...P,nodeId:r,type:_,position:P.position},Z=c.get(r);let R={inProgress:!0,isValid:null,from:qe(Z,Y,X.Left,!0),fromHandle:Y,fromPosition:Y.position,fromNode:Z,to:$,toHandle:null,toPosition:Go[Y.position],toNode:null,pointer:$};function D(){M=!0,g(R),m?.(e,{nodeId:r,handleId:o,handleType:_})}N===0&&D();function F(K){if(!M){const{x:ae,y:Ee}=me(K),ve=ae-O,be=Ee-H;if(!(ve*ve+be*be>N*N))return;D()}if(!C()||!Y){U(K);return}const G=b();$=me(K,I),T=Ef(Pt($,G,!1,[1,1]),n,c,Y),j||(W(),j=!0);const q=Qi(K,{handle:T,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:y,doc:A,lib:l,flowId:f,nodeLookup:c});L=q.handleDomNode,z=q.connection,V=Cf(!!T,q.isValid);const ee=c.get(r),ne=ee?qe(ee,Y,X.Left,!0):R.from,oe={...R,from:ne,isValid:V,to:q.toHandle&&V?st({x:q.toHandle.x,y:q.toHandle.y},G):$,toHandle:q.toHandle,toPosition:V&&q.toHandle?q.toHandle.position:Go[Y.position],toNode:q.toHandle?c.get(q.toHandle.nodeId):null,pointer:$};g(oe),R=oe}function U(K){if(!("touches"in K&&K.touches.length>0)){if(M){(T||L)&&z&&V&&v?.(z);const{inProgress:G,...q}=R,ee={...q,toPosition:R.toHandle?R.toPosition:null};x?.(K,ee),i&&w?.(K,ee)}h(),cancelAnimationFrame(B),j=!1,V=!1,z=null,L=null,A.removeEventListener("mousemove",F),A.removeEventListener("mouseup",U),A.removeEventListener("touchmove",F),A.removeEventListener("touchend",U)}}A.addEventListener("mousemove",F),A.addEventListener("mouseup",U),A.addEventListener("touchmove",F),A.addEventListener("touchend",U)}function Qi(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:c,isValidConnection:l=Ki,nodeLookup:u}){const f=i==="target",d=t?s.querySelector(`.${a}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:m}=me(e),v=s.elementFromPoint(h,m),x=v?.classList.contains(`${a}-flow__handle`)?v:d,y={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const w=qi(void 0,x),g=x.getAttribute("data-nodeid"),b=x.getAttribute("data-handleid"),C=x.classList.contains("connectable"),S=x.classList.contains("connectableend");if(!g||!w)return y;const N={source:f?g:o,sourceHandle:f?b:r,target:f?o:g,targetHandle:f?r:b};y.connection=N;const A=C&&S&&(n===Ze.Strict?f&&w==="source"||!f&&w==="target":g!==o||b!==r);y.isValid=A&&l(N),y.toHandle=Ui(g,w,b,u,n,!0)}return y}const Kn={onPointerDown:If,isValid:Qi};function Mf({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=ue(e);function i({translateExtent:a,width:c,height:l,zoomStep:u=1,pannable:f=!0,zoomable:d=!0,inversePan:h=!1}){const m=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const b=n(),C=g.sourceEvent.ctrlKey&&Nt()?10:1,S=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*u,N=b[2]*Math.pow(2,S*C);t.scaleTo(N)};let v=[0,0];const x=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},y=g=>{const b=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const C=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],S=[C[0]-v[0],C[1]-v[1]];v=C;const N=o()*Math.max(b[2],Math.log(b[2]))*(h?-1:1),k={x:b[0]-S[0]*N,y:b[1]-S[1]*N},A=[[0,0],[c,l]];t.setViewportConstrained({x:k.x,y:k.y,zoom:b[2]},A,a)},w=Ei().on("start",x).on("zoom",f?y:null).on("zoom.wheel",d?m:null);r.call(w,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:he}}const pn=e=>({x:e.x,y:e.y,zoom:e.k}),Mn=({x:e,y:t,zoom:n})=>dn.translate(e,t).scale(n),je=(e,t)=>e.target.closest(`.${t}`),Ji=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),kf=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,kn=(e,t=0,n=kf,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},es=e=>{const t=e.ctrlKey&&Nt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Tf({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(je(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(u.ctrlKey&&s){const x=he(u),y=es(u),w=f*Math.pow(2,y);o.scaleTo(n,w,x,u);return}const d=u.deltaMode===1?20:1;let h=r===Ye.Vertical?0:u.deltaX*d,m=r===Ye.Horizontal?0:u.deltaY*d;!Nt()&&u.shiftKey&&r!==Ye.Vertical&&(h=u.deltaY*d,m=0),o.translateBy(n,-(h/f)*i,-(m/f)*i,{internal:!0});const v=pn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,v):(e.isPanScrolling=!0,a?.(u,v)),e.panScrollTimeout=setTimeout(()=>{l?.(u,v),e.isPanScrolling=!1},150)}}function Af({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=je(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Pf({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=pn(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function Df({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Ji(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,pn(i.transform))}}function $f({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Ji(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=pn(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function jf({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:o,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:f}){return d=>{const h=t||n,m=o&&d.ctrlKey,v=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(je(d,`${u}-flow__node`)||je(d,`${u}-flow__edge`)||je(d,`${u}-flow__selection`)||je(d,`${u}-flow__nodesselection`)))return!0;if(!r&&!h&&!i&&!s&&!o||a||f&&!v||je(d,c)&&v||je(d,l)&&(!v||i&&v&&!t)||!o&&d.ctrlKey&&v)return!1;if(!o&&d.type==="touchstart"&&d.touches?.length>1)return d.preventDefault(),!1;if(!h&&!i&&!m&&v||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const x=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||v||e)&&x}}function Rf({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:c}){const l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect();let f=[[0,0],[u.width,u.height]];(typeof ResizeObserver<"u"?new ResizeObserver(H=>{const _=H[0];_&&(f=[[0,0],[_.contentRect.width,_.contentRect.height]])}):null)?.observe(e);const h=Ei().extent(()=>f).scaleExtent([t,n]).translateExtent(o),m=ue(e).call(h);b({x:r.x,y:r.y,zoom:it(r.zoom,t,n)},[[0,0],[u.width,u.height]],o);const v=m.on("wheel.zoom"),x=m.on("dblclick.zoom");h.wheelDelta(es);async function y(H,_){return m?new Promise(I=>{h?.interpolate(_?.interpolate==="linear"?pt:Yt).transform(kn(m,_?.duration,_?.ease,()=>I(!0)),H)}):!1}function w({noWheelClassName:H,noPanClassName:_,onPaneContextMenu:I,userSelectionActive:M,panOnScroll:P,panOnDrag:$,panOnScrollMode:j,panOnScrollSpeed:z,preventScrolling:V,zoomOnPinch:L,zoomOnScroll:W,zoomOnDoubleClick:Y,panActivationKeyPressed:Z=!1,zoomActivationKeyPressed:J,lib:R,onTransformChange:D,connectionInProgress:F,paneClickDistance:U,selectionOnDrag:K}){M&&!l.isZoomingOrPanning&&g();const G=P&&!J&&!M;h.clickDistance(K?1/0:!ge(U)||U<0?0:U);const q=G?Tf({zoomPanValues:l,noWheelClassName:H,d3Selection:m,d3Zoom:h,panOnScrollMode:j,panOnScrollSpeed:z,zoomOnPinch:L,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):Af({noWheelClassName:H,preventScrolling:V,d3ZoomHandler:v});m.on("wheel.zoom",q,{passive:!1});const ee=Pf({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:s});h.on("start",ee);const ne=Df({zoomPanValues:l,panOnDrag:$,onPaneContextMenu:!!I,onPanZoom:i,onTransformChange:D});h.on("zoom",ne);const oe=$f({zoomPanValues:l,panOnDrag:$,panOnScroll:P,onPaneContextMenu:I,onPanZoomEnd:a,onDraggingChange:c});h.on("end",oe);const ae=jf({panActivationKeyPressed:Z,zoomActivationKeyPressed:J,panOnDrag:$,zoomOnScroll:W,panOnScroll:P,zoomOnDoubleClick:Y,zoomOnPinch:L,userSelectionActive:M,noPanClassName:_,noWheelClassName:H,lib:R,connectionInProgress:F});h.filter(ae),Y?m.on("dblclick.zoom",x):m.on("dblclick.zoom",null)}function g(){h.on("zoom",null)}async function b(H,_,I){const M=Mn(H),P=h?.constrain()(M,_,I);return P&&await y(P),P}async function C(H,_){const I=Mn(H);return await y(I,_),I}function S(H){if(m){const _=Mn(H),I=m.property("__zoom");(I.k!==H.zoom||I.x!==H.x||I.y!==H.y)&&h?.transform(m,_,null,{sync:!0})}}function N(){const H=m?Ni(m.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}async function k(H,_){return m?new Promise(I=>{h?.interpolate(_?.interpolate==="linear"?pt:Yt).scaleTo(kn(m,_?.duration,_?.ease,()=>I(!0)),H)}):!1}async function A(H,_){return m?new Promise(I=>{h?.interpolate(_?.interpolate==="linear"?pt:Yt).scaleBy(kn(m,_?.duration,_?.ease,()=>I(!0)),H)}):!1}function B(H){h?.scaleExtent(H)}function T(H){h?.translateExtent(H)}function O(H){const _=!ge(H)||H<0?0:H;h?.clickDistance(_)}return{update:w,destroy:g,setViewport:C,setViewportConstrained:b,getViewport:N,scaleTo:k,scaleBy:A,setScaleExtent:B,setTranslateExtent:T,syncViewport:S,setClickDistance:O}}var at;(function(e){e.Line="line",e.Handle="handle"})(at||(at={}));function Hf({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,c=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function ar(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function De(e,t){return Math.max(0,t-e)}function $e(e,t){return Math.max(0,e-t)}function zt(e,t,n){return Math.max(0,t-e,e-n)}function cr(e,t){return e?!t:t}function Of(e,t,n,o,r,i,s,a){let{affectsX:c,affectsY:l}=t;const{isHorizontal:u,isVertical:f}=t,d=u&&f,{xSnapped:h,ySnapped:m}=n,{minWidth:v,maxWidth:x,minHeight:y,maxHeight:w}=o,{x:g,y:b,width:C,height:S,aspectRatio:N}=e;let k=Math.floor(u?h-e.pointerX:0),A=Math.floor(f?m-e.pointerY:0);const B=C+(c?-k:k),T=S+(l?-A:A),O=-i[0]*C,H=-i[1]*S;let _=zt(B,v,x),I=zt(T,y,w);if(s){let $=0,j=0;c&&k<0?$=De(g+k+O,s[0][0]):!c&&k>0&&($=$e(g+B+O,s[1][0])),l&&A<0?j=De(b+A+H,s[0][1]):!l&&A>0&&(j=$e(b+T+H,s[1][1])),_=Math.max(_,$),I=Math.max(I,j)}if(a){let $=0,j=0;c&&k>0?$=$e(g+k,a[0][0]):!c&&k<0&&($=De(g+B,a[1][0])),l&&A>0?j=$e(b+A,a[0][1]):!l&&A<0&&(j=De(b+T,a[1][1])),_=Math.max(_,$),I=Math.max(I,j)}if(r){if(u){const $=zt(B/N,y,w)*N;if(_=Math.max(_,$),s){let j=0;!c&&!l||c&&!l&&d?j=$e(b+H+B/N,s[1][1])*N:j=De(b+H+(c?k:-k)/N,s[0][1])*N,_=Math.max(_,j)}if(a){let j=0;!c&&!l||c&&!l&&d?j=De(b+B/N,a[1][1])*N:j=$e(b+(c?k:-k)/N,a[0][1])*N,_=Math.max(_,j)}}if(f){const $=zt(T*N,v,x)/N;if(I=Math.max(I,$),s){let j=0;!c&&!l||l&&!c&&d?j=$e(g+T*N+O,s[1][0])/N:j=De(g+(l?A:-A)*N+O,s[0][0])/N,I=Math.max(I,j)}if(a){let j=0;!c&&!l||l&&!c&&d?j=De(g+T*N,a[1][0])/N:j=$e(g+(l?A:-A)*N,a[0][0])/N,I=Math.max(I,j)}}}A=A+(A<0?I:-I),k=k+(k<0?_:-_),r&&(d?B>T*N?A=(cr(c,l)?-k:k)/N:k=(cr(c,l)?-A:A)*N:u?(A=k/N,l=c):(k=A*N,c=l));const M=c?g+k:g,P=l?b+A:b;return{width:C+(c?-k:k),height:S+(l?-A:A),x:i[0]*k*(c?-1:1)+M,y:i[1]*A*(l?-1:1)+P}}const ts={width:0,height:0,x:0,y:0},zf={...ts,pointerX:0,pointerY:0,aspectRatio:1};function Lf(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,c=n[1]*s;return[[o-a,r-c],[o+i-a,r+s-c]]}function Bf({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=ue(e);let s={controlDirection:ar("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:l,boundaries:u,keepAspectRatio:f,resizeDirection:d,onResizeStart:h,onResize:m,onResizeEnd:v,shouldResize:x}){let y={...ts},w={...zf};s={boundaries:u,resizeDirection:d,keepAspectRatio:f,controlDirection:ar(l)};let g,b=null,C=[],S,N,k,A=!1;const B=ui().on("start",T=>{const{nodeLookup:O,transform:H,snapGrid:_,snapToGrid:I,nodeOrigin:M,paneDomNode:P}=n();if(g=O.get(t),!g)return;b=P?.getBoundingClientRect()??null;const{xSnapped:$,ySnapped:j}=gt(T.sourceEvent,{transform:H,snapGrid:_,snapToGrid:I,containerBounds:b});y={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},w={...y,pointerX:$,pointerY:j,aspectRatio:y.width/y.height},S=void 0,N=Ue(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(S=O.get(g.parentId)),S&&g.extent==="parent"&&(N=[[0,0],[S.measured.width,S.measured.height]]),C=[],k=void 0;for(const[z,V]of O)if(V.parentId===t&&(C.push({id:z,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const L=Lf(V,g,V.origin??M);k?k=[[Math.min(L[0][0],k[0][0]),Math.min(L[0][1],k[0][1])],[Math.max(L[1][0],k[1][0]),Math.max(L[1][1],k[1][1])]]:k=L}h?.(T,{...y})}).on("drag",T=>{const{transform:O,snapGrid:H,snapToGrid:_,nodeOrigin:I}=n(),M=gt(T.sourceEvent,{transform:O,snapGrid:H,snapToGrid:_,containerBounds:b}),P=[];if(!g)return;const{x:$,y:j,width:z,height:V}=y,L={},W=g.origin??I,{width:Y,height:Z,x:J,y:R}=Of(w,s.controlDirection,M,s.boundaries,s.keepAspectRatio,W,N,k),D=Y!==z,F=Z!==V,U=J!==$&&D,K=R!==j&&F;if(!U&&!K&&!D&&!F)return;if((U||K||W[0]===1||W[1]===1)&&(L.x=U?J:y.x,L.y=K?R:y.y,y.x=L.x,y.y=L.y,C.length>0)){const ne=J-$,oe=R-j;for(const ae of C)ae.position={x:ae.position.x-ne+W[0]*(Y-z),y:ae.position.y-oe+W[1]*(Z-V)},P.push(ae)}if((D||F)&&(L.width=D&&(!s.resizeDirection||s.resizeDirection==="horizontal")?Y:y.width,L.height=F&&(!s.resizeDirection||s.resizeDirection==="vertical")?Z:y.height,y.width=L.width,y.height=L.height),S&&g.expandParent){const ne=W[0]*(L.width??0);L.x&&L.x<ne&&(y.x=ne,w.x=w.x-(L.x-ne));const oe=W[1]*(L.height??0);L.y&&L.y<oe&&(y.y=oe,w.y=w.y-(L.y-oe))}const G=Hf({width:y.width,prevWidth:z,height:y.height,prevHeight:V,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),q={...y,direction:G};x?.(T,q)!==!1&&(A=!0,m?.(T,q),o(L,P))}).on("end",T=>{A&&(v?.(T,{...y}),r?.({...y}),A=!1)});i.call(B)}function c(){i.on(".drag",null)}return{update:a,destroy:c}}var Tn={exports:{}},An={},Pn={exports:{}},Dn={};var lr;function Vf(){if(lr)return Dn;lr=1;var e=Gr();function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(f,d){var h=d(),m=o({inst:{value:h,getSnapshot:d}}),v=m[0].inst,x=m[1];return i(function(){v.value=h,v.getSnapshot=d,c(v)&&x({inst:v})},[f,h,d]),r(function(){return c(v)&&x({inst:v}),f(function(){c(v)&&x({inst:v})})},[f]),s(h),h}function c(f){var d=f.getSnapshot;f=f.value;try{var h=d();return!n(f,h)}catch{return!0}}function l(f,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return Dn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Dn}var ur;function Ff(){return ur||(ur=1,Pn.exports=Vf()),Pn.exports}var dr;function Yf(){if(dr)return An;dr=1;var e=Gr(),t=Ff();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;return An.useSyncExternalStoreWithSelector=function(l,u,f,d,h){var m=i(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function y(S){if(!w){if(w=!0,g=S,S=d(S),h!==void 0&&v.hasValue){var N=v.value;if(h(N,S))return b=N}return b=S}if(N=b,o(g,S))return N;var k=d(S);return h!==void 0&&h(N,k)?(g=S,N):(g=S,b=k)}var w=!1,g,b,C=f===void 0?null:f;return[function(){return y(u())},C===null?void 0:function(){return y(C())}]},[u,f,d,h]);var x=r(l,m[0],m[1]);return s(function(){v.hasValue=!0,v.value=x},[x]),c(x),x},An}var fr;function Xf(){return fr||(fr=1,Tn.exports=Yf()),Tn.exports}var Wf=Xf();const Zf=Ua(Wf),Gf={},hr=e=>{let t;const n=new Set,o=(u,f)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const h=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(m=>m(t,h))}},r=()=>t,c={setState:o,getState:r,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(Gf?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=t=e(o,r,c);return c},Uf=e=>e?hr(e):hr,{useDebugValue:qf}=qa,{useSyncExternalStoreWithSelector:Kf}=Zf,Qf=e=>e;function ns(e,t=Qf,n){const o=Kf(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return qf(o),o}const pr=(e,t)=>{const n=Uf(e),o=(r,i=t)=>ns(n,r,i);return Object.assign(o,n),o},Jf=(e,t)=>e?pr(e,t):pr;function ie(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const gn=E.createContext(null),eh=gn.Provider,os=ye.error001("react");function te(e,t){const n=E.useContext(gn);if(n===null)throw new Error(os);return ns(n,e,t)}function re(){const e=E.useContext(gn);if(e===null)throw new Error(os);return E.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const gr={display:"none"},th={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},rs="react-flow__node-desc",is="react-flow__edge-desc",nh="react-flow__aria-live",oh=e=>e.ariaLiveMessage,rh=e=>e.ariaLabelConfig;function ih({rfId:e}){const t=te(oh);return p.jsx("div",{id:`${nh}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:th,children:t})}function sh({rfId:e,disableKeyboardA11y:t}){const n=te(rh);return p.jsxs(p.Fragment,{children:[p.jsx("div",{id:`${rs}-${e}`,style:gr,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),p.jsx("div",{id:`${is}-${e}`,style:gr,children:n["edge.a11yDescription.default"]}),!t&&p.jsx(ih,{rfId:e})]})}const Ke=E.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return p.jsx("div",{className:se(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});Ke.displayName="Panel";const mr="https://reactflow.dev?utm_source=attribution";function ah({proOptions:e,position:t="bottom-right"}){return E.useEffect(()=>{},[]),e?.hideAttribution?null:p.jsx(Ke,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${mr}`,children:p.jsx("a",{href:mr,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const ch=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},Lt=e=>e.id;function lh(e,t){return ie(e.selectedNodes.map(Lt),t.selectedNodes.map(Lt))&&ie(e.selectedEdges.map(Lt),t.selectedEdges.map(Lt))}function uh({onSelectionChange:e}){const t=re(),{selectedNodes:n,selectedEdges:o}=te(ch,lh);return E.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const dh=e=>!!e.onSelectionChangeHandlers;function fh({onSelectionChange:e}){const t=te(dh);return e||t?p.jsx(uh,{onSelectionChange:e}):null}const ss=[0,0],hh={x:0,y:0,zoom:1},ph=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],yr=[...ph,"rfId"],gh=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),xr={translateExtent:bt,nodeOrigin:ss,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function mh(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:c}=te(gh,ie),l=re();E.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=xr,a()}),[]);const u=E.useRef(xr);return E.useEffect(()=>{for(const f of yr){const d=e[f],h=u.current[f];d!==h&&(typeof e[f]>"u"||(f==="nodes"?t(d):f==="edges"?n(d):f==="minZoom"?o(d):f==="maxZoom"?r(d):f==="translateExtent"?i(d):f==="nodeExtent"?s(d):f==="ariaLabelConfig"?l.setState({ariaLabelConfig:Jd(d)}):f==="fitView"?l.setState({fitViewQueued:d}):f==="fitViewOptions"?l.setState({fitViewOptions:d}):l.setState({[f]:d})))}u.current=e},yr.map(f=>e[f])),null}function wr(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function yh(e){const[t,n]=E.useState(e==="system"?null:e);return E.useEffect(()=>{if(e!=="system"){n(e);return}const o=wr(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:wr()?.matches?"dark":"light"}const vr=typeof document<"u"?document:null;function Et(e=null,t={target:vr,actInsideInputWithModifier:!0}){const[n,o]=E.useState(!1),r=E.useRef(!1),i=E.useRef(new Set([])),[s,a]=E.useMemo(()=>{if(e!==null){const l=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace(/\+/g,`
|
|
2
2
|
`).replace(`
|
|
3
3
|
|
|
4
4
|
`,`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,f as x}from"./index-
|
|
1
|
+
import{j as e,f as x}from"./index-CfGRmfFv.js";import{a as d,u,r as I}from"./App-BfpvLzSs.js";import{u as a}from"./promptBuilderStore-BMiudG9n.js";function y(t){return t?.filename??t?.url??t?.image??null}function C(t){const s=t.split(/[\\/]/).pop()??t;return s.length<=32?s:`${s.slice(0,14)}...${s.slice(-12)}`}function S(){const t=a(c=>c.scope),s=a(c=>c.clearImageScope),o=d(c=>c.currentImage),n=d(c=>c.history),{t:i}=u();if(t.kind==="draft")return e.jsx("span",{className:"prompt-builder__scope",children:i("promptBuilder.scopeDraft")});const p=y(o)===t.imageKey?o:n.find(c=>y(c)===t.imageKey)??null;if(!p)return e.jsx("span",{className:"prompt-builder__scope",children:i("promptBuilder.scopeDraft")});const h=i("promptBuilder.scopeImage",{name:C(t.imageKey)||i("promptBuilder.scopeImageFallback")});return e.jsxs("div",{className:"prompt-builder__scope-card",children:[e.jsx("img",{className:"prompt-builder__scope-thumb",src:p.thumb||p.url||p.image,alt:""}),e.jsx("span",{className:"prompt-builder__scope-name",children:h}),e.jsx("button",{type:"button",className:"prompt-builder__scope-remove",onClick:s,"aria-label":i("promptBuilder.removeScopeImage"),title:i("promptBuilder.removeScopeImage"),children:"×"})]})}function A(){const t=a(l=>l.model),s=a(l=>l.modelOptions),o=a(l=>l.backend),n=a(l=>l.updateConfig),{t:i}=u();return e.jsx(I,{className:"prompt-builder__model-picker",items:s.map(l=>({value:l,label:l==="auto"?i("promptBuilder.modelAuto"):l})),value:t,onChange:l=>{n(o,l)},ariaLabel:i("promptBuilder.model"),portal:!0})}const E={"Brief Intent Summary":"summary","Final Prompt - Korean":"ko","Final Prompt - English":"en",Notes:"notes"},T=/^(Brief Intent Summary|Final Prompt - Korean|Final Prompt - English|Notes):\s*(.*)$/gim;function K(t){const s=t.trim();return(s.match(/^```(?:[a-zA-Z0-9_-]+)?\s*([\s\S]*?)\s*```$/)?.[1]??s).trim()}function M(t){const s={},o=Array.from(t.matchAll(T));for(let n=0;n<o.length;n+=1){const i=o[n],l=i[1]??"",p=E[l];if(!p||typeof i.index!="number")continue;const h=i[2]?.trim()??"",c=i.index+i[0].length,m=o[n+1]?.index??t.length,f=K([h,t.slice(c,m)].filter(Boolean).join(`
|
|
2
2
|
`));f&&(s[p]=f)}return s}function $(t){const s=M(t),o=[];return s.ko&&o.push({language:"ko",heading:"Final Prompt - Korean",text:s.ko}),s.en&&o.push({language:"en",heading:"Final Prompt - English",text:s.en}),o.length===0?null:{summary:s.summary,prompts:o,notes:s.notes}}function F({messageId:t,prompt:s}){const o=d(m=>m.setPrompt),n=d(m=>m.insertPromptToComposer),i=d(m=>m.showToast),{t:l}=u(),p=s.language==="ko"?l("promptBuilder.finalKoreanPrompt"):l("promptBuilder.finalEnglishPrompt"),h=()=>{o(s.text),i(l("promptBuilder.applied"))},c=()=>{n({id:`builder_${t}_${s.language}`,name:p,text:s.text,placement:"after"}),i(l("promptBuilder.inserted"))};return e.jsxs("section",{className:"prompt-builder__structured-card","aria-label":p,children:[e.jsxs("div",{className:"prompt-builder__structured-card-header",children:[e.jsx("strong",{children:p}),e.jsx("span",{children:s.language.toUpperCase()})]}),e.jsx("p",{children:s.text}),e.jsxs("div",{className:"prompt-builder__structured-actions",children:[e.jsx("button",{type:"button",onClick:h,children:l("promptBuilder.applyToPrompt")}),e.jsx("button",{type:"button",onClick:c,children:l("promptBuilder.insertAsBlock")})]})]})}function D(t){return t.kind==="image"?"IMG":t.kind==="text"?"TXT":"FILE"}function R({message:t}){const{t:s}=u(),o=t.role==="assistant"?$(t.content):null;return e.jsxs("article",{className:`prompt-builder__message prompt-builder__message--${t.role}`,children:[e.jsx("div",{className:"prompt-builder__message-role",children:t.role==="user"?s("promptBuilder.user"):s("promptBuilder.assistant")}),o?e.jsxs("div",{className:"prompt-builder__structured-prompts",children:[o.summary?e.jsx("p",{className:"prompt-builder__structured-summary",children:o.summary}):null,o.prompts.map(n=>e.jsx(F,{messageId:t.id,prompt:n},`${t.id}-${n.language}`)),o.notes?e.jsx("p",{className:"prompt-builder__structured-notes",children:o.notes}):null]}):e.jsx("p",{children:t.content}),t.attachments&&t.attachments.length>0?e.jsx("div",{className:"prompt-builder__message-attachments",children:t.attachments.map(n=>e.jsxs("span",{className:"prompt-builder__message-attachment",children:[n.kind==="image"&&n.dataUrl?e.jsx("img",{src:n.dataUrl,alt:""}):e.jsx("span",{children:D(n)}),e.jsx("em",{children:n.name})]},n.id))}):null]})}function L(){const t=a(l=>l.messages),s=a(l=>l.loading),o=a(l=>l.error),n=x.useRef(null),{t:i}=u();return x.useEffect(()=>{const l=n.current;l&&(l.scrollTop=l.scrollHeight)},[t.length,s]),e.jsxs("div",{ref:n,className:"prompt-builder__messages",children:[t.length===0&&e.jsx("div",{className:"prompt-builder__empty",children:i("promptBuilder.empty")}),t.map(l=>e.jsx(R,{message:l},l.id)),s&&e.jsxs("div",{className:"prompt-builder__thinking",role:"status","aria-live":"polite",children:[e.jsxs("span",{className:"prompt-builder__thinking-dots","aria-hidden":"true",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]}),e.jsx("span",{children:i("promptBuilder.thinking")})]}),o?e.jsx("div",{className:"prompt-builder__empty prompt-builder__error",role:"alert",children:o}):null]})}function U(t){return t.kind==="image"?"IMG":t.kind==="text"?"TXT":"FILE"}function z(){const t=a(n=>n.attachments),s=a(n=>n.removeAttachment),{t:o}=u();return t.length===0?null:e.jsx("div",{className:"prompt-builder__attachments",children:t.map(n=>e.jsxs("span",{className:"prompt-builder__attachment",children:[n.kind==="image"&&n.dataUrl?e.jsx("img",{src:n.dataUrl,alt:""}):e.jsx("span",{children:U(n)}),e.jsx("em",{children:n.name}),e.jsx("button",{type:"button",onClick:()=>s(n.id),"aria-label":o("promptBuilder.removeAttachment",{name:n.name}),title:o("promptBuilder.removeAttachment",{name:n.name}),children:"×"})]},n.id))})}function O(){const t=a(r=>r.draft),s=a(r=>r.setDraft),o=a(r=>r.loading),n=a(r=>r.configLoaded),i=a(r=>r.addAttachments),l=a(r=>r.sendMessage),p=a(r=>r.messages),h=a(r=>r.clearMessages),c=a(r=>r.attachments),m=d(r=>r.prompt),f=d(r=>r.insertedPrompts),N=d(r=>r.quality),k=d(r=>r.getResolvedSize),v=d(r=>r.currentImage),b=x.useRef(null),{t:g}=u(),_=()=>{!t.trim()&&c.length===0||o||!n||l({currentPrompt:m,insertedPrompts:f.map(r=>({name:r.name,text:r.text})),settings:{quality:N,size:k()},currentResultPrompt:v?.prompt??null})},j=r=>{r.length!==0&&i(r)},P=r=>{const B=Array.from(r.clipboardData?.files??[]);B.length!==0&&(r.preventDefault(),j(B))};return e.jsxs("div",{className:"prompt-builder__composer",children:[e.jsx(z,{}),e.jsx("textarea",{value:t,placeholder:g("promptBuilder.placeholder"),onChange:r=>s(r.target.value),onPaste:P,onKeyDown:r=>{r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),_())}}),e.jsx("input",{ref:b,type:"file",multiple:!0,hidden:!0,onChange:r=>{j(Array.from(r.target.files??[])),r.target.value=""}}),e.jsxs("div",{className:"prompt-builder__composer-actions",children:[e.jsx("button",{type:"button",className:"prompt-builder__attach",onClick:()=>b.current?.click(),disabled:o,"aria-label":g("promptBuilder.attach"),title:g("promptBuilder.attach"),children:"+"}),e.jsx("button",{type:"button",className:"prompt-builder__clear",onClick:h,disabled:p.length===0||o,children:g("promptBuilder.clear")}),e.jsx("button",{type:"button",className:"prompt-builder__send",onClick:_,disabled:!t.trim()&&c.length===0||o||!n,children:g(o?"promptBuilder.sending":"promptBuilder.send")})]})]})}function H({variant:t="panel"}){const{t:s}=u(),o=a(i=>i.lastBackend),n=a(i=>i.loadConfig);return x.useEffect(()=>{n()},[n]),e.jsxs("section",{className:`prompt-builder prompt-builder--${t}`,"aria-label":s("promptBuilder.title"),children:[e.jsxs("div",{className:"prompt-builder__header",children:[e.jsxs("div",{children:[e.jsx("span",{className:"section-title",children:s("promptBuilder.title")}),e.jsx(S,{}),o?e.jsx("span",{className:"prompt-builder__scope prompt-builder__backend-badge",children:s("promptBuilder.viaBackend",{backend:s(`promptBuilder.backends.${o==="grok-api"?"grokApi":o}`)})}):null]}),e.jsx("div",{className:"prompt-builder__header-actions",children:e.jsx(A,{})})]}),e.jsx(L,{}),e.jsx(O,{})]})}export{H as PromptBuilderPanel};
|