keboola-cli 0.63.4__py3-none-any.whl
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.
- keboola_agent_cli/__init__.py +34 -0
- keboola_agent_cli/__main__.py +5 -0
- keboola_agent_cli/_ui_dist/assets/arc-DhFYIddx.js +2 -0
- keboola_agent_cli/_ui_dist/assets/arc-DhFYIddx.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/architecture-7EHR7CIX-hNCijx_H.js +1 -0
- keboola_agent_cli/_ui_dist/assets/architectureDiagram-3BPJPVTR-C6hUlprM.js +37 -0
- keboola_agent_cli/_ui_dist/assets/architectureDiagram-3BPJPVTR-C6hUlprM.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/array-BifhSqXX.js +2 -0
- keboola_agent_cli/_ui_dist/assets/array-BifhSqXX.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/blockDiagram-GPEHLZMM-DC7qY9i4.js +133 -0
- keboola_agent_cli/_ui_dist/assets/blockDiagram-GPEHLZMM-DC7qY9i4.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/c4Diagram-AAUBKEIU-5Lh44evt.js +11 -0
- keboola_agent_cli/_ui_dist/assets/c4Diagram-AAUBKEIU-5Lh44evt.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/channel-DBMrXlxx.js +2 -0
- keboola_agent_cli/_ui_dist/assets/channel-DBMrXlxx.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-2J33WTMH-Coy82EBh.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-2J33WTMH-Coy82EBh.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-3OPIFGDE-BQC5CRHI.js +63 -0
- keboola_agent_cli/_ui_dist/assets/chunk-3OPIFGDE-BQC5CRHI.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-4BX2VUAB-DUuEt70o.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-4BX2VUAB-DUuEt70o.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-55IACEB6-BvR-6chF.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-55IACEB6-BvR-6chF.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-5ZQYHXKU-BjcTN7ul.js +3 -0
- keboola_agent_cli/_ui_dist/assets/chunk-5ZQYHXKU-BjcTN7ul.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-727SXJPM-C0zxqqRN.js +207 -0
- keboola_agent_cli/_ui_dist/assets/chunk-727SXJPM-C0zxqqRN.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-AQP2D5EJ-CXf7rIlZ.js +232 -0
- keboola_agent_cli/_ui_dist/assets/chunk-AQP2D5EJ-CXf7rIlZ.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-BSJP7CBP-Oj_FO9Q7.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-BSJP7CBP-Oj_FO9Q7.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-CSCIHK7Q-CcTsLrFc.js +124 -0
- keboola_agent_cli/_ui_dist/assets/chunk-CSCIHK7Q-CcTsLrFc.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-FMBD7UC4-FH-zLkkW.js +16 -0
- keboola_agent_cli/_ui_dist/assets/chunk-FMBD7UC4-FH-zLkkW.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-L5ZTLDWV-B1Ky_e7O.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-L5ZTLDWV-B1Ky_e7O.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-ND2GUHAM-BHz1rpbm.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-ND2GUHAM-BHz1rpbm.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-NNHCCRGN-DlpIbxXb.js +160 -0
- keboola_agent_cli/_ui_dist/assets/chunk-NNHCCRGN-DlpIbxXb.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-NZK2D7GU-tnrSoegS.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-NZK2D7GU-tnrSoegS.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-O5CBEL6O-DxxqDH0l.js +71 -0
- keboola_agent_cli/_ui_dist/assets/chunk-O5CBEL6O-DxxqDH0l.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/chunk-QZHKN3VN-CSjc2gjj.js +2 -0
- keboola_agent_cli/_ui_dist/assets/chunk-QZHKN3VN-CSjc2gjj.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/classDiagram-4FO5ZUOK-BuZcZu85.js +2 -0
- keboola_agent_cli/_ui_dist/assets/classDiagram-4FO5ZUOK-BuZcZu85.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/classDiagram-v2-Q7XG4LA2-BuZcZu85.js +2 -0
- keboola_agent_cli/_ui_dist/assets/classDiagram-v2-Q7XG4LA2-BuZcZu85.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/cose-bilkent-S5V4N54A-Y0L8LDMa.js +2 -0
- keboola_agent_cli/_ui_dist/assets/cose-bilkent-S5V4N54A-Y0L8LDMa.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/cytoscape.esm-C8YCVR3_.js +322 -0
- keboola_agent_cli/_ui_dist/assets/cytoscape.esm-C8YCVR3_.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/dagre-BM42HDAG-UZ-9BTqF.js +5 -0
- keboola_agent_cli/_ui_dist/assets/dagre-BM42HDAG-UZ-9BTqF.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/dagre-Bx709z4p.js +2 -0
- keboola_agent_cli/_ui_dist/assets/dagre-Bx709z4p.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/defaultLocale-C8Fc0cco.js +2 -0
- keboola_agent_cli/_ui_dist/assets/defaultLocale-C8Fc0cco.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/diagram-2AECGRRQ-DoDQ60wi.js +44 -0
- keboola_agent_cli/_ui_dist/assets/diagram-2AECGRRQ-DoDQ60wi.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/diagram-5GNKFQAL-CMGFxpUs.js +11 -0
- keboola_agent_cli/_ui_dist/assets/diagram-5GNKFQAL-CMGFxpUs.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/diagram-KO2AKTUF-1uGDa-Iu.js +4 -0
- keboola_agent_cli/_ui_dist/assets/diagram-KO2AKTUF-1uGDa-Iu.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/diagram-LMA3HP47-XtFH7B51.js +25 -0
- keboola_agent_cli/_ui_dist/assets/diagram-LMA3HP47-XtFH7B51.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/diagram-OG6HWLK6-B4_Te1T5.js +25 -0
- keboola_agent_cli/_ui_dist/assets/diagram-OG6HWLK6-B4_Te1T5.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/dist-Di6zmlv0.js +2 -0
- keboola_agent_cli/_ui_dist/assets/dist-Di6zmlv0.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/erDiagram-TEJ5UH35-NjQkrdFt.js +86 -0
- keboola_agent_cli/_ui_dist/assets/erDiagram-TEJ5UH35-NjQkrdFt.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/eventmodeling-FCH6USID-BrJMIks8.js +1 -0
- keboola_agent_cli/_ui_dist/assets/flowDiagram-I6XJVG4X-CIr8DWl7.js +163 -0
- keboola_agent_cli/_ui_dist/assets/flowDiagram-I6XJVG4X-CIr8DWl7.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/ganttDiagram-6RSMTGT7-C1VY_xbQ.js +293 -0
- keboola_agent_cli/_ui_dist/assets/ganttDiagram-6RSMTGT7-C1VY_xbQ.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/gitGraph-WXDBUCRP-COacYjo-.js +1 -0
- keboola_agent_cli/_ui_dist/assets/gitGraphDiagram-PVQCEYII-DQT8-kg2.js +107 -0
- keboola_agent_cli/_ui_dist/assets/gitGraphDiagram-PVQCEYII-DQT8-kg2.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/graphlib-B8gBHxth.js +2 -0
- keboola_agent_cli/_ui_dist/assets/graphlib-B8gBHxth.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/index-CMq50kkV.css +1 -0
- keboola_agent_cli/_ui_dist/assets/index-D8W97DAz.js +118 -0
- keboola_agent_cli/_ui_dist/assets/index-D8W97DAz.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/info-J43DQDTF-DdCTRIzU.js +1 -0
- keboola_agent_cli/_ui_dist/assets/infoDiagram-5YYISTIA-C77rsoTp.js +3 -0
- keboola_agent_cli/_ui_dist/assets/infoDiagram-5YYISTIA-C77rsoTp.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/init-D6jRqBbL.js +2 -0
- keboola_agent_cli/_ui_dist/assets/init-D6jRqBbL.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/ishikawaDiagram-YF4QCWOH-BcTbXaLy.js +71 -0
- keboola_agent_cli/_ui_dist/assets/ishikawaDiagram-YF4QCWOH-BcTbXaLy.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/journeyDiagram-JHISSGLW-BejeAJQ_.js +140 -0
- keboola_agent_cli/_ui_dist/assets/journeyDiagram-JHISSGLW-BejeAJQ_.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/kanban-definition-UN3LZRKU-BRNz_UrH.js +90 -0
- keboola_agent_cli/_ui_dist/assets/kanban-definition-UN3LZRKU-BRNz_UrH.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/katex-C4eR7coU.js +258 -0
- keboola_agent_cli/_ui_dist/assets/katex-C4eR7coU.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/line-CzAQKFbJ.js +2 -0
- keboola_agent_cli/_ui_dist/assets/line-CzAQKFbJ.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/linear-DUNFFdck.js +2 -0
- keboola_agent_cli/_ui_dist/assets/linear-DUNFFdck.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/mermaid-parser.core-CpuBOkFa.js +5 -0
- keboola_agent_cli/_ui_dist/assets/mermaid-parser.core-CpuBOkFa.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/mindmap-definition-RKZ34NQL-9EJQNjH0.js +97 -0
- keboola_agent_cli/_ui_dist/assets/mindmap-definition-RKZ34NQL-9EJQNjH0.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/ordinal-hYBb2elL.js +2 -0
- keboola_agent_cli/_ui_dist/assets/ordinal-hYBb2elL.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/packet-YPE3B663-DLiiw_B2.js +1 -0
- keboola_agent_cli/_ui_dist/assets/path-BWPyau1x.js +2 -0
- keboola_agent_cli/_ui_dist/assets/path-BWPyau1x.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/pie-LRSECV5Y-CRoO8G1g.js +1 -0
- keboola_agent_cli/_ui_dist/assets/pieDiagram-4H26LBE5-XH4cy6Cb.js +31 -0
- keboola_agent_cli/_ui_dist/assets/pieDiagram-4H26LBE5-XH4cy6Cb.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/quadrantDiagram-W4KKPZXB-fdhc93U8.js +8 -0
- keboola_agent_cli/_ui_dist/assets/quadrantDiagram-W4KKPZXB-fdhc93U8.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/radar-GUYGQ44K-DAlLVJHm.js +1 -0
- keboola_agent_cli/_ui_dist/assets/requirementDiagram-4Y6WPE33-a94eP3R9.js +85 -0
- keboola_agent_cli/_ui_dist/assets/requirementDiagram-4Y6WPE33-a94eP3R9.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/rough.esm-CSKSodPl.js +2 -0
- keboola_agent_cli/_ui_dist/assets/rough.esm-CSKSodPl.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/sankeyDiagram-5OEKKPKP-jcBa02sp.js +41 -0
- keboola_agent_cli/_ui_dist/assets/sankeyDiagram-5OEKKPKP-jcBa02sp.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/sequenceDiagram-3UESZ5HK-A5-GGM-e.js +163 -0
- keboola_agent_cli/_ui_dist/assets/sequenceDiagram-3UESZ5HK-A5-GGM-e.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/src-ZI-V_AF0.js +2 -0
- keboola_agent_cli/_ui_dist/assets/src-ZI-V_AF0.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/stateDiagram-AJRCARHV-BKAA5rqE.js +2 -0
- keboola_agent_cli/_ui_dist/assets/stateDiagram-AJRCARHV-BKAA5rqE.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/stateDiagram-v2-BHNVJYJU-DnJwJBsE.js +2 -0
- keboola_agent_cli/_ui_dist/assets/stateDiagram-v2-BHNVJYJU-DnJwJBsE.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/timeline-definition-PNZ67QCA-Cy39jp8b.js +121 -0
- keboola_agent_cli/_ui_dist/assets/timeline-definition-PNZ67QCA-Cy39jp8b.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/treeView-BLDUP644-DbLYl23-.js +1 -0
- keboola_agent_cli/_ui_dist/assets/treemap-LRROVOQU-Bp0eGlOt.js +1 -0
- keboola_agent_cli/_ui_dist/assets/vennDiagram-CIIHVFJN-BGECKubd.js +35 -0
- keboola_agent_cli/_ui_dist/assets/vennDiagram-CIIHVFJN-BGECKubd.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/wardley-L42UT6IY-D4yH4jqS.js +1 -0
- keboola_agent_cli/_ui_dist/assets/wardleyDiagram-YWT4CUSO-D6XRG3cZ.js +79 -0
- keboola_agent_cli/_ui_dist/assets/wardleyDiagram-YWT4CUSO-D6XRG3cZ.js.map +1 -0
- keboola_agent_cli/_ui_dist/assets/xychartDiagram-2RQKCTM6-DRre-pfZ.js +8 -0
- keboola_agent_cli/_ui_dist/assets/xychartDiagram-2RQKCTM6-DRre-pfZ.js.map +1 -0
- keboola_agent_cli/_ui_dist/index.html +50 -0
- keboola_agent_cli/ai_client.py +83 -0
- keboola_agent_cli/auto_update.py +550 -0
- keboola_agent_cli/changelog.py +1198 -0
- keboola_agent_cli/cli.py +448 -0
- keboola_agent_cli/client.py +3422 -0
- keboola_agent_cli/commands/__init__.py +0 -0
- keboola_agent_cli/commands/_data_app_git.py +343 -0
- keboola_agent_cli/commands/_helpers.py +377 -0
- keboola_agent_cli/commands/_metadata_input.py +49 -0
- keboola_agent_cli/commands/_semantic_layer_crud.py +632 -0
- keboola_agent_cli/commands/_semantic_layer_helpers.py +44 -0
- keboola_agent_cli/commands/_semantic_layer_reference_data.py +247 -0
- keboola_agent_cli/commands/agent.py +968 -0
- keboola_agent_cli/commands/branch.py +423 -0
- keboola_agent_cli/commands/changelog.py +168 -0
- keboola_agent_cli/commands/component.py +216 -0
- keboola_agent_cli/commands/config.py +2442 -0
- keboola_agent_cli/commands/context.py +1481 -0
- keboola_agent_cli/commands/data_app.py +1279 -0
- keboola_agent_cli/commands/dev_portal.py +584 -0
- keboola_agent_cli/commands/doctor.py +37 -0
- keboola_agent_cli/commands/encrypt.py +145 -0
- keboola_agent_cli/commands/feature.py +311 -0
- keboola_agent_cli/commands/flow.py +948 -0
- keboola_agent_cli/commands/http_client.py +157 -0
- keboola_agent_cli/commands/init.py +279 -0
- keboola_agent_cli/commands/job.py +661 -0
- keboola_agent_cli/commands/kai.py +301 -0
- keboola_agent_cli/commands/lineage.py +1464 -0
- keboola_agent_cli/commands/org.py +292 -0
- keboola_agent_cli/commands/permissions.py +360 -0
- keboola_agent_cli/commands/project.py +1192 -0
- keboola_agent_cli/commands/repl.py +243 -0
- keboola_agent_cli/commands/schedule.py +340 -0
- keboola_agent_cli/commands/search.py +178 -0
- keboola_agent_cli/commands/semantic_layer.py +939 -0
- keboola_agent_cli/commands/serve.py +272 -0
- keboola_agent_cli/commands/sharing.py +340 -0
- keboola_agent_cli/commands/storage.py +2630 -0
- keboola_agent_cli/commands/stream.py +266 -0
- keboola_agent_cli/commands/sync.py +1277 -0
- keboola_agent_cli/commands/tool.py +206 -0
- keboola_agent_cli/commands/version.py +186 -0
- keboola_agent_cli/commands/workspace.py +635 -0
- keboola_agent_cli/config_store.py +582 -0
- keboola_agent_cli/constants.py +528 -0
- keboola_agent_cli/data_science_client.py +342 -0
- keboola_agent_cli/dev_portal_client.py +323 -0
- keboola_agent_cli/errors.py +248 -0
- keboola_agent_cli/http_base.py +315 -0
- keboola_agent_cli/json_utils.py +126 -0
- keboola_agent_cli/lib.py +536 -0
- keboola_agent_cli/manage_client.py +324 -0
- keboola_agent_cli/metastore_client.py +214 -0
- keboola_agent_cli/models.py +427 -0
- keboola_agent_cli/output.py +1084 -0
- keboola_agent_cli/permissions.py +469 -0
- keboola_agent_cli/py.typed +3 -0
- keboola_agent_cli/result_models.py +271 -0
- keboola_agent_cli/server/__init__.py +34 -0
- keboola_agent_cli/server/agent_runner.py +1289 -0
- keboola_agent_cli/server/agents_store.py +325 -0
- keboola_agent_cli/server/app.py +764 -0
- keboola_agent_cli/server/auth.py +117 -0
- keboola_agent_cli/server/dependencies.py +149 -0
- keboola_agent_cli/server/pricing.py +303 -0
- keboola_agent_cli/server/routers/__init__.py +1 -0
- keboola_agent_cli/server/routers/agents.py +616 -0
- keboola_agent_cli/server/routers/ai_chat.py +129 -0
- keboola_agent_cli/server/routers/branches.py +133 -0
- keboola_agent_cli/server/routers/components.py +48 -0
- keboola_agent_cli/server/routers/configs.py +507 -0
- keboola_agent_cli/server/routers/data_apps.py +384 -0
- keboola_agent_cli/server/routers/dev_portal.py +67 -0
- keboola_agent_cli/server/routers/encrypt.py +35 -0
- keboola_agent_cli/server/routers/feature.py +179 -0
- keboola_agent_cli/server/routers/flows.py +204 -0
- keboola_agent_cli/server/routers/health.py +53 -0
- keboola_agent_cli/server/routers/jobs.py +175 -0
- keboola_agent_cli/server/routers/kai.py +80 -0
- keboola_agent_cli/server/routers/lineage.py +226 -0
- keboola_agent_cli/server/routers/mcp.py +70 -0
- keboola_agent_cli/server/routers/members.py +170 -0
- keboola_agent_cli/server/routers/org.py +96 -0
- keboola_agent_cli/server/routers/projects.py +106 -0
- keboola_agent_cli/server/routers/schedules.py +54 -0
- keboola_agent_cli/server/routers/search.py +30 -0
- keboola_agent_cli/server/routers/semantic_layer.py +650 -0
- keboola_agent_cli/server/routers/sharing.py +86 -0
- keboola_agent_cli/server/routers/storage.py +574 -0
- keboola_agent_cli/server/routers/stream.py +100 -0
- keboola_agent_cli/server/routers/workspaces.py +302 -0
- keboola_agent_cli/server/run_broadcaster.py +329 -0
- keboola_agent_cli/server/sse.py +25 -0
- keboola_agent_cli/services/__init__.py +0 -0
- keboola_agent_cli/services/_encryption.py +217 -0
- keboola_agent_cli/services/_semantic_layer_cascade.py +147 -0
- keboola_agent_cli/services/_semantic_layer_crud.py +382 -0
- keboola_agent_cli/services/_semantic_layer_internals.py +1078 -0
- keboola_agent_cli/services/_semantic_layer_lookup.py +181 -0
- keboola_agent_cli/services/_semantic_layer_reference_data.py +217 -0
- keboola_agent_cli/services/_sync_bindings.py +456 -0
- keboola_agent_cli/services/_sync_branch.py +191 -0
- keboola_agent_cli/services/_sync_bulk.py +228 -0
- keboola_agent_cli/services/_sync_clone.py +163 -0
- keboola_agent_cli/services/_sync_models.py +97 -0
- keboola_agent_cli/services/_sync_push_ops.py +369 -0
- keboola_agent_cli/services/_sync_storage.py +376 -0
- keboola_agent_cli/services/_sync_writeback.py +167 -0
- keboola_agent_cli/services/agent_service.py +458 -0
- keboola_agent_cli/services/base.py +175 -0
- keboola_agent_cli/services/branch_service.py +588 -0
- keboola_agent_cli/services/component_service.py +694 -0
- keboola_agent_cli/services/config_service.py +2099 -0
- keboola_agent_cli/services/data_app_git_service.py +224 -0
- keboola_agent_cli/services/data_app_service.py +2082 -0
- keboola_agent_cli/services/deep_lineage_service.py +1322 -0
- keboola_agent_cli/services/dev_portal_service.py +345 -0
- keboola_agent_cli/services/doctor_service.py +445 -0
- keboola_agent_cli/services/encrypt_service.py +87 -0
- keboola_agent_cli/services/feature_service.py +268 -0
- keboola_agent_cli/services/flow_service.py +769 -0
- keboola_agent_cli/services/flow_validation.py +188 -0
- keboola_agent_cli/services/http_forwarder_service.py +236 -0
- keboola_agent_cli/services/job_idempotency_store.py +285 -0
- keboola_agent_cli/services/job_service.py +797 -0
- keboola_agent_cli/services/kai_service.py +367 -0
- keboola_agent_cli/services/lineage_service.py +274 -0
- keboola_agent_cli/services/mcp_service.py +1498 -0
- keboola_agent_cli/services/mcp_transport.py +259 -0
- keboola_agent_cli/services/member_service.py +593 -0
- keboola_agent_cli/services/org_service.py +619 -0
- keboola_agent_cli/services/project_service.py +947 -0
- keboola_agent_cli/services/repo_validate_service.py +767 -0
- keboola_agent_cli/services/schedule_service.py +731 -0
- keboola_agent_cli/services/search_service.py +331 -0
- keboola_agent_cli/services/semantic_layer_service.py +1497 -0
- keboola_agent_cli/services/sharing_service.py +307 -0
- keboola_agent_cli/services/storage_service.py +2524 -0
- keboola_agent_cli/services/stream_service.py +395 -0
- keboola_agent_cli/services/sync_service.py +2244 -0
- keboola_agent_cli/services/variables_service.py +447 -0
- keboola_agent_cli/services/version_service.py +1038 -0
- keboola_agent_cli/services/workspace_service.py +1103 -0
- keboola_agent_cli/stream_client.py +217 -0
- keboola_agent_cli/sync/__init__.py +1 -0
- keboola_agent_cli/sync/branch_mapping.py +174 -0
- keboola_agent_cli/sync/clone.py +211 -0
- keboola_agent_cli/sync/code_extraction.py +655 -0
- keboola_agent_cli/sync/config_format.py +290 -0
- keboola_agent_cli/sync/diff_engine.py +566 -0
- keboola_agent_cli/sync/git_utils.py +93 -0
- keboola_agent_cli/sync/manifest.py +162 -0
- keboola_agent_cli/sync/naming.py +90 -0
- keboola_agent_cli/sync/secrets.py +62 -0
- keboola_agent_cli/sync/sql_split.py +134 -0
- keboola_cli-0.63.4.dist-info/METADATA +308 -0
- keboola_cli-0.63.4.dist-info/RECORD +306 -0
- keboola_cli-0.63.4.dist-info/WHEEL +4 -0
- keboola_cli-0.63.4.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dagre-BM42HDAG-UZ-9BTqF.js","assets/src-ZI-V_AF0.js","assets/chunk-CSCIHK7Q-CcTsLrFc.js","assets/chunk-O5CBEL6O-DxxqDH0l.js","assets/chunk-5ZQYHXKU-BjcTN7ul.js","assets/dist-Di6zmlv0.js","assets/dagre-Bx709z4p.js","assets/graphlib-B8gBHxth.js","assets/chunk-3OPIFGDE-BQC5CRHI.js","assets/chunk-L5ZTLDWV-B1Ky_e7O.js","assets/chunk-NZK2D7GU-tnrSoegS.js","assets/rough.esm-CSKSodPl.js","assets/chunk-BSJP7CBP-Oj_FO9Q7.js","assets/cose-bilkent-S5V4N54A-Y0L8LDMa.js","assets/cytoscape.esm-C8YCVR3_.js","assets/c4Diagram-AAUBKEIU-5Lh44evt.js","assets/chunk-ND2GUHAM-BHz1rpbm.js","assets/flowDiagram-I6XJVG4X-CIr8DWl7.js","assets/channel-DBMrXlxx.js","assets/chunk-2J33WTMH-Coy82EBh.js","assets/chunk-55IACEB6-BvR-6chF.js","assets/chunk-FMBD7UC4-FH-zLkkW.js","assets/erDiagram-TEJ5UH35-NjQkrdFt.js","assets/gitGraphDiagram-PVQCEYII-DQT8-kg2.js","assets/mermaid-parser.core-CpuBOkFa.js","assets/chunk-NNHCCRGN-DlpIbxXb.js","assets/chunk-4BX2VUAB-DUuEt70o.js","assets/chunk-QZHKN3VN-CSjc2gjj.js","assets/ganttDiagram-6RSMTGT7-C1VY_xbQ.js","assets/linear-DUNFFdck.js","assets/defaultLocale-C8Fc0cco.js","assets/init-D6jRqBbL.js","assets/infoDiagram-5YYISTIA-C77rsoTp.js","assets/pieDiagram-4H26LBE5-XH4cy6Cb.js","assets/path-BWPyau1x.js","assets/ordinal-hYBb2elL.js","assets/arc-DhFYIddx.js","assets/array-BifhSqXX.js","assets/quadrantDiagram-W4KKPZXB-fdhc93U8.js","assets/xychartDiagram-2RQKCTM6-DRre-pfZ.js","assets/line-CzAQKFbJ.js","assets/requirementDiagram-4Y6WPE33-a94eP3R9.js","assets/sequenceDiagram-3UESZ5HK-A5-GGM-e.js","assets/classDiagram-4FO5ZUOK-BuZcZu85.js","assets/chunk-727SXJPM-C0zxqqRN.js","assets/classDiagram-v2-Q7XG4LA2-BuZcZu85.js","assets/stateDiagram-AJRCARHV-BKAA5rqE.js","assets/chunk-AQP2D5EJ-CXf7rIlZ.js","assets/stateDiagram-v2-BHNVJYJU-DnJwJBsE.js","assets/journeyDiagram-JHISSGLW-BejeAJQ_.js","assets/timeline-definition-PNZ67QCA-Cy39jp8b.js","assets/mindmap-definition-RKZ34NQL-9EJQNjH0.js","assets/kanban-definition-UN3LZRKU-BRNz_UrH.js","assets/sankeyDiagram-5OEKKPKP-jcBa02sp.js","assets/diagram-LMA3HP47-XtFH7B51.js","assets/diagram-2AECGRRQ-DoDQ60wi.js","assets/blockDiagram-GPEHLZMM-DC7qY9i4.js","assets/diagram-5GNKFQAL-CMGFxpUs.js","assets/architectureDiagram-3BPJPVTR-C6hUlprM.js","assets/diagram-KO2AKTUF-1uGDa-Iu.js","assets/ishikawaDiagram-YF4QCWOH-BcTbXaLy.js","assets/vennDiagram-CIIHVFJN-BGECKubd.js","assets/diagram-OG6HWLK6-B4_Te1T5.js","assets/wardleyDiagram-YWT4CUSO-D6XRG3cZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as e,b as t,g as n,h as r,p as i,x as a,y as o}from"./src-ZI-V_AF0.js";import{$ as s,C as c,E as l,I as u,L as d,N as f,P as p,Q as m,S as h,T as g,V as _,W as v,X as y,Z as b,_ as x,b as S,c as C,et as w,g as T,l as E,m as D,n as O,p as k,q as ee,r as te,s as ne,t as A,u as j,x as M}from"./chunk-CSCIHK7Q-CcTsLrFc.js";import{$ as re,G as N,J as ie,K as ae,Q as oe,X as se,Y as ce,Z as le,a as ue,b as de,d as fe,et as pe,f as me,g as he,h as ge,i as _e,nt as ve,o as ye,q as be,rt as xe,tt as Se,u as Ce,v as we,y as Te}from"./chunk-5ZQYHXKU-BjcTN7ul.js";import{t as Ee}from"./line-CzAQKFbJ.js";import{i as De,n as Oe,r as ke,t as Ae}from"./chunk-BSJP7CBP-Oj_FO9Q7.js";import{n as je}from"./chunk-L5ZTLDWV-B1Ky_e7O.js";import{i as Me,n as Ne}from"./chunk-NZK2D7GU-tnrSoegS.js";import{i as Pe,n as Fe,o as Ie}from"./chunk-O5CBEL6O-DxxqDH0l.js";import{t as Le}from"./rough.esm-CSKSodPl.js";import{a as Re,i as ze,r as Be,s as Ve}from"./chunk-3OPIFGDE-BQC5CRHI.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var He=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ue=new class extends He{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},We={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ge=new class{#e=We;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Ke(e){setTimeout(e,0)}var qe=typeof window>`u`||`Deno`in globalThis;function Je(){}function Ye(e,t){return typeof e==`function`?e(t):e}function Xe(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ze(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Qe(e,t){return typeof e==`function`?e(t):e}function $e(e,t){return typeof e==`function`?e(t):e}function et(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==nt(o,t.options))return!1}else if(!it(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function tt(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(rt(t.options.mutationKey)!==rt(a))return!1}else if(!it(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function nt(e,t){return(t?.queryKeyHashFn||rt)(e)}function rt(e){return JSON.stringify(e,(e,t)=>lt(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function it(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>it(e[n],t[n])):!1}var at=Object.prototype.hasOwnProperty;function ot(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ct(e)&&ct(t);if(!r&&!(lt(e)&<(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:at.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ot(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function st(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ct(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function lt(e){if(!ut(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ut(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ut(e){return Object.prototype.toString.call(e)===`[object Object]`}function dt(e){return new Promise(t=>{Ge.setTimeout(t,e)})}function ft(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ot(e,t)}function pt(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function mt(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ht=Symbol();function gt(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ht?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function _t(e,t){return typeof e==`function`?e(...t):!!e}function vt(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var yt=(()=>{let e=()=>qe;return{isServer(){return e()},setIsServer(t){e=t}}})();function bt(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var xt=Ke;function St(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=xt,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Ct=St(),wt=new class extends He{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Tt(e){return Math.min(1e3*2**e,3e4)}function Et(e){return(e??`online`)===`online`?wt.isOnline():!0}var Dt=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Ot(e){let t=!1,n=0,r,i=bt(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Dt(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Ue.isFocused()&&(e.networkMode===`always`||wt.isOnline())&&e.canRun(),u=()=>Et(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(yt.isServer()?0:3),o=e.retryDelay??Tt,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),dt(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var kt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xe(this.gcTime)&&(this.#e=Ge.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(yt.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Ge.clearTimeout(this.#e),this.#e=void 0)}};function At(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{vt(e,()=>t.signal,()=>n=!0)},u=gt(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?mt:pt;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Mt:jt,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:jt(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function jt(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Mt(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Nt=class extends kt{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=It(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=It(this.options);e.data!==void 0&&(this.setState(Ft(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ft(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Je).catch(Je):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>$e(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ht||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Qe(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Ze(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=gt(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?At(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Ot({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Dt&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Dt){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Pt(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ft(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Ct.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Pt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Et(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ft(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function It(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Lt=class extends He{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=bt(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),zt(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Bt(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Bt(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof $e(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!st(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Vt(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||$e(this.options.enabled,this.#t)!==$e(t.enabled,this.#t)||Qe(this.options.staleTime,this.#t)!==Qe(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||$e(this.options.enabled,this.#t)!==$e(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ut(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Je)),t}#g(){this.#b();let e=Qe(this.options.staleTime,this.#t);if(yt.isServer()||this.#r.isStale||!Xe(e))return;let t=Ze(this.#r.dataUpdatedAt,e)+1;this.#d=Ge.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(yt.isServer()||$e(this.options.enabled,this.#t)===!1||!Xe(this.#p)||this.#p===0)&&(this.#f=Ge.setInterval(()=>{(this.options.refetchIntervalInBackground||Ue.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(Ge.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(Ge.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&zt(e,t),o=i&&Vt(e,n,t,r);(a||o)&&(l={...l,...Pt(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=ft(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=ft(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Ht(e,t),refetch:this.refetch,promise:this.#o,isEnabled:$e(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=bt())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!st(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Ct.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Rt(e,t){return $e(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&$e(t.retryOnMount,e)===!1)}function zt(e,t){return Rt(e,t)||e.state.data!==void 0&&Bt(e,t,t.refetchOnMount)}function Bt(e,t,n){if($e(t.enabled,e)!==!1&&Qe(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ht(e,t)}return!1}function Vt(e,t,n,r){return(e!==t||$e(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ht(e,n)}function Ht(e,t){return $e(t.enabled,e)!==!1&&e.isStaleByTime(Qe(t.staleTime,e))}function Ut(e,t){return!st(e.getCurrentResult(),t)}var Wt=class extends kt{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Gt(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Ot({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Ct.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Gt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var P=class extends He{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Wt({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Kt(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Kt(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Kt(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Kt(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Ct.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>tt(t,e))}findAll(e={}){return this.getAll().filter(t=>tt(e,t))}notify(e){Ct.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Ct.batch(()=>Promise.all(e.map(e=>e.continue().catch(Je))))}};function Kt(e){return e.options.scope?.id}var qt=class extends He{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),st(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&rt(t.mutationKey)!==rt(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Gt();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Ct.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Jt=class extends He{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??nt(r,t),a=this.get(i);return a||(a=new Nt({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Ct.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>et(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>et(e,t)):t}notify(e){Ct.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ct.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ct.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Yt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Jt,this.#t=e.mutationCache||new P,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ue.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=wt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Qe(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ye(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Ct.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Ct.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Ct.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Ct.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Je).catch(Je)}invalidateQueries(e,t={}){return Ct.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ct.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Je)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Je)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Qe(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Je).catch(Je)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Je).catch(Je)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return wt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(rt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{it(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(rt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{it(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=nt(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ht&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Xt=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function te(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+ee(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+ee(s,l);c+=te(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+ee(s,l++),c+=te(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function ne(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function A(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var j={current:null},M={transition:null},re={ReactCurrentDispatcher:j,ReactCurrentBatchConfig:M,ReactCurrentOwner:C};function N(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:ne,forEach:function(e,t,n){ne(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ne(e,function(){t++}),t},toArray:function(e){return ne(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=re,e.act=N,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:A}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=M.transition;M.transition={};try{e()}finally{M.transition=t}},e.unstable_act=N,e.useCallback=function(e,t){return j.current.useCallback(e,t)},e.useContext=function(e){return j.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return j.current.useDeferredValue(e)},e.useEffect=function(e,t){return j.current.useEffect(e,t)},e.useId=function(){return j.current.useId()},e.useImperativeHandle=function(e,t,n){return j.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return j.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return j.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return j.current.useMemo(e,t)},e.useReducer=function(e,t,n){return j.current.useReducer(e,t,n)},e.useRef=function(e){return j.current.useRef(e)},e.useState=function(e){return j.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return j.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return j.current.useTransition()},e.version=`18.3.1`})),Zt=o(((e,t)=>{t.exports=Xt()})),Qt=o((e=>{var t=Zt(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),$t=o(((e,t)=>{t.exports=Qt()})),F=a(Zt(),1),I=$t(),en=F.createContext(void 0),tn=e=>{let t=F.useContext(en);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},nn=({client:e,children:t})=>(F.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(en.Provider,{value:e,children:t})),rn=F.createContext(!1),an=()=>F.useContext(rn);rn.Provider;function on(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var sn=F.createContext(on()),cn=()=>F.useContext(sn),ln=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?_t(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},un=e=>{F.useEffect(()=>{e.clearReset()},[e])},dn=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||_t(n,[e.error,r])),fn=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},pn=(e,t)=>e.isLoading&&e.isFetching&&!t,mn=(e,t)=>e?.suspense&&t.isPending,hn=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function gn(e,t,n){let r=an(),i=cn(),a=tn(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,fn(o),ln(o,i,s),un(i);let c=!a.getQueryCache().get(o.queryHash),[l]=F.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(F.useSyncExternalStore(F.useCallback(e=>{let t=d?l.subscribe(Ct.batchCalls(e)):Je;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),F.useEffect(()=>{l.setOptions(o)},[o,l]),mn(o,u))throw hn(o,l,i);if(dn({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!yt.isServer()&&pn(u,r)&&(c?hn(o,l,i):s?.promise)?.catch(Je).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function L(e,t){return gn(e,Lt,t)}function R(e,t){let n=tn(t),[r]=F.useState(()=>new qt(n,e));F.useEffect(()=>{r.setOptions(e)},[r,e]);let i=F.useSyncExternalStore(F.useCallback(e=>r.subscribe(Ct.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=F.useCallback((e,t)=>{r.mutate(e,t).catch(Je)},[r]);if(i.error&&_t(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var _n=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,ne(x);else{var t=n(l);t!==null&&A(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&A(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=O,k=function(){te.postMessage(null)}}else k=function(){g(O,0)};function ne(e){C=e,S||(S=!0,k())}function A(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,ne(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,A(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ne(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),vn=o(((e,t)=>{t.exports=_n()})),yn=o((e=>{var t=Zt(),n=vn();function r(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 i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var _={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){_[e]=new g(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];_[t]=new g(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){_[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){_[e]=new g(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){_[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){_[e]=new g(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){_[e]=new g(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){_[e]=new g(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){_[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(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(v,y);_[t]=new g(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(v,y);_[t]=new g(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(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new g(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=_.hasOwnProperty(t)?_[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for(`react.element`),C=Symbol.for(`react.portal`),w=Symbol.for(`react.fragment`),T=Symbol.for(`react.strict_mode`),E=Symbol.for(`react.profiler`),D=Symbol.for(`react.provider`),O=Symbol.for(`react.context`),k=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),A=Symbol.for(`react.lazy`),j=Symbol.for(`react.offscreen`),M=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=M&&e[M]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Object.assign,ie;function ae(e){if(ie===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ie=t&&t[1]||``}return`
|
|
3
|
+
`+ie+e}var oe=!1;function se(e,t){if(!e||oe)return``;oe=!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(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
|
|
4
|
+
`),a=r.stack.split(`
|
|
5
|
+
`),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
|
|
6
|
+
`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{oe=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ae(e):``}function ce(e){switch(e.tag){case 5:return ae(e.type);case 16:return ae(`Lazy`);case 13:return ae(`Suspense`);case 19:return ae(`SuspenseList`);case 0:case 2:case 15:return e=se(e.type,!1),e;case 11:return e=se(e.type.render,!1),e;case 1:return e=se(e.type,!0),e;default:return``}}function le(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 w:return`Fragment`;case C:return`Portal`;case E:return`Profiler`;case T:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case O:return(e.displayName||`Context`)+`.Consumer`;case D:return(e._context.displayName||`Context`)+`.Provider`;case k:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?le(e.type)||`Memo`:t;case A:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}function ue(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`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return le(t);case 8:return t===T?`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 de(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function fe(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function pe(e){var t=fe(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function me(e){e._valueTracker||=pe(e)}function he(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=fe(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function ge(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function _e(e,t){var n=t.checked;return N({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ve(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=de(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function ye(e,t){t=t.checked,t!=null&&b(e,`checked`,t,!1)}function be(e,t){ye(e,t);var n=de(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?Se(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&Se(e,t.type,de(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function xe(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function Se(e,t,n){(t!==`number`||ge(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var Ce=Array.isArray;function we(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+de(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Te(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(r(91));return N({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function Ee(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(r(92));if(Ce(n)){if(1<n.length)throw Error(r(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:de(n)}}function De(e,t){var n=de(t.value),r=de(t.defaultValue);n!=null&&(n=``+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=``+r)}function Oe(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function ke(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 Ae(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?ke(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var je,Me=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(je||=document.createElement(`div`),je.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=je.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ne(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pe={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Fe=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Pe).forEach(function(e){Fe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pe[t]=Pe[e]})});function Ie(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Pe.hasOwnProperty(e)&&Pe[e]?(``+t).trim():t+`px`}function Le(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=Ie(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Re=N({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 ze(e,t){if(t){if(Re[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Be(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 Ve=null;function He(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ue=null,We=null,Ge=null;function Ke(e){if(e=zi(e)){if(typeof Ue!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Vi(t),Ue(e.stateNode,e.type,t))}}function qe(e){We?Ge?Ge.push(e):Ge=[e]:We=e}function Je(){if(We){var e=We,t=Ge;if(Ge=We=null,Ke(e),t)for(e=0;e<t.length;e++)Ke(t[e])}}function Ye(e,t){return e(t)}function Xe(){}var Ze=!1;function Qe(e,t,n){if(Ze)return e(t,n);Ze=!0;try{return Ye(e,t,n)}finally{Ze=!1,(We!==null||Ge!==null)&&(Xe(),Je())}}function $e(e,t){var n=e.stateNode;if(n===null)return null;var i=Vi(n);if(i===null)return null;n=i[t];a: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 a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(r(231,t,typeof n));return n}var et=!1;if(c)try{var tt={};Object.defineProperty(tt,"passive",{get:function(){et=!0}}),window.addEventListener(`test`,tt,tt),window.removeEventListener(`test`,tt,tt)}catch{et=!1}function nt(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var rt=!1,it=null,at=!1,ot=null,st={onError:function(e){rt=!0,it=e}};function ct(e,t,n,r,i,a,o,s,c){rt=!1,it=null,nt.apply(st,arguments)}function lt(e,t,n,i,a,o,s,c,l){if(ct.apply(this,arguments),rt){if(rt){var u=it;rt=!1,it=null}else throw Error(r(198));at||(at=!0,ot=u)}}function ut(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function dt(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 ft(e){if(ut(e)!==e)throw Error(r(188))}function pt(e){var t=e.alternate;if(!t){if(t=ut(e),t===null)throw Error(r(188));return t===e?e:null}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return ft(a),e;if(o===i)return ft(a),t;o=o.sibling}throw Error(r(188))}if(n.return!==i.return)n=a,i=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,i=o;break}if(c===i){s=!0,i=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,i=a;break}if(c===i){s=!0,i=o,n=a;break}c=c.sibling}if(!s)throw Error(r(189))}}if(n.alternate!==i)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function mt(e){return e=pt(e),e===null?null:ht(e)}function ht(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ht(e);if(t!==null)return t;e=e.sibling}return null}var gt=n.unstable_scheduleCallback,_t=n.unstable_cancelCallback,vt=n.unstable_shouldYield,yt=n.unstable_requestPaint,bt=n.unstable_now,xt=n.unstable_getCurrentPriorityLevel,St=n.unstable_ImmediatePriority,Ct=n.unstable_UserBlockingPriority,wt=n.unstable_NormalPriority,Tt=n.unstable_LowPriority,Et=n.unstable_IdlePriority,Dt=null,Ot=null;function kt(e){if(Ot&&typeof Ot.onCommitFiberRoot==`function`)try{Ot.onCommitFiberRoot(Dt,e,void 0,(e.current.flags&128)==128)}catch{}}var At=Math.clz32?Math.clz32:Nt,jt=Math.log,Mt=Math.LN2;function Nt(e){return e>>>=0,e===0?32:31-(jt(e)/Mt|0)|0}var Pt=64,Ft=4194304;function It(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 Lt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=It(a))):r=It(s)}else o=n&~i,o===0?a!==0&&(r=It(a)):r=It(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-At(t),i=1<<n,r|=e[n],t&=~i;return r}function Rt(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 zt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-At(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Rt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Bt(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function Vt(){var e=Pt;return Pt<<=1,!(Pt&4194240)&&(Pt=64),e}function Ht(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ut(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-At(t),e[t]=n}function Wt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-At(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function Gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-At(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var P=0;function Kt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var qt,Jt,Yt,Xt,Qt,$t=!1,F=[],I=null,en=null,tn=null,nn=new Map,rn=new Map,an=[],on=`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 sn(e,t){switch(e){case`focusin`:case`focusout`:I=null;break;case`dragenter`:case`dragleave`:en=null;break;case`mouseover`:case`mouseout`:tn=null;break;case`pointerover`:case`pointerout`:nn.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:rn.delete(t.pointerId)}}function cn(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=zi(t),t!==null&&Jt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function ln(e,t,n,r,i){switch(t){case`focusin`:return I=cn(I,e,t,n,r,i),!0;case`dragenter`:return en=cn(en,e,t,n,r,i),!0;case`mouseover`:return tn=cn(tn,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return nn.set(a,cn(nn.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,rn.set(a,cn(rn.get(a)||null,e,t,n,r,i)),!0}return!1}function un(e){var t=Ri(e.target);if(t!==null){var n=ut(t);if(n!==null){if(t=n.tag,t===13){if(t=dt(n),t!==null){e.blockedOn=t,Qt(e.priority,function(){Yt(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 dn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ve=r,n.target.dispatchEvent(r),Ve=null}else return t=zi(n),t!==null&&Jt(t),e.blockedOn=n,!1;t.shift()}return!0}function fn(e,t,n){dn(e)&&n.delete(t)}function pn(){$t=!1,I!==null&&dn(I)&&(I=null),en!==null&&dn(en)&&(en=null),tn!==null&&dn(tn)&&(tn=null),nn.forEach(fn),rn.forEach(fn)}function mn(e,t){e.blockedOn===t&&(e.blockedOn=null,$t||($t=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,pn)))}function hn(e){function t(t){return mn(t,e)}if(0<F.length){mn(F[0],e);for(var n=1;n<F.length;n++){var r=F[n];r.blockedOn===e&&(r.blockedOn=null)}}for(I!==null&&mn(I,e),en!==null&&mn(en,e),tn!==null&&mn(tn,e),nn.forEach(t),rn.forEach(t),n=0;n<an.length;n++)r=an[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<an.length&&(n=an[0],n.blockedOn===null);)un(n),n.blockedOn===null&&an.shift()}var gn=x.ReactCurrentBatchConfig,L=!0;function R(e,t,n,r){var i=P,a=gn.transition;gn.transition=null;try{P=1,yn(e,t,n,r)}finally{P=i,gn.transition=a}}function _n(e,t,n,r){var i=P,a=gn.transition;gn.transition=null;try{P=4,yn(e,t,n,r)}finally{P=i,gn.transition=a}}function yn(e,t,n,r){if(L){var i=xn(e,t,n,r);if(i===null)pi(e,t,r,bn,n),sn(e,r);else if(ln(i,e,t,n,r))r.stopPropagation();else if(sn(e,r),t&4&&-1<on.indexOf(e)){for(;i!==null;){var a=zi(i);if(a!==null&&qt(a),a=xn(e,t,n,r),a===null&&pi(e,t,r,bn,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else pi(e,t,r,null,n)}}var bn=null;function xn(e,t,n,r){if(bn=null,e=He(r),e=Ri(e),e!==null)if(t=ut(e),t===null)e=null;else if(n=t.tag,n===13){if(e=dt(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 bn=e,null}function Sn(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(xt()){case St:return 1;case Ct:return 4;case wt:case Tt:return 16;case Et:return 536870912;default:return 16}default:return 16}}var Cn=null,wn=null,Tn=null;function z(){if(Tn)return Tn;var e,t=wn,n=t.length,r,i=`value`in Cn?Cn.value:Cn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Tn=i.slice(e,1<r?1-r:void 0)}function En(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 Dn(){return!0}function On(){return!1}function kn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Dn:On,this.isPropagationStopped=On,this}return N(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Dn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Dn)},persist:function(){},isPersistent:Dn}),t}var An={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jn=kn(An),Mn=N({},An,{view:0,detail:0}),Nn=kn(Mn),Pn,Fn,In,Ln=N({},Mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jn,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!==In&&(In&&e.type===`mousemove`?(Pn=e.screenX-In.screenX,Fn=e.screenY-In.screenY):Fn=Pn=0,In=e),Pn)},movementY:function(e){return`movementY`in e?e.movementY:Fn}}),Rn=kn(Ln),zn=kn(N({},Ln,{dataTransfer:0})),Bn=kn(N({},Mn,{relatedTarget:0})),Vn=kn(N({},An,{animationName:0,elapsedTime:0,pseudoElement:0})),Hn=kn(N({},An,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Un=kn(N({},An,{data:0})),Wn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Gn={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`},Kn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kn[e])?!!t[e]:!1}function Jn(){return qn}var Yn=kn(N({},Mn,{key:function(e){if(e.key){var t=Wn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=En(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Gn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jn,charCode:function(e){return e.type===`keypress`?En(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?En(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Xn=kn(N({},Ln,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Zn=kn(N({},Mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jn})),Qn=kn(N({},An,{propertyName:0,elapsedTime:0,pseudoElement:0})),$n=kn(N({},Ln,{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})),er=[9,13,27,32],tr=c&&`CompositionEvent`in window,nr=null;c&&`documentMode`in document&&(nr=document.documentMode);var rr=c&&`TextEvent`in window&&!nr,ir=c&&(!tr||nr&&8<nr&&11>=nr),ar=` `,or=!1;function sr(e,t){switch(e){case`keyup`:return er.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function cr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var lr=!1;function ur(e,t){switch(e){case`compositionend`:return cr(t);case`keypress`:return t.which===32?(or=!0,ar):null;case`textInput`:return e=t.data,e===ar&&or?null:e;default:return null}}function dr(e,t){if(lr)return e===`compositionend`||!tr&&sr(e,t)?(e=z(),Tn=wn=Cn=null,lr=!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 ir&&t.locale!==`ko`?null:t.data;default:return null}}var fr={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 pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!fr[e.type]:t===`textarea`}function mr(e,t,n,r){qe(r),t=hi(t,`onChange`),0<t.length&&(n=new jn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var hr=null,gr=null;function _r(e){si(e,0)}function vr(e){if(he(Bi(e)))return e}function yr(e,t){if(e===`change`)return t}var br=!1;if(c){var xr;if(c){var Sr=`oninput`in document;if(!Sr){var Cr=document.createElement(`div`);Cr.setAttribute(`oninput`,`return;`),Sr=typeof Cr.oninput==`function`}xr=Sr}else xr=!1;br=xr&&(!document.documentMode||9<document.documentMode)}function wr(){hr&&(hr.detachEvent(`onpropertychange`,Tr),gr=hr=null)}function Tr(e){if(e.propertyName===`value`&&vr(gr)){var t=[];mr(t,gr,e,He(e)),Qe(_r,t)}}function Er(e,t,n){e===`focusin`?(wr(),hr=t,gr=n,hr.attachEvent(`onpropertychange`,Tr)):e===`focusout`&&wr()}function Dr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return vr(gr)}function Or(e,t){if(e===`click`)return vr(t)}function kr(e,t){if(e===`input`||e===`change`)return vr(t)}function Ar(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var jr=typeof Object.is==`function`?Object.is:Ar;function Mr(e,t){if(jr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!jr(e[i],t[i]))return!1}return!0}function Nr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pr(e,t){var n=Nr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Nr(n)}}function Fr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ir(){for(var e=window,t=ge();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ge(e.document)}return t}function Lr(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 Rr(e){var t=Ir(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Fr(n.ownerDocument.documentElement,n)){if(r!==null&&Lr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Pr(n,a);var o=Pr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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 zr=c&&`documentMode`in document&&11>=document.documentMode,Br=null,Vr=null,Hr=null,Ur=!1;function Wr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ur||Br==null||Br!==ge(r)||(r=Br,`selectionStart`in r&&Lr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hr&&Mr(Hr,r)||(Hr=r,r=hi(Vr,`onSelect`),0<r.length&&(t=new jn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Br)))}function Gr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Kr={animationend:Gr(`Animation`,`AnimationEnd`),animationiteration:Gr(`Animation`,`AnimationIteration`),animationstart:Gr(`Animation`,`AnimationStart`),transitionend:Gr(`Transition`,`TransitionEnd`)},qr={},Jr={};c&&(Jr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Kr.animationend.animation,delete Kr.animationiteration.animation,delete Kr.animationstart.animation),`TransitionEvent`in window||delete Kr.transitionend.transition);function Yr(e){if(qr[e])return qr[e];if(!Kr[e])return e;var t=Kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Jr)return qr[e]=t[n];return e}var Xr=Yr(`animationend`),Zr=Yr(`animationiteration`),Qr=Yr(`animationstart`),$r=Yr(`transitionend`),ei=new Map,ti=`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 ni(e,t){ei.set(e,t),o(t,[e])}for(var ri=0;ri<ti.length;ri++){var B=ti[ri];ni(B.toLowerCase(),`on`+(B[0].toUpperCase()+B.slice(1)))}ni(Xr,`onAnimationEnd`),ni(Zr,`onAnimationIteration`),ni(Qr,`onAnimationStart`),ni(`dblclick`,`onDoubleClick`),ni(`focusin`,`onFocus`),ni(`focusout`,`onBlur`),ni($r,`onTransitionEnd`),s(`onMouseEnter`,[`mouseout`,`mouseover`]),s(`onMouseLeave`,[`mouseout`,`mouseover`]),s(`onPointerEnter`,[`pointerout`,`pointerover`]),s(`onPointerLeave`,[`pointerout`,`pointerover`]),o(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),o(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),o(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),o(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),o(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var ii=`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(` `),ai=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ii));function oi(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,lt(r,t,void 0,e),e.currentTarget=null}function si(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;oi(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;oi(i,s,l),a=c}}}if(at)throw e=ot,at=!1,ot=null,e}function ci(e,t){var n=t[Fi];n===void 0&&(n=t[Fi]=new Set);var r=e+`__bubble`;n.has(r)||(fi(t,e,2,!1),n.add(r))}function li(e,t,n){var r=0;t&&(r|=4),fi(n,e,r,t)}var ui=`_reactListening`+Math.random().toString(36).slice(2);function di(e){if(!e[ui]){e[ui]=!0,i.forEach(function(t){t!==`selectionchange`&&(ai.has(t)||li(t,!1,e),li(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ui]||(t[ui]=!0,li(`selectionchange`,!1,t))}}function fi(e,t,n,r){switch(Sn(t)){case 1:var i=R;break;case 4:i=_n;break;default:i=yn}n=i.bind(null,t,n,e),i=void 0,!et||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function pi(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Ri(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}Qe(function(){var r=a,i=He(n),o=[];a:{var s=ei.get(e);if(s!==void 0){var c=jn,l=e;switch(e){case`keypress`:if(En(n)===0)break a;case`keydown`:case`keyup`:c=Yn;break;case`focusin`:l=`focus`,c=Bn;break;case`focusout`:l=`blur`,c=Bn;break;case`beforeblur`:case`afterblur`:c=Bn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Rn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=zn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Zn;break;case Xr:case Zr:case Qr:c=Vn;break;case $r:c=Qn;break;case`scroll`:c=Nn;break;case`wheel`:c=$n;break;case`copy`:case`cut`:case`paste`:c=Hn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Xn}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=$e(p,f),h!=null&&u.push(mi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Ve&&(l=n.relatedTarget||n.fromElement)&&(Ri(l)||l[Pi]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Ri(l):null,l!==null&&(d=ut(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=Rn,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Xn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Bi(c),m=l==null?s:Bi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Ri(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=gi(m))p++;for(m=0,h=f;h;h=gi(h))m++;for(;0<p-m;)u=gi(u),p--;for(;0<m-p;)f=gi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=gi(u),f=gi(f)}u=null}else u=null;c!==null&&_i(o,s,c,u,!1),l!==null&&d!==null&&_i(o,d,l,u,!0)}}a:{if(s=r?Bi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=yr;else if(pr(s))if(br)g=kr;else{g=Dr;var _=Er}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Or);if(g&&=g(e,r)){mr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&Se(s,`number`,s.value)}switch(_=r?Bi(r):window,e){case`focusin`:(pr(_)||_.contentEditable===`true`)&&(Br=_,Vr=r,Hr=null);break;case`focusout`:Hr=Vr=Br=null;break;case`mousedown`:Ur=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ur=!1,Wr(o,n,i);break;case`selectionchange`:if(zr)break;case`keydown`:case`keyup`:Wr(o,n,i)}var v;if(tr)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else lr?sr(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(ir&&n.locale!==`ko`&&(lr||y!==`onCompositionStart`?y===`onCompositionEnd`&&lr&&(v=z()):(Cn=i,wn=`value`in Cn?Cn.value:Cn.textContent,lr=!0)),_=hi(r,y),0<_.length&&(y=new Un(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=cr(n),v!==null&&(y.data=v)))),(v=rr?ur(e,n):dr(e,n))&&(r=hi(r,`onBeforeInput`),0<r.length&&(i=new Un(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}si(o,t)})}function mi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function hi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=$e(e,n),a!=null&&r.unshift(mi(e,a,i)),a=$e(e,t),a!=null&&r.push(mi(e,a,i))),e=e.return}return r}function gi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _i(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=$e(n,a),c!=null&&o.unshift(mi(n,c,s))):i||(c=$e(n,a),c!=null&&o.push(mi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var vi=/\r\n?/g,yi=/\u0000|\uFFFD/g;function bi(e){return(typeof e==`string`?e:``+e).replace(vi,`
|
|
7
|
+
`).replace(yi,``)}function xi(e,t,n){if(t=bi(t),bi(e)!==t&&n)throw Error(r(425))}function Si(){}var Ci=null,wi=null;function Ti(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 Ei=typeof setTimeout==`function`?setTimeout:void 0,Di=typeof clearTimeout==`function`?clearTimeout:void 0,Oi=typeof Promise==`function`?Promise:void 0,ki=typeof queueMicrotask==`function`?queueMicrotask:Oi===void 0?Ei:function(e){return Oi.resolve(null).then(e).catch(Ai)};function Ai(e){setTimeout(function(){throw e})}function ji(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),hn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);hn(t)}function V(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 Mi(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 Ni=Math.random().toString(36).slice(2),H=`__reactFiber$`+Ni,U=`__reactProps$`+Ni,Pi=`__reactContainer$`+Ni,Fi=`__reactEvents$`+Ni,Ii=`__reactListeners$`+Ni,Li=`__reactHandles$`+Ni;function Ri(e){var t=e[H];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Pi]||n[H]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Mi(e);e!==null;){if(n=e[H])return n;e=Mi(e)}return t}e=n,n=e.parentNode}return null}function zi(e){return e=e[H]||e[Pi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Bi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(r(33))}function Vi(e){return e[U]||null}var Hi=[],Ui=-1;function Wi(e){return{current:e}}function Gi(e){0>Ui||(e.current=Hi[Ui],Hi[Ui]=null,Ui--)}function Ki(e,t){Ui++,Hi[Ui]=e.current,e.current=t}var qi={},Ji=Wi(qi),Yi=Wi(!1),Xi=qi;function Zi(e,t){var n=e.type.contextTypes;if(!n)return qi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Qi(e){return e=e.childContextTypes,e!=null}function $i(){Gi(Yi),Gi(Ji)}function ea(e,t,n){if(Ji.current!==qi)throw Error(r(168));Ki(Ji,t),Ki(Yi,n)}function ta(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,ue(e)||`Unknown`,a));return N({},n,i)}function na(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qi,Xi=Ji.current,Ki(Ji,e),Ki(Yi,Yi.current),!0}function ra(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=ta(e,t,Xi),i.__reactInternalMemoizedMergedChildContext=e,Gi(Yi),Gi(Ji),Ki(Ji,e)):Gi(Yi),Ki(Yi,n)}var ia=null,aa=!1,oa=!1;function sa(e){ia===null?ia=[e]:ia.push(e)}function ca(e){aa=!0,sa(e)}function la(){if(!oa&&ia!==null){oa=!0;var e=0,t=P;try{var n=ia;for(P=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ia=null,aa=!1}catch(t){throw ia!==null&&(ia=ia.slice(e+1)),gt(St,la),t}finally{P=t,oa=!1}}return null}var ua=[],da=0,fa=null,pa=0,ma=[],ha=0,ga=null,_a=1,va=``;function ya(e,t){ua[da++]=pa,ua[da++]=fa,fa=e,pa=t}function ba(e,t,n){ma[ha++]=_a,ma[ha++]=va,ma[ha++]=ga,ga=e;var r=_a;e=va;var i=32-At(r)-1;r&=~(1<<i),n+=1;var a=32-At(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,_a=1<<32-At(t)+i|n<<i|r,va=a+e}else _a=1<<a|n<<i|r,va=e}function xa(e){e.return!==null&&(ya(e,1),ba(e,1,0))}function Sa(e){for(;e===fa;)fa=ua[--da],ua[da]=null,pa=ua[--da],ua[da]=null;for(;e===ga;)ga=ma[--ha],ma[ha]=null,va=ma[--ha],ma[ha]=null,_a=ma[--ha],ma[ha]=null}var Ca=null,wa=null,Ta=!1,Ea=null;function Da(e,t){var n=Yl(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 Oa(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?!1:(e.stateNode=t,Ca=e,wa=V(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,Ca=e,wa=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=ga===null?null:{id:_a,overflow:va},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Yl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ca=e,wa=null,!0);default:return!1}}function ka(e){return(e.mode&1)!=0&&(e.flags&128)==0}function Aa(e){if(Ta){var t=wa;if(t){var n=t;if(!Oa(e,t)){if(ka(e))throw Error(r(418));t=V(n.nextSibling);var i=Ca;t&&Oa(e,t)?Da(i,n):(e.flags=e.flags&-4097|2,Ta=!1,Ca=e)}}else{if(ka(e))throw Error(r(418));e.flags=e.flags&-4097|2,Ta=!1,Ca=e}}}function ja(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ca=e}function Ma(e){if(e!==Ca)return!1;if(!Ta)return ja(e),Ta=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!Ti(e.type,e.memoizedProps)),t&&=wa){if(ka(e))throw Na(),Error(r(418));for(;t;)Da(e,t),t=V(t.nextSibling)}if(ja(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(r(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){wa=V(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}wa=null}}else wa=Ca?V(e.stateNode.nextSibling):null;return!0}function Na(){for(var e=wa;e;)e=V(e.nextSibling)}function Pa(){wa=Ca=null,Ta=!1}function Fa(e){Ea===null?Ea=[e]:Ea.push(e)}var Ia=x.ReactCurrentBatchConfig;function La(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(r(309));var i=n.stateNode}if(!i)throw Error(r(147,e));var a=i,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(r(284));if(!n._owner)throw Error(r(290,e))}return e}function Ra(e,t){throw e=Object.prototype.toString.call(t),Error(r(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function za(e){var t=e._init;return t(e._payload)}function Ba(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=Ql(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=nu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===w?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===A&&za(i)===t.type)?(r=a(t,n.props),r.ref=La(e,t,n),r.return=e,r):(r=$l(n.type,n.key,n.props,null,e.mode,r),r.ref=La(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ru(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=eu(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=nu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case S:return n=$l(t.type,t.key,t.props,null,e.mode,n),n.ref=La(e,null,t),n.return=e,n;case C:return t=ru(t,e.mode,n),t.return=e,t;case A:var r=t._init;return f(e,r(t._payload),n)}if(Ce(t)||re(t))return t=eu(t,e.mode,n,null),t.return=e,t;Ra(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case S:return n.key===i?l(e,t,n,r):null;case C:return n.key===i?u(e,t,n,r):null;case A:return i=n._init,p(e,t,i(n._payload),r)}if(Ce(n)||re(n))return i===null?d(e,t,n,r,null):null;Ra(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case S:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case C:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case A:var a=r._init;return m(e,t,n,a(r._payload),i)}if(Ce(r)||re(r))return e=e.get(n)||null,d(t,e,r,i,null);Ra(t,r)}return null}function h(r,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),Ta&&ya(r,h),l;if(d===null){for(;h<s.length;h++)d=f(r,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ta&&ya(r,h),l}for(d=i(r,d);h<s.length;h++)g=m(d,r,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(r,e)}),Ta&&ya(r,h),l}function g(a,s,c,l){var u=re(c);if(typeof u!=`function`)throw Error(r(150));if(c=u.call(c),c==null)throw Error(r(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ta&&ya(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ta&&ya(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ta&&ya(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===w&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case S:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===w){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===A&&za(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=La(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===w?(r=eu(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=$l(i.type,i.key,i.props,null,e.mode,o),o.ref=La(e,r,i),o.return=e,e=o)}return s(e);case C:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=ru(i,e.mode,o),r.return=e,e=r}return s(e);case A:return l=i._init,_(e,r,l(i._payload),o)}if(Ce(i))return h(e,r,i,o);if(re(i))return g(e,r,i,o);Ra(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=nu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Va=Ba(!0),Ha=Ba(!1),Ua=Wi(null),Wa=null,Ga=null,Ka=null;function qa(){Ka=Ga=Wa=null}function Ja(e){var t=Ua.current;Gi(Ua),e._currentValue=t}function Ya(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Xa(e,t){Wa=e,Ka=Ga=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Fs=!0),e.firstContext=null)}function Za(e){var t=e._currentValue;if(Ka!==e)if(e={context:e,memoizedValue:t,next:null},Ga===null){if(Wa===null)throw Error(r(308));Ga=e,Wa.dependencies={lanes:0,firstContext:e}}else Ga=Ga.next=e;return t}var Qa=null;function $a(e){Qa===null?Qa=[e]:Qa.push(e)}function eo(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,$a(t)):(n.next=i.next,i.next=n),t.interleaved=n,to(e,r)}function to(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 no=!1;function ro(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function io(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 ao(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function oo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,to(e,n)}return i=r.interleaved,i===null?(t.next=t,$a(r)):(t.next=i.next,i.next=t),r.interleaved=t,to(e,n)}function so(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Gt(e,n)}}function co(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function lo(e,t,n,r){var i=e.updateQueue;no=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=N({},d,f);break a;case 2:no=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Zc|=o,e.lanes=o,e.memoizedState=d}}function uo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=n,typeof a!=`function`)throw Error(r(191,a));a.call(i)}}}var fo={},po=Wi(fo),mo=Wi(fo),ho=Wi(fo);function W(e){if(e===fo)throw Error(r(174));return e}function G(e,t){switch(Ki(ho,t),Ki(mo,e),Ki(po,fo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ae(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ae(t,e)}Gi(po),Ki(po,t)}function K(){Gi(po),Gi(mo),Gi(ho)}function go(e){W(ho.current);var t=W(po.current),n=Ae(t,e.type);t!==n&&(Ki(mo,e),Ki(po,n))}function _o(e){mo.current===e&&(Gi(po),Gi(mo))}var q=Wi(0);function vo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data===`$?`||n.data===`$!`))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var J=[];function yo(){for(var e=0;e<J.length;e++)J[e]._workInProgressVersionPrimary=null;J.length=0}var bo=x.ReactCurrentDispatcher,xo=x.ReactCurrentBatchConfig,So=0,Co=null,wo=null,To=null,Eo=!1,Do=!1,Oo=0,ko=0;function Ao(){throw Error(r(321))}function jo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!jr(e[n],t[n]))return!1;return!0}function Mo(e,t,n,i,a,o){if(So=o,Co=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,bo.current=e===null||e.memoizedState===null?hs:gs,e=n(i,a),Do){o=0;do{if(Do=!1,Oo=0,25<=o)throw Error(r(301));o+=1,To=wo=null,t.updateQueue=null,bo.current=_s,e=n(i,a)}while(Do)}if(bo.current=ms,t=wo!==null&&wo.next!==null,So=0,To=wo=Co=null,Eo=!1,t)throw Error(r(300));return e}function No(){var e=Oo!==0;return Oo=0,e}function Po(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return To===null?Co.memoizedState=To=e:To=To.next=e,To}function Fo(){if(wo===null){var e=Co.alternate;e=e===null?null:e.memoizedState}else e=wo.next;var t=To===null?Co.memoizedState:To.next;if(t!==null)To=t,wo=e;else{if(e===null)throw Error(r(310));wo=e,e={memoizedState:wo.memoizedState,baseState:wo.baseState,baseQueue:wo.baseQueue,queue:wo.queue,next:null},To===null?Co.memoizedState=To=e:To=To.next=e}return To}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){var t=Fo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=wo,a=i.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}i.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,i=i.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((So&d)===d)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(c=l=f,s=i):l=l.next=f,Co.lanes|=d,Zc|=d}u=u.next}while(u!==null&&u!==o);l===null?s=i:l.next=c,jr(i,t.memoizedState)||(Fs=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=l,n.lastRenderedState=i}if(e=n.interleaved,e!==null){a=e;do o=a.lane,Co.lanes|=o,Zc|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ro(e){var t=Fo(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);jr(o,t.memoizedState)||(Fs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function zo(){}function Bo(e,t){var n=Co,i=Fo(),a=t(),o=!jr(i.memoizedState,a);if(o&&(i.memoizedState=a,Fs=!0),i=i.queue,Qo(Uo.bind(null,n,i,e),[e]),i.getSnapshot!==t||o||To!==null&&To.memoizedState.tag&1){if(n.flags|=2048,qo(9,Ho.bind(null,n,i,a,t),void 0,null),Wc===null)throw Error(r(349));So&30||Vo(n,t,a)}return a}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Co.updateQueue,t===null?(t={lastEffect:null,stores:null},Co.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jr(e,n)}catch{return!0}}function Go(e){var t=to(e,1);t!==null&&_l(t,e,1,-1)}function Ko(e){var t=Po();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t.queue=e,e=e.dispatch=us.bind(null,Co,e),[t.memoizedState,e]}function qo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Co.updateQueue,t===null?(t={lastEffect:null,stores:null},Co.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Jo(){return Fo().memoizedState}function Yo(e,t,n,r){var i=Po();Co.flags|=e,i.memoizedState=qo(1|t,n,void 0,r===void 0?null:r)}function Xo(e,t,n,r){var i=Fo();r=r===void 0?null:r;var a=void 0;if(wo!==null){var o=wo.memoizedState;if(a=o.destroy,r!==null&&jo(r,o.deps)){i.memoizedState=qo(t,n,a,r);return}}Co.flags|=e,i.memoizedState=qo(1|t,n,a,r)}function Zo(e,t){return Yo(8390656,8,e,t)}function Qo(e,t){return Xo(2048,8,e,t)}function $o(e,t){return Xo(4,2,e,t)}function es(e,t){return Xo(4,4,e,t)}function ts(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 ns(e,t,n){return n=n==null?null:n.concat([e]),Xo(4,4,ts.bind(null,t,e),n)}function rs(){}function is(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function as(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&jo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function os(e,t,n){return So&21?(jr(n,t)||(n=Vt(),Co.lanes|=n,Zc|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Fs=!0),e.memoizedState=n)}function ss(e,t){var n=P;P=n!==0&&4>n?n:4,e(!0);var r=xo.transition;xo.transition={};try{e(!1),t()}finally{P=n,xo.transition=r}}function cs(){return Fo().memoizedState}function ls(e,t,n){var r=gl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ds(e))fs(t,n);else if(n=eo(e,t,n,r),n!==null){var i=hl();_l(n,e,r,i),ps(n,t,r)}}function us(e,t,n){var r=gl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ds(e))fs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,jr(s,o)){var c=t.interleaved;c===null?(i.next=i,$a(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=eo(e,t,i,r),n!==null&&(i=hl(),_l(n,e,r,i),ps(n,t,r))}}function ds(e){var t=e.alternate;return e===Co||t!==null&&t===Co}function fs(e,t){Do=Eo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ps(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Gt(e,n)}}var ms={readContext:Za,useCallback:Ao,useContext:Ao,useEffect:Ao,useImperativeHandle:Ao,useInsertionEffect:Ao,useLayoutEffect:Ao,useMemo:Ao,useReducer:Ao,useRef:Ao,useState:Ao,useDebugValue:Ao,useDeferredValue:Ao,useTransition:Ao,useMutableSource:Ao,useSyncExternalStore:Ao,useId:Ao,unstable_isNewReconciler:!1},hs={readContext:Za,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:Za,useEffect:Zo,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Yo(4194308,4,ts.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Yo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Yo(4,2,e,t)},useMemo:function(e,t){var n=Po();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Po();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ls.bind(null,Co,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:Ko,useDebugValue:rs,useDeferredValue:function(e){return Po().memoizedState=e},useTransition:function(){var e=Ko(!1),t=e[0];return e=ss.bind(null,e[1]),Po().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=Co,a=Po();if(Ta){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Wc===null)throw Error(r(349));So&30||Vo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Zo(Uo.bind(null,i,o,e),[e]),i.flags|=2048,qo(9,Ho.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Po(),t=Wc.identifierPrefix;if(Ta){var n=va,r=_a;n=(r&~(1<<32-At(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Oo++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=ko++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},gs={readContext:Za,useCallback:is,useContext:Za,useEffect:Qo,useImperativeHandle:ns,useInsertionEffect:$o,useLayoutEffect:es,useMemo:as,useReducer:Lo,useRef:Jo,useState:function(){return Lo(Io)},useDebugValue:rs,useDeferredValue:function(e){return os(Fo(),wo.memoizedState,e)},useTransition:function(){return[Lo(Io)[0],Fo().memoizedState]},useMutableSource:zo,useSyncExternalStore:Bo,useId:cs,unstable_isNewReconciler:!1},_s={readContext:Za,useCallback:is,useContext:Za,useEffect:Qo,useImperativeHandle:ns,useInsertionEffect:$o,useLayoutEffect:es,useMemo:as,useReducer:Ro,useRef:Jo,useState:function(){return Ro(Io)},useDebugValue:rs,useDeferredValue:function(e){var t=Fo();return wo===null?t.memoizedState=e:os(t,wo.memoizedState,e)},useTransition:function(){return[Ro(Io)[0],Fo().memoizedState]},useMutableSource:zo,useSyncExternalStore:Bo,useId:cs,unstable_isNewReconciler:!1};function vs(e,t){if(e&&e.defaultProps){for(var n in t=N({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ys(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:N({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bs={isMounted:function(e){return(e=e._reactInternals)?ut(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hl(),i=gl(e),a=ao(r,i);a.payload=t,n!=null&&(a.callback=n),t=oo(e,a,i),t!==null&&(_l(t,e,i,r),so(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hl(),i=gl(e),a=ao(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=oo(e,a,i),t!==null&&(_l(t,e,i,r),so(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hl(),r=gl(e),i=ao(n,r);i.tag=2,t!=null&&(i.callback=t),t=oo(e,i,r),t!==null&&(_l(t,e,r,n),so(t,e,r))}};function xs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Mr(n,r)||!Mr(i,a):!0}function Ss(e,t,n){var r=!1,i=qi,a=t.contextType;return typeof a==`object`&&a?a=Za(a):(i=Qi(t)?Xi:Ji.current,r=t.contextTypes,a=(r=r!=null)?Zi(e,i):qi),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=bs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function Cs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&bs.enqueueReplaceState(t,t.state,null)}function ws(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},ro(e);var a=t.contextType;typeof a==`object`&&a?i.context=Za(a):(a=Qi(t)?Xi:Ji.current,i.context=Zi(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(ys(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&bs.enqueueReplaceState(i,i.state,null),lo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function Ts(e,t){try{var n=``,r=t;do n+=ce(r),r=r.return;while(r);var i=n}catch(e){i=`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}return{value:e,source:t,stack:i,digest:null}}function Es(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ds(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Os=typeof WeakMap==`function`?WeakMap:Map;function ks(e,t,n){n=ao(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){al||(al=!0,ol=r),Ds(e,t)},n}function As(e,t,n){n=ao(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ds(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Ds(e,t),typeof r!=`function`&&(sl===null?sl=new Set([this]):sl.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function js(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Os;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Hl.bind(null,e,t,n),t.then(e,e))}function Ms(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function Ns(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ao(-1,1),t.tag=2,oo(n,t,1))),n.lanes|=1),e)}var Ps=x.ReactCurrentOwner,Fs=!1;function Is(e,t,n,r){t.child=e===null?Ha(t,null,n,r):Va(t,e.child,n,r)}function Ls(e,t,n,r,i){n=n.render;var a=t.ref;return Xa(t,i),r=Mo(e,t,n,r,a,i),n=No(),e!==null&&!Fs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rc(e,t,i)):(Ta&&n&&xa(t),t.flags|=1,Is(e,t,r,i),t.child)}function Rs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Xl(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,zs(e,t,a,r,i)):(e=$l(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Mr:n,n(o,r)&&e.ref===t.ref)return rc(e,t,i)}return t.flags|=1,e=Ql(a,r),e.ref=t.ref,e.return=t,t.child=e}function zs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Mr(a,r)&&e.ref===t.ref)if(Fs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Fs=!0);else return t.lanes=e.lanes,rc(e,t,i)}return Hs(e,t,n,r,i)}function Bs(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ki(Jc,qc),qc|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ki(Jc,qc),qc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,Ki(Jc,qc),qc|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),Ki(Jc,qc),qc|=r;return Is(e,t,i,n),t.child}function Vs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Hs(e,t,n,r,i){var a=Qi(n)?Xi:Ji.current;return a=Zi(t,a),Xa(t,i),n=Mo(e,t,n,r,a,i),r=No(),e!==null&&!Fs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rc(e,t,i)):(Ta&&r&&xa(t),t.flags|=1,Is(e,t,n,i),t.child)}function Us(e,t,n,r,i){if(Qi(n)){var a=!0;na(t)}else a=!1;if(Xa(t,i),t.stateNode===null)nc(e,t),Ss(t,n,r),ws(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Za(l):(l=Qi(n)?Xi:Ji.current,l=Zi(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&Cs(t,o,r,l),no=!1;var f=t.memoizedState;o.state=f,lo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Yi.current||no?(typeof u==`function`&&(ys(t,n,u,r),c=t.memoizedState),(s=no||xs(t,n,s,r,f,c,l))?(d||typeof o.UNSAFE_componentWillMount!=`function`&&typeof o.componentWillMount!=`function`||(typeof o.componentWillMount==`function`&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==`function`&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==`function`&&(t.flags|=4194308)):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,io(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:vs(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Za(c):(c=Qi(n)?Xi:Ji.current,c=Zi(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&Cs(t,o,r,c),no=!1,f=t.memoizedState,o.state=f,lo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Yi.current||no?(typeof p==`function`&&(ys(t,n,p,r),m=t.memoizedState),(l=no||xs(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Ws(e,t,n,r,a,i)}function Ws(e,t,n,r,i,a){Vs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&ra(t,n,!1),rc(e,t,a);r=t.stateNode,Ps.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Va(t,e.child,null,a),t.child=Va(t,null,s,a)):Is(e,t,s,a),t.memoizedState=r.state,i&&ra(t,n,!0),t.child}function Gs(e){var t=e.stateNode;t.pendingContext?ea(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ea(e,t.context,!1),G(e,t.containerInfo)}function Ks(e,t,n,r,i){return Pa(),Fa(i),t.flags|=256,Is(e,t,n,r),t.child}var qs={dehydrated:null,treeContext:null,retryLane:0};function Js(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ys(e,t,n){var r=t.pendingProps,i=q.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ki(q,i&1),e===null)return Aa(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===`$!`?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=tu(o,r,0,null),e=eu(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Js(n),t.memoizedState=qs,e):Xs(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Qs(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Ql(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=eu(a,o,n,null),a.flags|=2):a=Ql(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?Js(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=qs,r}return a=e.child,e=a.sibling,r=Ql(a,{mode:`visible`,children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Xs(e,t){return t=tu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function Zs(e,t,n,r){return r!==null&&Fa(r),Va(t,e.child,null,n),e=Xs(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Qs(e,t,n,i,a,o,s){if(n)return t.flags&256?(t.flags&=-257,i=Es(Error(r(422))),Zs(e,t,s,i)):t.memoizedState===null?(o=i.fallback,a=t.mode,i=tu({mode:`visible`,children:i.children},a,0,null),o=eu(o,a,s,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,t.mode&1&&Va(t,e.child,null,s),t.child.memoizedState=Js(s),t.memoizedState=qs,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return Zs(e,t,s,null);if(a.data===`$!`){if(i=a.nextSibling&&a.nextSibling.dataset,i)var c=i.dgst;return i=c,o=Error(r(419)),i=Es(o,i,void 0),Zs(e,t,s,i)}if(c=(s&e.childLanes)!==0,Fs||c){if(i=Wc,i!==null){switch(s&-s){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(i.suspendedLanes|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,to(e,a),_l(i,e,a,-1))}return jl(),i=Es(Error(r(421))),Zs(e,t,s,i)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Wl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,wa=V(a.nextSibling),Ca=t,Ta=!0,Ea=null,e!==null&&(ma[ha++]=_a,ma[ha++]=va,ma[ha++]=ga,_a=e.id,va=e.overflow,ga=t),t=Xs(t,i.children),t.flags|=4096,t)}function $s(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ya(e.return,t,n)}function ec(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Is(e,t,r.children,n),r=q.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$s(e,n,t);else if(e.tag===19)$s(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ki(q,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&vo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ec(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ec(t,!0,n,null,a);break;case`together`:ec(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function nc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function rc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Zc|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=Ql(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ql(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ic(e,t,n){switch(t.tag){case 3:Gs(t),Pa();break;case 5:go(t);break;case 1:Qi(t.type)&&na(t);break;case 4:G(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ki(Ua,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ki(q,q.current&1),e=rc(e,t,n),e===null?null:e.sibling):Ys(e,t,n):(Ki(q,q.current&1),t.flags|=128,null);Ki(q,q.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ki(q,q.current),r)break;return null;case 22:case 23:return t.lanes=0,Bs(e,t,n)}return rc(e,t,n)}var ac=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}},oc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,W(po.current);var o=null;switch(n){case`input`:i=_e(e,i),r=_e(e,r),o=[];break;case`select`:i=N({},i,{value:void 0}),r=N({},r,{value:void 0}),o=[];break;case`textarea`:i=Te(e,i),r=Te(e,r),o=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=Si)}ze(n,r);var s;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(s in c)c.hasOwnProperty(s)&&(n||={},n[s]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(a.hasOwnProperty(u)?o||=[]:(o||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(s in c)!c.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||={},n[s]=``);for(s in l)l.hasOwnProperty(s)&&c[s]!==l[s]&&(n||={},n[s]=l[s])}else n||(o||=[],o.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(o||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(o||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(a.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&ci(`scroll`,e),o||c===l||(o=[])):(o||=[]).push(u,l))}n&&(o||=[]).push(`style`,n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}},sc=function(e,t,n,r){n!==r&&(t.flags|=4)};function cc(e,t){if(!Ta)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function lc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function uc(e,t,n){var i=t.pendingProps;switch(Sa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lc(t),null;case 1:return Qi(t.type)&&$i(),lc(t),null;case 3:return i=t.stateNode,K(),Gi(Yi),Gi(Ji),yo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ma(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ea!==null&&(xl(Ea),Ea=null))),lc(t),null;case 5:_o(t);var o=W(ho.current);if(n=t.type,e!==null&&t.stateNode!=null)oc(e,t,n,i,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(r(166));return lc(t),null}if(e=W(po.current),Ma(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[H]=t,i[U]=s,e=(t.mode&1)!=0,n){case`dialog`:ci(`cancel`,i),ci(`close`,i);break;case`iframe`:case`object`:case`embed`:ci(`load`,i);break;case`video`:case`audio`:for(o=0;o<ii.length;o++)ci(ii[o],i);break;case`source`:ci(`error`,i);break;case`img`:case`image`:case`link`:ci(`error`,i),ci(`load`,i);break;case`details`:ci(`toggle`,i);break;case`input`:ve(i,s),ci(`invalid`,i);break;case`select`:i._wrapperState={wasMultiple:!!s.multiple},ci(`invalid`,i);break;case`textarea`:Ee(i,s),ci(`invalid`,i)}for(var c in ze(n,s),o=null,s)if(s.hasOwnProperty(c)){var l=s[c];c===`children`?typeof l==`string`?i.textContent!==l&&(!0!==s.suppressHydrationWarning&&xi(i.textContent,l,e),o=[`children`,l]):typeof l==`number`&&i.textContent!==``+l&&(!0!==s.suppressHydrationWarning&&xi(i.textContent,l,e),o=[`children`,``+l]):a.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&ci(`scroll`,i)}switch(n){case`input`:me(i),xe(i,s,!0);break;case`textarea`:me(i),Oe(i);break;case`select`:case`option`:break;default:typeof s.onClick==`function`&&(i.onclick=Si)}i=o,t.updateQueue=i,i!==null&&(t.flags|=4)}else{c=o.nodeType===9?o:o.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=ke(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[H]=t,e[U]=i,ac(e,t,!1,!1),t.stateNode=e;a:{switch(c=Be(n,i),n){case`dialog`:ci(`cancel`,e),ci(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:ci(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;o<ii.length;o++)ci(ii[o],e);o=i;break;case`source`:ci(`error`,e),o=i;break;case`img`:case`image`:case`link`:ci(`error`,e),ci(`load`,e),o=i;break;case`details`:ci(`toggle`,e),o=i;break;case`input`:ve(e,i),o=_e(e,i),ci(`invalid`,e);break;case`option`:o=i;break;case`select`:e._wrapperState={wasMultiple:!!i.multiple},o=N({},i,{value:void 0}),ci(`invalid`,e);break;case`textarea`:Ee(e,i),o=Te(e,i),ci(`invalid`,e);break;default:o=i}for(s in ze(n,o),l=o,l)if(l.hasOwnProperty(s)){var u=l[s];s===`style`?Le(e,u):s===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&Me(e,u)):s===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Ne(e,u):typeof u==`number`&&Ne(e,``+u):s!==`suppressContentEditableWarning`&&s!==`suppressHydrationWarning`&&s!==`autoFocus`&&(a.hasOwnProperty(s)?u!=null&&s===`onScroll`&&ci(`scroll`,e):u!=null&&b(e,s,u,c))}switch(n){case`input`:me(e),xe(e,i,!1);break;case`textarea`:me(e),Oe(e);break;case`option`:i.value!=null&&e.setAttribute(`value`,``+de(i.value));break;case`select`:e.multiple=!!i.multiple,s=i.value,s==null?i.defaultValue!=null&&we(e,!!i.multiple,i.defaultValue,!0):we(e,!!i.multiple,s,!1);break;default:typeof o.onClick==`function`&&(e.onclick=Si)}switch(n){case`button`:case`input`:case`select`:case`textarea`:i=!!i.autoFocus;break a;case`img`:i=!0;break a;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return lc(t),null;case 6:if(e&&t.stateNode!=null)sc(e,t,e.memoizedProps,i);else{if(typeof i!=`string`&&t.stateNode===null)throw Error(r(166));if(n=W(ho.current),W(po.current),Ma(t)){if(i=t.stateNode,n=t.memoizedProps,i[H]=t,(s=i.nodeValue!==n)&&(e=Ca,e!==null))switch(e.tag){case 3:xi(i.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&xi(i.nodeValue,n,(e.mode&1)!=0)}s&&(t.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[H]=t,t.stateNode=i}return lc(t),null;case 13:if(Gi(q),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ta&&wa!==null&&t.mode&1&&!(t.flags&128))Na(),Pa(),t.flags|=98560,s=!1;else if(s=Ma(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(r(318));if(s=t.memoizedState,s=s===null?null:s.dehydrated,!s)throw Error(r(317));s[H]=t}else Pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lc(t),s=!1}else Ea!==null&&(xl(Ea),Ea=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||q.current&1?Yc===0&&(Yc=3):jl())),t.updateQueue!==null&&(t.flags|=4),lc(t),null);case 4:return K(),e===null&&di(t.stateNode.containerInfo),lc(t),null;case 10:return Ja(t.type._context),lc(t),null;case 17:return Qi(t.type)&&$i(),lc(t),null;case 19:if(Gi(q),s=t.memoizedState,s===null)return lc(t),null;if(i=(t.flags&128)!=0,c=s.rendering,c===null)if(i)cc(s,!1);else{if(Yc!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=vo(e),c!==null){for(t.flags|=128,cc(s,!1),i=c.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=n,n=t.child;n!==null;)s=n,e=i,s.flags&=14680066,c=s.alternate,c===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ki(q,q.current&1|2),t.child}e=e.sibling}s.tail!==null&&bt()>rl&&(t.flags|=128,i=!0,cc(s,!1),t.lanes=4194304)}else{if(!i)if(e=vo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),cc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!Ta)return lc(t),null}else 2*bt()-s.renderingStartTime>rl&&n!==1073741824&&(t.flags|=128,i=!0,cc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(lc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=bt(),t.sibling=null,n=q.current,Ki(q,i?n&1|2:n&1),t);case 22:case 23:return Dl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?qc&1073741824&&(lc(t),t.subtreeFlags&6&&(t.flags|=8192)):lc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function dc(e,t){switch(Sa(t),t.tag){case 1:return Qi(t.type)&&$i(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return K(),Gi(Yi),Gi(Ji),yo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _o(t),null;case 13:if(Gi(q),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Gi(q),null;case 4:return K(),null;case 10:return Ja(t.type._context),null;case 22:case 23:return Dl(),null;case 24:return null;default:return null}}var fc=!1,pc=!1,mc=typeof WeakSet==`function`?WeakSet:Set,Y=null;function hc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Vl(e,t,n)}else n.current=null}function gc(e,t,n){try{n()}catch(n){Vl(e,t,n)}}var _c=!1;function vc(e,t){if(Ci=L,e=Ir(),Lr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(wi={focusedElem:e,selectionRange:n},L=!1,Y=t;Y!==null;)if(t=Y,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:vs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){Vl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return h=_c,_c=!1,h}function yc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&gc(t,n,a)}i=i.next}while(i!==r)}}function bc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function xc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Sc(e){var t=e.alternate;t!==null&&(e.alternate=null,Sc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[H],delete t[U],delete t[Fi],delete t[Ii],delete t[Li])),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 Cc(e){return e.tag===5||e.tag===3||e.tag===4}function wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Cc(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 a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Si));else if(r!==4&&(e=e.child,e!==null))for(Tc(e,t,n),e=e.sibling;e!==null;)Tc(e,t,n),e=e.sibling}function Ec(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ec(e,t,n),e=e.sibling;e!==null;)Ec(e,t,n),e=e.sibling}var Dc=null,Oc=!1;function kc(e,t,n){for(n=n.child;n!==null;)Ac(e,t,n),n=n.sibling}function Ac(e,t,n){if(Ot&&typeof Ot.onCommitFiberUnmount==`function`)try{Ot.onCommitFiberUnmount(Dt,n)}catch{}switch(n.tag){case 5:pc||hc(n,t);case 6:var r=Dc,i=Oc;Dc=null,kc(e,t,n),Dc=r,Oc=i,Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Dc.removeChild(n.stateNode));break;case 18:Dc!==null&&(Oc?(e=Dc,n=n.stateNode,e.nodeType===8?ji(e.parentNode,n):e.nodeType===1&&ji(e,n),hn(e)):ji(Dc,n.stateNode));break;case 4:r=Dc,i=Oc,Dc=n.stateNode.containerInfo,Oc=!0,kc(e,t,n),Dc=r,Oc=i;break;case 0:case 11:case 14:case 15:if(!pc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&gc(n,t,o),i=i.next}while(i!==r)}kc(e,t,n);break;case 1:if(!pc&&(hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Vl(n,t,e)}kc(e,t,n);break;case 21:kc(e,t,n);break;case 22:n.mode&1?(pc=(r=pc)||n.memoizedState!==null,kc(e,t,n),pc=r):kc(e,t,n);break;default:kc(e,t,n)}}function jc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mc),t.forEach(function(t){var r=Gl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Mc(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Dc=c.stateNode,Oc=!1;break a;case 3:Dc=c.stateNode.containerInfo,Oc=!0;break a;case 4:Dc=c.stateNode.containerInfo,Oc=!0;break a}c=c.return}if(Dc===null)throw Error(r(160));Ac(o,s,a),Dc=null,Oc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Vl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Nc(t,e),t=t.sibling}function Nc(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Mc(t,e),Pc(e),i&4){try{yc(3,e,e.return),bc(3,e)}catch(t){Vl(e,e.return,t)}try{yc(5,e,e.return)}catch(t){Vl(e,e.return,t)}}break;case 1:Mc(t,e),Pc(e),i&512&&n!==null&&hc(n,n.return);break;case 5:if(Mc(t,e),Pc(e),i&512&&n!==null&&hc(n,n.return),e.flags&32){var a=e.stateNode;try{Ne(a,``)}catch(t){Vl(e,e.return,t)}}if(i&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&ye(a,o),Be(c,s);var u=Be(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Le(a,f):d===`dangerouslySetInnerHTML`?Me(a,f):d===`children`?Ne(a,f):b(a,d,f,u)}switch(c){case`input`:be(a,o);break;case`textarea`:De(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?we(a,!!o.multiple,o.multiple?[]:``,!1):we(a,!!o.multiple,o.defaultValue,!0)):we(a,!!o.multiple,m,!1)}a[U]=o}catch(t){Vl(e,e.return,t)}}break;case 6:if(Mc(t,e),Pc(e),i&4){if(e.stateNode===null)throw Error(r(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Vl(e,e.return,t)}}break;case 3:if(Mc(t,e),Pc(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{hn(t.containerInfo)}catch(t){Vl(e,e.return,t)}break;case 4:Mc(t,e),Pc(e);break;case 13:Mc(t,e),Pc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(nl=bt())),i&4&&jc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(pc=(u=pc)||d,Mc(t,e),pc=u):Mc(t,e),Pc(e),i&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Y=e,d=e.child;d!==null;){for(f=Y=d;Y!==null;){switch(p=Y,m=p.child,p.tag){case 0:case 11:case 14:case 15:yc(4,p,p.return);break;case 1:hc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){i=p,n=p.return;try{t=i,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Vl(i,n,e)}}break;case 5:hc(p,p.return);break;case 22:if(p.memoizedState!==null){Rc(f);continue}}m===null?Rc(f):(m.return=p,Y=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=Ie(`display`,s))}catch(t){Vl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Vl(e,e.return,t)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Mc(t,e),Pc(e),i&4&&jc(e);break;case 21:break;default:Mc(t,e),Pc(e)}}function Pc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(Cc(n)){var i=n;break a}n=n.return}throw Error(r(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(Ne(a,``),i.flags&=-33),Ec(e,wc(e),a);break;case 3:case 4:var o=i.stateNode.containerInfo;Tc(e,wc(e),o);break;default:throw Error(r(161))}}catch(t){Vl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fc(e,t,n){Y=e,Ic(e,t,n)}function Ic(e,t,n){for(var r=(e.mode&1)!=0;Y!==null;){var i=Y,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||fc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||pc;s=fc;var l=pc;if(fc=o,(pc=c)&&!l)for(Y=i;Y!==null;)o=Y,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?zc(i):(c.return=o,Y=c);for(;a!==null;)Y=a,Ic(a,t,n),a=a.sibling;Y=i,fc=s,pc=l}Lc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Y=a):Lc(e,t,n)}}function Lc(e){for(;Y!==null;){var t=Y;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pc||bc(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!pc)if(n===null)i.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:vs(t.type,n.memoizedProps);i.componentDidUpdate(a,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&uo(t,o,i);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}uo(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&hn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}pc||t.flags&512&&xc(t)}catch(e){Vl(t,t.return,e)}}if(t===e){Y=null;break}if(n=t.sibling,n!==null){n.return=t.return,Y=n;break}Y=t.return}}function Rc(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 zc(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{bc(4,t)}catch(e){Vl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Vl(t,i,e)}}var a=t.return;try{xc(t)}catch(e){Vl(t,a,e)}break;case 5:var o=t.return;try{xc(t)}catch(e){Vl(t,o,e)}}}catch(e){Vl(t,t.return,e)}if(t===e){Y=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Y=s;break}Y=t.return}}var Bc=Math.ceil,Vc=x.ReactCurrentDispatcher,Hc=x.ReactCurrentOwner,Uc=x.ReactCurrentBatchConfig,X=0,Wc=null,Gc=null,Kc=0,qc=0,Jc=Wi(0),Yc=0,Xc=null,Zc=0,Qc=0,$c=0,el=null,tl=null,nl=0,rl=1/0,il=null,al=!1,ol=null,sl=null,cl=!1,ll=null,ul=0,dl=0,fl=null,pl=-1,ml=0;function hl(){return X&6?bt():pl===-1?pl=bt():pl}function gl(e){return e.mode&1?X&2&&Kc!==0?Kc&-Kc:Ia.transition===null?(e=P,e===0?(e=window.event,e=e===void 0?16:Sn(e.type),e):e):(ml===0&&(ml=Vt()),ml):1}function _l(e,t,n,i){if(50<dl)throw dl=0,fl=null,Error(r(185));Ut(e,n,i),(!(X&2)||e!==Wc)&&(e===Wc&&(!(X&2)&&(Qc|=n),Yc===4&&Cl(e,Kc)),vl(e,i),n===1&&X===0&&!(t.mode&1)&&(rl=bt()+500,aa&&la()))}function vl(e,t){var n=e.callbackNode;zt(e,t);var r=Lt(e,e===Wc?Kc:0);if(r===0)n!==null&&_t(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&_t(n),t===1)e.tag===0?ca(wl.bind(null,e)):sa(wl.bind(null,e)),ki(function(){!(X&6)&&la()}),n=null;else{switch(Kt(r)){case 1:n=St;break;case 4:n=Ct;break;case 16:n=wt;break;case 536870912:n=Et;break;default:n=wt}n=ql(n,yl.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function yl(e,t){if(pl=-1,ml=0,X&6)throw Error(r(327));var n=e.callbackNode;if(zl()&&e.callbackNode!==n)return null;var i=Lt(e,e===Wc?Kc:0);if(i===0)return null;if(i&30||(i&e.expiredLanes)!==0||t)t=Ml(e,i);else{t=i;var a=X;X|=2;var o=Al();(Wc!==e||Kc!==t)&&(il=null,rl=bt()+500,Ol(e,t));do try{Pl();break}catch(t){kl(e,t)}while(1);qa(),Vc.current=o,X=a,Gc===null?(Wc=null,Kc=0,t=Yc):t=0}if(t!==0){if(t===2&&(a=Bt(e),a!==0&&(i=a,t=bl(e,a))),t===1)throw n=Xc,Ol(e,0),Cl(e,i),vl(e,bt()),n;if(t===6)Cl(e,i);else{if(a=e.current.alternate,!(i&30)&&!Sl(a)&&(t=Ml(e,i),t===2&&(o=Bt(e),o!==0&&(i=o,t=bl(e,o))),t===1))throw n=Xc,Ol(e,0),Cl(e,i),vl(e,bt()),n;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(r(345));case 2:Ll(e,tl,il);break;case 3:if(Cl(e,i),(i&130023424)===i&&(t=nl+500-bt(),10<t)){if(Lt(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){hl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Ei(Ll.bind(null,e,tl,il),t);break}Ll(e,tl,il);break;case 4:if(Cl(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var s=31-At(i);o=1<<s,s=t[s],s>a&&(a=s),i&=~o}if(i=a,i=bt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Bc(i/1960))-i,10<i){e.timeoutHandle=Ei(Ll.bind(null,e,tl,il),i);break}Ll(e,tl,il);break;case 5:Ll(e,tl,il);break;default:throw Error(r(329))}}}return vl(e,bt()),e.callbackNode===n?yl.bind(null,e):null}function bl(e,t){var n=el;return e.current.memoizedState.isDehydrated&&(Ol(e,t).flags|=256),e=Ml(e,t),e!==2&&(t=tl,tl=n,t!==null&&xl(t)),e}function xl(e){tl===null?tl=e:tl.push.apply(tl,e)}function Sl(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!jr(a(),i))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 Cl(e,t){for(t&=~$c,t&=~Qc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-At(t),r=1<<n;e[n]=-1,t&=~r}}function wl(e){if(X&6)throw Error(r(327));zl();var t=Lt(e,0);if(!(t&1))return vl(e,bt()),null;var n=Ml(e,t);if(e.tag!==0&&n===2){var i=Bt(e);i!==0&&(t=i,n=bl(e,i))}if(n===1)throw n=Xc,Ol(e,0),Cl(e,t),vl(e,bt()),n;if(n===6)throw Error(r(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ll(e,tl,il),vl(e,bt()),null}function Tl(e,t){var n=X;X|=1;try{return e(t)}finally{X=n,X===0&&(rl=bt()+500,aa&&la())}}function El(e){ll!==null&&ll.tag===0&&!(X&6)&&zl();var t=X;X|=1;var n=Uc.transition,r=P;try{if(Uc.transition=null,P=1,e)return e()}finally{P=r,Uc.transition=n,X=t,!(X&6)&&la()}}function Dl(){qc=Jc.current,Gi(Jc)}function Ol(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Di(n)),Gc!==null)for(n=Gc.return;n!==null;){var r=n;switch(Sa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&$i();break;case 3:K(),Gi(Yi),Gi(Ji),yo();break;case 5:_o(r);break;case 4:K();break;case 13:Gi(q);break;case 19:Gi(q);break;case 10:Ja(r.type._context);break;case 22:case 23:Dl()}n=n.return}if(Wc=e,Gc=e=Ql(e.current,null),Kc=qc=t,Yc=0,Xc=null,$c=Qc=Zc=0,tl=el=null,Qa!==null){for(t=0;t<Qa.length;t++)if(n=Qa[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}Qa=null}return e}function kl(e,t){do{var n=Gc;try{if(qa(),bo.current=ms,Eo){for(var i=Co.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Eo=!1}if(So=0,To=wo=Co=null,Do=!1,Oo=0,Hc.current=null,n===null||n.return===null){Yc=1,Xc=t,Gc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=Kc,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Ms(s);if(m!==null){m.flags&=-257,Ns(m,s,c,o,t),m.mode&1&&js(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){js(o,u,t),jl();break a}l=Error(r(426))}}else if(Ta&&c.mode&1){var _=Ms(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Ns(_,s,c,o,t),Fa(Ts(l,c));break a}}o=l=Ts(l,c),Yc!==4&&(Yc=2),el===null?el=[o]:el.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=ks(o,l,t);co(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(sl===null||!sl.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=As(o,c,t);co(o,x);break a}}o=o.return}while(o!==null)}Il(n)}catch(e){t=e,Gc===n&&n!==null&&(Gc=n=n.return);continue}break}while(1)}function Al(){var e=Vc.current;return Vc.current=ms,e===null?ms:e}function jl(){(Yc===0||Yc===3||Yc===2)&&(Yc=4),Wc===null||!(Zc&268435455)&&!(Qc&268435455)||Cl(Wc,Kc)}function Ml(e,t){var n=X;X|=2;var i=Al();(Wc!==e||Kc!==t)&&(il=null,Ol(e,t));do try{Nl();break}catch(t){kl(e,t)}while(1);if(qa(),X=n,Vc.current=i,Gc!==null)throw Error(r(261));return Wc=null,Kc=0,Yc}function Nl(){for(;Gc!==null;)Fl(Gc)}function Pl(){for(;Gc!==null&&!vt();)Fl(Gc)}function Fl(e){var t=Kl(e.alternate,e,qc);e.memoizedProps=e.pendingProps,t===null?Il(e):Gc=t,Hc.current=null}function Il(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=dc(n,t),n!==null){n.flags&=32767,Gc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Yc=6,Gc=null;return}}else if(n=uc(n,t,qc),n!==null){Gc=n;return}if(t=t.sibling,t!==null){Gc=t;return}Gc=t=e}while(t!==null);Yc===0&&(Yc=5)}function Ll(e,t,n){var r=P,i=Uc.transition;try{Uc.transition=null,P=1,Rl(e,t,n,r)}finally{Uc.transition=i,P=r}return null}function Rl(e,t,n,i){do zl();while(ll!==null);if(X&6)throw Error(r(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(r(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(Wt(e,o),e===Wc&&(Gc=Wc=null,Kc=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||cl||(cl=!0,ql(wt,function(){return zl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Uc.transition,Uc.transition=null;var s=P;P=1;var c=X;X|=4,Hc.current=null,vc(e,n),Nc(n,e),Rr(wi),L=!!Ci,wi=Ci=null,e.current=n,Fc(n,e,a),yt(),X=c,P=s,Uc.transition=o}else e.current=n;if(cl&&(cl=!1,ll=e,ul=a),o=e.pendingLanes,o===0&&(sl=null),kt(n.stateNode,i),vl(e,bt()),t!==null)for(i=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],i(a.value,{componentStack:a.stack,digest:a.digest});if(al)throw al=!1,e=ol,ol=null,e;return ul&1&&e.tag!==0&&zl(),o=e.pendingLanes,o&1?e===fl?dl++:(dl=0,fl=e):dl=0,la(),null}function zl(){if(ll!==null){var e=Kt(ul),t=Uc.transition,n=P;try{if(Uc.transition=null,P=16>e?16:e,ll===null)var i=!1;else{if(e=ll,ll=null,ul=0,X&6)throw Error(r(331));var a=X;for(X|=4,Y=e.current;Y!==null;){var o=Y,s=o.child;if(Y.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(Y=u;Y!==null;){var d=Y;switch(d.tag){case 0:case 11:case 15:yc(8,d,o)}var f=d.child;if(f!==null)f.return=d,Y=f;else for(;Y!==null;){d=Y;var p=d.sibling,m=d.return;if(Sc(d),d===u){Y=null;break}if(p!==null){p.return=m,Y=p;break}Y=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}Y=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,Y=s;else b:for(;Y!==null;){if(o=Y,o.flags&2048)switch(o.tag){case 0:case 11:case 15:yc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,Y=v;break b}Y=o.return}}var y=e.current;for(Y=y;Y!==null;){s=Y;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,Y=b;else b:for(s=y;Y!==null;){if(c=Y,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:bc(9,c)}}catch(e){Vl(c,c.return,e)}if(c===s){Y=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,Y=x;break b}Y=c.return}}if(X=a,la(),Ot&&typeof Ot.onPostCommitFiberRoot==`function`)try{Ot.onPostCommitFiberRoot(Dt,e)}catch{}i=!0}return i}finally{P=n,Uc.transition=t}}return!1}function Bl(e,t,n){t=Ts(n,t),t=ks(e,t,1),e=oo(e,t,1),t=hl(),e!==null&&(Ut(e,1,t),vl(e,t))}function Vl(e,t,n){if(e.tag===3)Bl(e,e,n);else for(;t!==null;){if(t.tag===3){Bl(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(sl===null||!sl.has(r))){e=Ts(n,e),e=As(t,e,1),t=oo(t,e,1),e=hl(),t!==null&&(Ut(t,1,e),vl(t,e));break}}t=t.return}}function Hl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=hl(),e.pingedLanes|=e.suspendedLanes&n,Wc===e&&(Kc&n)===n&&(Yc===4||Yc===3&&(Kc&130023424)===Kc&&500>bt()-nl?Ol(e,0):$c|=n),vl(e,t)}function Ul(e,t){t===0&&(e.mode&1?(t=Ft,Ft<<=1,!(Ft&130023424)&&(Ft=4194304)):t=1);var n=hl();e=to(e,t),e!==null&&(Ut(e,t,n),vl(e,n))}function Wl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ul(e,n)}function Gl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Ul(e,n)}var Kl=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Yi.current)Fs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Fs=!1,ic(e,t,n);Fs=!!(e.flags&131072)}else Fs=!1,Ta&&t.flags&1048576&&ba(t,pa,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;nc(e,t),e=t.pendingProps;var a=Zi(t,Ji.current);Xa(t,n),a=Mo(null,t,i,e,a,n);var o=No();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qi(i)?(o=!0,na(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,ro(t),a.updater=bs,t.stateNode=a,a._reactInternals=t,ws(t,i,e,n),t=Ws(null,t,i,!0,o,n)):(t.tag=0,Ta&&o&&xa(t),Is(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(nc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Zl(i),e=vs(i,e),a){case 0:t=Hs(null,t,i,e,n);break a;case 1:t=Us(null,t,i,e,n);break a;case 11:t=Ls(null,t,i,e,n);break a;case 14:t=Rs(null,t,i,vs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Hs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Us(e,t,i,a,n);case 3:a:{if(Gs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,io(e,t),lo(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Ts(Error(r(423)),t),t=Ks(e,t,i,n,a);break a}else if(i!==a){a=Ts(Error(r(424)),t),t=Ks(e,t,i,n,a);break a}else for(wa=V(t.stateNode.containerInfo.firstChild),Ca=t,Ta=!0,Ea=null,n=Ha(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Pa(),i===a){t=rc(e,t,n);break a}Is(e,t,i,n)}t=t.child}return t;case 5:return go(t),e===null&&Aa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Ti(i,a)?s=null:o!==null&&Ti(i,o)&&(t.flags|=32),Vs(e,t),Is(e,t,s,n),t.child;case 6:return e===null&&Aa(t),null;case 13:return Ys(e,t,n);case 4:return G(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Va(t,null,i,n):Is(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),Ls(e,t,i,a,n);case 7:return Is(e,t,t.pendingProps,n),t.child;case 8:return Is(e,t,t.pendingProps.children,n),t.child;case 12:return Is(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,Ki(Ua,i._currentValue),i._currentValue=s,o!==null)if(jr(o.value,s)){if(o.children===a.children&&!Yi.current){t=rc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=ao(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Ya(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Ya(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Is(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,Xa(t,n),a=Za(a),i=i(a),t.flags|=1,Is(e,t,i,n),t.child;case 14:return i=t.type,a=vs(i,t.pendingProps),a=vs(i.type,a),Rs(e,t,i,a,n);case 15:return zs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:vs(i,a),nc(e,t),t.tag=1,Qi(i)?(e=!0,na(t)):e=!1,Xa(t,n),Ss(t,i,a),ws(t,i,a,n),Ws(null,t,i,!0,e,n);case 19:return tc(e,t,n);case 22:return Bs(e,t,n)}throw Error(r(156,t.tag))};function ql(e,t){return gt(e,t)}function Jl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yl(e,t,n,r){return new Jl(e,t,n,r)}function Xl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zl(e){if(typeof e==`function`)return+!!Xl(e);if(e!=null){if(e=e.$$typeof,e===k)return 11;if(e===ne)return 14}return 2}function Ql(e,t){var n=e.alternate;return n===null?(n=Yl(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 $l(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)Xl(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case w:return eu(n.children,a,o,t);case T:s=8,a|=8;break;case E:return e=Yl(12,n,t,a|2),e.elementType=E,e.lanes=o,e;case ee:return e=Yl(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=Yl(19,n,t,a),e.elementType=te,e.lanes=o,e;case j:return tu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case D:s=10;break a;case O:s=9;break a;case k:s=11;break a;case ne:s=14;break a;case A:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Yl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function eu(e,t,n,r){return e=Yl(7,e,r,t),e.lanes=n,e}function tu(e,t,n,r){return e=Yl(22,e,r,t),e.elementType=j,e.lanes=n,e.stateNode={isHidden:!1},e}function nu(e,t,n){return e=Yl(6,e,null,t),e.lanes=n,e}function ru(e,t,n){return t=Yl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function iu(e,t,n,r,i){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=Ht(0),this.expirationTimes=Ht(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ht(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function au(e,t,n,r,i,a,o,s,c){return e=new iu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Yl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ro(a),e}function ou(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:C,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function su(e){if(!e)return qi;e=e._reactInternals;a:{if(ut(e)!==e||e.tag!==1)throw Error(r(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if(Qi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(r(171))}if(e.tag===1){var n=e.type;if(Qi(n))return ta(e,n,t)}return t}function cu(e,t,n,r,i,a,o,s,c){return e=au(n,r,!0,e,i,a,o,s,c),e.context=su(null),n=e.current,r=hl(),i=gl(n),a=ao(r,i),a.callback=t??null,oo(n,a,i),e.current.lanes=i,Ut(e,i,r),vl(e,r),e}function lu(e,t,n,r){var i=t.current,a=hl(),o=gl(i);return n=su(n),t.context===null?t.context=n:t.pendingContext=n,t=ao(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=oo(i,t,o),e!==null&&(_l(e,i,o,a),so(e,i,o)),o}function uu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function du(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fu(e,t){du(e,t),(e=e.alternate)&&du(e,t)}function pu(){return null}var mu=typeof reportError==`function`?reportError:function(e){console.error(e)};function hu(e){this._internalRoot=e}gu.prototype.render=hu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));lu(e,t,null,null)},gu.prototype.unmount=hu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;El(function(){lu(null,e,null,null)}),t[Pi]=null}};function gu(e){this._internalRoot=e}gu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<an.length&&t!==0&&t<an[n].priority;n++);an.splice(n,0,e),n===0&&un(e)}};function _u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function yu(){}function bu(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=uu(o);a.call(e)}}var o=cu(t,r,e,0,null,!1,!1,``,yu);return e._reactRootContainer=o,e[Pi]=o.current,di(e.nodeType===8?e.parentNode:e),El(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=uu(c);s.call(e)}}var c=au(e,0,!1,null,null,!1,!1,``,yu);return e._reactRootContainer=c,e[Pi]=c.current,di(e.nodeType===8?e.parentNode:e),El(function(){lu(t,c,n,r)}),c}function xu(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=uu(o);s.call(e)}}lu(t,o,e,i)}else o=bu(n,t,e,i,r);return uu(o)}qt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=It(t.pendingLanes);n!==0&&(Gt(t,n|1),vl(t,bt()),!(X&6)&&(rl=bt()+500,la()))}break;case 13:El(function(){var t=to(e,1);t!==null&&_l(t,e,1,hl())}),fu(e,1)}},Jt=function(e){if(e.tag===13){var t=to(e,134217728);t!==null&&_l(t,e,134217728,hl()),fu(e,134217728)}},Yt=function(e){if(e.tag===13){var t=gl(e),n=to(e,t);n!==null&&_l(n,e,t,hl()),fu(e,t)}},Xt=function(){return P},Qt=function(e,t){var n=P;try{return P=e,t()}finally{P=n}},Ue=function(e,t,n){switch(t){case`input`:if(be(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 a=Vi(i);if(!a)throw Error(r(90));he(i),be(i,a)}}}break;case`textarea`:De(e,n);break;case`select`:t=n.value,t!=null&&we(e,!!n.multiple,t,!1)}},Ye=Tl,Xe=El;var Su={usingClientEntryPoint:!1,Events:[zi,Bi,Vi,qe,Je,Tl]},Cu={findFiberByHostInstance:Ri,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},wu={bundleType:Cu.bundleType,version:Cu.version,rendererPackageName:Cu.rendererPackageName,rendererConfig:Cu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=mt(e),e===null?null:e.stateNode},findFiberByHostInstance:Cu.findFiberByHostInstance||pu,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 Tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Tu.isDisabled&&Tu.supportsFiber)try{Dt=Tu.inject(wu),Ot=Tu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Su,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_u(t))throw Error(r(200));return ou(e,t,null,n)},e.createRoot=function(e,t){if(!_u(e))throw Error(r(299));var n=!1,i=``,a=mu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=au(e,1,!1,null,null,n,!1,i,a),e[Pi]=t.current,di(e.nodeType===8?e.parentNode:e),new hu(t)},e.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(r(188)):(e=Object.keys(e).join(`,`),Error(r(268,e)));return e=mt(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return El(e)},e.hydrate=function(e,t,n){if(!vu(t))throw Error(r(200));return xu(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!_u(e))throw Error(r(405));var i=n!=null&&n.hydratedSources||null,a=!1,o=``,s=mu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=cu(t,null,e,1,n??null,a,!1,o,s),e[Pi]=t.current,di(e),i)for(e=0;e<i.length;e++)n=i[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new gu(t)},e.render=function(e,t,n){if(!vu(t))throw Error(r(200));return xu(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!vu(e))throw Error(r(40));return e._reactRootContainer?(El(function(){xu(null,null,e,!1,function(){e._reactRootContainer=null,e[Pi]=null})}),!0):!1},e.unstable_batchedUpdates=Tl,e.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!vu(n))throw Error(r(200));if(e==null||e._reactInternals===void 0)throw Error(r(38));return xu(e,t,n,!1,i)},e.version=`18.3.1-next-f1338f8080-20240426`})),bn=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=yn()})),xn=o((e=>{var t=bn();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),Sn=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Cn=(...e)=>e.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(` `),wn={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Tn=(0,F.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,F.createElement)(`svg`,{ref:c,...wn,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Cn(`lucide`,i),...s},[...o.map(([e,t])=>(0,F.createElement)(e,t)),...Array.isArray(a)?a:[a]])),z=(e,t)=>{let n=(0,F.forwardRef)(({className:n,...r},i)=>(0,F.createElement)(Tn,{ref:i,iconNode:t,className:Cn(`lucide-${Sn(e)}`,n),...r}));return n.displayName=`${e}`,n},En=z(`Activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Dn=z(`ArrowLeftRight`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),On=z(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),kn=z(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),An=z(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),jn=z(`Braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),Mn=z(`Brain`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z`,key:`ep3f8r`}],[`path`,{d:`M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4`,key:`1p4c4q`}],[`path`,{d:`M17.599 6.5a3 3 0 0 0 .399-1.375`,key:`tmeiqw`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M19.938 10.5a4 4 0 0 1 .585.396`,key:`1qfode`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M19.967 17.484A4 4 0 0 1 18 18`,key:`159ez6`}]]),Nn=z(`Calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),Pn=z(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Fn=z(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),In=z(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Ln=z(`CircleCheckBig`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Rn=z(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),zn=z(`CirclePlay`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polygon`,{points:`10 8 16 12 10 16 10 8`,key:`1cimsy`}]]),Bn=z(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Vn=z(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),Hn=z(`Code`,[[`polyline`,{points:`16 18 22 12 16 6`,key:`z7tu5w`}],[`polyline`,{points:`8 6 2 12 8 18`,key:`1eg1df`}]]),Un=z(`Compass`,[[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Wn=z(`Copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Gn=z(`Cpu`,[[`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`,key:`14l7u7`}],[`rect`,{width:`6`,height:`6`,x:`9`,y:`9`,rx:`1`,key:`5aljv4`}],[`path`,{d:`M15 2v2`,key:`13l42r`}],[`path`,{d:`M15 20v2`,key:`15mkzm`}],[`path`,{d:`M2 15h2`,key:`1gxd5l`}],[`path`,{d:`M2 9h2`,key:`1bbxkp`}],[`path`,{d:`M20 15h2`,key:`19e6y8`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M9 2v2`,key:`165o2o`}],[`path`,{d:`M9 20v2`,key:`i2bqo8`}]]),Kn=z(`Database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),qn=z(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),Jn=z(`Eraser`,[[`path`,{d:`m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21`,key:`182aya`}],[`path`,{d:`M22 21H7`,key:`t4ddhn`}],[`path`,{d:`m5 11 9 9`,key:`1mo9qw`}]]),Yn=z(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Xn=z(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Zn=z(`FileCode`,[[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z`,key:`1mlx9k`}]]),Qn=z(`FileText`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),$n=z(`FileUp`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),er=z(`FolderOpen`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),tr=z(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),nr=z(`GitCompare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),rr=z(`GitMerge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),ir=z(`Hammer`,[[`path`,{d:`m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9`,key:`eefl8a`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`b7pghm`}]]),ar=z(`Heart`,[[`path`,{d:`M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z`,key:`c3ymky`}]]),or=z(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),sr=z(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),cr=z(`Key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),lr=z(`Layers`,[[`path`,{d:`m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z`,key:`8b97xw`}],[`path`,{d:`m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65`,key:`dd6zsq`}],[`path`,{d:`m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65`,key:`ep9fru`}]]),ur=z(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),dr=z(`Lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),fr=z(`Maximize2`,[[`polyline`,{points:`15 3 21 3 21 9`,key:`mznyad`}],[`polyline`,{points:`9 21 3 21 3 15`,key:`1avn1i`}],[`line`,{x1:`21`,x2:`14`,y1:`3`,y2:`10`,key:`ota7mn`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),pr=z(`MessageSquare`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}]]),mr=z(`Minimize2`,[[`polyline`,{points:`4 14 10 14 10 20`,key:`11kfnr`}],[`polyline`,{points:`20 10 14 10 14 4`,key:`rlmsce`}],[`line`,{x1:`14`,x2:`21`,y1:`10`,y2:`3`,key:`o5lafz`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),hr=z(`Moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),gr=z(`Network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),_r=z(`PackagePlus`,[[`path`,{d:`M16 16h6`,key:`100bgy`}],[`path`,{d:`M19 13v6`,key:`85cyf1`}],[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}]]),vr=z(`PackageSearch`,[[`path`,{d:`M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14`,key:`e7tb2h`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`12`,key:`a4e8g8`}],[`circle`,{cx:`18.5`,cy:`15.5`,r:`2.5`,key:`b5zd12`}],[`path`,{d:`M20.27 17.27 22 19`,key:`1l4muz`}]]),yr=z(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),br=z(`Pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),xr=z(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),Sr=z(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Cr=z(`Radio`,[[`path`,{d:`M4.9 19.1C1 15.2 1 8.8 4.9 4.9`,key:`1vaf9d`}],[`path`,{d:`M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5`,key:`u1ii0m`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5`,key:`1j5fej`}],[`path`,{d:`M19.1 4.9C23 8.8 23 15.1 19.1 19`,key:`10b0cb`}]]),wr=z(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Tr=z(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Er=z(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Dr=z(`Send`,[[`path`,{d:`m22 2-7 20-4-9-9-4Z`,key:`1q3vgg`}],[`path`,{d:`M22 2 11 13`,key:`nzbqef`}]]),Or=z(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),kr=z(`Share2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Ar=z(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),jr=z(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Mr=z(`Sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Nr=z(`Table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),Pr=z(`Terminal`,[[`polyline`,{points:`4 17 10 11 4 5`,key:`akl6gq`}],[`line`,{x1:`12`,x2:`20`,y1:`19`,y2:`19`,key:`q2wloq`}]]),Fr=z(`Timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),Ir=z(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),Lr=z(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Rr=z(`Upload`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`17 8 12 3 7 8`,key:`t8dd8p`}],[`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`,key:`widbto`}]]),zr=z(`UserPlus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),Br=z(`User`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Vr=z(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Hr=z(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),Ur=z(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Wr=z(`ZoomIn`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),Gr=z(`ZoomOut`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),Kr=a(xn(),1);function qr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=qr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Jr(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=qr(e))&&(r&&(r+=` `),r+=t);return r}var Yr=(0,F.createContext)(null);function Xr({children:e}){let[t,n]=(0,F.useState)(`dashboard`),[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(null),[l,u]=(0,F.useState)(null);return(0,I.jsx)(Yr.Provider,{value:{page:t,setPage:n,project:r,setProject:i,branchId:a,setBranchId:o,manageToken:s,setManageToken:c,pendingLocalAiMessage:l,setPendingLocalAiMessage:u},children:e})}function Zr(){let e=(0,F.useContext)(Yr);if(!e)throw Error(`useUIState must be used inside UIStateProvider`);return e}var Qr=[{title:`Home`,items:[{id:`dashboard`,label:`Dashboard`,icon:ur}]},{title:`Manage`,items:[{id:`projects`,label:`Projects`,icon:An},{id:`branches`,label:`Branches`,icon:tr},{id:`doctor`,label:`Doctor`,icon:ar},{id:`changelog`,label:`Changelog`,icon:En}]},{title:`Browse`,items:[{id:`configs`,label:`Configs`,icon:jn},{id:`components`,label:`Components`,icon:vr},{id:`storage`,label:`Storage`,icon:Kn},{id:`stream`,label:`Data Streams`,icon:Cr},{id:`jobs`,label:`Jobs`,icon:zn},{id:`search`,label:`Search`,icon:Er}]},{title:`Develop`,items:[{id:`workspaces`,label:`SQL Workspaces`,icon:Pr},{id:`flows`,label:`Flows`,icon:Vr},{id:`schedules`,label:`Schedules`,icon:Nn},{id:`data-apps`,label:`Data Apps`,icon:Gn}]},{title:`Insights`,items:[{id:`lineage`,label:`Lineage`,icon:gr},{id:`semantic-layer`,label:`Semantic Layer`,icon:Kn}]},{title:`AI / Tools`,items:[{id:`mcp`,label:`MCP Tools`,icon:Ar},{id:`localai`,label:`Local AI`,icon:pr},{id:`agents`,label:`Agent Tasks`,icon:kn}]},{title:`Admin`,items:[{id:`org`,label:`Org Setup`,icon:lr},{id:`members`,label:`Members`,icon:Un},{id:`encrypt`,label:`Encrypt`,icon:dr}]}];function $r(){let{page:e,setPage:t}=Zr();return(0,I.jsxs)(`aside`,{className:`w-56 shrink-0 border-r border-zinc-200 bg-white/80 backdrop-blur p-3 overflow-y-auto dark:border-zinc-900 dark:bg-zinc-950/60`,children:[(0,I.jsxs)(`div`,{className:`px-2 py-3 mb-3 border-b border-zinc-200 dark:border-zinc-900`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-keboola animate-pulse`}),(0,I.jsx)(`span`,{className:`text-keboola font-bold tracking-wider text-sm`,children:`kbagent`}),(0,I.jsx)(`span`,{className:`text-zinc-500 text-xs dark:text-zinc-600`,children:`// NERD UI`})]}),(0,I.jsx)(`div`,{className:`text-zinc-500 text-[10px] mt-1`,children:`Keboola kernel + UI`})]}),(0,I.jsx)(`nav`,{className:`space-y-4`,children:Qr.map(n=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-zinc-500 px-2 mb-1 dark:text-zinc-600`,children:n.title}),(0,I.jsx)(`ul`,{className:`space-y-0.5`,children:n.items.map(n=>{let r=n.icon;return(0,I.jsx)(`li`,{children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>t(n.id),className:Jr(`w-full flex items-center gap-2 px-2 py-1.5 rounded text-left text-sm transition-colors`,e===n.id?`bg-keboola/10 text-keboola border border-keboola/30`:`text-zinc-600 hover:bg-zinc-100 hover:text-zinc-900 border border-transparent dark:text-zinc-400 dark:hover:bg-zinc-900 dark:hover:text-zinc-100`),children:[(0,I.jsx)(r,{className:`w-3.5 h-3.5`}),(0,I.jsx)(`span`,{children:n.label})]})},n.id)})})]},n.title))})]})}var ei=class extends Error{code;status;constructor(e,t,n){super(t),this.code=e,this.status=n}},ti=`/api`;function ni(e,t){let n=new URL(`${ti}${e}`,window.location.origin);if(t){for(let[e,r]of Object.entries(t))if(r!=null)if(Array.isArray(r))for(let t of r)n.searchParams.append(e,String(t));else n.searchParams.append(e,String(r))}return n.pathname+n.search}async function ri(e,t,n={}){let r={};n.body!==void 0&&(r[`content-type`]=`application/json`),n.manageToken&&(r[`x-manage-token`]=n.manageToken);let i=await fetch(ni(t,n.query),{method:e,headers:r,body:n.body===void 0?void 0:JSON.stringify(n.body),signal:n.signal,credentials:`include`});if(!i.ok){let e=null;try{e=await i.json()}catch{}let t=e?.error?.message??i.statusText;throw new ei(e?.error?.code??`HTTP_ERROR`,t,i.status)}if(i.status!==204)return(i.headers.get(`content-type`)??``).includes(`application/json`)?await i.json():await i.text()}var B={get:(e,t)=>ri(`GET`,e,t),post:(e,t,n)=>ri(`POST`,e,{...n,body:t}),put:(e,t,n)=>ri(`PUT`,e,{...n,body:t}),patch:(e,t,n)=>ri(`PATCH`,e,{...n,body:t}),delete:(e,t)=>ri(`DELETE`,e,t)};function ii(e,t,n){let r=ni(e,t),i=new EventSource(r,{withCredentials:!0});for(let[e,t]of Object.entries(n))i.addEventListener(e,e=>{try{t(JSON.parse(e.data))}catch(e){console.warn(`SSE event parse failed`,e)}});return i}function ai(e,t,n){let r=new AbortController;return{abort:()=>r.abort(),done:(async()=>{let i=await fetch(ni(e),{method:`POST`,headers:{"content-type":`application/json`,accept:`text/event-stream`},body:JSON.stringify(t),signal:r.signal,credentials:`include`});if(!i.ok||!i.body)throw new ei(`HTTP_ERROR`,i.statusText,i.status);let a=i.body.getReader(),o=new TextDecoder,s=``,c=`message`,l=[],u=()=>{if(l.length===0)return;let e=l.join(`
|
|
10
|
+
`),t=n[c]??n.message;if(t)try{t(JSON.parse(e))}catch{t(e)}c=`message`,l=[]};for(;;){let{value:e,done:t}=await a.read();if(t)break;s+=o.decode(e,{stream:!0});let n;for(;(n=s.indexOf(`
|
|
11
|
+
`))!==-1;){let e=s.slice(0,n).replace(/\r$/,``);if(s=s.slice(n+1),e===``){u();continue}if(e.startsWith(`:`))continue;let t=e.indexOf(`:`);if(t===-1)continue;let r=e.slice(0,t),i=e.slice(t+1).replace(/^ /,``);r===`event`?c=i:r===`data`&&l.push(i)}}u()})()}}function oi(){let e=L({queryKey:[`version`],queryFn:()=>B.get(`/version`),staleTime:5*6e4}).data?.kbagent;return(0,I.jsxs)(`footer`,{className:`h-6 border-t border-zinc-200 bg-white/80 backdrop-blur px-4 flex items-center text-[10px] text-zinc-500 gap-4 dark:border-zinc-900 dark:bg-zinc-950/60 dark:text-zinc-600`,children:[(0,I.jsxs)(`span`,{children:[`kbagent serve `,e?.version??`…`]}),e&&!e.up_to_date?(0,I.jsxs)(`span`,{className:`text-amber-700 dark:text-neon-amber`,children:[`⬆ `,e.latest_version,` available`]}):null,(0,I.jsx)(`span`,{className:`ml-auto`,children:`localhost only ・ bearer auth ・ kernel: python ・ ui: typescript`})]})}var si=(0,F.createContext)(null),ci=`kbagent.theme`;function li(){if(typeof window>`u`)return`dark`;let e=window.localStorage.getItem(ci);return e===`light`||e===`dark`?e:window.matchMedia?.(`(prefers-color-scheme: light)`).matches?`light`:`dark`}function ui(e){let t=document.documentElement;e===`dark`?(t.classList.add(`dark`),t.style.colorScheme=`dark`):(t.classList.remove(`dark`),t.style.colorScheme=`light`)}function di({children:e}){let[t,n]=(0,F.useState)(li);(0,F.useEffect)(()=>{ui(t),window.localStorage.setItem(ci,t)},[t]);let r=(0,F.useCallback)(e=>n(e),[]),i=(0,F.useCallback)(()=>n(e=>e===`dark`?`light`:`dark`),[]);return(0,I.jsx)(si.Provider,{value:{theme:t,toggle:i,setTheme:r},children:e})}function fi(){let e=(0,F.useContext)(si);if(!e)throw Error(`useTheme must be used inside ThemeProvider`);return e}function pi(){let{project:e,setProject:t,branchId:n,setBranchId:r}=Zr(),i=L({queryKey:[`projects`],queryFn:()=>B.get(`/projects`)}),a=L({queryKey:[`branches`,e],queryFn:()=>B.get(`/branches`,{query:{project:e}}),enabled:!!e});(0,F.useEffect)(()=>{if(e)return;let n=i.data?.projects;n?.length&&t((n.find(e=>e.is_default)??n[0]).alias)},[e,i.data,t]);let o=a.data?.branches??[],s=n?o.find(e=>e.id===n)?.name??`#${n}`:`main`;return(0,I.jsxs)(`header`,{className:`relative z-40 border-b border-zinc-200 bg-white/80 backdrop-blur px-4 h-12 flex items-center gap-4 dark:border-zinc-900 dark:bg-zinc-950/40`,children:[(0,I.jsx)(hi,{projects:i.data?.projects??[],current:e,onChange:e=>{t(e),r(null)}}),e?(0,I.jsx)(gi,{branches:o,current:n,label:s,loading:a.isFetching,onChange:r}):null,(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 text-xs text-zinc-500`,children:[(0,I.jsx)(mi,{}),(0,I.jsxs)(`span`,{className:`flex items-center gap-1`,title:`Connected to kbagent serve via the local Node BFF (web/backend)`,children:[(0,I.jsx)(Or,{className:`w-3 h-3 text-keboola`}),` kbagent serve`]})]})]})}function mi(){let{theme:e,toggle:t}=fi(),n=e===`dark`;return(0,I.jsxs)(`button`,{type:`button`,onClick:t,title:`Switch to ${n?`light`:`dark`} mode`,"aria-label":`Toggle color scheme`,className:`flex items-center gap-1 px-2 py-1 rounded border border-zinc-300 text-zinc-700 hover:border-keboola hover:text-keboola dark:border-zinc-700 dark:text-zinc-400`,children:[n?(0,I.jsx)(Mr,{className:`w-3.5 h-3.5`}):(0,I.jsx)(hr,{className:`w-3.5 h-3.5`}),(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider`,children:n?`light`:`dark`})]})}function hi({projects:e,current:t,onChange:n}){let[r,i]=(0,F.useState)(!1),[a,o]=(0,F.useState)(``),s=(0,F.useRef)(null),c=(0,F.useRef)(null);(0,F.useEffect)(()=>{if(!r)return;let e=e=>{s.current?.contains(e.target)||i(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[r]),(0,F.useEffect)(()=>{if(r){let e=setTimeout(()=>c.current?.focus(),0);return()=>clearTimeout(e)}o(``)},[r]);let l=(0,F.useMemo)(()=>{let t=a.trim().toLowerCase();return t?e.filter(e=>`${e.alias} ${e.project_name} ${e.org_name??``}`.toLowerCase().includes(t)):e},[e,a]);return(0,I.jsxs)(`div`,{className:`relative`,ref:s,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:`flex items-center gap-1.5 text-sm hover:text-keboola px-2 py-1 rounded border border-zinc-300 hover:border-keboola/40 dark:border-zinc-800`,children:[(0,I.jsx)(lr,{className:`w-3.5 h-3.5`}),(0,I.jsx)(`span`,{children:t??`select project`}),(0,I.jsx)(Fn,{className:`w-3 h-3 opacity-60`})]}),r?(0,I.jsxs)(`div`,{className:`absolute top-full left-0 mt-1 z-50 w-96 max-h-[28rem] flex flex-col rounded border border-zinc-200 bg-white shadow-xl dark:border-zinc-800 dark:bg-zinc-950`,children:[e.length>5?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-2 border-b border-zinc-200 dark:border-zinc-800`,children:[(0,I.jsx)(Er,{className:`w-3.5 h-3.5 text-zinc-400 flex-shrink-0`}),(0,I.jsx)(`input`,{ref:c,type:`text`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Escape`?a?o(``):i(!1):e.key===`Enter`&&l.length===1&&(n(l[0].alias),i(!1))},placeholder:`filter ${e.length} projects (alias, name, org)`,className:`flex-1 bg-transparent text-sm focus:outline-none placeholder-zinc-400 dark:placeholder-zinc-600`}),a?(0,I.jsxs)(`span`,{className:`text-[10px] text-zinc-500 flex-shrink-0`,children:[l.length,`/`,e.length]}):null]}):null,(0,I.jsx)(`div`,{className:`overflow-y-auto`,children:e.length===0?(0,I.jsx)(`div`,{className:`px-3 py-4 text-xs text-zinc-500`,children:`No projects. Add one via the Projects page.`}):l.length===0?(0,I.jsxs)(`div`,{className:`px-3 py-4 text-xs text-zinc-500`,children:[`No project matches “`,a,`”.`]}):l.map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>{n(e.alias),i(!1)},className:`w-full text-left px-3 py-2 text-sm flex items-center justify-between gap-2 hover:bg-zinc-100 dark:hover:bg-zinc-900 ${e.alias===t?`text-keboola`:`text-zinc-700 dark:text-zinc-300`}`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`div`,{className:`font-medium truncate`,children:e.alias}),(0,I.jsxs)(`div`,{className:`text-xs text-zinc-500 truncate`,children:[e.project_name,e.org_name?(0,I.jsxs)(`span`,{className:`text-zinc-400`,children:[` · `,e.org_name]}):e.org_id==null?null:(0,I.jsxs)(`span`,{className:`text-zinc-400`,children:[` · org #`,e.org_id]})]})]}),e.is_default?(0,I.jsx)(`span`,{className:`nerd-pill-green flex-shrink-0`,children:`default`}):null]},e.alias))})]}):null]})}function gi({branches:e,current:t,label:n,loading:r,onChange:i}){let[a,o]=(0,F.useState)(!1),s=(0,F.useRef)(null);(0,F.useEffect)(()=>{if(!a)return;let e=e=>{s.current?.contains(e.target)||o(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[a]);let c=t!==null;return(0,I.jsxs)(`div`,{className:`relative`,ref:s,children:[(0,I.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`flex items-center gap-1.5 text-sm px-2.5 py-1 rounded border ${c?`border-neon-amber/60 bg-neon-amber/10 text-amber-700 hover:bg-neon-amber/20 dark:text-neon-amber`:`border-zinc-300 text-zinc-600 hover:text-keboola hover:border-keboola/40 dark:border-zinc-800 dark:text-zinc-400`}`,children:[(0,I.jsx)(tr,{className:`w-3.5 h-3.5`}),(0,I.jsx)(`span`,{className:`font-medium`,children:n}),c?(0,I.jsx)(`span`,{className:`text-[9px] uppercase tracking-wider px-1 py-0.5 rounded bg-neon-amber/20 border border-neon-amber/40`,children:`DEV`}):(0,I.jsx)(`span`,{className:`text-[9px] uppercase tracking-wider text-zinc-500 dark:text-zinc-600`,children:`prod`}),r?(0,I.jsx)(`span`,{className:`text-xs text-zinc-600`,children:`...`}):null,(0,I.jsx)(Fn,{className:`w-3 h-3 opacity-60`})]}),a?(0,I.jsxs)(`div`,{className:`absolute top-full left-0 mt-1 z-50 w-64 max-h-72 overflow-y-auto rounded border border-zinc-200 bg-white shadow-xl dark:border-zinc-800 dark:bg-zinc-950`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>{i(null),o(!1)},className:`w-full text-left px-3 py-2 text-sm hover:bg-zinc-100 dark:hover:bg-zinc-900 ${t===null?`text-keboola`:`text-zinc-700 dark:text-zinc-300`}`,children:`main (production)`}),e.filter(e=>!e.isDefault).map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>{i(e.id),o(!1)},className:`w-full text-left px-3 py-2 text-sm hover:bg-zinc-100 dark:hover:bg-zinc-900 ${t===e.id?`text-keboola`:`text-zinc-700 dark:text-zinc-300`}`,children:[(0,I.jsx)(`div`,{children:e.name}),(0,I.jsxs)(`div`,{className:`text-xs text-zinc-500`,children:[`#`,e.id]})]},e.id))]}):null]})}function _i({children:e}){return(0,I.jsxs)(`div`,{className:`h-screen flex flex-col`,children:[(0,I.jsxs)(`div`,{className:`flex-1 flex overflow-hidden`,children:[(0,I.jsx)($r,{}),(0,I.jsxs)(`main`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,I.jsx)(pi,{}),(0,I.jsx)(`div`,{className:`flex-1 overflow-auto p-6`,children:e})]})]}),(0,I.jsx)(oi,{})]})}function vi(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var yi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi={};function Si(e,t){return((t||xi).jsx?bi:yi).test(e)}var Ci=/[ \t\n\f\r]/g;function wi(e){return typeof e==`object`?e.type===`text`?Ti(e.value):!1:Ti(e)}function Ti(e){return e.replace(Ci,``)===``}var Ei=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Ei.prototype.normal={},Ei.prototype.property={},Ei.prototype.space=void 0;function Di(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Ei(n,r,t)}function Oi(e){return e.toLowerCase()}var ki=class{constructor(e,t){this.attribute=t,this.property=e}};ki.prototype.attribute=``,ki.prototype.booleanish=!1,ki.prototype.boolean=!1,ki.prototype.commaOrSpaceSeparated=!1,ki.prototype.commaSeparated=!1,ki.prototype.defined=!1,ki.prototype.mustUseProperty=!1,ki.prototype.number=!1,ki.prototype.overloadedBoolean=!1,ki.prototype.property=``,ki.prototype.spaceSeparated=!1,ki.prototype.space=void 0;var Ai=t({boolean:()=>V,booleanish:()=>Mi,commaOrSpaceSeparated:()=>Fi,commaSeparated:()=>Pi,number:()=>H,overloadedBoolean:()=>Ni,spaceSeparated:()=>U}),ji=0,V=Ii(),Mi=Ii(),Ni=Ii(),H=Ii(),U=Ii(),Pi=Ii(),Fi=Ii();function Ii(){return 2**++ji}var Li=Object.keys(Ai),Ri=class extends ki{constructor(e,t,n,r){let i=-1;if(super(e,t),zi(this,`space`,r),typeof n==`number`)for(;++i<Li.length;){let e=Li[i];zi(this,Li[i],(n&Ai[e])===Ai[e])}}};Ri.prototype.defined=!0;function zi(e,t,n){n&&(e[t]=n)}function Bi(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Ri(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Oi(r)]=r,n[Oi(a.attribute)]=r}return new Ei(t,n,e.space)}var Vi=Bi({properties:{ariaActiveDescendant:null,ariaAtomic:Mi,ariaAutoComplete:null,ariaBusy:Mi,ariaChecked:Mi,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:U,ariaCurrent:null,ariaDescribedBy:U,ariaDetails:null,ariaDisabled:Mi,ariaDropEffect:U,ariaErrorMessage:null,ariaExpanded:Mi,ariaFlowTo:U,ariaGrabbed:Mi,ariaHasPopup:null,ariaHidden:Mi,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U,ariaLevel:H,ariaLive:null,ariaModal:Mi,ariaMultiLine:Mi,ariaMultiSelectable:Mi,ariaOrientation:null,ariaOwns:U,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:Mi,ariaReadOnly:Mi,ariaRelevant:null,ariaRequired:Mi,ariaRoleDescription:U,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:Mi,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Hi(e,t){return t in e?e[t]:t}function Ui(e,t){return Hi(e,t.toLowerCase())}var Wi=Bi({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Pi,acceptCharset:U,accessKey:U,action:null,allow:null,allowFullScreen:V,allowPaymentRequest:V,allowUserMedia:V,alt:null,as:null,async:V,autoCapitalize:null,autoComplete:U,autoFocus:V,autoPlay:V,blocking:U,capture:null,charSet:null,checked:V,cite:null,className:U,cols:H,colSpan:null,content:null,contentEditable:Mi,controls:V,controlsList:U,coords:H|Pi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:V,defer:V,dir:null,dirName:null,disabled:V,download:Ni,draggable:Mi,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:V,formTarget:null,headers:U,height:H,hidden:Ni,high:H,href:null,hrefLang:null,htmlFor:U,httpEquiv:U,id:null,imageSizes:null,imageSrcSet:null,inert:V,inputMode:null,integrity:null,is:null,isMap:V,itemId:null,itemProp:U,itemRef:U,itemScope:V,itemType:U,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:V,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:V,muted:V,name:null,nonce:null,noModule:V,noValidate:V,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:V,optimum:H,pattern:null,ping:U,placeholder:null,playsInline:V,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:V,referrerPolicy:null,rel:U,required:V,reversed:V,rows:H,rowSpan:H,sandbox:U,scope:null,scoped:V,seamless:V,selected:V,shadowRootClonable:V,shadowRootDelegatesFocus:V,shadowRootMode:null,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:Mi,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:V,useMap:null,value:Mi,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:V,declare:V,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:V,noHref:V,noShade:V,noWrap:V,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:Mi,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:V,disableRemotePlayback:V,prefix:null,property:null,results:H,security:null,unselectable:null},space:`html`,transform:Ui}),Gi=Bi({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Fi,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:U,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:V,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pi,g2:Pi,glyphName:Pi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:Fi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fi,rev:Fi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fi,requiredFeatures:Fi,requiredFonts:Fi,requiredFormats:Fi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:Fi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fi,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Hi}),Ki=Bi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),qi=Bi({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Ui}),Ji=Bi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Yi={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Xi=/[A-Z]/g,Zi=/-[a-z]/g,Qi=/^data[-\w.:]+$/i;function $i(e,t){let n=Oi(t),r=t,i=ki;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Qi.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Zi,ta);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Zi.test(e)){let n=e.replace(Xi,ea);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ri}return new i(r,t)}function ea(e){return`-`+e.toLowerCase()}function ta(e){return e.charAt(1).toUpperCase()}var na=Di([Vi,Wi,Ki,qi,Ji],`html`),ra=Di([Vi,Gi,Ki,qi,Ji],`svg`);function ia(e){return e.join(` `).trim()}var aa=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
|
|
12
|
+
`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),oa=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(aa());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),sa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),ca=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(oa()),r=sa();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),la=da(`end`),ua=da(`start`);function da(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function fa(e){let t=ua(e),n=la(e);if(t&&n)return{start:t,end:n}}function pa(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ha(e.position):`start`in e||`end`in e?ha(e):`line`in e||`column`in e?ma(e):``}function ma(e){return ga(e&&e.line)+`:`+ga(e&&e.column)}function ha(e){return ma(e&&e.start)+`-`+ma(e&&e.end)}function ga(e){return e&&typeof e==`number`?e:1}var _a=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=pa(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};_a.prototype.file=``,_a.prototype.name=``,_a.prototype.reason=``,_a.prototype.message=``,_a.prototype.stack=``,_a.prototype.column=void 0,_a.prototype.line=void 0,_a.prototype.ancestors=void 0,_a.prototype.cause=void 0,_a.prototype.fatal=void 0,_a.prototype.place=void 0,_a.prototype.ruleId=void 0,_a.prototype.source=void 0;var va=a(ca(),1),ya={}.hasOwnProperty,ba=new Map,xa=/[A-Z]/g,Sa=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ca=new Set([`td`,`th`]);function wa(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Fa(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Pa(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?ra:na,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ta(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ta(e,t,n){if(t.type===`element`)return Ea(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Da(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return ka(e,t,n);if(t.type===`mdxjsEsm`)return Oa(e,t);if(t.type===`root`)return Aa(e,t,n);if(t.type===`text`)return ja(e,t)}function Ea(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=ra,e.schema=i),e.ancestors.push(t);let a=Va(e,t.tagName,!1),o=Ia(e,t),s=Ra(e,t);return Sa.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!wi(e):!0})),Ma(e,o,a,t),Na(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Da(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Ha(e,t.position)}function Oa(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ha(e,t.position)}function ka(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=ra,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Va(e,t.name,!0),o=La(e,t),s=Ra(e,t);return Ma(e,o,a,t),Na(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Aa(e,t,n){let r={};return Na(r,Ra(e,t)),e.create(t,e.Fragment,r,n)}function ja(e,t){return t.value}function Ma(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Na(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Pa(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Fa(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ua(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Ia(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ya.call(t.properties,i)){let a=za(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ca.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function La(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Ha(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Ha(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Ra(e,t){let n=[],r=-1,i=e.passKeys?new Map:ba;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Ta(e,a,o);s!==void 0&&n.push(s)}return n}function za(e,t,n){let r=$i(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?vi(n):ia(n)),r.property===`style`){let t=typeof n==`object`?n:Ba(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Ua(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Yi[r.property]||r.property:r.attribute,n]}}function Ba(e,t){try{return(0,va.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new _a("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function Va(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Si(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Si(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ya.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ha(e)}function Ha(e,t){let n=new _a("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function Ua(e){let t={},n;for(n in e)ya.call(e,n)&&(t[Wa(n)]=e[n]);return t}function Wa(e){let t=e.replace(xa,Ga);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Ga(e){return`-`+e.toLowerCase()}var Ka={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},qa={};function Ja(e,t){let n=t||qa;return Ya(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Ya(e,t,n){if(Za(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Xa(e.children,t,n)}return Array.isArray(e)?Xa(e,t,n):``}function Xa(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Ya(e[i],t,n);return r.join(``)}function Za(e){return!!(e&&typeof e==`object`)}var Qa=document.createElement(`i`);function $a(e){let t=`&`+e+`;`;Qa.innerHTML=t;let n=Qa.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function eo(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function to(e,t){return e.length>0?(eo(e,e.length,0,t),e):t}var no={}.hasOwnProperty;function ro(e){let t={},n=-1;for(;++n<e.length;)io(t,e[n]);return t}function io(e,t){let n;for(n in t){let r=(no.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){no.call(r,a)||(r[a]=[]);let e=i[a];ao(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ao(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);eo(e,0,0,r)}function oo(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function so(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var co=q(/[A-Za-z]/),lo=q(/[\dA-Za-z]/),uo=q(/[#-'*+\--9=?A-Z^-~]/);function fo(e){return e!==null&&(e<32||e===127)}var po=q(/\d/),mo=q(/[\dA-Fa-f]/),ho=q(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function K(e){return e===-2||e===-1||e===32}var go=q(/\p{P}|\p{S}/u),_o=q(/\s/);function q(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function vo(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&lo(e.charCodeAt(n+1))&&lo(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function J(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return K(r)?(e.enter(n),s(r)):t(r)}function s(r){return K(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var yo={tokenize:bo};function bo(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return W(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var xo={tokenize:Co},So={tokenize:wo};function Co(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return eo(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(So,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(So,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return W(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;eo(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function wo(e,t,n){return J(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function To(e){if(e===null||G(e)||_o(e))return 1;if(go(e))return 2}function Eo(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Do={name:`attention`,resolveAll:Oo,tokenize:ko};function Oo(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Ao(d,-c),Ao(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=to(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=to(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=to(l,Eo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=to(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=to(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,eo(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ko(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=To(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=To(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Ao(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var jo={name:`autolink`,tokenize:Mo};function Mo(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return co(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||lo(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||lo(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||fo(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):uo(t)?(e.consume(t),l):n(t)}function u(e){return lo(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||lo(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var No={partial:!0,tokenize:Po};function Po(e,t,n){return r;function r(t){return K(t)?J(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||W(e)?t(e):n(e)}}var Fo={continuation:{tokenize:Lo},exit:Ro,name:`blockQuote`,tokenize:Io};function Io(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return K(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Lo(e,t,n){let r=this;return i;function i(t){return K(t)?J(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Fo,t,n)(r)}}function Ro(e){e.exit(`blockQuote`)}var zo={name:`characterEscape`,tokenize:Bo};function Bo(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return ho(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Vo={name:`characterReference`,tokenize:Ho};function Ho(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=lo,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=mo,u):(e.enter(`characterReferenceValue`),a=7,o=po,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===lo&&!$a(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Uo={partial:!0,tokenize:Ko},Wo={concrete:!0,name:`codeFenced`,tokenize:Go};function Go(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),K(t)?J(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||W(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Uo,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),J(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||W(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&K(t)?J(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||W(t)?e.check(Uo,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||W(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),K(t)?J(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),K(t)?J(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||W(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Ko(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var qo={name:`codeIndented`,tokenize:Yo},Jo={partial:!0,tokenize:Xo};function Yo(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),J(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):W(t)?e.attempt(Jo,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||W(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Xo(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):J(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):W(e)?i(e):n(e)}}var Zo={name:`codeText`,previous:$o,resolve:Qo,tokenize:es};function Qo(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function $o(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function es(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||W(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var ts=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&ns(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),ns(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ns(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);ns(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);ns(this.left,t.reverse())}}};function ns(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function rs(e){let t={},n=-1,r,i,a,o,s,c,l,u=new ts(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,is(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return eo(e,0,1/0,u.slice(0)),!l}function is(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var as={resolve:ss,tokenize:cs},os={partial:!0,tokenize:ls};function ss(e){return rs(e),e}function cs(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):W(t)?e.check(os,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function ls(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,a,`linePrefix`)}function a(i){if(i===null||W(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function us(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||fo(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||W(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||G(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||fo(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function ds(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):W(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||W(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!K(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function fs(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||W(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function ps(e,t){let n;return r;function r(i){return W(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):K(i)?J(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var ms={name:`definition`,tokenize:gs},hs={partial:!0,tokenize:_s};function gs(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ds.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=so(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return G(t)?ps(e,l)(t):l(t)}function l(t){return us(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(hs,d,d)(t)}function d(t){return K(t)?J(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||W(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function _s(e,t,n){return r;function r(t){return G(t)?ps(e,i)(t):n(t)}function i(t){return fs(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return K(t)?J(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||W(e)?t(e):n(e)}}var vs={name:`hardBreakEscape`,tokenize:ys};function ys(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return W(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var bs={name:`headingAtx`,resolve:xs,tokenize:Ss};function xs(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},eo(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Ss(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||G(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||W(n)?(e.exit(`atxHeading`),t(n)):K(n)?J(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||G(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Cs=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),ws=[`pre`,`script`,`style`,`textarea`],Ts={concrete:!0,name:`htmlFlow`,resolveTo:Os,tokenize:ks},Es={partial:!0,tokenize:js},Ds={partial:!0,tokenize:As};function Os(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ks(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:re):co(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):co(a)?(e.consume(a),i=4,r.interrupt?t:re):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:re):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return co(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||G(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ws.includes(l)?(i=1,r.interrupt?t(s):O(s)):Cs.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||lo(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return K(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||co(t)?(e.consume(t),b):K(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||lo(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):K(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):K(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||W(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||G(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||K(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||W(t)?O(t):K(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),ne):t===60&&i===1?(e.consume(t),A):t===62&&i===4?(e.consume(t),N):t===63&&i===3?(e.consume(t),re):t===93&&i===5?(e.consume(t),M):W(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Es,ie,k)(t)):t===null||W(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Ds,ee,ie)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||W(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function ne(t){return t===45?(e.consume(t),re):O(t)}function A(t){return t===47?(e.consume(t),o=``,j):O(t)}function j(t){if(t===62){let n=o.toLowerCase();return ws.includes(n)?(e.consume(t),N):O(t)}return co(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),j):O(t)}function M(t){return t===93?(e.consume(t),re):O(t)}function re(t){return t===62?(e.consume(t),N):t===45&&i===2?(e.consume(t),re):O(t)}function N(t){return t===null||W(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),N)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function As(e,t,n){let r=this;return i;function i(t){return W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function js(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(No,t,n)}}var Ms={name:`htmlText`,tokenize:Ns};function Ns(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):co(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):co(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):W(t)?(o=d,A(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ne(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):W(t)?(o=h,A(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ne(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ne(t):W(t)?(o=v,A(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):W(t)?(o=y,A(t)):(e.consume(t),y)}function b(e){return e===62?ne(e):y(e)}function x(t){return co(t)?(e.consume(t),S):n(t)}function S(t){return t===45||lo(t)?(e.consume(t),S):C(t)}function C(t){return W(t)?(o=C,A(t)):K(t)?(e.consume(t),C):ne(t)}function w(t){return t===45||lo(t)?(e.consume(t),w):t===47||t===62||G(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ne):t===58||t===95||co(t)?(e.consume(t),E):W(t)?(o=T,A(t)):K(t)?(e.consume(t),T):ne(t)}function E(t){return t===45||t===46||t===58||t===95||lo(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):W(t)?(o=D,A(t)):K(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):W(t)?(o=O,A(t)):K(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):W(t)?(o=k,A(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||G(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||G(e)?T(e):n(e)}function ne(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function A(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return K(t)?J(e,M,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):M(t)}function M(t){return e.enter(`htmlTextData`),o(t)}}var Ps={name:`labelEnd`,resolveAll:Rs,resolveTo:zs,tokenize:Bs},Fs={tokenize:Vs},Is={tokenize:Hs},Ls={tokenize:Us};function Rs(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&eo(e,0,e.length,n),e}function zs(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=to(s,e.slice(a+1,a+r+3)),s=to(s,[[`enter`,u,t]]),s=to(s,Eo(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=to(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=to(s,e.slice(o+1)),s=to(s,[[`exit`,c,t]]),eo(e,a,e.length,s),e}function Bs(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(so(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Fs,u,o?u:d)(t):t===91?e.attempt(Is,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Ls,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Vs(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return G(t)?ps(e,a)(t):a(t)}function a(t){return t===41?u(t):us(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return G(t)?ps(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?fs(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return G(t)?ps(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Hs(e,t,n){let r=this;return i;function i(t){return ds.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(so(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Us(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Ws={name:`labelStartImage`,resolveAll:Ps.resolveAll,tokenize:Gs};function Gs(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Ks={name:`labelStartLink`,resolveAll:Ps.resolveAll,tokenize:qs};function qs(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Js={name:`lineEnding`,tokenize:Ys};function Ys(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}}var Xs={name:`thematicBreak`,tokenize:Zs};function Zs(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||W(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),K(t)?J(e,s,`whitespace`)(t):s(t))}}var Qs={continuation:{tokenize:nc},exit:ic,name:`list`,tokenize:tc},$s={partial:!0,tokenize:ac},ec={partial:!0,tokenize:rc};function tc(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:po(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Xs,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return po(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(No,r.interrupt?n:u,e.attempt($s,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return K(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function nc(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(No,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,J(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!K(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ec,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,J(e,e.attempt(Qs,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function rc(e,t,n){let r=this;return J(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ic(e){e.exit(this.containerState.type)}function ac(e,t,n){let r=this;return J(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!K(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var oc={name:`setextUnderline`,resolveTo:sc,tokenize:cc};function sc(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function cc(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),K(t)?J(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||W(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var lc={tokenize:uc};function uc(e){let t=this,n=e.attempt(No,r,e.attempt(this.parser.constructs.flowInitial,i,J(e,e.attempt(this.parser.constructs.flow,i,e.attempt(as,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var dc={resolveAll:Y()},fc=mc(`string`),pc=mc(`text`);function mc(e){return{resolveAll:Y(e===`text`?hc:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Y(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function hc(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var gc=t({attentionMarkers:()=>wc,contentInitial:()=>vc,disable:()=>Tc,document:()=>_c,flow:()=>bc,flowInitial:()=>yc,insideSpan:()=>Cc,string:()=>xc,text:()=>Sc}),_c={42:Qs,43:Qs,45:Qs,48:Qs,49:Qs,50:Qs,51:Qs,52:Qs,53:Qs,54:Qs,55:Qs,56:Qs,57:Qs,62:Fo},vc={91:ms},yc={[-2]:qo,[-1]:qo,32:qo},bc={35:bs,42:Xs,45:[oc,Xs],60:Ts,61:oc,95:Xs,96:Wo,126:Wo},xc={38:Vo,92:zo},Sc={[-5]:Js,[-4]:Js,[-3]:Js,33:Ws,38:Vo,42:Do,60:[jo,Ms],91:Ks,92:[vs,zo],93:Ps,95:Do,96:Zo},Cc={null:[Do,dc]},wc={null:[42,95]},Tc={null:[]};function Ec(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=to(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Eo(a,l.events,l),l.events):[]}function f(e,t){return Oc(p(e),t)}function p(e){return Dc(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){W(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&eo(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Dc(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Oc(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
13
|
+
`;break;case-3:o=`\r
|
|
14
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function kc(e){let t={constructs:ro([gc,...(e||{}).extensions||[]]),content:n(yo),defined:[],document:n(xo),flow:n(lc),lazy:{},string:n(fc),text:n(pc)};return t;function n(e){return n;function n(n){return Ec(t,e,n)}}}function Ac(e){for(;!rs(e););return e}var jc=/[\0\t\n\r]/g;function Mc(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(jc.lastIndex=u,c=jc.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Nc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Pc(e){return e.replace(Nc,Fc)}function Fc(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return oo(n.slice(t?2:1),t?16:10)}return $a(n)||e}var Ic={}.hasOwnProperty;function Lc(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Rc(n)(Ac(kc(n).document().write(Mc()(e,t,!0))))}function Rc(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(xe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(_e),blockQuote:a(fe),characterEscape:T,characterReference:T,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(me,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(he),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ge),hardBreakEscape:a(ve),hardBreakTrailing:a(ve),htmlFlow:a(ye,o),htmlFlowData:T,htmlText:a(ye,o),htmlTextData:T,image:a(be),label:o,link:a(xe),listItem:a(Ce),listItemValue:f,listOrdered:a(Se,d),listUnordered:a(Se),paragraph:a(we),reference:ae,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(Te),thematicBreak:a(De)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(te),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(ee),htmlTextData:E,image:c(A),label:M,labelText:j,lineEnding:D,link:c(ne),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:re,resourceTitleString:N,resource:ie,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Bc(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Ic.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Hc).call(a,void 0,e[0])}for(r.position={start:zc(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:zc(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:zc(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Hc).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+pa({start:e.start,end:e.end})+`): it’s not open`);n.position.end=zc(e.end)}function u(){return Ja(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=so(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ee(),n.position={start:zc(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=zc(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=zc(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Pc(t),n.identifier=so(t).toLowerCase()}function M(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function N(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=so(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=oo(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=$a(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=zc(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[]}}function pe(){return{type:`code`,lang:null,meta:null,value:``}}function me(){return{type:`inlineCode`,value:``}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ge(){return{type:`emphasis`,children:[]}}function _e(){return{type:`heading`,depth:0,children:[]}}function ve(){return{type:`break`}}function ye(){return{type:`html`,value:``}}function be(){return{type:`image`,title:null,url:``,alt:null}}function xe(){return{type:`link`,title:null,url:``,children:[]}}function Se(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Ce(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function we(){return{type:`paragraph`,children:[]}}function Te(){return{type:`strong`,children:[]}}function Ee(){return{type:`text`,value:``}}function De(){return{type:`thematicBreak`}}}function zc(e){return{line:e.line,column:e.column,offset:e.offset}}function Bc(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Bc(e,r):Vc(e,r)}}function Vc(e,t){let n;for(n in t)if(Ic.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Hc(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+pa({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+pa({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+pa({start:t.start,end:t.end})+`) is still open`)}function Uc(e){let t=this;t.parser=n;function n(n){return Lc(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function X(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Wc(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
15
|
+
`}]}function Gc(e,t){let n=t.value?t.value+`
|
|
16
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Kc(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qc(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jc(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=vo(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Yc(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xc(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Zc(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Qc(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Zc(e,t);let i={src:vo(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function $c(e,t){let n={src:vo(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function el(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function tl(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Zc(e,t);let i={href:vo(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function nl(e,t){let n={href:vo(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function rl(e,t,n){let r=e.all(t),i=n?il(n):al(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
17
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
18
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function il(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=al(n[r])}return t}function al(e){return e.spread??e.children.length>1}function ol(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function sl(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cl(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ll(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ul(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=ua(t.children[1]),o=la(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function dl(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function fl(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var pl=9,ml=32;function hl(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(gl(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(gl(t.slice(i),i>0,!1)),a.join(``)}function gl(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===pl||t===ml;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===pl||t===ml;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function _l(e,t){let n={type:`text`,value:hl(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function vl(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var yl={blockquote:X,break:Wc,code:Gc,delete:Kc,emphasis:qc,footnoteReference:Jc,heading:Yc,html:Xc,imageReference:Qc,image:$c,inlineCode:el,linkReference:tl,link:nl,listItem:rl,list:ol,paragraph:sl,root:cl,strong:ll,table:ul,tableCell:fl,tableRow:dl,text:_l,thematicBreak:vl,toml:bl,yaml:bl,definition:bl,footnoteDefinition:bl};function bl(){}var xl=typeof self==`object`?self:globalThis,Sl=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new xl[e](t)},Cl=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(Sl(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(Sl(a,o),i)};return r},wl=e=>Cl(new Map,e)(0),Tl=``,{toString:El}={},{keys:Dl}=Object,Ol=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=El.call(e).slice(8,-1);switch(n){case`Array`:return[1,Tl];case`Object`:return[2,Tl];case`Date`:return[3,Tl];case`RegExp`:return[4,Tl];case`Map`:return[5,Tl];case`Set`:return[6,Tl];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},kl=([e,t])=>e===0&&(t===`function`||t===`symbol`),Al=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Ol(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Dl(r))(e||!kl(Ol(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(kl(Ol(n))||kl(Ol(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!kl(Ol(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},jl=(e,{json:t,lossy:n}={})=>{let r=[];return Al(!(t||n),!!t,new Map,r)(e),r},Ml=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?wl(jl(e,t)):structuredClone(e):(e,t)=>wl(jl(e,t));function Nl(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Pl(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Fl(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Nl,r=e.options.footnoteBackLabel||Pl,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=vo(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Ml(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
19
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
20
|
+
`}]}}var Il=(function(e){if(e==null)return Vl;if(typeof e==`function`)return Bl(e);if(typeof e==`object`)return Array.isArray(e)?Ll(e):Rl(e);if(typeof e==`string`)return zl(e);throw Error(`Expected function, string, or object as test`)});function Ll(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Il(e[n]);return Bl(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Rl(e){let t=e;return Bl(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function zl(e){return Bl(t);function t(t){return t&&t.type===e}}function Bl(e){return t;function t(t,n,r){return!!(Hl(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Vl(){return!0}function Hl(e){return typeof e==`object`&&!!e&&`type`in e}function Ul(e){return e}var Wl=[];function Gl(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Il(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Ul(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Wl,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Kl(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Kl(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Wl:[e]}function ql(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Gl(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Jl={}.hasOwnProperty,Yl={};function Xl(e,t){let n=t||Yl,r=new Map,i=new Map,a={all:s,applyData:Ql,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...yl,...n.handlers},one:o,options:n,patch:Zl,wrap:eu};return ql(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Jl.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Ml(n);return r.children=a.all(e),r}return Ml(e)}return(a.options.unknownHandler||$l)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=tu(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=tu(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Zl(e,t){e.position&&(t.position=fa(e))}function Ql(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Ml(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function $l(e,t){let n=t.data||{},r=`value`in t&&!(Jl.call(n,`hProperties`)||Jl.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function eu(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
21
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
22
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
23
|
+
`}),n}function tu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function nu(e,t){let n=Xl(e,t),r=n.one(e,void 0),i=Fl(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
24
|
+
`},i)),a}function ru(e,t){return e&&`run`in e?async function(n,r){let i=nu(n,{file:r,...t});await e.run(i,r)}:function(n,r){return nu(n,{file:r,...e||t})}}function iu(e){if(e)throw e}var au=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function ou(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function su(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?cu(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function cu(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var lu={basename:uu,dirname:du,extname:fu,join:pu,sep:`/`};function uu(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);gu(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function du(e){if(gu(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function fu(e){gu(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function pu(...e){let t=-1,n;for(;++t<e.length;)gu(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:mu(n)}function mu(e){gu(e);let t=e.codePointAt(0)===47,n=hu(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function hu(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function gu(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var _u={cwd:vu};function vu(){return`/`}function yu(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function bu(e){if(typeof e==`string`)e=new URL(e);else if(!yu(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return xu(e)}function xu(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Su=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Cu=class{constructor(e){let t;t=e?yu(e)?{path:e}:typeof e==`string`||Du(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:_u.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Su.length;){let e=Su[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Su.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?lu.basename(this.path):void 0}set basename(e){Tu(e,`basename`),wu(e,`basename`),this.path=lu.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?lu.dirname(this.path):void 0}set dirname(e){Eu(this.basename,`dirname`),this.path=lu.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?lu.extname(this.path):void 0}set extname(e){if(wu(e,`extname`),Eu(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=lu.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){yu(e)&&(e=bu(e)),Tu(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?lu.basename(this.path,this.extname):void 0}set stem(e){Tu(e,`stem`),wu(e,`stem`),this.path=lu.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new _a(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function wu(e,t){if(e&&e.includes(lu.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+lu.sep+"`")}function Tu(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Eu(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Du(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Ou=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),ku=a(au(),1),Au={}.hasOwnProperty,ju=new class e extends Ou{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=su()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,ku.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Pu(`data`,this.frozen),this.namespace[e]=t,this):Au.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Pu(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Lu(e),n=this.parser||this.Parser;return Mu(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Mu(`process`,this.parser||this.Parser),Nu(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Lu(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);zu(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Mu(`processSync`,this.parser||this.Parser),Nu(`processSync`,this.compiler||this.Compiler),this.process(e,r),Iu(`processSync`,`process`,t),n;function r(e,r){t=!0,iu(e),n=r}}run(e,t,n){Fu(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Lu(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Iu(`runSync`,`run`,n),r;function i(e,t){iu(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Lu(t),r=this.compiler||this.Compiler;return Nu(`stringify`,r),Fu(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Pu(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,ku.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];ou(o)&&ou(r)&&(r=(0,ku.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Mu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Nu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Pu(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Fu(e){if(!ou(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Iu(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Lu(e){return Ru(e)?e:new Cu(e)}function Ru(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function zu(e){return typeof e==`string`||Bu(e)}function Bu(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Vu=[],Hu={allowDangerousHtml:!0},Uu=/^(https?|ircs?|mailto|xmpp)$/i,Wu=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Gu(e){let t=Ku(e),n=qu(e);return Ju(t.runSync(t.parse(n),n),e)}function Ku(e){let t=e.rehypePlugins||Vu,n=e.remarkPlugins||Vu,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Hu}:Hu;return ju().use(Uc).use(n).use(ru,r).use(t)}function qu(e){let t=e.children||``,n=new Cu;return typeof t==`string`?n.value=t:``+t,n}function Ju(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Yu;for(let e of Wu)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return ql(e,l),wa(e,{Fragment:I.Fragment,components:i,ignoreInvalidStyle:!0,jsx:I.jsx,jsxs:I.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Ka)if(Object.hasOwn(Ka,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Ka[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Yu(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Uu.test(e.slice(0,t))?e:``}function Xu(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Zu(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Qu(e,t,n){let r=Il((n||{}).ignore||[]),i=$u(t),a=-1;for(;++a<i.length;)Gl(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function $u(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([ed(e[0]),td(e[1])])}return t}function ed(e){return typeof e==`string`?new RegExp(Zu(e),`g`):e}function td(e){return typeof e==`function`?e:function(){return e}}var nd=`phrasing`,rd=[`autolink`,`link`,`image`,`label`];function id(){return{transforms:[fd],enter:{literalAutolink:od,literalAutolinkEmail:sd,literalAutolinkHttp:sd,literalAutolinkWww:sd},exit:{literalAutolink:dd,literalAutolinkEmail:ud,literalAutolinkHttp:cd,literalAutolinkWww:ld}}}function ad(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:nd,notInConstruct:rd},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:nd,notInConstruct:rd},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:nd,notInConstruct:rd}]}}function od(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function sd(e){this.config.enter.autolinkProtocol.call(this,e)}function cd(e){this.config.exit.autolinkProtocol.call(this,e)}function ld(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function ud(e){this.config.exit.autolinkEmail.call(this,e)}function dd(e){this.exit(e)}function fd(e){Qu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,pd],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,md]],{ignore:[`link`,`linkReference`]})}function pd(e,t,n,r,i){let a=``;if(!_d(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!hd(n)))return!1;let o=gd(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function md(e,t,n,r){return!_d(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function hd(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function gd(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Xu(e,`(`),a=Xu(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function _d(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||_o(n)||go(n))&&(!t||n!==47)}Dd.peek=Ed;function vd(){this.buffer()}function yd(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function bd(){this.buffer()}function xd(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Sd(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=so(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Cd(e){this.exit(e)}function wd(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=so(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Td(e){this.exit(e)}function Ed(){return`[`}function Dd(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Od(){return{enter:{gfmFootnoteCallString:vd,gfmFootnoteCall:yd,gfmFootnoteDefinitionLabelString:bd,gfmFootnoteDefinition:xd},exit:{gfmFootnoteCallString:Sd,gfmFootnoteCall:Cd,gfmFootnoteDefinitionLabelString:wd,gfmFootnoteDefinition:Td}}}function kd(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Dd},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
25
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?jd:Ad))),s(),o}}function Ad(e,t,n){return t===0?e:jd(e,t,n)}function jd(e,t,n){return(n?``:` `)+e}var Md=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Ld.peek=Rd;function Nd(){return{canContainEols:[`delete`],enter:{strikethrough:Fd},exit:{strikethrough:Id}}}function Pd(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Md}],handlers:{delete:Ld}}}function Fd(e){this.enter({type:`delete`,children:[]},e)}function Id(e){this.exit(e)}function Ld(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Rd(){return`~`}function zd(e){return e.length}function Bd(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||zd,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Vd(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Hd(r[d]);else{let e=Hd(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
26
|
+
`)}function Vd(e){return e==null?``:String(e)}function Hd(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Ud(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Wd);return i(),o}function Wd(e,t,n){return`>`+(n?``:` `)+e}function Gd(e,t){return Kd(e,t.inConstruct,!0)&&!Kd(e,t.notInConstruct,!1)}function Kd(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function qd(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
27
|
+
`&&Gd(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
28
|
+
`}function Jd(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Yd(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Xd(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Zd(e,t,n,r){let i=Xd(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Yd(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Qd);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Jd(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
29
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
30
|
+
`),a&&(u+=s.move(a+`
|
|
31
|
+
`)),u+=s.move(c),l(),u}function Qd(e,t,n){return(n?``:` `)+e}function $d(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ef(e,t,n,r){let i=$d(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
32
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function tf(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function nf(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function rf(e,t,n){let r=To(e),i=To(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}af.peek=of;function af(e,t,n,r){let i=tf(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=rf(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=nf(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=rf(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+nf(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function of(e,t,n){return n.options.emphasis||`*`}function sf(e,t){let n=!1;return ql(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Ja(e)&&(t.options.setext||n))}function cf(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(sf(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
33
|
+
`,after:`
|
|
34
|
+
`});return r(),t(),o+`
|
|
35
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
36
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
37
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=nf(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}lf.peek=uf;function lf(e){return e.value||``}function uf(){return`<`}df.peek=ff;function df(e,t,n,r){let i=$d(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function ff(){return`!`}pf.peek=mf;function pf(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function mf(){return`!`}hf.peek=gf;function hf(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function gf(){return"`"}function _f(e,t){let n=Ja(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}vf.peek=yf;function vf(e,t,n,r){let i=$d(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(_f(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function yf(e,t,n){return _f(e,n)?`<`:`[`}bf.peek=xf;function bf(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function xf(){return`[`}function Sf(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Cf(e){let t=Sf(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function wf(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Tf(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ef(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?wf(n):Sf(n),s=e.ordered?o===`.`?`)`:`.`:Cf(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Tf(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Df(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Of(e,t,n,r){let i=Df(n),a=n.bulletCurrent||Sf(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function kf(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Af=Il([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function jf(e,t,n,r){return(e.children.some(function(e){return Af(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Mf(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Nf.peek=Pf;function Nf(e,t,n,r){let i=Mf(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=rf(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=nf(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=rf(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+nf(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Pf(e,t,n){return n.options.strong||`*`}function Ff(e,t,n,r){return n.safe(e.value,r)}function If(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Lf(e,t,n){let r=(Tf(n)+(n.options.ruleSpaces?` `:``)).repeat(If(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Rf={blockquote:Ud,break:qd,code:Zd,definition:ef,emphasis:af,hardBreak:qd,heading:cf,html:lf,image:df,imageReference:pf,inlineCode:hf,link:vf,linkReference:bf,list:Ef,listItem:Of,paragraph:kf,root:jf,strong:Nf,text:Ff,thematicBreak:Lf};function zf(){return{enter:{table:Bf,tableData:Wf,tableHeader:Wf,tableRow:Hf},exit:{codeText:Gf,table:Vf,tableData:Uf,tableHeader:Uf,tableRow:Uf}}}function Bf(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Vf(e){this.exit(e),this.data.inTable=void 0}function Hf(e){this.enter({type:`tableRow`,children:[]},e)}function Uf(e){this.exit(e)}function Wf(e){this.enter({type:`tableCell`,children:[]},e)}function Gf(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Kf));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Kf(e,t){return t===`|`?t:e}function qf(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
38
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
39
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Bd(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Rf.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Jf(){return{exit:{taskListCheckValueChecked:Xf,taskListCheckValueUnchecked:Xf,paragraph:Zf}}}function Yf(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Qf}}}function Xf(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Zf(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Qf(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Rf.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function $f(){return[id(),Od(),Nd(),zf(),Jf()]}function ep(e){return{extensions:[ad(),kd(e),Pd(),qf(e),Yf()]}}var tp={tokenize:hp,partial:!0},np={tokenize:gp,partial:!0},rp={tokenize:_p,partial:!0},ip={tokenize:vp,partial:!0},ap={tokenize:yp,partial:!0},op={name:`wwwAutolink`,tokenize:pp,previous:bp},sp={name:`protocolAutolink`,tokenize:mp,previous:xp},cp={name:`emailAutolink`,tokenize:fp,previous:Sp},lp={};function up(){return{text:lp}}for(var dp=48;dp<123;)lp[dp]=cp,dp++,dp===58?dp=65:dp===91&&(dp=97);lp[43]=cp,lp[45]=cp,lp[46]=cp,lp[95]=cp,lp[72]=[cp,sp],lp[104]=[cp,sp],lp[87]=[cp,op],lp[119]=[cp,op];function fp(e,t,n){let r=this,i,a;return o;function o(t){return!Cp(t)||!Sp.call(r,r.previous)||wp(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Cp(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(ap,u,l)(t):t===45||t===95||lo(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&co(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function pp(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!bp.call(r,r.previous)||wp(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(tp,e.attempt(np,e.attempt(rp,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function mp(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&xp.call(r,r.previous)&&!wp(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(co(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||fo(t)||G(t)||_o(t)||go(t)?n(t):e.attempt(np,e.attempt(rp,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function hp(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function gp(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(ip,c,s)(t):t===null||G(t)||_o(t)||t!==45&&go(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function _p(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(ip,t,a)(o):o===null||G(o)||_o(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function vp(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||G(o)||_o(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||G(e)||_o(e)?t(e):r(e)}function a(e){return co(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):co(t)?(e.consume(t),o):n(t)}}function yp(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return lo(e)?n(e):t(e)}}function bp(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function xp(e){return!co(e)}function Sp(e){return!(e===47||Cp(e))}function Cp(e){return e===43||e===45||e===46||e===95||lo(e)}function wp(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Tp={tokenize:Np,partial:!0};function Ep(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Ap,continuation:{tokenize:jp},exit:Mp}},text:{91:{name:`gfmFootnoteCall`,tokenize:kp},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Dp,resolveTo:Op}}}}function Dp(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=so(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Op(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function kp(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||G(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(so(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return G(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Ap(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||G(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=so(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return G(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),J(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function jp(e,t,n){return e.check(No,t,e.attempt(Tp,t,n))}function Mp(e){e.exit(`gfmFootnoteDefinition`)}function Np(e,t,n){let r=this;return J(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Pp(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&eo(o,o.length,0,Eo(s,e.slice(r+1,n),t)),eo(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),eo(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=To(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=To(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Fp=class{constructor(){this.map=[]}add(e,t,n){Ip(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Ip(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Lp(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Rp(){return{flow:{null:{name:`table`,tokenize:zp,resolveAll:Bp}}}}function zp(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):W(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):K(t)?J(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||G(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,K(t)?J(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return K(t)?J(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||W(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return K(t)?J(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||W(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||W(n)?(e.exit(`tableRow`),t(n)):K(n)?J(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||G(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Bp(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Fp;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Hp(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Vp(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Vp(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Vp(f,t,o,i,n,d)):(o[0]=o[1],d=Vp(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Hp(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Lp(t.events,n))}return e}function Vp(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Up(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Up(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Up(t.events,n[2]),a=Up(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Up(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Hp(e,t,n,r,i){let a=[],o=Up(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Up(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Wp={name:`tasklistCheck`,tokenize:Kp};function Gp(){return{text:{91:Wp}}}function Kp(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return G(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return W(r)?t(r):K(r)?e.check({tokenize:qp},t,n)(r):n(r)}}function qp(e,t,n){return J(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Jp(e){return ro([up(),Ep(),Pp(e),Rp(),Gp()])}var Yp={};function Xp(e){let t=this,n=e||Yp,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Jp(n)),a.push($f()),o.push(ep(n))}var Zp=[Xp],Qp=500,$p=2;function em(e){if(!e||e.length<Qp)return!1;let t=0;/^\s{0,3}#{1,4}\s+\S/m.test(e)&&t++;let n=e.match(/^[^\n|]*\|[^\n|]*\|[^\n]*$/gm);n&&n.length>=2&&t++;let r=e.match(/^(?:[ \t]*[-*+]\s|\s*\d+\.\s)\S/gm);r&&r.length>=3&&t++;let i=e.match(/\*\*[^*\n]{2,}?\*\*/g);return i&&i.length>=2&&t++,e.length>=1e3&&t++,t>=$p}function tm(e){let t=[];for(let n of e){let e=n.rawText;if(!e||!em(e))continue;let r=e.match(/^\s{0,3}#{1,4}\s+(.+)$/m)?.[1]?.trim()??n.title;t.push({stepId:n.id,title:r.slice(0,120),content:e,sourceKind:n.kind,ts:n.ts,sizeChars:e.length})}return t}function nm({text:e}){return em(e)?(0,I.jsx)(`div`,{className:`markdown-body text-xs`,children:(0,I.jsx)(Gu,{remarkPlugins:Zp,children:e})}):(0,I.jsx)(`pre`,{className:`whitespace-pre-wrap text-xs`,children:e})}function rm(e,t,n=`text/markdown`){let r=new Blob([e],{type:`${n};charset=utf-8`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(i),0)}function im(e,t,n){return`${e}-${t.replace(/[^a-zA-Z0-9._-]+/g,`-`).slice(0,60).replace(/^-+|-+$/g,``)||`step`}.${n}`}function am({text:e,filenameStem:t,className:n}){let[r,i]=(0,F.useState)(!1);return(0,I.jsxs)(`div`,{className:`flex items-center gap-1 ${n??``}`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch(n){console.warn(`clipboard write rejected, falling back to download`,n),rm(e,im(`kbagent`,t,`md`))}},className:`nerd-btn !px-2 !py-0.5 text-[10px] inline-flex items-center gap-1`,title:`Copy markdown to clipboard`,children:r?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Pn,{className:`w-3 h-3 text-keboola`}),(0,I.jsx)(`span`,{className:`text-keboola`,children:`Copied`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Wn,{className:`w-3 h-3`}),(0,I.jsx)(`span`,{children:`Copy`})]})}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>rm(e,im(`kbagent`,t,`md`)),className:`nerd-btn !px-2 !py-0.5 text-[10px] inline-flex items-center gap-1`,title:`Download as Markdown file`,children:[(0,I.jsx)(qn,{className:`w-3 h-3`}),(0,I.jsx)(`span`,{children:`.md`})]})]})}function om({artifact:e,onClose:t,onJumpToStep:n}){return(0,F.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(e.stopImmediatePropagation(),t())};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},[t]),(0,I.jsx)(`div`,{className:`fixed inset-0 z-[60] bg-zinc-900/70 backdrop-blur-sm flex items-center justify-center p-4`,onClick:t,children:(0,I.jsxs)(`div`,{style:{maxWidth:`90vw`,maxHeight:`92vh`},className:`bg-white dark:bg-zinc-950 border border-zinc-200 dark:border-zinc-800 rounded shadow-2xl w-full flex flex-col`,onClick:e=>e.stopPropagation(),children:[(0,I.jsxs)(`div`,{className:`px-4 py-3 border-b border-zinc-200 dark:border-zinc-800 flex items-center justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500`,children:`artifact`}),(0,I.jsx)(`div`,{className:`text-sm font-mono truncate`,children:e.title})]}),(0,I.jsx)(am,{text:e.content,filenameStem:e.title,className:`shrink-0`}),n?(0,I.jsxs)(`button`,{type:`button`,onClick:()=>{n(e.stepId),t()},className:`nerd-btn !px-2 !py-0.5 text-[10px] shrink-0`,title:`Show the underlying step in the timeline`,children:[(0,I.jsx)(In,{className:`w-3 h-3 inline mr-0.5`}),`View step`]}):null,(0,I.jsx)(`button`,{type:`button`,onClick:t,className:`nerd-btn !px-2 !py-0.5 text-[10px] shrink-0`,title:`Close (Esc)`,children:(0,I.jsx)(Ur,{className:`w-3 h-3`})})]}),(0,I.jsx)(`div`,{className:`overflow-auto flex-1 px-8 py-6`,children:(0,I.jsx)(`div`,{className:`markdown-body markdown-body-lg max-w-3xl mx-auto`,children:(0,I.jsx)(Gu,{remarkPlugins:Zp,children:e.content})})})]})})}function sm({artifacts:e,onJumpToStep:t}){let[n,r]=(0,F.useState)(null),i=e.find(e=>e.stepId===n)??null;return e.length===0?(0,I.jsxs)(`div`,{className:`border border-zinc-200 rounded bg-white dark:border-zinc-800 dark:bg-zinc-900/30 px-6 py-10 text-center`,children:[(0,I.jsx)(Qn,{className:`w-8 h-8 mx-auto text-zinc-400 dark:text-zinc-600 mb-2`}),(0,I.jsx)(`div`,{className:`text-sm text-zinc-600 dark:text-zinc-400`,children:`No markdown reports detected in this run.`}),(0,I.jsxs)(`div`,{className:`text-[11px] text-zinc-500 mt-1`,children:[`Artifacts are step bodies ≥ `,Qp,` chars that start with a heading (`,(0,I.jsx)(`code`,{className:`font-mono`,children:`#`}),` or `,(0,I.jsx)(`code`,{className:`font-mono`,children:`##`}),`).`]})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:e.map(e=>(0,I.jsx)(cm,{artifact:e,onOpen:()=>r(e.stepId)},e.stepId))}),i?(0,I.jsx)(om,{artifact:i,onClose:()=>r(null),onJumpToStep:t}):null]})}function cm({artifact:e,onOpen:t}){let n=e.content.split(`
|
|
40
|
+
`).filter(e=>e.trim().length>0&&!e.trim().startsWith(`#`)).join(` `).slice(0,200)||`(no preview)`;return(0,I.jsxs)(`div`,{className:`border border-zinc-200 rounded bg-white dark:border-zinc-800 dark:bg-zinc-900/30 flex flex-col`,children:[(0,I.jsxs)(`div`,{className:`px-3 py-2 border-b border-zinc-200 dark:border-zinc-800 flex items-start gap-2`,children:[(0,I.jsx)(Qn,{className:`w-4 h-4 text-keboola shrink-0 mt-0.5`}),(0,I.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:t,className:`text-sm font-medium text-left hover:text-keboola truncate block w-full`,title:e.title,children:e.title}),(0,I.jsxs)(`div`,{className:`text-[10px] text-zinc-500 mt-0.5 flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`uppercase tracking-wider`,children:e.sourceKind}),(0,I.jsx)(`span`,{children:`·`}),(0,I.jsxs)(`span`,{className:`tabular-nums`,children:[e.sizeChars.toLocaleString(),` ch`]}),e.ts==null?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{children:`·`}),(0,I.jsxs)(`span`,{className:`font-mono tabular-nums`,children:[`+`,e.ts,`s`]})]})]})]})]}),(0,I.jsx)(`div`,{className:`px-3 py-2 text-[11px] text-zinc-600 dark:text-zinc-400 line-clamp-3 flex-1`,children:n}),(0,I.jsxs)(`div`,{className:`px-3 py-2 border-t border-zinc-100 dark:border-zinc-900 flex items-center justify-between gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:t,className:`nerd-btn !px-2 !py-0.5 text-[10px]`,children:`Open`}),(0,I.jsx)(am,{text:e.content,filenameStem:e.title})]})]})}function lm(e){let t=[],n={};return e.forEach((e,r)=>{let i=e.data??{},a=typeof e.at==`number`?Math.round(e.at/100)/10:void 0;if(e.event===`init`){t.push({id:`${r}-init`,kind:`session`,title:`Run started`,subtitle:typeof i.action_type==`string`?`(${i.action_type})`:void 0,eventIndex:r,ts:a});return}if(e.event===`stderr`)return;if(e.event===`done`){let e=i.status??`ok`;t.push({id:`${r}-done`,kind:`result`,title:e===`ok`?`Run finished`:`Run failed: ${i.error??`?`}`,subtitle:typeof i.elapsed_seconds==`number`?`${i.elapsed_seconds}s`:typeof i.exit_code==`number`?`exit ${i.exit_code}`:void 0,status:e===`ok`?`ok`:`error`,eventIndex:r,ts:a});return}let o=typeof i.type==`string`?i.type:null;if(o===`system`&&i.subtype===`init`){let e=i.tools?.length??0;t.push({id:`${r}-system-init`,kind:`session`,title:`Session initialized`,subtitle:`model ${String(i.model??`?`)} · ${e} tools available`,eventIndex:r,ts:a});return}if(o===`assistant`){((i.message??{}).content??[]).forEach((e,i)=>{let o=`${r}-${i}`;if(e.type===`thinking`){let n=String(e.thinking??``);t.push({id:`${o}-think`,kind:`thinking`,title:n.split(`
|
|
41
|
+
`)[0]?.slice(0,80)||`(thinking)`,subtitle:n.length>80?`${n.length} chars`:void 0,eventIndex:r,ts:a,rawText:n,detail:(0,I.jsx)(nm,{text:n})})}else if(e.type===`text`){let n=String(e.text??``);t.push({id:`${o}-text`,kind:`text`,title:n.split(`
|
|
42
|
+
`)[0]?.slice(0,80)||`(empty)`,subtitle:n.length>80?`${n.length} chars`:void 0,eventIndex:r,ts:a,rawText:n,detail:(0,I.jsx)(nm,{text:n})})}else if(e.type===`tool_use`){let i=String(e.name??`?`),s=e.input??{},c=t.length;t.push({id:`${o}-tool`,kind:`tool`,title:i,subtitle:um(i,s),status:`running`,eventIndex:r,toolName:i,ts:a,detail:(0,I.jsx)(`div`,{className:`space-y-2`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500 mb-1`,children:`input`}),(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap text-xs`,children:JSON.stringify(s,null,2)})]})})}),typeof e.id==`string`&&(n[e.id]={stepIdx:c,input:s})}});return}o===`user`&&((i.message??{}).content??[]).forEach(e=>{if(e.type!==`tool_result`)return;let r=typeof e.tool_use_id==`string`?e.tool_use_id:null,i=e.is_error===!0,a=Array.isArray(e.content)?e.content.map(e=>e.text??``).join(``):String(e.content??``);if(r&&n[r]){let{stepIdx:e,input:o}=n[r],s=t[e];s.status=i?`error`:`ok`,s.toolResult={isError:i,text:a},s.rawText=a,s.detail=(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500 mb-1`,children:`input`}),(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap text-xs`,children:JSON.stringify(o,null,2)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`text-[10px] uppercase tracking-wider mb-1 ${i?`text-red-500`:`text-zinc-500`}`,children:[`output `,i?`(error)`:``]}),(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap text-xs ${i?`border-red-300 dark:border-red-700/40`:``}`,style:{maxHeight:`320px`},children:a})]})]})}})}),t}function um(e,t){if(!t||typeof t!=`object`)return;let n=t,r=typeof n.command==`string`?n.command:typeof n.file_path==`string`?n.file_path:typeof n.url==`string`?n.url:typeof n.query==`string`?n.query:typeof n.pattern==`string`?n.pattern:typeof n.path==`string`?n.path:null;if(r)return r.length>70?`${r.slice(0,70)}…`:r;let i=Object.keys(n);if(i.length!==0)return`${i.length} ${i.length===1?`key`:`keys`}`}function dm(e){return e==null||!Number.isFinite(e)?`$0.00`:e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function fm(e){return e?e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`:`0`}function pm({events:e,running:t=!1,elapsed:n=0,summary:r,onCancel:i}){let a=(0,F.useMemo)(()=>lm(e),[e]),o=(0,F.useMemo)(()=>tm(a),[a]),[s,c]=(0,F.useState)(`timeline`),l=(0,F.useMemo)(()=>{let e={},t=0,n=0;for(let r of a)r.kind===`tool`&&r.toolName&&(e[r.toolName]=(e[r.toolName]??0)+1,t++,r.status===`error`&&n++);return{tools:{count:t,by_tool:e,errors:n}}},[a]),u=r??l,[d,f]=(0,F.useState)(null),p=a[a.length-1]?.id??null,m=(0,F.useRef)(null),h=(d===p?null:d)===null;(0,F.useEffect)(()=>{h?m.current=null:m.current===null&&(m.current=a.length)},[h,a.length]);let g=!h&&m.current!==null?Math.max(0,a.length-m.current):0,_=h?a[a.length-1]??null:a.find(e=>e.id===d)??null;return(0,I.jsxs)(`div`,{className:`space-y-3`,children:[o.length>0?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-zinc-200 dark:border-zinc-800`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>c(`timeline`),className:`px-3 py-1.5 text-xs uppercase tracking-wider border-b-2 -mb-px ${s===`timeline`?`border-keboola text-keboola`:`border-transparent text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300`}`,children:`Timeline`}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>c(`artifacts`),className:`px-3 py-1.5 text-xs uppercase tracking-wider border-b-2 -mb-px inline-flex items-center gap-1.5 ${s===`artifacts`?`border-keboola text-keboola`:`border-transparent text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300`}`,children:[(0,I.jsx)(Qn,{className:`w-3 h-3`}),`Artifacts`,(0,I.jsx)(`span`,{className:`tabular-nums bg-keboola/10 text-keboola px-1.5 rounded`,children:o.length})]})]}):null,s===`artifacts`?(0,I.jsx)(sm,{artifacts:o,onJumpToStep:e=>{f(e),c(`timeline`)}}):(0,I.jsx)(mm,{steps:a,showStep:_,selectedId:d,setSelectedId:f,isLiveTail:h,newSinceCount:g,running:t,elapsed:n,effectiveSummary:u,onCancel:i,resumeLiveTail:()=>f(null)})]})}function mm({steps:e,showStep:t,selectedId:n,setSelectedId:r,isLiveTail:i,newSinceCount:a,running:o,elapsed:s,effectiveSummary:c,onCancel:l,resumeLiveTail:u}){return(0,I.jsxs)(`div`,{className:`grid grid-cols-12 gap-3 min-h-[24rem]`,children:[(0,I.jsxs)(`div`,{className:`col-span-4 border border-zinc-200 rounded bg-white dark:border-zinc-800 dark:bg-zinc-900/30 flex flex-col`,children:[(0,I.jsxs)(`div`,{className:`px-3 py-2 border-b border-zinc-200 dark:border-zinc-800 flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,I.jsx)(`span`,{className:`w-2 h-2 rounded-full shrink-0 ${o?`bg-neon-pink animate-pulse`:`bg-zinc-400 dark:bg-zinc-600`}`}),(0,I.jsx)(`span`,{className:`text-xs uppercase tracking-wider truncate`,children:o?`running · ${s}s`:`${e.length} steps`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[o&&!i?(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn !px-2 !py-0.5 text-[10px] !border-neon-pink/60 !text-neon-pink hover:!bg-neon-pink/10`,onClick:u,title:`Jump back to the most recent step and resume auto-following`,children:[(0,I.jsx)(Fn,{className:`w-3 h-3 inline mr-1`}),`Live tail`,a>0?(0,I.jsxs)(`span`,{className:`ml-1 tabular-nums`,children:[`+`,a]}):null]}):null,o&&l?(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn !px-2 !py-0.5 text-[10px] hover:text-red-500`,onClick:l,title:`Stop the run`,children:[(0,I.jsx)(Ur,{className:`w-3 h-3 inline mr-1`}),`cancel`]}):null]})]}),(0,I.jsx)(hm,{steps:e,showStepId:t?.id??null,isLiveTail:i,running:o,onSelect:e=>r(e)})]}),(0,I.jsxs)(`div`,{className:`col-span-5 border border-zinc-200 rounded bg-white dark:border-zinc-800 dark:bg-zinc-900/30 flex flex-col`,children:[(0,I.jsxs)(`div`,{className:`px-3 py-2 border-b border-zinc-200 dark:border-zinc-800 flex items-start justify-between gap-2`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`div`,{className:`text-xs uppercase tracking-wider text-zinc-500`,children:`step detail`}),t?(0,I.jsxs)(`div`,{className:`text-sm font-mono mt-0.5 truncate`,children:[t.title,t.subtitle?(0,I.jsx)(`span`,{className:`text-zinc-500 ml-2`,children:t.subtitle}):null]}):(0,I.jsx)(`div`,{className:`text-sm text-zinc-500 mt-0.5`,children:`select a step`})]}),t?.rawText?(0,I.jsx)(am,{text:t.rawText,filenameStem:t.title,className:`shrink-0`}):null]}),(0,I.jsx)(`div`,{className:`overflow-auto flex-1 p-3`,style:{maxHeight:`calc(100vh - 18rem)`},children:t?.detail??(0,I.jsx)(`div`,{className:`text-xs text-zinc-500`,children:`No body for this step.`})})]}),(0,I.jsxs)(`div`,{className:`col-span-3 space-y-3`,children:[(0,I.jsx)(_m,{summary:c,running:o}),(0,I.jsx)(ym,{summary:c})]})]})}function hm({steps:e,showStepId:t,isLiveTail:n,running:r,onSelect:i}){let a=(0,F.useRef)(null),o=(0,F.useRef)(null);return(0,F.useEffect)(()=>{if(!n)return;let t=e[e.length-1];if(!t||t.id===o.current)return;let r=a.current;r&&(r.scrollTop=r.scrollHeight,o.current=t.id)},[e,n]),(0,I.jsx)(`div`,{ref:a,className:`overflow-auto flex-1`,style:{maxHeight:`calc(100vh - 18rem)`},children:e.length===0?(0,I.jsx)(`div`,{className:`px-3 py-6 text-xs text-zinc-500 text-center`,children:r?`waiting for first event…`:`no steps recorded`}):(0,I.jsx)(`ul`,{className:`divide-y divide-zinc-100 dark:divide-zinc-900`,children:e.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:`w-full text-left px-3 py-2 flex items-start gap-2 hover:bg-zinc-50 dark:hover:bg-zinc-900/50 ${t===e.id?`bg-zinc-50 dark:bg-zinc-900/60 border-l-2 border-l-neon-pink`:`border-l-2 border-l-transparent`}`,children:[(0,I.jsx)(gm,{kind:e.kind,status:e.status}),(0,I.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-xs flex items-center gap-1`,children:e.kind===`tool`?(0,I.jsx)(`span`,{className:`font-mono text-keboola`,children:e.title}):e.kind===`thinking`?(0,I.jsx)(`span`,{className:`text-zinc-700 dark:text-zinc-300 italic`,children:e.title}):e.kind===`result`?(0,I.jsx)(`span`,{className:`font-bold ${e.status===`ok`?`text-keboola`:`text-red-600 dark:text-red-400`}`,children:e.title}):(0,I.jsx)(`span`,{className:`text-zinc-700 dark:text-zinc-300`,children:e.title})}),e.subtitle?(0,I.jsx)(`div`,{className:`text-[10px] text-zinc-500 truncate`,children:e.subtitle}):null]}),e.ts==null?null:(0,I.jsxs)(`span`,{className:`text-[10px] text-zinc-400 dark:text-zinc-600 font-mono shrink-0`,children:[`+`,e.ts,`s`]})]})},e.id))})})}function gm({kind:e,status:t}){return e===`thinking`?(0,I.jsx)(Mn,{className:`w-3.5 h-3.5 text-neon-pink shrink-0 mt-0.5`}):e===`tool`?(0,I.jsx)(Hr,{className:`w-3.5 h-3.5 shrink-0 mt-0.5 ${t===`error`?`text-red-500`:t===`running`?`text-neon-pink animate-pulse`:`text-keboola`}`}):e===`session`?(0,I.jsx)(In,{className:`w-3.5 h-3.5 text-zinc-500 shrink-0 mt-0.5`}):e===`result`?(0,I.jsx)(En,{className:`w-3.5 h-3.5 shrink-0 mt-0.5 ${t===`ok`?`text-keboola`:`text-red-500`}`}):(0,I.jsx)(In,{className:`w-3.5 h-3.5 text-zinc-400 shrink-0 mt-0.5`})}function _m({summary:e,running:t}){let n=e.tokens,r=e.cost_usd,i=e.model??`—`,a=e.model_recognized===!1;return(0,I.jsxs)(`div`,{className:`border border-zinc-200 rounded bg-white dark:border-zinc-800 dark:bg-zinc-900/30`,children:[(0,I.jsxs)(`div`,{className:`px-3 py-2 border-b border-zinc-200 dark:border-zinc-800 flex items-center justify-between`,children:[(0,I.jsx)(`div`,{className:`text-xs uppercase tracking-wider text-zinc-500`,children:`cost`}),r?.source===`claude_result`?(0,I.jsx)(`span`,{className:`text-[9px] uppercase text-keboola border border-keboola/40 px-1 rounded`,children:`authoritative`}):a?(0,I.jsx)(`span`,{className:`text-[9px] uppercase text-amber-600 border border-amber-400/60 px-1 rounded dark:text-neon-amber dark:border-neon-amber/40`,children:`approx`}):null]}),(0,I.jsxs)(`div`,{className:`px-3 py-3`,children:[(0,I.jsx)(`div`,{className:`text-2xl font-bold text-keboola tabular-nums`,children:r?dm(r.total):t?`…`:`—`}),(0,I.jsx)(`div`,{className:`text-[10px] text-zinc-500 mt-0.5 truncate`,title:i,children:i}),n?(0,I.jsxs)(`div`,{className:`mt-3 space-y-1 text-[11px]`,children:[(0,I.jsx)(vm,{label:`input`,value:fm(n.input),cost:r?.input}),(0,I.jsx)(vm,{label:`output`,value:fm(n.output),cost:r?.output}),n.cache_create>0?(0,I.jsx)(vm,{label:`cache write`,value:fm(n.cache_create),cost:r?.cache_create}):null,n.cache_read>0?(0,I.jsx)(vm,{label:`cache read`,value:fm(n.cache_read),cost:r?.cache_read,hint:`saved $$`}):null,(0,I.jsxs)(`div`,{className:`pt-1 mt-1 border-t border-zinc-100 dark:border-zinc-800 flex justify-between font-bold`,children:[(0,I.jsx)(`span`,{className:`text-zinc-500`,children:`total`}),(0,I.jsxs)(`span`,{className:`tabular-nums`,children:[fm(n.total),` tok`]})]})]}):(0,I.jsx)(`div`,{className:`text-[10px] text-zinc-500 mt-3`,children:t?`tokens reported on each turn…`:`no token data`})]})]})}function vm({label:e,value:t,cost:n,hint:r}){return(0,I.jsxs)(`div`,{className:`flex justify-between items-baseline`,children:[(0,I.jsx)(`span`,{className:`text-zinc-500`,children:e}),(0,I.jsxs)(`span`,{className:`tabular-nums text-zinc-700 dark:text-zinc-300`,children:[t,` `,n==null?null:(0,I.jsx)(`span`,{className:`text-zinc-400 dark:text-zinc-600 ml-1`,children:dm(n)}),r?(0,I.jsx)(`span`,{className:`text-keboola ml-1 text-[9px] uppercase`,children:r}):null]})]})}function ym({summary:e}){let t=e.tools;if(!t)return null;let n=Object.entries(t.by_tool).sort(([,e],[,t])=>t-e);return(0,I.jsxs)(`div`,{className:`border border-zinc-200 rounded bg-white dark:border-zinc-800 dark:bg-zinc-900/30`,children:[(0,I.jsxs)(`div`,{className:`px-3 py-2 border-b border-zinc-200 dark:border-zinc-800 flex items-center justify-between`,children:[(0,I.jsx)(`div`,{className:`text-xs uppercase tracking-wider text-zinc-500`,children:`tools used`}),(0,I.jsxs)(`div`,{className:`text-[10px] text-zinc-500`,children:[t.count,` call`,t.count===1?``:`s`,t.errors>0?(0,I.jsxs)(`span`,{className:`text-red-500 ml-2`,children:[t.errors,` err`]}):null]})]}),(0,I.jsx)(`div`,{className:`px-3 py-2 space-y-1 text-xs`,children:n.length===0?(0,I.jsx)(`div`,{className:`text-zinc-500`,children:`No tool calls yet.`}):n.map(([e,t])=>(0,I.jsxs)(`div`,{className:`flex justify-between`,children:[(0,I.jsx)(`span`,{className:`font-mono text-zinc-700 dark:text-zinc-300`,children:e}),(0,I.jsxs)(`span`,{className:`tabular-nums text-zinc-500`,children:[`×`,t]})]},e))})]})}function bm({events:e}){let[t,n]=(0,F.useState)(!1);return(0,I.jsxs)(`details`,{open:t,onToggle:e=>n(e.currentTarget.open),className:`border border-zinc-200 rounded bg-white dark:border-zinc-800 dark:bg-zinc-900/30`,children:[(0,I.jsxs)(`summary`,{className:`px-3 py-2 cursor-pointer text-xs uppercase tracking-wider text-zinc-500 select-none`,children:[`raw events (`,e.length,`)`]}),t?(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre overflow-auto text-[10px]`,style:{maxHeight:`320px`},children:e.map(e=>`${typeof e.at==`number`?`+${(e.at/1e3).toFixed(1)}s `:``}[${e.event}] ${JSON.stringify(e.data)}`).join(`
|
|
43
|
+
`)}):null]})}var xm=bn();function Sm({open:e,title:t,subtitle:n,width:r=`75vw`,onClose:i,actions:a,children:o}){if((0,F.useEffect)(()=>{if(!e)return;let t=e=>{e.key===`Escape`&&i()};return window.addEventListener(`keydown`,t),document.body.style.overflow=`hidden`,()=>{window.removeEventListener(`keydown`,t),document.body.style.overflow=``}},[e,i]),!e)return null;let s=r.startsWith(`max-w-`);return(0,xm.createPortal)((0,I.jsxs)(`div`,{className:`fixed inset-0 z-50 flex bg-zinc-900/50 backdrop-blur-sm dark:bg-black/70`,children:[(0,I.jsx)(`div`,{className:`flex-1`,onClick:i,role:`presentation`}),(0,I.jsxs)(`aside`,{style:s?void 0:{maxWidth:r},className:`relative w-full ${s?r:``} h-full bg-white border-l border-zinc-200 shadow-2xl flex flex-col dark:bg-zinc-950 dark:border-zinc-800`,children:[(0,I.jsxs)(`header`,{className:`flex items-start justify-between gap-3 p-4 border-b border-zinc-200 shrink-0 dark:border-zinc-900`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`font-bold text-keboola text-base`,children:t}),n?(0,I.jsx)(`p`,{className:`text-xs text-zinc-500 mt-1`,children:n}):null]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[a,(0,I.jsx)(`button`,{type:`button`,onClick:i,className:`text-zinc-500 hover:text-zinc-900 p-1 dark:hover:text-zinc-100`,"aria-label":`Close`,children:(0,I.jsx)(Ur,{className:`w-4 h-4`})})]})]}),(0,I.jsx)(`div`,{className:`flex-1 overflow-auto p-4`,children:o})]})]}),document.body)}function Cm({headline:e,subline:t,paths:n}){return(0,I.jsxs)(`div`,{className:`py-12 max-w-4xl mx-auto`,children:[(0,I.jsxs)(`div`,{className:`text-center mb-10`,children:[(0,I.jsx)(`h2`,{className:`text-2xl font-bold text-zinc-900 dark:text-zinc-100`,children:e}),t?(0,I.jsx)(`p`,{className:`text-zinc-500 mt-2 text-sm`,children:t}):null]}),(0,I.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:n.map((e,t)=>(0,I.jsxs)(`div`,{className:`nerd-card hover:border-keboola/40 transition-colors flex flex-col text-center py-8`,children:[e.badge?(0,I.jsx)(`span`,{className:`nerd-pill-amber w-fit mx-auto mb-3`,children:e.badge}):null,e.icon?(0,I.jsx)(`div`,{className:`flex justify-center mb-3`,children:e.icon}):null,(0,I.jsx)(`h3`,{className:`font-bold text-zinc-900 dark:text-zinc-100 text-base`,children:e.title}),(0,I.jsx)(`p`,{className:`text-zinc-500 text-xs mt-2 mb-6 px-4`,children:e.description}),(0,I.jsx)(`div`,{className:`flex justify-center`,children:e.action})]},t))})]})}function wm({title:e,hint:t,action:n}){return(0,I.jsxs)(`div`,{className:`nerd-card text-center py-10`,children:[(0,I.jsx)(`div`,{className:`text-zinc-700 text-sm dark:text-zinc-300`,children:e}),t?(0,I.jsx)(`div`,{className:`text-zinc-500 text-xs mt-2`,children:t}):null,n?(0,I.jsx)(`div`,{className:`mt-4`,children:n}):null]})}function Z({message:e}){return(0,I.jsxs)(`div`,{className:`nerd-card border-red-300 text-red-700 text-sm dark:border-red-700/40 dark:text-red-400`,children:[(0,I.jsx)(`div`,{className:`font-bold mb-1`,children:`Error`}),(0,I.jsx)(`div`,{className:`text-xs`,children:e})]})}function Q({label:e=`loading`}){return(0,I.jsxs)(`div`,{className:`text-zinc-500 text-xs flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-keboola animate-pulse`}),e]})}function Tm({title:e,description:t,actions:n}){return(0,I.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`text-xl font-bold text-zinc-900 dark:text-zinc-100`,children:e}),t?(0,I.jsx)(`p`,{className:`text-zinc-500 text-xs mt-1`,children:t}):null]}),n?(0,I.jsx)(`div`,{className:`flex gap-2`,children:n}):null]})}function Em({data:e,maxHeight:t=`60vh`}){return(0,I.jsx)(`pre`,{className:`nerd-code`,style:{maxHeight:t,overflow:`auto`},children:JSON.stringify(e,null,2)})}function Dm({rows:e,columns:t,rowKey:n,onRowClick:r,emptyMessage:i=`No data`}){return e.length===0?(0,I.jsx)(`div`,{className:`nerd-card text-zinc-500 text-sm text-center py-6`,children:i}):(0,I.jsx)(`div`,{className:`nerd-card overflow-auto p-0`,children:(0,I.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,I.jsx)(`thead`,{children:(0,I.jsx)(`tr`,{className:`border-b border-zinc-200 text-xs text-zinc-500 uppercase tracking-wider dark:border-zinc-800`,children:t.map((e,t)=>(0,I.jsx)(`th`,{className:`px-3 py-2 text-${e.align??`left`} font-normal`,style:{width:e.width},children:e.header},t))})}),(0,I.jsx)(`tbody`,{children:e.map(e=>(0,I.jsx)(`tr`,{onClick:r?()=>r(e):void 0,className:`border-b border-zinc-100 dark:border-zinc-900/50 ${r?`cursor-pointer hover:bg-zinc-100 dark:hover:bg-zinc-900/40`:``}`,children:t.map((t,n)=>(0,I.jsx)(`td`,{className:`px-3 py-2 text-${t.align??`left`}`,children:t.cell(e)},n))},n(e)))})]})})}function Om(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`?!0:!!(e&&typeof e==`object`&&`message`in e&&String(e.message).toLowerCase().includes(`abort`))}var km=[{label:`every minute`,cron:`* * * * *`},{label:`every 5 minutes`,cron:`*/5 * * * *`},{label:`every 15 minutes`,cron:`*/15 * * * *`},{label:`every hour`,cron:`0 * * * *`},{label:`every 6 hours`,cron:`0 */6 * * *`},{label:`daily @ midnight UTC`,cron:`0 0 * * *`},{label:`daily @ 06:00 UTC`,cron:`0 6 * * *`},{label:`weekdays @ 09:00 UTC`,cron:`0 9 * * 1-5`}];function Am({trigger:e,tasks:t}){let n=t.find(t=>t.id===e.task_id)?.name??e.task_id;return(0,I.jsxs)(`span`,{className:`nerd-pill !text-[10px] border-keboola/40 text-keboola`,title:`Chains to ${n} on ${e.on}`,children:[`→ `,n]})}function jm({action:e}){return e.type===`mcp_tool`?(0,I.jsxs)(`span`,{className:`text-xs flex items-center gap-1`,children:[(0,I.jsx)(Ar,{className:`w-3 h-3 text-accent`}),String(e.params.tool??``)]}):e.type===`cli_command`?(0,I.jsxs)(`span`,{className:`text-xs flex items-center gap-1`,children:[(0,I.jsx)(Pr,{className:`w-3 h-3 text-accent`}),e.params.argv?.join(` `)??``]}):(0,I.jsxs)(`span`,{className:`text-xs flex items-center gap-1`,children:[(0,I.jsx)(Mn,{className:`w-3 h-3 text-neon-pink`}),(0,I.jsx)(`span`,{className:`text-neon-pink`,children:String(e.params.cli??`ai`)}),(0,I.jsx)(`span`,{className:`text-zinc-500 truncate max-w-[40ch]`,children:String(e.params.prompt??``)})]})}function Mm(){let e=tn(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(null),d=L({queryKey:[`agents`],queryFn:()=>B.get(`/agents`),refetchInterval:1e4}),f=R({mutationFn:e=>B.patch(`/agents/${e.id}`,{enabled:!e.enabled}),onSuccess:()=>e.invalidateQueries({queryKey:[`agents`]})}),p=R({mutationFn:e=>B.delete(`/agents/${e}`),onSuccess:()=>e.invalidateQueries({queryKey:[`agents`]})});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Agent Tasks`,description:`Cron-scheduled tasks running inside kbagent serve. Three flavours: MCP tool calls, raw kbagent CLI, or full AI agents (claude / codex / gemini) with prompts.`,actions:(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>n(!0),children:[(0,I.jsx)(Sr,{className:`w-3 h-3`}),` New task`]})}),d.isLoading?(0,I.jsx)(Q,{}):null,d.error?(0,I.jsx)(Z,{message:d.error.message}):null,d.data?.tasks.length===0?(0,I.jsx)(Cm,{headline:`Schedule your first agent`,subline:`Two paths -- pick the one that fits your task.`,paths:[{title:`Schedule a kbagent CLI command`,description:`For deterministic background jobs: nightly sync pulls, periodic doctor checks, polling for failed jobs. Output captured to history.`,icon:(0,I.jsx)(Pr,{className:`w-8 h-8 text-keboola`}),action:(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn hover:text-keboola`,onClick:()=>n(!0),children:`+ New CLI task`})},{title:`Schedule an AI agent`,description:`For tasks that need judgement: 'triage overnight error jobs', 'summarize storage growth'. Runs claude / codex / gemini with a prompt.`,icon:(0,I.jsx)(Mn,{className:`w-8 h-8 text-neon-pink`}),badge:`more agentic`,action:(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn hover:text-neon-pink`,onClick:()=>n(!0),children:`+ New AI task`})}]}):(0,I.jsx)(Dm,{rows:d.data?.tasks??[],rowKey:e=>e.id,onRowClick:e=>o(e),columns:[{header:``,cell:e=>e.enabled?(0,I.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-keboola inline-block animate-pulse`}):(0,I.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-zinc-700 inline-block`})},{header:`Name`,cell:e=>(0,I.jsxs)(`div`,{className:`leading-tight`,children:[(0,I.jsxs)(`div`,{className:`font-bold inline-flex items-center gap-1.5`,children:[e.name,e.trigger?(0,I.jsx)(Am,{trigger:e.trigger,tasks:d.data?.tasks??[]}):null]}),e.description?(0,I.jsx)(`div`,{className:`text-[11px] text-zinc-500 dark:text-zinc-400 truncate max-w-[40ch] mt-0.5`,title:e.description,children:e.description}):null]})},{header:`Action`,cell:e=>(0,I.jsx)(jm,{action:e.action})},{header:`Cron`,cell:e=>e.manual?(0,I.jsx)(`span`,{className:`nerd-pill border-zinc-400 text-zinc-500 dark:border-zinc-700`,children:`manual`}):(0,I.jsx)(`span`,{className:`font-mono text-xs`,children:e.cron})},{header:`Next`,cell:e=>(0,I.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e.next_run_at?new Date(e.next_run_at).toLocaleString():`-`})},{header:`Last`,cell:e=>(0,I.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e.last_run_at?new Date(e.last_run_at).toLocaleString():`never`})},{header:``,align:`right`,cell:e=>(0,I.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-keboola`,title:e.manual&&e.action.type===`ai_agent`?`Run with prompt (manual task)`:`Run now (opens detail with live event stream)`,onClick:t=>{t.stopPropagation(),e.manual&&e.action.type===`ai_agent`?u(e):(c(!0),o(e))},children:(0,I.jsx)(xr,{className:`w-3 h-3`})}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-neon-pink`,title:`Edit task`,onClick:t=>{t.stopPropagation(),i(e)},children:(0,I.jsx)(br,{className:`w-3 h-3`})}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,title:e.enabled?`Disable`:`Enable`,onClick:t=>{t.stopPropagation(),f.mutate(e)},children:e.enabled?(0,I.jsx)(yr,{className:`w-3 h-3`}):(0,I.jsx)(xr,{className:`w-3 h-3`})}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-red-400 hover:border-red-700`,onClick:t=>{t.stopPropagation(),confirm(`Delete task '${e.name}'?`)&&p.mutate(e.id)},children:(0,I.jsx)(Ir,{className:`w-3 h-3`})})]})}]}),t?(0,I.jsx)(Pm,{onClose:()=>n(!1)}):null,r?(0,I.jsx)(Pm,{existing:r,onClose:()=>i(null)}):null,l?(0,I.jsx)(Fm,{task:l,onClose:()=>u(null),onSuccess:()=>{u(null),e.invalidateQueries({queryKey:[`agents`]})}}):null,a?(0,I.jsx)(Im,{task:a,autoRun:s,onClose:()=>{o(null),c(!1)},onEdit:()=>{i(a),o(null),c(!1)}}):null]})}function Nm(e){if(!e)return null;let t=e.action.params;return e.action.type===`mcp_tool`?{tool:String(t.tool??`get_jobs`),toolInput:JSON.stringify(t.input??{},null,2),argv:``,aiCli:`claude`,aiPrompt:``,aiExtraArgs:``}:e.action.type===`cli_command`?{tool:``,toolInput:``,argv:Array.isArray(t.argv)?t.argv.join(` `):``,aiCli:`claude`,aiPrompt:``,aiExtraArgs:``}:{tool:``,toolInput:``,argv:``,aiCli:String(t.cli??`claude`),aiPrompt:String(t.prompt??``),aiExtraArgs:Array.isArray(t.extra_args)?t.extra_args.join(` `):``}}function Pm({onClose:e,existing:t}){let n=tn(),{project:r}=Zr(),i=Nm(t),[a,o]=(0,F.useState)(t?.name??``),[s,c]=(0,F.useState)(t?.description??``),[l,u]=(0,F.useState)(t?.cron??`0 0 * * *`),[d,f]=(0,F.useState)(t?.manual??!1),[p,m]=(0,F.useState)(t?.enabled??!0),[h,g]=(0,F.useState)(t?.trigger??null),[_,v]=(0,F.useState)(t?.action.type??`ai_agent`),[y,b]=(0,F.useState)(i?.tool??`get_jobs`),[x,S]=(0,F.useState)(i?.toolInput??`{"status": "error"}`),[C,w]=(0,F.useState)(i?.argv??(r?`job list --project ${r} --status error --limit 10`:`doctor`)),[T,E]=(0,F.useState)(i?.aiCli??`claude`),[D,O]=(0,F.useState)(i?.aiPrompt??(r?`Use the kbagent CLI to list errored jobs in project '${r}' from the last 24 hours, then summarize the top 3 root causes.`:`Use the kbagent CLI to summarize the doctor report and flag anything alarming.`)),[k,ee]=(0,F.useState)(i?.aiExtraArgs??``),[te,ne]=(0,F.useState)(null),A=L({queryKey:[`agent-cron-preview`,l],queryFn:()=>B.get(`/agents/cron/preview?cron=${encodeURIComponent(l)}`),retry:!1,enabled:!d}),j=(L({queryKey:[`agents`],queryFn:()=>B.get(`/agents`),retry:!1}).data?.tasks??[]).filter(e=>e.id!==t?.id),[M,re]=(0,F.useState)(null),[N,ie]=(0,F.useState)(0),[ae,oe]=(0,F.useState)([]),[se,ce]=(0,F.useState)(!1),le=(0,F.useRef)(null),ue=(0,F.useMemo)(()=>JSON.stringify({name:a,description:s,cron:l,manual:d,enabled:p,trigger:h,actionType:_,tool:y,toolInput:x,argv:C,aiCli:T,aiPrompt:D,aiExtraArgs:k}),[]),de=JSON.stringify({name:a,description:s,cron:l,manual:d,enabled:p,trigger:h,actionType:_,tool:y,toolInput:x,argv:C,aiCli:T,aiPrompt:D,aiExtraArgs:k})!==ue,fe=()=>{de&&!window.confirm(`Discard unsaved changes?`)||e()},pe=()=>{let e={};return e=_===`mcp_tool`?{tool:y,project:r,input:JSON.parse(x||`{}`)}:_===`cli_command`?{argv:C.trim().split(/\s+/)}:{cli:T,prompt:D,extra_args:k.trim()?k.trim().split(/\s+/):[]},{type:_,params:e}},me=()=>{le.current&&=(le.current.abort(),null),ne(null),re(null),oe([]),ie(0),ce(!0);let e=Date.now(),t=setInterval(()=>ie(Math.round((Date.now()-e)/1e3)),500),n=(t,n)=>{oe(r=>[...r,{event:t,data:n??{},at:Date.now()-e}])},r=ai(`/agents/test/stream`,{name:a||`[preview]`,description:s,cron:l,enabled:!1,action:pe()},{init:e=>n(`init`,e),stdout:e=>n(`stdout`,e),stderr:e=>n(`stderr`,e),done:t=>{n(`done`,t);let r=t??{};re({run_id:`preview`,task_id:`preview`,started_at:new Date(e).toISOString(),ended_at:new Date().toISOString(),status:r.status??`ok`,output:r,error:r.error??null})},message:e=>n(`message`,e)});le.current=r,r.done.catch(e=>{Om(e)||ne(e.message)}).finally(()=>{clearInterval(t),ce(!1),le.current=null})},he=()=>{le.current&&=(le.current.abort(),null),ce(!1)},ge=t!=null,_e=R({mutationFn:()=>{let e={name:a,description:s,cron:l,manual:d,enabled:p,trigger:h,action:pe()};return ge?B.patch(`/agents/${t.id}`,e):B.post(`/agents`,e)},onSuccess:()=>{n.invalidateQueries({queryKey:[`agents`]}),e()},onError:e=>ne(e.message)});return(0,I.jsxs)(Sm,{open:!0,onClose:fe,title:ge?`Edit task: ${t.name}`:`New scheduled agent task`,subtitle:ge?`Modify the schedule or action. Save updates the task in-place; existing run history is preserved.`:`Pick a cron schedule and one of three actions: AI agent (claude/codex/gemini), MCP tool call, or kbagent CLI command.`,width:se||ae.length>0||M?`max-w-6xl`:`max-w-3xl`,actions:(0,I.jsxs)(I.Fragment,{children:[se?(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-red-400`,onClick:he,title:`Abort the running test`,children:[(0,I.jsx)(Ur,{className:`w-3 h-3 inline mr-1`}),`cancel (`,N,`s)`]}):(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-neon-pink`,disabled:_e.isPending,onClick:me,title:`Run this action right now without saving the schedule`,children:[(0,I.jsx)(xr,{className:`w-3 h-3 inline mr-1`}),`Test now`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-keboola`,disabled:!a||_e.isPending,onClick:()=>{ne(null),_e.mutate()},children:[(0,I.jsx)(kn,{className:`w-3 h-3 inline mr-1`}),_e.isPending?ge?`saving...`:`creating...`:ge?`Save`:`Create`]})]}),children:[(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`Name`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1`,value:a,onChange:e=>o(e.target.value),placeholder:`e.g. Nightly error-job triage`,required:!0})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`Description (optional)`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1`,value:s,onChange:e=>c(e.target.value)})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-600 dark:text-zinc-300 mb-2`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>f(e.target.checked)}),(0,I.jsxs)(`span`,{children:[`Manual trigger only`,` `,(0,I.jsx)(`span`,{className:`text-zinc-500`,children:`(no schedule — runs only via Test now / Run, or as a chained downstream)`})]})]}),d?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-400 mb-1`,children:`Cron schedule`}),(0,I.jsx)(`input`,{className:`nerd-input w-full font-mono`,value:l,onChange:e=>u(e.target.value)}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:km.map(e=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-pill hover:border-keboola hover:text-keboola`,onClick:()=>u(e.cron),children:e.label},e.cron))})]}),!d&&A.data?(0,I.jsxs)(`div`,{className:`text-xs text-zinc-500 mt-2`,children:[`Next firings:`,` `,(0,I.jsx)(`span`,{className:`font-mono text-accent`,children:A.data.firings.slice(0,3).map(e=>new Date(e).toLocaleString()).join(` → `)})]}):!d&&A.error?(0,I.jsx)(`div`,{className:`text-xs text-red-400 mt-2`,children:`Invalid cron expression`}):null]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-400 mb-1`,children:`Chain → run another task when this one completes`}),j.length===0?(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 italic`,children:`No other tasks yet. Save this task first, then add another to chain to.`}):(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsxs)(`select`,{className:`nerd-input`,value:h?.task_id??``,onChange:e=>{let t=e.target.value;g(t?{on:h?.on??`success`,task_id:t}:null)},children:[(0,I.jsx)(`option`,{value:``,children:`— no chain —`}),j.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),h?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`text-xs text-zinc-500`,children:`on`}),[`success`,`error`,`always`].map(e=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-pill ${h.on===e?`border-keboola text-keboola`:``}`,onClick:()=>g({...h,on:e}),children:e},e))]}):null]}),h?(0,I.jsxs)(`div`,{className:`text-xs text-zinc-500 mt-2`,children:[`After each run that ends with status`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:h.on}),`, the downstream task runs with `,(0,I.jsx)(`span`,{className:`font-mono`,children:`KBAGENT_UPSTREAM_RUN_ID`}),` +`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:`KBAGENT_UPSTREAM_TASK_ID`}),` in its env.`]}):null]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-400 mb-1`,children:`Action type`}),(0,I.jsxs)(`div`,{className:`flex gap-2 flex-wrap`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 ${_===`ai_agent`?`border-neon-pink text-neon-pink`:``}`,onClick:()=>v(`ai_agent`),children:[(0,I.jsx)(Mn,{className:`w-3 h-3`}),` AI agent`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 ${_===`cli_command`?`border-keboola text-keboola`:``}`,onClick:()=>v(`cli_command`),children:[(0,I.jsx)(Pr,{className:`w-3 h-3`}),` CLI command`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 ${_===`mcp_tool`?`border-keboola text-keboola`:``}`,onClick:()=>v(`mcp_tool`),children:[(0,I.jsx)(Ar,{className:`w-3 h-3`}),` MCP tool`]})]})]}),_===`ai_agent`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-400 mb-1`,children:`AI CLI`}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:[`claude`,`codex`,`gemini`].map(e=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn ${T===e?`border-neon-pink text-neon-pink`:``}`,onClick:()=>E(e),children:e},e))}),(0,I.jsx)(`div`,{className:`text-xs text-zinc-600 mt-2`,children:`The CLI must be installed and authenticated on this machine. The agent runs once with the prompt below and exits; its full response is captured into the run history.`})]}),(0,I.jsx)(Rm,{cli:T,draft:D,project:r,onApply:e=>O(e)}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`Prompt`,(0,I.jsx)(`textarea`,{className:`nerd-input w-full mt-1 font-mono h-40`,value:D,onChange:e=>O(e.target.value),placeholder:`Check overnight error jobs and summarize the top 3 root causes`})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`Extra CLI args (optional, space-separated)`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1 font-mono`,value:k,onChange:e=>ee(e.target.value),placeholder:`--allowed-tools Read,Bash`})]})]}):_===`cli_command`?(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`Argv (will be prefixed with 'kbagent' if missing)`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1 font-mono`,value:C,onChange:e=>w(e.target.value)}),(0,I.jsx)(`span`,{className:`text-zinc-600`,children:`stdout/stderr is captured into the run history.`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`MCP tool name`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1 font-mono`,value:y,onChange:e=>b(e.target.value)})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`Tool input (JSON, current project = `,r??`(none)`,`)`,(0,I.jsx)(`textarea`,{className:`nerd-input w-full mt-1 font-mono h-32`,value:x,onChange:e=>S(e.target.value)})]})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-400`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>m(e.target.checked)}),`Enable immediately (will start running per cron)`]}),te?(0,I.jsx)(Z,{message:te}):null]}),se||ae.length>0?(0,I.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,I.jsx)(pm,{events:ae,running:se,elapsed:N,onCancel:he}),(0,I.jsx)(bm,{events:ae}),M?.output&&(`stdout`in M.output||`results`in M.output)?(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`h3`,{className:`text-xs uppercase tracking-wider text-zinc-500 mb-2`,children:`Raw output (cli/mcp action)`}),M.output&&`stdout`in M.output?(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap`,style:{maxHeight:`240px`},children:String(M.output.stdout??``)}):null,M.output&&`results`in M.output?(0,I.jsx)(Em,{data:M.output,maxHeight:`320px`}):null]}):null]}):null]})}function Fm({task:e,onClose:t,onSuccess:n}){let[r,i]=(0,F.useState)(``),[a,o]=(0,F.useState)(null),s=R({mutationFn:()=>B.post(`/agents/${e.id}/run`,{runtime_input:r.trim()?{prompt:r.trim()}:null}),onSuccess:n,onError:e=>o(e.message)}),c=String(e.action.params.prompt??``);return(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-zinc-950/90 backdrop-blur-sm p-4`,onClick:t,role:`presentation`,children:(0,I.jsxs)(`div`,{className:`nerd-card w-full max-w-2xl space-y-3`,onClick:e=>e.stopPropagation(),role:`dialog`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h2`,{className:`font-bold text-keboola text-base`,children:[`Run: `,e.name]}),(0,I.jsx)(`p`,{className:`text-xs text-zinc-500 mt-1`,children:`Manual task. Add an ad-hoc runtime input (optional) and run blocking — the run record appears in the list once it finishes.`})]}),(0,I.jsxs)(`details`,{className:`text-xs text-zinc-500`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer`,children:`Persisted prompt (read-only)`}),(0,I.jsx)(`pre`,{className:`mt-1 nerd-code whitespace-pre-wrap text-[11px] max-h-48 overflow-auto`,children:c||`(empty)`})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`Runtime input (optional)`,(0,I.jsx)(`textarea`,{className:`nerd-input w-full mt-1 font-mono min-h-[120px]`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. How many distinct customers had >3 orders in Q1?`,autoFocus:!0})]}),(0,I.jsx)(`div`,{className:`text-xs text-zinc-500`,children:`The runtime input is appended to the persisted prompt as a labeled section, just for this run. The saved task is not modified.`}),a?(0,I.jsx)(`div`,{className:`text-xs text-red-400`,children:a}):null,(0,I.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn`,onClick:t,disabled:s.isPending,children:`Cancel`}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>s.mutate(),disabled:s.isPending,children:[(0,I.jsx)(xr,{className:`w-3 h-3`}),s.isPending?`running...`:`Run`]})]})]})})}function Im({task:e,autoRun:t,onClose:n,onEdit:r}){let i=tn(),a=L({queryKey:[`agent-runs`,e.id],queryFn:()=>B.get(`/agents/${e.id}/runs?limit=50`),refetchInterval:5e3}),[o,s]=(0,F.useState)([]),[c,l]=(0,F.useState)(!1),[u,d]=(0,F.useState)(0),[f,p]=(0,F.useState)(null),m=(0,F.useRef)(null),h=()=>{m.current&&=(m.current.abort(),null),p(null),s([]),d(0),l(!0);let t=Date.now(),n=setInterval(()=>d(Math.round((Date.now()-t)/1e3)),500),r=(e,n)=>{s(r=>[...r,{event:e,data:n??{},at:Date.now()-t}])},a=ai(`/agents/${e.id}/run/stream`,{},{init:e=>r(`init`,e),stdout:e=>r(`stdout`,e),stderr:e=>r(`stderr`,e),done:t=>{r(`done`,t),i.invalidateQueries({queryKey:[`agent-runs`,e.id]}),i.invalidateQueries({queryKey:[`agents`]})},message:e=>r(`message`,e)});m.current=a,a.done.catch(e=>{Om(e)||p(e.message)}).finally(()=>{clearInterval(n),l(!1),m.current=null})},g=()=>{m.current&&=(m.current.abort(),null),l(!1)},_=(0,F.useRef)(!1);(0,F.useEffect)(()=>{t&&!_.current&&(_.current=!0,h())},[t]),(0,F.useEffect)(()=>()=>{m.current&&=(m.current.abort(),null)},[]);let v=c||o.length>0;return(0,I.jsx)(Sm,{open:!0,onClose:n,title:e.name,subtitle:`${e.action.type} ・ cron: ${e.cron} ・ ${e.enabled?`enabled`:`disabled`}`,width:v?`90vw`:`75vw`,actions:(0,I.jsxs)(I.Fragment,{children:[c?(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-red-500`,onClick:g,title:`Stop the live run (kill-on-disconnect)`,children:[(0,I.jsx)(Ur,{className:`w-3 h-3 inline mr-1`}),`cancel (`,u,`s)`]}):(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-neon-pink`,onClick:h,title:`Run live with SSE event stream`,children:[(0,I.jsx)(xr,{className:`w-3 h-3 inline mr-1`}),`Run live`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-keboola`,onClick:r,title:`Edit this task`,children:[(0,I.jsx)(br,{className:`w-3 h-3 inline mr-1`}),`Edit`]})]}),children:(0,I.jsxs)(`div`,{className:`space-y-4`,children:[v?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsx)(pm,{events:o,running:c,elapsed:u,onCancel:g}),(0,I.jsx)(bm,{events:o})]}):null,f?(0,I.jsx)(Z,{message:f}):null,(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`h3`,{className:`text-xs uppercase tracking-wider text-zinc-500 mb-2`,children:`Action`}),(0,I.jsx)(Em,{data:e.action,maxHeight:`200px`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:`text-xs uppercase tracking-wider text-zinc-500 mb-2`,children:`Recent runs (auto-refreshing)`}),a.isLoading?(0,I.jsx)(Q,{}):null,a.data?.runs.length===0?(0,I.jsx)(`div`,{className:`text-xs text-zinc-500`,children:`No runs yet.`}):null,(0,I.jsx)(`div`,{className:`space-y-2`,children:(a.data?.runs??[]).map(t=>(0,I.jsx)(Lm,{run:t,taskId:e.id},t.run_id))})]})]})})}function Lm({run:e,taskId:t}){let[n,r]=(0,F.useState)(!1),i=L({queryKey:[`agent-run-events`,t,e.run_id],queryFn:()=>B.get(`/agents/${t}/runs/${e.run_id}/events`),enabled:n&&!!e.events_path,retry:!1}),a=e.status===`ok`?`nerd-pill-green`:e.status===`error`?`nerd-pill-red`:`nerd-pill-amber`,o=e.output&&typeof e.output==`object`&&`response`in e.output?String(e.output.response??``):null,s=e.output&&typeof e.output==`object`&&`stdout`in e.output?String(e.output.stdout??``):null,c=e.summary??null,l=e.ended_at?Math.round((new Date(e.ended_at).getTime()-new Date(e.started_at).getTime())/1e3):null;return(0,I.jsxs)(`div`,{className:`border border-zinc-200 rounded bg-white dark:border-zinc-800 dark:bg-transparent`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`w-full text-left px-3 py-2 flex items-center justify-between hover:bg-zinc-50 dark:hover:bg-zinc-900/40`,onClick:()=>r(e=>!e),children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 text-xs flex-wrap`,children:[(0,I.jsx)(`span`,{className:a,children:e.status}),(0,I.jsx)(`span`,{className:`text-zinc-700 dark:text-zinc-400`,children:new Date(e.started_at).toLocaleString()}),l==null?null:(0,I.jsxs)(`span`,{className:`text-zinc-500 dark:text-zinc-600`,children:[`(`,l,`s)`]}),c?.cost_usd?.total==null?null:(0,I.jsxs)(`span`,{className:`nerd-pill border-keboola/40 text-keboola`,children:[`$`,c.cost_usd.total.toFixed(c.cost_usd.total<.01?4:3)]}),c?.tokens?.total?(0,I.jsx)(`span`,{className:`nerd-pill`,children:c.tokens.total<1e3?`${c.tokens.total} tok`:`${(c.tokens.total/1e3).toFixed(1)}k tok`}):null,c?.tools?.count?(0,I.jsxs)(`span`,{className:`nerd-pill`,children:[c.tools.count,` tool`,c.tools.count===1?``:`s`,c.tools.errors>0?(0,I.jsxs)(`span`,{className:`text-red-500 ml-1`,children:[`(`,c.tools.errors,` err)`]}):null]}):null]}),(0,I.jsx)(`span`,{className:`text-zinc-500 dark:text-zinc-600 text-xs`,children:n?`− hide`:`+ details`})]}),n?(0,I.jsxs)(`div`,{className:`p-3 border-t border-zinc-100 dark:border-zinc-900 space-y-3`,children:[e.error?(0,I.jsx)(Z,{message:e.error}):null,e.events_path?i.isLoading?(0,I.jsx)(Q,{}):i.error?(0,I.jsx)(Z,{message:i.error.message}):i.data?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(pm,{events:i.data.events,summary:c??void 0}),(0,I.jsx)(bm,{events:i.data.events})]}):null:o?(0,I.jsxs)(`details`,{open:!0,children:[(0,I.jsx)(`summary`,{className:`text-xs text-zinc-500 cursor-pointer`,children:`AI response (legacy run, no event timeline persisted)`}),(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap`,style:{maxHeight:`320px`},children:o})]}):null,s?(0,I.jsxs)(`details`,{children:[(0,I.jsx)(`summary`,{className:`text-xs text-zinc-500 cursor-pointer`,children:`stdout`}),(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap`,style:{maxHeight:`320px`},children:s})]}):null,e.output?(0,I.jsxs)(`details`,{children:[(0,I.jsx)(`summary`,{className:`text-xs text-zinc-500 cursor-pointer`,children:`raw json`}),(0,I.jsx)(Em,{data:e.output,maxHeight:`240px`})]}):null]}):null]})}function Rm({cli:e,draft:t,project:n,onApply:r}){let[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(!1),[u,d]=(0,F.useState)(0),[f,p]=(0,F.useState)(``),[m,h]=(0,F.useState)(null),[g,_]=(0,F.useState)(null),v=(0,F.useRef)(null),y=()=>{p(``),h(null),_(null),d(0)},b=()=>{if(!o.trim()){_(`Describe what you want the agent to do first.`);return}v.current&&=(v.current.abort(),null),y(),l(!0);let r=Date.now(),i=setInterval(()=>d(Math.round((Date.now()-r)/1e3)),500),a=``,s=ai(`/agents/prompt/improve/stream`,{cli:e,goal:o,draft:t,project:n??null},{init:()=>{},stdout:e=>{let t=e??{};if(t.type===`assistant`&&typeof t.message==`object`){let e=t.message.content;if(Array.isArray(e))for(let t of e)t&&typeof t==`object`&&t.type===`text`&&typeof t.text==`string`&&(a+=t.text,p(a))}else typeof t.raw==`string`&&(a+=(a?`
|
|
44
|
+
`:``)+t.raw,p(a))},stderr:()=>{},done:e=>{let t=e??{};if(t.status===`error`){_(String(t.error??`AI helper failed`));return}let n=typeof t.prompt==`string`?t.prompt.trim():``;if(!n){_(`AI returned an empty prompt. Try refining your goal description.`);return}h(n)},message:()=>{}});v.current=s,s.done.catch(e=>{Om(e)||_(e.message)}).finally(()=>{clearInterval(i),l(!1),v.current=null})},x=()=>{v.current&&=(v.current.abort(),null),l(!1)};return(0,F.useEffect)(()=>()=>{v.current&&=(v.current.abort(),null)},[]),i?(0,I.jsxs)(`div`,{className:`nerd-card border-neon-pink/40 dark:border-neon-pink/40 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`div`,{className:`text-xs font-bold text-neon-pink flex items-center gap-1`,children:[(0,I.jsx)(Ar,{className:`w-3 h-3`}),`AI prompt helper · `,e]}),(0,I.jsxs)(`button`,{type:`button`,className:`text-xs text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 flex items-center gap-1`,onClick:()=>{x(),a(!1),y(),s(``)},title:`Close the helper without applying`,children:[(0,I.jsx)(Ur,{className:`w-3 h-3`}),` close`]})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`What do you want the agent to accomplish?`,(0,I.jsx)(`textarea`,{className:`nerd-input w-full mt-1 h-20`,value:o,onChange:e=>s(e.target.value),placeholder:`e.g. Each morning summarize errored jobs in project 'padak' from the last 24h, top 3 root causes.`,disabled:c})]}),t.trim()?(0,I.jsxs)(`div`,{className:`text-xs text-zinc-500`,children:[`Existing draft below the form will be used as a starting point (`,t.trim().length,` chars).`]}):null,(0,I.jsxs)(`div`,{className:`flex gap-2 items-center flex-wrap`,children:[c?(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-red-400 hover:border-red-700`,onClick:x,title:`Abort the AI helper`,children:[(0,I.jsx)(Ur,{className:`w-3 h-3 inline mr-1`}),`cancel (`,u,`s)`]}):(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-neon-pink hover:border-neon-pink/60`,onClick:b,disabled:!o.trim(),title:`Ask the AI to write a polished prompt`,children:[(0,I.jsx)(Ar,{className:`w-3 h-3 inline mr-1`}),m?`Regenerate`:`Generate prompt`]}),!c&&m?(0,I.jsxs)(`span`,{className:`text-xs text-zinc-500`,children:[`generated in `,u,`s`]}):null]}),g?(0,I.jsx)(Z,{message:g}):null,c&&f?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 mb-1`,children:`live output:`}),(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap text-xs text-zinc-600 dark:text-zinc-400`,style:{maxHeight:`200px`,overflow:`auto`},children:f})]}):null,m?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-500`,children:`AI suggestion:`}),(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap text-zinc-800 dark:text-zinc-200 border-neon-pink/30`,style:{maxHeight:`320px`,overflow:`auto`},children:m}),(0,I.jsxs)(`div`,{className:`flex gap-2 flex-wrap`,children:[(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn hover:text-keboola hover:border-keboola/60`,onClick:()=>{r(m),a(!1),y(),s(``)},title:`Replace the Prompt field below with this suggestion`,children:`✓ Use this prompt`}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn hover:text-red-400 hover:border-red-700`,onClick:()=>{h(null),p(``)},title:`Throw away this suggestion (keeps the helper open)`,children:`✗ Discard`})]})]}):null]}):(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs flex items-center gap-1 hover:text-neon-pink hover:border-neon-pink/60`,onClick:()=>a(!0),title:`Let ${e} help you write a polished prompt`,children:[(0,I.jsx)(Ar,{className:`w-3 h-3`}),`Help me write this prompt`]}),(0,I.jsxs)(`span`,{className:`text-xs text-zinc-500`,children:[`uses `,e,` to turn a plain-English goal into a polished prompt`]})]})}function zm(){let{project:e,setBranchId:t}=Zr(),n=tn(),[r,i]=(0,F.useState)(!1),a=L({queryKey:[`branches`,e],queryFn:()=>B.get(`/branches`,{query:{project:e??void 0}}),enabled:!!e}),o=R({mutationFn:({alias:e,branchId:t})=>B.post(`/branches/${encodeURIComponent(e)}/use`,{branch_id:t}),onSuccess:(e,r)=>{t(r.branchId),n.invalidateQueries({queryKey:[`branches`]})}}),s=R({mutationFn:e=>B.post(`/branches/${encodeURIComponent(e)}/reset`),onSuccess:()=>{t(null),n.invalidateQueries({queryKey:[`branches`]})}}),c=R({mutationFn:({alias:e,branchId:t})=>B.delete(`/branches/${encodeURIComponent(e)}/${t}`),onSuccess:()=>n.invalidateQueries({queryKey:[`branches`]})}),l=a.data?.branches??[],u=e?a.data?.active_branches?.[e]??null:null;return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Branches`,description:`Development branches in ${e??`(no project)`}`,actions:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1`,onClick:()=>e&&s.mutate(e),disabled:!e||u===null,children:[(0,I.jsx)(Tr,{className:`w-3 h-3`}),` Reset to main`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>i(!0),disabled:!e,children:[(0,I.jsx)(Sr,{className:`w-3 h-3`}),` Create branch`]})]})}),r&&e?(0,I.jsx)(Bm,{alias:e,onDone:()=>{i(!1),n.invalidateQueries({queryKey:[`branches`]})}}):null,e?a.isLoading?(0,I.jsx)(Q,{}):a.error?(0,I.jsx)(Z,{message:a.error.message}):(0,I.jsx)(Dm,{rows:l,rowKey:e=>`${e.project_alias}/${e.id}`,columns:[{header:`Branch`,cell:e=>(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(tr,{className:`w-3 h-3 text-zinc-500`}),(0,I.jsx)(`span`,{className:e.id===u?`text-keboola font-bold`:``,children:e.name}),e.isDefault?(0,I.jsx)(`span`,{className:`nerd-pill-green`,children:`main`}):null,e.id===u?(0,I.jsx)(`span`,{className:`nerd-pill-amber`,children:`active`}):null]})},{header:`ID`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500`,children:e.id})},{header:`Description`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500 text-xs`,children:e.description})},{header:`Created`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500 text-xs`,children:e.created})},{header:``,align:`right`,cell:e=>(0,I.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[!e.isDefault&&e.id!==u?(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-keboola`,onClick:()=>o.mutate({alias:e.project_alias,branchId:e.id}),children:`Switch`}):null,e.isDefault?(0,I.jsxs)(`span`,{className:`nerd-pill flex items-center gap-1`,children:[(0,I.jsx)(rr,{className:`w-3 h-3`}),` default`]}):(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-red-400 hover:border-red-700`,onClick:()=>{confirm(`Delete branch '${e.name}'?`)&&c.mutate({alias:e.project_alias,branchId:e.id})},children:(0,I.jsx)(Ir,{className:`w-3 h-3`})})]})}]}):(0,I.jsx)(wm,{title:`Select a project`})]})}function Bm({alias:e,onDone:t}){let[n,r]=(0,F.useState)(``),[i,a]=(0,F.useState)(``),[o,s]=(0,F.useState)(null),c=R({mutationFn:()=>B.post(`/branches/${encodeURIComponent(e)}`,{name:n,description:i}),onSuccess:()=>t(),onError:e=>s(e.message)});return(0,I.jsxs)(`form`,{className:`nerd-card space-y-3`,onSubmit:e=>{e.preventDefault(),s(null),c.mutate()},children:[(0,I.jsxs)(`h3`,{className:`font-bold text-keboola`,children:[`New branch in `,e]}),(0,I.jsx)(`input`,{className:`nerd-input w-full`,placeholder:`branch name`,value:n,onChange:e=>r(e.target.value),required:!0}),(0,I.jsx)(`input`,{className:`nerd-input w-full`,placeholder:`description (optional)`,value:i,onChange:e=>a(e.target.value)}),o?(0,I.jsx)(`div`,{className:`text-red-400 text-xs`,children:o}):null,(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`button`,{type:`submit`,className:`nerd-btn hover:text-keboola`,disabled:c.isPending,children:c.isPending?`Creating...`:`Create`}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn`,onClick:t,children:`Cancel`})]})]})}function Vm(){let e=new Date().getHours();return e<12?`Good Morning`:e<18?`Good Afternoon`:`Good Evening`}function Hm(){let{project:e,setPage:t,setPendingLocalAiMessage:n}=Zr(),[r,i]=(0,F.useState)(``),a=L({queryKey:[`projects`],queryFn:()=>B.get(`/projects`)}),o=L({queryKey:[`projects-status`],queryFn:()=>B.get(`/projects/status`)}),s=L({queryKey:[`agents`],queryFn:()=>B.get(`/agents`)}),c=L({queryKey:[`doctor`],queryFn:()=>B.get(`/doctor`)}),l=L({queryKey:[`dashboard-jobs`,e],queryFn:()=>B.get(`/jobs`,{query:{project:e??void 0,limit:5}}),enabled:!!e}),u=()=>{let e=r.trim();e&&(n(e),i(``),t(`localai`))},d=a.data?.projects??[],f=s.data?.tasks??[],p=f.filter(e=>e.enabled),m=o.data?.status?.filter(e=>e.status===`ok`).length??0,h=c.data?.summary?.warnings??0,g=c.data?.summary?.failed??0,_=p.filter(e=>e.next_run_at).sort((e,t)=>(e.next_run_at??``)>(t.next_run_at??``)?1:-1)[0];return(0,I.jsxs)(`div`,{className:`space-y-6`,children:[(0,I.jsx)(Tm,{title:Vm(),description:e?`Working in project ${e}. Ask the local AI anything below, or jump to a tile.`:`Pick a project in the top bar to scope per-project tiles, or ask cross-project below.`}),(0,I.jsx)(`form`,{className:`nerd-card border-keboola/30 bg-white dark:bg-zinc-900/40`,onSubmit:e=>{e.preventDefault(),u()},children:(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(Ar,{className:`w-5 h-5 text-keboola flex-shrink-0`}),(0,I.jsx)(`input`,{className:`flex-1 bg-transparent border-0 focus:outline-none text-sm placeholder-zinc-500 dark:placeholder-zinc-600`,placeholder:e?`Ask the local AI about ${e}…`:`Ask the local AI anything across your Keboola projects…`,value:r,onChange:e=>i(e.target.value)}),(0,I.jsxs)(`button`,{type:`submit`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,disabled:!r.trim(),title:`Open Local AI with this question (uses claude / codex / gemini on your machine)`,children:[(0,I.jsx)(Dr,{className:`w-3 h-3`}),` Ask`]})]})}),(0,I.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,I.jsx)(Um,{label:`Projects connected`,value:`${m} / ${d.length}`,icon:(0,I.jsx)(gr,{className:`w-4 h-4`}),onClick:()=>t(`projects`)}),(0,I.jsx)(Um,{label:`Agent tasks`,value:`${p.length} active`,subtle:`of ${f.length} total`,icon:(0,I.jsx)(kn,{className:`w-4 h-4`}),onClick:()=>t(`agents`)}),(0,I.jsx)(Um,{label:`Doctor`,value:g===0&&h===0?`all checks pass`:`${g+h} issues`,tone:g>0?`red`:h>0?`amber`:`green`,icon:(0,I.jsx)(ar,{className:`w-4 h-4`}),onClick:()=>t(`doctor`)}),(0,I.jsx)(Um,{label:`Recent jobs`,value:`${l.data?.jobs?.length??0} loaded`,subtle:e??`(no project)`,icon:(0,I.jsx)(zn,{className:`w-4 h-4`}),onClick:()=>t(`jobs`)})]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,I.jsxs)(`section`,{className:`nerd-card`,children:[(0,I.jsxs)(`header`,{className:`flex items-center justify-between mb-3`,children:[(0,I.jsxs)(`h3`,{className:`text-sm font-bold text-keboola flex items-center gap-2`,children:[(0,I.jsx)(En,{className:`w-4 h-4`}),` Scheduled agents`]}),(0,I.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 hover:text-keboola`,onClick:()=>t(`agents`),children:`manage →`})]}),s.isLoading?(0,I.jsx)(Q,{}):f.length===0?(0,I.jsx)(wm,{title:`No scheduled agents yet`,hint:`Hand off recurring chores to claude / codex / kbagent CLI.`}):(0,I.jsxs)(`div`,{className:`space-y-2`,children:[_?(0,I.jsxs)(`div`,{className:`border border-keboola/40 bg-keboola/5 rounded p-2 text-xs`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-keboola mb-1`,children:`Next firing`}),(0,I.jsx)(`div`,{className:`font-bold text-zinc-900 dark:text-zinc-100`,children:_.name}),(0,I.jsx)(`div`,{className:`text-zinc-500`,children:_.next_run_at?new Date(_.next_run_at).toLocaleString():`(unscheduled)`})]}):null,(0,I.jsx)(`ul`,{className:`space-y-1`,children:f.slice(0,5).map(e=>(0,I.jsx)(Gm,{task:e},e.id))})]})]}),(0,I.jsxs)(`section`,{className:`nerd-card`,children:[(0,I.jsx)(`header`,{className:`flex items-center justify-between mb-3`,children:(0,I.jsx)(`h3`,{className:`text-sm font-bold text-keboola`,children:`Suggested next steps`})}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[d.length===0?(0,I.jsx)(Wm,{icon:(0,I.jsx)(gr,{className:`w-3.5 h-3.5 text-keboola`}),text:`Add your first Keboola project`,target:`projects`,setPage:t}):null,f.length===0?(0,I.jsx)(Wm,{icon:(0,I.jsx)(kn,{className:`w-3.5 h-3.5 text-neon-pink`}),text:`Schedule an AI agent — e.g. triage overnight error jobs`,target:`agents`,setPage:t}):null,h>0||g>0?(0,I.jsx)(Wm,{icon:(0,I.jsx)(ar,{className:`w-3.5 h-3.5 text-amber-700 dark:text-neon-amber`}),text:`Doctor reports ${g} fail + ${h} warn -- triage`,target:`doctor`,setPage:t}):null,(0,I.jsx)(Wm,{icon:(0,I.jsx)(Pr,{className:`w-3.5 h-3.5 text-accent`}),text:`Open a SQL workspace and explore Storage interactively`,target:`workspaces`,setPage:t}),(0,I.jsx)(Wm,{icon:(0,I.jsx)(gr,{className:`w-3.5 h-3.5 text-keboola`}),text:`Build deep column-level lineage across registered projects`,target:`lineage`,setPage:t}),(0,I.jsx)(Wm,{icon:(0,I.jsx)(Ar,{className:`w-3.5 h-3.5 text-accent`}),text:`Browse MCP tools and call one ad-hoc`,target:`mcp`,setPage:t})]})]})]}),e?(0,I.jsxs)(`section`,{className:`nerd-card`,children:[(0,I.jsxs)(`header`,{className:`flex items-center justify-between mb-3`,children:[(0,I.jsxs)(`h3`,{className:`text-sm font-bold text-keboola flex items-center gap-2`,children:[(0,I.jsx)(zn,{className:`w-4 h-4`}),` Recent jobs in `,e]}),(0,I.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 hover:text-keboola`,onClick:()=>t(`jobs`),children:`all jobs →`})]}),l.isLoading?(0,I.jsx)(Q,{}):(l.data?.jobs.length??0)===0?(0,I.jsx)(`div`,{className:`text-xs text-zinc-500`,children:`No recent jobs.`}):(0,I.jsx)(`ul`,{className:`text-xs space-y-1`,children:(l.data?.jobs??[]).slice(0,6).map(e=>(0,I.jsxs)(`li`,{className:`flex items-center gap-3 py-1 border-b border-zinc-200 dark:border-zinc-900/40`,children:[(0,I.jsx)(`span`,{className:`font-mono text-zinc-500`,children:e.id}),(0,I.jsx)(`span`,{className:`nerd-pill`,children:e.status}),(0,I.jsx)(`span`,{className:`text-accent`,children:e.component}),(0,I.jsx)(`span`,{className:`text-zinc-500 ml-auto`,children:e.createdTime})]},String(e.id)))})]}):null]})}function Um({label:e,value:t,subtle:n,icon:r,tone:i=`default`,onClick:a}){return(0,I.jsxs)(`button`,{type:`button`,onClick:a,className:`nerd-card text-left hover:border-keboola/40 transition-colors ${i===`red`?`border-red-300 dark:border-red-700/40 text-red-600 dark:text-red-400`:i===`amber`?`border-neon-amber/40 text-amber-700 dark:text-neon-amber`:i===`green`?`border-keboola/40 text-keboola`:`border-zinc-200 dark:border-zinc-800`}`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-1 text-[10px] uppercase tracking-wider text-zinc-500`,children:[(0,I.jsx)(`span`,{children:e}),r]}),(0,I.jsx)(`div`,{className:`text-2xl font-bold`,children:t}),n?(0,I.jsx)(`div`,{className:`text-[10px] text-zinc-500 mt-0.5`,children:n}):null]})}function Wm({icon:e,text:t,target:n,setPage:r}){return(0,I.jsxs)(`button`,{type:`button`,onClick:()=>r(n),className:`w-full text-left p-2 rounded border border-zinc-200 dark:border-zinc-900 hover:border-keboola/40 hover:bg-zinc-100 dark:hover:bg-zinc-900/30 transition-colors flex items-start gap-2 text-xs`,children:[(0,I.jsx)(`span`,{className:`mt-0.5`,children:e}),(0,I.jsx)(`span`,{className:`text-zinc-700 dark:text-zinc-300`,children:t}),(0,I.jsx)(`span`,{className:`ml-auto text-zinc-500 dark:text-zinc-600`,children:`→`})]})}function Gm({task:e}){let t=tn(),n=R({mutationFn:()=>B.post(`/agents/${e.id}/run`,{}),onSettled:()=>{t.invalidateQueries({queryKey:[`agents`]}),t.invalidateQueries({queryKey:[`agent-runs`,e.id]})}});return(0,I.jsxs)(`li`,{className:`flex items-center gap-2 text-xs py-1 border-b border-zinc-200 dark:border-zinc-900/40`,children:[(0,I.jsx)(`span`,{className:`w-2 h-2 rounded-full ${e.enabled?`bg-keboola animate-pulse`:`bg-zinc-700`}`}),(0,I.jsx)(`span`,{className:`flex-1 truncate text-zinc-700 dark:text-zinc-300`,children:e.name}),(0,I.jsx)(`span`,{className:`font-mono text-[10px] text-zinc-500`,children:e.cron}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-[10px] py-0.5 px-1.5 flex items-center gap-1 hover:text-keboola hover:border-keboola/60`,onClick:()=>n.mutate(),disabled:n.isPending,title:`Trigger '${e.name}' now (outside the cron schedule)`,children:n.isPending?(0,I.jsx)(`span`,{className:`text-keboola`,children:`running…`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(xr,{className:`w-3 h-3`}),` run`]})})]})}function Km(){let e=L({queryKey:[`changelog`],queryFn:()=>B.get(`/changelog`)});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Changelog`,description:`Release history of the kbagent kernel.`}),e.isLoading?(0,I.jsx)(Q,{}):null,e.error?(0,I.jsx)(Z,{message:e.error.message}):null,(0,I.jsx)(`div`,{className:`space-y-3`,children:(e.data?.entries??[]).map(e=>(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsxs)(`h3`,{className:`font-bold text-keboola`,children:[`v`,e.version]}),(0,I.jsx)(`ul`,{className:`mt-2 text-sm space-y-1`,children:e.highlights.map((e,t)=>(0,I.jsxs)(`li`,{className:`text-zinc-700 dark:text-zinc-300`,children:[`• `,e]},t))})]},e.version))})]})}var qm=[`I need to download data from marketing campaigns`,`I want to write data to BigQuery`,`I need a Snowflake transformation`,`Connect to Salesforce CRM`,`Schedule daily exports to S3`],Jm=[{id:``,label:`All`},{id:`extractor`,label:`Data Source`},{id:`writer`,label:`Data Destination`},{id:`application`,label:`Application`},{id:`transformation`,label:`Transformation`}];function Ym(){let{project:e}=Zr(),[t,n]=(0,F.useState)(``),[r,i]=(0,F.useState)(``),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(0),l=L({queryKey:[`components`,e,t,r],queryFn:()=>B.get(`/components`,{query:{project:e??void 0,query:t||void 0,type:r||void 0}}),enabled:!!e}),u=l.data?.components??[];return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Components`,description:`${u.length} component(s) available in ${e??`(no project)`}. Type a use-case below — the search runs against the AI Service when filled, falls back to Storage catalog otherwise.`}),(0,I.jsxs)(`div`,{className:`nerd-card border-keboola/30 bg-keboola/5 dark:bg-zinc-900/40`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,I.jsx)(Ar,{className:`w-5 h-5 text-keboola flex-shrink-0`}),(0,I.jsx)(`input`,{className:`flex-1 bg-transparent border-0 focus:outline-none text-sm font-mono placeholder-zinc-400 dark:placeholder-zinc-600`,placeholder:qm[s],value:t,onChange:e=>n(e.target.value),onFocus:()=>c(e=>(e+1)%qm.length)}),t?(0,I.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-200`,onClick:()=>n(``),children:`clear`}):null]}),(0,I.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-1.5`,children:qm.map(e=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-pill hover:border-keboola hover:text-keboola text-[10px]`,onClick:()=>n(e),children:e},e))})]}),(0,I.jsx)(`div`,{className:`flex gap-2 flex-wrap`,children:Jm.map(e=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs ${r===e.id?`border-keboola text-keboola`:``}`,onClick:()=>i(e.id),children:e.label},e.id||`all`))}),l.isLoading?(0,I.jsx)(Q,{}):null,l.error?(0,I.jsx)(Z,{message:l.error.message}):null,(0,I.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3`,children:u.map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>o(e),className:`nerd-card text-left hover:border-keboola/50 transition-colors`,children:[(0,I.jsxs)(`div`,{className:`flex items-start justify-between mb-1`,children:[(0,I.jsx)(`div`,{className:`font-bold text-accent text-sm`,children:e.component_name}),(0,I.jsx)(`span`,{className:`nerd-pill text-[10px]`,children:e.component_type})]}),(0,I.jsx)(`div`,{className:`text-[11px] text-zinc-600 font-mono mb-2`,children:e.component_id}),(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 line-clamp-3`,children:e.description??``})]},e.component_id))}),a?(0,I.jsx)(Sm,{open:!0,onClose:()=>o(null),title:a.component_name,subtitle:a.component_id,width:`max-w-3xl`,children:(0,I.jsx)(Xm,{componentId:a.component_id})}):null]})}function Xm({componentId:e}){let{project:t}=Zr(),n=L({queryKey:[`component-detail`,e,t],queryFn:()=>B.get(`/components/${encodeURIComponent(e)}`,{query:{project:t??void 0}})});return n.isLoading?(0,I.jsx)(Q,{}):n.error?(0,I.jsx)(Z,{message:n.error.message}):(0,I.jsx)(Em,{data:n.data})}function Zm(){let{project:e,branchId:t}=Zr(),[n,r]=(0,F.useState)(``),[i,a]=(0,F.useState)(null),o=L({queryKey:[`configs`,e,t],queryFn:()=>B.get(`/configs`,{query:{project:e??void 0,branch_id:t??void 0}}),enabled:!!e}),s=o.data?.configs.filter(e=>n?`${e.config_name} ${e.config_id} ${e.component_id}`.toLowerCase().includes(n.toLowerCase()):!0)??[];return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Configurations`,description:`Component configs in ${e??`(no project)`}${t?` (branch #${t})`:``}`}),(0,I.jsx)(`input`,{className:`nerd-input w-full max-w-md`,placeholder:`filter by name / id / component...`,value:n,onChange:e=>r(e.target.value)}),e?o.isLoading?(0,I.jsx)(Q,{}):o.error?(0,I.jsx)(Z,{message:o.error.message}):(0,I.jsxs)(I.Fragment,{children:[o.data?.errors.length?(0,I.jsxs)(`div`,{className:`text-amber-400 text-xs`,children:[o.data.errors.length,` project error(s) -- some configs may be missing.`]}):null,(0,I.jsx)(Dm,{rows:s,rowKey:e=>`${e.project_alias}/${e.component_id}/${e.config_id}`,onRowClick:e=>a(e),columns:[{header:`Component`,cell:e=>(0,I.jsx)(`span`,{className:`text-accent`,children:e.component_id})},{header:`Config ID`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-400`,children:e.config_id})},{header:`Name`,cell:e=>(0,I.jsx)(`span`,{className:`font-medium`,children:e.config_name})},{header:`Folder`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500 text-xs`,children:e.folder??``})},{header:`Modified`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500 text-xs`,children:e.last_modified??``})}]})]}):(0,I.jsx)(wm,{title:`Select a project from the top bar`}),i?(0,I.jsx)(Qm,{alias:i.project_alias,componentId:i.component_id,configId:i.config_id,onClose:()=>a(null)}):null]})}function Qm({alias:e,componentId:t,configId:n,onClose:r}){let{branchId:i}=Zr(),a=L({queryKey:[`config-detail`,e,t,n,i],queryFn:()=>B.get(`/configs/${encodeURIComponent(e)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,{query:{branch_id:i??void 0}})});return(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,I.jsxs)(`h3`,{className:`font-bold text-keboola`,children:[t,` / `,n]}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:r,children:`Close`})]}),a.isLoading?(0,I.jsx)(Q,{}):null,a.error?(0,I.jsx)(Z,{message:a.error.message}):null,a.data?(0,I.jsx)(Em,{data:a.data}):null]})}var $m={running:`nerd-pill-green`,starting:`nerd-pill-amber`,stopping:`nerd-pill-amber`,stopped:`nerd-pill`,error:`nerd-pill-red`};function eh(){let{project:e,branchId:t}=Zr(),n=tn(),[r,i]=(0,F.useState)(null),a=L({queryKey:[`data-apps`,e,t],queryFn:()=>B.get(`/data-apps`,{query:{project:e??void 0,branch_id:t??void 0}}),enabled:!!e}),o=R({mutationFn:({alias:e,appId:t})=>B.post(`/data-apps/${encodeURIComponent(e)}/${encodeURIComponent(t)}/start`),onSuccess:()=>n.invalidateQueries({queryKey:[`data-apps`]})}),s=R({mutationFn:({alias:e,appId:t})=>B.post(`/data-apps/${encodeURIComponent(e)}/${encodeURIComponent(t)}/stop`),onSuccess:()=>n.invalidateQueries({queryKey:[`data-apps`]})}),c=R({mutationFn:({alias:e,appId:t})=>B.delete(`/data-apps/${encodeURIComponent(e)}/${encodeURIComponent(t)}`),onSuccess:()=>n.invalidateQueries({queryKey:[`data-apps`]})});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Data Apps`,description:`Custom Streamlit / Python data apps deployed on Keboola.`}),e?a.isLoading?(0,I.jsx)(Q,{}):a.error?(0,I.jsx)(Z,{message:a.error.message}):(0,I.jsx)(Dm,{rows:a.data?.apps??[],rowKey:e=>`${e.project_alias}/${e.app_id}`,onRowClick:e=>i(e),columns:[{header:`App`,cell:e=>(0,I.jsx)(`span`,{className:`font-bold`,children:e.name})},{header:`ID`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500 text-xs`,children:e.app_id})},{header:`Type`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-400`,children:e.type})},{header:`State`,cell:e=>(0,I.jsx)(`span`,{className:$m[e.state]??`nerd-pill`,children:e.state})},{header:`Size`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500`,children:e.size})},{header:`URL`,cell:e=>e.url?(0,I.jsx)(`a`,{className:`text-accent text-xs`,href:e.url,target:`_blank`,rel:`noreferrer`,children:`open`}):null},{header:``,align:`right`,cell:e=>(0,I.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[e.state===`running`?(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:t=>{t.stopPropagation(),s.mutate({alias:e.project_alias,appId:e.app_id})},children:(0,I.jsx)(yr,{className:`w-3 h-3`})}):(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-keboola`,onClick:t=>{t.stopPropagation(),o.mutate({alias:e.project_alias,appId:e.app_id})},children:(0,I.jsx)(xr,{className:`w-3 h-3`})}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-red-400 hover:border-red-700`,onClick:t=>{t.stopPropagation(),confirm(`Delete app ${e.name}?`)&&c.mutate({alias:e.project_alias,appId:e.app_id})},children:(0,I.jsx)(Ir,{className:`w-3 h-3`})})]})}]}):(0,I.jsx)(wm,{title:`Select a project`}),r?(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,I.jsx)(`h3`,{className:`font-bold text-keboola`,children:r.name}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:()=>i(null),children:`Close`})]}),(0,I.jsx)(Em,{data:r})]}):null]})}function th(){let e=L({queryKey:[`doctor`],queryFn:()=>B.get(`/doctor`)});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`kbagent doctor`,description:`Health checks: config, connectivity, version, plugins, conversation.`,actions:(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1`,onClick:()=>e.refetch(),children:[(0,I.jsx)(wr,{className:`w-3 h-3`}),` Re-run`]})}),e.isLoading?(0,I.jsx)(Q,{}):null,e.error?(0,I.jsx)(Z,{message:e.error.message}):null,e.data?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`grid grid-cols-4 gap-3`,children:[(0,I.jsx)(nh,{label:`Total`,value:e.data.summary.total}),(0,I.jsx)(nh,{label:`Passed`,value:e.data.summary.passed,color:`text-keboola`}),(0,I.jsx)(nh,{label:`Failed`,value:e.data.summary.failed,color:`text-red-600 dark:text-red-400`}),(0,I.jsx)(nh,{label:`Warnings`,value:e.data.summary.warnings??0,color:`text-amber-700 dark:text-neon-amber`})]}),(0,I.jsx)(`div`,{className:`space-y-2`,children:e.data.checks.map(e=>(0,I.jsxs)(`div`,{className:`nerd-card flex items-start gap-3`,children:[(0,I.jsx)(`div`,{className:`mt-0.5`,children:e.status===`pass`?(0,I.jsx)(Ln,{className:`w-4 h-4 text-keboola`}):e.status===`fail`?(0,I.jsx)(Bn,{className:`w-4 h-4 text-red-600 dark:text-red-400`}):(0,I.jsx)(Ln,{className:`w-4 h-4 text-amber-700 dark:text-neon-amber`})}),(0,I.jsxs)(`div`,{className:`flex-1`,children:[(0,I.jsx)(`div`,{className:`font-bold`,children:e.name}),(0,I.jsx)(`div`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:e.message}),e.details?(0,I.jsxs)(`details`,{className:`mt-2`,children:[(0,I.jsx)(`summary`,{className:`text-xs text-zinc-500 cursor-pointer`,children:`details`}),(0,I.jsx)(Em,{data:e.details,maxHeight:`200px`})]}):null]})]},e.name))})]}):null]})}function nh({label:e,value:t,color:n=`text-zinc-900 dark:text-zinc-100`}){return(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 uppercase tracking-wider`,children:e}),(0,I.jsx)(`div`,{className:`text-3xl font-bold mt-1 ${n}`,children:t})]})}function rh(){let{project:e}=Zr(),[t,n]=(0,F.useState)(`keboola.ex-db-snowflake`),[r,i]=(0,F.useState)(`{
|
|
45
|
+
"#password": "secret"
|
|
46
|
+
}`),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(null),l=R({mutationFn:()=>{let n=JSON.parse(r);return B.post(`/encrypt/values`,{project:e,component_id:t,values:n})},onSuccess:e=>{o(e),c(null)},onError:e=>{c(e.message),o(null)}});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Encrypt secrets`,description:`Convert plaintext #-prefixed values to KBC:: ciphertext for use in configs.`}),(0,I.jsxs)(`div`,{className:`nerd-card space-y-3`,children:[(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`Component ID`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1`,value:t,onChange:e=>n(e.target.value)})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`Values (JSON, keys must start with #)`,(0,I.jsx)(`textarea`,{className:`nerd-input w-full mt-1 h-32 font-mono`,value:r,onChange:e=>i(e.target.value)})]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>l.mutate(),disabled:!e||l.isPending,children:[(0,I.jsx)(dr,{className:`w-3 h-3`}),` `,l.isPending?`encrypting...`:`Encrypt`]})]}),s?(0,I.jsx)(Z,{message:s}):null,a?(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`h3`,{className:`font-bold text-keboola mb-2`,children:`Encrypted result`}),(0,I.jsx)(Em,{data:a})]}):null]})}var ih=r(e=>{let{securityLevel:t}=M(),n=i(`body`);return t===`sandbox`&&(n=i((i(`#i${e}`).node()?.contentDocument??document).body)),n.select(`#${e}`)},`selectSvgElement`);function ah(e){return e==null}r(ah,`isNothing`);function oh(e){return typeof e==`object`&&!!e}r(oh,`isObject`);function sh(e){return Array.isArray(e)?e:ah(e)?[]:[e]}r(sh,`toArray`);function ch(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}r(ch,`extend`);function lh(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}r(lh,`repeat`);function uh(e){return e===0&&1/e==-1/0}r(uh,`isNegativeZero`);var dh={isNothing:ah,isObject:oh,toArray:sh,repeat:lh,isNegativeZero:uh,extend:ch};function fh(e,t){var n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
|
|
47
|
+
|
|
48
|
+
`+e.mark.snippet),r+` `+n):r}r(fh,`formatError`);function ph(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=fh(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}r(ph,`YAMLException$1`),ph.prototype=Object.create(Error.prototype),ph.prototype.constructor=ph,ph.prototype.toString=r(function(e){return this.name+`: `+fh(this,e)},`toString`);var mh=ph;function hh(e,t,n,r,i){var a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}r(hh,`getLine`);function gh(e,t){return dh.repeat(` `,t-e.length)+e}r(gh,`padStart`);function _h(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||=79,typeof t.indent!=`number`&&(t.indent=1),typeof t.linesBefore!=`number`&&(t.linesBefore=3),typeof t.linesAfter!=`number`&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],a,o=-1;a=n.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var s=``,c,l,u=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+u+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)l=hh(e.buffer,r[o-c],i[o-c],e.position-(r[o]-r[o-c]),d),s=dh.repeat(` `,t.indent)+gh((e.line-c+1).toString(),u)+` | `+l.str+`
|
|
49
|
+
`+s;for(l=hh(e.buffer,r[o],i[o],e.position,d),s+=dh.repeat(` `,t.indent)+gh((e.line+1).toString(),u)+` | `+l.str+`
|
|
50
|
+
`,s+=dh.repeat(`-`,t.indent+u+3+l.pos)+`^
|
|
51
|
+
`,c=1;c<=t.linesAfter&&!(o+c>=i.length);c++)l=hh(e.buffer,r[o+c],i[o+c],e.position-(r[o]-r[o+c]),d),s+=dh.repeat(` `,t.indent)+gh((e.line+c+1).toString(),u)+` | `+l.str+`
|
|
52
|
+
`;return s.replace(/\n$/,``)}r(_h,`makeSnippet`);var vh=_h,yh=[`kind`,`multi`,`resolve`,`construct`,`instanceOf`,`predicate`,`represent`,`representName`,`defaultStyle`,`styleAliases`],bh=[`scalar`,`sequence`,`mapping`];function xh(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}r(xh,`compileStyleAliases`);function Sh(e,t){if(t||={},Object.keys(t).forEach(function(t){if(yh.indexOf(t)===-1)throw new mh(`Unknown option "`+t+`" is met in definition of "`+e+`" YAML type.`)}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=xh(t.styleAliases||null),bh.indexOf(this.kind)===-1)throw new mh(`Unknown kind "`+this.kind+`" is specified for "`+e+`" YAML type.`)}r(Sh,`Type$1`);var Ch=Sh;function wh(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}r(wh,`compileList`);function Th(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function i(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(r(i,`collectType`),t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(i);return e}r(Th,`compileMap`);function Eh(e){return this.extend(e)}r(Eh,`Schema$1`),Eh.prototype.extend=r(function(e){var t=[],n=[];if(e instanceof Ch)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new mh(`Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })`);t.forEach(function(e){if(!(e instanceof Ch))throw new mh(`Specified list of YAML types (or a single Type object) contains a non-Type object.`);if(e.loadKind&&e.loadKind!==`scalar`)throw new mh(`There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.`);if(e.multi)throw new mh(`There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.`)}),n.forEach(function(e){if(!(e instanceof Ch))throw new mh(`Specified list of YAML types (or a single Type object) contains a non-Type object.`)});var r=Object.create(Eh.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=wh(r,`implicit`),r.compiledExplicit=wh(r,`explicit`),r.compiledTypeMap=Th(r.compiledImplicit,r.compiledExplicit),r},`extend`);var Dh=new Eh({explicit:[new Ch(`tag:yaml.org,2002:str`,{kind:`scalar`,construct:r(function(e){return e===null?``:e},`construct`)}),new Ch(`tag:yaml.org,2002:seq`,{kind:`sequence`,construct:r(function(e){return e===null?[]:e},`construct`)}),new Ch(`tag:yaml.org,2002:map`,{kind:`mapping`,construct:r(function(e){return e===null?{}:e},`construct`)})]});function Oh(e){if(e===null)return!0;var t=e.length;return t===1&&e===`~`||t===4&&(e===`null`||e===`Null`||e===`NULL`)}r(Oh,`resolveYamlNull`);function kh(){return null}r(kh,`constructYamlNull`);function Ah(e){return e===null}r(Ah,`isNull`);var jh=new Ch(`tag:yaml.org,2002:null`,{kind:`scalar`,resolve:Oh,construct:kh,predicate:Ah,represent:{canonical:r(function(){return`~`},`canonical`),lowercase:r(function(){return`null`},`lowercase`),uppercase:r(function(){return`NULL`},`uppercase`),camelcase:r(function(){return`Null`},`camelcase`),empty:r(function(){return``},`empty`)},defaultStyle:`lowercase`});function Mh(e){if(e===null)return!1;var t=e.length;return t===4&&(e===`true`||e===`True`||e===`TRUE`)||t===5&&(e===`false`||e===`False`||e===`FALSE`)}r(Mh,`resolveYamlBoolean`);function Nh(e){return e===`true`||e===`True`||e===`TRUE`}r(Nh,`constructYamlBoolean`);function Ph(e){return Object.prototype.toString.call(e)===`[object Boolean]`}r(Ph,`isBoolean`);var Fh=new Ch(`tag:yaml.org,2002:bool`,{kind:`scalar`,resolve:Mh,construct:Nh,predicate:Ph,represent:{lowercase:r(function(e){return e?`true`:`false`},`lowercase`),uppercase:r(function(e){return e?`TRUE`:`FALSE`},`uppercase`),camelcase:r(function(e){return e?`True`:`False`},`camelcase`)},defaultStyle:`lowercase`});function Ih(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}r(Ih,`isHexCode`);function Lh(e){return 48<=e&&e<=55}r(Lh,`isOctCode`);function Rh(e){return 48<=e&&e<=57}r(Rh,`isDecCode`);function zh(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i===`-`||i===`+`)&&(i=e[++n]),i===`0`){if(n+1===t)return!0;if(i=e[++n],i===`b`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(i!==`0`&&i!==`1`)return!1;r=!0}return r&&i!==`_`}if(i===`x`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!Ih(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}if(i===`o`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!Lh(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}}if(i===`_`)return!1;for(;n<t;n++)if(i=e[n],i!==`_`){if(!Rh(e.charCodeAt(n)))return!1;r=!0}return!(!r||i===`_`)}r(zh,`resolveYamlInteger`);function Bh(e){var t=e,n=1,r;if(t.indexOf(`_`)!==-1&&(t=t.replace(/_/g,``)),r=t[0],(r===`-`||r===`+`)&&(r===`-`&&(n=-1),t=t.slice(1),r=t[0]),t===`0`)return 0;if(r===`0`){if(t[1]===`b`)return n*parseInt(t.slice(2),2);if(t[1]===`x`)return n*parseInt(t.slice(2),16);if(t[1]===`o`)return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}r(Bh,`constructYamlInteger`);function Vh(e){return Object.prototype.toString.call(e)===`[object Number]`&&e%1==0&&!dh.isNegativeZero(e)}r(Vh,`isInteger`);var Hh=new Ch(`tag:yaml.org,2002:int`,{kind:`scalar`,resolve:zh,construct:Bh,predicate:Vh,represent:{binary:r(function(e){return e>=0?`0b`+e.toString(2):`-0b`+e.toString(2).slice(1)},`binary`),octal:r(function(e){return e>=0?`0o`+e.toString(8):`-0o`+e.toString(8).slice(1)},`octal`),decimal:r(function(e){return e.toString(10)},`decimal`),hexadecimal:r(function(e){return e>=0?`0x`+e.toString(16).toUpperCase():`-0x`+e.toString(16).toUpperCase().slice(1)},`hexadecimal`)},defaultStyle:`decimal`,styleAliases:{binary:[2,`bin`],octal:[8,`oct`],decimal:[10,`dec`],hexadecimal:[16,`hex`]}}),Uh=RegExp(`^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function Wh(e){return!(e===null||!Uh.test(e)||e[e.length-1]===`_`)}r(Wh,`resolveYamlFloat`);function Gh(e){var t=e.replace(/_/g,``).toLowerCase(),n=t[0]===`-`?-1:1;return`+-`.indexOf(t[0])>=0&&(t=t.slice(1)),t===`.inf`?n===1?1/0:-1/0:t===`.nan`?NaN:n*parseFloat(t,10)}r(Gh,`constructYamlFloat`);var Kh=/^[-+]?[0-9]+e/;function qh(e,t){var n;if(isNaN(e))switch(t){case`lowercase`:return`.nan`;case`uppercase`:return`.NAN`;case`camelcase`:return`.NaN`}else if(e===1/0)switch(t){case`lowercase`:return`.inf`;case`uppercase`:return`.INF`;case`camelcase`:return`.Inf`}else if(e===-1/0)switch(t){case`lowercase`:return`-.inf`;case`uppercase`:return`-.INF`;case`camelcase`:return`-.Inf`}else if(dh.isNegativeZero(e))return`-0.0`;return n=e.toString(10),Kh.test(n)?n.replace(`e`,`.e`):n}r(qh,`representYamlFloat`);function Jh(e){return Object.prototype.toString.call(e)===`[object Number]`&&(e%1!=0||dh.isNegativeZero(e))}r(Jh,`isFloat`);var Yh=new Ch(`tag:yaml.org,2002:float`,{kind:`scalar`,resolve:Wh,construct:Gh,predicate:Jh,represent:qh,defaultStyle:`lowercase`}),Xh=Dh.extend({implicit:[jh,Fh,Hh,Yh]}),Zh=Xh,Qh=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),$h=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function eg(e){return e===null?!1:Qh.exec(e)!==null||$h.exec(e)!==null}r(eg,`resolveYamlTimestamp`);function tg(e){var t,n,r,i,a,o,s,c=0,l=null,u,d,f;if(t=Qh.exec(e),t===null&&(t=$h.exec(e)),t===null)throw Error(`Date resolve error`);if(n=+t[1],r=t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+=`0`;c=+c}return t[9]&&(u=+t[10],d=+(t[11]||0),l=(u*60+d)*6e4,t[9]===`-`&&(l=-l)),f=new Date(Date.UTC(n,r,i,a,o,s,c)),l&&f.setTime(f.getTime()-l),f}r(tg,`constructYamlTimestamp`);function ng(e){return e.toISOString()}r(ng,`representYamlTimestamp`);var rg=new Ch(`tag:yaml.org,2002:timestamp`,{kind:`scalar`,resolve:eg,construct:tg,instanceOf:Date,represent:ng});function ig(e){return e===`<<`||e===null}r(ig,`resolveYamlMerge`);var ag=new Ch(`tag:yaml.org,2002:merge`,{kind:`scalar`,resolve:ig}),og=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
53
|
+
\r`;function sg(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=og;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8==0}r(sg,`resolveYamlBinary`);function cg(e){var t,n,r=e.replace(/[\r\n=]/g,``),i=r.length,a=og,o=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),new Uint8Array(s)}r(cg,`constructYamlBinary`);function lg(e){var t=``,n=0,r,i,a=e.length,o=og;for(r=0;r<a;r++)r%3==0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}r(lg,`representYamlBinary`);function ug(e){return Object.prototype.toString.call(e)===`[object Uint8Array]`}r(ug,`isBinary`);var dg=new Ch(`tag:yaml.org,2002:binary`,{kind:`scalar`,resolve:sg,construct:cg,predicate:ug,represent:lg}),fg=Object.prototype.hasOwnProperty,pg=Object.prototype.toString;function mg(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,pg.call(i)!==`[object Object]`)return!1;for(a in i)if(fg.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}r(mg,`resolveYamlOmap`);function hg(e){return e===null?[]:e}r(hg,`constructYamlOmap`);var gg=new Ch(`tag:yaml.org,2002:omap`,{kind:`sequence`,resolve:mg,construct:hg}),_g=Object.prototype.toString;function vg(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],_g.call(r)!==`[object Object]`||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}r(vg,`resolveYamlPairs`);function yg(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}r(yg,`constructYamlPairs`);var bg=new Ch(`tag:yaml.org,2002:pairs`,{kind:`sequence`,resolve:vg,construct:yg}),xg=Object.prototype.hasOwnProperty;function Sg(e){if(e===null)return!0;var t,n=e;for(t in n)if(xg.call(n,t)&&n[t]!==null)return!1;return!0}r(Sg,`resolveYamlSet`);function Cg(e){return e===null?{}:e}r(Cg,`constructYamlSet`);var wg=new Ch(`tag:yaml.org,2002:set`,{kind:`mapping`,resolve:Sg,construct:Cg}),Tg=Zh.extend({implicit:[rg,ag],explicit:[dg,gg,bg,wg]}),Eg=Object.prototype.hasOwnProperty,Dg=1,Og=2,kg=3,Ag=4,jg=1,Mg=2,Ng=3,Pg=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Fg=/[\x85\u2028\u2029]/,Ig=/[,\[\]\{\}]/,Lg=/^(?:!|!!|![a-z\-]+!)$/i,Rg=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function zg(e){return Object.prototype.toString.call(e)}r(zg,`_class`);function Bg(e){return e===10||e===13}r(Bg,`is_EOL`);function Vg(e){return e===9||e===32}r(Vg,`is_WHITE_SPACE`);function Hg(e){return e===9||e===32||e===10||e===13}r(Hg,`is_WS_OR_EOL`);function Ug(e){return e===44||e===91||e===93||e===123||e===125}r(Ug,`is_FLOW_INDICATOR`);function Wg(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}r(Wg,`fromHexCode`);function Gg(e){return e===120?2:e===117?4:e===85?8:0}r(Gg,`escapedHexLen`);function Kg(e){return 48<=e&&e<=57?e-48:-1}r(Kg,`fromDecimalCode`);function qg(e){return e===48?`\0`:e===97?`\x07`:e===98?`\b`:e===116||e===9?` `:e===110?`
|
|
54
|
+
`:e===118?`\v`:e===102?`\f`:e===114?`\r`:e===101?`\x1B`:e===32?` `:e===34?`"`:e===47?`/`:e===92?`\\`:e===78?`
`:e===95?`\xA0`:e===76?`\u2028`:e===80?`\u2029`:``}r(qg,`simpleEscapeSequence`);function Jg(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}r(Jg,`charFromCodepoint`);function Yg(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}r(Yg,`setProperty`);var Xg=Array(256),Zg=Array(256);for(Qg=0;Qg<256;Qg++)Xg[Qg]=+!!qg(Qg),Zg[Qg]=qg(Qg);var Qg;function $g(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Tg,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}r($g,`State$1`);function e_(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=vh(n),new mh(t,n)}r(e_,`generateError`);function $(e,t){throw e_(e,t)}r($,`throwError`);function t_(e,t){e.onWarning&&e.onWarning.call(null,e_(e,t))}r(t_,`throwWarning`);var n_={YAML:r(function(e,t,n){var r,i,a;e.version!==null&&$(e,`duplication of %YAML directive`),n.length!==1&&$(e,`YAML directive accepts exactly one argument`),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),r===null&&$(e,`ill-formed argument of the YAML directive`),i=parseInt(r[1],10),a=parseInt(r[2],10),i!==1&&$(e,`unacceptable YAML version of the document`),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&t_(e,`unsupported YAML version of the document`)},`handleYamlDirective`),TAG:r(function(e,t,n){var r,i;n.length!==2&&$(e,`TAG directive accepts exactly two arguments`),r=n[0],i=n[1],Lg.test(r)||$(e,`ill-formed tag handle (first argument) of the TAG directive`),Eg.call(e.tagMap,r)&&$(e,`there is a previously declared suffix for "`+r+`" tag handle`),Rg.test(i)||$(e,`ill-formed tag prefix (second argument) of the TAG directive`);try{i=decodeURIComponent(i)}catch{$(e,`tag prefix is malformed: `+i)}e.tagMap[r]=i},`handleTagDirective`)};function r_(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||$(e,`expected valid JSON character`);else Pg.test(s)&&$(e,`the stream contains non-printable characters`);e.result+=s}}r(r_,`captureSegment`);function i_(e,t,n,r){var i,a,o,s;for(dh.isObject(n)||$(e,`cannot merge mappings; the provided source object is unacceptable`),i=Object.keys(n),o=0,s=i.length;o<s;o+=1)a=i[o],Eg.call(t,a)||(Yg(t,a,n[a]),r[a]=!0)}r(i_,`mergeMappings`);function a_(e,t,n,r,i,a,o,s,c){var l,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),l=0,u=i.length;l<u;l+=1)Array.isArray(i[l])&&$(e,`nested arrays are not supported inside keys`),typeof i==`object`&&zg(i[l])===`[object Object]`&&(i[l]=`[object Object]`);if(typeof i==`object`&&zg(i)===`[object Object]`&&(i=`[object Object]`),i=String(i),t===null&&(t={}),r===`tag:yaml.org,2002:merge`)if(Array.isArray(a))for(l=0,u=a.length;l<u;l+=1)i_(e,t,a[l],n);else i_(e,t,a,n);else !e.json&&!Eg.call(n,i)&&Eg.call(t,i)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,$(e,`duplicated mapping key`)),Yg(t,i,a),delete n[i];return t}r(a_,`storeMappingPair`);function o_(e){var t=e.input.charCodeAt(e.position);t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):$(e,`a line break is expected`),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}r(o_,`readLineBreak`);function s_(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Vg(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Bg(i))for(o_(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&t_(e,`deficient indentation`),r}r(s_,`skipSeparationSpace`);function c_(e){var t=e.position,n=e.input.charCodeAt(t);return!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Hg(n)))}r(c_,`testDocumentSeparator`);function l_(e,t){t===1?e.result+=` `:t>1&&(e.result+=dh.repeat(`
|
|
55
|
+
`,t-1))}r(l_,`writeFoldedLines`);function u_(e,t,n){var r,i,a,o,s,c,l,u,d=e.kind,f=e.result,p=e.input.charCodeAt(e.position);if(Hg(p)||Ug(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),Hg(i)||n&&Ug(i)))return!1;for(e.kind=`scalar`,e.result=``,a=o=e.position,s=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),Hg(i)||n&&Ug(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),Hg(r))break}else if(e.position===e.lineStart&&c_(e)||n&&Ug(p))break;else if(Bg(p))if(c=e.line,l=e.lineStart,u=e.lineIndent,s_(e,!1,-1),e.lineIndent>=t){s=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=l,e.lineIndent=u;break}s&&=(r_(e,a,o,!1),l_(e,e.line-c),a=o=e.position,!1),Vg(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return r_(e,a,o,!1),e.result?!0:(e.kind=d,e.result=f,!1)}r(u_,`readPlainScalar`);function d_(e,t){var n=e.input.charCodeAt(e.position),r,i;if(n!==39)return!1;for(e.kind=`scalar`,e.result=``,e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(r_(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else Bg(n)?(r_(e,r,i,!0),l_(e,s_(e,!1,t)),r=i=e.position):e.position===e.lineStart&&c_(e)?$(e,`unexpected end of the document within a single quoted scalar`):(e.position++,i=e.position);$(e,`unexpected end of the stream within a single quoted scalar`)}r(d_,`readSingleQuotedScalar`);function f_(e,t){var n,r,i,a,o,s=e.input.charCodeAt(e.position);if(s!==34)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;)if(s===34)return r_(e,n,e.position,!0),e.position++,!0;else if(s===92){if(r_(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),Bg(s))s_(e,!1,t);else if(s<256&&Xg[s])e.result+=Zg[s],e.position++;else if((o=Gg(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=Wg(s))>=0?a=(a<<4)+o:$(e,`expected hexadecimal character`);e.result+=Jg(a),e.position++}else $(e,`unknown escape sequence`);n=r=e.position}else Bg(s)?(r_(e,n,r,!0),l_(e,s_(e,!1,t)),n=r=e.position):e.position===e.lineStart&&c_(e)?$(e,`unexpected end of the document within a double quoted scalar`):(e.position++,r=e.position);$(e,`unexpected end of the stream within a double quoted scalar`)}r(f_,`readDoubleQuotedScalar`);function p_(e,t){var n=!0,r,i,a,o=e.tag,s,c=e.anchor,l,u,d,f,p,m=Object.create(null),h,g,_,v=e.input.charCodeAt(e.position);if(v===91)u=93,p=!1,s=[];else if(v===123)u=125,p=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if(s_(e,!0,t),v=e.input.charCodeAt(e.position),v===u)return e.position++,e.tag=o,e.anchor=c,e.kind=p?`mapping`:`sequence`,e.result=s,!0;n?v===44&&$(e,`expected the node content, but found ','`):$(e,`missed comma between flow collection entries`),g=h=_=null,d=f=!1,v===63&&(l=e.input.charCodeAt(e.position+1),Hg(l)&&(d=f=!0,e.position++,s_(e,!0,t))),r=e.line,i=e.lineStart,a=e.position,b_(e,t,Dg,!1,!0),g=e.tag,h=e.result,s_(e,!0,t),v=e.input.charCodeAt(e.position),(f||e.line===r)&&v===58&&(d=!0,v=e.input.charCodeAt(++e.position),s_(e,!0,t),b_(e,t,Dg,!1,!0),_=e.result),p?a_(e,s,m,g,h,_,r,i,a):d?s.push(a_(e,null,m,g,h,_,r,i,a)):s.push(h),s_(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}$(e,`unexpected end of the stream within a flow collection`)}r(p_,`readFlowCollection`);function m_(e,t){var n,r,i=jg,a=!1,o=!1,s=t,c=0,l=!1,u,d=e.input.charCodeAt(e.position);if(d===124)r=!1;else if(d===62)r=!0;else return!1;for(e.kind=`scalar`,e.result=``;d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)jg===i?i=d===43?Ng:Mg:$(e,`repeat of a chomping mode identifier`);else if((u=Kg(d))>=0)u===0?$(e,`bad explicit indentation width of a block scalar; it cannot be less than one`):o?$(e,`repeat of an indentation width identifier`):(s=t+u-1,o=!0);else break;if(Vg(d)){do d=e.input.charCodeAt(++e.position);while(Vg(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Bg(d)&&d!==0)}for(;d!==0;){for(o_(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),Bg(d)){c++;continue}if(e.lineIndent<s){i===Ng?e.result+=dh.repeat(`
|
|
56
|
+
`,a?1+c:c):i===jg&&a&&(e.result+=`
|
|
57
|
+
`);break}for(r?Vg(d)?(l=!0,e.result+=dh.repeat(`
|
|
58
|
+
`,a?1+c:c)):l?(l=!1,e.result+=dh.repeat(`
|
|
59
|
+
`,c+1)):c===0?a&&(e.result+=` `):e.result+=dh.repeat(`
|
|
60
|
+
`,c):e.result+=dh.repeat(`
|
|
61
|
+
`,a?1+c:c),a=!0,o=!0,c=0,n=e.position;!Bg(d)&&d!==0;)d=e.input.charCodeAt(++e.position);r_(e,n,e.position,!1)}return!0}r(m_,`readBlockScalar`);function h_(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,$(e,`tab characters must not be used in indentation`)),!(c!==45||(o=e.input.charCodeAt(e.position+1),!Hg(o))));){if(s=!0,e.position++,s_(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,b_(e,t,kg,!1,!0),a.push(e.result),s_(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)$(e,`bad indentation of a sequence entry`);else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind=`sequence`,e.result=a,!0):!1}r(h_,`readBlockSequence`);function g_(e,t,n){var r,i,a,o,s,c,l=e.tag,u=e.anchor,d={},f=Object.create(null),p=null,m=null,h=null,g=!1,_=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),v=e.input.charCodeAt(e.position);v!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,$(e,`tab characters must not be used in indentation`)),r=e.input.charCodeAt(e.position+1),a=e.line,(v===63||v===58)&&Hg(r))v===63?(g&&(a_(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!0,i=!0):g?(g=!1,i=!0):$(e,`incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`),e.position+=1,v=r;else{if(o=e.line,s=e.lineStart,c=e.position,!b_(e,n,Og,!1,!0))break;if(e.line===a){for(v=e.input.charCodeAt(e.position);Vg(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),Hg(v)||$(e,`a whitespace character is expected after the key-value separator within a block mapping`),g&&(a_(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!1,i=!1,p=e.tag,m=e.result;else if(_)$(e,`can not read an implicit mapping pair; a colon is missed`);else return e.tag=l,e.anchor=u,!0}else if(_)$(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return e.tag=l,e.anchor=u,!0}if((e.line===a||e.lineIndent>t)&&(g&&(o=e.line,s=e.lineStart,c=e.position),b_(e,t,Ag,!0,i)&&(g?m=e.result:h=e.result),g||(a_(e,d,f,p,m,h,o,s,c),p=m=h=null),s_(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&v!==0)$(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return g&&a_(e,d,f,p,m,null,o,s,c),_&&(e.tag=l,e.anchor=u,e.kind=`mapping`,e.result=d),_}r(g_,`readBlockMapping`);function __(e){var t,n=!1,r=!1,i,a,o=e.input.charCodeAt(e.position);if(o!==33)return!1;if(e.tag!==null&&$(e,`duplication of a tag property`),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i=`!!`,o=e.input.charCodeAt(++e.position)):i=`!`,t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):$(e,`unexpected end of the stream within a verbatim tag`)}else{for(;o!==0&&!Hg(o);)o===33&&(r?$(e,`tag suffix cannot contain exclamation marks`):(i=e.input.slice(t-1,e.position+1),Lg.test(i)||$(e,`named tag handle cannot contain such characters`),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),Ig.test(a)&&$(e,`tag suffix cannot contain flow indicator characters`)}a&&!Rg.test(a)&&$(e,`tag name cannot contain such characters: `+a);try{a=decodeURIComponent(a)}catch{$(e,`tag name is malformed: `+a)}return n?e.tag=a:Eg.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i===`!`?e.tag=`!`+a:i===`!!`?e.tag=`tag:yaml.org,2002:`+a:$(e,`undeclared tag handle "`+i+`"`),!0}r(__,`readTagProperty`);function v_(e){var t,n=e.input.charCodeAt(e.position);if(n!==38)return!1;for(e.anchor!==null&&$(e,`duplication of an anchor property`),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Hg(n)&&!Ug(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&$(e,`name of an anchor node must contain at least one character`),e.anchor=e.input.slice(t,e.position),!0}r(v_,`readAnchorProperty`);function y_(e){var t,n,r=e.input.charCodeAt(e.position);if(r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Hg(r)&&!Ug(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&$(e,`name of an alias node must contain at least one character`),n=e.input.slice(t,e.position),Eg.call(e.anchorMap,n)||$(e,`unidentified alias "`+n+`"`),e.result=e.anchorMap[n],s_(e,!0,-1),!0}r(y_,`readAlias`);function b_(e,t,n,r,i){var a,o,s,c=1,l=!1,u=!1,d,f,p,m,h,g;if(e.listener!==null&&e.listener(`open`,e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=Ag===n||kg===n,r&&s_(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;__(e)||v_(e);)s_(e,!0,-1)?(l=!0,s=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&=l||i,(c===1||Ag===n)&&(h=Dg===n||Og===n?t:t+1,g=e.position-e.lineStart,c===1?s&&(h_(e,g)||g_(e,g,h))||p_(e,h)?u=!0:(o&&m_(e,h)||d_(e,h)||f_(e,h)?u=!0:y_(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&$(e,`alias node should not have any properties`)):u_(e,h,Dg===n)&&(u=!0,e.tag===null&&(e.tag=`?`)),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(u=s&&h_(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag===`?`){for(e.result!==null&&e.kind!==`scalar`&&$(e,`unacceptable node kind for !<?> tag; it should be "scalar", not "`+e.kind+`"`),d=0,f=e.implicitTypes.length;d<f;d+=1)if(m=e.implicitTypes[d],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!==`!`){if(Eg.call(e.typeMap[e.kind||`fallback`],e.tag))m=e.typeMap[e.kind||`fallback`][e.tag];else for(m=null,p=e.typeMap.multi[e.kind||`fallback`],d=0,f=p.length;d<f;d+=1)if(e.tag.slice(0,p[d].tag.length)===p[d].tag){m=p[d];break}m||$(e,`unknown tag !<`+e.tag+`>`),e.result!==null&&m.kind!==e.kind&&$(e,`unacceptable node kind for !<`+e.tag+`> tag; it should be "`+m.kind+`", not "`+e.kind+`"`),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):$(e,`cannot resolve a node with !<`+e.tag+`> explicit tag`)}return e.listener!==null&&e.listener(`close`,e),e.tag!==null||e.anchor!==null||u}r(b_,`composeNode`);function x_(e){var t=e.position,n,r,i,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(s_(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!Hg(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&$(e,`directive name must not be less than one character in length`);o!==0;){for(;Vg(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!Bg(o));break}if(Bg(o))break;for(n=e.position;o!==0&&!Hg(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&o_(e),Eg.call(n_,r)?n_[r](e,r,i):t_(e,`unknown document directive "`+r+`"`)}if(s_(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,s_(e,!0,-1)):a&&$(e,`directives end mark is expected`),b_(e,e.lineIndent-1,Ag,!1,!0),s_(e,!0,-1),e.checkLineBreaks&&Fg.test(e.input.slice(t,e.position))&&t_(e,`non-ASCII line breaks are interpreted as content`),e.documents.push(e.result),e.position===e.lineStart&&c_(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,s_(e,!0,-1));return}if(e.position<e.length-1)$(e,`end of the stream or a document separator is expected`);else return}r(x_,`readDocument`);function S_(e,t){e=String(e),t||={},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
62
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new $g(e,t),r=e.indexOf(`\0`);for(r!==-1&&(n.position=r,$(n,`null byte is not allowed in input`)),n.input+=`\0`;n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)x_(n);return n.documents}r(S_,`loadDocuments`);function C_(e,t,n){typeof t==`object`&&t&&n===void 0&&(n=t,t=null);var r=S_(e,n);if(typeof t!=`function`)return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}r(C_,`loadAll$1`);function w_(e,t){var n=S_(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new mh(`expected a single document in the stream, but found more`)}}r(w_,`load$1`);var T_={loadAll:C_,load:w_},E_=Object.prototype.toString,D_=Object.prototype.hasOwnProperty,O_=65279,k_=9,A_=10,j_=13,M_=32,N_=33,P_=34,F_=35,I_=37,L_=38,R_=39,z_=42,B_=44,V_=45,H_=58,U_=61,W_=62,G_=63,K_=64,q_=91,J_=93,Y_=96,X_=123,Z_=124,Q_=125,$_={};$_[0]=`\\0`,$_[7]=`\\a`,$_[8]=`\\b`,$_[9]=`\\t`,$_[10]=`\\n`,$_[11]=`\\v`,$_[12]=`\\f`,$_[13]=`\\r`,$_[27]=`\\e`,$_[34]=`\\"`,$_[92]=`\\\\`,$_[133]=`\\N`,$_[160]=`\\_`,$_[8232]=`\\L`,$_[8233]=`\\P`;var ev=[`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],tv=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function nv(e,t){var n,r,i,a,o,s,c;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)===`!!`&&(o=`tag:yaml.org,2002:`+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&D_.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[o]=s;return n}r(nv,`compileStyleMap`);function rv(e){var t=e.toString(16).toUpperCase(),n,r;if(e<=255)n=`x`,r=2;else if(e<=65535)n=`u`,r=4;else if(e<=4294967295)n=`U`,r=8;else throw new mh(`code point within a string may not be greater than 0xFFFFFFFF`);return`\\`+n+dh.repeat(`0`,r-t.length)+t}r(rv,`encodeHex`);var iv=1,av=2;function ov(e){this.schema=e.schema||Tg,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=dh.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=nv(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType===`"`?av:iv,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer==`function`?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=``,this.duplicates=[],this.usedDuplicates=null}r(ov,`State`);function sv(e,t){for(var n=dh.repeat(` `,t),r=0,i=-1,a=``,o,s=e.length;r<s;)i=e.indexOf(`
|
|
63
|
+
`,r),i===-1?(o=e.slice(r),r=s):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
|
|
64
|
+
`&&(a+=n),a+=o;return a}r(sv,`indentString`);function cv(e,t){return`
|
|
65
|
+
`+dh.repeat(` `,e.indent*t)}r(cv,`generateNextLine`);function lv(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}r(lv,`testImplicitResolving`);function uv(e){return e===M_||e===k_}r(uv,`isWhitespace`);function dv(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==O_||65536<=e&&e<=1114111}r(dv,`isPrintable`);function fv(e){return dv(e)&&e!==O_&&e!==j_&&e!==A_}r(fv,`isNsCharOrWhitespace`);function pv(e,t,n){var r=fv(e),i=r&&!uv(e);return(n?r:r&&e!==B_&&e!==q_&&e!==J_&&e!==X_&&e!==Q_)&&e!==F_&&!(t===H_&&!i)||fv(t)&&!uv(t)&&e===F_||t===H_&&i}r(pv,`isPlainSafe`);function mv(e){return dv(e)&&e!==O_&&!uv(e)&&e!==V_&&e!==G_&&e!==H_&&e!==B_&&e!==q_&&e!==J_&&e!==X_&&e!==Q_&&e!==F_&&e!==L_&&e!==z_&&e!==N_&&e!==Z_&&e!==U_&&e!==W_&&e!==R_&&e!==P_&&e!==I_&&e!==K_&&e!==Y_}r(mv,`isPlainSafeFirst`);function hv(e){return!uv(e)&&e!==H_}r(hv,`isPlainSafeLast`);function gv(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}r(gv,`codePointAt`);function _v(e){return/^\n* /.test(e)}r(_v,`needIndentIndicator`);var vv=1,yv=2,bv=3,xv=4,Sv=5;function Cv(e,t,n,r,i,a,o,s){var c,l=0,u=null,d=!1,f=!1,p=r!==-1,m=-1,h=mv(gv(e,0))&&hv(gv(e,e.length-1));if(t||o)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=gv(e,c),!dv(l))return Sv;h&&=pv(l,u,s),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=gv(e,c),l===A_)d=!0,p&&(f||=c-m-1>r&&e[m+1]!==` `,m=c);else if(!dv(l))return Sv;h&&=pv(l,u,s),u=l}f||=p&&c-m-1>r&&e[m+1]!==` `}return!d&&!f?h&&!o&&!i(e)?vv:a===av?Sv:yv:n>9&&_v(e)?Sv:o?a===av?Sv:yv:f?xv:bv}r(Cv,`chooseScalarStyle`);function wv(e,t,n,i,a){e.dump=(function(){if(t.length===0)return e.quotingType===av?`""`:`''`;if(!e.noCompatMode&&(ev.indexOf(t)!==-1||tv.test(t)))return e.quotingType===av?`"`+t+`"`:`'`+t+`'`;var o=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),c=i||e.flowLevel>-1&&n>=e.flowLevel;function l(t){return lv(e,t)}switch(r(l,`testAmbiguity`),Cv(t,c,e.indent,s,l,e.quotingType,e.forceQuotes&&!i,a)){case vv:return t;case yv:return`'`+t.replace(/'/g,`''`)+`'`;case bv:return`|`+Tv(t,e.indent)+Ev(sv(t,o));case xv:return`>`+Tv(t,e.indent)+Ev(sv(Dv(t,s),o));case Sv:return`"`+kv(t)+`"`;default:throw new mh(`impossible error: invalid scalar style`)}})()}r(wv,`writeScalar`);function Tv(e,t){var n=_v(e)?String(t):``,r=e[e.length-1]===`
|
|
66
|
+
`;return n+(r&&(e[e.length-2]===`
|
|
67
|
+
`||e===`
|
|
68
|
+
`)?`+`:r?``:`-`)+`
|
|
69
|
+
`}r(Tv,`blockHeader`);function Ev(e){return e[e.length-1]===`
|
|
70
|
+
`?e.slice(0,-1):e}r(Ev,`dropEndingNewline`);function Dv(e,t){for(var n=/(\n+)([^\n]*)/g,r=(function(){var r=e.indexOf(`
|
|
71
|
+
`);return r=r===-1?e.length:r,n.lastIndex=r,Ov(e.slice(0,r),t)})(),i=e[0]===`
|
|
72
|
+
`||e[0]===` `,a,o;o=n.exec(e);){var s=o[1],c=o[2];a=c[0]===` `,r+=s+(!i&&!a&&c!==``?`
|
|
73
|
+
`:``)+Ov(c,t),i=a}return r}r(Dv,`foldString`);function Ov(e,t){if(e===``||e[0]===` `)return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,c=``;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,c+=`
|
|
74
|
+
`+e.slice(i,a),i=a+1),o=s;return c+=`
|
|
75
|
+
`,e.length-i>t&&o>i?c+=e.slice(i,o)+`
|
|
76
|
+
`+e.slice(o+1):c+=e.slice(i),c.slice(1)}r(Ov,`foldLine`);function kv(e){for(var t=``,n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=gv(e,i),r=$_[n],!r&&dv(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||rv(n);return t}r(kv,`escapeString`);function Av(e,t,n){var r=``,i=e.tag,a,o,s;for(a=0,o=n.length;a<o;a+=1)s=n[a],e.replacer&&(s=e.replacer.call(n,String(a),s)),(Fv(e,t,s,!1,!1)||s===void 0&&Fv(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump);e.tag=i,e.dump=`[`+r+`]`}r(Av,`writeFlowSequence`);function jv(e,t,n,r){var i=``,a=e.tag,o,s,c;for(o=0,s=n.length;o<s;o+=1)c=n[o],e.replacer&&(c=e.replacer.call(n,String(o),c)),(Fv(e,t+1,c,!0,!0,!1,!0)||c===void 0&&Fv(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=cv(e,t)),e.dump&&A_===e.dump.charCodeAt(0)?i+=`-`:i+=`- `,i+=e.dump);e.tag=a,e.dump=i||`[]`}r(jv,`writeBlockSequence`);function Mv(e,t,n){var r=``,i=e.tag,a=Object.keys(n),o,s,c,l,u;for(o=0,s=a.length;o<s;o+=1)u=``,r!==``&&(u+=`, `),e.condenseFlow&&(u+=`"`),c=a[o],l=n[c],e.replacer&&(l=e.replacer.call(n,c,l)),Fv(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+=`? `),u+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),Fv(e,t,l,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump=`{`+r+`}`}r(Mv,`writeFlowMapping`);function Nv(e,t,n,r){var i=``,a=e.tag,o=Object.keys(n),s,c,l,u,d,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys==`function`)o.sort(e.sortKeys);else if(e.sortKeys)throw new mh(`sortKeys must be a boolean or a function`);for(s=0,c=o.length;s<c;s+=1)f=``,(!r||i!==``)&&(f+=cv(e,t)),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),Fv(e,t+1,l,!0,!0,!0)&&(d=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024,d&&(e.dump&&A_===e.dump.charCodeAt(0)?f+=`?`:f+=`? `),f+=e.dump,d&&(f+=cv(e,t)),Fv(e,t+1,u,!0,d)&&(e.dump&&A_===e.dump.charCodeAt(0)?f+=`:`:f+=`: `,f+=e.dump,i+=f));e.tag=a,e.dump=i||`{}`}r(Nv,`writeBlockMapping`);function Pv(e,t,n){var r,i=n?e.explicitTypes:e.implicitTypes,a,o,s,c;for(a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t==`object`&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag=`?`,s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,E_.call(s.represent)===`[object Function]`)r=s.represent(t,c);else if(D_.call(s.represent,c))r=s.represent[c](t,c);else throw new mh(`!<`+s.tag+`> tag resolver accepts not "`+c+`" style`);e.dump=r}return!0}return!1}r(Pv,`detectType`);function Fv(e,t,n,r,i,a,o){e.tag=null,e.dump=n,Pv(e,n,!1)||Pv(e,n,!0);var s=E_.call(e.dump),c=r,l;r&&=e.flowLevel<0||e.flowLevel>t;var u=s===`[object Object]`||s===`[object Array]`,d,f;if(u&&(d=e.duplicates.indexOf(n),f=d!==-1),(e.tag!==null&&e.tag!==`?`||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[d])e.dump=`*ref_`+d;else{if(u&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),s===`[object Object]`)r&&Object.keys(e.dump).length!==0?(Nv(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(Mv(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object Array]`)r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?jv(e,t-1,e.dump,i):jv(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(Av(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object String]`)e.tag!==`?`&&wv(e,e.dump,t,a,c);else if(s===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new mh(`unacceptable kind of an object to dump `+s)}e.tag!==null&&e.tag!==`?`&&(l=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`),l=e.tag[0]===`!`?`!`+l:l.slice(0,18)===`tag:yaml.org,2002:`?`!!`+l.slice(18):`!<`+l+`>`,e.dump=l+` `+e.dump)}return!0}r(Fv,`writeNode`);function Iv(e,t){var n=[],r=[],i,a;for(Lv(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=Array(a)}r(Iv,`getDuplicateReferences`);function Lv(e,t,n){var r,i,a;if(typeof e==`object`&&e)if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)Lv(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)Lv(e[r[i]],t,n)}r(Lv,`inspectNode`);function Rv(e,t){t||={};var n=new ov(t);n.noRefs||Iv(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),Fv(n,0,r,!0,!0)?n.dump+`
|
|
77
|
+
`:``}r(Rv,`dump$1`);var zv={dump:Rv};function Bv(e,t){return function(){throw Error(`Function yaml.`+e+` is removed in js-yaml 4. Use yaml.`+t+` instead, which is now safe by default.`)}}r(Bv,`renamed`);var Vv=Xh,Hv=T_.load;T_.loadAll,zv.dump;function Uv(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function Wv(e){if(e==null)return!0;if(N(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!de(e)&&!we(e)&&!Te(e)?!1:e.length===0;if(typeof e==`object`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Uv(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var Gv=r((e,t,n,r,i,a=!1,o)=>{t.arrowTypeStart&&Jv(e,`start`,t.arrowTypeStart,n,r,i,a,o),t.arrowTypeEnd&&Jv(e,`end`,t.arrowTypeEnd,n,r,i,a,o)},`addEdgeMarkers`),Kv={arrow_cross:{type:`cross`,fill:!1},arrow_point:{type:`point`,fill:!0},arrow_barb:{type:`barb`,fill:!0},arrow_barb_neo:{type:`barb`,fill:!0},arrow_circle:{type:`circle`,fill:!1},aggregation:{type:`aggregation`,fill:!1},extension:{type:`extension`,fill:!1},composition:{type:`composition`,fill:!0},dependency:{type:`dependency`,fill:!0},lollipop:{type:`lollipop`,fill:!1},only_one:{type:`onlyOne`,fill:!1},zero_or_one:{type:`zeroOrOne`,fill:!1},one_or_more:{type:`oneOrMore`,fill:!1},zero_or_more:{type:`zeroOrMore`,fill:!1},requirement_arrow:{type:`requirement_arrow`,fill:!1},requirement_contains:{type:`requirement_contains`,fill:!1}},qv=[`cross`,`point`,`circle`,`lollipop`,`aggregation`,`extension`,`composition`,`dependency`,`barb`],Jv=r((e,t,r,i,a,o,s=!1,c)=>{let l=Kv[r],u=l&&qv.includes(l.type);if(!l){n.warn(`Unknown arrow type: ${r}`);return}let d=`${a}_${o}-${l.type}${t===`start`?`Start`:`End`}${s&&u?`-margin`:``}`;if(c&&c.trim()!==``){let n=`${d}_${c.replace(/[^\dA-Za-z]/g,`_`)}`;if(!document.getElementById(n)){let e=document.getElementById(d);if(e){let t=e.cloneNode(!0);t.id=n,t.querySelectorAll(`path, circle, line`).forEach(e=>{e.setAttribute(`stroke`,c),l.fill&&e.setAttribute(`fill`,c)}),e.parentNode?.appendChild(t)}}e.attr(`marker-${t}`,`url(${i}#${n})`)}else e.attr(`marker-${t}`,`url(${i}#${d})`)},`addEdgeMarker`),Yv=r(e=>typeof e==`string`?e:M()?.flowchart?.curve,`resolveEdgeCurveType`),Xv=new Map,Zv=new Map,Qv=r(()=>{Xv.clear(),Zv.clear()},`clear`),$v=r(e=>e?typeof e==`string`?e:e.reduce((e,t)=>e+`;`+t,``):``,`getLabelStyles`),ey=r(async(e,t)=>{let r=M(),a=g(r),{labelStyles:o}=Me(t);t.labelStyle=o;let s=e.insert(`g`).attr(`class`,`edgeLabel`),c=s.insert(`g`).attr(`class`,`label`).attr(`data-id`,t.id),l=t.labelType===`markdown`,u=await Fe(e,t.label,{style:$v(t.labelStyle),useHtmlLabels:a,addSvgBackground:!0,isNode:!1,markdown:l,width:void 0},r);c.node().appendChild(u),n.info(`abc82`,t,t.labelType);let d=u.getBBox(),f=d;if(a){let e=u.children[0],t=i(u);d=e.getBoundingClientRect(),f=d,t.attr(`width`,d.width),t.attr(`height`,d.height)}else{let e=i(u).select(`text`).node();e&&typeof e.getBBox==`function`&&(f=e.getBBox())}c.attr(`transform`,Ae(f,a)),Xv.set(t.id,s),t.width=d.width,t.height=d.height;let p;if(t.startLabelLeft){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),r=n.insert(`g`).attr(`class`,`inner`),o=await Be(r,t.startLabelLeft,$v(t.labelStyle)||``,!1,!1);p=o;let s=o.getBBox();if(a){let e=o.children[0],t=i(o);s=e.getBoundingClientRect(),t.attr(`width`,s.width),t.attr(`height`,s.height)}r.attr(`transform`,Ae(s,a)),Zv.get(t.id)||Zv.set(t.id,{}),Zv.get(t.id).startLeft=n,ty(p,t.startLabelLeft)}if(t.startLabelRight){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),r=n.insert(`g`).attr(`class`,`inner`),o=await Be(r,t.startLabelRight,$v(t.labelStyle)||``,!1,!1);p=o;let s=o.getBBox();if(a){let e=o.children[0],t=i(o);s=e.getBoundingClientRect(),t.attr(`width`,s.width),t.attr(`height`,s.height)}r.attr(`transform`,Ae(s,a)),Zv.get(t.id)||Zv.set(t.id,{}),Zv.get(t.id).startRight=n,ty(p,t.startLabelRight)}if(t.endLabelLeft){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),r=n.insert(`g`).attr(`class`,`inner`),o=await Be(n,t.endLabelLeft,$v(t.labelStyle)||``,!1,!1);p=o;let s=o.getBBox();if(a){let e=o.children[0],t=i(o);s=e.getBoundingClientRect(),t.attr(`width`,s.width),t.attr(`height`,s.height)}r.attr(`transform`,Ae(s,a)),Zv.get(t.id)||Zv.set(t.id,{}),Zv.get(t.id).endLeft=n,ty(p,t.endLabelLeft)}if(t.endLabelRight){let n=e.insert(`g`).attr(`class`,`edgeTerminals`),r=n.insert(`g`).attr(`class`,`inner`),o=await Be(n,t.endLabelRight,$v(t.labelStyle)||``,!1,!1);p=o;let s=o.getBBox();if(a){let e=o.children[0],t=i(o);s=e.getBoundingClientRect(),t.attr(`width`,s.width),t.attr(`height`,s.height)}r.attr(`transform`,Ae(s,a)),Zv.get(t.id)||Zv.set(t.id,{}),Zv.get(t.id).endRight=n,ty(p,t.endLabelRight)}return u},`insertEdgeLabel`);function ty(e,t){g(M())&&e&&(e.style.width=t.length*9+`px`,e.style.height=`12px`)}r(ty,`setTerminalWidth`);var ny=r((e,t)=>{n.debug(`Moving label abc88 `,e.id,e.label,Xv.get(e.id),t);let r=t.updatedPath?t.updatedPath:t.originalPath,{subGraphTitleTotalMargin:i}=je(M());if(e.label){let a=Xv.get(e.id),o=e.x,s=e.y;if(r){let i=he.calcLabelPosition(r);n.debug(`Moving label `+e.label+` from (`,o,`,`,s,`) to (`,i.x,`,`,i.y,`) abc88`),t.updatedPath&&(o=i.x,s=i.y)}a.attr(`transform`,`translate(${o}, ${s+i/2})`)}if(e.startLabelLeft){let t=Zv.get(e.id).startLeft,n=e.x,i=e.y;if(r){let t=he.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.startLabelRight){let t=Zv.get(e.id).startRight,n=e.x,i=e.y;if(r){let t=he.calcTerminalLabelPosition(e.arrowTypeStart?10:0,`start_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelLeft){let t=Zv.get(e.id).endLeft,n=e.x,i=e.y;if(r){let t=he.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_left`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}if(e.endLabelRight){let t=Zv.get(e.id).endRight,n=e.x,i=e.y;if(r){let t=he.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,`end_right`,r);n=t.x,i=t.y}t.attr(`transform`,`translate(${n}, ${i})`)}},`positionEdgeLabel`),ry=r((e,t)=>{let n=e.x,r=e.y,i=Math.abs(t.x-n),a=Math.abs(t.y-r),o=e.width/2,s=e.height/2;return i>=o||a>=s},`outsideNode`),iy=r((e,t,r)=>{n.debug(`intersection calc abc89:
|
|
78
|
+
outsidePoint: ${JSON.stringify(t)}
|
|
79
|
+
insidePoint : ${JSON.stringify(r)}
|
|
80
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);let i=e.x,a=e.y,o=Math.abs(i-r.x),s=e.width/2,c=r.x<t.x?s-o:s+o,l=e.height/2,u=Math.abs(t.y-r.y),d=Math.abs(t.x-r.x);if(Math.abs(a-t.y)*s>Math.abs(i-t.x)*l){let e=r.y<t.y?t.y-l-a:a-l-t.y;c=d*e/u;let i={x:r.x<t.x?r.x+c:r.x-d+c,y:r.y<t.y?r.y+u-e:r.y-u+e};return c===0&&(i.x=t.x,i.y=t.y),d===0&&(i.x=t.x),u===0&&(i.y=t.y),n.debug(`abc89 top/bottom calc, Q ${u}, q ${e}, R ${d}, r ${c}`,i),i}else{c=r.x<t.x?t.x-s-i:i-s-t.x;let e=u*c/d,a=r.x<t.x?r.x+d-c:r.x-d+c,o=r.y<t.y?r.y+e:r.y-e;return n.debug(`sides calc abc89, Q ${u}, q ${e}, R ${d}, r ${c}`,{_x:a,_y:o}),c===0&&(a=t.x,o=t.y),d===0&&(a=t.x),u===0&&(o=t.y),{x:a,y:o}}},`intersection`),ay=r((e,t)=>{n.warn(`abc88 cutPathAtIntersect`,e,t);let r=[],i=e[0],a=!1;return e.forEach(e=>{if(n.info(`abc88 checking point`,e,t),!ry(t,e)&&!a){let o=iy(t,i,e);n.debug(`abc88 inside`,e,i,o),n.debug(`abc88 intersection`,o,t);let s=!1;r.forEach(e=>{s||=e.x===o.x&&e.y===o.y}),r.some(e=>e.x===o.x&&e.y===o.y)?n.warn(`abc88 no intersect`,o,r):r.push(o),a=!0}else n.warn(`abc88 outside`,e,i),i=e,a||r.push(e)}),n.debug(`returning points`,r),r},`cutPathAtIntersect`);function oy(e){let t=[],n=[];for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1];(i.x===a.x&&a.y===o.y&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-i.y)>5||i.y===a.y&&a.x===o.x&&Math.abs(a.x-i.x)>5&&Math.abs(a.y-o.y)>5)&&(t.push(a),n.push(r))}return{cornerPoints:t,cornerPointPositions:n}}r(oy,`extractCornerPoints`);var sy=r(function(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=n/Math.sqrt(r*r+i*i);return{x:t.x-a*r,y:t.y-a*i}},`findAdjacentPoint`),cy=r(function(e){let{cornerPointPositions:t}=oy(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){let t=e[i-1],a=e[i+1],o=e[i],s=sy(t,o,5),c=sy(a,o,5),l=c.x-s.x,u=c.y-s.y;r.push(s);let d=Math.sqrt(2)*2,f={x:o.x,y:o.y};Math.abs(a.x-t.x)>10&&Math.abs(a.y-t.y)>=10?(n.debug(`Corner point fixing`,Math.abs(a.x-t.x),Math.abs(a.y-t.y)),f=o.x===s.x?{x:l<0?s.x-5+d:s.x+5-d,y:u<0?s.y-d:s.y+d}:{x:l<0?s.x-d:s.x+d,y:u<0?s.y-5+d:s.y+5-d}):n.debug(`Corner point skipping fixing`,Math.abs(a.x-t.x),Math.abs(a.y-t.y)),r.push(f,c)}else r.push(e[i]);return r},`fixCorners`),ly=r((e,t,n)=>{let r=e-t-n,i=Math.floor(r/4);return`0 ${t} ${Array(i).fill(`2 2`).join(` `)} ${n}`},`generateDashArray`),uy=r(function(e,t,r,a,o,s,c,l=!1){if(!c)throw Error(`insertEdge: missing diagramId for edge "${t.id}" \u2014 edge IDs require a diagram prefix for uniqueness`);let{handDrawnSeed:u}=M(),d=t.points,f=!1,p=o;var m=s;let h=[];for(let e in t.cssCompiledStyles)Ne(e)||h.push(t.cssCompiledStyles[e]);n.debug(`UIO intersect check`,t.points,m.x,p.x),m.intersect&&p.intersect&&!l&&(d=d.slice(1,t.points.length-1),d.unshift(p.intersect(d[0])),n.debug(`Last point UIO`,t.start,`-->`,t.end,d[d.length-1],m,m.intersect(d[d.length-1])),d.push(m.intersect(d[d.length-1])));let g=btoa(JSON.stringify(d));t.toCluster&&(n.info(`to cluster abc88`,r.get(t.toCluster)),d=ay(t.points,r.get(t.toCluster).node),f=!0),t.fromCluster&&(n.debug(`from cluster abc88`,r.get(t.fromCluster),JSON.stringify(d,null,2)),d=ay(d.reverse(),r.get(t.fromCluster).node).reverse(),f=!0);let _=d.filter(e=>!Number.isNaN(e.y)),v=Yv(t.curve);v!==`rounded`&&(_=cy(_));let y=xe;switch(v){case`linear`:y=xe;break;case`basis`:y=pe;break;case`cardinal`:y=re;break;case`bumpX`:y=Se;break;case`bumpY`:y=ve;break;case`catmullRom`:y=oe;break;case`monotoneX`:y=se;break;case`monotoneY`:y=le;break;case`natural`:y=ce;break;case`step`:y=ie;break;case`stepAfter`:y=ae;break;case`stepBefore`:y=be;break;case`rounded`:y=xe;break;default:y=pe}let{x:b,y:x}=Oe(t),S=Ee().x(b).y(x).curve(y),C;switch(t.thickness){case`normal`:C=`edge-thickness-normal`;break;case`thick`:C=`edge-thickness-thick`;break;case`invisible`:C=`edge-thickness-invisible`;break;default:C=`edge-thickness-normal`}switch(t.pattern){case`solid`:C+=` edge-pattern-solid`;break;case`dotted`:C+=` edge-pattern-dotted`;break;case`dashed`:C+=` edge-pattern-dashed`;break;default:C+=` edge-pattern-solid`}let w,T=v===`rounded`?dy(py(_,t),5):S(_),E=Array.isArray(t.style)?t.style:[t.style],D=E.find(e=>e?.startsWith(`stroke:`)),O=``;t.animate&&(O=`edge-animation-fast`),t.animation&&(O=`edge-animation-`+t.animation);let k=!1;if(t.look===`handDrawn`){let n=Le.svg(e);Object.assign([],_);let r=n.path(T,{roughness:.3,seed:u});C+=` transition`,w=i(r).select(`path`).attr(`id`,`${c}-${t.id}`).attr(`class`,` `+C+(t.classes?` `+t.classes:``)+(O?` `+O:``)).attr(`style`,E?E.reduce((e,t)=>e+`;`+t,``):``);let a=w.attr(`d`);w.attr(`d`,a),e.node().appendChild(w.node())}else{let n=h.join(`;`),r=E?E.reduce((e,t)=>e+t+`;`,``):``,i=(n?n+`;`+r+`;`:r)+`;`+(E?E.reduce((e,t)=>e+`;`+t,``):``);w=e.append(`path`).attr(`d`,T).attr(`id`,`${c}-${t.id}`).attr(`class`,` `+C+(t.classes?` `+t.classes:``)+(O?` `+O:``)).attr(`style`,i),D=i.match(/stroke:([^;]+)/)?.[1],k=t.animate===!0||!!t.animation||n.includes(`animation`);let a=w.node(),o=typeof a.getTotalLength==`function`?a.getTotalLength():0,s=De[t.arrowTypeStart]||0,l=De[t.arrowTypeEnd]||0;if(t.look===`neo`&&!k){let e=`stroke-dasharray: ${t.pattern===`dotted`||t.pattern===`dashed`?ly(o,s,l):`0 ${s} ${o-s-l} ${l}`}; stroke-dashoffset: 0;`;w.attr(`style`,e+w.attr(`style`))}}w.attr(`data-edge`,!0),w.attr(`data-et`,`edge`),w.attr(`data-id`,t.id),w.attr(`data-points`,g),w.attr(`data-look`,Ce(t.look)),t.showPoints&&_.forEach(t=>{e.append(`circle`).style(`stroke`,`red`).style(`fill`,`red`).attr(`r`,1).attr(`cx`,t.x).attr(`cy`,t.y)});let ee=``;(M().flowchart.arrowMarkerAbsolute||M().state.arrowMarkerAbsolute)&&(ee=window.location.protocol+`//`+window.location.host+window.location.pathname+window.location.search,ee=ee.replace(/\(/g,`\\(`).replace(/\)/g,`\\)`)),n.info(`arrowTypeStart`,t.arrowTypeStart),n.info(`arrowTypeEnd`,t.arrowTypeEnd);let te=!k&&t?.look===`neo`;Gv(w,t,ee,c,a,te,D);let ne=Math.floor(d.length/2),A=d[ne];he.isLabelCoordinateInPath(A,w.attr(`d`))||(f=!0);let j={};return f&&(j.updatedPath=d),j.originalPath=t.points,j},`insertEdge`);function dy(e,t){if(e.length<2)return``;let n=``,r=e.length,i=1e-5;for(let a=0;a<r;a++){let o=e[a],s=e[a-1],c=e[a+1];if(a===0)n+=`M${o.x},${o.y}`;else if(a===r-1)n+=`L${o.x},${o.y}`;else{let e=o.x-s.x,r=o.y-s.y,a=c.x-o.x,l=c.y-o.y,u=Math.hypot(e,r),d=Math.hypot(a,l);if(u<i||d<i){n+=`L${o.x},${o.y}`;continue}let f=e/u,p=r/u,m=a/d,h=l/d,g=f*m+p*h,_=Math.acos(Math.max(-1,Math.min(1,g)));if(_<i||Math.abs(Math.PI-_)<i){n+=`L${o.x},${o.y}`;continue}let v=Math.min(t/Math.sin(_/2),u/2,d/2),y=o.x-f*v,b=o.y-p*v,x=o.x+m*v,S=o.y+h*v;n+=`L${y},${b}`,n+=`Q${o.x},${o.y} ${x},${S}`}}return n}r(dy,`generateRoundedPath`);function fy(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};let n=t.x-e.x,r=t.y-e.y;return{angle:Math.atan2(r,n),deltaX:n,deltaY:r}}r(fy,`calculateDeltaAndAngle`);function py(e,t){let n=e.map(e=>({...e}));if(e.length>=2&&ke[t.arrowTypeStart]){let r=ke[t.arrowTypeStart],i=e[0],a=e[1],{angle:o}=fy(i,a),s=r*Math.cos(o),c=r*Math.sin(o);n[0].x=i.x+s,n[0].y=i.y+c}let r=e.length;if(r>=2&&ke[t.arrowTypeEnd]){let i=ke[t.arrowTypeEnd],a=e[r-1],o=e[r-2],{angle:s}=fy(o,a),c=i*Math.cos(s),l=i*Math.sin(s);n[r-1].x=a.x-c,n[r-1].y=a.y-l}return n}r(py,`applyMarkerOffsetsToPoints`);var my=r((e,t,n,r)=>{t.forEach(t=>{hy[t](e,n,r)})},`insertMarkers`),hy={extension:r((e,t,r)=>{n.trace(`Making markers for `,r),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+t+`-extensionStart`).attr(`class`,`marker extension `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M 1,7 L18,13 V 1 Z`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+t+`-extensionEnd`).attr(`class`,`marker extension `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 V 13 L18,7 Z`),e.append(`marker`).attr(`id`,r+`_`+t+`-extensionStart-margin`).attr(`class`,`marker extension `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,7 18,13 18,1`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`),e.append(`defs`).append(`marker`).attr(`id`,r+`_`+t+`-extensionEnd-margin`).attr(`class`,`marker extension `+t).attr(`refX`,9).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`viewBox`,`0 0 20 14`).append(`polygon`).attr(`points`,`10,1 10,13 18,7`).style(`stroke-width`,2).style(`stroke-dasharray`,`0`)},`extension`),composition:r((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart`).attr(`class`,`marker composition `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd`).attr(`class`,`marker composition `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionStart-margin`).attr(`class`,`marker composition `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`viewBox`,`0 0 15 15`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-compositionEnd-margin`).attr(`class`,`marker composition `+t).attr(`refX`,3.5).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`composition`),aggregation:r((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart`).attr(`class`,`marker aggregation `+t).attr(`refX`,18).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationStart-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,15).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-aggregationEnd-margin`).attr(`class`,`marker aggregation `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,2).attr(`d`,`M 18,7 L9,13 L1,7 L9,1 Z`)},`aggregation`),dependency:r((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart`).attr(`class`,`marker dependency `+t).attr(`refX`,6).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd`).attr(`class`,`marker dependency `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyStart-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,4).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 5,7 L9,13 L1,7 L9,1 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-dependencyEnd-margin`).attr(`class`,`marker dependency `+t).attr(`refX`,16).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).style(`stroke-width`,0).attr(`d`,`M 18,7 L9,13 L14,7 L9,1 Z`)},`dependency`),lollipop:r((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopStart-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,13).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-lollipopEnd-margin`).attr(`class`,`marker lollipop `+t).attr(`refX`,1).attr(`refY`,7).attr(`markerWidth`,190).attr(`markerHeight`,240).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`circle`).attr(`fill`,`transparent`).attr(`cx`,7).attr(`cy`,7).attr(`r`,6).attr(`stroke-width`,2)},`lollipop`),point:r((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 10 5 L 0 10 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,4.5).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,8).attr(`markerHeight`,8).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 5 L 10 10 L 10 0 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,11.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,10.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0 0 L 11.5 7 L 0 14 z`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-pointStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 11.5 14`).attr(`refX`,1).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11.5).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0,7 11.5,14 11.5,0`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`point`),circle:r((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,11).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-1).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,1).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleEnd-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refY`,5).attr(`refX`,12.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-circleStart-margin`).attr(`class`,`marker `+t).attr(`viewBox`,`0 0 10 10`).attr(`refX`,-2).attr(`refY`,5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,14).attr(`markerHeight`,14).attr(`orient`,`auto`).append(`circle`).attr(`cx`,`5`).attr(`cy`,`5`).attr(`r`,`5`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,0).style(`stroke-dasharray`,`1,0`)},`circle`),cross:r((e,t,n)=>{e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,12).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 11 11`).attr(`refX`,-1).attr(`refY`,5.2).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,11).attr(`markerHeight`,11).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 l 9,9 M 10,1 l -9,9`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2).style(`stroke-dasharray`,`1,0`),e.append(`marker`).attr(`id`,n+`_`+t+`-crossEnd-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,17.7).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5),e.append(`marker`).attr(`id`,n+`_`+t+`-crossStart-margin`).attr(`class`,`marker cross `+t).attr(`viewBox`,`0 0 15 15`).attr(`refX`,-3.5).attr(`refY`,7.5).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 1,1 L 14,14 M 1,14 L 14,1`).attr(`class`,`arrowMarkerPath`).style(`stroke-width`,2.5).style(`stroke-dasharray`,`1,0`)},`cross`),barb:r((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`barb`),barbNeo:r((e,t,n)=>{let{themeVariables:r}=S(),{transitionColor:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`strokeWidth`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-barbEnd-margin`).attr(`refX`,17).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,14).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L11,14 L13,7 L11,0 Z`).attr(`fill`,`${i}`)},`barbNeo`),only_one:r((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`)},`only_one`),zero_or_one:r((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,21).attr(`cy`,9).attr(`r`,6),r.append(`path`).attr(`d`,`M9,0 L9,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,9).attr(`r`,6),i.append(`path`).attr(`d`,`M21,0 L21,18`)},`zero_or_one`),one_or_more:r((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`)},`one_or_more`),zero_or_more:r((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);r.append(`circle`).attr(`fill`,`white`).attr(`cx`,48).attr(`cy`,18).attr(`r`,6),r.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`);let i=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`);i.append(`circle`).attr(`fill`,`white`).attr(`cx`,9).attr(`cy`,18).attr(`r`,6),i.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`)},`zero_or_more`),only_one_neo:r((e,t,n)=>{let{themeVariables:r}=S(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneStart`).attr(`class`,`marker onlyOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M9,0 L9,18 M15,0 L15,18`).attr(`stroke-width`,`${i}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-onlyOneEnd`).attr(`class`,`marker onlyOne `+t).attr(`refX`,18).attr(`refY`,9).attr(`markerWidth`,18).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M3,0 L3,18 M9,0 L9,18`).attr(`stroke-width`,`${i}`)},`only_one_neo`),zero_or_one_neo:r((e,t,n)=>{let{themeVariables:r}=S(),{strokeWidth:i,mainBkg:a}=r,o=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneStart`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,0).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);o.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,21).attr(`cy`,9).attr(`stroke-width`,`${i}`).attr(`r`,6),o.append(`path`).attr(`d`,`M9,0 L9,18`).attr(`stroke-width`,`${i}`);let s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrOneEnd`).attr(`class`,`marker zeroOrOne `+t).attr(`refX`,30).attr(`refY`,9).attr(`markerWidth`,30).attr(`markerHeight`,18).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);s.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,9).attr(`cy`,9).attr(`stroke-width`,`${i}`).attr(`r`,6),s.append(`path`).attr(`d`,`M21,0 L21,18`).attr(`stroke-width`,`${i}`)},`zero_or_one_neo`),one_or_more_neo:r((e,t,n)=>{let{themeVariables:r}=S(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreStart`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`path`).attr(`d`,`M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27`).attr(`stroke-width`,`${i}`),e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-oneOrMoreEnd`).attr(`class`,`marker oneOrMore `+t).attr(`refX`,27).attr(`refY`,18).attr(`markerWidth`,45).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`).append(`path`).attr(`d`,`M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18`).attr(`stroke-width`,`${i}`)},`one_or_more_neo`),zero_or_more_neo:r((e,t,n)=>{let{themeVariables:r}=S(),{strokeWidth:i,mainBkg:a}=r,o=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreStart`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,18).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`markerUnits`,`userSpaceOnUse`).attr(`orient`,`auto`);o.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,45.5).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${i}`),o.append(`path`).attr(`d`,`M0,18 Q18,0 36,18 Q18,36 0,18`).attr(`stroke-width`,`${i}`);let s=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-zeroOrMoreEnd`).attr(`class`,`marker zeroOrMore `+t).attr(`refX`,39).attr(`refY`,18).attr(`markerWidth`,57).attr(`markerHeight`,36).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`);s.append(`circle`).attr(`fill`,a??`white`).attr(`cx`,11).attr(`cy`,18).attr(`r`,6).attr(`stroke-width`,`${i}`),s.append(`path`).attr(`d`,`M21,18 Q39,0 57,18 Q39,36 21,18`).attr(`stroke-width`,`${i}`)},`zero_or_more_neo`),requirement_arrow:r((e,t,n)=>{e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`path`).attr(`d`,`M0,0
|
|
81
|
+
L20,10
|
|
82
|
+
M20,10
|
|
83
|
+
L0,20`)},`requirement_arrow`),requirement_contains:r((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`g`);r.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),r.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),r.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10)},`requirement_contains`),requirement_arrow_neo:r((e,t,n)=>{let{themeVariables:r}=S(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`stroke-width`,`${i}`).attr(`viewBox`,`0 0 25 20`).append(`path`).attr(`d`,`M0,0
|
|
84
|
+
L20,10
|
|
85
|
+
M20,10
|
|
86
|
+
L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:r((e,t,n)=>{let{themeVariables:r}=S(),{strokeWidth:i}=r,a=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);a.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),a.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),a.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),a.selectAll(`*`).attr(`stroke-width`,`${i}`)},`requirement_contains_neo`)},gy=my,_y={common:ne,getConfig:S,insertCluster:ze,insertEdge:uy,insertEdgeLabel:ey,insertMarkers:gy,insertNode:Re,interpolateToCurve:fe,labelHelper:Ve,log:n,positionEdgeLabel:ny},vy={},yy=r(e=>{for(let t of e)vy[t.name]=t},`registerLayoutLoaders`);r(()=>{yy([{name:`dagre`,loader:r(async()=>await s(()=>import(`./dagre-BM42HDAG-UZ-9BTqF.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),`loader`)},{name:`cose-bilkent`,loader:r(async()=>await s(()=>import(`./cose-bilkent-S5V4N54A-Y0L8LDMa.js`),__vite__mapDeps([13,1,14])),`loader`)}])},`registerDefaultLayoutLoaders`)();var by=r(async(e,t)=>{if(!(e.layoutAlgorithm in vy))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=vy[e.layoutAlgorithm],r=await n.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:s,gradientStop:c}=a,l=t.attr(`id`);if(t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),t.append(`defs`).append(`filter`).attr(`id`,`${l}-drop-shadow-small`).attr(`height`,`150%`).attr(`width`,`150%`).append(`feDropShadow`).attr(`dx`,`2`).attr(`dy`,`2`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),o){let e=t.append(`linearGradient`).attr(`id`,t.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`svg:stop`).attr(`offset`,`0%`).attr(`stop-color`,s).attr(`stop-opacity`,1),e.append(`svg:stop`).attr(`offset`,`100%`).attr(`stop-color`,c).attr(`stop-opacity`,1)}return r.render(e,t,_y,{algorithm:n.algorithm})},`render`),xy=r((e=``,{fallback:t=`dagre`}={})=>{if(e in vy)return e;if(t in vy)return n.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},`getRegisteredLayoutAlgorithm`),Sy=`comm`,Cy=`rule`,wy=`decl`,Ty=`@import`,Ey=`@namespace`,Dy=`@keyframes`,Oy=`@layer`,ky=Math.abs,Ay=String.fromCharCode;function jy(e){return e.trim()}function My(e,t,n){return e.replace(t,n)}function Ny(e,t){return e.charCodeAt(t)|0}function Py(e,t,n){return e.slice(t,n)}function Fy(e){return e.length}function Iy(e){return e.length}function Ly(e,t){return t.push(e),e}var Ry=1,zy=1,By=0,Vy=0,Hy=0,Uy=``;function Wy(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:Ry,column:zy,length:o,return:``,siblings:s}}function Gy(){return Hy}function Ky(){return Hy=Vy>0?Ny(Uy,--Vy):0,zy--,Hy===10&&(zy=1,Ry--),Hy}function qy(){return Hy=Vy<By?Ny(Uy,Vy++):0,zy++,Hy===10&&(zy=1,Ry++),Hy}function Jy(){return Ny(Uy,Vy)}function Yy(){return Vy}function Xy(e,t){return Py(Uy,e,t)}function Zy(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Qy(e){return Ry=zy=1,By=Fy(Uy=e),Vy=0,[]}function $y(e){return Uy=``,e}function eb(e){return jy(Xy(Vy-1,rb(e===91?e+2:e===40?e+1:e)))}function tb(e){for(;(Hy=Jy())&&Hy<33;)qy();return Zy(e)>2||Zy(Hy)>3?``:` `}function nb(e,t){for(;--t&&qy()&&!(Hy<48||Hy>102||Hy>57&&Hy<65||Hy>70&&Hy<97););return Xy(e,Yy()+(t<6&&Jy()==32&&qy()==32))}function rb(e){for(;qy();)switch(Hy){case e:return Vy;case 34:case 39:e!==34&&e!==39&&rb(Hy);break;case 40:e===41&&rb(e);break;case 92:qy();break}return Vy}function ib(e,t){for(;qy()&&e+Hy!==57&&!(e+Hy===84&&Jy()===47););return`/*`+Xy(t,Vy-1)+`*`+Ay(e===47?e:qy())}function ab(e){for(;!Zy(Jy());)qy();return Xy(e,Vy)}function ob(e){return $y(sb(``,null,null,null,[``],e=Qy(e),0,[0],e))}function sb(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=qy()){case 40:m!=108&&Ny(w,d-1)==58?(v++,w+=`(`):w+=eb(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=eb(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=Ay(y);break}w+=tb(m);break;case 92:w+=nb(Yy()-1,7);continue;case 47:switch(Jy()){case 42:case 47:Ly(lb(ib(qy(),Yy()),t,n,c),c),(Zy(m||1)==5||Zy(Jy()||1)==5)&&Fy(w)&&Py(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=Fy(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=Ay(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=My(w,/\f/g,``)),p>0&&(Fy(w)-d||h===0)&&Ly(p>32?ub(w+`;`,r,n,d-1,c):ub(My(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(Ly(C=cb(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)sb(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(Ny(w,3)===110)break;case 108:if(Ny(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?sb(e,C,C,r&&Ly(cb(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):sb(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+Fy(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&Ky()==125)continue}switch(w+=Ay(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(Fy(w)-1)*_,_=1;break;case 64:Jy()===45&&(w+=eb(qy())),f=Jy(),u=d=Fy(b=w+=ab(Yy())),y++;break;case 45:m===45&&Fy(w)==2&&(h=0)}}return a}function cb(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=Iy(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=Py(e,f+1,f=ky(g=o[h])),b=e;v<m;++v)(b=jy(g>0?p[v]+` `+y:My(y,/&\f/g,p[v])))&&(c[_++]=b);return Wy(e,t,n,i===0?Cy:s,c,l,u,d)}function lb(e,t,n,r){return Wy(e,t,n,Sy,Ay(Gy()),Py(e,2,-2),0,r)}function ub(e,t,n,r,i){return Wy(e,t,n,wy,Py(e,0,r),Py(e,r+1,-1),r,i)}function db(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function fb(e,t,n,r){switch(e.type){case Oy:if(e.children.length)break;case Ty:case Ey:case wy:return e.return=e.return||e.value;case Sy:return``;case Dy:return e.return=e.value+`{`+db(e.children,r)+`}`;case Cy:if(!Fy(e.value=e.props.join(`,`)))return``}return Fy(n=db(e.children,r))?e.return=e.value+`{`+n+`}`:``}function pb(e){var t=Iy(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}var mb=`c4`,hb={id:mb,detector:r(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./c4Diagram-AAUBKEIU-5Lh44evt.js`);return{diagram:e}},__vite__mapDeps([15,1,2,5,4,16]));return{id:mb,diagram:e}},`loader`)},gb=`flowchart`,_b={id:gb,detector:r((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-CIr8DWl7.js`);return{diagram:e}},__vite__mapDeps([17,1,2,3,4,5,18,19,8,9,10,11,20,12,21,16]));return{id:gb,diagram:e}},`loader`)},vb=`flowchart-v2`,yb={id:vb,detector:r((e,t)=>t?.flowchart?.defaultRenderer===`dagre-d3`?!1:(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-CIr8DWl7.js`);return{diagram:e}},__vite__mapDeps([17,1,2,3,4,5,18,19,8,9,10,11,20,12,21,16]));return{id:vb,diagram:e}},`loader`)},bb=`er`,xb={id:bb,detector:r(e=>/^\s*erDiagram/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./erDiagram-TEJ5UH35-NjQkrdFt.js`);return{diagram:e}},__vite__mapDeps([22,1,2,3,4,5,18,19,8,9,10,11,20,12]));return{id:bb,diagram:e}},`loader`)},Sb=`gitGraph`,Cb={id:Sb,detector:r(e=>/^\s*gitGraph/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-PVQCEYII-DQT8-kg2.js`);return{diagram:e}},__vite__mapDeps([23,1,2,24,25,4,5,26,27]));return{id:Sb,diagram:e}},`loader`)},wb=`gantt`,Tb={id:wb,detector:r(e=>/^\s*gantt/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./ganttDiagram-6RSMTGT7-C1VY_xbQ.js`);return{diagram:e}},__vite__mapDeps([28,1,2,5,29,30,31,4]));return{id:wb,diagram:e}},`loader`)},Eb=`info`,Db={id:Eb,detector:r(e=>/^\s*info/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./infoDiagram-5YYISTIA-C77rsoTp.js`);return{diagram:e}},__vite__mapDeps([32,1,2,24,25]));return{id:Eb,diagram:e}},`loader`)},Ob=`pie`,kb={id:Ob,detector:r(e=>/^\s*pie/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./pieDiagram-4H26LBE5-XH4cy6Cb.js`);return{diagram:e}},__vite__mapDeps([33,1,2,5,24,25,34,35,31,36,37,4,26]));return{id:Ob,diagram:e}},`loader`)},Ab=`quadrantChart`,jb={id:Ab,detector:r(e=>/^\s*quadrantChart/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./quadrantDiagram-W4KKPZXB-fdhc93U8.js`);return{diagram:e}},__vite__mapDeps([38,1,2,29,30,31]));return{id:Ab,diagram:e}},`loader`)},Mb=`xychart`,Nb={id:Mb,detector:r(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./xychartDiagram-2RQKCTM6-DRre-pfZ.js`);return{diagram:e}},__vite__mapDeps([39,1,2,3,4,5,29,30,31,35,40,34,37]));return{id:Mb,diagram:e}},`loader`)},Pb=`requirement`,Fb={id:Pb,detector:r(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./requirementDiagram-4Y6WPE33-a94eP3R9.js`);return{diagram:e}},__vite__mapDeps([41,1,2,3,4,5,19,8,9,10,11,20,12]));return{id:Pb,diagram:e}},`loader`)},Ib=`sequence`,Lb={id:Ib,detector:r(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./sequenceDiagram-3UESZ5HK-A5-GGM-e.js`);return{diagram:e}},__vite__mapDeps([42,1,2,5,4,16,27]));return{id:Ib,diagram:e}},`loader`)},Rb=`class`,zb={id:Rb,detector:r((e,t)=>t?.class?.defaultRenderer===`dagre-wrapper`?!1:/^\s*classDiagram/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./classDiagram-4FO5ZUOK-BuZcZu85.js`);return{diagram:e}},__vite__mapDeps([43,1,2,3,4,5,19,8,9,10,11,20,44,21,16,12]));return{id:Rb,diagram:e}},`loader`)},Bb=`classDiagram`,Vb={id:Bb,detector:r((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./classDiagram-v2-Q7XG4LA2-BuZcZu85.js`);return{diagram:e}},__vite__mapDeps([45,1,2,3,4,5,19,8,9,10,11,20,44,21,16,12]));return{id:Bb,diagram:e}},`loader`)},Hb=`state`,Ub={id:Hb,detector:r((e,t)=>t?.state?.defaultRenderer===`dagre-wrapper`?!1:/^\s*stateDiagram/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./stateDiagram-AJRCARHV-BKAA5rqE.js`);return{diagram:e}},__vite__mapDeps([46,1,2,3,4,5,40,34,37,6,7,19,8,9,10,11,20,47,12]));return{id:Hb,diagram:e}},`loader`)},Wb=`stateDiagram`,Gb={id:Wb,detector:r((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-BHNVJYJU-DnJwJBsE.js`);return{diagram:e}},__vite__mapDeps([48,1,2,3,4,5,19,8,9,10,11,20,47,12]));return{id:Wb,diagram:e}},`loader`)},Kb=`journey`,qb={id:Kb,detector:r(e=>/^\s*journey/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./journeyDiagram-JHISSGLW-BejeAJQ_.js`);return{diagram:e}},__vite__mapDeps([49,1,2,36,5,34,21,16]));return{id:Kb,diagram:e}},`loader`)},Jb={draw:r((e,t,r)=>{n.debug(`rendering svg for syntax error
|
|
87
|
+
`);let i=ih(t),a=i.append(`g`);i.attr(`viewBox`,`0 0 2412 512`),C(i,100,512,!0),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),a.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),a.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),a.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${r}`)},`draw`)},Yb=Jb,Xb={db:{},renderer:Jb,parser:{parse:r(()=>{},`parse`)}},Zb=`flowchart-elk`,Qb={id:Zb,detector:r((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./flowDiagram-I6XJVG4X-CIr8DWl7.js`);return{diagram:e}},__vite__mapDeps([17,1,2,3,4,5,18,19,8,9,10,11,20,12,21,16]));return{id:Zb,diagram:e}},`loader`)},$b=`timeline`,ex={id:$b,detector:r(e=>/^\s*timeline/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./timeline-definition-PNZ67QCA-Cy39jp8b.js`);return{diagram:e}},__vite__mapDeps([50,1,2,36,5,34,4]));return{id:$b,diagram:e}},`loader`)},tx=`mindmap`,nx={id:tx,detector:r(e=>/^\s*mindmap/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./mindmap-definition-RKZ34NQL-9EJQNjH0.js`);return{diagram:e}},__vite__mapDeps([51,1,2,3,4,5,19,8,9,10,11,20,12]));return{id:tx,diagram:e}},`loader`)},rx=`kanban`,ix={id:rx,detector:r(e=>/^\s*kanban/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./kanban-definition-UN3LZRKU-BRNz_UrH.js`);return{diagram:e}},__vite__mapDeps([52,1,2,3,4,5,8,9,10,11,21]));return{id:rx,diagram:e}},`loader`)},ax=`sankey`,ox={id:ax,detector:r(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./sankeyDiagram-5OEKKPKP-jcBa02sp.js`);return{diagram:e}},__vite__mapDeps([53,1,2,35,31]));return{id:ax,diagram:e}},`loader`)},sx=`packet`,cx={id:sx,detector:r(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./diagram-LMA3HP47-XtFH7B51.js`);return{diagram:e}},__vite__mapDeps([54,1,2,24,25,4,5,26]));return{id:sx,diagram:e}},`loader`)},lx=`radar`,ux={id:lx,detector:r(e=>/^\s*radar-beta/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./diagram-2AECGRRQ-DoDQ60wi.js`);return{diagram:e}},__vite__mapDeps([55,1,2,24,25,4,5,26]));return{id:lx,diagram:e}},`loader`)},dx=`block`,fx={id:dx,detector:r(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./blockDiagram-GPEHLZMM-DC7qY9i4.js`);return{diagram:e}},__vite__mapDeps([56,1,2,3,4,5,40,34,37,7,18,12,21,9]));return{id:dx,diagram:e}},`loader`)},px=`treeView`,mx={id:px,detector:r(e=>/^\s*treeView-beta/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./diagram-5GNKFQAL-CMGFxpUs.js`);return{diagram:e}},__vite__mapDeps([57,1,2,24,25,4,5,26,27]));return{id:px,diagram:e}},`loader`)},hx=`architecture`,gx={id:hx,detector:r(e=>/^\s*architecture/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./architectureDiagram-3BPJPVTR-C6hUlprM.js`);return{diagram:e}},__vite__mapDeps([58,1,2,3,4,5,24,25,14,26]));return{id:hx,diagram:e}},`loader`)},_x=`eventmodeling`,vx={id:_x,detector:r(e=>/^\s*eventmodeling/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./diagram-KO2AKTUF-1uGDa-Iu.js`);return{diagram:e}},__vite__mapDeps([59,1,2,24,25,4,5,26]));return{id:_x,diagram:e}},`loader`)},yx=`ishikawa`,bx={id:yx,detector:r(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-YF4QCWOH-BcTbXaLy.js`);return{diagram:e}},__vite__mapDeps([60,1,2,4,5,11]));return{id:yx,diagram:e}},`loader`)},xx=`venn`,Sx={id:xx,detector:r(e=>/^\s*venn-beta/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./vennDiagram-CIIHVFJN-BGECKubd.js`);return{diagram:e}},__vite__mapDeps([61,1,2,4,5,11]));return{id:xx,diagram:e}},`loader`)},Cx=`treemap`,wx={id:Cx,detector:r(e=>/^\s*treemap/.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./diagram-OG6HWLK6-B4_Te1T5.js`);return{diagram:e}},__vite__mapDeps([62,1,2,24,25,30,35,31,4,5,19,26,10]));return{id:Cx,diagram:e}},`loader`)},Tx=`wardley-beta`,Ex={id:Tx,detector:r(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:r(async()=>{let{diagram:e}=await s(async()=>{let{diagram:e}=await import(`./wardleyDiagram-YWT4CUSO-D6XRG3cZ.js`);return{diagram:e}},__vite__mapDeps([63,1,2,24,25,4,5,26]));return{id:Tx,diagram:e}},`loader`)},Dx=!1,Ox=r(()=>{Dx||(Dx=!0,f(`error`,Xb,e=>e.toLowerCase().trim()===`error`),f(`---`,{db:{clear:r(()=>{},`clear`)},styles:{},renderer:{draw:r(()=>{},`draw`)},parser:{parse:r(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:r(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),p(Qb,nx,gx),p(hb,ix,Vb,zb,xb,Tb,Db,kb,Fb,Lb,yb,_b,ex,Cb,Gb,Ub,qb,jb,ox,cx,Nb,fx,vx,mx,ux,bx,wx,Sx,Ex))},`addDiagrams`),kx=r(async()=>{n.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(D).map(async([e,{detector:t,loader:r}])=>{if(r)try{h(e)}catch{try{let{diagram:e,id:n}=await r();f(n,e,t)}catch(t){throw n.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete D[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){n.error(`Failed to load ${e.length} external diagrams`);for(let t of e)n.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),Ax=`graphics-document document`;function jx(e,t){e.attr(`role`,Ax),t!==``&&e.attr(`aria-roledescription`,t)}r(jx,`setA11yDiagramInfo`);function Mx(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}r(Mx,`addSVGa11yTitleDescription`);var Nx=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{r(this,`Diagram`)}static async fromText(t,n={}){let r=S(),i=k(t,r);t=ye(t)+`
|
|
88
|
+
`;try{h(i)}catch{let e=c(i);if(!e)throw new A(`Diagram ${i} not found.`);let{id:t,diagram:n}=await e();f(t,n)}let{db:a,parser:o,renderer:s,init:l}=h(i);return o.parser&&(o.parser.yy=a),a.clear?.(),l?.(r),n.title&&a.setDiagramTitle?.(n.title),await o.parse(t),new e(i,t,a,o,s)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},Px=[],Fx=r(()=>{Px.forEach(e=>{e()}),Px=[]},`attachFunctions`),Ix=r(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function Lx(e){let t=e.match(x);if(!t)return{text:e,metadata:{}};let n=Hv(t[1],{schema:Vv})??{};n=typeof n==`object`&&!Array.isArray(n)?n:{};let r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}r(Lx,`extractFrontMatter`);var Rx=r(e=>e.replace(/\r\n?/g,`
|
|
89
|
+
`).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),zx=r(e=>{let{text:t,metadata:n}=Lx(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),Bx=r(e=>{let t=he.detectInit(e)??{},n=he.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:ge(e),directive:t}},`processDirectives`);function Vx(e){let t=zx(Rx(e)),n=Bx(t.text),r=_e(t.config,n.directive);return e=Ix(n.text),{code:e,title:t.title,config:r}}r(Vx,`preprocessDiagram`);function Hx(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}r(Hx,`toBase64`);var Ux=5e4,Wx=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,Gx=`sandbox`,Kx=`loose`,qx=`http://www.w3.org/2000/svg`,Jx=`http://www.w3.org/1999/xlink`,Yx=`http://www.w3.org/1999/xhtml`,Xx=`100%`,Zx=`100%`,Qx=`border:0;margin:0;`,$x=`margin:0`,eS=`allow-top-navigation-by-user-activation allow-popups`,tS=`The "iframe" tag is not supported by your browser.`,nS=[`foreignobject`],rS=[`dominant-baseline`];function iS(e){let t=Vx(e);return u(),O(t.config??{}),t}r(iS,`processAndSetConfigs`);async function aS(e,t){Ox();try{let{code:t,config:n}=iS(e);return{diagramType:(await _S(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}r(aS,`parse`);var oS=r((e,t,n=[])=>`.${e} ${t} ${d(`{ ${n.join(` !important; `)} !important; }`)}`,`cssImportantStyles`),sS=r((e,t=new Map)=>{let n=new CSSStyleSheet;if(e.fontFamily!==void 0&&n.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,n.cssRules.length),e.altFontFamily!==void 0&&n.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,n.cssRules.length),t instanceof Map){let r=g(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{Wv(e.styles)||r.forEach(t=>{n.insertRule(oS(e.id,t,e.styles),n.cssRules.length)}),Wv(e.textStyles)||n.insertRule(oS(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))),n.cssRules.length)})}let r=``;if(e.themeCSS!==void 0)if(typeof n.replaceSync==`function`){let t=new CSSStyleSheet;t.replaceSync(e.themeCSS),r=E(t)+`
|
|
90
|
+
`}else r+=`${e.themeCSS}
|
|
91
|
+
`;return r+E(n)},`createCssStyles`),cS=r((e,t)=>db(ob(`${e}{${t}}`),pb([r(function(t,r,i,a){if(t.type===`rule`&&Array.isArray(t.props)){if(t.parent&&t.parent.type===`@keyframes`)return;t.props=t.props.map(t=>t.startsWith(e)?t:`${e} ${t}`)}else t.type.startsWith(`@`)&&([`@media`,`@supports`,`@layer`,`@scope`,`@container`,`@starting-style`,`@keyframes`].includes(t.type)||(n.warn(`Removing unsupported at-rule ${t.type} from CSS`),t.type=Sy))},`addNamespace`),fb])),`compileCSS`),lS=r((e,t,n,r)=>cS(r,y(t,sS(e,n),{...e.themeVariables,theme:e.theme,look:e.look},r)),`createUserStyles`),uS=r((e=``,t,n)=>{let r=e;return!n&&!t&&(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,`marker-end="url(#`)),r=ue(r),r=r.replace(/<br>/g,`<br/>`),r},`cleanUpSvgCode`),dS=r((e=``,t)=>`<iframe style="width:${Xx};height:${t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+`px`:Zx};${Qx}" src="data:text/html;charset=UTF-8;base64,${Hx(`<body style="${$x}">${e}</body>`)}" sandbox="${eS}">
|
|
92
|
+
${tS}
|
|
93
|
+
</iframe>`,`putIntoIFrame`),fS=r((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,qx);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function pS(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}r(pS,`sandboxedIframe`);var mS=r((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),hS=r(async function(e,t,a){Ox();let o=iS(t);t=o.code;let s=S();n.debug(s),t.length>(s?.maxTextSize??Ux)&&(t=Wx);let c=`#${e}`,l=`i`+e,u=`#`+l,d=`d`+e,f=`#`+d,p=r(()=>{let e=i(h?u:f).node();e&&`remove`in e&&e.remove()},`removeTempElements`),m=i(document.body),h=s.securityLevel===Gx,g=s.securityLevel===Kx,_=s.fontFamily;a===void 0?(mS(document,e,d,l),h?(m=i(pS(i(document.body),l).nodes()[0].contentDocument.body),m.node().style.margin=`0`):m=i(`body`),fS(m,e,d)):(a&&(a.innerHTML=``),h?(m=i(pS(i(a),l).nodes()[0].contentDocument.body),m.node().style.margin=`0`):m=i(a),fS(m,e,d,`font-family: ${_}`,Jx));let v,y;try{v=await Nx.fromText(t,{title:o.title})}catch(e){if(s.suppressErrorRendering)throw p(),e;v=await Nx.fromText(`error`),y=e}let b=m.select(f).node(),x=v.type,C=b.firstChild,E=C.firstChild,D=v.renderer.getClasses?.(t,v),O=lS(s,x,D,c),k=document.createElement(`style`);k.innerHTML=O,C.insertBefore(k,E);try{await v.renderer.draw(t,e,`11.15.0`,v)}catch(n){throw s.suppressErrorRendering?p():Yb.draw(t,e,`11.15.0`),n}let ee=m.select(`${f} svg`),te=v.db.getAccTitle?.(),ne=v.db.getAccDescription?.();vS(x,ee,te,ne),m.select(`[id="${e}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,Yx);let A=m.select(f).node().innerHTML;if(n.debug(`config.arrowMarkerAbsolute`,s.arrowMarkerAbsolute),A=uS(A,h,T(s.arrowMarkerAbsolute)),h){let e=m.select(f+` svg`).node();A=dS(A,e)}else g||(A=w.sanitize(A,{ADD_TAGS:nS,ADD_ATTR:rS,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Fx(),y)throw y;return p(),{diagramType:x,svg:A,bindFunctions:v.db.bindFunctions}},`render`);function gS(t={}){let n=te({},t);n?.fontFamily&&!n.themeVariables?.fontFamily&&(n.themeVariables||={},n.themeVariables.fontFamily=n.fontFamily),_(n),n?.theme&&n.theme in b?n.themeVariables=b[n.theme].getThemeVariables(n.themeVariables):n&&(n.themeVariables=b.default.getThemeVariables(n.themeVariables)),e((typeof n==`object`?ee(n):l()).logLevel),Ox()}r(gS,`initialize`);var _S=r((e,t={})=>{let{code:n}=Vx(e);return Nx.fromText(n,t)},`getDiagramFromText`);function vS(e,t,n,r){jx(t,e),Mx(t,n,r,t.attr(`id`))}r(vS,`addA11yInfo`);var yS=Object.freeze({render:hS,parse:aS,getDiagramFromText:_S,initialize:gS,getConfig:S,setConfig:v,getSiteConfig:l,updateSiteConfig:m,reset:r(()=>{u()},`reset`),globalReset:r(()=>{u(j)},`globalReset`),defaultConfig:j});e(S().logLevel),u(S());var bS=r((e,t,r)=>{n.warn(e),me(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),xS=r(async function(e={querySelector:`.mermaid`}){try{await SS(e)}catch(t){if(me(t)&&n.error(t.str),NS.parseError&&NS.parseError(t),!e.suppressErrors)throw n.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),SS=r(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:`.mermaid`}){let i=yS.getConfig();n.debug(`${e?``:`No `}Callback function found`);let a;if(r)a=r;else if(t)a=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);n.debug(`Found ${a.length} diagrams`),i?.startOnLoad!==void 0&&(n.debug(`Start On Load: `+i?.startOnLoad),yS.updateSiteConfig({startOnLoad:i?.startOnLoad}));let o=new he.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed),s,c=[];for(let t of Array.from(a)){if(n.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let r=`mermaid-${o.next()}`;s=t.innerHTML,s=Ie(he.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,`<br/>`);let i=he.detectInit(s);i&&n.debug(`Detected early reinit: `,i);try{let{svg:n,bindFunctions:i}=await MS(r,s,t);t.innerHTML=n,e&&await e(r),i&&i(t)}catch(e){bS(e,c,NS.parseError)}}if(c.length>0)throw c[0]},`runThrowsErrors`),CS=r(function(e){yS.initialize(e)},`initialize`),wS=r(async function(e,t,r){n.warn(`mermaid.init is deprecated. Please use run instead.`),e&&CS(e);let i={postRenderCallback:r,querySelector:`.mermaid`};typeof t==`string`?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await xS(i)},`init`),TS=r(async(e,{lazyLoad:t=!0}={})=>{Ox(),p(...e),t===!1&&await kx()},`registerExternalDiagrams`),ES=r(function(){if(NS.startOnLoad){let{startOnLoad:e}=yS.getConfig();e&&NS.run().catch(e=>n.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,ES,!1);var DS=r(function(e){NS.parseError=e},`setParseErrorHandler`),OS=[],kS=!1,AS=r(async()=>{if(!kS){for(kS=!0;OS.length>0;){let e=OS.shift();if(e)try{await e()}catch(e){n.error(`Error executing queue`,e)}}kS=!1}},`executeQueue`),jS=r(async(e,t)=>new Promise((i,a)=>{let o=r(()=>new Promise((r,o)=>{yS.parse(e,t).then(e=>{r(e),i(e)},e=>{n.error(`Error parsing`,e),NS.parseError?.(e),o(e),a(e)})}),`performCall`);OS.push(o),AS().catch(a)}),`parse`),MS=r((e,t,i)=>new Promise((a,o)=>{let s=r(()=>new Promise((r,s)=>{yS.render(e,t,i).then(e=>{r(e),a(e)},e=>{n.error(`Error parsing`,e),NS.parseError?.(e),s(e),o(e)})}),`performCall`);OS.push(s),AS().catch(o)}),`render`),NS={startOnLoad:!0,mermaidAPI:yS,parse:jS,render:MS,init:wS,run:xS,registerExternalDiagrams:TS,registerLayoutLoaders:yy,initialize:CS,parseError:void 0,contentLoaded:ES,setParseErrorHandler:DS,detectType:k,registerIconPacks:Pe,getRegisteredDiagramsMetadata:r(()=>Object.keys(D).map(e=>({id:e})),`getRegisteredDiagramsMetadata`)},PS=NS;function FS(){let{project:e,branchId:t}=Zr(),[n,r]=(0,F.useState)(null),i=L({queryKey:[`flows`,e,t],queryFn:()=>B.get(`/flows`,{query:{project:e??void 0,branch_id:t??void 0,with_schedules:!0}}),enabled:!!e});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Flows`,description:`Orchestrator and flow component configurations.`}),e?i.isLoading?(0,I.jsx)(Q,{}):i.error?(0,I.jsx)(Z,{message:i.error.message}):(0,I.jsx)(Dm,{rows:i.data?.flows??[],rowKey:e=>`${e.project_alias}/${e.component_id}/${e.config_id}`,onRowClick:e=>r(e),columns:[{header:`Name`,cell:e=>(0,I.jsx)(`span`,{className:`font-bold`,children:e.name})},{header:`Component`,cell:e=>(0,I.jsx)(`span`,{className:`text-accent text-xs`,children:e.component_id})},{header:`ID`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500`,children:e.config_id})},{header:`State`,cell:e=>e.is_disabled?(0,I.jsx)(`span`,{className:`nerd-pill`,children:`disabled`}):(0,I.jsx)(`span`,{className:`nerd-pill-green`,children:`enabled`})},{header:`Schedules`,cell:e=>e.schedules?.length?(0,I.jsxs)(`span`,{className:`text-xs`,children:[e.schedules.length,` schedule(s)`]}):(0,I.jsx)(`span`,{className:`text-xs text-zinc-500 dark:text-zinc-600`,children:`-`})}]}):(0,I.jsx)(wm,{title:`Select a project`}),n?(0,I.jsx)(IS,{flow:n,onClose:()=>r(null)}):null]})}function IS({flow:e,onClose:t}){let{branchId:n}=Zr(),[r,i]=(0,F.useState)(`builder`),a=L({queryKey:[`flow-detail`,e.project_alias,e.component_id,e.config_id,n],queryFn:()=>B.get(`/flows/${encodeURIComponent(e.project_alias)}/${encodeURIComponent(e.config_id)}`,{query:{component_id:e.component_id,branch_id:n??void 0}})});return(0,I.jsxs)(Sm,{open:!0,onClose:t,title:e.name,subtitle:`${e.component_id} ・ ${e.config_id} ・ ${e.is_disabled?`disabled`:`enabled`}`,width:`max-w-5xl`,children:[(0,I.jsxs)(`div`,{className:`flex gap-2 mb-4`,children:[(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs ${r===`builder`?`border-keboola text-keboola`:``}`,onClick:()=>i(`builder`),children:`Builder`}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs ${r===`raw`?`border-keboola text-keboola`:``}`,onClick:()=>i(`raw`),children:`Raw JSON`})]}),a.isLoading?(0,I.jsx)(Q,{}):null,a.error?(0,I.jsx)(Z,{message:a.error.message}):null,a.data&&r===`builder`?(0,I.jsx)(LS,{detail:a.data}):null,a.data&&r===`raw`?(0,I.jsx)(Em,{data:a.data}):null]})}function LS({detail:e}){let t=e.phases??[],n=e.tasks??[],r=new Map;for(let e of n){let t=String(e.phase),n=r.get(t)??[];n.push(e),r.set(t,n)}return t.length===0?(0,I.jsx)(wm,{title:`This flow has no phases yet.`}):(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(RS,{phases:t,tasksByPhase:r}),(0,I.jsx)(`div`,{className:`space-y-3`,children:t.map((e,n)=>{let i=r.get(String(e.id))??[];return(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,I.jsxs)(`h4`,{className:`text-sm font-bold text-keboola`,children:[`Step `,n+1,` ・ `,e.name??e.id]}),(0,I.jsxs)(`span`,{className:`text-xs text-zinc-500`,children:[i.length,` task(s)`,e.dependsOn&&e.dependsOn.length>0?(0,I.jsxs)(`span`,{className:`ml-2 text-zinc-500 dark:text-zinc-600`,children:[`depends on:`,` `,e.dependsOn.map(e=>t.find(t=>t.id===e)?.name??e).join(`, `)]}):null]})]}),i.length===0?(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 dark:text-zinc-600`,children:`No tasks in this phase.`}):(0,I.jsx)(`ul`,{className:`text-xs space-y-1`,children:i.map(e=>(0,I.jsxs)(`li`,{className:`flex items-center gap-2 py-1 border-b border-zinc-200 dark:border-zinc-900/40`,children:[(0,I.jsx)(`span`,{className:`font-mono text-accent`,children:e.task?.componentId??`?`}),(0,I.jsx)(`span`,{className:`text-zinc-500`,children:`/`}),(0,I.jsx)(`span`,{className:`font-mono text-zinc-600 dark:text-zinc-400`,children:e.task?.configId??`?`}),(0,I.jsx)(`span`,{className:`ml-auto text-zinc-700 dark:text-zinc-300`,children:e.name??``})]},String(e.id)))})]},String(e.id))})})]})}function RS({phases:e,tasksByPhase:t}){let n=(0,F.useRef)(null),r=(0,F.useRef)(0),[i,a]=(0,F.useState)(null);return(0,F.useEffect)(()=>{if(!n.current)return;let i=!1;r.current+=1;let o=`flow_${Date.now()}_${r.current}`,s=e=>e.replace(/[^a-zA-Z0-9]/g,`_`),c=e=>e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`),l=[`graph TD`];for(let n of e){let e=`p_${s(String(n.id))}`,r=t.get(String(n.id))?.length??0,i=`${c(n.name??String(n.id))}<br/><small>${r} task${r===1?``:`s`}</small>`;l.push(` ${e}["${i}"]`)}for(let t=0;t<e.length;t++){let n=e[t],r=`p_${s(String(n.id))}`;if(n.dependsOn&&n.dependsOn.length>0)for(let e of n.dependsOn)l.push(` p_${s(String(e))} --> ${r}`);else if(t>0){let n=e[t-1];l.push(` p_${s(String(n.id))} --> ${r}`)}}return PS.render(o,l.join(`
|
|
94
|
+
`)).then(({svg:e})=>{i||!n.current||(n.current.innerHTML=e,a(null))}).catch(e=>{i||a(String(e))}),()=>{i=!0,document.getElementById(o)?.remove()}},[e,t]),(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500 mb-2`,children:`Flow diagram`}),i?(0,I.jsx)(`div`,{className:`text-xs text-red-600 dark:text-red-400`,children:i}):null,(0,I.jsx)(`div`,{ref:n,className:`overflow-auto`,style:{minHeight:200}})]})}var zS={success:`nerd-pill-green`,error:`nerd-pill-red`,warning:`nerd-pill-amber`,processing:`nerd-pill-amber`,cancelled:`nerd-pill`,terminated:`nerd-pill`};function BS(){let{project:e}=Zr(),[t,n]=(0,F.useState)(null),[r,i]=(0,F.useState)(null),a=L({queryKey:[`jobs`,e,t],queryFn:()=>B.get(`/jobs`,{query:{project:e??void 0,status:t??void 0,limit:100}}),enabled:!!e,refetchInterval:8e3});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Jobs`,description:`Recent Queue API jobs in ${e??`(no project)`} -- auto refreshing 8s`}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:[null,`success`,`error`,`processing`,`warning`].map(e=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn ${t===e?`border-keboola text-keboola`:``}`,onClick:()=>n(e),children:e??`all`},e??`all`))}),e?a.isLoading?(0,I.jsx)(Q,{}):a.error?(0,I.jsx)(Z,{message:a.error.message}):(0,I.jsx)(Dm,{rows:a.data?.jobs??[],rowKey:e=>String(e.id),onRowClick:e=>i(e),columns:[{header:`Job ID`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-600 dark:text-zinc-400`,children:e.id})},{header:`Status`,cell:e=>(0,I.jsx)(`span`,{className:zS[e.status]??`nerd-pill`,children:e.status})},{header:`Component`,cell:e=>(0,I.jsx)(`span`,{className:`text-accent`,children:e.component})},{header:`Config`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500`,children:e.configId})},{header:`Created`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500 text-xs`,children:e.createdTime})},{header:`Duration`,align:`right`,cell:e=>(0,I.jsx)(`span`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:e.durationSeconds==null?`-`:VS(e.durationSeconds)})}]}):(0,I.jsx)(wm,{title:`Select a project from the top bar`}),r?(0,I.jsx)(HS,{job:r,onClose:()=>i(null)}):null]})}function VS(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),n=e%60;return t<60?`${t}m ${n}s`:`${Math.floor(t/60)}h ${t%60}m`}function HS({job:e,onClose:t}){let n=L({queryKey:[`job-detail`,e.project_alias,e.id],queryFn:()=>B.get(`/jobs/${encodeURIComponent(e.project_alias)}/${encodeURIComponent(String(e.id))}`)}),[r,i]=(0,F.useState)([]),[a,o]=(0,F.useState)(!1),s=(0,F.useRef)(null);(0,F.useEffect)(()=>()=>{s.current?.close()},[]);let c=()=>{i([]),o(!0);let t=ii(`/jobs/${encodeURIComponent(e.project_alias)}/${encodeURIComponent(String(e.id))}/stream`,void 0,{log:e=>{let t=e;i(e=>[...e,t])},status:e=>{let t=e;i(e=>[...e,{id:`s-${Date.now()}`,message:`→ status: ${t.status}`}])},done:e=>{let n=e;i(e=>[...e,{id:`d-${Date.now()}`,message:`✓ done: ${n.final}`}]),o(!1),t.close()}});s.current=t},l=n.data??{};return(0,I.jsxs)(Sm,{open:!0,onClose:t,title:`Job ${e.id}`,subtitle:`${e.component} ・ config ${e.configId}`,width:`max-w-5xl`,actions:(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>a?s.current?.close():c(),children:a?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(jr,{className:`w-3 h-3`}),` stop stream`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(xr,{className:`w-3 h-3`}),` stream logs`]})}),children:[n.isLoading?(0,I.jsx)(Q,{}):null,n.error?(0,I.jsx)(Z,{message:n.error.message}):null,n.data?(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(US,{detail:l,job:e}),(0,I.jsx)(KS,{detail:l}),r.length>0?(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 mb-2`,children:`Live log tail (SSE)`}),(0,I.jsx)(`pre`,{className:`nerd-code`,style:{maxHeight:`30vh`},children:r.map(e=>`[${e.type??`log`}] ${e.message}`).join(`
|
|
95
|
+
`)})]}):null,(0,I.jsxs)(`details`,{children:[(0,I.jsx)(`summary`,{className:`text-xs text-zinc-500 cursor-pointer`,children:`raw JSON`}),(0,I.jsx)(Em,{data:l,maxHeight:`40vh`})]})]}):null]})}function US({detail:e,job:t}){let n=String(e.status??t.status),r=String(e.startTime??``),i=String(e.endTime??``),a=e.durationSeconds??t.durationSeconds,o=String(e.createdTime??t.createdTime??``),s=e.tokenDescription??e.token?.description??``,c=e.url??``,l=e.config??t.configId,u=e.branchId??null,d=e.params??{},f=String(d?.backend?.context??d?.size??`—`),p=zS[n]??`nerd-pill`;return(0,I.jsxs)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-3`,children:[(0,I.jsxs)(WS,{icon:(0,I.jsx)(Zn,{className:`w-3.5 h-3.5`}),label:`Status`,children:[(0,I.jsx)(`span`,{className:p,children:n}),c?(0,I.jsx)(`a`,{href:c,target:`_blank`,rel:`noreferrer`,className:`block mt-2 text-xs text-accent hover:underline`,children:`open in Keboola UI →`}):null]}),(0,I.jsx)(WS,{icon:(0,I.jsx)(Fr,{className:`w-3.5 h-3.5`}),label:`Duration`,children:(0,I.jsx)(`div`,{className:`text-2xl font-bold text-keboola`,children:a==null?`-`:VS(a)})}),(0,I.jsxs)(WS,{icon:(0,I.jsx)(Vn,{className:`w-3.5 h-3.5`}),label:`Times`,children:[(0,I.jsx)(GS,{k:`Created`,v:o}),(0,I.jsx)(GS,{k:`Started`,v:r}),(0,I.jsx)(GS,{k:`Ended`,v:i})]}),(0,I.jsx)(WS,{icon:(0,I.jsx)(Br,{className:`w-3.5 h-3.5`}),label:`Created by`,children:(0,I.jsx)(`div`,{className:`text-xs text-zinc-700 dark:text-zinc-300 break-words`,children:s||`—`})}),(0,I.jsxs)(WS,{icon:(0,I.jsx)(En,{className:`w-3.5 h-3.5`}),label:`Configuration`,children:[(0,I.jsx)(GS,{k:`Component`,v:String(e.component??t.component)}),(0,I.jsx)(GS,{k:`Config ID`,v:String(l)}),u?(0,I.jsx)(GS,{k:`Branch ID`,v:String(u)}):null]}),(0,I.jsx)(WS,{icon:(0,I.jsx)(Or,{className:`w-3.5 h-3.5`}),label:`Backend`,children:(0,I.jsx)(`div`,{className:`text-sm text-zinc-700 dark:text-zinc-300`,children:f})}),(0,I.jsxs)(WS,{icon:(0,I.jsx)(Gn,{className:`w-3.5 h-3.5`}),label:`Run IDs`,children:[(0,I.jsx)(GS,{k:`Run ID`,v:String(e.runId??``)}),(0,I.jsx)(GS,{k:`Job ID`,v:String(e.id??t.id)})]}),(0,I.jsx)(WS,{icon:(0,I.jsx)(En,{className:`w-3.5 h-3.5`}),label:`Project`,children:(0,I.jsx)(GS,{k:`Alias`,v:t.project_alias})})]})}function WS({icon:e,label:t,children:n}){return(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsxs)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500 flex items-center gap-1 mb-2`,children:[e,t]}),n]})}function GS({k:e,v:t}){return t?(0,I.jsxs)(`div`,{className:`text-xs`,children:[(0,I.jsxs)(`span`,{className:`text-zinc-500`,children:[e,`:`]}),` `,(0,I.jsx)(`span`,{className:`font-mono text-zinc-700 dark:text-zinc-300`,children:t})]}):null}function KS({detail:e}){let t=e.params??{},n=e.result??{},r=(e.configData??{}).storage??{},i=r.input?.tables??[],a=r.output?.tables??[];return(0,I.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-3`,children:[(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500 mb-2`,children:`Parameters`}),Object.keys(t).length===0?(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 dark:text-zinc-600`,children:`No parameters.`}):(0,I.jsx)(`pre`,{className:`nerd-code text-[10px]`,style:{maxHeight:`200px`},children:JSON.stringify(t,null,2)}),Object.keys(n).length>0?(0,I.jsxs)(`details`,{className:`mt-2`,children:[(0,I.jsx)(`summary`,{className:`text-xs text-zinc-500 cursor-pointer`,children:`result`}),(0,I.jsx)(`pre`,{className:`nerd-code text-[10px]`,style:{maxHeight:`200px`},children:JSON.stringify(n,null,2)})]}):null]}),(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500 mb-2`,children:`Mapping`}),(0,I.jsxs)(`div`,{className:`text-xs text-zinc-700 dark:text-zinc-300 mb-1`,children:[`Input (`,i.length,`)`]}),i.length===0?(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 dark:text-zinc-600`,children:`No tables.`}):(0,I.jsx)(`ul`,{className:`text-xs space-y-1`,children:i.map((e,t)=>(0,I.jsxs)(`li`,{className:`font-mono text-accent`,children:[String(e.source??``),` → `,String(e.destination??``)]},t))}),(0,I.jsxs)(`div`,{className:`text-xs text-zinc-700 dark:text-zinc-300 mt-3 mb-1`,children:[`Output (`,a.length,`)`]}),a.length===0?(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 dark:text-zinc-600`,children:`No tables.`}):(0,I.jsx)(`ul`,{className:`text-xs space-y-1`,children:a.map((e,t)=>(0,I.jsxs)(`li`,{className:`font-mono text-accent`,children:[String(e.source??``),` → `,String(e.destination??``)]},t))})]})]})}var qS=5e6;function JS(e){e===`dark`?PS.initialize({startOnLoad:!1,maxTextSize:qS,theme:`dark`,themeVariables:{background:`#050508`,primaryColor:`#1a1a2e`,primaryTextColor:`#22c55e`,primaryBorderColor:`#22c55e`,lineColor:`#22d3ee`}}):PS.initialize({startOnLoad:!1,maxTextSize:qS,theme:`default`,themeVariables:{background:`#ffffff`,primaryColor:`#f4f4f5`,primaryTextColor:`#18181b`,primaryBorderColor:`#16a34a`,lineColor:`#0891b2`}})}function YS(){let[e,t]=(0,F.useState)(`sharing`);return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Lineage`,description:`Two views: bucket-sharing graph (live, cross-project) + deep column-level lineage (from a pre-computed JSON cache built via 'kbagent lineage build').`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 ${e===`sharing`?`border-keboola text-keboola`:``}`,onClick:()=>t(`sharing`),children:[(0,I.jsx)(Dn,{className:`w-3 h-3`}),` Sharing graph`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 ${e===`deep`?`border-keboola text-keboola`:``}`,onClick:()=>t(`deep`),children:[(0,I.jsx)(gr,{className:`w-3 h-3`}),` Deep lineage (from JSON)`]})]}),e===`sharing`?(0,I.jsx)(XS,{onOpenDeepLineage:()=>t(`deep`)}):(0,I.jsx)(ZS,{})]})}function XS({onOpenDeepLineage:e}){let t=L({queryKey:[`lineage-sharing`],queryFn:()=>B.get(`/lineage/edges`)});return(0,I.jsxs)(I.Fragment,{children:[t.isLoading?(0,I.jsx)(Q,{}):null,t.error?(0,I.jsx)(Z,{message:t.error.message}):null,t.data?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,I.jsx)(QS,{label:`Edges`,value:t.data.summary.total_edges}),(0,I.jsx)(QS,{label:`Shared buckets`,value:t.data.summary.total_shared_buckets}),(0,I.jsx)(QS,{label:`Linked buckets`,value:t.data.summary.total_linked_buckets})]}),t.data.edges.length>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)($S,{edges:t.data.edges,onOpenDeepLineage:e}),(0,I.jsx)(Dm,{rows:t.data.edges,rowKey:e=>`${e.source_project_id}/${e.source_bucket_id}-(${e.sharing_type})->${e.target_project_id}/${e.target_bucket_id}`,columns:[{header:`Source`,cell:e=>(0,I.jsx)(`span`,{className:`text-keboola`,children:e.source_project_alias||`#${e.source_project_id}`})},{header:`Source bucket`,cell:e=>(0,I.jsx)(`span`,{className:`text-accent`,children:e.source_bucket_id})},{header:`Type`,cell:e=>(0,I.jsx)(`span`,{className:`nerd-pill`,children:e.sharing_type})},{header:`Target`,cell:e=>(0,I.jsx)(`span`,{className:`text-keboola`,children:e.target_project_alias||`#${e.target_project_id}`})},{header:`Target bucket`,cell:e=>(0,I.jsx)(`span`,{className:`text-accent`,children:e.target_bucket_id})}]})]}):(0,I.jsx)(wm,{title:`No bucket sharing between registered projects.`})]}):null]})}function ZS(){let[e,t]=(0,F.useState)(()=>localStorage.getItem(`kbagent-lineage-path`)??``),[n,r]=(0,F.useState)(()=>localStorage.getItem(`kbagent-lineage-build-dir`)??`/tmp/kbagent-lineage`),[i,a]=(0,F.useState)(!0),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(null),[u,d]=(0,F.useState)(null),[f,p]=(0,F.useState)(null),[m,h]=(0,F.useState)(``),[g,_]=(0,F.useState)(`upstream`),[v,y]=(0,F.useState)(5),[b,x]=(0,F.useState)(null),S=R({mutationFn:t=>{let n=(t??e).trim();if(!n)throw Error(`No lineage cache path to load.`);return B.get(`/lineage/info?load=${encodeURIComponent(n)}`)},onSuccess:(t,n)=>{l(t),p(null);let r=(n??e).trim();r&&localStorage.setItem(`kbagent-lineage-path`,r)},onError:e=>{l(null),p(e.message)}}),C=R({mutationFn:()=>{let t=e.trim()||`${n.replace(/\/$/,``)}/lineage.json`;return B.post(`/lineage/build`,{directory:n,output:t,use_ai:o,refresh:i})},onSuccess:r=>{d(r),p(null),localStorage.setItem(`kbagent-lineage-build-dir`,n);let i=r.output_path??(e.trim()||`${n}/lineage.json`);t(i),S.mutate(i)},onError:e=>{d(null),p(e.message)}}),w=R({mutationFn:()=>B.post(`/lineage/show`,{load:e,upstream:g===`upstream`?m:null,downstream:g===`downstream`?m:null,depth:v,format:`text`}),onSuccess:e=>x(e),onError:e=>p(e.message)});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`nerd-card space-y-3`,children:[(0,I.jsxs)(`h3`,{className:`text-sm font-bold text-keboola flex items-center gap-2`,children:[(0,I.jsx)(ir,{className:`w-4 h-4`}),` Build deep lineage`]}),(0,I.jsxs)(`p`,{className:`text-xs text-zinc-500`,children:[`Pulls every project's configs (`,(0,I.jsx)(`code`,{className:`text-accent`,children:`kbagent sync pull`}),`), parses SQL transformations, and writes a JSON cache. Big projects: minutes. The output JSON is auto-loaded on success.`]}),(0,I.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-2`,children:[(0,I.jsxs)(`label`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Working directory (where to sync project configs)`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1 font-mono`,placeholder:`/tmp/kbagent-lineage`,value:n,onChange:e=>r(e.target.value)})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Output file (defaults to ./lineage.json inside the working dir)`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1 font-mono`,placeholder:`(default)`,value:e,onChange:e=>t(e.target.value)})]})]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center`,children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:i,onChange:e=>a(e.target.checked)}),`sync pull all projects first (recommended)`]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(e.target.checked)}),`generate AI tasks for ambiguous edges (--ai)`]}),(0,I.jsx)(`div`,{className:`ml-auto flex gap-2`,children:(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-keboola disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:text-zinc-600 dark:disabled:hover:text-zinc-400`,disabled:!n.trim()||C.isPending,title:n.trim()?void 0:`Working directory required`,onClick:()=>{p(null),d(null),C.mutate()},children:[(0,I.jsx)(ir,{className:`w-3 h-3 inline mr-1`}),C.isPending?`building...`:`Build`]})})]}),n.trim()?null:(0,I.jsxs)(`div`,{className:`text-xs text-amber-700 dark:text-neon-amber`,children:[`⚠ Working directory is empty -- type a path (e.g.`,` `,(0,I.jsx)(`code`,{className:`text-accent`,children:`/tmp/kbagent-lineage`}),`) to enable Build.`]}),C.isPending?(0,I.jsxs)(`div`,{className:`text-xs text-keboola flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-keboola animate-pulse`}),`sync pull + parse SQL + scan configs ・ this can take minutes for big organizations ・ stay on this page (the request is in-flight)`]}):null,u?(0,I.jsxs)(`details`,{open:!0,children:[(0,I.jsx)(`summary`,{className:`text-xs text-keboola cursor-pointer`,children:`✓ Build complete -- summary (click to expand)`}),(0,I.jsx)(Em,{data:u,maxHeight:`240px`})]}):null]}),(0,I.jsxs)(`div`,{className:`nerd-card space-y-3`,children:[(0,I.jsxs)(`h3`,{className:`text-sm font-bold text-keboola flex items-center gap-2`,children:[(0,I.jsx)(er,{className:`w-4 h-4`}),` Load existing lineage cache`]}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`input`,{className:`nerd-input flex-1 font-mono`,placeholder:`/path/to/lineage.json`,value:e,onChange:e=>t(e.target.value)}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn hover:text-keboola`,disabled:!e||S.isPending,onClick:()=>S.mutate(void 0),children:S.isPending?`loading...`:`Load`})]})]}),f?(0,I.jsx)(Z,{message:f}):null,c?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`details`,{className:`nerd-card`,children:[(0,I.jsx)(`summary`,{className:`text-sm font-bold text-keboola cursor-pointer`,children:`Graph summary (click to expand)`}),(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Em,{data:c,maxHeight:`200px`})})]}),(0,I.jsxs)(`div`,{className:`nerd-card p-0 overflow-hidden`,children:[(0,I.jsxs)(`div`,{className:`px-3 py-2 border-b border-zinc-200 flex items-center justify-between text-xs dark:border-zinc-800`,children:[(0,I.jsxs)(`span`,{className:`text-keboola font-bold`,children:[`Interactive browser`,(0,I.jsx)(`span`,{className:`text-zinc-500 font-normal ml-2`,children:`(sidebar tree ・ search ・ upstream / downstream walk ・ Mermaid ・ ER ・ columns)`})]}),(0,I.jsx)(`a`,{href:`/api/lineage/browser?load=${encodeURIComponent(e)}`,target:`_blank`,rel:`noreferrer`,className:`text-zinc-500 hover:text-keboola`,children:`open in new tab ↗`})]}),(0,I.jsx)(`iframe`,{src:`/api/lineage/browser?load=${encodeURIComponent(e)}`,title:`Lineage browser`,className:`w-full bg-white`,style:{height:`70vh`,border:0}},e)]}),(0,I.jsxs)(`details`,{className:`nerd-card space-y-3`,children:[(0,I.jsx)(`summary`,{className:`text-sm font-bold text-keboola cursor-pointer`,children:`Headless walk (JSON, for scripting)`}),(0,I.jsxs)(`div`,{className:`flex gap-2 flex-wrap items-end mt-3`,children:[(0,I.jsxs)(`label`,{className:`text-xs text-zinc-600 flex-1 min-w-[260px] dark:text-zinc-400`,children:[`Node FQN (project:table or table.id)`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1`,placeholder:`padak:in.c-bucket.table`,value:m,onChange:e=>h(e.target.value)})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Direction`,(0,I.jsxs)(`select`,{className:`nerd-input w-full mt-1`,value:g,onChange:e=>_(e.target.value),children:[(0,I.jsx)(`option`,{value:`upstream`,children:`upstream (sources)`}),(0,I.jsx)(`option`,{value:`downstream`,children:`downstream (consumers)`})]})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Depth`,(0,I.jsx)(`input`,{type:`number`,className:`nerd-input w-20 mt-1`,value:v,onChange:e=>y(Number(e.target.value)||1),min:1,max:20})]}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn hover:text-keboola`,disabled:!m||w.isPending,onClick:()=>w.mutate(),children:w.isPending?`walking...`:`Walk`})]}),b?(0,I.jsx)(Em,{data:b}):null]})]}):(0,I.jsx)(wm,{title:`No lineage cache loaded yet`,hint:`Use the Build form above (UI does sync pull + lineage build for you), or point Load at an existing JSON cache.`})]})}function QS({label:e,value:t}){return(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 uppercase tracking-wider`,children:e}),(0,I.jsx)(`div`,{className:`text-3xl font-bold text-keboola mt-1`,children:t})]})}function $S({edges:e,onOpenDeepLineage:t}){let n=(0,F.useRef)(null),r=(0,F.useRef)(0),[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(``),[u,d]=(0,F.useState)(``),{theme:f}=fi(),p=(0,F.useMemo)(()=>{let t=new Set;for(let n of e){let e=n.source_project_alias||`p${n.source_project_id}`;t.add(e)}return Array.from(t).sort((e,t)=>e.localeCompare(t))},[e]),m=(0,F.useMemo)(()=>{let t=new Set;for(let n of e){let e=n.target_project_alias||`p${n.target_project_id}`;t.add(e)}return Array.from(t).sort((e,t)=>e.localeCompare(t))},[e]),h=(0,F.useMemo)(()=>!c&&!u?e:e.filter(e=>{let t=e.source_project_alias||`p${e.source_project_id}`,n=e.target_project_alias||`p${e.target_project_id}`;return!(c&&t!==c||u&&n!==u)}),[e,c,u]);if((0,F.useEffect)(()=>{if(!n.current)return;let e=!1;JS(f),r.current+=1;let t=`mmd_${Date.now()}_${r.current}`,i=e=>e.replace(/[^a-zA-Z0-9]/g,`_`),o=e=>e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`),c=[`graph LR`];for(let e of h){let t=e.source_project_alias||`p${e.source_project_id}`,n=e.target_project_alias||`p${e.target_project_id}`,r=`n_${i(t)}_${i(e.source_bucket_id)}`,a=`n_${i(n)}_${i(e.target_bucket_id)}`;c.push(` ${r}["${o(t)}<br/>${o(e.source_bucket_id)}"] -->|${o(e.sharing_type||`shared`)}| ${a}["${o(n)}<br/>${o(e.target_bucket_id)}"]`)}let l=c.join(`
|
|
96
|
+
`);if(s(l),h.length===0){n.current.innerHTML=``,a(null);return}return PS.render(t,l).then(({svg:t})=>{if(!(e||!n.current)){if(/maximum text size/i.test(t)){a(`Maximum text size in diagram exceeded`),n.current.innerHTML=``;return}n.current.innerHTML=t,a(null)}}).catch(t=>{e||a(String(t))}),()=>{e=!0,document.getElementById(t)?.remove()}},[h,f]),e.length===0)return(0,I.jsx)(`div`,{className:`nerd-card text-center py-6 text-xs text-zinc-500`,children:`No edges to render.`});let g=!!i&&/maximum text size/i.test(i),_=!!c||!!u;return(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-3 flex-wrap gap-2`,children:[(0,I.jsx)(`h3`,{className:`text-keboola font-bold text-sm`,children:`Diagram`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs flex-wrap`,children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-zinc-500`,children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider`,children:`Source:`}),(0,I.jsxs)(`select`,{className:`nerd-input text-xs py-0.5`,value:c,onChange:e=>l(e.target.value),title:`Filter edges by source project`,children:[(0,I.jsxs)(`option`,{value:``,children:[`(all `,p.length,`)`]}),p.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-zinc-500`,children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider`,children:`Target:`}),(0,I.jsxs)(`select`,{className:`nerd-input text-xs py-0.5`,value:u,onChange:e=>d(e.target.value),title:`Filter edges by target project`,children:[(0,I.jsxs)(`option`,{value:``,children:[`(all `,m.length,`)`]}),m.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]}),_?(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-keboola`,onClick:()=>{l(``),d(``)},title:`Clear both filters`,children:`clear`}):null,(0,I.jsxs)(`span`,{className:`text-zinc-500 text-[10px]`,children:[h.length,`/`,e.length,` edges`]})]})]}),g?(0,I.jsx)(eC,{edgeCount:h.length,mermaidCode:o,onOpenDeepLineage:t}):i?(0,I.jsx)(`div`,{className:`text-red-600 text-xs mb-2 dark:text-red-400`,children:i}):null,g?null:h.length===0?(0,I.jsx)(`div`,{className:`text-center py-6 text-xs text-zinc-500`,children:`No edges match the current filter.`}):(0,I.jsx)(`div`,{ref:n,className:`overflow-auto border border-zinc-200 dark:border-zinc-800 rounded bg-white dark:bg-zinc-950/40`,style:{height:`600px`}})]})}function eC({edgeCount:e,mermaidCode:t,onOpenDeepLineage:n}){return(0,I.jsxs)(`div`,{className:`border border-neon-amber/40 bg-neon-amber/10 rounded p-4 text-sm space-y-3`,children:[(0,I.jsxs)(`div`,{className:`font-bold text-amber-700 dark:text-neon-amber`,children:[`Diagram too large to render here (`,e,` edges)`]}),(0,I.jsx)(`p`,{className:`text-zinc-700 dark:text-zinc-300 text-xs leading-relaxed`,children:`Mermaid's embedded renderer caps source-text size and rejected this graph. Two ways forward — both stay in the UI, no shell required:`}),(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:n,className:`nerd-btn text-xs hover:text-keboola hover:border-keboola/60`,title:`Switch to the Deep Lineage tab — supports zoom, pan, search, and column-level drill-down.`,children:`→ Open Deep Lineage tab`}),(0,I.jsxs)(`button`,{type:`button`,onClick:()=>{let n=new Blob([t],{type:`text/plain;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`lineage-sharing-${e}-edges.mmd`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)},disabled:!t,className:`nerd-btn text-xs hover:text-keboola hover:border-keboola/60`,title:`Download the raw Mermaid source — paste into mermaid.live or any local renderer with higher size limits.`,children:[`⬇ Download Mermaid source (`,(t.length/1024).toFixed(0),` KB)`]})]}),(0,I.jsx)(`p`,{className:`text-[11px] text-zinc-500`,children:`Tip: filter the edge table below first — narrowing the set often brings the diagram back under the embedded renderer's limit.`})]})}function tC(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`?!0:!!(e&&typeof e==`object`&&`message`in e&&String(e.message).toLowerCase().includes(`abort`))}function nC(){let{project:e,branchId:t,pendingLocalAiMessage:n,setPendingLocalAiMessage:r}=Zr(),[i,a]=(0,F.useState)(`claude`),[o,s]=(0,F.useState)([]),[c,l]=(0,F.useState)(``),[u,d]=(0,F.useState)(!1),f=(0,F.useRef)(null),p=(0,F.useRef)(null);(0,F.useEffect)(()=>{if(!n)return;let e=n;r(null),m.current?.(e)},[n]);let m=(0,F.useRef)(null);(0,F.useEffect)(()=>{let e=p.current;e&&(e.scrollTop=e.scrollHeight)},[o]),(0,F.useEffect)(()=>()=>{f.current&&=(f.current.abort(),null)},[]);let h=n=>{let r=(n??c).trim();if(!r||u)return;l(``),s(e=>[...e,{role:`user`,content:r}]);let a=o.length+1;s(e=>[...e,{role:`assistant`,content:``,pending:!0,activity:[]}]),d(!0);let p=``,m=[],h=e=>{s(t=>{let n=[...t];return n[a]&&(n[a]={...n[a],...e}),n})},g=ai(`/ai/chat/stream`,{cli:i,message:r,project:e??null,branch_id:t},{init:e=>{let t=e??{};typeof t.meta_prompt==`string`&&h({metaPrompt:t.meta_prompt})},stdout:e=>{let t=e??{};if(t.type===`assistant`&&typeof t.message==`object`){let e=t.message.content;if(Array.isArray(e))for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(e.type===`text`&&typeof e.text==`string`)p+=e.text,h({content:p});else if(e.type===`tool_use`){let t=typeof e.name==`string`?e.name:`tool`,n=e.input,r=typeof n==`object`&&n?(()=>{let e=n;return typeof e.command==`string`?e.command:typeof e.description==`string`?e.description:JSON.stringify(e).slice(0,200)})():``;m.push(`→ ${t}: ${r}`),h({activity:[...m]})}}}else if(t.type===`user`&&typeof t.message==`object`){let e=t.message.content;if(Array.isArray(e))for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(e.type===`tool_result`){let t=e.is_error===!0;m.push(` ${t?`✗`:`✓`} tool result${t?` (error)`:``}`),h({activity:[...m]})}}}else typeof t.raw==`string`&&(p+=(p?`
|
|
97
|
+
`:``)+t.raw,h({content:p}))},stderr:()=>{},done:e=>{let t=e??{};if(t.status===`error`){h({pending:!1,error:String(t.error??`AI chat failed`)});return}!p&&typeof t.response==`string`&&(p=t.response),h({pending:!1,content:p||`(empty response)`})},message:()=>{}});f.current=g,g.done.catch(e=>{tC(e)||h({pending:!1,error:e.message})}).finally(()=>{d(!1),f.current=null})};m.current=h;let g=()=>{f.current&&=(f.current.abort(),null),d(!1),s(e=>{let t=[...e],n=t[t.length-1];return n&&n.role===`assistant`&&n.pending&&(t[t.length-1]={...n,pending:!1,error:`Cancelled by user.`}),t})},_=()=>{g(),s([])},v=e?`Ask ${i} about ${e} — e.g. "list jobs that failed in the last 24h"`:`Ask ${i} anything about your Keboola projects — pick one in the top bar, or ask cross-project (use --project NAME)`;return(0,I.jsxs)(`div`,{className:`space-y-4 flex flex-col`,style:{height:`calc(100vh - 7rem)`},children:[(0,I.jsx)(Tm,{title:`Local AI`,description:`Chat with your local ${i} install. It has the kbagent CLI on PATH and can run real Keboola commands to answer questions.`,actions:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-zinc-500`,children:`CLI:`}),[`claude`,`codex`,`gemini`].map(e=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs ${i===e?`border-keboola text-keboola`:``}`,onClick:()=>a(e),disabled:u,children:e},e)),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs flex items-center gap-1 hover:text-red-400 hover:border-red-700`,onClick:_,disabled:o.length===0,title:`Clear conversation and start fresh`,children:[(0,I.jsx)(Jn,{className:`w-3 h-3`}),` new`]})]})}),(0,I.jsx)(`div`,{ref:p,className:`flex-1 overflow-y-auto nerd-card space-y-4 min-h-0`,children:o.length===0?(0,I.jsx)(rC,{project:e,cli:i}):o.map((e,t)=>(0,I.jsx)(iC,{msg:e,cli:i},t))}),(0,I.jsxs)(`form`,{className:`nerd-card border-keboola/30 bg-white dark:bg-zinc-900/40 flex items-end gap-2 shrink-0`,onSubmit:e=>{e.preventDefault(),h()},children:[(0,I.jsx)(Ar,{className:`w-5 h-5 text-keboola flex-shrink-0 mb-1`}),(0,I.jsx)(`textarea`,{className:`flex-1 bg-transparent border-0 focus:outline-none text-sm placeholder-zinc-500 dark:placeholder-zinc-600 resize-none`,rows:2,placeholder:v,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),h())},disabled:u}),u?(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-red-400 hover:border-red-700`,onClick:g,title:`Abort the current response`,children:[(0,I.jsx)(Ur,{className:`w-3 h-3`}),` cancel`]}):(0,I.jsxs)(`button`,{type:`submit`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,disabled:!c.trim(),title:`Send (Cmd/Ctrl + Enter)`,children:[(0,I.jsx)(Dr,{className:`w-3 h-3`}),` send`]})]})]})}function rC({project:e,cli:t}){let n=e?[`list jobs that failed in ${e} during the last 24 hours`,`which buckets in ${e} have the most rows?`,`summarise scheduled flows in ${e} that haven't run in 7 days`]:[`which of my projects has the most failed jobs in the last week?`,`list all linked buckets across my projects and where they originate`,`find any project where doctor reports warnings`];return(0,I.jsxs)(`div`,{className:`text-center py-12 space-y-4`,children:[(0,I.jsx)(`div`,{className:`text-zinc-400 dark:text-zinc-600`,children:(0,I.jsx)(kn,{className:`w-12 h-12 mx-auto mb-2`})}),(0,I.jsxs)(`p`,{className:`text-sm text-zinc-600 dark:text-zinc-400`,children:[`Chat with your local `,(0,I.jsx)(`span`,{className:`font-bold text-keboola`,children:t}),`. It has `,(0,I.jsx)(`code`,{className:`text-xs`,children:`kbagent`}),` on PATH and runs real commands to answer.`]}),(0,I.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`Try one of these:`}),(0,I.jsx)(`div`,{className:`max-w-xl mx-auto space-y-1 text-left`,children:n.map((e,t)=>(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 dark:text-zinc-500 px-3 py-2 rounded border border-zinc-200 dark:border-zinc-900/40 bg-zinc-50 dark:bg-zinc-950/40`,children:e},t))})]})}function iC({msg:e,cli:t}){let[n,r]=(0,F.useState)(!0),[i,a]=(0,F.useState)(!1);return e.role===`user`?(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(`div`,{className:`w-7 h-7 rounded-full bg-zinc-200 dark:bg-zinc-800 flex items-center justify-center flex-shrink-0`,children:(0,I.jsx)(Br,{className:`w-3.5 h-3.5 text-zinc-600 dark:text-zinc-400`})}),(0,I.jsx)(`div`,{className:`flex-1 min-w-0 text-sm text-zinc-900 dark:text-zinc-100 whitespace-pre-wrap py-1`,children:e.content})]}):(0,I.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,I.jsx)(`div`,{className:`w-7 h-7 rounded-full bg-keboola/10 border border-keboola/40 flex items-center justify-center flex-shrink-0`,children:(0,I.jsx)(Ar,{className:`w-3.5 h-3.5 text-keboola`})}),(0,I.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-2`,children:[e.metaPrompt?(0,I.jsxs)(`div`,{className:`border border-zinc-200 dark:border-zinc-800 rounded`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`w-full text-left px-2 py-1 text-[10px] uppercase tracking-wider text-zinc-500 hover:text-keboola flex items-center gap-1`,onClick:()=>a(e=>!e),children:[(0,I.jsx)(`span`,{children:i?`▾`:`▸`}),(0,I.jsxs)(`span`,{children:[`Prompt sent to `,t]}),(0,I.jsxs)(`span`,{className:`ml-auto text-zinc-400`,children:[e.metaPrompt.length,` chars`]})]}),i?(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap text-[11px] text-zinc-600 dark:text-zinc-400 border-t border-zinc-200 dark:border-zinc-800`,style:{maxHeight:`240px`,overflow:`auto`},children:e.metaPrompt}):null]}):null,e.activity&&e.activity.length>0?(0,I.jsxs)(`div`,{className:`border border-zinc-200 dark:border-zinc-800 rounded`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`w-full text-left px-2 py-1 text-[10px] uppercase tracking-wider text-zinc-500 hover:text-keboola flex items-center gap-1`,onClick:()=>r(e=>!e),children:[(0,I.jsx)(`span`,{children:n?`▾`:`▸`}),(0,I.jsx)(`span`,{children:`Activity`}),(0,I.jsxs)(`span`,{className:`ml-auto text-zinc-400`,children:[e.activity.length,` events`]})]}),n?(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap text-[11px] text-zinc-600 dark:text-zinc-400 border-t border-zinc-200 dark:border-zinc-800`,style:{maxHeight:`200px`,overflow:`auto`},children:e.activity.join(`
|
|
98
|
+
`)}):null]}):null,e.error?(0,I.jsx)(Z,{message:e.error}):e.content?(0,I.jsxs)(`div`,{className:`prose prose-sm dark:prose-invert max-w-none text-sm`,children:[(0,I.jsx)(Gu,{remarkPlugins:[Xp],children:e.content}),e.pending?(0,I.jsx)(`span`,{className:`text-keboola animate-pulse`,children:`▌`}):null]}):e.pending?(0,I.jsx)(`div`,{className:`text-xs text-zinc-500`,children:`thinking…`}):null]})]})}function aC(){let{project:e,branchId:t}=Zr(),[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(``),o=L({queryKey:[`mcp-tools`,e,t],queryFn:()=>B.get(`/mcp/tools`,{query:{project:e??void 0,branch_id:t?String(t):void 0}})}),s=(o.data?.tools??[]).filter(e=>i?`${e.name} ${e.description}`.toLowerCase().includes(i.toLowerCase()):!0);return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`MCP Tools`,description:`${o.data?.tools.length??0} tools exposed by keboola-mcp-server. Click a tile to call it.`}),(0,I.jsx)(`input`,{className:`nerd-input w-full max-w-md`,placeholder:`filter tools...`,value:i,onChange:e=>a(e.target.value)}),o.isLoading?(0,I.jsx)(Q,{}):null,o.error?(0,I.jsx)(Z,{message:o.error.message}):null,(0,I.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3`,children:s.map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>r(e),className:`nerd-card text-left hover:border-keboola/50 transition-colors`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,I.jsx)(`div`,{className:`font-bold text-accent`,children:e.name}),e.multi_project?(0,I.jsx)(`span`,{className:`nerd-pill-green`,children:`multi-project`}):(0,I.jsx)(`span`,{className:`nerd-pill-amber`,children:`write`})]}),(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 line-clamp-3`,children:e.description})]},e.name))}),(0,I.jsx)(oC,{tool:n,onClose:()=>r(null)})]})}function oC({tool:e,onClose:t}){let{project:n}=Zr(),[r,i]=(0,F.useState)(`{}`),[a,o]=(0,F.useState)(null),[s,c]=(0,F.useState)(null);(0,F.useEffect)(()=>{if(e){let t=e.inputSchema?.required??[],n=e.inputSchema?.properties??{},r={};for(let e of t){let t=n[e];r[e]=t?.default??(t?.type===`array`?[]:t?.type===`object`?{}:``)}i(JSON.stringify(r,null,2)),o(null),c(null)}},[e]);let l=R({mutationFn:()=>{if(!e)throw Error(`No tool selected`);let t={};try{t=JSON.parse(r||`{}`)}catch(e){throw Error(`Invalid JSON: ${e.message}`)}return B.post(`/mcp/tools/${encodeURIComponent(e.name)}/call`,{input:t,project:n})},onSuccess:e=>{o(e),c(null)},onError:e=>{c(e.message),o(null)}});return(0,I.jsx)(Sm,{open:!!e,onClose:t,title:e?.name??``,subtitle:e?.description,width:`max-w-4xl`,actions:(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>l.mutate(),disabled:!e||l.isPending,children:[(0,I.jsx)(xr,{className:`w-3 h-3`}),` `,l.isPending?`running...`:`Call`]}),children:e?(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 mb-1`,children:`Input (JSON)`}),(0,I.jsx)(`textarea`,{className:`nerd-input w-full h-48 font-mono text-xs`,value:r,onChange:e=>i(e.target.value)})]}),(0,I.jsxs)(`details`,{children:[(0,I.jsxs)(`summary`,{className:`text-xs text-zinc-500 cursor-pointer`,children:[`Schema (`,e.inputSchema?.required?.length??0,` required)`]}),(0,I.jsx)(Em,{data:e.inputSchema,maxHeight:`200px`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 mb-1`,children:`Result`}),s?(0,I.jsx)(Z,{message:s}):null,a?(0,I.jsx)(Em,{data:a}):null,!s&&!a?(0,I.jsx)(`div`,{className:`text-zinc-500 text-xs dark:text-zinc-600`,children:`Result will appear here after Call.`}):null]})]}):null})}var sC=[`datasets`,`metrics`,`relationships`,`constraints`,`glossary`],cC=[...sC];async function lC(e){let t=await e.text();try{return JSON.parse(t)}catch(t){throw Error(`${e.name}: not valid JSON (${t instanceof Error?t.message:String(t)})`)}}function uC({onClick:e,disabled:t,children:n}){return(0,I.jsx)(`button`,{type:`button`,onClick:e,disabled:t,className:`px-3 py-1.5 rounded text-xs font-bold bg-keboola text-white border border-keboola hover:bg-keboola/80 hover:border-keboola/80 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1`,children:n})}function dC({children:e}){return(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-zinc-500 dark:text-zinc-600 mb-1`,children:e})}function fC({value:e,onChange:t,placeholder:n=`(pick project)`}){let r=L({queryKey:[`sl-projects`],queryFn:()=>B.get(`/projects`)}).data?.projects?.map(e=>e.alias)??[];return(0,I.jsxs)(`select`,{className:`nerd-input text-sm py-1`,value:e,onChange:e=>t(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:n}),r.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})}function pC({project:e,value:t,onChange:n,placeholder:r=`(default model)`,disabled:i}){let a=L({queryKey:[`sl-models`,e],queryFn:()=>B.get(`/semantic-layer/models`,{query:{project:e}}),enabled:!!e&&!i}).data?.models?.map(e=>e.name)??[];return(0,I.jsxs)(`select`,{className:`nerd-input text-sm py-1`,value:t,onChange:e=>n(e.target.value),disabled:i||!e,children:[(0,I.jsx)(`option`,{value:``,children:r}),a.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})}function mC(e){return{mode:`project`,project:e,model:``,file:null}}function hC({label:e,side:t,setSide:n}){return(0,I.jsxs)(`div`,{className:`border border-zinc-200 dark:border-zinc-900 rounded p-3 space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`span`,{className:`text-xs font-bold text-keboola`,children:e}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px]`,children:[(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn px-1.5 py-0.5 ${t.mode===`project`?`border-keboola text-keboola`:``}`,onClick:()=>n({...t,mode:`project`,file:null}),children:`Project`}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn px-1.5 py-0.5 ${t.mode===`file`?`border-keboola text-keboola`:``}`,onClick:()=>n({...t,mode:`file`}),children:`File`})]})]}),t.mode===`project`?(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(dC,{children:`Project`}),(0,I.jsx)(fC,{value:t.project,onChange:e=>n({...t,project:e,model:``})}),(0,I.jsx)(dC,{children:`Model (optional)`}),(0,I.jsx)(pC,{project:t.project,value:t.model,onChange:e=>n({...t,model:e})})]}):(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(dC,{children:`Snapshot file`}),(0,I.jsxs)(`label`,{className:`nerd-btn text-xs flex items-center gap-1 cursor-pointer w-fit`,children:[(0,I.jsx)($n,{className:`w-3 h-3`}),` `,t.file?t.file.name:`Pick JSON…`,(0,I.jsx)(`input`,{type:`file`,accept:`.json,application/json`,className:`hidden`,onChange:async e=>{let r=e.target.files?.[0];if(r){try{let e=await lC(r);n({...t,file:{name:r.name,content:e}})}catch(e){alert(e instanceof Error?e.message:String(e))}e.target.value=``}}})]}),t.file?(0,I.jsxs)(`div`,{className:`text-[10px] text-zinc-500`,children:[`Loaded `,t.file.name,`. Diff uses inline body, the file is not uploaded.`]}):(0,I.jsx)(`div`,{className:`text-[10px] text-zinc-500`,children:"Pick a JSON snapshot produced by Export (or `kbagent sl export`)."})]})]})}function gC({kind:e,data:t}){return t.added.length+t.removed.length+t.changed.length===0?(0,I.jsxs)(`div`,{className:`text-xs text-zinc-500 italic`,children:[e,`: identical (`,t.added.length===0?`no items on either side`:`matched`,`).`]}):(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`text-xs font-bold capitalize`,children:[e,` `,(0,I.jsxs)(`span`,{className:`text-zinc-500 font-normal text-[10px]`,children:[`+`,t.added.length,` / −`,t.removed.length,` / ~`,t.changed.length]})]}),t.added.length>0?(0,I.jsxs)(`div`,{className:`text-[11px] flex flex-wrap gap-1`,children:[(0,I.jsx)(`span`,{className:`text-emerald-500`,children:`+`}),t.added.map(e=>(0,I.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-700 dark:text-emerald-400`,children:e},`a-${e}`))]}):null,t.removed.length>0?(0,I.jsxs)(`div`,{className:`text-[11px] flex flex-wrap gap-1`,children:[(0,I.jsx)(`span`,{className:`text-red-500`,children:`−`}),t.removed.map(e=>(0,I.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-red-500/10 text-red-700 dark:text-red-400`,children:e},`r-${e}`))]}):null,t.changed.length>0?(0,I.jsx)(`div`,{className:`text-[11px] space-y-0.5`,children:t.changed.map(e=>{let t=e.name??e.term??`?`;return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[(0,I.jsx)(`span`,{className:`text-amber-500`,children:`~`}),(0,I.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-700 dark:text-amber-400`,children:t}),e.diff_keys&&e.diff_keys.length>0?(0,I.jsxs)(`span`,{className:`text-zinc-500`,children:[`[`,e.diff_keys.join(`, `),`]`]}):null]},`c-${t}`)})}):null]})}function _C({initialProject:e,onClose:t}){let[n,r]=(0,F.useState)(mC(e)),[i,a]=(0,F.useState)(mC(``)),o=(n.mode===`project`?!!n.project:!!n.file)&&(i.mode===`project`?!!i.project:!!i.file),s=R({mutationFn:()=>{let e={};return n.mode===`project`?(e.project_a=n.project,n.model&&(e.model_a=n.model)):n.file&&(e.file_a=n.file.content),i.mode===`project`?(e.project_b=i.project,i.model&&(e.model_b=i.model)):i.file&&(e.file_b=i.file.content),B.post(`/semantic-layer/diff`,e)}});return(0,I.jsx)(Sm,{open:!0,onClose:t,title:`Diff snapshots`,width:`80vw`,children:(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-3`,children:[(0,I.jsx)(hC,{label:`Left (A)`,side:n,setSide:r}),(0,I.jsx)(hC,{label:`Right (B)`,side:i,setSide:a})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 pt-2 border-t border-zinc-200 dark:border-zinc-900`,children:[(0,I.jsxs)(uC,{onClick:()=>s.mutate(),disabled:!o||s.isPending,children:[(0,I.jsx)(nr,{className:`w-3 h-3`}),s.isPending?`Diffing…`:`Run diff`]}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:t,children:`Close`})]}),s.error?(0,I.jsx)(Z,{message:s.error.message}):null,s.data?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`text-[11px] text-zinc-500`,children:[(0,I.jsx)(`span`,{className:`font-mono`,children:`A:`}),` `,String(s.data.left.source),` \xA0`,(0,I.jsx)(On,{className:`inline w-3 h-3`}),` \xA0`,(0,I.jsx)(`span`,{className:`font-mono`,children:`B:`}),` `,String(s.data.right.source)]}),(0,I.jsx)(`div`,{className:`grid md:grid-cols-2 gap-x-6 gap-y-3`,children:sC.map(e=>(0,I.jsx)(gC,{kind:e,data:s.data[e]},e))}),(0,I.jsxs)(`details`,{className:`text-[11px]`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-zinc-500`,children:`Raw response`}),(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Em,{data:s.data,maxHeight:`40vh`})})]})]}):null]})})}function vC({selected:e,onChange:t}){let n=n=>{e.includes(n)?t(e.filter(e=>e!==n)):t([...e,n])};return(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:cC.map(t=>(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:e.includes(t),onChange:()=>n(t)}),(0,I.jsx)(`span`,{className:`capitalize`,children:t})]},t))})}function yC({kind:e,stats:t,dryRun:n}){let r=n?`would`:`did`;return(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsxs)(`div`,{className:`text-xs font-bold capitalize`,children:[e,` `,(0,I.jsxs)(`span`,{className:`text-zinc-500 font-normal text-[10px]`,children:[`+`,t.new.length,` ~`,t.overwritten.length,` =`,t.identical.length,` `,`✗`,t.failed.length]})]}),t.new.length>0?(0,I.jsxs)(`div`,{className:`text-[11px]`,children:[(0,I.jsxs)(`span`,{className:`text-emerald-500`,children:[r,` create:`]}),` `,t.new.join(`, `)]}):null,t.overwritten.length>0?(0,I.jsxs)(`div`,{className:`text-[11px]`,children:[(0,I.jsxs)(`span`,{className:`text-amber-500`,children:[r,` overwrite:`]}),` `,t.overwritten.join(`, `)]}):null,t.identical.length>0?(0,I.jsxs)(`div`,{className:`text-[11px]`,children:[(0,I.jsxs)(`span`,{className:`text-zinc-500`,children:[`unchanged (`,t.identical.length,`):`]}),` `,t.identical.join(`, `)]}):null,t.failed.length>0?(0,I.jsx)(`div`,{className:`text-[11px] space-y-0.5`,children:t.failed.map(e=>(0,I.jsxs)(`div`,{className:`text-red-500`,children:[`✗ `,e.name,`: `,e.error]},e.name))}):null]})}function bC({initialFromProject:e,onClose:t}){let[n,r]=(0,F.useState)(e),[i,a]=(0,F.useState)(``),[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(``),[u,d]=(0,F.useState)([...sC]),f=!!n&&!!o&&n!==o&&u.length>0,p=R({mutationFn:()=>B.post(`/semantic-layer/promote`,{from_project:n,to_project:o,from_model:i||void 0,to_model:c||void 0,types:u.length===sC.length?void 0:u,dry_run:!0})}),m=R({mutationFn:()=>B.post(`/semantic-layer/promote`,{from_project:n,to_project:o,from_model:i||void 0,to_model:c||void 0,types:u.length===sC.length?void 0:u,dry_run:!1})}),h=m.data??p.data,g=m.data?!1:p.data?!0:null;return(0,I.jsx)(Sm,{open:!0,onClose:t,title:`Promote model across projects`,width:`70vw`,children:(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-3`,children:[(0,I.jsxs)(`div`,{className:`border border-zinc-200 dark:border-zinc-900 rounded p-3 space-y-2`,children:[(0,I.jsx)(`span`,{className:`text-xs font-bold text-keboola`,children:`From`}),(0,I.jsx)(dC,{children:`Project`}),(0,I.jsx)(fC,{value:n,onChange:e=>{r(e),a(``)}}),(0,I.jsx)(dC,{children:`Model (optional)`}),(0,I.jsx)(pC,{project:n,value:i,onChange:a})]}),(0,I.jsxs)(`div`,{className:`border border-zinc-200 dark:border-zinc-900 rounded p-3 space-y-2`,children:[(0,I.jsx)(`span`,{className:`text-xs font-bold text-keboola`,children:`To`}),(0,I.jsx)(dC,{children:`Project`}),(0,I.jsx)(fC,{value:o,onChange:e=>{s(e),l(``)}}),(0,I.jsx)(dC,{children:`Model (optional)`}),(0,I.jsx)(pC,{project:o,value:c,onChange:l})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(dC,{children:`Entity types to promote`}),(0,I.jsx)(vC,{selected:u,onChange:d}),(0,I.jsx)(`div`,{className:`text-[10px] text-zinc-500`,children:"All five are selected by default. Unchecking sends a `types` filter so the API only touches those kinds."})]}),n&&o&&n===o?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-amber-500`,children:[(0,I.jsx)(Lr,{className:`w-3.5 h-3.5`}),` From and To must be different projects.`]}):null,(0,I.jsxs)(`div`,{className:`flex items-center gap-2 pt-2 border-t border-zinc-200 dark:border-zinc-900`,children:[(0,I.jsxs)(uC,{onClick:()=>p.mutate(),disabled:!f||p.isPending||m.isPending,children:[(0,I.jsx)(Ar,{className:`w-3 h-3`}),p.isPending?`Previewing…`:`Preview (dry-run)`]}),(0,I.jsxs)(uC,{onClick:()=>{confirm(`Apply promote from ${n} → ${o}? CHANGED items will be overwritten on target.`)&&m.mutate()},disabled:!f||p.isPending||m.isPending,children:[(0,I.jsx)(Dr,{className:`w-3 h-3`}),m.isPending?`Applying…`:`Apply`]}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:t,children:`Close`})]}),p.error?(0,I.jsx)(Z,{message:p.error.message}):null,m.error?(0,I.jsx)(Z,{message:m.error.message}):null,h&&g!==null?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`text-[11px] text-zinc-500`,children:[g?`Preview`:`Applied`,`: `,h.from_project,` `,(0,I.jsx)(On,{className:`inline w-3 h-3`}),` `,h.to_project]}),(0,I.jsx)(`div`,{className:`grid md:grid-cols-2 gap-x-6 gap-y-3`,children:sC.map(e=>{let t=h[e];return t?(0,I.jsx)(yC,{kind:e,stats:t,dryRun:g},e):null})}),(0,I.jsxs)(`details`,{className:`text-[11px]`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-zinc-500`,children:`Raw response`}),(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Em,{data:h,maxHeight:`40vh`})})]})]}):null]})})}function xC({initialProject:e,initialModel:t,onClose:n,onImported:r}){let[i,a]=(0,F.useState)(e),[o,s]=(0,F.useState)(t),[c,l]=(0,F.useState)(null),[u,d]=(0,F.useState)([...sC]),[f,p]=(0,F.useState)(!1),m=R({mutationFn:()=>B.post(`/semantic-layer/import`,{project:i,model:o||void 0,snapshot:c?.content,types:u.length===sC.length?void 0:u,dry_run:!0,overwrite:f})}),h=R({mutationFn:()=>B.post(`/semantic-layer/import`,{project:i,model:o||void 0,snapshot:c?.content,types:u.length===sC.length?void 0:u,dry_run:!1,overwrite:f}),onSuccess:()=>r()}),g=!!i&&!!c&&u.length>0,_=h.data??m.data,v=h.data?!1:m.data?!0:null;return(0,I.jsx)(Sm,{open:!0,onClose:n,title:`Import snapshot`,width:`70vw`,children:(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-3`,children:[(0,I.jsxs)(`div`,{className:`border border-zinc-200 dark:border-zinc-900 rounded p-3 space-y-2`,children:[(0,I.jsx)(`span`,{className:`text-xs font-bold text-keboola`,children:`Target`}),(0,I.jsx)(dC,{children:`Project`}),(0,I.jsx)(fC,{value:i,onChange:e=>{a(e),s(``)}}),(0,I.jsx)(dC,{children:`Model (optional — defaults to single model)`}),(0,I.jsx)(pC,{project:i,value:o,onChange:s})]}),(0,I.jsxs)(`div`,{className:`border border-zinc-200 dark:border-zinc-900 rounded p-3 space-y-2`,children:[(0,I.jsx)(`span`,{className:`text-xs font-bold text-keboola`,children:`Snapshot`}),(0,I.jsxs)(`label`,{className:`nerd-btn text-xs flex items-center gap-1 cursor-pointer w-fit`,children:[(0,I.jsx)($n,{className:`w-3 h-3`}),` `,c?c.name:`Pick JSON snapshot…`,(0,I.jsx)(`input`,{type:`file`,accept:`.json,application/json`,className:`hidden`,onChange:async e=>{let t=e.target.files?.[0];if(t){try{let e=await lC(t);l({name:t.name,content:e})}catch(e){alert(e instanceof Error?e.message:String(e))}e.target.value=``}}})]}),(0,I.jsx)(`div`,{className:`text-[10px] text-zinc-500`,children:"The snapshot is sent inline in the request body (no upload endpoint). Produced by the Export button or `kbagent sl export`."}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:f,onChange:e=>p(e.target.checked)}),`Overwrite existing items (otherwise: skip on conflict)`]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(dC,{children:`Entity types to import`}),(0,I.jsx)(vC,{selected:u,onChange:d})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 pt-2 border-t border-zinc-200 dark:border-zinc-900`,children:[(0,I.jsxs)(uC,{onClick:()=>m.mutate(),disabled:!g||m.isPending||h.isPending,children:[(0,I.jsx)(Ar,{className:`w-3 h-3`}),m.isPending?`Previewing…`:`Preview (dry-run)`]}),(0,I.jsxs)(uC,{onClick:()=>{confirm(`Import snapshot into ${i}? ${f?`EXISTING items will be overwritten.`:`Conflicts will be skipped.`}`)&&h.mutate()},disabled:!g||m.isPending||h.isPending,children:[(0,I.jsx)(Rr,{className:`w-3 h-3`}),h.isPending?`Importing…`:`Import`]}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:n,children:`Close`})]}),m.error?(0,I.jsx)(Z,{message:m.error.message}):null,h.error?(0,I.jsx)(Z,{message:h.error.message}):null,_&&v!==null?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`text-[11px] text-zinc-500`,children:[v?`Preview`:`Imported`,`: `,_.target_project,` ← snapshot`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:_.source_model||`(unknown)`})]}),(0,I.jsx)(`div`,{className:`grid md:grid-cols-3 gap-2`,children:Object.entries(_.imported.summary).map(([e,t])=>(0,I.jsxs)(`div`,{className:`text-[11px] flex items-center justify-between border border-zinc-200 dark:border-zinc-900 rounded px-2 py-1`,children:[(0,I.jsx)(`span`,{className:`text-zinc-500`,children:e}),(0,I.jsx)(`span`,{className:`font-mono`,children:t})]},e))}),(0,I.jsxs)(`details`,{className:`text-[11px]`,children:[(0,I.jsxs)(`summary`,{className:`cursor-pointer text-zinc-500`,children:[`Item-by-item (`,_.imported.items.length,`)`]}),(0,I.jsx)(`div`,{className:`mt-2 max-h-72 overflow-auto space-y-0.5 font-mono text-[11px]`,children:_.imported.items.map((e,t)=>(0,I.jsxs)(`div`,{className:e.status===`imported`||e.status===`would-import`?`text-emerald-500`:e.status===`overwritten`||e.status===`would-overwrite`?`text-amber-500`:e.status===`skipped`?`text-zinc-500`:`text-red-500`,children:[e.status,` `,e.type,`: `,e.name??`?`,e.error?` — ${e.error}`:``]},`${e.type}-${e.name??t}`))})]})]}):null]})})}function SC({project:e,selected:t,onChange:n}){let[r,i]=(0,F.useState)(``),a=L({queryKey:[`sl-build-buckets`,e],queryFn:()=>B.get(`/storage/buckets`,{query:{project:e}}),enabled:!!e}),o=L({queryKey:[`sl-build-tables`,e,r],queryFn:()=>B.get(`/storage/tables`,{query:{project:e,...r?{bucket_id:r}:{}}}),enabled:!!e}),s=(0,F.useMemo)(()=>(o.data?.tables??[]).map(e=>e.id),[o.data]);return(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(dC,{children:`Filter by bucket`}),(0,I.jsxs)(`select`,{className:`nerd-input text-xs py-0.5`,value:r,onChange:e=>i(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`(all buckets)`}),(a.data?.buckets??[]).map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.id},e.id))]}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-[10px]`,onClick:()=>{t.length===s.length?n([]):n(s)},disabled:s.length===0,children:t.length===s.length&&s.length>0?`Unselect all`:`Select all`}),(0,I.jsxs)(`span`,{className:`text-[10px] text-zinc-500`,children:[t.length,` / `,s.length,` selected`]})]}),o.isLoading?(0,I.jsx)(Q,{label:`loading tables`}):null,o.error?(0,I.jsx)(Z,{message:o.error.message}):null,o.data?(0,I.jsx)(`div`,{className:`border border-zinc-200 dark:border-zinc-900 rounded p-2 max-h-72 overflow-auto space-y-0.5 font-mono text-[11px]`,children:s.length===0?(0,I.jsx)(`div`,{className:`text-zinc-500 italic`,children:`No tables in this scope.`}):s.map(e=>(0,I.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:t.includes(e),onChange:r=>{r.target.checked?n([...t,e]):n(t.filter(t=>t!==e))}}),(0,I.jsx)(`span`,{children:e})]},e))}):null]})}function CC({initialProject:e,initialModel:t,onClose:n,onBuilt:r}){let[i,a]=(0,F.useState)(e),[o,s]=(0,F.useState)(t),[c,l]=(0,F.useState)([]),[u,d]=(0,F.useState)(``),[f,p]=(0,F.useState)(!1),m=!!i&&c.length>0,h=R({mutationFn:()=>B.post(`/semantic-layer/build`,{project:i,model:o||void 0,tables:c,name:u||void 0,dry_run:!0,keep_on_failure:f})}),g=R({mutationFn:()=>B.post(`/semantic-layer/build`,{project:i,model:o||void 0,tables:c,name:u||void 0,dry_run:!1,keep_on_failure:f}),onSuccess:()=>r()}),_=g.data??h.data,v=g.data?!1:h.data?!0:null;return(0,I.jsx)(Sm,{open:!0,onClose:n,title:`Build model from tables`,width:`75vw`,children:(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(`div`,{className:`text-[11px] text-zinc-500`,children:`Heuristic greenfield builder — fetches the storage schema for each table, classifies columns into role-buckets, and synthesises one dataset per table with a COUNT(*) metric. Validation runs locally before any push. AI-assisted variant is CLI-only for now.`}),(0,I.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(dC,{children:`Project`}),(0,I.jsx)(fC,{value:i,onChange:e=>{a(e),s(``),l([])}}),(0,I.jsx)(dC,{children:`Target model (optional)`}),(0,I.jsx)(pC,{project:i,value:o,onChange:s}),(0,I.jsx)(`div`,{className:`text-[10px] text-zinc-500`,children:`Empty means "create a fresh model with the name below."`})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(dC,{children:`Model name (if creating a fresh one)`}),(0,I.jsx)(`input`,{className:`nerd-input w-full text-sm`,value:u,onChange:e=>d(e.target.value),placeholder:`e.g. analytics_core`}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:f,onChange:e=>p(e.target.checked)}),`Keep on failure (don't rollback if push fails — for forensic inspection)`]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(dC,{children:`Source tables`}),i?(0,I.jsx)(SC,{project:i,selected:c,onChange:l}):(0,I.jsx)(`div`,{className:`text-[11px] text-zinc-500 italic`,children:`Pick a project first.`})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 pt-2 border-t border-zinc-200 dark:border-zinc-900`,children:[(0,I.jsxs)(uC,{onClick:()=>h.mutate(),disabled:!m||h.isPending||g.isPending,children:[(0,I.jsx)(Ar,{className:`w-3 h-3`}),h.isPending?`Previewing…`:`Preview (dry-run)`]}),(0,I.jsxs)(uC,{onClick:()=>{confirm(`Build & push model from ${c.length} table(s) into ${i}?`)&&g.mutate()},disabled:!m||h.isPending||g.isPending,children:[(0,I.jsx)(_r,{className:`w-3 h-3`}),g.isPending?`Building…`:`Build`]}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:n,children:`Close`})]}),h.error?(0,I.jsx)(Z,{message:h.error.message}):null,g.error?(0,I.jsx)(Z,{message:g.error.message}):null,_&&v!==null?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`text-[11px] text-zinc-500`,children:[v?`Preview`:`Pushed`,`: fallback=`,_.fallback_used,`, validated=`,_.validated?`yes`:`no`]}),_.validation.errors.length>0?(0,I.jsxs)(`div`,{className:`text-[11px] space-y-0.5`,children:[(0,I.jsxs)(`div`,{className:`text-red-500 font-bold`,children:[`Errors (`,_.validation.errors.length,`)`]}),_.validation.errors.map((e,t)=>(0,I.jsxs)(`div`,{className:`text-red-500`,children:[`[`,e.code??`ERR`,`] `,e.message]},t))]}):null,_.validation.warnings.length>0?(0,I.jsxs)(`div`,{className:`text-[11px] space-y-0.5`,children:[(0,I.jsxs)(`div`,{className:`text-amber-500 font-bold`,children:[`Warnings (`,_.validation.warnings.length,`)`]}),_.validation.warnings.map((e,t)=>(0,I.jsxs)(`div`,{className:`text-amber-500`,children:[`[`,e.code??`WARN`,`] `,e.message]},t))]}):null,(0,I.jsx)(`div`,{className:`grid md:grid-cols-5 gap-2`,children:sC.map(e=>(0,I.jsxs)(`div`,{className:`text-[11px] flex items-center justify-between border border-zinc-200 dark:border-zinc-900 rounded px-2 py-1`,children:[(0,I.jsx)(`span`,{className:`text-zinc-500 capitalize`,children:e}),(0,I.jsx)(`span`,{className:`font-mono`,children:_.generated[e]?.length??0})]},e))}),_.pushed?(0,I.jsxs)(`div`,{className:`text-[11px] text-emerald-500`,children:[`Pushed model `,_.pushed.model_uuid,`: `,JSON.stringify(_.pushed.counts)]}):null,_.fetch_errors.length>0?(0,I.jsxs)(`details`,{className:`text-[11px]`,children:[(0,I.jsxs)(`summary`,{className:`cursor-pointer text-amber-500`,children:[`Fetch errors (`,_.fetch_errors.length,`)`]}),(0,I.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:_.fetch_errors.map(e=>(0,I.jsxs)(`div`,{className:`text-amber-500`,children:[e.table,`: `,e.error]},e.table))})]}):null,(0,I.jsxs)(`details`,{className:`text-[11px]`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-zinc-500`,children:`Raw response`}),(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Em,{data:_,maxHeight:`40vh`})})]})]}):null]})})}function wC({initialProject:e,onClose:t}){let[n,r]=(0,F.useState)(e),[i,a]=(0,F.useState)(`keboola.snowflake-transformation`),[o,s]=(0,F.useState)(!1),c=R({mutationFn:()=>B.post(`/semantic-layer/token/encrypt`,{project:n,component_id:i})}),l=async e=>{try{await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)}catch(e){alert(`Clipboard write failed: ${e instanceof Error?e.message:String(e)}`)}};return(0,I.jsx)(Sm,{open:!0,onClose:t,title:`Encrypt project storage token`,width:`55vw`,children:(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`text-[11px] text-zinc-500`,children:[`Encrypts the project's storage token as a `,(0,I.jsx)(`span`,{className:`font-mono`,children:`KBC::Project::*`}),` `,`ciphertext bound to a specific component. Paste the resulting value into the transformation config's `,(0,I.jsx)(`span`,{className:`font-mono`,children:`parameters.user_properties.token`}),` `,`so the metastore-aware transformation can read it without seeing the plaintext token.`]}),(0,I.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(dC,{children:`Project`}),(0,I.jsx)(fC,{value:n,onChange:r})]}),(0,I.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,I.jsx)(dC,{children:`Component ID`}),(0,I.jsx)(`input`,{className:`nerd-input w-full text-sm`,value:i,onChange:e=>a(e.target.value),placeholder:`e.g. keboola.snowflake-transformation`}),(0,I.jsx)(`div`,{className:`text-[10px] text-zinc-500`,children:`Must match the component the transformation actually uses (per-component scope).`})]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 pt-2 border-t border-zinc-200 dark:border-zinc-900`,children:[(0,I.jsxs)(uC,{onClick:()=>c.mutate(),disabled:!n||!i||c.isPending,children:[(0,I.jsx)(sr,{className:`w-3 h-3`}),c.isPending?`Encrypting…`:`Encrypt token`]}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:t,children:`Close`})]}),c.error?(0,I.jsx)(Z,{message:c.error.message}):null,c.data?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsx)(dC,{children:`Encrypted user_properties`}),(0,I.jsxs)(`div`,{className:`text-[11px] text-zinc-500`,children:[`Paste this block into the transformation's`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:`parameters.user_properties`}),`. The key (e.g. `,(0,I.jsx)(`span`,{className:`font-mono`,children:`#metastore_token`}),`) is what the transformation reads at runtime.`]}),(0,I.jsx)(`textarea`,{readOnly:!0,rows:6,className:`nerd-input w-full font-mono text-[11px] break-all`,value:JSON.stringify(c.data.encrypted,null,2),onFocus:e=>e.target.select()}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsxs)(uC,{onClick:()=>l(JSON.stringify(c.data.encrypted,null,2)),children:[(0,I.jsx)(Wn,{className:`w-3 h-3`}),o?`Copied!`:`Copy block`]}),Object.entries(c.data.encrypted).map(([e,t])=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>l(t),className:`nerd-btn text-xs`,title:`Copy just the ciphertext for ${e}`,children:[`Copy `,e]},e)),(0,I.jsxs)(`span`,{className:`text-[10px] text-zinc-500`,children:[`Component scope:`,` `,(0,I.jsx)(`span`,{className:`font-mono`,children:c.data.component_id})]})]})]}):null]})})}function TC(e){let t={...e};for(let[e,n]of[[`tableId`,`table_id`],[`primaryKey`,`primary_key`],[`constraintType`,`constraint_type`]])t[e]!==void 0&&t[n]===void 0&&(t[n]=t[e]);return t}var EC={metric:{kind:`metric`,pluralLabel:`Metrics`,pkField:`name`,fields:[{key:`name`,label:`Name`,type:`text`,required:!0,placeholder:`monthly_active_users`,help:`Lowercase + underscores. Must be unique within the model.`},{key:`sql`,editKey:`new_sql`,label:`SQL expression`,type:`textarea`,required:!0,placeholder:`COUNT(DISTINCT user_id)`,help:`Aggregation expression evaluated against the dataset.`},{key:`dataset`,editKey:`new_dataset`,label:`Dataset (FQN)`,type:`text`,required:!0,placeholder:`in.c-users.events`,help:`Storage table this metric aggregates over.`},{key:`description`,editKey:`new_description`,label:`Description`,type:`textarea`}],tableColumns:[{header:`Name`,cell:e=>(0,I.jsx)(`span`,{className:`font-bold`,children:e.name})},{header:`Dataset`,cell:e=>(0,I.jsx)(`span`,{className:`font-mono text-xs text-accent`,children:e.dataset})},{header:`SQL`,cell:e=>(0,I.jsx)(`code`,{className:`text-xs text-zinc-600 dark:text-zinc-400 truncate block max-w-md`,children:e.sql})}]},dataset:{kind:`dataset`,pluralLabel:`Datasets`,pkField:`name`,fields:[{key:`name`,label:`Name`,type:`text`,required:!0,placeholder:`events`,help:`Lowercase + underscores. Defaults to the table name if omitted.`},{key:`table_id`,label:`Table ID`,type:`text`,required:!0,placeholder:`in.c-users.events`,help:`Storage table FQN. Used to derive the dataset's FQN.`},{key:`grain`,editKey:`new_grain`,label:`Grain`,type:`text`,placeholder:`user_id, event_timestamp`,help:`Comma-separated columns that uniquely identify a row.`},{key:`primary_key`,label:`Primary key`,type:`list`,placeholder:`user_id, event_id`,help:`Columns making up the primary key (one per line or comma-separated).`},{key:`description`,editKey:`new_description`,label:`Description`,type:`textarea`},{key:`deep_fields`,label:`Probe column types`,type:`boolean`,help:`When true, kbagent queries Snowflake to populate column metadata + role classification (slow).`}],tableColumns:[{header:`Name`,cell:e=>(0,I.jsx)(`span`,{className:`font-bold`,children:e.name})},{header:`Table`,cell:e=>(0,I.jsx)(`span`,{className:`font-mono text-xs text-accent`,children:e.table_id})},{header:`Grain`,cell:e=>(0,I.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e.grain||`—`})}]},relationship:{kind:`relationship`,pluralLabel:`Relationships`,pkField:`name`,fields:[{key:`name`,label:`Name`,type:`text`,required:!0,placeholder:`users_to_events`},{key:`from`,editKey:`new_from`,label:`From dataset`,type:`text`,required:!0,placeholder:`users`},{key:`to`,editKey:`new_to`,label:`To dataset`,type:`text`,required:!0,placeholder:`events`},{key:`on`,editKey:`new_on`,label:`Join expression`,type:`text`,required:!0,placeholder:`users.id = events.user_id`},{key:`type`,editKey:`new_type`,label:`Join type`,type:`select`,options:[`left`,`inner`,`right`,`outer`]}],tableColumns:[{header:`Name`,cell:e=>(0,I.jsx)(`span`,{className:`font-bold`,children:e.name})},{header:`From → To`,cell:e=>(0,I.jsxs)(`span`,{className:`text-xs`,children:[(0,I.jsx)(`span`,{className:`font-mono text-accent`,children:e.from}),(0,I.jsx)(`span`,{className:`text-zinc-500 mx-1`,children:`→`}),(0,I.jsx)(`span`,{className:`font-mono text-accent`,children:e.to})]})},{header:`Join`,cell:e=>(0,I.jsxs)(`span`,{className:`text-xs text-zinc-500`,children:[(0,I.jsx)(`span`,{className:`nerd-pill text-[10px] mr-1`,children:e.type||`left`}),(0,I.jsx)(`code`,{children:e.on})]})}]},constraint:{kind:`constraint`,pluralLabel:`Constraints`,pkField:`name`,fields:[{key:`name`,label:`Name`,type:`text`,required:!0,placeholder:`revenue_above_zero_critical`,help:`Lowercase + underscores. Suffix with _critical / _warning / _healthy / _review for health-band classification.`},{key:`constraint_type`,editKey:`new_constraint_type`,label:`Type`,type:`select`,required:!0,options:[`inequality`,`equality`,`range`,`composition`,`exclusion`,`temporal`,`conditional`]},{key:`rule`,editKey:`new_rule`,label:`Rule expression`,type:`textarea`,required:!0,placeholder:`monthly_revenue > 0`,help:`STRING expression (not an object). Plain SQL boolean predicate.`},{key:`metrics`,editKey:`new_metrics`,label:`Applies to metrics`,type:`list`,placeholder:`monthly_revenue, daily_active_users`,help:`Comma-separated metric names.`},{key:`severity`,editKey:`new_severity`,label:`Severity`,type:`select`,options:[`warning`,`critical`,`info`],help:`API enum is 3-level; the 4-band health (critical / warning / healthy / review) lives in the name suffix.`}],tableColumns:[{header:`Name`,cell:e=>(0,I.jsx)(`span`,{className:`font-bold`,children:e.name})},{header:`Type`,cell:e=>(0,I.jsx)(`span`,{className:`nerd-pill text-[10px]`,children:e.constraint_type})},{header:`Severity`,cell:e=>{let t=e.severity||`warning`;return(0,I.jsx)(`span`,{className:`${t===`critical`?`nerd-pill-red`:t===`warning`?`nerd-pill-amber`:`nerd-pill`} text-[10px]`,children:t})}},{header:`Rule`,cell:e=>(0,I.jsx)(`code`,{className:`text-xs text-zinc-600 dark:text-zinc-400 truncate block max-w-md`,children:e.rule})}]},glossary:{kind:`glossary`,pluralLabel:`Glossary`,pkField:`term`,fields:[{key:`term`,editKey:`new_term`,label:`Term`,type:`text`,required:!0,placeholder:`MAU`,help:`The term being defined. Used as the unique identifier for edit/delete.`},{key:`definition`,editKey:`new_definition`,label:`Definition`,type:`textarea`,required:!0,placeholder:`Monthly Active Users — distinct users observed in a calendar month.`}],tableColumns:[{header:`Term`,cell:e=>(0,I.jsx)(`span`,{className:`font-bold`,children:e.term})},{header:`Definition`,cell:e=>(0,I.jsx)(`span`,{className:`text-xs text-zinc-600 dark:text-zinc-400 truncate block max-w-2xl`,children:e.definition})}]}},DC=[`metric`,`dataset`,`relationship`,`constraint`,`glossary`];function OC(){let{project:e}=Zr(),[t,n]=(0,F.useState)(null),[r,i]=(0,F.useState)(`metric`),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(!1),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(!1),_=tn(),v=L({queryKey:[`sl-models`,e],queryFn:()=>B.get(`/semantic-layer/models`,{query:{project:e}}),enabled:!!e}),y=v.data?.models??[],b=t??(y.length>0?y[0].name:null);return e?(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Semantic Layer`,description:`Keboola Metastore for ${e}. Models, metrics, datasets, relationships, constraints, glossary.`,actions:(0,I.jsxs)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>o(!0),children:[(0,I.jsx)(Sr,{className:`w-3 h-3`}),` New model`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>m(!0),title:`Heuristic greenfield builder — pick tables, get a starter model`,children:[(0,I.jsx)(_r,{className:`w-3 h-3`}),` Build`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>f(!0),title:`Replay a JSON snapshot into a model`,children:[(0,I.jsx)(Rr,{className:`w-3 h-3`}),` Import`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>g(!0),title:`Encrypt project storage token for transformation user_properties`,children:[(0,I.jsx)(sr,{className:`w-3 h-3`}),` Encrypt token`]})]})}),v.isLoading?(0,I.jsx)(Q,{}):null,v.error?(0,I.jsx)(Z,{message:v.error.message}):null,v.data&&y.length===0?(0,I.jsx)(wm,{title:`No semantic-layer models yet`,hint:"Click 'New model' above to create your first one, or run `kbagent sl build` from the CLI for an AI-assisted greenfield."}):null,y.length>0?(0,I.jsx)(kC,{models:y,activeModel:b,onChange:n,project:e,onOpenDiff:()=>c(!0),onOpenPromote:()=>u(!0)}):null,b?(0,I.jsx)(MC,{project:e,model:b,activeTab:r,setActiveTab:i}):null,a?(0,I.jsx)(jC,{project:e,onClose:()=>o(!1),onCreated:t=>{o(!1),_.invalidateQueries({queryKey:[`sl-models`,e]}),n(t)}}):null,s?(0,I.jsx)(_C,{initialProject:e,onClose:()=>c(!1)}):null,l?(0,I.jsx)(bC,{initialFromProject:e,onClose:()=>u(!1)}):null,d?(0,I.jsx)(xC,{initialProject:e,initialModel:b??``,onClose:()=>f(!1),onImported:()=>{_.invalidateQueries({queryKey:[`sl-show`]}),_.invalidateQueries({queryKey:[`sl-models`,e]})}}):null,p?(0,I.jsx)(CC,{initialProject:e,initialModel:b??``,onClose:()=>m(!1),onBuilt:()=>{_.invalidateQueries({queryKey:[`sl-models`,e]}),_.invalidateQueries({queryKey:[`sl-show`]})}}):null,h?(0,I.jsx)(wC,{initialProject:e,onClose:()=>g(!1)}):null]}):(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Semantic Layer`,description:`Keboola Metastore — models, metrics, datasets, relationships, constraints, glossary.`}),(0,I.jsx)(wm,{title:`Pick a project`,hint:`Use the top-bar project picker to scope the semantic-layer view.`})]})}function kC({models:e,activeModel:t,onChange:n,project:r,onOpenDiff:i,onOpenPromote:a}){let o=tn(),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(!1),d=R({mutationFn:e=>B.delete(`/semantic-layer/models/${encodeURIComponent(e)}`,{query:{project:r}}),onSuccess:()=>{o.invalidateQueries({queryKey:[`sl-models`,r]})}}),f=R({mutationFn:()=>B.get(`/semantic-layer/export`,{query:{project:r,model:t??void 0}}),onSuccess:e=>{let n=new Blob([JSON.stringify(e,null,2)],{type:`application/json;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r;let a=new Date().toISOString().slice(0,19).replace(/[:T]/g,``);i.download=`sl-${e.model?.name??t??`model`}-${a}.json`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}});return(0,I.jsxs)(`div`,{className:`nerd-card flex items-center justify-between flex-wrap gap-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-zinc-500`,children:`Model:`}),(0,I.jsx)(`select`,{className:`nerd-input text-sm py-1`,value:t??``,onChange:e=>n(e.target.value),children:e.map(e=>(0,I.jsx)(`option`,{value:e.name,children:e.name},e.uuid))}),t?(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-red-400 hover:border-red-700`,onClick:()=>{confirm(`Delete model '${t}'? This deletes every entity it contains.`)&&d.mutate(t)},disabled:d.isPending,title:`Delete this model + everything in it`,children:(0,I.jsx)(Ir,{className:`w-3 h-3`})}):null]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsxs)(`label`,{className:`flex items-center gap-1 text-xs text-zinc-500`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked)}),`deep`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs flex items-center gap-1 hover:text-keboola`,onClick:()=>c(!0),children:[(0,I.jsx)(Rn,{className:`w-3 h-3`}),` Validate`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs flex items-center gap-1 hover:text-keboola`,onClick:()=>f.mutate(),disabled:f.isPending,children:[(0,I.jsx)(qn,{className:`w-3 h-3`}),` Export`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs flex items-center gap-1 hover:text-keboola`,onClick:i,title:`Diff two snapshots (project↔project, project↔file, file↔file)`,children:[(0,I.jsx)(nr,{className:`w-3 h-3`}),` Diff`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs flex items-center gap-1 hover:text-keboola`,onClick:a,title:`Promote this model to another project (with dry-run preview)`,children:[(0,I.jsx)(Dr,{className:`w-3 h-3`}),` Promote`]})]}),s&&t?(0,I.jsx)(AC,{project:r,model:t,deep:l,onClose:()=>c(!1)}):null]})}function AC({project:e,model:t,deep:n,onClose:r}){let i=L({queryKey:[`sl-validate`,e,t,n],queryFn:()=>B.get(`/semantic-layer/validate`,{query:{project:e,model:t,deep:n}})});return(0,I.jsxs)(Sm,{open:!0,onClose:r,title:`Validate · ${t}`,subtitle:n?`deep (Snowflake column probes)`:`structural checks only`,children:[i.isLoading?(0,I.jsx)(Q,{}):null,i.error?(0,I.jsx)(Z,{message:i.error.message}):null,i.data?(0,I.jsx)(Em,{data:i.data}):null]})}function jC({project:e,onClose:t,onCreated:n}){let[r,i]=(0,F.useState)(``),[a,o]=(0,F.useState)(``),[s,c]=(0,F.useState)(`Snowflake`),[l,u]=(0,F.useState)(null),d=R({mutationFn:()=>B.post(`/semantic-layer/models`,{project:e,name:r,description:a,sql_dialect:s}),onSuccess:e=>n(e.model?.name??r),onError:e=>u(e.message)});return(0,I.jsx)(Sm,{open:!0,onClose:t,title:`New semantic-layer model`,width:`40rem`,children:(0,I.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),u(null),d.mutate()},children:[(0,I.jsxs)(`label`,{className:`block text-xs text-zinc-500`,children:[`Name`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1`,value:r,onChange:e=>i(e.target.value),required:!0,placeholder:`core_metrics`})]}),(0,I.jsxs)(`label`,{className:`block text-xs text-zinc-500`,children:[`Description`,(0,I.jsx)(`textarea`,{className:`nerd-input w-full mt-1 h-20`,value:a,onChange:e=>o(e.target.value)})]}),(0,I.jsxs)(`label`,{className:`block text-xs text-zinc-500`,children:[`SQL dialect`,(0,I.jsxs)(`select`,{className:`nerd-input w-full mt-1`,value:s,onChange:e=>c(e.target.value),children:[(0,I.jsx)(`option`,{value:`Snowflake`,children:`Snowflake`}),(0,I.jsx)(`option`,{value:`BigQuery`,children:`BigQuery`})]})]}),l?(0,I.jsx)(Z,{message:l}):null,(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`button`,{type:`submit`,className:`nerd-btn hover:text-keboola`,disabled:d.isPending,children:d.isPending?`Creating…`:`Create model`}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn`,onClick:t,children:`Cancel`})]})]})})}function MC({project:e,model:t,activeTab:n,setActiveTab:r}){let i=L({queryKey:[`sl-show`,e,t],queryFn:()=>B.get(`/semantic-layer/show`,{query:{project:e,model:t}})}),a={metric:`metrics`,dataset:`datasets`,relationship:`relationships`,constraint:`constraints`,glossary:`glossary`},o=(0,F.useMemo)(()=>i.data?(i.data[a[n]]??[]).map(TC):[],[i.data,n]),s=(0,F.useMemo)(()=>i.data?(i.data.datasets??[]).map(e=>TC(e)):[],[i.data]);return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[DC.map(e=>{let t=i.data?i.data[a[e]]?.length??0:null,o=EC[e];return(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 ${n===e?`border-keboola text-keboola`:``}`,onClick:()=>r(e),children:[(0,I.jsx)(`span`,{children:o.pluralLabel}),t===null?null:(0,I.jsxs)(`span`,{className:`text-[10px] text-zinc-500`,children:[`(`,t,`)`]})]},e)}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs ml-auto hover:text-keboola`,onClick:()=>i.refetch(),disabled:i.isFetching,title:`Reload entities`,children:(0,I.jsx)(wr,{className:`w-3 h-3`})})]}),i.isLoading?(0,I.jsx)(Q,{}):null,i.error?(0,I.jsx)(Z,{message:i.error.message}):null,i.data?(0,I.jsx)(NC,{project:e,model:t,kind:n,rows:o,allDatasets:s,onChange:()=>i.refetch()}):null]})}function NC({project:e,model:t,kind:n,rows:r,allDatasets:i,onChange:a}){let o=EC[n],[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(null),[d,f]=(0,F.useState)(null),[p,m]=(0,F.useState)(``),[h,g]=(0,F.useState)(`table`),[_,v]=(0,F.useState)(``),y=(0,F.useMemo)(()=>{let e=r;if(n===`relationship`&&_&&(e=e.filter(e=>e.from===_||e.to===_)),p.trim()){let t=p.trim().toLowerCase();e=e.filter(e=>{for(let n of Object.values(e))if(typeof n==`string`&&n.toLowerCase().includes(t)||Array.isArray(n)&&n.some(e=>String(e).toLowerCase().includes(t)))return!0;return!1})}return e},[r,p,n,_]),b=R({mutationFn:r=>{let i=r[o.pkField];return B.delete(`/semantic-layer/items/${n}/${encodeURIComponent(i)}`,{query:{project:e,model:t}})},onSuccess:a}),x=e=>(0,I.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:t=>{t.stopPropagation(),u(e)},title:`Edit`,children:(0,I.jsx)(br,{className:`w-3 h-3`})}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-red-400 hover:border-red-700`,onClick:t=>{t.stopPropagation();let r=e[o.pkField];confirm(`Delete ${n} '${r}'?`)&&b.mutate(e)},title:`Delete`,children:(0,I.jsx)(Ir,{className:`w-3 h-3`})})]});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-3 flex-wrap gap-2`,children:[(0,I.jsxs)(`h3`,{className:`text-keboola font-bold text-sm`,children:[o.pluralLabel,` `,(0,I.jsx)(`span`,{className:`text-zinc-500 font-normal text-[10px]`,children:p||n===`relationship`&&_?`${y.length} / ${r.length}`:r.length})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsxs)(`label`,{className:`relative`,children:[(0,I.jsx)(Er,{className:`w-3 h-3 absolute left-2 top-1/2 -translate-y-1/2 text-zinc-500`}),(0,I.jsx)(`input`,{type:`text`,value:p,onChange:e=>m(e.target.value),placeholder:`Search…`,className:`nerd-input text-xs pl-6 w-44`})]}),n===`relationship`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`select`,{className:`nerd-input text-xs py-1`,value:_,onChange:e=>v(e.target.value),title:`Filter relationships touching a specific dataset`,children:[(0,I.jsx)(`option`,{value:``,children:`(all datasets)`}),i.map(e=>e.table_id||``).filter(Boolean).sort((e,t)=>e.localeCompare(t)).map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs px-1.5 ${h===`table`?`border-keboola text-keboola`:``}`,onClick:()=>g(`table`),title:`Table view`,children:(0,I.jsx)(Nr,{className:`w-3 h-3`})}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs px-1.5 ${h===`graph`?`border-keboola text-keboola`:``}`,onClick:()=>g(`graph`),title:`ER diagram view`,children:(0,I.jsx)(gr,{className:`w-3 h-3`})})]})]}):null,(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs flex items-center gap-1 hover:text-keboola`,onClick:()=>c(!0),children:[(0,I.jsx)(Sr,{className:`w-3 h-3`}),` Add `,n]})]})]}),r.length===0?(0,I.jsx)(wm,{title:`No ${o.pluralLabel.toLowerCase()} yet`}):n===`relationship`&&h===`graph`?(0,I.jsx)(WC,{datasets:i,relationships:y,onPickEdge:e=>u(e)}):n===`constraint`?(0,I.jsx)(BC,{rows:y,onRowClick:e=>f(e),renderRowActions:x}):(0,I.jsx)(Dm,{rows:y,rowKey:e=>e[o.pkField]??JSON.stringify(e).slice(0,32),onRowClick:e=>f(e),columns:[...o.tableColumns,{header:``,align:`right`,cell:x}]})]}),s?(0,I.jsx)(PC,{mode:`add`,project:e,model:t,kind:n,initial:null,onClose:()=>c(!1),onSaved:()=>{c(!1),a()}}):null,l?(0,I.jsx)(PC,{mode:`edit`,project:e,model:t,kind:n,initial:l,onClose:()=>u(null),onSaved:()=>{u(null),a()}}):null,d?(0,I.jsx)(Sm,{open:!0,onClose:()=>f(null),title:`${n} · ${d[o.pkField]??`(no name)`}`,children:n===`dataset`?(0,I.jsx)(LC,{row:d}):(0,I.jsx)(Em,{data:d})}):null]})}function PC({mode:e,project:t,model:n,kind:r,initial:i,onClose:a,onSaved:o}){let s=EC[r],c=tn(),[l,u]=(0,F.useState)(()=>{if(e===`edit`&&i){let e={};for(let t of s.fields){let n=i[t.key];n!==void 0&&(e[t.key]=n)}return e}return{}}),[d,f]=(0,F.useState)(null),p=R({mutationFn:()=>{let a={project:t,model:n};for(let t of s.fields)e===`edit`&&t.editKey?l[t.key]!==void 0&&(a[t.editKey]=l[t.key]):a[t.key]=l[t.key];for(let t of s.fields){if(t.type!==`list`)continue;let n=e===`edit`&&t.editKey?t.editKey:t.key,r=a[n];typeof r==`string`&&(a[n]=r.split(/[,\n]/).map(e=>e.trim()).filter(Boolean))}if(e===`add`)return B.post(`/semantic-layer/items/${r}`,a);let o=i?.[s.pkField];return B.put(`/semantic-layer/items/${r}/${encodeURIComponent(o)}`,a)},onSuccess:()=>{c.invalidateQueries({queryKey:[`sl-show`,t,n]}),o()},onError:e=>f(e.message)}),m=i?.[s.pkField];return(0,I.jsx)(Sm,{open:!0,onClose:a,title:e===`add`?`Add ${r}`:`Edit ${r} · ${m??`(no id)`}`,width:`44rem`,children:(0,I.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),f(null),p.mutate()},children:[s.fields.map(t=>(0,I.jsx)(FC,{field:t,mode:e,value:l[t.key],onChange:e=>u(n=>({...n,[t.key]:e}))},t.key)),d?(0,I.jsx)(Z,{message:d}):null,(0,I.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,I.jsx)(`button`,{type:`submit`,className:`nerd-btn hover:text-keboola`,disabled:p.isPending,children:p.isPending?`Saving…`:e===`add`?`Add`:`Save changes`}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn`,onClick:a,children:`Cancel`})]})]})})}function FC({field:e,mode:t,value:n,onChange:r}){let i=t===`add`&&e.required,a=(0,I.jsxs)(`span`,{className:`block text-xs text-zinc-500`,children:[e.label,i?(0,I.jsx)(`span`,{className:`text-red-500 ml-1`,children:`*`}):null]}),o=e.help?(0,I.jsx)(`span`,{className:`block text-[10px] text-zinc-500 dark:text-zinc-600 mt-0.5`,children:e.help}):null;return e.type===`boolean`?(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-500`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:!!n,onChange:e=>r(e.target.checked)}),e.label,e.help?(0,I.jsxs)(`span`,{className:`text-zinc-400`,children:[`— `,e.help]}):null]}):e.type===`select`?(0,I.jsxs)(`label`,{className:`block`,children:[a,(0,I.jsxs)(`select`,{className:`nerd-input w-full mt-1`,value:n??``,onChange:e=>r(e.target.value),required:i,children:[(0,I.jsx)(`option`,{value:``,children:`(unset)`}),e.options?.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]}),o]}):e.type===`textarea`?(0,I.jsxs)(`label`,{className:`block`,children:[a,(0,I.jsx)(`textarea`,{className:`nerd-input w-full mt-1 h-24`,value:n??``,onChange:e=>r(e.target.value),placeholder:e.placeholder,required:i}),o]}):e.type===`list`?(0,I.jsxs)(`label`,{className:`block`,children:[a,(0,I.jsx)(`textarea`,{className:`nerd-input w-full mt-1 h-16`,value:Array.isArray(n)?n.join(`, `):n??``,onChange:e=>r(e.target.value),placeholder:e.placeholder}),o]}):(0,I.jsxs)(`label`,{className:`block`,children:[a,(0,I.jsx)(`input`,{type:`text`,className:`nerd-input w-full mt-1`,value:n??``,onChange:e=>r(e.target.value),placeholder:e.placeholder,required:i}),o]})}function IC({role:e}){return e?(0,I.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] border ${e===`key`?`bg-keboola/10 text-keboola border-keboola/30`:e===`measure`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/30`:`bg-zinc-200/30 text-zinc-600 dark:text-zinc-400 border-zinc-300`}`,children:e}):(0,I.jsx)(`span`,{className:`text-zinc-500 text-[10px]`,children:`—`})}function LC({row:e}){let t=e.fields??[],n=e.ai?.keywords??[],r=e.table_id||e.tableId||``,i=e.fqn||``,a=e.grain||``,o=e.primary_key||e.primaryKey||[];return(0,I.jsxs)(`div`,{className:`space-y-4 text-xs`,children:[(0,I.jsxs)(`div`,{className:`grid md:grid-cols-2 gap-3`,children:[(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-zinc-500`,children:`Storage table`}),(0,I.jsx)(`div`,{className:`font-mono`,children:r||`(unset)`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-zinc-500`,children:`FQN`}),(0,I.jsx)(`div`,{className:`font-mono break-all`,children:i||`(derived from table_id)`})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-zinc-500`,children:`Grain`}),(0,I.jsx)(`div`,{children:a||(0,I.jsx)(`span`,{className:`text-zinc-500 italic`,children:`(not set)`})})]}),(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-zinc-500`,children:`Primary key`}),(0,I.jsx)(`div`,{className:`font-mono`,children:o.length>0?o.join(`, `):(0,I.jsx)(`span`,{className:`text-zinc-500 italic`,children:`(none)`})})]})]}),e.description?(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-zinc-500`,children:`Description`}),(0,I.jsx)(`div`,{className:`text-zinc-700 dark:text-zinc-300`,children:e.description})]}):null,n.length>0?(0,I.jsxs)(`div`,{className:`space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-widest text-zinc-500`,children:`AI keywords`}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:n.map(e=>(0,I.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-keboola/10 text-keboola text-[10px]`,children:e},e))})]}):null,(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`div`,{className:`text-[10px] uppercase tracking-widest text-zinc-500 mb-1`,children:[`Fields (`,t.length,`)`]}),t.length===0?(0,I.jsx)(`div`,{className:`text-zinc-500 italic`,children:`No fields. Re-run add with --deep-fields to populate from Snowflake.`}):(0,I.jsx)(`div`,{className:`border border-zinc-200 dark:border-zinc-900 rounded overflow-hidden`,children:(0,I.jsxs)(`table`,{className:`w-full text-[11px]`,children:[(0,I.jsx)(`thead`,{className:`bg-zinc-100 dark:bg-zinc-900 text-zinc-500`,children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{className:`text-left px-2 py-1 font-normal`,children:`Name`}),(0,I.jsx)(`th`,{className:`text-left px-2 py-1 font-normal`,children:`Type`}),(0,I.jsx)(`th`,{className:`text-left px-2 py-1 font-normal`,children:`Role`}),(0,I.jsx)(`th`,{className:`text-left px-2 py-1 font-normal`,children:`Description`})]})}),(0,I.jsx)(`tbody`,{children:t.map((e,t)=>(0,I.jsxs)(`tr`,{className:`border-t border-zinc-200 dark:border-zinc-900`,children:[(0,I.jsx)(`td`,{className:`px-2 py-1 font-mono`,children:e.name||`—`}),(0,I.jsx)(`td`,{className:`px-2 py-1 font-mono text-zinc-500`,children:e.type||`—`}),(0,I.jsx)(`td`,{className:`px-2 py-1`,children:(0,I.jsx)(IC,{role:e.role})}),(0,I.jsx)(`td`,{className:`px-2 py-1 text-zinc-600 dark:text-zinc-400`,children:e.description||``})]},`${e.name}-${t}`))})]})})]}),(0,I.jsxs)(`details`,{className:`text-[11px]`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-zinc-500`,children:`Raw response`}),(0,I.jsx)(`div`,{className:`mt-2`,children:(0,I.jsx)(Em,{data:e,maxHeight:`40vh`})})]})]})}var RC=[`inequality`,`equality`,`range`,`composition`,`exclusion`,`temporal`,`conditional`];function zC({severity:e}){return e===`critical`||e===`error`?(0,I.jsx)(Bn,{className:`w-3 h-3 text-red-500`}):e===`warning`?(0,I.jsx)(Lr,{className:`w-3 h-3 text-amber-500`}):(0,I.jsx)(or,{className:`w-3 h-3 text-zinc-500`})}function BC({rows:e,onRowClick:t,renderRowActions:n}){let r=(0,F.useMemo)(()=>{let t={};for(let n of e){let e=n.constraint_type||`(untyped)`;(t[e]??=[]).push(n)}return t},[e]),i=(0,F.useMemo)(()=>Object.keys(r).sort((e,t)=>{let n=RC.indexOf(e),r=RC.indexOf(t);return n===-1&&r===-1?e.localeCompare(t):n===-1?1:r===-1?-1:n-r}),[r]);return e.length===0?(0,I.jsx)(wm,{title:`No constraints match the current filter`}):(0,I.jsx)(`div`,{className:`space-y-3`,children:i.map(e=>{let i=r[e];return(0,I.jsxs)(`details`,{open:!0,className:`border border-zinc-200 dark:border-zinc-900 rounded`,children:[(0,I.jsxs)(`summary`,{className:`cursor-pointer select-none px-3 py-2 text-xs font-bold bg-zinc-50 dark:bg-zinc-950 flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`nerd-pill text-[10px]`,children:e}),(0,I.jsxs)(`span`,{className:`text-zinc-500 font-normal`,children:[`(`,i.length,`)`]})]}),(0,I.jsx)(`table`,{className:`w-full text-xs`,children:(0,I.jsx)(`tbody`,{children:i.map((e,r)=>(0,I.jsxs)(`tr`,{className:`border-t border-zinc-200 dark:border-zinc-900 cursor-pointer hover:bg-zinc-50 dark:hover:bg-zinc-950`,onClick:()=>t(e),children:[(0,I.jsx)(`td`,{className:`px-3 py-1.5 align-top`,children:(0,I.jsx)(zC,{severity:e.severity})}),(0,I.jsx)(`td`,{className:`px-2 py-1.5 align-top font-bold w-1/4`,children:e.name}),(0,I.jsx)(`td`,{className:`px-2 py-1.5 align-top`,children:(0,I.jsx)(`code`,{className:`text-zinc-600 dark:text-zinc-400 break-all`,children:e.rule})}),(0,I.jsx)(`td`,{className:`px-2 py-1.5 align-top text-right`,children:n(e)})]},`${e.name}-${r}`))})})]},e)})})}function VC(e){return e.replace(/"/g,`#quot;`).replace(/\n/g,` `).replace(/`/g,`'`)}function HC(e){return e.replace(/[^A-Za-z0-9_]/g,`_`).replace(/^_+/,``)}var UC=80;function WC({datasets:e,relationships:t,onPickEdge:n}){let{theme:r}=fi(),i=(0,F.useRef)(null),a=(0,F.useRef)(null),o=(0,F.useRef)(0),[s,c]=(0,F.useState)(null),[l,u]=(0,F.useState)(``),[d,f]=(0,F.useState)(1),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(!1),_=t.slice(0,UC),v=()=>{let e=h?a.current:i.current,t=e?.querySelector(`svg`),n=e?.parentElement;if(!t||!n)return;let r=t.getAttribute(`viewBox`)?.split(/\s+/).map(Number);if(!r||r.length!==4)return;let[,,o,s]=r;if(!o||!s)return;let c=(n.clientWidth-32)/o,l=(n.clientHeight-32)/s;f(Math.max(.4,Math.min(2.5,Math.min(c,l))))};(0,F.useEffect)(()=>{if(!i.current)return;let t=!1,n=new Map;for(let t of e){let e=t.table_id||``,r=t.name||e;e&&n.set(e,r)}for(let e of _)for(let t of[e.from,e.to])t&&!n.has(t)&&n.set(t,t);let s=[`flowchart TB`];for(let[e,t]of n)s.push(` ${HC(e)}["${VC(t)}"]`);for(let e of _){let t=e.from,n=e.to;if(!t||!n)continue;let r=e.type||`left`,i=r===`inner`?`==>`:`-->`;s.push(` ${HC(t)} ${i}|"${VC(r)}"| ${HC(n)}`)}let l=s.join(`
|
|
99
|
+
`);u(l),PS.initialize({startOnLoad:!1,theme:r===`dark`?`dark`:`default`,securityLevel:`loose`,themeVariables:{fontFamily:`ui-monospace, SFMono-Regular, Menlo, monospace`}}),o.current+=1;let d=`sl_erd_${Date.now()}_${o.current}`;return PS.render(d,l).then(({svg:e})=>{if(t)return;let n=e.replace(/max-width:[^;"]+;?/g,``).replace(/\swidth="[^"]+"/,``).replace(/\sheight="[^"]+"/,``).replace(/<svg /,`<svg preserveAspectRatio="xMidYMid meet" style="width:100%;height:100%;display:block;" `);for(let e of[i.current,a.current])e&&(e.innerHTML=n);c(null),p||v()}).catch(e=>{if(!t){for(let e of[i.current,a.current])e&&(e.innerHTML=``);c(e.message)}}),()=>{t=!0}},[e,_,r,h]);let y=(0,I.jsxs)(`div`,{className:`flex items-center gap-1 text-xs`,children:[(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs px-1.5`,onClick:()=>{m(!0),f(e=>Math.max(.4,e/1.25))},title:`Zoom out`,children:(0,I.jsx)(Gr,{className:`w-3 h-3`})}),(0,I.jsxs)(`span`,{className:`text-[10px] text-zinc-500 min-w-[3rem] text-center font-mono`,children:[Math.round(d*100),`%`]}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs px-1.5`,onClick:()=>{m(!0),f(e=>Math.min(4,e*1.25))},title:`Zoom in`,children:(0,I.jsx)(Wr,{className:`w-3 h-3`})}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs px-1.5`,onClick:()=>{m(!1),v()},title:`Fit to viewport`,children:(0,I.jsx)(Tr,{className:`w-3 h-3`})}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs px-1.5`,onClick:()=>{m(!1),g(e=>!e)},title:h?`Exit fullscreen`:`Open in fullscreen`,children:h?(0,I.jsx)(mr,{className:`w-3 h-3`}):(0,I.jsx)(fr,{className:`w-3 h-3`})})]}),b=(0,I.jsx)(`div`,{className:`w-full overflow-auto border border-zinc-200 dark:border-zinc-900 rounded p-2 bg-white dark:bg-zinc-950`,style:{height:`70vh`},children:(0,I.jsx)(`div`,{ref:i,style:{width:`${d*100}%`,height:`${d*100}%`,minWidth:`100%`,minHeight:`100%`}})});return(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between flex-wrap gap-2`,children:[(0,I.jsx)(`div`,{className:`text-[11px] text-amber-500 flex items-center gap-1`,children:t.length>UC?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Lr,{className:`w-3.5 h-3.5`}),` Showing the first`,` `,UC,` of `,t.length,` relationships. Use the dataset filter above to drill into a subgraph.`]}):(0,I.jsxs)(`span`,{className:`text-zinc-500`,children:[`Rendering `,_.length,` relationship`,_.length===1?``:`s`,`. Click an edge in the list below to edit it.`]})}),y]}),s?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(Z,{message:`ER diagram failed to render: ${s}`}),(0,I.jsxs)(`details`,{className:`text-[10px]`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-zinc-500`,children:`Mermaid source`}),(0,I.jsx)(`pre`,{className:`mt-1 p-2 bg-zinc-50 dark:bg-zinc-950 rounded overflow-auto max-h-72`,children:l})]})]}):null,b,(0,I.jsxs)(`details`,{className:`text-[11px]`,children:[(0,I.jsxs)(`summary`,{className:`cursor-pointer text-zinc-500`,children:[`Edge list (`,_.length,`) — click to edit`]}),(0,I.jsx)(`ul`,{className:`mt-1 space-y-0.5 max-h-72 overflow-auto`,children:_.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:`text-left hover:text-keboola`,children:[(0,I.jsx)(`span`,{className:`font-mono`,children:e.from}),(0,I.jsx)(`span`,{className:`mx-1 text-zinc-500`,children:`→`}),(0,I.jsx)(`span`,{className:`font-mono`,children:e.to}),(0,I.jsx)(`span`,{className:`ml-2 text-zinc-500`,children:e.on})]})},e.name))})]}),h?(0,I.jsx)(Sm,{open:!0,onClose:()=>g(!1),title:`ER diagram (fullscreen)`,subtitle:`${_.length} relationship${_.length===1?``:`s`} · ${Math.round(d*100)}% zoom`,width:`95vw`,actions:y,children:(0,I.jsx)(`div`,{className:`w-full overflow-auto border border-zinc-200 dark:border-zinc-900 rounded p-2 bg-white dark:bg-zinc-950`,style:{height:`85vh`},children:(0,I.jsx)(`div`,{ref:a,style:{width:`${d*100}%`,height:`${d*100}%`,minWidth:`100%`,minHeight:`100%`}})})}):null]})}function GC({reason:e,onSubmit:t,onCancel:n}){let[r,i]=(0,F.useState)(``),a=(0,F.useRef)(null);return(0,F.useEffect)(()=>{a.current?.focus()},[]),(0,I.jsx)(`div`,{className:`fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4`,children:(0,I.jsxs)(`form`,{className:`nerd-card w-full max-w-md space-y-3 border-keboola/40`,onSubmit:e=>{e.preventDefault(),r.trim()&&t(r.trim())},children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`h3`,{className:`font-bold text-keboola flex items-center gap-2`,children:[(0,I.jsx)(dr,{className:`w-4 h-4`}),` Manage token required`]}),(0,I.jsx)(`button`,{type:`button`,className:`text-zinc-500 hover:text-zinc-200`,onClick:n,children:(0,I.jsx)(Ur,{className:`w-4 h-4`})})]}),(0,I.jsx)(`p`,{className:`text-xs text-zinc-400`,children:e}),(0,I.jsx)(`p`,{className:`text-xs text-zinc-600`,children:`Sent only for THIS request. Not stored anywhere, not logged.`}),(0,I.jsx)(`input`,{ref:a,type:`password`,className:`nerd-input w-full`,placeholder:`KBC manage API token`,value:r,onChange:e=>i(e.target.value),required:!0}),(0,I.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:n,children:`Cancel`}),(0,I.jsx)(`button`,{type:`submit`,className:`nerd-btn hover:text-keboola`,disabled:!r.trim(),children:`Submit`})]})]})})}function KC(){let{project:e}=Zr(),t=tn(),[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)(null),[c,l]=(0,F.useState)(null),u=R({mutationFn:async({action:t,manageToken:n})=>{if(!e)throw Error(`No project selected`);if(t.type===`list`){let i=await B.get(`/members/${encodeURIComponent(e)}`,{query:{include_pending:t.include_pending},manageToken:n});return r(i.members),i}if(t.type===`invite`)return B.post(`/members/${encodeURIComponent(e)}/invite`,{email:t.email,role:t.role,reason:t.reason},{manageToken:n});if(t.type===`remove`)return B.post(`/members/${encodeURIComponent(e)}/remove`,{email:t.email},{manageToken:n});if(t.type===`set-role`)return B.post(`/members/${encodeURIComponent(e)}/set-role`,{email:t.email,role:t.role},{manageToken:n});throw Error(`unknown action`)},onError:e=>a(e.message),onSuccess:()=>{t.invalidateQueries({queryKey:[`members`]}),a(null)}});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Project members`,description:`Manage members of ${e??`(no project)`} -- requires a manage token.`,actions:(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,disabled:!e,onClick:()=>l({email:``,role:`guest`,reason:``}),children:[(0,I.jsx)(zr,{className:`w-3 h-3`}),` Invite`]})}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn`,disabled:!e,onClick:()=>s({type:`list`,include_pending:!0}),children:`Load members`}),e?null:(0,I.jsx)(wm,{title:`Select a project`}),i?(0,I.jsx)(Z,{message:i}):null,u.isPending?(0,I.jsx)(Q,{}):null,n?(0,I.jsx)(Dm,{rows:n,rowKey:e=>String(e.id??e.email??Math.random()),columns:[{header:`Email`,cell:e=>(0,I.jsx)(`span`,{children:String(e.email??``)})},{header:`Name`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-400`,children:String(e.name??``)})},{header:`Role`,cell:e=>(0,I.jsx)(`span`,{className:`nerd-pill`,children:String(e.role??``)})}]}):null,c?(0,I.jsxs)(`form`,{className:`nerd-card space-y-3`,onSubmit:e=>{e.preventDefault(),s({type:`invite`,email:c.email,role:c.role,reason:c.reason}),l(null)},children:[(0,I.jsx)(`h3`,{className:`font-bold text-keboola`,children:`Invite member`}),(0,I.jsx)(`input`,{className:`nerd-input w-full`,placeholder:`email`,value:c.email,onChange:e=>l({...c,email:e.target.value})}),(0,I.jsxs)(`select`,{className:`nerd-input w-full`,value:c.role,onChange:e=>l({...c,role:e.target.value}),children:[(0,I.jsx)(`option`,{children:`admin`}),(0,I.jsx)(`option`,{children:`guest`}),(0,I.jsx)(`option`,{children:`readOnly`}),(0,I.jsx)(`option`,{children:`share`})]}),(0,I.jsx)(`input`,{className:`nerd-input w-full`,placeholder:`reason (optional)`,value:c.reason,onChange:e=>l({...c,reason:e.target.value})}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`button`,{type:`submit`,className:`nerd-btn hover:text-keboola`,children:`Continue → manage token`}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn`,onClick:()=>l(null),children:`Cancel`})]})]}):null,o?(0,I.jsx)(GC,{reason:`Action: ${o.type}`,onCancel:()=>s(null),onSubmit:e=>{let t=o;s(null),u.mutate({action:t,manageToken:e})}}):null]})}function qC(){let[e,t]=(0,F.useState)(`https://connection.keboola.com`),[n,r]=(0,F.useState)(``),[i,a]=(0,F.useState)(``),[o,s]=(0,F.useState)(!0),[c,l]=(0,F.useState)(!1),[u,d]=(0,F.useState)(null),f=R({mutationFn:({manageToken:t})=>B.post(`/org/setup`,{stack_url:e,org_id:n?Number(n):null,project_ids:i?i.split(`,`).map(e=>Number(e.trim())).filter(Boolean):null,dry_run:o},{manageToken:t}),onSuccess:e=>d(e)});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Organization setup`,description:`Bulk-register every project in an org -- requires a manage token / PAT.`}),(0,I.jsxs)(`form`,{className:`nerd-card space-y-3`,onSubmit:e=>{e.preventDefault(),l(!0)},children:[(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400`,children:[`Stack URL`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1`,value:e,onChange:e=>t(e.target.value)})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400`,children:[`Org ID (org-admin mode)`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1`,value:n,onChange:e=>r(e.target.value),placeholder:`12345`})]})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`OR Project IDs (PAT mode, comma-separated)`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1`,value:i,onChange:e=>a(e.target.value),placeholder:`123, 456, 789`})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-400`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(e.target.checked)}),`Dry run (preview without applying)`]}),(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsxs)(`button`,{type:`submit`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,children:[(0,I.jsx)(lr,{className:`w-3 h-3`}),` `,f.isPending?`running...`:`Run setup`]})})]}),f.error?(0,I.jsx)(Z,{message:f.error.message}):null,u?(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`h3`,{className:`font-bold text-keboola mb-2`,children:`Result`}),(0,I.jsx)(Em,{data:u})]}):null,c?(0,I.jsx)(GC,{reason:`Org setup needs a Keboola manage token (or PAT) to enumerate projects and create storage tokens.`,onCancel:()=>l(!1),onSubmit:e=>{l(!1),f.mutate({manageToken:e})}}):null]})}function JC(){let e=tn(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(null),a=L({queryKey:[`projects`],queryFn:()=>B.get(`/projects`)}),o=L({queryKey:[`projects-status`],queryFn:()=>B.get(`/projects/status`)});(0,F.useEffect)(()=>{o.data&&e.invalidateQueries({queryKey:[`projects`]})},[o.data,e]);let s=R({mutationFn:e=>B.delete(`/projects/${encodeURIComponent(e)}`),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})}),c=R({mutationFn:e=>B.post(`/projects/use/${encodeURIComponent(e)}`),onSuccess:()=>e.invalidateQueries({queryKey:[`projects`]})}),l=new Map(o.data?.status?.map(e=>[e.alias,e])??[]);return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Projects`,description:`Keboola projects registered in this kbagent config.`,actions:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1`,onClick:()=>e.invalidateQueries({queryKey:[`projects-status`]}),children:[(0,I.jsx)(wr,{className:`w-3 h-3`}),` Refresh status`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>n(e=>!e),children:[(0,I.jsx)(Sr,{className:`w-3 h-3`}),` Add project`]})]})}),t?(0,I.jsx)(XC,{onDone:()=>{n(!1),e.invalidateQueries({queryKey:[`projects`]})}}):null,a.isLoading?(0,I.jsx)(Q,{}):null,a.error?(0,I.jsx)(Z,{message:a.error.message}):a.data?.projects.length===0?(0,I.jsx)(wm,{title:`No projects configured`,hint:`Click 'Add project' to register your first Keboola project.`}):(0,I.jsx)(Dm,{rows:a.data?.projects??[],rowKey:e=>e.alias,onRowClick:e=>i(e),columns:[{header:`Alias`,cell:e=>(0,I.jsxs)(`span`,{className:`font-bold text-zinc-900 dark:text-zinc-100`,children:[e.alias,` `,e.is_default?(0,I.jsx)(`span`,{className:`nerd-pill-green`,children:`default`}):null]})},{header:`Org`,cell:e=>e.org_name?(0,I.jsx)(`span`,{className:`text-zinc-700 dark:text-zinc-300`,children:e.org_name}):e.org_id==null?(0,I.jsx)(`span`,{className:`text-zinc-400`,title:"Org info unavailable — older stacks omit the organization block from /v2/storage/tokens/verify. Use `kbagent org setup` to populate via the Manage API.",children:`—`}):(0,I.jsxs)(`span`,{className:`text-zinc-500 font-mono`,title:`Organization #${e.org_id}. Name unknown — Storage API only exposes the id. Run \`kbagent org setup --org-id ${e.org_id} --url <stack>\` to populate the name.`,children:[`#`,e.org_id]})},{header:`Project`,cell:e=>(0,I.jsx)(`span`,{children:e.project_name})},{header:`ID`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500`,children:e.project_id??`-`})},{header:`Stack`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500 text-xs`,children:e.stack_url})},{header:`Status`,cell:e=>{let t=l.get(e.alias);return t?t.status===`ok`?(0,I.jsxs)(`span`,{className:`nerd-pill-green flex items-center gap-1 w-fit`,children:[(0,I.jsx)(Rn,{className:`w-3 h-3`}),` `,t.response_time_ms,`ms`]}):(0,I.jsxs)(`span`,{className:`nerd-pill-red flex items-center gap-1 w-fit`,children:[(0,I.jsx)(Bn,{className:`w-3 h-3`}),` `,t.error_code]}):(0,I.jsx)(`span`,{className:`text-zinc-600`,children:`-`})}},{header:`Token`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500 text-xs`,children:e.token})},{header:``,align:`right`,cell:e=>(0,I.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[e.is_default?null:(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:t=>{t.stopPropagation(),c.mutate(e.alias)},children:`Make default`}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-red-400 hover:border-red-700`,onClick:t=>{t.stopPropagation(),confirm(`Remove project '${e.alias}' from kbagent?`)&&s.mutate(e.alias)},children:(0,I.jsx)(Ir,{className:`w-3 h-3`})})]})}]}),r?(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,I.jsxs)(`h3`,{className:`font-bold text-keboola`,children:[`Project: `,r.alias]}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs`,onClick:()=>i(null),children:`Close`})]}),(0,I.jsx)(YC,{alias:r.alias})]}):null]})}function YC({alias:e}){let t=L({queryKey:[`project-info`,e],queryFn:()=>B.get(`/projects/${encodeURIComponent(e)}/info`)});return t.isLoading?(0,I.jsx)(Q,{}):t.error?(0,I.jsx)(Z,{message:t.error.message}):(0,I.jsx)(Em,{data:t.data})}function XC({onDone:e}){let[t,n]=(0,F.useState)(``),[r,i]=(0,F.useState)(`https://connection.keboola.com`),[a,o]=(0,F.useState)(``),[s,c]=(0,F.useState)(null),l=R({mutationFn:()=>B.post(`/projects`,{alias:t,stack_url:r,token:a}),onSuccess:()=>{e(),n(``),o(``)},onError:e=>{c((e instanceof ei,e.message))}});return(0,I.jsxs)(`form`,{className:`nerd-card space-y-3`,onSubmit:e=>{e.preventDefault(),c(null),l.mutate()},children:[(0,I.jsx)(`h3`,{className:`font-bold text-keboola`,children:`Add new project`}),(0,I.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400`,children:[`Alias`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1`,value:t,onChange:e=>n(e.target.value),required:!0,placeholder:`my-project`})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400`,children:[`Stack URL`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1`,value:r,onChange:e=>i(e.target.value),required:!0})]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400`,children:[`Storage Token`,(0,I.jsx)(`input`,{type:`password`,className:`nerd-input w-full mt-1`,value:a,onChange:e=>o(e.target.value),required:!0,placeholder:`123-12345-...`})]})]}),s?(0,I.jsx)(`div`,{className:`text-red-400 text-xs`,children:s}):null,(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`button`,{type:`submit`,disabled:l.isPending,className:`nerd-btn hover:text-keboola`,children:l.isPending?`Adding...`:`Add project`}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn`,onClick:e,children:`Cancel`})]})]})}function ZC(){let{project:e,branchId:t}=Zr(),n=L({queryKey:[`schedules`,e,t],queryFn:()=>B.get(`/schedules`,{query:{project:e?[e]:void 0,branch_id:t??void 0}}),enabled:!!e});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Schedules`,description:`Cron-based job triggers across the platform.`}),n.isLoading?(0,I.jsx)(Q,{}):null,n.error?(0,I.jsx)(Z,{message:n.error.message}):null,(0,I.jsx)(Dm,{rows:n.data?.schedules??[],rowKey:e=>`${e.project_alias}/${e.schedule_id}`,columns:[{header:`Project`,cell:e=>(0,I.jsx)(`span`,{className:`text-keboola`,children:e.project_alias})},{header:`Schedule ID`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500`,children:e.schedule_id})},{header:`Cron`,cell:e=>(0,I.jsx)(`span`,{className:`font-bold text-accent`,children:e.cron_tab})},{header:`TZ`,cell:e=>(0,I.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e.timezone})},{header:`State`,cell:e=>e.state===`enabled`?(0,I.jsx)(`span`,{className:`nerd-pill-green`,children:`enabled`}):(0,I.jsx)(`span`,{className:`nerd-pill`,children:`disabled`})},{header:`Target`,cell:e=>e.target?(0,I.jsxs)(`span`,{className:`text-xs`,children:[(0,I.jsx)(`span`,{className:`text-accent`,children:e.target.component_id}),` / `,e.target.config_id]}):(0,I.jsx)(`span`,{className:`text-xs text-zinc-600`,children:`-`})}]})]})}function QC(){let[e,t]=(0,F.useState)(``),[n,r]=(0,F.useState)(`textual`),[i,a]=(0,F.useState)([]),[o,s]=(0,F.useState)(null),c=R({mutationFn:()=>B.get(`/search`,{query:{query:e,search_type:n,type:i.length?i:void 0}}),onSuccess:e=>s(e)});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Search`,description:`Global search across all registered projects.`}),(0,I.jsxs)(`form`,{className:`nerd-card flex gap-2 flex-wrap`,onSubmit:t=>{t.preventDefault(),e.trim()&&c.mutate()},children:[(0,I.jsx)(`input`,{className:`nerd-input flex-1 min-w-[260px]`,placeholder:`search query...`,value:e,onChange:e=>t(e.target.value)}),(0,I.jsxs)(`select`,{className:`nerd-input`,value:n,onChange:e=>r(e.target.value),children:[(0,I.jsx)(`option`,{value:`textual`,children:`textual (name)`}),(0,I.jsx)(`option`,{value:`config-based`,children:`config-based (body)`})]}),(0,I.jsxs)(`select`,{className:`nerd-input`,multiple:!0,size:3,value:i,onChange:e=>a(Array.from(e.target.selectedOptions,e=>e.value)),children:[(0,I.jsx)(`option`,{value:`bucket`,children:`bucket`}),(0,I.jsx)(`option`,{value:`table`,children:`table`}),(0,I.jsx)(`option`,{value:`config`,children:`config`}),(0,I.jsx)(`option`,{value:`flow`,children:`flow`}),(0,I.jsx)(`option`,{value:`data-app`,children:`data-app`}),(0,I.jsx)(`option`,{value:`transformation`,children:`transformation`})]}),(0,I.jsxs)(`button`,{type:`submit`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,children:[(0,I.jsx)(Er,{className:`w-3 h-3`}),` `,c.isPending?`searching...`:`Search`]})]}),c.error?(0,I.jsx)(Z,{message:c.error.message}):null,o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`text-xs text-zinc-500`,children:[o.stats.results_found,` hit(s) across `,o.stats.projects_searched,` project(s)`]}),(0,I.jsx)(Dm,{rows:o.results,rowKey:e=>`${e.project_alias}/${e.type}/${e.id}`,columns:[{header:`Project`,cell:e=>(0,I.jsx)(`span`,{className:`text-keboola`,children:e.project_alias})},{header:`Type`,cell:e=>(0,I.jsx)(`span`,{className:`nerd-pill`,children:e.type})},{header:`Name`,cell:e=>(0,I.jsx)(`span`,{className:`font-bold`,children:e.name})},{header:`ID`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500`,children:e.id})},{header:`Component`,cell:e=>e.component_id??``}]})]}):null]})}function $C(){let e=L({queryKey:[`sharing-all`],queryFn:()=>B.get(`/sharing`)});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Bucket sharing`,description:`Buckets shared across the org or to specific projects/users.`}),e.isLoading?(0,I.jsx)(Q,{}):null,e.error?(0,I.jsx)(Z,{message:e.error.message}):null,(0,I.jsx)(Dm,{rows:e.data?.shared_buckets??[],rowKey:e=>`${e.source_project_id}/${e.source_bucket_id}`,columns:[{header:`Source project`,cell:e=>(0,I.jsx)(`span`,{className:`text-keboola`,children:e.source_project_id})},{header:`Bucket`,cell:e=>(0,I.jsx)(`span`,{className:`text-accent`,children:e.source_bucket_id})},{header:`Name`,cell:e=>(0,I.jsx)(`span`,{children:e.source_bucket_name})},{header:`Type`,cell:e=>(0,I.jsx)(`span`,{className:`nerd-pill`,children:e.sharing_type})}]})]})}function ew(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024**3).toFixed(2)} GB`}function tw(){let{project:e,branchId:t}=Zr(),[n,r]=(0,F.useState)(`buckets`),[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)(null),c=L({queryKey:[`buckets`,e,t],queryFn:()=>B.get(`/storage/buckets`,{query:{project:e??void 0,branch_id:t??void 0}}),enabled:!!e}),l=L({queryKey:[`tables`,e,i,t],queryFn:()=>B.get(`/storage/tables`,{query:{project:e??void 0,bucket_id:i??void 0,branch_id:t??void 0}}),enabled:!!e&&n===`tables`});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Storage`,description:`Buckets, tables and files in ${e??`(no project)`}`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[[`buckets`,`tables`,`files`].map(e=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn ${n===e?`border-keboola text-keboola`:``}`,onClick:()=>r(e),children:e},e)),i?(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-amber-700 dark:hover:text-amber-400`,onClick:()=>a(null),children:[`✕ filter: `,i]}):null]}),e?n===`buckets`?c.isLoading?(0,I.jsx)(Q,{}):c.error?(0,I.jsx)(Z,{message:c.error.message}):(0,I.jsx)(Dm,{rows:c.data?.buckets??[],rowKey:e=>`${e.project_alias}/${e.id}`,onRowClick:e=>{a(e.id),r(`tables`)},columns:[{header:`Bucket`,cell:e=>(0,I.jsxs)(`span`,{className:`font-bold text-accent`,children:[e.id,` `,e.is_linked?(0,I.jsx)(`span`,{className:`nerd-pill-amber`,children:`linked`}):null]})},{header:`Stage`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-600 dark:text-zinc-400`,children:e.stage})},{header:`Backend`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-600 dark:text-zinc-400`,children:e.backend})},{header:`Rows`,align:`right`,cell:e=>e.rows_count.toLocaleString()},{header:`Size`,align:`right`,cell:e=>ew(e.data_size_bytes)}]}):n===`tables`?l.isLoading?(0,I.jsx)(Q,{}):l.error?(0,I.jsx)(Z,{message:l.error.message}):(0,I.jsx)(Dm,{rows:l.data?.tables??[],rowKey:e=>`${e.project_alias}/${e.id}`,onRowClick:e=>s(e),columns:[{header:`Table`,cell:e=>(0,I.jsx)(`span`,{className:`text-accent`,children:e.id})},{header:`Name`,cell:e=>e.display_name},{header:`Bucket`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500`,children:e.bucket_id})},{header:`Rows`,align:`right`,cell:e=>e.rows_count.toLocaleString()},{header:`Size`,align:`right`,cell:e=>ew(e.data_size_bytes)},{header:`Last import`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500 text-xs`,children:e.last_import_date})}]}):(0,I.jsx)(sw,{}):(0,I.jsx)(wm,{title:`Select a project from the top bar`}),(0,I.jsx)(nw,{table:o,onClose:()=>s(null)})]})}function nw({table:e,onClose:t}){let{branchId:n}=Zr(),[r,i]=(0,F.useState)(`info`),a=L({queryKey:[`table-detail`,e?.project_alias,e?.id,n],queryFn:()=>B.get(`/storage/table-detail/${encodeURIComponent(e.project_alias)}/${encodeURIComponent(e.id)}`,{query:{branch_id:n??void 0}}),enabled:!!e}),o=L({queryKey:[`table-preview`,e?.project_alias,e?.id],queryFn:()=>B.get(`/storage/table-preview/${encodeURIComponent(e.project_alias)}/${encodeURIComponent(e.id)}`,{query:{limit:100}}),enabled:!!e&&r===`preview`}),s=e?`/api/storage/table-download/${encodeURIComponent(e.project_alias)}/${encodeURIComponent(e.id)}${n?`?branch_id=${n}`:``}`:`#`;return(0,I.jsx)(Sm,{open:!!e,onClose:t,title:e?.id??``,subtitle:e?`${e.rows_count.toLocaleString()} rows ・ ${ew(e.data_size_bytes)} ・ ${e.is_alias?`alias`:`table`}`:void 0,width:`max-w-5xl`,actions:(0,I.jsxs)(`a`,{href:s,download:!0,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,children:[(0,I.jsx)(qn,{className:`w-3 h-3`}),` CSV`]}),children:(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(`div`,{className:`flex gap-2`,children:[`info`,`schema`,`preview`,`raw`].map(e=>(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs ${r===e?`border-keboola text-keboola`:``}`,onClick:()=>i(e),children:[e===`info`?(0,I.jsx)(or,{className:`w-3 h-3 inline mr-1`}):e===`preview`?(0,I.jsx)(Xn,{className:`w-3 h-3 inline mr-1`}):null,e]},e))}),a.isLoading?(0,I.jsx)(Q,{}):null,a.error?(0,I.jsx)(Z,{message:a.error.message}):null,a.data&&r===`info`?(0,I.jsx)(rw,{d:a.data}):null,a.data&&r===`schema`?(0,I.jsx)(aw,{d:a.data}):null,r===`preview`?o.isLoading?(0,I.jsx)(Q,{label:`loading 100 rows...`}):o.error?(0,I.jsx)(Z,{message:o.error.message}):o.data?(0,I.jsx)(ow,{p:o.data}):null:null,a.data&&r===`raw`?(0,I.jsx)(Em,{data:a.data}):null]})})}function rw({d:e}){return(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsx)(iw,{label:`Bucket`,value:e.bucket_id,mono:!0}),(0,I.jsx)(iw,{label:`Name`,value:e.name}),e.description?(0,I.jsx)(iw,{label:`Description`,value:e.description}):null,(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,I.jsx)(iw,{label:`Rows`,value:e.rows_count.toLocaleString()}),(0,I.jsx)(iw,{label:`Size`,value:ew(e.data_size_bytes)}),(0,I.jsx)(iw,{label:`Primary key`,value:e.primary_key.length?e.primary_key.join(`, `):`-`,mono:!0}),(0,I.jsx)(iw,{label:`Columns`,value:String(e.columns.length)}),(0,I.jsx)(iw,{label:`Created`,value:e.created,mono:!0}),(0,I.jsx)(iw,{label:`Last import`,value:e.last_import_date||`-`,mono:!0})]})]})}function iw({label:e,value:t,mono:n=!1}){return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500 mb-1`,children:e}),(0,I.jsx)(`div`,{className:`text-sm ${n?`font-mono text-accent`:`text-zinc-800 dark:text-zinc-200`}`,children:t})]})}function aw({d:e}){return(0,I.jsx)(`div`,{className:`overflow-auto`,children:(0,I.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{className:`border-b border-zinc-200 dark:border-zinc-800 text-zinc-500 uppercase tracking-wider`,children:[(0,I.jsx)(`th`,{className:`px-3 py-2 text-left font-normal`,children:`Column`}),(0,I.jsx)(`th`,{className:`px-3 py-2 text-left font-normal`,children:`Type`}),(0,I.jsx)(`th`,{className:`px-3 py-2 text-left font-normal`,children:`Native`}),(0,I.jsx)(`th`,{className:`px-3 py-2 text-left font-normal`,children:`Length`}),(0,I.jsx)(`th`,{className:`px-3 py-2 text-center font-normal`,children:`Null`}),(0,I.jsx)(`th`,{className:`px-3 py-2 text-center font-normal`,children:`PK`}),(0,I.jsx)(`th`,{className:`px-3 py-2 text-left font-normal`,children:`Default`}),(0,I.jsx)(`th`,{className:`px-3 py-2 text-left font-normal`,children:`Description`})]})}),(0,I.jsx)(`tbody`,{children:e.column_details.map(t=>(0,I.jsxs)(`tr`,{className:`border-b border-zinc-200 dark:border-zinc-900/50`,children:[(0,I.jsx)(`td`,{className:`px-3 py-2 font-bold text-accent`,children:t.name}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-zinc-600 dark:text-zinc-400`,children:t.type??`-`}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-zinc-500`,children:t.native_type??`-`}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-zinc-500`,children:t.length??`-`}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-center`,children:t.nullable===void 0?`-`:t.nullable?`✓`:``}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-center`,children:e.primary_key.includes(t.name)?`🔑`:``}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-zinc-500`,children:t.default??`-`}),(0,I.jsx)(`td`,{className:`px-3 py-2 text-zinc-600 dark:text-zinc-400 text-xs`,children:t.description??``})]},t.name))})]})})}function ow({p:e}){let[t,n]=(0,F.useState)(()=>e.header.map(()=>``)),[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(`asc`);if(e.row_count===0)return(0,I.jsx)(wm,{title:`Table is empty (no rows returned)`});let s=e.rows.filter(e=>t.every((t,n)=>!t||e[n]?.toLowerCase().includes(t.toLowerCase())));r!==null&&(s=[...s].sort((e,t)=>{let n=e[r]??``,i=t[r]??``,o=Number(n),s=Number(i),c=!Number.isNaN(o)&&!Number.isNaN(s)?o-s:n.localeCompare(i);return a===`asc`?c:-c}));let c=e=>{r===e?o(e=>e===`asc`?`desc`:`asc`):(i(e),o(`asc`))};return(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`text-xs text-zinc-500 flex justify-between items-center`,children:[(0,I.jsxs)(`span`,{children:[`Showing `,s.length,` of `,e.row_count,` row(s)`,r===null?null:(0,I.jsxs)(`span`,{className:`ml-2 text-zinc-500 dark:text-zinc-600`,children:[`・ sorted by `,e.header[r],` `,a===`asc`?`↑`:`↓`]})]}),t.some(e=>e)||r!==null?(0,I.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 hover:text-keboola`,onClick:()=>{n(e.header.map(()=>``)),i(null)},children:`clear filters + sort`}):null]}),(0,I.jsxs)(`div`,{className:`overflow-auto border border-zinc-200 dark:border-zinc-800 rounded`,children:[(0,I.jsxs)(`table`,{className:`w-full text-xs font-mono`,children:[(0,I.jsxs)(`thead`,{className:`bg-zinc-100 dark:bg-zinc-900/60 sticky top-0`,children:[(0,I.jsx)(`tr`,{children:e.header.map((e,t)=>(0,I.jsx)(`th`,{className:`px-3 py-1.5 text-left text-keboola border-b border-zinc-200 dark:border-zinc-800 whitespace-nowrap cursor-pointer hover:bg-zinc-200 dark:hover:bg-zinc-900`,onClick:()=>c(t),children:(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e,(0,I.jsx)(`span`,{className:`text-zinc-500 dark:text-zinc-600 text-[10px]`,children:r===t?a===`asc`?`↑`:`↓`:`↕`})]})},t))}),(0,I.jsx)(`tr`,{className:`bg-zinc-50 dark:bg-zinc-950`,children:e.header.map((e,r)=>(0,I.jsx)(`th`,{className:`px-2 py-1 border-b border-zinc-200 dark:border-zinc-800 font-normal`,children:(0,I.jsx)(`input`,{type:`text`,placeholder:`filter...`,value:t[r],onChange:e=>{let i=[...t];i[r]=e.target.value,n(i)},className:`w-full bg-transparent border border-zinc-200 dark:border-zinc-800 rounded px-1 py-0.5 text-[10px] text-zinc-700 dark:text-zinc-300 focus:outline-none focus:border-keboola`})},r))})]}),(0,I.jsx)(`tbody`,{children:s.map((e,t)=>(0,I.jsx)(`tr`,{className:`border-b border-zinc-200 dark:border-zinc-900/40 hover:bg-zinc-100 dark:hover:bg-zinc-900/30`,children:e.map((e,t)=>(0,I.jsx)(`td`,{className:`px-3 py-1 text-zinc-700 dark:text-zinc-300 whitespace-nowrap`,children:e},t))},t))})]}),s.length===0?(0,I.jsx)(`div`,{className:`text-center text-xs text-zinc-500 py-6`,children:`No rows match the active filters.`}):null]})]})}function sw(){let{project:e}=Zr(),t=L({queryKey:[`files`,e],queryFn:()=>B.get(`/storage/files`,{query:{project:e??void 0,limit:50}}),enabled:!!e});if(t.isLoading)return(0,I.jsx)(Q,{});if(t.error)return(0,I.jsx)(Z,{message:t.error.message});let n=t.data?.files??[];return n.length===0?(0,I.jsx)(wm,{title:`No files in this project`}):(0,I.jsx)(Dm,{rows:n,rowKey:e=>String(e.id),columns:[{header:`ID`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500`,children:String(e.id)})},{header:`Name`,cell:e=>(0,I.jsx)(`span`,{children:String(e.name??``)})},{header:`Size`,align:`right`,cell:e=>String(e.sizeBytes??e.size_bytes??``)},{header:`Tags`,cell:e=>(0,I.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e.tags?.join(`, `)??``})},{header:`Created`,cell:e=>(0,I.jsx)(`span`,{className:`text-xs text-zinc-500`,children:String(e.created??``)})}]})}function cw(e){return e==null?void 0:String(e)}function lw(){let{project:e,branchId:t}=Zr(),n=tn(),[r,i]=(0,F.useState)(null),[a,o]=(0,F.useState)(!1),s=L({queryKey:[`streams`,e,t],queryFn:()=>B.get(`/stream/${encodeURIComponent(e??``)}/list`,{query:{branch:cw(t)}}),enabled:!!e}),c=R({mutationFn:n=>B.post(`/stream/${encodeURIComponent(e??``)}/delete`,{source_id:n,branch_id:cw(t)}),onSuccess:()=>{n.invalidateQueries({queryKey:[`streams`]}),i(null)}});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`Data Streams`,description:`OpenTelemetry / OTLP ingest sources in ${e??`(no project)`}. Telemetry lands in the in.c-otlp-<source> bucket via auto-provisioned logs/metrics/traces sinks.`,actions:(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,disabled:!e,onClick:()=>o(!0),children:[(0,I.jsx)(Sr,{className:`w-3 h-3`}),` New source`]})}),c.error?(0,I.jsx)(Z,{message:`Delete failed: ${c.error.message}`}):null,e?s.isLoading?(0,I.jsx)(Q,{}):s.error?(0,I.jsx)(Z,{message:s.error.message}):(0,I.jsx)(Dm,{rows:s.data?.sources??[],rowKey:e=>e.source_id,onRowClick:e=>i(e),emptyMessage:`No Data Streams sources yet. Create one to get an OTLP ingest endpoint.`,columns:[{header:`Name`,cell:e=>(0,I.jsx)(`span`,{className:`font-bold text-accent`,children:e.name})},{header:`Source ID`,cell:e=>(0,I.jsx)(`span`,{className:`font-mono text-zinc-500 text-xs`,children:e.source_id})},{header:`Type`,cell:e=>(0,I.jsx)(`span`,{className:`nerd-pill uppercase`,children:e.type||`?`})},{header:`Endpoint`,cell:e=>e.base_endpoint?(0,I.jsx)(`span`,{className:`font-mono text-zinc-600 dark:text-zinc-400 text-xs break-all`,children:e.base_endpoint}):(0,I.jsx)(`span`,{className:`text-xs text-zinc-500 dark:text-zinc-600`,children:`-`})},{header:``,align:`right`,cell:e=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-red-600 hover:border-red-300 dark:hover:text-red-400 dark:hover:border-red-700`,onClick:t=>{t.stopPropagation(),confirm(`Delete Data Stream source '${e.name}' (${e.source_id})?\n\nThis removes the source and its sinks. Data already in Storage stays.`)&&c.mutate(e.source_id)},title:`Delete source`,children:(0,I.jsx)(Ir,{className:`w-3 h-3`})})}]}):(0,I.jsx)(wm,{title:`Select a project`}),a&&e?(0,I.jsx)(uw,{project:e,branchId:t,onClose:()=>o(!1),onCreated:e=>{o(!1),n.invalidateQueries({queryKey:[`streams`]});let t=s.data?.sources.find(t=>t.source_id===e);i(t??{source_id:e,name:e,type:`otlp`,description:``,base_endpoint:``})}}):null,r&&e?(0,I.jsx)(dw,{project:e,branchId:t,source:r,onClose:()=>i(null),onDelete:e=>{confirm(`Delete Data Stream source '${e}'?`)&&c.mutate(e)}}):null]})}function uw({project:e,branchId:t,onClose:n,onCreated:r}){let[i,a]=(0,F.useState)(``),[o,s]=(0,F.useState)(`otlp`),[c,l]=(0,F.useState)(!0),[u,d]=(0,F.useState)(!1),[f,p]=(0,F.useState)(null),m=R({mutationFn:()=>B.post(`/stream/${encodeURIComponent(e)}/create-source`,{name:i,source_type:o,branch_id:cw(t),provision_sinks:c,if_not_exists:u}),onSuccess:e=>r(e.source_id),onError:e=>p(e.message)});return(0,I.jsx)(Sm,{open:!0,onClose:n,title:`New Data Stream source`,subtitle:`Project: ${e}. Creates an ingest source and (for OTLP) the logs/metrics/traces sinks.`,width:`max-w-xl`,actions:(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-keboola`,disabled:!i.trim()||m.isPending,onClick:()=>{p(null),m.mutate()},children:[(0,I.jsx)(Cr,{className:`w-3 h-3 inline mr-1`}),m.isPending?`creating...`:`Create`]}),children:(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`label`,{className:`text-xs text-zinc-600 dark:text-zinc-400 block`,children:[`Name`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1 font-mono`,value:i,onChange:e=>a(e.target.value),placeholder:`my-telemetry`,required:!0}),(0,I.jsx)(`span`,{className:`text-zinc-500 dark:text-zinc-600`,children:`Used in the source id and the OTLP ingest URL path.`})]}),(0,I.jsxs)(`div`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Type`,(0,I.jsx)(`div`,{className:`flex gap-2 mt-1`,children:[`otlp`,`http`].map(e=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs uppercase ${o===e?`border-keboola text-keboola`:``}`,onClick:()=>s(e),children:e},e))}),(0,I.jsx)(`span`,{className:`text-zinc-500 dark:text-zinc-600`,children:o===`otlp`?`OpenTelemetry Protocol -- logs, metrics, and traces over http/protobuf.`:`Generic HTTP ingest source.`})]}),o===`otlp`?(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked)}),`Auto-provision logs / metrics / traces sinks (recommended -- without them data has nowhere to land)`]}):null,(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:u,onChange:e=>d(e.target.checked)}),`If-not-exists (reuse an existing source with the same name instead of erroring)`]}),f?(0,I.jsx)(Z,{message:f}):null]})})}function dw({project:e,branchId:t,source:n,onClose:r,onDelete:i}){let[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(`overview`),l=L({queryKey:[`stream-detail`,e,n.source_id,t,a],queryFn:()=>B.get(`/stream/${encodeURIComponent(e)}/detail`,{query:{source_id:n.source_id,branch:cw(t),reveal:a}})}),u=l.data,d=u?Object.entries(u.signal_endpoints??{}):[],f=u?Object.entries(u.destination?.tables??{}):[];return(0,I.jsxs)(Sm,{open:!0,onClose:r,title:n.name,subtitle:`${n.type||`?`} source ・ ${n.source_id}`,width:`max-w-4xl`,actions:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 ${a?`border-amber-400 text-amber-600 dark:text-neon-amber`:`hover:text-keboola`}`,onClick:()=>o(e=>!e),title:a?`Hide the secret in the endpoint URL`:`Reveal the secret embedded in the OTLP endpoint URL`,children:[a?(0,I.jsx)(Yn,{className:`w-3.5 h-3.5`}):(0,I.jsx)(Xn,{className:`w-3.5 h-3.5`}),a?`Hide secret`:`Reveal secret`]}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-red-600 hover:border-red-300 dark:hover:text-red-400 dark:hover:border-red-700`,onClick:()=>i(n.source_id),children:[(0,I.jsx)(Ir,{className:`w-3.5 h-3.5`}),` Delete`]})]}),children:[l.isLoading?(0,I.jsx)(Q,{}):null,l.error?(0,I.jsx)(Z,{message:l.error.message}):null,u?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`flex gap-2 mb-4`,children:[(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs ${s===`overview`?`border-keboola text-keboola`:``}`,onClick:()=>c(`overview`),children:`Overview`}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs ${s===`raw`?`border-keboola text-keboola`:``}`,onClick:()=>c(`raw`),children:`Raw JSON`})]}),s===`overview`?(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-bold text-keboola mb-3`,children:`Source`}),(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,I.jsx)(pw,{label:`Source ID`,value:u.source_id,mono:!0}),(0,I.jsx)(pw,{label:`Name`,value:u.name}),(0,I.jsx)(pw,{label:`Type`,value:u.type}),(0,I.jsx)(pw,{label:`Protocol`,value:u.protocol||`-`,mono:!0}),(0,I.jsx)(pw,{label:`Branch`,value:u.branch_id,mono:!0}),(0,I.jsx)(pw,{label:`Description`,value:u.description||`-`})]})]}),(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-bold text-keboola`,children:`Ingest endpoint`}),u.secret_revealed?(0,I.jsx)(`span`,{className:`nerd-pill-amber text-[10px]`,children:`secret revealed`}):(0,I.jsx)(`span`,{className:`nerd-pill text-[10px]`,children:`secret masked`})]}),(0,I.jsx)(fw,{url:u.endpoint}),u.secret_revealed?null:(0,I.jsxs)(`div`,{className:`text-[11px] text-zinc-500 dark:text-zinc-600 mt-2`,children:[`The OTLP URL embeds a write secret (masked as `,(0,I.jsx)(`code`,{children:`***`}),`). Use "Reveal secret" to copy the full URL into your OTLP exporter -- treat it like a credential.`]}),d.length>0?(0,I.jsxs)(`div`,{className:`mt-3 space-y-1`,children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500`,children:`Per-signal endpoints`}),d.map(([e,t])=>(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`nerd-pill text-[10px] w-16 shrink-0 justify-center`,children:e}),(0,I.jsx)(fw,{url:t})]},e))]}):null]}),(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-bold text-keboola mb-3`,children:`Destination`}),u.destination?.bucket||u.destination?.buckets?.length||f.length>0?(0,I.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[u.destination?.bucket?(0,I.jsx)(pw,{label:`Bucket`,value:u.destination.bucket,mono:!0}):u.destination?.buckets?.length?(0,I.jsx)(pw,{label:`Buckets`,value:u.destination.buckets.join(`, `),mono:!0}):null,f.map(([e,t])=>(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`nerd-pill text-[10px] w-16 shrink-0 justify-center`,children:e}),(0,I.jsx)(`span`,{className:`font-mono text-accent break-all`,children:t})]},e))]}):(0,I.jsx)(`div`,{className:`text-xs text-zinc-500`,children:`No sinks yet -- this source has no destination tables. For OTLP, create it with sink provisioning enabled.`})]}),u.import_conditions?(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-bold text-keboola mb-3`,children:`Import conditions`}),(0,I.jsx)(Em,{data:u.import_conditions})]}):null]}):(0,I.jsx)(Em,{data:u})]}):null]})}function fw({url:e}){let[t,n]=(0,F.useState)(!1);return e?(0,I.jsxs)(`div`,{className:`flex items-start gap-2 min-w-0`,children:[(0,I.jsx)(`code`,{className:`nerd-code flex-1 text-[11px] break-all`,children:e}),(0,I.jsx)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),window.setTimeout(()=>n(!1),1200)}catch{}},className:`nerd-btn text-[10px] shrink-0 ${t?`border-keboola text-keboola`:`hover:text-keboola hover:border-keboola/60`}`,title:`Copy endpoint to clipboard`,children:t?`✓`:(0,I.jsx)(Wn,{className:`w-3 h-3`})})]}):(0,I.jsx)(`span`,{className:`text-xs text-zinc-500 dark:text-zinc-600`,children:`-`})}function pw({label:e,value:t,mono:n=!1}){return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500`,children:e}),(0,I.jsx)(`div`,{className:`text-xs mt-0.5 ${n?`font-mono text-accent`:`text-zinc-800 dark:text-zinc-200`} break-all`,children:t||`—`})]})}function mw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hw(e){if(Array.isArray(e))return e}function gw(e,t,n){return(t=Tw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _w(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function vw(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
100
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yw(Object(n),!0).forEach(function(t){gw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xw(e,t){if(e==null)return{};var n,r,i=Sw(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Sw(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Cw(e,t){return hw(e)||_w(e,t)||Ew(e,t)||vw()}function ww(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Tw(e){var t=ww(e,`string`);return typeof t==`symbol`?t:t+``}function Ew(e,t){if(e){if(typeof e==`string`)return mw(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mw(e,t):void 0}}function Dw(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ow(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ow(Object(n),!0).forEach(function(t){Dw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ow(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Aw(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}}function jw(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function Mw(e){return{}.toString.call(e).includes(`Object`)}function Nw(e){return!Object.keys(e).length}function Pw(e){return typeof e==`function`}function Fw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Iw(e,t){return Mw(t)||Vw(`changeType`),Object.keys(t).some(function(t){return!Fw(e,t)})&&Vw(`changeField`),t}function Lw(e){Pw(e)||Vw(`selectorType`)}function Rw(e){Pw(e)||Mw(e)||Vw(`handlerType`),Mw(e)&&Object.values(e).some(function(e){return!Pw(e)})&&Vw(`handlersType`)}function zw(e){e||Vw(`initialIsRequired`),Mw(e)||Vw(`initialType`),Nw(e)&&Vw(`initialContent`)}function Bw(e,t){throw Error(e[t]||e.default)}var Vw=jw(Bw)({initialIsRequired:`initial state is required`,initialType:`initial state should be an object`,initialContent:`initial state shouldn't be an empty object`,handlerType:`handler should be an object or a function`,handlersType:`all handlers should be a functions`,selectorType:`selector should be a function`,changeType:`provided value of changes should be an object`,changeField:`it seams you want to change a field in the state which is not specified in the "initial" state`,default:"an unknown error accured in `state-local` package"}),Hw={changes:Iw,selector:Lw,handler:Rw,initial:zw};function Uw(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Hw.initial(e),Hw.handler(t);var n={current:e},r=jw(Kw)(n,t),i=jw(Gw)(n),a=jw(Hw.changes)(e),o=jw(Ww)(n);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return Hw.selector(e),e(n.current)}function c(e){Aw(r,i,a,o)(e)}return[s,c]}function Ww(e,t){return Pw(t)?t(e.current):t}function Gw(e,t){return e.current=kw(kw({},e.current),t),t}function Kw(e,t,n){return Pw(t)?t(e.current):Object.keys(n).forEach(function(n){return t[n]?.call(t,e.current[n])}),n}var qw={create:Uw},Jw={paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}};function Yw(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function Xw(e){return{}.toString.call(e).includes(`Object`)}function Zw(e){return e||tT(`configIsRequired`),Xw(e)||tT(`configType`),e.urls?(Qw(),{paths:{vs:e.urls.monacoBase}}):e}function Qw(){console.warn(eT.deprecation)}function $w(e,t){throw Error(e[t]||e.default)}var eT={configIsRequired:`the configuration object is required`,configType:`the configuration object should be an object`,default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
101
|
+
You are using deprecated way of configuration.
|
|
102
|
+
|
|
103
|
+
Instead of using
|
|
104
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
105
|
+
use
|
|
106
|
+
monaco.config({ paths: { vs: '...' } })
|
|
107
|
+
|
|
108
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
109
|
+
`},tT=Yw($w)(eT),nT={config:Zw},rT=function(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}};function iT(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],iT(e[n],t[n]))}),bw(bw({},e),t)}var aT={type:`cancelation`,msg:`operation is manually canceled`};function oT(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(aT):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var sT=[`monaco`],cT=Cw(qw.create({config:Jw,isInitialized:!1,resolve:null,reject:null,monaco:null}),2),lT=cT[0],uT=cT[1];function dT(e){var t=nT.config(e),n=t.monaco,r=xw(t,sT);uT(function(e){return{config:iT(e.config,r),monaco:n}})}function fT(){var e=lT(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(uT({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),oT(yT);if(window.monaco&&window.monaco.editor)return _T(window.monaco),e.resolve(window.monaco),oT(yT);rT(pT,hT)(gT)}return oT(yT)}function pT(e){return document.body.appendChild(e)}function mT(e){var t=document.createElement(`script`);return e&&(t.src=e),t}function hT(e){var t=lT(function(e){return{config:e.config,reject:e.reject}}),n=mT(`${t.config.paths.vs}/loader.js`);return n.onload=function(){return e()},n.onerror=t.reject,n}function gT(){var e=lT(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t([`vs/editor/editor.main`],function(t){var n=t.m||t;_T(n),e.resolve(n)},function(t){e.reject(t)})}function _T(e){lT().monaco||uT({monaco:e})}function vT(){return lT(function(e){return e.monaco})}var yT=new Promise(function(e,t){return uT({resolve:e,reject:t})}),bT={config:dT,init:fT,__getMonacoInstance:vT},xT={wrapper:{display:`flex`,position:`relative`,textAlign:`initial`},fullWidth:{width:`100%`},hide:{display:`none`}},ST={container:{display:`flex`,height:`100%`,width:`100%`,justifyContent:`center`,alignItems:`center`}};function CT({children:e}){return F.createElement(`div`,{style:ST.container},e)}var wT=CT;function TT({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:a,wrapperProps:o}){return F.createElement(`section`,{style:{...xT.wrapper,width:e,height:t},...o},!n&&F.createElement(wT,null,r),F.createElement(`div`,{ref:i,style:{...xT.fullWidth,...!n&&xT.hide},className:a}))}var ET=(0,F.memo)(TT);function DT(e){(0,F.useEffect)(e,[])}var OT=DT;function kT(e,t,n=!0){let r=(0,F.useRef)(!0);(0,F.useEffect)(r.current||!n?()=>{r.current=!1}:e,t)}var AT=kT;function jT(){}function MT(e,t,n,r){return NT(e,r)||PT(e,t,n,r)}function NT(e,t){return e.editor.getModel(FT(e,t))}function PT(e,t,n,r){return e.editor.createModel(t,n,r?FT(e,r):void 0)}function FT(e,t){return e.Uri.parse(t)}function IT({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:a,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:l=`light`,loading:u=`Loading...`,options:d={},height:f=`100%`,width:p=`100%`,className:m,wrapperProps:h={},beforeMount:g=jT,onMount:_=jT}){let[v,y]=(0,F.useState)(!1),[b,x]=(0,F.useState)(!0),S=(0,F.useRef)(null),C=(0,F.useRef)(null),w=(0,F.useRef)(null),T=(0,F.useRef)(_),E=(0,F.useRef)(g),D=(0,F.useRef)(!1);OT(()=>{let e=bT.init();return e.then(e=>(C.current=e)&&x(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>S.current?ee():e.cancel()}),AT(()=>{if(S.current&&C.current){let t=S.current.getOriginalEditor(),i=MT(C.current,e||``,r||n||`text`,a||``);i!==t.getModel()&&t.setModel(i)}},[a],v),AT(()=>{if(S.current&&C.current){let e=S.current.getModifiedEditor(),r=MT(C.current,t||``,i||n||`text`,o||``);r!==e.getModel()&&e.setModel(r)}},[o],v),AT(()=>{let e=S.current.getModifiedEditor();e.getOption(C.current.editor.EditorOption.readOnly)?e.setValue(t||``):t!==e.getValue()&&(e.executeEdits(``,[{range:e.getModel().getFullModelRange(),text:t||``,forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),AT(()=>{S.current?.getModel()?.original.setValue(e||``)},[e],v),AT(()=>{let{original:e,modified:t}=S.current.getModel();C.current.editor.setModelLanguage(e,r||n||`text`),C.current.editor.setModelLanguage(t,i||n||`text`)},[n,r,i],v),AT(()=>{C.current?.editor.setTheme(l)},[l],v),AT(()=>{S.current?.updateOptions(d)},[d],v);let O=(0,F.useCallback)(()=>{if(!C.current)return;E.current(C.current);let s=MT(C.current,e||``,r||n||`text`,a||``),c=MT(C.current,t||``,i||n||`text`,o||``);S.current?.setModel({original:s,modified:c})},[n,t,i,e,r,a,o]),k=(0,F.useCallback)(()=>{!D.current&&w.current&&(S.current=C.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...d}),O(),C.current?.editor.setTheme(l),y(!0),D.current=!0)},[d,l,O]);(0,F.useEffect)(()=>{v&&T.current(S.current,C.current)},[v]),(0,F.useEffect)(()=>{!b&&!v&&k()},[b,v,k]);function ee(){let e=S.current?.getModel();s||e?.original?.dispose(),c||e?.modified?.dispose(),S.current?.dispose()}return F.createElement(ET,{width:p,height:f,isEditorReady:v,loading:u,_ref:w,className:m,wrapperProps:h})}(0,F.memo)(IT);function LT(e){let t=(0,F.useRef)();return(0,F.useEffect)(()=>{t.current=e},[e]),t.current}var RT=LT,zT=new Map;function BT({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:a,theme:o=`light`,line:s,loading:c=`Loading...`,options:l={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:p=`100%`,height:m=`100%`,className:h,wrapperProps:g={},beforeMount:_=jT,onMount:v=jT,onChange:y,onValidate:b=jT}){let[x,S]=(0,F.useState)(!1),[C,w]=(0,F.useState)(!0),T=(0,F.useRef)(null),E=(0,F.useRef)(null),D=(0,F.useRef)(null),O=(0,F.useRef)(v),k=(0,F.useRef)(_),ee=(0,F.useRef)(),te=(0,F.useRef)(r),ne=RT(a),A=(0,F.useRef)(!1),j=(0,F.useRef)(!1);OT(()=>{let e=bT.init();return e.then(e=>(T.current=e)&&w(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>E.current?re():e.cancel()}),AT(()=>{let o=MT(T.current,e||r||``,t||i||``,a||n||``);o!==E.current?.getModel()&&(d&&zT.set(ne,E.current?.saveViewState()),E.current?.setModel(o),d&&E.current?.restoreViewState(zT.get(a)))},[a],x),AT(()=>{E.current?.updateOptions(l)},[l],x),AT(()=>{!E.current||r===void 0||(E.current.getOption(T.current.editor.EditorOption.readOnly)?E.current.setValue(r):r!==E.current.getValue()&&(j.current=!0,E.current.executeEdits(``,[{range:E.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),E.current.pushUndoStop(),j.current=!1))},[r],x),AT(()=>{let e=E.current?.getModel();e&&i&&T.current?.editor.setModelLanguage(e,i)},[i],x),AT(()=>{s!==void 0&&E.current?.revealLine(s)},[s],x),AT(()=>{T.current?.editor.setTheme(o)},[o],x);let M=(0,F.useCallback)(()=>{if(!(!D.current||!T.current)&&!A.current){k.current(T.current);let c=a||n,f=MT(T.current,r||e||``,t||i||``,c||``);E.current=T.current?.editor.create(D.current,{model:f,automaticLayout:!0,...l},u),d&&E.current.restoreViewState(zT.get(c)),T.current.editor.setTheme(o),s!==void 0&&E.current.revealLine(s),S(!0),A.current=!0}},[e,t,n,r,i,a,l,u,d,o,s]);(0,F.useEffect)(()=>{x&&O.current(E.current,T.current)},[x]),(0,F.useEffect)(()=>{!C&&!x&&M()},[C,x,M]),te.current=r,(0,F.useEffect)(()=>{x&&y&&(ee.current?.dispose(),ee.current=E.current?.onDidChangeModelContent(e=>{j.current||y(E.current.getValue(),e)}))},[x,y]),(0,F.useEffect)(()=>{if(x){let e=T.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=T.current.editor.getModelMarkers({resource:t});b?.(e)}});return()=>{e?.dispose()}}return()=>{}},[x,b]);function re(){ee.current?.dispose(),f?d&&zT.set(a,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()}return F.createElement(ET,{width:p,height:m,isEditorReady:x,loading:c,_ref:D,className:h,wrapperProps:g})}var VT=(0,F.memo)(BT);function HT(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`?!0:!!(e&&typeof e==`object`&&`message`in e&&String(e.message).toLowerCase().includes(`abort`))}function UT(){let{project:e}=Zr(),t=tn(),[n,r]=(0,F.useState)(null),[i,a]=(0,F.useState)(!1),o=L({queryKey:[`workspaces`,e],queryFn:()=>B.get(`/workspaces`,{query:{project:e??void 0}}),enabled:!!e}),s=R({mutationFn:({alias:e,id:t})=>B.delete(`/workspaces/${encodeURIComponent(e)}/${t}`),onSuccess:()=>{t.invalidateQueries({queryKey:[`workspaces`]}),r(null)}});return(0,I.jsxs)(`div`,{className:`space-y-4`,children:[(0,I.jsx)(Tm,{title:`SQL Workspaces`,description:`Run SQL against ${e??`(no project)`} via the Query Service. Workspaces are owned by you on the warehouse and stay alive until deleted.`,actions:(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,disabled:!e,onClick:()=>a(!0),children:[(0,I.jsx)(Sr,{className:`w-3 h-3`}),` New workspace`]})}),e?o.isLoading?(0,I.jsx)(Q,{}):o.error?(0,I.jsx)(Z,{message:o.error.message}):(0,I.jsx)(Dm,{rows:o.data?.workspaces??[],rowKey:e=>`${e.project_alias}/${e.id}`,onRowClick:e=>r(e),columns:[{header:`Name`,cell:e=>(0,I.jsx)(`span`,{className:`font-bold text-accent`,children:e.name})},{header:`ID`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-500`,children:e.id})},{header:`Backend`,cell:e=>e.backend},{header:`Schema`,cell:e=>(0,I.jsx)(`span`,{className:`text-zinc-600 dark:text-zinc-400`,children:e.schema})},{header:`Created`,cell:e=>(0,I.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e.created})},{header:``,align:`right`,cell:e=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-red-600 hover:border-red-300 dark:hover:text-red-400 dark:hover:border-red-700`,onClick:t=>{t.stopPropagation(),confirm(`Delete workspace ${e.name} (#${e.id})?`)&&s.mutate({alias:e.project_alias,id:e.id})},children:(0,I.jsx)(Ir,{className:`w-3 h-3`})})}]}):(0,I.jsx)(wm,{title:`Select a project`}),i&&e?(0,I.jsx)(qT,{project:e,onClose:()=>a(!1),onCreated:e=>{a(!1),t.invalidateQueries({queryKey:[`workspaces`]}),r(e)}}):null,n?(0,I.jsx)(WT,{workspace:n,onClose:()=>r(null),onDelete:e=>{confirm(`Delete workspace ${e.name}?`)&&s.mutate({alias:e.project_alias,id:e.id})}}):null]})}function WT({workspace:e,onClose:t,onDelete:n}){let[r,i]=(0,F.useState)(!1),[a,o]=(0,F.useState)(!1),s=R({mutationFn:()=>B.post(`/workspaces/${encodeURIComponent(e.project_alias)}/${e.id}/password`)});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Sm,{open:!0,onClose:t,title:e.name,subtitle:`workspace #${e.id} ・ ${e.backend} ・ schema ${e.schema}`,width:`max-w-4xl`,actions:(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola border-keboola/40`,onClick:()=>i(!0),children:[(0,I.jsx)(Hn,{className:`w-3.5 h-3.5`}),` Open SQL Editor`]}),children:(0,I.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-4`,children:[(0,I.jsxs)(`div`,{className:`lg:col-span-2 space-y-4`,children:[(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-bold text-keboola`,children:`Description`}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-pill text-[10px] hover:border-neon-pink hover:text-neon-pink`,title:`AI-generated description (not yet wired)`,disabled:!0,children:[(0,I.jsx)(Ar,{className:`w-3 h-3 inline mr-1`}),` Generate`]})]}),(0,I.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`No description yet. Workspaces are throwaway SQL sandboxes — document non-trivial ones so teammates know what they were for.`})]}),(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-bold text-keboola mb-3`,children:`Parameters`}),(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,I.jsx)(GT,{label:`Workspace ID`,value:String(e.id),mono:!0}),(0,I.jsx)(GT,{label:`Type`,value:e.backend}),(0,I.jsx)(GT,{label:`Schema`,value:e.schema,mono:!0}),(0,I.jsx)(GT,{label:`Host`,value:e.host,mono:!0}),(0,I.jsx)(GT,{label:`User`,value:e.user,mono:!0}),(0,I.jsx)(GT,{label:`Created`,value:e.created}),(0,I.jsx)(GT,{label:`Sandbox component`,value:e.component_id,mono:!0}),(0,I.jsx)(GT,{label:`Config ID`,value:e.config_id,mono:!0})]})]}),(0,I.jsxs)(`div`,{className:`nerd-card`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-bold text-keboola mb-3`,children:`Credentials`}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsx)(GT,{label:`Host`,value:e.host,mono:!0}),(0,I.jsx)(GT,{label:`User`,value:e.user,mono:!0}),(0,I.jsx)(GT,{label:`Schema`,value:e.schema,mono:!0}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-zinc-500`,children:`Password:`}),(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-keboola`,onClick:()=>{o(!0),s.mutate()},children:[(0,I.jsx)(cr,{className:`w-3 h-3 inline mr-1`}),` Reset & show`]}),a&&s.data?(0,I.jsx)(`code`,{className:`text-xs text-amber-700 dark:text-neon-amber font-mono`,children:s.data.password}):null]}),(0,I.jsx)(`div`,{className:`text-[11px] text-zinc-500 dark:text-zinc-600`,children:`Reset is the only way to retrieve a password — Keboola never stores the plaintext.`})]})]})]}),(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`w-full nerd-btn flex items-center gap-2 hover:text-keboola justify-start py-2`,onClick:()=>i(!0),children:[(0,I.jsx)(Hn,{className:`w-4 h-4 text-keboola`}),(0,I.jsx)(`span`,{children:`Open SQL Editor`})]}),(0,I.jsx)(KT,{icon:(0,I.jsx)(Rr,{className:`w-3.5 h-3.5`}),label:`Load tables`,hint:`Copy tables from Storage into this workspace`}),(0,I.jsx)(KT,{icon:(0,I.jsx)(Xn,{className:`w-3.5 h-3.5`}),label:`Browse storage`,hint:`(use SQL Editor → Storage Explorer sidebar)`}),(0,I.jsx)(KT,{icon:(0,I.jsx)(kr,{className:`w-3.5 h-3.5`}),label:`Enable sharing`,hint:`Share this workspace with the project`}),(0,I.jsx)(KT,{icon:(0,I.jsx)(Mn,{className:`w-3.5 h-3.5`}),label:`Run AI agent here`,hint:`Spawn an agent task scoped to this workspace`}),(0,I.jsx)(`hr`,{className:`border-zinc-100 dark:border-zinc-900 my-2`}),(0,I.jsxs)(`button`,{type:`button`,className:`w-full nerd-btn flex items-center gap-2 hover:text-red-600 hover:border-red-300 dark:hover:text-red-400 dark:hover:border-red-700 justify-start py-2 text-red-600 dark:text-red-400`,onClick:()=>n(e),children:[(0,I.jsx)(Ir,{className:`w-4 h-4`}),(0,I.jsx)(`span`,{children:`Delete workspace`})]})]})]})}),r?(0,I.jsx)(JT,{workspace:e,onClose:()=>i(!1)}):null]})}function GT({label:e,value:t,mono:n=!1}){return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500`,children:e}),(0,I.jsx)(`div`,{className:`text-xs mt-0.5 ${n?`font-mono text-accent`:`text-zinc-800 dark:text-zinc-200`} truncate`,children:t||`—`})]})}function KT({icon:e,label:t,hint:n,onClick:r}){let i=!r;return(0,I.jsxs)(`button`,{type:`button`,disabled:i,onClick:r,className:`w-full text-left p-2 rounded border border-zinc-100 dark:border-zinc-900 ${i?`text-zinc-500 dark:text-zinc-600 cursor-not-allowed`:`text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-900 hover:border-keboola/30`}`,title:i?`Not yet wired`:void 0,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,I.jsx)(`span`,{children:e}),(0,I.jsx)(`span`,{className:`font-medium`,children:t})]}),n?(0,I.jsx)(`div`,{className:`text-[10px] text-zinc-500 dark:text-zinc-600 mt-0.5 ml-5.5`,children:n}):null]})}function qT({project:e,onClose:t,onCreated:n}){let[r,i]=(0,F.useState)(`kbagent-${e}`),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(!1),[l,u]=(0,F.useState)(null),d=R({mutationFn:()=>B.post(`/workspaces/${encodeURIComponent(e)}`,{name:r,read_only:a,ui_mode:s}),onSuccess:e=>n(e),onError:e=>u(e.message)});return(0,I.jsx)(Sm,{open:!0,onClose:t,title:`New SQL workspace`,subtitle:`Project: ${e}. Workspaces persist on the warehouse and cost compute -- delete when done.`,width:`max-w-xl`,actions:(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-keboola`,disabled:!r.trim()||d.isPending,onClick:()=>{u(null),d.mutate()},children:[(0,I.jsx)(Kn,{className:`w-3 h-3 inline mr-1`}),d.isPending?`creating...`:`Create`]}),children:(0,I.jsxs)(`div`,{className:`space-y-3`,children:[(0,I.jsxs)(`label`,{className:`text-xs text-zinc-600 dark:text-zinc-400 block`,children:[`Name`,(0,I.jsx)(`input`,{className:`nerd-input w-full mt-1 font-mono`,value:r,onChange:e=>i(e.target.value),placeholder:`my-workspace`,required:!0}),(0,I.jsx)(`span`,{className:`text-zinc-500 dark:text-zinc-600`,children:`Visible on the warehouse and in the Keboola UI (if ui_mode).`})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked)}),`Read-only storage access (recommended for analysis -- prevents accidental writes to project tables)`]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),`UI mode (~15s, visible in Keboola UI's Workspaces tab) -- otherwise headless (~1s, only seen by kbagent)`]}),l?(0,I.jsx)(Z,{message:l}):null]})})}function JT({workspace:e,onClose:t}){let[n,r]=(0,F.useState)(`-- ${e.backend} workspace ・ schema: ${e.schema}
|
|
110
|
+
-- Click a table in the Storage Explorer (left) to insert it.
|
|
111
|
+
-- Query Service runs SELECT only; SHOW / DDL → INFORMATION_SCHEMA.
|
|
112
|
+
SELECT current_timestamp() AS now;`),[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)(null),[c,l]=(0,F.useState)(null),[u,d]=(0,F.useState)(`claude`),[f,p]=(0,F.useState)(null),m=L({queryKey:[`sql-buckets`,e.project_alias],queryFn:()=>B.get(`/storage/buckets`,{query:{project:e.project_alias}})}),h=L({queryKey:[`sql-tables`,e.project_alias],queryFn:()=>B.get(`/storage/tables`,{query:{project:e.project_alias}})}),g=R({mutationFn:()=>B.post(`/workspaces/${encodeURIComponent(e.project_alias)}/${e.id}/query`,{sql:n}),onSuccess:e=>{a(e),s(null),l(null)},onError:t=>{let r=t.message;s(r),a(null);let i=n.trim().toUpperCase();(r.includes(`422`)||r.toLowerCase().includes(`unprocessable`)||r.toLowerCase().includes(`not allowed`))&&(i.startsWith(`SHOW`)||i.startsWith(`DESCRIBE`)||i.startsWith(`DESC `)||i.startsWith(`CREATE`)||i.startsWith(`DROP`)||i.startsWith(`INSERT`)||i.startsWith(`UPDATE`)||i.startsWith(`DELETE`))&&l(e.backend===`snowflake`?`Query Service only runs SELECT. For SHOW TABLES / column listing on Snowflake, use:
|
|
113
|
+
SELECT TABLE_NAME, ROW_COUNT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = CURRENT_SCHEMA();`:e.backend===`bigquery`?"Query Service only runs SELECT. For BigQuery, list tables with:\n SELECT table_name FROM `<dataset>.INFORMATION_SCHEMA.TABLES`;":`Query Service only runs SELECT. Use INFORMATION_SCHEMA for catalog browsing.`)}}),_=t=>{let n=t.split(`.`).pop()??t,i=e.backend===`bigquery`?`\`${e.schema}\`.\`${n}\``:`"${n}"`;r(e=>`${e}\n${i}`)},v=new Map;for(let e of h.data?.tables??[]){let t=v.get(e.bucket_id)??[];t.push(e.id),v.set(e.bucket_id,t)}return(0,I.jsx)(Sm,{open:!0,onClose:t,title:`SQL ・ ${e.name}`,subtitle:`${e.backend} ・ ${e.schema} ・ workspace #${e.id}`,width:`max-w-7xl`,actions:(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn flex items-center gap-1 hover:text-keboola`,onClick:()=>g.mutate(),disabled:g.isPending,children:[(0,I.jsx)(xr,{className:`w-3 h-3`}),` `,g.isPending?`running...`:`Run (⌘↵)`]}),children:(0,I.jsxs)(`div`,{className:`flex gap-3 h-full`,children:[(0,I.jsxs)(`aside`,{className:`w-64 shrink-0 nerd-card overflow-y-auto`,style:{maxHeight:`75vh`},children:[(0,I.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-zinc-500 mb-2`,children:`Storage Explorer`}),m.isLoading||h.isLoading?(0,I.jsx)(Q,{label:`loading buckets...`}):(0,I.jsx)(`div`,{className:`space-y-2 text-xs`,children:(m.data?.buckets??[]).map(e=>(0,I.jsx)(YT,{bucketId:e.id,isLinked:e.is_linked??!1,sourceProjectName:e.source_project_name,tables:v.get(e.id)??[],onPick:_},e.id))})]}),(0,I.jsxs)(`div`,{className:`flex-1 space-y-3 min-w-0`,children:[(0,I.jsx)(eE,{cli:u,onCliChange:d,project:e.project_alias,workspaceId:e.id,backend:e.backend,schemaName:e.schema,draftSql:n,bucketIds:(m.data?.buckets??[]).map(e=>e.id),onApply:e=>r(e),request:f,onRequestConsumed:()=>p(null)}),(0,I.jsx)(`div`,{className:`border border-zinc-200 dark:border-zinc-800 rounded`,children:(0,I.jsx)(VT,{height:`280px`,language:`sql`,theme:`vs-dark`,value:n,onChange:e=>r(e??``),options:{fontSize:13,minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:`on`}})}),o?(0,I.jsxs)(`div`,{className:`nerd-card border-red-300 dark:border-red-700/40 text-red-600 dark:text-red-400 text-sm space-y-2`,children:[(0,I.jsx)(`div`,{children:o}),c?(0,I.jsxs)(`div`,{className:`text-amber-700 dark:text-amber-400 text-xs whitespace-pre-wrap`,children:[`Hint: `,c]}):null,(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs hover:text-neon-pink hover:border-neon-pink/60 flex items-center gap-1`,onClick:()=>p({seed:Date.now(),goal:`Fix this SQL — diagnose the warehouse error and return a corrected query. Pay attention to linked-bucket FQNs and column names.`,failedError:o}),title:`Open the AI SQL helper in fix mode using ${u}`,children:[(0,I.jsx)(Ar,{className:`w-3 h-3`}),` Send to `,u,` for fix`]})]}):null,i?(0,I.jsx)(XT,{result:i}):null]})]})})}function YT({bucketId:e,isLinked:t,sourceProjectName:n,tables:r,onPick:i}){let[a,o]=(0,F.useState)(!1);return(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`button`,{type:`button`,className:`w-full text-left flex items-center gap-1 px-1 py-0.5 hover:text-keboola`,onClick:()=>o(e=>!e),children:[(0,I.jsx)(`span`,{className:`text-zinc-500 dark:text-zinc-600`,children:a?`▾`:`▸`}),(0,I.jsx)(`span`,{className:`font-mono text-accent truncate`,children:e}),t?(0,I.jsx)(`span`,{className:`nerd-pill-amber text-[9px] flex-shrink-0`,title:n?`Linked from project '${n}'. Tables live in the source project's DB — use 'kbagent storage bucket-detail' for the correct SQL FQN.`:`Linked bucket — tables live in the source project's DB. Use 'kbagent storage bucket-detail' for the correct SQL FQN.`,children:`linked`}):null,(0,I.jsx)(`span`,{className:`text-[10px] text-zinc-500 dark:text-zinc-600 ml-auto`,children:r.length})]}),a&&r.length>0?(0,I.jsx)(`div`,{className:`ml-4 mt-1 space-y-0.5 border-l border-zinc-100 dark:border-zinc-900 pl-2`,children:r.map(e=>(0,I.jsx)(`button`,{type:`button`,className:`w-full text-left text-xs font-mono text-zinc-600 dark:text-zinc-400 hover:text-keboola truncate`,onClick:()=>i(e),title:`Click to insert ${e}`,children:e.split(`.`).pop()},e))}):null]})}function XT({result:e}){return(0,I.jsx)(`div`,{className:`space-y-3`,children:(e.statements??[]).map((e,t)=>(0,I.jsxs)(`div`,{className:`border border-zinc-200 dark:border-zinc-800 rounded`,children:[(0,I.jsxs)(`div`,{className:`px-3 py-2 border-b border-zinc-200 dark:border-zinc-800 text-xs flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`span`,{children:[`Statement `,t+1,` ・ `,e.status,` ・ `,e.rows_affected,` rows`]}),e.csv_data?(0,I.jsx)(QT,{csv:e.csv_data,index:t+1}):null]}),e.csv_data?(0,I.jsx)($T,{csv:e.csv_data}):(0,I.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`No result data.`})]},e.statement_id??t))})}function ZT({text:e,label:t}){let[n,r]=(0,F.useState)(!1);return(0,I.jsx)(`button`,{type:`button`,onClick:async t=>{t.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),window.setTimeout(()=>r(!1),1200)}catch{}},className:`nerd-btn text-[10px] ${n?`border-keboola text-keboola`:`hover:text-keboola hover:border-keboola/60`}`,title:`Copy ${t} to clipboard`,children:n?`✓ copied`:`⧉ copy`})}function QT({csv:e,index:t}){let[n,r]=(0,F.useState)(!1);return(0,I.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>{let n=new Blob([e],{type:`text/csv;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`query-result-${t}-${new Date().toISOString().slice(0,19).replace(/[:T]/g,``)}.csv`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)},className:`nerd-btn text-[10px] hover:text-keboola hover:border-keboola/60`,title:`Save the full result as a .csv file`,children:`⬇ CSV`}),(0,I.jsx)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e),r(!0),window.setTimeout(()=>r(!1),1200)}catch{}},className:`nerd-btn text-[10px] ${n?`border-keboola text-keboola`:`hover:text-keboola hover:border-keboola/60`}`,title:`Copy the full result as CSV to the clipboard`,children:n?`✓ copied`:`⧉ copy`})]})}function $T({csv:e}){let t=e.trim().split(`
|
|
114
|
+
`).map(e=>e.split(`,`).map(e=>e.replace(/^"|"$/g,``)));if(t.length===0)return null;let[n,...r]=t;return(0,I.jsxs)(`div`,{className:`overflow-auto`,style:{maxHeight:360},children:[(0,I.jsxs)(`table`,{className:`w-full text-xs font-mono`,children:[(0,I.jsx)(`thead`,{className:`bg-zinc-100 dark:bg-zinc-900/60`,children:(0,I.jsx)(`tr`,{children:n.map((e,t)=>(0,I.jsx)(`th`,{className:`px-3 py-1.5 text-left text-keboola border-b border-zinc-200 dark:border-zinc-800 whitespace-nowrap`,children:e},t))})}),(0,I.jsx)(`tbody`,{children:r.slice(0,200).map((e,t)=>(0,I.jsx)(`tr`,{className:`border-b border-zinc-200 dark:border-zinc-900/40`,children:e.map((e,t)=>(0,I.jsx)(`td`,{className:`px-3 py-1 text-zinc-700 dark:text-zinc-300 whitespace-nowrap`,children:e},t))},t))})]}),r.length>200?(0,I.jsxs)(`div`,{className:`text-xs text-zinc-500 px-3 py-1`,children:[`... `,r.length-200,` more rows`]}):null]})}function eE({cli:e,onCliChange:t,project:n,workspaceId:r,backend:i,schemaName:a,draftSql:o,bucketIds:s,onApply:c,request:l,onRequestConsumed:u}){let[d,f]=(0,F.useState)(!1),[p,m]=(0,F.useState)(``),[h,g]=(0,F.useState)(!1),[_,v]=(0,F.useState)(0),[y,b]=(0,F.useState)(``),[x,S]=(0,F.useState)(null),[C,w]=(0,F.useState)(null),[T,E]=(0,F.useState)(null),[D,O]=(0,F.useState)([]),[k,ee]=(0,F.useState)(!1),[te,ne]=(0,F.useState)(!0),[A,j]=(0,F.useState)(``),M=(0,F.useRef)(null);(0,F.useEffect)(()=>{l&&(f(!0),m(l.goal),j(l.failedError??``),u?.())},[l,u]);let re=()=>{b(``),S(null),w(null),v(0),E(null),O([])},N=()=>{if(!p.trim()){w(`Describe the query you want first (e.g. 'top 10 customers by revenue last 30 days').`);return}M.current&&=(M.current.abort(),null),re(),g(!0);let t=Date.now(),c=setInterval(()=>v(Math.round((Date.now()-t)/1e3)),500),l=``,u=ai(`/workspaces/sql/improve/stream`,{cli:e,goal:p,project:n,backend:i,schema_name:a,workspace_id:r,draft_sql:o,bucket_ids:s,failed_error:A},{init:e=>{let t=e??{};typeof t.meta_prompt==`string`&&E(t.meta_prompt)},stdout:e=>{let t=e??{};if(t.type===`assistant`&&typeof t.message==`object`){let e=t.message.content;if(Array.isArray(e))for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(e.type===`text`&&typeof e.text==`string`)l+=e.text,b(l);else if(e.type===`tool_use`){let t=typeof e.name==`string`?e.name:`tool`,n=e.input,r=typeof n==`object`&&n?(()=>{let e=n;return typeof e.command==`string`?e.command:typeof e.description==`string`?e.description:JSON.stringify(e).slice(0,200)})():``;O(e=>[...e,`→ ${t}: ${r}`])}}}else if(t.type===`user`&&typeof t.message==`object`){let e=t.message.content;if(Array.isArray(e))for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(e.type===`tool_result`){let t=e.is_error===!0;O(e=>[...e,` ${t?`✗`:`✓`} tool result${t?` (error)`:``}`])}}}else typeof t.raw==`string`&&(l+=(l?`
|
|
115
|
+
`:``)+t.raw,b(l))},stderr:e=>{let t=e??{};typeof t.raw==`string`&&t.raw.trim()&&O(e=>[...e,` ⚠ ${t.raw}`])},done:e=>{let t=e??{};if(t.status===`error`){w(String(t.error??`AI helper failed`));return}let n=typeof t.sql==`string`?t.sql.trim():``;if(!n){w(`AI returned an empty query. Refine the goal and regenerate.`);return}S(n)},message:()=>{}});M.current=u,u.done.catch(e=>{HT(e)||w(e.message)}).finally(()=>{clearInterval(c),g(!1),M.current=null})},ie=()=>{M.current&&=(M.current.abort(),null),g(!1)};return(0,F.useEffect)(()=>()=>{M.current&&=(M.current.abort(),null)},[]),d?(0,I.jsxs)(`div`,{className:`nerd-card border-neon-pink/40 dark:border-neon-pink/40 space-y-3`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsxs)(`div`,{className:`text-xs font-bold text-neon-pink flex items-center gap-1`,children:[(0,I.jsx)(Ar,{className:`w-3 h-3`}),`AI SQL helper · `,e,A?(0,I.jsx)(`span`,{className:`ml-2 nerd-pill-amber`,title:`Helper is in fix-mode: the warehouse error from your last Run will be passed to the AI.`,children:`fix mode`}):null]}),(0,I.jsxs)(`button`,{type:`button`,className:`text-xs text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300 flex items-center gap-1`,onClick:()=>{ie(),f(!1),re(),m(``),j(``)},title:`Close the helper without applying`,children:[(0,I.jsx)(Ur,{className:`w-3 h-3`}),` close`]})]}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,I.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-zinc-500`,children:`CLI:`}),[`claude`,`codex`,`gemini`].map(n=>(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn text-xs ${e===n?`border-neon-pink text-neon-pink`:``}`,onClick:()=>t(n),disabled:h,children:n},n))]}),(0,I.jsxs)(`label`,{className:`text-xs text-zinc-400 block`,children:[`What query do you need?`,(0,I.jsx)(`textarea`,{className:`nerd-input w-full mt-1 h-20`,value:p,onChange:e=>m(e.target.value),placeholder:`e.g. Top 10 customers by total revenue in the last 30 days, joined with their country from in.c-customers.`,disabled:h})]}),o.trim()?(0,I.jsxs)(`div`,{className:`text-xs text-zinc-500`,children:[`Existing SQL in the editor will be passed to the AI as a starting point (`,o.trim().length,` chars).`]}):null,(0,I.jsxs)(`div`,{className:`flex gap-2 items-center flex-wrap`,children:[h?(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-red-400 hover:border-red-700`,onClick:ie,title:`Abort the AI helper`,children:[(0,I.jsx)(Ur,{className:`w-3 h-3 inline mr-1`}),`cancel (`,_,`s)`]}):(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn hover:text-neon-pink hover:border-neon-pink/60`,onClick:N,disabled:!p.trim(),title:`Ask the AI to write the SQL`,children:[(0,I.jsx)(Ar,{className:`w-3 h-3 inline mr-1`}),x?`Regenerate`:`Generate SQL`]}),!h&&x?(0,I.jsxs)(`span`,{className:`text-xs text-zinc-500`,children:[`generated in `,_,`s`]}):null]}),C?(0,I.jsx)(Z,{message:C}):null,T?(0,I.jsxs)(`div`,{className:`border border-zinc-200 dark:border-zinc-800 rounded`,children:[(0,I.jsxs)(`div`,{className:`flex items-center px-2 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 hover:text-keboola flex-1 text-left`,onClick:()=>ee(e=>!e),title:`See exactly what context the AI received`,children:[(0,I.jsx)(`span`,{children:k?`▾`:`▸`}),(0,I.jsxs)(`span`,{children:[`Prompt sent to `,e]})]}),(0,I.jsxs)(`span`,{className:`text-zinc-400 mr-2`,children:[T.length,` chars`]}),(0,I.jsx)(ZT,{text:T,label:`prompt`})]}),k?(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap text-[11px] text-zinc-600 dark:text-zinc-400 border-t border-zinc-200 dark:border-zinc-800`,style:{maxHeight:`240px`,overflow:`auto`},children:T}):null]}):null,D.length>0?(0,I.jsxs)(`div`,{className:`border border-zinc-200 dark:border-zinc-800 rounded`,children:[(0,I.jsxs)(`div`,{className:`flex items-center px-2 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1 hover:text-keboola flex-1 text-left`,onClick:()=>ne(e=>!e),title:`See what tools the AI is calling`,children:[(0,I.jsx)(`span`,{children:te?`▾`:`▸`}),(0,I.jsx)(`span`,{children:`Activity`})]}),(0,I.jsxs)(`span`,{className:`text-zinc-400 mr-2`,children:[D.length,` events`]}),(0,I.jsx)(ZT,{text:D.join(`
|
|
116
|
+
`),label:`activity`})]}),te?(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap text-[11px] text-zinc-600 dark:text-zinc-400 border-t border-zinc-200 dark:border-zinc-800`,style:{maxHeight:`200px`,overflow:`auto`},children:D.join(`
|
|
117
|
+
`)}):null]}):null,h&&y?(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-500 mb-1`,children:`live output:`}),(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap text-xs text-zinc-600 dark:text-zinc-400`,style:{maxHeight:`200px`,overflow:`auto`},children:y})]}):null,x?(0,I.jsxs)(`div`,{className:`space-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,I.jsx)(`div`,{className:`text-xs text-zinc-500`,children:`AI suggestion:`}),(0,I.jsx)(ZT,{text:x,label:`SQL`})]}),(0,I.jsx)(`pre`,{className:`nerd-code whitespace-pre-wrap text-zinc-800 dark:text-zinc-200 border-neon-pink/30`,style:{maxHeight:`320px`,overflow:`auto`},children:x}),(0,I.jsxs)(`div`,{className:`flex gap-2 flex-wrap`,children:[(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn hover:text-keboola hover:border-keboola/60`,onClick:()=>{c(x),f(!1),re(),m(``)},title:`Replace the editor's SQL with this suggestion`,children:`✓ Use this SQL`}),(0,I.jsx)(`button`,{type:`button`,className:`nerd-btn hover:text-red-400 hover:border-red-700`,onClick:()=>{S(null),b(``)},title:`Throw away this suggestion (keeps the helper open)`,children:`✗ Discard`})]})]}):null]}):(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`nerd-btn text-xs flex items-center gap-1 hover:text-neon-pink hover:border-neon-pink/60`,onClick:()=>f(!0),title:`Let ${e} write the SQL for you`,children:[(0,I.jsx)(Ar,{className:`w-3 h-3`}),`Help me write this SQL`]}),(0,I.jsxs)(`span`,{className:`text-xs text-zinc-500`,children:[`uses `,e,` with your workspace context (project, backend, visible buckets) baked in`]})]})}function tE(){let{page:e}=Zr();switch(e){case`dashboard`:return(0,I.jsx)(Hm,{});case`projects`:return(0,I.jsx)(JC,{});case`configs`:return(0,I.jsx)(Zm,{});case`components`:return(0,I.jsx)(Ym,{});case`storage`:return(0,I.jsx)(tw,{});case`stream`:return(0,I.jsx)(lw,{});case`jobs`:return(0,I.jsx)(BS,{});case`branches`:return(0,I.jsx)(zm,{});case`workspaces`:return(0,I.jsx)(UT,{});case`flows`:return(0,I.jsx)(FS,{});case`schedules`:return(0,I.jsx)(ZC,{});case`lineage`:return(0,I.jsx)(YS,{});case`semantic-layer`:return(0,I.jsx)(OC,{});case`sharing`:return(0,I.jsx)($C,{});case`data-apps`:return(0,I.jsx)(eh,{});case`mcp`:return(0,I.jsx)(aC,{});case`localai`:return(0,I.jsx)(nC,{});case`agents`:return(0,I.jsx)(Mm,{});case`search`:return(0,I.jsx)(QC,{});case`encrypt`:return(0,I.jsx)(rh,{});case`org`:return(0,I.jsx)(qC,{});case`members`:return(0,I.jsx)(KC,{});case`doctor`:return(0,I.jsx)(th,{});case`changelog`:return(0,I.jsx)(Km,{});default:return(0,I.jsx)(Hm,{})}}function nE(){return(0,I.jsx)(di,{children:(0,I.jsx)(Xr,{children:(0,I.jsx)(_i,{children:(0,I.jsx)(tE,{})})})})}var rE=new Yt({defaultOptions:{queries:{retry:1,staleTime:3e4,refetchOnWindowFocus:!1}}});Kr.createRoot(document.getElementById(`root`)).render((0,I.jsx)(F.StrictMode,{children:(0,I.jsx)(nn,{client:rE,children:(0,I.jsx)(nE,{})})}));export{ey as a,Vv as c,uy as i,Hv as l,by as n,gy as o,Qv as r,ny as s,xy as t,ih as u};
|
|
118
|
+
//# sourceMappingURL=index-D8W97DAz.js.map
|