sparkforensics-server 0.2.0 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/lib/static-files.js +5 -4
- package/package.json +4 -3
- package/public/assets/AutoscalingChurn-Bf5TN-s_.js +1 -0
- package/public/assets/CacheUtilization-DRf_FNrK.js +1 -0
- package/public/assets/CachingOpportunity-BTJzIhtI.js +1 -0
- package/public/assets/ColdStart-DnFgnD3n.js +1 -0
- package/public/assets/ConfigAudit-B5FsOdmu.js +1 -0
- package/public/assets/CoreUsageArea-CTksBPuq.js +1 -0
- package/public/assets/Dashboard-BFMsMuc_.js +1 -0
- package/public/assets/DuplicatePlanSubtree-BCt-Guuh.js +1 -0
- package/public/assets/DurationHistogram-xRcnND4k.js +1 -0
- package/public/assets/EmptyState-CnTrSjtU.js +1 -0
- package/public/assets/ExecutorUtilization-CP21XlUq.js +1 -0
- package/public/assets/GcPressure-BoEJsLjb.js +1 -0
- package/public/assets/ImpactEstimate-BHcqJkcZ.js +1 -0
- package/public/assets/IncompleteRun-b9FWrOHn.js +1 -0
- package/public/assets/JobFailures-C5FkTq3O.js +1 -0
- package/public/assets/MemoryUtilization-D2W4AB_f.js +1 -0
- package/public/assets/OverBroadcast-Btu3xorf.js +1 -0
- package/public/assets/PartitionSizing-yZWhLN0e.js +1 -0
- package/public/assets/PlanExplorer-DSk1ivS4.js +1 -0
- package/public/assets/PlanGraphRoute-C3iOzUdB.js +1 -0
- package/public/assets/RetryWaste-B4436kr1.js +1 -0
- package/public/assets/RowPagination-oeWB8gBm.js +1 -0
- package/public/assets/ShuffleIO-DUiv8EJe.js +1 -0
- package/public/assets/Skew-D2lB1oQc.js +1 -0
- package/public/assets/SlowHost-Qb_8aa-W.js +1 -0
- package/public/assets/SmallFiles-u6suTgfj.js +1 -0
- package/public/assets/SpeculationWaste-vUCniiFP.js +1 -0
- package/public/assets/Spill-BskXFX2e.js +1 -0
- package/public/assets/StageFailed-D9b83Jvy.js +1 -0
- package/public/assets/StageFindingGroup-DagqHOUz.js +1 -0
- package/public/assets/StageHeader-DibMSunO.js +1 -0
- package/public/assets/StagePill-Dt6V9yVw.js +1 -0
- package/public/assets/StageShape-CfdrDUZa.js +1 -0
- package/public/assets/StageSlowness-BoGLIYKR.js +1 -0
- package/public/assets/Straggler-DU1WSU-m.js +1 -0
- package/public/assets/TaskFailures-DkY6zBNJ.js +1 -0
- package/public/assets/TinyTask-Lsnt5mJF.js +1 -0
- package/public/assets/UnderBroadcast-DxHc0lwy.js +1 -0
- package/public/assets/WidgetLeadSummary-BdUUi7L5.js +1 -0
- package/public/assets/charts-vendor-0VMaLVLN.js +59 -0
- package/public/assets/downsample-WmNM1qc9.js +1 -0
- package/public/assets/finding-anchor-Bl1hRK5E.js +1 -0
- package/public/assets/impact-sort-DxaUheWV.js +1 -0
- package/public/assets/inbox-DHIFHqcn.js +1 -0
- package/public/assets/index-CjVklAdW.css +2 -0
- package/public/assets/index-U654cmB8.js +9 -0
- package/public/assets/parser-worker-5a9aUx3o.js +115 -0
- package/public/assets/plan-graph-vendor-B0sEms9Z.js +7 -0
- package/public/assets/plan-graph-vendor-DLioOiRN.css +1 -0
- package/public/assets/react-vendor-D2TLlSzI.js +9 -0
- package/public/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/public/assets/select-CtKaJ5Hx.js +1 -0
- package/public/assets/toggle-group-DB2VfFIx.js +1 -0
- package/public/assets/usePagedRows-jNUWgVTD.js +1 -0
- package/public/assets/useRecentFiles-BiYdWs8J.js +11 -0
- package/public/assets/useSortMode-BhPky1lW.js +1 -0
- package/public/docs/404.html +3 -3
- package/public/docs/assets/{app.BgzsaTS3.js → app.BczRxXPr.js} +1 -1
- package/public/docs/assets/chunks/@localSearchIndexroot.c2HfrwDg.js +1 -0
- package/public/docs/assets/chunks/{VPLocalSearchBox.DOq3t-On.js → VPLocalSearchBox.DXvkTVnC.js} +1 -1
- package/public/docs/assets/chunks/theme.ByUdwrLG.js +2 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.9ToZXcTk.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.9ToZXcTk.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.B1vUqtry.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_detector-contract.md.BOeH4d1J.lean.js → contributor-guide_architecture_detector-contract.md.B1vUqtry.lean.js} +1 -1
- package/public/docs/assets/{contributor-guide_architecture_drill-down.md.BtPdlM7r.js → contributor-guide_architecture_drill-down.md.Bawx6NgP.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DHVq1UPt.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DHVq1UPt.lean.js +1 -0
- package/public/docs/assets/{contributor-guide_architecture_overview.md.CehiRmGn.js → contributor-guide_architecture_overview.md.DkXdJ9jE.js} +1 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.DkXdJ9jE.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.C-xxn0q7.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.C-xxn0q7.lean.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.DYwFeyjV.js +1 -0
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.C0SovZX8.js +6 -0
- package/public/docs/assets/{contributor-guide_architecture_worker-protocol.md.B93qJ_tT.lean.js → contributor-guide_architecture_worker-protocol.md.C0SovZX8.lean.js} +1 -1
- package/public/docs/assets/{contributor-guide_development-setup.md.DvAN_9mK.js → contributor-guide_development-setup.md.DvMV1xhQ.js} +3 -3
- package/public/docs/assets/contributor-guide_development-setup.md.DvMV1xhQ.lean.js +1 -0
- package/public/docs/assets/{contributor-guide_testing.md.6rIKqSyY.js → contributor-guide_testing.md.BohuQWvl.js} +1 -1
- package/public/docs/assets/{contributor-guide_testing.md.6rIKqSyY.lean.js → contributor-guide_testing.md.BohuQWvl.lean.js} +1 -1
- package/public/docs/assets/{style.DXOMCXxn.css → style.DSixAiZE.css} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-failures.md.4z5BXGJ2.js → tuning-reference_bottleneck-failures.md.CAsFf3RR.js} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-gc.md.DSxzZRK7.js → tuning-reference_bottleneck-gc.md.B4T3kJYV.js} +2 -2
- package/public/docs/assets/{tuning-reference_bottleneck-gc.md.DSxzZRK7.lean.js → tuning-reference_bottleneck-gc.md.B4T3kJYV.lean.js} +1 -1
- package/public/docs/assets/tuning-reference_bottleneck-shuffle.md.DDMQVOW6.js +12 -0
- package/public/docs/assets/{tuning-reference_bottleneck-shuffle.md.CM-nTmIH.lean.js → tuning-reference_bottleneck-shuffle.md.DDMQVOW6.lean.js} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-skew.md.BdUwiDhn.js → tuning-reference_bottleneck-skew.md.B0MzhWcX.js} +4 -4
- package/public/docs/assets/{tuning-reference_bottleneck-skew.md.BdUwiDhn.lean.js → tuning-reference_bottleneck-skew.md.B0MzhWcX.lean.js} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-small-files.md.B8kloyx8.js → tuning-reference_bottleneck-small-files.md.DHGMTmPs.js} +2 -2
- package/public/docs/assets/{tuning-reference_bottleneck-small-files.md.B8kloyx8.lean.js → tuning-reference_bottleneck-small-files.md.DHGMTmPs.lean.js} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-straggler.md.DY36fHN5.js → tuning-reference_bottleneck-straggler.md.DIbXdAcQ.js} +2 -2
- package/public/docs/assets/{tuning-reference_bottleneck-straggler.md.DY36fHN5.lean.js → tuning-reference_bottleneck-straggler.md.DIbXdAcQ.lean.js} +1 -1
- package/public/docs/assets/{tuning-reference_bottleneck-tiny-tasks.md.QTV7O8kU.js → tuning-reference_bottleneck-tiny-tasks.md.CB05v3zh.js} +1 -1
- package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DqC_iGkw.js +5 -0
- package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DqC_iGkw.lean.js +1 -0
- package/public/docs/assets/{tuning-reference_cluster-config.md.ZVmDGsQ3.js → tuning-reference_cluster-config.md.CD6vzYtD.js} +1 -1
- package/public/docs/assets/{tuning-reference_cluster-config.md.ZVmDGsQ3.lean.js → tuning-reference_cluster-config.md.CD6vzYtD.lean.js} +1 -1
- package/public/docs/assets/{tuning-reference_memory-model.md.DhT-n4y3.js → tuning-reference_memory-model.md.CWhvgevP.js} +1 -1
- package/public/docs/assets/{tuning-reference_memory-model.md.DhT-n4y3.lean.js → tuning-reference_memory-model.md.CWhvgevP.lean.js} +1 -1
- package/public/docs/assets/{user-guide_alternative-log-retrieval.md.sU3KGarf.js → user-guide_alternative-log-retrieval.md.B4tPGIal.js} +1 -1
- package/public/docs/assets/{user-guide_alternative-log-retrieval.md.sU3KGarf.lean.js → user-guide_alternative-log-retrieval.md.B4tPGIal.lean.js} +1 -1
- package/public/docs/assets/user-guide_getting-started.md.BJvwLEIM.js +3 -0
- package/public/docs/assets/user-guide_getting-started.md.BJvwLEIM.lean.js +1 -0
- package/public/docs/assets/{user-guide_mcp-tools.md.C8MiIu7F.js → user-guide_mcp-tools.md.DGvolGzt.js} +4 -4
- package/public/docs/assets/{user-guide_mcp-tools.md.C8MiIu7F.lean.js → user-guide_mcp-tools.md.DGvolGzt.lean.js} +1 -1
- package/public/docs/assets/user-guide_run-comparison.md.CQc1aoU8.js +1 -0
- package/public/docs/assets/user-guide_run-comparison.md.CQc1aoU8.lean.js +1 -0
- package/public/docs/assets/user-guide_understanding-findings.md.B29f0ucS.js +1 -0
- package/public/docs/assets/user-guide_understanding-findings.md.B29f0ucS.lean.js +1 -0
- package/public/docs/contributor-guide/architecture/board-widgets.html +6 -6
- package/public/docs/contributor-guide/architecture/detector-contract.html +6 -6
- package/public/docs/contributor-guide/architecture/drill-down.html +6 -6
- package/public/docs/contributor-guide/architecture/impact-estimation.html +6 -6
- package/public/docs/contributor-guide/architecture/index.html +4 -4
- package/public/docs/contributor-guide/architecture/overview.html +6 -6
- package/public/docs/contributor-guide/architecture/state-and-history.html +6 -6
- package/public/docs/contributor-guide/architecture/widget-rendering.html +6 -6
- package/public/docs/contributor-guide/architecture/worker-protocol.html +7 -7
- package/public/docs/contributor-guide/contributing.html +4 -4
- package/public/docs/contributor-guide/development-setup.html +6 -6
- package/public/docs/contributor-guide/testing.html +6 -6
- package/public/docs/hashmap.json +1 -1
- package/public/docs/index.html +4 -4
- package/public/docs/tuning-reference/anti-patterns.html +4 -4
- package/public/docs/tuning-reference/aqe.html +4 -4
- package/public/docs/tuning-reference/bottleneck-broadcast-sizing.html +4 -4
- package/public/docs/tuning-reference/bottleneck-cold-start.html +4 -4
- package/public/docs/tuning-reference/bottleneck-duplicate-plan-subtree.html +4 -4
- package/public/docs/tuning-reference/bottleneck-failures.html +6 -6
- package/public/docs/tuning-reference/bottleneck-gc.html +6 -6
- package/public/docs/tuning-reference/bottleneck-job-failure-rate.html +4 -4
- package/public/docs/tuning-reference/bottleneck-memory-utilization.html +4 -4
- package/public/docs/tuning-reference/bottleneck-retry-waste.html +4 -4
- package/public/docs/tuning-reference/bottleneck-shuffle.html +7 -7
- package/public/docs/tuning-reference/bottleneck-skew.html +8 -8
- package/public/docs/tuning-reference/bottleneck-slow-host.html +4 -4
- package/public/docs/tuning-reference/bottleneck-small-files.html +7 -7
- package/public/docs/tuning-reference/bottleneck-spill.html +4 -4
- package/public/docs/tuning-reference/bottleneck-straggler.html +6 -6
- package/public/docs/tuning-reference/bottleneck-tiny-tasks.html +6 -6
- package/public/docs/tuning-reference/bottleneck-utilization.html +7 -7
- package/public/docs/tuning-reference/caching.html +4 -4
- package/public/docs/tuning-reference/cluster-config.html +6 -6
- package/public/docs/tuning-reference/config.html +4 -4
- package/public/docs/tuning-reference/data-formats.html +4 -4
- package/public/docs/tuning-reference/index.html +4 -4
- package/public/docs/tuning-reference/intro.html +4 -4
- package/public/docs/tuning-reference/joins.html +4 -4
- package/public/docs/tuning-reference/memory-model.html +6 -6
- package/public/docs/tuning-reference/metrics.html +4 -4
- package/public/docs/tuning-reference/partitioning.html +4 -4
- package/public/docs/tuning-reference/pyspark.html +4 -4
- package/public/docs/tuning-reference/shuffle.html +4 -4
- package/public/docs/tuning-reference/spark-architecture.html +4 -4
- package/public/docs/tuning-reference/table-formats.html +4 -4
- package/public/docs/user-guide/alternative-log-retrieval.html +6 -6
- package/public/docs/user-guide/getting-started.html +7 -7
- package/public/docs/user-guide/mcp-tools.html +9 -9
- package/public/docs/user-guide/run-comparison.html +6 -6
- package/public/docs/user-guide/understanding-findings.html +6 -6
- package/public/index.html +7 -6
- package/public/sample-runs/sample-run.ndjson.gz +0 -0
- package/vendor-core/cli/collect-run.js +3 -2
- package/vendor-core/cli/native-zstd.js +351 -0
- package/vendor-core/detectors.js +390 -75
- package/vendor-core/docs-config.js +34 -8
- package/vendor-core/docs-content/chapters/03-memory-model.md +39 -0
- package/vendor-core/docs-content/chapters/11-cluster-config.md +40 -0
- package/vendor-core/docs-content/detection/cache.md +4 -3
- package/vendor-core/docs-content/detection/chrn.md +4 -2
- package/vendor-core/docs-content/detection/gc.md +2 -0
- package/vendor-core/docs-content/detection/host.md +2 -1
- package/vendor-core/docs-content/detection/local.md +2 -3
- package/vendor-core/docs-content/detection/mem.md +3 -3
- package/vendor-core/docs-content/detection/plan.md +3 -1
- package/vendor-core/docs-content/detection/shape.md +2 -1
- package/vendor-core/docs-content/detection/shfl.md +2 -1
- package/vendor-core/docs-content/detection/spec.md +4 -3
- package/vendor-core/docs-content/detection/spill.md +1 -1
- package/vendor-core/docs-content/detection/strag.md +2 -1
- package/vendor-core/docs-content/detection/tiny.md +2 -1
- package/vendor-core/docs-content/tuning/failures.md +1 -1
- package/vendor-core/docs-content/tuning/gc.md +11 -4
- package/vendor-core/docs-content/tuning/shuffle.md +25 -5
- package/vendor-core/docs-content/tuning/skew.md +14 -6
- package/vendor-core/docs-content/tuning/small-files.md +12 -7
- package/vendor-core/docs-content/tuning/straggler.md +34 -0
- package/vendor-core/docs-content/tuning/tiny-tasks.md +1 -1
- package/vendor-core/docs-content/tuning/utilization.md +57 -7
- package/vendor-core/docs-content/upstream.json +4 -0
- package/vendor-core/event-handlers.js +321 -69
- package/vendor-core/event-schemas.js +8 -6
- package/vendor-core/evidence-report.js +4 -2
- package/vendor-core/impact-estimator.js +150 -34
- package/vendor-core/mcp-tools.js +20 -7
- package/vendor-core/occupancy.js +70 -2
- package/vendor-core/parser-worker.js +30 -14
- package/vendor-core/plan-summary.js +4 -0
- package/vendor-core/run-comparison.js +22 -17
- package/vendor-core/shs-fetch.js +18 -7
- package/vendor-core/shs-load.js +2 -1
- package/vendor-core/stage-quantiles.js +59 -3
- package/vendor-core/string-hash.js +15 -0
- package/vendor-core/types.js +9 -1
- package/vendor-core/vendor/fzstd.js +94 -18
- package/public/assets/AutoscalingChurn-CFJkiqxW.js +0 -1
- package/public/assets/CacheUtilization-kTKZBzDA.js +0 -1
- package/public/assets/CachingOpportunity-CU70EWcF.js +0 -1
- package/public/assets/ColdStart-hOI-WOvm.js +0 -1
- package/public/assets/ConfigAudit-B4oAksZY.js +0 -1
- package/public/assets/CoreUsageArea-D-dR3SQk.js +0 -1
- package/public/assets/Dashboard-MDhohsq4.js +0 -4
- package/public/assets/DuplicatePlanSubtree-54RKsfI7.js +0 -1
- package/public/assets/DurationHistogram-CviQyPNM.js +0 -1
- package/public/assets/EmptyState-v2ehFncc.js +0 -1
- package/public/assets/ExecutorUtilization-vHyFHgL6.js +0 -1
- package/public/assets/GcPressure-DINuhcno.js +0 -1
- package/public/assets/ImpactEstimate-C6GzFOY9.js +0 -1
- package/public/assets/IncompleteRun-a1kuCnU6.js +0 -1
- package/public/assets/JobFailures-CYwPfUhR.js +0 -1
- package/public/assets/MemoryUtilization-Dlfj0e_f.js +0 -1
- package/public/assets/OverBroadcast-BMu7Y8l9.js +0 -1
- package/public/assets/PartitionSizing-CvMGfSVB.js +0 -1
- package/public/assets/PlanExplorer-xYFme_Rx.js +0 -1
- package/public/assets/PlanGraphRoute-a3OGg6ET.js +0 -1
- package/public/assets/RetryWaste-JKRjOZ-J.js +0 -1
- package/public/assets/RowPagination-DypWbnic.js +0 -1
- package/public/assets/ShuffleIO-Mi8HiVu-.js +0 -1
- package/public/assets/Skew-C3iOScTC.js +0 -1
- package/public/assets/SlowHost-DKBg18v-.js +0 -1
- package/public/assets/SmallFiles-CCCB6AIu.js +0 -1
- package/public/assets/SpeculationWaste-DUNupw0_.js +0 -1
- package/public/assets/Spill-BlLdatik.js +0 -1
- package/public/assets/StageFailed-qtY7C7Yo.js +0 -1
- package/public/assets/StageFindingGroup-CoVdEZYs.js +0 -1
- package/public/assets/StageHeader-uDBLHgdg.js +0 -1
- package/public/assets/StagePill-CYCMdlIx.js +0 -1
- package/public/assets/StageShape-zs0mAjQJ.js +0 -1
- package/public/assets/StageSlowness-C7vg0u5Q.js +0 -1
- package/public/assets/Straggler-4BRGAQP4.js +0 -1
- package/public/assets/TaskFailures-CSjO23Kg.js +0 -1
- package/public/assets/TinyTask-6Zuovcn5.js +0 -1
- package/public/assets/UnderBroadcast-CePjo0ZV.js +0 -1
- package/public/assets/WidgetLeadSummary-DRNRVvn7.js +0 -1
- package/public/assets/charts-vendor-Cf1-wzeH.js +0 -59
- package/public/assets/downsample-D8XmJk6i.js +0 -1
- package/public/assets/finding-anchor-4TmpXd7j.js +0 -1
- package/public/assets/impact-sort-Cq6KOLqh.js +0 -1
- package/public/assets/inbox-DBFovbUX.js +0 -1
- package/public/assets/index-CHjV2-jB.js +0 -9
- package/public/assets/index-DMEtaP4u.css +0 -1
- package/public/assets/parser-worker-BMPPE37w.js +0 -64
- package/public/assets/plan-graph-vendor-B96a-e4N.js +0 -7
- package/public/assets/plan-graph-vendor-BnuhLJ6X.css +0 -1
- package/public/assets/react-vendor-DA6opS-q.js +0 -9
- package/public/assets/select-D5fK-za0.js +0 -1
- package/public/assets/toggle-group-lbIXRG0W.js +0 -1
- package/public/assets/usePagedRows-CFoZrPr4.js +0 -1
- package/public/assets/useRecentFiles-BPGQ6XII.js +0 -13
- package/public/assets/useSortMode-BOPpfLhJ.js +0 -1
- package/public/docs/assets/chunks/@localSearchIndexroot.PQ5JepCp.js +0 -1
- package/public/docs/assets/chunks/theme.BP14rGBx.js +0 -2
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.B-OsL91z.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_board-widgets.md.B-OsL91z.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_detector-contract.md.BOeH4d1J.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DYCDPgkh.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_impact-estimation.md.DYCDPgkh.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_overview.md.CehiRmGn.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.m3S3UdMk.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_state-and-history.md.m3S3UdMk.lean.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_widget-rendering.md.DbqPf2OT.js +0 -1
- package/public/docs/assets/contributor-guide_architecture_worker-protocol.md.B93qJ_tT.js +0 -6
- package/public/docs/assets/contributor-guide_development-setup.md.DvAN_9mK.lean.js +0 -1
- package/public/docs/assets/tuning-reference_bottleneck-shuffle.md.CM-nTmIH.js +0 -12
- package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DTiueZC3.js +0 -5
- package/public/docs/assets/tuning-reference_bottleneck-utilization.md.DTiueZC3.lean.js +0 -1
- package/public/docs/assets/user-guide_getting-started.md.DtEM37MK.js +0 -3
- package/public/docs/assets/user-guide_getting-started.md.DtEM37MK.lean.js +0 -1
- package/public/docs/assets/user-guide_run-comparison.md.S0TWWmLY.js +0 -1
- package/public/docs/assets/user-guide_run-comparison.md.S0TWWmLY.lean.js +0 -1
- package/public/docs/assets/user-guide_understanding-findings.md.D0R_Y-R2.js +0 -1
- package/public/docs/assets/user-guide_understanding-findings.md.D0R_Y-R2.lean.js +0 -1
- /package/public/docs/assets/{contributor-guide_architecture_drill-down.md.BtPdlM7r.lean.js → contributor-guide_architecture_drill-down.md.Bawx6NgP.lean.js} +0 -0
- /package/public/docs/assets/{contributor-guide_architecture_widget-rendering.md.DbqPf2OT.lean.js → contributor-guide_architecture_widget-rendering.md.DYwFeyjV.lean.js} +0 -0
- /package/public/docs/assets/{tuning-reference_bottleneck-failures.md.4z5BXGJ2.lean.js → tuning-reference_bottleneck-failures.md.CAsFf3RR.lean.js} +0 -0
- /package/public/docs/assets/{tuning-reference_bottleneck-tiny-tasks.md.QTV7O8kU.lean.js → tuning-reference_bottleneck-tiny-tasks.md.CB05v3zh.lean.js} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./PlanGraphRoute-C3iOzUdB.js","./rolldown-runtime-hePW80VL.js","./charts-vendor-0VMaLVLN.js","./react-vendor-D2TLlSzI.js","./plan-graph-vendor-B0sEms9Z.js","./plan-graph-vendor-DLioOiRN.css","./useRecentFiles-BiYdWs8J.js","./impact-sort-DxaUheWV.js","./Dashboard-BFMsMuc_.js","./inbox-DHIFHqcn.js","./EmptyState-CnTrSjtU.js","./toggle-group-DB2VfFIx.js","./DurationHistogram-xRcnND4k.js","./downsample-WmNM1qc9.js","./WidgetLeadSummary-BdUUi7L5.js","./StagePill-Dt6V9yVw.js","./ImpactEstimate-BHcqJkcZ.js","./RowPagination-oeWB8gBm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,M as n,j as r}from"./charts-vendor-0VMaLVLN.js";import{J as i,Q as a,X as o,Y as s,at as c,ct as l,et as u,it as d,lt as f,nt as p,ot as m,q as h,rt as g,st as _,tt as v}from"./react-vendor-D2TLlSzI.js";import{p as y}from"./plan-graph-vendor-B0sEms9Z.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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var b=e(n(),1),x=f(),ee=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},S=(e,t)=>({classGroupId:e,validator:t}),C=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),w=`-`,T=[],E=`arbitrary..`,D=e=>{let t=k(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return te(e);let n=e.split(w);return O(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?ee(i,t):t:i||T}return n[e]||T}}},O=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=O(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(w):e.slice(t).join(w),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},te=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?E+r:void 0})(),k=e=>{let{theme:t,classGroups:n}=e;return ne(n,t)},ne=(e,t)=>{let n=C();for(let r in e){let i=e[r];A(i,n,r,t)}return n},A=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];re(i,t,n,r)}},re=(e,t,n,r)=>{if(typeof e==`string`){ie(e,t,n);return}if(typeof e==`function`){j(e,t,n,r);return}ae(e,t,n,r)},ie=(e,t,n)=>{let r=e===``?t:oe(t,e);r.classGroupId=n},j=(e,t,n,r)=>{if(se(e)){A(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(S(n,e))},ae=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];A(o,oe(t,a),n,r)}},oe=(e,t)=>{let n=e,r=t.split(w),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=C(),n.nextPart.set(t,i)),n=i}return n},se=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ce=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},M=`!`,N=`:`,le=[],ue=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),P=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===N){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(M)?(c=s.slice(0,-1),l=!0):s.startsWith(M)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ue(t,l,c,u)};if(t){let e=t+N,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ue(le,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},de=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},F=e=>({cache:ce(e.cacheSize),parseClassName:P(e),sortModifiers:de(e),postfixLookupClassGroupIds:fe(e),...D(e)}),fe=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},pe=/\s+/,I=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(pe),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+M:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},me=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=he(n))&&(i&&(i+=` `),i+=r);return i},he=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=he(e[r]))&&(n&&(n+=` `),n+=t);return n},ge=(e,...t)=>{let n,r,i,a,o=o=>(n=F(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=I(e,n);return i(e,a),a};return a=o,(...e)=>a(me(...e))},_e=[],L=e=>{let t=t=>t[e]||_e;return t.isThemeGetter=!0,t.themeKey=e,t},ve=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ye=/^\((?:(\w[\w-]*):)?(.+)\)$/i,be=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,xe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Se=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ce=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,we=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Te=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ee=e=>be.test(e),R=e=>!!e&&!Number.isNaN(Number(e)),z=e=>!!e&&Number.isInteger(Number(e)),De=e=>e.endsWith(`%`)&&R(e.slice(0,-1)),Oe=e=>xe.test(e),ke=()=>!0,Ae=e=>Se.test(e)&&!Ce.test(e),je=()=>!1,Me=e=>we.test(e),Ne=e=>Te.test(e),Pe=e=>!B(e)&&!V(e),Fe=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Ie=e=>Ze(e,tt,je),B=e=>ve.test(e),Le=e=>Ze(e,nt,Ae),Re=e=>Ze(e,rt,R),ze=e=>Ze(e,at,ke),Be=e=>Ze(e,it,je),Ve=e=>Ze(e,$e,je),He=e=>Ze(e,et,Ne),Ue=e=>Ze(e,ot,Me),V=e=>ye.test(e),We=e=>Qe(e,nt),Ge=e=>Qe(e,it),Ke=e=>Qe(e,$e),qe=e=>Qe(e,tt),Je=e=>Qe(e,et),Ye=e=>Qe(e,ot,!0),Xe=e=>Qe(e,at,!0),Ze=(e,t,n)=>{let r=ve.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Qe=(e,t,n=!1)=>{let r=ye.exec(e);return r?r[1]?t(r[1]):n:!1},$e=e=>e===`position`||e===`percentage`,et=e=>e===`image`||e===`url`,tt=e=>e===`length`||e===`size`||e===`bg-size`,nt=e=>e===`length`,rt=e=>e===`number`,it=e=>e===`family-name`,at=e=>e===`number`||e===`weight`,ot=e=>e===`shadow`,st=ge(()=>{let e=L(`color`),t=L(`font`),n=L(`text`),r=L(`font-weight`),i=L(`tracking`),a=L(`leading`),o=L(`breakpoint`),s=L(`container`),c=L(`spacing`),l=L(`radius`),u=L(`shadow`),d=L(`inset-shadow`),f=L(`text-shadow`),p=L(`drop-shadow`),m=L(`blur`),h=L(`perspective`),g=L(`aspect`),_=L(`ease`),v=L(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),V,B],ee=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[V,B,c],w=()=>[Ee,`full`,`auto`,...C()],T=()=>[z,`none`,`subgrid`,V,B],E=()=>[`auto`,{span:[`full`,z,V,B]},z,V,B],D=()=>[z,`auto`,V,B],O=()=>[`auto`,`min`,`max`,`fr`,V,B],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ne=()=>[`auto`,...C()],A=()=>[Ee,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],re=()=>[s,Ee,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],ie=()=>[Ee,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],j=()=>[e,V,B],ae=()=>[...b(),Ke,Ve,{position:[V,B]}],oe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],se=()=>[`auto`,`cover`,`contain`,qe,Ie,{size:[V,B]}],ce=()=>[De,We,Le],M=()=>[``,`none`,`full`,l,V,B],N=()=>[``,R,We,Le],le=()=>[`solid`,`dashed`,`dotted`,`double`],ue=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],P=()=>[R,De,Ke,Ve],de=()=>[``,`none`,m,V,B],F=()=>[`none`,R,V,B],fe=()=>[`none`,R,V,B],pe=()=>[R,V,B],I=()=>[Ee,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Oe],breakpoint:[Oe],color:[ke],container:[Oe],"drop-shadow":[Oe],ease:[`in`,`out`,`in-out`],font:[Pe],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Oe],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Oe],shadow:[Oe],spacing:[`px`,R],text:[Oe],"text-shadow":[Oe],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ee,B,V,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,V,B]}],"container-named":[Fe],columns:[{columns:[R,`auto`,B,V,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[z,`auto`,V,B]}],basis:[{basis:[Ee,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[R,Ee,`auto`,`initial`,`none`,B]}],grow:[{grow:[``,R,V,B]}],shrink:[{shrink:[``,R,V,B]}],order:[{order:[z,`first`,`last`,`none`,V,B]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:ne()}],mx:[{mx:ne()}],my:[{my:ne()}],ms:[{ms:ne()}],me:[{me:ne()}],mbs:[{mbs:ne()}],mbe:[{mbe:ne()}],mt:[{mt:ne()}],mr:[{mr:ne()}],mb:[{mb:ne()}],ml:[{ml:ne()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:A()}],"inline-size":[{inline:[`auto`,...re()]}],"min-inline-size":[{"min-inline":[`auto`,...re()]}],"max-inline-size":[{"max-inline":[`none`,...re()]}],"block-size":[{block:[`auto`,...ie()]}],"min-block-size":[{"min-block":[`auto`,...ie()]}],"max-block-size":[{"max-block":[`none`,...ie()]}],w:[{w:[s,`screen`,...A()]}],"min-w":[{"min-w":[s,`screen`,`none`,...A()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...A()]}],h:[{h:[`screen`,`lh`,...A()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...A()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...A()]}],"font-size":[{text:[`base`,n,We,Le]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Xe,ze]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,De,B]}],"font-family":[{font:[Ge,Be,t]}],"font-features":[{"font-features":[B]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,V,B]}],"line-clamp":[{"line-clamp":[R,`none`,V,Re]}],leading:[{leading:[`none`,a,...C()]}],"list-image":[{"list-image":[`none`,V,B]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,V,B]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...le(),`wavy`]}],"text-decoration-thickness":[{decoration:[R,`from-font`,`auto`,V,Le]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[R,`auto`,V,B]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[z,V,B]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,V,B]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,V,B]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ae()}],"bg-repeat":[{bg:oe()}],"bg-size":[{bg:se()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},z,V,B],radial:[``,V,B],conic:[``,z,V,B]},Je,He]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-bs":[{"border-bs":N()}],"border-w-be":[{"border-be":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":N()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...le(),`hidden`,`none`]}],"divide-style":[{divide:[...le(),`hidden`,`none`]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...le(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[R,V,B]}],"outline-w":[{outline:[``,R,We,Le]}],"outline-color":[{outline:j()}],shadow:[{shadow:[``,`inner`,`none`,u,Ye,Ue]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ye,Ue]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:N()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[R,Le]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":[`none`,f,Ye,Ue]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[R,V,B]}],"mix-blend":[{"mix-blend":[...ue(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[R]}],"mask-image-linear-from-pos":[{"mask-linear-from":P()}],"mask-image-linear-to-pos":[{"mask-linear-to":P()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":P()}],"mask-image-t-to-pos":[{"mask-t-to":P()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":P()}],"mask-image-r-to-pos":[{"mask-r-to":P()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":P()}],"mask-image-b-to-pos":[{"mask-b-to":P()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":P()}],"mask-image-l-to-pos":[{"mask-l-to":P()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":P()}],"mask-image-x-to-pos":[{"mask-x-to":P()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":P()}],"mask-image-y-to-pos":[{"mask-y-to":P()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[V,B]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[R]}],"mask-image-conic-from-pos":[{"mask-conic-from":P()}],"mask-image-conic-to-pos":[{"mask-conic-to":P()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ae()}],"mask-repeat":[{mask:oe()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,V,B]}],filter:[{filter:[``,`none`,V,B]}],blur:[{blur:de()}],brightness:[{brightness:[R,V,B]}],contrast:[{contrast:[R,V,B]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ye,Ue]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:[``,R,V,B]}],"hue-rotate":[{"hue-rotate":[R,V,B]}],invert:[{invert:[``,R,V,B]}],saturate:[{saturate:[R,V,B]}],sepia:[{sepia:[``,R,V,B]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,V,B]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[R,V,B]}],"backdrop-contrast":[{"backdrop-contrast":[R,V,B]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,R,V,B]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R,V,B]}],"backdrop-invert":[{"backdrop-invert":[``,R,V,B]}],"backdrop-opacity":[{"backdrop-opacity":[R,V,B]}],"backdrop-saturate":[{"backdrop-saturate":[R,V,B]}],"backdrop-sepia":[{"backdrop-sepia":[``,R,V,B]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,V,B]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[R,`initial`,V,B]}],ease:[{ease:[`linear`,`initial`,_,V,B]}],delay:[{delay:[R,V,B]}],animate:[{animate:[`none`,v,V,B]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,V,B]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:F()}],"rotate-x":[{"rotate-x":F()}],"rotate-y":[{"rotate-y":F()}],"rotate-z":[{"rotate-z":F()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":[`scale-3d`],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[V,B,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:I()}],"translate-x":[{"translate-x":I()}],"translate-y":[{"translate-y":I()}],"translate-z":[{"translate-z":I()}],"translate-none":[`translate-none`],zoom:[{zoom:[z,V,B]}],accent:[{accent:j()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,V,B]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,V,B]}],fill:[{fill:[`none`,...j()]}],"stroke-w":[{stroke:[R,We,Le,Re]}],stroke:[{stroke:[`none`,...j()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function H(...e){return st(t(e))}var U=y();function ct({className:e,children:t,value:n,...r}){return(0,U.jsxs)(_,{value:n,"data-slot":`progress`,className:H(`flex flex-wrap gap-3`,e),...r,children:[t,(0,U.jsx)(lt,{children:(0,U.jsx)(ut,{})})]})}function lt({className:e,...t}){return(0,U.jsx)(m,{className:H(`relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted`,e),"data-slot":`progress-track`,...t})}function ut({className:e,...t}){return(0,U.jsx)(c,{"data-slot":`progress-indicator`,className:H(`h-full bg-primary transition-all`,e),...t})}var dt=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},ft=(e=>e?dt(e):dt),pt=e=>e;function mt(e,t=pt){let n=b.useSyncExternalStore(e.subscribe,b.useCallback(()=>t(e.getState()),[e,t]),b.useCallback(()=>t(e.getInitialState()),[e,t]));return b.useDebugValue(n),n}var ht={observed:`Observed in this event log.`,explicitlyDisabled:`Explicitly disabled in this event log.`,noObservedExecutorMetrics:`Not emitted by this event log.`,noObservedStageSubmission:`Not emitted by this event log.`,noRddStorageSnapshot:`Stages were submitted without RDD storage snapshots.`,noResolvedSqlPlan:`Not emitted by this event log.`,noSqlExecution:`Not applicable to this event log.`,noEnvironmentUpdate:`Not emitted by this event log.`,noTaskRecords:`Not emitted by this event log.`,noUsableCoreTimeAggregate:`No usable aggregate was emitted.`,outsideEventLogScope:`Available outside local event-log scope.`,parseIncomplete:`Cannot determine from an incomplete parse.`};function gt(e,t,n){return{key:e,state:`present`,reasonCode:`observed`,summary:ht.observed,evidence:{eventType:t,count:n}}}function _t(e,t,n){return{key:e,state:t,reasonCode:n,summary:ht[n]}}function vt(e,t){let n=e[t];return typeof n==`number`&&Number.isFinite(n)&&n>0?n:0}function yt(e){return e!=null&&e.schemaVersion===1}function bt(e){return typeof e==`number`&&Number.isFinite(e)&&e>0}function xt(e){let t=e?.perStage;return typeof t==`object`&&!!t&&!Array.isArray(t)&&Object.values(t).some(e=>bt(e?.taskCount)&&bt(e?.totalTaskDurationSum))}function St(e,t){return e!=null&&String(e).toLowerCase()===t}function Ct(e,t,n){return n?_t(e,t===`noSqlExecution`?`notApplicable`:`notEmitted`,t):_t(e,`unknown`,`parseIncomplete`)}function wt(e,{skippedLines:t=0}={}){let n=e?.app,r=n?.evidenceInputs??{},i=t===0&&vt(r,`applicationEnds`)>0,a=vt(r,`executorMetricRows`),o=vt(r,`stageSubmissions`),s=vt(r,`rddStorageSnapshots`),c=vt(r,`resolvedSqlPlans`),l=vt(r,`sqlExecutions`),u=vt(r,`environmentUpdates`),d=vt(r,`taskRecords`);return{schemaVersion:1,entries:[a>0?gt(`executorMetrics`,`executorMetricRows`,a):St(n?.config?.[`spark.eventLog.logStageExecutorMetrics`],`false`)?_t(`executorMetrics`,`disabled`,`explicitlyDisabled`):Ct(`executorMetrics`,`noObservedExecutorMetrics`,i),s>0?gt(`rddStorageSnapshots`,`rddStorageSnapshots`,s):Ct(`rddStorageSnapshots`,o===0?`noObservedStageSubmission`:`noRddStorageSnapshot`,i),c>0?gt(`sqlPlan`,`resolvedSqlPlans`,c):l>0&&i?_t(`sqlPlan`,`notEmitted`,`noResolvedSqlPlan`):Ct(`sqlPlan`,`noSqlExecution`,i),u>0?gt(`sparkConfiguration`,`environmentUpdates`,u):Ct(`sparkConfiguration`,`noEnvironmentUpdate`,i),d===0?Ct(`taskCoreTime`,`noTaskRecords`,i):xt(e?.runAggregates)?gt(`taskCoreTime`,`taskRecords`,d):Ct(`taskCoreTime`,`noUsableCoreTimeAggregate`,i),_t(`infrastructureContext`,`outsideEventLog`,`outsideEventLogScope`),_t(`sourceContext`,`outsideEventLog`,`outsideEventLogScope`),_t(`costContext`,`outsideEventLog`,`outsideEventLogScope`)]}}function Tt(e,t,n){return{app:e.app,stages:new Map(e.stages),executors:{added:[...e.executors.added],removed:[...e.executors.removed]},sql:new Map(e.sql),jobs:new Map(e.jobs),runAggregates:e.runAggregates,evidenceAvailability:e.evidenceAvailability,catalog:[...t],taskData:new Map(n)}}function Et(e,t,n){e.app=n.app,e.stages=new Map(n.stages),e.executors={added:[...n.executors.added],removed:[...n.executors.removed]},e.sql=new Map(n.sql),e.jobs=new Map(n.jobs),e.runAggregates=n.runAggregates??null,e.evidenceAvailability=yt(n.evidenceAvailability)?n.evidenceAvailability:null,t.clear();for(let[e,r]of n.taskData)t.set(e,r);return[...n.catalog]}function Dt(){return{app:null,stages:new Map,executors:{added:[],removed:[]},sql:new Map,jobs:new Map,runAggregates:null,evidenceAvailability:null}}function Ot(){if(typeof window>`u`)return`dark`;try{let e=window.localStorage.getItem(`shuffle-works-theme`);if(e===`light`||e===`dark`)return e}catch{}return window.matchMedia?.(`(prefers-color-scheme: light)`).matches?`light`:`dark`}var kt=`shuffle-works-widget-density`;function At(){if(typeof window>`u`)return`basic`;try{let e=window.localStorage.getItem(kt);if(e===`basic`||e===`advanced`)return e}catch{}return`basic`}var W=ft(e=>({appModel:Dt(),catalog:[],configFindings:[],activeFileId:null,sessionCache:new Map,taskDataCache:new Map,parse:{pct:0,lines:0,etaMs:null},status:`idle`,shsParsing:!1,errorMessage:null,errorNonce:0,theme:Ot(),widgetDensity:At(),exportMode:!1,skippedLines:0,comparison:{active:!1,baselineId:null,candidateId:null},compareLoad:null,planGraph:{active:!1,stageId:null,initialScope:`segment`},modelResetCount:0,openComparison:(t,n)=>e(e=>(e.activeFileId!=null&&e.appModel.app&&e.sessionCache.set(e.activeFileId,Tt(e.appModel,e.catalog,e.taskDataCache)),{comparison:{active:!0,baselineId:t,candidateId:n}})),setComparisonActive:t=>e(e=>({comparison:{...e.comparison,active:t}})),setCompareLoad:t=>e({compareLoad:t}),closeComparison:()=>e({comparison:{active:!1,baselineId:null,candidateId:null}}),openPlanGraph:(t,n)=>e({planGraph:{active:!0,stageId:t,initialScope:n?.initialScope??`segment`}}),closePlanGraph:()=>e({planGraph:{active:!1,stageId:null,initialScope:`segment`}}),resetModel:()=>e(e=>({appModel:Dt(),catalog:[],configFindings:[],taskDataCache:new Map,status:`idle`,shsParsing:!1,errorMessage:null,skippedLines:0,comparison:{active:!1,baselineId:null,candidateId:null},compareLoad:null,planGraph:{active:!1,stageId:null,initialScope:`segment`},modelResetCount:e.modelResetCount+1})),setStatus:t=>e({status:t}),setShsParsing:t=>e({shsParsing:t}),setParse:t=>e({parse:t}),setCatalog:t=>e({catalog:t}),setConfigFindings:t=>e({configFindings:t}),setTaskData:(t,n)=>e(e=>{let r=new Map(e.taskDataCache);return r.set(t,n),{taskDataCache:r}}),setActiveFile:t=>e({activeFileId:t}),setError:t=>e(e=>({errorMessage:t,errorNonce:t?e.errorNonce+1:e.errorNonce,status:t?`error`:e.status})),setTheme:t=>e({theme:t}),setWidgetDensity:t=>{try{window.localStorage.setItem(kt,t)}catch{}e({widgetDensity:t})},setSkippedLines:t=>e({skippedLines:t}),setEvidenceAvailability:t=>e(e=>({appModel:{...e.appModel,evidenceAvailability:t}}))}));function G(e){return mt(W,e)}function jt(){return G(e=>e.widgetDensity)}var Mt=(0,b.createContext)(null);function Nt({children:e}){let t=G(e=>e.theme);return(0,b.useEffect)(()=>{if(t===`light`?document.documentElement.setAttribute(`data-theme`,`light`):document.documentElement.removeAttribute(`data-theme`),typeof window<`u`){try{window.localStorage.setItem(`shuffle-works-theme`,t)}catch{}try{window.localStorage.setItem(`vitepress-theme-appearance`,t)}catch{}}},[t]),(0,U.jsx)(Mt.Provider,{value:{theme:t,toggle:()=>W.getState().setTheme(t===`dark`?`light`:`dark`)},children:e})}function Pt(){let e=(0,b.useContext)(Mt);if(!e)throw Error(`useTheme outside ThemeProvider`);return e}var Ft=e(r(),1);function It(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Lt=e=>{switch(e){case`success`:return Bt;case`info`:return Ht;case`warning`:return Vt;case`error`:return Ut;default:return null}},Rt=Array(12).fill(0),zt=({visible:e,className:t})=>b.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},b.createElement(`div`,{className:`sonner-spinner`},Rt.map((e,t)=>b.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Bt=b.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},b.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Vt=b.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},b.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Ht=b.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},b.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Ut=b.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},b.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Wt=b.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},b.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),b.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Gt=()=>{let[e,t]=b.useState(document.hidden);return b.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Kt=1,qt=100,Jt=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Kt++,Yt=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-qt;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Jt(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],b.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Zt(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!b.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!b.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!b.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!b.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Jt(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},Xt=(e,t)=>Yt.message(e,t),Zt=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Qt=Object.assign(Xt,{success:Yt.success,info:Yt.info,warning:Yt.warning,error:Yt.error,custom:Yt.custom,message:Yt.message,promise:Yt.promise,dismiss:Yt.dismiss,loading:Yt.loading},{getHistory:()=>Yt.toasts,getToasts:()=>Yt.getActiveToasts()});It(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function $t(e){return e.label!==void 0}var en=3,tn=`24px`,nn=`16px`,rn=4e3,an=356,on=14,sn=45,cn=200;function ln(...e){return e.filter(Boolean).join(` `)}function un(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var dn=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:x,gap:ee,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=b.useState(null),[O,te]=b.useState(null),[k,ne]=b.useState(!1),[A,re]=b.useState(!1),[ie,j]=b.useState(!1),[ae,oe]=b.useState(!1),[se,ce]=b.useState(!1),[M,N]=b.useState(0),[le,ue]=b.useState(0),P=b.useRef(n.duration||y||rn),de=b.useRef(null),F=b.useRef(null),fe=c===0,pe=c+1<=o,I=n.type,me=I??`default`,he=n.dismissible!==!1,ge=n.className||``,_e=n.descriptionClassName||``,L=b.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ve=b.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ye=b.useMemo(()=>n.duration||y||rn,[n.duration,y]),be=b.useRef(0),xe=b.useRef(0),Se=b.useRef(0),Ce=b.useRef(null),[we,Te]=x.split(`-`),Ee=b.useMemo(()=>s.reduce((e,t,n)=>n>=L?e:e+t.height,0),[s,L]),R=Gt(),z=b.useMemo(()=>e.swipeDirections??un(x),[e.swipeDirections,x]),De=n.invert||t,Oe=I===`loading`;xe.current=b.useMemo(()=>L*ee+Ee,[L,Ee]),b.useEffect(()=>{P.current=ye},[ye]),b.useEffect(()=>{ne(!0)},[]),b.useEffect(()=>{let e=F.current;if(e){let t=e.getBoundingClientRect().height;return ue(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),b.useLayoutEffect(()=>{if(!k)return;let e=F.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ue(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[k,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let ke=b.useCallback(()=>{re(!0),N(xe.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},cn)},[n,d,a,xe]);b.useEffect(()=>{if(n.promise&&I===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||R?(()=>{if(Se.current<be.current){let e=new Date().getTime()-be.current;P.current-=e}Se.current=new Date().getTime()})():P.current!==1/0&&(be.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),ke()},P.current)),()=>clearTimeout(e)},[u,i,n,I,R,ke]),b.useEffect(()=>{n.delete&&(ke(),n.onDismiss==null||n.onDismiss.call(n,n))},[ke,n.delete]);function Ae(){return w?.loading?b.createElement(`div`,{className:ln(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":I===`loading`},w.loading):b.createElement(zt,{className:ln(C?.loader,n?.classNames?.loader),visible:I===`loading`})}let je=n.icon||w?.[I]||Lt(I);return b.createElement(`li`,{tabIndex:0,ref:F,className:ln(_,ge,C?.toast,n?.classNames?.toast,C?.[me],n?.classNames?.[me]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":k,"data-promise":!!n.promise,"data-swiped":se,"data-removed":A,"data-visible":pe,"data-y-position":we,"data-x-position":Te,"data-index":c,"data-front":fe,"data-swiping":ie,"data-dismissible":he,"data-type":I,"data-invert":De,"data-swipe-out":ae,"data-swipe-direction":O,"data-expanded":!!(u||S&&k),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${A?M:xe.current}px`,"--initial-height":S?`auto`:`${le}px`,...m,...n.style},onDragEnd:()=>{j(!1),D(null),Ce.current=null},onPointerDown:e=>{e.button!==2&&!Oe&&he&&(de.current=new Date,N(xe.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(j(!0),Ce.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(ae||!he)return;Ce.current=null;let e=Number(F.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(F.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-de.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if((E===`x`?z.includes(e>0?`right`:`left`):z.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=sn||a>.11)){N(xe.current),n.onDismiss==null||n.onDismiss.call(n,n),te(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),ke(),oe(!0);return}var o,s;(o=F.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=F.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ce(!1),j(!1),D(null)},onPointerMove:e=>{var t,n;if(!Ce.current||!he||window.getSelection()?.toString().length>0)return;let r=e.clientY-Ce.current.y,i=e.clientX-Ce.current.x;!E&&(Math.abs(i)>1||Math.abs(r)>1)&&D(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(z.includes(`top`)||z.includes(`bottom`)){if(z.includes(`top`)&&r<0||z.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(E===`x`&&(z.includes(`left`)||z.includes(`right`))){if(z.includes(`left`)&&i<0||z.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ce(!0),(t=F.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=F.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},ve&&!n.jsx&&I!==`loading`?b.createElement(`button`,{"aria-label":T,"data-disabled":Oe,"data-close-button":!0,onClick:Oe||!he?()=>{}:()=>{ke(),n.onDismiss==null||n.onDismiss.call(n,n)},className:ln(C?.closeButton,n?.classNames?.closeButton)},w?.close??Wt):null,(I||n.icon||n.promise)&&n.icon!==null&&(w?.[I]!==null||n.icon)?b.createElement(`div`,{"data-icon":``,className:ln(C?.icon,n?.classNames?.icon)},I===`loading`?n.icon||Ae():n.promise?Ae():null,I===`loading`?null:je):null,b.createElement(`div`,{"data-content":``,className:ln(C?.content,n?.classNames?.content)},b.createElement(`div`,{"data-title":``,className:ln(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?b.createElement(`div`,{"data-description":``,className:ln(v,_e,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),b.isValidElement(n.cancel)?n.cancel:n.cancel&&$t(n.cancel)?b.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{$t(n.cancel)&&he&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),ke())},className:ln(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,b.isValidElement(n.action)?n.action:n.action&&$t(n.action)?b.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{$t(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&ke())},className:ln(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function fn(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function pn(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?nn:tn;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var mn=b.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=en,toastOptions:g,dir:_=fn(),gap:v=on,icons:y,customAriaLabel:x,containerAriaLabel:ee=`Notifications`}=e,[S,C]=b.useState([]),w=b.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),T=b.useMemo(()=>Array.from(new Set([i].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,i]),[E,D]=b.useState([]),[O,te]=b.useState(!1),[k,ne]=b.useState(!1),[A,re]=b.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),ie=b.useRef(null),j=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ae=b.useRef(null),oe=b.useRef(!1),se=b.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||Yt.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return b.useEffect(()=>Yt.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Ft.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),b.useEffect(()=>{if(d!==`system`){re(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?re(`dark`):re(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{re(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{re(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),b.useEffect(()=>{S.length<=1&&te(!1)},[S]),b.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;te(!0),(t=ie.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===ie.current||ie.current?.contains(document.activeElement))&&te(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),b.useEffect(()=>{if(ie.current)return()=>{ae.current&&(ae.current.focus({preventScroll:!0}),ae.current=null,oe.current=!1)}},[ie.current]),b.createElement(`section`,{ref:t,"aria-label":x??`${ee} ${j}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},T.map((t,n)=>{let[i,a]=t.split(`-`);return w.length?b.createElement(`ol`,{key:t,dir:_===`auto`?fn():_,tabIndex:-1,ref:ie,className:c,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${an}px`,"--gap":`${v}px`,...m,...pn(l,u)},onBlur:e=>{oe.current&&!e.currentTarget.contains(e.relatedTarget)&&(oe.current=!1,ae.current&&=(ae.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||oe.current||(oe.current=!0,ae.current=e.relatedTarget)},onMouseEnter:()=>te(!0),onMouseMove:()=>te(!0),onMouseLeave:()=>{k||te(!1)},onDragEnd:()=>te(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ne(!0)},onPointerUp:()=>ne(!1)},w.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>b.createElement(dn,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:se,toasts:w.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:D,expandByDefault:o,gap:v,expanded:O,swipeDirections:e.swipeDirections}))):null}))}),hn=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function gn(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:hn(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var _n=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},vn=e=>{let t=_n(e);return t.charAt(0).toUpperCase()+t.slice(1)},yn=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),bn={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function xn(e){return e!=null}function Sn(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??bn.width,a=e.size??e.height??bn.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?yn(...c):yn(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??bn[`stroke-width`])*Number(e.size??e.width??bn.width)/Number(t.size??t.width??bn.width):t.strokeWidth??bn[`stroke-width`];return[`svg`,{...Object.entries(bn).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&xn(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&xn(t.width)&&{[r(`width`)]:t.width},...`height`in t&&xn(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Cn(e,t={}){return Sn(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var wn=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Tn=(0,b.createContext)({}),En=()=>(0,b.useContext)(Tn),Dn=(0,b.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=En()??{},y=!!c||wn(d),[x,ee,S=[]]=Cn(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:yn(v,s),hasA11yProp:y,attributes:d});return(0,b.createElement)(x,{ref:f,...ee},[...S.map(([e,t])=>(0,b.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function K(e,t=[],n=[]){let r=typeof e==`string`?gn(e,t,n):e,i=(0,b.forwardRef)(({className:e,...t},n)=>(0,b.createElement)(Dn,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=vn(r.name)),i}var On={name:`activity`,size:24,node:[[`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`}]]};On.node;var kn=K(On),An={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};An.node;var jn=K(An),Mn={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};Mn.node;var Nn=K(Mn),Pn={name:`bot`,size:24,node:[[`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`}]]};Pn.node;var Fn=K(Pn),In={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};In.node;var Ln=K(In),Rn={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Rn.node;var zn=K(Rn),Bn={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Bn.node;var Vn=K(Bn),Hn={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Hn.node;var Un=K(Hn),Wn={name:`git-compare-arrows`,size:24,node:[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]};Wn.node;var Gn=K(Wn),Kn={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Kn.node;var qn=K(Kn),Jn={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Jn.node;var Yn=K(Jn),Xn={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Xn.node;var Zn=K(Xn),Qn={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};Qn.node;var $n=K(Qn),er={name:`server`,size:24,node:[[`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`}]]};er.node;var tr=K(er),nr={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};nr.node;var rr=K(nr),ir={name:`sun`,size:24,node:[[`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`}]]};ir.node;var ar=K(ir),or={name:`triangle-alert`,size:24,node:[[`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`}]],aliases:[`alert-triangle`]};or.node;var sr=K(or),cr={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};cr.node;var lr=K(cr),ur={name:`workflow`,size:24,node:[[`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`}]]};ur.node;var dr=K(ur),fr={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};fr.node;var pr=K(fr),mr=({...e})=>{let{theme:t}=Pt();return(0,U.jsx)(mn,{theme:t,className:`toaster group`,icons:{success:(0,U.jsx)(Vn,{className:`size-4`}),info:(0,U.jsx)(qn,{className:`size-4`}),warning:(0,U.jsx)(sr,{className:`size-4`}),error:(0,U.jsx)($n,{className:`size-4`}),loading:(0,U.jsx)(Yn,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},toastOptions:{classNames:{toast:`cn-toast`}},...e})};function hr(e,t,n){switch(e.type){case`progress`:t.onProgress?.(e);break;case`app`:t.onApp?.(e.data);break;case`stage`:t.onStage?.(e.data);break;case`sql`:t.onSql?.(e.data);break;case`sqlPlan`:t.onSqlPlan?.(e.data);break;case`executor`:t.onExecutor?.(e.data);break;case`job`:t.onJob?.(e.data);break;case`runAggregates`:t.onRunAggregates?.(e.data);break;case`stageExecutorMetrics`:t.onStageExecutorMetrics?.(e.data);break;case`done`:{let{skippedLines:n}=e;t.onDone?.({skippedLines:n});break}case`error`:t.onError?.(e);break;case`taskData`:{let t=n?.get(e.reqId);t&&(t.resolve({metrics:e.metrics,fieldNames:e.fieldNames}),n.delete(e.reqId));break}}}function gr(){let e=null,t=new Map,n=0,r={};function i(){e=new Worker(new URL(new URL(`parser-worker-5a9aUx3o.js`,import.meta.url).href,``+import.meta.url),{type:`module`}),e.onmessage=({data:e})=>hr(e,r,t),e.onerror=e=>{r.onError?.(`Worker crashed: ${e.message}`),u()}}function a(t,n){r=n,i(),e.postMessage({type:`parse`,file:t})}function o(t,n){r=n,i(),e.postMessage({type:`parseFromUrl`,request:t})}function s(t,n){r=n,i(),e.postMessage({type:`parseFiles`,files:t})}function c(r){return new Promise((i,a)=>{let o=String(n++);t.set(o,{resolve:i,reject:a}),e.postMessage({type:`getTaskData`,stageId:r,reqId:o})})}async function l(e){return await Promise.all(e.map(e=>c(e).then(t=>({stageId:e,...t}))))}function u(){e?.terminate(),e=null;for(let{reject:e}of t.values())e(Error(`Worker terminated`));t.clear()}return{startParse:a,startParseFromUrl:o,startParseFiles:s,requestTaskData:c,prefetchFlaggedStages:l,terminate:u}}function _r(e,{onProgress:t,onDone:n,onError:r}){return{onProgress:t,onApp(t){e.app=t},onStage(t){let n=t;e.stages.set(n.id,n)},onSql(t){let n=t;e.sql.set(n.id,t);for(let t of n.stageIds??[]){let r=e.stages.get(t);r&&(r.sqlExecutionId=n.id)}},onSqlPlan(t){let n=t,r=e.sql.get(n.executionId);r&&(r.planTree=n.planTree)},onExecutor(t){let n=t;n.kind===`added`?e.executors.added.push(n):e.executors.removed.push(n)},onJob(t){let n=t;e.jobs.set(n.id,n)},onRunAggregates(t){e.runAggregates=t},onStageExecutorMetrics(t){if(!(t instanceof Map))return;let n=t;for(let[t,r]of n){let n=e.stages.get(t);n&&(n.executorMetrics=r)}},onDone:n,onError:r}}var vr=134217728,yr=8e3,br=1.5,xr={critical:0,warning:1,info:2},Sr={skew:`task-skew`,slowHost:`task-skew`,straggler:`task-skew`,shuffle:`shuffle-io`,spill:`spill`,gc:`gc-pressure`,failures:`failures`,coldStart:`executor-timeline`,utilization:`executor-timeline`,speculationWaste:`executor-timeline`};function Cr(e){let t=new Map;for(let n of e){if(n.stageId==null)continue;let e=Sr[n.type];e&&(t.has(n.stageId)||t.set(n.stageId,new Set),t.get(n.stageId).add(e))}let n=new Map;for(let[e,r]of t)n.set(e,r.size);return n}var wr={skew:`SKEW`,shuffle:`SHFL`,spill:`SPILL`,gc:`GC`,coldStart:`COLD`,utilization:`UTIL`,memoryUtilization:`MEM`,cacheUtilization:`CSTOR`,coreLocality:`LOCAL`,autoscalingChurn:`CHRN`,slowHost:`HOST`,failures:`FAIL`,straggler:`STRAG`,retryWaste:`RETRY`,tinyTask:`TINY`,stageFailed:`SFAIL`,speculationWaste:`SPEC`,partitionSizing:`PART`,stageSlowness:`SLOW`,stageShape:`SHAPE`,cachingOpportunity:`CACHE`,jobFailureRate:`JOBS`,configAudit:`CFG`,duplicatePlanSubtree:`PLAN`,smallFiles:`PLAN`,underBroadcast:`PLAN`,overBroadcast:`PLAN`,broadcastSizing:`PLAN`,incompleteRun:`INCMP`};function Tr(e){return wr[e]??e.toUpperCase()}var Er={skew:`Skew spill: a few heavy tasks spill while most do not; rebalance partitioning`,volume:`Volume spill: most tasks spill because data exceeds memory; add partitions`,unclassified:`Spill cause could not be classified`},Dr={skew:`skew`,volume:`vol`,unclassified:`?`},Or=8;function kr(e,t=Or){return e.length<=t?e.join(`, `):`${e.slice(0,t).join(`, `)}, +${e.length-t} more`}function Ar(e){let t;for(let n of e)(t===void 0||xr[n.impactBand]<xr[t])&&(t=n.impactBand);return t}function jr(e){let t=String(e),n=t.match(/((?:hdfs?|s3[an]?):\/\/\S+|\/[^\s,)]+)/i);if(!n)return t;let r=n[1].replace(/[/,]+$/,``).split(`/`).filter(Boolean);return r[r.length-1]||t}function Mr(e){return e.split(`::`)[0]||e}function q(e){return!e||e<=0?`—`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(0)} MB`:`${(e/1e3).toFixed(0)} KB`}function Nr(e){return e/1e6}function Pr(e){return typeof e.value==`number`?e.value:0}function Fr(e,t){switch(e){case`pct`:return`${t}%`;case`pctFraction`:return`${Math.round(t*100)}%`;case`ratio`:return`${t}×`;case`ms`:return Br(t);case`count`:return`${t}`}}var Ir={shuffleReadBytes:`bytes`,memoryBytesSpilled:`bytes`,shuffleReadMax:`bytes`,avgFileSizeBytes:`bytes`,smallerSideBytes:`bytes`,broadcastBytes:`bytes`,speculationWasteMs:`ms`,retryWasteMs:`ms`,taskDurationP50:`ms`,stageDurationMinutes:`minutes`,"P95/median":`ratio`,"max/median":`ratio`,pRatio:`ratio`,oiRatio:`ratio`,taskStageSkew:`ratio`,hostMeanRatio:`ratio`,execMaxMedianRatio:`ratio`,gcPct:`pct`,failureRate:`pct`,stragglerShare:`pct`,hostDurationShare:`pctFraction`,taskCount:`count`,speculativeTasks:`count`,subtreeOccurrences:`count`};function Lr(e){return e>0&&e<1e3?`${Math.round(e)} B`:q(e)}function Rr(e){let t=e.metric?Ir[e.metric]:void 0;if(!t||typeof e.value!=`number`)return null;switch(t){case`bytes`:return Lr(e.value);case`minutes`:return Br(e.value*6e4);case`ms`:return Fr(`ms`,e.value);case`ratio`:return Fr(`ratio`,e.value);case`pct`:return Fr(`pct`,e.value);case`pctFraction`:return Fr(`pctFraction`,e.value);case`count`:return Fr(`count`,e.value)}}function zr(e){let t=Rr(e),n=e.impactEstimate?.wallClock,r=[t,n?`~${Br(n.high)}`:null].filter(Boolean);return r.length>0?r.join(` · `):null}function Br(e){return!e||e<=0?`—`:e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`}function Vr(e){let t=e.shuffleReadBytes??0;if(t<=0)return null;let n=Math.min(yr,Math.ceil(t/vr)),r=e.taskCount??0;return n<=r*br?null:{recommended:n,current:r}}function Hr(e,t){if(e.length===0)return{labels:[],data:[]};let n=e[0],r=e[0];for(let t=1;t<e.length;t++)e[t]<n&&(n=e[t]),e[t]>r&&(r=e[t]);let i=(r-n)/t||1,a=Array(t).fill(0);for(let r of e)a[Math.min(Math.floor((r-n)/i),t-1)]++;return{labels:a.map((e,t)=>Math.round(n+t*i)),data:a}}function Ur(e,t,{dedupe:n=!1}={}){if(!e)return;let r=n?new Set:null,i=[{node:e,parent:null}];for(;i.length>0;){let{node:e,parent:n}=i.pop();if(r){if(r.has(e))continue;r.add(e)}t(e,n);let a=e.children??[];for(let t=a.length-1;t>=0;t--)i.push({node:a[t],parent:e})}}function Wr(e){for(let t of e.metrics??[]){if(t.metricType===`timing`)return t.value;if(t.metricType===`nsTiming`)return t.value/1e6}for(let t of e.metrics??[])if(/time/i.test(t.name)&&typeof t.value==`number`)return t.value;return null}function Gr(e){let t=[],n=new Map,r=new Map;if(!e)return{segments:t,segOf:n,segmentTopology:r};let i=1,a=0;return Ur(e,(e,o)=>{let s;if(!o)s=0,r.set(s,{parentIndex:null,depth:0,traversalOrder:a++});else if(o.exchangeRole===`read`){let e=n.get(o);s=i++,r.set(s,{parentIndex:e,depth:r.get(e).depth+1,traversalOrder:a++})}else s=n.get(o);n.set(e,s),(t[s]??=[]).push(e)},{dedupe:!0}),{segments:t,segOf:n,segmentTopology:r}}function Kr(e,t,n,r){let i=e.filter(Boolean).map((e,t)=>({i:t,nodes:e,...r.get(t)})).sort((e,t)=>t.depth-e.depth||e.traversalOrder-t.traversalOrder),a=[...n].map(e=>({id:e,s:t.get(e)})).filter(e=>!!e.s).sort((e,t)=>e.s.submittedAt-t.s.submittedAt),o=Math.min(i.length,a.length),s=[];for(let e=0;e<o;e++)s.push({segmentIndex:i[e].i,stageId:a[e].id,nodes:i[e].nodes,stage:a[e].s});return{orderedSegments:i,orderedStages:a,pairs:s}}function qr(e,t,n){let r=new Map,i=e,a=0;for(;i!=null;)r.set(i,a++),i=n.get(i)?.parentIndex??null;for(i=t,a=0;i!=null;){let e=r.get(i);if(e!=null)return e+a;i=n.get(i)?.parentIndex??null,a++}return 1/0}function Jr(e,t,n,r){let i=t,a=r,{orderedSegments:o,pairs:s}=Kr(e,i,n,a),c=new Map(s.map(e=>[e.segmentIndex,e.stageId])),l=s.map(e=>e.segmentIndex);if(l.length===0)return c;for(let{i:e}of o){if(c.has(e))continue;let t=l[0],n=qr(e,t,a);for(let r of l){let i=qr(e,r,a);i<n&&(n=i,t=r)}c.set(e,c.get(t))}return c}function Yr(e){let t=new Map;for(let{nodes:n,stage:r}of e){let{submittedAt:e,completedAt:i}=r,a=Math.max(0,i-e),o=n.map(Wr),s=o.reduce((e,t)=>e+(t??0),0);n.forEach((e,r)=>{let i=s>0?a*((o[r]??0)/s):a/n.length;t.set(e,i)})}return t}function Xr(e,t,n){let r=n?.stageIds??[];if(!e||r.length===0)return new Map;let{segments:i,segmentTopology:a}=Gr(e),{pairs:o}=Kr(i,t,r,a);return Yr(o)}function Zr(e,t,n){let r=n?.stageIds??[],i=new Map;if(!e||r.length===0)return i;let{segments:a,segmentTopology:o}=Gr(e),{pairs:s}=Kr(a,t,r,o),c=Yr(s);for(let{nodes:e}of s){let t=new Set(e);for(let n of e){let e=new Set;function r(n){if(e.has(n))return 0;e.add(n);let i=c.get(n)??0;for(let e of n.children??[])t.has(e)&&(i+=r(e));return i}i.set(n,r(n))}}return i}var Qr=[`serializefromobject`,`deserializetoobject`,`mapelements`,`mappartitions`,`inputadapter`,`columnartorow`,`rowtocolumnar`,`union`];function $r(e){let t=(e??``).toLowerCase();return t.startsWith(`scan`)?`scan`:t.includes(`exchange`)?`exchange`:t.includes(`join`)?`join`:t.includes(`aggregate`)?`aggregate`:t.startsWith(`sort`)?`sort`:t.startsWith(`filter`)?`filter`:t===`adaptivesparkplan`?`aqe`:Qr.some(e=>t.startsWith(e))||t.startsWith(`wholestagecodegen`)?`boilerplate`:`transform`}function ei(e){return e.exchangeRole!==void 0||$r(e.name)===`exchange`}function ti(e){return e===`BroadcastExchange`}function ni(e,t){if(!t||t===e)return``;let n=(e??``).toLowerCase(),r=e=>e.replace(/#\d+/g,``);if(Qr.some(e=>n.startsWith(e))||n===`adaptivesparkplan`)return``;if(n.startsWith(`wholestagecodegen`)){let t=e.match(/\((\d+)\)/);return t?`codegen #${t[1]}`:``}if(n.includes(`exchange`)){let e=t.match(/Exchange\s+(\w+partitioning)\(([^)]+)\)/i);if(e){let t=e[1].toLowerCase().startsWith(`hash`)?`hash`:`range`,n=r(e[2]).split(`,`).map(e=>e.trim()),i=/^\d+$/.test(n[n.length-1])?n.pop():null;return`${t}(${n.map(e=>e.replace(/\s+ASC(\s+NULLS\s+\w+)?$/i,`↑`).replace(/\s+DESC(\s+NULLS\s+\w+)?$/i,`↓`).trim()).slice(0,3).join(`, `)}${i?`, ${i}`:``})`}let n=t.match(/Exchange\s+(\w+)/);return n?n[1]:``}if(n.startsWith(`sort`)&&!n.includes(`merge`)){let e=t.match(/Sort\s+\[([^\]]+)\]/);if(e)return r(e[1]).split(`,`).map(e=>e.trim().replace(/\s+ASC(\s+NULLS\s+\w+)?$/i,`↑`).replace(/\s+DESC(\s+NULLS\s+\w+)?$/i,`↓`)).slice(0,4).join(`, `)}if(n.includes(`join`)){let e=t.match(/Join\s+\[([^\]]*)\][^,]*,\s*\[[^\]]*\][^,]*,\s*(\w+)/i);if(e){let t=r(e[1]).split(`,`)[0].trim();return t?`${t} ${e[2]}`:e[2]}}if(n.includes(`aggregate`)){let e=t.match(/functions=\[([^\]]+)\]/);if(e){let t=[...new Set(e[1].split(`,`).map(e=>(e.trim().match(/^(\w+)\(/)?.[1]??``).replace(/^partial_/,``)))].filter(Boolean);return t.slice(0,5).join(`, `)+(t.length>5?` +${t.length-5}`:``)}}if(n.startsWith(`filter`)){let e=t.match(/Filter\s+(.+)/s);if(e){let t=r(e[1]).trim().replace(/^\((.+)\)$/s,`$1`);return t.length>70?t.slice(0,70)+`…`:t}}if(n.startsWith(`project`)){let e=t.match(/Project\s+\[([^\]]+)\]/);if(e){let t=r(e[1]).split(`,`).map(e=>e.trim());return t.length<=3?t.join(`, `):`${t.length} columns`}return``}if(n.startsWith(`scan`)){if(n.includes(`existingrdd`)){let t=jr(e);if(t!==e)return t}let t=e.match(/Scan\s+(\S+)/);return t?t[1]:``}let i=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),a=r(t).replace(RegExp(`^${i}\\s*`,`i`),``).trim();return a.length>80?a.slice(0,80)+`…`:a}function ri(e){let{value:t,metricType:n}=e;return typeof t==`string`?t:n===`size`?q(t):n===`timing`?Br(t):n===`nsTiming`?Br(t/1e6):t.toLocaleString(`en-US`)}function ii(e){return!e||e.length===0?``:ri([`number of output rows`,`size of files read`,`spill size`,`duration`].map(t=>e.find(e=>e.name===t)).find(Boolean)??e[0])}function ai(e,t,n,r,i=`exclusive`){if(!e||!n)return null;let a=Yi(r,t.stages);if(!a.length)return null;let o=new Map;for(let e of a){let n=t.stages.get(e);n&&o.set(e,{submittedAt:n.submittedAt,completedAt:n.completedAt})}return i===`inclusive`?Zr(e,o,{...n,stageIds:a}):Xr(e,o,{...n,stageIds:a})}function oi(e){return e.trim().replace(/#\w+$/,``)}function si(e){return e.replace(/^\[|\]$/g,``).split(`,`).map(oi).filter(Boolean)}function ci(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++)e[i]===`(`?n++:e[i]===`)`?n--:e[i]===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1);return t.push(e.slice(r).trim()),t.filter(Boolean)}function li(e,t){e.warnings.push({type:`crossJoin`,detail:`${t} detected: this can cause severe data explosion.`})}function ui(e,t){e.warnings.push({type:`longFilterCondition`,detail:`Filter condition is ${t} characters: consider simplifying or pushing the filter down closer to the scan.`})}function di(e,t){let n=null,r=null,i=e.match(/^Scan\s+(parquet|orc|csv|json)\s+(spark_catalog\.\S+)$/i);if(!i&&!/FileScan/i.test(t)&&!t.includes(`JDBCRelation`))return null;if(i)n=i[1].toLowerCase(),r=i[2];else{let e=t.match(/FileScan\s+(parquet|orc|csv|json)\s+(spark_catalog\.[^[\s]+)\[/i);e&&(n=e[1].toLowerCase(),r=e[2])}if(r)return/PreparedDeltaFileIndex/i.test(t)&&(n=`delta`),`${n}:${r.replace(/^spark_catalog\./,``)}`;if(/_delta_log/.test(e)||/_delta_log/.test(t)||/DeltaLogFileIndex/i.test(e+t)||/checkpointMetadata#|sidecar#|commitInfo#/.test(e+t))return null;let a=t.match(/FileScan\s+(parquet|orc|csv|json)\b/i);if(a){let e=t.match(/Location:[^[]*\[([^\]]+)\]/);return e?`${a[1].toLowerCase()}:${jr(e[1].split(`,`)[0].trim())}`:null}if(/JDBCRelation/.test(t)){let e=fi(t).match(/\bFROM\s+(\(|[A-Za-z_][\w.]*)/i);return!e||e[1]===`(`?null:`jdbc:${e[1].toLowerCase()}`}return null}function fi(e){let t=e.match(/JDBCRelation\(([\s\S]+?)\)\s*(?:SPARK_GEN_SUBQ_\d+\)?)?\s*\[numPartitions/),n=e.match(/JDBCRelation\(\(([\s\S]+?)\)\s*SPARK_GEN_SUBQ/);return(n?n[1]:t?t[1]:``).replace(/\s+/g,` `).trim()}function pi(e,t,n){let r=di(e,t);if(!r)return!1;let i=r.indexOf(`:`),a=r.slice(0,i),o=r.slice(i+1);if(a===`jdbc`)return n.scans.push({path:o,format:a,projectedColumns:[],pushedFilters:[],sql:fi(t)}),!0;let s=t.match(/FileScan\s+\w+\s+(\[[^\]]*\])/i)??t.match(/(\[[^\]]*\])/),c=t.match(/PushedFilters:\s*\[([^\]]*)\]/);return n.scans.push({path:o,format:a,projectedColumns:s?si(s[1]):[],pushedFilters:c&&c[1]?c[1].split(`,`).map(e=>e.trim()).filter(Boolean):[]}),!0}function mi(e,t,n){let r=t.match(/^(SortMergeJoin|BroadcastHashJoin|ShuffledHashJoin|BroadcastNestedLoopJoin)\s+(\[[^\]]*\]),\s*(\[[^\]]*\]),\s*(\w+)/);return r?(n.joins.push({joinType:r[1],leftKeys:si(r[2]),rightKeys:si(r[3])}),/^Cross$/i.test(r[4])&&li(n,`Cross join`),!0):!1}function hi(e,t,n){let r=t.match(/(?:Object)?HashAggregate\(keys=(\[[^\]]*\]),\s*functions=(\[[\s\S]*\])\)/);if(!r)return!1;let i=r[2].replace(/^\[|\]$/g,``);if(/\bpartial_/.test(i))return!0;let a=ci(i).map(e=>e.replace(/#\w+/g,``).trim()).filter(Boolean).slice(0,8),o=si(r[1]);return(o.length||a.length)&&n.aggs.push({groupByKeys:o,aggregations:a}),!0}function gi(e,t){let n=e.match(/hashpartitioning\((.+?),\s*(\d+)\)/i),r=e.match(/rangepartitioning\((.+?),\s*(\d+)\)/i);if(n)t.exchanges.push({partitioning:`hash`,keys:ci(n[1]).map(e=>oi(e.replace(/\s+(ASC|DESC)(\s+NULLS\s+\w+)?/i,``))).filter(Boolean),numPartitions:parseInt(n[2],10)});else if(r)t.exchanges.push({partitioning:`range`,keys:ci(r[1]).map(e=>oi(e.replace(/\s+(ASC|DESC)(\s+NULLS\s+\w+)?/i,``))).filter(Boolean),numPartitions:parseInt(r[2],10)});else if(/RoundRobinPartitioning/i.test(e)){let n=e.match(/RoundRobinPartitioning\((\d+)\)/i);t.exchanges.push({partitioning:`roundrobin`,keys:[],numPartitions:n?parseInt(n[1],10):0})}else/SinglePartition/i.test(e)&&t.exchanges.push({partitioning:`single`,keys:[],numPartitions:1})}function _i(e){let t={scans:[],joins:[],aggs:[],exchanges:[],warnings:[]};return e&&Ur(e,e=>{let n=e.name??``,r=e.detail??``;if(/CartesianProduct/i.test(n)||/CartesianProduct/i.test(r))li(t,`CartesianProduct`);else if(!pi(n,r,t)&&!(/Join/i.test(n)&&mi(n,r,t))&&!(/Aggregate/i.test(n)&&hi(n,r,t))){if(e.exchangeRole===`read`)gi(r,t);else if(/^Filter/i.test(n)){let e=r.match(/^Filter\s+([\s\S]+)/);e&&e[1].trim().length>1e3&&ui(t,e[1].trim().length)}}},{dedupe:!0}),t}function vi(e){if(!e)return null;let t=e.name??``,n=e.detail??``,r={scans:[],joins:[],aggs:[],exchanges:[],warnings:[]},i=null;if(/CartesianProduct/i.test(t)||/CartesianProduct/i.test(n))i=`cartesian`,li(r,`CartesianProduct`);else if(pi(t,n,r))i=`scan`;else if(/Join/i.test(t)&&mi(t,n,r))i=`join`;else if(/Aggregate/i.test(t)&&hi(t,n,r))i=`agg`;else if(ei(e))i=`exchange`,gi(n,r);else if(/^Filter/i.test(t)){i=`filter`;let e=n.match(/^Filter\s+([\s\S]+)/);e&&e[1].trim().length>1e3&&ui(r,e[1].trim().length)}let a=r.scans[0]?`scan`:r.joins[0]?`join`:r.aggs[0]?`agg`:r.exchanges[0]||i===`exchange`&&e.exchangeRole!==`write`?`exchange`:null,o=r.scans[0]??r.joins[0]??r.aggs[0]??r.exchanges[0]??null,s=r.warnings[0]??null;return!i||(i===`agg`||i===`filter`)&&!a&&!s?null:{kind:a,warning:s,...o??{}}}function yi(e,t){let n=t.reduce((e,t)=>e+(t.totalCores??0),0);if(n<=0){let r=e.resources?.executor?.cores??null;n=r==null?0:t.length*r}return n}function bi(e){let t=[...e].sort((e,t)=>e.time-t.time||e.delta-t.delta),n=0,r=0;for(let e of t)n+=e.delta,n>r&&(r=n);return r}function xi(e,t,n){let r=new Map,i=[];for(let e of t){let t=e.totalCores??0;r.set(e.executorId,t),i.push({time:e.timestamp,delta:t})}for(let e of n){let t=r.get(e.executorId)??0;i.push({time:e.timestamp,delta:-t})}let a=bi(i);if(a>0)return a;let o=Si(t,n),s=e.resources?.executor?.cores??null;return s==null?0:o*s}function Si(e,t){return bi([...e.map(e=>({time:e.timestamp,delta:1})),...t.map(e=>({time:e.timestamp,delta:-1}))])}var Ci=new Set([`RACK_LOCAL`,`ANY`]),wi=5,Ti=10,Ei={totalTasks:null,nonLocalTasks:null,ratio:null,topStages:[]};function Di(e,{minTasksPerStage:t=Ti,topN:n=wi}={}){if(!Array.isArray(e)||e.length===0)return Ei;let r=0,i=0,a=[];for(let n of e){let e=n?.localityStats;if(!Array.isArray(e)||e.length===0)continue;let o=0,s=0;for(let{locality:t,count:n}of e)Number.isFinite(n)&&(o+=n,Ci.has(t)&&(s+=n));r+=o,i+=s,o>=t&&a.push({stageId:n.id,nonLocalTasks:s,taskCount:o,ratio:s/o})}if(r===0)return Ei;let o=a.sort((e,t)=>t.nonLocalTasks-e.nonLocalTasks).slice(0,n);return{totalTasks:r,nonLocalTasks:i,ratio:i/r,topStages:o}}function Oi(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e[0]-t[0]),n=[[t[0][0],t[0][1]]];for(let e=1;e<t.length;e++){let r=n[n.length-1],i=t[e];i[0]<=r[1]?r[1]=Math.max(r[1],i[1]):n.push([i[0],i[1]])}return n}function ki(e,t){let n=e?.startTime??0,r=[...t.values()].filter(e=>e.submittedAt!=null&&e.completedAt!=null).map(e=>[e.submittedAt,e.completedAt]),i=e?.endTime??null??(r.length>0?r.reduce((e,t)=>Math.max(e,t[1]),-1/0):n),a=Math.max(0,i-n);if(r.length===0)return{total:a,startup:a,stagesActive:0,gaps:0,idle:0};let o=Oi(r),s=o.reduce((e,[t,n])=>e+(n-t),0),c=o[0][0],l=Math.max(0,c-n),u=0;for(let e=1;e<o.length;e++)u+=o[e][0]-o[e-1][1];let d=o[o.length-1][1],f=Math.max(0,i-d);return{total:a,startup:l,stagesActive:s,gaps:u,idle:f}}function Ai(e){return(e.completedAt??0)-(e.submittedAt??0)}function ji(e){let t=Ai(e);return t>0?(e.executorRunTime??0)/t:0}function Mi(e){let t=[...e.values()].filter(e=>Ai(e)>0),n=new Map;for(let e of t)n.set(e.id,0);if(t.length===0)return n;let r=[];for(let e of t){let t=ji(e);r.push({time:e.submittedAt??0,id:e.id,weight:t,isStart:!0}),r.push({time:e.completedAt??0,id:e.id,weight:t,isStart:!1})}r.sort((e,t)=>e.time-t.time);let i=new Map,a=r[0].time,o=0;for(;o<r.length;){let e=r[o].time;if(e>a&&i.size>0){let t=e-a,r=0;for(let e of i.values())r+=e;for(let[e,a]of i){let o=r>0?a/r:1/i.size;n.set(e,(n.get(e)??0)+t*o)}}for(;o<r.length&&r[o].time===e;){let e=r[o];e.isStart?i.set(e.id,e.weight):i.delete(e.id),o++}a=e}return n}function Ni(e){let t=Mi(e),n=new Map;for(let r of e.values()){let e=Ai(r);if(e<=0)continue;let i=t.get(r.id)??0;n.set(r.id,Math.min(1,i/e))}return n}function Pi(e,t){let n=e.taskDurationMax??0;if(t<=0)return n;let r=e.executorRunTime??0;return Math.max(n,r/t)}function Fi(e,t,n){let r=Math.max(0,Ai(t)-n);return Math.min(e,r)}function Ii(e,t){let n=Ni(e),r=new Map;for(let i of e.values()){let e=n.get(i.id);e!==void 0&&r.set(i.id,{gate:e,ceiling:Pi(i,t),coreWorkFloor:t>0?(i.executorRunTime??0)/t:0})}return r}var Li=.999;function Ri(e,t){let n=e.stragglerExcessMs??0,r=e.peakConcurrentTasks??0;return n<=0||r<=0?t:Math.max(t,n/r)}function zi(e,t){return Math.max(t,e.stragglerExcessMs??0)}function Bi(e){let t=e.taskDurationP50??0;return!((e.stragglerCount??0)>0)||e.longestNonStragglerMs==null?t:Math.max(t,e.longestNonStragglerMs)}function Vi(e,t,n,r,{shortensLongestTask:i=!1,removedCoreWorkMs:a=0,longestTaskAfterFixMs:o=0}={}){let s=n.get(t),c=r.get(t);if(!s||!c)return null;let l=s.executorRunTime??0,u=a>0&&l>0?c.coreWorkFloor*Math.max(0,1-a/l):c.coreWorkFloor,d=Fi(e,s,i?Math.max((s.taskDurationMax??0)-e,o,u):c.ceiling);return c.gate>=Li?{basis:`serial`,wallClock:{low:d,high:d}}:{basis:`contended`,wallClock:{low:d*c.gate,high:d}}}function Hi(e,t,n,r){let i=[],a=[];for(let o of e){let e=Vi(t.get(o)??0,o,n,r);if(!e)continue;i.push(e);let s=n.get(o);a.push([s.submittedAt??0,s.completedAt??0])}if(i.length===0)return null;let o=i.reduce((e,t)=>e+t.wallClock.high,0),s=i.reduce((e,t)=>e+t.wallClock.low,0),c=Oi(a).reduce((e,[t,n])=>e+(n-t),0),l=Math.min(o,c),u=Math.min(s,c);return{basis:i.every(e=>e.basis===`serial`)?`serial`:`contended`,wallClock:{low:u,high:l}}}function Ui(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677)}return n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(16)}var Wi=1048576,Gi=1024*Wi,Ki=1024*Gi;function qi(e,t){let{taskCount:n,spillDiskMax:r=0,spillMemMax:i=0,spillDiskP50:a=0,spillMemP50:o=0}=e;if(n===1){if(r>=t.singleTaskDiskGiB*Gi||i>=t.singleTaskMemGiB*Gi)return{magnitude:`severe`}}else{let e=n>0?r/n:0;if(r>=t.highDiskGiB*Gi||e>=t.highTaskDiskMB*Wi||i>=t.highMemGiB*Gi)return{magnitude:`high`};if(r>=t.medDiskMB*Wi||i>=t.medMemGiB*Gi)return{magnitude:`medium`}}if(n>=t.skewMinTasks){if(a>0&&r/a>t.skewRatio&&r>=t.skewDiskFloorMB*Wi)return{magnitude:`high`};if(o>0&&i/o>t.skewRatio&&i>=t.skewMemFloorMB*Wi)return{magnitude:`medium`}}return null}function Ji(e){return!Array.isArray(e)||e.length===0?null:[...e].sort((e,t)=>t.count-e.count)[0].reason}function Yi(e,t){let n=[];for(let r of t.values())r.sqlExecutionId===e&&n.push(r.id);return n}function Xi(e,t){let n=new Set;for(let t of e)for(let e of t.stageIds??[])n.add(e);return n.size>0?[...n].sort((e,t)=>e-t):t}function Zi(e,t={}){let{includeDetail:n=!1,normalizeDetail:r=e=>e}=t,i=new WeakMap,a=[];function o(e,t){a.push(e);let s=e.exchangeRole===`read`?e.children[0]:null,c=s?s.children:e.children??[],l=s?s.metrics:e.metrics,u=c.map(e=>o(e,!1)),d=1+u.reduce((e,t)=>e+t.size,0),f=(l??[]).map(e=>e.name).sort().join(`,`),p=u.map(e=>Ui(e.fingerprint)).join(`,`),m={size:d,fingerprint:t&&n?`${e.name}[${f}]<${r(e.detail??``)}>{${p}}`:`${e.name}[${f}]{${p}}`};return i.set(e,m),m}return o(e,!0),{shapeOf:i,allNodes:a}}function Qi(e){let t=e.replace(/#\d+L?/g,``).replace(/,?\s*plan_id=\d+/g,``).replace(/\[codegen id\s*:\s*\d+\]/gi,`[codegen id]`).replace(/\bBuild(Left|Right)\b/g,`BuildSide`);return t=t.replace(/(?<![A-Za-z_])([A-Za-z_][\w.]*)\s*=\s*([A-Za-z_][\w.]*)/g,(e,t,n)=>{let[r,i]=[t,n].sort();return`${r} = ${i}`}),t}var $i=/Join/i,ea=new WeakMap;function ta(e){let t=ea.get(e);return t===void 0&&(t=di(e.name??``,e.detail??``),ea.set(e,t)),t}function na(e){return $i.test(e)?`join`:e===`Union`?`union`:null}function ra(e){let t=[],n=[];function r(e){n.push(e);let i=(e.children??[]).map(r);n.pop();let a=(e.metrics??[]).map(e=>e.name).sort().join(`,`),o=i.map(e=>Ui(e.fingerprint)).join(`,`),s=`${e.name}[${a}]{${o}}`,c=new Map,l=ta(e);if(l){let t=(e.metrics??[]).find(e=>e.name===fa);c.set(l,(c.get(l)??0)+(t?t.value:0))}for(let e of i)for(let[t,n]of e.leafRelationBytes)c.set(t,(c.get(t)??0)+n);let u=na(e.name??``);return u&&t.push({node:e,operator:u,fingerprint:`${e.name}[${a}]<${Qi(e.detail??``)}>{${o}}`,leafRelationBytes:new Map(c),ancestorNodes:n.slice()}),{fingerprint:s,leafRelationBytes:c}}return r(e),t}function ia(e){let t=null;return Ur(e,e=>{t||=ta(e)}),t}function aa(e,{minSubtreeSize:t,minOccurrences:n}){let{shapeOf:r,allNodes:i}=Zi(e),a=i.filter(e=>r.get(e).size>=t&&e.exchangeRole!==`write`),o=new Map;for(let e of a){let t=r.get(e).fingerprint;o.has(t)||o.set(t,[]),o.get(t).push(e)}let s=[...o.values()].filter(e=>e.length>=n).sort((e,t)=>r.get(t[0]).size-r.get(e[0]).size),c=new WeakSet,l=e=>{c.add(e);for(let t of e.children??[])l(t)},u=[];for(let e of s){let t=e.filter(e=>!c.has(e));if(!(t.length<n)){for(let e of t)l(e);u.push({rootName:t[0].name,subtreeSize:r.get(t[0]).size,occurrences:t.length,isExchangeRoot:ei(t[0]),sampleRelation:ia(t[0]),groupIndex:u.length,nodes:t})}}return u}function oa(e){let t=e=>{let t=[];return Ur(e,e=>t.push(e.detail??``)),t},n=e=>Qi(e).replace(/\b(\w+QueryStage)\s+\d+/g,`$1`),r=t(e[0]),i=[];for(let a of e.slice(1)){let e=t(a);if(e.length!==r.length)return!1;for(let t=0;t<r.length;t++)if(e[t]!==r[t]&&(i[t]??=n(r[t]),n(e[t])!==i[t]))return!1}return!0}function sa(e){return e.exchangeRole!==`write`&&!e.name.startsWith(`WholeStageCodegen`)}function ca(e){let t=new Map;for(let n of e)if(sa(n))for(let e of n.stageIds??[])t.set(e,(t.get(e)??0)+1);return t}function la(e,t){let n={};for(let[r,i]of ca(e))n[r]=i/(t.get(r)??i);return n}function ua(e,t,n){return e<=n.minSubtreeSize&&t<=n.minOccurrences?`low`:e>=n.minSubtreeSize*2||t>=n.minOccurrences+2?`high`:`medium`}var da=`number of files read`,fa=`size of files read`,pa=`number of written files`,ma=`written output`;function ha(e){let t=(e.metrics??[]).find(e=>e.name===`data size`);if(t)return t.value;let n=0;for(let t of e.children??[])n+=ha(t);return n}function ga(e){if((e.metrics??[]).find(e=>e.name===`data size`))return[e];let t=[];for(let n of e.children??[])t.push(...ga(n));return t}function _a(e){if(e.length<3)return null;let t=e.map(e=>e.value).sort((e,t)=>e-t),n=t[Math.floor(t.length/2)];if(n<=0)return null;let r=e.reduce((e,t)=>t.value>e.value?t:e);return{key:r.key,ratio:r.value/n,value:r.value}}function va(){return Ra.map(e=>({type:e.type,version:e.version??1,scope:e.scope,thresholds:e.thresholds,docAnchor:e.docAnchor}))}function ya(e,t){let{taskCount:n,taskDurationP50:r,taskDurationP95:i,taskDurationMax:a}=e;return r===0?null:(n??0)>=t?{ratio:i/r,metric:`P95/median`}:{ratio:a/r,metric:`max/median`}}function ba(e){let t=e?.app;if(t?.startTime==null||t?.endTime==null)return null;let n=t.endTime-t.startTime;return n>0?n:null}function xa(e,t,n){return t==null||e>=t*n}function Sa(e,t,n){let r=(e.completedAt??0)-(e.submittedAt??0),i=ba(t);return i!=null&&r>0&&r<i*n}function Ca(e,t,n,r,i=0){if(!n)return e;let a=Vi(e,t,n.stages,n.occupancy,{shortensLongestTask:!0,removedCoreWorkMs:r,longestTaskAfterFixMs:i});return a?a.wallClock.high:e}var wa=`This ratio is a point-in-time storage snapshot from stage-submission events, not a runtime read-count. Confirm against the Spark UI's Storage tab before acting.`;function Ta(e){return e<10?`low`:e>=50?`high`:`medium`}function Ea(e,t,n){let r=e.name||`RDD ${e.id}`,i=Math.round(t*100),a=100-i;return{type:`cacheUtilization`,variant:`partialCache`,stageId:null,rddId:e.id,rddName:r,impactBand:n,metric:`cachedRatio`,value:i,confidence:Ta(e.numPartitions),validationRequired:wa,memorySize:e.memorySize,diskSize:e.diskSize,numCachedPartitions:e.numCachedPartitions,numPartitions:e.numPartitions,recommendation:`RDD ${r} is ${a}% evicted from cache (${i}% of partitions cached). Increase executor memory or reduce the cached dataset size.`}}function Da(e,t,n){let r=e.name||`RDD ${e.id}`,i=Math.round(t*100);return{type:`cacheUtilization`,variant:`diskSpillover`,stageId:null,rddId:e.id,rddName:r,impactBand:n,metric:`diskRatio`,value:i,confidence:Ta(e.numPartitions),validationRequired:wa,memorySize:e.memorySize,diskSize:e.diskSize,numCachedPartitions:e.numCachedPartitions,numPartitions:e.numPartitions,recommendation:`RDD ${r} is ${i}% spilled to disk despite requesting MEMORY_AND_DISK. Executor memory may be too small for this cached dataset.`}}var Oa=.005,ka=.02;function Aa(e,t){return e<=t*1.5?`low`:e>=t*5?`high`:`medium`}function ja(e,t,n){return n===`high`?e<=t.warnPct100*1.5?`low`:e>=t.warnPct100*3?`high`:`medium`:e>=t.lowInfoPct100*.66?`low`:e<=t.lowInfoPct100*.2?`high`:`medium`}function Ma(e,t,n){return e<t*1.5?`low`:e>=n?`high`:`medium`}function Na(e,t){return e<=t*1.5?`low`:e>=t*4?`high`:`medium`}function Pa(e,t,n){let r=t>0?e/(n*t):1/0;return r<=1.5?`low`:r>=3?`high`:`medium`}function Fa(e,t,n){let r={low:0,medium:1,high:2},i=e<n.warnRatio*1.5?`low`:e>=n.critRatio?`high`:`medium`,a=t<n.minTasks*2?`low`:t>=n.minTasks*4?`high`:`medium`;return r[i]<=r[a]?i:a}function Ia(e,t,n){return e<=t*1.5?`low`:e>=n?`high`:`medium`}function La(e,t){return e<=t?`low`:e>=t*3?`high`:`medium`}var Ra=[{type:`skew`,scope:`stage`,order:30,fixEffort:`code`,version:1,docAnchor:`#bottleneck-skew`,thresholds:{ratioWarn:3,minTasksForP95:20,floorPctWarn:.005},detect(e,t){let n=ya(e,this.thresholds.minTasksForP95);if(n===null)return null;let{ratio:r,metric:i}=n;if(r<=this.thresholds.ratioWarn)return null;let a=Math.max(0,i===`P95/median`?e.taskDurationP95-e.taskDurationP50:e.taskDurationMax-e.taskDurationP50),o=Ri(e,a),s=ba(t);if(!xa(Ca(o,e.id,t,zi(e,a),Bi(e)),s,this.thresholds.floorPctWarn))return null;let c=Math.round(r*10)/10;return{type:`skew`,stageId:e.id,impactBand:`warning`,metric:i,value:c,confidence:Aa(r,this.thresholds.ratioWarn),validationRequired:`This finding is gated by a 0.5% runtime-floor threshold, our own noise floor for this metric.`,recommendation:`Task duration ratio (${i}) is ${c}×: for join-driven skew, enable AQE skew-join handling (spark.sql.adaptive.skewJoin.enabled); otherwise salt the key or repartition on a better key to reduce task skew.`}}},{type:`stageShape`,scope:`stage`,order:35,fixEffort:`code`,version:1,docAnchor:`#bottleneck-stage-shape`,thresholds:{pRatioMax:.5,oiRatioMax:10,skewWarn:3,lowParallelismFloorPct:.005},detect(e,t){let n=[],r=(e.executorStats??[]).length*(t?.app?.resources?.executor?.cores??1),i=(e.completedAt??0)-(e.submittedAt??0);if(r>0&&!Sa(e,t,this.thresholds.lowParallelismFloorPct)){let t=e.taskCount/r;t<this.thresholds.pRatioMax&&n.push({type:`stageShape`,stageId:e.id,impactBand:`info`,rule:`lowParallelism`,metric:`pRatio`,value:Math.round(t*100)/100,totalCores:r,recommendation:`This stage runs ${e.taskCount} ${e.taskCount===1?`task`:`tasks`} across ~${r} cores, so it is under-parallelized and leaves cluster capacity idle.`})}if(e.inputBytes>0){let t=e.outputBytes/e.inputBytes;t>this.thresholds.oiRatioMax&&n.push({type:`stageShape`,stageId:e.id,impactBand:`info`,rule:`dataExplosion`,metric:`oiRatio`,value:Math.round(t*10)/10,recommendation:`This stage outputs ${Math.round(t)}× its input volume: check for an exploding join or a cross product.`})}if(i>0){let t=e.taskDurationMax/i;t>this.thresholds.skewWarn&&n.push({type:`stageShape`,stageId:e.id,impactBand:`info`,rule:`taskStageSkew`,metric:`taskStageSkew`,value:Math.round(t*10)/10,totalCores:r,recommendation:`One task takes ${Math.round(t*10)/10}× this stage's wall-clock duration; a single straggler is gating the whole stage.`})}return n}},{type:`shuffle`,scope:`stage`,order:20,fixEffort:`config`,version:1,docAnchor:`#bottleneck-shuffle`,thresholds:{minBytes:50*Wi,stageFloorPct:.005},detect(e,t){let n=e.shuffleReadBytes;return n<=this.thresholds.minBytes||Sa(e,t,this.thresholds.stageFloorPct)?null:{type:`shuffle`,stageId:e.id,impactBand:`info`,metric:`shuffleReadBytes`,value:n,recommendation:`${q(n)} shuffled in this stage: consider increasing spark.sql.shuffle.partitions or adding a broadcast join.`}}},{type:`partitionSizing`,scope:`stage`,order:22,fixEffort:`config`,version:1,docAnchor:`#bottleneck-partition-sizing`,thresholds:{skewRatio:5,skewFloorBytes:256*Wi,lowParTotalBytes:Gi,lowParMaxTasks:7,maxPartBytes:5*Gi},detect(e){let t=[],{shuffleReadP50:n,shuffleReadMax:r,shuffleReadBytes:i,taskCount:a}=e;if(r>this.thresholds.skewRatio*n&&r>this.thresholds.skewFloorBytes){let i=n>0?`${Math.round(r/n*10)/10}× the median (${q(n)})`:`far larger than the median (${q(n)}, effectively empty)`;t.push({type:`partitionSizing`,stageId:e.id,impactBand:`warning`,rule:`shufflePartitionSkew`,metric:`shuffleReadMax`,value:r,recommendation:`The largest shuffle partition (${q(r)}) is ${i}: for join skew, enable AQE skew-join handling (spark.sql.adaptive.skewJoin.enabled); otherwise salt the key or repartition on a better key.`})}return i>=this.thresholds.lowParTotalBytes&&a<=this.thresholds.lowParMaxTasks&&t.push({type:`partitionSizing`,stageId:e.id,impactBand:`warning`,rule:`lowShuffleParallelism`,metric:`taskCount`,value:a,recommendation:`${Math.round(i/Gi*10)/10} GB of shuffle spread over only ${a} tasks: raise spark.sql.shuffle.partitions so each partition is smaller.`}),r>=this.thresholds.maxPartBytes&&t.push({type:`partitionSizing`,stageId:e.id,impactBand:`critical`,rule:`maxPartitionTooBig`,metric:`shuffleReadMax`,value:r,recommendation:`A single shuffle partition (${q(r)}) exceeds 5 GB: this will OOM or spill heavily. Repartition to break it up before this stage.`}),t}},{type:`spill`,scope:`stage`,order:10,fixEffort:`code`,version:1,docAnchor:`#bottleneck-spill`,thresholds:{singleTaskDiskGiB:1,singleTaskMemGiB:4,highDiskGiB:1,highTaskDiskMB:512,highMemGiB:4,medDiskMB:256,medMemGiB:1,skewRatio:5,skewDiskFloorMB:128,skewMemFloorMB:256,skewMinTasks:10,stageFloorPct:.005},detect(e,t){if(e.memoryBytesSpilled===0||Sa(e,t,this.thresholds.stageFloorPct))return null;let n=e.spillClassification,r=n===`skew`||n===`volume`,i=qi(e,this.thresholds);return{type:`spill`,stageId:e.id,impactBand:`warning`,spillMagnitude:i?.magnitude,metric:`memoryBytesSpilled`,value:e.memoryBytesSpilled,confidence:r?`medium`:`low`,validationRequired:r?`Spill cause is inferred from the share of tasks that spilled: confirm against per-task spill metrics in the Spark UI.`:`Spill cause could not be classified: inspect per-task spill metrics in the Spark UI before acting.`,recommendation:n===`skew`?`${q(e.memoryBytesSpilled)} spilled, skew-driven: fix task skew first; adding memory will not help.`:`${q(e.memoryBytesSpilled)} spilled: raise spark.sql.shuffle.partitions or increase executor memory.`}}},{type:`gc`,scope:`stage`,order:50,fixEffort:`config`,version:1,docAnchor:`#bottleneck-gc`,validationRequired:`This finding is gated by a 10-second minimum-runtime floor, our own noise floor for this metric.`,thresholds:{warnPct100:10,lowInfoPct100:5,minRunTimeMs:1e4,lowInfoFloorPct:.005},detect(e,t){let n=e.gcPct;if((e.executorRunTime??0)>=this.thresholds.minRunTimeMs&&n>this.thresholds.warnPct100){let t=Math.round(n*10)/10;return{type:`gc`,stageId:e.id,impactBand:`warning`,metric:`gcPct`,value:t,confidence:ja(n,this.thresholds,`high`),validationRequired:this.validationRequired,recommendation:`GC consumed ${t}% of executor run time: reduce object creation, use primitive types, avoid UDFs, increase executor memory.`}}if((e.executorRunTime??0)>=this.thresholds.minRunTimeMs&&n<this.thresholds.lowInfoPct100&&!Sa(e,t,this.thresholds.lowInfoFloorPct)){let t=Math.round(n*10)/10;return{type:`gc`,stageId:e.id,direction:`low`,impactBand:`info`,metric:`gcPct`,value:t,confidence:ja(n,this.thresholds,`low`),validationRequired:this.validationRequired,recommendation:`GC consumed only ${t}% of executor run time: memory may be over-provisioned; consider reducing spark.executor.memory for cost savings.`}}return null}},{type:`slowHost`,scope:`stage`,order:60,fixEffort:`config`,version:1,docAnchor:`#bottleneck-slow-host`,thresholds:{minHosts:3,minTasks:15,ratioWarn:2,minShare:.2,shareWarn:.75,taskShareWarn:.5,ratioTiers:[1.33,1.78,3.16,10],floorMs:1e3,floorBytes:64*Wi,stageFloorPct:.005},detect(e,t){let n=e.hostStats??[],r=e.executorStats??[];if(n.length<this.thresholds.minHosts&&r.length<this.thresholds.minHosts||e.taskCount<this.thresholds.minTasks||Sa(e,t,this.thresholds.stageFloorPct))return null;let i=[];if(n.length>=this.thresholds.minHosts){let t=n.map(e=>({host:e.host,taskCount:e.taskCount,mean:e.totalDuration/e.taskCount})),r=[...t].map(e=>e.mean).sort((e,t)=>e-t),a=r[Math.floor(r.length/2)];if(a>0)for(let n of t){let t=n.mean/a,r=n.taskCount/e.taskCount;t<this.thresholds.ratioWarn||r<this.thresholds.minShare||n.mean<this.thresholds.floorMs||i.push({type:`slowHost`,stageId:e.id,impactBand:`warning`,metric:`hostMeanRatio`,value:Math.round(t*10)/10,hostMeanMs:n.mean,host:n.host,hostTaskShare:Math.round(r*100)/100,recommendation:`${n.host} may just hold data locality for its tasks or carry one heavy stage, not necessarily a hardware fault: check what it was running, and consider enabling spark.speculation to relaunch a lagging task automatically.`})}let o=n.reduce((e,t)=>e+t.totalDuration,0);if(o>0)for(let t of n){let n=t.totalDuration/o,r=t.taskCount/e.taskCount;n>=this.thresholds.shareWarn&&r>=this.thresholds.taskShareWarn&&i.push({type:`slowHost`,stageId:e.id,impactBand:`warning`,variant:`durationShare`,metric:`hostDurationShare`,value:Math.round(n*100)/100,hostMeanMs:t.totalDuration/t.taskCount,host:t.host,hostTaskShare:Math.round(r*100)/100,recommendation:`${t.host} is doing ${Math.round(n*100)}% of this stage's total task time: check for data locality or partition assignment skewing work onto one node.`})}}let a=e.executorStats??[],o=this.thresholds.ratioTiers,s=e=>e>=o[3]?`critical`:e>=o[1]?`warning`:e>=o[0]?`info`:null,c=this.thresholds.floorMs,l=this.thresholds.floorBytes,u=[{dimension:`taskTime`,floor:c,samples:a.filter(e=>e.taskCount>0).map(e=>({key:e.executorId,value:e.totalDuration/e.taskCount}))},{dimension:`inputBytes`,floor:l,samples:a.map(e=>({key:e.executorId,value:e.inputBytes??0}))},{dimension:`shuffleBytes`,floor:l,samples:a.map(e=>({key:e.executorId,value:(e.shuffleReadBytes??0)+(e.shuffleWriteBytes??0)}))}],d=e.executorMetrics instanceof Map?e.executorMetrics:null;d&&d.size>=3&&u.push({dimension:`storageMemory`,floor:l,samples:[...d.entries()].map(([e,t])=>({key:e,value:(t.onHeapStorageMemory??0)+(t.offHeapStorageMemory??0)}))});for(let t of u){let n=_a(t.samples);if(!n||n.value<t.floor)continue;let r=s(n.ratio);if(!r)continue;let a=t.dimension===`taskTime`?`info`:r;i.push({type:`slowHost`,stageId:e.id,impactBand:a,variant:`multiDim`,dimension:t.dimension,metric:`execMaxMedianRatio`,value:Math.round(n.ratio*10)/10,execMaxValue:n.value,executorId:n.key,recommendation:`Executor ${n.key} deviates ${Math.round(n.ratio*10)/10}× from the median on ${t.dimension}: investigate uneven partition assignment or a degraded executor.`})}return i}},{type:`stageSlowness`,scope:`stage`,order:65,fixEffort:`code`,version:2,docAnchor:`#bottleneck-stage-slowness`,thresholds:{infoMin:15},suppressWhen(e,t){return t.some(t=>t.type===`slowHost`&&t.stageId===e.stageId)},detect(e){let t=(e.completedAt??0)-(e.submittedAt??0);if(!(t>0))return null;let n=t/6e4,r=n>=this.thresholds.infoMin?`info`:null;if(!r)return null;let i=Math.round(n*10)/10;return{type:`stageSlowness`,stageId:e.id,impactBand:r,metric:`stageDurationMinutes`,value:i,recommendation:`This stage ran ${i} minutes with no more specific cause flagged: often a partition-count problem, raise parallelism via spark.sql.shuffle.partitions or spark.default.parallelism, or check for a large per-task data volume driving heavy shuffle and spill.`}}},{type:`stageFailed`,scope:`stage`,order:42,fixEffort:`code`,version:1,docAnchor:`#bottleneck-failures`,thresholds:{},detect(e){return e.stageFailureReason==null?null:{type:`stageFailed`,stageId:e.id,impactBand:`critical`,variant:`stageFailure`,metric:`stageFailureReason`,value:e.stageFailureReason,numTasks:e.taskCount,memoryBytesSpilled:e.memoryBytesSpilled,failedTaskDetails:e.failedTaskSamples??[],recommendation:`This stage attempt failed outright. Inspect the driver log for the failure reason and the job that triggered it.`}}},{type:`failures`,scope:`stage`,order:40,fixEffort:`code`,version:1,docAnchor:`#bottleneck-failures`,thresholds:{minTasks:10,warnRate:.05,critRate:.2},detect(e){if(e.taskCount<this.thresholds.minTasks||!e.failedTasks)return null;let t=e.failedTasks/e.taskCount;if(t<=this.thresholds.warnRate)return null;let n=Math.round(t*1e3)/10,r=Ji(e.failureReasons);return{type:`failures`,stageId:e.id,impactBand:t>this.thresholds.critRate?`critical`:`warning`,metric:`failureRate`,value:n,failedTasks:e.failedTasks,dominantReason:r,recommendation:`${n}% of tasks failed${r?` (dominant reason: ${r})`:``}: investigate driver logs for executor instability or data-driven errors.`}}},{type:`straggler`,scope:`stage`,order:70,fixEffort:`code`,version:1,docAnchor:`#bottleneck-straggler`,thresholds:{minTasks:10,shareWarn:.05,shareWarnAtFloor:.025,warnPct:.1,critPct:.2,floorPctWarn:Oa,floorPctCrit:ka},detect(e,t){if(e.taskCount<this.thresholds.minTasks)return null;let n=ba(t);if(Sa(e,t,this.thresholds.floorPctWarn))return null;let r=(e.stragglerCount??0)/e.taskCount,i=(e.speculativeTasks??0)>0;if(!i&&r<=this.thresholds.shareWarnAtFloor)return null;let a=i?e.speculativeTasks/e.taskCount:0,o=Bi(e),s=Math.max(0,e.taskDurationMax-o),c=Ca(Ri(e,s),e.id,t,zi(e,s),o),l=xa(c,n,this.thresholds.floorPctWarn),u=xa(c,n,this.thresholds.floorPctCrit),d=r>this.thresholds.shareWarn||r>this.thresholds.shareWarnAtFloor&&n!=null&&l;if(!i&&!d)return null;let f=a>=this.thresholds.critPct&&u?`critical`:a>=this.thresholds.warnPct&&l?`warning`:`info`,p=i&&!(xr[d&&l?`warning`:`info`]<xr[f]),m=p?e.speculativeTasks:Math.round(r*100),h=p?`${m} speculative attempt${m===1?``:`s`} discarded`:`${m}% of tasks straggled`;return{type:`straggler`,stageId:e.id,impactBand:`info`,metric:p?`speculativeTasks`:`stragglerShare`,value:m,unit:p?`count`:`pct`,speculativeTasks:e.speculativeTasks??0,stragglerCount:e.stragglerCount??0,confidence:p?Ma(a,this.thresholds.warnPct,this.thresholds.critPct):Ma(r,this.thresholds.shareWarn,this.thresholds.critPct),validationRequired:`This finding is gated by 0.5%/2% runtime-floor thresholds, our own noise floor for this metric.`,recommendation:`${h}: rule out a GC pause or a slow shuffle fetch before assuming a hardware issue; if a skewed key is the real cause, that's a candidate for AQE's skew-join handling.`}}},{type:`speculationWaste`,scope:`stage`,order:71,fixEffort:`config`,version:1,docAnchor:`#bottleneck-speculation-waste`,thresholds:{minWasted:5,minWasteMs:6e4},detect(e){let t=e.speculationWastedAttempts??0,n=e.speculationWasteMs??0;return t<this.thresholds.minWasted||n<this.thresholds.minWasteMs?null:{type:`speculationWaste`,stageId:e.id,impactBand:`warning`,metric:`speculationWasteMs`,value:n,confidence:Na(n,this.thresholds.minWasteMs),recommendation:`Speculative execution discarded ${Math.round(n/1e3)}s of executor time in this stage; if task durations are naturally variable rather than genuine stragglers, consider tuning spark.speculation.multiplier/quantile.`}}},{type:`retryWaste`,scope:`stage`,order:45,fixEffort:`code`,version:1,docAnchor:`#bottleneck-retry-waste`,thresholds:{minWasted:3,minWasteMs:3e4},detect(e){let t=e.wastedAttempts??0,n=e.retryWasteMs??0;return t<this.thresholds.minWasted||n<this.thresholds.minWasteMs?null:{type:`retryWaste`,stageId:e.id,impactBand:`warning`,metric:`retryWasteMs`,value:n,numTasks:e.taskCount,memoryBytesSpilled:e.memoryBytesSpilled,retriedTaskDetails:e.retryTaskSamples??[],recommendation:`Retried task attempts wasted ${Math.round(n/1e3)}s of executor time (${t} attempt${t===1?``:`s`}) even though the stage completed: investigate executor loss or fetch failures.`,extended:`${t} task attempts were superseded by a later retry, wasting ${Math.round(n/1e3)}s of executor time. Common causes: executor loss (OOM-kill, node death) or shuffle FetchFailed forcing a stage-map recompute. Check driver logs for the dominant reason (see the Failures widget) even if the final failure rate looks low; retries hide the true cost.`}}},{type:`tinyTask`,scope:`stage`,order:80,fixEffort:`code`,version:1,docAnchor:`#bottleneck-tiny-tasks`,thresholds:{minTasks:100,maxP50:500,maxP95:1e3,stageFloorPct:.005},detect(e,t){if(e.taskCount<this.thresholds.minTasks||Sa(e,t,this.thresholds.stageFloorPct)||e.taskDurationP50>this.thresholds.maxP50||e.taskDurationP95>this.thresholds.maxP95)return null;let n=Math.max(1,Math.round(e.taskCount/10)),r=e.shuffleReadBytes>0?`lower spark.sql.shuffle.partitions or .coalesce(${n})`:`.coalesce(${n})`;return{type:`tinyTask`,stageId:e.id,impactBand:`info`,metric:`taskDurationP50`,value:Math.round(e.taskDurationP50),recommendation:`Many small tasks (${e.taskCount}, P50 ${Math.round(e.taskDurationP50)}ms): scheduler overhead may dominate. Try ${r}.`}}},{type:`incompleteRun`,scope:`app`,order:5,fixEffort:`code`,version:1,thresholds:{},recommendation:`This event log never recorded an ApplicationEnd event: the capture stopped before the run finished (an in-flight job, a rotated-away log, or a cut-short capture). Findings and metrics elsewhere on this board reflect only what was captured up to that point, not the full run.`,detect(e){return!e.app||e.app.startTime==null||e.app.endTime!=null?null:{type:`incompleteRun`,stageId:null,impactBand:`warning`,metric:`applicationEnd`,value:`missing`,recommendation:this.recommendation}}},{type:`coldStart`,scope:`app`,order:90,fixEffort:`code`,version:1,docAnchor:`#bottleneck-cold-start`,thresholds:{gapSeconds:30},detect(e){let{app:t,stages:n,executorsAdded:r,executorsRemoved:i}=e;if(!t||t.startTime==null||n.size===0)return null;let a=1/0;for(let e of n.values())e.submittedAt>0&&e.submittedAt<a&&(a=e.submittedAt);if(!Number.isFinite(a))return null;let o=new Map;for(let e of i)o.set(e.executorId,e.timestamp);let s=1/0;for(let e of r)if(e.timestamp>0){if(e.timestamp<=a){let t=o.get(e.executorId);if(t==null||t>a)return null}else e.timestamp<s&&(s=e.timestamp)}if(!Number.isFinite(s))return null;let c=(s-a)/1e3;if(c<=this.thresholds.gapSeconds)return null;let l=Math.round(c);return{type:`coldStart`,stageId:null,impactBand:`warning`,metric:`startupGapSeconds`,value:l,recommendation:`The first stage waited ${l}s for an executor to become available: keep a warm pool of idle executors, or if using dynamic allocation, raise the minimum/initial executor count so it doesn't scale up from zero.`}}},{type:`utilization`,scope:`app`,order:100,fixEffort:`config`,version:1,docAnchor:`#bottleneck-utilization`,thresholds:{minUtil:.6},detect(e){let{app:t,executorsAdded:n,executorsRemoved:r,runAggregates:i}=e;if(!t||n.length===0||t.startTime==null||t.endTime==null)return null;let a=t.endTime-t.startTime;if(a<=0)return null;let o=xi(t,n,r);if(o<=0)return null;let s=o*a,c=(i?.busyCoreMs??0)/s;if(c>=this.thresholds.minUtil)return null;let l=null;if(o>0){let t=0;for(let n of e.stages.values())t+=Nr(n.executorCpuTime??0);l=Math.round(t/(a*o)*100)}let u=Math.round(c*100);return{type:`utilization`,stageId:null,impactBand:`info`,metric:`avgUtilization`,value:u,utilizationFraction:c,appDurationMs:a,totalCores:o,cpuUtilizationPct:l,recommendation:`Average executor utilization was only ${u}%: consider reducing cluster size or enabling dynamic allocation.`}}},{type:`memoryUtilization`,scope:`app`,order:102,fixEffort:`config`,version:1,docAnchor:`#bottleneck-memory-utilization`,thresholds:{idleCoreWarn:.5,bandTooSmall:.95,bandTooHigh:.7,wasteBufferMultiplier:1.5},detect(e){let{app:t,executorsAdded:n,executorsRemoved:r,runAggregates:i,stages:a}=e,o=[];if(t?.startTime==null||t?.endTime==null)return o;let s=t.endTime-t.startTime;if(s<=0)return o;let c=Si(n,r),l=xi(t,n,r),u=t.resources?.executor?.memoryMB??null;if(i&&l>0){let e=l*s,t=e>0?1-i.busyCoreMs/e:0;if(t>this.thresholds.idleCoreWarn){let e=Math.round(t*100);o.push({type:`memoryUtilization`,variant:`idleCores`,stageId:null,impactBand:`warning`,metric:`idleCoreRate`,value:e,idleRateFraction:t,allocatedMB:u,peakExecutors:c,appDurationMs:s,recommendation:`${e}% of allocated core-time ran no task: reduce cluster size or enable dynamic allocation.`})}}let d=new Map;for(let e of a.values()){let t=e.executorMetrics;if(t instanceof Map)for(let[e,n]of t){let t=n?.jvmHeapMemory??0;t>(d.get(e)??0)&&d.set(e,t)}}if(d.size===0)o.push({type:`memoryUtilization`,variant:`memoryBand`,stageId:null,impactBand:`info`,metric:`memoryBand`,dataUnavailable:!0,recommendation:`Per-executor memory usage requires spark.eventLog.logStageExecutorMetrics=true: not enabled for this run.`});else if(u!=null&&u>0){let e=u*1024*1024;for(let[t,n]of d){let r=n/e;r>this.thresholds.bandTooSmall?o.push({type:`memoryUtilization`,variant:`memoryBand`,rule:`heapNearCapacity`,stageId:null,executorId:t,impactBand:`warning`,metric:`heapUsedRatio`,value:Math.round(r*100),recommendation:`Executor ${t} peaked at ${Math.round(r*100)}% of allocated heap: memory may be too small; raise spark.executor.memory to avoid OOM/spill.`}):r<this.thresholds.bandTooHigh&&o.push({type:`memoryUtilization`,variant:`memoryBand`,rule:`heapOverProvisioned`,stageId:null,executorId:t,impactBand:`info`,metric:`heapUsedRatio`,value:Math.round(r*100),allocatedBytes:e,heap:n,appDurationMs:s,recommendation:`Executor ${t} used only ${Math.round(r*100)}% of allocated heap: memory may be over-provisioned; consider reducing spark.executor.memory for cost savings.`})}}if(u!=null&&c>0){let e=c*u*(s/1e3),t=0;for(let e of a.values())t+=e.executorRunTime??0;let n=t/1e3*u,r=e-n;if(r>this.thresholds.wasteBufferMultiplier*n){let e=Math.round(r);o.push({type:`memoryUtilization`,variant:`wasteModel`,stageId:null,impactBand:`info`,metric:`wastedMBSeconds`,value:e,confidence:Pa(r,n,this.thresholds.wasteBufferMultiplier),validationRequired:`Memory-waste estimate uses allocated-vs-used memory-time and a 1.5x buffer: confirm against the Spark UI before acting.`,recommendation:`Allocated executor memory sat largely idle over the run (~${e.toLocaleString(`en-US`)} MB-seconds wasted): review spark.executor.memory and executor count.`})}}return o}},{type:`cacheUtilization`,scope:`app`,order:103,fixEffort:`code`,version:1,docAnchor:`#bottleneck-cache-utilization`,thresholds:{cachedRatioWarn:.5,cachedRatioInfo:.9,diskRatioWarn:.4,diskRatioInfo:.15},detect(e){let t=e.app?.rddInfo;if(!(t instanceof Map))return null;let n=[];for(let e of t.values()){let t=e.storageLevel??{};if((t.useMemory||t.useDisk)&&(e.numCachedPartitions??0)>0){if((e.numPartitions??0)>0){let t=e.numCachedPartitions/e.numPartitions;t<this.thresholds.cachedRatioWarn?n.push(Ea(e,t,`warning`)):t<this.thresholds.cachedRatioInfo&&n.push(Ea(e,t,`info`))}if(t.useMemory&&t.useDisk){let t=(e.memorySize??0)+(e.diskSize??0);if(t>0){let r=(e.diskSize??0)/t;r>this.thresholds.diskRatioWarn?n.push(Da(e,r,`warning`)):r>this.thresholds.diskRatioInfo&&n.push(Da(e,r,`info`))}}}}return n}},{type:`coreLocality`,scope:`app`,order:103,fixEffort:`config`,version:1,docAnchor:`#bottleneck-core-locality`,thresholds:{minTasks:50,warnRatio:.15,critRatio:.35},detect(e){let{totalTasks:t,nonLocalTasks:n,ratio:r}=Di([...e.stages.values()]);if(t==null||t<this.thresholds.minTasks||r<this.thresholds.warnRatio)return null;let i=Math.round(r*100);return{type:`coreLocality`,stageId:null,impactBand:r>=this.thresholds.critRatio?`critical`:`warning`,metric:`nonLocalRatio`,value:i,nonLocalTaskCount:n,confidence:Fa(r,t,this.thresholds),validationRequired:`This finding is gated by 15%/35% non-local-ratio thresholds (and a 50-task minimum), our own noise floor for this metric.`,recommendation:`${i}% of tasks (${n}) ran without process- or node-local data placement: check spark.locality.wait settings and executor/data colocation.`}}},{type:`autoscalingChurn`,scope:`app`,order:103,fixEffort:`config`,version:1,docAnchor:`#bottleneck-autoscaling-churn`,thresholds:{shortLivedMs:12e4,warningPct:.3,criticalPct:.6,minExecutors:5},detect(e){let{app:t,executorsAdded:n,executorsRemoved:r}=e;if(!t||n.length===0||t.endTime==null||n.length<this.thresholds.minExecutors)return null;let i=new Map;for(let e of r)i.set(e.executorId,e.timestamp);let a=0;for(let e of n)(i.has(e.executorId)?i.get(e.executorId):t.endTime)-e.timestamp<this.thresholds.shortLivedMs&&a++;let o=a/n.length,s=o>this.thresholds.criticalPct?`critical`:o>this.thresholds.warningPct?`warning`:null;if(!s)return null;let c=Math.round(o*100);return{type:`autoscalingChurn`,stageId:null,impactBand:s,metric:`shortLivedExecutorPct`,value:c,shortLivedExecutorCount:a,confidence:Ia(o,this.thresholds.warningPct,this.thresholds.criticalPct),recommendation:`${c}% of executors ran for under 2 minutes before being removed. This looks like wasteful re-provisioning rather than normal scale-down; consider raising spark.dynamicAllocation.executorIdleTimeout or widening the minExecutors/maxExecutors bounds to reduce flapping.`}}},{type:`cachingOpportunity`,scope:`app`,order:105,fixEffort:`code`,version:1,docAnchor:`#bottleneck-caching-opportunity`,thresholds:{minExecutions:2},detect(e){let t=e.sql;if(!(t instanceof Map)||t.size===0)return null;let n=new Map;for(let e of t.values()){if(!e.planTree)continue;let t=new Map;Ur(e.planTree,e=>{let n=ta(e);if(!n)return;let r=(e.metrics??[]).find(e=>e.name===fa);t.set(n,(t.get(n)??0)+(r?r.value:0))});for(let[r,i]of t){let t=n.get(r);if(!t){let e=r.indexOf(`:`);t={format:r.slice(0,e),relation:r.slice(e+1),executionIds:new Set,executionBytes:new Map},n.set(r,t)}t.executionIds.add(e.id),t.executionBytes.set(e.id,(t.executionBytes.get(e.id)??0)+i)}}let r=new Map;for(let e of t.values()){if(!e.planTree)continue;let t=ra(e.planTree),n=new Map(t.map(e=>[e.node,e.fingerprint])),i=new Map;for(let e of t){let t=i.get(e.fingerprint);t||(t={operator:e.operator,node:e.node,leafRelationBytes:new Map,ancestorFingerprints:new Set(e.ancestorNodes.map(e=>n.get(e)).filter(e=>!!e))},i.set(e.fingerprint,t));for(let[n,r]of e.leafRelationBytes)t.leafRelationBytes.set(n,(t.leafRelationBytes.get(n)??0)+r)}for(let[t,n]of i){let i=r.get(t);i||(i={operator:n.operator,exampleNode:n.node,executionIds:new Set,executionBytes:new Map,ancestorFingerprints:new Set,leafRelationRids:new Set},r.set(t,i)),i.executionIds.add(e.id);let a=[...n.leafRelationBytes.values()].reduce((e,t)=>e+t,0);i.executionBytes.set(e.id,(i.executionBytes.get(e.id)??0)+a);for(let e of n.ancestorFingerprints)i.ancestorFingerprints.add(e);for(let e of n.leafRelationBytes.keys())i.leafRelationRids.add(e)}}let i=e=>r.has(e)&&r.get(e).executionIds.size>=this.thresholds.minExecutions,a=new Map;for(let[e,t]of r){if(!i(e)){a.set(e,{finalExecutionIds:t.executionIds,suppressed:!0});continue}let n=[...t.ancestorFingerprints].filter(i).map(e=>r.get(e));if(n.length===0){a.set(e,{finalExecutionIds:t.executionIds,suppressed:!1});continue}let o=new Set(n.flatMap(e=>[...e.executionIds])),s=new Set([...t.executionIds].filter(e=>!o.has(e)));s.size===0||s.size<this.thresholds.minExecutions?a.set(e,{finalExecutionIds:s,suppressed:!0}):a.set(e,{finalExecutionIds:s,suppressed:!1})}let o=e=>e.slice(e.indexOf(`:`)+1),s={join:[`joined`,`join`],union:[`unioned`,`union`]},c=[],l=new Map;for(let[e,t]of r){let n=a.get(e);if(n.suppressed)continue;let r=[...n.finalExecutionIds].sort((e,t)=>e-t),i=r.reduce((e,n)=>e+(t.executionBytes.get(n)??0),0),u=[...t.leafRelationRids].sort();if(u.length===0)continue;let d=u.map(e=>{let t=e.indexOf(`:`);return{relation:e.slice(t+1),format:e.slice(0,t)}}),[f,p]=s[t.operator],m=u.map(o).join(` ${p} `),h=r.length,g=i>=128*Wi?`${f[0].toUpperCase()}${f.slice(1)} result read by ${h} queries (~${q(i)}). Cache/persist the ${f} DataFrame so it is computed once.`:`${f[0].toUpperCase()}${f.slice(1)} result read by ${h} queries. Cache the ${f} DataFrame, or reconsider whether it needs to be recomputed each time.`;c.push({type:`cachingOpportunity`,variant:`composite`,stageId:null,impactBand:`info`,metric:`executionReuse`,value:h,format:`derived`,relations:d,operator:t.operator,relation:m,executionIds:r,totalReadBytes:i,confidence:La(h,this.thresholds.minExecutions),validationRequired:`Composite reuse is inferred from a structural plan-shape match (operator + normalized join/filter condition + child shapes) across SQL executions; confirm these executions truly compute the same join/union before caching.`,recommendation:g});for(let e of u){l.has(e)||l.set(e,new Set);for(let t of r)l.get(e).add(t)}}for(let[e,t]of n){let n=l.get(e),r=n?[...t.executionIds].filter(e=>!n.has(e)):[...t.executionIds];if(r.length<this.thresholds.minExecutions)continue;let i=r.length,a=r.reduce((e,n)=>e+(t.executionBytes.get(n)??0),0),o=a>=128*Wi?`Read by ${i} queries (~${q(a)}). Cache/persist the shared DataFrame so it is scanned once.`:`Read by ${i} queries. Cache the shared DataFrame, or broadcast it if it is a small join lookup.`;c.push({type:`cachingOpportunity`,stageId:null,impactBand:`info`,metric:`executionReuse`,value:i,relation:t.relation,format:t.format,executionIds:r.sort((e,t)=>e-t),totalReadBytes:a,confidence:La(i,this.thresholds.minExecutions),validationRequired:`Relation-reuse is inferred from the pre-AQE plan scan identity across SQL executions; confirm the reads are the same data and cacheable within one session before acting.`,recommendation:o})}return c}},{type:`jobFailureRate`,scope:`app`,order:110,fixEffort:`code`,version:1,docAnchor:`#bottleneck-job-failure-rate`,thresholds:{infoRate:.1,warnRate:.3,critRate:.5},detect(e){let{jobs:t,stages:n}=e,r=(t?[...t.values()]:[]).filter(e=>e.result!=null);if(r.length===0)return null;let i=r.filter(e=>e.succeeded===!1),a=i.length,o=a/r.length;if(o<this.thresholds.infoRate)return null;let s=0,c=0;for(let e of n.values())s+=e.taskCount??0,c+=e.failedTasks??0;let l=s>0?c/s:0,u=i.filter(e=>e.submissionTime!=null&&e.completionTime!=null),d=u.length>0?u.reduce((e,t)=>e+(t.completionTime-t.submissionTime),0)/u.length:0,f=r.length;return{type:`jobFailureRate`,stageId:null,impactBand:o>=this.thresholds.critRate?`critical`:o>=this.thresholds.warnRate?`warning`:`info`,metric:`jobFailureRate`,value:Math.round(o*1e3)/10,failedJobs:a,totalJobs:f,failedTasks:c,totalTasks:s,avgJobDurationMs:d,taskFailureRate:Math.round(l*1e3)/10,recommendation:`${a} of ${f} jobs never recovered: inspect the driver log for the failed job(s) and the stage failures that triggered them.`}}},{type:`configAudit`,scope:`config`,order:120,fixEffort:`config`,version:1,inScorecard:!1,docAnchor:`#config-shuffle-service`,thresholds:{},property:`spark.shuffle.service.enabled`,detect(e){let t=e.app?.resources??null;return t?.dynamicAllocationEnabled===!0&&t?.shuffleServiceEnabled===!1?{type:`configAudit`,property:`spark.shuffle.service.enabled`,impactBand:`warning`,metric:`config`,value:`false`,recommendation:`Dynamic allocation is on but the external shuffle service is off: set spark.shuffle.service.enabled=true so shuffle data survives executor removal.`}:null}},{type:`configAudit`,scope:`config`,order:121,fixEffort:`config`,version:1,inScorecard:!1,docAnchor:`#config-autoscale-bounds`,thresholds:{},property:`spark.dynamicAllocation.maxExecutors`,detect(e){let t=e.app,n=t?.config??{};if((t?.resources??null)?.dynamicAllocationEnabled!==!0)return null;let r=n[`spark.dynamicAllocation.minExecutors`]==null?null:parseInt(n[`spark.dynamicAllocation.minExecutors`],10),i=n[`spark.dynamicAllocation.maxExecutors`]==null?null:parseInt(n[`spark.dynamicAllocation.maxExecutors`],10);return r!=null&&i!=null&&r>i?{type:`configAudit`,property:`spark.dynamicAllocation.minExecutors`,impactBand:`critical`,metric:`config`,value:`${r} > ${i}`,recommendation:`Autoscaling bounds are inverted: spark.dynamicAllocation.minExecutors (${r}) exceeds maxExecutors (${i}). Set min ≤ max.`}:i==null?{type:`configAudit`,property:`spark.dynamicAllocation.maxExecutors`,impactBand:`info`,metric:`config`,value:`(unset)`,recommendation:`Dynamic allocation is on with no upper bound: set spark.dynamicAllocation.maxExecutors to cap cluster growth.`}:null}},{type:`configAudit`,scope:`config`,order:122,fixEffort:`config`,version:1,inScorecard:!1,docAnchor:`#config-serializer`,thresholds:{},property:`spark.serializer`,detect(e){let t=e.app,n=t?.config??{},r=t?.resources??null;if(Object.keys(n).length===0)return null;let i=r?.serializer??n[`spark.serializer`]??null;return typeof i==`string`&&/kryo/i.test(i)?null:{type:`configAudit`,property:`spark.serializer`,impactBand:`info`,metric:`config`,value:i??`(default JavaSerializer)`,recommendation:`Current serializer is ${i??`the default JavaSerializer`}: consider spark.serializer=org.apache.spark.serializer.KryoSerializer for faster, smaller buffers.`}}},{type:`configAudit`,scope:`config`,order:123,fixEffort:`config`,version:1,inScorecard:!1,docAnchor:`#config-memory-overhead`,thresholds:{floorMB:384,floorPct:.1},property:`spark.executor.memoryOverhead`,detect(e){let t=e.app?.resources??null,n=t?.executor?.memoryMB??null,r=t?.executor?.memoryOverheadMB??null;if(n==null||r==null)return null;let i=Math.max(this.thresholds.floorMB,Math.round(n*this.thresholds.floorPct));return r>=i?null:{type:`configAudit`,property:`spark.executor.memoryOverhead`,impactBand:`info`,metric:`config`,value:`${r} MiB`,recommendation:`Executor memoryOverhead (${r} MiB) is below Spark's default floor of ${i} MiB (max of 384 MiB or 10% of executor memory): raise it to avoid off-heap OOM-kills.`}}},{type:`duplicatePlanSubtree`,scope:`sql`,order:130,fixEffort:`code`,version:2,docAnchor:`#bottleneck-duplicate-plan-subtree`,thresholds:{minSubtreeSize:3,minOccurrences:2,stageFloorPct:.005},detect(e,t){if(!e.planTree)return null;let n=aa(e.planTree,this.thresholds);if(n.length===0)return null;let r=Yi(e.id,t.stages),i=[];Ur(e.planTree,e=>i.push(e));let a=ca(i),o=ba(t),s=n.map(n=>{let i=[];for(let e of n.nodes)Ur(e,e=>i.push(e));let s=Xi(i,r),c=0;for(let e of s){let n=t.stages.get(e);n&&(c+=Math.max(0,(n.completedAt??0)-(n.submittedAt??0)))}if(o!=null&&c>0&&c<o*this.thresholds.stageFloorPct)return null;let l=oa(n.nodes),u=la(i,a),d=i.map(e=>e.id).filter(Boolean),f=n.sampleRelation?` (touching ${n.sampleRelation})`:``,p=l?``:` Their filters, columns or scanned tables differ, so the repeats may compute different data.`;return{type:`duplicatePlanSubtree`,executionId:e.id,stageIds:s,planNodeIds:d,stageShares:u,occurrencesIdentical:l,impactBand:l&&Object.keys(u).length>0?`warning`:`info`,metric:`subtreeOccurrences`,value:n.occurrences,rootName:n.rootName,subtreeSize:n.subtreeSize,sampleRelation:n.sampleRelation,groupIndex:n.groupIndex,confidence:l?ua(n.subtreeSize,n.occurrences,this.thresholds):`low`,validationRequired:`Duplicate-subtree matching compares operator names and metric names only, not literal values or expr IDs: confirm the repeated work is real in the Spark SQL plan tab before acting.`,recommendation:(n.isExchangeRoot?`A ${n.subtreeSize}-node subtree rooted at ${jr(n.rootName)} repeats ${n.occurrences}x in this plan${f}: this looks like a possible missed exchange reuse; check whether the same shuffle could be computed once and reused.`:`A ${n.subtreeSize}-node subtree rooted at ${jr(n.rootName)} repeats ${n.occurrences}x in this plan${f}: consider caching/persisting the shared computation or check for a duplicated query branch.`)+p}}).filter(e=>e!==null);return s.length>0?s:null}},{type:`smallFiles`,scope:`sql`,order:131,fixEffort:`config`,version:2,docAnchor:`#bottleneck-small-files`,thresholds:{minFiles:100,maxAvgFileSizeMB:3},detect(e,t){if(!e.planTree)return null;let{minFiles:n,maxAvgFileSizeMB:r}=this.thresholds,i=[];if(Ur(e.planTree,e=>{let t=e.metrics??[],a=e=>t.find(t=>t.name===e),o=(t,a,o)=>{if(!t||!a||!(t.value>n))return;let s=a.value/t.value;s<r*Wi&&i.push({direction:o,fileCount:t.value,avgBytes:s,nodeName:e.name,node:e})};o(a(da),a(fa),`read`),o(a(pa),a(ma),`write`)}),i.length===0)return null;let a=Yi(e.id,t.stages);return i.map(t=>{let n=Xi([t.node],a),r=t.node.id?[t.node.id]:[];return{type:`smallFiles`,executionId:e.id,stageIds:n,planNodeIds:r,impactBand:`warning`,metric:`avgFileSizeBytes`,value:Math.round(t.avgBytes),fileCount:t.fileCount,direction:t.direction,nodeName:t.nodeName,recommendation:t.direction===`read`?`${t.fileCount} small files were read at ${jr(t.nodeName)}: consider compacting the upstream output so fewer, larger files are produced.`:`${t.fileCount} small files were written at ${jr(t.nodeName)}: repartition or coalesce before writing to raise the average file size.`}})}},{type:`broadcastSizing`,scope:`sql`,order:132,fixEffort:`config`,version:2,docAnchor:`#bottleneck-broadcast-sizing`,thresholds:{broadcastTiers:[10*Wi,100*Wi,Gi,5*Gi],comparisonTiers:[10*Gi,300*Gi,Ki],overBroadcastBytes:Gi},detect(e,t){if(!e.planTree)return null;let{broadcastTiers:n,comparisonTiers:r,overBroadcastBytes:i}=this.thresholds,a=Yi(e.id,t.stages),o=[];return Ur(e.planTree,t=>{if(t.name===`SortMergeJoin`&&(t.children??[]).length===2){let[i,s]=t.children,c=ha(i),l=ha(s),u=Math.min(c,l),d=Math.max(c,l);if(u>0&&(u<n[0]||u<n[1]&&d>r[0]||u<n[2]&&d>r[1]||u<n[3]&&d>r[2])){let t=[...ga(i),...ga(s)];o.push({type:`underBroadcast`,executionId:e.id,stageIds:Xi(t,a),planNodeIds:t.map(e=>e.id).filter(Boolean),impactBand:`info`,metric:`smallerSideBytes`,value:u,largerSideBytes:d,recommendation:`The smaller input to this Sort Merge Join (${q(u)}) is well under the broadcast threshold relative to the larger side (${q(d)}): this could have been a broadcast join. Consider a broadcast() hint or raising spark.sql.autoBroadcastJoinThreshold.`})}}if(ti(t.name)){let n=(t.metrics??[]).find(e=>e.name===`data size`);if(n&&n.value>i){let r=(t.children??[])[0];o.push({type:`overBroadcast`,executionId:e.id,stageIds:Xi(r?[r]:[],a),planNodeIds:[t.id].filter(Boolean),impactBand:`warning`,metric:`broadcastBytes`,value:n.value,recommendation:`This broadcast (${q(n.value)}) exceeds the 1 GB threshold: check for a misapplied broadcast hint or a misconfigured spark.sql.autoBroadcastJoinThreshold.`})}}}),o.length?o:null}}];function za(e){throw Error(`Unreachable case: ${JSON.stringify(e)}`)}var Ba=125e6,Va=2e8;function Ha(e){let t=(Array.isArray(e.executorStats)?e.executorStats:[]).reduce((e,t)=>e+(t.totalDuration??0),0),n=e.taskCount??0,r=(e.completedAt??0)-(e.submittedAt??0),i=t-(e.executorRunTime??0);return t<=0||n<=0||r<=0||i<=0?null:{perTaskMs:i/n,concurrency:t/r}}function Ua(e){let t=Array.isArray(e.executorStats)?e.executorStats.length:0;return Math.max(1,t)}function Wa(e){let t=e.fetchWaitTime,n=e.executorRunTime??0,r=(e.completedAt??0)-(e.submittedAt??0);return typeof t!=`number`||n<=0||r<=0?null:t/(n/r)}function Ga(e){let t=e.retryWasteMs??0,n=e.wastedAttempts??0,r=Array.isArray(e.retryTaskSamples)?e.retryTaskSamples:[];if(t<=0||n<=0||r.length<n)return t;let i=r.reduce((e,t)=>Math.max(e,(t.attemptNumber??0)+1),1),a=Math.max(1,e.peakConcurrentTasks??1);return Math.min(t,Math.max(i*t/n,t/a))}var Ka=134217728,qa=50,Ja=10,Ya=125e6,Xa=20,Za=15e3,Qa=125e6,$a={shortensLongestTask:!0};function J(e,t){return t?{basis:`resourceOnly`,wallClock:null,estimateMethod:e,rawWaste:t}:{basis:`informational`,wallClock:null,estimateMethod:e}}function eo(e,t,n,r,i,a,o){let s=Vi(e,t,n,r,o);return s?{basis:s.basis,wallClock:s.wallClock,estimateMethod:i,rawWaste:a}:J(i,a)}function to(e,t,n,r){let i=e>0?{value:e,unit:`ms`}:void 0;if(!t||t.length===0)return J(`modeled`,i);let a=e/t.length,o=Hi(t,new Map(t.map(e=>[e,a])),n,r);return o?{basis:o.basis,wallClock:o.wallClock,estimateMethod:`modeled`,rawWaste:i}:J(`modeled`,i)}function no(e,t,n,r){switch(e.type){case`retryWaste`:{if(e.stageId==null)return null;let r=t.get(e.stageId);if(!r)return null;let i=r.retryWasteMs??0,a=Ga(r);return eo(a,e.stageId,t,n,a===i?`measured`:`modeled`,{value:i,unit:`ms`})}case`speculationWaste`:{if(e.stageId==null)return null;let r=t.get(e.stageId);if(!r)return null;let i=r.speculationWasteMs??0;return eo(i,e.stageId,t,n,`measured`,{value:i,unit:`ms`})}case`coldStart`:{if(typeof e.value!=`number`)return null;let t=e.value*1e3;return{basis:`serial`,wallClock:{low:t,high:t},estimateMethod:`measured`}}case`gc`:{if(e.direction===`low`)return J(`none`);if(e.stageId==null)return null;let r=t.get(e.stageId);if(!r)return null;let i=(r.completedAt??0)-(r.submittedAt??0),a=r.executorRunTime??0,o=r.jvmGCTime??0,s={value:o,unit:`coreMs`};return a<=0||i<=0?J(`modeled`,s):eo(o/(a/i),e.stageId,t,n,`modeled`,s)}case`skew`:{if(e.stageId==null)return null;let r=t.get(e.stageId);if(!r)return null;let i=r.taskDurationP50??0,a=e.metric===`P95/median`,o=Math.max(0,a?(r.taskDurationP95??0)-i:(r.taskDurationMax??0)-i),s=Ri(r,o);return eo(s,e.stageId,t,n,`measured`,{value:s,unit:`ms`},{...$a,removedCoreWorkMs:zi(r,o),longestTaskAfterFixMs:Bi(r)})}case`straggler`:case`stageShape`:{if(e.type===`stageShape`){if(e.rule===`lowParallelism`){let n=t.get(e.stageId);if(!n)return null;let r=(n.completedAt??0)-(n.submittedAt??0);return J(`measured`,{value:Math.max(0,(e.totalCores??0)-(n.taskCount??0))*r,unit:`coreMs`})}if(e.rule===`dataExplosion`){let n=t.get(e.stageId);return n?J(`measured`,{value:Math.max(0,(n.outputBytes??0)-(n.inputBytes??0)),unit:`bytes`}):null}if(e.rule===`taskStageSkew`){let n=t.get(e.stageId);if(!n)return null;let r=e.totalCores??0,i=n.taskCount??0;return J(`measured`,{value:Math.max(0,Math.min(r,i)-1)*Math.max(0,(n.taskDurationMax??0)-(n.taskDurationP50??0)),unit:`coreMs`})}return null}if(e.stageId==null)return null;let r=t.get(e.stageId);if(!r)return null;let i=Bi(r),a=Math.max(0,(r.taskDurationMax??0)-i),o=Ri(r,a);return eo(o,e.stageId,t,n,`measured`,{value:o,unit:`ms`},{...$a,removedCoreWorkMs:zi(r,a),longestTaskAfterFixMs:i})}case`slowHost`:{let r=e.metric===`hostMeanRatio`||e.variant===`durationShare`?e.hostMeanMs:e.variant===`multiDim`&&e.dimension===`taskTime`?e.execMaxValue:null;if(r==null)return J(`none`);if(e.stageId==null)return null;let i=t.get(e.stageId);if(!i)return null;let a=Math.max(0,r-(i.taskDurationP50??0));return eo(a,e.stageId,t,n,`measured`,{value:a,unit:`ms`})}case`duplicatePlanSubtree`:{let r=e.stageIds;if(!r||r.length===0)return null;let i=typeof e.value==`number`?e.value:0;if(i<2||e.occurrencesIdentical===!1)return J(`none`);let a=e.stageShares??null,o=(i-1)/i,s=new Map;for(let e of r){let n=t.get(e),r=a?a[e]??0:1;if(n&&r>0){let t=n.taskActiveMs??Math.max(0,(n.completedAt??0)-(n.submittedAt??0));s.set(e,t*r*o)}}if(s.size===0)return J(`none`);let c={value:[...s.values()].reduce((e,t)=>e+t,0),unit:`ms`},l=Hi([...s.keys()],s,t,n);return l?{basis:l.basis,wallClock:l.wallClock,estimateMethod:`measured`,rawWaste:c}:J(`measured`,c)}case`shuffle`:{if(e.stageId==null)return null;let r=t.get(e.stageId);if(!r)return null;let i=r.shuffleReadBytes??0,a=i/(Ba*Ua(r))*1e3,o=Wa(r);return eo(o==null?a:Math.min(a,o),e.stageId,t,n,o!=null&&o<a?`measured`:`modeled`,{value:i,unit:`bytes`})}case`spill`:{if(e.stageId==null)return null;let r=t.get(e.stageId);if(!r)return null;let i=r.diskBytesSpilled??0;return eo(i/(Va*Ua(r))*1e3,e.stageId,t,n,`modeled`,{value:i,unit:`bytes`})}case`stageSlowness`:{if(e.stageId==null)return null;let i=t.get(e.stageId);if(!i)return null;if(r<=0)return J(`modeled`);let a=(i.inputBytes??0)+(i.shuffleReadBytes??0),o=typeof i.taskActiveMs==`number`?i.taskActiveMs:Math.max(0,(i.completedAt??0)-(i.submittedAt??0)),s=i.taskCount??0,c=a>0?o*Math.max(0,1-s/r):0;return eo(c,e.stageId,t,n,`modeled`,{value:c,unit:`ms`},$a)}case`partitionSizing`:{if(e.stageId==null)return null;let r=t.get(e.stageId);if(!r)return null;let i=0;if(e.rule===`maxPartitionTooBig`)i=(r.shuffleReadMax??0)/Ba*1e3;else if(e.rule===`shufflePartitionSkew`)i=Math.max(0,(r.shuffleReadMax??0)-(r.shuffleReadP50??0))/Ba*1e3;else if(e.rule===`lowShuffleParallelism`){let e=Math.ceil((r.shuffleReadBytes??0)/Ka),t=r.taskCount??0;e>t&&t>0&&(i=Math.max(0,(r.completedAt??0)-(r.submittedAt??0))*(1-t/e))}else return null;return eo(i,e.stageId,t,n,`modeled`,{value:i,unit:`ms`})}case`tinyTask`:{if(e.stageId==null)return null;let r=t.get(e.stageId);if(!r)return null;let i=r.taskCount??0,a=Math.max(0,i-Math.round(i/10)),o=Ha(r);if(o){let r=a*o.perTaskMs/Math.max(1,o.concurrency);return eo(r,e.stageId,t,n,`measured`,{value:r,unit:`ms`})}let s=a*qa;return eo(s,e.stageId,t,n,`modeled`,{value:s,unit:`ms`})}case`smallFiles`:{let r=(e.fileCount??0)*Ja,i=e.stageIds,a=1;if(e.direction===`read`)for(let e of i??[])a=Math.max(a,t.get(e)?.peakConcurrentTasks??1);return to(r/a,i,t,n)}case`overBroadcast`:return to((e.value??0)/Ya*1e3,e.stageIds,t,n);case`underBroadcast`:return to((e.value??0)/Ya*1e3,e.stageIds,t,n);case`memoryUtilization`:if(e.variant===`wasteModel`&&typeof e.value==`number`)return J(`measured`,{value:e.value,unit:`mbSeconds`});if(e.variant===`idleCores`){let t=e.idleRateFraction,n=e.allocatedMB,r=e.peakExecutors,i=e.appDurationMs;return t!=null&&n!=null&&r!=null&&i!=null?J(`modeled`,{value:t*n*r*(i/1e3),unit:`mbSeconds`}):J(`modeled`)}if(e.variant===`memoryBand`&&e.rule===`heapOverProvisioned`){let t=e.allocatedBytes,n=e.heap,r=e.appDurationMs;if(t!=null&&n!=null&&r!=null)return J(`modeled`,{value:(t-n)/1048576*(r/1e3),unit:`mbSeconds`})}return J(`modeled`);case`utilization`:{let t=e.utilizationFraction,n=e.appDurationMs,r=e.totalCores;return t==null||n==null||r==null?J(`measured`):J(`measured`,{value:(1-t)*n*r/36e5,unit:`coreHours`})}case`coreLocality`:return J(`modeled`,{value:(e.nonLocalTaskCount??0)*Xa,unit:`coreMs`});case`autoscalingChurn`:return J(`modeled`,{value:(e.shortLivedExecutorCount??0)*Za/36e5,unit:`coreHours`});case`configAudit`:return J(`none`);case`jobFailureRate`:return J(`modeled`,{value:(e.failedJobs??0)*(e.avgJobDurationMs??0)/36e5,unit:`coreHours`});case`cachingOpportunity`:return J(`modeled`,{value:(e.totalReadBytes??0)/Qa*1e3,unit:`ms`});case`cacheUtilization`:{let t=e.memorySize??0,n=e.diskSize??0,r=e.numCachedPartitions??0,i=e.numPartitions??0,a=Math.max(0,i-r),o=t+n;return J(`modeled`,{value:((r>0?o/r*a:0)+n)/Qa*1e3,unit:`ms`})}case`stageFailed`:case`failures`:case`incompleteRun`:return J(`none`);default:return null}}function ro(e,t,n=0){let r=Ii(t,n);for(let i of e){let e=no(i,t,r,n);e&&(i.impactEstimate=e)}return e}var io=Oa,ao=ka;function oo(e){if(e?.startTime==null||e?.endTime==null)return null;let t=e.endTime-e.startTime;return t>0?t:null}function so(e,t){let n=oo(t);if(n==null)return e;for(let t of e){if(t.type===`partitionSizing`&&t.rule===`maxPartitionTooBig`)continue;let e=t.impactEstimate?.wallClock?.high;if(e==null)continue;let r=e/n;t.impactBand=r>=ao?`critical`:r>=io?`warning`:`info`}return e}function co(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,`0`)}function lo(e){let t=e.stageId??e.executionId??e.property??``,n=e.type===`memoryUtilization`?void 0:e.rule,r=[e.host,e.executorId,n,e.variant,e.dimension,e.direction,e.nodeName,e.rootName,e.subtreeSize,e.groupIndex,e.largerSideBytes,e.rddId,e.relation,e.format,e.operator,e.executionIds?e.executionIds.join(`,`):``].map(e=>e??``).join(`|`);return co(`${e.type}|${t}|${e.metric??``}|${e.value??``}|${r}`)}function uo(e){return`This overlaps with the ${e} finding on this stage: both are driven by the same dominant outlier task, so don't add their recoverable-time figures together.`}function fo(e){let t=new Set(e.filter(e=>e.type===`skew`&&e.metric===`max/median`&&e.stageId!=null).map(e=>e.stageId));if(t.size===0)return;let n=new Set(e.filter(e=>e.type===`straggler`&&e.stageId!=null).map(e=>e.stageId)),r=new Set([...t].filter(e=>n.has(e)));if(r.size!==0)for(let t of e){if(t.stageId==null||!r.has(t.stageId))continue;let e=t.type===`skew`?uo(`straggler`):t.type===`straggler`?uo(`skew`):null;e&&(t.validationRequired=t.validationRequired?`${t.validationRequired} ${e}`:e)}}function po(e,t,n){if(!n)return;let r=t.version??1;for(let i of Array.isArray(n)?n:[n]){if(!i||t.suppressWhen&&t.suppressWhen(i,e))continue;let n={...i,docAnchor:i.docAnchor??t.docAnchor,detectorVersion:r},a=lo(n);e.some(e=>e.id===a)||e.push({...n,id:a})}}function mo(e,t,n,r,i,a=new Map,o=null){let s=xi(e??{},n,r),c={app:e,stages:t,executorsAdded:n,executorsRemoved:r,jobs:i,sql:a,runAggregates:o,occupancy:Ii(t,s)},l=[];for(let e of Ra)if(e.inScorecard!==!1)switch(e.scope){case`stage`:for(let n of t.values())po(l,e,e.detect(n,c));break;case`sql`:for(let t of a.values())po(l,e,e.detect(t,c));break;case`app`:case`config`:po(l,e,e.detect(c));break;default:za(e.scope)}return ro(l,t,s),so(l,e),fo(l),l.sort((e,t)=>xr[e.impactBand]-xr[t.impactBand]),l}var ho=new WeakMap;function go(e){let t=[];for(let n of Ra)n.scope===`config`&&po(t,n,n.detect({app:e}));return ro(t,new Map),so(t,e),t.map(e=>({...e,stageId:e.stageId??null}))}function _o(e){if(e===null)return go(e);let t=ho.get(e);if(t)return t.slice();let n=go(e);return ho.set(e,n),n.slice()}var vo=`sparkforensics`,yo=`recentFiles`,bo=10,xo=0;function So(){let e=Date.now();return e>xo?(xo=e,e):++xo}function Co(){return typeof window<`u`&&`showOpenFilePicker`in window}function wo(e){e.objectStoreNames.contains(yo)&&e.deleteObjectStore(yo),e.createObjectStore(yo,{keyPath:`id`})}function To(e,t,n){return`${e}::${t}::${n}`}function Eo(){return new Promise((e,t)=>{let n=indexedDB.open(vo,1);n.onupgradeneeded=()=>wo(n.result),n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}function Do(e,t){return e.transaction(yo,t).objectStore(yo)}function Oo(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}async function ko({handle:e,name:t,size:n,lastModified:r,appName:i=null,issueCount:a=null}){let o=await Eo();try{let s={id:To(t,n,r),name:t,size:n,lastModified:r,handle:e,appName:i,issueCount:a,lastOpenedAt:So()};await Oo(Do(o,`readwrite`).put(s));let c=await Oo(Do(o,`readonly`).getAll());if(c.length>bo){c.sort((e,t)=>e.lastOpenedAt-t.lastOpenedAt);let e=c.slice(0,c.length-bo);for(let t of e)await Oo(Do(o,`readwrite`).delete(t.id))}return s}finally{o.close()}}async function Ao(){let e=await Eo();try{return(await Oo(Do(e,`readonly`).getAll())).sort((e,t)=>t.lastOpenedAt-e.lastOpenedAt)}finally{e.close()}}async function jo(e){let t=await Eo();try{let n=await Oo(Do(t,`readonly`).get(e));if(!n)return;n.lastOpenedAt=So(),await Oo(Do(t,`readwrite`).put(n))}finally{t.close()}}async function Mo(e){let t=await Eo();try{await Oo(Do(t,`readwrite`).delete(e))}finally{t.close()}}async function No(e){let t=await Eo();try{let n=await Oo(Do(t,`readonly`).get(e));return n?n.handle:null}finally{t.close()}}async function Po(e,t=`read`){if(!e)return!1;let n=e,r={mode:t};return await n.queryPermission(r)===`granted`||await n.requestPermission(r)===`granted`}var Fo=new Set([`local-server-unavailable`,`upstream-unreachable`,`application-not-found`,`access-or-upstream-failure`,`invalid-event-log`]),Io=[/^application_\d+_\d+$/,/^local-\d+$/,/^app-[A-Za-z0-9][A-Za-z0-9._-]*$/,/^spark-[A-Za-z0-9][A-Za-z0-9._~-]*$/,/^driver-\d+$/],Lo=/^(?!\.{1,2}$)[A-Za-z0-9][A-Za-z0-9._~-]*$/;function Ro(e){return typeof e==`string`?e.trim():``}function zo(e){let t=Ro(e);if(!t||t.includes(`?`)||t.includes(`#`))return null;let n;try{n=new URL(t)}catch{return null}return n.protocol!==`http:`&&n.protocol!==`https:`||n.username||n.password||n.search||n.hash?null:(n.pathname=`${n.pathname.replace(/\/+$/,``)}/`,n.toString())}function Bo(e){return Io.some(t=>t.test(e))}function Vo(e){return Lo.test(e)}function Ho({baseUrl:e=``,appId:t=``,attemptId:n=``}={}){let r=zo(e),i=Ro(t),a=Ro(n),o={baseUrl:r?null:`Enter an absolute HTTP(S) base URL without credentials, query, or fragment.`,appId:Bo(i)?null:`Enter a supported Spark application ID.`,attemptId:!a||Vo(a)?null:`Enter a URL-path-safe attempt ID.`};return o.baseUrl||o.appId||o.attemptId?{request:null,errors:o}:{request:{baseUrl:r,appId:i,attemptId:a||null},errors:o}}function Uo(e){return e?.request!=null}function Wo(e){return typeof e==`string`&&Fo.has(e)}var Y={current:null},Go={current:null};function Ko(e={}){let t=e.makeClient??gr,n=(0,b.useCallback)(async e=>{let t=W.getState().taskDataCache.get(e);if(t)return t;let n=await Y.current.requestTaskData(e);return W.getState().setTaskData(e,n),n},[]),r=(0,b.useCallback)(async(e=0)=>{let t=W.getState().appModel,n=wt(t,{skippedLines:e});W.getState().setEvidenceAvailability(n);let r=mo(t.app,t.stages,t.executors.added,t.executors.removed,t.jobs,t.sql,t.runAggregates);W.getState().setCatalog(r),W.getState().setConfigFindings(_o(t.app)),W.getState().setSkippedLines(e),W.getState().setStatus(`ready`);let i=[...new Set(r.map(e=>e.stageId).filter(e=>e!=null))],a=await Y.current.prefetchFlaggedStages(i);for(let{stageId:e,metrics:t,fieldNames:n}of a)W.getState().setTaskData(e,{metrics:t,fieldNames:n});let o=Go.current;if(o?.handle){let e=new Set(r.map(e=>e.stageId??`app:${e.type}`)).size;await ko({handle:o.handle,name:o.name,size:o.size,lastModified:o.lastModified,appName:t.app?.name??null,issueCount:e})}},[]),i=(0,b.useCallback)(()=>{let e=W.getState();e.activeFileId!=null&&e.appModel.app&&e.sessionCache.set(e.activeFileId,Tt(e.appModel,e.catalog,e.taskDataCache))},[]),a=(0,b.useCallback)(e=>(Y.current?.terminate(),W.getState().resetModel(),W.getState().setStatus(`parsing`),W.getState().setActiveFile(null),Go.current=null,Y.current=t(),_r(W.getState().appModel,{onProgress:e=>W.getState().setParse({pct:e.pct??0,lines:e.linesProcessed??0,etaMs:e.etaMs??null}),onDone:e=>{r(e?.skippedLines??0)},onError:t=>{e?e(t):W.getState().setError(String(t?.message??t))}})),[t,r]),o=(0,b.useCallback)((e,t)=>{let n=a(),r=t?.id??To(e.name,e.size,e.lastModified);W.getState().setActiveFile(r),t?.handle&&(Go.current={handle:t.handle,name:e.name,size:e.size,lastModified:e.lastModified}),Y.current.startParse(e,n)},[a]),s=(0,b.useCallback)(e=>{let t=a();Y.current.startParseFiles(Array.from(e),t)},[a]),c=(0,b.useCallback)((e,t)=>{let n=a(e=>{if(W.getState().setShsParsing(!1),e?.source===`shs`&&Wo(e.code)){W.getState().resetModel(),t(e);return}W.getState().setError(String(e?.message??e))});W.getState().setShsParsing(!0),Y.current.startParseFromUrl(e,n)},[a]),l=(0,b.useCallback)(()=>{i(),Y.current?.terminate(),W.getState().resetModel(),W.getState().setStatus(`idle`)},[i]),u=(0,b.useCallback)(async(e,t)=>{let n=W.getState();if(e===n.activeFileId)return`noop`;let r=n.sessionCache.get(e);if(r){i(),Y.current?.terminate(),Y.current=null;let t=Et(n.appModel,n.taskDataCache,r);return W.getState().setCatalog(t),W.getState().setConfigFindings(_o(n.appModel.app)),W.getState().setActiveFile(e),W.getState().setStatus(`ready`),await jo(e),`restored`}let a=t??await No(e);if(!a||!await Po(a))return`gone`;let s;try{s=await a.getFile()}catch(t){return t instanceof DOMException&&(t.name===`NotFoundError`||t.name===`NotAllowedError`)&&(await Mo(e).catch(()=>{}),n.sessionCache.delete(e)),`gone`}return i(),o(s,{handle:a,id:e}),`started`},[o,i]),d=(0,b.useCallback)((e,t)=>{let n=W.getState().sessionCache,r=n.get(e),i=n.get(t);return!r||!i?null:{baseline:{label:Mr(e),snapshot:r},candidate:{label:Mr(t),snapshot:i}}},[]),f=(0,b.useCallback)(async(e,t)=>{if(e.kind===`file`)return{start:t=>Y.current.startParse(e.file,t)};if(e.kind===`folder`)return{start:t=>Y.current.startParseFiles(e.files,t)};if(e.kind===`url`)return{start:t=>Y.current.startParseFromUrl(e.request,t)};let n=e.handle??await No(e.id);if(!n)return W.getState().setError(`Run ${t}: this recent file is no longer available.`),null;if(!await Po(n))return W.getState().setError(`Run ${t}: permission to read this file was denied.`),null;let r;try{r=await n.getFile()}catch{return W.getState().setError(`Run ${t}: this recent file could not be read.`),null}return{start:e=>Y.current.startParse(r,e)}},[]),p=(0,b.useCallback)((e,t=0)=>{let n=W.getState().appModel;W.getState().setEvidenceAvailability(wt(n,{skippedLines:t}));let r=W.getState().appModel,i=mo(r.app,r.stages,r.executors.added,r.executors.removed,r.jobs,r.sql,r.runAggregates);W.getState().sessionCache.set(e,Tt(r,i,W.getState().taskDataCache))},[]);return{startLoad:o,startLoadFolder:s,startLoadFromUrl:c,resetToDropZone:l,getTaskData:n,pickRecent:u,prepareComparison:d,startCompareLoad:(0,b.useCallback)((e,n)=>{let r=(e,t)=>{Y.current?.terminate(),W.getState().setCompareLoad(null),W.getState().setComparisonActive(!1);let n=t?.message??String(t);W.getState().setError(`Run ${e}: ${n}`)},i=async(e,n,i)=>{Y.current?.terminate(),W.getState().resetModel(),W.getState().setActiveFile(e.id),W.getState().setCompareLoad({current:n===`A`?1:2}),Y.current=t();let a=await f(e,n);if(!a){Y.current?.terminate(),W.getState().setCompareLoad(null),W.getState().setComparisonActive(!1);return}let o=_r(W.getState().appModel,{onProgress:e=>W.getState().setParse({pct:e.pct??0,lines:e.linesProcessed??0,etaMs:e.etaMs??null}),onDone:e=>i(e?.skippedLines??0),onError:e=>r(n,e)});a.start(o)};i(e,`A`,t=>{p(e.id,t),i(n,`B`,t=>{p(n.id,t),W.getState().setCompareLoad(null),W.getState().setActiveFile(null),W.getState().openComparison(e.id,n.id)})})},[t,f,p]),drillIntoRun:(0,b.useCallback)(e=>{let t=W.getState(),n=t.sessionCache.get(e);if(!n)return;Y.current?.terminate(),Y.current=null;let r=Et(t.appModel,t.taskDataCache,n);W.getState().setCatalog(r),W.getState().setConfigFindings(_o(t.appModel.app)),W.getState().setActiveFile(e),W.getState().setStatus(`ready`),W.getState().setComparisonActive(!1)},[])}}function qo(e){return String(e).toLowerCase().replace(/\b[0-9a-f]{8,}\b/g,`#`).replace(/\d+/g,`#`).replace(/\s+/g,` `).trim()}function Jo(e){if(!e)return null;function t(e){let n=(e.children??[]).map(t).sort();return Ui(JSON.stringify([qo(e.name??``),Qi(e.detail??``),n]))}return t(e)}function Yo(e,t){let n=e.sqlExecutionId;if(n==null)return``;let r=t.sql.get(n)?.planTree??null;if(!r)return``;let i=[];return(function t(n){n.stageIds?.includes(e.id)&&i.push(JSON.stringify([qo(n.name??``),Qi(n.detail??``)]));for(let e of n.children??[])t(e)})(r),i.length===0?Jo(r)??``:Ui(JSON.stringify(i.sort()))}function Xo(e,t){return qo(e.name??``)+`§`+Yo(e,t)}function Zo(e){let t=new Map;for(let[n,r]of e.stages){let i=Xo(r,e),a=t.get(i);a?a.push(n):t.set(i,[n])}return t}function Qo(e,t){let n=Zo(e),r=Zo(t),i=[],a=new Set,o=new Set;for(let e of[n,r])for(let[t,n]of e)n.length>1&&o.add(t);for(let e of[...n.keys()].sort()){let t=r.get(e);if(!t)continue;let o=n.get(e);if(o.length!==t.length)continue;let s=[...o].sort((e,t)=>e-t),c=[...t].sort((e,t)=>e-t);for(let t=0;t<s.length;t++)i.push({identity:e,baseId:s[t],candId:c[t]});a.add(e)}let s=e.stages.size+t.stages.size;return{pairs:i,matchedIdentities:a,collisionIdentities:o,coverage:s===0?1:2*i.length/s}}function $o(e){if(e.length===0)return null;let t=[...e].sort((e,t)=>e-t),n=Math.ceil(.95*t.length)-1;return t[Math.min(t.length-1,Math.max(0,n))]}function es(e,t){let n=0,r=!1;for(let i of e){let e=i[t];Number.isFinite(e)&&(n+=e,r=!0)}return{sum:n,present:r}}function ts(e){let t=(e.completedAt??0)-(e.submittedAt??0);return t>0&&Number.isFinite(e.taskDurationMax)?e.taskDurationMax/t:null}function ns(e){let t=[];for(let n of e){let e=ts(n);e!=null&&t.push(e)}return t}var rs=new Set([`inputBytes`,`outputBytes`,`taskCount`,`executorsAdded`]);function is(e,t,n){if(t==null||n==null)return`unavailable`;if(rs.has(e))return n===t?`unchanged`:`neutral`;let r=n-t;return r<0?`improvement`:r>0?`regression`:`unchanged`}function as(e,t,n,r,i={}){let a=is(e,n,r);return{key:e,label:t,baseline:n,candidate:r,delta:n==null||r==null?null:r-n,direction:a,...i}}function os(e,t){let n=[];n.push(as(`wallClock`,`Wall-clock duration`,ki(e.app,e.stages).total,ki(t.app,t.stages).total));let r=es([...e.stages.values()],`memoryBytesSpilled`),i=es([...t.stages.values()],`memoryBytesSpilled`);n.push(as(`shuffleSpill`,`Shuffle spill`,r.present?r.sum:null,i.present?i.sum:null,{unavailableReason:r.present&&i.present?void 0:`No shuffle-spill data recorded for a run`}));let a=$o(ns([...e.stages.values()])),o=$o(ns([...t.stages.values()]));n.push(as(`taskSkew`,`Task skew (p95)`,a,o,{unavailableReason:a!=null&&o!=null?void 0:`No stage had measurable duration for a run`}));let s=es([...e.stages.values()],`taskCount`),c=es([...t.stages.values()],`taskCount`),l=es([...e.stages.values()],`failedTasks`),u=es([...t.stages.values()],`failedTasks`),d=s.present&&s.sum>0&&l.present?l.sum/s.sum:null,f=c.present&&c.sum>0&&u.present?u.sum/c.sum:null;n.push(as(`failedTaskRate`,`Failed-task rate`,d,f,{unavailableReason:d!=null&&f!=null?void 0:`No task or failure counts recorded for a run`}));let p=(r,i,a,o)=>{let s=es([...e.stages.values()],a),c=es([...t.stages.values()],a);n.push(as(r,i,s.present?s.sum:null,c.present?c.sum:null,{unavailableReason:s.present&&c.present?void 0:o}))};p(`diskSpill`,`Disk spill`,`diskBytesSpilled`,`No disk-spill data recorded for a run`),p(`gcTime`,`GC time`,`jvmGCTime`,`No GC-time data recorded for a run`),p(`inputBytes`,`Input read`,`inputBytes`,`No input-bytes data recorded for a run`),p(`outputBytes`,`Output written`,`outputBytes`,`No output-bytes data recorded for a run`),p(`executorRunTime`,`Executor run-time`,`executorRunTime`,`No executor run-time recorded for a run`),p(`taskCount`,`Task count`,`taskCount`,`No task counts recorded for a run`);let m=e=>Array.isArray(e.executors?.added)?e.executors.added.length:null,h=m(e),g=m(t);return n.push(as(`executorsAdded`,`Executors added`,h,g,{unavailableReason:h!=null&&g!=null?void 0:`No executor events recorded for a run`})),n}function ss(e,t){let n=e=>{let t=new Map;for(let n of e.catalog){let r=typeof n.rule==`string`?n.rule:n.type,i=n.impactBand??`unknown`,a=`${r}§${i}`,o=t.get(a)??{rule:r,impactBand:i,count:0,stages:new Set};o.count++;let s=n.stageId==null?null:e.stages.get(n.stageId);s?.name&&o.stages.add(s.name),t.set(a,o)}return t},r=n(e),i=n(t),a=[],o=[];for(let e of[...new Set([...r.keys(),...i.keys()])].sort()){let t=r.get(e),n=i.get(e),s=t?.count??0,c=n?.count??0;if(c===s)continue;let l=n??t,u=c>s?n:t,d={rule:l.rule,impactBand:l.impactBand,baseCount:s,candCount:c,delta:c-s,stages:[...u.stages].sort()};(c>s?a:o).push(d)}return{introduced:a,resolved:o}}function cs(e,t){return e?.name!=null&&t?.name!=null&&e.name!==t.name}function ls(e,t,n){return n.pairs.map(n=>{let r=ts(e.stages.get(n.baseId)),i=ts(t.stages.get(n.candId));return{identity:n.identity,baseId:n.baseId,candId:n.candId,baseline:r,candidate:i,delta:r!=null&&i!=null?i-r:null}}).sort((e,t)=>e.identity<t.identity?-1:+(e.identity>t.identity))}function us(e){let t=e=>Number.isFinite(e)?e:null,n=(e.completedAt??0)-(e.submittedAt??0);return{duration:n>0?n:null,memoryBytesSpilled:t(e.memoryBytesSpilled),diskBytesSpilled:t(e.diskBytesSpilled),jvmGCTime:t(e.jvmGCTime),inputBytes:t(e.inputBytes),outputBytes:t(e.outputBytes),executorRunTime:t(e.executorRunTime),taskCount:t(e.taskCount),failedTasks:t(e.failedTasks)}}function ds(e){return[...e.stages].map(([e,t])=>({id:e,name:t.name??`Stage ${e}`,metrics:us(t)}))}var fs=.5;function ps(e,t){let n=e.snapshot,r=t.snapshot,i=Qo(n,r),a=cs(n.app,r.app),o=i.coverage<fs,s=a&&o?`Run names differ and only ${(i.coverage*100).toFixed(0)}% of stages matched, so deltas may compare different work.`:a?`Run names differ, so deltas may compare different work.`:o?`Only ${(i.coverage*100).toFixed(0)}% of stages matched between runs, so per-stage rows mostly compare unrelated work.`:null;return{baselineLabel:e.label,candidateLabel:t.label,confidence:a||o?`low`:`ok`,reason:s,matchedCoverage:i.coverage,metrics:os(n,r),findings:ss(n,r),stageSkew:ls(n,r,i),baseStages:ds(n),candStages:ds(r)}}var ms=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,hs=t,gs=(e,t)=>n=>{if(t?.variants==null)return hs(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ms(t)||ms(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return hs(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},_s=gs(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none cursor-pointer focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:cursor-default disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-default aria-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function X({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,U.jsx)(d,{"data-slot":`button`,className:H(_s({variant:t,size:n,className:e})),...r})}var vs=`docs/tuning-reference`,ys={"bottleneck-stage-shape":`bottleneck-skew`,"bottleneck-stage-slowness":`bottleneck-slow-host`,"bottleneck-partition-sizing":`bottleneck-shuffle`,"bottleneck-speculation-waste":`bottleneck-straggler`,"bottleneck-core-locality":`bottleneck-utilization`,"bottleneck-caching-opportunity":`bottleneck-utilization`,"bottleneck-autoscaling-churn":`cluster-config`,"bottleneck-cache-utilization":`memory-model`};function bs(e){return e.startsWith(`metric-`)?`metrics`:e.startsWith(`config-`)?`config`:ys[e]??e}function xs(e){let t=String(e).replace(/^#/,``);return`${vs}/${bs(t)}.html#${encodeURIComponent(t)}`}var Ss=new Set([`#intro`,`#spark-architecture`,`#memory-model`,`#partitioning`,`#joins`,`#shuffle`,`#data-formats`,`#table-formats`,`#caching`,`#pyspark`,`#aqe`,`#cluster-config`,`#anti-patterns`,`#metrics`,`#config`,`#bottleneck-cold-start`,`#bottleneck-failures`,`#bottleneck-gc`,`#bottleneck-job-failure-rate`,`#bottleneck-retry-waste`,`#bottleneck-shuffle`,`#bottleneck-skew`,`#bottleneck-slow-host`,`#bottleneck-spill`,`#bottleneck-straggler`,`#bottleneck-tiny-tasks`,`#bottleneck-utilization`,`#bottleneck-memory-utilization`,`#bottleneck-broadcast-sizing`,`#bottleneck-duplicate-plan-subtree`,`#bottleneck-small-files`,`#bottleneck-stage-shape`,`#bottleneck-stage-slowness`,`#bottleneck-partition-sizing`,`#bottleneck-speculation-waste`,`#bottleneck-core-locality`,`#bottleneck-caching-opportunity`,`#bottleneck-autoscaling-churn`,`#bottleneck-cache-utilization`,`#config-autoscale-bounds`,`#config-memory-overhead`,`#config-serializer`,`#config-shuffle-service`,...Object.values({"task-duration":`#metric-task-duration`,"shuffle-read-bytes":`#metric-shuffle-read-bytes`,"shuffle-write-bytes":`#metric-shuffle-write-bytes`,"memory-bytes-spilled":`#metric-memory-bytes-spilled`,"disk-bytes-spilled":`#metric-disk-bytes-spilled`,"jvm-gc-time":`#metric-jvm-gc-time`,gcpct:`#metric-gcpct`,"executor-run-time":`#metric-executor-run-time`,"fetch-wait-time-ratio":`#metric-fetch-wait-time-ratio`,"input-bytes":`#metric-input-bytes`,"output-bytes":`#metric-output-bytes`,"io-ratio":`#metric-io-ratio`,"peak-execution-memory":`#metric-peak-execution-memory`,"failed-tasks":`#metric-failed-tasks`,"speculative-tasks":`#metric-speculative-tasks`,"first-stage-submitted-at":`#metric-first-stage-submitted-at`,"executor-count":`#metric-executor-count`,"stage-duration":`#metric-stage-duration`})]);function Cs(e){return Ss.has(String(e))}var ws={underBroadcast:`broadcastSizing`,overBroadcast:`broadcastSizing`},Ts;function Es(){if(!Ts){Ts=new Map;for(let e of va()){let t=Ts.get(e.type)??new Set;t.add(e.docAnchor),Ts.set(e.type,t)}}return Ts}function Ds(e){let t=ws[e]??e,n=Es().get(t)??new Set;if(n.size!==1)return;let[r]=n;return r&&Cs(r)?r:void 0}function Os(e){let t=new Set(e.map(e=>e.docAnchor));if(t.size!==1)return;let[n]=t;return n}function ks({entries:e,activeId:t=null,onPick:n,onRemove:r}){return e.length?(0,U.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.map(e=>{let i=e.appName||e.name,a=e.issueCount==null?``:` · ${e.issueCount} issue${e.issueCount===1?``:`s`}`;return(0,U.jsxs)(`li`,{className:H(`flex items-center gap-1 rounded-md`,e.id===t&&`bg-accent`),children:[(0,U.jsxs)(`button`,{type:`button`,className:`tap-target-comfortable flex min-w-0 flex-1 cursor-pointer flex-col items-start gap-0.5 rounded-md px-1.5 py-1 text-left hover:bg-muted`,onClick:()=>n?.(e.id),children:[(0,U.jsx)(`span`,{className:`w-full truncate text-sm font-medium`,children:i}),(0,U.jsxs)(`span`,{className:`w-full truncate text-xs text-muted-foreground`,children:[e.name,` · `,q(e.size),a]})]}),(0,U.jsx)(X,{type:`button`,variant:`ghost`,size:`icon`,className:`tap-target-comfortable`,"aria-label":`Remove from recent files`,onClick:()=>r?.(e.id),children:(0,U.jsx)(pr,{"aria-hidden":`true`})})]},e.id)})}):(0,U.jsx)(`p`,{className:`px-1.5 py-1 text-sm text-muted-foreground`,children:`No recent files yet`})}function As(e,t){let n=e=>e.match(/(\d+)|(\D+)/g)??[e],r=n(e),i=n(t),a=Math.max(r.length,i.length);for(let e=0;e<a;e++){let t=r[e]??``,n=i[e]??``;if(t===n)continue;let a=Number(t),o=Number(n);return!Number.isNaN(a)&&!Number.isNaN(o)?a-o:t<n?-1:1}return 0}function js(e){let t=e.filter(e=>!e.toLowerCase().startsWith(`appstatus`)).filter(e=>/^events_\d+_/.test(e)),n=e=>parseInt(e.match(/^events_(\d+)_/)[1],10),r=t.filter(e=>e.endsWith(`.compact`)).map(n),i=r.length>0?Math.max(...r):-1,a=t.filter(e=>{let t=n(e);return e.endsWith(`.compact`)?t===i:t>i}).sort(As),o=a.map(n);for(let e=1;e<o.length;e++)if(o[e]!==o[e-1]+1)throw Error(`Rolling event-log directory is missing file(s) between index ${o[e-1]} and ${o[e]}.`);return a}var Ms={baseUrl:`shuffle-works-shs-base-url`,appId:`shuffle-works-shs-app-id`,attemptId:`shuffle-works-shs-attempt-id`};function Ns(e){if(typeof window>`u`)return``;try{return window.localStorage.getItem(Ms[e])??``}catch{return``}}var Ps=`sample-runs/sample-run.ndjson.gz`,Fs={"local-server-unavailable":`The local server is unavailable. Start local-server mode, then try again.`,"upstream-unreachable":`The History Server could not be reached. Check the address and try again.`,"application-not-found":`The requested application was not found. Check the application and attempt IDs.`,"access-or-upstream-failure":`The History Server could not provide this event log. Check access and try again.`,"invalid-event-log":`The response did not contain a supported event log. Choose a local file or try another application.`};async function Is(e){let t=e.createReader(),n=[];for(;;){let e=await new Promise((e,n)=>t.readEntries(e,n));if(e.length===0)break;n.push(...e)}let r=n.filter(e=>e.isFile);return Promise.all(r.map(e=>new Promise((t,n)=>e.file(t,n))))}function Ls({onPick:e,compact:t=!1}={}){let{startLoad:n,startLoadFolder:r,startLoadFromUrl:i,pickRecent:a}=Ko(),o=G(e=>e.shsParsing),s=(0,b.useRef)(null),c=(0,b.useRef)(null),[l,u]=(0,b.useState)(!1),[d,f]=(0,b.useState)([]),[p,m]=(0,b.useState)(()=>Ns(`baseUrl`)),[h,g]=(0,b.useState)(()=>Ns(`appId`)),[_,v]=(0,b.useState)(()=>Ns(`attemptId`)),[y,x]=(0,b.useState)(!1),[ee,S]=(0,b.useState)(!1),[C,w]=(0,b.useState)(!1),[T,E]=(0,b.useState)({baseUrl:!1,appId:!1,attemptId:!1}),[D,O]=(0,b.useState)(null),te=(0,b.useRef)(null),[k,ne]=(0,b.useState)(!1),A=Ho({baseUrl:p,appId:h,attemptId:_}),re=ee||o,ie=y||o;(0,b.useEffect)(()=>{D&&te.current?.focus()},[D]),(0,b.useEffect)(()=>{if(t)return;let e=new AbortController,n=setTimeout(()=>e.abort(),800);return fetch(`/shs-proxy`,{signal:e.signal}).then(e=>{e.status===400&&w(!0)}).catch(()=>{}).finally(()=>clearTimeout(n)),()=>{clearTimeout(n),e.abort()}},[t]);let j=(0,b.useCallback)(()=>{Ao().then(e=>f(e)).catch(()=>f([]))},[]);(0,b.useEffect)(()=>{j()},[j]);let ae=(0,b.useCallback)(async()=>{ne(!0);try{let t=await fetch(Ps);if(!t.ok)throw Error(`HTTP ${t.status}`);let r=await t.blob(),i=new File([r],`sample-run.ndjson.gz`,{type:`application/gzip`});e?e({kind:`file`,id:To(i.name,i.size,i.lastModified),label:i.name,file:i}):n(i)}catch{W.getState().setError(`Could not load the sample run. Check your connection and try again, or choose a file below.`)}finally{ne(!1)}},[n,e]),oe=(0,b.useCallback)(async()=>{if(Co()){let t;try{[t]=await window.showOpenFilePicker()}catch{return}try{let r=await t.getFile();e?e({kind:`file`,id:To(r.name,r.size,r.lastModified),label:r.name,file:r,handle:t}):n(r,{handle:t})}catch{W.getState().setError(`Could not read the selected file.`)}return}s.current?.click()},[n,e]),se=(0,b.useCallback)(t=>{let n=t.map(e=>e.name);if(!n.some(e=>/^events_\d+_/.test(e))){W.getState().setError(`This isn't a Spark rolling event-log directory. Choose file to load a single event log.`);return}let i;try{i=js(n)}catch(e){W.getState().setError(e.message);return}let a=new Map(t.map(e=>[e.name,e])),o=i.map(e=>a.get(e));if(e){let t=o[0];e({kind:`folder`,id:`folder:${t?.name??i[0]}`,label:`${o.length}-file rolling log`,files:o});return}r(o)},[r,e]),ce=(0,b.useCallback)(t=>{let r=t.target.files?.[0];r&&(e?e({kind:`file`,id:To(r.name,r.size,r.lastModified),label:r.name,file:r}):n(r)),t.target.value=``},[n,e]),M=(0,b.useCallback)(e=>{let t=Array.from(e.target.files??[]);t.length&&se(t),e.target.value=``},[se]),N=(0,b.useCallback)(async t=>{let r=t.dataTransfer.files[0],i=t.dataTransfer.items?.[0],a=i?.webkitGetAsEntry?.();if(a&&a.isDirectory){try{let e=await Is(a);se(e)}catch{W.getState().setError(`Could not read the dropped folder.`)}return}if(Co()&&i?.getAsFileSystemHandle)try{let t=await i.getAsFileSystemHandle();if(t&&t.kind===`file`){let r=await t.getFile();e?e({kind:`file`,id:To(r.name,r.size,r.lastModified),label:r.name,file:r,handle:t}):n(r,{handle:t});return}}catch{W.getState().setError(`Could not read the selected file.`);return}r&&(e?e({kind:`file`,id:To(r.name,r.size,r.lastModified),label:r.name,file:r}):n(r))},[n,se,e]),le=(0,b.useCallback)(e=>{e.preventDefault(),u(!1),N(e)},[N]),ue=(0,b.useCallback)(async t=>{let n=d.find(e=>e.id===t);if(e){e({kind:`recent`,id:t,label:n?.appName||n?.name||t,handle:n?.handle});return}let r=await a(t,n?.handle);(r===`restored`||r===`gone`)&&j()},[d,a,j,e]),P=(0,b.useCallback)(e=>{let t=d.find(t=>t.id===e);Mo(e).catch(()=>{}).finally(j),t&&Qt(`Removed "${t.appName||t.name}" from recent files`,{action:{label:`Undo`,onClick:()=>{ko(t).catch(()=>{}).finally(j)}}})},[d,j]),de=(0,b.useCallback)((e,t)=>{if(e===`baseUrl`&&m(t),e===`appId`&&g(t),e===`attemptId`&&v(t),O(null),typeof window<`u`)try{window.localStorage.setItem(Ms[e],t)}catch{}},[]),F=(0,b.useCallback)(e=>{E(t=>({...t,[e]:!0}))},[]),fe=(0,b.useCallback)(t=>{t.preventDefault(),E({baseUrl:!0,appId:!0,attemptId:!0}),O(null);let n=A.request;if(Uo(A)&&n){if(e){let t=n.attemptId?`${n.appId}/${n.attemptId}`:n.appId;e({kind:`url`,id:t,label:t,request:n});return}i(n,e=>{O(e.code)})}},[A,i,e]),pe=e=>T[e]?A.errors[e]:null,I=(0,U.jsxs)(`section`,{className:`landing-history-server w-full text-left`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`tap-target-comfortable flex w-full cursor-pointer items-center justify-between rounded-md border border-border px-3 py-2 text-left text-sm font-medium hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"aria-expanded":re,"aria-controls":`shs-fetch-panel`,onClick:()=>S(e=>!e),children:[`Fetch from Spark History Server`,re?(0,U.jsx)(zn,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}):(0,U.jsx)(Ln,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]}),re?(0,U.jsxs)(`div`,{id:`shs-fetch-panel`,className:`mt-3 rounded-md border border-border p-4`,children:[(0,U.jsx)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:`Requires local-server mode and a History Server reachable from this machine.`}),(0,U.jsxs)(`form`,{onSubmit:fe,className:`flex flex-col gap-3`,children:[(0,U.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,U.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Base URL`,(0,U.jsx)(`input`,{type:`text`,value:p,onChange:e=>de(`baseUrl`,e.target.value),onBlur:()=>F(`baseUrl`),placeholder:`http://history-server:18080`,"aria-label":`Spark History Server base URL`,"aria-invalid":!!pe(`baseUrl`),"aria-describedby":pe(`baseUrl`)?`shs-base-url-error`:void 0,className:`tap-target-input rounded-md border border-input bg-background px-2 py-1 text-sm text-foreground`}),pe(`baseUrl`)?(0,U.jsx)(`span`,{id:`shs-base-url-error`,className:`text-destructive`,children:pe(`baseUrl`)}):null]}),(0,U.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Application ID`,(0,U.jsx)(`input`,{type:`text`,value:h,onChange:e=>de(`appId`,e.target.value),onBlur:()=>F(`appId`),placeholder:`application_1234567890_0001`,"aria-label":`Application ID`,"aria-invalid":!!pe(`appId`),"aria-describedby":pe(`appId`)?`shs-app-id-error`:void 0,className:`tap-target-input rounded-md border border-input bg-background px-2 py-1 text-sm text-foreground`}),pe(`appId`)?(0,U.jsx)(`span`,{id:`shs-app-id-error`,className:`text-destructive`,children:pe(`appId`)}):null]}),(0,U.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Attempt ID (optional)`,(0,U.jsx)(`input`,{type:`text`,value:_,onChange:e=>de(`attemptId`,e.target.value),onBlur:()=>F(`attemptId`),placeholder:`2`,"aria-label":`Attempt ID (optional)`,"aria-invalid":!!pe(`attemptId`),"aria-describedby":pe(`attemptId`)?`shs-attempt-id-error`:void 0,className:`tap-target-input rounded-md border border-input bg-background px-2 py-1 text-sm text-foreground`}),pe(`attemptId`)?(0,U.jsx)(`span`,{id:`shs-attempt-id-error`,className:`text-destructive`,children:pe(`attemptId`)}):null]})]}),o?(0,U.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`text-sm text-muted-foreground`,children:`Fetching event log…`}):null,D?(0,U.jsxs)(`p`,{ref:te,role:`alert`,tabIndex:-1,className:`text-sm text-destructive`,children:[Fs[D],` `,`Edit the fields, review `,(0,U.jsx)(`a`,{href:xs(`#intro`),target:`_blank`,rel:`noopener noreferrer`,className:`tap-target-comfortable text-primary underline-offset-4 hover:underline`,children:`Local-server setup`}),`, or choose a local file.`]}):null,(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,U.jsx)(X,{type:`submit`,className:`tap-target-comfortable`,disabled:!Uo(A)||o,children:`Fetch`}),(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Application IDs: application_…, local-…, app-…, spark-…, or driver-…`})]})]})]}):null]});return(0,U.jsxs)(`div`,{"data-testid":`drop-zone`,role:`region`,"aria-label":`Drop Spark event log file here`,className:H(`mx-auto flex w-full flex-col items-center justify-center gap-6 rounded-xl border-2 border-dashed border-border p-6 text-center transition-colors`,t?`max-w-full`:`landing-drop-zone max-w-none p-6 sm:p-8`,l&&`border-primary bg-primary/5`),onDragOver:e=>{e.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:le,children:[(0,U.jsx)(lr,{"aria-hidden":`true`,className:`size-10 text-primary`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`font-heading text-lg font-semibold`,children:`Choose a Spark event log`}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Drop an event log file here, or choose a file below.`}),(0,U.jsx)(`p`,{className:`mt-1 max-w-xl text-xs text-muted-foreground`,children:`Accepts a Spark event log file: newline-delimited JSON, one event per line, optionally gzip/Zstandard/LZ4/Snappy-compressed.`})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,U.jsx)(X,{type:`button`,className:`tap-target-comfortable`,onClick:()=>void oe(),children:`Choose file`}),t?null:(0,U.jsx)(X,{type:`button`,variant:`outline`,className:`tap-target-comfortable`,onClick:()=>void ae(),disabled:k,children:k?`Loading sample…`:`Try a sample run`})]}),(0,U.jsx)(`input`,{ref:s,type:`file`,className:`hidden`,"data-testid":`file-input`,"aria-label":`Choose file`,onChange:ce}),(0,U.jsx)(`input`,{ref:c,type:`file`,className:`hidden`,"data-testid":`folder-input`,"aria-label":`Choose rolling log folder`,onChange:M,webkitdirectory:`true`,directory:`true`}),t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(X,{type:`button`,variant:`outline`,className:`tap-target-comfortable`,onClick:()=>c.current?.click(),children:`Choose rolling-log folder`}),(0,U.jsx)(`div`,{className:`w-full max-w-2xl`,children:I})]}):(0,U.jsxs)(U.Fragment,{children:[C?(0,U.jsxs)(`div`,{className:`flex w-full max-w-2xl items-start gap-2 rounded-md border border-border p-4 text-left`,children:[(0,U.jsx)(tr,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,U.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`If a Spark History Server is reachable, open`,` `,(0,U.jsx)(`strong`,{className:`font-medium text-foreground`,children:`Other sources`}),` below to fetch a run from it directly.`]})]}):null,(0,U.jsxs)(`section`,{className:`landing-other-sources w-full max-w-2xl text-left`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`tap-target-comfortable flex w-full cursor-pointer items-center justify-between rounded-md border border-border px-3 py-2 text-left text-sm font-medium hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,"aria-expanded":ie,"aria-controls":`other-sources-panel`,onClick:()=>x(e=>!e),children:[`Other sources`,ie?(0,U.jsx)(zn,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}):(0,U.jsx)(Ln,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]}),ie?(0,U.jsxs)(`div`,{id:`other-sources-panel`,className:`mt-3 flex flex-col gap-3 rounded-md border border-border p-4`,children:[(0,U.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Use these for a rolling `,(0,U.jsx)(`code`,{children:`eventlog_v2_*`}),` directory or to fetch an application from a local Spark History Server.`]}),(0,U.jsx)(`div`,{children:(0,U.jsx)(X,{type:`button`,variant:`outline`,className:`tap-target-comfortable`,onClick:()=>c.current?.click(),children:`Choose rolling-log folder`})}),I]}):null]})]}),d.length>0&&(0,U.jsxs)(`div`,{className:`w-full max-w-md text-left`,children:[(0,U.jsx)(`p`,{className:`mb-1 px-1.5 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Recent files`}),(0,U.jsx)(ks,{entries:d,onPick:e=>void ue(e),onRemove:P})]})]})}var Rs=gs(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function zs({className:e,variant:t=`default`,render:n,...r}){return g({defaultTagName:`span`,props:l({className:H(Rs({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}function Bs(e){return`docs/user-guide/understanding-findings.html#${Tr(e).toLowerCase()}`}var Vs=`#intro`,Hs=(0,b.createContext)(null);function Us({children:e}){let[t,n]=(0,b.useState)(!1),[r,i]=(0,b.useState)({kind:`site`,source:`reference`,path:xs(Vs)}),a=(0,b.useCallback)((e=Vs)=>{i({kind:`site`,source:`reference`,path:xs(e)}),n(!0)},[]),o=(0,b.useCallback)(e=>{i({kind:`site`,source:`guide`,path:e}),n(!0)},[]),s=(0,b.useCallback)(()=>n(!1),[]),c=(0,b.useMemo)(()=>({open:a,openSite:o,close:s,isOpen:t,target:r}),[a,o,s,t,r]);return(0,U.jsx)(Hs.Provider,{value:c,children:e})}function Ws(){let e=(0,b.useContext)(Hs);if(!e)throw Error(`useDocs outside DocsProvider`);return e}function Gs(){return(0,b.useContext)(Hs)}function Ks({anchor:e,children:t}){let{open:n}=Ws();return Cs(e)?(0,U.jsx)(`a`,{href:xs(e),className:`text-primary underline-offset-4 hover:underline`,onClick:t=>{t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.button!==0||(t.preventDefault(),n(e))},children:t}):null}var qs={INCMP:{expansion:`Incomplete run`,description:`This event log never recorded an application-end event, so other findings and metrics reflect only what was captured.`},SKEW:{expansion:`Task skew`,description:`A small number of tasks take much longer than their peers.`},SHFL:{expansion:`Shuffle I/O`,description:`Tasks are moving a large amount of intermediate data between stages.`},SPILL:{expansion:`Memory and disk spill`,description:`Tasks are writing data out of memory, which slows execution.`},GC:{expansion:`Garbage collection pressure`,description:`Tasks are spending an unusually large share of time reclaiming memory.`},COLD:{expansion:`Executor cold start`,description:`New executors are taking time to become available for work.`},UTIL:{expansion:`Low utilization`,description:`Allocated executors are idle for a large share of the application run.`},MEM:{expansion:`Memory utilization`,description:`Executor memory or core capacity may be over- or under-provisioned.`},LOCAL:{expansion:`Core usage locality`,description:`Tasks are running without process- or node-local data placement more than expected.`},HOST:{expansion:`Slow host`,description:`One executor is substantially slower than its peers.`},FAIL:{expansion:`Failed tasks`,description:`Tasks are failing often enough to affect the stage.`},STRAG:{expansion:`Straggler tasks`,description:`A few tasks are much slower than the rest of their stage.`},SPEC:{expansion:`Speculation waste`,description:`Speculative task attempts used a lot of executor time without confirming a genuine straggler.`},RETRY:{expansion:`Retry waste`,description:`Repeated task attempts are consuming avoidable execution time.`},TINY:{expansion:`Tiny tasks`,description:`Many very short tasks are adding scheduling overhead.`},SFAIL:{expansion:`Failed stage`,description:`A stage attempt failed outright.`},PART:{expansion:`Partition sizing`,description:`Shuffle partitions are too large, too uneven, or too few for the work.`},SLOW:{expansion:`Stage slowness`,description:`A stage is slow overall without a more specific diagnosed cause.`},SHAPE:{expansion:`Stage shape`,description:`The stage has an inefficient task count, output shape, or task-to-stage balance.`},CACHE:{expansion:`Caching opportunity`,description:`A reusable dataset may benefit from being persisted between stages.`},CSTOR:{expansion:`Cache storage`,description:`A persisted dataset is not fully cached in memory or is spilling to disk.`},CHRN:{expansion:`Autoscaling churn`,description:`Executors are being stood up and torn down again before they can do useful work.`},JOBS:{expansion:`Job failure rate`,description:`A large share of completed jobs did not succeed.`},CFG:{expansion:`Configuration audit`,description:`Configuration settings may cause reliability or efficiency problems.`},PLAN:{expansion:`Plan advisor`,description:`The SQL execution plan has a pattern worth reviewing.`},BROADCASTSIZING:{expansion:`Broadcast sizing`,description:`A broadcast join threshold or hint may be misconfigured for this query.`}};function Js({children:e}){return jt()===`advanced`?(0,U.jsx)(U.Fragment,{children:e}):null}var Ys={critical:`bg-critical`,warning:`bg-warning`,info:`bg-info`},Xs={critical:`text-critical`,warning:`text-warning`,info:`text-info`},Zs={critical:`border-critical`,warning:`border-warning`,info:`border-info`},Qs=gs(`inline-block size-2 shrink-0 rounded-full`,{variants:{impactBand:{...Ys,muted:`bg-muted-foreground`}},defaultVariants:{impactBand:`info`}}),$s=gs(`gap-1.5 border-transparent`,{variants:{impactBand:{critical:`bg-critical/10 text-critical`,warning:`bg-warning/10 text-warning`,info:`bg-info/10 text-info`}},defaultVariants:{impactBand:`info`}});function ec({impactBand:e,className:t}){return(0,U.jsx)(`span`,{"aria-hidden":`true`,className:H(Qs({impactBand:e}),t)})}function tc({type:e,impactBand:t,className:n,plainBadge:r,docAnchor:i}){let a=Gs(),o=jt(),s=Tr(e),c=qs[s],l=r?void 0:c?`${c.expansion}: ${c.description}`:void 0,u=r?void 0:i&&Cs(i)?i:Ds(e),d=c?.expansion??s,f=Bs(e),p=u?xs(u):r?void 0:f,m=!r&&o===`advanced`&&!!u,h=(0,U.jsxs)(zs,{title:l,className:H($s({impactBand:t}),`h-6`,p&&`underline decoration-dotted underline-offset-2`,m?H(`rounded-r-none`,n):n),render:p?(0,U.jsx)(`a`,{href:p,onClick:e=>{!a||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||(e.preventDefault(),u?a.open(u):a.openSite(f))}}):void 0,children:[(0,U.jsx)(ec,{impactBand:t}),s]});return r?h:(0,U.jsxs)(`span`,{className:`inline-flex items-center`,children:[h,m?(0,U.jsx)(Js,{children:(0,U.jsx)(`a`,{href:f,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`SparkForensics guide: ${d}`,title:`SparkForensics guide: ${d}`,onClick:e=>{!a||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||(e.preventDefault(),a.openSite(f))},className:H(`tap-target-comfortable tap-target-comfortable--sm inline-flex h-6 shrink-0 items-center rounded-r-4xl border border-transparent py-0.5 pr-2 pl-1 text-xs font-medium whitespace-nowrap transition-colors`,$s({impactBand:t}),n,`text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`),children:(0,U.jsx)(Un,{"aria-hidden":`true`,className:`size-3`})})}):null]})}function nc({label:e,impactBand:t,title:n,className:r}){return(0,U.jsx)(zs,{title:n,className:H($s({impactBand:t}),`font-mono`,r),children:e})}function rc({...e}){return(0,U.jsx)(p,{"data-slot":`collapsible`,...e})}function ic({...e}){return(0,U.jsx)(v,{"data-slot":`collapsible-trigger`,...e})}function ac({className:e,...t}){return(0,U.jsx)(u,{"data-slot":`collapsible-content`,className:H(`h-(--collapsible-panel-height) overflow-hidden transition-[height] duration-150 ease-out data-ending-style:h-0 data-starting-style:h-0 motion-reduce:transition-none`,e),...t})}var oc=`npx sparkforensics-mcp`,sc=`{
|
|
3
|
+
"mcpServers": {
|
|
4
|
+
"sparkforensics": {
|
|
5
|
+
"command": "npx",
|
|
6
|
+
"args": ["sparkforensics-mcp"]
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}`;function cc(){return(0,U.jsxs)(rc,{className:`w-full`,children:[(0,U.jsx)(ic,{className:H(_s({variant:`outline`}),`tap-target-comfortable`),children:`Use with an AI assistant (MCP)`}),(0,U.jsxs)(ac,{className:`mt-2 flex w-full flex-col gap-2 text-sm`,children:[(0,U.jsx)(`p`,{className:`text-muted-foreground`,children:`This project exposes an MCP server so an AI assistant can diagnose a run directly, without going through this web UI.`}),(0,U.jsx)(`pre`,{"data-testid":`mcp-config-snippet`,className:`overflow-x-auto rounded-md bg-muted p-2 text-xs whitespace-pre`,children:oc}),(0,U.jsx)(`p`,{className:`text-muted-foreground`,children:`Or, in an MCP client config:`}),(0,U.jsx)(`pre`,{className:`overflow-x-auto rounded-md bg-muted p-2 text-xs whitespace-pre`,children:sc})]})]})}var lc=`[data-shuffle-product-bar]`;function uc(){return document.querySelector(lc)}function dc({className:e,children:t}){let n=uc();return n?(0,Ft.createPortal)((0,U.jsx)(`div`,{"data-shuffle-page-controls":!0,children:t}),n):(0,U.jsx)(`div`,{className:e,"data-shuffle-page-controls":!0,children:t})}function fc({message:e,nonce:t}){let n=(0,b.useRef)(null);return(0,b.useEffect)(()=>{n.current?.focus()},[e,t]),(0,U.jsxs)(`div`,{ref:n,role:`alert`,tabIndex:-1,className:H(`mb-4 flex items-start gap-3 rounded-lg border-l-4 bg-critical/10 p-4 text-sm text-foreground`,Zs.critical),children:[(0,U.jsx)(sr,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-critical`}),(0,U.jsx)(`p`,{children:e})]})}var pc=`docs/`;function mc({label:e,onChange:t}){return(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl border border-border p-4`,children:[(0,U.jsxs)(`span`,{className:`min-w-0 truncate text-sm`,children:[(0,U.jsx)(`span`,{"aria-hidden":`true`,className:`mr-2 text-clean`,children:`✓`}),e]}),(0,U.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,className:`tap-target-comfortable`,onClick:t,children:`Change`})]})}function hc({testId:e,ariaLabel:t,source:n,onPick:r,onChange:i}){return(0,U.jsx)(`div`,{"data-testid":e,"aria-label":t,className:`min-w-0 flex-1`,children:n?(0,U.jsx)(mc,{label:n.label,onChange:i}):(0,U.jsx)(Ls,{onPick:r,compact:!0})})}function gc({onClick:e}){return(0,U.jsxs)(X,{type:`button`,variant:`outline`,className:`tap-target-comfortable`,onClick:e,children:[`Compare two runs `,(0,U.jsx)(jn,{"aria-hidden":`true`})]})}function _c(){return(0,U.jsxs)(`div`,{className:`landing-resources`,"aria-label":`SparkForensics resources`,children:[(0,U.jsxs)(`a`,{href:pc,target:`_blank`,rel:`noopener noreferrer`,className:`landing-resource-card`,children:[(0,U.jsx)(Un,{"aria-hidden":`true`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`Read the docs`}),(0,U.jsx)(`span`,{children:`How to load a log, read the board, and use every finding.`})]}),(0,U.jsx)(jn,{"aria-hidden":`true`,className:`landing-resource-arrow`})]}),(0,U.jsxs)(`a`,{href:xs(`#intro`),target:`_blank`,rel:`noopener noreferrer`,className:`landing-resource-card`,children:[(0,U.jsx)(Nn,{"aria-hidden":`true`}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`strong`,{children:`Spark optimization reference`}),(0,U.jsx)(`span`,{children:`Architecture, memory, shuffle, and tuning notes behind every finding.`})]}),(0,U.jsx)(jn,{"aria-hidden":`true`,className:`landing-resource-arrow`})]})]})}function vc({onCompare:e}){return(0,U.jsxs)(`section`,{className:`landing-next-steps`,"aria-labelledby":`next-steps-title`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`landing-next-steps-label`,children:`After your first run`}),(0,U.jsx)(`h2`,{id:`next-steps-title`,children:`Go further with the evidence you already have.`})]}),(0,U.jsxs)(`div`,{className:`landing-next-step-list`,children:[(0,U.jsxs)(`article`,{children:[(0,U.jsx)(Gn,{"aria-hidden":`true`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{children:`Compare two runs`}),(0,U.jsx)(`p`,{children:`Use a baseline and candidate log to see which structurally matched stages changed.`}),(0,U.jsx)(gc,{onClick:e})]})]}),(0,U.jsxs)(`article`,{children:[(0,U.jsx)(Fn,{"aria-hidden":`true`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{children:`Use with an AI assistant`}),(0,U.jsx)(`p`,{children:`Connect MCP when you want an agent to inspect this evidence with you.`}),(0,U.jsx)(cc,{})]})]}),(0,U.jsxs)(`article`,{children:[(0,U.jsx)(dr,{"aria-hidden":`true`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{children:`Automate it in Airflow`}),(0,U.jsx)(`p`,{children:`Run this analysis after every Spark job with sparkforensics-operator instead of checking runs by hand.`}),(0,U.jsxs)(X,{variant:`outline`,className:`tap-target-comfortable`,nativeButton:!1,render:(0,U.jsx)(`a`,{href:`https://github.com/shuffle-works/sparkforensics-operator`,target:`_blank`,rel:`noopener noreferrer`}),children:[`View sparkforensics-operator `,(0,U.jsx)(jn,{"aria-hidden":`true`})]})]})]})]})]})}function yc({errorMessage:e,errorNonce:t}={}){let{startCompareLoad:n}=Ko(),{theme:r,toggle:i}=Pt(),[a,o]=(0,b.useState)(!1),[s,c]=(0,b.useState)(null),[l,u]=(0,b.useState)(null);return a?(0,U.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`h2`,{className:`font-heading text-lg font-semibold`,children:`Compare two runs`}),(0,U.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,className:`tap-target-comfortable`,onClick:()=>{o(!1),c(null),u(null)},children:`Cancel`})]}),(0,U.jsx)(`p`,{className:`landing-compare-intro`,children:`Use Run A as the baseline and Run B as the candidate. Compare structurally matched stages to review material changes in a shared stage-level context.`}),e?(0,U.jsx)(fc,{message:e,nonce:t}):null,(0,U.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`mb-2 text-sm font-medium text-muted-foreground`,children:`Run A (baseline)`}),(0,U.jsx)(hc,{testId:`compare-slot-a`,ariaLabel:`Run A`,source:s,onPick:c,onChange:()=>c(null)})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`mb-2 text-sm font-medium text-muted-foreground`,children:`Run B (candidate)`}),(0,U.jsx)(hc,{testId:`compare-slot-b`,ariaLabel:`Run B`,source:l,onPick:u,onChange:()=>u(null)})]})]}),(0,U.jsx)(`div`,{className:`flex justify-end`,children:(0,U.jsx)(X,{type:`button`,className:`tap-target-comfortable`,disabled:!s||!l,onClick:()=>{s&&l&&n(s,l)},children:`Compare`})})]}):(0,U.jsxs)(`div`,{className:`landing-shell mx-auto w-full max-w-6xl`,children:[(0,U.jsxs)(`section`,{className:`landing-hero`,"aria-labelledby":`landing-title`,children:[(0,U.jsxs)(dc,{className:`landing-identity`,children:[(0,U.jsx)(kn,{"aria-hidden":`true`,className:`size-4`}),(0,U.jsx)(`span`,{children:`SparkForensics`}),(0,U.jsxs)(`button`,{type:`button`,className:`theme-toggle tap-target-comfortable`,"aria-label":`Toggle theme`,"aria-pressed":r===`light`,title:`Toggle theme`,onClick:i,children:[(0,U.jsx)(ar,{"aria-hidden":`true`,className:`theme-icon sun`}),(0,U.jsx)(Zn,{"aria-hidden":`true`,className:`theme-icon moon`})]})]}),(0,U.jsxs)(`div`,{className:`landing-hero-copy`,children:[(0,U.jsx)(`p`,{className:`landing-kicker`,children:`Private by default`}),(0,U.jsx)(`h2`,{id:`landing-title`,children:`Analyze a Spark event log.`}),(0,U.jsx)(`p`,{children:`Read stages, timelines, shuffle reads, and executor behavior from the log Spark already produced.`})]}),(0,U.jsxs)(`div`,{className:`landing-proof`,"aria-label":`SparkForensics guarantees`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(rr,{"aria-hidden":`true`}),` Nothing leaves your machine`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(Fn,{"aria-hidden":`true`}),` Bring your AI into the investigation`]}),(0,U.jsxs)(`span`,{children:[(0,U.jsx)(Gn,{"aria-hidden":`true`}),` Compare one run against another`]})]}),(0,U.jsx)(_c,{})]}),(0,U.jsxs)(`section`,{className:`landing-intake`,"aria-labelledby":`start-investigation-title`,children:[(0,U.jsx)(`div`,{className:`landing-section-heading`,children:(0,U.jsx)(`div`,{children:(0,U.jsx)(`h2`,{id:`start-investigation-title`,children:`Analyze a single run first.`})})}),e?(0,U.jsx)(fc,{message:e,nonce:t}):null,(0,U.jsx)(Ls,{})]}),(0,U.jsx)(vc,{onCompare:()=>o(!0)})]})}function bc(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function xc(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function Sc(e){return e/100*window.innerHeight}function Cc(e){return e/100*window.innerWidth}function wc(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Tc({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=wc(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=xc(t,i);break;case`em`:r=bc(t,i);break;case`vh`:r=Sc(i);break;case`vw`:r=Cc(i)}return r}function Ec(e){return parseFloat(e.toFixed(3))}function Dc({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Oc(e){let{panels:t}=e,n=Dc({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=Ec(Tc({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.collapsedThreshold!==void 0&&(a=Ec(Tc({groupSize:n,panelElement:t,styleProp:r.collapsedThreshold})/n*100));let o;r.defaultSize!==void 0&&(o=Ec(Tc({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let s=0;r.minSize!==void 0&&(s=Ec(Tc({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let c=100;return r.maxSize!==void 0&&(c=Ec(Tc({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsedThreshold:a,collapsible:r.collapsible===!0,defaultSize:o,disabled:r.disabled,minSize:s,maxSize:c,panelId:e.id}})}var kc=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0){if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},Z={cursorFlags:0,state:`inactive`},Ac=new kc;function jc(){return Z}function Mc(e){return Ac.addListener(`change`,e)}function Nc(e,t=[],n,r=!1){let i=Z,a={...Z};a.cursorFlags=e,a.state===`active`&&(a.didPointerMove||=r,a.previews=t,n&&(a.previewLayoutMap=n)),Z=a,Ac.emit(`change`,{prev:i,next:a})}function Pc(e){let t=Z;Z=e,t.state===`active`&&e.state!==`active`&&t.didPointerMove&&t.hitRegions.forEach(({separator:e})=>{e&&e.element.ownerDocument.activeElement===e.element&&e.element.blur()}),Ac.emit(`change`,{prev:t,next:e})}function Fc(e){Z.state!==`active`||!Z.previews.some(t=>t.separator===e)||Pc({...Z,previews:Z.previews.map(t=>t.separator===e?{...t}:t)})}function Ic(e){if(Z.state===`inactive`)return!1;let t=Z.hitRegions.filter(t=>t.group!==e),n=Z.state===`active`&&Z.previews.some(t=>t.group===e);if(t.length===Z.hitRegions.length&&!n)return!1;if(t.length===0)Pc({cursorFlags:0,state:`inactive`});else if(Z.state===`active`){let n=new Map(Z.initialLayoutMap),r=new Map(Z.previewLayoutMap);n.delete(e),r.delete(e),Pc({...Z,cursorFlags:0,hitRegions:t,initialLayoutMap:n,previewLayoutMap:r,previews:Z.previews.filter(t=>t.group!==e)})}else Pc({...Z,hitRegions:t});return!0}var Lc=e=>e,Rc=()=>{},zc=1,Bc=2,Vc=4,Hc=8,Uc=3,Wc=12,Gc;function Kc(){return Gc===void 0&&(Gc=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(Gc=!0)),Gc}function qc({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++}})}if(r!==0||i!==0){if(n===`active`&&e&&Kc()){let t=(e&zc)!==0,n=(e&Bc)!==0,r=(e&Vc)!==0,i=(e&Hc)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}return Kc()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var Jc=new WeakMap;function Yc(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=Jc.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=jc();switch(r.state){case`active`:case`hover`:{let e=qc({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0)}Jc.set(e,{prevStyle:t,styleSheet:n})}function Q(e,t=`Assertion error`){if(!e)throw Error(t)}function Xc(e,t){return Array.from(t).sort((t,n)=>{let r=e===`horizontal`?Zc(t,n):Qc(t,n);if(r!==0)return r;let i=t.element.compareDocumentPosition(n.element);return i&Node.DOCUMENT_POSITION_DISCONNECTED?0:i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Zc(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Qc(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function $c(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function el(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function tl({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=el(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return Q(i,`No rect found`),i}var nl;function rl(){return nl===void 0&&(nl=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),nl}function il({expandHitTargets:e=!0,group:t,includeDisabled:n=!1}){let{element:r,orientation:i,panels:a,separators:o}=t,s=Xc(i,Array.from(r.children).filter($c).filter(e=>!e.hasAttribute(`data-resize-preview`)).map(e=>({element:e}))).map(({element:e})=>e),c=[],l=!1,u=!1,d=-1,f,p=-1,m=0,h,g=[];{let e=-1;for(let t of s)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(m++,d===-1&&(d=e),p=e))}if(n||m>1){let r=-1;for(let m of s)if(m.hasAttribute(`data-panel`)){r++;let o=a.find(e=>e.element===m);if(o){if(h){let a=h.element.getBoundingClientRect(),s=m.getBoundingClientRect(),_;if(u){let e=i===`horizontal`?new DOMRect(a.right,a.top,0,a.height):new DOMRect(a.left,a.bottom,a.width,0),t=i===`horizontal`?new DOMRect(s.left,s.top,0,s.height):new DOMRect(s.left,s.top,s.width,0);switch(g.length){case 0:_=[e,t];break;case 1:{let n=g[0];_=[n,tl({orientation:i,rects:[a,s],targetRect:n.element.getBoundingClientRect()})===a?t:e];break}default:_=g}}else _=g.length?g:[i===`horizontal`?new DOMRect(a.right,s.top,s.left-a.right,s.height):new DOMRect(s.left,a.bottom,s.width,s.top-a.bottom)];for(let i of _){let a=`width`in i?i:i.element.getBoundingClientRect(),s=e?rl()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine:0;if(a.width<s){let e=s-a.width;a=new DOMRect(a.x-e/2,a.y,a.width+e,a.height)}if(a.height<s){let e=s-a.height;a=new DOMRect(a.x,a.y-e/2,a.width,a.height+e)}(n||!l&&!(r<=d||r>p))&&(f??=Dc({group:t}),c.push({group:t,groupSize:f,panels:[h,o],separator:`width`in i?void 0:i,rect:a})),l=!1}}u=!1,h=o,g=[]}}else if(m.hasAttribute(`data-separator`)){m.ariaDisabled!==null&&(l=!0);let e=o.find(e=>e.element===m);e?g.push(e):(h=void 0,g=[])}else u=!0}return c}var al=new Map,ol=new kc;function sl(e){al=new Map(al),al.delete(e)}function cl(e,t){for(let[t]of al)if(t.id===e)return t}function ll(e,t){for(let[t,n]of al)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function ul(){return al}function dl(e,t){return ol.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function fl(e,t,n){let r=al.get(e);al=new Map(al),al.set(e,t),ol.emit(`groupChange`,{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function pl(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function $(e,t,n=0){return Math.abs(Ec(e)-Ec(t))<=n}function ml(e,t){return $(e,t)?0:e>t?1:-1}function hl({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsedThreshold:a,collapsible:o,disabled:s,maxSize:c=100,minSize:l=0}=t;if(s&&!e)return n;if(ml(r,l)<0){if(o){let e=a??(l-i)/2,t=ml(n,i)<=0,o=t?i+e:l-e,s=ml(r,o);r=ml(r,i)<=0||s<0||a!==void 0&&t&&s===0?i:l}else r=l}return r=Math.min(c,r),r=Ec(r),r}function gl({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if($(e,0))return t;let o=a===`imperative-api`,s=n.map(({panelId:e})=>t[e]),c=n.map(({panelId:e})=>i[e]),l=[...s],[u,d]=r;Q(u!=null,`Invalid first pivot index`),Q(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];Q(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Q(n!=null,`Previous layout not found for panel index ${t}`),$(n,i)){let t=o-n;ml(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];Q(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Q(n!=null,`Previous layout not found for panel index ${t}`),$(n,o)){let t=n-i;ml(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];Q(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsedSize:a,collapsedThreshold:o,collapsible:c,minSize:l}=r;if(c&&ml(i,l)<0){let t=l-a,n=o??t/2;if(ml(i+Math.abs(e),l)<0){let r=ml(Math.abs(e),n);e=r>0||r===0&&o===void 0&&e<0?e<0?-t:t:0}}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];Q(e!=null,`Previous layout not found for panel index ${r}`);let a=hl({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];Q(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=hl({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!$(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(pl(c,l))return i;{let t=e<0?d:u,r=s[t];Q(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=hl({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!$(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];Q(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=hl({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if($(i,s)||(t-=s-i,l[r]=s),$(t,0))break;e>0?r--:r++}}}return $(Object.values(l).reduce((e,t)=>t+e,0),100,.1)?l.reduce((e,t,r)=>(e[n[r].panelId]=t,e),{}):i}function _l(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||ml(e[n],t[n])!==0)return!1;return!0}function vl({commit:e,document:t,event:n,hitRegions:r,initialLayoutMap:i,mountedGroups:a,pointerDownAtPoint:o,prevCursorFlags:s}){let c=0,l=jc(),u=l.state===`active`?l.previews:[],d=new Map(l.state===`active`?l.previewLayoutMap:void 0);r.forEach(t=>{let{group:r,groupSize:s}=t,{orientation:l,panels:f}=r;if(e&&r.resizePreviewMode!==`separator`)return;let{disableCursor:p}=r.mutableState,m=0;m=o?l===`horizontal`?(n.clientX-o.x)/s*100:(n.clientY-o.y)/s*100:l===`horizontal`?n.clientX<0?-100:100:n.clientY<0?-100:100;let h=i.get(r),g=a.get(r);if(!h||!g)return;let{defaultLayoutDeferred:_,derivedPanelConstraints:v,groupSize:y,layout:b,separatorToPanels:x}=g;if(v&&b&&x){let n=r.resizePreviewMode===`separator`?d.get(r)??b:b,i=gl({delta:m,initialLayout:h,panelConstraints:v,pivotIndices:t.panels.map(e=>f.indexOf(e)),prevLayout:n,trigger:`mouse-or-touch`});if(r.resizePreviewMode===`separator`&&!e&&!_l(i,n)){d.set(r,i);let e=0,t=f.map(t=>(e+=i[t.id]-h[t.id],s/100*e));u=u.map(e=>{if(e.group!==r)return e;let n=t[e.panelIndex];return n===e.offset?e:{...e,offset:n}})}if(_l(i,n)&&m!==0&&!p)switch(l){case`horizontal`:c|=m<0?zc:Bc;break;case`vertical`:c|=m<0?Vc:Hc}(r.resizePreviewMode!==`separator`||e)&&!_l(i,b)&&fl(t.group,{defaultLayoutDeferred:_,derivedPanelConstraints:v,groupSize:y,layout:i,separatorToPanels:x})}});let f=0;n.movementX===0?f|=s&Uc:f|=c&Uc,n.movementY===0?f|=s&Wc:f|=c&Wc;let p=l.state===`active`&&(n.clientX!==l.pointerDownAtPoint.x||n.clientY!==l.pointerDownAtPoint.y);Nc(f,u,d,p),Yc(t)}function yl(e,t){let n=jc(),r=ul(),i=!1;return n.state===`active`&&(vl({commit:!0,document:e,event:t,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:r,pointerDownAtPoint:n.pointerDownAtPoint,prevCursorFlags:n.cursorFlags}),Pc({cursorFlags:0,state:`inactive`}),n.hitRegions.length>0&&(Yc(e),i=!0,n.hitRegions.forEach(e=>{if(!r.has(e.group))return;let t=ll(e.group.id,!0);fl(e.group,t,{isUserInteraction:!0})}))),i}function bl(e){e.defaultPrevented||yl(e.currentTarget,e)}function xl(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=el(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t)}}return r?{distance:i,hitRegion:r}:void 0}function Sl(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Cl(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:kl(e),b:kl(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Q(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Ol(Dl(n.a)),b:Ol(Dl(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var wl=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Tl(e){let t=getComputedStyle(Al(e)??e).display;return t===`flex`||t===`inline-flex`}function El(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Tl(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||wl.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Dl(e){let t=e.length;for(;t--;){let n=e[t];if(Q(n,`Missing node`),El(n))return n}return null}function Ol(e){return e&&Number(getComputedStyle(e).zIndex)||0}function kl(e){let t=[];for(;e;)t.push(e),e=Al(e);return t}function Al(e){let{parentNode:t}=e;return Sl(t)?t.host:t}function jl(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Ml({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!$c(n)||n.contains(e)||e.contains(n))return!0;if(Cl(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(jl(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Nl(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=il({group:r}),a=xl(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Ml({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function Pl({layout:e,panelConstraints:t}){let n=t.map(({panelId:t})=>e[t]),r=[...n],i=r.reduce((e,t)=>e+t,0);if(Object.keys(e).length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${Object.values(e).map(e=>`${e}%`).join(`, `)}`);if(!$(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];Q(t!=null,`No layout data found for index ${e}`);let n=100/i*t;r[e]=n}let a=0;for(let e=0;e<t.length;e++){let i=n[e];Q(i!=null,`No layout data found for index ${e}`);let o=r[e];Q(o!=null,`No layout data found for index ${e}`);let s=hl({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!$(a,0))for(let e=0;e<t.length;e++){let n=r[e];Q(n!=null,`No layout data found for index ${e}`);let i=n+a,o=hl({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,$(a,0)))break}return r.reduce((e,n,r)=>(e[t[r].panelId]=n,e),{})}function Fl({groupId:e,panelId:t}){let n=()=>{let t=ul();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&$(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:Ec(100-e)}}return gl({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=Pl({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});_l(c,u)||fl(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&$(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=Dc({group:t}),o=Ec(Tc({groupSize:a,panelElement:r,styleProp:e})/a*100);s(o)}}}function Il(e){e.defaultPrevented||Nl(e,ul()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=Fl({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function Ll(e){let t=ul();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function Rl({groupId:e}){let t=()=>{let t=ul();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=Pl({layout:e,panelConstraints:r});return n?o:(_l(o,c)||fl(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function zl(e,t){let n=Ll(e),r=ll(n.id,!0),i=n.separators.find(t=>t.element===e);Q(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);Q(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=Rl({groupId:n.id}).getLayout(),c=Pl({layout:gl({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});_l(s,c)||fl(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function Bl(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=Ll(t);if(!(n.disabled||n.separators.find(e=>e.element===t)?.disabled))switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&zl(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&zl(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&zl(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&zl(t,-5);break;case`End`:e.preventDefault(),zl(t,100);break;case`Enter`:{e.preventDefault();let n=Ll(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=ll(n.id,!0),o=n.separators.find(e=>e.element===t);Q(o,`Matching separator not found`);let s=a.get(o);Q(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(Q(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];zl(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=Ll(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);Q(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),zl(t,-100)}}function Vl(e,t){let{element:n,orientation:r,panels:i}=e,a=n.getBoundingClientRect(),o=r===`horizontal`;return il({expandHitTargets:!1,group:e,includeDisabled:!0}).map(({panels:r,rect:s,separator:c},l)=>{let u=i.indexOf(r[0]),d=o?s.left+s.width/2:s.top+s.height/2;return{active:t.some(t=>{if(t.group!==e||t.panels[0]!==r[0])return!1;if(c||t.separator)return t.separator===c;let n=o?t.rect.left+t.rect.width/2:t.rect.top+t.rect.height/2;return $(d,n)}),group:e,key:c?`separator-${c.id}`:`panel-${r[0].id}-${l}`,offset:0,panelIndex:u,rect:new DOMRect((o&&!c?d:s.left)-a.left-n.clientLeft+n.scrollLeft,(!o&&!c?d:s.top)-a.top-n.clientTop+n.scrollTop,o&&!c?0:s.width,!o&&!c?0:s.height),separator:c}})}function Hl(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=ul(),n=Nl(e,t);if(n.length===0)return;let r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)});let a=Array.from(r.keys()).flatMap(e=>e.resizePreviewMode===`separator`?Vl(e,n):[]);Pc({cursorFlags:0,didPointerMove:!1,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},previewLayoutMap:new Map(r),previews:a,state:`active`}),e.preventDefault()}function Ul(e){let t=ul(),n=jc();n.state===`active`&&vl({commit:!1,document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function Wl(e){if(e.defaultPrevented)return;let t=jc(),n=ul();switch(t.state){case`active`:if(e.buttons===0){t.previewLayoutMap.forEach((e,t)=>{let r=n.get(t);t.resizePreviewMode===`separator`&&r&&!_l(e,r.layout)&&fl(t,{...r,layout:e})}),Pc({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=ll(e.group.id,!0);fl(e.group,t,{isUserInteraction:!0})}),Yc(e.currentTarget);return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.isConnected&&!t.hasPointerCapture?.(e.pointerId)&&t.setPointerCapture?.(e.pointerId)}vl({commit:!1,document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=Nl(e,n);r.length===0?t.state!==`inactive`&&Pc({cursorFlags:0,state:`inactive`}):Pc({cursorFlags:0,hitRegions:r,state:`hover`}),Yc(e.currentTarget);break}}}function Gl(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(jc().state){case`hover`:Pc({cursorFlags:0,state:`inactive`})}}function Kl(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||yl(e.currentTarget,e)&&e.preventDefault()}function ql(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Ec(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Ec((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function Jl(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}function Yl({group:e,panelConstraints:t}){let n=e.panels.map(({id:e})=>e).join(`,`),r=e.mutableState.defaultLayout;return e.mutableState.layouts[n]??(r&&Jl(e.panels,r)?r:ql(t))}function Xl(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Dc({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Ec(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Zl(e,t){if(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 Ql(e,t){return e.length===t.length&&e.every((e,n)=>Zl(e,t[n]))}function $l({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Ec(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Ec((r[e]??0)/a*l);else{let e=Ec(l/c.length);for(let t of c)u[t]=e}return u}var eu=new Map;function tu(e){let t=!0;Q(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=Dc({group:e});if(t===0)return;let n=ll(e.id);if(!n)return;let r=Oc(e),i=n.defaultLayoutDeferred?Yl({group:e,panelConstraints:r}):n.layout,a=Pl({layout:$l({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&_l(n.layout,a)&&Ql(n.derivedPanelConstraints,r)&&n.groupSize===t)continue;fl(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else Xl(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{Q(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Dc({group:e}),s=Oc(e),c=Pl({layout:Yl({group:e,panelConstraints:s}),panelConstraints:s}),l=e.element.ownerDocument;eu.set(l,(eu.get(l)??0)+1);let u=new Map;return il({group:e,includeDisabled:!0}).forEach(e=>{e.separator&&u.set(e.separator,e.panels)}),fl(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:c,separatorToPanels:u}),e.separators.forEach(e=>{Q(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,Bl)}),eu.get(l)===1&&(l.addEventListener(`contextmenu`,bl,!0),l.addEventListener(`dblclick`,Il,!0),l.addEventListener(`pointerdown`,Hl,!0),l.addEventListener(`pointerleave`,Ul),l.addEventListener(`pointermove`,Wl),l.addEventListener(`pointerout`,Gl),l.addEventListener(`pointerup`,Kl,!0)),function(){t=!1,eu.set(l,Math.max(0,(eu.get(l)??0)-1)),sl(e),Ic(e)&&Yc(l),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Bl)}),eu.get(l)||(l.removeEventListener(`contextmenu`,bl,!0),l.removeEventListener(`dblclick`,Il,!0),l.removeEventListener(`pointerdown`,Hl,!0),l.removeEventListener(`pointerleave`,Ul),l.removeEventListener(`pointermove`,Wl),l.removeEventListener(`pointerout`,Gl),l.removeEventListener(`pointerup`,Kl,!0)),a.disconnect()}}function nu(){let[e,t]=(0,b.useState)({});return[e,(0,b.useCallback)(()=>t({}),[])]}function ru(e){let t=(0,b.useId)();return`${e??t}`}var iu=typeof window<`u`?b.useLayoutEffect:b.useEffect;function au(e){let t=(0,b.useRef)(e);return iu(()=>{t.current=e},[e]),(0,b.useCallback)((...e)=>t.current?.(...e),[t])}function ou(...e){return au(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t}})})}function su(e){let t=(0,b.useRef)({...e});return iu(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var cu=(0,b.createContext)(null);function lu({separator:e}){let{element:t}=e,n=(0,b.useRef)(null);return iu(()=>{let e=t.cloneNode(!0),r=[t,...t.querySelectorAll(`*`)],i=[e,...e.querySelectorAll(`*`)],a=t.ownerDocument.defaultView;return r.forEach((e,t)=>{let n=i[t];if(n instanceof a.HTMLElement||n instanceof a.SVGElement){let t=a.getComputedStyle(e);for(let e=0;e<t.length;e++){let r=t.item(e);n.style.setProperty(r,t.getPropertyValue(r))}}n.removeAttribute(`data-testid`),n.removeAttribute(`id`)}),Object.assign(e.style,{boxSizing:`border-box`,height:`100%`,margin:`0`,position:`static`,transform:`none`,width:`100%`}),n.current.appendChild(e),()=>e.remove()},[t]),(0,U.jsx)(`div`,{ref:n,style:{height:`100%`,opacity:.65,pointerEvents:`none`,width:`100%`}})}function uu(){let e=(0,b.useContext)(cu);return Q(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function du(e){let{registerOverlay:t}=uu(),n=(0,b.useRef)(e);Zl(n.current,e)||(n.current=e);let r=n.current;return iu(()=>t(r),[t,r]),null}du.displayName=`SeparatorOverlay`;function fu({active:e,orientation:t,style:n,...r}){let i;switch(t){case`horizontal`:i={height:`100%`,minWidth:`1px`};break;case`vertical`:i={minHeight:`1px`,width:`100%`}}return(0,U.jsx)(`div`,{...r,"data-separator-overlay":e?`active`:`inactive`,style:{...i,...n,flexShrink:0,pointerEvents:`none`}})}function pu({overlay:e,preview:t}){let{group:n,offset:r,rect:i,separator:a}=t,o=n.orientation===`horizontal`,s=a?.preview,c=e;return(0,b.isValidElement)(s)&&s.type===du&&(c=s.props,s=void 0),s??(c?s=(0,U.jsx)(fu,{...c,active:t.active,orientation:n.orientation}):a&&(s=(0,U.jsx)(lu,{separator:a}))),(0,U.jsx)(`div`,{"aria-hidden":`true`,"data-resize-preview":!0,inert:!0,style:{height:i.height,left:i.left,pointerEvents:`none`,position:`absolute`,top:i.top,transform:o?`translateX(${r}px)`:`translateY(${r}px)`,width:i.width},children:s})}function mu(e,t){let n=(0,b.useRef)({getLayout:()=>({}),setLayout:Lc});(0,b.useImperativeHandle)(t,()=>n.current,[]),iu(()=>{Object.assign(n.current,Rl({groupId:e}))})}function hu({groupId:e,resizePreviewMode:t}){let[n,r]=(0,b.useState)([]),i=(0,b.useRef)(n);return iu(()=>{let n=n=>{let a=cl(e),o=t===`separator`&&n.state===`active`?n.previews.filter(e=>e.group===a&&(e.active||!$(e.offset,0))):[],s=i.current;s.length===o.length&&o.every((e,t)=>e===s[t])||(i.current=o,r(o))};if(t!==`separator`){n(jc());return}let a=Mc(({next:e})=>n(e));return n(jc()),a},[e,t]),n}function gu({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizePreviewMode:d=`panel`,resizeTargetMinimumSize:f={coarse:20,fine:10},style:p,...m}){let h=(0,b.useRef)({onLayoutChange:{},onLayoutChanged:{}}),g=au(e=>{_l(h.current.onLayoutChange,e)||(h.current.onLayoutChange=e,c?.(e))}),_=au((e,t)=>{_l(h.current.onLayoutChanged,e)||(h.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t}))}),v=ru(s),[y,x]=(0,b.useState)(),ee=hu({groupId:v,resizePreviewMode:d}),S=(0,b.useRef)(null),[C,w]=nu(),T=(0,b.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),E=ou(S,a);mu(v,o);let D=au((e,t)=>{let r=ll(e);if(r)return{flexGrow:r.layout[t]??1};if(n?.[t])return{flexGrow:n?.[t]}}),O=su({defaultLayout:n,disableCursor:r,resizeTargetMinimumSize:f}),te=(0,b.useMemo)(()=>({get disableCursor(){return!!O.disableCursor},getPanelStyles:D,id:v,orientation:u,registerPanel:e=>{let t=T.current;return t.panels=Xc(u,[...t.panels,e]),w(),()=>{t.panels=t.panels.filter(t=>t!==e),w()}},registerOverlay:e=>(x(e),()=>{x(void 0)}),registerSeparator:e=>{let t=T.current;return t.separators=Xc(u,[...t.separators,e]),w(),()=>{t.separators=t.separators.filter(t=>t!==e),w()}},updatePanelProps:(e,{disabled:t})=>{let n=T.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=cl(v),i=ll(v);r&&i&&fl(r,{...i,derivedPanelConstraints:Oc(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=T.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[D,v,w,u,O]),k=(0,b.useRef)(null);return iu(()=>{let e=S.current;if(e===null)return;let t=T.current,n;if(O.defaultLayout!==void 0&&Object.keys(O.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=O.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:v,mutableState:{defaultLayout:n,disableCursor:!!O.disableCursor,expandedPanelSizes:T.current.lastExpandedPanelSizes,layouts:T.current.layouts},orientation:u,panels:t.panels,resizePreviewMode:d,get resizeTargetMinimumSize(){return O.resizeTargetMinimumSize},separators:t.separators};k.current=r;let a=tu(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=ll(r.id,!0);!o&&s.length>0&&(g(c),_(c,!1));let l=dl(v,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=$(t.collapsedSize,i[t.panelId]),a=$(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=jc(),s=o.state!==`active`||!o.hitRegions.some(e=>e.group===r);g(i),s&&_(i,e.isUserInteraction)});return()=>{k.current=null,a(),l()}},[i,v,_,g,u,C,d,O]),(0,b.useEffect)(()=>{let e=k.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,U.jsx)(cu.Provider,{value:te,children:(0,U.jsxs)(`div`,{...m,className:t,"data-group":!0,"data-testid":v,id:v,ref:E,style:{height:`100%`,width:`100%`,overflow:`hidden`,position:d===`separator`?`relative`:void 0,...p,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:[e,ee.map(e=>(0,U.jsx)(pu,{overlay:y,preview:e},e.key))]})})}gu.displayName=`Group`;function _u(e,t){let{id:n}=uu(),r=(0,b.useRef)({collapse:Rc,expand:Rc,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Rc});(0,b.useImperativeHandle)(t,()=>r.current,[]),iu(()=>{Object.assign(r.current,Fl({groupId:n,panelId:e}))})}function vu({children:e,className:t,collapsedSize:n=`0%`,collapsedThreshold:r,collapsible:i=!1,defaultSize:a,disabled:o,elementRef:s,groupResizeBehavior:c=`preserve-relative-size`,id:l,maxSize:u=`100%`,minSize:d=`0%`,onResize:f,panelRef:p,style:m,...h}){let g=!!l,_=ru(l),v=su({disabled:o}),y=(0,b.useRef)(null),x=ou(y,s),{getPanelStyles:ee,id:S,orientation:C,registerPanel:w,updatePanelProps:T}=uu(),E=f!==null,D=au((e,t,n)=>{f?.(e,l,n)});iu(()=>{let e=y.current;if(e!==null){let t={element:e,id:_,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:E?D:void 0,panelConstraints:{groupResizeBehavior:c,collapsedSize:n,collapsedThreshold:r,collapsible:i,defaultSize:a,disabled:v.disabled,maxSize:u,minSize:d}};return w(t)}},[c,n,r,i,a,E,_,g,u,d,D,w,v]),(0,b.useEffect)(()=>{T(_,{disabled:o})},[o,_,T]),_u(_,p);let O=()=>{let e=ee(S,_);if(e)return JSON.stringify(e)},te=(0,b.useSyncExternalStore)(e=>dl(S,e),O,O),k;return k=te?JSON.parse(te):a===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:a},(0,U.jsx)(`div`,{...h,"data-disabled":o||void 0,"data-panel":!0,"data-testid":_,id:_,ref:x,style:{...yu,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,U.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...m,touchAction:C===`horizontal`?`pan-y`:`pan-x`},children:e})})}vu.displayName=`Panel`;var yu={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function bu({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=Pl({layout:gl({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=Pl({layout:gl({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function xu({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,preview:o,style:s,...c}){let l=ru(a),u=su({disabled:n,disableDoubleClick:r,children:e,className:t,preview:o,style:s}),[d,f]=(0,b.useState)({}),[p,m]=(0,b.useState)(`inactive`),[h,g]=(0,b.useState)(!1),_=(0,b.useRef)(null),v=(0,b.useRef)(null),y=ou(_,i),{disableCursor:x,id:ee,orientation:S,registerSeparator:C,updateSeparatorProps:w}=uu(),T=S===`horizontal`?`vertical`:`horizontal`;iu(()=>{let e=_.current;if(e!==null){let t={disabled:u.disabled,disableDoubleClick:u.disableDoubleClick,element:e,id:l,get children(){return u.children},get className(){return u.className},get preview(){return u.preview},get style(){return u.style}};v.current=t;let n=C(t),r=Mc(e=>{m(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=dl(ee,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=n.findIndex(t=>t.panelId===e.id);f(bu({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{v.current=null,r(),i(),n()}}},[ee,l,C,u]),iu(()=>{let e=v.current;e&&Fc(e)},[o]),(0,b.useEffect)(()=>{w(l,{disabled:n,disableDoubleClick:r})},[n,r,l,w]);let E;n&&!x&&(E=`not-allowed`);let D;if(n)D=`disabled`;else switch(p){case`active`:D=`active`;break;default:D=h?`focus`:p}return(0,U.jsx)(`div`,{...c,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":T,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":D,"data-testid":l,id:l,onBlur:()=>g(!1),onFocus:()=>g(!0),ref:y,role:`separator`,style:{flexBasis:`auto`,cursor:E,...s,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}xu.displayName=`Separator`;var Su=6,Cu=320,wu=.9;function Tu(e){return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)}function Eu(){return Math.min(Cu,Math.floor(window.innerWidth*wu))}function Du(e,t){let n=e.indexOf(`#`),r=n===-1?e:e.slice(0,n),i=n===-1?``:e.slice(n);return`${r}${r.includes(`?`)?`&`:`?`}t=${t}${i}`}function Ou(){let{isOpen:e,target:t,close:n}=Ws(),{theme:r}=Pt(),c=(0,b.useSyncExternalStore)(Tu,Eu),l=(0,b.useRef)(null),[u,d]=(0,b.useState)(null),f=(0,b.useRef)(null),p=(0,b.useCallback)(e=>{if(f.current?.disconnect(),f.current=null,!e){document.documentElement.style.setProperty(`--docs-inset`,`0px`);return}let t=()=>document.documentElement.style.setProperty(`--docs-inset`,`${e.getBoundingClientRect().width+Su}px`),n=new ResizeObserver(t);n.observe(e),t(),f.current=n},[]);(0,b.useEffect)(()=>{if(!e){l.current=null,d(null);return}let n=t.path,i=l.current;i&&i.path===n&&i.theme===r||(l.current={kind:`site`,path:n,theme:r},d(Du(n,r)))},[e,t,r]);let m=t.source===`reference`?`Reference`:`Guide`;return(0,U.jsx)(i,{open:e,modal:!1,disablePointerDismissal:!0,onOpenChange:e=>{e||n()},children:(0,U.jsx)(s,{children:(0,U.jsx)(o,{"data-slot":`docs-panel`,className:`pointer-events-none fixed inset-0 z-[60]`,children:(0,U.jsxs)(gu,{orientation:`horizontal`,className:`h-full w-full`,children:[(0,U.jsx)(vu,{minSize:`10%`,className:`pointer-events-none`}),(0,U.jsx)(xu,{"aria-label":`Resize docs panel`,className:`pointer-events-auto w-1.5 cursor-col-resize bg-border/60 transition-colors hover:bg-primary/50 data-dragging:bg-primary/50`}),(0,U.jsx)(vu,{defaultSize:576,minSize:c,maxSize:`90vw`,className:`pointer-events-auto`,children:(0,U.jsxs)(`div`,{ref:p,className:`flex h-full flex-col border-l border-border bg-popover text-sm text-popover-foreground shadow-lg`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border p-4`,children:[(0,U.jsx)(h,{className:`font-heading text-base font-medium text-foreground`,children:m}),(0,U.jsxs)(a,{render:(0,U.jsx)(X,{variant:`ghost`,size:`icon-sm`}),children:[(0,U.jsx)(pr,{"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]}),(0,U.jsx)(`iframe`,{src:u??void 0,title:m,className:`w-full flex-1 border-0`})]})})]})})})})}function ku({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,tabIndex:0,children:(0,U.jsx)(`table`,{"data-slot":`table`,className:H(`w-full caption-bottom text-sm`,e),...t})})}function Au({className:e,...t}){return(0,U.jsx)(`thead`,{"data-slot":`table-header`,className:H(`[&_tr]:border-b`,e),...t})}function ju({className:e,...t}){return(0,U.jsx)(`tbody`,{"data-slot":`table-body`,className:H(`[&_tr:last-child]:border-0`,e),...t})}function Mu({className:e,...t}){return(0,U.jsx)(`tr`,{"data-slot":`table-row`,className:H(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function Nu({className:e,...t}){return(0,U.jsx)(`th`,{"data-slot":`table-head`,className:H(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function Pu({className:e,...t}){return(0,U.jsx)(`td`,{"data-slot":`table-cell`,className:H(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}function Fu({className:e,...t}){return(0,U.jsx)(`caption`,{"data-slot":`table-caption`,className:H(`mt-4 text-sm text-muted-foreground`,e),...t})}function Iu({className:e,size:t=`default`,...n}){return(0,U.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:H(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function Lu({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-content`,className:H(`px-(--card-spacing)`,e),...t})}var Ru=(0,b.createContext)(!0),zu=()=>(0,b.useContext)(Ru),Bu=(0,b.createContext)(null),Vu=(0,b.createContext)(null),Hu=(0,b.createContext)(null),Uu=(0,b.createContext)(null);function Wu({children:e,registerWidget:t,registerFindingAnchor:n,reportWidgetOpen:r,clearRouteFocus:i,focusedWidgetId:a,activeRouteTarget:o,flashedFinding:s}){let c=(0,b.useMemo)(()=>({registerWidget:t,registerFindingAnchor:n,reportWidgetOpen:r,clearRouteFocus:i}),[t,n,r,i]);return(0,U.jsx)(Bu.Provider,{value:c,children:(0,U.jsx)(Vu.Provider,{value:a,children:(0,U.jsx)(Hu.Provider,{value:o,children:(0,U.jsx)(Uu.Provider,{value:s,children:e})})})})}function Gu(){return(0,b.useContext)(Bu)}function Ku(){return(0,b.useContext)(Vu)}function qu(){return(0,b.useContext)(Hu)}function Ju(){return(0,b.useContext)(Uu)}var Yu=(0,b.createContext)(null);function Xu(){return(0,b.useContext)(Yu)}function Zu({children:e,className:t}){return(0,U.jsx)(`div`,{className:H(`grid grid-cols-[repeat(auto-fit,minmax(320px,1fr))] items-start gap-4`,t),children:e})}function Qu({cardId:e,widgetId:t,children:n,className:r,collapsedTile:i=!1}){let a=Gu(),o=Ku(),[s,c]=(0,b.useState)(0),[l,u]=(0,b.useState)(!1),d=(0,b.useRef)(null),f=(0,b.useRef)(null),p=(0,b.useMemo)(()=>({openRequestGeneration:s,reportOpen:e=>{u(e),t&&a?.reportWidgetOpen(t,e)},setDisclosureButton:e=>{f.current=e},onDisclosureBlur:()=>{t&&a?.clearRouteFocus(t)},routeFocused:t?o===t:!1,collapsedTile:i}),[a,s,t,o,i]);return(0,b.useLayoutEffect)(()=>{if(a&&t&&d.current)return a.registerWidget(t,{wrapperElement:d.current,open:()=>{c(e=>e+1)},getDisclosureButton:()=>f.current})},[a,t]),(0,U.jsx)(Yu.Provider,{value:p,children:(0,U.jsx)(`div`,{ref:d,"data-testid":`widget-grid-item-${e}`,className:H(`empty:hidden`,t&&`scroll-mt-20`,l&&`col-span-full`,r),children:n})})}function $u({children:e}){return(0,U.jsx)(Yu.Provider,{value:null,children:e})}function ed({title:e,impactBand:t,badges:n,statusBadge:r,summary:i,defaultCollapsed:a=!1,collapsible:o=!0,open:s,onOpenChange:c,compact:l=!1,routeFocused:u,disclosureButtonRef:d,children:f,id:p}){let m=Xu(),h=(0,b.useRef)(null),g=m?.collapsedTile??!1,[_,v]=(0,b.useState)(!g&&!a),y=s??_,x=u??m?.routeFocused??!1,[ee,S]=(0,b.useState)(x),C=(0,b.useRef)(0);(0,b.useLayoutEffect)(()=>{m?.reportOpen(y)},[m,y]),(0,b.useLayoutEffect)(()=>{let e=m?.openRequestGeneration??0;e!==0&&e!==C.current&&(C.current=e,y||(s===void 0?v(!0):c?.(!0)))},[s,m?.openRequestGeneration,c,y]),(0,b.useLayoutEffect)(()=>{S(x)},[x]);let w=e=>{s===void 0?v(e):c?.(e)},T=(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 px-(--card-spacing) sm:flex-row sm:flex-wrap sm:items-center sm:justify-between`,children:[o?(0,U.jsxs)(ic,{ref:e=>{m?.setDisclosureButton(e),typeof d==`function`?d(e):d&&(d.current=e)},"aria-expanded":String(y),"data-route-focused":ee?``:void 0,className:H(`tap-target-comfortable tap-target-comfortable--sm flex min-w-0 cursor-pointer items-center gap-2 bg-transparent text-left sm:flex-1`,ee&&`border-ring ring-[3px] ring-ring/50 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`),onBlur:e=>{e.relatedTarget&&h.current?.contains(e.relatedTarget)||(S(!1),m?.onDisclosureBlur())},children:[(0,U.jsx)(`h3`,{className:`font-heading text-base leading-snug font-bold`,children:e}),y?(0,U.jsx)(zn,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}):(0,U.jsx)(Ln,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]}):(0,U.jsx)(`h3`,{className:`min-w-0 font-heading text-base leading-snug font-bold sm:flex-1`,children:e}),n||y&&r?(0,U.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1`,children:[n,y?r:null]}):null]}),E=(0,U.jsx)($u,{children:(0,U.jsx)(Lu,{children:f})});return(0,U.jsx)(Iu,{ref:h,id:p,size:l?`sm`:`default`,className:H(`border-l-4`,t?Zs[t]:`border-transparent`,g&&!y&&`min-h-[6.5rem]`),children:o?(0,U.jsxs)(rc,{open:y,onOpenChange:w,children:[T,i&&!y?(0,U.jsx)(`div`,{className:`px-(--card-spacing) pb-(--card-spacing)`,children:i}):null,(0,U.jsx)($u,{children:(0,U.jsx)(ac,{keepMounted:!0,children:(0,U.jsx)(Ru.Provider,{value:y,children:(0,U.jsx)(Lu,{children:f})})})})]}):(0,U.jsxs)(U.Fragment,{children:[T,E]})})}function td(){return(0,U.jsx)(Iu,{className:`border-l-4 border-transparent`,"aria-hidden":`true`,children:(0,U.jsx)(Lu,{children:(0,U.jsx)(`div`,{className:`h-5 w-1/3 animate-pulse rounded-md bg-muted motion-reduce:animate-none`})})})}var nd=e=>String(e),rd=[{key:`duration`,label:`Duration`,fmt:Br},{key:`executorRunTime`,label:`Executor run-time`,fmt:Br},{key:`jvmGCTime`,label:`GC time`,fmt:Br},{key:`memoryBytesSpilled`,label:`Memory spill`,fmt:q},{key:`diskBytesSpilled`,label:`Disk spill`,fmt:q},{key:`inputBytes`,label:`Input read`,fmt:q},{key:`outputBytes`,label:`Output written`,fmt:q},{key:`taskCount`,label:`Task count`,fmt:nd},{key:`failedTasks`,label:`Failed tasks`,fmt:nd}];function id(e,t){return e==null?`—`:t(e)}function ad({base:e,cand:t,fmt:n}){if(e==null||t==null)return(0,U.jsx)(Pu,{className:`text-muted-foreground`,children:`—`});let r=t-e,i=r===0?`unchanged`:(r<0?`-`:`+`)+n(Math.abs(r));return(0,U.jsx)(Pu,{className:H(`font-medium`,r===0?`text-muted-foreground`:r<0?`text-clean`:`text-critical`),children:i})}function od({base:e,cand:t}){return(0,U.jsxs)(ku,{children:[(0,U.jsx)(Au,{children:(0,U.jsxs)(Mu,{children:[(0,U.jsx)(Nu,{className:`text-left`,children:`Metric`}),(0,U.jsx)(Nu,{children:`Baseline`}),(0,U.jsx)(Nu,{children:`Candidate`}),(0,U.jsx)(Nu,{children:`Δ`})]})}),(0,U.jsx)(ju,{children:rd.map(n=>(0,U.jsxs)(Mu,{"aria-label":n.label,children:[(0,U.jsx)(Nu,{scope:`row`,className:`text-left`,children:n.label}),(0,U.jsx)(Pu,{children:id(e.metrics[n.key],n.fmt)}),(0,U.jsx)(Pu,{children:id(t.metrics[n.key],n.fmt)}),(0,U.jsx)(ad,{base:e.metrics[n.key],cand:t.metrics[n.key],fmt:n.fmt})]},n.key))})]})}function sd({baseStages:e,candStages:t}){let[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)([]);if(e.length===0||t.length===0)return null;let c=t=>e.find(e=>e.id===t),l=e=>t.find(t=>t.id===e),u=()=>{n!==``&&i!==``&&s(e=>[...e,{baseId:Number(n),candId:Number(i)}])},d=e=>s(t=>t.filter((t,n)=>n!==e));return(0,U.jsxs)(ed,{title:`Pinned per-stage deltas`,children:[(0,U.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Pick one stage from each run to compare directly. Pairs are chosen by you: no automatic matching.`}),(0,U.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-end gap-3`,children:[(0,U.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Baseline stage`,(0,U.jsxs)(`select`,{className:`rounded border border-border bg-background px-2 py-1 text-sm text-foreground`,value:n,onChange:e=>r(e.target.value),children:[(0,U.jsx)(`option`,{value:``,children:`Select…`}),e.map(e=>(0,U.jsx)(`option`,{value:String(e.id),children:e.name},e.id))]})]}),(0,U.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-muted-foreground`,children:[`Candidate stage`,(0,U.jsxs)(`select`,{className:`rounded border border-border bg-background px-2 py-1 text-sm text-foreground`,value:i,onChange:e=>a(e.target.value),children:[(0,U.jsx)(`option`,{value:``,children:`Select…`}),t.map(e=>(0,U.jsx)(`option`,{value:String(e.id),children:e.name},e.id))]})]}),(0,U.jsx)(X,{type:`button`,size:`sm`,disabled:n===``||i===``,onClick:u,children:`Pin pair`})]}),(0,U.jsx)(`div`,{className:`flex flex-col gap-4`,children:o.map((e,t)=>{let n=c(e.baseId),r=l(e.candId);return!n||!r?null:(0,U.jsxs)(`div`,{className:`rounded border border-border p-3`,children:[(0,U.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,U.jsxs)(`span`,{className:`text-sm font-medium`,children:[n.name,` → `,r.name]}),(0,U.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>d(t),children:`Remove`})]}),(0,U.jsx)(od,{base:n,cand:r})]},t)})})]})}var cd=`bg-plan-aggregate/8 text-plan-aggregate`,ld=e=>`${e.toFixed(2)}×`,ud={wallClock:Br,shuffleSpill:q,taskSkew:ld,failedTaskRate:e=>`${(e*100).toFixed(1)}%`,diskSpill:q,gcTime:Br,inputBytes:q,outputBytes:q,executorRunTime:Br},dd=e=>ud[e]??(e=>Intl.NumberFormat().format(e)),fd={regression:`text-critical`,improvement:`text-clean`,unchanged:`text-muted-foreground`,neutral:`text-muted-foreground`,unavailable:`text-muted-foreground`};function pd({m:e}){if(e.direction===`unavailable`)return(0,U.jsxs)(Mu,{"aria-label":e.label,"data-direction":`unavailable`,children:[(0,U.jsx)(Nu,{scope:`row`,className:`text-left`,children:e.label}),(0,U.jsxs)(Pu,{colSpan:3,className:`text-muted-foreground`,children:[`Unavailable: `,e.unavailableReason]})]});let t=dd(e.key),n=e=>e==null?`—`:t(e),r=e=>e==null?`—`:e===0?`unchanged`:(e<0?`-`:`+`)+t(Math.abs(e)),i=rs.has(e.key)?`text-muted-foreground`:fd[e.direction];return(0,U.jsxs)(Mu,{"aria-label":e.label,"data-direction":e.direction,children:[(0,U.jsx)(Nu,{scope:`row`,className:`text-left`,children:e.label}),(0,U.jsx)(Pu,{children:n(e.baseline)}),(0,U.jsx)(Pu,{children:n(e.candidate)}),(0,U.jsx)(Pu,{className:H(`font-medium`,i),children:r(e.delta)})]})}var md=[`critical`,`warning`,`info`],hd=e=>md.includes(e)?e:`info`;function gd({stages:e}){return e.length===0?null:(0,U.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.map(e=>(0,U.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground`,children:e},e))})}function _d({items:e}){return(0,U.jsx)(`ul`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,U.jsxs)(`li`,{className:`flex flex-col gap-1 border-b border-border pb-2 last:border-0 last:pb-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(tc,{type:e.rule,impactBand:hd(e.impactBand),className:Tr(e.rule)===`PLAN`?cd:void 0}),(0,U.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[e.baseCount,` → `,e.candCount]})]}),(0,U.jsx)(gd,{stages:e.stages})]},`${e.rule}§${e.impactBand}`))})}function vd({reason:e}){let[t,n]=(0,b.useState)(!1);return t?null:(0,U.jsxs)(`div`,{role:`alert`,className:`mb-4 flex items-start justify-between gap-3 rounded border border-warning/40 bg-warning/10 px-3 py-2 text-sm text-warning`,children:[(0,U.jsx)(`span`,{children:e}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>n(!0),"aria-label":`Dismiss warning`,className:`shrink-0 cursor-pointer rounded px-1 text-muted-foreground hover:text-foreground`,children:`Dismiss`})]})}function yd({model:e,onClose:t,onDrillIn:n}){let r=Math.round(e.matchedCoverage*100);(0,b.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t]);let i=(0,U.jsxs)(`header`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{className:`font-heading text-lg font-semibold`,children:`Run comparison`}),(0,U.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Baseline `,(0,U.jsx)(`strong`,{children:e.baselineLabel}),` vs candidate `,(0,U.jsx)(`strong`,{children:e.candidateLabel})]})]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>n(`baseline`),children:`View run A dashboard`}),(0,U.jsx)(X,{variant:`outline`,size:`sm`,onClick:()=>n(`candidate`),children:`View run B dashboard`})]}):null,(0,U.jsx)(X,{variant:`ghost`,size:`sm`,onClick:t,children:`Close`})]})]});return(0,U.jsxs)(`div`,{"data-testid":`dashboard`,className:`mx-auto flex max-w-4xl flex-col gap-6 p-6`,children:[i,(0,U.jsxs)(`main`,{className:`contents`,children:[(0,U.jsx)(`h2`,{className:`sr-only`,children:`Comparison results`}),e.confidence===`low`&&e.reason?(0,U.jsx)(vd,{reason:e.reason}):null,(0,U.jsxs)(ed,{title:`Metrics`,children:[(0,U.jsxs)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:[`Metrics and finding categories cover the whole run. Per-stage skew below covers only the `,r,`% of stages that matched by unique identity.`]}),(0,U.jsxs)(ku,{children:[(0,U.jsx)(Au,{children:(0,U.jsxs)(Mu,{children:[(0,U.jsx)(Nu,{className:`text-left`,children:`Metric`}),(0,U.jsxs)(Nu,{children:[`Baseline (`,e.baselineLabel,`)`]}),(0,U.jsxs)(Nu,{children:[`Candidate (`,e.candidateLabel,`)`]}),(0,U.jsx)(Nu,{children:`Δ`})]})}),(0,U.jsx)(ju,{children:e.metrics.map(e=>(0,U.jsx)(pd,{m:e},e.key))})]})]}),e.findings.introduced.length>0||e.findings.resolved.length>0?(0,U.jsxs)(ed,{title:`Findings by category`,children:[e.findings.introduced.length>0?(0,U.jsxs)(`div`,{className:`mb-4`,children:[(0,U.jsxs)(`h3`,{className:`mb-2 text-xs font-semibold text-muted-foreground`,children:[`More in candidate (`,e.candidateLabel,`)`]}),(0,U.jsx)(_d,{items:e.findings.introduced})]}):null,e.findings.resolved.length>0?(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h3`,{className:`mb-2 text-xs font-semibold text-muted-foreground`,children:[`Fewer in candidate (`,e.candidateLabel,`)`]}),(0,U.jsx)(_d,{items:e.findings.resolved})]}):null]}):null,e.stageSkew.length>0?(0,U.jsx)(ed,{title:`Per-stage task skew (matched stages only)`,children:(0,U.jsxs)(ku,{children:[(0,U.jsx)(Au,{children:(0,U.jsxs)(Mu,{children:[(0,U.jsx)(Nu,{className:`text-left`,children:`Stage`}),(0,U.jsx)(Nu,{children:`Baseline`}),(0,U.jsx)(Nu,{children:`Candidate`})]})}),(0,U.jsx)(ju,{children:[...e.stageSkew].sort((e,t)=>Math.abs(t.delta??0)-Math.abs(e.delta??0)).map(e=>(0,U.jsxs)(Mu,{children:[(0,U.jsx)(Nu,{scope:`row`,className:`text-left`,children:e.identity.split(`§`)[0]}),(0,U.jsx)(Pu,{children:e.baseline==null?`—`:ld(e.baseline)}),(0,U.jsx)(Pu,{children:e.candidate==null?`—`:ld(e.candidate)})]},`${e.baseId}-${e.candId}`))})]})}):null,(0,U.jsx)(sd,{baseStages:e.baseStages??[],candStages:e.candStages??[]})]})]})}var bd=(0,b.createContext)(null);function xd({children:e}){let[t,n]=(0,b.useState)(null),r=(0,b.useCallback)(e=>n(e),[]),i=(0,b.useCallback)(()=>n(null),[]),a=(0,b.useMemo)(()=>({stageId:t,openStage:r,close:i}),[t,r,i]);return(0,U.jsx)(bd.Provider,{value:a,children:e})}function Sd(){let e=(0,b.useContext)(bd);if(!e)throw Error(`useStageDetail outside StageDetailProvider`);return e}function Cd(){let e=G(e=>e.planGraph.stageId),t=G(e=>e.planGraph.initialScope),n=G(e=>e.appModel),r=G(e=>e.catalog),i=G(e=>e.activeFileId),a=G(e=>e.closePlanGraph);return e==null?null:{stageId:e,initialScope:t,appModel:n,findings:r,activeFileId:i,onClose:a}}var wd=`modulepreload`,Td=function(e,t){return new URL(e,t).href},Ed={},Dd=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Td(t,n),t=s(t),t in Ed)return;Ed[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:wd,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Od=(0,b.lazy)(()=>Dd(async()=>{let{PlanGraphRoute:e}=await import(`./PlanGraphRoute-C3iOzUdB.js`);return{PlanGraphRoute:e}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url).then(({PlanGraphRoute:e})=>({default:e}))),kd=(0,b.lazy)(()=>Dd(async()=>{let{Dashboard:e}=await import(`./Dashboard-BFMsMuc_.js`);return{Dashboard:e}},__vite__mapDeps([8,1,2,3,4,5,6,9,10,11,12,13,14,15,16,17]),import.meta.url).then(({Dashboard:e})=>({default:e})));function Ad(){let e=G(e=>e.comparison),t=G(e=>e.closeComparison),{prepareComparison:n,drillIntoRun:r}=Ko(),i=(0,b.useMemo)(()=>{let t=e.baselineId&&e.candidateId?n(e.baselineId,e.candidateId):null;return t?ps(t.baseline,t.candidate):null},[e.baselineId,e.candidateId,n]),a=!i;return(0,b.useEffect)(()=>{a&&t()},[a,t]),i?(0,U.jsx)(yd,{model:i,onClose:t,onDrillIn:t=>{let n=t===`baseline`?e.baselineId:e.candidateId;n&&r(n)}}):null}function jd(){let e=Cd();return e?(0,U.jsx)(b.Suspense,{fallback:(0,U.jsx)(`p`,{role:`status`,"aria-live":`polite`,"aria-label":`Loading plan graph`,className:`p-6 text-sm text-muted-foreground`,children:`Loading plan graph…`}),children:(0,U.jsx)(Od,{...e},e.stageId)}):null}function Md(){let e=G(e=>e.status),t=G(e=>e.errorMessage),n=G(e=>e.errorNonce),r=G(e=>e.parse),i=G(e=>e.shsParsing),a=G(e=>e.planGraph.active),o=G(e=>e.comparison.active),s=G(e=>e.compareLoad);if(s){let e=Math.round(r.pct*100);return(0,U.jsxs)(`main`,{className:`flex min-h-screen flex-col items-center justify-center gap-4 p-10`,children:[(0,U.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-sm text-muted-foreground`,children:[`Parsing run `,s.current,` of 2… `,e,`%`]}),(0,U.jsx)(ct,{value:r.pct*100,className:`w-full max-w-md`})]})}if(a)return(0,U.jsx)(jd,{});if(o)return(0,U.jsx)(Ad,{});if(e===`ready`)return(0,U.jsx)(b.Suspense,{fallback:(0,U.jsx)(`p`,{role:`status`,"aria-live":`polite`,"aria-label":`Loading dashboard`,className:`p-6 text-sm text-muted-foreground`,children:`Loading dashboard…`}),children:(0,U.jsx)(kd,{})});if(e===`parsing`&&!i){let e=Math.round(r.pct*100),t=r.lines>0?` · ${r.lines.toLocaleString()} lines`:``;return(0,U.jsxs)(`main`,{className:`flex min-h-screen flex-col items-center justify-center gap-4 p-10`,children:[(0,U.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-sm text-muted-foreground`,children:[`Parsing… `,e,`%`,t]}),(0,U.jsx)(ct,{value:r.pct*100,className:`w-full max-w-md`})]})}return(0,U.jsx)(`main`,{className:`min-h-screen p-6 sm:p-10`,children:(0,U.jsx)(yc,{errorMessage:e===`error`?t:null,errorNonce:n})})}function Nd(){let e=G(e=>e.status),t=G(e=>e.planGraph.active),n=G(e=>e.comparison.active);return(0,U.jsx)(Nt,{children:(0,U.jsx)(Us,{children:(0,U.jsxs)(xd,{children:[e===`ready`||t||n?null:(0,U.jsx)(`header`,{children:(0,U.jsx)(`h1`,{className:`sr-only`,children:`SparkForensics`})}),(0,U.jsx)(Md,{}),(0,U.jsx)(Ou,{}),(0,U.jsx)(mr,{})]})})})}(0,x.createRoot)(document.getElementById(`root`)).render((0,U.jsx)(b.StrictMode,{children:(0,U.jsx)(Nd,{})}));export{$r as $,Ks as A,K as At,Mo as B,ic as C,ar as Ct,ec as D,Vn as Dt,Xs as E,Un as Et,_s as F,jt as Ft,Yi as G,_o as H,gs as I,xt as It,Di as J,ki as K,Ko as L,H as Lt,ks as M,Pt as Mt,Os as N,W as Nt,tc as O,zn as Ot,X as P,G as Pt,ai as Q,ko as R,ac as S,dr as St,Ys as T,qn as Tt,Ra as U,mo as V,va as W,vi as X,yi as Y,_i as Z,Pu as _,Vr as _t,td as a,Ur as at,Mu as b,Ar as bt,Wu as c,Er as ct,Gu as d,Br as dt,ri as et,zu as f,zr as ft,Fu as g,jr as gt,ju as h,Pr as ht,ed as i,Jr as it,zs as j,Qt as jt,Js as k,Ln as kt,qu as l,Hr as lt,ku as m,kr as mt,Sd as n,ni as nt,Zu as o,xr as ot,Iu as p,Fr as pt,Oi as q,cd as r,Gr as rt,Qu as s,Dr as st,Dd as t,ii as tt,Ju as u,q as ut,Nu as v,Cr as vt,nc as w,Zn as wt,rc as x,pr as xt,Au as y,Tr as yt,Ao as z};
|