iobroker.eos-admin 9.0.19 → 9.0.21
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/NEXOWATT_EOS_BUILD_INFO.json +4 -4
- package/README.md +7 -3
- package/START_HIER_9.0.20.md +65 -0
- package/adminWww/.vite/manifest.json +39 -39
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +110 -109
- package/adminWww/assets/{AdapterUpdateDialog-JOf2z4Vg.js → AdapterUpdateDialog-Dxl_b7Op.js} +1 -1
- package/adminWww/assets/{Adapters-C9fcSdWm.js → Adapters-CVKKhXmI.js} +1 -1
- package/adminWww/assets/{ConfigManager-BeeLlT6D.js → ConfigManager-Bf6nTAkL.js} +1 -1
- package/adminWww/assets/{Enums-FqnXWl8U.js → Enums-CJHVJY7t.js} +1 -1
- package/adminWww/assets/{Fields-DMgrt5Pi.js → Fields-DWHbZKvm.js} +1 -1
- package/adminWww/assets/{Files-CIHtt12g.js → Files-a6owMTXA.js} +1 -1
- package/adminWww/assets/{Hosts-fPLBzvTy.js → Hosts-LtEMeXpV.js} +1 -1
- package/adminWww/assets/{Instances-4XaVQlrT.js → Instances-DhChziA1.js} +1 -1
- package/adminWww/assets/{Intro-5TKriiLO.js → Intro-Cyq9gVDC.js} +1 -1
- package/adminWww/assets/{Logs-33zcIds-.js → Logs-wcramXsg.js} +1 -1
- package/adminWww/assets/{Objects-CNQPVbNG.js → Objects-DINVHd_e.js} +1 -1
- package/adminWww/assets/{Overview-BskXGOc8.js → Overview-DK4R41zR.js} +1 -1
- package/adminWww/assets/{State-C8SJ_Iqo.js → State-DcEACXzL.js} +1 -1
- package/adminWww/assets/{UsedResources-CgqRa9ei.js → UsedResources-C1LcM0Rb.js} +1 -1
- package/adminWww/assets/{Users-0JVYWR9u.js → Users-DvDdSyDY.js} +1 -1
- package/adminWww/assets/{bootstrap-D16lu6rd.js → bootstrap-Dbj_GbnP.js} +3 -3
- package/adminWww/assets/{hostInit-C8YZJuzi.js → hostInit-BNFIx0-f.js} +1 -1
- package/adminWww/assets/icons/nexowatt-180.png +0 -0
- package/adminWww/assets/{icons-material-CiNJ_6Ur.js → icons-material-DVbdXNgr.js} +1 -1
- package/adminWww/assets/{index-DA9Sphgh.js → index-CoKP1NSA.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-DPdkRa_d.js → installSVGRenderer-CMvku1F1.js} +1 -1
- package/adminWww/assets/{mf-entry-bootstrap-0-a7ab91de.js → mf-entry-bootstrap-0-ac330bce.js} +2 -2
- package/adminWww/index.html +24 -24
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/mf-stats.json +1 -1
- package/adminWww/{remoteEntry-eos-9.0.19.js → remoteEntry-eos-9.0.21.js} +1 -1
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/eosCustomerUpdateHttp.js +203 -0
- package/build/lib/eosCustomerUpdateHttp.js.map +1 -0
- package/build/lib/eosCustomerUpdateTransport.js +472 -0
- package/build/lib/eosCustomerUpdateTransport.js.map +1 -0
- package/build/lib/eosCustomerUpdateWorker.js +567 -0
- package/build/lib/eosCustomerUpdateWorker.js.map +1 -0
- package/build/lib/eosCustomerUpdates.js +631 -0
- package/build/lib/eosCustomerUpdates.js.map +1 -0
- package/build/lib/eosDeviceEmsPlan.js +18 -5
- package/build/lib/eosDeviceEmsPlan.js.map +1 -1
- package/build/lib/eosDeviceEmsService.js +52 -2
- package/build/lib/eosDeviceEmsService.js.map +1 -1
- package/build/lib/eosLegacyMigration.js +26 -1
- package/build/lib/eosLegacyMigration.js.map +1 -1
- package/build/lib/eosModuleConfigStore.js +12 -1
- package/build/lib/eosModuleConfigStore.js.map +1 -1
- package/build/lib/eosModuleHost.js +81 -26
- package/build/lib/eosModuleHost.js.map +1 -1
- package/build/lib/eosModuleHttp.js +8 -2
- package/build/lib/eosModuleHttp.js.map +1 -1
- package/build/lib/eosStateSubscriptions.js +59 -2
- package/build/lib/eosStateSubscriptions.js.map +1 -1
- package/build/lib/eosUpdateSnapshot.js +290 -0
- package/build/lib/eosUpdateSnapshot.js.map +1 -0
- package/build/lib/eosUploadGuard.js +124 -81
- package/build/lib/eosUploadGuard.js.map +1 -1
- package/build/lib/web.js +83 -0
- package/build/lib/web.js.map +1 -1
- package/docs/reports/unified-9.0.20/ANFORDERUNGEN_UND_INBETRIEBNAHME.md +159 -0
- package/docs/reports/unified-9.0.20/DEVICE_COMMAND_DELIVERY_REVIEW.md +82 -0
- package/docs/reports/unified-9.0.20/DEVICE_LIFECYCLE_REVIEW.md +46 -0
- package/docs/reports/unified-9.0.20/DEVICE_PLAN_REVIEW.md +33 -0
- package/docs/reports/unified-9.0.20/DEVICE_POWER_CAPABILITY_REVIEW.md +25 -0
- package/docs/reports/unified-9.0.20/FARM_CONTROLLER_REVIEW.md +27 -0
- package/docs/reports/unified-9.0.20/FARM_DIAGNOSE_UI.md +81 -0
- package/docs/reports/unified-9.0.20/FARM_DISPATCH_REVIEW.md +47 -0
- package/docs/reports/unified-9.0.20/HISTORY_REVIEW.md +68 -0
- package/docs/reports/unified-9.0.20/INFLUXDB2_INSTALLER_UI.md +39 -0
- package/docs/reports/unified-9.0.20/INFLUX_CREDENTIAL_NETWORK_REVIEW.md +38 -0
- package/docs/reports/unified-9.0.20/INFLUX_DIRECT_UNABHAENGIGE_PRUEFUNG.md +64 -0
- package/docs/reports/unified-9.0.20/INFLUX_RUNTIME_INTEGRATION_REVIEW.md +53 -0
- package/docs/reports/unified-9.0.20/INFLUX_RUNTIME_UNABHAENGIGE_PRUEFUNG.md +34 -0
- package/docs/reports/unified-9.0.20/INFLUX_TRANSPORT_ABSCHLUSSPRUEFUNG.md +55 -0
- package/docs/reports/unified-9.0.20/LOGIN_WEBAPP_LOGO.md +29 -0
- package/docs/reports/unified-9.0.20/MIGRATION_REVIEW.md +35 -0
- package/docs/reports/unified-9.0.20/PRUEFBERICHT.md +54 -0
- package/docs/reports/unified-9.0.20/PWA_ANONYMOUS_HTTPS_REVIEW.md +28 -0
- package/docs/reports/unified-9.0.20/PWA_ICON_UNABHAENGIGE_PRUEFUNG.md +60 -0
- package/docs/reports/unified-9.0.20/SERIAL_LIFECYCLE_REVIEW.md +37 -0
- package/docs/reports/unified-9.0.20/SOLAX_READBACK_REVIEW.md +43 -0
- package/docs/reports/unified-9.0.20/SOLAX_READBACK_UNABHAENGIGE_PRUEFUNG.md +34 -0
- package/docs/reports/unified-9.0.20/STATIC_REVIEW_DE.md +175 -0
- package/docs/reports/unified-9.0.20/STORAGE_COMMAND_ACK_REVIEW.md +36 -0
- package/docs/reports/unified-9.0.20/TARIFF_REPORT_REVIEW.md +29 -0
- package/docs/reports/unified-9.0.20/VISUALISIERUNG.md +64 -0
- package/docs/reports/unified-9.0.20/history-setup-navigation-proxy.txt +26 -0
- package/docs/reports/unified-9.0.20/history-setup-navigation-ssr.txt +7 -0
- package/docs/reports/unified-9.0.20/history-setup-ui-lint.txt +0 -0
- package/docs/reports/unified-9.0.20/history-setup-ui-node22.txt +102 -0
- package/docs/reports/unified-9.0.20/history-setup-ui-node24.txt +23 -0
- package/docs/reports/unified-9.0.20/history-setup-ui-security.txt +0 -0
- package/docs/reports/unified-9.0.20/history-setup-ui-typecheck.txt +0 -0
- package/docs/reports/unified-9.0.20/login-pwa-branding-hashes.txt +9 -0
- package/docs/reports/unified-9.0.20/login-pwa-branding-node22.txt +42 -0
- package/docs/reports/unified-9.0.20/login-pwa-branding-node24.txt +13 -0
- package/docs/reports/unified-9.0.20/raw/INDEX.json +1913 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/baseline-node22.log +16 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/baseline-node24.log +14 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/lint-after.json +1 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/lint-before.json +1 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/modbus-stop-backoff.cjs +22 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-control-review.log +29 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-modbus-final.json +18 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-modbus-final.log +325 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/node22-modbus-review.log +278 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/node24-modbus-final.json +18 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/node24-modbus-final.log +58 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/device/node24-modbus-review.log +51 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/api-gaps-before.log +64 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/api-negative-before.log +46 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/chart-gaps-before.log +127 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-after.log +67 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-before.log +61 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-eslint-js.log +0 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-eslint-ts.log +0 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-node22.log +442 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/device-command-subscriptions-node24.log +78 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/fix.py +73 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-eslint-final.json +7 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-final-node22.log +279 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-final-node24.log +52 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-followup-node22.log +223 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-followup-node24.log +43 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/history-own-cache.log +17 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/negative-pricing-before.log +96 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/node22-after.log +66 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/node22-repro.log +8 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/node24-after.log +17 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/node24-repro.log +8 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/history/repro.cjs +39 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/chromium-probe.log +3 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/patch-live.py +101 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/repro-live-display.cjs +26 -0
- package/docs/reports/unified-9.0.20/raw/additional-audit/visuals/repro-live-display.log +36 -0
- package/docs/reports/unified-9.0.20/raw/audit-full.log +345 -0
- package/docs/reports/unified-9.0.20/raw/audit-full.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/audit-runtime.log +23 -0
- package/docs/reports/unified-9.0.20/raw/audit-runtime.result.json +15 -0
- package/docs/reports/unified-9.0.20/raw/backend-final.log +5 -0
- package/docs/reports/unified-9.0.20/raw/backend-final.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node22.result.json +20 -0
- package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node22.tap +721 -0
- package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node24.result.json +20 -0
- package/docs/reports/unified-9.0.20/raw/baseline-919-coverage-tests-node24.tap +127 -0
- package/docs/reports/unified-9.0.20/raw/commissioning-evidence.json +69 -0
- package/docs/reports/unified-9.0.20/raw/commissioning-failed-init-drain-919-before.log +14 -0
- package/docs/reports/unified-9.0.20/raw/commissioning-final-node22.log +882 -0
- package/docs/reports/unified-9.0.20/raw/commissioning-final-node24.log +149 -0
- package/docs/reports/unified-9.0.20/raw/commissioning-lint.log +0 -0
- package/docs/reports/unified-9.0.20/raw/commissioning-planner-919-before.log +70 -0
- package/docs/reports/unified-9.0.20/raw/commissioning-retained-readiness-before.log +34 -0
- package/docs/reports/unified-9.0.20/raw/commissioning-runtime-retry-919-before.log +46 -0
- package/docs/reports/unified-9.0.20/raw/commissioning-types-node24.log +0 -0
- package/docs/reports/unified-9.0.20/raw/device-farm-protocol/DEVICE_FARM_READONLY_REVIEW.md +66 -0
- package/docs/reports/unified-9.0.20/raw/device-farm-protocol/run-readback-tests.cjs +13 -0
- package/docs/reports/unified-9.0.20/raw/device-farm-protocol/solax-control-chain.test.cjs +58 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-baseline-node22.log +16 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-baseline-node24.log +14 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-evidence.json +55 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-lint-after.json +1 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-lint-before.json +1 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-modbus-stop-backoff.cjs +22 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-control-review.log +29 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-modbus-final.json +18 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-modbus-final.log +325 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-node22-modbus-review.log +278 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-node24-modbus-final.json +18 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-node24-modbus-final.log +58 -0
- package/docs/reports/unified-9.0.20/raw/device-lifecycle-node24-modbus-review.log +51 -0
- package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node22.log +0 -0
- package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node22.result.json +15 -0
- package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node24.log +0 -0
- package/docs/reports/unified-9.0.20/raw/devices-hosted-typecheck-node24.result.json +15 -0
- package/docs/reports/unified-9.0.20/raw/farm-controller/controller-node22.log +110 -0
- package/docs/reports/unified-9.0.20/raw/farm-controller/controller-node24.log +24 -0
- package/docs/reports/unified-9.0.20/raw/farm-controller/evidence.json +33 -0
- package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-lint.txt +0 -0
- package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-node22.txt +113 -0
- package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-node24.txt +26 -0
- package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-security.txt +0 -0
- package/docs/reports/unified-9.0.20/raw/farm-diagnostics-ui-typecheck.txt +0 -0
- package/docs/reports/unified-9.0.20/raw/farm-dispatch/allocator-baseline.jsonl +6 -0
- package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-before.log +138 -0
- package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-main-delta.patch +77 -0
- package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-main-lint.json +7 -0
- package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node22.log +64 -0
- package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node22.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node24.log +18 -0
- package/docs/reports/unified-9.0.20/raw/farm-dispatch/diagnostics-node24.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/final-ui-independent-review.json +194 -0
- package/docs/reports/unified-9.0.20/raw/frontend-build.log +152 -0
- package/docs/reports/unified-9.0.20/raw/frontend-build.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node22.json +35 -0
- package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node22.result.json +17 -0
- package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node24.json +31 -0
- package/docs/reports/unified-9.0.20/raw/independent-influx/parser-after-node24.result.json +17 -0
- package/docs/reports/unified-9.0.20/raw/independent-influx/parser-before.json +31 -0
- package/docs/reports/unified-9.0.20/raw/independent-influx/parser-reproducer.cjs +9 -0
- package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node22.result.json +18 -0
- package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node22.tap +34 -0
- package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node24.result.json +18 -0
- package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra-node24.tap +11 -0
- package/docs/reports/unified-9.0.20/raw/independent-influx/transport-extra.test.cjs +9 -0
- package/docs/reports/unified-9.0.20/raw/independent-solax/node22-focused.log +165 -0
- package/docs/reports/unified-9.0.20/raw/independent-solax/node24-focused.log +35 -0
- package/docs/reports/unified-9.0.20/raw/independent-solax/review-receipt.json +57 -0
- package/docs/reports/unified-9.0.20/raw/independent-solax/split-response-after.log +1 -0
- package/docs/reports/unified-9.0.20/raw/independent-solax/split-response-before.log +1 -0
- package/docs/reports/unified-9.0.20/raw/independent-solax/split-response.cjs +16 -0
- package/docs/reports/unified-9.0.20/raw/independent-solax/stop-race-generation-guard.log +1 -0
- package/docs/reports/unified-9.0.20/raw/independent-solax/stop-race.cjs +13 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct/eslint.log +0 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct/node22.log +112 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct/node24.log +24 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct/typecheck.log +0 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct-review/hosted-module-history.test.cjs +85 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node22.json +12 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node22.log +100 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node24.json +12 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct-review/independent-node24.log +21 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct-review/runtime-after.test.cjs +15 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct-review/runtime-loss-before.test.cjs +9 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct-review/security-scan.cjs +15 -0
- package/docs/reports/unified-9.0.20/raw/influx-direct-review/transport-extra.test.cjs +9 -0
- package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node22.log +227 -0
- package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node22.result.json +11 -0
- package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node24.log +44 -0
- package/docs/reports/unified-9.0.20/raw/influx-independent/legacy-history-node24.result.json +11 -0
- package/docs/reports/unified-9.0.20/raw/influx-independent/node22.log +112 -0
- package/docs/reports/unified-9.0.20/raw/influx-independent/node22.result.json +12 -0
- package/docs/reports/unified-9.0.20/raw/influx-independent/node24.log +23 -0
- package/docs/reports/unified-9.0.20/raw/influx-independent/node24.result.json +12 -0
- package/docs/reports/unified-9.0.20/raw/influx-independent/runtime-after.test.cjs +15 -0
- package/docs/reports/unified-9.0.20/raw/influx-independent/transport-extra.test.cjs +9 -0
- package/docs/reports/unified-9.0.20/raw/influx-runtime/evidence.json +24 -0
- package/docs/reports/unified-9.0.20/raw/influx-runtime/final-node22.log +326 -0
- package/docs/reports/unified-9.0.20/raw/influx-runtime/final-node24.log +59 -0
- package/docs/reports/unified-9.0.20/raw/influx-runtime/runtime-node22.log +62 -0
- package/docs/reports/unified-9.0.20/raw/influx-runtime/runtime-node24.log +16 -0
- package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-lint.log +0 -0
- package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-lint.result.json +17 -0
- package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node22.log +112 -0
- package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node22.result.json +15 -0
- package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node24.log +106 -0
- package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-node24.result.json +15 -0
- package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-typecheck.log +0 -0
- package/docs/reports/unified-9.0.20/raw/influx-security/security-influx-typecheck.result.json +15 -0
- package/docs/reports/unified-9.0.20/raw/influx-security/source-sha256.json +5 -0
- package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-lint-final.log +0 -0
- package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-lint-final.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node22-final.log +124 -0
- package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node22-final.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node24-final.log +26 -0
- package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-node24-final.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node22-final.log +0 -0
- package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node22-final.result.json +15 -0
- package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node24-final.log +0 -0
- package/docs/reports/unified-9.0.20/raw/influx-transport-final/influx-transport-type-node24-final.result.json +15 -0
- package/docs/reports/unified-9.0.20/raw/influx-ui-independent-review-final.json +285 -0
- package/docs/reports/unified-9.0.20/raw/influx-ui-independent-review-intermediate.json +285 -0
- package/docs/reports/unified-9.0.20/raw/installer-build.log +26 -0
- package/docs/reports/unified-9.0.20/raw/installer-build.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/isolation/INDEX.json +332 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-final.log +3 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-final.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-hosted.log +6 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-hosted.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-verified.log +1 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family-verified.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family.log +11 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-family.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-final.log +3 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-final.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-hosted.log +3 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-hosted.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-verified.log +1 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid-verified.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid.log +11 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-fenecon-hybrid.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node22.log +296 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node22.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node24.log +56 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-final-node24.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-node24.log +54 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-node24.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-output-modes.log +1 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-output-modes.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node22.log +332 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node22.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node24.log +62 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-final-node24.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node22.log +342 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node22.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node24.log +72 -0
- package/docs/reports/unified-9.0.20/raw/isolation/command-ack-release-node24.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/isolation/isolation-node22.log +482 -0
- package/docs/reports/unified-9.0.20/raw/isolation/isolation-node22.result.json +19 -0
- package/docs/reports/unified-9.0.20/raw/isolation/isolation-node24.log +87 -0
- package/docs/reports/unified-9.0.20/raw/isolation/migration-lint.log +0 -0
- package/docs/reports/unified-9.0.20/raw/isolation/migration-lint.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/isolation/migration-node22.log +330 -0
- package/docs/reports/unified-9.0.20/raw/isolation/migration-node22.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/isolation/migration-node24-before.log +72 -0
- package/docs/reports/unified-9.0.20/raw/isolation/migration-node24-before.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/isolation/migration-node24.log +60 -0
- package/docs/reports/unified-9.0.20/raw/isolation/migration-node24.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/isolation/repro-migration-start-budget.cjs +49 -0
- package/docs/reports/unified-9.0.20/raw/isolation/repro-serial-release.cjs +21 -0
- package/docs/reports/unified-9.0.20/raw/isolation/repro-sunspec-discovery.cjs +11 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-before-repro.log +1 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-before-repro.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node22.log +32 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node22.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node24.log +11 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-gates-node24.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck-final.log +0 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck-final.result.json +28 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck.log +2 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-helper-typecheck.result.json +26 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-lint.log +0 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-lint.result.json +18 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-node22.log +344 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-node22.result.json +17 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-node24.log +62 -0
- package/docs/reports/unified-9.0.20/raw/isolation/serial-node24.result.json +17 -0
- package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-after.log +3 -0
- package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-after.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-before.log +3 -0
- package/docs/reports/unified-9.0.20/raw/isolation/sunspec-review-before.result.json +15 -0
- package/docs/reports/unified-9.0.20/raw/keygen-source.json +6 -0
- package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/check-919.log +70 -0
- package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/check-920.log +71 -0
- package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/diff.json +82 -0
- package/docs/reports/unified-9.0.20/raw/legacy-mirror-debt/receipt.json +48 -0
- package/docs/reports/unified-9.0.20/raw/lint-final.log +16 -0
- package/docs/reports/unified-9.0.20/raw/lint-final.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/main-individual-review-before-cache-boundary-fix.json +112 -0
- package/docs/reports/unified-9.0.20/raw/main-individual-review-before-capability-ack.json +103 -0
- package/docs/reports/unified-9.0.20/raw/main-individual-review-before-farm-diagnostics.json +102 -0
- package/docs/reports/unified-9.0.20/raw/main-individual-review-final.json +103 -0
- package/docs/reports/unified-9.0.20/raw/main-individual-review.json +93 -0
- package/docs/reports/unified-9.0.20/raw/modules-build.log +5 -0
- package/docs/reports/unified-9.0.20/raw/modules-build.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/node22-tests-final.log +12471 -0
- package/docs/reports/unified-9.0.20/raw/node22-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/node22-typecheck-final.log +7 -0
- package/docs/reports/unified-9.0.20/raw/node22-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.20/raw/node24-tests-final.log +2093 -0
- package/docs/reports/unified-9.0.20/raw/node24-tests-final.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/node24-typecheck-final.log +5 -0
- package/docs/reports/unified-9.0.20/raw/node24-typecheck-final.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.20/raw/power-capability/evidence.json +69 -0
- package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-existing-regressions-node24.log +94 -0
- package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-lint.log +0 -0
- package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-node22.log +304 -0
- package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-node24.log +56 -0
- package/docs/reports/unified-9.0.20/raw/power-capability/power-capability-typecheck.log +0 -0
- package/docs/reports/unified-9.0.20/raw/pwa-https/evidence.json +45 -0
- package/docs/reports/unified-9.0.20/raw/pwa-https/node22-build.log +21 -0
- package/docs/reports/unified-9.0.20/raw/pwa-https/node22-source.log +23 -0
- package/docs/reports/unified-9.0.20/raw/pwa-https/node24-build.log +11 -0
- package/docs/reports/unified-9.0.20/raw/pwa-https/node24-source.log +11 -0
- package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-boundaries.test.cjs +45 -0
- package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-receipt.json +71 -0
- package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-v22.23.4.tap +34 -0
- package/docs/reports/unified-9.0.20/raw/pwa-independent/policy-v24.22.3.tap +11 -0
- package/docs/reports/unified-9.0.20/raw/pwa-ui-independent-review-final.json +348 -0
- package/docs/reports/unified-9.0.20/raw/repro-failed-init-drain-before.cjs +15 -0
- package/docs/reports/unified-9.0.20/raw/repro-profile-replacement-after-unmapped.cjs +15 -0
- package/docs/reports/unified-9.0.20/raw/repro-runtime-retry-before.cjs +18 -0
- package/docs/reports/unified-9.0.20/raw/sbom-runtime.log +7 -0
- package/docs/reports/unified-9.0.20/raw/sbom-runtime.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/sbom-vendor-check.log +1 -0
- package/docs/reports/unified-9.0.20/raw/sbom-vendor-check.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/solax-readback-node22.json +30 -0
- package/docs/reports/unified-9.0.20/raw/solax-readback-node22.log +542 -0
- package/docs/reports/unified-9.0.20/raw/solax-readback-node24.json +30 -0
- package/docs/reports/unified-9.0.20/raw/solax-readback-node24.log +97 -0
- package/docs/reports/unified-9.0.20/raw/tariff-report-before.log +147 -0
- package/docs/reports/unified-9.0.20/raw/tariff-report-evidence.json +48 -0
- package/docs/reports/unified-9.0.20/raw/tariff-report-final-node22.log +151 -0
- package/docs/reports/unified-9.0.20/raw/tariff-report-final-node24.log +32 -0
- package/docs/reports/unified-9.0.20/raw/ui-docs-check.log +6 -0
- package/docs/reports/unified-9.0.20/raw/ui-docs-check.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/ui-runtime-final.log +7 -0
- package/docs/reports/unified-9.0.20/raw/ui-runtime-final.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/ui-runtime-sync.log +6 -0
- package/docs/reports/unified-9.0.20/raw/ui-runtime-sync.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/ui-sbom-check.log +6 -0
- package/docs/reports/unified-9.0.20/raw/ui-sbom-check.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/ui-sbom-final.log +6 -0
- package/docs/reports/unified-9.0.20/raw/ui-sbom-final.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/ui-secret-final.log +6 -0
- package/docs/reports/unified-9.0.20/raw/ui-secret-final.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/ui-security-final.log +8 -0
- package/docs/reports/unified-9.0.20/raw/ui-security-final.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/visuals-baseline-919.txt +36 -0
- package/docs/reports/unified-9.0.20/raw/visuals-browser-limit.txt +3 -0
- package/docs/reports/unified-9.0.20/raw/visuals-lint.txt +0 -0
- package/docs/reports/unified-9.0.20/raw/visuals-node22.txt +258 -0
- package/docs/reports/unified-9.0.20/raw/visuals-node24.txt +51 -0
- package/docs/reports/unified-9.0.20/raw/visuals-security.txt +0 -0
- package/docs/reports/unified-9.0.20/raw/visuals-typecheck.txt +0 -0
- package/docs/reports/unified-9.0.20/raw/wallet-freshness-after.log +19 -0
- package/docs/reports/unified-9.0.20/raw/wallet-freshness-after.result.json +16 -0
- package/docs/reports/unified-9.0.20/raw/wallet-freshness-before.log +31 -0
- package/docs/reports/unified-9.0.20/raw/wallet-freshness-before.result.json +14 -0
- package/docs/reports/unified-9.0.20/raw/wallet-freshness-independent.result.json +13 -0
- package/docs/reports/unified-9.0.20/raw/wallet-freshness-independent.tap +10 -0
- package/io-package.json +12 -12
- package/modules/backup/admin/index.js +4 -1
- package/modules/devices/admin/host-bridge.js +5 -1
- package/modules/devices/lib/device-alias-semantics-v1.json +22 -1
- package/modules/devices/lib/deviceAliasFreshness.js +1 -0
- package/modules/devices/lib/deviceAliasSemantics.js +13 -3
- package/modules/devices/lib/deviceRuntime.js +106 -12
- package/modules/devices/lib/drivers/modbus.js +90 -21
- package/modules/devices/lib/drivers/modbusAsciiBus.js +47 -31
- package/modules/devices/lib/drivers/modbusRtuBus.js +33 -9
- package/modules/devices/lib/drivers/modbusSerialLease.js +29 -0
- package/modules/devices/lib/drivers/mqtt.js +204 -82
- package/modules/devices/lib/drivers/mqttPendingOperations.js +119 -0
- package/modules/devices/lib/modbusReadEvidence.js +29 -0
- package/modules/devices/test/deviceAliasFreshness.test.js +7 -2
- package/modules/devices/test/modbusConnectLifecycle.test.js +148 -0
- package/modules/devices/test/modbusSerialLifecycle.test.js +91 -0
- package/modules/devices/test/mqttCommandLifecycle.test.js +255 -0
- package/modules/devices/test/mqttResourceBounds.test.js +98 -0
- package/modules/devices/test/mqttRuntimeSession.test.js +109 -0
- package/modules/devices/test/serialOperationGate.test.js +3 -3
- package/modules/devices/test/solaxReadbackContext.test.js +472 -0
- package/modules/devices/tsconfig.alias-semantics.json +1 -1
- package/modules/devices/tsconfig.mqtt-lifecycle.json +20 -0
- package/modules/devices/tsconfig.serial-lifecycle.json +18 -0
- package/modules/eebus/admin/index.js +6 -3
- package/package.json +9 -7
- package/release-manifests/unified/build-environment.cdx.json +6 -6
- package/release-manifests/unified/files.json +848 -169
- package/release-manifests/unified/frontend.cdx.json +6 -6
- package/release-manifests/unified/installer.cdx.json +6 -6
- package/release-manifests/unified/obsolete-admin-assets.json +154 -6
- package/release-manifests/unified/runtime.cdx.json +25 -25
- package/release-manifests/unified/validation.json +15 -15
- package/tools/eos-release-check.cjs +2 -2
- package/tools/eos-release-manifest.cjs +3 -3
- package/ui/admin/react/assets/index-BJO3q7oe.js +13 -0
- package/ui/admin/react/assets/{index-CuquHlsY.css → index-ofLP_Y7y.css} +1 -1
- package/ui/admin/react/index.html +2 -2
- package/ui/docs/security/eslint-reviewed-findings.json +91 -35
- package/ui/ems/engine.js +14 -3
- package/ui/ems/modules/energy-wallet.js +9 -3
- package/ui/ems/modules/storage-control.js +60 -19
- package/ui/ems/modules/tariff-provider.js +34 -10
- package/ui/ems/services/tariff-provider-registry.js +18 -8
- package/ui/io-package.json +1 -1
- package/ui/lib/influx-config.js +204 -0
- package/ui/lib/influx-direct.js +527 -0
- package/ui/lib/influx-history-runtime.js +326 -0
- package/ui/lib/influx-network-policy.js +112 -0
- package/ui/lib/ui-access-policy.js +2 -2
- package/ui/main.js +614 -255
- package/ui/package.json +12 -6
- package/ui/www/app.js +152 -203
- package/ui/www/ems-apps.html +2 -1
- package/ui/www/ems-apps.js +8 -1
- package/ui/www/energy-ledger.html +1 -1
- package/ui/www/eos-updates.css +15 -0
- package/ui/www/eos-updates.js +351 -0
- package/ui/www/evcs.html +1 -1
- package/ui/www/history.html +1 -1
- package/ui/www/history.js +114 -74
- package/ui/www/index.html +4 -1
- package/ui/www/live-display.js +115 -0
- package/ui/www/logic.html +1 -1
- package/ui/www/login.css +1 -0
- package/ui/www/login.html +2 -1
- package/ui/www/manifest.webmanifest +3 -3
- package/ui/www/settings.html +36 -1
- package/ui/www/simulation.html +1 -1
- package/ui/www/smarthome-config.html +1 -1
- package/ui/www/smarthome.html +1 -1
- package/ui/www/storagefarm-dispatch.js +287 -0
- package/ui/www/storagefarm-summary.css +15 -0
- package/ui/www/storagefarm.html +15 -1
- package/ui/www/storagefarm.js +8 -26
- package/ui/www/tariff-report.js +43 -25
- package/ui/admin/react/assets/index-Bq5IupDw.js +0 -13
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))d(c);new MutationObserver(c=>{for(const h of c)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&d(m)}).observe(document,{childList:!0,subtree:!0});function o(c){const h={};return c.integrity&&(h.integrity=c.integrity),c.referrerPolicy&&(h.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?h.credentials="include":c.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function d(c){if(c.ep)return;c.ep=!0;const h=o(c);fetch(c.href,h)}})();function Pf(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var uo={exports:{}},Ai={},co={exports:{}},Ee={};var $d;function um(){if($d)return Ee;$d=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),m=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),j=Symbol.iterator;function E(b){return b===null||typeof b!="object"?null:(b=j&&b[j]||b["@@iterator"],typeof b=="function"?b:null)}var W={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,_={};function N(b,D,pe){this.props=b,this.context=D,this.refs=_,this.updater=pe||W}N.prototype.isReactComponent={},N.prototype.setState=function(b,D){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,D,"setState")},N.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function $(){}$.prototype=N.prototype;function U(b,D,pe){this.props=b,this.context=D,this.refs=_,this.updater=pe||W}var O=U.prototype=new $;O.constructor=U,R(O,N.prototype),O.isPureReactComponent=!0;var ue=Array.isArray,le=Object.prototype.hasOwnProperty,ke={current:null},be={key:!0,ref:!0,__self:!0,__source:!0};function re(b,D,pe){var xe,V={},ee=null,me=null;if(D!=null)for(xe in D.ref!==void 0&&(me=D.ref),D.key!==void 0&&(ee=""+D.key),D)le.call(D,xe)&&!be.hasOwnProperty(xe)&&(V[xe]=D[xe]);var ae=arguments.length-2;if(ae===1)V.children=pe;else if(1<ae){for(var ge=Array(ae),Ve=0;Ve<ae;Ve++)ge[Ve]=arguments[Ve+2];V.children=ge}if(b&&b.defaultProps)for(xe in ae=b.defaultProps,ae)V[xe]===void 0&&(V[xe]=ae[xe]);return{$$typeof:r,type:b,key:ee,ref:me,props:V,_owner:ke.current}}function je(b,D){return{$$typeof:r,type:b.type,key:D,ref:b.ref,props:b.props,_owner:b._owner}}function L(b){return typeof b=="object"&&b!==null&&b.$$typeof===r}function oe(b){var D={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(pe){return D[pe]})}var z=/\/+/g;function K(b,D){return typeof b=="object"&&b!==null&&b.key!=null?oe(""+b.key):D.toString(36)}function Se(b,D,pe,xe,V){var ee=typeof b;(ee==="undefined"||ee==="boolean")&&(b=null);var me=!1;if(b===null)me=!0;else switch(ee){case"string":case"number":me=!0;break;case"object":switch(b.$$typeof){case r:case a:me=!0}}if(me)return me=b,V=V(me),b=xe===""?"."+K(me,0):xe,ue(V)?(pe="",b!=null&&(pe=b.replace(z,"$&/")+"/"),Se(V,D,pe,"",function(Ve){return Ve})):V!=null&&(L(V)&&(V=je(V,pe+(!V.key||me&&me.key===V.key?"":(""+V.key).replace(z,"$&/")+"/")+b)),D.push(V)),1;if(me=0,xe=xe===""?".":xe+":",ue(b))for(var ae=0;ae<b.length;ae++){ee=b[ae];var ge=xe+K(ee,ae);me+=Se(ee,D,pe,ge,V)}else if(ge=E(b),typeof ge=="function")for(b=ge.call(b),ae=0;!(ee=b.next()).done;)ee=ee.value,ge=xe+K(ee,ae++),me+=Se(ee,D,pe,ge,V);else if(ee==="object")throw D=String(b),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return me}function Z(b,D,pe){if(b==null)return b;var xe=[],V=0;return Se(b,xe,"","",function(ee){return D.call(pe,ee,V++)}),xe}function ce(b){if(b._status===-1){var D=b._result;D=D(),D.then(function(pe){(b._status===0||b._status===-1)&&(b._status=1,b._result=pe)},function(pe){(b._status===0||b._status===-1)&&(b._status=2,b._result=pe)}),b._status===-1&&(b._status=0,b._result=D)}if(b._status===1)return b._result.default;throw b._result}var ye={current:null},F={transition:null},se={ReactCurrentDispatcher:ye,ReactCurrentBatchConfig:F,ReactCurrentOwner:ke};function G(){throw Error("act(...) is not supported in production builds of React.")}return Ee.Children={map:Z,forEach:function(b,D,pe){Z(b,function(){D.apply(this,arguments)},pe)},count:function(b){var D=0;return Z(b,function(){D++}),D},toArray:function(b){return Z(b,function(D){return D})||[]},only:function(b){if(!L(b))throw Error("React.Children.only expected to receive a single React element child.");return b}},Ee.Component=N,Ee.Fragment=o,Ee.Profiler=c,Ee.PureComponent=U,Ee.StrictMode=d,Ee.Suspense=p,Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=se,Ee.act=G,Ee.cloneElement=function(b,D,pe){if(b==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+b+".");var xe=R({},b.props),V=b.key,ee=b.ref,me=b._owner;if(D!=null){if(D.ref!==void 0&&(ee=D.ref,me=ke.current),D.key!==void 0&&(V=""+D.key),b.type&&b.type.defaultProps)var ae=b.type.defaultProps;for(ge in D)le.call(D,ge)&&!be.hasOwnProperty(ge)&&(xe[ge]=D[ge]===void 0&&ae!==void 0?ae[ge]:D[ge])}var ge=arguments.length-2;if(ge===1)xe.children=pe;else if(1<ge){ae=Array(ge);for(var Ve=0;Ve<ge;Ve++)ae[Ve]=arguments[Ve+2];xe.children=ae}return{$$typeof:r,type:b.type,key:V,ref:ee,props:xe,_owner:me}},Ee.createContext=function(b){return b={$$typeof:m,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},b.Provider={$$typeof:h,_context:b},b.Consumer=b},Ee.createElement=re,Ee.createFactory=function(b){var D=re.bind(null,b);return D.type=b,D},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(b){return{$$typeof:g,render:b}},Ee.isValidElement=L,Ee.lazy=function(b){return{$$typeof:k,_payload:{_status:-1,_result:b},_init:ce}},Ee.memo=function(b,D){return{$$typeof:x,type:b,compare:D===void 0?null:D}},Ee.startTransition=function(b){var D=F.transition;F.transition={};try{b()}finally{F.transition=D}},Ee.unstable_act=G,Ee.useCallback=function(b,D){return ye.current.useCallback(b,D)},Ee.useContext=function(b){return ye.current.useContext(b)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(b){return ye.current.useDeferredValue(b)},Ee.useEffect=function(b,D){return ye.current.useEffect(b,D)},Ee.useId=function(){return ye.current.useId()},Ee.useImperativeHandle=function(b,D,pe){return ye.current.useImperativeHandle(b,D,pe)},Ee.useInsertionEffect=function(b,D){return ye.current.useInsertionEffect(b,D)},Ee.useLayoutEffect=function(b,D){return ye.current.useLayoutEffect(b,D)},Ee.useMemo=function(b,D){return ye.current.useMemo(b,D)},Ee.useReducer=function(b,D,pe){return ye.current.useReducer(b,D,pe)},Ee.useRef=function(b){return ye.current.useRef(b)},Ee.useState=function(b){return ye.current.useState(b)},Ee.useSyncExternalStore=function(b,D,pe){return ye.current.useSyncExternalStore(b,D,pe)},Ee.useTransition=function(){return ye.current.useTransition()},Ee.version="18.3.1",Ee}var Ud;function Wo(){return Ud||(Ud=1,co.exports=um()),co.exports}var Hd;function cm(){if(Hd)return Ai;Hd=1;var r=Wo(),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,c=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function m(g,p,x){var k,j={},E=null,W=null;x!==void 0&&(E=""+x),p.key!==void 0&&(E=""+p.key),p.ref!==void 0&&(W=p.ref);for(k in p)d.call(p,k)&&!h.hasOwnProperty(k)&&(j[k]=p[k]);if(g&&g.defaultProps)for(k in p=g.defaultProps,p)j[k]===void 0&&(j[k]=p[k]);return{$$typeof:a,type:g,key:E,ref:W,props:j,_owner:c.current}}return Ai.Fragment=o,Ai.jsx=m,Ai.jsxs=m,Ai}var Gd;function dm(){return Gd||(Gd=1,uo.exports=cm()),uo.exports}var l=dm(),w=Wo();const Rf=Pf(w);var ql={},fo={exports:{}},xt={},ho={exports:{}},po={};var Kd;function fm(){return Kd||(Kd=1,(function(r){function a(F,se){var G=F.length;F.push(se);e:for(;0<G;){var b=G-1>>>1,D=F[b];if(0<c(D,se))F[b]=se,F[G]=D,G=b;else break e}}function o(F){return F.length===0?null:F[0]}function d(F){if(F.length===0)return null;var se=F[0],G=F.pop();if(G!==se){F[0]=G;e:for(var b=0,D=F.length,pe=D>>>1;b<pe;){var xe=2*(b+1)-1,V=F[xe],ee=xe+1,me=F[ee];if(0>c(V,G))ee<D&&0>c(me,V)?(F[b]=me,F[ee]=G,b=ee):(F[b]=V,F[xe]=G,b=xe);else if(ee<D&&0>c(me,G))F[b]=me,F[ee]=G,b=ee;else break e}}return se}function c(F,se){var G=F.sortIndex-se.sortIndex;return G!==0?G:F.id-se.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;r.unstable_now=function(){return h.now()}}else{var m=Date,g=m.now();r.unstable_now=function(){return m.now()-g}}var p=[],x=[],k=1,j=null,E=3,W=!1,R=!1,_=!1,N=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(F){for(var se=o(x);se!==null;){if(se.callback===null)d(x);else if(se.startTime<=F)d(x),se.sortIndex=se.expirationTime,a(p,se);else break;se=o(x)}}function ue(F){if(_=!1,O(F),!R)if(o(p)!==null)R=!0,ce(le);else{var se=o(x);se!==null&&ye(ue,se.startTime-F)}}function le(F,se){R=!1,_&&(_=!1,$(re),re=-1),W=!0;var G=E;try{for(O(se),j=o(p);j!==null&&(!(j.expirationTime>se)||F&&!oe());){var b=j.callback;if(typeof b=="function"){j.callback=null,E=j.priorityLevel;var D=b(j.expirationTime<=se);se=r.unstable_now(),typeof D=="function"?j.callback=D:j===o(p)&&d(p),O(se)}else d(p);j=o(p)}if(j!==null)var pe=!0;else{var xe=o(x);xe!==null&&ye(ue,xe.startTime-se),pe=!1}return pe}finally{j=null,E=G,W=!1}}var ke=!1,be=null,re=-1,je=5,L=-1;function oe(){return!(r.unstable_now()-L<je)}function z(){if(be!==null){var F=r.unstable_now();L=F;var se=!0;try{se=be(!0,F)}finally{se?K():(ke=!1,be=null)}}else ke=!1}var K;if(typeof U=="function")K=function(){U(z)};else if(typeof MessageChannel<"u"){var Se=new MessageChannel,Z=Se.port2;Se.port1.onmessage=z,K=function(){Z.postMessage(null)}}else K=function(){N(z,0)};function ce(F){be=F,ke||(ke=!0,K())}function ye(F,se){re=N(function(){F(r.unstable_now())},se)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(F){F.callback=null},r.unstable_continueExecution=function(){R||W||(R=!0,ce(le))},r.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):je=0<F?Math.floor(1e3/F):5},r.unstable_getCurrentPriorityLevel=function(){return E},r.unstable_getFirstCallbackNode=function(){return o(p)},r.unstable_next=function(F){switch(E){case 1:case 2:case 3:var se=3;break;default:se=E}var G=E;E=se;try{return F()}finally{E=G}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(F,se){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var G=E;E=F;try{return se()}finally{E=G}},r.unstable_scheduleCallback=function(F,se,G){var b=r.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?b+G:b):G=b,F){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=G+D,F={id:k++,callback:se,priorityLevel:F,startTime:G,expirationTime:D,sortIndex:-1},G>b?(F.sortIndex=G,a(x,F),o(p)===null&&F===o(x)&&(_?($(re),re=-1):_=!0,ye(ue,G-b))):(F.sortIndex=D,a(p,F),R||W||(R=!0,ce(le))),F},r.unstable_shouldYield=oe,r.unstable_wrapCallback=function(F){var se=E;return function(){var G=E;E=se;try{return F.apply(this,arguments)}finally{E=G}}}})(po)),po}var qd;function hm(){return qd||(qd=1,ho.exports=fm()),ho.exports}var Qd;function pm(){if(Qd)return xt;Qd=1;var r=Wo(),a=hm();function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var d=new Set,c={};function h(e,t){m(e,t),m(e+"Capture",t)}function m(e,t){for(c[e]=t,e=0;e<t.length;e++)d.add(t[e])}var g=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,x=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,k={},j={};function E(e){return p.call(j,e)?!0:p.call(k,e)?!1:x.test(e)?j[e]=!0:(k[e]=!0,!1)}function W(e,t,n,i){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function R(e,t,n,i){if(t===null||typeof t>"u"||W(e,t,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function _(e,t,n,i,s,u,f){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=u,this.removeEmptyString=f}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new _(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];N[t]=new _(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new _(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new _(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){N[e]=new _(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new _(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new _(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new _(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new _(e,5,!1,e.toLowerCase(),null,!1,!1)});var $=/[\-:]([a-z])/g;function U(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace($,U);N[t]=new _(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace($,U);N[t]=new _(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace($,U);N[t]=new _(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new _(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new _(e,1,!1,e.toLowerCase(),null,!0,!0)});function O(e,t,n,i){var s=N.hasOwnProperty(t)?N[t]:null;(s!==null?s.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(R(t,n,s,i)&&(n=null),i||s===null?E(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,i=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,i?e.setAttributeNS(i,t,n):e.setAttribute(t,n))))}var ue=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,le=Symbol.for("react.element"),ke=Symbol.for("react.portal"),be=Symbol.for("react.fragment"),re=Symbol.for("react.strict_mode"),je=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),oe=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),Se=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),ce=Symbol.for("react.lazy"),ye=Symbol.for("react.offscreen"),F=Symbol.iterator;function se(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var G=Object.assign,b;function D(e){if(b===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);b=t&&t[1]||""}return`
|
|
2
|
-
`+b+e}var pe=!1;function xe(e,t){if(!e||pe)return"";pe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(A){var i=A}Reflect.construct(e,[],t)}else{try{t.call()}catch(A){i=A}e.call(t.prototype)}else{try{throw Error()}catch(A){i=A}e()}}catch(A){if(A&&i&&typeof A.stack=="string"){for(var s=A.stack.split(`
|
|
3
|
-
`),u=i.stack.split(`
|
|
4
|
-
`),f=s.length-1,v=u.length-1;1<=f&&0<=v&&s[f]!==u[v];)v--;for(;1<=f&&0<=v;f--,v--)if(s[f]!==u[v]){if(f!==1||v!==1)do if(f--,v--,0>v||s[f]!==u[v]){var y=`
|
|
5
|
-
`+s[f].replace(" at new "," at ");return e.displayName&&y.includes("<anonymous>")&&(y=y.replace("<anonymous>",e.displayName)),y}while(1<=f&&0<=v);break}}}finally{pe=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?D(e):""}function V(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=xe(e.type,!1),e;case 11:return e=xe(e.type.render,!1),e;case 1:return e=xe(e.type,!0),e;default:return""}}function ee(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case be:return"Fragment";case ke:return"Portal";case je:return"Profiler";case re:return"StrictMode";case K:return"Suspense";case Se:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case oe:return(e.displayName||"Context")+".Consumer";case L:return(e._context.displayName||"Context")+".Provider";case z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case ce:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}function me(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ee(t);case 8:return t===re?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ae(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ge(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ve(e){var t=ge(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,u=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(f){i=""+f,u.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(f){i=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Un(e){e._valueTracker||(e._valueTracker=Ve(e))}function q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=ge(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function ve(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $e(e,t){var n=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function kt(e,t){var n=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;n=ae(t.value!=null?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Oe(e,t){t=t.checked,t!=null&&O(e,"checked",t,!1)}function Qt(e,t){Oe(e,t);var n=ae(t.value),i=t.type;if(n!=null)i==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ws(e,t.type,n):t.hasOwnProperty("defaultValue")&&ws(e,t.type,ae(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xo(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ws(e,t,n){(t!=="number"||ve(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Hr=Array.isArray;function dr(e,t,n,i){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&i&&(e[n].defaultSelected=!0)}else{for(n=""+ae(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,i&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function ys(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(o(91));return G({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Jo(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(o(92));if(Hr(n)){if(1<n.length)throw Error(o(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ae(n)}}function eu(e,t){var n=ae(t.value),i=ae(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),i!=null&&(e.defaultValue=""+i)}function tu(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function nu(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function xs(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?nu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fi,ru=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,i,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,i,s)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fi=Fi||document.createElement("div"),Fi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Gr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},hh=["Webkit","ms","Moz","O"];Object.keys(Kr).forEach(function(e){hh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Kr[t]=Kr[e]})});function iu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Kr.hasOwnProperty(e)&&Kr[e]?(""+t).trim():t+"px"}function lu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var i=n.indexOf("--")===0,s=iu(n,t[n],i);n==="float"&&(n="cssFloat"),i?e.setProperty(n,s):e[n]=s}}var ph=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ss(e,t){if(t){if(ph[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(o(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(o(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(t.style!=null&&typeof t.style!="object")throw Error(o(62))}}function ks(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var js=null;function bs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Es=null,fr=null,hr=null;function su(e){if(e=mi(e)){if(typeof Es!="function")throw Error(o(280));var t=e.stateNode;t&&(t=ul(t),Es(e.stateNode,e.type,t))}}function au(e){fr?hr?hr.push(e):hr=[e]:fr=e}function ou(){if(fr){var e=fr,t=hr;if(hr=fr=null,su(e),t)for(e=0;e<t.length;e++)su(t[e])}}function uu(e,t){return e(t)}function cu(){}var Cs=!1;function du(e,t,n){if(Cs)return e(t,n);Cs=!0;try{return uu(e,t,n)}finally{Cs=!1,(fr!==null||hr!==null)&&(cu(),ou())}}function qr(e,t){var n=e.stateNode;if(n===null)return null;var i=ul(n);if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(o(231,t,typeof n));return n}var Ns=!1;if(g)try{var Qr={};Object.defineProperty(Qr,"passive",{get:function(){Ns=!0}}),window.addEventListener("test",Qr,Qr),window.removeEventListener("test",Qr,Qr)}catch{Ns=!1}function mh(e,t,n,i,s,u,f,v,y){var A=Array.prototype.slice.call(arguments,3);try{t.apply(n,A)}catch(T){this.onError(T)}}var Zr=!1,Bi=null,Vi=!1,Ps=null,gh={onError:function(e){Zr=!0,Bi=e}};function vh(e,t,n,i,s,u,f,v,y){Zr=!1,Bi=null,mh.apply(gh,arguments)}function wh(e,t,n,i,s,u,f,v,y){if(vh.apply(this,arguments),Zr){if(Zr){var A=Bi;Zr=!1,Bi=null}else throw Error(o(198));Vi||(Vi=!0,Ps=A)}}function Hn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function fu(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function hu(e){if(Hn(e)!==e)throw Error(o(188))}function yh(e){var t=e.alternate;if(!t){if(t=Hn(e),t===null)throw Error(o(188));return t!==e?null:e}for(var n=e,i=t;;){var s=n.return;if(s===null)break;var u=s.alternate;if(u===null){if(i=s.return,i!==null){n=i;continue}break}if(s.child===u.child){for(u=s.child;u;){if(u===n)return hu(s),e;if(u===i)return hu(s),t;u=u.sibling}throw Error(o(188))}if(n.return!==i.return)n=s,i=u;else{for(var f=!1,v=s.child;v;){if(v===n){f=!0,n=s,i=u;break}if(v===i){f=!0,i=s,n=u;break}v=v.sibling}if(!f){for(v=u.child;v;){if(v===n){f=!0,n=u,i=s;break}if(v===i){f=!0,i=u,n=s;break}v=v.sibling}if(!f)throw Error(o(189))}}if(n.alternate!==i)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function pu(e){return e=yh(e),e!==null?mu(e):null}function mu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=mu(e);if(t!==null)return t;e=e.sibling}return null}var gu=a.unstable_scheduleCallback,vu=a.unstable_cancelCallback,xh=a.unstable_shouldYield,Sh=a.unstable_requestPaint,Ge=a.unstable_now,kh=a.unstable_getCurrentPriorityLevel,Rs=a.unstable_ImmediatePriority,wu=a.unstable_UserBlockingPriority,$i=a.unstable_NormalPriority,jh=a.unstable_LowPriority,yu=a.unstable_IdlePriority,Ui=null,Zt=null;function bh(e){if(Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(Ui,e,void 0,(e.current.flags&128)===128)}catch{}}var Ot=Math.clz32?Math.clz32:Nh,Eh=Math.log,Ch=Math.LN2;function Nh(e){return e>>>=0,e===0?32:31-(Eh(e)/Ch|0)|0}var Hi=64,Gi=4194304;function Yr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ki(e,t){var n=e.pendingLanes;if(n===0)return 0;var i=0,s=e.suspendedLanes,u=e.pingedLanes,f=n&268435455;if(f!==0){var v=f&~s;v!==0?i=Yr(v):(u&=f,u!==0&&(i=Yr(u)))}else f=n&~s,f!==0?i=Yr(f):u!==0&&(i=Yr(u));if(i===0)return 0;if(t!==0&&t!==i&&(t&s)===0&&(s=i&-i,u=t&-t,s>=u||s===16&&(u&4194240)!==0))return t;if((i&4)!==0&&(i|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)n=31-Ot(t),s=1<<n,i|=e[n],t&=~s;return i}function Ph(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rh(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,u=e.pendingLanes;0<u;){var f=31-Ot(u),v=1<<f,y=s[f];y===-1?((v&n)===0||(v&i)!==0)&&(s[f]=Ph(v,t)):y<=t&&(e.expiredLanes|=v),u&=~v}}function As(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function xu(){var e=Hi;return Hi<<=1,(Hi&4194240)===0&&(Hi=64),e}function zs(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ot(t),e[t]=n}function Ah(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Ot(n),u=1<<s;t[s]=0,i[s]=-1,e[s]=-1,n&=~u}}function Ms(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Ot(n),s=1<<i;s&t|e[i]&t&&(e[i]|=t),n&=~s}}var Ae=0;function Su(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var ku,_s,ju,bu,Eu,Ls=!1,qi=[],Sn=null,kn=null,jn=null,Jr=new Map,ei=new Map,bn=[],zh="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Cu(e,t){switch(e){case"focusin":case"focusout":Sn=null;break;case"dragenter":case"dragleave":kn=null;break;case"mouseover":case"mouseout":jn=null;break;case"pointerover":case"pointerout":Jr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ei.delete(t.pointerId)}}function ti(e,t,n,i,s,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:u,targetContainers:[s]},t!==null&&(t=mi(t),t!==null&&_s(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Mh(e,t,n,i,s){switch(t){case"focusin":return Sn=ti(Sn,e,t,n,i,s),!0;case"dragenter":return kn=ti(kn,e,t,n,i,s),!0;case"mouseover":return jn=ti(jn,e,t,n,i,s),!0;case"pointerover":var u=s.pointerId;return Jr.set(u,ti(Jr.get(u)||null,e,t,n,i,s)),!0;case"gotpointercapture":return u=s.pointerId,ei.set(u,ti(ei.get(u)||null,e,t,n,i,s)),!0}return!1}function Nu(e){var t=Gn(e.target);if(t!==null){var n=Hn(t);if(n!==null){if(t=n.tag,t===13){if(t=fu(n),t!==null){e.blockedOn=t,Eu(e.priority,function(){ju(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Qi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Is(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);js=i,n.target.dispatchEvent(i),js=null}else return t=mi(n),t!==null&&_s(t),e.blockedOn=n,!1;t.shift()}return!0}function Pu(e,t,n){Qi(e)&&n.delete(t)}function _h(){Ls=!1,Sn!==null&&Qi(Sn)&&(Sn=null),kn!==null&&Qi(kn)&&(kn=null),jn!==null&&Qi(jn)&&(jn=null),Jr.forEach(Pu),ei.forEach(Pu)}function ni(e,t){e.blockedOn===t&&(e.blockedOn=null,Ls||(Ls=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,_h)))}function ri(e){function t(s){return ni(s,e)}if(0<qi.length){ni(qi[0],e);for(var n=1;n<qi.length;n++){var i=qi[n];i.blockedOn===e&&(i.blockedOn=null)}}for(Sn!==null&&ni(Sn,e),kn!==null&&ni(kn,e),jn!==null&&ni(jn,e),Jr.forEach(t),ei.forEach(t),n=0;n<bn.length;n++)i=bn[n],i.blockedOn===e&&(i.blockedOn=null);for(;0<bn.length&&(n=bn[0],n.blockedOn===null);)Nu(n),n.blockedOn===null&&bn.shift()}var pr=ue.ReactCurrentBatchConfig,Zi=!0;function Lh(e,t,n,i){var s=Ae,u=pr.transition;pr.transition=null;try{Ae=1,Ds(e,t,n,i)}finally{Ae=s,pr.transition=u}}function Dh(e,t,n,i){var s=Ae,u=pr.transition;pr.transition=null;try{Ae=4,Ds(e,t,n,i)}finally{Ae=s,pr.transition=u}}function Ds(e,t,n,i){if(Zi){var s=Is(e,t,n,i);if(s===null)Js(e,t,i,Yi,n),Cu(e,i);else if(Mh(s,e,t,n,i))i.stopPropagation();else if(Cu(e,i),t&4&&-1<zh.indexOf(e)){for(;s!==null;){var u=mi(s);if(u!==null&&ku(u),u=Is(e,t,n,i),u===null&&Js(e,t,i,Yi,n),u===s)break;s=u}s!==null&&i.stopPropagation()}else Js(e,t,i,null,n)}}var Yi=null;function Is(e,t,n,i){if(Yi=null,e=bs(i),e=Gn(e),e!==null)if(t=Hn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=fu(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Yi=e,null}function Ru(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(kh()){case Rs:return 1;case wu:return 4;case $i:case jh:return 16;case yu:return 536870912;default:return 16}default:return 16}}var En=null,Ts=null,Xi=null;function Au(){if(Xi)return Xi;var e,t=Ts,n=t.length,i,s="value"in En?En.value:En.textContent,u=s.length;for(e=0;e<n&&t[e]===s[e];e++);var f=n-e;for(i=1;i<=f&&t[n-i]===s[u-i];i++);return Xi=s.slice(e,1<i?1-i:void 0)}function Ji(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function el(){return!0}function zu(){return!1}function jt(e){function t(n,i,s,u,f){this._reactName=n,this._targetInst=s,this.type=i,this.nativeEvent=u,this.target=f,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(n=e[v],this[v]=n?n(u):u[v]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?el:zu,this.isPropagationStopped=zu,this}return G(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=el)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=el)},persist:function(){},isPersistent:el}),t}var mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ws=jt(mr),ii=G({},mr,{view:0,detail:0}),Ih=jt(ii),Os,Fs,li,tl=G({},ii,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vs,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==li&&(li&&e.type==="mousemove"?(Os=e.screenX-li.screenX,Fs=e.screenY-li.screenY):Fs=Os=0,li=e),Os)},movementY:function(e){return"movementY"in e?e.movementY:Fs}}),Mu=jt(tl),Th=G({},tl,{dataTransfer:0}),Wh=jt(Th),Oh=G({},ii,{relatedTarget:0}),Bs=jt(Oh),Fh=G({},mr,{animationName:0,elapsedTime:0,pseudoElement:0}),Bh=jt(Fh),Vh=G({},mr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$h=jt(Vh),Uh=G({},mr,{data:0}),_u=jt(Uh),Hh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gh={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Kh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kh[e])?!!t[e]:!1}function Vs(){return qh}var Qh=G({},ii,{key:function(e){if(e.key){var t=Hh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ji(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vs,charCode:function(e){return e.type==="keypress"?Ji(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ji(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Zh=jt(Qh),Yh=G({},tl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lu=jt(Yh),Xh=G({},ii,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vs}),Jh=jt(Xh),ep=G({},mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),tp=jt(ep),np=G({},tl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),rp=jt(np),ip=[9,13,27,32],$s=g&&"CompositionEvent"in window,si=null;g&&"documentMode"in document&&(si=document.documentMode);var lp=g&&"TextEvent"in window&&!si,Du=g&&(!$s||si&&8<si&&11>=si),Iu=" ",Tu=!1;function Wu(e,t){switch(e){case"keyup":return ip.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ou(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gr=!1;function sp(e,t){switch(e){case"compositionend":return Ou(t);case"keypress":return t.which!==32?null:(Tu=!0,Iu);case"textInput":return e=t.data,e===Iu&&Tu?null:e;default:return null}}function ap(e,t){if(gr)return e==="compositionend"||!$s&&Wu(e,t)?(e=Au(),Xi=Ts=En=null,gr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Du&&t.locale!=="ko"?null:t.data;default:return null}}var op={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!op[e.type]:t==="textarea"}function Bu(e,t,n,i){au(i),t=sl(t,"onChange"),0<t.length&&(n=new Ws("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var ai=null,oi=null;function up(e){lc(e,0)}function nl(e){var t=Sr(e);if(q(t))return e}function cp(e,t){if(e==="change")return t}var Vu=!1;if(g){var Us;if(g){var Hs="oninput"in document;if(!Hs){var $u=document.createElement("div");$u.setAttribute("oninput","return;"),Hs=typeof $u.oninput=="function"}Us=Hs}else Us=!1;Vu=Us&&(!document.documentMode||9<document.documentMode)}function Uu(){ai&&(ai.detachEvent("onpropertychange",Hu),oi=ai=null)}function Hu(e){if(e.propertyName==="value"&&nl(oi)){var t=[];Bu(t,oi,e,bs(e)),du(up,t)}}function dp(e,t,n){e==="focusin"?(Uu(),ai=t,oi=n,ai.attachEvent("onpropertychange",Hu)):e==="focusout"&&Uu()}function fp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return nl(oi)}function hp(e,t){if(e==="click")return nl(t)}function pp(e,t){if(e==="input"||e==="change")return nl(t)}function mp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ft=typeof Object.is=="function"?Object.is:mp;function ui(e,t){if(Ft(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var s=n[i];if(!p.call(t,s)||!Ft(e[s],t[s]))return!1}return!0}function Gu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ku(e,t){var n=Gu(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Gu(n)}}function qu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qu(){for(var e=window,t=ve();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ve(e.document)}return t}function Gs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function gp(e){var t=Qu(),n=e.focusedElem,i=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&qu(n.ownerDocument.documentElement,n)){if(i!==null&&Gs(n)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,u=Math.min(i.start,s);i=i.end===void 0?u:Math.min(i.end,s),!e.extend&&u>i&&(s=i,i=u,u=s),s=Ku(n,u);var f=Ku(n,i);s&&f&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==f.node||e.focusOffset!==f.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),u>i?(e.addRange(t),e.extend(f.node,f.offset)):(t.setEnd(f.node,f.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var vp=g&&"documentMode"in document&&11>=document.documentMode,vr=null,Ks=null,ci=null,qs=!1;function Zu(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qs||vr==null||vr!==ve(i)||(i=vr,"selectionStart"in i&&Gs(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ci&&ui(ci,i)||(ci=i,i=sl(Ks,"onSelect"),0<i.length&&(t=new Ws("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=vr)))}function rl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var wr={animationend:rl("Animation","AnimationEnd"),animationiteration:rl("Animation","AnimationIteration"),animationstart:rl("Animation","AnimationStart"),transitionend:rl("Transition","TransitionEnd")},Qs={},Yu={};g&&(Yu=document.createElement("div").style,"AnimationEvent"in window||(delete wr.animationend.animation,delete wr.animationiteration.animation,delete wr.animationstart.animation),"TransitionEvent"in window||delete wr.transitionend.transition);function il(e){if(Qs[e])return Qs[e];if(!wr[e])return e;var t=wr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Yu)return Qs[e]=t[n];return e}var Xu=il("animationend"),Ju=il("animationiteration"),ec=il("animationstart"),tc=il("transitionend"),nc=new Map,rc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Cn(e,t){nc.set(e,t),h(t,[e])}for(var Zs=0;Zs<rc.length;Zs++){var Ys=rc[Zs],wp=Ys.toLowerCase(),yp=Ys[0].toUpperCase()+Ys.slice(1);Cn(wp,"on"+yp)}Cn(Xu,"onAnimationEnd"),Cn(Ju,"onAnimationIteration"),Cn(ec,"onAnimationStart"),Cn("dblclick","onDoubleClick"),Cn("focusin","onFocus"),Cn("focusout","onBlur"),Cn(tc,"onTransitionEnd"),m("onMouseEnter",["mouseout","mouseover"]),m("onMouseLeave",["mouseout","mouseover"]),m("onPointerEnter",["pointerout","pointerover"]),m("onPointerLeave",["pointerout","pointerover"]),h("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),h("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),h("onBeforeInput",["compositionend","keypress","textInput","paste"]),h("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),h("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),h("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var di="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),xp=new Set("cancel close invalid load scroll toggle".split(" ").concat(di));function ic(e,t,n){var i=e.type||"unknown-event";e.currentTarget=n,wh(i,t,void 0,e),e.currentTarget=null}function lc(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],s=i.event;i=i.listeners;e:{var u=void 0;if(t)for(var f=i.length-1;0<=f;f--){var v=i[f],y=v.instance,A=v.currentTarget;if(v=v.listener,y!==u&&s.isPropagationStopped())break e;ic(s,v,A),u=y}else for(f=0;f<i.length;f++){if(v=i[f],y=v.instance,A=v.currentTarget,v=v.listener,y!==u&&s.isPropagationStopped())break e;ic(s,v,A),u=y}}}if(Vi)throw e=Ps,Vi=!1,Ps=null,e}function De(e,t){var n=t[la];n===void 0&&(n=t[la]=new Set);var i=e+"__bubble";n.has(i)||(sc(t,e,2,!1),n.add(i))}function Xs(e,t,n){var i=0;t&&(i|=4),sc(n,e,i,t)}var ll="_reactListening"+Math.random().toString(36).slice(2);function fi(e){if(!e[ll]){e[ll]=!0,d.forEach(function(n){n!=="selectionchange"&&(xp.has(n)||Xs(n,!1,e),Xs(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ll]||(t[ll]=!0,Xs("selectionchange",!1,t))}}function sc(e,t,n,i){switch(Ru(t)){case 1:var s=Lh;break;case 4:s=Dh;break;default:s=Ds}n=s.bind(null,t,n,e),s=void 0,!Ns||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),i?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Js(e,t,n,i,s){var u=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var f=i.tag;if(f===3||f===4){var v=i.stateNode.containerInfo;if(v===s||v.nodeType===8&&v.parentNode===s)break;if(f===4)for(f=i.return;f!==null;){var y=f.tag;if((y===3||y===4)&&(y=f.stateNode.containerInfo,y===s||y.nodeType===8&&y.parentNode===s))return;f=f.return}for(;v!==null;){if(f=Gn(v),f===null)return;if(y=f.tag,y===5||y===6){i=u=f;continue e}v=v.parentNode}}i=i.return}du(function(){var A=u,T=bs(n),B=[];e:{var I=nc.get(e);if(I!==void 0){var Q=Ws,X=e;switch(e){case"keypress":if(Ji(n)===0)break e;case"keydown":case"keyup":Q=Zh;break;case"focusin":X="focus",Q=Bs;break;case"focusout":X="blur",Q=Bs;break;case"beforeblur":case"afterblur":Q=Bs;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Q=Mu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Q=Wh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Q=Jh;break;case Xu:case Ju:case ec:Q=Bh;break;case tc:Q=tp;break;case"scroll":Q=Ih;break;case"wheel":Q=rp;break;case"copy":case"cut":case"paste":Q=$h;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Q=Lu}var te=(t&4)!==0,Ke=!te&&e==="scroll",C=te?I!==null?I+"Capture":null:I;te=[];for(var S=A,P;S!==null;){P=S;var H=P.stateNode;if(P.tag===5&&H!==null&&(P=H,C!==null&&(H=qr(S,C),H!=null&&te.push(hi(S,H,P)))),Ke)break;S=S.return}0<te.length&&(I=new Q(I,X,null,n,T),B.push({event:I,listeners:te}))}}if((t&7)===0){e:{if(I=e==="mouseover"||e==="pointerover",Q=e==="mouseout"||e==="pointerout",I&&n!==js&&(X=n.relatedTarget||n.fromElement)&&(Gn(X)||X[on]))break e;if((Q||I)&&(I=T.window===T?T:(I=T.ownerDocument)?I.defaultView||I.parentWindow:window,Q?(X=n.relatedTarget||n.toElement,Q=A,X=X?Gn(X):null,X!==null&&(Ke=Hn(X),X!==Ke||X.tag!==5&&X.tag!==6)&&(X=null)):(Q=null,X=A),Q!==X)){if(te=Mu,H="onMouseLeave",C="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(te=Lu,H="onPointerLeave",C="onPointerEnter",S="pointer"),Ke=Q==null?I:Sr(Q),P=X==null?I:Sr(X),I=new te(H,S+"leave",Q,n,T),I.target=Ke,I.relatedTarget=P,H=null,Gn(T)===A&&(te=new te(C,S+"enter",X,n,T),te.target=P,te.relatedTarget=Ke,H=te),Ke=H,Q&&X)t:{for(te=Q,C=X,S=0,P=te;P;P=yr(P))S++;for(P=0,H=C;H;H=yr(H))P++;for(;0<S-P;)te=yr(te),S--;for(;0<P-S;)C=yr(C),P--;for(;S--;){if(te===C||C!==null&&te===C.alternate)break t;te=yr(te),C=yr(C)}te=null}else te=null;Q!==null&&ac(B,I,Q,te,!1),X!==null&&Ke!==null&&ac(B,Ke,X,te,!0)}}e:{if(I=A?Sr(A):window,Q=I.nodeName&&I.nodeName.toLowerCase(),Q==="select"||Q==="input"&&I.type==="file")var ie=cp;else if(Fu(I))if(Vu)ie=pp;else{ie=fp;var de=dp}else(Q=I.nodeName)&&Q.toLowerCase()==="input"&&(I.type==="checkbox"||I.type==="radio")&&(ie=hp);if(ie&&(ie=ie(e,A))){Bu(B,ie,n,T);break e}de&&de(e,I,A),e==="focusout"&&(de=I._wrapperState)&&de.controlled&&I.type==="number"&&ws(I,"number",I.value)}switch(de=A?Sr(A):window,e){case"focusin":(Fu(de)||de.contentEditable==="true")&&(vr=de,Ks=A,ci=null);break;case"focusout":ci=Ks=vr=null;break;case"mousedown":qs=!0;break;case"contextmenu":case"mouseup":case"dragend":qs=!1,Zu(B,n,T);break;case"selectionchange":if(vp)break;case"keydown":case"keyup":Zu(B,n,T)}var fe;if($s)e:{switch(e){case"compositionstart":var we="onCompositionStart";break e;case"compositionend":we="onCompositionEnd";break e;case"compositionupdate":we="onCompositionUpdate";break e}we=void 0}else gr?Wu(e,n)&&(we="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(we="onCompositionStart");we&&(Du&&n.locale!=="ko"&&(gr||we!=="onCompositionStart"?we==="onCompositionEnd"&&gr&&(fe=Au()):(En=T,Ts="value"in En?En.value:En.textContent,gr=!0)),de=sl(A,we),0<de.length&&(we=new _u(we,e,null,n,T),B.push({event:we,listeners:de}),fe?we.data=fe:(fe=Ou(n),fe!==null&&(we.data=fe)))),(fe=lp?sp(e,n):ap(e,n))&&(A=sl(A,"onBeforeInput"),0<A.length&&(T=new _u("onBeforeInput","beforeinput",null,n,T),B.push({event:T,listeners:A}),T.data=fe))}lc(B,t)})}function hi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function sl(e,t){for(var n=t+"Capture",i=[];e!==null;){var s=e,u=s.stateNode;s.tag===5&&u!==null&&(s=u,u=qr(e,n),u!=null&&i.unshift(hi(e,u,s)),u=qr(e,t),u!=null&&i.push(hi(e,u,s))),e=e.return}return i}function yr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ac(e,t,n,i,s){for(var u=t._reactName,f=[];n!==null&&n!==i;){var v=n,y=v.alternate,A=v.stateNode;if(y!==null&&y===i)break;v.tag===5&&A!==null&&(v=A,s?(y=qr(n,u),y!=null&&f.unshift(hi(n,y,v))):s||(y=qr(n,u),y!=null&&f.push(hi(n,y,v)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var Sp=/\r\n?/g,kp=/\u0000|\uFFFD/g;function oc(e){return(typeof e=="string"?e:""+e).replace(Sp,`
|
|
6
|
-
`).replace(kp,"")}function al(e,t,n){if(t=oc(t),oc(e)!==t&&n)throw Error(o(425))}function ol(){}var ea=null,ta=null;function na(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ra=typeof setTimeout=="function"?setTimeout:void 0,jp=typeof clearTimeout=="function"?clearTimeout:void 0,uc=typeof Promise=="function"?Promise:void 0,bp=typeof queueMicrotask=="function"?queueMicrotask:typeof uc<"u"?function(e){return uc.resolve(null).then(e).catch(Ep)}:ra;function Ep(e){setTimeout(function(){throw e})}function ia(e,t){var n=t,i=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(i===0){e.removeChild(s),ri(t);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=s}while(n);ri(t)}function Nn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function cc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var xr=Math.random().toString(36).slice(2),Yt="__reactFiber$"+xr,pi="__reactProps$"+xr,on="__reactContainer$"+xr,la="__reactEvents$"+xr,Cp="__reactListeners$"+xr,Np="__reactHandles$"+xr;function Gn(e){var t=e[Yt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[on]||n[Yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=cc(e);e!==null;){if(n=e[Yt])return n;e=cc(e)}return t}e=n,n=e.parentNode}return null}function mi(e){return e=e[Yt]||e[on],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Sr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function ul(e){return e[pi]||null}var sa=[],kr=-1;function Pn(e){return{current:e}}function Ie(e){0>kr||(e.current=sa[kr],sa[kr]=null,kr--)}function Le(e,t){kr++,sa[kr]=e.current,e.current=t}var Rn={},lt=Pn(Rn),mt=Pn(!1),Kn=Rn;function jr(e,t){var n=e.type.contextTypes;if(!n)return Rn;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var s={},u;for(u in n)s[u]=t[u];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function gt(e){return e=e.childContextTypes,e!=null}function cl(){Ie(mt),Ie(lt)}function dc(e,t,n){if(lt.current!==Rn)throw Error(o(168));Le(lt,t),Le(mt,n)}function fc(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var s in i)if(!(s in t))throw Error(o(108,me(e)||"Unknown",s));return G({},n,i)}function dl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Rn,Kn=lt.current,Le(lt,e),Le(mt,mt.current),!0}function hc(e,t,n){var i=e.stateNode;if(!i)throw Error(o(169));n?(e=fc(e,t,Kn),i.__reactInternalMemoizedMergedChildContext=e,Ie(mt),Ie(lt),Le(lt,e)):Ie(mt),Le(mt,n)}var un=null,fl=!1,aa=!1;function pc(e){un===null?un=[e]:un.push(e)}function Pp(e){fl=!0,pc(e)}function An(){if(!aa&&un!==null){aa=!0;var e=0,t=Ae;try{var n=un;for(Ae=1;e<n.length;e++){var i=n[e];do i=i(!0);while(i!==null)}un=null,fl=!1}catch(s){throw un!==null&&(un=un.slice(e+1)),gu(Rs,An),s}finally{Ae=t,aa=!1}}return null}var br=[],Er=0,hl=null,pl=0,Rt=[],At=0,qn=null,cn=1,dn="";function Qn(e,t){br[Er++]=pl,br[Er++]=hl,hl=e,pl=t}function mc(e,t,n){Rt[At++]=cn,Rt[At++]=dn,Rt[At++]=qn,qn=e;var i=cn;e=dn;var s=32-Ot(i)-1;i&=~(1<<s),n+=1;var u=32-Ot(t)+s;if(30<u){var f=s-s%5;u=(i&(1<<f)-1).toString(32),i>>=f,s-=f,cn=1<<32-Ot(t)+s|n<<s|i,dn=u+e}else cn=1<<u|n<<s|i,dn=e}function oa(e){e.return!==null&&(Qn(e,1),mc(e,1,0))}function ua(e){for(;e===hl;)hl=br[--Er],br[Er]=null,pl=br[--Er],br[Er]=null;for(;e===qn;)qn=Rt[--At],Rt[At]=null,dn=Rt[--At],Rt[At]=null,cn=Rt[--At],Rt[At]=null}var bt=null,Et=null,Te=!1,Bt=null;function gc(e,t){var n=Lt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function vc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,bt=e,Et=Nn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,bt=e,Et=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=qn!==null?{id:cn,overflow:dn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Lt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,bt=e,Et=null,!0):!1;default:return!1}}function ca(e){return(e.mode&1)!==0&&(e.flags&128)===0}function da(e){if(Te){var t=Et;if(t){var n=t;if(!vc(e,t)){if(ca(e))throw Error(o(418));t=Nn(n.nextSibling);var i=bt;t&&vc(e,t)?gc(i,n):(e.flags=e.flags&-4097|2,Te=!1,bt=e)}}else{if(ca(e))throw Error(o(418));e.flags=e.flags&-4097|2,Te=!1,bt=e}}}function wc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;bt=e}function ml(e){if(e!==bt)return!1;if(!Te)return wc(e),Te=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!na(e.type,e.memoizedProps)),t&&(t=Et)){if(ca(e))throw yc(),Error(o(418));for(;t;)gc(e,t),t=Nn(t.nextSibling)}if(wc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Et=Nn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Et=null}}else Et=bt?Nn(e.stateNode.nextSibling):null;return!0}function yc(){for(var e=Et;e;)e=Nn(e.nextSibling)}function Cr(){Et=bt=null,Te=!1}function fa(e){Bt===null?Bt=[e]:Bt.push(e)}var Rp=ue.ReactCurrentBatchConfig;function gi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(o(309));var i=n.stateNode}if(!i)throw Error(o(147,e));var s=i,u=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===u?t.ref:(t=function(f){var v=s.refs;f===null?delete v[u]:v[u]=f},t._stringRef=u,t)}if(typeof e!="string")throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function gl(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xc(e){var t=e._init;return t(e._payload)}function Sc(e){function t(C,S){if(e){var P=C.deletions;P===null?(C.deletions=[S],C.flags|=16):P.push(S)}}function n(C,S){if(!e)return null;for(;S!==null;)t(C,S),S=S.sibling;return null}function i(C,S){for(C=new Map;S!==null;)S.key!==null?C.set(S.key,S):C.set(S.index,S),S=S.sibling;return C}function s(C,S){return C=Wn(C,S),C.index=0,C.sibling=null,C}function u(C,S,P){return C.index=P,e?(P=C.alternate,P!==null?(P=P.index,P<S?(C.flags|=2,S):P):(C.flags|=2,S)):(C.flags|=1048576,S)}function f(C){return e&&C.alternate===null&&(C.flags|=2),C}function v(C,S,P,H){return S===null||S.tag!==6?(S=ro(P,C.mode,H),S.return=C,S):(S=s(S,P),S.return=C,S)}function y(C,S,P,H){var ie=P.type;return ie===be?T(C,S,P.props.children,H,P.key):S!==null&&(S.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===ce&&xc(ie)===S.type)?(H=s(S,P.props),H.ref=gi(C,S,P),H.return=C,H):(H=Fl(P.type,P.key,P.props,null,C.mode,H),H.ref=gi(C,S,P),H.return=C,H)}function A(C,S,P,H){return S===null||S.tag!==4||S.stateNode.containerInfo!==P.containerInfo||S.stateNode.implementation!==P.implementation?(S=io(P,C.mode,H),S.return=C,S):(S=s(S,P.children||[]),S.return=C,S)}function T(C,S,P,H,ie){return S===null||S.tag!==7?(S=rr(P,C.mode,H,ie),S.return=C,S):(S=s(S,P),S.return=C,S)}function B(C,S,P){if(typeof S=="string"&&S!==""||typeof S=="number")return S=ro(""+S,C.mode,P),S.return=C,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case le:return P=Fl(S.type,S.key,S.props,null,C.mode,P),P.ref=gi(C,null,S),P.return=C,P;case ke:return S=io(S,C.mode,P),S.return=C,S;case ce:var H=S._init;return B(C,H(S._payload),P)}if(Hr(S)||se(S))return S=rr(S,C.mode,P,null),S.return=C,S;gl(C,S)}return null}function I(C,S,P,H){var ie=S!==null?S.key:null;if(typeof P=="string"&&P!==""||typeof P=="number")return ie!==null?null:v(C,S,""+P,H);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case le:return P.key===ie?y(C,S,P,H):null;case ke:return P.key===ie?A(C,S,P,H):null;case ce:return ie=P._init,I(C,S,ie(P._payload),H)}if(Hr(P)||se(P))return ie!==null?null:T(C,S,P,H,null);gl(C,P)}return null}function Q(C,S,P,H,ie){if(typeof H=="string"&&H!==""||typeof H=="number")return C=C.get(P)||null,v(S,C,""+H,ie);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case le:return C=C.get(H.key===null?P:H.key)||null,y(S,C,H,ie);case ke:return C=C.get(H.key===null?P:H.key)||null,A(S,C,H,ie);case ce:var de=H._init;return Q(C,S,P,de(H._payload),ie)}if(Hr(H)||se(H))return C=C.get(P)||null,T(S,C,H,ie,null);gl(S,H)}return null}function X(C,S,P,H){for(var ie=null,de=null,fe=S,we=S=0,et=null;fe!==null&&we<P.length;we++){fe.index>we?(et=fe,fe=null):et=fe.sibling;var Pe=I(C,fe,P[we],H);if(Pe===null){fe===null&&(fe=et);break}e&&fe&&Pe.alternate===null&&t(C,fe),S=u(Pe,S,we),de===null?ie=Pe:de.sibling=Pe,de=Pe,fe=et}if(we===P.length)return n(C,fe),Te&&Qn(C,we),ie;if(fe===null){for(;we<P.length;we++)fe=B(C,P[we],H),fe!==null&&(S=u(fe,S,we),de===null?ie=fe:de.sibling=fe,de=fe);return Te&&Qn(C,we),ie}for(fe=i(C,fe);we<P.length;we++)et=Q(fe,C,we,P[we],H),et!==null&&(e&&et.alternate!==null&&fe.delete(et.key===null?we:et.key),S=u(et,S,we),de===null?ie=et:de.sibling=et,de=et);return e&&fe.forEach(function(On){return t(C,On)}),Te&&Qn(C,we),ie}function te(C,S,P,H){var ie=se(P);if(typeof ie!="function")throw Error(o(150));if(P=ie.call(P),P==null)throw Error(o(151));for(var de=ie=null,fe=S,we=S=0,et=null,Pe=P.next();fe!==null&&!Pe.done;we++,Pe=P.next()){fe.index>we?(et=fe,fe=null):et=fe.sibling;var On=I(C,fe,Pe.value,H);if(On===null){fe===null&&(fe=et);break}e&&fe&&On.alternate===null&&t(C,fe),S=u(On,S,we),de===null?ie=On:de.sibling=On,de=On,fe=et}if(Pe.done)return n(C,fe),Te&&Qn(C,we),ie;if(fe===null){for(;!Pe.done;we++,Pe=P.next())Pe=B(C,Pe.value,H),Pe!==null&&(S=u(Pe,S,we),de===null?ie=Pe:de.sibling=Pe,de=Pe);return Te&&Qn(C,we),ie}for(fe=i(C,fe);!Pe.done;we++,Pe=P.next())Pe=Q(fe,C,we,Pe.value,H),Pe!==null&&(e&&Pe.alternate!==null&&fe.delete(Pe.key===null?we:Pe.key),S=u(Pe,S,we),de===null?ie=Pe:de.sibling=Pe,de=Pe);return e&&fe.forEach(function(om){return t(C,om)}),Te&&Qn(C,we),ie}function Ke(C,S,P,H){if(typeof P=="object"&&P!==null&&P.type===be&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case le:e:{for(var ie=P.key,de=S;de!==null;){if(de.key===ie){if(ie=P.type,ie===be){if(de.tag===7){n(C,de.sibling),S=s(de,P.props.children),S.return=C,C=S;break e}}else if(de.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===ce&&xc(ie)===de.type){n(C,de.sibling),S=s(de,P.props),S.ref=gi(C,de,P),S.return=C,C=S;break e}n(C,de);break}else t(C,de);de=de.sibling}P.type===be?(S=rr(P.props.children,C.mode,H,P.key),S.return=C,C=S):(H=Fl(P.type,P.key,P.props,null,C.mode,H),H.ref=gi(C,S,P),H.return=C,C=H)}return f(C);case ke:e:{for(de=P.key;S!==null;){if(S.key===de)if(S.tag===4&&S.stateNode.containerInfo===P.containerInfo&&S.stateNode.implementation===P.implementation){n(C,S.sibling),S=s(S,P.children||[]),S.return=C,C=S;break e}else{n(C,S);break}else t(C,S);S=S.sibling}S=io(P,C.mode,H),S.return=C,C=S}return f(C);case ce:return de=P._init,Ke(C,S,de(P._payload),H)}if(Hr(P))return X(C,S,P,H);if(se(P))return te(C,S,P,H);gl(C,P)}return typeof P=="string"&&P!==""||typeof P=="number"?(P=""+P,S!==null&&S.tag===6?(n(C,S.sibling),S=s(S,P),S.return=C,C=S):(n(C,S),S=ro(P,C.mode,H),S.return=C,C=S),f(C)):n(C,S)}return Ke}var Nr=Sc(!0),kc=Sc(!1),vl=Pn(null),wl=null,Pr=null,ha=null;function pa(){ha=Pr=wl=null}function ma(e){var t=vl.current;Ie(vl),e._currentValue=t}function ga(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function Rr(e,t){wl=e,ha=Pr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(vt=!0),e.firstContext=null)}function zt(e){var t=e._currentValue;if(ha!==e)if(e={context:e,memoizedValue:t,next:null},Pr===null){if(wl===null)throw Error(o(308));Pr=e,wl.dependencies={lanes:0,firstContext:e}}else Pr=Pr.next=e;return t}var Zn=null;function va(e){Zn===null?Zn=[e]:Zn.push(e)}function jc(e,t,n,i){var s=t.interleaved;return s===null?(n.next=n,va(t)):(n.next=s.next,s.next=n),t.interleaved=n,fn(e,i)}function fn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var zn=!1;function wa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function hn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Mn(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ne&2)!==0){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,fn(e,n)}return s=i.interleaved,s===null?(t.next=t,va(i)):(t.next=s.next,s.next=t),i.interleaved=t,fn(e,n)}function yl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ms(e,n)}}function Ec(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var s=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var f={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};u===null?s=u=f:u=u.next=f,n=n.next}while(n!==null);u===null?s=u=t:u=u.next=t}else s=u=t;n={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:u,shared:i.shared,effects:i.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function xl(e,t,n,i){var s=e.updateQueue;zn=!1;var u=s.firstBaseUpdate,f=s.lastBaseUpdate,v=s.shared.pending;if(v!==null){s.shared.pending=null;var y=v,A=y.next;y.next=null,f===null?u=A:f.next=A,f=y;var T=e.alternate;T!==null&&(T=T.updateQueue,v=T.lastBaseUpdate,v!==f&&(v===null?T.firstBaseUpdate=A:v.next=A,T.lastBaseUpdate=y))}if(u!==null){var B=s.baseState;f=0,T=A=y=null,v=u;do{var I=v.lane,Q=v.eventTime;if((i&I)===I){T!==null&&(T=T.next={eventTime:Q,lane:0,tag:v.tag,payload:v.payload,callback:v.callback,next:null});e:{var X=e,te=v;switch(I=t,Q=n,te.tag){case 1:if(X=te.payload,typeof X=="function"){B=X.call(Q,B,I);break e}B=X;break e;case 3:X.flags=X.flags&-65537|128;case 0:if(X=te.payload,I=typeof X=="function"?X.call(Q,B,I):X,I==null)break e;B=G({},B,I);break e;case 2:zn=!0}}v.callback!==null&&v.lane!==0&&(e.flags|=64,I=s.effects,I===null?s.effects=[v]:I.push(v))}else Q={eventTime:Q,lane:I,tag:v.tag,payload:v.payload,callback:v.callback,next:null},T===null?(A=T=Q,y=B):T=T.next=Q,f|=I;if(v=v.next,v===null){if(v=s.shared.pending,v===null)break;I=v,v=I.next,I.next=null,s.lastBaseUpdate=I,s.shared.pending=null}}while(!0);if(T===null&&(y=B),s.baseState=y,s.firstBaseUpdate=A,s.lastBaseUpdate=T,t=s.shared.interleaved,t!==null){s=t;do f|=s.lane,s=s.next;while(s!==t)}else u===null&&(s.shared.lanes=0);Jn|=f,e.lanes=f,e.memoizedState=B}}function Cc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],s=i.callback;if(s!==null){if(i.callback=null,i=n,typeof s!="function")throw Error(o(191,s));s.call(i)}}}var vi={},Xt=Pn(vi),wi=Pn(vi),yi=Pn(vi);function Yn(e){if(e===vi)throw Error(o(174));return e}function ya(e,t){switch(Le(yi,t),Le(wi,e),Le(Xt,vi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:xs(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=xs(t,e)}Ie(Xt),Le(Xt,t)}function Ar(){Ie(Xt),Ie(wi),Ie(yi)}function Nc(e){Yn(yi.current);var t=Yn(Xt.current),n=xs(t,e.type);t!==n&&(Le(wi,e),Le(Xt,n))}function xa(e){wi.current===e&&(Ie(Xt),Ie(wi))}var Fe=Pn(0);function Sl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Sa=[];function ka(){for(var e=0;e<Sa.length;e++)Sa[e]._workInProgressVersionPrimary=null;Sa.length=0}var kl=ue.ReactCurrentDispatcher,ja=ue.ReactCurrentBatchConfig,Xn=0,Be=null,Ze=null,Xe=null,jl=!1,xi=!1,Si=0,Ap=0;function st(){throw Error(o(321))}function ba(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ft(e[n],t[n]))return!1;return!0}function Ea(e,t,n,i,s,u){if(Xn=u,Be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,kl.current=e===null||e.memoizedState===null?Lp:Dp,e=n(i,s),xi){u=0;do{if(xi=!1,Si=0,25<=u)throw Error(o(301));u+=1,Xe=Ze=null,t.updateQueue=null,kl.current=Ip,e=n(i,s)}while(xi)}if(kl.current=Cl,t=Ze!==null&&Ze.next!==null,Xn=0,Xe=Ze=Be=null,jl=!1,t)throw Error(o(300));return e}function Ca(){var e=Si!==0;return Si=0,e}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?Be.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Mt(){if(Ze===null){var e=Be.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var t=Xe===null?Be.memoizedState:Xe.next;if(t!==null)Xe=t,Ze=e;else{if(e===null)throw Error(o(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},Xe===null?Be.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function ki(e,t){return typeof t=="function"?t(e):t}function Na(e){var t=Mt(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var i=Ze,s=i.baseQueue,u=n.pending;if(u!==null){if(s!==null){var f=s.next;s.next=u.next,u.next=f}i.baseQueue=s=u,n.pending=null}if(s!==null){u=s.next,i=i.baseState;var v=f=null,y=null,A=u;do{var T=A.lane;if((Xn&T)===T)y!==null&&(y=y.next={lane:0,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null}),i=A.hasEagerState?A.eagerState:e(i,A.action);else{var B={lane:T,action:A.action,hasEagerState:A.hasEagerState,eagerState:A.eagerState,next:null};y===null?(v=y=B,f=i):y=y.next=B,Be.lanes|=T,Jn|=T}A=A.next}while(A!==null&&A!==u);y===null?f=i:y.next=v,Ft(i,t.memoizedState)||(vt=!0),t.memoizedState=i,t.baseState=f,t.baseQueue=y,n.lastRenderedState=i}if(e=n.interleaved,e!==null){s=e;do u=s.lane,Be.lanes|=u,Jn|=u,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Pa(e){var t=Mt(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var i=n.dispatch,s=n.pending,u=t.memoizedState;if(s!==null){n.pending=null;var f=s=s.next;do u=e(u,f.action),f=f.next;while(f!==s);Ft(u,t.memoizedState)||(vt=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,i]}function Pc(){}function Rc(e,t){var n=Be,i=Mt(),s=t(),u=!Ft(i.memoizedState,s);if(u&&(i.memoizedState=s,vt=!0),i=i.queue,Ra(Mc.bind(null,n,i,e),[e]),i.getSnapshot!==t||u||Xe!==null&&Xe.memoizedState.tag&1){if(n.flags|=2048,ji(9,zc.bind(null,n,i,s,t),void 0,null),Je===null)throw Error(o(349));(Xn&30)!==0||Ac(n,t,s)}return s}function Ac(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Be.updateQueue,t===null?(t={lastEffect:null,stores:null},Be.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zc(e,t,n,i){t.value=n,t.getSnapshot=i,_c(t)&&Lc(e)}function Mc(e,t,n){return n(function(){_c(t)&&Lc(e)})}function _c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ft(e,n)}catch{return!0}}function Lc(e){var t=fn(e,1);t!==null&&Ht(t,e,1,-1)}function Dc(e){var t=Jt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:e},t.queue=e,e=e.dispatch=_p.bind(null,Be,e),[t.memoizedState,e]}function ji(e,t,n,i){return e={tag:e,create:t,destroy:n,deps:i,next:null},t=Be.updateQueue,t===null?(t={lastEffect:null,stores:null},Be.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e)),e}function Ic(){return Mt().memoizedState}function bl(e,t,n,i){var s=Jt();Be.flags|=e,s.memoizedState=ji(1|t,n,void 0,i===void 0?null:i)}function El(e,t,n,i){var s=Mt();i=i===void 0?null:i;var u=void 0;if(Ze!==null){var f=Ze.memoizedState;if(u=f.destroy,i!==null&&ba(i,f.deps)){s.memoizedState=ji(t,n,u,i);return}}Be.flags|=e,s.memoizedState=ji(1|t,n,u,i)}function Tc(e,t){return bl(8390656,8,e,t)}function Ra(e,t){return El(2048,8,e,t)}function Wc(e,t){return El(4,2,e,t)}function Oc(e,t){return El(4,4,e,t)}function Fc(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Bc(e,t,n){return n=n!=null?n.concat([e]):null,El(4,4,Fc.bind(null,t,e),n)}function Aa(){}function Vc(e,t){var n=Mt();t=t===void 0?null:t;var i=n.memoizedState;return i!==null&&t!==null&&ba(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function $c(e,t){var n=Mt();t=t===void 0?null:t;var i=n.memoizedState;return i!==null&&t!==null&&ba(t,i[1])?i[0]:(e=e(),n.memoizedState=[e,t],e)}function Uc(e,t,n){return(Xn&21)===0?(e.baseState&&(e.baseState=!1,vt=!0),e.memoizedState=n):(Ft(n,t)||(n=xu(),Be.lanes|=n,Jn|=n,e.baseState=!0),t)}function zp(e,t){var n=Ae;Ae=n!==0&&4>n?n:4,e(!0);var i=ja.transition;ja.transition={};try{e(!1),t()}finally{Ae=n,ja.transition=i}}function Hc(){return Mt().memoizedState}function Mp(e,t,n){var i=In(e);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},Gc(e))Kc(t,n);else if(n=jc(e,t,n,i),n!==null){var s=ft();Ht(n,e,i,s),qc(n,t,i)}}function _p(e,t,n){var i=In(e),s={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gc(e))Kc(t,s);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var f=t.lastRenderedState,v=u(f,n);if(s.hasEagerState=!0,s.eagerState=v,Ft(v,f)){var y=t.interleaved;y===null?(s.next=s,va(t)):(s.next=y.next,y.next=s),t.interleaved=s;return}}catch{}n=jc(e,t,s,i),n!==null&&(s=ft(),Ht(n,e,i,s),qc(n,t,i))}}function Gc(e){var t=e.alternate;return e===Be||t!==null&&t===Be}function Kc(e,t){xi=jl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qc(e,t,n){if((n&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,Ms(e,n)}}var Cl={readContext:zt,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useInsertionEffect:st,useLayoutEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useMutableSource:st,useSyncExternalStore:st,useId:st,unstable_isNewReconciler:!1},Lp={readContext:zt,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:zt,useEffect:Tc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,bl(4194308,4,Fc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bl(4194308,4,e,t)},useInsertionEffect:function(e,t){return bl(4,2,e,t)},useMemo:function(e,t){var n=Jt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=Jt();return t=n!==void 0?n(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Mp.bind(null,Be,e),[i.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:Dc,useDebugValue:Aa,useDeferredValue:function(e){return Jt().memoizedState=e},useTransition:function(){var e=Dc(!1),t=e[0];return e=zp.bind(null,e[1]),Jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Be,s=Jt();if(Te){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),Je===null)throw Error(o(349));(Xn&30)!==0||Ac(i,t,n)}s.memoizedState=n;var u={value:n,getSnapshot:t};return s.queue=u,Tc(Mc.bind(null,i,u,e),[e]),i.flags|=2048,ji(9,zc.bind(null,i,u,n,t),void 0,null),n},useId:function(){var e=Jt(),t=Je.identifierPrefix;if(Te){var n=dn,i=cn;n=(i&~(1<<32-Ot(i)-1)).toString(32)+n,t=":"+t+"R"+n,n=Si++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Ap++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Dp={readContext:zt,useCallback:Vc,useContext:zt,useEffect:Ra,useImperativeHandle:Bc,useInsertionEffect:Wc,useLayoutEffect:Oc,useMemo:$c,useReducer:Na,useRef:Ic,useState:function(){return Na(ki)},useDebugValue:Aa,useDeferredValue:function(e){var t=Mt();return Uc(t,Ze.memoizedState,e)},useTransition:function(){var e=Na(ki)[0],t=Mt().memoizedState;return[e,t]},useMutableSource:Pc,useSyncExternalStore:Rc,useId:Hc,unstable_isNewReconciler:!1},Ip={readContext:zt,useCallback:Vc,useContext:zt,useEffect:Ra,useImperativeHandle:Bc,useInsertionEffect:Wc,useLayoutEffect:Oc,useMemo:$c,useReducer:Pa,useRef:Ic,useState:function(){return Pa(ki)},useDebugValue:Aa,useDeferredValue:function(e){var t=Mt();return Ze===null?t.memoizedState=e:Uc(t,Ze.memoizedState,e)},useTransition:function(){var e=Pa(ki)[0],t=Mt().memoizedState;return[e,t]},useMutableSource:Pc,useSyncExternalStore:Rc,useId:Hc,unstable_isNewReconciler:!1};function Vt(e,t){if(e&&e.defaultProps){t=G({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function za(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:G({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Nl={isMounted:function(e){return(e=e._reactInternals)?Hn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var i=ft(),s=In(e),u=hn(i,s);u.payload=t,n!=null&&(u.callback=n),t=Mn(e,u,s),t!==null&&(Ht(t,e,s,i),yl(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=ft(),s=In(e),u=hn(i,s);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=Mn(e,u,s),t!==null&&(Ht(t,e,s,i),yl(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ft(),i=In(e),s=hn(n,i);s.tag=2,t!=null&&(s.callback=t),t=Mn(e,s,i),t!==null&&(Ht(t,e,i,n),yl(t,e,i))}};function Qc(e,t,n,i,s,u,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,u,f):t.prototype&&t.prototype.isPureReactComponent?!ui(n,i)||!ui(s,u):!0}function Zc(e,t,n){var i=!1,s=Rn,u=t.contextType;return typeof u=="object"&&u!==null?u=zt(u):(s=gt(t)?Kn:lt.current,i=t.contextTypes,u=(i=i!=null)?jr(e,s):Rn),t=new t(n,u),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Nl,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=u),t}function Yc(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Nl.enqueueReplaceState(t,t.state,null)}function Ma(e,t,n,i){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},wa(e);var u=t.contextType;typeof u=="object"&&u!==null?s.context=zt(u):(u=gt(t)?Kn:lt.current,s.context=jr(e,u)),s.state=e.memoizedState,u=t.getDerivedStateFromProps,typeof u=="function"&&(za(e,t,u,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Nl.enqueueReplaceState(s,s.state,null),xl(e,n,s,i),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function zr(e,t){try{var n="",i=t;do n+=V(i),i=i.return;while(i);var s=n}catch(u){s=`
|
|
7
|
-
Error generating stack: `+u.message+`
|
|
8
|
-
`+u.stack}return{value:e,source:t,stack:s,digest:null}}function _a(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function La(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Tp=typeof WeakMap=="function"?WeakMap:Map;function Xc(e,t,n){n=hn(-1,n),n.tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){Ll||(Ll=!0,Qa=i),La(e,t)},n}function Jc(e,t,n){n=hn(-1,n),n.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var s=t.value;n.payload=function(){return i(s)},n.callback=function(){La(e,t)}}var u=e.stateNode;return u!==null&&typeof u.componentDidCatch=="function"&&(n.callback=function(){La(e,t),typeof i!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var f=t.stack;this.componentDidCatch(t.value,{componentStack:f!==null?f:""})}),n}function ed(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Tp;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(n)||(s.add(n),e=Yp.bind(null,e,t,n),t.then(e,e))}function td(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function nd(e,t,n,i,s){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=hn(-1,1),t.tag=2,Mn(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=s,e)}var Wp=ue.ReactCurrentOwner,vt=!1;function dt(e,t,n,i){t.child=e===null?kc(t,null,n,i):Nr(t,e.child,n,i)}function rd(e,t,n,i,s){n=n.render;var u=t.ref;return Rr(t,s),i=Ea(e,t,n,i,u,s),n=Ca(),e!==null&&!vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,pn(e,t,s)):(Te&&n&&oa(t),t.flags|=1,dt(e,t,i,s),t.child)}function id(e,t,n,i,s){if(e===null){var u=n.type;return typeof u=="function"&&!no(u)&&u.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=u,ld(e,t,u,i,s)):(e=Fl(n.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,(e.lanes&s)===0){var f=u.memoizedProps;if(n=n.compare,n=n!==null?n:ui,n(f,i)&&e.ref===t.ref)return pn(e,t,s)}return t.flags|=1,e=Wn(u,i),e.ref=t.ref,e.return=t,t.child=e}function ld(e,t,n,i,s){if(e!==null){var u=e.memoizedProps;if(ui(u,i)&&e.ref===t.ref)if(vt=!1,t.pendingProps=i=u,(e.lanes&s)!==0)(e.flags&131072)!==0&&(vt=!0);else return t.lanes=e.lanes,pn(e,t,s)}return Da(e,t,n,i,s)}function sd(e,t,n){var i=t.pendingProps,s=i.children,u=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Le(_r,Ct),Ct|=n;else{if((n&1073741824)===0)return e=u!==null?u.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Le(_r,Ct),Ct|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=u!==null?u.baseLanes:n,Le(_r,Ct),Ct|=i}else u!==null?(i=u.baseLanes|n,t.memoizedState=null):i=n,Le(_r,Ct),Ct|=i;return dt(e,t,s,n),t.child}function ad(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Da(e,t,n,i,s){var u=gt(n)?Kn:lt.current;return u=jr(t,u),Rr(t,s),n=Ea(e,t,n,i,u,s),i=Ca(),e!==null&&!vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,pn(e,t,s)):(Te&&i&&oa(t),t.flags|=1,dt(e,t,n,s),t.child)}function od(e,t,n,i,s){if(gt(n)){var u=!0;dl(t)}else u=!1;if(Rr(t,s),t.stateNode===null)Rl(e,t),Zc(t,n,i),Ma(t,n,i,s),i=!0;else if(e===null){var f=t.stateNode,v=t.memoizedProps;f.props=v;var y=f.context,A=n.contextType;typeof A=="object"&&A!==null?A=zt(A):(A=gt(n)?Kn:lt.current,A=jr(t,A));var T=n.getDerivedStateFromProps,B=typeof T=="function"||typeof f.getSnapshotBeforeUpdate=="function";B||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v!==i||y!==A)&&Yc(t,f,i,A),zn=!1;var I=t.memoizedState;f.state=I,xl(t,i,f,s),y=t.memoizedState,v!==i||I!==y||mt.current||zn?(typeof T=="function"&&(za(t,n,T,i),y=t.memoizedState),(v=zn||Qc(t,n,v,i,I,y,A))?(B||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=y),f.props=i,f.state=y,f.context=A,i=v):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,bc(e,t),v=t.memoizedProps,A=t.type===t.elementType?v:Vt(t.type,v),f.props=A,B=t.pendingProps,I=f.context,y=n.contextType,typeof y=="object"&&y!==null?y=zt(y):(y=gt(n)?Kn:lt.current,y=jr(t,y));var Q=n.getDerivedStateFromProps;(T=typeof Q=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v!==B||I!==y)&&Yc(t,f,i,y),zn=!1,I=t.memoizedState,f.state=I,xl(t,i,f,s);var X=t.memoizedState;v!==B||I!==X||mt.current||zn?(typeof Q=="function"&&(za(t,n,Q,i),X=t.memoizedState),(A=zn||Qc(t,n,A,i,I,X,y)||!1)?(T||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,X,y),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,X,y)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&I===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&I===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=X),f.props=i,f.state=X,f.context=y,i=A):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&I===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&I===e.memoizedState||(t.flags|=1024),i=!1)}return Ia(e,t,n,i,u,s)}function Ia(e,t,n,i,s,u){ad(e,t);var f=(t.flags&128)!==0;if(!i&&!f)return s&&hc(t,n,!1),pn(e,t,u);i=t.stateNode,Wp.current=t;var v=f&&typeof n.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&f?(t.child=Nr(t,e.child,null,u),t.child=Nr(t,null,v,u)):dt(e,t,v,u),t.memoizedState=i.state,s&&hc(t,n,!0),t.child}function ud(e){var t=e.stateNode;t.pendingContext?dc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&dc(e,t.context,!1),ya(e,t.containerInfo)}function cd(e,t,n,i,s){return Cr(),fa(s),t.flags|=256,dt(e,t,n,i),t.child}var Ta={dehydrated:null,treeContext:null,retryLane:0};function Wa(e){return{baseLanes:e,cachePool:null,transitions:null}}function dd(e,t,n){var i=t.pendingProps,s=Fe.current,u=!1,f=(t.flags&128)!==0,v;if((v=f)||(v=e!==null&&e.memoizedState===null?!1:(s&2)!==0),v?(u=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Le(Fe,s&1),e===null)return da(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(f=i.children,e=i.fallback,u?(i=t.mode,u=t.child,f={mode:"hidden",children:f},(i&1)===0&&u!==null?(u.childLanes=0,u.pendingProps=f):u=Bl(f,i,0,null),e=rr(e,i,n,null),u.return=t,e.return=t,u.sibling=e,t.child=u,t.child.memoizedState=Wa(n),t.memoizedState=Ta,e):Oa(t,f));if(s=e.memoizedState,s!==null&&(v=s.dehydrated,v!==null))return Op(e,t,f,i,v,s,n);if(u){u=i.fallback,f=t.mode,s=e.child,v=s.sibling;var y={mode:"hidden",children:i.children};return(f&1)===0&&t.child!==s?(i=t.child,i.childLanes=0,i.pendingProps=y,t.deletions=null):(i=Wn(s,y),i.subtreeFlags=s.subtreeFlags&14680064),v!==null?u=Wn(v,u):(u=rr(u,f,n,null),u.flags|=2),u.return=t,i.return=t,i.sibling=u,t.child=i,i=u,u=t.child,f=e.child.memoizedState,f=f===null?Wa(n):{baseLanes:f.baseLanes|n,cachePool:null,transitions:f.transitions},u.memoizedState=f,u.childLanes=e.childLanes&~n,t.memoizedState=Ta,i}return u=e.child,e=u.sibling,i=Wn(u,{mode:"visible",children:i.children}),(t.mode&1)===0&&(i.lanes=n),i.return=t,i.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=i,t.memoizedState=null,i}function Oa(e,t){return t=Bl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Pl(e,t,n,i){return i!==null&&fa(i),Nr(t,e.child,null,n),e=Oa(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Op(e,t,n,i,s,u,f){if(n)return t.flags&256?(t.flags&=-257,i=_a(Error(o(422))),Pl(e,t,f,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(u=i.fallback,s=t.mode,i=Bl({mode:"visible",children:i.children},s,0,null),u=rr(u,s,f,null),u.flags|=2,i.return=t,u.return=t,i.sibling=u,t.child=i,(t.mode&1)!==0&&Nr(t,e.child,null,f),t.child.memoizedState=Wa(f),t.memoizedState=Ta,u);if((t.mode&1)===0)return Pl(e,t,f,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var v=i.dgst;return i=v,u=Error(o(419)),i=_a(u,i,void 0),Pl(e,t,f,i)}if(v=(f&e.childLanes)!==0,vt||v){if(i=Je,i!==null){switch(f&-f){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=(s&(i.suspendedLanes|f))!==0?0:s,s!==0&&s!==u.retryLane&&(u.retryLane=s,fn(e,s),Ht(i,e,s,-1))}return to(),i=_a(Error(o(421))),Pl(e,t,f,i)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Xp.bind(null,e),s._reactRetry=t,null):(e=u.treeContext,Et=Nn(s.nextSibling),bt=t,Te=!0,Bt=null,e!==null&&(Rt[At++]=cn,Rt[At++]=dn,Rt[At++]=qn,cn=e.id,dn=e.overflow,qn=t),t=Oa(t,i.children),t.flags|=4096,t)}function fd(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),ga(e.return,t,n)}function Fa(e,t,n,i,s){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:s}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=i,u.tail=n,u.tailMode=s)}function hd(e,t,n){var i=t.pendingProps,s=i.revealOrder,u=i.tail;if(dt(e,t,i.children,n),i=Fe.current,(i&2)!==0)i=i&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fd(e,n,t);else if(e.tag===19)fd(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Le(Fe,i),(t.mode&1)===0)t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Sl(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Fa(t,!1,s,n,u);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Sl(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Fa(t,!0,n,null,u);break;case"together":Fa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Rl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function pn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jn|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=Wn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fp(e,t,n){switch(t.tag){case 3:ud(t),Cr();break;case 5:Nc(t);break;case 1:gt(t.type)&&dl(t);break;case 4:ya(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,s=t.memoizedProps.value;Le(vl,i._currentValue),i._currentValue=s;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(Le(Fe,Fe.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?dd(e,t,n):(Le(Fe,Fe.current&1),e=pn(e,t,n),e!==null?e.sibling:null);Le(Fe,Fe.current&1);break;case 19:if(i=(n&t.childLanes)!==0,(e.flags&128)!==0){if(i)return hd(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Le(Fe,Fe.current),i)break;return null;case 22:case 23:return t.lanes=0,sd(e,t,n)}return pn(e,t,n)}var pd,Ba,md,gd;pd=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ba=function(){},md=function(e,t,n,i){var s=e.memoizedProps;if(s!==i){e=t.stateNode,Yn(Xt.current);var u=null;switch(n){case"input":s=$e(e,s),i=$e(e,i),u=[];break;case"select":s=G({},s,{value:void 0}),i=G({},i,{value:void 0}),u=[];break;case"textarea":s=ys(e,s),i=ys(e,i),u=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=ol)}Ss(n,i);var f;n=null;for(A in s)if(!i.hasOwnProperty(A)&&s.hasOwnProperty(A)&&s[A]!=null)if(A==="style"){var v=s[A];for(f in v)v.hasOwnProperty(f)&&(n||(n={}),n[f]="")}else A!=="dangerouslySetInnerHTML"&&A!=="children"&&A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(c.hasOwnProperty(A)?u||(u=[]):(u=u||[]).push(A,null));for(A in i){var y=i[A];if(v=s?.[A],i.hasOwnProperty(A)&&y!==v&&(y!=null||v!=null))if(A==="style")if(v){for(f in v)!v.hasOwnProperty(f)||y&&y.hasOwnProperty(f)||(n||(n={}),n[f]="");for(f in y)y.hasOwnProperty(f)&&v[f]!==y[f]&&(n||(n={}),n[f]=y[f])}else n||(u||(u=[]),u.push(A,n)),n=y;else A==="dangerouslySetInnerHTML"?(y=y?y.__html:void 0,v=v?v.__html:void 0,y!=null&&v!==y&&(u=u||[]).push(A,y)):A==="children"?typeof y!="string"&&typeof y!="number"||(u=u||[]).push(A,""+y):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&(c.hasOwnProperty(A)?(y!=null&&A==="onScroll"&&De("scroll",e),u||v===y||(u=[])):(u=u||[]).push(A,y))}n&&(u=u||[]).push("style",n);var A=u;(t.updateQueue=A)&&(t.flags|=4)}},gd=function(e,t,n,i){n!==i&&(t.flags|=4)};function bi(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function at(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,i|=s.subtreeFlags&14680064,i|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function Bp(e,t,n){var i=t.pendingProps;switch(ua(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return at(t),null;case 1:return gt(t.type)&&cl(),at(t),null;case 3:return i=t.stateNode,Ar(),Ie(mt),Ie(lt),ka(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ml(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Bt!==null&&(Xa(Bt),Bt=null))),Ba(e,t),at(t),null;case 5:xa(t);var s=Yn(yi.current);if(n=t.type,e!==null&&t.stateNode!=null)md(e,t,n,i,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(o(166));return at(t),null}if(e=Yn(Xt.current),ml(t)){i=t.stateNode,n=t.type;var u=t.memoizedProps;switch(i[Yt]=t,i[pi]=u,e=(t.mode&1)!==0,n){case"dialog":De("cancel",i),De("close",i);break;case"iframe":case"object":case"embed":De("load",i);break;case"video":case"audio":for(s=0;s<di.length;s++)De(di[s],i);break;case"source":De("error",i);break;case"img":case"image":case"link":De("error",i),De("load",i);break;case"details":De("toggle",i);break;case"input":kt(i,u),De("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!u.multiple},De("invalid",i);break;case"textarea":Jo(i,u),De("invalid",i)}Ss(n,u),s=null;for(var f in u)if(u.hasOwnProperty(f)){var v=u[f];f==="children"?typeof v=="string"?i.textContent!==v&&(u.suppressHydrationWarning!==!0&&al(i.textContent,v,e),s=["children",v]):typeof v=="number"&&i.textContent!==""+v&&(u.suppressHydrationWarning!==!0&&al(i.textContent,v,e),s=["children",""+v]):c.hasOwnProperty(f)&&v!=null&&f==="onScroll"&&De("scroll",i)}switch(n){case"input":Un(i),Xo(i,u,!0);break;case"textarea":Un(i),tu(i);break;case"select":case"option":break;default:typeof u.onClick=="function"&&(i.onclick=ol)}i=s,t.updateQueue=i,i!==null&&(t.flags|=4)}else{f=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=nu(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=f.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=f.createElement(n,{is:i.is}):(e=f.createElement(n),n==="select"&&(f=e,i.multiple?f.multiple=!0:i.size&&(f.size=i.size))):e=f.createElementNS(e,n),e[Yt]=t,e[pi]=i,pd(e,t,!1,!1),t.stateNode=e;e:{switch(f=ks(n,i),n){case"dialog":De("cancel",e),De("close",e),s=i;break;case"iframe":case"object":case"embed":De("load",e),s=i;break;case"video":case"audio":for(s=0;s<di.length;s++)De(di[s],e);s=i;break;case"source":De("error",e),s=i;break;case"img":case"image":case"link":De("error",e),De("load",e),s=i;break;case"details":De("toggle",e),s=i;break;case"input":kt(e,i),s=$e(e,i),De("invalid",e);break;case"option":s=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},s=G({},i,{value:void 0}),De("invalid",e);break;case"textarea":Jo(e,i),s=ys(e,i),De("invalid",e);break;default:s=i}Ss(n,s),v=s;for(u in v)if(v.hasOwnProperty(u)){var y=v[u];u==="style"?lu(e,y):u==="dangerouslySetInnerHTML"?(y=y?y.__html:void 0,y!=null&&ru(e,y)):u==="children"?typeof y=="string"?(n!=="textarea"||y!=="")&&Gr(e,y):typeof y=="number"&&Gr(e,""+y):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(c.hasOwnProperty(u)?y!=null&&u==="onScroll"&&De("scroll",e):y!=null&&O(e,u,y,f))}switch(n){case"input":Un(e),Xo(e,i,!1);break;case"textarea":Un(e),tu(e);break;case"option":i.value!=null&&e.setAttribute("value",""+ae(i.value));break;case"select":e.multiple=!!i.multiple,u=i.value,u!=null?dr(e,!!i.multiple,u,!1):i.defaultValue!=null&&dr(e,!!i.multiple,i.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=ol)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return at(t),null;case 6:if(e&&t.stateNode!=null)gd(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(n=Yn(yi.current),Yn(Xt.current),ml(t)){if(i=t.stateNode,n=t.memoizedProps,i[Yt]=t,(u=i.nodeValue!==n)&&(e=bt,e!==null))switch(e.tag){case 3:al(i.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&al(i.nodeValue,n,(e.mode&1)!==0)}u&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Yt]=t,t.stateNode=i}return at(t),null;case 13:if(Ie(Fe),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Te&&Et!==null&&(t.mode&1)!==0&&(t.flags&128)===0)yc(),Cr(),t.flags|=98560,u=!1;else if(u=ml(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(o(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Yt]=t}else Cr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;at(t),u=!1}else Bt!==null&&(Xa(Bt),Bt=null),u=!0;if(!u)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Fe.current&1)!==0?Ye===0&&(Ye=3):to())),t.updateQueue!==null&&(t.flags|=4),at(t),null);case 4:return Ar(),Ba(e,t),e===null&&fi(t.stateNode.containerInfo),at(t),null;case 10:return ma(t.type._context),at(t),null;case 17:return gt(t.type)&&cl(),at(t),null;case 19:if(Ie(Fe),u=t.memoizedState,u===null)return at(t),null;if(i=(t.flags&128)!==0,f=u.rendering,f===null)if(i)bi(u,!1);else{if(Ye!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Sl(e),f!==null){for(t.flags|=128,bi(u,!1),i=f.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)u=n,e=i,u.flags&=14680066,f=u.alternate,f===null?(u.childLanes=0,u.lanes=e,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=f.childLanes,u.lanes=f.lanes,u.child=f.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=f.memoizedProps,u.memoizedState=f.memoizedState,u.updateQueue=f.updateQueue,u.type=f.type,e=f.dependencies,u.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Le(Fe,Fe.current&1|2),t.child}e=e.sibling}u.tail!==null&&Ge()>Lr&&(t.flags|=128,i=!0,bi(u,!1),t.lanes=4194304)}else{if(!i)if(e=Sl(f),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),bi(u,!0),u.tail===null&&u.tailMode==="hidden"&&!f.alternate&&!Te)return at(t),null}else 2*Ge()-u.renderingStartTime>Lr&&n!==1073741824&&(t.flags|=128,i=!0,bi(u,!1),t.lanes=4194304);u.isBackwards?(f.sibling=t.child,t.child=f):(n=u.last,n!==null?n.sibling=f:t.child=f,u.last=f)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Ge(),t.sibling=null,n=Fe.current,Le(Fe,i?n&1|2:n&1),t):(at(t),null);case 22:case 23:return eo(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(Ct&1073741824)!==0&&(at(t),t.subtreeFlags&6&&(t.flags|=8192)):at(t),null;case 24:return null;case 25:return null}throw Error(o(156,t.tag))}function Vp(e,t){switch(ua(t),t.tag){case 1:return gt(t.type)&&cl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ar(),Ie(mt),Ie(lt),ka(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return xa(t),null;case 13:if(Ie(Fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Cr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Fe),null;case 4:return Ar(),null;case 10:return ma(t.type._context),null;case 22:case 23:return eo(),null;case 24:return null;default:return null}}var Al=!1,ot=!1,$p=typeof WeakSet=="function"?WeakSet:Set,Y=null;function Mr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){Ue(e,t,i)}else n.current=null}function Va(e,t,n){try{n()}catch(i){Ue(e,t,i)}}var vd=!1;function Up(e,t){if(ea=Zi,e=Qu(),Gs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var s=i.anchorOffset,u=i.focusNode;i=i.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var f=0,v=-1,y=-1,A=0,T=0,B=e,I=null;t:for(;;){for(var Q;B!==n||s!==0&&B.nodeType!==3||(v=f+s),B!==u||i!==0&&B.nodeType!==3||(y=f+i),B.nodeType===3&&(f+=B.nodeValue.length),(Q=B.firstChild)!==null;)I=B,B=Q;for(;;){if(B===e)break t;if(I===n&&++A===s&&(v=f),I===u&&++T===i&&(y=f),(Q=B.nextSibling)!==null)break;B=I,I=B.parentNode}B=Q}n=v===-1||y===-1?null:{start:v,end:y}}else n=null}n=n||{start:0,end:0}}else n=null;for(ta={focusedElem:e,selectionRange:n},Zi=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var X=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(X!==null){var te=X.memoizedProps,Ke=X.memoizedState,C=t.stateNode,S=C.getSnapshotBeforeUpdate(t.elementType===t.type?te:Vt(t.type,te),Ke);C.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var P=t.stateNode.containerInfo;P.nodeType===1?P.textContent="":P.nodeType===9&&P.documentElement&&P.removeChild(P.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(H){Ue(t,t.return,H)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return X=vd,vd=!1,X}function Ei(e,t,n){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&e)===e){var u=s.destroy;s.destroy=void 0,u!==void 0&&Va(t,n,u)}s=s.next}while(s!==i)}}function zl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function $a(e){var t=e.ref;if(t!==null){var n=e.stateNode;e.tag,e=n,typeof t=="function"?t(e):t.current=e}}function wd(e){var t=e.alternate;t!==null&&(e.alternate=null,wd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Yt],delete t[pi],delete t[la],delete t[Cp],delete t[Np])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function yd(e){return e.tag===5||e.tag===3||e.tag===4}function xd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ua(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ol));else if(i!==4&&(e=e.child,e!==null))for(Ua(e,t,n),e=e.sibling;e!==null;)Ua(e,t,n),e=e.sibling}function Ha(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Ha(e,t,n),e=e.sibling;e!==null;)Ha(e,t,n),e=e.sibling}var tt=null,$t=!1;function _n(e,t,n){for(n=n.child;n!==null;)Sd(e,t,n),n=n.sibling}function Sd(e,t,n){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(Ui,n)}catch{}switch(n.tag){case 5:ot||Mr(n,t);case 6:var i=tt,s=$t;tt=null,_n(e,t,n),tt=i,$t=s,tt!==null&&($t?(e=tt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):tt.removeChild(n.stateNode));break;case 18:tt!==null&&($t?(e=tt,n=n.stateNode,e.nodeType===8?ia(e.parentNode,n):e.nodeType===1&&ia(e,n),ri(e)):ia(tt,n.stateNode));break;case 4:i=tt,s=$t,tt=n.stateNode.containerInfo,$t=!0,_n(e,t,n),tt=i,$t=s;break;case 0:case 11:case 14:case 15:if(!ot&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var u=s,f=u.destroy;u=u.tag,f!==void 0&&((u&2)!==0||(u&4)!==0)&&Va(n,t,f),s=s.next}while(s!==i)}_n(e,t,n);break;case 1:if(!ot&&(Mr(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(v){Ue(n,t,v)}_n(e,t,n);break;case 21:_n(e,t,n);break;case 22:n.mode&1?(ot=(i=ot)||n.memoizedState!==null,_n(e,t,n),ot=i):_n(e,t,n);break;default:_n(e,t,n)}}function kd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new $p),t.forEach(function(i){var s=Jp.bind(null,e,i);n.has(i)||(n.add(i),i.then(s,s))})}}function Ut(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var s=n[i];try{var u=e,f=t,v=f;e:for(;v!==null;){switch(v.tag){case 5:tt=v.stateNode,$t=!1;break e;case 3:tt=v.stateNode.containerInfo,$t=!0;break e;case 4:tt=v.stateNode.containerInfo,$t=!0;break e}v=v.return}if(tt===null)throw Error(o(160));Sd(u,f,s),tt=null,$t=!1;var y=s.alternate;y!==null&&(y.return=null),s.return=null}catch(A){Ue(s,t,A)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)jd(t,e),t=t.sibling}function jd(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ut(t,e),en(e),i&4){try{Ei(3,e,e.return),zl(3,e)}catch(te){Ue(e,e.return,te)}try{Ei(5,e,e.return)}catch(te){Ue(e,e.return,te)}}break;case 1:Ut(t,e),en(e),i&512&&n!==null&&Mr(n,n.return);break;case 5:if(Ut(t,e),en(e),i&512&&n!==null&&Mr(n,n.return),e.flags&32){var s=e.stateNode;try{Gr(s,"")}catch(te){Ue(e,e.return,te)}}if(i&4&&(s=e.stateNode,s!=null)){var u=e.memoizedProps,f=n!==null?n.memoizedProps:u,v=e.type,y=e.updateQueue;if(e.updateQueue=null,y!==null)try{v==="input"&&u.type==="radio"&&u.name!=null&&Oe(s,u),ks(v,f);var A=ks(v,u);for(f=0;f<y.length;f+=2){var T=y[f],B=y[f+1];T==="style"?lu(s,B):T==="dangerouslySetInnerHTML"?ru(s,B):T==="children"?Gr(s,B):O(s,T,B,A)}switch(v){case"input":Qt(s,u);break;case"textarea":eu(s,u);break;case"select":var I=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!u.multiple;var Q=u.value;Q!=null?dr(s,!!u.multiple,Q,!1):I!==!!u.multiple&&(u.defaultValue!=null?dr(s,!!u.multiple,u.defaultValue,!0):dr(s,!!u.multiple,u.multiple?[]:"",!1))}s[pi]=u}catch(te){Ue(e,e.return,te)}}break;case 6:if(Ut(t,e),en(e),i&4){if(e.stateNode===null)throw Error(o(162));s=e.stateNode,u=e.memoizedProps;try{s.nodeValue=u}catch(te){Ue(e,e.return,te)}}break;case 3:if(Ut(t,e),en(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{ri(t.containerInfo)}catch(te){Ue(e,e.return,te)}break;case 4:Ut(t,e),en(e);break;case 13:Ut(t,e),en(e),s=e.child,s.flags&8192&&(u=s.memoizedState!==null,s.stateNode.isHidden=u,!u||s.alternate!==null&&s.alternate.memoizedState!==null||(qa=Ge())),i&4&&kd(e);break;case 22:if(T=n!==null&&n.memoizedState!==null,e.mode&1?(ot=(A=ot)||T,Ut(t,e),ot=A):Ut(t,e),en(e),i&8192){if(A=e.memoizedState!==null,(e.stateNode.isHidden=A)&&!T&&(e.mode&1)!==0)for(Y=e,T=e.child;T!==null;){for(B=Y=T;Y!==null;){switch(I=Y,Q=I.child,I.tag){case 0:case 11:case 14:case 15:Ei(4,I,I.return);break;case 1:Mr(I,I.return);var X=I.stateNode;if(typeof X.componentWillUnmount=="function"){i=I,n=I.return;try{t=i,X.props=t.memoizedProps,X.state=t.memoizedState,X.componentWillUnmount()}catch(te){Ue(i,n,te)}}break;case 5:Mr(I,I.return);break;case 22:if(I.memoizedState!==null){Cd(B);continue}}Q!==null?(Q.return=I,Y=Q):Cd(B)}T=T.sibling}e:for(T=null,B=e;;){if(B.tag===5){if(T===null){T=B;try{s=B.stateNode,A?(u=s.style,typeof u.setProperty=="function"?u.setProperty("display","none","important"):u.display="none"):(v=B.stateNode,y=B.memoizedProps.style,f=y!=null&&y.hasOwnProperty("display")?y.display:null,v.style.display=iu("display",f))}catch(te){Ue(e,e.return,te)}}}else if(B.tag===6){if(T===null)try{B.stateNode.nodeValue=A?"":B.memoizedProps}catch(te){Ue(e,e.return,te)}}else if((B.tag!==22&&B.tag!==23||B.memoizedState===null||B===e)&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===e)break e;for(;B.sibling===null;){if(B.return===null||B.return===e)break e;T===B&&(T=null),B=B.return}T===B&&(T=null),B.sibling.return=B.return,B=B.sibling}}break;case 19:Ut(t,e),en(e),i&4&&kd(e);break;case 21:break;default:Ut(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(yd(n)){var i=n;break e}n=n.return}throw Error(o(160))}switch(i.tag){case 5:var s=i.stateNode;i.flags&32&&(Gr(s,""),i.flags&=-33);var u=xd(e);Ha(e,u,s);break;case 3:case 4:var f=i.stateNode.containerInfo,v=xd(e);Ua(e,v,f);break;default:throw Error(o(161))}}catch(y){Ue(e,e.return,y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hp(e,t,n){Y=e,bd(e)}function bd(e,t,n){for(var i=(e.mode&1)!==0;Y!==null;){var s=Y,u=s.child;if(s.tag===22&&i){var f=s.memoizedState!==null||Al;if(!f){var v=s.alternate,y=v!==null&&v.memoizedState!==null||ot;v=Al;var A=ot;if(Al=f,(ot=y)&&!A)for(Y=s;Y!==null;)f=Y,y=f.child,f.tag===22&&f.memoizedState!==null?Nd(s):y!==null?(y.return=f,Y=y):Nd(s);for(;u!==null;)Y=u,bd(u),u=u.sibling;Y=s,Al=v,ot=A}Ed(e)}else(s.subtreeFlags&8772)!==0&&u!==null?(u.return=s,Y=u):Ed(e)}}function Ed(e){for(;Y!==null;){var t=Y;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:ot||zl(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!ot)if(n===null)i.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Vt(t.type,n.memoizedProps);i.componentDidUpdate(s,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var u=t.updateQueue;u!==null&&Cc(t,u,i);break;case 3:var f=t.updateQueue;if(f!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Cc(t,f,n)}break;case 5:var v=t.stateNode;if(n===null&&t.flags&4){n=v;var y=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":y.autoFocus&&n.focus();break;case"img":y.src&&(n.src=y.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var A=t.alternate;if(A!==null){var T=A.memoizedState;if(T!==null){var B=T.dehydrated;B!==null&&ri(B)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}ot||t.flags&512&&$a(t)}catch(I){Ue(t,t.return,I)}}if(t===e){Y=null;break}if(n=t.sibling,n!==null){n.return=t.return,Y=n;break}Y=t.return}}function Cd(e){for(;Y!==null;){var t=Y;if(t===e){Y=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Y=n;break}Y=t.return}}function Nd(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{zl(4,t)}catch(y){Ue(t,n,y)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var s=t.return;try{i.componentDidMount()}catch(y){Ue(t,s,y)}}var u=t.return;try{$a(t)}catch(y){Ue(t,u,y)}break;case 5:var f=t.return;try{$a(t)}catch(y){Ue(t,f,y)}}}catch(y){Ue(t,t.return,y)}if(t===e){Y=null;break}var v=t.sibling;if(v!==null){v.return=t.return,Y=v;break}Y=t.return}}var Gp=Math.ceil,Ml=ue.ReactCurrentDispatcher,Ga=ue.ReactCurrentOwner,_t=ue.ReactCurrentBatchConfig,Ne=0,Je=null,qe=null,nt=0,Ct=0,_r=Pn(0),Ye=0,Ci=null,Jn=0,_l=0,Ka=0,Ni=null,wt=null,qa=0,Lr=1/0,mn=null,Ll=!1,Qa=null,Ln=null,Dl=!1,Dn=null,Il=0,Pi=0,Za=null,Tl=-1,Wl=0;function ft(){return(Ne&6)!==0?Ge():Tl!==-1?Tl:Tl=Ge()}function In(e){return(e.mode&1)===0?1:(Ne&2)!==0&&nt!==0?nt&-nt:Rp.transition!==null?(Wl===0&&(Wl=xu()),Wl):(e=Ae,e!==0||(e=window.event,e=e===void 0?16:Ru(e.type)),e)}function Ht(e,t,n,i){if(50<Pi)throw Pi=0,Za=null,Error(o(185));Xr(e,n,i),((Ne&2)===0||e!==Je)&&(e===Je&&((Ne&2)===0&&(_l|=n),Ye===4&&Tn(e,nt)),yt(e,i),n===1&&Ne===0&&(t.mode&1)===0&&(Lr=Ge()+500,fl&&An()))}function yt(e,t){var n=e.callbackNode;Rh(e,t);var i=Ki(e,e===Je?nt:0);if(i===0)n!==null&&vu(n),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(n!=null&&vu(n),t===1)e.tag===0?Pp(Rd.bind(null,e)):pc(Rd.bind(null,e)),bp(function(){(Ne&6)===0&&An()}),n=null;else{switch(Su(i)){case 1:n=Rs;break;case 4:n=wu;break;case 16:n=$i;break;case 536870912:n=yu;break;default:n=$i}n=Td(n,Pd.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Pd(e,t){if(Tl=-1,Wl=0,(Ne&6)!==0)throw Error(o(327));var n=e.callbackNode;if(Dr()&&e.callbackNode!==n)return null;var i=Ki(e,e===Je?nt:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||t)t=Ol(e,i);else{t=i;var s=Ne;Ne|=2;var u=zd();(Je!==e||nt!==t)&&(mn=null,Lr=Ge()+500,tr(e,t));do try{Qp();break}catch(v){Ad(e,v)}while(!0);pa(),Ml.current=u,Ne=s,qe!==null?t=0:(Je=null,nt=0,t=Ye)}if(t!==0){if(t===2&&(s=As(e),s!==0&&(i=s,t=Ya(e,s))),t===1)throw n=Ci,tr(e,0),Tn(e,i),yt(e,Ge()),n;if(t===6)Tn(e,i);else{if(s=e.current.alternate,(i&30)===0&&!Kp(s)&&(t=Ol(e,i),t===2&&(u=As(e),u!==0&&(i=u,t=Ya(e,u))),t===1))throw n=Ci,tr(e,0),Tn(e,i),yt(e,Ge()),n;switch(e.finishedWork=s,e.finishedLanes=i,t){case 0:case 1:throw Error(o(345));case 2:nr(e,wt,mn);break;case 3:if(Tn(e,i),(i&130023424)===i&&(t=qa+500-Ge(),10<t)){if(Ki(e,0)!==0)break;if(s=e.suspendedLanes,(s&i)!==i){ft(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=ra(nr.bind(null,e,wt,mn),t);break}nr(e,wt,mn);break;case 4:if(Tn(e,i),(i&4194240)===i)break;for(t=e.eventTimes,s=-1;0<i;){var f=31-Ot(i);u=1<<f,f=t[f],f>s&&(s=f),i&=~u}if(i=s,i=Ge()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Gp(i/1960))-i,10<i){e.timeoutHandle=ra(nr.bind(null,e,wt,mn),i);break}nr(e,wt,mn);break;case 5:nr(e,wt,mn);break;default:throw Error(o(329))}}}return yt(e,Ge()),e.callbackNode===n?Pd.bind(null,e):null}function Ya(e,t){var n=Ni;return e.current.memoizedState.isDehydrated&&(tr(e,t).flags|=256),e=Ol(e,t),e!==2&&(t=wt,wt=n,t!==null&&Xa(t)),e}function Xa(e){wt===null?wt=e:wt.push.apply(wt,e)}function Kp(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var i=0;i<n.length;i++){var s=n[i],u=s.getSnapshot;s=s.value;try{if(!Ft(u(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Tn(e,t){for(t&=~Ka,t&=~_l,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ot(t),i=1<<n;e[n]=-1,t&=~i}}function Rd(e){if((Ne&6)!==0)throw Error(o(327));Dr();var t=Ki(e,0);if((t&1)===0)return yt(e,Ge()),null;var n=Ol(e,t);if(e.tag!==0&&n===2){var i=As(e);i!==0&&(t=i,n=Ya(e,i))}if(n===1)throw n=Ci,tr(e,0),Tn(e,t),yt(e,Ge()),n;if(n===6)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,nr(e,wt,mn),yt(e,Ge()),null}function Ja(e,t){var n=Ne;Ne|=1;try{return e(t)}finally{Ne=n,Ne===0&&(Lr=Ge()+500,fl&&An())}}function er(e){Dn!==null&&Dn.tag===0&&(Ne&6)===0&&Dr();var t=Ne;Ne|=1;var n=_t.transition,i=Ae;try{if(_t.transition=null,Ae=1,e)return e()}finally{Ae=i,_t.transition=n,Ne=t,(Ne&6)===0&&An()}}function eo(){Ct=_r.current,Ie(_r)}function tr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,jp(n)),qe!==null)for(n=qe.return;n!==null;){var i=n;switch(ua(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&cl();break;case 3:Ar(),Ie(mt),Ie(lt),ka();break;case 5:xa(i);break;case 4:Ar();break;case 13:Ie(Fe);break;case 19:Ie(Fe);break;case 10:ma(i.type._context);break;case 22:case 23:eo()}n=n.return}if(Je=e,qe=e=Wn(e.current,null),nt=Ct=t,Ye=0,Ci=null,Ka=_l=Jn=0,wt=Ni=null,Zn!==null){for(t=0;t<Zn.length;t++)if(n=Zn[t],i=n.interleaved,i!==null){n.interleaved=null;var s=i.next,u=n.pending;if(u!==null){var f=u.next;u.next=s,i.next=f}n.pending=i}Zn=null}return e}function Ad(e,t){do{var n=qe;try{if(pa(),kl.current=Cl,jl){for(var i=Be.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}jl=!1}if(Xn=0,Xe=Ze=Be=null,xi=!1,Si=0,Ga.current=null,n===null||n.return===null){Ye=1,Ci=t,qe=null;break}e:{var u=e,f=n.return,v=n,y=t;if(t=nt,v.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){var A=y,T=v,B=T.tag;if((T.mode&1)===0&&(B===0||B===11||B===15)){var I=T.alternate;I?(T.updateQueue=I.updateQueue,T.memoizedState=I.memoizedState,T.lanes=I.lanes):(T.updateQueue=null,T.memoizedState=null)}var Q=td(f);if(Q!==null){Q.flags&=-257,nd(Q,f,v,u,t),Q.mode&1&&ed(u,A,t),t=Q,y=A;var X=t.updateQueue;if(X===null){var te=new Set;te.add(y),t.updateQueue=te}else X.add(y);break e}else{if((t&1)===0){ed(u,A,t),to();break e}y=Error(o(426))}}else if(Te&&v.mode&1){var Ke=td(f);if(Ke!==null){(Ke.flags&65536)===0&&(Ke.flags|=256),nd(Ke,f,v,u,t),fa(zr(y,v));break e}}u=y=zr(y,v),Ye!==4&&(Ye=2),Ni===null?Ni=[u]:Ni.push(u),u=f;do{switch(u.tag){case 3:u.flags|=65536,t&=-t,u.lanes|=t;var C=Xc(u,y,t);Ec(u,C);break e;case 1:v=y;var S=u.type,P=u.stateNode;if((u.flags&128)===0&&(typeof S.getDerivedStateFromError=="function"||P!==null&&typeof P.componentDidCatch=="function"&&(Ln===null||!Ln.has(P)))){u.flags|=65536,t&=-t,u.lanes|=t;var H=Jc(u,v,t);Ec(u,H);break e}}u=u.return}while(u!==null)}_d(n)}catch(ie){t=ie,qe===n&&n!==null&&(qe=n=n.return);continue}break}while(!0)}function zd(){var e=Ml.current;return Ml.current=Cl,e===null?Cl:e}function to(){(Ye===0||Ye===3||Ye===2)&&(Ye=4),Je===null||(Jn&268435455)===0&&(_l&268435455)===0||Tn(Je,nt)}function Ol(e,t){var n=Ne;Ne|=2;var i=zd();(Je!==e||nt!==t)&&(mn=null,tr(e,t));do try{qp();break}catch(s){Ad(e,s)}while(!0);if(pa(),Ne=n,Ml.current=i,qe!==null)throw Error(o(261));return Je=null,nt=0,Ye}function qp(){for(;qe!==null;)Md(qe)}function Qp(){for(;qe!==null&&!xh();)Md(qe)}function Md(e){var t=Id(e.alternate,e,Ct);e.memoizedProps=e.pendingProps,t===null?_d(e):qe=t,Ga.current=null}function _d(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=Bp(n,t,Ct),n!==null){qe=n;return}}else{if(n=Vp(n,t),n!==null){n.flags&=32767,qe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ye=6,qe=null;return}}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);Ye===0&&(Ye=5)}function nr(e,t,n){var i=Ae,s=_t.transition;try{_t.transition=null,Ae=1,Zp(e,t,n,i)}finally{_t.transition=s,Ae=i}return null}function Zp(e,t,n,i){do Dr();while(Dn!==null);if((Ne&6)!==0)throw Error(o(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var u=n.lanes|n.childLanes;if(Ah(e,u),e===Je&&(qe=Je=null,nt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Dl||(Dl=!0,Td($i,function(){return Dr(),null})),u=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||u){u=_t.transition,_t.transition=null;var f=Ae;Ae=1;var v=Ne;Ne|=4,Ga.current=null,Up(e,n),jd(n,e),gp(ta),Zi=!!ea,ta=ea=null,e.current=n,Hp(n),Sh(),Ne=v,Ae=f,_t.transition=u}else e.current=n;if(Dl&&(Dl=!1,Dn=e,Il=s),u=e.pendingLanes,u===0&&(Ln=null),bh(n.stateNode),yt(e,Ge()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],i(s.value,{componentStack:s.stack,digest:s.digest});if(Ll)throw Ll=!1,e=Qa,Qa=null,e;return(Il&1)!==0&&e.tag!==0&&Dr(),u=e.pendingLanes,(u&1)!==0?e===Za?Pi++:(Pi=0,Za=e):Pi=0,An(),null}function Dr(){if(Dn!==null){var e=Su(Il),t=_t.transition,n=Ae;try{if(_t.transition=null,Ae=16>e?16:e,Dn===null)var i=!1;else{if(e=Dn,Dn=null,Il=0,(Ne&6)!==0)throw Error(o(331));var s=Ne;for(Ne|=4,Y=e.current;Y!==null;){var u=Y,f=u.child;if((Y.flags&16)!==0){var v=u.deletions;if(v!==null){for(var y=0;y<v.length;y++){var A=v[y];for(Y=A;Y!==null;){var T=Y;switch(T.tag){case 0:case 11:case 15:Ei(8,T,u)}var B=T.child;if(B!==null)B.return=T,Y=B;else for(;Y!==null;){T=Y;var I=T.sibling,Q=T.return;if(wd(T),T===A){Y=null;break}if(I!==null){I.return=Q,Y=I;break}Y=Q}}}var X=u.alternate;if(X!==null){var te=X.child;if(te!==null){X.child=null;do{var Ke=te.sibling;te.sibling=null,te=Ke}while(te!==null)}}Y=u}}if((u.subtreeFlags&2064)!==0&&f!==null)f.return=u,Y=f;else e:for(;Y!==null;){if(u=Y,(u.flags&2048)!==0)switch(u.tag){case 0:case 11:case 15:Ei(9,u,u.return)}var C=u.sibling;if(C!==null){C.return=u.return,Y=C;break e}Y=u.return}}var S=e.current;for(Y=S;Y!==null;){f=Y;var P=f.child;if((f.subtreeFlags&2064)!==0&&P!==null)P.return=f,Y=P;else e:for(f=S;Y!==null;){if(v=Y,(v.flags&2048)!==0)try{switch(v.tag){case 0:case 11:case 15:zl(9,v)}}catch(ie){Ue(v,v.return,ie)}if(v===f){Y=null;break e}var H=v.sibling;if(H!==null){H.return=v.return,Y=H;break e}Y=v.return}}if(Ne=s,An(),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(Ui,e)}catch{}i=!0}return i}finally{Ae=n,_t.transition=t}}return!1}function Ld(e,t,n){t=zr(n,t),t=Xc(e,t,1),e=Mn(e,t,1),t=ft(),e!==null&&(Xr(e,1,t),yt(e,t))}function Ue(e,t,n){if(e.tag===3)Ld(e,e,n);else for(;t!==null;){if(t.tag===3){Ld(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Ln===null||!Ln.has(i))){e=zr(n,e),e=Jc(t,e,1),t=Mn(t,e,1),e=ft(),t!==null&&(Xr(t,1,e),yt(t,e));break}}t=t.return}}function Yp(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),t=ft(),e.pingedLanes|=e.suspendedLanes&n,Je===e&&(nt&n)===n&&(Ye===4||Ye===3&&(nt&130023424)===nt&&500>Ge()-qa?tr(e,0):Ka|=n),yt(e,t)}function Dd(e,t){t===0&&((e.mode&1)===0?t=1:(t=Gi,Gi<<=1,(Gi&130023424)===0&&(Gi=4194304)));var n=ft();e=fn(e,t),e!==null&&(Xr(e,t,n),yt(e,n))}function Xp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Dd(e,n)}function Jp(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(o(314))}i!==null&&i.delete(t),Dd(e,n)}var Id;Id=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||mt.current)vt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return vt=!1,Fp(e,t,n);vt=(e.flags&131072)!==0}else vt=!1,Te&&(t.flags&1048576)!==0&&mc(t,pl,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Rl(e,t),e=t.pendingProps;var s=jr(t,lt.current);Rr(t,n),s=Ea(null,t,i,e,s,n);var u=Ca();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,gt(i)?(u=!0,dl(t)):u=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,wa(t),s.updater=Nl,t.stateNode=s,s._reactInternals=t,Ma(t,i,e,n),t=Ia(null,t,i,!0,u,n)):(t.tag=0,Te&&u&&oa(t),dt(null,t,s,n),t=t.child),t;case 16:i=t.elementType;e:{switch(Rl(e,t),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=tm(i),e=Vt(i,e),s){case 0:t=Da(null,t,i,e,n);break e;case 1:t=od(null,t,i,e,n);break e;case 11:t=rd(null,t,i,e,n);break e;case 14:t=id(null,t,i,Vt(i.type,e),n);break e}throw Error(o(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Vt(i,s),Da(e,t,i,s,n);case 1:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Vt(i,s),od(e,t,i,s,n);case 3:e:{if(ud(t),e===null)throw Error(o(387));i=t.pendingProps,u=t.memoizedState,s=u.element,bc(e,t),xl(t,i,null,n);var f=t.memoizedState;if(i=f.element,u.isDehydrated)if(u={element:i,isDehydrated:!1,cache:f.cache,pendingSuspenseBoundaries:f.pendingSuspenseBoundaries,transitions:f.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){s=zr(Error(o(423)),t),t=cd(e,t,i,n,s);break e}else if(i!==s){s=zr(Error(o(424)),t),t=cd(e,t,i,n,s);break e}else for(Et=Nn(t.stateNode.containerInfo.firstChild),bt=t,Te=!0,Bt=null,n=kc(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Cr(),i===s){t=pn(e,t,n);break e}dt(e,t,i,n)}t=t.child}return t;case 5:return Nc(t),e===null&&da(t),i=t.type,s=t.pendingProps,u=e!==null?e.memoizedProps:null,f=s.children,na(i,s)?f=null:u!==null&&na(i,u)&&(t.flags|=32),ad(e,t),dt(e,t,f,n),t.child;case 6:return e===null&&da(t),null;case 13:return dd(e,t,n);case 4:return ya(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Nr(t,null,i,n):dt(e,t,i,n),t.child;case 11:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Vt(i,s),rd(e,t,i,s,n);case 7:return dt(e,t,t.pendingProps,n),t.child;case 8:return dt(e,t,t.pendingProps.children,n),t.child;case 12:return dt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(i=t.type._context,s=t.pendingProps,u=t.memoizedProps,f=s.value,Le(vl,i._currentValue),i._currentValue=f,u!==null)if(Ft(u.value,f)){if(u.children===s.children&&!mt.current){t=pn(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var v=u.dependencies;if(v!==null){f=u.child;for(var y=v.firstContext;y!==null;){if(y.context===i){if(u.tag===1){y=hn(-1,n&-n),y.tag=2;var A=u.updateQueue;if(A!==null){A=A.shared;var T=A.pending;T===null?y.next=y:(y.next=T.next,T.next=y),A.pending=y}}u.lanes|=n,y=u.alternate,y!==null&&(y.lanes|=n),ga(u.return,n,t),v.lanes|=n;break}y=y.next}}else if(u.tag===10)f=u.type===t.type?null:u.child;else if(u.tag===18){if(f=u.return,f===null)throw Error(o(341));f.lanes|=n,v=f.alternate,v!==null&&(v.lanes|=n),ga(f,n,t),f=u.sibling}else f=u.child;if(f!==null)f.return=u;else for(f=u;f!==null;){if(f===t){f=null;break}if(u=f.sibling,u!==null){u.return=f.return,f=u;break}f=f.return}u=f}dt(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,Rr(t,n),s=zt(s),i=i(s),t.flags|=1,dt(e,t,i,n),t.child;case 14:return i=t.type,s=Vt(i,t.pendingProps),s=Vt(i.type,s),id(e,t,i,s,n);case 15:return ld(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:Vt(i,s),Rl(e,t),t.tag=1,gt(i)?(e=!0,dl(t)):e=!1,Rr(t,n),Zc(t,i,s),Ma(t,i,s,n),Ia(null,t,i,!0,e,n);case 19:return hd(e,t,n);case 22:return sd(e,t,n)}throw Error(o(156,t.tag))};function Td(e,t){return gu(e,t)}function em(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lt(e,t,n,i){return new em(e,t,n,i)}function no(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tm(e){if(typeof e=="function")return no(e)?1:0;if(e!=null){if(e=e.$$typeof,e===z)return 11;if(e===Z)return 14}return 2}function Wn(e,t){var n=e.alternate;return n===null?(n=Lt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Fl(e,t,n,i,s,u){var f=2;if(i=e,typeof e=="function")no(e)&&(f=1);else if(typeof e=="string")f=5;else e:switch(e){case be:return rr(n.children,s,u,t);case re:f=8,s|=8;break;case je:return e=Lt(12,n,t,s|2),e.elementType=je,e.lanes=u,e;case K:return e=Lt(13,n,t,s),e.elementType=K,e.lanes=u,e;case Se:return e=Lt(19,n,t,s),e.elementType=Se,e.lanes=u,e;case ye:return Bl(n,s,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case L:f=10;break e;case oe:f=9;break e;case z:f=11;break e;case Z:f=14;break e;case ce:f=16,i=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return t=Lt(f,n,t,s),t.elementType=e,t.type=i,t.lanes=u,t}function rr(e,t,n,i){return e=Lt(7,e,i,t),e.lanes=n,e}function Bl(e,t,n,i){return e=Lt(22,e,i,t),e.elementType=ye,e.lanes=n,e.stateNode={isHidden:!1},e}function ro(e,t,n){return e=Lt(6,e,null,t),e.lanes=n,e}function io(e,t,n){return t=Lt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nm(e,t,n,i,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zs(0),this.expirationTimes=zs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zs(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function lo(e,t,n,i,s,u,f,v,y){return e=new nm(e,t,n,v,y),t===1?(t=1,u===!0&&(t|=8)):t=0,u=Lt(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wa(u),e}function rm(e,t,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ke,key:i==null?null:""+i,children:e,containerInfo:t,implementation:n}}function Wd(e){if(!e)return Rn;e=e._reactInternals;e:{if(Hn(e)!==e||e.tag!==1)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(gt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(o(171))}if(e.tag===1){var n=e.type;if(gt(n))return fc(e,n,t)}return t}function Od(e,t,n,i,s,u,f,v,y){return e=lo(n,i,!0,e,s,u,f,v,y),e.context=Wd(null),n=e.current,i=ft(),s=In(n),u=hn(i,s),u.callback=t??null,Mn(n,u,s),e.current.lanes=s,Xr(e,s,i),yt(e,i),e}function Vl(e,t,n,i){var s=t.current,u=ft(),f=In(s);return n=Wd(n),t.context===null?t.context=n:t.pendingContext=n,t=hn(u,f),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=Mn(s,t,f),e!==null&&(Ht(e,s,f,u),yl(e,s,f)),f}function $l(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Fd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function so(e,t){Fd(e,t),(e=e.alternate)&&Fd(e,t)}function im(){return null}var Bd=typeof reportError=="function"?reportError:function(e){console.error(e)};function ao(e){this._internalRoot=e}Ul.prototype.render=ao.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));Vl(e,t,null,null)},Ul.prototype.unmount=ao.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;er(function(){Vl(null,e,null,null)}),t[on]=null}};function Ul(e){this._internalRoot=e}Ul.prototype.unstable_scheduleHydration=function(e){if(e){var t=bu();e={blockedOn:null,target:e,priority:t};for(var n=0;n<bn.length&&t!==0&&t<bn[n].priority;n++);bn.splice(n,0,e),n===0&&Nu(e)}};function oo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Hl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Vd(){}function lm(e,t,n,i,s){if(s){if(typeof i=="function"){var u=i;i=function(){var A=$l(f);u.call(A)}}var f=Od(t,i,e,0,null,!1,!1,"",Vd);return e._reactRootContainer=f,e[on]=f.current,fi(e.nodeType===8?e.parentNode:e),er(),f}for(;s=e.lastChild;)e.removeChild(s);if(typeof i=="function"){var v=i;i=function(){var A=$l(y);v.call(A)}}var y=lo(e,0,!1,null,null,!1,!1,"",Vd);return e._reactRootContainer=y,e[on]=y.current,fi(e.nodeType===8?e.parentNode:e),er(function(){Vl(t,y,n,i)}),y}function Gl(e,t,n,i,s){var u=n._reactRootContainer;if(u){var f=u;if(typeof s=="function"){var v=s;s=function(){var y=$l(f);v.call(y)}}Vl(t,f,e,s)}else f=lm(n,t,e,s,i);return $l(f)}ku=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Yr(t.pendingLanes);n!==0&&(Ms(t,n|1),yt(t,Ge()),(Ne&6)===0&&(Lr=Ge()+500,An()))}break;case 13:er(function(){var i=fn(e,1);if(i!==null){var s=ft();Ht(i,e,1,s)}}),so(e,1)}},_s=function(e){if(e.tag===13){var t=fn(e,134217728);if(t!==null){var n=ft();Ht(t,e,134217728,n)}so(e,134217728)}},ju=function(e){if(e.tag===13){var t=In(e),n=fn(e,t);if(n!==null){var i=ft();Ht(n,e,t,i)}so(e,t)}},bu=function(){return Ae},Eu=function(e,t){var n=Ae;try{return Ae=e,t()}finally{Ae=n}},Es=function(e,t,n){switch(t){case"input":if(Qt(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var s=ul(i);if(!s)throw Error(o(90));q(i),Qt(i,s)}}}break;case"textarea":eu(e,n);break;case"select":t=n.value,t!=null&&dr(e,!!n.multiple,t,!1)}},uu=Ja,cu=er;var sm={usingClientEntryPoint:!1,Events:[mi,Sr,ul,au,ou,Ja]},Ri={findFiberByHostInstance:Gn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},am={bundleType:Ri.bundleType,version:Ri.version,rendererPackageName:Ri.rendererPackageName,rendererConfig:Ri.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ue.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=pu(e),e===null?null:e.stateNode},findFiberByHostInstance:Ri.findFiberByHostInstance||im,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kl.isDisabled&&Kl.supportsFiber)try{Ui=Kl.inject(am),Zt=Kl}catch{}}return xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sm,xt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!oo(t))throw Error(o(200));return rm(e,t,null,n)},xt.createRoot=function(e,t){if(!oo(e))throw Error(o(299));var n=!1,i="",s=Bd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=lo(e,1,!1,null,null,n,!1,i,s),e[on]=t.current,fi(e.nodeType===8?e.parentNode:e),new ao(t)},xt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=pu(t),e=e===null?null:e.stateNode,e},xt.flushSync=function(e){return er(e)},xt.hydrate=function(e,t,n){if(!Hl(t))throw Error(o(200));return Gl(null,e,t,!0,n)},xt.hydrateRoot=function(e,t,n){if(!oo(e))throw Error(o(405));var i=n!=null&&n.hydratedSources||null,s=!1,u="",f=Bd;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(f=n.onRecoverableError)),t=Od(t,null,e,1,n??null,s,!1,u,f),e[on]=t.current,fi(e),i)for(e=0;e<i.length;e++)n=i[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Ul(t)},xt.render=function(e,t,n){if(!Hl(t))throw Error(o(200));return Gl(null,e,t,!1,n)},xt.unmountComponentAtNode=function(e){if(!Hl(e))throw Error(o(40));return e._reactRootContainer?(er(function(){Gl(null,null,e,!1,function(){e._reactRootContainer=null,e[on]=null})}),!0):!1},xt.unstable_batchedUpdates=Ja,xt.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Hl(n))throw Error(o(200));if(e==null||e._reactInternals===void 0)throw Error(o(38));return Gl(e,t,n,!1,i)},xt.version="18.3.1-next-f1338f8080-20240426",xt}var Zd;function mm(){if(Zd)return fo.exports;Zd=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),fo.exports=pm(),fo.exports}var Yd;function gm(){if(Yd)return ql;Yd=1;var r=mm();return ql.createRoot=r.createRoot,ql.hydrateRoot=r.hydrateRoot,ql}var vm=gm();const wm=Pf(vm);var Oo=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Af=/^[\\/]{2}/;function ym(r,a){return a+r.replace(/\\/g,"/")}var Xd="popstate";function Jd(r){return typeof r=="object"&&r!=null&&"pathname"in r&&"search"in r&&"hash"in r&&"state"in r&&"key"in r}function xm(r={}){function a(c,h){let{pathname:m="/",search:g="",hash:p=""}=or(c.location.hash.substring(1));return!m.startsWith("/")&&!m.startsWith(".")&&(m="/"+m),Ro("",{pathname:m,search:g,hash:p},h.state&&h.state.usr||null,h.state&&h.state.key||"default")}function o(c,h){let m=c.document.querySelector("base"),g="";if(m&&m.getAttribute("href")){let p=c.location.href,x=p.indexOf("#");g=x===-1?p:p.slice(0,x)}return g+"#"+(typeof h=="string"?h:ar(h))}function d(c,h){Wt(c.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(h)})`)}return km(a,o,d,r)}function We(r,a){if(r===!1||r===null||typeof r>"u")throw new Error(a)}function Wt(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function Sm(){return Math.random().toString(36).substring(2,10)}function ef(r,a){return{usr:r.state,key:r.key,idx:a,masked:r.mask?{pathname:r.pathname,search:r.search,hash:r.hash}:void 0}}function Ro(r,a,o=null,d,c){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof a=="string"?or(a):a,state:o,key:a&&a.key||d||Sm(),mask:c}}function ar({pathname:r="/",search:a="",hash:o=""}){return a&&a!=="?"&&(r+=a.charAt(0)==="?"?a:"?"+a),o&&o!=="#"&&(r+=o.charAt(0)==="#"?o:"#"+o),r}function or(r){let a={};if(r){let o=r.indexOf("#");o>=0&&(a.hash=r.substring(o),r=r.substring(0,o));let d=r.indexOf("?");d>=0&&(a.search=r.substring(d),r=r.substring(0,d)),r&&(a.pathname=r)}return a}function km(r,a,o,d={}){let{window:c=document.defaultView,v5Compat:h=!1}=d,m=c.history,g="POP",p=null,x=k();x==null&&(x=0,m.replaceState({...m.state,idx:x},""));function k(){return(m.state||{idx:null}).idx}function j(){g="POP";let N=k(),$=N==null?null:N-x;x=N,p&&p({action:g,location:_.location,delta:$})}function E(N,$){g="PUSH";let U=Jd(N)?N:Ro(_.location,N,$);o&&o(U,N),x=k()+1;let O=ef(U,x),ue=_.createHref(U.mask||U);try{m.pushState(O,"",ue)}catch(le){if(le instanceof DOMException&&le.name==="DataCloneError")throw le;c.location.assign(ue)}h&&p&&p({action:g,location:_.location,delta:1})}function W(N,$){g="REPLACE";let U=Jd(N)?N:Ro(_.location,N,$);o&&o(U,N),x=k();let O=ef(U,x),ue=_.createHref(U.mask||U);m.replaceState(O,"",ue),h&&p&&p({action:g,location:_.location,delta:0})}function R(N){return jm(c,N)}let _={get action(){return g},get location(){return r(c,m)},listen(N){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Xd,j),p=N,()=>{c.removeEventListener(Xd,j),p=null}},createHref(N){return a(c,N)},createURL:R,encodeLocation(N){let $=R(N);return{pathname:$.pathname,search:$.search,hash:$.hash}},push:E,replace:W,go(N){return m.go(N)}};return _}function jm(r,a,o=!1){let d="http://localhost";r&&(d=r.location.origin!=="null"?r.location.origin:r.location.href),We(d,"No window.location.(origin|href) available to create URL");let c=typeof a=="string"?a:ar(a);return c=c.replace(/ $/,"%20"),!o&&Af.test(c)&&(c=d+c),new URL(c,d)}function zf(r,a,o="/"){return bm(r,a,o,!1)}function bm(r,a,o,d,c){let h=typeof a=="string"?or(a):a,m=yn(h.pathname||"/",o);if(m==null)return null;let g=Em(r),p=null,x=Im(m);for(let k=0;p==null&&k<g.length;++k)p=Dm(g[k],x,d);return p}function Em(r){let a=Mf(r);return Cm(a),a}function Mf(r,a=[],o=[],d="",c=!1){let h=(m,g,p=c,x)=>{let k={relativePath:x===void 0?m.path||"":x,caseSensitive:m.caseSensitive===!0,childrenIndex:g,route:m};if(k.relativePath.startsWith("/")){if(!k.relativePath.startsWith(d)&&p)return;We(k.relativePath.startsWith(d),`Absolute route path "${k.relativePath}" nested under path "${d}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),k.relativePath=k.relativePath.slice(d.length)}let j=qt([d,k.relativePath]),E=o.concat(k);m.children&&m.children.length>0&&(We(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${j}".`),Mf(m.children,a,E,j,p)),!(m.path==null&&!m.index)&&a.push({path:j,score:_m(j,m.index),routesMeta:E.map((W,R)=>{let[_,N]=Df(W.relativePath,W.caseSensitive,R===E.length-1);return{...W,matcher:_,compiledParams:N}})})};return r.forEach((m,g)=>{if(m.path===""||!m.path?.includes("?"))h(m,g);else for(let p of _f(m.path))h(m,g,!0,p)}),a}function _f(r){let a=r.split("/");if(a.length===0)return[];let[o,...d]=a,c=o.endsWith("?"),h=o.replace(/\?$/,"");if(d.length===0)return c?[h,""]:[h];let m=_f(d.join("/")),g=[];return g.push(...m.map(p=>p===""?h:[h,p].join("/"))),c&&g.push(...m),g.map(p=>r.startsWith("/")&&p===""?"/":p)}function Cm(r){r.sort((a,o)=>a.score!==o.score?o.score-a.score:Lm(a.routesMeta.map(d=>d.childrenIndex),o.routesMeta.map(d=>d.childrenIndex)))}var Nm=/^:[\w-]+$/,Pm=3,Rm=2,Am=1,zm=10,Mm=-2,tf=r=>r==="*";function _m(r,a){let o=r.split("/"),d=o.length;return o.some(tf)&&(d+=Mm),a&&(d+=Rm),o.filter(c=>!tf(c)).reduce((c,h)=>c+(Nm.test(h)?Pm:h===""?Am:zm),d)}function Lm(r,a){return r.length===a.length&&r.slice(0,-1).every((d,c)=>d===a[c])?r[r.length-1]-a[a.length-1]:0}function Dm(r,a,o=!1){let{routesMeta:d}=r,c={},h="/",m=[];for(let g=0;g<d.length;++g){let p=d[g],x=g===d.length-1,k=h==="/"?a:a.slice(h.length)||"/",j={path:p.relativePath,caseSensitive:p.caseSensitive,end:x},E=p.matcher&&p.compiledParams?Lf(j,k,p.matcher,p.compiledParams):is(j,k),W=p.route;if(!E&&x&&o&&!d[d.length-1].route.index&&(E=is({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},k)),!E)return null;Object.assign(c,E.params),m.push({params:c,pathname:qt([h,E.pathname]),pathnameBase:Om(qt([h,E.pathnameBase])),route:W}),E.pathnameBase!=="/"&&(h=qt([h,E.pathnameBase]))}return m}function is(r,a){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[o,d]=Df(r.path,r.caseSensitive,r.end);return Lf(r,a,o,d)}function Lf(r,a,o,d){let c=a.match(o);if(!c)return null;let h=c[0],m=Or(h,1),g=c.slice(1);return{params:d.reduce((x,{paramName:k,isOptional:j},E)=>{if(k==="*"){let R=g[E]||"";m=Or(h.slice(0,h.length-R.length),1)}const W=g[E];return j&&!W?x[k]=void 0:x[k]=(W||"").replace(/%2F/g,"/"),x},{}),pathname:h,pathnameBase:m,pattern:r}}function Df(r,a=!1,o=!0){Wt(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let d=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,g,p,x,k)=>{if(d.push({paramName:g,isOptional:p!=null}),p){let j=k.charAt(x+m.length);return j&&j!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(d.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),d]}function Im(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Wt(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),r}}function yn(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let o=a.endsWith("/")?a.length-1:a.length,d=r.charAt(o);return d&&d!=="/"?null:r.slice(o)||"/"}function Tm(r,a="/"){let{pathname:o,search:d="",hash:c=""}=typeof r=="string"?or(r):r,h;return o?(o=If(o),o.startsWith("/")||o.startsWith("\\")?h=nf(o.substring(1),"/"):h=nf(o,a)):h=a,{pathname:h,search:Fm(d),hash:Bm(c)}}function nf(r,a){let o=Or(a).split("/");return r.split("/").forEach(c=>{c===".."?o.length>1&&o.pop():c!=="."&&o.push(c)}),o.length>1?o.join("/"):"/"}function mo(r,a,o,d){return`Cannot include a '${r}' character in a manually specified \`to.${a}\` field [${JSON.stringify(d)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Wm(r){return r.filter((a,o)=>o===0||a.route.path&&a.route.path.length>0)}function Fo(r){let a=Wm(r);return a.map((o,d)=>d===a.length-1?o.pathname:o.pathnameBase)}function fs(r,a,o,d=!1){let c;typeof r=="string"?c=or(r):(c={...r},We(!c.pathname||!c.pathname.includes("?"),mo("?","pathname","search",c)),We(!c.pathname||!c.pathname.includes("#"),mo("#","pathname","hash",c)),We(!c.search||!c.search.includes("#"),mo("#","search","hash",c)));let h=r===""||c.pathname==="",m=h?"/":c.pathname,g;if(m==null)g=o;else{let j=a.length-1;if(!d&&m.startsWith("..")){let E=m.split("/");for(;E[0]==="..";)E.shift(),j-=1;c.pathname=E.join("/")}g=j>=0?a[j]:"/"}let p=Tm(c,g),x=m&&m!=="/"&&m.endsWith("/"),k=(h||m===".")&&o.endsWith("/");return!p.pathname.endsWith("/")&&(x||k)&&(p.pathname+="/"),p}var If=r=>r.replace(/[\\/]{2,}/g,"/"),qt=r=>If(r.join("/"));function Or(r,a=0){let o=r.length;for(;o>a&&r.charCodeAt(o-1)===47;)o--;return o===r.length?r:r.slice(0,o)}var Om=r=>Or(r).replace(/^\/*/,"/"),Fm=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Bm=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,Vm=class{constructor(r,a,o,d=!1){this.status=r,this.statusText=a||"",this.internal=d,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function $m(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function Um(r){let a=r.map(o=>o.route.path).filter(Boolean);return qt(a)||"/"}var Tf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Wf(r,a){let o=r;if(typeof o!="string"||!Oo.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let d=o,c=!1;if(Tf)try{let h=new URL(window.location.href),m=Af.test(o)?new URL(ym(o,h.protocol)):new URL(o),g=yn(m.pathname,a);m.origin===h.origin&&g!=null?o=g+m.search+m.hash:c=!0}catch{Wt(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:d,isExternal:c,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var rf=new URL("http://localhost");function Bo(r){if(r.createURL)return r.createURL("/");try{return new URL(r.createHref("/"),rf)}catch{return rf}}function go(r,a){return r.origin===a.origin&&(r.origin!=="null"||r.protocol===a.protocol&&r.host===a.host)}function Hm(r,a){if(r.startsWith("//"))return!0;let o=a.protocol.toLowerCase();return r.toLowerCase().startsWith(o)?a.host===""||r.slice(o.length).startsWith("//"):!1}function Vo(r,a,o,d){let c=null;try{c=r==null?null:new URL(r,o)}catch{}let h=new URL(a,o),m=c!=null&&!go(c,o),g=!go(h,o);if(d==="reject"){if(m||g)throw new Error("External navigation is not allowed")}else if(g&&(c==null||!Hm(r,c)||!go(c,h)))throw new Error("External navigation is not allowed")}var Of=["POST","PUT","PATCH","DELETE"];new Set(Of);var Gm=["GET",...Of];new Set(Gm);var Km=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function qm(r){try{return Km.includes(new URL(r).protocol)}catch{return!1}}var Vr=w.createContext(null);Vr.displayName="DataRouter";var hs=w.createContext(null);hs.displayName="DataRouterState";var Ff=w.createContext(!1);function Qm(){return w.useContext(Ff)}var Bf=w.createContext({isTransitioning:!1});Bf.displayName="ViewTransition";var Zm=w.createContext(new Map);Zm.displayName="Fetchers";var Ym=w.createContext(null);Ym.displayName="Await";var Pt=w.createContext(null);Pt.displayName="Navigation";var Wi=w.createContext(null);Wi.displayName="Location";var ln=w.createContext({outlet:null,matches:[],isDataRoute:!1});ln.displayName="Route";var $o=w.createContext(null);$o.displayName="RouteError";var Vf="REACT_ROUTER_ERROR",Xm="REDIRECT",Jm="ROUTE_ERROR_RESPONSE";function eg(r){if(r.startsWith(`${Vf}:${Xm}:{`))try{let a=JSON.parse(r.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function tg(r){if(r.startsWith(`${Vf}:${Jm}:{`))try{let a=JSON.parse(r.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new Vm(a.status,a.statusText,a.data)}catch{}}function ng(r,{relative:a}={}){We($r(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:d}=w.useContext(Pt),{hash:c,pathname:h,search:m}=Oi(r,{relative:a}),g=h;return o!=="/"&&(g=h==="/"?o:qt([o,h])),d.createHref({pathname:g,search:m,hash:c})}function $r(){return w.useContext(Wi)!=null}function sn(){return We($r(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(Wi).location}var $f="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Uf(r){w.useContext(Pt).static||w.useLayoutEffect(r)}function Hf(){let{isDataRoute:r}=w.useContext(ln);return r?mg():rg()}function rg(){We($r(),"useNavigate() may be used only in the context of a <Router> component.");let r=w.useContext(Vr),{basename:a,navigator:o}=w.useContext(Pt),{matches:d}=w.useContext(ln),{pathname:c}=sn(),h=JSON.stringify(Fo(d)),m=w.useRef(!1);return Uf(()=>{m.current=!0}),w.useCallback((p,x={})=>{if(Wt(m.current,$f),!m.current)return;if(typeof p=="number"){o.go(p);return}let k=fs(p,JSON.parse(h),c,x.relative==="path");r==null&&a!=="/"&&(k.pathname=k.pathname==="/"?a:qt([a,k.pathname])),Vo(typeof p=="string"?p:ar(p),o.createHref(k),Bo(o),"reject"),(x.replace?o.replace:o.push)(k,x.state,x)},[a,o,h,c,r])}w.createContext(null);function Oi(r,{relative:a}={}){let{matches:o}=w.useContext(ln),{pathname:d}=sn(),c=JSON.stringify(Fo(o));return w.useMemo(()=>fs(r,JSON.parse(c),d,a==="path"),[r,c,d,a])}function ig(r,a){return Gf(r,a)}function Gf(r,a,o){We($r(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=w.useContext(Pt),{matches:c}=w.useContext(ln),h=c[c.length-1],m=h?h.params:{},g=h?h.pathname:"/",p=h?h.pathnameBase:"/",x=h&&h.route;{let N=x&&x.path||"";qf(g,!x||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
9
|
-
|
|
10
|
-
Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let k=sn(),j;if(a){let N=typeof a=="string"?or(a):a;We(p==="/"||N.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${N.pathname}" was given in the \`location\` prop.`),j=N}else j=k;let E=j.pathname||"/",W=E;if(p!=="/"){let N=p.replace(/^\//,"").split("/");W="/"+E.replace(/^\//,"").split("/").slice(N.length).join("/")}let R=o&&o.state.matches.length?o.state.matches.map(N=>Object.assign(N,{route:o.manifest[N.route.id]||N.route})):zf(r,{pathname:W});Wt(x||R!=null,`No routes matched location "${j.pathname}${j.search}${j.hash}" `),Wt(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${j.pathname}${j.search}${j.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=ug(R&&R.map(N=>Object.assign({},N,{params:Object.assign({},m,N.params),pathname:qt([p,d.encodeLocation?d.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?p:qt([p,d.encodeLocation?d.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),c,o);return a&&_?w.createElement(Wi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...j},navigationType:"POP"}},_):_}function lg(){let r=pg(),a=$m(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),o=r instanceof Error?r.stack:null,d="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:d},h={padding:"2px 4px",backgroundColor:d},m=null;return console.error("Error handled by React Router default ErrorBoundary:",r),m=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:h},"ErrorBoundary")," or"," ",w.createElement("code",{style:h},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},a),o?w.createElement("pre",{style:c},o):null,m)}var sg=w.createElement(lg,null),Kf=class extends w.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,a){return a.location!==r.location||a.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:a.error,location:a.location,revalidation:r.revalidation||a.revalidation}}componentDidCatch(r,a){this.props.onError?this.props.onError(r,a):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const o=tg(r.digest);o&&(r=o)}let a=r!==void 0?w.createElement(ln.Provider,{value:this.props.routeContext},w.createElement($o.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?w.createElement(ag,{error:r},a):a}};Kf.contextType=Ff;var vo=new WeakMap;function ag({children:r,error:a}){let{basename:o,navigator:d}=w.useContext(Pt);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let c=eg(a.digest);if(c){let h=vo.get(a);if(h)throw h;let m=Wf(c.location,o),g=m.absoluteURL||m.to;if(Vo(c.location,g,Bo(d),"allow-explicit"),qm(g))throw new Error("Invalid redirect location");if(Tf&&!vo.get(a))if(m.isExternal||c.reloadDocument)window.location.href=g;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:c.replace}));throw vo.set(a,p),p}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${g}`})}}return r}function og({routeContext:r,match:a,children:o}){let d=w.useContext(Vr);return d&&d.static&&d.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(d.staticContext._deepestRenderedBoundaryId=a.route.id),w.createElement(ln.Provider,{value:r},o)}function ug(r,a=[],o){let d=o?.state;if(r==null){if(!d)return null;if(d.errors)r=d.matches;else if(a.length===0&&!d.initialized&&d.matches.length>0)r=d.matches;else return null}let c=r,h=d?.errors;if(h!=null){let k=c.findIndex(j=>j.route.id&&h?.[j.route.id]!==void 0);We(k>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),c=c.slice(0,Math.min(c.length,k+1))}let m=!1,g=-1;if(o&&d){m=d.renderFallback;for(let k=0;k<c.length;k++){let j=c[k];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(g=k),j.route.id){let{loaderData:E,errors:W}=d,R=j.route.loader&&!E.hasOwnProperty(j.route.id)&&(!W||W[j.route.id]===void 0);if(j.route.lazy||R){o.isStatic&&(m=!0),g>=0?c=c.slice(0,g+1):c=[c[0]];break}}}}let p=o?.onError,x=d&&p?(k,j)=>{p(k,{location:d.location,params:d.matches?.[0]?.params??{},pattern:Um(d.matches),errorInfo:j})}:void 0;return c.reduceRight((k,j,E)=>{let W,R=!1,_=null,N=null;d&&(W=h&&j.route.id?h[j.route.id]:void 0,_=j.route.errorElement||sg,m&&(g<0&&E===0?(qf("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,N=null):g===E&&(R=!0,N=j.route.hydrateFallbackElement||null)));let $=a.concat(c.slice(0,E+1)),U=()=>{let O;return W?O=_:R?O=N:j.route.Component?O=w.createElement(j.route.Component,null):j.route.element?O=j.route.element:O=k,w.createElement(og,{match:j,routeContext:{outlet:k,matches:$,isDataRoute:d!=null},children:O})};return d&&(j.route.ErrorBoundary||j.route.errorElement||E===0)?w.createElement(Kf,{location:d.location,revalidation:d.revalidation,component:_,error:W,children:U(),routeContext:{outlet:null,matches:$,isDataRoute:!0},onError:x}):U()},null)}function Uo(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cg(r){let a=w.useContext(Vr);return We(a,Uo(r)),a}function dg(r){let a=w.useContext(hs);return We(a,Uo(r)),a}function fg(r){let a=w.useContext(ln);return We(a,Uo(r)),a}function Ho(r){let a=fg(r),o=a.matches[a.matches.length-1];return We(o.route.id,`${r} can only be used on routes that contain a unique "id"`),o.route.id}function hg(){return Ho("useRouteId")}function pg(){let r=w.useContext($o),a=dg("useRouteError"),o=Ho("useRouteError");return r!==void 0?r:a.errors?.[o]}function mg(){let{router:r}=cg("useNavigate"),a=Ho("useNavigate"),o=w.useRef(!1);return Uf(()=>{o.current=!0}),w.useCallback(async(c,h={})=>{Wt(o.current,$f),o.current&&(typeof c=="number"?await r.navigate(c):await r.navigate(c,{fromRouteId:a,...h}))},[r,a])}var lf={};function qf(r,a,o){!a&&!lf[r]&&(lf[r]=!0,Wt(!1,o))}w.memo(gg);function gg({routes:r,manifest:a,future:o,state:d,isStatic:c,onError:h}){return Gf(r,void 0,{manifest:a,state:d,isStatic:c,onError:h})}function sf({to:r,replace:a,state:o,relative:d}){We($r(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c,navigator:h}=w.useContext(Pt);Wt(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:m}=w.useContext(ln),{pathname:g}=sn(),p=Hf(),x=fs(r,Fo(m),g,d==="path");Vo(typeof r=="string"?r:ar(r),h.createHref(x),Bo(h),"reject");let k=JSON.stringify(x);return w.useEffect(()=>{p(JSON.parse(k),{replace:a,state:o,relative:d})},[p,k,d,a,o]),null}function ut(r){We(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function vg({basename:r="/",children:a=null,location:o,navigationType:d="POP",navigator:c,static:h=!1,useTransitions:m}){We(!$r(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let g=r.replace(/^\/*/,"/"),p=w.useMemo(()=>({basename:g,navigator:c,static:h,useTransitions:m,future:{}}),[g,c,h,m]);typeof o=="string"&&(o=or(o));let{pathname:x="/",search:k="",hash:j="",state:E=null,key:W="default",mask:R}=o,_=w.useMemo(()=>{let N=yn(x,g);return N==null?null:{location:{pathname:N,search:k,hash:j,state:E,key:W,mask:R},navigationType:d}},[g,x,k,j,E,W,d,R]);return Wt(_!=null,`<Router basename="${g}"> is not able to match the URL "${x}${k}${j}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:w.createElement(Pt.Provider,{value:p},w.createElement(Wi.Provider,{children:a,value:_}))}function wg({children:r,location:a}){return ig(Ao(r),a)}function Ao(r,a=[]){let o=[];return w.Children.forEach(r,(d,c)=>{if(!w.isValidElement(d))return;let h=[...a,c];if(d.type===w.Fragment){o.push.apply(o,Ao(d.props.children,h));return}We(d.type===ut,`[${typeof d.type=="string"?d.type:d.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),We(!d.props.index||!d.props.children,"An index route cannot have child routes.");let m={id:d.props.id||h.join("-"),caseSensitive:d.props.caseSensitive,element:d.props.element,Component:d.props.Component,index:d.props.index,path:d.props.path,middleware:d.props.middleware,loader:d.props.loader,action:d.props.action,hydrateFallbackElement:d.props.hydrateFallbackElement,HydrateFallback:d.props.HydrateFallback,errorElement:d.props.errorElement,ErrorBoundary:d.props.ErrorBoundary,hasErrorBoundary:d.props.hasErrorBoundary===!0||d.props.ErrorBoundary!=null||d.props.errorElement!=null,shouldRevalidate:d.props.shouldRevalidate,handle:d.props.handle,lazy:d.props.lazy};d.props.children&&(m.children=Ao(d.props.children,h)),o.push(m)}),o}var Xl="get",Jl="application/x-www-form-urlencoded";function ps(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function yg(r){return ps(r)&&r.tagName.toLowerCase()==="button"}function xg(r){return ps(r)&&r.tagName.toLowerCase()==="form"}function Sg(r){return ps(r)&&r.tagName.toLowerCase()==="input"}function kg(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function jg(r,a){return r.button===0&&(!a||a==="_self")&&!kg(r)}var Ql=null;function bg(){if(Ql===null)try{new FormData(document.createElement("form"),0),Ql=!1}catch{Ql=!0}return Ql}var Eg=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function wo(r){return r!=null&&!Eg.has(r)?(Wt(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jl}"`),null):r}function Cg(r,a){let o,d,c,h,m;if(xg(r)){let g=r.getAttribute("action");d=g?yn(g,a):null,o=r.getAttribute("method")||Xl,c=wo(r.getAttribute("enctype"))||Jl,h=new FormData(r)}else if(yg(r)||Sg(r)&&(r.type==="submit"||r.type==="image")){let g=r.form;if(g==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=r.getAttribute("formaction")||g.getAttribute("action");if(d=p?yn(p,a):null,o=r.getAttribute("formmethod")||g.getAttribute("method")||Xl,c=wo(r.getAttribute("formenctype"))||wo(g.getAttribute("enctype"))||Jl,h=new FormData(g,r),!bg()){let{name:x,type:k,value:j}=r;if(k==="image"){let E=x?`${x}.`:"";h.append(`${E}x`,"0"),h.append(`${E}y`,"0")}else x&&h.append(x,j)}}else{if(ps(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Xl,d=null,c=Jl,m=r}return h&&c==="text/plain"&&(m=h,h=void 0),{action:d,method:o.toLowerCase(),encType:c,formData:h,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Go(r,a){if(r===!1||r===null||typeof r>"u")throw new Error(a)}function Qf(r,a,o,d){let c=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return o?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${d}`:c.pathname=`${c.pathname}.${d}`:c.pathname==="/"?c.pathname=`_root.${d}`:a&&yn(c.pathname,a)==="/"?c.pathname=`${Or(a)}/_root.${d}`:c.pathname=`${Or(c.pathname)}.${d}`,c}async function Ng(r,a){if(r.id in a)return a[r.id];try{let o=await import(r.module);return a[r.id]=o,o}catch(o){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Pg(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function Rg(r,a,o){let d=await Promise.all(r.map(async c=>{let h=a.routes[c.route.id];if(h){let m=await Ng(h,o);return m.links?m.links():[]}return[]}));return _g(d.flat(1).filter(Pg).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function af(r,a,o,d,c,h){let m=(p,x)=>o[x]?p.route.id!==o[x].route.id:!0,g=(p,x)=>o[x].pathname!==p.pathname||o[x].route.path?.endsWith("*")&&o[x].params["*"]!==p.params["*"];return h==="assets"?a.filter((p,x)=>m(p,x)||g(p,x)):h==="data"?a.filter((p,x)=>{let k=d.routes[p.route.id];if(!k||!k.hasLoader)return!1;if(m(p,x)||g(p,x))return!0;if(p.route.shouldRevalidate){let j=p.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:o[0]?.params||{},nextUrl:new URL(r,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof j=="boolean")return j}return!0}):[]}function Ag(r,a,{includeHydrateFallback:o}={}){return zg(r.map(d=>{let c=a.routes[d.route.id];if(!c)return[];let h=[c.module];return c.clientActionModule&&(h=h.concat(c.clientActionModule)),c.clientLoaderModule&&(h=h.concat(c.clientLoaderModule)),o&&c.hydrateFallbackModule&&(h=h.concat(c.hydrateFallbackModule)),c.imports&&(h=h.concat(c.imports)),h}).flat(1))}function zg(r){return[...new Set(r)]}function Mg(r){let a={},o=Object.keys(r).sort();for(let d of o)a[d]=r[d];return a}function _g(r,a){let o=new Set;return new Set(a),r.reduce((d,c)=>{let h=JSON.stringify(Mg(c));return o.has(h)||(o.add(h),d.push({key:h,link:c})),d},[])}function Ko(){let r=w.useContext(Vr);return Go(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function Lg(){let r=w.useContext(hs);return Go(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var qo=w.createContext(void 0);qo.displayName="FrameworkContext";function ms(){let r=w.useContext(qo);return Go(r,"You must render this element inside a <HydratedRouter> element"),r}function Dg(r,a){let o=w.useContext(qo),[d,c]=w.useState(!1),[h,m]=w.useState(!1),{onFocus:g,onBlur:p,onMouseEnter:x,onMouseLeave:k,onTouchStart:j}=a,E=w.useRef(null);w.useEffect(()=>{if(r==="render"&&m(!0),r==="viewport"){let _=$=>{$.forEach(U=>{m(U.isIntersecting)})},N=new IntersectionObserver(_,{threshold:.5});return E.current&&N.observe(E.current),()=>{N.disconnect()}}},[r]),w.useEffect(()=>{if(d){let _=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(_)}}},[d]);let W=()=>{c(!0)},R=()=>{c(!1),m(!1)};return o?r!=="intent"?[h,E,{}]:[h,E,{onFocus:zi(g,W),onBlur:zi(p,R),onMouseEnter:zi(x,W),onMouseLeave:zi(k,R),onTouchStart:zi(j,W)}]:[!1,E,{}]}function zi(r,a){return o=>{r&&r(o),o.defaultPrevented||a(o)}}function Ig({page:r,...a}){let o=Qm(),{nonce:d}=ms(),{router:c}=Ko(),h=w.useMemo(()=>zf(c.routes,r,c.basename),[c.routes,r,c.basename]);return h?(a.nonce==null&&d&&(a={...a,nonce:d}),o?w.createElement(Wg,{page:r,matches:h,...a}):w.createElement(Og,{page:r,matches:h,...a})):null}function Tg(r){let{manifest:a,routeModules:o}=ms(),[d,c]=w.useState([]);return w.useEffect(()=>{let h=!1;return Rg(r,a,o).then(m=>{h||c(m)}),()=>{h=!0}},[r,a,o]),d}function Wg({page:r,matches:a,...o}){let d=sn(),{future:c}=ms(),{basename:h}=Ko(),m=w.useMemo(()=>{if(r===d.pathname+d.search+d.hash)return[];let g=Qf(r,h,c.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,x=[];for(let k of a)typeof k.route.shouldRevalidate=="function"?p=!0:x.push(k.route.id);return p&&x.length>0&&g.searchParams.set("_routes",x.join(",")),[g.pathname+g.search]},[h,c.v8_trailingSlashAwareDataRequests,r,d,a]);return w.createElement(w.Fragment,null,m.map(g=>w.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...o})))}function Og({page:r,matches:a,...o}){let d=sn(),{future:c,manifest:h,routeModules:m}=ms(),{basename:g}=Ko(),{loaderData:p,matches:x}=Lg(),k=w.useMemo(()=>af(r,a,x,h,d,"data"),[r,a,x,h,d]),j=w.useMemo(()=>af(r,a,x,h,d,"assets"),[r,a,x,h,d]),E=w.useMemo(()=>{if(r===d.pathname+d.search+d.hash)return[];let _=new Set,N=!1;if(a.forEach(U=>{let O=h.routes[U.route.id];!O||!O.hasLoader||(!k.some(ue=>ue.route.id===U.route.id)&&U.route.id in p&&m[U.route.id]?.shouldRevalidate||O.hasClientLoader?N=!0:_.add(U.route.id))}),_.size===0)return[];let $=Qf(r,g,c.v8_trailingSlashAwareDataRequests,"data");return N&&_.size>0&&$.searchParams.set("_routes",a.filter(U=>_.has(U.route.id)).map(U=>U.route.id).join(",")),[$.pathname+$.search]},[g,c.v8_trailingSlashAwareDataRequests,p,d,h,k,a,r,m]),W=w.useMemo(()=>Ag(j,h),[j,h]),R=Tg(j);return w.createElement(w.Fragment,null,E.map(_=>w.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...o})),W.map(_=>w.createElement("link",{key:_,rel:"modulepreload",href:_,...o})),R.map(({key:_,link:N})=>w.createElement("link",{key:_,nonce:o.nonce,...N,crossOrigin:N.crossOrigin??o.crossOrigin})))}function Fg(...r){return a=>{r.forEach(o=>{typeof o=="function"?o(a):o!=null&&(o.current=a)})}}var Bg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Bg&&(window.__reactRouterVersion="7.18.4")}catch{}function Vg({basename:r,children:a,useTransitions:o,window:d}){let c=w.useRef();c.current==null&&(c.current=xm({window:d,v5Compat:!0}));let h=c.current,[m,g]=w.useState({action:h.action,location:h.location}),p=w.useCallback(x=>{o===!1?g(x):w.startTransition(()=>g(x))},[o]);return w.useLayoutEffect(()=>h.listen(p),[h,p]),w.createElement(vg,{basename:r,children:a,location:m.location,navigationType:m.action,navigator:h,useTransitions:o})}var Qo=w.forwardRef(function({onClick:a,discover:o="render",prefetch:d="none",relative:c,reloadDocument:h,replace:m,mask:g,state:p,target:x,to:k,preventScrollReset:j,viewTransition:E,defaultShouldRevalidate:W,...R},_){let{basename:N,navigator:$,useTransitions:U}=w.useContext(Pt),O=typeof k=="string"&&Oo.test(k),ue=Wf(k,N);k=ue.to;let le=ng(k,{relative:c}),ke=sn(),be=null;if(g){let Z=fs(g,[],ke.mask?ke.mask.pathname:"/",!0);N!=="/"&&(Z.pathname=Z.pathname==="/"?N:qt([N,Z.pathname])),be=$.createHref(Z)}let[re,je,L]=Dg(d,R),oe=Gg(k,{replace:m,mask:g,state:p,target:x,preventScrollReset:j,relative:c,viewTransition:E,defaultShouldRevalidate:W,useTransitions:U});function z(Z){a&&a(Z),Z.defaultPrevented||oe(Z)}let K=!(ue.isExternal||h),Se=w.createElement("a",{...R,...L,href:(K?be:void 0)||ue.absoluteURL||le,onClick:K?z:a,ref:Fg(_,je),target:x,"data-discover":!O&&o==="render"?"true":void 0});return re&&!O?w.createElement(w.Fragment,null,Se,w.createElement(Ig,{page:le})):Se});Qo.displayName="Link";var $g=w.forwardRef(function({"aria-current":a="page",caseSensitive:o=!1,className:d="",end:c=!1,style:h,to:m,viewTransition:g,children:p,...x},k){let j=Oi(m,{relative:x.relative}),E=sn(),W=w.useContext(hs),{navigator:R,basename:_}=w.useContext(Pt),N=W!=null&&Yg(j)&&g===!0,$=R.encodeLocation?R.encodeLocation(j).pathname:j.pathname,U=E.pathname,O=W&&W.navigation&&W.navigation.location?W.navigation.location.pathname:null;o||(U=U.toLowerCase(),O=O?O.toLowerCase():null,$=$.toLowerCase()),O&&_&&(O=yn(O,_)||O);const ue=$!=="/"&&$.endsWith("/")?$.length-1:$.length;let le=U===$||!c&&U.startsWith($)&&U.charAt(ue)==="/",ke=O!=null&&(O===$||!c&&O.startsWith($)&&O.charAt($.length)==="/"),be={isActive:le,isPending:ke,isTransitioning:N},re=le?a:void 0,je;typeof d=="function"?je=d(be):je=[d,le?"active":null,ke?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let L=typeof h=="function"?h(be):h;return w.createElement(Qo,{...x,"aria-current":re,className:je,ref:k,style:L,to:m,viewTransition:g},typeof p=="function"?p(be):p)});$g.displayName="NavLink";var Ug=w.forwardRef(({discover:r="render",fetcherKey:a,navigate:o,reloadDocument:d,replace:c,state:h,method:m=Xl,action:g,onSubmit:p,relative:x,preventScrollReset:k,viewTransition:j,defaultShouldRevalidate:E,...W},R)=>{let{useTransitions:_}=w.useContext(Pt),N=Qg(),$=Zg(g,{relative:x}),U=m.toLowerCase()==="get"?"get":"post",O=typeof g=="string"&&Oo.test(g),ue=le=>{if(p&&p(le),le.defaultPrevented)return;le.preventDefault();let ke=le.nativeEvent.submitter,be=ke?.getAttribute("formmethod")||m,re=()=>N(ke||le.currentTarget,{fetcherKey:a,method:be,navigate:o,replace:c,state:h,relative:x,preventScrollReset:k,viewTransition:j,defaultShouldRevalidate:E});_&&o!==!1?w.startTransition(()=>re()):re()};return w.createElement("form",{ref:R,method:U,action:$,onSubmit:d?p:ue,...W,"data-discover":!O&&r==="render"?"true":void 0})});Ug.displayName="Form";function Hg(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Zf(r){let a=w.useContext(Vr);return We(a,Hg(r)),a}function Gg(r,{target:a,replace:o,mask:d,state:c,preventScrollReset:h,relative:m,viewTransition:g,defaultShouldRevalidate:p,useTransitions:x}={}){let k=Hf(),j=sn(),E=Oi(r,{relative:m});return w.useCallback(W=>{if(jg(W,a)){W.preventDefault();let R=o!==void 0?o:ar(j)===ar(E),_=()=>k(r,{replace:R,mask:d,state:c,preventScrollReset:h,relative:m,viewTransition:g,defaultShouldRevalidate:p});x?w.startTransition(()=>_()):_()}},[j,k,E,o,d,c,a,r,h,m,g,p,x])}var Kg=0,qg=()=>`__${String(++Kg)}__`;function Qg(){let{router:r}=Zf("useSubmit"),{basename:a}=w.useContext(Pt),o=hg(),d=r.fetch,c=r.navigate;return w.useCallback(async(h,m={})=>{let{action:g,method:p,encType:x,formData:k,body:j}=Cg(h,a);if(m.navigate===!1){let E=m.fetcherKey||qg();await d(E,o,m.action||g,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:k,body:j,formMethod:m.method||p,formEncType:m.encType||x,flushSync:m.flushSync})}else await c(m.action||g,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:k,body:j,formMethod:m.method||p,formEncType:m.encType||x,replace:m.replace,state:m.state,fromRouteId:o,flushSync:m.flushSync,viewTransition:m.viewTransition})},[d,c,a,o])}function Zg(r,{relative:a}={}){let{basename:o}=w.useContext(Pt),d=w.useContext(ln);We(d,"useFormAction must be used inside a RouteContext");let[c]=d.matches.slice(-1),h={...Oi(r||".",{relative:a})},m=sn();if(r==null){h.search=m.search;let g=new URLSearchParams(h.search),p=g.getAll("index");if(p.some(k=>k==="")){g.delete("index"),p.filter(j=>j).forEach(j=>g.append("index",j));let k=g.toString();h.search=k?`?${k}`:""}}return(!r||r===".")&&c.route.index&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(h.pathname=h.pathname==="/"?o:qt([o,h.pathname])),ar(h)}function Yg(r,{relative:a}={}){let o=w.useContext(Bf);We(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:d}=Zf("useViewTransitionState"),c=Oi(r,{relative:a});if(!o.isTransitioning)return!1;let h=yn(o.currentLocation.pathname,d)||o.currentLocation.pathname,m=yn(o.nextLocation.pathname,d)||o.nextLocation.pathname;return is(c.pathname,m)!=null||is(c.pathname,h)!=null}const Yf=1500,yo=16*1024*1024;class Re extends Error{constructor(a,o,d){super(a),this.status=o,this.payload=d,this.name="RuntimeRequestError"}status;payload}function gs(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function ls(r){return gs(r)&&typeof r.status=="number"&&Number.isInteger(r.status)?r.status:0}function St(r,a){return gs(r)&&typeof r.message=="string"&&r.message?r.message:a}function zo(r,a=0,o={remaining:1e5}){if(o.remaining-=1,a>40||o.remaining<0)throw new Error("API-Daten überschreiten die zulässige Strukturgröße.");if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"&&Number.isFinite(r))return r;if(Array.isArray(r))return r.map(c=>zo(c,a+1,o));if(!gs(r))throw new Error("Ungültige JSON-Daten.");const d=Object.create(null);for(const[c,h]of Object.entries(r)){if(c==="__proto__"||c==="prototype"||c==="constructor")throw new Error("Unzulässiger API-Datenschlüssel.");d[c]=zo(h,a+1,o)}return d}function Xf(r){const a=zo(r);if(!gs(a))throw new Error("Ungültige API-Antwort.");return a}function Jf(r){const a=Xf(r);if(typeof a.enabled!="boolean"||typeof a.authed!="boolean"||typeof a.role!="string"||typeof a.configured!="boolean"||!["iobroker","eos"].includes(String(a.mode))||!["none","customer","installer","admin"].includes(a.role)||a.authenticated!==void 0&&a.authenticated!==a.authed||!Array.isArray(a.capabilities)||!a.capabilities.every(o=>typeof o=="string")||a.capabilities.length>128||a.user!==void 0&&a.user!==null&&typeof a.user!="string"||a.authed&&(a.configured!==!0||!a.user||a.role==="none"||typeof a.csrfToken!="string"||!/^[A-Za-z0-9+/_=-]{16,1024}$/.test(a.csrfToken)))throw new Error("Ungültiger EOS-Anmeldestatus.");return{...a,enabled:a.enabled,configured:a.configured,mode:a.mode,authed:a.authed,role:a.role,loginUrl:typeof a.loginUrl=="string"&&a.loginUrl.length<=4096?a.loginUrl:"",logoutUrl:typeof a.logoutUrl=="string"&&a.logoutUrl.length<=4096?a.logoutUrl:"",csrfToken:a.authed&&typeof a.csrfToken=="string"?a.csrfToken:"",capabilities:a.capabilities,user:typeof a.user=="string"?a.user:null}}class Mo extends Error{constructor(){super("API-Antwort ist zu groß (maximal 16 MiB)."),this.name="ApiResponseLimitError"}}async function Xg(r,a){const o=r.body;if(!o||o.locked)throw a.abort(),new Error("API-Antwort enthält keinen lesbaren Datenstrom.");const d=o.getReader(),c=a.signal,h=()=>{d.cancel().catch(()=>{})};c.addEventListener("abort",h,{once:!0});try{if(c.aborted)throw new Error("API-Abruf abgebrochen.");const m=r.headers.get("content-length");if(m!==null){if(!/^\d+$/.test(m)||!Number.isSafeInteger(Number(m)))throw new Error("Ungültige API-Antwortgröße.");if(Number(m)>yo)throw new Mo}let g=new Uint8Array(64*1024),p=0;for(;;){const j=await d.read();if(c.aborted)throw new Error("API-Abruf abgebrochen.");if(j.done)break;const E=p+j.value.byteLength;if(E>yo)throw new Mo;if(E>g.byteLength){const W=new Uint8Array(Math.min(yo,Math.max(E,g.byteLength*2)));W.set(g.subarray(0,p)),g=W}g.set(j.value,p),p=E}const x=new TextDecoder("utf-8",{fatal:!0}).decode(g.subarray(0,p));return JSON.parse(x)}catch(m){throw a.abort(),h(),m}finally{c.removeEventListener("abort",h),d.releaseLock()}}async function eh(r,a,o=!1){const d=/^application\/json(?:\s*;|$)/i.test(r.headers.get("content-type")||"");if(o&&!d&&[401,403,404,502].includes(r.status))throw a.abort(),r.body&&r.body.cancel().catch(()=>{}),r.status===401?new Re("Die Anmeldung an der Systemverwaltung ist abgelaufen. Bitte dort erneut anmelden.",401,{error:"admin_proxy_auth_required"}):r.status===403?new Re("Der Admin-Proxy benötigt ein Konto aus der Administratorgruppe der Systemverwaltung.",403,{error:"admin_proxy_forbidden"}):r.status===404?new Re("Der Admin-Proxy dieser Instanz ist nicht verfügbar. Admin-Version und Instanzfreigabe prüfen.",404,{error:"admin_proxy_unavailable"}):new Re("Der UI-Adapter ist über den Admin-Proxy nicht erreichbar. Instanzstatus und Port prüfen.",502,{error:"runtime_unreachable"});let c;try{const h=await Xg(r,a);c=Xf(h)}catch(h){const m=Object.create(null),g=r.ok?h instanceof Mo?h.message:"Ungültige API-Antwort.":`HTTP ${r.status}`;throw new Re(g,r.status,m)}if(!r.ok||c.ok===!1){const h=typeof c.message=="string"?c.message:typeof c.error=="string"?c.error:`HTTP ${r.status}`;throw new Re(h,r.status,c)}return c}function Fr(r){if(typeof r!="string"||!/^(0|[1-9]\d{0,5})$/.test(r))throw new Re("Ungültige Adapterinstanz.",0,{error:"runtime_instance_invalid"});return r}function an(){const r=new URLSearchParams(window.location.search||"").get("instance");if(r!==null)return Fr(r);const a="/proxy/nexowatt-ui.",o=window.location.pathname||"/",d=o.indexOf(a);if(d>=0){const c=o.slice(d+a.length),h=c.indexOf("/");return Fr(h<0?c:c.slice(0,h))}return"0"}function xo(r){if(typeof r!="string"||r.length>256||!r.startsWith("/")||!r.endsWith("/"))throw new Re("Der Admin-Verbindungspfad ist ungültig.",0,{error:"runtime_path_invalid"});const a=r.slice(1,-1).split("/");if(r!=="/"&&(a.length>16||a.some(o=>!/^[A-Za-z0-9._~-]{1,128}$/.test(o)||o==="."||o==="..")))throw new Re("Der Admin-Verbindungspfad ist ungültig.",0,{error:"runtime_path_invalid"});if(/\/proxy\/nexowatt-ui\.(?:0|[1-9][0-9]{0,5})\//u.test(r))throw new Re("Der Admin-Verbindungspfad ist mehrdeutig.",0,{error:"runtime_path_invalid"});return r}function of(r,a){const o=`${r}proxy/nexowatt-ui.${a}`;if(o.length>256)throw new Re("Der Admin-Verbindungspfad ist zu lang.",0,{error:"runtime_path_invalid"});return th()+o}function th(){const r=window.location.protocol;if(r!=="http:"&&r!=="https:")throw new Re("Für die EOS-Verbindung ist HTTP oder HTTPS erforderlich.",0,{error:"runtime_protocol_invalid"});const a=window.location.hostname;if(!a||/[\\\s/?#@]/.test(a))throw new Re("Der EOS-Hostname ist ungültig.",0,{error:"runtime_host_invalid"});const o=window.location.port;if(o&&(!/^\d{1,5}$/.test(o)||Number(o)<1||Number(o)>65535))throw new Re("Der EOS-Port ist ungültig.",0,{error:"runtime_port_invalid"});return`${r}//${a}${o?`:${o}`:""}`}function Vn(r=an()){const a=Fr(r),o=window.location.pathname||"/",d="/proxy/nexowatt-ui.",c=o.indexOf(d);if(c>=0){if(o.indexOf(d,c+d.length)>=0||o.indexOf("/adapter/nexowatt-ui/",c+d.length)>=0)throw new Re("Der Admin-Verbindungspfad ist mehrdeutig.",0,{error:"runtime_path_invalid"});const k=o.slice(c+d.length),j=k.indexOf("/");if(Fr(j<0?k:k.slice(0,j))!==a)throw new Re("Die Seite gehört zu einer anderen Adapterinstanz.",0,{error:"runtime_instance_mismatch"});const W=xo(o.slice(0,c+1));return of(W,a)}if(window.location.protocol!=="https:")return null;const h="/adapter/nexowatt-ui/",m=o.indexOf(h);if(m<0)return null;const g=xo(o.slice(0,m+1)),p=o.slice(m+h.length);if(p!=="tab.html"&&p!=="react/index.html"&&p!=="react/"&&p!=="react")throw new Re("Der Admin-Einstiegspfad ist unbekannt.",0,{error:"runtime_path_invalid"});const x=So(()=>window.socketPath)||So(()=>window.parent&&window.parent.socketPath)||So(()=>window.top&&window.top.socketPath);if(x!=null&&x!==""&&!(typeof x=="string"&&x.includes("@@"))&&xo(x)!==g)throw new Re("Admin-Pfad und Verbindungspfad stimmen nicht überein.",0,{error:"runtime_path_mismatch"});return of(g,a)}async function vs(r=an(),a=null){return th()}function So(r){try{return r()}catch{return null}}async function uf(r,a=Yf,o={}){const d=new AbortController;let c,h=!1;try{c=setTimeout(()=>{h=!0,d.abort()},a);const m=await fetch(r,{method:"GET",cache:"no-store",redirect:"error",credentials:o.credentials||"omit",headers:o.headers||void 0,signal:d.signal});return await eh(m,d,o.adminProxy===!0)}catch(m){throw h?new Re("Der UI-Adapter antwortet nicht rechtzeitig. Bitte Verbindung und Adapterstatus prüfen.",0,{error:"runtime_timeout"}):m instanceof Re?m:new Re("Die Verbindung zum UI-Adapter ist nicht erreichbar. Bitte Zugriffspfad und Adapterstatus prüfen.",0,{error:"runtime_network_error"})}finally{c&&clearTimeout(c)}}async function Jg(r,a,o=Yf,d={}){const c=new AbortController;let h,m=!1;try{h=setTimeout(()=>{m=!0,c.abort()},o);const g=await fetch(r,{method:"POST",cache:"no-store",redirect:"error",credentials:d.credentials||"omit",headers:{"Content-Type":"application/json",...d.headers||{}},body:JSON.stringify(a||{}),signal:c.signal});return await eh(g,c,d.adminProxy===!0)}catch(g){throw m?new Re("Der UI-Adapter antwortet nicht rechtzeitig. Bitte Verbindung und Adapterstatus prüfen.",0,{error:"runtime_timeout"}):g instanceof Re?g:new Re("Die Verbindung zum UI-Adapter ist nicht erreichbar. Bitte Zugriffspfad und Adapterstatus prüfen.",0,{error:"runtime_network_error"})}finally{h&&clearTimeout(h)}}async function Ur(r,a=null,o=6e3,d=an(),c=null){const h=Date.now()+o,m=await vs(d,c);let g=h-Date.now();if(g<=0)throw new Re("Der UI-Adapter antwortet nicht rechtzeitig. Bitte Verbindung und Adapterstatus prüfen.",0,{error:"runtime_timeout"});const p={credentials:"include",adminProxy:m.includes("/proxy/nexowatt-ui.")},x=m+r;if(a!==null){if(new URL(x).origin!==window.location.origin)throw new Re("Schreibzugriffe benötigen den gemeinsamen HTTPS-Zugang zur UI.",0,{error:"runtime_same_origin_required"});if(!/^\/api\/(?:auth|strict-auth)\/login(?:\?|$)/.test(r)){const k=Jf(await uf(m+"/api/auth/status",g,p));if(!k.authed||!k.configured||!k.csrfToken)throw new Re("Anmeldung erforderlich.",401,{error:"authentication_required"});if(p.headers={"X-NW-CSRF":k.csrfToken},g=h-Date.now(),g<=0)throw new Re("Die Berechtigungsprüfung hat das Zeitbudget überschritten.",0,{error:"runtime_timeout"})}}return a===null?uf(x,g,p):Jg(x,a,g,p)}async function cf(r=an(),a=null){const o=await vs(r,a),d=new URL(o+"/login.html");if(d.username||d.password||d.protocol!=="https:"&&!(d.protocol==="http:"&&["localhost","127.0.0.1","[::1]","::1"].includes(d.hostname)))throw new Re("Die Anmeldung benötigt einen HTTPS-Zugang.",0,{error:"runtime_secure_route_required"});return d.href}async function ev(r=an(),a=null){return Jf(await Ur(`/api/strict-auth/status?instance=${encodeURIComponent(Fr(r))}&t=${Date.now()}`,null,6e3,r,a))}async function tv(r=an(),a=null){return await Ur(`/api/strict-auth/logout?instance=${encodeURIComponent(Fr(r))}&t=${Date.now()}`,{},6e3,r,a),{ok:!0}}function nn(r){try{(window.top||window).location.href=r}catch{window.location.href=r}}async function df(r=null){return Ur("/api/installer/notification-mail",r,1e4)}async function Fn(r="",a=null){return Ur(`/api/mesh/coordinator${r}`,a,1e4)}async function Mi(r="",a=null){if(!["","/status","/config","/preview"].includes(r))throw new Error("Ungültiger Netzanschluss-Aufruf.");return Ur(`/api/dynamic-grid${r}`,a,5e3)}async function ff(r="",a=null){if(!["","/config","/preview","/revoke"].includes(r))throw new Error("Ungültiger Partner-Aufruf.");return Ur(`/api/installer/partner-integrations${r}`,a,5e3)}const nv=""+new URL("nexowatt-192-43ZwQ44y.png",import.meta.url).href;function ur({title:r,subtitle:a,children:o,actions:d=null,compact:c=!1,embedded:h=!1,showBack:m=!0,backLabel:g="Zurück zum Installer"}){w.useEffect(()=>{document.title=r?`NexoWatt EOS – ${r}`:"NexoWatt EOS Admin"},[r]);const p=an();return h?l.jsx("main",{className:"nw-embedded-ems-page",children:o}):l.jsxs("div",{className:"nw-page-shell",children:[l.jsx("div",{className:"nw-page-gradient"}),l.jsxs("div",{className:`nw-page-wrap ${c?"nw-page-wrap--compact":""}`,children:[l.jsxs("header",{className:"nw-hero",children:[l.jsxs("div",{className:"nw-brand",children:[l.jsx("img",{className:"nw-brand__logo",src:nv,alt:"NexoWatt EOS",width:52,height:52}),l.jsx("div",{children:l.jsx("h1",{children:r})})]}),l.jsxs("div",{className:"nw-instance-badge",children:["Instanz ",p]})]}),a||m||d?l.jsxs("section",{className:"nw-header-card",children:[a?l.jsx("p",{className:"nw-subtitle",children:a}):null,l.jsxs("div",{className:"nw-header-card__actions",children:[m?l.jsx(Qo,{className:"nw-link-button",to:"/installer",children:g}):null,d]})]}):null,o]})]})}function rv({children:r}){const a=w.useRef(null);return w.useEffect(()=>{const o=a.current;if(!o)return;const d=document.documentElement,c=document.body,h=d.classList.contains("nw-ems-embedded"),m=c.classList.contains("nw-ems-embedded"),g=c.classList.contains("nw-cockpit-page");d.classList.add("nw-ems-embedded"),c.classList.add("nw-ems-embedded","nw-cockpit-page");const p=document.createElement("link");p.rel="stylesheet",p.href=`${Vn()??""}/static/styles.css`,p.dataset.nwEmbeddedEms="true",document.head.appendChild(p);let x=!0,k=0,j=0;const E=()=>{!x||k||(k=window.requestAnimationFrame(()=>{k=0;const R=Math.max(1,Math.ceil(o.getBoundingClientRect().height)+1);R!==j&&(j=R,window.parent.postMessage({type:"nw:dynamic-grid-height",height:R},window.location.origin))}))},W=new ResizeObserver(E);return W.observe(o),p.addEventListener("load",E),window.addEventListener("resize",E),document.fonts?.ready.then(E).catch(()=>{}),E(),()=>{x=!1,W.disconnect(),window.cancelAnimationFrame(k),window.removeEventListener("resize",E),p.removeEventListener("load",E),p.remove(),h||d.classList.remove("nw-ems-embedded"),m||c.classList.remove("nw-ems-embedded"),g||c.classList.remove("nw-cockpit-page")}},[]),l.jsx("div",{className:"nw-embedded-ems-content",ref:a,children:r})}function hf(r){if(!r||r.length>4096||/[\\\u0000-\u0020\u007f]/.test(r)||r.startsWith("//"))return"";try{const a=new URL(r,window.location.origin);return a.username||a.password||!["http:","https:"].includes(a.protocol)||a.origin!==window.location.origin&&a.protocol!=="https:"?"":a.href}catch{return""}}const nh=w.createContext(null);function iv(){return w.useContext(nh)}function pf(r,a,o=null){if(Array.isArray(o)&&!o.includes(r?.role||"")||["license.manage","notifications.manage"].includes(String(a||""))&&r?.role!=="admin"||a==="mesh.configure"&&!["admin","installer"].includes(r?.role||""))return!1;const d=Array.isArray(r?.capabilities)?r.capabilities.map(String):[];return d.includes("*")||d.includes(String(a||""))}function Gt({capability:r,title:a,requiredRole:o="Installer oder Admin",allowedRoles:d=null,embedded:c=!1,children:h}){const m=an(),g=c&&window.parent!==window&&new URLSearchParams(window.location.search).get("embedded")==="1",p=Z=>g?l.jsx(rv,{children:Z}):Z,[x,k]=w.useState("checking"),[j,E]=w.useState(null),[W,R]=w.useState(""),[_,N]=w.useState(!1),[$,U]=w.useState("Berechtigung wird geprüft…"),[O,ue]=w.useState(!1),le=w.useRef(!1),ke=w.useRef(0),be=w.useRef(!1),re=w.useRef(null),je=w.useRef(!1),L=w.useMemo(()=>!!(j?.enabled!==!1&&j?.authed&&pf(j,r,d)),[j,r,d]),oe=w.useCallback(Z=>(E(Z),Z.enabled===!1||!Z.configured?(k("locked"),U("Die Anmeldung ist noch nicht korrekt eingerichtet. Der geschützte Bereich bleibt gesperrt."),"denied"):Z.authed&&pf(Z,r,d)?(k("authorized"),U("Zugriff freigegeben."),"authorized"):(k("locked"),U(Z.authed?`Das angemeldete Konto besitzt nicht die erforderliche Rolle (${o}).`:Z.mode==="eos"?`Bitte zentral im EOS mit der Rolle ${o} anmelden.`:`Bitte mit einem Benutzerkonto der Rolle ${o} anmelden.`),"denied")),[r,o,d]),z=w.useCallback(Z=>(E(null),R(""),k("locked"),U(`Berechtigungsprüfung nicht erreichbar: ${St(Z,"Verbindung nicht verfügbar")}. Der Bereich bleibt gesperrt.`),"unavailable"),[]),K=w.useCallback(async({silent:Z=!1}={})=>{if(!le.current||be.current||re.current!==null||Z&&je.current)return"stale";Z||(je.current=!1);const ce=++ke.current;re.current=ce;const ye=()=>le.current&&ke.current===ce;Z||(k("checking"),U("Berechtigung wird geprüft…"));try{const F=await ev(m,null);if(!ye())return"stale";const se=oe(F);if(F.configured&&(!F.authed||se==="denied")){const G=!F.authed&&F.mode==="eos"?hf(F.loginUrl):await cf(m,null);ye()&&R(G)}return se}catch(F){return ye()?z(F):"stale"}finally{re.current===ce&&(re.current=null)}},[oe,z,m]);w.useEffect(()=>{le.current=!0,be.current=!1,ue(!1),K().catch(()=>{});const Z=()=>{K({silent:!0}).catch(()=>{})};window.addEventListener("focus",Z);const ce=window.setInterval(()=>{K({silent:!0}).catch(()=>{})},3e4);return()=>{le.current=!1,ke.current+=1,re.current=null,be.current=!1,window.clearInterval(ce),window.removeEventListener("focus",Z)}},[K]);const Se=async()=>{if(!le.current||be.current)return;const Z=j,ce=++ke.current,ye=()=>le.current&&ke.current===ce;re.current=null,be.current=!0,je.current=!0,ue(!0),E(null),k("locked"),U("Abmeldung läuft…");try{if(await tv(m,null),!ye())return;if(window.navigator.serviceWorker?.controller?.postMessage({type:"NW_AUTH_LOGOUT"}),Z?.mode==="eos")R(hf(Z.logoutUrl)),N(!0),U("Die Ansicht ist gesperrt. Bitte die zentrale EOS-Abmeldung im eigenen Fenster abschließen.");else{const F=await cf(m,null);if(!ye())return;R(F),N(!1),U(`Abgemeldet. Bitte mit einem Benutzerkonto der Rolle ${o} anmelden.`)}}catch(F){ye()&&U(`Ansicht gesperrt. Die Abmeldung konnte nicht bestätigt werden: ${St(F,"Verbindung nicht verfügbar")}. Bitte erneut prüfen.`)}finally{ye()&&(be.current=!1,ue(!1))}};return p(L&&x==="authorized"?l.jsx(nh.Provider,{value:j,children:l.jsxs("div",{className:"nw-protected-route",children:[!g&&l.jsxs("div",{className:"nw-protected-route__session",children:[l.jsx("span",{children:j?.user?`Angemeldet als ${j.user} (${j.role||"berechtigt"})`:"Geschützter Zugriff aktiv"}),l.jsx("button",{className:"nw-button",disabled:O,onClick:Se,type:"button",children:"Abmelden"})]}),h]})}):l.jsx(ur,{embedded:g,title:a,subtitle:`Dieser Bereich ist ausschließlich für ${o} freigegeben. Inhalte und Lizenzdaten werden erst nach erfolgreicher EOS-Anmeldung geladen.`,showBack:!1,compact:!0,children:l.jsxs("section",{className:"nw-card nw-access-gate","aria-busy":x==="checking"||O,children:[l.jsx("h2",{children:"Zugriff geschützt"}),l.jsx("p",{className:"nw-text-muted",children:"Direkte Links, Browser-Lesezeichen und erneutes Laden umgehen diese Sperre nicht."}),l.jsx("p",{className:"nw-text-muted",id:"nwAuthHelp",children:j?.mode==="eos"?"Die zentrale EOS-Anmeldung bestätigt dein Konto und deine Rolle. Hier wird kein Passwort abgefragt.":"Die Anmeldung öffnet sich in einem eigenen Fenster. Verwende dort dein eigenes Benutzerkonto und kehre anschließend hierher zurück."}),l.jsxs("div",{className:"nw-actions-row",children:[W&&l.jsx("a",{className:"nw-button nw-button--primary",href:W,target:"_blank",rel:"noopener noreferrer",children:_?"Zentral abmelden":j?.authed?"Zur Bedienoberfläche":j?.mode==="eos"?"Zentral anmelden":"Anmeldung öffnen"}),l.jsx("button",{className:"nw-button",disabled:O||x==="checking",onClick:()=>{N(!1),K()},type:"button",children:"Erneut prüfen"})]}),l.jsx("div",{className:`nw-status ${L?"nw-status--ok":"nw-status--bad"}`,children:$})]})}))}function lv(r){if(r?.authed!==!0||!["admin","installer","customer"].includes(r.role))return[];const a=[{label:"Zum EOS-Dashboard",path:"/"}];return r.role==="admin"&&a.unshift({label:"Zur EOS-Administration",path:"/system/"}),a}function sv(r){return r?.authed!==!0||r.role!=="admin"?[]:[{label:"Devices",path:"/modules/devices/"},{label:"EEBus",path:"/modules/eebus/"},{label:"Sicherung",path:"/modules/backup/"},{label:"Zertifikate",path:"/security/tls/"},{label:"Bestandsübernahme",path:"/migration/"}]}function mf(){const r=iv(),a=r?.authed===!0&&r?.role==="admin",o=an(),[d,c]=w.useState(null),[h,m]=w.useState("Verbindung wird geprüft…");w.useEffect(()=>{let k=!0;return c(null),m("Verbindung wird geprüft…"),(async()=>{try{const j=await vs(o);if(!k)return;c({instance:o,url:j}),m("Bereit.")}catch{if(!k)return;c(null),m("Die Adresse der Oberfläche konnte nicht ermittelt werden. Bitte die Adapterverbindung prüfen.")}})(),()=>{k=!1}},[o]);const g=d?.instance===o?d.url:null,p=w.useMemo(()=>{const k=window.location.port||(window.location.protocol==="https:"?"443":"80");return`nwAdmin=1&instance=${encodeURIComponent(String(o))}&adminPort=${encodeURIComponent(k)}`},[o]),x=[...sv(r).map(k=>({label:k.label,adminOnly:!0,onClick:()=>nn(`${g}${k.path}`)})),{label:"E-Mail-Versand",adminOnly:!0,onClick:()=>nn(`${g}/mail-setup/?instance=${o}#/notification-mail`)},{label:"VIS öffnen",variant:"primary",onClick:()=>nn(`${g}/`)},{label:"EMS Apps öffnen",onClick:()=>nn(`${g}/ems-apps.html?${p}`)},{label:"Simulation",onClick:()=>nn(`${g}/simulation.html?${p}`)},{label:"Lizenz",adminOnly:!0,onClick:()=>nn(`${g}/nexowatt/license`)},{label:"SmartHome VIS",onClick:()=>nn(`${g}/smarthome.html`)},{label:"SmartHome Config",onClick:()=>nn(`${g}/smarthome-config.html?${p}`)}];return l.jsx(ur,{title:"Installer",subtitle:"Wähle, was geöffnet werden soll. Die Verbindung wird aus der Adapter-Instanz ermittelt. Die Installer-Seite ist für Konfiguration und Mapping gedacht.",showBack:!1,actions:g?lv(r).map(k=>l.jsx("a",{className:"nw-link-button",href:`${g}${k.path}`,target:"_top",children:k.label},k.path)):null,children:l.jsxs("section",{className:"nw-card nw-card--centered",children:[l.jsx("div",{className:"nw-button-grid",children:x.filter(k=>!k.adminOnly||a).map(k=>l.jsx("button",{className:`nw-button ${k.variant==="primary"?"nw-button--primary":""}`,onClick:()=>{g&&k.onClick()},disabled:!g,type:"button",children:k.label},k.label))}),l.jsx("div",{className:"nw-install-hint",role:"status",children:h})]})})}const pt=()=>{throw new Error("Ungültige Mesh-Daten. Bitte Verbindung und Konfiguration prüfen.")};function Ii(r){if(r===null||typeof r!="object"||Array.isArray(r))return pt();const a=Object.getPrototypeOf(r);return a!==Object.prototype&&a!==null?pt():r}const ne=r=>typeof r=="string"&&r.length<=16384?r:pt(),J=r=>typeof r=="number"&&Number.isFinite(r)?r:pt(),Tt=r=>typeof r=="boolean"?r:pt(),Me=r=>a=>a==null?null:r(a),ht=(r,a)=>o=>o===void 0?a:r(o),$n=(r,a=1e4)=>o=>Array.isArray(o)&&o.length<=a?o.map(d=>r(d)):pt(),Bn=(...r)=>a=>{for(const o of r)if(a===o)return o;return pt()};function Ce(r){return a=>{const o=Ii(a),d=Object.create(null);for(const[c,h]of Object.entries(r))d[c]=h(o[c]);return d}}function _o(r,a=0,o={remaining:2e5}){if((--o.remaining<0||a>24)&&pt(),!(r===null||typeof r=="boolean")){if(typeof r=="string"){ne(r);return}if(typeof r=="number"){J(r);return}if(Array.isArray(r)){r.length>1e4&&pt();for(const d of r)_o(d,a+1,o);return}for(const[d,c]of Object.entries(Ii(r)))(d==="__proto__"||d==="prototype"||d==="constructor")&&pt(),_o(c,a+1,o)}}function cr(r){return a=>(_o(a),r(a))}const av=["importW","exportW","l1A","l2A","l3A","evW","chargeW","dischargeW","pvW","flexW"],ov=["importW","exportW","l1A","l2A","l3A"],ko=Ce({importW:J,exportW:J,l1A:J,l2A:J,l3A:J}),ss=Ce({importW:J,exportW:J,l1A:J,l2A:J,l3A:J,evW:J,chargeW:J,dischargeW:J,pvW:J,flexW:J}),rh={limit:ko,reserve:ko,unmonitored:ko},uv=Ce(rh),gf=Ce({id:ne,name:ne,branch:ne,max:ss,fallback:ss,weight:J,commissioned:Tt,watchdogVerified:Tt}),cv=Ce({strategy:Bn("fixed","transformer"),headroomW:J,headroomA:J,engagePct:J,releasePct:J}),dv=Ce({evW:ht(ne,""),chargeW:ht(ne,""),dischargeW:ht(ne,""),pvW:ht(ne,""),flexW:ht(ne,"")}),fv=Ce({gridW:ht(ne,""),l1A:ht(ne,""),l2A:ht(ne,""),l3A:ht(ne,"")}),hv=Ce({id:ne,epoch:ne,importDp:ne,exportDp:ne,unit:Bn("Wh","kWh")}),ih=Ce({role:Bn("off","master","slave"),mode:Bn("diagnostic","active"),siteId:ne,nodeId:ne,masterId:ne,revision:J,intervalMs:J,requestTimeoutMs:J,leaseMs:J,staleMs:J,recoveryCycles:J,rampWPerSecond:J,allocation:cv,masterUrl:ne,localParticipates:Tt,nodes:$n(gf,99),branches:$n(Ce({id:ne,...rh}),100),local:gf,site:uv,feedback:dv,siteFeedback:fv,meter:Ce({id:ne,epoch:ne,importDp:ne,exportDp:ne,unit:Bn("Wh","kWh"),archiveIntervalMs:J})}),lh=Ce({importW:J,exportW:J,strategy:r=>r===void 0?void 0:Bn("fixed","transformer")(r)}),pv=cr(lh),as=r=>{const a=Ii(r),o=Ce({seq:J,at:ne,stream:ne,meter:hv,quality:ne,importMilliWh:Me(J),exportMilliWh:Me(J),sourceAt:$n(Me(J),2)})(r);return(!Number.isSafeInteger(o.seq)||o.seq<1||!Number.isFinite(Date.parse(o.at)))&&pt(),{...a,...o,meter:{...Ii(a.meter),...o.meter}}},mv=Ce({error:ht(ne,""),local:Me(Ce({sequence:J})),pending:J,lastSync:Me(ne),meterQuality:ne,nodes:$n(Ce({id:ne,name:ne,last:Me(as),receivedAt:Me(ne),failure:ht(ne,""),sequence:ht(J,0)}),100)}),gv=Ce({controlMode:ne,state:ne,reason:ne,operatorLimits:Me(lh),siteMeasurement:Me(Ce({gridW:Me(J),ageMs:Me(J),phaseA:Me($n(Me(J),3))})),nodes:$n(Ce({id:ne,name:ne,online:Tt,ageMs:Me(J),rttMs:Me(J),confirmed:Tt,sample:Me(Ce({gridW:J})),allowed:ss,reserved:ss}),100)}),vv=Ce({master:Me(gv),local:Me(Ce({state:ht(ne,""),reason:ht(ne,""),remainingMs:ht(J,0)})),timing:Ce({lastRttMs:Me(J),p95RttMs:Me(J)}),error:ne,accounting:mv}),wv=Ce({enabled:Tt}),sh={app:wv,config:ih,pairedNodes:$n(ne,99),locked:Tt},yv=cr(Ce(sh)),xv=cr(Ce({...sh,status:vv})),Sv=Ce({config:ih,pairingKey:ne}),ah=cr(r=>{const a=Sv(r);return(a.config.role!=="slave"||!/^[A-Za-z0-9_-]{43}$/.test(a.pairingKey))&&pt(),a});function kv(r){r.length>1048576&&pt();let a;try{a=JSON.parse(r)}catch{return pt()}return ah(a)}const jv=Ce({importEuroKwh:J,exportEuroKwh:J,periodFeeEuro:J}),bv=Ce({enabled:Tt,intervalMs:J,maxAgeMs:J,maxSkewMs:J,maxArchiveMB:J,operatorName:ne,tariff:jv,meter:Ce({id:ne,epoch:ne,importDp:ne,exportDp:ne,unit:Bn("Wh","kWh"),calibrated:Tt,calibrationUntil:ne})}),vf=cr(Ce({config:bv})),Ev=cr(Ce({lastSequence:J,records:$n(as)})),Cv=cr(r=>{const a=Ce({nodeId:ne,name:ne,operatorName:ne,status:Bn("BLOCKED","PARTIAL_PERIOD","DRAFT"),requested:Ce({from:ne,to:ne}),measured:Ce({from:Me(ne),to:Me(ne)}),first:Me(as),last:Me(as),count:J,invalid:J,gaps:J,importKwh:Me(J),exportKwh:Me(J),amounts:Me(Ce({importCents:J,exportCents:J,periodFeeCents:J,balanceCents:J})),note:ne,periodFeePending:Tt,usable:Tt,boundaryComplete:Tt,generatedAt:ne})(r);return a.usable&&(!a.amounts||!a.first||!a.last||!a.measured.from||!a.measured.to)&&pt(),{...Ii(r),...a}}),tn=r=>r?new Date(r).toLocaleString("de-DE"):"—",Zl=r=>{const a=new Date(r);return new Date(a.getTime()-a.getTimezoneOffset()*6e4).toISOString().slice(0,23)},wf=r=>r==null?"—":r/1e6,jo=r=>(r/100).toLocaleString("de-DE",{style:"currency",currency:"EUR"});function bo(r,a,o="application/json"){const d=URL.createObjectURL(new Blob([a],{type:`${o};charset=utf-8`})),c=document.createElement("a");c.href=d,c.download=r,c.click(),setTimeout(()=>URL.revokeObjectURL(d),1e3)}const Nv=r=>`"${(typeof r=="number"&&Number.isFinite(r)?String(r):String(r??"").replace(/^[=+\-@\t\r]/,"'$&")).replace(/"/g,'""')}"`;function Pv({meshConfig:r,status:a}){const[o,d]=w.useState(null),[c,h]=w.useState(""),[m,g]=w.useState(!1),[p,x]=w.useState(""),[k,j]=w.useState(Zl(Date.now()-30*864e5)),[E,W]=w.useState(Zl(Date.now())),[R,_]=w.useState(null),[N,$]=w.useState(null);w.useEffect(()=>{let L=!0;return Fn("/accounting").then(oe=>{const z=vf(oe);L&&d(z.config)}).catch(oe=>{L&&h(St(oe,"Mesh-Anfrage fehlgeschlagen."))}),()=>{L=!1}},[]),w.useEffect(()=>{!N&&r?.role==="master"&&$(a?.master?.operatorLimits||{importW:r.site.limit.importW,exportW:r.site.limit.exportW,strategy:r.allocation.strategy})},[r,a,N]);const U=r.role==="master",O=r.role==="slave"||r.localParticipates,ue=[...r.nodes,...U&&O?[r.local]:[]],le=(L,oe)=>d(z=>z&&{...z,[L]:oe}),ke=async L=>{g(!0),h("");try{await L()}catch(oe){h(St(oe,"Mesh-Anfrage fehlgeschlagen."))}finally{g(!1)}},be=L=>{L.preventDefault(),ke(async()=>{const oe=vf(await Fn("/accounting",o));d(oe.config),_(null),h("Zählerarchiv und Tarife gespeichert.")})},re=L=>{L.preventDefault(),ke(async()=>{o&&(_(null),_(Cv(await Fn("/accounting/report",{nodeId:p,from:new Date(k).toISOString(),to:new Date(E).toISOString(),tariff:o.tariff}))))})},je=()=>ke(async()=>{const L=[];let oe=0,z=null;do{const K=Ev(await Fn("/accounting/records",{nodeId:p,after:oe}));if(z===null&&(z=K.lastSequence),!K.records.length)break;let Se=oe;for(const ce of K.records){if(ce.seq<=Se)throw new Error("Ungültige Reihenfolge im Zählerarchiv.");Se=ce.seq}for(const ce of K.records)ce.seq<=z&&Date.parse(ce.at)>=Date.parse(k)&&Date.parse(ce.at)<=Date.parse(E)&&L.push(ce);const Z=K.records.at(-1);if(!Z)break;if(oe=Z.seq,L.length>1e5)throw new Error("Mehr als 100.000 Datensätze: Exportzeitraum verkleinern.");h(`${oe} von ${z} Archivpositionen geprüft…`)}while(oe<z);bo(`NexoWatt_Zaehler_${p}.jsonl`,L.map(K=>JSON.stringify(K)).join(`
|
|
11
|
-
`)+`
|
|
12
|
-
`,"application/x-ndjson"),h(`${L.length} Originaldatensätze exportiert.`)});return l.jsxs(l.Fragment,{children:[U&&N&&l.jsxs("section",{className:"nw-card",children:[l.jsx("h2",{children:"Betreiber · Trafo-Freigabe"}),l.jsx("p",{children:"Die gemeinsame Leistung wird auf die Haus-NVPs verteilt. Absenkungen wirken mit der nächsten Antwort; zusätzliche Freigaben erst nach bestätigter Begrenzung. Technische Anschlussgrenzen und Rückfallreserven bleiben verbindlich."}),l.jsxs("form",{onSubmit:L=>{L.preventDefault(),ke(async()=>{$(pv(await Fn("/operating",N))),h("Trafo-Freigabe gespeichert. Umsetzung in der Teilnehmerübersicht kontrollieren.")})},style:{display:"grid",gap:12},children:[l.jsxs("label",{className:"nw-field-label",children:["Verteilung im Betrieb",l.jsxs("select",{className:"nw-input",value:N.strategy||r.allocation?.strategy||"fixed",onChange:L=>$({...N,strategy:L.target.value==="transformer"?"transformer":"fixed"}),children:[l.jsx("option",{value:"fixed",children:"Feste Anteile"}),l.jsx("option",{value:"transformer",children:"Bedarfsabhängig · Trafo / Häuser"})]})]}),["importW","exportW"].map(L=>l.jsxs("label",{className:"nw-field-label",children:[L==="importW"?"Gesamter Bezug maximal W":"Gesamte Einspeisung maximal W",l.jsx("input",{className:"nw-input",type:"number",min:"0",max:r.site.limit[L],value:N[L],onChange:oe=>$({...N,[L]:oe.target.value===""?"":Number(oe.target.value)}),required:!0})]},L)),l.jsx("button",{className:"nw-button nw-button--primary",disabled:m,children:"Gesamtfreigabe übernehmen"})]})]}),l.jsxs("section",{className:"nw-card",children:[l.jsx("h2",{children:U?"Betreiber · Zähler und Abrechnung":"Haus-NVP · Lokales Zählerarchiv"}),l.jsx("p",{role:"status",children:c}),l.jsx("p",{children:"Optionales Archiv mit kumulativem Bezug und Einspeisung. Originalstände bleiben am Haus gespeichert und werden nach einer Verbindungsunterbrechung nachgeliefert. Master und Slave benötigen jeweils ein aktiviertes Archiv."}),a?.accounting?.error&&l.jsxs("p",{role:"alert",children:["Archivstörung: ",a.accounting.error,". Die Regelung läuft über einen getrennten Kanal."]}),O&&l.jsxs("p",{children:["Lokale Datensätze: ",a?.accounting?.local?.sequence||0," · Noch nicht am Master bestätigt: ",U?"lokal am Master":a?.accounting?.pending||0," · Letzter Abgleich: ",tn(a?.accounting?.lastSync)," · Zählerqualität: ",a?.accounting?.meterQuality||"missing"]}),U&&l.jsx("div",{style:{overflowX:"auto",maxHeight:360},children:l.jsxs("table",{style:{width:"100%"},children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Haus"}),l.jsx("th",{children:"Zähler / Epoche"}),l.jsx("th",{children:"Bezug kWh"}),l.jsx("th",{children:"Einspeisung kWh"}),l.jsx("th",{children:"Messzeit / Empfang"}),l.jsx("th",{children:"Qualität / Datensätze"})]})}),l.jsx("tbody",{children:a?.accounting?.nodes?.map(L=>l.jsxs("tr",{children:[l.jsx("td",{children:L.name||L.id}),l.jsxs("td",{children:[L.last?.meter?.id||"Nicht eingerichtet"," / ",L.last?.meter?.epoch||"—"]}),l.jsx("td",{children:L.last?.importMilliWh==null?"—":(L.last.importMilliWh/1e6).toLocaleString("de-DE")}),l.jsx("td",{children:L.last?.exportMilliWh==null?"—":(L.last.exportMilliWh/1e6).toLocaleString("de-DE")}),l.jsxs("td",{children:[tn(L.last?.at),l.jsx("br",{}),tn(L.receivedAt)]}),l.jsxs("td",{children:[L.failure||L.last?.quality||"Fehlt"," / ",L.sequence||0]})]},L.id))})]})}),o&&l.jsx("form",{onSubmit:be,children:l.jsxs("fieldset",{disabled:m,style:{border:0,padding:0,minWidth:0,display:"grid",gap:12},children:[l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:o.enabled,onChange:L=>le("enabled",L.target.checked)})," ",U?"Abrechnung und Zählerarchiv im Master aktivieren":"Lokales Zählerarchiv und Nachlieferung aktivieren"]}),O&&l.jsxs("details",{open:!o.meter.id,children:[l.jsx("summary",{children:"Geeichten Haus-NVP-Zähler zuordnen"}),l.jsx("p",{children:"Bei Zählerwechsel oder Rücksetzung eine neue Epoche vergeben. Eine neue Epoche darf keine fehlende Zählerdifferenz überbrücken. Der eingebaute Verbrauchsverlauf ersetzt diese ausdrückliche Zählerzuordnung nicht."}),[["id","Zählernummer"],["epoch","Zählerepoche (z. B. Einbaudatum)"],["importDp","Kumulativer Bezugszähler – Datenpunkt"],["exportDp","Kumulativer Einspeisezähler – Datenpunkt"]].map(([L,oe])=>l.jsxs("label",{className:"nw-field-label",children:[oe,l.jsx("input",{className:"nw-input",value:o.meter[L],onChange:z=>le("meter",{...o.meter,[L]:z.target.value})})]},L)),l.jsxs("label",{className:"nw-field-label",children:["Einheit der beiden Datenpunkte",l.jsxs("select",{className:"nw-input",value:o.meter.unit,onChange:L=>le("meter",{...o.meter,unit:L.target.value==="Wh"?"Wh":"kWh"}),children:[l.jsx("option",{children:"kWh"}),l.jsx("option",{children:"Wh"})]})]}),l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:o.meter.calibrated,onChange:L=>le("meter",{...o.meter,calibrated:L.target.checked})})," Geeichter Zweirichtungszähler am Haus-NVP und Zuordnung vor Ort geprüft"]}),l.jsxs("label",{className:"nw-field-label",children:["Eichfrist gültig bis",l.jsx("input",{className:"nw-input",type:"date",value:o.meter.calibrationUntil,onChange:L=>le("meter",{...o.meter,calibrationUntil:L.target.value})})]})]}),l.jsxs("details",{children:[l.jsx("summary",{children:"Archivintervalle und Speichergrenze"}),[["intervalMs","Messintervall ms (mindestens 60.000)"],["maxAgeMs","Zählerstand maximal alt ms"],["maxSkewMs","Beide Zählerstände maximal versetzt ms"],["maxArchiveMB","Archivgrenze MiB je Haus"]].map(([L,oe])=>l.jsxs("label",{className:"nw-field-label",children:[oe,l.jsx("input",{className:"nw-input",type:"number",min:"0",value:o[L],onChange:z=>le(L,z.target.value===""?"":Number(z.target.value)),required:!0})]},L)),l.jsx("p",{children:"Archive werden nicht automatisch gelöscht. Bei voller Grenze wird die Erfassung mit einer sichtbaren Störung angehalten; bestätigte Originale bleiben erhalten."})]}),U&&l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"nw-field-label",children:["Betreibername",l.jsx("input",{className:"nw-input",value:o.operatorName,onChange:L=>le("operatorName",L.target.value)})]}),l.jsx("h3",{children:"Tarif für den ausgewählten Abrechnungsentwurf"}),l.jsx("p",{children:"Preise für den gesamten ausgewerteten Zeitraum eingeben. Bei Tarifwechsel getrennte Zeiträume auswerten. Die Pauschale gilt einmal je Haus und ausgewähltem Zeitraum. Keine automatische Umsatzsteuerberechnung."}),[["importEuroKwh","Bezug EUR/kWh"],["exportEuroKwh","Einspeisegutschrift EUR/kWh"],["periodFeeEuro","Pauschale EUR je ausgewertetem Zeitraum"]].map(([L,oe])=>l.jsxs("label",{className:"nw-field-label",children:[oe,l.jsx("input",{className:"nw-input",type:"number",min:"0",step:"0.000001",value:o.tariff[L],onChange:z=>{le("tariff",{...o.tariff,[L]:z.target.value===""?"":Number(z.target.value)}),_(null)},required:!0})]},L))]}),l.jsx("button",{className:"nw-button nw-button--primary",children:"Archiv-Einstellungen speichern"})]})}),U&&o&&l.jsxs("form",{onSubmit:re,style:{display:"grid",gap:12,marginTop:24},children:[l.jsx("h3",{children:"Zeitraum auswerten"}),l.jsxs("label",{className:"nw-field-label",children:["Haus",l.jsxs("select",{className:"nw-input",value:p,onChange:L=>{x(L.target.value),_(null)},required:!0,children:[l.jsx("option",{value:"",children:"Haus wählen"}),ue.map(L=>l.jsx("option",{value:L.id,children:L.name||L.id},L.id))]})]}),l.jsxs("label",{className:"nw-field-label",children:["Von (Ortszeit)",l.jsx("input",{className:"nw-input",type:"datetime-local",step:"0.001",value:k,onChange:L=>{j(L.target.value),_(null)},required:!0})]}),l.jsxs("label",{className:"nw-field-label",children:["Bis (Ortszeit)",l.jsx("input",{className:"nw-input",type:"datetime-local",step:"0.001",value:E,onChange:L=>{W(L.target.value),_(null)},required:!0})]}),l.jsx("button",{className:"nw-button nw-button--primary",disabled:m,children:"Abrechnungsentwurf berechnen"}),l.jsx("button",{className:"nw-button",type:"button",disabled:m||!p,onClick:je,children:"Originalzählerstände für Zeitraum exportieren (JSONL)"})]})]}),R&&l.jsxs("section",{className:"nw-card nw-mesh-report",children:[l.jsxs("h2",{children:["Abrechnungsentwurf · ",R.name||R.nodeId]}),l.jsx("p",{children:R.operatorName}),l.jsx("p",{children:l.jsx("strong",{children:R.status==="BLOCKED"?"Gesperrt – Zählerdaten nicht durchgehend zuordenbar":R.status==="PARTIAL_PERIOD"?"Teilzeitraum – angeforderte Randstände fehlen":"Entwurf aus Originalzählerständen"})}),l.jsxs("p",{children:["Gewünscht: ",tn(R.requested.from)," bis ",tn(R.requested.to),l.jsx("br",{}),"Gemessen: ",tn(R.measured.from)," bis ",tn(R.measured.to)]}),l.jsxs("p",{children:[R.count," Datensätze · ",R.invalid," Qualitätsfehler · ",R.gaps," Intervalllücken · Zähler ",R.first?.meter?.id||"—"]}),l.jsxs("table",{style:{width:"100%"},children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Position"}),l.jsx("th",{children:"Anfang kWh"}),l.jsx("th",{children:"Ende kWh"}),l.jsx("th",{children:"Differenz kWh"}),l.jsx("th",{children:"Betrag"})]})}),l.jsx("tbody",{children:[["import","Bezug"],["export","Einspeisung"]].map(([L,oe])=>l.jsxs("tr",{children:[l.jsx("th",{children:oe}),l.jsxs("td",{children:[wf(R.first?.[`${L}MilliWh`]),l.jsx("br",{}),l.jsx("small",{children:tn(R.first?.sourceAt?.[L==="import"?0:1])})]}),l.jsxs("td",{children:[wf(R.last?.[`${L}MilliWh`]),l.jsx("br",{}),l.jsx("small",{children:tn(R.last?.sourceAt?.[L==="import"?0:1])})]}),l.jsx("td",{children:R[`${L}Kwh`]??"—"}),l.jsx("td",{children:R.amounts?jo(R.amounts[`${L}Cents`]):"—"})]},L))})]}),R.amounts&&l.jsxs("p",{children:["Pauschale: ",jo(R.amounts.periodFeeCents)," · Saldo Bezug + Pauschale − Einspeisung: ",l.jsx("strong",{children:jo(R.amounts.balanceCents)})]}),l.jsx("p",{children:R.note}),R.periodFeePending&&l.jsx("p",{children:"Die Pauschale ist für diesen Teilzeitraum noch nicht angesetzt. Randzeiten prüfen und ausdrücklich übernehmen."}),l.jsxs("p",{children:["Originalreferenzen: ",R.first?.stream||"—"," · Sequenz ",R.first?.seq||"—"," bis ",R.last?.seq||"—",". Erstellt ",tn(R.generatedAt),"."]}),l.jsxs("div",{className:"nw-mesh-no-print",style:{display:"flex",flexWrap:"wrap",gap:8},children:[R.usable&&!R.boundaryComplete&&l.jsx("button",{className:"nw-button",onClick:()=>{!R.measured.from||!R.measured.to||(j(Zl(R.measured.from)),W(Zl(R.measured.to)),h("Gemessene Randzeiten übernommen. Erneut berechnen."))},children:"Gemessene Randzeiten übernehmen"}),l.jsx("button",{className:"nw-button",onClick:()=>bo(`NexoWatt_Entwurf_${R.nodeId}.json`,JSON.stringify(R,null,2)),children:"Prüfbeleg JSON"}),l.jsx("button",{className:"nw-button",disabled:!R.usable,onClick:()=>{if(!R.amounts)return;const L=[["Status","Haus","Von gemessen","Bis gemessen","Bezug kWh","Einspeisung kWh","Bezug Cent","Einspeisung Cent","Pauschale Cent","Saldo Cent"],[R.status,R.name||R.nodeId,R.measured.from,R.measured.to,R.importKwh,R.exportKwh,R.amounts.importCents,R.amounts.exportCents,R.amounts.periodFeeCents,R.amounts.balanceCents]];bo(`NexoWatt_Entwurf_${R.nodeId}.csv`,"\uFEFF"+L.map(oe=>oe.map(Nv).join(";")).join(`\r
|
|
13
|
-
`),"text/csv")},children:"Abrechnungsentwurf CSV"}),l.jsx("button",{className:"nw-button",disabled:!R.usable,onClick:()=>window.print(),children:"Drucken / PDF"})]}),l.jsx("style",{children:"@media print { body * { visibility: hidden; } .nw-mesh-report, .nw-mesh-report * { visibility: visible; color: #111 !important; background: white !important; } .nw-mesh-report { position: absolute; left: 0; top: 0; width: 100%; } .nw-mesh-no-print, .nw-mesh-no-print * { display: none !important; } }"})]})]})}const Ti={importW:"Hausbezug W",exportW:"Einspeisung W",l1A:"Phase L1 A",l2A:"Phase L2 A",l3A:"Phase L3 A",evW:"Ladepunkte gesamt W",chargeW:"Speicherladung W",dischargeW:"Speicherentladung W",pvW:"PV-Erzeugung W",flexW:"Weitere flexible Lasten W"},yf=()=>({importW:0,exportW:0,l1A:0,l2A:0,l3A:0,evW:0,chargeW:0,dischargeW:0,pvW:0,flexW:0}),Rv=r=>({id:r,name:"",branch:"",max:yf(),fallback:yf(),weight:1,commissioned:!1,watchdogVerified:!1});function Wr({label:r,value:a,onChange:o}){return l.jsxs("label",{className:"nw-field-label",children:[r,l.jsx("input",{className:"nw-input",type:"number",min:"0",step:"any",value:a??0,onChange:d=>o(d.target.value===""?"":Number(d.target.value)),required:!0})]})}function xf({value:r,onChange:a}){return l.jsx("div",{style:{overflowX:"auto"},children:l.jsxs("table",{style:{width:"100%"},children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Grenze"}),l.jsx("th",{children:"Anschluss"}),l.jsx("th",{children:"Reserve"}),l.jsx("th",{children:"Nicht erfasste Last"})]})}),l.jsx("tbody",{children:ov.map(o=>l.jsxs("tr",{children:[l.jsx("th",{children:Ti[o]}),["limit","reserve","unmonitored"].map(d=>l.jsx("td",{children:l.jsx(Wr,{label:`${d} ${Ti[o]}`,value:r[d][o],onChange:c=>a({...r,[d]:{...r[d],[o]:c}})})},d))]},o))})]})})}function Sf({value:r,onChange:a,local:o=!1}){const d=(c,h)=>a({...r,[c]:h});return l.jsxs("div",{style:{display:"grid",gap:12},children:[!o&&l.jsxs("label",{className:"nw-field-label",children:["Eindeutige Slave-ID",l.jsx("input",{className:"nw-input",value:r.id,onChange:c=>d("id",c.target.value),required:!0,pattern:"[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}"})]}),l.jsxs("label",{className:"nw-field-label",children:["Haus / Gerät",l.jsx("input",{className:"nw-input",value:r.name,onChange:c=>d("name",c.target.value)})]}),l.jsxs("label",{className:"nw-field-label",children:["Strang-ID (optional)",l.jsx("input",{className:"nw-input",value:r.branch,onChange:c=>d("branch",c.target.value)})]}),l.jsx(Wr,{label:"Verteilungsgewicht (1–100)",value:r.weight,onChange:c=>d("weight",c)}),l.jsx("div",{style:{overflowX:"auto"},children:l.jsxs("table",{style:{width:"100%"},children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Gesamtes Haus"}),l.jsx("th",{children:"Maximum"}),l.jsx("th",{children:"Sicherer Rückfall"})]})}),l.jsx("tbody",{children:av.map(c=>l.jsxs("tr",{children:[l.jsx("th",{children:Ti[c]}),["max","fallback"].map(h=>l.jsx("td",{children:l.jsx(Wr,{label:`${h==="max"?"Maximum":"Rückfall"} ${Ti[c]}`,value:r[h][c],onChange:m=>d(h,{...r[h],[c]:m})})},h))]},c))})]})}),l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:r.commissioned,onChange:c=>d("commissioned",c.target.checked)})," Lokale Messung, Vorzeichen, Gerätegrenzen und Regelung geprüft"]}),l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:r.watchdogVerified,onChange:c=>d("watchdogVerified",c.target.checked)})," Unabhängigen Geräte-Rückfall bei EOS-/Verbindungsausfall vor Ort nachgewiesen"]})]})}function Av(){const[r,a]=w.useState(null),[o,d]=w.useState(!1),[c,h]=w.useState(null),[m,g]=w.useState(null),[p,x]=w.useState(0),[k,j]=w.useState("Konfiguration wird geladen…"),[E,W]=w.useState(!1),[R,_]=w.useState(!1),[N,$]=w.useState(""),[U,O]=w.useState(""),[ue,le]=w.useState(""),[ke,be]=w.useState([]);w.useEffect(()=>{let z=!0,K;const Se=async(Z=!1)=>{try{const ce=xv(await Fn());if(!z)return;a(ce.app),d(!1),g(ce.status),_(ce.locked||ce.config.mode==="active"),be(ce.pairedNodes),Z?(h(ce.config),j("Verbindung zuerst im Diagnosebetrieb einrichten.")):h(ye=>ye===null||ce.config.mode==="active"?ce.config:ye)}catch(ce){z&&(j(St(ce,"Mesh-Anfrage fehlgeschlagen.")),[401,403,404].includes(ls(ce)??0)&&(d(!0),h(null),g(null),O("")))}finally{z&&(K=setTimeout(()=>Se(),2e3))}};return Se(!0),()=>{z=!1,clearTimeout(K)}},[]);const re=(z,K)=>h(Se=>Se&&{...Se,[z]:K}),je=async z=>{z.preventDefault(),W(!0),O("");try{const K=yv(await Fn("/config",{config:c,pairingKey:N}));h(K.config),_(K.config.mode==="active"),$(""),be(K.pairedNodes),j("Konfiguration gespeichert. Aktive Verbünde starten mit sicherem Rückfall und neuer Synchronisation.")}catch(K){j(St(K,"Mesh-Anfrage fehlgeschlagen."))}finally{W(!1)}},L=async()=>{if(c?.nodes[p]){W(!0);try{const z=ah(await Fn("/pair",{nodeId:c.nodes[p].id}));O(JSON.stringify(z,null,2)),j("Paarungsdaten einmalig kopieren und am zugehörigen Slave importieren. Vertraulich behandeln.")}catch(z){j(St(z,"Mesh-Anfrage fehlgeschlagen."))}finally{W(!1)}}},oe=()=>{try{const z=kv(ue);h(z.config),$(z.pairingKey),le(""),j("Paarung übernommen. Master-Adresse und lokale Messwerte ergänzen, anschließend speichern.")}catch(z){j(St(z,"Mesh-Anfrage fehlgeschlagen."))}};return l.jsxs(ur,{title:"Microgrid · Master / Slave",subtitle:"EMS-App · Ein Trafo-Master · bis zu 99 Haus-Slaves",showBack:!1,compact:new URLSearchParams(window.location.search).has("embedded"),actions:l.jsx("a",{className:"nw-link-button",href:`${Vn()??""}/ems-apps.html?nwAdmin=1`,target:window.parent!==window?"_parent":"_self",children:"Zum EMS-AppCenter"}),children:[o&&l.jsxs("section",{className:"nw-card",children:[l.jsx("p",{role:"alert",children:k}),l.jsx("p",{children:"Die App muss im EMS-AppCenter installiert sein. Zugriff nur für Installer und Admin."})]}),!o&&l.jsxs(l.Fragment,{children:[r&&!r.enabled&&l.jsxs("section",{className:"nw-card",children:[l.jsx("strong",{children:"App inaktiv"}),l.jsx("p",{children:"Einrichtung und gespeicherte Daten sind zugänglich. Regelkommunikation und Zähleraufzeichnung starten erst mit „Aktiv: An“ im EMS-AppCenter."})]}),l.jsxs("section",{className:"nw-card",children:[l.jsx("h2",{children:"Verbindung und Freigaben"}),l.jsx("p",{role:"status",children:k}),m&&l.jsxs(l.Fragment,{children:[l.jsxs("p",{children:[l.jsx("strong",{children:m.master?.controlMode==="LOCAL_AUTONOMY"?"Lokale Hausregelung":m.master?.controlMode==="TRANSFORMER_LIMIT"?"Trafo-Begrenzung":m.master?.state||m.local?.state})," · Antwort ",m.timing.lastRttMs===null?"—":`${Math.round(m.timing.lastRttMs)} ms`," · P95 ",m.timing.p95RttMs===null?"—":`${Math.round(m.timing.p95RttMs)} ms`," · Freigabe ",Math.round(m.local?.remainingMs||0)," ms"]}),l.jsxs("p",{children:[m.master?.reason||m.local?.reason," ",m.error]}),m.master?.siteMeasurement&&l.jsxs("p",{children:["Trafo-NVP: ",m.master.siteMeasurement.gridW!==null?`${Math.round(m.master.siteMeasurement.gridW)} W`:"Messung fehlt"," · Messwertalter: ",m.master.siteMeasurement.ageMs!==null?`${Math.round(m.master.siteMeasurement.ageMs)} ms`:"—"," · Phasen A: ",m.master.siteMeasurement.phaseA?.map(z=>Number(z).toFixed(1)).join(" / ")||"—"]})]}),l.jsx("p",{children:"Der Master begrenzt den gesamten Hausanschluss. 0 ist eine wirksame Grenze. Bei Ausfall bleibt nur der geplante Rückfall; Boost und Zeitpläne erhöhen ihn nicht."}),l.jsx("p",{children:"Direkte Tailscale-Verbindungen bevorzugen; tatsächliche Laufzeit am Standort prüfen. Ein unabhängiger Geräte-Watchdog ist für aktive Regelung erforderlich."}),R&&l.jsxs("p",{children:[l.jsx("strong",{children:"Aktive Konfiguration geschützt."})," Grenz- oder Topologieänderungen benötigen eine geplante Stillsetzung und erneute Inbetriebnahme."]})]}),m?.master&&l.jsxs("section",{className:"nw-card",children:[l.jsxs("h2",{children:["Betreiberübersicht · Teilnehmer (",m.master.nodes.length,"/100 einschließlich optionalem Master-Haus)"]}),l.jsx("div",{style:{overflowX:"auto",maxHeight:360},children:l.jsxs("table",{style:{width:"100%"},children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Haus"}),l.jsx("th",{children:"Verbindung"}),l.jsx("th",{children:"Alter"}),l.jsx("th",{children:"Antwortzeit"}),l.jsx("th",{children:"Bestätigt"}),l.jsx("th",{children:"Haus-NVP aktuell"}),l.jsx("th",{children:"Bezug / Reserviert"}),l.jsx("th",{children:"Einspeisegrenze"})]})}),l.jsx("tbody",{children:m.master.nodes.map(z=>l.jsxs("tr",{children:[l.jsx("td",{children:z.name||z.id}),l.jsx("td",{children:z.online?"Verbunden":"Fehlt"}),l.jsx("td",{children:z.ageMs===null?"—":`${Math.round(z.ageMs)} ms`}),l.jsx("td",{children:z.rttMs===null?"—":`${Math.round(z.rttMs)} ms`}),l.jsx("td",{children:z.confirmed?"Verifiziert":"Ausstehend"}),l.jsx("td",{children:z.sample!==null?`${Math.round(z.sample.gridW)} W`:"—"}),l.jsxs("td",{children:[Math.round(z.allowed.importW)," / ",Math.round(z.reserved.importW)," W"]}),l.jsxs("td",{children:[Math.round(z.allowed.exportW)," W"]})]},z.id))})]})})]}),c&&c.role!=="off"&&l.jsx(Pv,{meshConfig:c,status:m}),c&&l.jsx("form",{onSubmit:je,children:l.jsxs("fieldset",{disabled:E||R,style:{border:0,padding:0,minWidth:0},children:[l.jsxs("section",{className:"nw-card",style:{display:"grid",gap:14},children:[l.jsx("h2",{children:"Verbund einrichten"}),l.jsxs("label",{className:"nw-field-label",children:["Rolle",l.jsxs("select",{className:"nw-input",value:c.role,onChange:z=>re("role",z.target.value==="master"?"master":z.target.value==="slave"?"slave":"off"),children:[l.jsx("option",{value:"off",children:"Aus"}),l.jsx("option",{value:"master",children:"Master"}),l.jsx("option",{value:"slave",children:"Slave"})]})]}),c.role!=="off"&&l.jsxs(l.Fragment,{children:[["siteId","nodeId","masterId"].map((z,K)=>l.jsxs("label",{className:"nw-field-label",children:[["Standort-ID","Lokale Knoten-ID","Feste Master-ID"][K],l.jsx("input",{className:"nw-input",value:c[z],onChange:Se=>re(z,Se.target.value),required:!0})]},z)),l.jsx(Wr,{label:"Gemeinsame Konfigurationsversion",value:c.revision,onChange:z=>re("revision",z)}),l.jsxs("label",{className:"nw-field-label",children:["Betrieb",l.jsxs("select",{className:"nw-input",value:c.mode,onChange:z=>re("mode",z.target.value==="active"?"active":"diagnostic"),children:[l.jsx("option",{value:"diagnostic",children:"Diagnose – noch keine Master-Regelung"}),l.jsx("option",{value:"active",children:"Aktiv – geprüfte Anlage verbindlich begrenzen"})]})]}),c.role==="slave"&&l.jsxs(l.Fragment,{children:[l.jsxs("label",{className:"nw-field-label",children:["Tailscale-Adresse des Masters inklusive EOS-Port",l.jsx("input",{className:"nw-input",placeholder:"http://100.x.x.x:8188",value:c.masterUrl,onChange:z=>re("masterUrl",z.target.value),required:!0})]}),l.jsxs("label",{className:"nw-field-label",children:["Individueller Paarungsschlüssel",l.jsx("input",{className:"nw-input",type:"password",autoComplete:"new-password",value:N,onChange:z=>$(z.target.value),placeholder:"Leer lassen zum Beibehalten"})]})]}),c.role==="master"&&l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.localParticipates,onChange:z=>re("localParticipates",z.target.checked)})," Master regelt zusätzlich sein eigenes Haus"]}),l.jsxs("details",{children:[l.jsx("summary",{children:"Kommunikationszeiten und Wiederanlauf"}),l.jsx("p",{children:"Startwerte: Austausch 1 s, Antwort-Timeout 800 ms, Freigabe 3 s, Messwertalter höchstens 2 s. Vor Ort prüfen."}),[["intervalMs","Austausch ms"],["requestTimeoutMs","Antwort-Timeout ms"],["leaseMs","Freigabedauer ms"],["staleMs","Maximales Messwertalter ms"],["recoveryCycles","Stabile Zyklen vor Erhöhung"],["rampWPerSecond","Wiederanlauframpe W/s"]].map(([z,K])=>l.jsx(Wr,{label:K,value:c[z],onChange:Se=>re(z,Se)},z))]})]})]}),c.role==="master"&&l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"nw-card",children:[l.jsx("h2",{children:"Trafo-Regelung"}),l.jsxs("label",{className:"nw-field-label",children:["Verteilung",l.jsxs("select",{className:"nw-input",value:c.allocation?.strategy||"fixed",onChange:z=>re("allocation",{...c.allocation||{headroomW:1e3,headroomA:3,engagePct:90,releasePct:80},strategy:z.target.value==="transformer"?"transformer":"fixed"}),children:[l.jsx("option",{value:"fixed",children:"Feste Anteile (bisheriges Verhalten)"}),l.jsx("option",{value:"transformer",children:"Bedarfsabhängig · Master am Trafo, Slaves an Häusern"})]})]}),l.jsx("p",{children:"Die Häuser optimieren lokal innerhalb sicherer NVP-Korridore. Bei knapper Kapazität verteilt der Master die Gesamtfreigabe bedarfsgerecht. Haus- und Stranggrenzen gelten in jedem Betriebszustand."}),c.allocation?.strategy==="transformer"&&l.jsxs(l.Fragment,{children:[[["headroomW","Zusätzlicher Spielraum je Haus W"],["headroomA","Zusätzlicher Spielraum je Phase A"],["engagePct","Eingriff ab Trafoauslastung %"],["releasePct","Wiederfreigabe unter Trafoauslastung %"]].map(([z,K])=>l.jsx(Wr,{label:K,value:c.allocation[z],onChange:Se=>re("allocation",{...c.allocation,[z]:Se})},z)),l.jsx("button",{className:"nw-button",type:"button",onClick:()=>h(z=>z&&{...z,intervalMs:250,requestTimeoutMs:200,leaseMs:1500,staleMs:1e3}),children:"Schnellen Takt übernehmen: 250 ms / 200 ms Timeout"}),l.jsx("p",{children:"Nur bei entsprechend schnellen NVP-Messwerten und stabiler Verbindung verwenden. Messung, Netzwerk und Stellgeräte bestimmen zusammen die tatsächliche Reaktionszeit."})]})]}),l.jsxs("section",{className:"nw-card",children:[l.jsx("h2",{children:"Gemeinsamer Anschluss"}),l.jsx("p",{children:"Hauptzähler und alle drei Phasen unter der lokalen Netzmessung zuordnen. Für nicht geregelte Lasten dauerhaft Kapazität vorhalten."}),l.jsx(xf,{value:c.site,onChange:z=>re("site",z)}),c.localParticipates&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{children:"Getrennter Hauptzähler des Verbunds"}),l.jsx("p",{children:"Hier die Messung des gesamten Standorts eintragen; die lokale Hausmessung bleibt getrennt."}),["gridW","l1A","l2A","l3A"].map(z=>l.jsxs("label",{className:"nw-field-label",children:[z," – Hauptzähler-DP",l.jsx("input",{className:"nw-input",value:c.siteFeedback?.[z]||"",onChange:K=>re("siteFeedback",{...c.siteFeedback,[z]:K.target.value})})]},z))]})]}),l.jsxs("section",{className:"nw-card",children:[l.jsx("h2",{children:"Stränge"}),c.branches.map((z,K)=>l.jsxs("details",{children:[l.jsxs("summary",{children:["Strang ",z.id||K+1]}),l.jsx("input",{className:"nw-input","aria-label":"Strang-ID",value:z.id,onChange:Se=>re("branches",c.branches.map((Z,ce)=>K===ce?{...Z,id:Se.target.value}:Z))}),l.jsx(xf,{value:z,onChange:Se=>re("branches",c.branches.map((Z,ce)=>K===ce?Se:Z))}),l.jsx("button",{className:"nw-button",type:"button",onClick:()=>re("branches",c.branches.filter((Se,Z)=>Z!==K)),children:"Strang entfernen"})]},K)),l.jsx("button",{className:"nw-button",type:"button",onClick:()=>re("branches",[...c.branches,{id:"",reserve:{...c.site.reserve},unmonitored:{...c.site.unmonitored},limit:{importW:0,exportW:0,l1A:0,l2A:0,l3A:0}}]),children:"Strang hinzufügen"})]}),l.jsxs("section",{className:"nw-card",children:[l.jsxs("h2",{children:["Slaves (",c.nodes.length,"/99)"]}),l.jsx("p",{children:"Erst Teilnehmer speichern, dann für jeden Slave eigene Paarungsdaten erzeugen."}),l.jsx("select",{className:"nw-input","aria-label":"Slave auswählen",value:p,onChange:z=>x(Number(z.target.value)),children:c.nodes.map((z,K)=>l.jsxs("option",{value:K,children:[z.name||z.id||`Slave ${K+1}`," ",ke.includes(z.id)?"· gepaart":""]},K))}),c.nodes[p]&&l.jsxs(l.Fragment,{children:[l.jsx(Sf,{value:c.nodes[p],onChange:z=>re("nodes",c.nodes.map((K,Se)=>Se===p?z:K))}),l.jsx("button",{className:"nw-button",type:"button",onClick:L,children:"Paarung für gespeicherten Slave erzeugen"}),l.jsx("button",{className:"nw-button",type:"button",onClick:()=>{re("nodes",c.nodes.filter((z,K)=>K!==p)),x(0),O("")},children:"Slave entfernen"})]}),l.jsx("button",{className:"nw-button",type:"button",disabled:c.nodes.length>=99,onClick:()=>{re("nodes",[...c.nodes,Rv(`haus_${c.nodes.length+1}`)]),x(c.nodes.length),O("")},children:"Slave hinzufügen"})]})]}),(c.role==="slave"||c.role==="master"&&c.localParticipates)&&l.jsxs("section",{className:"nw-card",children:[l.jsx("h2",{children:"Lokales Haus"}),l.jsx(Sf,{local:!0,value:c.local,onChange:z=>re("local",z)}),l.jsx("h3",{children:"Tatsächliche Leistungen"}),l.jsx("p",{children:"Summenmesswerte in W, jeweils positiv. Nur vorhandene Geräte freigeben. Lokalen NVP und Phasen im App-Center zuordnen."}),["evW","chargeW","dischargeW","pvW","flexW"].map(z=>l.jsxs("label",{className:"nw-field-label",children:[Ti[z]," – Messwert-DP",l.jsx("input",{className:"nw-input",value:c.feedback?.[z]||"",onChange:K=>re("feedback",{...c.feedback,[z]:K.target.value})})]},z))]}),l.jsx("section",{className:"nw-card",children:l.jsx("button",{className:"nw-button nw-button--primary",type:"submit",children:"Konfiguration speichern"})}),c.role!=="master"&&l.jsxs("section",{className:"nw-card",children:[l.jsx("h2",{children:"Paarung vom Master übernehmen"}),l.jsx("textarea",{className:"nw-input",rows:5,"aria-label":"Paarungsdaten importieren",value:ue,onChange:z=>le(z.target.value)}),l.jsx("button",{className:"nw-button",type:"button",onClick:oe,children:"Paarung in Formular übernehmen"})]})]})}),U&&l.jsxs("section",{className:"nw-card",children:[l.jsx("h2",{children:"Einmalige Paarungsdaten"}),l.jsx("p",{children:"Enthält den Schlüssel dieses Slaves. Nach Übernahme schließen."}),l.jsx("textarea",{className:"nw-input",rows:8,readOnly:!0,value:U,"aria-label":"Einmalige Paarungsdaten"}),l.jsx("button",{className:"nw-button",onClick:()=>O(""),children:"Schließen und aus Ansicht entfernen"})]})]})]})}const rt=r=>r!==null&&typeof r=="object"&&!Array.isArray(r)&&(Object.getPrototypeOf(r)===Object.prototype||Object.getPrototypeOf(r)===null),he=r=>typeof r=="string",it=r=>typeof r=="number"&&Number.isFinite(r),ct=r=>typeof r=="boolean",ze=r=>r===null||r===""||it(r),os=r=>ct(r)||ze(r),M=r=>a=>a===void 0||r(a),Qe=r=>a=>a===null||r(a),Nt=r=>a=>Array.isArray(a)&&a.every(r);function _e(r){return a=>{if(!rt(a))return!1;for(const o in r)if(Object.hasOwn(r,o)&&!r[o](a[o]))return!1;return!0}}const Eo=r=>a=>rt(a)&&Object.keys(a).every(o=>!["__proto__","prototype","constructor"].includes(o)&&r(a[o]));function xn(r){const a=[{value:r,depth:0}],o=new Set;let d=0;for(;a.length;){const c=a.pop();if(!c||++d>5e4||c.depth>32)return!1;const h=c.value;if(h===null||ct(h)||it(h))continue;if(he(h)){if(h.length>1048576)return!1;continue}if(!Array.isArray(h)&&!rt(h)||o.has(h))return!1;o.add(h);const m=Object.getOwnPropertyDescriptors(h);for(const g of Object.keys(m)){if(["__proto__","prototype","constructor"].includes(g))return!1;const p=m[g];if(!p||!("value"in p))return!1;if(Array.isArray(h)&&g==="length")continue;const x=p.value;a.push({value:x,depth:c.depth+1})}}return!0}const wn=_e({stateId:M(he),unit:M(he),sign:M(ze),maxAgeMs:M(ze),scale:M(ze)}),zv=_e({stateId:M(he),unit:M(he),sign:M(ze),maxAgeMs:M(ze),scale:M(ze),kind:M(he),importMeasurement:M(wn),exportMeasurement:M(wn)}),Mv=_e({measurement:M(Qe(zv)),valid:M(ct),reason:M(he)}),_v=_e({id:he,source:M(he),measurement:M(wn),importLimitW:M(Qe(ze)),exportLimitW:M(Qe(ze)),importReserveW:M(ze),exportReserveW:M(ze)}),_i=_e({stateId:M(he),scale:M(ze),sign:M(ze),readbackStateId:M(he)}),Co=_e({stateId:M(he),readbackStateId:M(he),onValue:M(os),offValue:M(os)}),Lv=_e({stateId:M(he),ttlMs:M(ze),writeValue:M(os),readbackStateId:M(he),expiryBehavior:M(he)}),Dv=_e({mode:M(he),signedTarget:M(_i),chargeTarget:M(_i),dischargeTarget:M(_i),maxCharge:M(_i),maxDischarge:M(_i),appliedMaxCharge:M(wn),appliedMaxDischarge:M(wn),watchdog:M(Lv),run:M(Co),chargeEnable:M(Co),dischargeEnable:M(Co)}),Iv=_e({targetGridImportW:M(ze),importThresholdW:M(ze),peakLimitW:M(ze)}),Tv=_e({stateId:M(he),availableValue:M(os),maxAgeMs:M(ze)}),Wv=_e({id:he,name:M(he),connectionPointId:M(he),controlPointId:M(he),dispatchGroupId:M(he),primaryPurpose:M(he),authority:M(he),powerMeasurement:M(wn),socMeasurement:M(wn),maxChargeW:M(ze),maxDischargeW:M(ze),minSoc:M(ze),maxSoc:M(ze),maxDeltaWPerSec:M(ze),configuredToleranceW:M(ze),commandTimeoutMs:M(ze),strategy:M(Iv),command:M(Dv),availability:M(Tv),requestPowerMeasurement:M(wn)}),Ov=_e({stateId:M(he),unit:M(he),scale:M(ze),readbackStateId:M(he)}),Fv=_e({id:he,connectionPointId:M(he),referencePowerW:M(ze),powerMeasurement:M(wn),command:M(Ov),evuControl:M(ct)}),Bv=_e({schemaVersion:M(it),configVersion:it,maxSkewMs:M(ze),points:Nt(_v),storages:Nt(Wv),pvAssignments:Nt(Fv)}),Vv=_e({installed:ct,enabled:ct}),$v=_e({path:M(he),message:M(he),reason:M(he),code:M(he)}),sr=r=>he(r)||$v(r),oh=_e({valid:M(ct),activeEligible:M(ct),errors:M(Nt(sr)),activationErrors:M(Nt(sr)),warnings:M(Nt(sr))}),kf=_e({valueW:M(Qe(it)),ageMs:M(Qe(it)),valid:M(ct),reason:M(he)}),Uv=_e({socPct:M(Qe(it)),available:M(ct)}),Hv=_e({id:M(he),requestedW:M(Qe(it)),targetW:M(Qe(it)),minPowerW:M(Qe(it)),maxPowerW:M(Qe(it)),commandConfirmed:M(ct),accepted:M(ct),reason:M(he)}),Gv=_e({id:M(he),appliedConfirmed:M(ct),targetW:M(Qe(it))}),Kv=_e({id:he,connectionPointId:M(he),primaryPurpose:M(he),authority:M(he),requestedW:M(Qe(it)),reason:M(he),status:M(he)}),qv=_e({points:M(Eo(kf)),storages:M(Eo(kf)),storageTelemetry:M(Eo(Uv)),errors:M(Nt(sr))}),Qv=_e({ts:M(Qe(it)),status:M(he),configVersion:M(Qe(it)),reason:M(he),budget:M(Qe(_e({reason:M(he)}))),snapshot:M(Qe(qv)),storageResults:M(Nt(Hv)),pendingIntervals:M(Nt(Gv)),errors:M(Nt(sr)),activationErrors:M(Nt(sr)),groups:M(Nt(Kv)),writesPerformed:M(Qe(it))}),Zv=_e({config:M(Bv),app:M(Vv),rootSource:M(Qe(Mv)),status:M(Qe(Qv)),validation:M(Qe(oh)),locked:M(ct)});function Li(r,a=!0){if(!xn(r)||!Zv(r))throw new Error("Ungültige Antwort der Netzanschluss-API. Der Entwurf bleibt erhalten.");if(a&&(!r.config||!r.app))throw new Error("Unvollständige Antwort der Netzanschluss-API. Der Entwurf bleibt erhalten.");if(r.config&&(!Number.isSafeInteger(r.config.configVersion)||r.config.configVersion<1||r.config.points.length!==2||!r.config.points.some(o=>o.id==="M0")||!r.config.points.some(o=>o.id==="M1")))throw new Error("Ungültige Messstruktur der Netzanschluss-API.");return r}function Yv(r){return xn(r)&&oh(r)?r:null}function Xv(r){return xn(r)&&Nt(sr)(r)?{valid:!1,errors:r}:null}const Jv=_e({enabled:ct,host:he,port:it,tlsMode:he,user:he,siteName:he,passwordSet:ct});function jf(r){if(!xn(r)||!rt(r)||!Jv(r.config)||!Number.isInteger(r.config.port)||r.config.port<1||r.config.port>65535||!["tls","starttls"].includes(r.config.tlsMode))throw new Error("Ungültige Antwort der E-Mail-Konfiguration.");return r.config}function ew(){const[r,a]=w.useState({enabled:!1,host:"",port:465,tlsMode:"tls",user:"",siteName:"",passwordSet:!1}),[o,d]=w.useState(""),[c,h]=w.useState(!1),[m,g]=w.useState(!0),[p,x]=w.useState(!1),[k,j]=w.useState("Versandkonfiguration wird geladen…"),[E,W]=w.useState(!1);w.useEffect(()=>{let N=!0;return df().then($=>{N&&(a(jf($)),x(!0),j("SMTP-Zugangsdaten werden verschlüsselt auf dieser Anlage gespeichert."))}).catch($=>{N&&(j(St($,"E-Mail-Konfiguration nicht erreichbar.")),W(!0))}).finally(()=>{N&&g(!1)}),()=>{N=!1}},[]);const R=(N,$)=>a(U=>({...U,[N]:$})),_=async N=>{N.preventDefault(),g(!0),W(!1);try{const $=await df({...r,password:o,clearPassword:c});a(jf($)),d(""),h(!1),j("Gespeichert. Unter Kunden-Einstellungen → Benachrichtigungen die Empfängeradresse eintragen und eine Test-Mail senden.")}catch($){j(St($,"E-Mail-Konfiguration nicht erreichbar.")),W(!0)}finally{g(!1)}};return l.jsxs(ur,{title:"E-Mail-Versand",subtitle:"Direkter Versand wichtiger EOS-Meldungen. Einrichtung ausschließlich durch den Admin.",showBack:!1,children:[l.jsx("section",{className:"nw-card",children:l.jsxs("form",{onSubmit:_,className:"nw-access-gate__form",style:{maxWidth:680,margin:"0 auto"},children:[l.jsxs("label",{className:"nw-field-label",children:[l.jsx("input",{type:"checkbox",checked:r.enabled,disabled:m||!p,onChange:N=>R("enabled",N.target.checked)})," Direkten E-Mail-Versand aktivieren"]}),l.jsx("label",{className:"nw-field-label",htmlFor:"mailFrom",children:"Absender"}),l.jsx("input",{className:"nw-input",id:"mailFrom",value:"info@nexowatt.com",readOnly:!0}),l.jsx("label",{className:"nw-field-label",htmlFor:"mailSite",children:"Anlagenname für die E-Mail"}),l.jsx("input",{className:"nw-input",id:"mailSite",value:r.siteName,maxLength:100,disabled:m,onChange:N=>R("siteName",N.target.value),placeholder:"Zum Beispiel Firmenstandort Rhede"}),l.jsx("label",{className:"nw-field-label",htmlFor:"mailHost",children:"SMTP-Server"}),l.jsx("input",{className:"nw-input",id:"mailHost",value:r.host,disabled:m,required:r.enabled,onChange:N=>R("host",N.target.value),placeholder:"SMTP-Server des E-Mail-Anbieters",autoComplete:"off"}),l.jsx("label",{className:"nw-field-label",htmlFor:"mailTls",children:"Verschlüsselung"}),l.jsxs("select",{className:"nw-input",id:"mailTls",value:r.tlsMode,disabled:m,onChange:N=>{const $=N.target.value;a(U=>({...U,tlsMode:$,port:[465,587].includes(U.port)?$==="tls"?465:587:U.port}))},children:[l.jsx("option",{value:"tls",children:"TLS (normalerweise Port 465)"}),l.jsx("option",{value:"starttls",children:"STARTTLS verpflichtend (normalerweise Port 587)"})]}),l.jsx("label",{className:"nw-field-label",htmlFor:"mailPort",children:"SMTP-Port"}),l.jsx("input",{className:"nw-input",id:"mailPort",type:"number",min:1,max:65535,value:r.port,disabled:m,onChange:N=>R("port",Number(N.target.value))}),l.jsx("label",{className:"nw-field-label",htmlFor:"mailUser",children:"SMTP-Benutzer"}),l.jsx("input",{className:"nw-input",id:"mailUser",value:r.user,disabled:m,required:r.enabled,autoComplete:"off",onChange:N=>R("user",N.target.value)}),l.jsx("label",{className:"nw-field-label",htmlFor:"mailPassword",children:"SMTP-Passwort / App-Passwort"}),l.jsx("input",{className:"nw-input",id:"mailPassword",type:"password",autoComplete:"new-password",value:o,disabled:m,onChange:N=>d(N.target.value),placeholder:r.passwordSet?"Gespeichert – leer lassen zum Beibehalten":"Noch nicht hinterlegt"}),l.jsxs("label",{className:"nw-field-label",children:[l.jsx("input",{type:"checkbox",checked:c,disabled:m,onChange:N=>h(N.target.checked)})," Gespeichertes Passwort löschen (Versand vorher deaktivieren)"]}),l.jsx("button",{className:"nw-button nw-button--primary",type:"submit",disabled:m||!p,children:m?"Bitte warten…":"Versandkonfiguration speichern"}),l.jsx("div",{role:"status",className:`nw-status ${E?"nw-status--bad":"nw-status--ok"}`,children:k})]})}),l.jsxs("section",{className:"nw-card",children:[l.jsx("h2",{children:"Meldeverhalten"}),l.jsx("p",{children:"Harte Fehler: sofort bei Erkennung. Normale Fehler: gesammelt alle 30 Minuten. Sonstige Hinweise, Entwarnungen und Erinnerungen an harte Fehler: als Tageszusammenfassung. Gleichzeitige Störungen werden gebündelt."}),l.jsx("p",{children:"Reguläre Ladepausen, Ladeende und normale PV-Abregelung erzeugen keine Störungsmail. Bei vollständigem Rechner- oder Internetausfall kann dieses Gerät selbst keine E-Mail versenden."}),l.jsx("a",{className:"nw-button",href:`${Vn()??""}/settings.html`,children:"Kunden-Benachrichtigungen öffnen"}),l.jsx("a",{className:"nw-button",href:`${Vn()??""}/ems-apps.html`,children:"Zurück zum App-Center"})]})]})}const tw=r=>typeof r=="string"&&r.length>0&&r.length<=512&&r===r.trim()&&!/[\x00-\x1f\x7f]/.test(r);function nw({currentId:r="",mode:a="read",signal:o}={}){return new Promise((d,c)=>{if(o?.aborted){c(new DOMException("Auswahl abgebrochen.","AbortError"));return}const h=Array.from(crypto.getRandomValues(new Uint8Array(16)),O=>O.toString(16).padStart(2,"0")).join(""),m=window.location.origin,g=window.parent!==window&&new URLSearchParams(window.location.search).get("embedded")==="1";let p=g?window.parent:null,x=null,k=!1,j=!1,E,W;const R=()=>{try{p?.postMessage({type:"nw:dp-picker-cancel",requestId:h},m)}catch{}},_=(O,ue)=>{if(!k){k=!0,clearTimeout(W),clearInterval(E),window.removeEventListener("message",U),window.removeEventListener("pagehide",N),o?.removeEventListener("abort",N),(ue||O===null)&&R();try{x&&!x.closed&&x.close()}catch{}ue?c(ue):d(O)}},N=()=>_(null,new DOMException("Auswahl abgebrochen.","AbortError")),$=()=>{if(!(j||!p||k)){j=!0;try{p.postMessage({type:"nw:dp-picker-open",requestId:h,currentId:r.slice(0,512),mode:a},m)}catch{_(null,new Error("Datenpunktauswahl konnte nicht geöffnet werden."))}}};function U(O){if(!(k||O.origin!==m||O.source!==p||!xn(O.data)||!rt(O.data)||O.data.requestId!==h)){if(O.data.type==="nw:dp-picker-ready"&&x){$();return}O.data.type==="nw:dp-picker-opened"&&j&&(clearTimeout(W),W=setTimeout(()=>_(null,new Error("Datenpunktauswahl beendet. Bitte erneut öffnen.")),3e5)),O.data.type==="nw:dp-picker-result"&&j&&(O.data.id===null?_(null):tw(O.data.id)&&_(O.data.id))}}if(window.addEventListener("message",U),window.addEventListener("pagehide",N),o?.addEventListener("abort",N,{once:!0}),W=setTimeout(()=>_(null,new Error("Datenpunktauswahl nicht erreichbar. Bitte Anmeldung prüfen und erneut öffnen.")),15e3),g)$();else{const O=new URL(`${Vn()??""}/ems-apps.html`,m);O.searchParams.set("nwAdmin","1"),O.searchParams.set("dpPicker","1"),O.searchParams.set("requestId",h);try{x=window.open(O.toString(),`nw-dp-picker-${h}`,"popup,width=1050,height=760")}catch{_(null,new Error("Bitte das Fenster zur Datenpunktauswahl im Browser zulassen."));return}if(p=x,!x){_(null,new Error("Bitte das Fenster zur Datenpunktauswahl im Browser zulassen."));return}E=setInterval(()=>{x?.closed&&_(null)},400)}})}const uh=w.createContext({revision:0,blocked:!1});function Kt({label:r,value:a="",onChange:o,required:d=!1,help:c="",maxLength:h=512,mode:m="read",disabled:g=!1}){const p=w.useId(),x=w.useContext(uh),[k,j]=w.useState(!1),[E,W]=w.useState(""),R=w.useRef(null),_=w.useRef({context:x,value:a,onChange:o,disabled:g});_.current={context:x,value:a,onChange:o,disabled:g},w.useLayoutEffect(()=>(R.current?.abort(),R.current=null,j(!1),()=>{R.current?.abort(),R.current=null}),[x.revision,x.blocked,a,g]);async function N(){if(g||x.blocked)return;R.current?.abort();const $=new AbortController,U={context:x,value:a};R.current=$,j(!0),W("");try{const O=await nw({currentId:typeof a=="string"?a:"",mode:m,signal:$.signal});O!==null&&!$.signal.aborted&&R.current===$&&_.current.context.revision===U.context.revision&&!_.current.context.blocked&&_.current.value===U.value&&!_.current.disabled&&_.current.onChange(O)}catch(O){!(O instanceof Error&&O.name==="AbortError")&&!$.signal.aborted&&W(O instanceof Error?O.message:"Datenpunkt konnte nicht gewählt werden.")}finally{R.current===$&&(R.current=null,j(!1))}}return l.jsxs("div",{className:"nw-nvp-field nw-config-field","data-dp-field":"true",children:[l.jsx("label",{htmlFor:p,className:"nw-config-label",children:r}),l.jsxs("div",{className:"nw-dp-field-controls",style:{display:"flex",gap:8,alignItems:"stretch",minWidth:0},children:[l.jsx("input",{id:p,className:"nw-input nw-config-input",style:{minWidth:0,flex:1},value:a??"",required:d,maxLength:h,disabled:g||x.blocked,onChange:$=>o($.target.value)}),l.jsx("button",{type:"button",className:"nw-button nw-config-btn nw-config-btn--ghost","data-dp-pick":"true","aria-label":`Datenpunkt auswählen: ${r}`,disabled:g||x.blocked||k,onClick:N,children:k?"Auswahl offen…":"DP wählen"})]}),c&&l.jsx("small",{children:c}),E&&l.jsx("small",{role:"alert",children:E})]})}const Zo=r=>{const a=Object.create(null);for(const[o,d]of Object.entries(r))a[o]=d;return Object.freeze(a)},Lo=Zo({selfConsumption:"Eigenverbrauchsoptimierung (EVO)",zeroExport:"Nulleinspeisung",peakShaving:"Lastspitzenkappung",arbitrage:"Arbitrage",tariff:"Tarifgeführter Betrieb"}),us=Zo({M0:"M0 · Gesamtanschluss",M1:"M1 · lokaler Bereich"}),Br=()=>({stateId:"",unit:"W",sign:1,maxAgeMs:5e3}),bf=r=>({id:r,source:r==="M0"?"general":"mapped",...r==="M1"?{measurement:Br()}:{},importLimitW:null,exportLimitW:null,importReserveW:0,exportReserveW:0}),Ef=()=>({schemaVersion:1,configVersion:1,maxSkewMs:1e3,points:[bf("M0"),bf("M1")],storages:[],pvAssignments:[]}),cs=()=>({stateId:"",scale:1,sign:1}),rw=()=>({id:"",name:"",connectionPointId:"",controlPointId:"",dispatchGroupId:"",primaryPurpose:"selfConsumption",authority:"eos",powerMeasurement:Br(),socMeasurement:{stateId:"",scale:1,maxAgeMs:5e3},maxChargeW:"",maxDischargeW:"",minSoc:10,maxSoc:90,maxDeltaWPerSec:"",configuredToleranceW:100,commandTimeoutMs:5e3,strategy:{targetGridImportW:50,importThresholdW:20},command:{mode:"signedTarget",signedTarget:cs()}}),iw=()=>({id:"",connectionPointId:"",referencePowerW:"",powerMeasurement:Br(),command:{stateId:"",unit:"W",scale:1}}),ir=r=>typeof r=="number"&&Number.isFinite(r)?`${(r/1e3).toLocaleString("de-DE",{maximumFractionDigits:2})} kW`:"—",Do=r=>typeof r=="string"?r:r?.message||r?.reason||r?.code||"Unbekannter Prüfhinweis",Yo=(r,a,o)=>{const d={...r};return o?d[a]=o:delete d[a],d};function He({label:r,value:a,onChange:o,min:d=0,max:c,required:h=!0,unit:m="",help:g=""}){return l.jsxs("label",{className:"nw-nvp-field nw-config-field",children:[l.jsxs("span",{className:"nw-config-label",children:[r,m?` (${m})`:""]}),l.jsx("input",{className:"nw-input nw-config-input",type:"number",min:d,max:c,step:"any",required:h,value:a??"",onChange:p=>o(p.target.value===""?"":Number(p.target.value))}),g&&l.jsx("small",{children:g})]})}function es({label:r,value:a,onChange:o,required:d=!1,help:c="",maxLength:h=256}){return l.jsxs("label",{className:"nw-nvp-field nw-config-field",children:[l.jsx("span",{className:"nw-config-label",children:r}),l.jsx("input",{className:"nw-input nw-config-input",value:a??"",required:d,maxLength:h,onChange:m=>o(m.target.value)}),c&&l.jsx("small",{children:c})]})}function Dt({label:r,value:a,onChange:o,options:d,required:c=!0,placeholder:h=!1}){return l.jsxs("label",{className:"nw-nvp-field nw-config-field",children:[l.jsx("span",{className:"nw-config-label",children:r}),l.jsxs("select",{className:"nw-input nw-config-select",value:a??"",required:c,onChange:m=>o(m.target.value),children:[h&&l.jsx("option",{value:"",children:"Bitte ausdrücklich zuordnen"}),Object.entries(d).map(([m,g])=>l.jsx("option",{value:m,children:String(g)},m))]})]})}function Tr({value:r,onChange:a,label:o="Istleistung · Datenpunkt",storage:d=!1,positiveOnly:c=!1}){const h=r||Br(),m=(g,p)=>a({...h,[g]:p});return l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(Kt,{label:o,value:h.stateId,onChange:g=>m("stateId",g),required:!0,help:d?"AC-Wirkung der Batterie. PV und Batterie benötigen getrennte Istwerte.":"Vollständige Datenpunktkennung."}),l.jsx(Dt,{label:"Einheit des Messwerts",value:h.unit,onChange:g=>m("unit",g),options:{W:"Watt (W)",kW:"Kilowatt (kW)"}}),l.jsx(Dt,{label:"Vorzeichen der Messung",value:h.sign,onChange:g=>m("sign",Number(g)),options:c?{1:"Positiver Betrag"}:d?{1:"Positiv = Entladen","-1":"Positiv = Laden"}:{1:"Rohwert unverändert","-1":"Rohwert umkehren"}}),l.jsx(He,{label:"Höchstens zulässiges Messwertalter",unit:"ms",min:1,value:h.maxAgeMs,onChange:g=>m("maxAgeMs",g)})]})}function lw({rootSource:r}){const a=r?.measurement,o=a?.kind==="split"?[["Netzbezug",a.importMeasurement],["Netzeinspeisung",a.exportMeasurement]]:[["Signierte Netzleistung",a]];return l.jsxs("div",{className:"nw-dynamic-root-source",children:[l.jsx("h3",{children:"M0-Messung aus Allgemein"}),l.jsx("p",{children:"Verknüpfte Quelle, hier schreibgeschützt. M0 erfasst den Gesamtanschluss einschließlich M1."}),l.jsx("dl",{className:"nw-dynamic-readout",children:o.map(([d,c])=>l.jsxs(Rf.Fragment,{children:[l.jsx("dt",{children:d}),l.jsxs("dd",{children:[l.jsx("code",{children:c?.stateId||"Noch nicht zugeordnet"}),c?.stateId&&l.jsxs("small",{children:[c.unit||"Einheit nicht bestätigt"," · Vorzeichen ",c.sign===-1?"umgekehrt":"unverändert"," · Alter maximal ",c.maxAgeMs??a?.maxAgeMs??"—"," ms"]})]})]},d))}),r?.valid===!1&&l.jsx("p",{className:"nw-nvp-notice",children:r.reason||"M0 muss zuerst unter Allgemein vollständig zugeordnet werden."}),a?.kind==="split"&&l.jsxs("p",{children:["Gemeinsames Vorzeichen: ",a.sign===-1?"Bezug minus Einspeisung wird umgekehrt":"Bezug minus Einspeisung","."]}),l.jsx("a",{className:"nw-link-button nw-config-btn",href:`${Vn()??""}/ems-apps.html?nwAdmin=1&tab=mapping`,target:typeof window<"u"&&window.parent!==window?"_parent":"_self",children:"Zuordnung → Allgemein öffnen"})]})}function sw({value:r,onChange:a,rootSource:o=null}){const d=(h,m)=>a({...r,[h]:m}),c=r.id==="M1";return l.jsxs("section",{className:"nw-card nw-config-card nw-nvp-point","aria-label":`${r.id} einrichten`,children:[l.jsxs("div",{className:"nw-nvp-section-heading",children:[l.jsx("h2",{className:"nw-config-card__title",children:us[r.id]}),l.jsx("span",{className:"nw-nvp-tag",children:c?"Innerhalb von M0":"Gesamtanschluss"})]}),c?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:"M1 misst ausschließlich den lokalen Bereich. Netzbezug ist positiv, Einspeisung negativ."}),l.jsx(Tr,{label:"M1-Nettoleistung · Datenpunkt",value:r.measurement,onChange:h=>d("measurement",h)})]}):l.jsx(lw,{rootSource:o}),l.jsx("h3",{children:"Anschlussgrenzen und feste Reserven"}),l.jsx("p",{children:"Die Betriebsgrenze ergibt sich aus Anschlussgrenze minus Reserve. 0 W ist eine wirksame Grenze."}),l.jsx("div",{className:"nw-nvp-grid",children:["import","export"].map(h=>{const m=`${h}LimitW`,g=`${h}ReserveW`,p=h==="import"?"Bezug":"Einspeisung",x=c&&r[m]===null,k=r[m],j=r[g];return l.jsxs("div",{className:"nw-nvp-limit",children:[c&&l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:!x,onChange:E=>a({...r,[m]:E.target.checked?"":null,[g]:E.target.checked?r[g]:0})})," ",p," lokal begrenzen"]}),x?l.jsxs("p",{children:[p,": ausdrücklich keine lokale Vertragsgrenze. M0 bleibt wirksam."]}):l.jsxs(l.Fragment,{children:[l.jsx(He,{label:`${p} · Anschlussgrenze`,unit:"W",value:r[m],onChange:E=>d(m,E)}),l.jsx(He,{label:`${p} · feste Reserve`,unit:"W",value:r[g],onChange:E=>d(g,E)}),l.jsxs("p",{className:"nw-text-muted",children:["Betriebsgrenze: ",typeof k=="number"&&typeof j=="number"?`${k-j} W`:"noch nicht festgelegt"]})]})]},h)})})]})}function ds({label:r,value:a,onChange:o}){const d=typeof a=="number"||a==="";return l.jsxs("div",{className:"nw-dynamic-scalar",children:[l.jsx(Dt,{label:`${r} · Datentyp`,value:d?"number":"boolean",onChange:c=>o(c==="number"?0:!1),options:{boolean:"Boolean",number:"Zahl"}}),d?l.jsx(He,{label:r,min:-Number.MAX_SAFE_INTEGER,value:typeof a=="number"||a===""?a:void 0,onChange:o}):l.jsx(Dt,{label:r,value:String(a===!0),onChange:c=>o(c==="true"),options:{true:"true",false:"false"}})]})}function Di({label:r,value:a,onChange:o,signed:d=!1}){const c=a||cs(),h=(m,g)=>o({...c,[m]:g});return l.jsxs("div",{className:"nw-dynamic-subsection",children:[l.jsx("h4",{children:r}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(Kt,{mode:"write",label:`${r} · Schreib-Datenpunkt`,value:c.stateId,onChange:m=>h("stateId",m),required:!0}),l.jsx(He,{label:`${r} · W je Rohwert`,min:1e-6,value:c.scale,onChange:m=>h("scale",m),help:"1 für W; 1000 für kW. Der Sollwert in W wird durch diesen Faktor geteilt."}),d&&l.jsx(Dt,{label:"Vorzeichen des Sollwerts",value:c.sign,onChange:m=>h("sign",Number(m)),options:{1:"Positiv = Entladen","-1":"Positiv = Laden"}}),l.jsx(Kt,{label:`${r} · Rücklese-Datenpunkt (optional)`,value:c.readbackStateId,onChange:m=>o(Yo(c,"readbackStateId",m)),help:"Rückgelesener Sollwert ist getrennt von der gemessenen Leistung."})]})]})}function aw({label:r,value:a,onChange:o}){const d=(c,h)=>o({...a,[c]:h});return l.jsxs("div",{className:"nw-dynamic-subsection",children:[l.jsx("h4",{children:r}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(Kt,{mode:"write",label:`${r} · Schreib-Datenpunkt`,value:a.stateId,onChange:c=>d("stateId",c),required:!0}),l.jsx(Kt,{label:`${r} · Rücklese-Datenpunkt (optional)`,value:a.readbackStateId,onChange:c=>o(Yo(a,"readbackStateId",c))}),l.jsx(ds,{label:`${r} · Ein-Wert`,value:a.onValue,onChange:c=>d("onValue",c)}),l.jsx(ds,{label:`${r} · Aus-Wert`,value:a.offValue,onChange:c=>d("offValue",c)})]})]})}function ow({value:r,onChange:a,onRemove:o}){const d=(p,x)=>a({...r,[p]:x}),c=r.command||{mode:"signedTarget",signedTarget:cs()},h=(p,x)=>d("command",{...c,[p]:x}),m=(p,x)=>d("strategy",{...r.strategy,[p]:x}),g=p=>{const x={...c,mode:p};["signedTarget","chargeTarget","dischargeTarget","maxCharge","maxDischarge","appliedMaxCharge","appliedMaxDischarge","watchdog"].forEach(j=>delete x[j]),(p==="signedTarget"?["signedTarget"]:p==="splitTarget"?["chargeTarget","dischargeTarget"]:["maxCharge","maxDischarge"]).forEach(j=>{x[j]=c[j]||cs()}),p==="externalLimits"&&(x.appliedMaxCharge=c.appliedMaxCharge||Br(),x.appliedMaxDischarge=c.appliedMaxDischarge||Br(),x.watchdog=c.watchdog||{stateId:"",ttlMs:5e3,writeValue:!0,readbackStateId:"",expiryBehavior:"zeroLimits"}),d("command",x)};return l.jsxs("article",{className:"nw-nvp-device",children:[l.jsxs("div",{className:"nw-nvp-section-heading",children:[l.jsx("h3",{children:r.name||r.id||"Neuer Speicher"}),l.jsx("button",{type:"button",className:"nw-button nw-config-btn",onClick:o,children:"Speicher entfernen"})]}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(es,{label:"Speicherkennung",value:r.id,onChange:p=>d("id",p),required:!0,help:"Eindeutige freie Kennung dieser App; keine bestehende Farm-Zuordnung erforderlich."}),l.jsx(es,{label:"Speichername",value:r.name,onChange:p=>d("name",p)}),l.jsx(Dt,{label:"Physischer Anschlussbereich",value:r.connectionPointId,onChange:p=>d("connectionPointId",p),options:us,placeholder:!0}),l.jsx(Dt,{label:"Regelmesspunkt",value:r.controlPointId,onChange:p=>d("controlPointId",p),options:us,placeholder:!0}),l.jsx(es,{label:"Regel-/Dispatchgruppe",value:r.dispatchGroupId,onChange:p=>d("dispatchGroupId",p),required:!0,help:"Gemeinsame Gruppe nur bei gleichem Bereich, gleicher Aufgabe, Strategie und Hoheit."}),l.jsx(Dt,{label:"Betriebsaufgabe",value:r.primaryPurpose,onChange:p=>d("primaryPurpose",p),options:Lo}),l.jsx(Dt,{label:"Stellhoheit",value:r.authority,onChange:p=>d("authority",p),options:{eos:"EOS gibt Leistungsziele vor",external:"Externer Regler innerhalb EOS-Grenzen"}})]}),l.jsxs("p",{className:"nw-nvp-info",children:["Wirksame Anschlussgrenzen: ",r.connectionPointId==="M1"?"M1 und M0":r.connectionPointId==="M0"?"M0":"noch nicht zugeordnet","."]}),l.jsx("h4",{children:"Istwerte und Verfügbarkeit"}),l.jsx(Tr,{storage:!0,label:"Batterie-Istleistung · Datenpunkt",value:r.powerMeasurement,onChange:p=>d("powerMeasurement",p)}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(Kt,{label:"SoC · Datenpunkt",value:r.socMeasurement?.stateId,onChange:p=>d("socMeasurement",{...r.socMeasurement,stateId:p}),required:!0}),l.jsx(He,{label:"SoC · Prozentpunkte je Rohwert",min:1e-6,value:r.socMeasurement?.scale,onChange:p=>d("socMeasurement",{...r.socMeasurement,scale:p})}),l.jsx(He,{label:"SoC · Höchstalter",unit:"ms",min:1,value:r.socMeasurement?.maxAgeMs,onChange:p=>d("socMeasurement",{...r.socMeasurement,maxAgeMs:p})})]}),l.jsxs("label",{className:"nw-dynamic-checkbox",children:[l.jsx("input",{type:"checkbox",checked:!!r.availability,onChange:p=>{const x={...r};p.target.checked?x.availability={stateId:"",availableValue:!0,maxAgeMs:5e3}:delete x.availability,a(x)}})," Zusätzliches Verfügbarkeitssignal verwenden"]}),r.availability&&l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(Kt,{label:"Verfügbarkeit · Datenpunkt",value:r.availability.stateId,onChange:p=>d("availability",{...r.availability,stateId:p}),required:!0}),l.jsx(ds,{label:"Verfügbar-Wert",value:r.availability.availableValue,onChange:p=>d("availability",{...r.availability,availableValue:p})}),l.jsx(He,{label:"Verfügbarkeit · Höchstalter",unit:"ms",min:1,value:r.availability.maxAgeMs,onChange:p=>d("availability",{...r.availability,maxAgeMs:p})})]}),l.jsx("h4",{children:"Leistungs-, SoC- und Änderungsgrenzen"}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(He,{label:"Maximale Ladeleistung",unit:"W",value:r.maxChargeW,onChange:p=>d("maxChargeW",p)}),l.jsx(He,{label:"Maximale Entladeleistung",unit:"W",value:r.maxDischargeW,onChange:p=>d("maxDischargeW",p)}),l.jsx(He,{label:"Untergrenze SoC",unit:"%",max:100,value:r.minSoc,onChange:p=>d("minSoc",p)}),l.jsx(He,{label:"Obergrenze SoC",unit:"%",max:100,value:r.maxSoc,onChange:p=>d("maxSoc",p)}),l.jsx(He,{label:"Höchste Leistungsänderung",unit:"W/s",min:1,value:r.maxDeltaWPerSec,onChange:p=>d("maxDeltaWPerSec",p)}),l.jsx(He,{label:"Bestätigungstoleranz",unit:"W",value:r.configuredToleranceW,onChange:p=>d("configuredToleranceW",p)}),l.jsx(He,{label:"Bestätigungsfrist",unit:"ms",min:1,value:r.commandTimeoutMs,onChange:p=>d("commandTimeoutMs",p)})]}),l.jsxs("h4",{children:["Strategie für ",Lo[r.primaryPurpose||""]]}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(He,{label:"Ziel-Netzbezug",unit:"W",value:r.strategy?.targetGridImportW,onChange:p=>m("targetGridImportW",p)}),l.jsx(He,{label:"Bezugsschwelle / Toleranz",unit:"W",value:r.strategy?.importThresholdW,onChange:p=>m("importThresholdW",p)}),r.primaryPurpose==="peakShaving"&&l.jsx(He,{label:"Lastspitzengrenze",unit:"W",value:r.strategy?.peakLimitW,onChange:p=>m("peakLimitW",p)})]}),r.primaryPurpose==="arbitrage"&&r.authority==="eos"&&l.jsxs(l.Fragment,{children:[l.jsx("p",{children:"Ein extern berechneter Leistungswunsch wird von EOS innerhalb der Anschluss- und Speichergrenzen umgesetzt."}),l.jsx(Tr,{storage:!0,label:"Arbitrage-Leistungswunsch · Datenpunkt",value:r.requestPowerMeasurement,onChange:p=>d("requestPowerMeasurement",p)})]}),r.primaryPurpose==="tariff"&&l.jsx("p",{className:"nw-nvp-info",children:"Der aktive Tarifbetrieb nutzt das zentrale Preissignal. Anschluss- und SoC-Grenzen gelten auch bei günstigen Preisen."}),l.jsx("h4",{children:"Generische Geräteschnittstelle"}),l.jsx(Dt,{label:"Befehlsschnittstelle",value:c.mode,onChange:g,options:{signedTarget:"Signierter Leistungs-Sollwert",splitTarget:"Getrennte Lade-/Entlade-Sollwerte",externalLimits:"Maximale Lade-/Entladefreigaben für externen Regler"}}),c.mode==="signedTarget"&&l.jsx(Di,{signed:!0,label:"Leistungssollwert",value:c.signedTarget,onChange:p=>h("signedTarget",p)}),c.mode==="splitTarget"&&l.jsxs(l.Fragment,{children:[l.jsx(Di,{label:"Ladesollwert",value:c.chargeTarget,onChange:p=>h("chargeTarget",p)}),l.jsx(Di,{label:"Entladesollwert",value:c.dischargeTarget,onChange:p=>h("dischargeTarget",p)}),l.jsx("p",{children:"Richtungswechsel erfolgen erst nach bestätigter Neutralisierung des bisherigen Sollwerts."})]}),c.mode==="externalLimits"&&l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"nw-nvp-notice",children:"Externe Stellhoheit ist für Arbitrage vorgesehen. EOS erteilt maximale Lade-/Entladefreigaben, keine Leistungsziele. Wirksame Grenzrücklesung und geräteseitiger Ablauf sind erforderlich."}),l.jsx(Di,{label:"Maximale Ladefreigabe",value:c.maxCharge,onChange:p=>h("maxCharge",p)}),l.jsx(Di,{label:"Maximale Entladefreigabe",value:c.maxDischarge,onChange:p=>h("maxDischarge",p)}),l.jsx(Tr,{positiveOnly:!0,label:"Angewandte Ladegrenze · Datenpunkt",value:c.appliedMaxCharge,onChange:p=>h("appliedMaxCharge",p)}),l.jsx(Tr,{positiveOnly:!0,label:"Angewandte Entladegrenze · Datenpunkt",value:c.appliedMaxDischarge,onChange:p=>h("appliedMaxDischarge",p)}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(Kt,{mode:"write",label:"Watchdog · Schreib-Datenpunkt",value:c.watchdog?.stateId,onChange:p=>h("watchdog",{...c.watchdog,stateId:p}),required:!0}),l.jsx(Kt,{label:"Watchdog · Rücklese-Datenpunkt",value:c.watchdog?.readbackStateId,onChange:p=>h("watchdog",{...c.watchdog,readbackStateId:p}),required:!0}),l.jsx(He,{label:"Geräteseitige Ablaufzeit",unit:"ms",min:1,value:c.watchdog?.ttlMs,onChange:p=>h("watchdog",{...c.watchdog,ttlMs:p})}),l.jsx(ds,{label:"Watchdog · Schreibwert",value:c.watchdog?.writeValue,onChange:p=>h("watchdog",{...c.watchdog,writeValue:p})})]}),l.jsx("p",{children:"Konfigurierter Gerätevertrag: Nach Ablauf setzt das Gerät seine externen Maximalfreigaben auf 0. Diese Funktion muss im Gerät eingerichtet sein."})]}),l.jsxs("details",{children:[l.jsx("summary",{children:"Optionale Betriebs- und Richtungsfreigaben"}),[["run","Betriebsfreigabe"],["chargeEnable","Ladefreigabe"],["dischargeEnable","Entladefreigabe"]].map(([p,x])=>l.jsxs("div",{children:[l.jsxs("label",{className:"nw-dynamic-checkbox",children:[l.jsx("input",{type:"checkbox",checked:!!c[p],onChange:k=>{const j={...c};k.target.checked?j[p]={stateId:"",onValue:!0,offValue:!1}:delete j[p],d("command",j)}})," ",x," zuordnen"]}),c[p]&&l.jsx(aw,{label:x,value:c[p],onChange:k=>h(p,k)})]},p))]})]})}function uw({value:r,onChange:a,onRemove:o}){const d=(c,h)=>a({...r,[c]:h});return l.jsxs("article",{className:"nw-nvp-device",children:[l.jsxs("div",{className:"nw-nvp-section-heading",children:[l.jsx("h3",{children:r.id||"Neuer PV-Wechselrichter"}),l.jsx("button",{type:"button",className:"nw-button nw-config-btn",onClick:o,children:"PV entfernen"})]}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(es,{label:"PV-Kennung",value:r.id,onChange:c=>d("id",c),required:!0}),l.jsx(Dt,{label:"PV-Anschlussbereich",value:r.connectionPointId,onChange:c=>d("connectionPointId",c),options:us,placeholder:!0}),l.jsx(He,{label:"AC-Bezugsleistung",unit:"W",min:1,value:r.referencePowerW,onChange:c=>d("referencePowerW",c),help:"Bezugsleistung der Wirkleistungsregelung, keine ungeprüfte DC-Modulleistung."})]}),l.jsx(Tr,{label:"PV-Istleistung · Datenpunkt",value:r.powerMeasurement,onChange:c=>d("powerMeasurement",c)}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(Kt,{mode:"write",label:"PV-Erzeugungsgrenze · Schreib-Datenpunkt",value:r.command?.stateId,onChange:c=>d("command",{...r.command,stateId:c}),required:!0}),l.jsx(Dt,{label:"Einheit der PV-Vorgabe",value:r.command?.unit,onChange:c=>d("command",{...r.command,unit:c}),options:{W:"Watt (W)","%":"Prozent der AC-Bezugsleistung"}}),l.jsx(He,{label:r.command?.unit==="%"?"Prozentpunkte je Rohwert":"PV-Vorgabe · W je Rohwert",min:1e-6,value:r.command?.scale,onChange:c=>d("command",{...r.command,scale:c})}),l.jsx(Kt,{label:"PV-Erzeugungsgrenze · Rücklese-Datenpunkt (optional)",value:r.command?.readbackStateId,onChange:c=>d("command",Yo(r.command||{},"readbackStateId",c))})]}),l.jsxs("label",{className:"nw-dynamic-checkbox",children:[l.jsx("input",{type:"checkbox",checked:r.evuControl===!0,onChange:c=>d("evuControl",c.target.checked)})," Vorhandene EVU-Stufen auf diesen Wechselrichter anwenden"]}),r.evuControl&&l.jsx("p",{children:"Verwendet die bestehende EVU-Anlagenzuordnung. EVU-Stufe und dynamische Anschlussgrenze werden zu einer gemeinsamen Erzeugungsvorgabe zusammengeführt."})]})}function Cf({status:r,preview:a=!1}){if(!r)return l.jsx("p",{children:a?"Noch keine Messwertvorschau verfügbar.":"Noch kein Betriebsstatus verfügbar."});const o=r.ts,d=typeof o!="number"||!Number.isFinite(o)||o>Date.now()||Date.now()-o>15e3,c=r.snapshot||{},h=Object.entries(c.points||{}).map(([E,W])=>({id:E,...W})),m=c.storages||{},g=Array.isArray(r.storageResults)?r.storageResults:[],p=Array.isArray(r.pendingIntervals)?r.pendingIntervals:[],x=[...new Set([...Object.keys(m),...g.map(E=>E.id),...p.map(E=>E.id)])].filter(E=>typeof E=="string"),k=[...Array.isArray(r.errors)?r.errors:[],...Array.isArray(r.activationErrors)?r.activationErrors:[],...Array.isArray(c.errors)?c.errors:[]],j=Zo({active:"Aktiv",limited:"Durch Grenzen beschränkt",recovering:"Anschlussgrenze wiederherstellen",handover_pending:"Stellübergabe läuft",handover_confirmed:"Stellübergabe bestätigt",config_invalid:"Konfiguration unvollständig oder ungültig",runtime_error:"Laufzeitfehler","root-measurement-unavailable":"M0-Messung nicht verfügbar","other-actuator-transition-unconfirmed":"Weitere Aktorwirkung noch unbestätigt",inactive:"Inaktiv"});return l.jsxs("div",{className:"nw-dynamic-live",children:[l.jsxs("p",{children:[l.jsx("strong",{children:a?"Vorschau – keine Geräteschreibzugriffe":j[r.status||""]||r.status||"Laufender Betrieb"}),r.configVersion?` · Konfiguration ${r.configVersion}`:""]}),r.reason||r.budget?.reason?l.jsx("p",{children:r.reason||r.budget?.reason}):null,d&&l.jsx("p",{role:"alert",children:"Betriebsanzeige veraltet. Aktuelle Stellwerte können nicht bestätigt werden."}),k.length>0&&l.jsx("ul",{children:k.map((E,W)=>l.jsx("li",{children:Do(E)},W))}),h.length>0&&l.jsx("div",{className:"nw-nvp-table-wrap",children:l.jsxs("table",{className:"nw-nvp-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Messpunkt"}),l.jsx("th",{children:"Netzleistung"}),l.jsx("th",{children:"Qualität"}),l.jsx("th",{children:"Messwertalter"})]})}),l.jsx("tbody",{children:h.map(E=>l.jsxs("tr",{children:[l.jsx("th",{children:E.id}),l.jsx("td",{children:ir(E.valueW)}),l.jsx("td",{children:d?"Anzeige veraltet":E.valid?"Gültig":E.reason||"Ungültig"}),l.jsx("td",{children:typeof E.ageMs=="number"?`${Math.round(E.ageMs)} ms`:"—"})]},E.id))})]})}),Array.isArray(r.groups)&&r.groups.length>0&&l.jsx("div",{className:"nw-nvp-table-wrap",children:l.jsxs("table",{className:"nw-nvp-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Regelgruppe"}),l.jsx("th",{children:"Bereich / Aufgabe"}),l.jsx("th",{children:"Bedarf"}),l.jsx("th",{children:"Begründung"})]})}),l.jsx("tbody",{children:r.groups.map(E=>l.jsxs("tr",{children:[l.jsx("th",{children:E.id}),l.jsxs("td",{children:[E.connectionPointId," · ",Lo[E.primaryPurpose||""]||E.primaryPurpose,l.jsx("small",{children:E.authority==="external"?"Externe Stellhoheit":"EOS-Stellhoheit"})]}),l.jsx("td",{children:d?"—":ir(E.requestedW)}),l.jsx("td",{children:E.reason||E.status||"—"})]},E.id))})]})}),x.length>0&&l.jsx("div",{className:"nw-nvp-table-wrap",children:l.jsxs("table",{className:"nw-nvp-table","aria-label":"Sollwerte, Bestätigung und Messung",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Speicher"}),l.jsx("th",{children:"Anforderung"}),l.jsx("th",{children:"Ziel / Freigabe"}),l.jsx("th",{children:"Befehl"}),l.jsx("th",{children:"Anwendung"}),l.jsx("th",{children:"Gemessen"})]})}),l.jsx("tbody",{children:x.map(E=>{const W=m[E]||{},R=c.storageTelemetry?.[E]||{},_=g.find(O=>O.id===E)||{},N=p.find(O=>O.id===E)||{},$=N.appliedConfirmed===!0&&(!Number.isFinite(_.targetW)||N.targetW===_.targetW),U=typeof _.targetW=="number"?ir(_.targetW):typeof _.minPowerW=="number"&&typeof _.maxPowerW=="number"?`${ir(_.minPowerW)} bis ${ir(_.maxPowerW)}`:"—";return l.jsxs("tr",{children:[l.jsx("th",{children:E}),l.jsx("td",{children:d?"—":ir(_.requestedW)}),l.jsx("td",{children:d?"—":U}),l.jsxs("td",{children:[a?"Vorschau":d?"Unbekannt":_.commandConfirmed?"Rücklesung bestätigt":_.accepted?"Gesendet · unbestätigt":"Keine bestätigte Ausgabe",l.jsx("small",{children:_.reason||""})]}),l.jsx("td",{children:a?"Keine Anwendung":d?"Unbekannt":$?"Wirkung / Grenze bestätigt":"Noch nicht bestätigt"}),l.jsxs("td",{children:[ir(W.valueW),l.jsxs("small",{children:[typeof R.socPct=="number"?`${R.socPct} % SoC`:"SoC unbekannt"," · ",R.available===!0&&W.valid?"verfügbar":"Verfügbarkeit unbestätigt"]})]})]},E)})})]})}),typeof r.writesPerformed=="number"&&l.jsxs("p",{children:["Angenommene Schreibvorgänge im letzten Zyklus: ",r.writesPerformed,"."]}),l.jsx("p",{className:"nw-text-muted",children:"Netzbezug positiv; Speicherentladung positiv. Gesendete Sollwerte, bestätigte Gerätegrenzen und gemessene Wirkung sind unterschiedliche Zustände."})]})}function cw({validation:r}){if(!r)return null;const a=[...r.errors||[],...r.activationErrors||[]];return l.jsxs("div",{className:"nw-dynamic-validation",children:[l.jsx("p",{children:l.jsx("strong",{children:r.valid===!1?"Einrichtung prüfen":r.activeEligible===!1?"Einrichtung noch nicht vollständig aktivierbar":"Einrichtung geprüft"})}),a.length>0&&l.jsx("ul",{children:a.map((o,d)=>l.jsxs("li",{children:[typeof o!="string"&&o.path&&l.jsxs("code",{children:[o.path,": "]}),Do(o)]},d))}),Array.isArray(r.warnings)&&r.warnings.length>0&&l.jsx("ul",{children:r.warnings.map((o,d)=>l.jsx("li",{children:Do(o)},d))})]})}function dw(){const[r,a]=w.useState(null),[o,d]=w.useState(null),[c,h]=w.useState(1),m=w.useRef(null),g=w.useRef(0),[p,x]=w.useState(!1),k="Der gespeicherte Stand wurde außerhalb dieses Formulars geändert. Bitte neu laden. Ihr Entwurf bleibt bis dahin erhalten; Speichern und App-Schalter sind gesperrt.",j=q=>{typeof q=="number"&&(!Number.isSafeInteger(q)||q<1||(g.current=Math.max(g.current,q),x(m.current!==null&&g.current>m.current)))},[E,W]=w.useState({installed:!1,enabled:!1}),[R,_]=w.useState(null),[N,$]=w.useState(null),[U,O]=w.useState(null),[ue,le]=w.useState(null),[ke,be]=w.useState(!1),[re,je]=w.useState(!1),[L,oe]=w.useState(!1),[z,K]=w.useState(0),[Se,Z]=w.useState("Dynamischer Netzanschluss wird geladen…"),[ce,ye]=w.useState(!1),F=E.installed&&E.enabled,se=w.useMemo(()=>({revision:z,blocked:re||p}),[z,re,p]),G=(q,ve=!1,$e=!1)=>{const kt=q.config?.configVersion;if(typeof kt=="number"&&Number.isSafeInteger(kt)&&kt<Math.max(g.current,m.current||0))return!1;if(j(q.config?.configVersion),$(q.status||null),_(q.rootSource||null),q.app&&W(q.app),be(q.locked===!0),ve||$e){K(Qt=>Qt+1);const Oe={...Ef(),...q.config};(!Array.isArray(Oe.points)||Oe.points.length!==2)&&(Oe.points=Ef().points),Array.isArray(Oe.storages)||(Oe.storages=[]),Array.isArray(Oe.pvAssignments)||(Oe.pvAssignments=[]),d(Oe),h(Oe.configVersion||1),m.current=Oe.configVersion||1,x(g.current>m.current),ve?(a(Oe),oe(!1),O(null),le(q.validation||null)):a(Qt=>Qt?{...Qt,configVersion:Oe.configVersion}:Oe)}return!0};w.useEffect(()=>{const q=ve=>{window.parent===window||ve.source!==window.parent||ve.origin!==window.location.origin||!xn(ve.data)||!rt(ve.data)||ve.data.type!=="nw:dynamic-grid-parent-changed"||j(ve.data.configVersion)};return window.addEventListener("message",q),()=>window.removeEventListener("message",q)},[]);const b=q=>{window.parent!==window&&q.config&&Number.isSafeInteger(q.config.configVersion)&&window.parent.postMessage({type:"nw:dynamic-grid-saved",configVersion:q.config.configVersion},window.location.origin)};w.useEffect(()=>{let q=!0,ve;const $e=async(kt=!1)=>{try{const Oe=Li(await Mi());if(!q)return;const Qt=G(Oe,kt);kt&&Qt&&(ye(!1),Z("Alle Zuordnungen dieser App werden hier eingerichtet."))}catch(Oe){q&&(ye(!0),Z(St(Oe,"App nicht erreichbar.")),[401,403].includes(ls(Oe))&&(a(null),$(null)))}finally{q&&(ve=window.setTimeout(()=>$e(!1),3e3))}};return $e(!0),()=>{q=!1,window.clearTimeout(ve)}},[]);const D=q=>{K(ve=>ve+1),a(q),oe(!0),O(null),le(null)},pe=(q,ve)=>{r&&D({...r,[q]:ve})},xe=(q,ve,$e)=>q.map((kt,Oe)=>Oe===ve?$e:kt),V=(q,ve)=>{r&&D({...r,[q]:r[q].filter(($e,kt)=>kt!==ve)})},ee=q=>{if(ye(!0),Z(ls(q)===409?"Der gespeicherte Stand wurde geändert oder eine Stellübergabe ist offen. Bitte Betriebsstatus prüfen und neu laden. Ihr Entwurf bleibt erhalten.":St(q,"Speichern fehlgeschlagen.")),q instanceof Re&&rt(q.payload)){const ve=Yv(q.payload.validation)||Xv(q.payload.details);ve&&le(ve)}},me=async()=>{je(!0);try{const q=Li(await Mi());G(q,!0)&&(ye(!1),Z("Gespeicherten Stand geladen."))}catch(q){ee(q)}finally{je(!1)}},ae=async(q=!1)=>{if(p){ye(!0),Z(k);return}je(!0),ye(!1);try{const ve=q?{installed:!0,enabled:!0}:{installed:!!E.installed,enabled:!!E.enabled},$e=Li(await Mi("/config",{config:r,expectedConfigVersion:c,app:ve}));if(!G($e,!0)){Z(k);return}b($e),Z($e.app?.installed&&$e.app?.enabled?"Dynamischer Netzanschluss aktiviert. Die Laufzeit prüft Messqualität und Bestätigungen vor der Stellwertausgabe.":"Einrichtung als inaktiver Entwurf gespeichert.")}catch(ve){ee(ve)}finally{je(!1)}},ge=async q=>{if(p){ye(!0),Z(k);return}je(!0),ye(!1);try{const ve=Li(await Mi("/config",{config:o,expectedConfigVersion:c,app:q}));if(!G(ve,!L,!0)){Z(k);return}b(ve),Z(q.installed?"App installiert und inaktiv. Die Einrichtung bleibt erhalten.":"App deinstalliert. Die gespeicherte Einrichtung bleibt erhalten.")}catch(ve){ee(ve)}finally{je(!1)}},Ve=async()=>{je(!0),ye(!1);try{const q=Li(await Mi("/preview",{config:r}),!1);le(q.validation||null),O(q.status||null),Z("Entwurf geprüft. Die Vorschau schreibt keine Gerätesollwerte.")}catch(q){ee(q)}finally{je(!1)}},Un=window.parent!==window&&new URLSearchParams(window.location.search).get("embedded")==="1";return l.jsx(uh.Provider,{value:se,children:l.jsxs(ur,{embedded:Un,title:"Dynamischer Netzanschluss",subtitle:"M0 und M1 gemeinsam begrenzen. Speicher und PV vollständig in dieser App zuordnen und betreiben.",showBack:!1,actions:l.jsx("a",{className:"nw-link-button nw-config-btn",href:`${Vn()??""}/ems-apps.html?nwAdmin=1`,target:Un?"_parent":"_self",children:"Zu EMS Apps"}),children:[l.jsxs("section",{className:"nw-card nw-config-card nw-dynamic-lifecycle",children:[l.jsxs("div",{className:"nw-nvp-section-heading",children:[l.jsx("h2",{className:"nw-config-card__title",children:"App und Betrieb"}),l.jsx("span",{className:`nw-nvp-tag ${F?"nw-dynamic-active":""}`,children:N?.status==="handover_pending"?"Stellübergabe läuft":F?"Dynamisch aktiv":E.installed?"Installiert · inaktiv":"Nicht installiert"})]}),l.jsx("div",{role:ce?"alert":"status",className:`nw-status ${ce?"nw-status--bad":""}`,children:Se}),l.jsx("p",{children:"Installiert und aktiviert schaltet diese App auf dynamischen Betrieb. Inaktive Entwürfe erzeugen keine Stellwerte."}),l.jsxs("div",{className:"nw-actions-row",children:[!E.installed&&l.jsx("button",{type:"button",className:"nw-button nw-config-btn",disabled:re||p||!r,onClick:()=>ge({installed:!0,enabled:!1}),children:"App installieren"}),F&&l.jsx("button",{type:"button",className:"nw-button nw-config-btn",disabled:re||p,onClick:()=>ge({installed:!0,enabled:!1}),children:"App deaktivieren"}),E.installed&&!F&&l.jsx("button",{type:"button",className:"nw-button nw-config-btn",disabled:re||p,onClick:()=>ge({installed:!1,enabled:!1}),children:"App deinstallieren"}),l.jsx("button",{type:"button",className:"nw-button nw-config-btn",disabled:re,onClick:me,children:L?"Entwurf verwerfen und neu laden":"Neu laden"})]}),p&&l.jsx("p",{role:"alert",className:"nw-nvp-notice",children:k}),L&&l.jsx("p",{className:"nw-nvp-notice",children:"Ungespeicherte Änderungen. Der Betriebsstatus gehört zum gespeicherten Stand."}),ke&&l.jsx("p",{className:"nw-nvp-notice",children:"Eine Stellübergabe ist noch offen. Der Server prüft, wann Änderungen sicher übernommen werden können."})]}),r&&l.jsx("form",{noValidate:!0,onSubmit:q=>{q.preventDefault(),ae(!0)},"aria-busy":re,children:l.jsxs("fieldset",{disabled:re,className:"nw-nvp-fieldset",children:[l.jsxs("section",{className:"nw-card nw-config-card",children:[l.jsx("h2",{className:"nw-config-card__title",children:"Messstruktur und gemeinsame Grenzen"}),l.jsx("p",{children:"M0 umfasst den gesamten Anschluss einschließlich M1. Ein Speicher außerhalb von M1 kann keine lokale M1-Nulleinspeisung herstellen."}),l.jsx(He,{label:"Höchste zeitliche Abweichung zusammengehöriger Messungen",unit:"ms",value:r.maxSkewMs,onChange:q=>pe("maxSkewMs",q)})]}),r.points.map((q,ve)=>l.jsx(sw,{value:q,rootSource:R,onChange:$e=>pe("points",xe(r.points,ve,$e))},q.id)),l.jsxs("section",{className:"nw-card nw-config-card",children:[l.jsxs("div",{className:"nw-nvp-section-heading",children:[l.jsx("h2",{className:"nw-config-card__title",children:"Speicher und Betriebsaufgaben"}),l.jsx("button",{className:"nw-button nw-config-btn",type:"button",onClick:()=>pe("storages",[...r.storages,rw()]),children:"Speicher hinzufügen"})]}),l.jsx("p",{children:"Jeder Speicher erhält hier seine eigenen Datenpunkte, Grenzen und Betriebsaufgaben. Die Einrichtung in einer anderen App ist nicht erforderlich."}),!r.storages.length&&l.jsx("p",{children:"Noch kein Speicher eingerichtet."}),r.storages.map((q,ve)=>l.jsx(ow,{value:q,onChange:$e=>pe("storages",xe(r.storages,ve,$e)),onRemove:()=>V("storages",ve)},ve))]}),l.jsxs("section",{className:"nw-card nw-config-card",children:[l.jsxs("div",{className:"nw-nvp-section-heading",children:[l.jsx("h2",{className:"nw-config-card__title",children:"PV-Wechselrichter"}),l.jsx("button",{className:"nw-button nw-config-btn",type:"button",onClick:()=>pe("pvAssignments",[...r.pvAssignments,iw()]),children:"PV hinzufügen"})]}),l.jsx("p",{children:"Eine lokale Nulleinspeisung benötigt wirksame Stellmöglichkeiten im lokalen Bereich. PV wird nach gemessener Leistung und verbleibendem Anschlussbudget begrenzt."}),r.pvAssignments.map((q,ve)=>l.jsx(uw,{value:q,onChange:$e=>pe("pvAssignments",xe(r.pvAssignments,ve,$e)),onRemove:()=>V("pvAssignments",ve)},ve))]}),l.jsxs("section",{className:"nw-card nw-config-card",children:[l.jsx("h2",{className:"nw-config-card__title",children:"Einrichtung übernehmen"}),l.jsxs("div",{className:"nw-actions-row",children:[l.jsx("button",{type:"button",className:"nw-button nw-config-btn",onClick:Ve,children:"Einrichtung prüfen"}),l.jsx("button",{type:"button",className:"nw-button nw-config-btn",disabled:p,onClick:()=>ae(!1),children:F?"Änderungen speichern":"Entwurf speichern"}),l.jsx("button",{type:"submit",className:"nw-button nw-config-btn nw-button--primary nw-config-btn--primary",disabled:p,children:F?"Speichern und aktiv halten":"Speichern und aktivieren"})]}),l.jsx("p",{children:"Aktivieren übernimmt Konfiguration und App-Zustand gemeinsam. Unvollständige Zuordnungen werden mit konkreten Gründen abgewiesen. Empfang eines Befehls ersetzt keine bestätigte Gerätewirkung."}),l.jsx(cw,{validation:ue})]})]})}),U&&l.jsxs("section",{className:"nw-card nw-config-card",children:[l.jsx("h2",{className:"nw-config-card__title",children:"Vorschau der Einrichtung"}),l.jsx(Cf,{preview:!0,status:U})]}),l.jsxs("section",{className:"nw-card nw-config-card",children:[l.jsx("h2",{className:"nw-config-card__title",children:"Betriebsstatus"}),l.jsx(Cf,{status:N})]})]})})}const fw=["balance.read","telemetry.read","capabilities.read","curtailment.request","storage.charge.request","storage.discharge.request","dispatch.status.read","dispatch.cancel"];function It(){throw new Error("Die Partnerdaten sind unvollständig oder ungültig. Bitte Eingaben prüfen oder erneut laden.")}function vn(r,a=256){return typeof r!="string"||r.length>a||/[\u0000-\u001f\u007f]/.test(r)?It():r}function rn(r){return typeof r!="boolean"?It():r}function gn(r,a,o,d=!1){return typeof r!="number"||!Number.isFinite(r)||r<a||r>o||d&&!Number.isSafeInteger(r)?It():r}function ts(r,a){return typeof r!="string"||!a.includes(r)?It():r}function ns(r,a,o){return!Array.isArray(r)||r.length>a?It():r.map(o)}function Io(r){return!xn(r)||!rt(r)||!rt(r.arbitrage)?It():{configVersion:gn(r.configVersion,1,Number.MAX_SAFE_INTEGER,!0),enabled:rn(r.enabled),partnerId:vn(r.partnerId,128),endpoint:vn(r.endpoint,2048),credentialRef:vn(r.credentialRef,128),grants:ns(r.grants,64,a=>rt(a)?{appId:ts(a.appId,["arbitrage","energyLedger","directMarketing"]),resourceId:vn(a.resourceId,128),permissions:ns(a.permissions,8,o=>ts(o,fw))}:It()),arbitrage:{profile:ts(r.arbitrage.profile,["household","tradingOnly"]),maxCommandSeconds:gn(r.arbitrage.maxCommandSeconds,1,60,!0),resources:ns(r.arbitrage.resources,32,a=>{if(!rt(a))return It();const o={id:vn(a.id,128),maxChargeW:gn(a.maxChargeW,0,1e8,!0),maxDischargeW:gn(a.maxDischargeW,0,1e8,!0),minSocPct:gn(a.minSocPct,0,100),maxSocPct:gn(a.maxSocPct,0,100),maxImportW:gn(a.maxImportW,0,1e8,!0),maxExportW:gn(a.maxExportW,0,1e8,!0),allowGridCharge:rn(a.allowGridCharge),allowGridExport:rn(a.allowGridExport),commissioned:rn(a.commissioned)};return o.minSocPct>=o.maxSocPct?It():o})}}}function No(r,a=!1){return!xn(r)||!rt(r)||r.ok!==!0||!rt(r.app)||!rt(r.status)||!rt(r.validation)?It():{ok:!0,config:a&&r.preview===!0&&r.config===null&&r.validation.valid===!1?null:Io(r.config),app:{installed:rn(r.app.installed),enabled:rn(r.app.enabled),active:rn(r.app.active)},status:{connection:ts(r.status.connection,["disabled","blocked","disconnected","connected"]),reason:vn(r.status.reason,512),controlAvailable:rn(r.status.controlAvailable),revision:gn(r.status.revision,0,Number.MAX_SAFE_INTEGER,!0)},validation:ch(r.validation),...r.preview===void 0?{}:{preview:rn(r.preview)}}}function ch(r){return!xn(r)||!rt(r)?It():{valid:rn(r.valid),errors:ns(r.errors,256,a=>rt(a)?{path:vn(a.path,512),code:vn(a.code,128),message:vn(a.message,1024)}:It())}}const Po={arbitrage:"Arbitrage · Speicherhandel",energyLedger:"Bilanz · Partnerfreigaben",directMarketing:"Direktvermarktung · Partnerfreigaben"},dh={"balance.read":"Bilanzdaten lesen","telemetry.read":"Messwerte lesen","capabilities.read":"Verfügbare Funktionen lesen","curtailment.request":"Begrenzung anfragen","storage.charge.request":"Laden anfragen","storage.discharge.request":"Entladen anfragen","dispatch.status.read":"Auftragsstatus lesen","dispatch.cancel":"Eigene Aufträge zurücknehmen"},hw={energyLedger:["balance.read"],directMarketing:["telemetry.read","capabilities.read","curtailment.request","dispatch.status.read","dispatch.cancel"],arbitrage:["telemetry.read","capabilities.read","storage.charge.request","storage.discharge.request","dispatch.status.read","dispatch.cancel"]},pw={disabled:"Verbindung ausgeschaltet",blocked:"Verbindung gesperrt",disconnected:"Nicht verbunden",connected:"Verbunden"},Nf=Object.freeze({DISABLED:"Partnerverbindung ausgeschaltet.",NOT_CONNECTED:"Noch keine bestätigte Partnerverbindung.",CONTROL_UNAVAILABLE:"Die sichere Speichersteuerung ist noch nicht freigegeben.",INVALID_CONFIG:"Die gespeicherte Konfiguration ist unvollständig oder ungültig.",APP_INACTIVE:"Die zugehörige App ist nicht aktiv."});function mw(r){return Object.hasOwn(Nf,r)?Nf[r]:`Statushinweis: ${r}`}function lr({label:r,value:a,onChange:o,min:d=0,max:c}){return l.jsxs("label",{className:"nw-nvp-field nw-config-field",children:[l.jsx("span",{className:"nw-config-label",children:r}),l.jsx("input",{className:"nw-input nw-config-input",type:"number",required:!0,min:d,max:c,step:"any",value:a,onChange:h=>o(h.target.value===""?"":Number(h.target.value))})]})}function rs({label:r,value:a,onChange:o,help:d="",maxLength:c=128}){return l.jsxs("label",{className:"nw-nvp-field nw-config-field",children:[l.jsx("span",{className:"nw-config-label",children:r}),l.jsx("input",{className:"nw-input nw-config-input",value:a,maxLength:c,autoComplete:"off",onChange:h=>o(h.target.value)}),d&&l.jsx("small",{children:d})]})}function gw({grant:r,resourceIds:a,onChange:o,onRemove:d}){return l.jsxs("article",{className:"nw-nvp-device",children:[l.jsxs("div",{className:"nw-nvp-section-heading",children:[l.jsx("h3",{children:"Ressourcenfreigabe"}),l.jsx("button",{className:"nw-button nw-config-btn",type:"button",onClick:d,children:"Freigabe entfernen"})]}),l.jsxs("label",{className:"nw-nvp-field nw-config-field",children:[l.jsx("span",{className:"nw-config-label",children:"Freigegebene Ressource"}),l.jsxs("select",{className:"nw-input nw-config-select",required:!0,value:r.resourceId,onChange:c=>o({...r,resourceId:c.target.value}),children:[l.jsx("option",{value:"",children:"Ressource ausdrücklich auswählen"}),r.resourceId&&!a.includes(r.resourceId)&&l.jsxs("option",{value:r.resourceId,children:["Nicht zugeordnet: ",r.resourceId]}),a.map(c=>l.jsx("option",{value:c,children:c==="site"?"Anlage (site)":c==="single"?"Einzelspeicher (single)":`Dynamische Gruppe: ${c}`},c))]}),l.jsx("small",{children:"Nur lokal eingerichtete Ressourcen freigeben. Rohdatenpunktpfade sind nicht zulässig."})]}),l.jsx("div",{className:"nw-partner-permissions",children:hw[r.appId].map(c=>l.jsxs("label",{className:"nw-dynamic-checkbox",children:[l.jsx("input",{type:"checkbox",checked:r.permissions.includes(c),onChange:h=>o({...r,permissions:h.target.checked?[...r.permissions,c]:r.permissions.filter(m=>m!==c)})}),dh[c]]},c))})]})}function vw({resource:r,onChange:a,onRemove:o}){const d=(c,h)=>a({...r,[c]:h});return l.jsxs("article",{className:"nw-nvp-device",children:[l.jsxs("div",{className:"nw-nvp-section-heading",children:[l.jsx("h3",{children:r.id||"Neuer Handelsspeicher"}),l.jsx("button",{className:"nw-button nw-config-btn",type:"button",onClick:o,children:"Speicher entfernen"})]}),l.jsxs("label",{className:"nw-nvp-field nw-config-field",children:[l.jsx("span",{className:"nw-config-label",children:"Lokaler Regelpfad"}),l.jsxs("select",{className:"nw-input nw-config-select",value:r.id==="single"?"single":r.id==="farm"?"unsupported":"group",onChange:c=>a({...r,id:c.target.value==="single"?"single":"",commissioned:!1}),children:[l.jsx("option",{value:"single",children:"Vorhandene Einzelspeicher-Regelung (single)"}),l.jsx("option",{value:"group",children:"Konfigurierte dynamische Speichergruppe"}),r.id==="farm"&&l.jsx("option",{value:"unsupported",children:"Speicherfarm: in dieser Version nicht freigegeben"})]})]}),r.id!=="single"&&r.id!=="farm"&&l.jsx(rs,{label:"Kennung der konfigurierten dynamischen Speichergruppe",maxLength:64,value:r.id,onChange:c=>a({...r,id:c,commissioned:!1}),help:"Exakte Gruppenkennung aus dem dynamischen Netzanschluss; keine Datenpunktadresse."}),r.id==="single"&&l.jsx("p",{children:"Die vorhandene lokale Speicherregelung muss eingerichtet und aktiv sein. Arbitrage ergänzt ihre Handelsanforderungen; PV und dynamischer Netzanschluss sind dafür nicht erforderlich."}),r.id==="farm"&&l.jsx("p",{className:"nw-nvp-notice",children:"Die bestehende Speicherfarm ist für Partnersteuerung in dieser Version nicht freigegeben. Diese Ressource entfernen oder einen unterstützten Regelpfad einrichten."}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(lr,{label:"Maximale Ladeleistung (W)",value:r.maxChargeW,onChange:c=>d("maxChargeW",c)}),l.jsx(lr,{label:"Maximale Entladeleistung (W)",value:r.maxDischargeW,onChange:c=>d("maxDischargeW",c)}),l.jsx(lr,{label:"Reserve · Mindest-SoC (%)",value:r.minSocPct,max:100,onChange:c=>d("minSocPct",c)}),l.jsx(lr,{label:"Höchster SoC (%)",value:r.maxSocPct,max:100,onChange:c=>d("maxSocPct",c)}),l.jsx(lr,{label:"Zulässiger Netzbezug (W)",value:r.maxImportW,onChange:c=>d("maxImportW",c)}),l.jsx(lr,{label:"Zulässige Netzeinspeisung (W)",value:r.maxExportW,onChange:c=>d("maxExportW",c)})]}),l.jsxs("label",{className:"nw-dynamic-checkbox",children:[l.jsx("input",{type:"checkbox",checked:r.allowGridCharge,onChange:c=>d("allowGridCharge",c.target.checked)}),"Netzladung für diesen Speicher erlauben"]}),l.jsxs("label",{className:"nw-dynamic-checkbox",children:[l.jsx("input",{type:"checkbox",checked:r.allowGridExport,onChange:c=>d("allowGridExport",c.target.checked)}),"Einspeisung aus diesem Speicher erlauben"]}),l.jsxs("label",{className:"nw-dynamic-checkbox",children:[l.jsx("input",{type:"checkbox",checked:r.id!=="farm"&&r.commissioned,disabled:r.id==="farm",onChange:c=>d("commissioned",c.target.checked)}),"Installateurfreigabe: Messung, Grenzen und sicherer Regelpfad wurden an dieser Anlage geprüft"]})]})}function To({appId:r="arbitrage"}){const[a,o]=w.useState(null),[d,c]=w.useState(null),[h,m]=w.useState(null),[g,p]=w.useState(null),[x,k]=w.useState(!1),[j,E]=w.useState(!1),[W,R]=w.useState(!1),[_,N]=w.useState(!1),[$,U]=w.useState(!1),[O,ue]=w.useState("Partnerfreigaben werden geladen…"),[le,ke]=w.useState(0),[be,re]=w.useState(Date.now()),je=w.useRef(null),L=w.useRef(0),oe=w.useRef(!1),z=w.useRef(!0),K="Der gespeicherte Stand wurde geändert. Ihr Entwurf bleibt erhalten. Vor dem nächsten Speichern bitte neu laden.",Se=window.parent!==window&&new URLSearchParams(window.location.search).get("embedded")==="1",Z=le===0||be-le>15e3,ce=!Z&&!_&&!W,ye=ce&&d?.app.active===!0&&d.status.controlAvailable&&d.status.connection==="connected",F=j||W||_,se=(V,ee)=>{!z.current||V.config.configVersion<L.current||(L.current=V.config.configVersion,c(V),ke(Date.now()),ee?(je.current=V.config.configVersion,o(V.config),k(!1),R(!1),N(!1),m(null),p(null)):je.current!==null&&V.config.configVersion>je.current&&R(!0))},G=async(V=!1)=>{if(!oe.current){V&&(oe.current=!0,E(!0));try{const ee=No(await ff());if(!V&&oe.current)return;se(ee,V),z.current&&V&&(ue("Gespeicherter Stand geladen."),U(!1))}catch(ee){if(!z.current)return;ke(0),U(!0),ue(St(ee,"Der Betriebsstatus ist nicht erreichbar."))}finally{V&&(oe.current=!1,z.current&&E(!1))}}};w.useEffect(()=>{z.current=!0,G(!0);const V=ae=>{if(ae.origin!==window.location.origin||ae.source!==window.parent||!ae.data||typeof ae.data!="object"||!("type"in ae.data)||ae.data.type!=="nw:partner-integrations-parent-changed"||!("configVersion"in ae.data))return;const ge=ae.data.configVersion;typeof ge!="number"||!Number.isSafeInteger(ge)||ge<1||(L.current=Math.max(L.current,ge),je.current!==null&&ge>je.current&&R(!0))};window.addEventListener("message",V);const ee=window.setInterval(()=>{G()},5e3),me=window.setInterval(()=>re(Date.now()),1e3);return()=>{z.current=!1,window.clearInterval(ee),window.clearInterval(me),window.removeEventListener("message",V)}},[]);const b=V=>{o(V),k(!0),m(null),p(null)},D=async(V,ee)=>{if(oe.current||!a||je.current===null||V!=="preview"&&(W||_))return;oe.current=!0,E(!0),U(!1);let me=!1;try{const ae=V==="revoke"?{expectedConfigVersion:je.current}:V==="preview"?{config:Io(a)}:{config:Io(a),expectedConfigVersion:je.current,...ee===void 0?{}:{app:{installed:!0,enabled:ee}}};me=!0;const ge=await ff(V==="save"?"/config":`/${V}`,ae);if(!z.current)return;if(V==="preview"){const Ve=No(ge,!0);m(Ve),p(Ve.validation),ue(Ve.validation.valid?"Einrichtung geprüft. Die Vorschau sendet keine Gerätebefehle.":"Die Einrichtung enthält Prüfhinweise.")}else{const Ve=No(ge);se(Ve,!0),ue(V==="revoke"?"Partnerverbindung und alle Daten-/Steuerfreigaben wurden widerrufen.":"Konfiguration gespeichert. Der aktuelle Betriebsstatus entscheidet über die Verfügbarkeit."),Se&&window.parent.postMessage({type:"nw:partner-integrations-saved",configVersion:Ve.config.configVersion},window.location.origin)}}catch(ae){if(!z.current)return;const ge=ls(ae);if(ge===409&&R(!0),me&&V!=="preview"&&ge!==400&&ge!==422&&ge!==409&&N(!0),ae instanceof Re&&ae.payload.validation)try{p(ch(ae.payload.validation))}catch{}U(!0),ue(ge===409?K:St(ae,"Der Auftrag konnte nicht bestätigt werden. Bitte den Serverstand neu laden."))}finally{oe.current=!1,z.current&&E(!1)}},pe=a?.grants.map((V,ee)=>({grant:V,index:ee})).filter(V=>V.grant.appId===r)||[],xe=g||h?.validation||d?.validation;return l.jsxs(ur,{title:Po[r],embedded:Se,subtitle:"Partnerverbindung, ausdrücklich freigegebene Daten und sicher begrenzte Anforderungen.",children:[l.jsxs("section",{className:"nw-card nw-config-card",children:[l.jsxs("div",{className:"nw-nvp-section-heading",children:[l.jsx("h2",{className:"nw-config-card__title",children:Po[r]}),l.jsx("span",{className:"nw-nvp-tag",children:ce&&d?pw[d.status.connection]:"Betriebsstatus unbestätigt"})]}),l.jsx("div",{className:`nw-status ${$?"nw-status--bad":""}`,role:$?"alert":"status",children:O}),r==="arbitrage"?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:"Eigenständiger Speicherhandel für Haushalte oder Anlagen, in denen EOS ausschließlich Speicher für den Handel regelt. PV, Wallbox, Bilanz und dynamischer Netzanschluss sind dafür keine Voraussetzung."}),l.jsxs("p",{children:[l.jsx("strong",{children:ye?"Partnerkanal bereit · jede Steueranforderung wird einzeln geprüft":"Diagnose / Steuerung gesperrt"})," · ",d?mw(d.status.reason):"Status wird geprüft."]}),l.jsx("p",{children:"Lokale Netzgrenzen, Speicherreserve und Geräteschutz haben Vorrang vor Händleranforderungen. Eine Verbindung oder Auftragsannahme bestätigt noch keine Wirkung am Speicher."})]}):l.jsx("p",{children:r==="energyLedger"?"Bilanzdaten dürfen nur für die hier benannten Ressourcen gelesen werden. Diese App erteilt keine Speichersteuerrechte.":"Messwerte und Begrenzungsanfragen werden separat freigegeben. Speicherhandel erhält seine Freigaben ausschließlich in der App Arbitrage."}),Z&&l.jsx("p",{className:"nw-nvp-notice",role:"alert",children:"Keine frische Betriebsbestätigung. Aktive Steuerung kann nicht bestätigt werden."}),W&&l.jsx("p",{className:"nw-nvp-notice",role:"alert",children:K}),_&&l.jsx("p",{className:"nw-nvp-notice",role:"alert",children:"Das Ergebnis der letzten Änderung ist unklar. Vor weiteren Änderungen den Serverstand neu laden."}),x&&l.jsx("p",{className:"nw-nvp-notice",children:"Ungespeicherter Entwurf. Die Betriebsanzeige zeigt den gespeicherten Stand."}),l.jsxs("div",{className:"nw-actions-row",children:[l.jsx("button",{type:"button",className:"nw-button nw-config-btn",disabled:j,onClick:()=>{G(!0)},children:x?"Entwurf verwerfen und neu laden":"Neu laden"}),r==="arbitrage"&&d&&l.jsx("button",{type:"button",className:"nw-button nw-config-btn",disabled:F||x,onClick:()=>{D("save",!d.app.enabled)},children:d.app.enabled?"Arbitrage-App ausschalten":"Arbitrage-App einschalten"})]}),r==="arbitrage"&&d&&l.jsxs("p",{children:["App: ",d.app.installed?d.app.enabled?"Installiert · eingeschaltet":"Installiert · ausgeschaltet":"Nicht installiert",". Ohne bestätigte Steuerfreigabe bleibt der Betrieb in Diagnose."]})]}),a&&l.jsx("form",{onSubmit:V=>{V.preventDefault(),D("save")},"aria-busy":j,children:l.jsxs("fieldset",{className:"nw-nvp-fieldset",disabled:j,children:[l.jsxs("section",{className:"nw-card nw-config-card",children:[l.jsx("h2",{className:"nw-config-card__title",children:"Gemeinsame Partnerverbindung"}),l.jsx("p",{children:"Ein Partnerprofil wird von den Fach-Apps gemeinsam genutzt. Die folgenden Verbindungsdaten gelten auch für die anderen Partnerfreigaben."}),l.jsxs("label",{className:"nw-dynamic-checkbox",children:[l.jsx("input",{type:"checkbox",checked:a.enabled,onChange:V=>b({...a,enabled:V.target.checked})}),"Partnerverbindung einschalten"]}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsx(rs,{label:"Partnerkennung",value:a.partnerId,onChange:V=>b({...a,partnerId:V})}),l.jsx(rs,{label:"Geschützte WebSocket-Adresse (wss://)",maxLength:2048,value:a.endpoint,onChange:V=>b({...a,endpoint:V}),help:"Adresse ohne Zugangsdaten, Token, URL-Parameter oder Fragment."}),l.jsx(rs,{label:"Referenz auf das geschützte Zugangstoken",value:a.credentialRef,onChange:V=>b({...a,credentialRef:V}),help:"Name der auf dem EOS-System bereitgestellten Umgebungsvariable mit Präfix NEXOWATT_PARTNER_. Hier keinen Tokenwert eingeben."})]})]}),r==="arbitrage"&&l.jsxs("section",{className:"nw-card nw-config-card",children:[l.jsx("h2",{className:"nw-config-card__title",children:"Speicherhandel und Reserve"}),l.jsxs("div",{className:"nw-nvp-grid",children:[l.jsxs("label",{className:"nw-nvp-field nw-config-field",children:[l.jsx("span",{className:"nw-config-label",children:"Betriebsprofil"}),l.jsxs("select",{className:"nw-input nw-config-select",value:a.arbitrage.profile,onChange:V=>b({...a,arbitrage:{...a.arbitrage,profile:V.target.value==="tradingOnly"?"tradingOnly":"household"}}),children:[l.jsx("option",{value:"household",children:"Haushalt mit Speicherhandel"}),l.jsx("option",{value:"tradingOnly",children:"Nur Speicherhandel"})]})]}),l.jsx(lr,{label:"Maximale Gültigkeit einer Anforderung (s)",value:a.arbitrage.maxCommandSeconds,min:1,max:60,onChange:V=>b({...a,arbitrage:{...a.arbitrage,maxCommandSeconds:V}})})]}),l.jsx("p",{children:"Die Speicherkennung verweist auf die lokale Gerätezuordnung. Die Einzelspeicher-Regelung muss lokal eingerichtet und aktiv sein. Alternativ kann eine bestehende dynamische Speichergruppe verwendet werden. Vor einer Steuerfreigabe müssen aktuelle Messwerte, Anschlussgrenzen und der sichere Regelpfad an der Anlage geprüft sein; diese Maske ersetzt keine Inbetriebnahmeprüfung."}),a.arbitrage.resources.map((V,ee)=>l.jsx(vw,{resource:V,onChange:me=>b({...a,arbitrage:{...a.arbitrage,resources:a.arbitrage.resources.map((ae,ge)=>ge===ee?me:ae)}}),onRemove:()=>b({...a,arbitrage:{...a.arbitrage,resources:a.arbitrage.resources.filter((me,ae)=>ae!==ee)},grants:a.grants.filter(me=>!(me.appId==="arbitrage"&&me.resourceId===V.id))})},ee)),l.jsx("button",{className:"nw-button nw-config-btn",type:"button",disabled:a.arbitrage.resources.length>=32,onClick:()=>b({...a,arbitrage:{...a.arbitrage,resources:[...a.arbitrage.resources,{id:"single",maxChargeW:"",maxDischargeW:"",minSocPct:20,maxSocPct:90,maxImportW:"",maxExportW:"",allowGridCharge:!1,allowGridExport:!1,commissioned:!1}]}}),children:"Handelsspeicher hinzufügen"})]}),l.jsxs("section",{className:"nw-card nw-config-card",children:[l.jsxs("h2",{className:"nw-config-card__title",children:["Freigaben für ",r==="arbitrage"?"Arbitrage":r==="energyLedger"?"Bilanz":"Direktvermarktung"]}),l.jsx("p",{children:"Nur ausdrücklich ausgewählte Daten und Anforderungen dürfen genutzt werden. Neue Freigaben beginnen ohne Rechte."}),pe.length===0&&l.jsx("p",{children:"Noch keine Ressource freigegeben."}),pe.map(({grant:V,index:ee})=>l.jsx(gw,{grant:V,resourceIds:r==="arbitrage"?[...new Set(a.arbitrage.resources.map(me=>me.id).filter(me=>me&&me!=="farm"))]:["site"],onChange:me=>b({...a,grants:a.grants.map((ae,ge)=>ge===ee?me:ae)}),onRemove:()=>b({...a,grants:a.grants.filter((me,ae)=>ae!==ee)})},ee)),l.jsx("button",{className:"nw-button nw-config-btn",type:"button",disabled:a.grants.length>=64,onClick:()=>b({...a,grants:[...a.grants,{appId:r,resourceId:"",permissions:[]}]}),children:"Ressource freigeben"}),a.grants.length>pe.length&&l.jsxs("p",{className:"nw-text-muted",children:[a.grants.length-pe.length," weitere Ressourcenfreigabe(n) werden in den anderen Fach-Apps verwaltet und beim Speichern erhalten."]})]}),l.jsxs("section",{className:"nw-card nw-config-card",children:[l.jsx("h2",{className:"nw-config-card__title",children:"Prüfen und übernehmen"}),l.jsxs("div",{className:"nw-actions-row",children:[l.jsx("button",{className:"nw-button nw-config-btn",type:"button",onClick:()=>{D("preview")},children:"Freigaben prüfen"}),l.jsx("button",{className:"nw-button nw-config-btn nw-button--primary nw-config-btn--primary",type:"submit",disabled:F,children:"Konfiguration speichern"})]}),xe&&l.jsxs("div",{className:"nw-dynamic-validation",children:[l.jsx("p",{children:xe.valid?"Einrichtung formal gültig. Die Betriebsfreigabe wird zusätzlich geprüft.":"Einrichtung prüfen:"}),xe.errors.length>0&&l.jsx("ul",{children:xe.errors.map((V,ee)=>l.jsxs("li",{children:[V.message," ",l.jsxs("small",{children:["(",V.path,")"]})]},ee))})]}),h&&l.jsxs("div",{className:"nw-partner-preview",children:[l.jsx("h3",{children:"Vorschau der Daten- und Steuerfreigaben"}),l.jsx("p",{children:"Geprüfter Entwurf; keine Messwertübertragung und keine Gerätebefehle durch diese Vorschau."}),l.jsx("div",{className:"nw-nvp-table-wrap",children:l.jsxs("table",{className:"nw-nvp-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"App"}),l.jsx("th",{children:"Ressource"}),l.jsx("th",{children:"Erlaubte Nutzung"})]})}),l.jsx("tbody",{children:(h.config?.grants||[]).filter(V=>V.appId===r).map((V,ee)=>l.jsxs("tr",{children:[l.jsx("td",{children:Po[V.appId]}),l.jsx("td",{children:V.resourceId}),l.jsx("td",{children:V.permissions.map(me=>dh[me]).join(", ")||"Keine Rechte"})]},ee))})]})})]})]})]})}),d&&l.jsxs("section",{className:"nw-card nw-config-card nw-partner-revoke",children:[l.jsx("h2",{className:"nw-config-card__title",children:"Partnerzugriff widerrufen"}),l.jsx("p",{children:"Schaltet die gemeinsame Partnerverbindung aus und entfernt sämtliche Daten- und Steuerfreigaben für Arbitrage, Bilanz und Direktvermarktung. Lokale Schutzfunktionen bleiben zuständig."}),l.jsx("button",{className:"nw-button nw-config-btn",type:"button",disabled:F,onClick:()=>{D("revoke")},children:"Alle Partnerfreigaben jetzt widerrufen"}),l.jsxs("p",{className:"nw-text-muted",children:["Gespeicherte Konfiguration: ",d.config.configVersion,". Letzte Statusabfrage: ",le?new Date(le).toLocaleTimeString("de-DE"):"Nicht bestätigt","."]})]})]})}function ww(){return l.jsx(To,{appId:"arbitrage"})}const yw={appcenter:{title:"EMS App-Center",path:"/ems-apps.html",needsAdminBackQuery:!0},simulation:{title:"Simulation",path:"/simulation.html",needsAdminBackQuery:!0},license:{title:"Lizenz",path:"/license.html",needsAdminBackQuery:!0},"smarthome-config":{title:"SmartHome Config",path:"/smarthome-config.html",needsAdminBackQuery:!0},"smarthome-vis":{title:"SmartHome VIS",path:"/smarthome.html",needsAdminBackQuery:!1}};function xw(r,a){if(!r||!r.includes(".html"))return r;const o=r.includes("?")?"&":"?",d=window.location.port||"8081";return`${r}${o}nwAdmin=1&instance=${encodeURIComponent(String(a))}&adminPort=${encodeURIComponent(d)}`}function Ir({targetKey:r}){const a=yw[r],o=an(),[d,c]=w.useState(null),[h,m]=w.useState("Weiterleitung wird vorbereitet…");w.useEffect(()=>{let p=!0,x;return c(null),m("Weiterleitung wird vorbereitet…"),(async()=>{try{const k=await vs(o);if(!p)return;const j=`${k}${a.needsAdminBackQuery?xw(a.path,o):a.path}`;c({instance:o,key:r,url:j}),m("Öffne Seite…"),x=setTimeout(()=>{p&&nn(j)},50)}catch{if(!p)return;c(null),m("Die Adresse der Oberfläche konnte nicht ermittelt werden. Bitte die Adapterverbindung prüfen.")}})(),()=>{p=!1,x!==void 0&&clearTimeout(x)}},[o,r,a.path,a.needsAdminBackQuery]);const g=d?.instance===o&&d.key===r?d.url:null;return l.jsx(ur,{title:a.title,subtitle:"Weiterleitung wird vorbereitet…",children:l.jsxs("section",{className:"nw-card nw-card--centered",children:[l.jsx("div",{className:`nw-status${g?" nw-status--ok":""}`,role:"status",children:h}),l.jsx("div",{className:"nw-actions-row nw-actions-row--centered",children:l.jsx("button",{className:"nw-button nw-button--primary",onClick:()=>{g&&nn(g)},disabled:!g,type:"button",children:"Jetzt öffnen"})})]})})}function Sw(){for(const r of["localStorage","sessionStorage"])try{const a=window[r],o=[];for(let d=0;d<a.length;d+=1){const c=a.key(d);c&&c.startsWith("nexowatt-ui.licenseKey.")&&o.push(c)}o.forEach(d=>a.removeItem(d))}catch{}}function kw(){return w.useEffect(()=>{Sw()},[]),l.jsx(Ir,{targetKey:"license"})}const Yl=["admin","installer"];function jw(){const r=Vn(),a=r?new URL(r).pathname:"",o=window.location.pathname,d=a&&o.startsWith(`${a}/`)?o.slice(a.length):o;return l.jsxs(wg,{children:[l.jsx(ut,{path:"/arbitrage",element:l.jsx(Gt,{embedded:!0,capability:"appcenter.open",requiredRole:"Installer oder Admin",title:"Arbitrage",allowedRoles:Yl,children:l.jsx(ww,{})})}),l.jsx(ut,{path:"/partner-integrations/energyLedger",element:l.jsx(Gt,{embedded:!0,capability:"appcenter.open",requiredRole:"Installer oder Admin",title:"Bilanz · Partnerfreigaben",allowedRoles:Yl,children:l.jsx(To,{appId:"energyLedger"})})}),l.jsx(ut,{path:"/partner-integrations/directMarketing",element:l.jsx(Gt,{embedded:!0,capability:"appcenter.open",requiredRole:"Installer oder Admin",title:"Direktvermarktung · Partnerfreigaben",allowedRoles:Yl,children:l.jsx(To,{appId:"directMarketing"})})}),l.jsx(ut,{path:"/dynamic-grid",element:l.jsx(Gt,{embedded:!0,capability:"appcenter.open",requiredRole:"Installer oder Admin",title:"Dynamischer Netzanschluss",allowedRoles:Yl,children:l.jsx(dw,{})})}),l.jsx(ut,{path:"/nvp-topology",element:l.jsx(sf,{replace:!0,to:"/dynamic-grid"})}),l.jsx(ut,{path:"/mesh-coordinator",element:l.jsx(Gt,{capability:"mesh.configure",requiredRole:"Installer oder Admin",title:"Microgrid",children:d.startsWith("/ems/microgrid")?l.jsx(Av,{}):l.jsx(Ir,{targetKey:"appcenter"})})}),l.jsx(ut,{path:"/notification-mail",element:l.jsx(Gt,{capability:"notifications.manage",requiredRole:"Admin",title:"E-Mail-Versand",children:l.jsx(ew,{})})}),l.jsx(ut,{element:l.jsx(Gt,{capability:"appcenter.open",title:"Installer",children:l.jsx(mf,{})}),path:"/"}),l.jsx(ut,{element:l.jsx(Gt,{capability:"appcenter.open",title:"Installer",children:l.jsx(mf,{})}),path:"/installer"}),l.jsx(ut,{element:l.jsx(Gt,{capability:"license.manage",requiredRole:"Admin",title:"Lizenz",children:l.jsx(kw,{})}),path:"/license"}),l.jsx(ut,{element:l.jsx(Gt,{capability:"appcenter.open",title:"EMS App-Center",children:l.jsx(Ir,{targetKey:"appcenter"})}),path:"/redirect/appcenter"}),l.jsx(ut,{element:l.jsx(Gt,{capability:"simulation.open",title:"Simulation",children:l.jsx(Ir,{targetKey:"simulation"})}),path:"/redirect/simulation"}),l.jsx(ut,{element:l.jsx(Ir,{targetKey:"smarthome-config"}),path:"/redirect/smarthome-config"}),l.jsx(ut,{element:l.jsx(Ir,{targetKey:"smarthome-vis"}),path:"/redirect/smarthome-vis"}),l.jsx(ut,{element:l.jsx(sf,{replace:!0,to:"/installer"}),path:"*"})]})}const fh=document.getElementById("root");if(!fh)throw new Error("Admin-Anwendung kann nicht gestartet werden: Einbettung fehlt.");wm.createRoot(fh).render(l.jsx(Rf.StrictMode,{children:l.jsx(Vg,{children:l.jsx(jw,{})})}));
|