semiotic 3.10.1 → 3.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -62
- package/ai/artifact-surface-inventory.json +4 -1
- package/ai/dist/mcp-server.js +25 -24
- package/ai/examples.md +28 -0
- package/ai/reference.md +6 -1
- package/ai/schema.json +121 -5
- package/ai/surface-manifest.json +3 -2
- package/ai/task-packets/compare-category-totals.json +7 -53
- package/ai/task-packets/compare-category-totals.md +4 -4
- package/ai/task-packets/correct-published-chart.json +7 -53
- package/ai/task-packets/correct-published-chart.md +4 -4
- package/ai/task-packets/index.json +9 -9
- package/ai/task-packets/update-live-chart.json +8 -54
- package/ai/task-packets/update-live-chart.md +4 -4
- package/dist/c-27DCB5T6.min.js +18 -0
- package/dist/c-2MONF2P6.min.js +1 -0
- package/dist/c-2TW5H5PD.min.js +1 -0
- package/dist/c-3AGX252H.min.js +1 -0
- package/dist/c-3B6JZEZT.min.js +1 -0
- package/dist/c-3BYZXCX3.min.js +4 -0
- package/dist/c-3DIPZJDO.min.js +1 -0
- package/dist/c-3FOUMWLR.min.js +1 -0
- package/dist/c-3NA6I656.min.js +2 -0
- package/dist/c-3OFVBWQY.min.js +1 -0
- package/dist/{c-QA3HMQJP.min.js → c-3PFVJFBK.min.js} +1 -1
- package/dist/c-3PPO7ZJF.min.js +4 -0
- package/dist/c-3YEW2PK6.min.js +1 -0
- package/dist/c-4JKDJUYD.min.js +1 -0
- package/dist/c-4LKK5YWB.min.js +1 -0
- package/dist/c-4MD53L2J.min.js +33 -0
- package/dist/c-4V3CD337.min.js +1 -0
- package/dist/c-4XLHPQTP.min.js +1 -0
- package/dist/c-5NYONM6V.min.js +5 -0
- package/dist/c-6IVBV5NO.min.js +1 -0
- package/dist/c-6ZU3QVLB.min.js +100 -0
- package/dist/c-72CBVNYX.min.js +209 -0
- package/dist/c-7APWCEPL.min.js +1 -0
- package/dist/c-7ASK4WBF.min.js +1 -0
- package/dist/{c-ORLEBW72.min.js → c-7FKPPCGN.min.js} +1 -1
- package/dist/c-7LY46QUI.min.js +41 -0
- package/dist/c-ABMGCCLT.min.js +1 -0
- package/dist/c-AINGQGUN.min.js +1 -0
- package/dist/c-AKLBQMQF.min.js +391 -0
- package/dist/c-AXJ2QI3F.min.js +1 -0
- package/dist/c-BQYD7T4E.min.js +1 -0
- package/dist/{c-V4XMSLC3.min.js → c-BYJJ7EMG.min.js} +1 -1
- package/dist/{c-J6DVC236.min.js → c-C4KIXUWU.min.js} +1 -1
- package/dist/c-C4SXYFXL.min.js +1 -0
- package/dist/c-CLDCKFBE.min.js +1 -0
- package/dist/c-CLJCJSFU.min.js +1 -0
- package/dist/c-CLLCX3PT.min.js +2 -0
- package/dist/c-ECHBKW7U.min.js +1 -0
- package/dist/c-EPJWM2UT.min.js +1 -0
- package/dist/c-F2GGJB2S.min.js +31 -0
- package/dist/c-FD2BXSRG.min.js +1 -0
- package/dist/c-FDUQDCBC.min.js +51 -0
- package/dist/c-FOTTQHOO.min.js +1 -0
- package/dist/c-FU7A5KSY.min.js +1 -0
- package/dist/c-G53AVC42.min.js +113 -0
- package/dist/c-GHN6IR4Y.min.js +1 -0
- package/dist/c-GSCO3FWL.min.js +1 -0
- package/dist/c-GYLOSK7M.min.js +1 -0
- package/dist/c-HK4OSLZA.min.js +1 -0
- package/dist/c-HLGTD5SJ.min.js +1 -0
- package/dist/c-HQ27AHMC.min.js +1 -0
- package/dist/{c-D6HAAPTX.min.js → c-IBRLFKWA.min.js} +1 -1
- package/dist/c-IHWZ2C6D.min.js +26 -0
- package/dist/c-IIV73MUW.min.js +1 -0
- package/dist/c-IPYGNVN6.min.js +116 -0
- package/dist/c-JJKRER47.min.js +1 -0
- package/dist/c-JO6AYCU4.min.js +1 -0
- package/dist/c-JWHPG6S2.min.js +1 -0
- package/dist/c-JXVYIXTV.min.js +1 -0
- package/dist/c-K2ZIYDI3.min.js +1 -0
- package/dist/c-K37JAIWA.min.js +4 -0
- package/dist/c-KGROWFT2.min.js +9 -0
- package/dist/c-MOP2NGLH.min.js +1 -0
- package/dist/c-MTX2AO5S.min.js +1 -0
- package/dist/c-N5WT7TXG.min.js +1 -0
- package/dist/c-NATWERHZ.min.js +1 -0
- package/dist/{c-42PLDTX7.min.js → c-O53GOO7H.min.js} +1 -1
- package/dist/c-OVQB75PE.min.js +1 -0
- package/dist/c-P3SKRNZN.min.js +1 -0
- package/dist/c-P5NXQWIM.min.js +1 -0
- package/dist/c-P7BQMVQQ.min.js +1 -0
- package/dist/{c-GNTXRXRN.min.js → c-PDQHLOKU.min.js} +1 -1
- package/dist/c-PKY4JFY5.min.js +1 -0
- package/dist/c-PQOZPM4G.min.js +1 -0
- package/dist/c-PZ3NEGNG.min.js +1 -0
- package/dist/c-QXLDCATV.min.js +1 -0
- package/dist/c-R2HUSWKB.min.js +1 -0
- package/dist/{c-HYW2XA4Q.min.js → c-RHDOOQ4X.min.js} +1 -1
- package/dist/c-RZPP5ERV.min.js +1 -0
- package/dist/c-SG2Y7EBY.min.js +46 -0
- package/dist/{c-WUWXGQYA.min.js → c-SJIB5RNI.min.js} +1 -1
- package/dist/c-SQNEVNWT.min.js +1 -0
- package/dist/c-STHZWF3D.min.js +1 -0
- package/dist/c-TIDKVMMZ.min.js +1 -0
- package/dist/c-TIMGODBG.min.js +1 -0
- package/dist/c-TR7OHUAO.min.js +2 -0
- package/dist/c-TTKWXGAI.min.js +61 -0
- package/dist/c-TVKZC4BY.min.js +1 -0
- package/dist/c-U5XVLSHN.min.js +1 -0
- package/dist/c-U6NLVFN4.min.js +1 -0
- package/dist/{c-VJTDST2R.min.js → c-UBHICVSC.min.js} +1 -1
- package/dist/c-UOPPO26M.min.js +1 -0
- package/dist/c-UUDAON4Z.min.js +1 -0
- package/dist/c-V32TPPY2.min.js +1 -0
- package/dist/c-V5KFJWQQ.min.js +1 -0
- package/dist/{c-P65V6HLO.min.js → c-VN557BQE.min.js} +1 -1
- package/dist/c-VXIYF7V2.min.js +1 -0
- package/dist/c-Y342FJ6K.min.js +1 -0
- package/dist/c-YM6CT4LJ.min.js +1 -0
- package/dist/{c-MVR3RWF3.min.js → c-YMFUIO54.min.js} +1 -1
- package/dist/c-YQVOKPKR.min.js +1 -0
- package/dist/c-YRJ3BJQZ.min.js +1 -0
- package/dist/c-YT5KPVNP.min.js +1 -0
- package/dist/components/ai/audienceProfile.d.ts +18 -1
- package/dist/components/ai/describeChart.d.ts +5 -1
- package/dist/components/ai/intentManifest.d.ts +16 -0
- package/dist/components/ai/intentRegistry.d.ts +12 -0
- package/dist/components/ai/intents.d.ts +6 -6
- package/dist/components/ai/streamSchema.d.ts +19 -0
- package/dist/components/ai/streamingTypes.d.ts +57 -11
- package/dist/components/ai/suggestCharts.d.ts +1 -1
- package/dist/components/ai/suggestStreamCharts.d.ts +43 -8
- package/dist/components/ai/suggestStreamDashboard.d.ts +35 -0
- package/dist/components/ai/variantDiscovery.d.ts +1 -1
- package/dist/components/charts/ordinal/BarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/DonutChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/GroupedBarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/PieChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/ordinal/StackedBarChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +14 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +6 -5
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeLineChart.d.ts +2 -161
- package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +175 -0
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +6 -5
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +6 -5
- package/dist/components/charts/realtime/aggregate.d.ts +11 -1
- package/dist/components/charts/realtime/resolveWindowSize.d.ts +1 -1
- package/dist/components/charts/shared/DirectLabelLayer.d.ts +25 -0
- package/dist/components/charts/shared/directLabels.d.ts +12 -0
- package/dist/components/charts/shared/knownChartComponents.d.ts +4 -1
- package/dist/components/charts/shared/lineSeriesSsr.d.ts +0 -12
- package/dist/components/charts/shared/useChartSetup.d.ts +2 -0
- package/dist/components/charts/value/BigNumber.streamCapability.d.ts +2 -0
- package/dist/components/charts/value/GaugeChart.streamCapability.d.ts +2 -0
- package/dist/components/charts/xy/BubbleChart.d.ts +4 -1
- package/dist/components/charts/xy/ConnectedScatterplot.d.ts +4 -1
- package/dist/components/charts/xy/LineChart.d.ts +4 -1
- package/dist/components/charts/xy/Scatterplot.d.ts +7 -0
- package/dist/components/realtime/HyperLogLog.d.ts +19 -0
- package/dist/components/realtime/ReorderBuffer.d.ts +2 -2
- package/dist/components/realtime/TDigest.d.ts +22 -0
- package/dist/components/realtime/WindowAccumulator.d.ts +22 -5
- package/dist/components/realtime/applyChangelog.d.ts +38 -0
- package/dist/components/realtime/minHeap.d.ts +3 -0
- package/dist/components/recipes/atlas/flowCircuitChartProps.d.ts +1 -1
- package/dist/components/recipes/layout1d.d.ts +2 -20
- package/dist/components/recipes/minGapPlacement.d.ts +20 -0
- package/dist/components/semiotic-ai-core.d.ts +8 -3
- package/dist/components/semiotic-ai-stream.d.ts +10 -0
- package/dist/components/semiotic-ai.d.ts +4 -6
- package/dist/components/semiotic-realtime-core.d.ts +6 -2
- package/dist/components/semiotic-stream-types.d.ts +14 -0
- package/dist/components/semiotic-xy.d.ts +1 -0
- package/dist/components/semiotic.d.ts +3 -11
- package/dist/components/server/encodeSvgFramesToGif.d.ts +2 -0
- package/dist/components/server/rasterizeSVG.d.ts +2 -0
- package/dist/components/server/registerServerXYPlugins.d.ts +2 -0
- package/dist/components/server/renderEvidence.d.ts +4 -0
- package/dist/components/server/serverChartConfigs.d.ts +5 -0
- package/dist/components/server/serverChartConfigsRealtime.d.ts +6 -0
- package/dist/components/server/serverRealtimeCategoryColors.d.ts +3 -0
- package/dist/components/server/staticAnnotations.d.ts +9 -0
- package/dist/components/stream/SceneGraph.d.ts +3 -3
- package/dist/components/stream/StalenessBadge.d.ts +5 -2
- package/dist/components/stream/pipelinePathJoin.d.ts +27 -0
- package/dist/components/stream/pipelineTransitionTypes.d.ts +43 -0
- package/dist/components/stream/pipelineTransitions.d.ts +5 -35
- package/dist/components/stream/seriesGeometry.d.ts +2 -1
- package/dist/components/stream/streamEncodingTypes.d.ts +9 -0
- package/dist/components/stream/types.d.ts +25 -2
- package/dist/components/text/axisLabelAssessment.d.ts +15 -0
- package/dist/components/text/browserAxisLabelAssessment.d.ts +1 -0
- package/dist/components/text/browserLabelMeasurement.d.ts +3 -0
- package/dist/components/text/labelMeasurement.d.ts +19 -0
- package/dist/components/text/labelPlacement.d.ts +71 -0
- package/dist/components/text/useAxisLabelAssessment.d.ts +6 -0
- package/dist/components/text/useLabelMeasurer.d.ts +3 -0
- package/dist/controls.module.min.js +71 -1
- package/dist/geo.min.js +231 -1
- package/dist/geo.module.min.js +31 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics-matter.module.min.js +1 -1
- package/dist/physics-rapier.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/rough.min.js +2 -1
- package/dist/rough.module.min.js +2 -1
- package/dist/semiotic-access.module.min.js +1 -1
- package/dist/semiotic-ai-artifact-policy-constants.module.min.js +1 -1
- package/dist/semiotic-ai-core.d.ts +8 -3
- package/dist/semiotic-ai-core.min.js +4 -1
- package/dist/semiotic-ai-core.module.min.js +4 -1
- package/dist/semiotic-ai-hash-primitives.module.min.js +1 -1
- package/dist/semiotic-ai.d.ts +4 -6
- package/dist/semiotic-ai.module.min.js +14 -1
- package/dist/semiotic-artifact-react.min.js +269 -1
- package/dist/semiotic-artifact-react.module.min.js +137 -1
- package/dist/semiotic-artifact.min.js +3 -1
- package/dist/semiotic-artifact.module.min.js +3 -1
- package/dist/semiotic-atlas-core.min.js +2 -1
- package/dist/semiotic-atlas-core.module.min.js +1 -1
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-atlas.module.min.js +11 -1
- package/dist/semiotic-client-cjs-shared.min.js +1529 -1
- package/dist/semiotic-client-glyph.module.min.js +3 -1
- package/dist/semiotic-client-responsive.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-custom-layout-selection-cjs-shared.min.js +2 -1
- package/dist/semiotic-data.min.js +1 -1
- package/dist/semiotic-data.module.min.js +1 -1
- package/dist/semiotic-evidence.min.js +3 -1
- package/dist/semiotic-evidence.module.min.js +3 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +8 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +8 -1
- package/dist/semiotic-experimental-react-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-vacp.min.js +1 -1
- package/dist/semiotic-experimental-vacp.module.min.js +1 -1
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-realtime-core.d.ts +6 -2
- package/dist/semiotic-realtime-core.module.min.js +1 -1
- package/dist/semiotic-realtime-react.module.min.js +1 -1
- package/dist/semiotic-recipes-core-cjs-base.min.js +160 -1
- package/dist/semiotic-recipes-core.module.min.js +72 -1
- package/dist/semiotic-recipes-geo-cjs.min.js +1 -1
- package/dist/semiotic-recipes-react.min.js +3 -1
- package/dist/semiotic-server-edge-node.module.min.js +391 -1
- package/dist/semiotic-server-edge.min.js +651 -1
- package/dist/semiotic-server-edge.module.min.js +372 -1
- package/dist/semiotic-server-node.min.js +651 -1
- package/dist/semiotic-server-node.module.min.js +1 -1
- package/dist/semiotic-text.min.js +1 -1
- package/dist/semiotic-text.module.min.js +1 -1
- package/dist/semiotic-themes-core.min.js +1 -1
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +1 -1
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.min.js +11 -1
- package/dist/semiotic-utils-core.module.min.js +8 -1
- package/dist/semiotic-value.module.min.js +15 -1
- package/dist/semiotic-xy.d.ts +1 -0
- package/dist/semiotic.d.ts +3 -11
- package/dist/semiotic.module.min.js +10 -1
- package/dist/server.min.js +651 -1
- package/dist/server.module.min.js +1 -1
- package/dist/xy.module.min.js +1 -1
- package/package.json +4 -3
- package/dist/c-2N7IU2NY.min.js +0 -1
- package/dist/c-2RL2QPZJ.min.js +0 -1
- package/dist/c-2WK7YJLL.min.js +0 -1
- package/dist/c-45CQWZZ6.min.js +0 -1
- package/dist/c-4BRHKVKV.min.js +0 -1
- package/dist/c-7242NXSG.min.js +0 -1
- package/dist/c-7DVPSB5C.min.js +0 -1
- package/dist/c-7EGHJU2F.min.js +0 -1
- package/dist/c-A7OGOFSL.min.js +0 -1
- package/dist/c-AFBSWT77.min.js +0 -1
- package/dist/c-AH5HWZWS.min.js +0 -1
- package/dist/c-AJ7EC32V.min.js +0 -1
- package/dist/c-AQADQNY7.min.js +0 -1
- package/dist/c-ATM475SA.min.js +0 -1
- package/dist/c-AVO3Q7T7.min.js +0 -1
- package/dist/c-B7GW7IHJ.min.js +0 -1
- package/dist/c-BNFJMDHN.min.js +0 -1
- package/dist/c-BOHCQILI.min.js +0 -1
- package/dist/c-C3TZLTZK.min.js +0 -1
- package/dist/c-CGQAQWBV.min.js +0 -1
- package/dist/c-CPV4N35K.min.js +0 -1
- package/dist/c-DIPEYUOW.min.js +0 -1
- package/dist/c-E4JDJH4I.min.js +0 -1
- package/dist/c-E72OTUZU.min.js +0 -1
- package/dist/c-E7I2L7CU.min.js +0 -1
- package/dist/c-ELDWAO2V.min.js +0 -1
- package/dist/c-EUBTECGM.min.js +0 -1
- package/dist/c-EUMPMDCS.min.js +0 -1
- package/dist/c-EZZT2WAE.min.js +0 -1
- package/dist/c-FHBVFCQB.min.js +0 -1
- package/dist/c-G4HCO2IQ.min.js +0 -1
- package/dist/c-G5VIJEOK.min.js +0 -1
- package/dist/c-GHVOXAYH.min.js +0 -1
- package/dist/c-GXV3C3MO.min.js +0 -1
- package/dist/c-HHTK2R75.min.js +0 -1
- package/dist/c-HLLFJYTY.min.js +0 -1
- package/dist/c-HP4ZFM47.min.js +0 -1
- package/dist/c-HPOYKCCG.min.js +0 -1
- package/dist/c-HYDTS5OP.min.js +0 -1
- package/dist/c-I4QJ6YLM.min.js +0 -1
- package/dist/c-IK33LNZ6.min.js +0 -1
- package/dist/c-IK3PZHRY.min.js +0 -1
- package/dist/c-JIMJF6F6.min.js +0 -1
- package/dist/c-JUKIWTBJ.min.js +0 -1
- package/dist/c-KKPMHAZC.min.js +0 -1
- package/dist/c-L6WNDBHV.min.js +0 -1
- package/dist/c-LDEX5OFW.min.js +0 -1
- package/dist/c-LESEUVC5.min.js +0 -1
- package/dist/c-LYQMZMZQ.min.js +0 -1
- package/dist/c-MB6CV5NC.min.js +0 -1
- package/dist/c-MOKJOIPE.min.js +0 -1
- package/dist/c-N3FXLRNT.min.js +0 -1
- package/dist/c-N5NPTJVJ.min.js +0 -1
- package/dist/c-NHBL4J67.min.js +0 -1
- package/dist/c-ODG6TFSY.min.js +0 -1
- package/dist/c-PRIKOLTE.min.js +0 -1
- package/dist/c-PSKKFZNP.min.js +0 -1
- package/dist/c-PSNI6KAZ.min.js +0 -1
- package/dist/c-QAVFOEUY.min.js +0 -1
- package/dist/c-R2P4RR7Q.min.js +0 -1
- package/dist/c-RFC7UAG7.min.js +0 -1
- package/dist/c-S3AZX5PP.min.js +0 -1
- package/dist/c-SGAURYHG.min.js +0 -1
- package/dist/c-SJMWU6UX.min.js +0 -1
- package/dist/c-STIIGQOD.min.js +0 -1
- package/dist/c-T2ASIJVZ.min.js +0 -1
- package/dist/c-T2V7O2LO.min.js +0 -1
- package/dist/c-TKG2NP7G.min.js +0 -1
- package/dist/c-TX3THUTO.min.js +0 -1
- package/dist/c-TX7XJM3Z.min.js +0 -1
- package/dist/c-UC7SIU2W.min.js +0 -1
- package/dist/c-UMXSJIOV.min.js +0 -1
- package/dist/c-VRSXMLYF.min.js +0 -1
- package/dist/c-VSLWSAN2.min.js +0 -1
- package/dist/c-VXLOLYTO.min.js +0 -1
- package/dist/c-W4ZUKSEQ.min.js +0 -1
- package/dist/c-WCBRPILW.min.js +0 -1
- package/dist/c-WGHT7OCY.min.js +0 -1
- package/dist/c-WWCW3APR.min.js +0 -1
- package/dist/c-XSB27XPS.min.js +0 -1
- package/dist/c-Y6PYUMFU.min.js +0 -1
- package/dist/c-YDECTEUW.min.js +0 -1
- package/dist/c-YF3YKVQI.min.js +0 -1
- package/dist/c-YLZIV3VS.min.js +0 -1
- package/dist/c-ZIVPFTOC.min.js +0 -1
package/dist/geo.min.js
CHANGED
|
@@ -1,2 +1,232 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
function e({target:e,children:t}){const[n,r]=Do.useState({requestedTarget:e,resolved:!1,target:null});return Do.useEffect(()=>{const t=function(e){return"string"==typeof e?document.getElementById(e):"function"==typeof e?e():e}(e);"production"!==process.env.NODE_ENV&&null==t&&"string"==typeof e&&console.warn(`[Semiotic] accessibleTable portal target "${e}" was not found. Rendering the data-summary controls inline instead.`),r({requestedTarget:e,resolved:!0,target:t})},[e]),n.requestedTarget===e&&n.resolved?n.target?(0,zo.createPortal)(t,n.target):(0,_o.jsx)(_o.Fragment,{children:t}):null}function t(e){return e>1?wa:-1>e?-wa:Math.asin(e)}function n(e){return(e=Ia(e/2))*e}function r(){}function i(e,t){e&&Oa.hasOwnProperty(e.type)&&Oa[e.type](e,t)}function o(e,t,n){var r,i=-1,o=e.length-n;for(t.lineStart();++i<o;)t.point((r=e[i])[0],r[1],r[2]);t.lineEnd()}function a(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)o(e[n],t,1);t.polygonEnd()}function s(e,t){e&&_a.hasOwnProperty(e.type)?_a[e.type](e,t):i(e,t)}function l(){Ba.point=u}function c(){d(ea,ta)}function u(e,t){Ba.point=d,ea=e,ta=t,na=e*=ja,ra=La(t=(t*=ja)/2+ka),ia=Ia(t)}function d(e,t){var n=(e*=ja)-na,r=0>n?-1:1,i=r*n,o=La(t=(t*=ja)/2+ka),a=Ia(t),s=ia*a,l=ra*o+s*La(i),c=s*r*Ia(i);Fa.add(Ra(c,l)),na=e,ra=o,ia=a}function h(e){return[Ra(e[1],e[0]),t(e[2])]}function f(e){var t=e[0],n=e[1],r=La(n);return[r*La(t),r*Ia(t),Ia(n)]}function p(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function m(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function g(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function y(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function v(e){var t=Da(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function b(e,t){pa.push(ma=[oa=e,sa=e]),aa>t&&(aa=t),t>la&&(la=t)}function x(e,t){var n=f([e*ja,t*ja]);if(ha){var r=m(ha,n),i=m([r[1],-r[0],0],r);v(i),i=h(i);var o,a=e-ca,s=a>0?1:-1,l=i[0]*Ma*s,c=Aa(a)>180;c^(l>s*ca&&s*e>l)?(o=i[1]*Ma)>la&&(la=o):c^((l=(l+360)%360-180)>s*ca&&s*e>l)?aa>(o=-i[1]*Ma)&&(aa=o):(aa>t&&(aa=t),t>la&&(la=t)),c?ca>e?A(oa,e)>A(oa,sa)&&(sa=e):A(e,sa)>A(oa,sa)&&(oa=e):oa>sa?e>ca?A(oa,e)>A(oa,sa)&&(sa=e):A(e,sa)>A(oa,sa)&&(oa=e):(oa>e&&(oa=e),e>sa&&(sa=e))}else pa.push(ma=[oa=e,sa=e]);aa>t&&(aa=t),t>la&&(la=t),ha=n,ca=e}function w(){$a.point=x}function k(){ma[0]=oa,ma[1]=sa,$a.point=b,ha=null}function S(e,t){if(ha){var n=e-ca;fa.add(Aa(n)>180?n+(n>0?360:-360):n)}else ua=e,da=t;Ba.point(e,t),x(e,t)}function M(){Ba.lineStart()}function j(){S(ua,da),Ba.lineEnd(),Aa(fa)>va&&(oa=-(sa=180)),ma[0]=oa,ma[1]=sa,ha=null}function A(e,t){return 0>(t-=e)?t+360:t}function C(e,t){return e[0]-t[0]}function R(e,t){return e[0]>e[1]?e[0]>t||t>e[1]:t>=e[0]&&e[1]>=t}function L(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function P(e,t){return Aa(e)>xa&&(e-=Math.round(e/Sa)*Sa),[e,t]}function N(e,t,n){return(e%=Sa)?t||n?L(I(e),T(t,n)):I(e):t||n?T(t,n):P}function E(e){return function(t,n){return Aa(t+=e)>xa&&(t-=Math.round(t/Sa)*Sa),[t,n]}}function I(e){var t=E(e);return t.invert=E(-e),t}function T(e,n){function r(e,n){var r=La(n),l=La(e)*r,c=Ia(e)*r,u=Ia(n),d=u*i+l*o;return[Ra(c*a-d*s,l*i-u*o),t(d*a+c*s)]}var i=La(e),o=Ia(e),a=La(n),s=Ia(n);return r.invert=function(e,n){var r=La(n),l=La(e)*r,c=Ia(e)*r,u=Ia(n),d=u*a-c*s;return[Ra(c*a+u*s,l*i+d*o),t(d*i-l*o)]},r}function D(e,t){(t=f(t))[0]-=e,v(t);var n,r=(n=-t[1])>1?0:-1>n?xa:Math.acos(n);return((0>-t[2]?-r:r)+Sa-va)%Sa}function z(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:r,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function _(e,t){return Aa(e[0]-t[0])<va&&Aa(e[1]-t[1])<va}function O(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function F(e,t,n,r,i){var o,a,s=[],l=[];if(e.forEach(function(e){if((t=e.length-1)>0){var t,n,r=e[0],a=e[t];if(_(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;t>o;++o)i.point((r=e[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}s.push(n=new O(r,e,null,!0)),l.push(n.o=new O(r,null,n,!1)),s.push(n=new O(a,e,null,!1)),l.push(n.o=new O(a,null,n,!0))}}),s.length){for(l.sort(t),W(s),W(l),o=0,a=l.length;a>o;++o)l[o].e=n=!n;for(var c,u,d=s[0];;){for(var h=d,f=!0;h.v;)if((h=h.n)===d)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,a=c.length;a>o;++o)i.point((u=c[o])[0],u[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(o=(c=h.p.z).length-1;o>=0;--o)i.point((u=c[o])[0],u[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,f=!f}while(!h.v);i.lineEnd()}}}function W(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r<t;)i.n=n=e[r],n.p=i,i=n;i.n=n=e[0],n.p=i}}function B(e){return Aa(e[0])>xa?Ta(e[0])*((Aa(e[0])+xa)%Sa-xa):e[0]}function H(e,n){var r=B(n),i=n[1],o=Ia(i),a=[Ia(r),-La(r),0],s=0,l=0,c=new ns.Adder;1===o?i=wa+va:-1===o&&(i=-wa-va);for(var u=0,d=e.length;d>u;++u)if(p=(h=e[u]).length)for(var h,p,g=h[p-1],y=B(g),b=g[1]/2+ka,x=Ia(b),w=La(b),k=0;p>k;++k,y=M,x=A,w=C,g=S){var S=h[k],M=B(S),j=S[1]/2+ka,A=Ia(j),C=La(j),R=M-y,L=0>R?-1:1,P=L*R,N=P>xa,E=x*A;if(c.add(Ra(E*L*Ia(P),w*C+E*La(P))),s+=N?R+L*Sa:R,N^y>=r^M>=r){var I=m(f(g),f(S));v(I);var T=m(a,I);v(T);var D=(N^R>=0?-1:1)*t(T[2]);(i>D||i===D&&(I[0]||I[1]))&&(l+=N^R>=0?1:-1)}}return(-va>s||va>s&&-1e-12>c)^1&l}function $(e,t,n,r){return function(i){function o(t,n){e(t,n)&&i.point(t,n)}function a(e,t){m.point(e,t)}function s(){b.point=a,m.lineStart()}function l(){b.point=o,m.lineEnd()}function c(e,t){p.push([e,t]),y.point(e,t)}function u(){y.lineStart(),p=[]}function d(){c(p[0][0],p[0][1]),y.lineEnd();var e,t,n,r,o=y.clean(),a=g.result(),s=a.length;if(p.pop(),h.push(p),p=null,s)if(1&o){if((t=(n=a[0]).length-1)>0){for(v||(i.polygonStart(),v=!0),i.lineStart(),e=0;t>e;++e)i.point((r=n[e])[0],r[1]);i.lineEnd()}}else s>1&&2&o&&a.push(a.pop().concat(a.shift())),f.push(a.filter(q))}var h,f,p,m=t(i),g=z(),y=t(g),v=!1,b={point:o,lineStart:s,lineEnd:l,polygonStart:function(){b.point=c,b.lineStart=u,b.lineEnd=d,f=[],h=[]},polygonEnd:function(){b.point=o,b.lineStart=s,b.lineEnd=l,f=(0,rs.merge)(f);var e=H(h,r);f.length?(v||(i.polygonStart(),v=!0),F(f,G,e,n,i)):e&&(v||(i.polygonStart(),v=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),v&&(i.polygonEnd(),v=!1),f=h=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};return b}}function q(e){return e.length>1}function G(e,t){return(0>(e=e.x)[0]?e[1]-wa-va:wa-e[1])-(0>(t=t.x)[0]?t[1]-wa-va:wa-t[1])}function V(){cs.point=cs.lineEnd=r}function U(e,t){Ga=e*=ja,Va=Ia(t*=ja),Ua=La(t),cs.point=Y}function Y(e,t){e*=ja;var n=Ia(t*=ja),r=La(t),i=Aa(e-Ga),o=La(i),a=r*Ia(i),s=Ua*n-Va*r*o,l=Va*n+Ua*r*o;qa.add(Ra(Da(a*a+s*s),l)),Ga=e,Va=n,Ua=r}function X(e,t){return us[0]=e,us[1]=t,n=ds,qa=new ls.Adder,s(n,cs),+qa;var n}function Z(e,t){return!(!e||!fs.hasOwnProperty(e.type))&&fs[e.type](e,t)}function K(e,t){return 0===X(e,t)}function Q(e,t){for(var n,r,i,o=0,a=e.length;a>o;o++){if(0===(r=X(e[o],t)))return!0;if(o>0&&(i=X(e[o],e[o-1]))>0&&i>=n&&i>=r&&ba*i>(n+r-i)*(1-Math.pow((n-r)/i,2)))return!0;n=r}return!1}function J(e,t){return!!H(e.map(ee),te(t))}function ee(e){return(e=e.map(te)).pop(),e}function te(e){return[e[0]*ja,e[1]*ja]}function ne(e,t){return(e&&hs.hasOwnProperty(e.type)?hs[e.type]:Z)(e,t)}function re(e,t,n){var r=(0,ps.range)(e,t-va,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function ie(e,t,n){var r=(0,ps.range)(e,t-va,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function oe(e,r){var i=e[0]*ja,o=e[1]*ja,a=r[0]*ja,s=r[1]*ja,l=La(o),c=Ia(o),u=La(s),d=Ia(s),h=l*La(i),f=l*Ia(i),p=u*La(a),m=u*Ia(a),g=2*t(Da(n(s-o)+l*u*n(a-i))),y=Ia(g),v=g?function(e){var t=Ia(e*=g)/y,n=Ia(g-e)/y,r=n*h+t*p,i=n*f+t*m,o=n*c+t*d;return[Ra(i,r)*Ma,Ra(o,Da(r*r+i*i))*Ma]}:function(){return[i*Ma,o*Ma]};return v.distance=g,v}function ae(){bs.point=se}function se(e,t){bs.point=le,Ya=Za=e,Xa=Ka=t}function le(e,t){vs.add(Ka*e-Za*t),Za=e,Ka=t}function ce(){le(Ya,Xa)}function ue(e,t){As+=e,Cs+=t,++Rs}function de(){Ds.point=he}function he(e,t){Ds.point=fe,ue(es=e,ts=t)}function fe(e,t){var n=e-es,r=t-ts,i=Da(n*n+r*r);Ls+=i*(es+e)/2,Ps+=i*(ts+t)/2,Ns+=i,ue(es=e,ts=t)}function pe(){Ds.point=ue}function me(){Ds.point=ye}function ge(){ve(Qa,Ja)}function ye(e,t){Ds.point=ve,ue(Qa=es=e,Ja=ts=t)}function ve(e,t){var n=e-es,r=t-ts,i=Da(n*n+r*r);Ls+=i*(es+e)/2,Ps+=i*(ts+t)/2,Ns+=i,Es+=(i=ts*e-es*t)*(es+e),Is+=i*(ts+t),Ts+=3*i,ue(es=e,ts=t)}function be(e){this._context=e}function xe(e,t){Ys.point=we,Os=Ws=e,Fs=Bs=t}function we(e,t){Us.add(Da((Ws-=e)*Ws+(Bs-=t)*Bs)),Ws=e,Bs=t}function ke(e){let t=1;this._+=e[0];for(const n=e.length;n>t;++t)this._+=arguments[t]+e[t]}function Se(e,t){function n(e){return e&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),s(e,r(i))),i.result()}let r,i,o=3,a=4.5;return n.area=function(e){return s(e,r(xs)),xs.result()},n.measure=function(e){return s(e,r(Xs)),Xs.result()},n.bounds=function(e){return s(e,r(js)),js.result()},n.centroid=function(e){return s(e,r(zs)),zs.result()},n.projection=function(t){return arguments.length?(r=null==t?(e=null,ms):(e=t).stream,n):e},n.context=function(e){return arguments.length?(i=null==e?(t=null,new Zs(o)):new be(t=e),"function"!=typeof a&&i.pointRadius(a),n):t},n.pointRadius=function(e){return arguments.length?(a="function"==typeof e?e:(i.pointRadius(+e),+e),n):a},n.digits=function(e){if(!arguments.length)return o;if(null==e)o=null;else{const t=Math.floor(e);if(0>t)throw new RangeError("invalid digits: "+e);o=t}return null===t&&(i=new Zs(o)),n},n.projection(e).digits(o).context(t)}function Me(e){return function(t){var n=new je;for(var r in e)n[r]=e[r];return n.stream=t,n}}function je(){}function Ae(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),s(n,e.stream(js)),t(js.result()),null!=r&&e.clipExtent(r),e}function Ce(e,t,n){return Ae(e,function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])},n)}function Re(e,t,n){return Ce(e,[[0,0],t],n)}function Le(e,t,n){return Ae(e,function(n){var r=+t,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([o,a])},n)}function Pe(e,t,n){return Ae(e,function(n){var r=+t,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([o,a])},n)}function Ne(e,n){return+n?function(e,n){function r(i,o,a,s,l,c,u,d,h,f,p,m,g,y){var v=u-i,b=d-o,x=v*v+b*b;if(x>4*n&&g--){var w=s+f,k=l+p,S=c+m,M=Da(w*w+k*k+S*S),j=t(S/=M),A=Aa(Aa(S)-1)<va||Aa(a-h)<va?(a+h)/2:Ra(k,w),C=e(A,j),R=C[0],L=C[1],P=R-i,N=L-o,E=b*P-v*N;(E*E/x>n||Aa((v*P+b*N)/x-.5)>.3||Ks>s*f+l*p+c*m)&&(r(i,o,a,s,l,c,R,L,A,w/=M,k/=M,S,g,y),y.point(R,L),r(R,L,A,w,k,S,u,d,h,f,p,m,g,y))}}return function(t){function n(n,r){n=e(n,r),t.point(n[0],n[1])}function i(){v=NaN,S.point=o,t.lineStart()}function o(n,i){var o=f([n,i]),a=e(n,i);r(v,b,y,x,w,k,v=a[0],b=a[1],y=n,x=o[0],w=o[1],k=o[2],16,t),t.point(v,b)}function a(){S.point=n,t.lineEnd()}function s(){i(),S.point=l,S.lineEnd=c}function l(e,t){o(u=e,t),d=v,h=b,p=x,m=w,g=k,S.point=o}function c(){r(v,b,y,x,w,k,d,h,u,p,m,g,16,t),S.lineEnd=a,a()}var u,d,h,p,m,g,y,v,b,x,w,k,S={point:n,lineStart:i,lineEnd:a,polygonStart:function(){t.polygonStart(),S.lineStart=s},polygonEnd:function(){t.polygonEnd(),S.lineStart=i}};return S}}(e,n):function(e){return Me({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}(e)}function Ee(e,t,n,r,i,o){function a(e,o){return[c*(e*=r)-u*(o*=i)+t,n-u*e-c*o]}if(!o)return function(e,t,n,r,i){function o(o,a){return[t+e*(o*=r),n-e*(a*=i)]}return o.invert=function(o,a){return[(o-t)/e*r,(n-a)/e*i]},o}(e,t,n,r,i);var s=La(o),l=Ia(o),c=s*e,u=l*e,d=s/e,h=l/e,f=(l*n-s*t)/e,p=(l*t+s*n)/e;return a.invert=function(e,t){return[r*(d*e-h*t+f),i*(p-h*e-d*t)]},a}function Ie(e){return Te(function(){return e})()}function Te(e){function t(e){return v(e[0]*ja,e[1]*ja)}function n(e){return(e=v.invert(e[0],e[1]))&&[e[0]*Ma,e[1]*Ma]}function r(){var e=Ee(w,0,0,E,I,P).apply(null,o(M,j)),t=Ee(w,k-e[0],S-e[1],E,I,P);return a=N(A,C,R),d=L(o,t),v=L(a,d),u=Ne(d,H),i()}function i(){return b=x=null,t}var o,a,s,l,c,u,d,v,b,x,w=150,k=480,S=250,M=0,j=0,A=0,C=0,R=0,P=0,E=1,I=1,T=null,O=is,W=null,B=ms,H=.5;return t.stream=function(e){return b&&x===e?b:b=Qs(function(e){return Me({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}(a)(O(u(B(x=e)))))},t.preclip=function(e){return arguments.length?(O=e,T=void 0,i()):O},t.postclip=function(e){return arguments.length?(B=e,W=s=l=c=null,i()):B},t.clipAngle=function(e){return arguments.length?(O=+e?function(e){function t(e,t){return La(e)*La(t)>i}function n(e,t,n){var r=[1,0,0],o=m(f(e),f(t)),a=p(o,o),s=o[0],l=a-s*s;if(!l)return!n&&e;var c=i*a/l,u=-i*s/l,d=m(r,o),v=y(r,c);g(v,y(o,u));var b=d,x=p(v,b),w=p(b,b),k=x*x-w*(p(v,v)-1);if(k>=0){var S=Da(k),M=y(b,(-x-S)/w);if(g(M,v),M=h(M),!n)return M;var j,A=e[0],C=t[0],R=e[1],L=t[1];A>C&&(j=A,A=C,C=j);var P=C-A,N=Aa(P-xa)<va;if(!N&&R>L&&(j=R,R=L,L=j),N||va>P?N?R+L>0^M[1]<(Aa(M[0]-A)<va?R:L):M[1]>=R&&L>=M[1]:P>xa^(M[0]>=A&&C>=M[0])){var E=y(b,(-x+S)/w);return g(E,v),[M,h(E)]}}}function r(t,n){var r=a?e:xa-e,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>n?i|=4:n>r&&(i|=8),i}var i=La(e),o=2*ja,a=i>0,s=Aa(i)>va;return $(t,function(e){var i,o,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(d,h){var f,p=[d,h],m=t(d,h),g=a?m?0:r(d,h):m?r(d+(0>d?xa:-xa),h):0;if(!i&&(c=l=m)&&e.lineStart(),m!==l&&(!(f=n(i,p))||_(i,f)||_(p,f))&&(p[2]=1),m!==l)u=0,m?(e.lineStart(),f=n(p,i),e.point(f[0],f[1])):(f=n(i,p),e.point(f[0],f[1],2),e.lineEnd()),i=f;else if(s&&i&&a^m){var y;g&o||!(y=n(p,i,!0))||(u=0,a?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!m||i&&_(i,p)||e.point(p[0],p[1]),i=p,l=m,o=g},lineEnd:function(){l&&e.lineEnd(),i=null},clean:function(){return u|(c&&l)<<1}}},function(t,n,r,i){!function(e,t,n,r,i,o){if(n){var a=La(t),s=Ia(t),l=r*n;null==i?(i=t+r*Sa,o=t-l/2):(i=D(a,i),o=D(a,o),(r>0?o>i:i>o)&&(i+=r*Sa));for(var c,u=i;r>0?u>o:o>u;u-=l)c=h([a,-s*La(u),-s*Ia(u)]),e.point(c[0],c[1])}}(i,e,o,r,t,n)},a?[0,-e]:[-xa,e-xa])}(T=e*ja):(T=null,is),i()):T*Ma},t.clipExtent=function(e){return arguments.length?(B=null==e?(W=s=l=c=null,ms):function(e,t,n,r){function i(i,o){return!(e>i||i>n||t>o||o>r)}function o(i,o,s,c){var u=0,d=0;if(null==i||(u=a(i,s))!==(d=a(o,s))||0>l(i,o)^s>0)do{c.point(0===u||3===u?e:n,u>1?r:t)}while((u=(u+s+4)%4)!==d);else c.point(o[0],o[1])}function a(r,i){return Aa(r[0]-e)<va?i>0?0:3:Aa(r[0]-n)<va?i>0?2:1:Aa(r[1]-t)<va?i>0?1:0:i>0?3:2}function s(e,t){return l(e.x,t.x)}function l(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){function l(e,t){i(e,t)&&w.point(e,t)}function c(o,a){var s=i(o,a);if(d&&h.push([o,a]),b)f=o,p=a,m=s,b=!1,s&&(w.lineStart(),w.point(o,a));else if(s&&v)w.point(o,a);else{var l=[g=Math.max(ss,Math.min(as,g)),y=Math.max(ss,Math.min(as,y))],c=[o=Math.max(ss,Math.min(as,o)),a=Math.max(ss,Math.min(as,a))];!function(e,t,n,r,i,o){var a,s=e[0],l=e[1],c=0,u=1,d=t[0]-s,h=t[1]-l;if(a=n-s,d||0>=a){if(a/=d,0>d){if(c>a)return;u>a&&(u=a)}else if(d>0){if(a>u)return;a>c&&(c=a)}if(a=i-s,d||a>=0){if(a/=d,0>d){if(a>u)return;a>c&&(c=a)}else if(d>0){if(c>a)return;u>a&&(u=a)}if(a=r-l,h||0>=a){if(a/=h,0>h){if(c>a)return;u>a&&(u=a)}else if(h>0){if(a>u)return;a>c&&(c=a)}if(a=o-l,h||a>=0){if(a/=h,0>h){if(a>u)return;a>c&&(c=a)}else if(h>0){if(c>a)return;u>a&&(u=a)}return c>0&&(e[0]=s+c*d,e[1]=l+c*h),1>u&&(t[0]=s+u*d,t[1]=l+u*h),!0}}}}}(l,c,e,t,n,r)?s&&(w.lineStart(),w.point(o,a),x=!1):(v||(w.lineStart(),w.point(l[0],l[1])),w.point(c[0],c[1]),s||w.lineEnd(),x=!1)}g=o,y=a,v=s}var u,d,h,f,p,m,g,y,v,b,x,w=a,k=z(),S={point:l,lineStart:function(){S.point=c,d&&d.push(h=[]),b=!0,v=!1,g=y=NaN},lineEnd:function(){u&&(c(f,p),m&&v&&k.rejoin(),u.push(k.result())),S.point=l,v&&w.lineEnd()},polygonStart:function(){w=k,u=[],d=[],x=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,i=d.length;i>n;++n)for(var o,a,s=d[n],l=1,c=s.length,u=s[0],h=u[0],f=u[1];c>l;++l)o=h,a=f,h=(u=s[l])[0],f=u[1],a>r?r>=f&&(f-a)*(e-o)>(h-o)*(r-a)&&--t:f>r&&(h-o)*(r-a)>(f-a)*(e-o)&&++t;return t}(),n=x&&t,i=(u=(0,os.merge)(u)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&F(u,s,t,o,a),a.polygonEnd()),w=a,u=d=h=null}};return S}}(W=+e[0][0],s=+e[0][1],l=+e[1][0],c=+e[1][1]),i()):null==W?null:[[W,s],[l,c]]},t.scale=function(e){return arguments.length?(w=+e,r()):w},t.translate=function(e){return arguments.length?(k=+e[0],S=+e[1],r()):[k,S]},t.center=function(e){return arguments.length?(M=e[0]%360*ja,j=e[1]%360*ja,r()):[M*Ma,j*Ma]},t.rotate=function(e){return arguments.length?(A=e[0]%360*ja,C=e[1]%360*ja,R=e.length>2?e[2]%360*ja:0,r()):[A*Ma,C*Ma,R*Ma]},t.angle=function(e){return arguments.length?(P=e%360*ja,r()):P*Ma},t.reflectX=function(e){return arguments.length?(E=e?-1:1,r()):0>E},t.reflectY=function(e){return arguments.length?(I=e?-1:1,r()):0>I},t.precision=function(e){return arguments.length?(u=Ne(d,H=e*e),i()):Da(H)},t.fitExtent=function(e,n){return Ce(t,e,n)},t.fitSize=function(e,n){return Re(t,e,n)},t.fitWidth=function(e,n){return Le(t,e,n)},t.fitHeight=function(e,n){return Pe(t,e,n)},function(){return o=e.apply(this,arguments),t.invert=o.invert&&n,r()}}function De(e,n){function r(e,t){var n=Da(a-2*o*Ia(t))/o;return[n*Ia(e*=o),s-n*La(e)]}var i=Ia(e),o=(i+Ia(n))/2;if(Aa(o)<va)return function(e){function n(e,t){return[e*r,Ia(t)/r]}var r=La(e);return n.invert=function(e,n){return[e/r,t(n*r)]},n}(e);var a=1+i*(2*o-i),s=Da(a)/o;return r.invert=function(e,n){var r=s-n,i=Ra(e,Aa(r))*Ta(r);return 0>r*o&&(i-=xa*Ta(e)*Ta(r)),[i/o,t((a-(e*e+r*r)*o*o)/(2*o))]},r}function ze(){return(e=De,t=0,n=xa/3,r=Te(e),i=r(t,n),i.parallels=function(e){return arguments.length?r(t=e[0]*ja,n=e[1]*ja):[t*Ma,n*Ma]},i).scale(155.424).center([0,33.6442]);var e,t,n,r,i}function _e(e,t){return[e,Ea(za((wa+t)/2))]}function Oe(e,t){return[e,t]}function Fe(e,n){var r=t(il*Ia(n)),i=r*r,o=i*i*i;return[e*La(r)/(il*(el+3*tl*i+o*(7*nl+9*rl*i))),r*(el+tl*i+o*(nl+rl*i))]}function We(){return Ie(Fe).scale(177.158)}function Be(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),t*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function He(e,t){return[La(t)*Ia(e),Ia(t)]}function $e(e,t,n){return e+(t-e)*n}function qe(e,t,n){if(1>=n)return 1;const r=n-1;return function(e){const t=Math.max(0,Math.min(1,e.minOpacity??.1));if(Number.isNaN(e.age))return 1;if(e.age===1/0)return t;if(!Number.isFinite(e.extent)||0>=e.extent)return 1;const n=Math.max(0,e.age);if("step"===e.type)return(e.threshold??.5*e.extent)>n?1:t;if("exponential"===e.type){const r=e.halfLife??e.extent/2;return t+Math.pow(.5,n/(r>0?r:e.extent/2))*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}({age:r-t,extent:r,type:e.type,halfLife:e.halfLife??n/2,threshold:e.stepThreshold??.5*n,minOpacity:e.minOpacity??.1})}function Ge(e,t,n){const r=e.duration??500,i=n-t;return r>i?1-i/r:0}function Ve(e,t,n,r){let i=!1;return t>0?(e._pulseIntensity!==t&&(e._pulseIntensity=t,i=!0),e._pulseColor!==n&&(e._pulseColor=n,i=!0),e._pulseGlowRadius!==r&&(e._pulseGlowRadius=r,i=!0),i):(0!==e._pulseIntensity&&(e._pulseIntensity=0,i=!0),void 0!==e._pulseColor&&(e._pulseColor=void 0,i=!0),void 0!==e._pulseGlowRadius&&(e._pulseGlowRadius=void 0,i=!0),i)}function Ue(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function Ye(e,t,n){const r=e=>e.toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function Xe(e){const t=e.map(Ue),n=t.length-1;return e=>{if(Number.isNaN(e)&&(e=0),0>=e){const[e,n,r]=t[0];return Ye(e,n,r)}if(e>=1){const[e,r,i]=t[n];return Ye(e,r,i)}const r=e*n,i=Math.floor(r),o=r-i,[a,s,l]=t[i],[c,u,d]=t[i+1];return Ye(Math.round(a+(c-a)*o),Math.round(s+(u-s)*o),Math.round(l+(d-l)*o))}}function Ze(e){return e&&Object.prototype.hasOwnProperty.call(Ml,e)?Ml[e]:hl}function Ke(e,t,n){if("function"==typeof t){const r=t(e);return n&&r&&"string"==typeof r&&!function(e){const t=e.toLowerCase();return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")||Ll.has(t)}(r)?n(r):r}const r=e?.[t]+"";return n?n(r):Al[Math.abs(function(e){let t=0;for(let n=0;e.length>n;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}(r))%Al.length]}function Qe(e,t){if(null==t||!Object.prototype.hasOwnProperty.call(e,t))return;const n=e[t];return"string"==typeof n&&n.length>0?n:void 0}function Je(e,t,n="category10"){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;return t=>Qe(e,t)??"#999"}const r=Array.from(new Set(e.map(e=>e?.[t]).filter(e=>null!=e).map(e=>e+""))),i=r.every(e=>!isNaN(Number(e)));if(Array.isArray(n))return(0,ul.scaleOrdinal)().domain(r).range(n).unknown("#999");const o=Object.prototype.hasOwnProperty.call(jl,n)?jl[n]:jl.category10;if(i&&"function"==typeof o){let e=-1/0;for(const t of r){const n=Number(t);n>e&&(e=n)}return t=>o(0===e?0:Number(t)/e)}{const e=Array.isArray(o)?o:Al;return(0,ul.scaleOrdinal)().domain(r).range(e).unknown("#999")}}function et(e,t,n=[3,20],r){let i;if(i="function"==typeof t?t(e):e?.[t],!r)return i;const[o,a]=r,[s,l]=n;if(a===o)return(s+l)/2;let c=(i-o)/(a-o);return 0>c?c=0:c>1&&(c=1),s+c*(l-s)}function tt(e,t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:void 0;return 0===e.length?e=>n&&Qe(n,e)||"#4e79a7":t=>{if(n){const e=Qe(n,t);if(e)return e}let r=0;for(let e=0;t.length>e;e++)r=31*r+t.charCodeAt(e)|0;return e[Math.abs(r)%e.length]??"#4e79a7"}}function nt(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(nt))}function rt(e,t,n){e.has(t)||(e.add(t),console.warn(n))}function it(e,t){return e?"function"==typeof e?e:t=>t[e]:e=>e[t]}function ot(e){return e?"function"==typeof e?e:t=>t[e]:e=>e.coordinates||e.data||[]}function at(e,t,n){return e?"function"==typeof e?{...n,...e(t)}:{...n,...e}:{...n}}function st(e,t){if(2>e.length)return[e];const n=.4*t,r=[];let i=[e[0]];for(let t=1;e.length>t;t++){const o=e[t];Math.abs(o[0]-e[t-1][0])>n?(2>i.length||r.push(i),i=[o]):i.push(o)}return 2>i.length||r.push(i),r}function lt(e,t,n=24){const r=t[0]-e[0],i=t[1]-e[1],o=Math.sqrt(r*r+i*i);if(0===o)return[e,t];const a=-i/o,s=r/o,l=Math.min(.3*o,80),c=(e[0]+t[0])/2+a*l,u=(e[1]+t[1])/2+s*l,d=[];for(let r=0;n>=r;r++){const i=r/n,o=1-i;d.push([o*o*e[0]+2*o*i*c+i*i*t[0],o*o*e[1]+2*o*i*u+i*i*t[1]])}return d}function ct(e,t){if(2>e.length)return e;const n=t/2+1,r=[];for(let t=0;e.length>t;t++){const i=e[t];let o,a;0===t?(o=e[1][0]-i[0],a=e[1][1]-i[1]):t===e.length-1?(o=i[0]-e[t-1][0],a=i[1]-e[t-1][1]):(o=e[t+1][0]-e[t-1][0],a=e[t+1][1]-e[t-1][1]);const s=Math.sqrt(o*o+a*a)||1;r.push([i[0]+a/s*n,i[1]+-o/s*n])}return r}function ut(e,t,n,r,i){const o=t[0]-e[0],a=t[1]-e[1],s=Math.sqrt(o*o+a*a);if(0===s)return[e,t];const l=a/s,c=-o/s,u=i/2+1;return[[e[0]+l*u,e[1]+c*u],[t[0]+l*u,t[1]+c*u]]}function dt(e){let t=1/0,n=-1/0;for(const r of e)t>r&&(t=r),r>n&&(n=r);return[t,n]}function ht(e,t,n,r){const i=e.push(t);return n&&n.push(r),i}function ft(e,t){const n={...e};for(const e of t)n[El[e]]++;return n}function pt(e,t,n){const r=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:r,revisions:ft(n,r)}}function mt(e){if(null==e)return 0;if("number"==typeof e&&Number.isFinite(e)&&e>=0&&.5>e)return e;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${e+""}.`)}function gt(e){if(!e)return Ql;let t=!1;for(let n=0;e.length>n;n++){const r=e[n];if(null==r||"object"!=typeof r){t=!0;break}}if(!t)return e;const n=[];for(const t of e)null!=t&&"object"==typeof t&&n.push(t);return n}function yt(e){const{domain:t,layout:n,sceneGeometry:r}=e.revisions;return{domain:t,layout:n,sceneGeometry:r}}function vt(e,t){return{sceneGeometry:Math.max(e.sceneGeometry,t.sceneGeometry),layout:Math.max(e.layout,t.layout),domain:Math.max(e.domain,t.domain)}}function bt(e,t,n,r,i,o){const a=i-n,s=o-r,l=a*a+s*s;if(0===l)return Math.sqrt((e-n)**2+(t-r)**2);let c=((e-n)*a+(t-r)*s)/l;return c=Math.max(0,Math.min(1,c)),Math.sqrt((e-(n+c*a))**2+(t-(r+c*s))**2)}function xt(e,t=30){return Math.max((e??4)+5,12,t)}function wt(e,t){const[n,r]=e.viewBox??oc,[i,o]=e.anchor??ac,a=r>0?r:1,s=Math.max(0,t)/a,l=(n>0?n:a)*s,c=a*s;return{width:l,height:c,scale:s,offsetX:-i*l,offsetY:-o*c}}function kt(e,t){const n=wt(e,t),r=[[n.offsetX,n.offsetY],[n.offsetX+n.width,n.offsetY],[n.offsetX,n.offsetY+n.height],[n.offsetX+n.width,n.offsetY+n.height]];let i=0;for(const[e,t]of r){const n=Math.sqrt(e*e+t*t);n>i&&(i=n)}return i}function St(e,t,n,r){if("none"!==e)return"color"===e||null==e?t??r:"accent"===e?n:e}function Mt(e){if("undefined"==typeof Path2D)return null;sc||(sc=new Map);const t=sc.get(e);if(t)return t;const n=new Path2D(e);return sc.size>1024&&sc.clear(),sc.set(e,n),n}function jt(e,t,n=0,r="horizontal"){const[i,o]=e.viewBox??oc,a=Math.min(1,Math.max(0,n)),s=Math.min(1,Math.max(0,t));return s>a?a>0||1>s?"vertical"===r?{x:0,y:o*(1-s),width:i,height:o*(s-a)}:{x:i*a,y:0,width:i*(s-a),height:o}:null:{x:0,y:0,width:0,height:0}}function At(e,t){const n=wt(e,t);return{centerDx:n.offsetX+n.width/2,centerDy:n.offsetY+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2,radius:Math.hypot(n.width,n.height)/2}}function Ct(e,t,n,r,i,o=e=>e){for(const a of t.parts){const t=Mt(a.d);if(!t)continue;const s=a.opacity??1,l=e.globalAlpha;1!==s&&(e.globalAlpha=l*s);const c=i?"none"===a.fill?void 0:i:St(a.fill,n,r);c&&(e.fillStyle=o(c),e.fill(t));const u=i?a.stroke&&"none"!==a.stroke?i:void 0:St(a.stroke??"none",n,r);u&&(e.strokeStyle=o(u),e.lineWidth=a.strokeWidth??1,e.lineCap=a.strokeLinecap??"butt",e.lineJoin=a.strokeLinejoin??"miter",e.stroke(t)),1!==s&&(e.globalAlpha=l)}}function Rt(e,t,n,r,i,o,a=0,s=r){if(o){const e=function(e,t,n,r,i,o=e=>e.x,a=e=>e.y,s=e=>e.r){const l=Math.max(r,i+5,12),c=t-l,u=t+l,d=n-l,h=n+l;let f=null,p=1/0;return e.visit((e,i,l,m,g)=>{if(i>u||c>m||l>h||d>g)return!0;if(!e.length){let i=e;do{const e=i.data,l=o(e)-t,c=a(e)-n,u=Math.sqrt(l*l+c*c);xt(s(e),r)>=u&&p>u&&(f=e,p=u),i=i.next}while(i)}return!1}),f?{node:f,distance:p}:null}(o,t,n,r,a);if(e&&!1!==e.node.interactive)return e}else{let i=null,o=1/0;for(const a of e){if("point"!==a.type)continue;if(!1===a.interactive)continue;const e=a.x-t,s=a.y-n,l=Math.sqrt(e*e+s*s);xt(a.r,r)>=l&&o>l&&(i=a,o=l)}if(i)return{node:i,distance:o}}let l=null,c=1/0;for(const i of e){if("glyph"!==i.type)continue;if(null==i.datum)continue;const e=At(i.glyph,i.size),o=i.x+e.centerDx-t,a=i.y+e.centerDy-n,s=Math.sqrt(o*o+a*a);xt(e.radius,r)>=s&&c>s&&(l=i,c=s)}if(l)return{node:l,distance:c};for(let r=e.length-1;r>=0;r--){const o=e[r];if("geoarea"!==o.type)continue;const a=o;if(!1===a.interactive)continue;const[[s,l],[c,u]]=a.bounds;if(!(s>t||t>c||l>n||n>u)&&(a._cachedPath2D||(a._cachedPath2D=new Path2D(a.pathData)),i.isPointInPath(a._cachedPath2D,t,n)))return{node:a,distance:0}}let u=null,d=1/0;for(const r of e){if("line"!==r.type)continue;const e=r,{path:i}=e,o=Math.max((e.style.strokeWidth??2)+4,5,s),a=t-o,l=t+o,c=n-o,h=n+o;for(let r=0;i.length-1>r;r++){const s=i[r],f=i[r+1],p=s[0],m=s[1],g=f[0],y=f[1];if(a>p&&a>g||p>l&&g>l||c>m&&c>y||m>h&&y>h)continue;const v=bt(t,n,p,m,g,y);o>=v&&d>v&&(u=e,d=v)}}return u?{node:u,distance:d}:null}function Lt(e,t=0,n=1/0,r=0){const i=Number.isFinite(t)?t:0,o=Number.isFinite(n)?Math.max(i,n):1/0,a=Number.isFinite(e)?Math.floor(e):i,s=Math.max(i,Math.min(o,a));return r>0&&Number.isFinite(r)?Math.max(i,Math.min(o,Math.round(s/r)*r)):s}function Pt(){if(gc)return;if("undefined"==typeof window||"undefined"==typeof document)return;gc=!0;const e=e=>{if(!e?.includes("--"))return"";const t=document.createElement("span").style;return t.cssText=e,Array.from(t).filter(e=>e.startsWith("--")).sort().map(e=>`${e}:${t.getPropertyValue(e)}!${t.getPropertyPriority(e)}`).join(";")},t=(t,n)=>{const r=t.target;if(!(r instanceof Element))return!1;if(r===n||r.contains(n))return!0;if(!n.contains(r))return!1;const i="CANVAS"===r.tagName;return!(!i&&!r.querySelector("canvas")||i&&"style"===t.attributeName&&e(t.oldValue)===e(r.getAttribute("style")))},n=e=>{const n=[];for(const r of wc){const i=r.getElement();i&&((!e||e.some(e=>t(e,i)))&&n.push(r))}if(!e||0!==n.length){mc++;for(const e of n)e.listener()}};if("undefined"!=typeof MutationObserver&&document.documentElement&&(yc=new MutationObserver(e=>{n(e)})).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme","data-semiotic-theme-mode"],attributeOldValue:!0,subtree:!0}),"function"==typeof window.matchMedia)try{vc=window.matchMedia("(prefers-color-scheme: dark)"),bc=()=>n(),"function"==typeof vc.addEventListener?vc.addEventListener("change",bc):"function"==typeof vc.addListener&&vc.addListener(bc)}catch{}xc=function(){const e="undefined"==typeof document?void 0:document.fonts;if(!e||"function"!=typeof e.addEventListener)return()=>{};const t=e=>{(function(e){return 0!==e.fontfaces?.length})(e)&&n()};return e.addEventListener("loadingdone",t),()=>e.removeEventListener("loadingdone",t)}()}function Nt(e,t){if(!t)return t;const n=function(e){const t=e.trim();if(!t.startsWith("var(")||!t.endsWith(")"))return null;const n=t.slice(4,-1),r=n.indexOf(",");if(-1===r){const e=n.trim();return e.startsWith("--")?{name:e}:null}const i=n.slice(0,r).trim(),o=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:o||void 0}:null}(t);if(!n)return t;const r=()=>n.fallback?Nt(e,n.fallback):t,i=e.canvas;if(!i)return r();let o=pc.get(i);o&&o.version===mc||(o={version:mc,map:new Map},pc.set(i,o));const a=o.map.get(t);if(void 0!==a)return a;const s=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||t;return o.map.set(t,s),s}function Et(e,t){const n=e();return Number.isFinite(n)?n:t}function It(e){let t=6;for(let n=1;e.length>n;n++){const r=Math.abs(e[n]-e[n-1]);r>0&&Number.isFinite(r)&&(t=Math.max(t,Math.ceil(Math.log10(Math.max(Math.abs(e[n]),Math.abs(e[n-1]))/r))+1))}const n=Math.min(17,t);return e=>Number.isInteger(e)?e+"":Number(e.toPrecision(n))+""}function Tt(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function Dt(e){return"object"==typeof e&&null!==e&&"gradient"in e}function zt(e,t,n,r,i=8){const o=r,a="left"===r?"right":"right"===r?"left":"top"===r?"bottom":"top",s=Math.max(t[o],Math.max(0,("left"===r||"right"===r?n[0]:n[1])-i)-e[a]);e[o]>s&&(e[o]=s)}function _t(e){return Math.ceil(7*e.length)}function Ot(e,t){if(Tt(e)){const n=Vt(t);let r=Pc;for(const t of e.legendGroups){t.label&&(r=Math.max(r,_t(t.label)));for(const e of t.items)r=Math.max(r,n.swatchSize+n.labelGap+_t(e.label))}return r}if(Dt(e)){const{gradient:t}=e,n=t.format||It(t.domain),r=Math.max(_t(n(t.domain[0])),_t(n(t.domain[1]))),i=t.label?_t(t.label):0;return Math.max(Pc,19+r,i)}return Pc}function Ft(e){return(Tt(e)||Dt(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):Nc}function Wt(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?Fc:Oc:0}function Bt(e){return Math.max(0,e?.edgeGutter??Ec)}function Ht(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?_c:zc:Dc:0}function $t(e,t,n){if(Dt(e))return e.gradient.label?Ic:Tc;if(!Tt(e))return 20;const r=Vt(n),i=Math.max(1,n?.maxWidth??t);let o=r.rowHeight;for(const t of e.legendGroups){let e=0,n=0;for(const o of t.items){const t=r.swatchSize+r.labelGap+_t(o.label),a=0===n?t:n+r.itemGap+t;n>0&&a>i?(e+=1,n=t):n=a}t.items.length>0&&(e+=1),o=Math.max(o,e*r.rowHeight,t.label?_t(t.label):0)}return o+(e.legendGroups.length>1?16:0)}function qt(e,t,n){return Ot(e,t)+Ft(e)+Wt(t,n)+Bt(t)}function Gt(e,t){const{legend:n}=t;if(!n)return;const r=t.position??"right",i=$t(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout)+Ft(n)+Ht("bottom"===r?t.axisChrome:"top"===r?t.axisChrome?.topAxis:void 0,t.legendLayout)+("top"===r&&t.hasTitle?24:0),o=Math.max(t.minimumMargin??0,"top"===r?t.hasTitle?jc:Mc:0);"right"===r?e.right=Math.max(e.right,o,qt(n,t.legendLayout,t.axisChrome?.rightAxis)):"left"===r?e.left=Math.max(e.left,o,qt(n,t.legendLayout,t.axisChrome?.leftAxis)):"top"===r?e.top=Math.max(e.top,o,i):e.bottom=Math.max(e.bottom,o,i)}function Vt(e){const t=Math.max(1,e?.swatchSize??Ac),n=Math.max(t,e?.rowHeight??Lc);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??Cc),itemGap:Math.max(0,e?.itemGap??Rc),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}function Ut(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function Yt(e){const t=function(){const[e,t]=(0,dc.useState)(()=>!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return(0,dc.useEffect)(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),function(e,t){if("function"==typeof e.addEventListener)return e.addEventListener("change",t),()=>e.removeEventListener("change",t);const n=e;return n.addListener(t),()=>n.removeListener(t)}(e,e=>t(e.matches))},[]),e}(),n=(0,cc.useRef)(t);n.current=t;const[r,i]=function(e,t,n,r={}){const i=(0,hc.useRef)(null),[o,a]=(0,hc.useState)(null);return fc(()=>{if(!t&&!n)return;const e=i.current;if(!e||"undefined"==typeof ResizeObserver)return;const o=(e,t)=>({w:Lt(e,r.minWidth,r.maxWidth,r.widthStep),h:Lt(t,r.minHeight,r.maxHeight,r.heightStep)}),s=e.getBoundingClientRect();(s.width>0||s.height>0)&&a(o(s.width,s.height));const l=new ResizeObserver(e=>{for(const t of e){const{width:e,height:n}=t.contentRect,r=o(e,n);a(e=>e&&e.w===r.w&&e.h===r.h?e:r)}});return l.observe(e),()=>l.disconnect()},[t,n,r.minWidth,r.maxWidth,r.widthStep,r.minHeight,r.maxHeight,r.heightStep]),[i,[t&&o?o.w:e[0],n&&o?o.h:e[1]]]}(e.sizeProp,e.responsiveWidth,e.responsiveHeight),o=i[0],a=i[1],s=(0,cc.useMemo)(()=>[o,a],[o,a]),l=!!e.title,c=!!e.legend&&"top"===e.legendPosition,u=(0,cc.useMemo)(()=>{const t=function(e,t,n=!1){const r=n?t?jc:Mc:t?36:0;return r>e.top?{...e,top:r}:e}({...e.marginDefault,...e.userMargin},l,c);if(e.legend&&!e.legendMarginReserved){const n={...t},r=e.legendPosition??"right";Gt(t,{legend:e.legend,position:r,size:s,hasTitle:l,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),zt(t,n,s,r)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,l,c,s]),d=i[0]-u.left-u.right,h=i[1]-u.top-u.bottom,f=Ut(e.foregroundGraphics,i,u),p=Ut(e.backgroundGraphics,i,u),m=(0,uc.useThemeSelector)(e=>e.theme),{transition:g,introEnabled:y}=function(e,t){if(!1===e)return{transition:void 0,introEnabled:!1};const n="undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;return{transition:e?!0===e?{duration:300}:{duration:e.duration??300,easing:"linear"===e.easing?"linear":"ease-out"}:t,introEnabled:!(n||!e||!0!==e&&!1===e.intro)}}(e.animate,e.transitionProp),v="semiotic-table-"+lc.useId(),b=(0,cc.useRef)(null);if(!b.current){const t=!e.suspendWhenHidden||"undefined"==typeof document||!document.hidden;b.current=new Sc({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}const x=b.current;x.configure({clock:e.clock,random:e.random,seed:e.seed});const w=(0,cc.useRef)(null),k=(0,cc.useRef)(e.frameScheduler??Bc);k.current=e.frameScheduler??Bc;const S=(0,cc.useRef)(null),M=(0,cc.useRef)(!1),j=(0,cc.useRef)(()=>{}),A=(0,cc.useCallback)(()=>{if(null!==w.current||M.current)return;const e=k.current;let t=!1,n=!1;const r=e.requestAnimationFrame(()=>{t=!0;const e=!n;e&&(M.current=!0),w.current=null,S.current=null;try{j.current()}finally{e&&(M.current=!1)}});n=!0,t||(w.current=r,S.current=e)},[]),C=(0,cc.useCallback)(()=>{null!==w.current&&((S.current??k.current).cancelAnimationFrame(w.current),w.current=null,S.current=null)},[]);Wc(()=>{x.setPaused(!0===e.paused)},[x,e.paused]),(0,cc.useEffect)(()=>{if(!e.suspendWhenHidden||"undefined"==typeof document)return void x.setVisible(!0);const t=()=>x.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[x,e.suspendWhenHidden]),(0,cc.useEffect)(()=>()=>{C()},[C]);const R=(0,cc.useRef)(()=>{}),L=(0,cc.useRef)(()=>{}),P=(0,cc.useRef)({inside:!1,clientX:0,clientY:0,pointerType:void 0}),N=(0,cc.useRef)(null),E=(0,cc.useRef)(null),I=(0,cc.useRef)(null),T=(0,cc.useCallback)(()=>{const e=N.current;N.current=null,e&&R.current(e)},[]),D=(0,cc.useCallback)(e=>{const t=P.current;if(t.inside=!0,t.clientX=e.clientX,t.clientY=e.clientY,t.pointerType=e.pointerType,N.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===E.current){const e=k.current;let t=!1;const n=e.requestAnimationFrame(()=>{t=!0,E.current=null,I.current=null,T()});t||(E.current=n,I.current=e)}},[T]),z=(0,cc.useCallback)(()=>{P.current.inside=!1,N.current=null,null!==E.current&&((I.current??k.current).cancelAnimationFrame(E.current),E.current=null,I.current=null),L.current()},[]);(0,cc.useEffect)(()=>()=>{N.current=null,null!==E.current&&((I.current??k.current).cancelAnimationFrame(E.current),E.current=null,I.current=null)},[]);const _=e.themeDirtyRef,O=(0,cc.useRef)(!1);return Wc(()=>{if(!_)return;const t=!O.current;O.current=!0,t&&e.skipInitialThemeInvalidation||(mc++,_.current=!0,A())},[m,e.skipInitialThemeInvalidation,A,_]),(0,cc.useEffect)(()=>{if(_)return function(e,t){Pt();const n={getElement:e,listener:t};return wc.add(n),()=>{wc.delete(n)&&0===wc.size&&(yc?.disconnect(),yc=null,vc&&bc&&("function"==typeof vc.removeEventListener?vc.removeEventListener("change",bc):"function"==typeof vc.removeListener&&vc.removeListener(bc)),vc=null,bc=null,xc?.(),xc=null,gc=!1)}}(()=>r.current,()=>{_.current=!0,A()})},[r,A,_]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:r,size:i,margin:u,adjustedWidth:d,adjustedHeight:h,resolvedForeground:f,resolvedBackground:p,currentTheme:m,transition:g,introEnabled:y,tableId:v,frameRuntime:x,rafRef:w,renderFnRef:j,scheduleRender:A,cancelRender:C,hoverHandlerRef:R,hoverLeaveRef:L,onPointerMove:D,onPointerLeave:z,pointerStateRef:P}}function Xt(e){if(!e?.colors)return;const t=e.colors;return{primary:t.primary,secondary:t.secondary||t.primary,surface:t.surface||t.background,success:t.success,danger:t.danger,warning:t.warning,error:t.error,info:t.info,text:t.text,textSecondary:t.textSecondary,border:t.border,grid:t.grid}}function Zt({isStale:e,position:t}){return(0,Vc.jsx)("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===t?{top:4,left:4}:"bottom-left"===t?{bottom:4,left:4}:"bottom-right"===t?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:e?"#dc3545":"#28a745",color:"white"},children:e?"STALE":"LIVE"})}function Kt(e,t={}){const n=function(e){const t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:n+""}(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(r){const i=function(e){const t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}(r);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:i}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:i,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function Qt(e){const{x:t,y:n,text:r,fill:i,fontSize:o=12,fontWeight:a,fontFamily:s,textAnchor:l="start",dominantBaseline:c,background:u,className:d}=e,h=function(e){return void 0===e||!0===e||"halo"===e?{type:"halo"}:!1===e||"none"===e?null:"box"===e?{type:"box"}:{...e,type:e.type??"halo"}}(u),f=e=>(0,Zc.jsx)("text",{x:t,y:n,textAnchor:l,dominantBaseline:c,fill:i,fontSize:o,fontWeight:a,fontFamily:s,className:d,...e?{style:{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}}:{},children:r});if(!h)return f();if("halo"===h.type)return f({stroke:h.fill??Kc,strokeWidth:h.haloWidth??3});const p=h.padding??{x:6,y:3},m="number"==typeof p?p:p.x,g="number"==typeof p?p:p.y,y=function(e,t){return(e+"").length*t*.6}(r,o),v=o+2*g;let b,x;return b="middle"===l?t-y/2-m:"end"===l?t-y-m:t-m,x="middle"===c||"central"===c?n-v/2:"hanging"===c||"text-before-edge"===c?n-g:n-.8*o-g,(0,Zc.jsxs)("g",{className:d,children:[(0,Zc.jsx)("rect",{x:b,y:x,width:y+2*m,height:v,rx:h.radius??3,ry:h.radius??3,fill:h.fill??Kc,fillOpacity:h.opacity??.85,stroke:h.stroke,strokeWidth:h.strokeWidth}),f()]})}function Jt(e,t,n){if(!e)return null;const r="object"==typeof e?e:{};return(0,Qc.jsx)("circle",{className:"semiotic-threshold-end-cap",cx:t[0],cy:t[1],r:Math.max(0,r.radius??4),fill:r.fill??n})}function en({ann:e,position:t,vertical:n,width:r,height:i,color:o,fontSize:a=12,fontFamily:s,bold:l,background:c,dash:u="6,3",labelGap:d=4}){const h=e.labelPosition,f=t>.6*r,p=n?t+(f?-4:4):"left"===h?4:"center"===h?r/2:r-4,m=n?"bottom"===h?i-4:"center"===h?i/2:16:20>t?Math.min(i-4,t+16):t-d,g=n?f?"end":"start":"left"===h?"start":"center"===h?"middle":"end",y=n?[t,0]:[0,t],v=n?[t,i]:[r,t];return(0,Jc.jsxs)("g",{opacity:e.opacity,children:[(0,Jc.jsx)("line",{x1:y[0],y1:y[1],x2:v[0],y2:v[1],stroke:o,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray||u}),Jt(e.endCap,y,o),e.label&&(0,Jc.jsx)(Qt,{x:p,y:m,text:e.label,textAnchor:g,fill:o,fontSize:a,fontFamily:s,fontWeight:l?"bold":void 0,background:c??e.labelBackground??"halo"})]})}function tn(e){return{label:e.label,title:e.title,wrap:e.wrap||120,noWrap:"function"==typeof e._noteLayout?e.noWrap:void 0,_noteLayout:e._noteLayout}}function nn(e){return"function"==typeof e._noteLayout?e._noteLayout(e):void 0}function rn(e,t,n){if(!e)return[];const r=Math.max(1,Math.floor(t/n)),i=[];let o="";for(const t of e.split(/\s+/))t&&(o&&o.length+1+t.length>r?(i.push(o),o=t):o=o?`${o} ${t}`:t);return o&&i.push(o),i}function on(e,t,n,r){return"curly"===e?r?`M0,0 C${.6*n},0 ${.4*n},${t/2} ${n},${t/2} C${.4*n},${t/2} ${.6*n},${t} 0,${t}`:`M0,0 C0,${.6*n} ${t/2},${.4*n} ${t/2},${n} C${t/2},${.4*n} ${t},${.6*n} ${t},0`:r?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function an(e,t,n,r){if(!e)return(0,tu.jsx)("g",{className:"annotation-note"});const{label:i,title:o,orientation:a,align:s,wrap:l=120,noWrap:c}=e;if(!i&&!o)return(0,tu.jsx)("g",{className:"annotation-note"});let u=a;u||(u=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");const d="topBottom"===u,h="leftRight"===u;let f=s;f&&"dynamic"!==f||(f=d?0>t?"right":"left":0>n?"bottom":"top");let p="start";d?"right"===f?p="end":"middle"===f&&(p="middle"):p=0>t?"end":"start";const m=e.useHTML||e.html,g=m?void 0:nn(e),y=g?.lineHeight??16,v=g?.titleLines??(o?c?[o]:rn(o,l,8):[]),b=g?.labelLines??(i?c?[i]:rn(i,l,8):[]),x=v.length+b.length,w=h?"end"===p?-4:4:0,k=[],S=r||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";if(m)k.push((0,tu.jsx)("foreignObject",{className:"annotation-note-html",x:"end"===p?w-l:"middle"===p?w-l/2:w,y:-y,width:l,height:Math.max(y,x*y+(o&&i?2:0))+y,style:{overflow:"visible"},children:(0,tu.jsxs)("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:S,fontSize:"12px",lineHeight:y+"px",overflow:"visible",textAlign:"end"===p?"right":"middle"===p?"center":"left",whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[o&&(0,tu.jsx)("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:o}),i&&(0,tu.jsx)("div",{className:"annotation-note-label",children:i})]})},"annotation-note-html"));else for(const e of[!0,!1]){const t=e?v:b;if(0===t.length)continue;const n="annotation-note-"+(e?"title":"label");k.push((0,tu.jsx)("text",{className:n,fill:S,textAnchor:p,fontWeight:e?g?.titleFontWeight??"bold":void 0,y:e?void 0:v.length*y,children:t.map((e,t)=>(0,tu.jsx)("tspan",{x:w,dy:0===t?0:y,children:e},t))},n))}let M=null;if((o||i)&&(0!==t||0!==n)){const e=d?g?g.width:Math.min(l,120):(v.length+b.length+(b.length>0?1:0))*y,t=d?p:f,n="end"===t||"bottom"===t?-e:"middle"===t?-e/2:0;M=(0,tu.jsx)("line",{className:"note-line",x1:d?n:0,x2:d?n+e:0,y1:d?0:n,y2:d?0:n+e,stroke:r||"var(--semiotic-text-secondary, currentColor)"})}const j=Math.max(0,x-1)*y;let A=0;(d||h)&&(A=h&&"middle"===f?-(j+y+(b.length>0&&v.length>0?2:0))/2+y/2:0>n||h&&"bottom"===f?-(j+2):2+y);const C=0!==A?`translate(0,${A})`:void 0;return(0,tu.jsxs)("g",{className:"annotation-note",transform:`translate(${t},${n})`,...g?.textProps,children:[(0,tu.jsx)("g",{className:"annotation-note-content",transform:C,children:k}),M]})}function sn(e,t,n,r,i){let o=null;const a=n||"var(--semiotic-text-secondary, currentColor)";switch(e){case"callout-circle":{const e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&(o=(0,tu.jsx)("circle",{r:e,fill:"none",stroke:a},"subject-circle"));break}case"callout-rect":{const e=t?.width||0,n=t?.height||0;(e>0||n>0)&&(o=(0,tu.jsx)("rect",{width:e,height:n,fill:"none",stroke:a},"subject-rect"));break}case"callout-custom":o=t?.custom;break;case"xy-threshold":{const e=r||0,n=i||0;let s=0,l=0,c=0,u=0;if(void 0!==t?.x)s=l=(t.x||0)-e,c=(t.y1||0)-n,u=(t.y2||0)-n;else if(void 0!==t?.y)c=u=(t.y||0)-n,s=(t.x1||0)-e,l=(t.x2||0)-e;else if(void 0!==t?.x1||void 0!==t?.x2)s=(t.x1||0)-e,l=(t.x2||0)-e;else{if(void 0===t?.y1&&void 0===t?.y2)break;c=(t.y1||0)-n,u=(t.y2||0)-n}o=(0,tu.jsx)("line",{x1:s,y1:c,x2:l,y2:u,stroke:a,strokeDasharray:"5,5"},"threshold-line");break}case"bracket":{const e=t?.type||"curly",n=t?.width??t?.height;void 0!==n&&(o=(0,tu.jsx)("path",{d:on(e,n,t?.depth||30,void 0===t?.width),fill:"none",stroke:a},"bracket-path"));break}}return(0,tu.jsx)("g",{className:"annotation-subject",children:o})}function ln(e,t,n,r,i,o){let a,s,l=0,c=0;if("callout-circle"!==i&&"label"!==i||!o?.radius){if("callout-rect"===i&&o){const n=o.width||0,r=o.height||0;if(n>0||r>0){const i=n/2,o=r/2,a=e-i,s=t-o;if(0!==a||0!==s){const e=Math.abs(a),t=Math.abs(s),u=n/2,d=r/2,h=e*d>t*u?u/e:d/t;l=i+a*h,c=o+s*h}}}else if("bracket"===i&&o){const e=o.width,t=o.height,n=o.depth||30;void 0!==e?(l=e/2,c=n):void 0!==t&&(l=n,c=t/2)}}else{const n=(o.radius||0)+(o.radiusPadding||0);if(n>0&&(0!==e||0!==t)){const r=Math.atan2(t,e);l=Math.cos(r)*n,c=Math.sin(r)*n}}const u=e-l,d=t-c,h=Math.hypot(u,d);if(h>.5){const i=r||"var(--semiotic-text-secondary, currentColor)",o="curve"===n?.type;let f=Math.atan2(d,u);if(o){const r=(l+e)/2,o=(c+t)/2,s=-d/h,p=u/h,m=(n?.curve??.25)*h,g=r+s*m,y=o+p*m;a=(0,tu.jsx)("path",{className:"connector-curve",d:`M${l},${c}Q${g},${y} ${e},${t}`,fill:"none",stroke:i},"connector-line"),f=Math.atan2(y-c,g-l)}else a=(0,tu.jsx)("line",{x1:l,y1:c,x2:e,y2:t,stroke:i},"connector-line");if("arrow"===n?.end){const e=10,t=16/180*Math.PI;s=(0,tu.jsx)("path",{d:`M${l},${c}L${l+e*Math.cos(f+t)},${c+e*Math.sin(f+t)}L${l+e*Math.cos(f-t)},${c+e*Math.sin(f-t)}Z`,fill:i,stroke:"none"},"connector-arrow")}}return(0,tu.jsxs)("g",{className:"annotation-connector",children:[a,s]})}function cn(e){const{x:t=0,y:n=0,dx:r,dy:i,nx:o,ny:a,note:s,connector:l,subject:c,type:u,color:d,className:h,disable:f,opacity:p,strokeDasharray:m,events:g={},"data-testid":y}=e,v=Array.isArray(t)?t[0]??0:t,b=Array.isArray(n)?n[0]??0:n,x=Array.isArray(f)?f:[];let w=r||0,k=i||0;null!=o&&(w=o-v),null!=a&&(k=a-b);const S="string"==typeof u?u:"label";if("bracket"===S&&c&&0===w&&0===k)if(void 0!==c.width){w=c.width/2;const e=c.depth||30;k=e+(0>e?-5:5)}else if(void 0!==c.height){const e=c.depth||30;w=e+(0>e?-5:5),k=c.height/2}return(0,tu.jsxs)("g",{className:("annotation "+(h||"")).trim(),transform:`translate(${v},${b})`,"data-testid":y,...null!=p&&{opacity:p},...m&&{strokeDasharray:m},...g,children:[!x.includes("connector")&&ln(w,k,l,d,S,c),!x.includes("subject")&&sn(S,c,d,v,b),!x.includes("note")&&an(s,w,k,d)]})}function un(e){const{noteData:t}=e,{screenCoordinates:n}=t,r="string"==typeof t.type?t.type:"label",i=t.eventListeners||t.events||{};if(t.coordinates&&n){const e=t.nx||n[0][0]+(t.dx??0),i=t.ny||n[0][1]+(t.dy??0),o=n.map((n,o)=>{const a=Object.assign({},t,{note:0===o?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:i});return(0,tu.jsx)(cn,{"data-testid":"semiotic-annotation",...a,type:r},"multi-annotation-"+o)});return(0,tu.jsx)("g",{children:o})}const o=t.note||{title:"none",label:t.label},a=`${o.label}-${o.title}-${t.i}`;return(0,tu.jsx)(cn,{"data-testid":"semiotic-annotation",events:i,...t,type:r},a)}function dn(e){return Math.round(100*e)/100}function hn(e,t=2){const n=[],r=[],i=t+1;for(let t=0;i>t;t++){let o=0;for(const[n,r]of e)null!==r&&(o+=n**t*r);n.push(o);const a=[];for(let n=0;i>n;n++){let r=0;for(const[i,o]of e)null!==o&&(r+=i**(t+n));a.push(r)}r.push(a)}r.push(n);const o=function(e,t){const n=e,r=e.length-1,i=[t];for(let e=0;r>e;e++){let t=e;for(let i=e+1;r>i;i++)Math.abs(n[e][i])>Math.abs(n[e][t])&&(t=i);for(let i=e;r+1>i;i++){const r=n[i][e];n[i][e]=n[i][t],n[i][t]=r}for(let t=e+1;r>t;t++)for(let i=r;i>=e;i--)n[i][t]-=n[i][e]*n[e][t]/n[e][e]}for(let e=r-1;e>=0;e--){let t=0;for(let o=e+1;r>o;o++)t+=n[o][e]*i[o];i[e]=(n[r][e]-t)/n[e][e]}return i}(r,i).map(dn);return{points:e.map(([e])=>[dn(e),dn(o.reduce((t,n,r)=>t+n*e**r,0))]),equation:[...o].reverse()}}function fn(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function pn(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function mn(e){return null==e?null:e+""}function gn(e,t,n){return t.stickyPositionCache?.set(e,n),n}function yn(e,t,n){const r=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===r){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let r=n.pointNodes.length-1;r>=0;r--){const i=n.pointNodes[r];if(i.pointId===e.pointId)return gn(t,n,{x:i.x,y:i.y})}const r=function(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],r=e.scales?.x??e.scales?.time,i=e.scales?.y??e.scales?.value;if(!r||!i)return null;const o=n[e.xAccessor||"x"],a=n[e.yAccessor||"y"];return null==o||null==a?null:{x:r(o),y:i(a)}}(n);return r?gn(t,n,r):null}if("semantic"===r){const r=function(e,t,n){const r=function(e){return mn(e.provenance?.stableId??e.stableId)}(e);if(!r)return null;const i=n.pointNodes?.find(e=>mn(e.pointId)===r);if(i)return gn(t,n,{x:i.x,y:i.y});const o=n.data?.find(e=>function(e){return mn(e.stableId??e.id??e.provenance?.stableId)}(e)===r);if(!o)return null;const a=fn(o,n),s=pn(o,n);return null==a||null==s?null:gn(t,n,{x:a,y:s})}(e,t,n);if(r)return r}let i=null,o=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(i=t.x,o=t.y)}if(null!=i&&null!=o||(i=fn(e,n),o=pn(e,n)),null!=i&&null!=o)return gn(t,n,{x:i,y:o});if("sticky"===r){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function vn(e,t,n,r=50){return!(-r>e||e>(n.width||0)+r||-r>t||t>(n.height||0)+r)}function bn(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle}}function xn(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function wn(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function kn(e,t){let n=2166136261;const r=wn(t);for(let e=0;r.length>e;e++)n^=r.charCodeAt(e),n=Math.imul(n,16777619);return`${e}-hatch-${(n>>>0).toString(36)}`}function Sn(e,t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45,lineOpacity:s=1}=e,l=Math.max(8,Math.ceil(2*o));return(0,ou.jsxs)("pattern",{id:t,width:l,height:l,patternUnits:"userSpaceOnUse",patternTransform:0!==a?`rotate(${a})`:void 0,children:[n&&"transparent"!==n&&(0,ou.jsx)("rect",{width:l,height:l,fill:n}),(0,ou.jsx)("line",{x1:0,y1:0,x2:0,y2:l,stroke:r,strokeWidth:i,strokeOpacity:s}),(0,ou.jsx)("line",{x1:o,y1:0,x2:o,y2:l,stroke:r,strokeWidth:i,strokeOpacity:s})]},t)}function Mn(e,t,n="#4e79a7"){if(xn(e)){const n=kn(t,e);return{fill:`url(#${n})`,def:Sn(e,n)}}return e&&"string"==typeof e?{fill:e}:{fill:n}}function jn(e,t,n,r){const i=Mn(e.fill??e.color,t,r);return function(e,t,n,r){if(!e||"object"!=typeof e)return;const i=e;if(!Array.isArray(i.stops))return;const o=i.stops.flatMap(e=>{if(!e||"object"!=typeof e)return[];const{offset:t,color:n,opacity:i}=e;return"number"==typeof t&&Number.isFinite(t)?[{offset:Math.max(0,Math.min(1,t)),color:"string"==typeof n&&n?n:r,opacity:"number"==typeof i&&Number.isFinite(i)?Math.max(0,Math.min(1,i)):void 0}]:[]}).sort((e,t)=>e.offset-t.offset);if(!o.length)return;const a="horizontal"===i.direction?"horizontal":"vertical"===i.direction?"vertical":n,s=t+"-gradient";return{fill:`url(#${s})`,def:(0,ou.jsx)("linearGradient",{id:s,x1:0,y1:0,x2:"horizontal"===a?"100%":0,y2:"vertical"===a?"100%":0,children:o.map((e,t)=>(0,ou.jsx)("stop",{offset:100*e.offset+"%",stopColor:e.color,stopOpacity:e.opacity},`${e.offset}-${t}`))},s)}}(e.gradient,t,n,"string"==typeof e.fill&&e.fill?e.fill:"string"==typeof e.color&&e.color?e.color:r)??i}function An(e,t,n,r){const i=function(e,t,n){const r=e.position,i="string"==typeof r&&su.has(r)?r:"bottom-left",o=i.endsWith("left")?"left":i.endsWith("right")?"right":"center",a=i.startsWith("top")?"top":i.startsWith("bottom")?"bottom":"middle",s="top"===a?0:"bottom"===a?n:n/2;return{x:("left"===o?0:"right"===o?t:t/2)+("number"==typeof e.dx&&Number.isFinite(e.dx)?e.dx:0),y:s+("number"==typeof e.dy&&Number.isFinite(e.dy)?e.dy:0),textAnchor:"start"===e.textAnchor||"middle"===e.textAnchor||"end"===e.textAnchor?e.textAnchor:"left"===o?"start":"right"===o?"end":"middle",dominantBaseline:"auto"===e.dominantBaseline||"middle"===e.dominantBaseline||"hanging"===e.dominantBaseline?e.dominantBaseline:"top"===a?"hanging":"bottom"===a?"auto":"middle"}}(e,t,n);return{...i,fill:e.fill??e.color??r.fill,fontSize:e.fontSize??r.fontSize,fontFamily:e.fontFamily??r.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,letterSpacing:e.letterSpacing,opacity:e.opacity,className:e.className,style:{pointerEvents:"none"}}}function Cn({annotation:e,width:t,height:n,defaults:r=cu}){const i=e.label??e.text;return null==i?null:(0,lu.jsx)("text",{...An(e,t,n,r),children:i})}function Rn(e){return!0===e?._annotationDeferred}function Ln(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function Pn(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function Nn(e){return Math.max(.72,.95-.06*e)}function En(e){const t=e.map((e,t)=>{return{p:e,i:t,emphasis:(n=e.annotation,"primary"===n?.emphasis||"secondary"===n?.emphasis?n.emphasis:null),confidence:Pn(e.annotation),readingOrder:null,rank:1};var n}),n=t.some(e=>null!=e.emphasis||null!=e.confidence),r=e.some(e=>Rn(e.annotation)),i=e.some(e=>null!=Ln(e.annotation)),o=e.some(e=>"layer"===Ln(e.annotation));if(!n&&!r&&!i)return e.map(e=>e.node);const a=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);a.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,a.length)});for(const e of t)e.emphasis&&(e.rank=du[e.emphasis]);const s=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{const{p:t,i:n,emphasis:r,readingOrder:i}=e,o=Rn(t.annotation);let a=t.node;if("primary"===r||"secondary"===r||null!=i){const e=null==r&&null!=i;a=(0,uu.jsx)("g",{className:e?"annotation-emphasis annotation-emphasis--inferred":"annotation-emphasis annotation-emphasis--"+r,..."secondary"===r?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:Nn(i),"data-annotation-reading-order":i}:{},children:t.node},"annotation-emphasis-"+n)}const s=Ln(t.annotation);return s&&(a=(0,uu.jsx)("g",{className:"annotation-cohesion--"+s,children:a},"annotation-cohesion-"+n)),o&&(a=(0,uu.jsx)("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:a},"annotation-deferred-"+n)),a});return r&&s.unshift((0,uu.jsx)("style",{children:".annotation-deferred{opacity:0;pointer-events:none;transition:opacity .12s ease}.stream-xy-frame:hover .annotation-deferred,.stream-ordinal-frame:hover .annotation-deferred,.stream-network-frame:hover .annotation-deferred,.stream-geo-frame:hover .annotation-deferred,.stream-xy-frame:focus-within .annotation-deferred,.stream-ordinal-frame:focus-within .annotation-deferred,.stream-network-frame:focus-within .annotation-deferred,.stream-geo-frame:focus-within .annotation-deferred{opacity:1;pointer-events:auto}@media (prefers-reduced-motion:reduce){.annotation-deferred{transition:none}}"},"annotation-disclosure-style")),o&&s.unshift((0,uu.jsx)("style",{children:".annotation-cohesion--layer text,.annotation-cohesion--layer tspan{fill:var(--semiotic-annotation-color,var(--semiotic-text-secondary,#666));font-style:italic}"},"annotation-cohesion-style")),s}function In(e){return!!e&&"object"==typeof e&&pu.has(function(e){return"string"==typeof e?.type?e.type:""}(e))}function Tn(e){return"primary"===e?.emphasis||!0===e?.defensive}function Dn(e,t,n={}){return"number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations)?Math.max(0,Math.floor(n.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4))):1/0}function zn(e){let t;const n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;const r=e?.provenance?.confidence;switch("number"==typeof r&&Number.isFinite(r)&&(t+=15*Math.max(0,Math.min(1,r))),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}function _n(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?Object.prototype.hasOwnProperty.call(xu,t.source)?xu[t.source]:t.source:null,r="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!n&&!r)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const i=[n,r].filter(Boolean).join(" · "),o="string"==typeof e.label?e.label:"";return o.includes(`(${i})`)?e:{...e,label:o?`${o} (${i})`:`(${i})`}}function On(e){if(!Fn(e))return e;const t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function Fn(e){return In(e)}function Wn(e,t,n,r,i){const o=e+n,a=t+r;return Math.abs(n)>Math.abs(r)?{x:0>n?o-i.width-4:o+4,y:0>r?a-i.height:a,width:i.width,height:i.height}:{x:0>n?o-i.width:o,y:0>r?a-i.height-4:a+4,width:i.width,height:i.height}}function Bn(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function Hn(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function $n(e,t,n,r,i,o,a,s){const l=Bn(e,a);let c=.4*Math.hypot(t.dx,t.dy)+80*function(e,t,n,r){const i=Math.max(0,r-e.x),o=Math.max(0,r-e.y);return(i+Math.max(0,e.x+e.width-(t-r)))*e.height+(o+Math.max(0,e.y+e.height-(n-r)))*e.width}(l,i,o,s);for(const e of n)c+=12*Hn(l,e);for(const e of r)c+=4*Hn(l,e);return c}function qn(e){const{annotations:t,context:n,defaultOffset:r=mu,notePadding:i=gu,markPadding:o=yu,edgePadding:a=vu,preserveManualOffsets:s=!0,routeLongConnectors:l=!0,connectorThreshold:c=bu,density:u,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:p,cohesion:m,audience:g}=e,y=n.width||0,v=n.height||0,b="object"==typeof p?p:{},x=b.breakpoint??480,w=!!p&&x>=y,k=w&&!1!==b.preferShortText?t.map(On):t,S=w&&!u?{maxAnnotations:b.maxAnnotations??("callout-list"===b.strategy?1:2),minVisible:b.minVisible??1}:u,M=d||w&&(!1!==b.progressiveDisclosure||"callout-list"===b.strategy),j=w&&!f?b.responsive??{minWidth:x}:f,A=w&&!m?b.cohesion:m;if(0===k.length||0>=y||0>=v)return k.slice();const C=[],R=function(e,t){return(e.pointNodes||[]).map(e=>{const n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}(n,o);let L=!1;const P=k.map((e,t)=>{if(!Fn(e))return e;const o=function(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};const r=e.pointId??e.nodeId;if(null!=r&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===r);if(e)return{x:e.x,y:e.y}}const i=e.coordinates,o=n.scales?.geoProjection;if(Array.isArray(i)&&i.length>=2&&o){const e=i[0],t=i[1];if("number"==typeof e&&"number"==typeof t){const n=o([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?yn(e,t,n):{x:e.x,y:e.y}}(e,t,n);if(!o)return e;const u=function(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t=nn(e);if(t)return{width:Math.max(24,t.width+10),height:Math.max(18,t.height+6)};const n="number"==typeof e.wrap?e.wrap:120,r=[...rn("string"==typeof e.title?e.title:void 0,n,7),...rn("string"==typeof e.label?e.label:void 0,n,7)],i=r.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(n,7*i)+10),height:Math.max(18,16*r.length+6)}}(!0===e.defensive?_n(e):e);if(s&&("number"==typeof(d=e).dx||"number"==typeof d.dy)){const t=function(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}(e);return C.push(Bn(Wn(o.x,o.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,u),i)),e}var d;let h=null,f=1/0;for(const e of function(e){const t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}(r)){const t=$n(Wn(o.x,o.y,e.dx,e.dy,u),e,C,R,y,v,i,a);f>t&&(h=e,f=t)}if(!h)return e;const p=Bn(Wn(o.x,o.y,h.dx,h.dy,u),i);C.push(p);const m=Math.hypot(h.dx,h.dy),g=l&&m>=c&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return L=!0,{...e,dx:h.dx,dy:h.dy,...g?{connector:g}:{}}}),N=L?P:k.slice();let E=N;if(h){let e=!1;const t=N.map(t=>{const n=function(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}(t);return n!==t&&(e=!0),n});E=e?t:N}{let e=!1;const t=E.map(t=>{if(!0!==t?.defensive)return t;const n=_n(t);return n!==t&&(e=!0),n});E=e?t:E}const I=new Set;if(S){const e="object"==typeof S?S:{},t=function(e){if(!e)return 1;const t=function(e){const t=e?.familiarity;if(!t)return 3;const n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}(e);return t>2?4>t?1:.6:1.5}(g),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??Dn(y,v,e))*t))},{deferred:r}=function(e){const{annotations:t,width:n,height:r}=e,i=Math.max(0,e.minVisible??1),o=Dn(n,r,e),a=t.map((e,t)=>{return{annotation:e,index:t,note:(n=e,In(n))};var n}),s=a.filter(e=>e.note);if(0===s.length||o>=s.length)return{visible:t.slice(),deferred:[],budget:o};const l=s.filter(e=>Tn(e.annotation)),c=s.filter(e=>!Tn(e.annotation)).sort((e,t)=>zn(t.annotation)-zn(e.annotation)||e.index-t.index),u=Math.min(c.length,Math.max(Math.max(0,o-l.length),Math.max(0,i-l.length))),d=new Set([...l.map(e=>e.index),...c.slice(0,u).map(e=>e.index)]),h=[],f=[];for(const{annotation:e,index:t,note:n}of a)!n||d.has(t)?h.push(e):f.push(e);return{visible:h,deferred:f,budget:o}}({annotations:E,width:y,height:v,...n});for(const e of r)I.add(e)}if(j&&("object"==typeof j&&"number"==typeof j.minWidth?j.minWidth:480)>=y)for(const e of E)Fn(e)&&"secondary"===e.emphasis&&I.add(e);if(I.size>0)for(const e of E)!0===e?.defensive&&I.delete(e);let T;return T=0===I.size?E:M?E.map(e=>I.has(e)?{...e,_annotationDeferred:!0}:e):E.filter(e=>!I.has(e)),A?function(e,t){let n=!1;const r=e.map(e=>Fn(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?r:e}(T,A):T}function Gn({config:e,orientation:t="vertical",width:n=100,customClickBehavior:r,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:a,legendInteraction:s}){const{colorFn:l,domain:c,label:u,format:d}=e,h="horizontal"===t,f=d||It(c),p="grad-legend-"+Mu.useId(),m=!(!r&&!i),g="isolate"===s||void 0===s&&null!=a,[y,v]=Mu.useState(0),[b,x]=Mu.useState(null),w=Mu.useRef([]),[k,S]=c,M=Mu.useMemo(()=>Array.from({length:65},(e,t)=>{const n=t/64;return(0,ju.jsx)("stop",{offset:n,stopColor:l(h?k+n*(S-k):S-n*(S-k))},t)}),[l,k,S,h]),j=h?Math.min(n,200):14,A=h?12:100,C=h?Math.max(0,(n-j)/2):0,R=u?18:0;return(0,ju.jsxs)("g",{"aria-label":u||"Gradient legend",role:m?"listbox":void 0,"aria-orientation":m?t:void 0,"aria-multiselectable":!(!m||!g)||void 0,style:ku,children:[(0,ju.jsx)("defs",{children:(0,ju.jsx)("linearGradient",{id:p,x1:"0%",y1:"0%",x2:h?"100%":"0%",y2:h?"0%":"100%",children:M})}),u&&(0,ju.jsx)("text",{x:h?C+j/2:0,y:12,textAnchor:h?"middle":"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),(0,ju.jsx)("rect",{x:C,y:R,width:j,height:A,fill:`url(#${p})`,rx:2}),m&&Array.from({length:5},(e,n)=>((e,n,s)=>{const l="string"==typeof e.interactionKey?e.interactionKey:e.label,c=a?.has(l)??!1,u=o===l,d=b===s,h=e=>{const t=(e+5)%5;v(t),w.current[t]?.focus()};return(0,ju.jsx)("rect",{ref:e=>{w.current[s]=e},className:"semiotic-gradient-legend-bin",...n,fill:a?.size&&!c||null!=o&&!u?"rgba(255,255,255,0.65)":"transparent",stroke:d||c||u?"var(--semiotic-focus, #005fcc)":"transparent",strokeWidth:d?3:2,tabIndex:s===y?0:-1,role:"option","aria-label":e.label,"aria-selected":g?c:void 0,"aria-current":!(g||!u)||void 0,onClick:r?()=>r(e):void 0,onMouseEnter:i?()=>i(e):void 0,onMouseLeave:i?()=>i(null):void 0,onFocus:()=>{v(s),x(s),i?.(e)},onBlur:()=>{x(null),i?.(null)},onKeyDown:n=>{if(("Enter"===n.key||" "===n.key)&&r)return n.preventDefault(),void r(e);const i="horizontal"===t?"ArrowRight":"ArrowDown";n.key===("horizontal"===t?"ArrowLeft":"ArrowUp")||n.key===i?(n.preventDefault(),h(s+(n.key===i?1:-1))):"Home"!==n.key&&"End"!==n.key||(n.preventDefault(),h("Home"===n.key?0:4))},style:{cursor:"pointer",pointerEvents:"all"}},"gradient-interaction-"+s)})((e=>{const t=h?e:5-e-1,n=c[0]+t/5*(c[1]-c[0]),r=c[0]+(t+1)/5*(c[1]-c[0]);return{label:`${f(n)} – ${f(r)}`,valueRange:[n,r],interactionKey:`${n}:${r}`}})(n),{x:h?C+n*j/5:0,y:h?R:R+n*A/5,width:h?j/5:j,height:h?A:A/5},n)),[0,1].map(e=>(0,ju.jsx)("text",{x:h?C+e*j:j+5,y:R+(h?A+12:e?A:10),textAnchor:h?e?"end":"start":void 0,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:f(c[h?e:1-e])},e))]})}function Vn(e,t,n,r,i){if("function"==typeof n)return n(e);const o=r(e,t);return"fill"===n?(0,Au.jsx)("rect",{style:o,width:i,height:i}):(0,Au.jsx)("line",{style:o,x1:0,y1:0,x2:i,y2:i})}function Un({swatchSize:e}){return(0,Au.jsx)("path",{d:`M${.25*e},${.55*e} L${.45*e},${.75*e} L${.8*e},${.3*e}`,fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}function Yn(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}function Xn(e,t,n,r,i,o){const{legendGroup:{type:a="fill",styleFn:s,items:l},customClickBehavior:c,customHoverBehavior:u,highlightedCategory:d,isolatedCategories:h,focusedGroupIndex:f,focusedItemIndex:p,groupIndex:m,onFocusedIndexChange:g,interactive:y,useIsolateAria:v,metrics:{swatchSize:b,labelGap:x}}=e,w=!!h?.size&&h.has(t.label);return(0,Au.jsxs)("g",{transform:r,onClick:c?()=>c(t):void 0,onMouseEnter:u?()=>u(t):void 0,onMouseLeave:u?()=>u(null):void 0,tabIndex:y?m===f&&n===p?0:-1:void 0,role:y?"option":void 0,"aria-selected":y&&v?w:void 0,"aria-current":!(!y||v||null==d||t.label!==d)||void 0,"aria-label":t.label,onKeyDown:y?e=>{if("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c?.(t)),e.key===i||e.key===o){e.preventDefault();const t=(n+(e.key===o?1:-1)+l.length)%l.length;g(m,t);const r=e.currentTarget.parentElement?.children[t];r instanceof SVGElement&&r.focus()}}:void 0,onFocus:y?e=>{g(m,n),u?.(t),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","visible")}:void 0,onBlur:y?e=>{u?.(null),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","hidden")}:void 0,style:{cursor:y?"pointer":"default",opacity:Yn(t,d,h),transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[y&&(0,Au.jsx)("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:b+x+2+7*t.label.length,height:b+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),Vn(t,n,a,s,b),w&&(0,Au.jsx)(Un,{swatchSize:b}),(0,Au.jsx)("text",{y:b/2,x:b+x,dominantBaseline:"central",fontSize:12,style:Su,fill:"var(--semiotic-text, #333)",children:t.label})]},"legend-item-"+n)}function Zn(e){const{legendGroups:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,legendInteraction:a,title:s="Legend",width:l=100,height:c=20,orientation:u="vertical",legendLayout:d}=e,h=Vt(d),[f,p]=wu.useState(0),[m,g]=wu.useState(0),y=wu.useCallback((e,t)=>{p(e),g(t)},[]),v="vertical"===u?(({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:a,focusedItemIndex:s,onFocusedIndexChange:l,legendInteraction:c,metrics:u})=>{const d=[],h=function(e,t){let n=24;return e.map(({hasLabel:e,itemCount:r})=>{n+=5;const i=n;let o;n+=8,e&&(n+=16,o=n,n+=8);const a=n;return n+=r*t+8,{lineY:i,labelY:o,itemsY:a,endY:n}})}(e.map(e=>({hasLabel:!!e.label,itemCount:e.items.length})),u.rowHeight);return e.forEach((e,f)=>{const p=h[f];d.push((0,Au.jsx)("line",{stroke:"gray",x1:0,y1:p.lineY,x2:t,y2:p.lineY},"legend-top-line legend-symbol-"+f)),e.label&&null!=p.labelY&&d.push((0,Au.jsx)("text",{y:p.labelY,className:"legend-group-label",fontSize:12,style:Su,fill:"var(--semiotic-text, #333)",children:e.label},"legend-text-"+f)),d.push((0,Au.jsx)("g",{className:"legend-item",transform:`translate(0,${p.itemsY})`,children:Cu(e,n,r,i,o,a,s,f,l,c,u)},"legend-group-"+f))}),d})({legendGroups:t||[],width:l,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:m,onFocusedIndexChange:y,legendInteraction:a,metrics:h}):(({legendGroups:e,height:t,width:n,customClickBehavior:r,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:a,focusedGroupIndex:s,focusedItemIndex:l,onFocusedIndexChange:c,legendInteraction:u,metrics:d})=>{let h=0;const f=[];e.forEach((e,t)=>{let p=0;e.label&&(p+=16);const m=((e,t,n,r,i,o,a,s,l,c,u,d)=>{const{items:h}=e,f=[],{swatchSize:p,labelGap:m,itemGap:g,rowHeight:y,align:v}=u,b={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=i,metrics:u},x=h.map(e=>p+m+7*e.label.length),w=[];let k=0,S=0;x.forEach((e,t)=>{const n=0===S?e:S+g+e;d&&d>0&&S>0&&n>d?(w.push({start:k,end:t,width:S}),k=t,S=e):S=n}),h.length>0&&w.push({start:k,end:h.length,width:S}),w.forEach((e,t)=>{let n="center"===v?Math.max(0,((d??e.width)-e.width)/2):"end"===v?Math.max(0,(d??e.width)-e.width):0;for(let r=e.start;e.end>r;r++)f.push(Xn(b,h[r],r,`translate(${n},${t*y})`,"ArrowLeft","ArrowRight")),n+=x[r]+g});const M=w.reduce((e,t)=>Math.max(e,t.width),0),j=w.length;return{items:f,offset:M,totalRows:j,totalHeight:j*y}})(e,r,i,o,a,s,l,t,c,u,d,d.maxWidth??n);p+=m.offset+5,f.push({label:e.label,...m,offset:p,totalRows:m.totalRows,totalHeight:m.totalHeight}),h+=p+12});const p=d.maxWidth??n;let m=h>p?0:"center"===d.align?Math.max(0,(p-h)/2):"end"===d.align?Math.max(0,p-h):0;const g=[];return f.forEach((n,r)=>{const i=e[r];i.label&&(g.push((0,Au.jsx)("text",{transform:`translate(${m},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",fontSize:12,style:Su,fill:"var(--semiotic-text, #333)",children:i.label},"legend-text-"+r)),m+=16),g.push((0,Au.jsx)("g",{className:"legend-item",transform:`translate(${m},0)`,children:n.items},"legend-group-"+r)),m+=n.offset+5,e[r+1]&&g.push((0,Au.jsx)("line",{stroke:"gray",x1:m,y1:-8,x2:m,y2:(n.totalHeight||t)+0+8},"legend-top-line legend-symbol-"+r)),m+=12}),(0,Au.jsx)("g",{children:g})})({legendGroups:t||[],title:s,height:c,width:l,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:m,onFocusedIndexChange:y,legendInteraction:a,metrics:h}),b=!(!n&&!r);return(0,Au.jsxs)("g",{role:b?"listbox":void 0,"aria-multiselectable":!(!b||"isolate"!==a&&(void 0!==a||null==o))||void 0,"aria-label":"Chart legend",style:ku,children:[void 0!==s&&""!==s&&"vertical"===u&&(0,Au.jsx)("text",{className:"legend-title",y:16,x:l/2,textAnchor:"middle",fontSize:12,style:Su,fill:"var(--semiotic-text, #333)",children:s}),v]})}function Kn(e){const{legend:t,totalWidth:n,totalHeight:r,margin:i,legendPosition:o="right",legendLayout:a,legendHoverBehavior:s,legendClickBehavior:l,legendHighlightedCategory:c,legendIsolatedCategories:u,legendInteraction:d}=e;if(!t)return null;const{x:h,y:f,width:p}=function(e,t){const n=t.position??"right",r="top"===n||"bottom"===n,i=Math.max(0,t.totalWidth-t.margin.left-t.margin.right),o=Math.max(1,r?t.legendLayout?.maxWidth??i:t.reservedWidth??Ot(e,t.legendLayout)),a=Ft(e),s=Wt(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),l=Bt(t.legendLayout),c=$t(e,i,t.legendLayout),u=Ht(t.axisChrome,t.legendLayout),d=Ht(t.axisChrome?.topAxis,t.legendLayout);if("left"===n)return{x:Math.max(l,t.margin.left-s-o-a),y:t.margin.top,width:o,height:c};if("top"===n)return{x:t.margin.left,y:t.margin.top-d-a-c,width:o,height:c};if("bottom"===n){const e=t.totalHeight-t.margin.bottom;return{x:t.margin.left,y:Math.max(e+a,Math.min(e+u+a,t.totalHeight-c)),width:o,height:c}}return{x:Math.min(t.totalWidth-o-l,t.totalWidth-t.margin.right+s+a),y:t.margin.top,width:o,height:c}}(t,{totalWidth:n,totalHeight:r,margin:i,position:o,legendLayout:a,axisChrome:e.axisChrome}),m="top"===o||"bottom"===o;return(0,Ru.jsx)("g",{transform:`translate(${h}, ${f})`,children:Dt(t)?(0,Ru.jsx)(Gn,{config:t.gradient,orientation:m?"horizontal":"vertical",width:p,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):Tt(t)?(0,Ru.jsx)(Zn,{legendGroups:t.legendGroups,title:"",width:p,orientation:m?"horizontal":"vertical",legendLayout:a,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}function Qn({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?(0,Lu.jsx)("foreignObject",{x:0,y:0,width:t,height:n,children:e}):(0,Lu.jsx)("text",{x:t/2,y:22,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontSize:14,className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)",fontFamily:"var(--semiotic-title-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-title-font-weight, bold)"},children:e}):null}function Jn(e,t){return"string"==typeof e&&e.length>0?e:t}function er(e,t,n){return"string"==typeof t&&t.length>0?t:"string"==typeof e&&e.length>0?`${e} (${n.familyPhrase})`:n.fallback}function tr(e){const{width:t,height:n,totalWidth:r,totalHeight:i,margin:o,showAxes:a,title:s,description:l,idPrefix:c,legend:u,legendHoverBehavior:d,legendClickBehavior:h,legendHighlightedCategory:f,legendIsolatedCategories:p,legendPosition:m,legendLayout:g,foregroundGraphics:y,annotations:v,onAnnotationActivate:b,onObservation:x,chartId:w,chartType:k,autoPlaceAnnotations:S,svgAnnotationRules:M,pointNodes:j,geoProjection:A}=e,C=function(e){const t=(0,Yc.useObservationSelector)(e=>e.pushObservation),n=Uc.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return Uc.useMemo(()=>({...e,onObservation:n}),[n,e])}({onAnnotationActivate:b,onObservation:x,chartId:w,chartType:k}),R=(0,Xc.useRef)([v?.length??0,new Map]),L=v?.length??0;R.current[0]!==L&&(R.current=[L,new Map]);const P=(0,Xc.useMemo)(()=>{if(!v||0===v.length)return null;const e=function(e,t={}){const n=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,i=new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!n)return!1;const t=e?.provenance?.stableId;return!(t&&i.has(t)&&!r)})}(v),r=A?e.map(e=>{if(!Array.isArray(e.coordinates)||2>e.coordinates.length)return e;const t=A(Number(e.coordinates[0]),Number(e.coordinates[1]));return t?{...e,x:t[0],y:t[1]}:e}):e,i={scales:{x:e=>Number(e),y:e=>Number(e)},timeAxis:"x",width:t,height:n,frameType:"xy",pointNodes:j,stickyPositionCache:R.current[1]};return function(e,t,n,r){return function(e,t,n,r){const i=[];return e.forEach((e,o)=>{let a;if(n){const i=n(e,o,r);a=null!=i?i:t(e,o,r)}else a=t(e,o,r);a&&i.push({node:a,annotation:e})}),{nodes:En(i),renderedAnnotations:i.map(e=>e.annotation)}}(e,t,n,r).nodes}(S?qn({annotations:r,context:i,..."object"==typeof S?S:{}}):r,function(e,t={}){return function(e,n,r){switch(e.type){case"label":case"callout":case"callout-circle":case"callout-rect":{const t=yn(e,n,r);if(!t)return null;const{x:i,y:o}=t;if(!vn(i,o,r))return null;const a="callout"===e.type?"callout-circle":e.type,s="callout-circle"===a?{radius:e.radius??12,radiusPadding:e.radiusPadding}:"callout-rect"===a?{width:e.width,height:e.height}:void 0;return(0,hu.jsx)(un,{noteData:{x:i,y:o,dx:e.dx??30,dy:e.dy??-30,note:tn(e),type:a,...s?{subject:s}:{},connector:e.connector||{end:"arrow"},color:e.color,disable:e.disable,opacity:e.opacity,strokeDasharray:e.strokeDasharray,className:e.className}},"ann-"+n)}case"x-threshold":case"y-threshold":{const t="x-threshold"===e.type,i=null!=e.value?{...e,[t?"x":"y"]:e.value}:e,o=t?fn(i,r):pn(i,r);return null==o?null:(0,hu.jsx)(en,{ann:e,position:o,vertical:t,width:r.width||0,height:r.height||0,color:e.color||"#f97316",bold:!0},"ann-"+n)}case"enclose":{const t=(e.coordinates||[]).map(e=>({x:fn({...e,type:"point"},r),y:pn({...e,type:"point"},r),r:1})).filter(e=>null!=e.x&&null!=e.y);if(2>t.length)return null;const i=(0,nu.packEnclose)(t),o=e.padding||10;return(0,hu.jsxs)("g",{children:[(0,hu.jsx)("circle",{cx:i.x,cy:i.y,r:i.r+o,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&(0,hu.jsx)(Qt,{x:i.x,y:i.y-i.r-o-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+n)}case"rect-enclose":{const t=(e.coordinates||[]).map(e=>({x:fn({...e,type:"point"},r),y:pn({...e,type:"point"},r)})).filter(e=>null!=e.x&&null!=e.y);if(2>t.length)return null;const i=e.padding||10,o=t.map(e=>e.x),a=t.map(e=>e.y),[s,l]=dt(o),[c,u]=dt(a),d=s-i,h=l+i,f=c-i;return(0,hu.jsxs)("g",{children:[(0,hu.jsx)("rect",{x:d,y:f,width:h-d,height:u+i-f,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&(0,hu.jsx)(Qt,{x:(d+h)/2,y:f-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+n)}case"highlight":{const t=r.data||[],i="function"==typeof e.filter?t.filter(e.filter):e.field&&null!=e.value?t.filter(t=>t[e.field]===e.value):[],o={stroke:e.color||"#f97316",strokeWidth:2,fill:"none"};return(0,hu.jsx)("g",{children:i.map((t,n)=>{const i=fn(t,r),a=pn(t,r);if(null==i||null==a)return null;const s="function"==typeof e.r?e.r(t):e.r||6,l="function"==typeof e.style?e.style(t):e.style||o;return(0,hu.jsx)("circle",{cx:i,cy:a,r:s,...l},"hl-"+n)})},"ann-"+n)}case"bracket":{const t=fn(e,r),i=pn(e,r);return(0,hu.jsx)(un,{noteData:{x:t??0,y:i??0,dx:e.dx||0,dy:e.dy||0,note:tn(e),type:"bracket",subject:{type:e.bracketType||"curly",width:e.width,height:e.height,depth:e.depth||30},color:e.color}},"ann-"+n)}case"trend":{const t=r.data||[];if(2>t.length)return null;const i=r.xAccessor||"x",o=r.yAccessor||"y",a="ordinal"===r.frameType,s="horizontal"===r.projection,l=a?i:null,c=a?o:null;let u;const d=[],h=new Map;if(a&&l&&c){for(const e of t){const t=e[l];if(null==t)continue;const n=t+"";h.has(n)||(h.set(n,d.length),d.push(n))}u=t.map(e=>{const t=e[l],n=e[c];if(null==t||null==n)return null;const r=h.get(t+"");return null!=r?[r,+n]:null}).filter(e=>null!==e)}else u=t.map(e=>[e[i],e[o]]).filter(e=>null!=e[0]&&null!=e[1]);if(2>u.length)return null;const f=r.scales?.x??r.scales?.time,p=r.scales?.y??r.scales?.value;if(!f||!p)return null;const m=e=>t=>{const n=Math.max(0,Math.floor(t)),r=Math.min(d.length-1,n+1),i=t-n,o=e(d[n]);return o+(e(d[r])-o)*i},g=f,y=p;let v;if(a)if(s){const e=m(y);v=(t,n)=>[g(n),e(t)]}else{const e=m(g);v=(t,n)=>[e(t),y(n)]}else v=(e,t)=>[g(e),y(t)];const b=e.method||"linear";let x;if("loess"===b)x=function(e,t=.3){const n=e.length;if(2>n)return e.slice();const r=e.slice().sort((e,t)=>e[0]-t[0]),i=r.map(e=>e[0]),o=r.map(e=>e[1]),a=Math.min(n,Math.max(2,Math.ceil(t*n))),s=Number.isFinite(a)&&i.every(Number.isFinite);let l=0,c=a-1;const u=[];for(let e=0;n>e;e++){const t=i[e];let r,d=0,h=n-1;if(s){for(;n-1>c&&Math.abs(i[l]-t)>=Math.abs(i[c+1]-t);)l++,c++;const e=Math.max(Math.abs(i[l]-t),Math.abs(i[c]-t));r=e||1,e>0&&(d=l,h=c)}else r=i.map(e=>Math.abs(e-t)).sort((e,t)=>e-t)[a-1]||1;let f=0,p=0,m=0,g=0,y=0;for(let e=d;h>=e;e++){const n=Math.abs(i[e]-t)/r,a=1>n?Math.pow(1-Math.pow(n,3),3):0;0!==a&&(f+=a,p+=a*i[e],m+=a*o[e],g+=a*i[e]*i[e],y+=a*i[e]*o[e])}if(0===f){u.push([t,o[e]]);continue}const v=f*g-p*p;if(1e-12>Math.abs(v))u.push([t,m/f]);else{const e=(f*y-p*m)/v;u.push([t,(m-e*p)/f+e*t])}}return u}(u,e.bandwidth??.3);else{const t="polynomial"===b?hn(u,e.order||2):function(e){const t=[0,0,0,0];let n=0;for(const[r,i]of e)null!==i&&(n++,t[0]+=r,t[1]+=i,t[2]+=r*r,t[3]+=r*i);const r=n*t[2]-t[0]*t[0],i=0===r?0:dn((n*t[3]-t[0]*t[1])/r),o=dn(t[1]/n-i*t[0]/n);return{points:e.map(([e])=>[dn(e),dn(i*e+o)]),equation:[i,o]}}(u);x=t.points}const w=x.map(([e,t])=>{const[n,r]=v(e,t);return`${n},${r}`}).join(" "),k=e.color||"#6366f1",S=x[x.length-1],[M,j]=v(S[0],S[1]);return(0,hu.jsxs)("g",{children:[(0,hu.jsx)("polyline",{points:w,fill:"none",stroke:k,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&(0,hu.jsx)("text",{x:M+4,y:j-4,fill:k,fontSize:11,children:e.label})]},"ann-"+n)}case"band":{const t=r.scales?.y??r.scales?.value,i=t?.domain?.(),s=e.y0??i?.[0],l=e.y1??i?.[1],c=null!=s&&t?t(s):0,u=null!=l&&t?t(l):r.height||0,d=jn(e,"ann-"+n,"vertical","var(--semiotic-primary, #6366f1)");return(0,hu.jsxs)("g",{opacity:e.opacity,children:[d.def&&(0,hu.jsx)("defs",{children:d.def}),(0,hu.jsx)("rect",{x:0,y:Math.min(c,u),width:r.width||0,height:Math.abs(u-c),fill:d.fill,fillOpacity:e.fillOpacity??.1}),e.label&&(0,hu.jsx)(Qt,{x:(r.width||0)-4,y:(o=c,a=u,Math.max(Math.min(o,a),0)+16),textAnchor:"end",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+n)}case"x-band":{const t=r.scales?.x??r.scales?.time,i=t?.domain?.(),o=e.x0??i?.[0],a=e.x1??i?.[1],s=null!=o&&t?t(o):null,l=null!=a&&t?t(a):null;if(null==s||null==l)return null;const c=jn(e,"ann-"+n,"horizontal","var(--semiotic-primary, #6366f1)");return(0,hu.jsxs)("g",{opacity:e.opacity,children:[c.def&&(0,hu.jsx)("defs",{children:c.def}),(0,hu.jsx)("rect",{x:Math.min(s,l),y:0,width:Math.abs(l-s),height:r.height||0,fill:c.fill,fillOpacity:e.fillOpacity??.1}),e.label&&(0,hu.jsx)(Qt,{x:Math.min(s,l)+4,y:16,textAnchor:"start",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+n)}case"envelope":{const t=r.data||[];if(2>t.length)return null;const i=r.xAccessor||"x",o=r.scales?.x??r.scales?.time,a=r.scales?.y??r.scales?.value;if(!o||!a)return null;const s=e.upperAccessor||"upperBounds",l=e.lowerAccessor||"lowerBounds",c=e.filter,u=t.filter(e=>null!=e[s]&&null!=e[l]&&!(c&&!c(e))).sort((e,t)=>e[i]-t[i]);if(2>u.length)return null;const d=fu[r.curve||"linear"]||ru.curveLinear,h=(0,ru.area)().x(e=>o(e[i])).y0(e=>a(e[l])).y1(e=>a(e[s])).curve(d)(u);if(!h)return null;const f=e.fill||"#6366f1";return(0,hu.jsxs)("g",{children:[(0,hu.jsx)("path",{d:h,fill:f,fillOpacity:e.fillOpacity??.15,stroke:"none"}),e.label&&u.length>0&&(0,hu.jsx)("text",{x:o(u[u.length-1][i])+4,y:a(u[u.length-1][s])-4,fill:f,fontSize:11,children:e.label})]},"ann-"+n)}case"anomaly-band":{const t=r.data||[];if(2>t.length)return null;const i=r.yAccessor||"y",o=r.scales?.x??r.scales?.time,a=r.scales?.y??r.scales?.value;if(!o||!a)return null;const s=t.map(e=>e[i]).filter(e=>null!=e&&isFinite(e));if(2>s.length)return null;const l=s.reduce((e,t)=>e+t,0)/s.length,c=s.reduce((e,t)=>e+(t-l)**2,0)/s.length,u=Math.sqrt(c),d=e.threshold??2,h=l-d*u,f=!1!==e.showBand,p=e.fill||"#6366f1",m=e.fillOpacity??.1,g=e.anomalyColor||"#ef4444",y=e.anomalyRadius??6,v=a(l+d*u),b=a(h),x=t.filter(e=>{const t=e[i];return null!=t&&Math.abs(t-l)>d*u});return(0,hu.jsxs)("g",{children:[f&&(0,hu.jsx)("rect",{x:0,y:Math.min(v,b),width:r.width||0,height:Math.abs(b-v),fill:p,fillOpacity:m}),x.map((e,t)=>{const n=fn(e,r),i=pn(e,r);return null==n||null==i?null:(0,hu.jsx)("circle",{cx:n,cy:i,r:y,fill:g,fillOpacity:.7,stroke:g,strokeWidth:1.5},"anomaly-"+t)}),e.label&&(0,hu.jsx)("text",{x:(r.width||0)-4,y:Math.min(v,b)-4,textAnchor:"end",fill:p,fontSize:11,children:e.label})]},"ann-"+n)}case"forecast":{const t=r.data||[];if(3>t.length)return null;const o=r.xAccessor||"x",a=r.yAccessor||"y",s=r.scales?.x??r.scales?.time,l=r.scales?.y??r.scales?.value;if(!s||!l)return null;const c=t.map(e=>[e[o],e[a]]).filter(e=>null!=e[0]&&null!=e[1]&&isFinite(e[0])&&isFinite(e[1])).sort((e,t)=>e[0]-t[0]);if(3>c.length)return null;let u;if("polynomial"===(e.method||"linear")){const t=hn(c,e.order||2).equation;u=e=>t.reduce((t,n,r)=>t+n*Math.pow(e,r),0)}else{const e=function(e){const t=e.length;let n=0,r=0,i=0,o=0;for(const[t,a]of e)n+=t,r+=a,i+=t*t,o+=t*a;const a=t*i-n*n;if(1e-12>Math.abs(a))return null;const s=(t*o-n*r)/a,l=(r-s*n)/t;return e=>l+s*e}(c);if(!e)return null;u=e}const d=c.length,{se:h,meanX:f,ssX:p}=function(e,t){const n=e.length,r=e.map(([e,n])=>n-t(e)).reduce((e,t)=>e+t*t,0),i=Math.sqrt(r/Math.max(n-2,1)),o=e.reduce((e,t)=>e+t[0],0)/n,a=e.reduce((e,t)=>e+(t[0]-o)**2,0);return{se:i,meanX:o,ssX:a}}(c,u),m=.99>(i=e.confidence??.95)?.95>i?.9>i?1:1.645:1.96:2.576,g=e.steps??5,y=c[d-1][0],v=(y-c[0][0])/Math.max(d-1,1),b=[];for(let e=1;g>=e;e++)b.push(y+e*v);const x=[];for(const e of b){const t=u(e),n=h*Math.sqrt(1+1/d+(p>0?(e-f)**2/p:0))*m;x.push({x:e,yCenter:t,yUpper:t+n,yLower:t-n})}const w=`M${x.map(e=>`${s(e.x)},${l(e.yUpper)}`).join(" L")} L${x.slice().reverse().map(e=>`${s(e.x)},${l(e.yLower)}`).join(" L")} Z`,k=x.map(e=>`${s(e.x)},${l(e.yCenter)}`).join(" "),S=`${s(y)},${l(u(y))}`,M=e.strokeColor||"#6366f1";return(0,hu.jsxs)("g",{children:[(0,hu.jsx)("path",{d:w,fill:e.fill||"#6366f1",fillOpacity:e.fillOpacity??.15,stroke:"none"}),(0,hu.jsx)("polyline",{points:`${S} ${k}`,fill:"none",stroke:M,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray??"6,3"}),e.label&&x.length>0&&(0,hu.jsx)("text",{x:s(x[x.length-1].x)+4,y:l(x[x.length-1].yCenter)-4,fill:M,fontSize:11,children:e.label})]},"ann-"+n)}case"widget":{let i,o;if(null!=e.px&&null!=e.py)i=e.px,o=e.py;else{const t=yn(e,n,r);if(!t)return null;i=t.x,o=t.y}if(!vn(i,o,r))return null;const a=e.dx??0,s=e.dy??0,l=e.width??32,c=e.height??32,u=e.content??(0,hu.jsx)("span",{style:{fontSize:18,cursor:"default"},title:e.label||"Info",children:"ℹ️"});return(0,hu.jsx)("foreignObject",{x:i+a-l/2,y:o+s-c/2,width:l,height:c,style:{overflow:"visible",pointerEvents:"auto"},children:(0,hu.jsx)("div",{...Kt(e,t),style:{width:l,height:c,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},"ann-"+n)}case"text":{const t=yn(e,n,r);if(!t)return null;const{x:i,y:o}=t,a=i+(e.dx||0),s=o+(e.dy||0),l=e.color||"var(--semiotic-text, #333)",c=(0,hu.jsx)("text",{x:a,y:s,fill:l,fontSize:e.fontSize||11,opacity:e.opacity,strokeDasharray:e.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:e.label});return!0!==e._redundantConnector?eu.cloneElement(c,{key:"ann-text-"+n}):(0,hu.jsxs)("g",{opacity:e.opacity,strokeDasharray:e.strokeDasharray,children:[(0,hu.jsx)("line",{x1:i,y1:o,x2:a,y2:s,stroke:l,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),eu.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},"ann-text-"+n)}case"frame-text":return(0,hu.jsx)(Cn,{annotation:e,width:r.width||0,height:r.height||0},"ann-frame-text-"+n);case"category-highlight":{const t=e.category;if(null==t)return null;const i=e=>"function"==typeof e&&"function"==typeof e.bandwidth,o=r.scales?.o,a=r.scales?.x,s=r.scales?.y,l=i(o)?o:i(a)?a:i(s)?s:null;if(!l)return null;const c=l(t+"");if(null==c)return null;const u=l.bandwidth(),d=e.color||"var(--semiotic-primary, #4589ff)",h=e.opacity??.15,f=e.label;return(0,hu.jsxs)("g",(r.projection?"vertical"===r.projection:l===a)?{children:[(0,hu.jsx)("rect",{x:c,y:0,width:u,height:r.height||0,fill:d,fillOpacity:h}),f&&(0,hu.jsx)(Qt,{x:c+u/2,y:16,textAnchor:"middle",fill:d,fontSize:12,fontWeight:"bold",text:f,background:e.labelBackground??"none"})]}:{children:[(0,hu.jsx)("rect",{x:0,y:c,width:r.width||0,height:u,fill:d,fillOpacity:h}),f&&(0,hu.jsx)(Qt,{x:12,y:c+u/2,dominantBaseline:"middle",fill:d,fontSize:12,fontWeight:"bold",text:f,background:e.labelBackground??"none"})]},"ann-"+n)}default:return null}var i,o,a}}(0,C),M,i)},[v,S,M,t,n,j,C,A]),N=a||s||l||u||y||P&&P.length>0,E=(0,Xc.useId)(),{titleId:I,descId:T,labelledBy:D}=function(e){const t=(e+"").replace(/[^a-zA-Z0-9_-]/g,"_"),n=/^[A-Za-z_]/.test(t)?t:"c"+t,r=n+"-semiotic-title",i=n+"-semiotic-desc";return{titleId:r,descId:i,labelledBy:`${r} ${i}`}}(c||w||E);return N?(0,Pu.jsxs)("svg",{role:"img","aria-labelledby":D,width:r,height:i,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[(0,Pu.jsx)("title",{id:I,children:Jn(s,"Geographic chart")}),(0,Pu.jsx)("desc",{id:T,children:er(s,l,{familyPhrase:"geographic data visualization",fallback:"geographic data visualization"})}),(0,Pu.jsxs)("g",{transform:"translate("+o.left+","+o.top+")",children:[P,y]}),(0,Pu.jsx)(Qn,{title:s,totalWidth:r,marginTop:o.top}),Kn({legend:u,totalWidth:r,totalHeight:i,margin:o,legendPosition:m,title:s,legendLayout:g,legendHoverBehavior:d,legendClickBehavior:h,legendHighlightedCategory:f,legendIsolatedCategories:p})]}):null}function nr(e,t="#4e79a7"){return xn(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function rr(e){if(!1!==e?.interactive)return e?.style?.cursor}function ir(e,t){if(!e)return;const n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function or(e,t,n){const r=rr(t);return r&&null!=e&&!1!==e?(0,Tu.jsx)("g",{style:{cursor:r},"data-semiotic-mark-cursor":r,children:e},n):e}function ar(e,t,n,r){const i=e.getContext("2d");if(!i)return null;const{effectiveDprX:o,effectiveDprY:a}=function(e,t,n){const r=Math.round(t[0]*n),i=Math.round(t[1]*n),o=0===t[0]?n:r/t[0],a=0===t[1]?n:i/t[1],s=t[0]+"px",l=t[1]+"px";return e.style.width!==s&&(e.style.width=s),e.style.height!==l&&(e.style.height=l),e.width!==r&&(e.width=r),e.height!==i&&(e.height=i),{effectiveDprX:o,effectiveDprY:a}}(e,t,r);return i.setTransform(o,0,0,a,0,0),i.translate(n.left,n.top),i}function sr(e,t){if("undefined"==typeof window)return 1;const n=window.devicePixelRatio||1,r="undefined"!=typeof window&&("function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches||768>Math.min(window.innerWidth||1/0,window.innerHeight||1/0))?2:3,i="number"==typeof e&&e>0?e:r;if(!t)return Math.max(1,Math.min(n,i));const[o,a]=t,s=Math.min(Math.sqrt(8388608/(o*a)),16384/Math.max(o,a));return Math.max(1>s?0:1,Math.min(n,i,s))}function lr(e){const{cancelRender:t,dirtyRef:n,frameRuntime:r,manageFrameRuntime:i,maxDevicePixelRatio:o,scheduleRender:a}=e,s=(0,Hu.useRef)(null),l=(0,Hu.useRef)(null),c=(0,Hu.useRef)(!1),u=(0,Hu.useRef)(!1),d=(0,Hu.useRef)(!1);return qu(()=>{!u.current&&(u.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),function(e){const{hydrated:t,wasHydratingFromSSR:n,storeRef:r,dirtyRef:i,renderFnRef:o,cancelRender:a,cleanup:s}=e;Ou(()=>{if(!t)return;const e=r.current;t&&n&&e?.cancelIntroAnimation?.(),!n&&e?.sceneNodes&&e.sceneNodes.length>0&&e?.markStylePaintPending?e.markStylePaintPending():i.current=!0,a?.(),o.current()},[t,n]);const l=(0,_u.useRef)(s);l.current=s,(0,_u.useEffect)(()=>()=>l.current?.(),[])}({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),(0,Hu.useEffect)(()=>{if(!1!==i)return r.subscribe(()=>{r.isActive?(n.current=!0,a()):t()})},[t,n,r,i,a]),(0,Hu.useEffect)(()=>function(){function e(){n||(r(),t=null,c.current=!0,a(),queueMicrotask(()=>{n||i()}))}if("undefined"==typeof window||"function"!=typeof window.matchMedia)return()=>{};let t=null,n=!1;const r=()=>{t&&("function"==typeof t.removeEventListener?t.removeEventListener("change",e):"function"==typeof t.removeListener&&t.removeListener(e))},i=()=>{const n=`(resolution: ${window.devicePixelRatio||1}dppx)`;t=window.matchMedia(n),t.media.includes("resolution")?"function"==typeof t.addEventListener?t.addEventListener("change",e):"function"==typeof t.addListener&&t.addListener(e):t=null};return i(),()=>{n=!0,r(),t=null}}(),[a]),(0,Hu.useEffect)(()=>{d.current?(c.current=!0,a()):d.current=!0},[o,a]),{canvasRef:s,interactionCanvasRef:l,resolutionDirtyRef:c}}function cr({children:e,size:t,margin:n,backdropFill:r,overflowVisible:i=!1}){return e||r?(0,$u.jsxs)("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:i?"visible":void 0},children:[r&&"transparent"!==r?(0,$u.jsx)("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:t[0],height:t[1],fill:r}):null,(0,$u.jsx)("g",{transform:`translate(${n.left},${n.top})`,children:e})]}):null}function ur(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(!Object.is(e[r],t[r]))return!1}return!0}function dr(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function hr(e){if(null===e||"object"!=typeof e)return!1;if(Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function fr(e){const{background:t,hasBackgroundGraphics:n=!1,themeBackground:r=""}=e;return"transparent"===t?null:n?t||null:t||(r&&"transparent"!==r?r:"")||null}function pr({hoverPoint:e}){let t="";if(e){const n=e.data||e;t="object"==typeof n?"Data point: "+Object.entries(n).filter(([,e])=>"object"!=typeof e&&"function"!=typeof e).map(([e,t])=>`${e}: ${t}`).join(", "):"Data point: "+n}return(0,Xu.jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:Zu,children:t})}function mr(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[n,r]of Object.entries(e))n.startsWith("_")||null!=r&&""!==r&&("number"==typeof r?Number.isFinite(r)&&(t[n]=r):"string"==typeof r?t[n]=r:"boolean"==typeof r?t[n]=r+"":r instanceof Date&&(t[n]=r.toISOString().slice(0,10)));return t}function gr(e){return e&&"object"==typeof e?e:{}}function yr(e){return gr(e.accessibility).tableFields??e.accessibleDatum??e.datum}function vr({accessibleTable:e,children:t}){return"object"!=typeof e?t:"undefined"==typeof document?null:(0,Qu.jsx)(Vu.Suspense,{fallback:null,children:(0,Qu.jsx)(Ju,{target:e.portalTarget,children:t})})}function br(e,t){if(!e||0===e.length)return t+", empty";const n={};for(const t of e){if(null===t?.datum)continue;const e=t.type+"";n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return t+", empty";const r=[],i={point:"points",line:"lines",area:"areas",rect:"bars",heatcell:"cells",circle:"nodes",candlestick:"candlesticks",wedge:"wedges",arc:"arcs",geoarea:"regions"},o=["point","line","area","rect","heatcell","circle","candlestick","wedge","arc","geoarea"],a=Object.keys(n).sort((e,t)=>{const n=o.indexOf(e),r=o.indexOf(t);return(-1===n?999:n)-(-1===r?999:r)});for(const e of a)r.push(`${n[e]} ${i[e]||e}`);return`${t}, ${r.join(", ")}`}function xr({scene:e,chartType:t,tableId:n,chartTitle:r}){const[i,o]=Vu.useState(!1),[a,s]=Vu.useState(5),l=Uu.useContext(Yu),c=l?.visible??!1,u=i||c,d=Vu.useRef(null),h=r?"Data summary for "+r:n?`Data summary for ${t} ${n}`:"Data summary for "+t;Vu.useEffect(()=>{u||s(5)},[u]);const f=Vu.useCallback(e=>{e.target===e.currentTarget&&(i||c||o(!0))},[i,c]),p=Vu.useCallback(e=>{c||d.current?.contains(e.relatedTarget)||o(!1)},[c]);if(!e||0===e.length)return n?(0,Qu.jsx)("span",{id:n,tabIndex:-1,style:Zu}):null;if(!u)return(0,Qu.jsx)("div",{id:n,className:td,tabIndex:-1,onFocus:f,style:Zu,role:"region","aria-label":h,children:(0,Qu.jsxs)("button",{type:"button",onClick:()=>o(!0),style:rd,children:["View data summary (",e.length," elements)"]})});const m=function(e){const t=[];if(!Array.isArray(e))return t;const n=e.some(e=>e&&("line"===e.type||"area"===e.type));for(const r of e)if(r&&"object"==typeof r&&null!==r.datum)try{switch(r.type){case"point":if(n)break;t.push({label:"Point",values:mr(yr(r))});break;case"line":case"area":{const e=yr(r),n=Array.isArray(e)?e:[],i="line"===r.type?"Line point":"Area point";for(const e of n)t.push({label:i,values:mr(e)});break}case"rect":{const e=yr(r),n=null!=e&&"object"==typeof e?e:{},i=n.category??r.group??"",o=n.value??n.__aggregateValue??n.total,a=mr(n);null==a.category&&""!==i&&(a.category=i+""),null==a.value&&null!=o&&(a.value="number"==typeof o||"string"==typeof o?o:o+""),t.push({label:"Bar",values:a});break}case"heatcell":{const e=mr(yr(r));null==e.value&&"number"==typeof r.value&&Number.isFinite(r.value)&&(e.value=r.value),t.push({label:"Cell",values:e});break}case"wedge":{const e=yr(r),n=mr(e);if(null==n.category){const t=gr(e),r=t.category??t.label;null!=r&&(n.category=r+"")}t.push({label:"Wedge",values:n});break}case"circle":t.push({label:"Node",values:mr(yr(r))});break;case"arc":t.push({label:"Arc",values:mr(yr(r))});break;case"candlestick":t.push({label:"Candlestick",values:mr(yr(r))});break;case"geoarea":{const e=gr(yr(r)),n=mr(e);if(null==n.name){const t=gr(e.properties).name??e.name;null!=t&&(n.name=t+"")}t.push({label:"Region",values:n});break}}}catch{}return t}(e),g=function(e){const t=new Map;for(const n of e??[])for(const[e,r]of Object.entries(n?.values??{})){if(null==r||""===r)continue;let n=t.get(e);if(n||(n={count:0,min:1/0,max:-1/0,sum:0,strings:new Set},t.set(e,n)),"number"==typeof r){if(!Number.isFinite(r))continue;n.count++,n.sum+=r,n.min>r&&(n.min=r),r>n.max&&(n.max=r)}else"object"!=typeof r&&"function"!=typeof r&&n.strings.add(r+"")}return Array.from(t,([e,t])=>{if(t.count)return{name:e,count:t.count,numeric:!0,min:t.min,max:t.max,mean:t.sum/t.count};const n=Array.from(t.strings);return{name:e,count:n.length,numeric:!1,uniqueValues:n.slice(0,5)}}).filter(e=>e.count>0)}(m),y=function(e,t){const n=[e+" data points."];for(const e of t)if(e.numeric)n.push(`${e.name}: ${Ku(e.min)} to ${Ku(e.max)}, mean ${Ku(e.mean)}.`);else{const t=e.uniqueValues,r=t.length>3?`${t.slice(0,3).join(", ")}… (${e.count} unique)`:t.join(", ");n.push(`${e.name}: ${r}.`)}return n.join(" ")}(m.length,g),v=Math.min(a,m.length),b=m.slice(0,v),x=m.length-v,w=new Set;for(const e of b)for(const t of Object.keys(e.values))w.add(t);const k=Array.from(w);return(0,Qu.jsxs)("div",{ref:d,id:n,className:nd,tabIndex:-1,onBlur:p,style:id,role:"region","aria-label":h,children:[(0,Qu.jsx)("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{c&&l&&l.setVisible(!1),o(!1)},"aria-label":"Close data summary",style:ad,children:"×"}),(0,Qu.jsx)("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:od,children:y}),(0,Qu.jsxs)("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Sample data for "+t,style:sd,children:[(0,Qu.jsx)("caption",{className:"semiotic-accessible-data-table-caption",style:ud,children:x>0?`First ${v} of ${m.length} data points`:`All ${m.length} data points`}),(0,Qu.jsx)("thead",{children:(0,Qu.jsxs)("tr",{children:[(0,Qu.jsx)("th",{style:ld,children:"type"}),k.map(e=>(0,Qu.jsx)("th",{style:ld,children:e},e))]})}),(0,Qu.jsx)("tbody",{children:b.map((e,t)=>(0,Qu.jsxs)("tr",{children:[(0,Qu.jsx)("td",{style:cd,children:e.label}),k.map(t=>{return(0,Qu.jsx)("td",{style:cd,children:(n=e.values[t],null==n||""===n?"—":"number"==typeof n?Number.isNaN(n)?"—":Ku(n):"boolean"==typeof n?n?"true":"false":"object"==typeof n?"—":n+"")},t);var n})]},t))})]}),x>0&&(0,Qu.jsxs)("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>s(e=>e+25),style:dd,children:["Show ",Math.min(25,x)," more"," ",1===x?"row":"rows"," (",x," remaining)"]})]})}function wr({summary:e}){return e?(0,Qu.jsx)("div",{role:"note",style:Zu,children:e}):null}function kr({tableId:e}){return(0,Qu.jsx)("a",{href:"#"+e,style:Zu,onClick:t=>{t.preventDefault();const n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:e=>{Object.assign(e.currentTarget.style,{position:"absolute",width:"auto",height:"auto",overflow:"visible",clip:"auto",whiteSpace:"normal",padding:"4px 8px",background:"var(--semiotic-bg, #fff)",color:"var(--semiotic-text, #000)",border:"2px solid var(--semiotic-focus, #005fcc)",borderRadius:"4px",zIndex:"10",fontSize:"12px",top:"4px",left:"4px"})},onBlur:e=>{const t=e.currentTarget;t.removeAttribute("style"),Object.assign(t.style,Zu)},children:"Skip to data table"})}function Sr({active:e,hoverPoint:t,margin:n,size:r,shape:i="circle",width:o,height:a,pathData:s}){if(!e||!t)return null;const l=t.x+n.left,c=t.y+n.top;let u;if("geoarea"!==i&&"path"!==i||!s)if("rect"===i&&null!=o&&null!=a){const e=Math.max(o,4),t=Math.max(a,4);u=(0,fd.jsx)("rect",{x:l-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:pd,strokeWidth:2,strokeDasharray:"4,2"})}else u=(0,fd.jsx)("circle","wedge"===i?{cx:l,cy:c,r:12,fill:"none",stroke:pd,strokeWidth:2.5,strokeDasharray:"6,3"}:{cx:l,cy:c,r:8,fill:"none",stroke:pd,strokeWidth:2,strokeDasharray:"4,2"});else u=(0,fd.jsx)("g",{transform:`translate(${n.left},${n.top})`,children:(0,fd.jsx)("path",{d:s,fill:"none",stroke:pd,strokeWidth:2.5,strokeDasharray:"6,3"})});return(0,fd.jsx)("svg",{style:{position:"absolute",left:0,top:0,width:r[0],height:r[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:u})}function Mr({chrome:e="default",className:t="",style:n,children:r,...i}){const o="default"===e?{...vd,...n}:n;return(0,yd.jsx)("div",{...i,"data-semiotic-tooltip-chrome":!0,className:("semiotic-tooltip "+t).trim(),style:o,children:r})}function jr(e){return e.ownsChrome=!0,e}function Ar(e){if("string"!=typeof e)return null!=e;const t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function Cr(e){if(!gd.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const n=e.props,r=n["data-semiotic-tooltip-chrome"];if(null!=r&&!1!==r&&"false"!==r)return!0;const i=n.style;if(i&&"object"==typeof i){if(Ar(i.background))return!0;if(Ar(i.backgroundColor))return!0}return!1}function Rr({x:e,y:t,containerWidth:n,containerHeight:r,margin:i,children:o,className:a="stream-frame-tooltip",zIndex:s=1}){const l=Number.isFinite(e)&&Number.isFinite(t),c=md.useRef(null),[u,d]=md.useState(null);md.useLayoutEffect(()=>{const e=c.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect();Number.isFinite(t.width)&&Number.isFinite(t.height)&&d(e=>e&&.5>Math.abs(e.width-t.width)&&.5>Math.abs(e.height-t.height)?e:{width:t.width,height:t.height})};if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[a,n,r,l]);let h;h=u?`translate(${u.width+12>n-e?"calc(-100% - 12px)":"12px"}, ${u.height+12>r-t?"calc(-100% - 4px)":"4px"})`:`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${.3*r>t?"4px":"calc(-100% - 4px)"})`;const f=Cr(o),p=f?null:vd;return l?(0,xd.jsx)("div",{ref:c,className:f?a:(a+" semiotic-tooltip").trim(),style:{...p||{},position:"absolute",left:i.left+e,top:i.top+t,transform:h,pointerEvents:"none",zIndex:s,width:"max-content"},children:o}):null}function Lr(e){switch(e){case"monotoneX":return Sd.curveMonotoneX;case"monotoneY":return Sd.curveMonotoneY;case"cardinal":return Sd.curveCardinal;case"catmullRom":return Sd.curveCatmullRom;case"step":return Sd.curveStep;case"stepBefore":return Sd.curveStepBefore;case"stepAfter":return Sd.curveStepAfter;case"basis":return Sd.curveBasis;case"natural":return Sd.curveNatural;default:return null}}function Pr(e,t,n){if(null==t)return n;if(xn(t)){const r=function(e,t){const n=e.background??"transparent",r=e.stroke??"#000",i="transparent"===n||"none"===n?n:Nt(t,n)||n,o=Nt(t,r)||r||"#000",a="undefined"!=typeof window&&window.devicePixelRatio||1,s=`${wn(e)}|${i}|${o}@${a}`,l=au.get(s);if(void 0!==l)return l;const c=function(e={},t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45}=e,s={background:n,stroke:r,lineWidth:i,spacing:o,angle:a},l=Math.max(8,Math.ceil(2*o));let c;try{c=function(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(iu||(iu=document.createElement("canvas")),iu.width=e,iu.height=e,iu)}(l)}catch{return bn(s)}const u=c.getContext("2d");if(!u)return bn(s);n&&"transparent"!==n?(u.fillStyle=n,u.fillRect(0,0,l,l)):u.clearRect(0,0,l,l),u.strokeStyle=r,u.lineWidth=i,u.lineCap="square";const d=a*Math.PI/180;if(45===a||-45===a){const e=a>0?1:-1;for(let t=-l;2*l>=t;t+=o)u.beginPath(),u.moveTo(t,0),u.lineTo(t+e*l,l),u.stroke()}else{u.save(),u.translate(l/2,l/2),u.rotate(d);const e=2*l;for(let t=-e;e>=t;t+=o)u.beginPath(),u.moveTo(-e,t),u.lineTo(e,t),u.stroke();u.restore()}return(t||u).createPattern(c,"repeat")}({background:i,stroke:o,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle},t),u=xn(c)?null:c;return au.set(s,u),u}(t,e);return r||t.background&&Nt(e,t.background)||n}return"string"!=typeof t?t:Nt(e,t)||n}function Nr(e,t){if(null==t)return;const n=Pr(e,t,"");return""===n?void 0:n}function Er(e,t,n,r,i,o,a){const s=t.stops.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity)));if(2>s.length)return null;const l=e.createLinearGradient(r,i,o,a);for(const t of s)l.addColorStop(Math.max(0,Math.min(1,t.offset)),Ir(e,t,n));return l}function Ir(e,t,n){const r=t.color??n,i=Nt(e,r)||r;if(null==t.opacity)return i;const o=Math.max(0,Math.min(1,t.opacity)),[a,s,l]=function(e,t){const n=e.fillStyle,r="#010203";try{e.fillStyle=r,e.fillStyle=t}catch{return e.fillStyle=n,[78,121,167]}const i=e.fillStyle;if(e.fillStyle=n,"string"!=typeof i)return[78,121,167];if(i.toLowerCase()===r&&t.trim().toLowerCase()!==r)return[78,121,167];if(i.startsWith("#"))return[parseInt(i.slice(1,3),16),parseInt(i.slice(3,5),16),parseInt(i.slice(5,7),16)];const o=i.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return o?[+o[1],+o[2],+o[3]]:[78,121,167]}(e,i);return`rgba(${a},${s},${l},${o})`}function Tr(e){return!(!e._pulseIntensity||0>=e._pulseIntensity)}function Dr(e,t,n,r=.35){Tr(t)&&(e.globalAlpha=t._pulseIntensity*r,e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",n?e.fill(n):e.fill())}function zr(e,t,n){let r=n;for(const n of t)"lesser"===n.thresholdType?n.value>e&&(r=n.color):e>n.value&&(r=n.color);return r}function _r(e,t,n,r){if(2>e.length||t.length!==e.length||0===n.length)return[];const i=[],o=(e,t,n)=>{const r=i[i.length-1];r?.color===e?r.path.push(n):i.push({color:e,path:[t,n]})};for(let i=1;e.length>i;i++){const[a,s]=e[i-1],[l,c]=e[i],u=t[i-1],d=t[i]-u,h=[0,...0===d?[]:n.map(({value:e})=>(e-u)/d).filter(e=>e>0&&1>e&&Number.isFinite(e)).sort((e,t)=>e-t).filter((e,t,n)=>0===t||e!==n[t-1]),1];for(let e=1;h.length>e;e++){const t=h[e-1],i=h[e];o(zr(u+d*((t+i)/2),n,r),[a+(l-a)*t,s+(c-s)*t],[a+(l-a)*i,s+(c-s)*i])}}return i}function Or(e,t,n,r,i,o){if(2>t.length)return;const a=[0];for(let e=1;t.length>e;e++){const n=t[e][0]-t[e-1][0],r=t[e][1]-t[e-1][1];a.push(a[e-1]+Math.sqrt(n*n+r*r))}const s=a[a.length-1];if(0===s)return;const l=Math.min(.2*s,40);e.strokeStyle=n,e.lineWidth=r,e.lineCap=o;for(let n=0;t.length-1>n;n++){const r=(a[n]+a[n+1])/2;let o=i;l>r&&(o*=r/l),l>s-r&&(o*=(s-r)/l),e.globalAlpha=Math.max(0,o),e.beginPath(),e.moveTo(t[n][0],t[n][1]),e.lineTo(t[n+1][0],t[n+1][1]),e.stroke()}}function Fr(e,t,n,r,i){if(0>=t.size)return;const o=t.glyph;if(!o||!o.parts?.length)return;const a=wt(o,t.size);if(0>=a.scale)return;const s=(t.style.opacity??1)*(t._decayOpacity??1);if(0>=s)return;const l=t=>{const n=Pr(e,t,t);return"string"==typeof n?n:t},c=t.color??("string"==typeof t.style.fill?t.style.fill:void 0);e.save(),e.translate(n,r),t.rotation&&e.rotate(t.rotation),e.translate(a.offsetX,a.offsetY),e.scale(a.scale,a.scale),e.globalAlpha=i*s*(t.style.fillOpacity??1);const u=jt(o,t.fraction??1,t.fractionStart??0,t.fractionDirection??"horizontal");u&&t.ghostColor&&Ct(e,o,c,t.accent,t.ghostColor,l),u&&(e.beginPath(),e.rect(u.x,u.y,u.width,u.height),e.clip()),Ct(e,o,c,t.accent,void 0,l),e.restore()}function Wr([e,t,n]){const r=1<<n;return[e-Math.floor(e/r)*r,t,n]}function Br(e,t,n,r,i){return"function"==typeof e?e(t,n,r,i):e.replace("{z}",t+"").replace("{x}",n+"").replace("{y}",r+"").replace("{r}",i>1?"@2x":"")}function Hr(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):256}function $r(e){let t=0;for(let n=1;e.length>n;n++){const r=e[n][0]-e[n-1][0],i=e[n][1]-e[n-1][1];t+=Math.sqrt(r*r+i*i)}return t}function qr(e,t){let n=0;for(let r=1;e.length>r;r++){const i=e[r][0]-e[r-1][0],o=e[r][1]-e[r-1][1],a=Math.sqrt(i*i+o*o);if(n+a>=t||r===e.length-1){const s=a>0?(t-n)/a:0,l=a>.001?a:1;return{x:e[r-1][0]+i*s,y:e[r-1][1]+o*s,nx:-o/l,ny:i/l}}n+=a}const r=e[e.length-1];return{x:r[0],y:r[1],nx:0,ny:0}}function Gr(e,t){return"touch"===t?Math.max(e,24):e}function Vr(...e){const t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:Ld.createElement(Ld.Fragment,null,...t)}function Ur({value:e,children:t}){const n=(bd??(bd=Pd.createContext(null)),bd);return(0,Nd.jsx)(n.Provider,{value:e,children:t})}function Yr(e,t){return null!=e?(0,Nd.jsx)(Ur,{value:t,children:e}):e}function Xr(e,t){const n="function"==typeof e?e(t.datum??null,t):e;return(r=n)&&"object"==typeof r&&"string"==typeof r.id&&"function"==typeof r.cacheKey&&"function"==typeof r.drawCanvas&&"function"==typeof r.renderStaticSVG?n:void 0;var r}function Zr(e,t){if("undefined"!=typeof process&&"production"===process.env?.NODE_ENV)return;const n=`${e}:${t}`;Ed.has(n)||(Ed.add(n),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}function Kr(e){if(!e)return;const t=[];for(const n of e)if("point"===n.type)t.push(n);else if("glyph"===n.type){const e=n,r=At(e.glyph,e.size);t.push({pointId:e.pointId,x:e.x+r.centerDx,y:e.y+r.centerDy,r:r.radius})}return t}function Qr(e,t){for(const n of t){const t=e.find(e=>e.lower===n);if(t)return t}}function Jr(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const n=t.maxEntries??6,r=!1!==t.skipPositional,i=[];for(const[t,n]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;const e=t.toLowerCase();if(r&&zd.has(e))continue;if(null==n)continue;const o=typeof n;("string"===o||"number"===o||"boolean"===o||n instanceof Date)&&i.push({key:t,lower:e,value:n})}if(0===i.length)return{entries:[]};let o=i.findIndex(e=>Id.includes(e.lower));const a=o>=0;0>o&&(o=i.findIndex(e=>"id"===e.lower)),0>o&&(o=i.findIndex(e=>"string"==typeof e.value));const s=0>o?void 0:i[o],l=i.filter((e,t)=>t!==o&&(!a||"id"!==e.lower)),c=Qr(l,Td),u=Qr(l,Dd),d=[];c&&d.push({key:c.key,value:c.value}),u&&d.push({key:u.key,value:u.value});for(const e of l){if(d.length>=n)break;Td.includes(e.lower)||Dd.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}function ei(e,t){return"function"==typeof t?t(e):e[t]}function ti(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}if(e instanceof Date)return e.toLocaleDateString();if("object"==typeof e&&null!==e){if(void 0!==e.id)return e.id+"";if(void 0!==e.name)return e.name+"";try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return e+""}function ni(e={}){const{fields:t,title:n,format:r,style:i={},className:o=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let a;const s=[];if(n){const t=ei(e,n);a=ti(t,r)}if(t&&t.length>0)t.forEach(t=>{let n,i,o;"string"==typeof t?(n=t,i=t,o=r):(n=t.label,i=t.accessor||t.key||"",o=t.format||r);const a=ei(e,i);s.push({label:n,value:ti(a,o)})});else if(!n){const t=["value","y","name","id","label"];for(const n of t)if(void 0!==e[n]){a=ti(e[n],r);break}if(!a){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(a=ti(e[t[0]],r))}}return(0,_d.jsxs)(Mr,{className:o,style:i,children:[a&&(0,_d.jsx)("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:a}),s.map((e,t)=>(0,_d.jsxs)("div",{style:{marginTop:0===t&&a?"4px":0},children:[e.label&&(0,_d.jsxs)("span",{children:[e.label,": "]}),e.value]},t))]})}}function ri(e={}){const{fields:t=[],title:n,format:r,style:i={},className:o="",showLabels:a=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const l=[];if(n){const t=ei(e,n);l.push({value:ti(t,r)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let n,i,o;"string"==typeof t?(n=t,i=t,o=r):(n=t.label,i=t.accessor||t.key||"",o=t.format||r);const s=ti(ei(e,i),o);l.push({label:a?n:void 0,value:s})});else{const t=Jr(e,{skipPositional:!1});null!=t.title&&l.push({label:void 0,value:ti(t.title,r),bold:!0}),t.entries.forEach(e=>{l.push({label:a?e.key:void 0,value:ti(e.value,r)})})}return Array.isArray(l)&&0!==l.length?(0,_d.jsx)(Mr,{className:("semiotic-tooltip-multiline "+o).trim(),style:i,children:l.map((e,t)=>(0,_d.jsxs)("div",{style:{marginBottom:l.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&(0,_d.jsxs)("strong",{children:[e.label,s]}),e.value]},t))}):null}}function ii(e){if(!0!==e){if("function"==typeof e){const t=e;return e=>{const n=!0===e?.__semioticHoverData||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType);let r=Array.isArray(i=n?e.data??{}:e)?i[0]:i;var i;if(!r)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof r?.x0&&"number"==typeof r?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof r?.sankeyWidth)&&r.data&&"object"==typeof r.data&&(r=r.data),!r)return null;if(n&&(void 0!==e.allSeries||void 0!==e.xValue)){const t={...r};void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),r=t}const o=t(r);return null==o?null:Cr(o)?o:(0,_d.jsx)(Mr,{children:o})}}if(!1===e||void 0===e)return!1;if(function(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}(e)){if("function"==typeof e.content)return ii(e.content);"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');const t=ri();return ii(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){const t=ni(e);return ii(e=>t(e))}if("multi"===e){"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');const e=ri();return ii(t=>e(t))}return ni()}}function oi({data:e}){if(!e)return null;if(e.properties)return(0,Od.jsx)("div",{className:"semiotic-tooltip",style:vd,children:(0,Od.jsx)("div",{style:{fontWeight:600},children:e.properties.name||e.properties.NAME||e.properties.id||"Feature"})});const t=null!=e.data?e.data:e;if(!t||"object"!=typeof t)return null;const n=Jr(t),r=null!=n.title?n.title+"":null;return null==r&&0===n.entries.length?null:(0,Od.jsxs)("div",{className:"semiotic-tooltip",style:vd,children:[null!=r&&(0,Od.jsx)("div",{style:{fontWeight:600,marginBottom:n.entries.length?2:0},children:r}),n.entries.map(e=>{return(0,Od.jsxs)("div",{children:[(0,Od.jsxs)("span",{style:{opacity:.7},children:[e.key,": "]}),(0,Od.jsx)("span",{style:{fontWeight:600},children:(t=e.value,null==t?"–":"number"==typeof t?Math.abs(t)>9999?t.toLocaleString():t+"":t instanceof Date?t.toLocaleDateString():t+"")})]},e.key);var t})]})}function ai(){if(null!==Wd)return Wd;if("undefined"==typeof window)return!1;const e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t="undefined"!=typeof navigator&&"number"==typeof navigator.hardwareConcurrency&&4>=navigator.hardwareConcurrency,n="undefined"!=typeof navigator&&"number"==typeof navigator.deviceMemory&&4>=navigator.deviceMemory;return Wd=e||t||n}function si(){return ai()?12:30}function li(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function ci(e){return e?e.getContext("2d"):null}function ui(e){const t=e.pointer.clientX-e.canvasRect.left-e.margin.left,n=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>n||n>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const r=ci(e.hitCanvasRef.current);if(!r)return{kind:"unavailable"};const i=Rt(e.scene,t,n,Gr(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,Gr(6,e.pointer.pointerType));if(!i)return{kind:"miss"};const{node:o}=i,a=o.datum,s=Array.isArray(a)?null:a?.properties?a:a?.data||a,l="point"===o.type?o.x:"geoarea"===o.type?o.centroid[0]:t,c="point"===o.type?o.y:"geoarea"===o.type?o.centroid[1]:n;return{kind:"hit",node:o,hover:{...s,...s?.properties||{},data:s,properties:s?.properties,__semioticHoverData:!0,x:l,y:c}}}function di(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"hover",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"focus"===s?.type&&t({type:"focus",datum:n,inputType:"touch"===s.inputType?"pointer":s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"hover-end",timestamp:l,chartType:o,chartId:a}))}function hi(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"click",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"activate"===s?.type&&t({type:"activate",datum:n,inputType:s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"click-end",timestamp:l,chartType:o,chartId:a}))}function fi(e){const t=e.datum;return{...t||{},...t?.properties||{},data:t,properties:t?.properties,x:e.x,y:e.y,__semioticHoverData:!0}}function pi(e,t,n,r){return"function"==typeof e?e({size:t,margin:n,scales:r}):e}function mi({graphics:e,size:t,margin:n,readScales:r,tracker:i}){return(0,Vd.useSyncExternalStore)(i.subscribe,i.getSnapshot,i.getSnapshot),Gd.createElement(Gd.Fragment,null,pi(e,t,n,r()))}function gi(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}function yi(e,t,n,r){if(!t)return e;const i=(i,...o)=>{const a={...e(i,...o)};if(t.isActive)if(t.predicate(r?r(i):i))n?.selectedStyle&&Object.assign(a,n.selectedStyle);else{const e=n?.unselectedOpacity??Jd;a.opacity=e,a.fillOpacity=e,a.strokeOpacity=e,n?.unselectedStyle&&Object.assign(a,n.unselectedStyle)}return a};return o=i,a=[i],a?.length?(Object.defineProperty(o,qd,{configurable:!0,enumerable:!1,value:a}),o):o;var o,a}function vi(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function bi(e,t){const{when:n}=e,r=t.width,i=t.height,o=function(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}(t),a=function(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}(t);return!("number"==typeof n.minWidth&&n.minWidth>r||"number"==typeof n.maxWidth&&r>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof i||n.minHeight>i)||"number"==typeof n.maxHeight&&("number"!=typeof i||i>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||n.minAspectRatio>o)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function xi(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};const r=n.map((e,t)=>({rule:e,index:t})).filter(e=>bi(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:r.reduce((e,t)=>function(e,t){const n={...e,...t};for(const r of["margin","frameProps","mobileSemantics","style"])vi(e[r])&&vi(t[r])&&(n[r]={...e[r],...t[r]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}(e,t.rule.transform),e),matches:r}}function wi(e,t={}){const n=t.mobileSemantics?.interaction,r="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,i="mobile"===t.mode||"number"==typeof t.width&&480>=t.width,o=!!n||void 0!==r,a=e&&"object"==typeof e?e:void 0;if(!1===e||!1===a?.enabled||void 0===e&&!i&&!o)return oh;const s=a??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??r??ih,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??ih,standardControls:s.standardControls??!1}}function ki(e){return e.compactMode?e.marginDefaults:sh}function Si(e,t,n){if(!1!==t)return e;const r={...e};return"horizontal"===n?r.left=Math.min(r.left,15):r.bottom=Math.min(r.bottom,15),r}function Mi(e,t,n){const r=e.xValue??t?.[n];if(null==r)return null;const i=Number(r);return Number.isFinite(i)?i:null}function ji(e){let t=e.data||e.datum||e;return Array.isArray(t)&&(t=t[0]),null!=e.xValue&&t&&"object"==typeof t&&!Array.isArray(t)&&null==t.xValue?{...t,xValue:e.xValue}:t||{}}function Ai(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function Ci(e,t){if(!t)return[];const n=new Set;for(const r of e){const e="function"==typeof t?t(r):r[t];null!=e&&n.add(e+"")}return Array.from(n)}function Ri(e,t){return null!=e&&Object.hasOwn(e,t)}function Li({data:e,colorBy:t,colorScale:n,showLegend:r,legendPosition:i,userMargin:o,defaults:a={top:50,bottom:60,left:70,right:40},categories:s,additionalLegend:l,chartWidth:c,chartHeight:u,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:p}){const{legendPosition:m,legendLayout:g}=function(e,t,n){const r=Ri(n,"legendPosition"),i=Ri(n,"legendLayout");return{legendPosition:r?n?.legendPosition??"right":e??"right",legendLayout:i?n?.legendLayout:t}}(i,d,h),y=Ri(h,"legend"),v=(0,ch.useContext)(uh),b=null!==(0,ch.useContext)(dh),x=void 0!==r?r:!v&&!!t,w=!!t&&(x||b),k=(0,lh.useMemo)(()=>w?void 0!==s?s:Ci(e,t):[],[s,t,e,w]);!function(e){const t=(0,ch.useContext)(dh),n=(0,ch.useId)(),r=function(e){const t=new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}(e),i=(0,ch.useRef)([]);(function(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0})(i.current,r)||(i.current=r);const o=i.current;hh(()=>{if(t)return()=>t.unregisterCategories(n)},[t,n]),hh(()=>{t&&t.registerCategories(n,o)},[t,n,o])}(b&&t?k:[]);const S=(0,lh.useMemo)(()=>{if(!x||!t)return;const r=function({data:e,colorBy:t,colorScale:n,getColor:r,strokeColor:i,strokeWidth:o,categories:a}){return{legendGroups:[{styleFn:e=>{const t=e.color||"#333",n={fill:t,stroke:t};return void 0!==i&&(n.stroke=i),void 0!==o&&(n.strokeWidth=o),n},type:"fill",items:(void 0!==a?a:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((i,o)=>{const a=e.find("function"==typeof t?e=>t(e)===i:e=>e[t]===i),s=a?r(a,t,n):n?n(i):Rl[o%Rl.length];return{label:i+"",color:s,__semioticCategory:!0}}),label:""}]}}({data:e,colorBy:t,colorScale:n,getColor:Ke,categories:k});return 0!==r.legendGroups.reduce((e,t)=>e+t.items.length,0)?r:void 0},[x,t,e,n,k]),M=(0,lh.useMemo)(()=>y?h?.legend:function(...e){let t;for(const n of e)n&&(t=Tt(t)&&Tt(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}(S,l),[S,l,h?.legend,y]),{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:R,leftAxis:L,rightAxis:P}=p??{},N=void 0!==R,E=void 0!==L,I=void 0!==P,{hasAxis:T,hasAxisLabel:D,rotatedTicks:z}=R??{},{hasAxis:_,hasAxisLabel:O}=L??{},{hasAxis:F,hasAxisLabel:W}=P??{},B=(0,lh.useMemo)(()=>{const e="number"==typeof o?{top:o,bottom:o,left:o,right:o}:o??{},t=function(e,t,n=!1){const r={...e};for(const e of t??[])!1!==e.visible||"top"===e.orient&&n||(r[e.orient]=0);return r}(a,h?.axes,f),n=n=>{const r=e[n];return"number"==typeof r?r:t[n]},r={top:n("top"),right:n("right"),bottom:n("bottom"),left:n("left")},i={...r};return M&&(Gt(r,{legend:M,position:m,size:[c??600,u??400],hasTitle:f,legendLayout:g,minimumMargin:"bottom"===m?80:"top"===m?50:0,axisChrome:void 0===j?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:N?{hasAxis:T,hasAxisLabel:D,rotatedTicks:z}:void 0,leftAxis:E?{hasAxis:_,hasAxisLabel:O}:void 0,rightAxis:I?{hasAxis:F,hasAxisLabel:W}:void 0}}),null!=c&&null!=u&&zt(r,i,[c,u],m)),r},[a,h?.axes,o,M,m,c,u,g,f,j,A,C,N,T,D,z,E,_,O,I,F,W]);return{legend:M,margin:B,legendPosition:m,legendLayout:g,legendMarginReserved:void 0!==M&&!Ri(h,"margin"),hasAutomaticLegend:void 0!==S}}function Pi(e){const t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function Ni(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function Ei(){const e=(0,rh.useTheme)(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function Ii({selection:e,linkedHover:t,fallbackFields:n=fh,unwrapData:r=!1,onObservation:i,chartType:o,chartId:a,onClick:s,hoverHighlight:l,colorByField:c,mobileInteraction:u,emitObservations:d=!0}){const h=(0,Kd.useId)(),f=(0,Kd.useMemo)(()=>gi(t,n),[t,n]),p=(0,Kd.useMemo)(()=>"series"===f?.mode?[f.seriesField||c||n[0]].filter(e=>!!e):f?.fields||n,[f,c,n]),m=(0,eh.useSelection)({name:e?.name||"__unused__",fields:p}),g=(0,eh.useLinkedHover)({name:f?.name||"hover",fields:p}),y=(0,nh.useObservationSelector)(e=>e.pushObservation),v=(0,Kd.useCallback)(e=>{i?.(e),y?.(e)},[i,y]),b=e?{isActive:m.isActive,predicate:m.predicate}:null,[x,w]=(0,Kd.useState)(null),k=(0,Kd.useRef)(!1),S=c||n[0],M=(0,Kd.useMemo)(()=>{if(!l||null==x||!S)return null;const e=x,t=S;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:(n[t]??"")+"")===e}},[l,x,S]),j=(0,Kd.useCallback)((e,n)=>{const r=!e&&k.current&&!!u?.enabled&&u.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===f?.mode&&f.xField){const n=Mi(e,t,f.xField);null!=n&&(0,th.setCrosshairPosition)(f.name||"hover",n,h)}"x-position"!==f?.mode&&g.onHover(t)}else"x-position"!==f?.mode||r||(0,th.clearCrosshairPosition)(f.name||"hover",h),"x-position"===f?.mode||r||g.onHover(null);if(l&&S)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[S];w(null!=n?n+"":null)}else r||w(null);d&&(i||y)&&di({onObservation:v,datum:e?ji(e):null,x:e?.x,y:e?.y,chartType:o||"unknown",chartId:a,context:n})},[t,g,f,h,i,o,a,y,v,d,l,S,u]),A=(0,Kd.useCallback)((n=!0)=>{k.current=!1,t&&"x-position"!==f?.mode&&g.onHover(null),e&&u?.tapToSelect&&m.clear(),n&&l&&w(null),"x-position"===f?.mode&&((0,th.unlockCrosshair)(f.name||"hover",h),(0,th.clearCrosshairPosition)(f.name||"hover",h))},[t,f,g,e,u,m,l,h]),C=(0,Kd.useCallback)((n,r)=>{const c=!!u?.enabled&&(u.tapToLockTooltip||u.tapToSelect),b=!!u?.enabled&&"backgroundTap"===u.clearSelection;if("x-position"===f?.mode&&f.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=Mi(n,e,f.xField);null!=t&&(0,th.toggleCrosshairLock)(f.name||"hover",t,h)}if(c)if(n){k.current=!0;const r=ji(n);if(t&&"x-position"!==f?.mode&&g.onHover(r),e&&u?.tapToSelect&&p.length>0){const e={};for(const t of p){const n=r[t];void 0!==n&&(e[t]=[n])}Ai(e)&&m.selectPoints(e)}if(l&&S){const e=r?.[S];w(null!=e?e+"":null)}}else b&&A();if(n||b){if(n&&s){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),s(e,{x:n.x??0,y:n.y??0})}d&&(i||y)&&hi({onObservation:v,datum:n?ji(n):null,x:n?.x,y:n?.y,chartType:o||"unknown",chartId:a,context:r})}},[s,d,i,y,v,o,a,f,h,u,t,g,e,m,p,l,S,A]);return(0,Kd.useEffect)(()=>{if(!u?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&k.current&&A()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u?.enabled,A]),(0,Kd.useEffect)(()=>()=>{k.current&&A(!1)},[A]),(0,Kd.useEffect)(()=>{if("x-position"!==f?.mode)return;const e=f.name||"hover";return()=>{(0,th.unlockCrosshair)(e,h),(0,th.clearCrosshairPosition)(e,h)}},[f?.mode,f?.name,h]),{activeSelectionHook:b,hoverSelectionHook:M,customHoverBehavior:j,customClickBehavior:C,crosshairSourceId:h}}function Ti(e,t,n){return function(e,t,n){const r=ah[e||"primary"],i=e&&"primary"!==e||!n?.width?r.width:n.width,o=e&&"primary"!==e||!n?.height?r.height:n.height,a=xi({...t,mode:e},{width:t.width??i,height:t.height??o}).props,s=a.mode||e||"primary",l=ah[s],c="context"===s||"sparkline"===s,u="primary"===s&&n?.width?n.width:l.width;return{mode:s,width:a.width??u,height:a.height??("primary"===s&&n?.height?n.height:l.height),showAxes:a.showAxes??l.showAxes,showGrid:a.showGrid??l.showGrid,enableHover:a.enableHover??(!!a.linkedHover||l.enableHover),showLegend:a.showLegend??l.showLegend,showLabels:a.showLabels??l.showLabels,title:c?void 0:a.title,description:a.description,summary:a.summary,accessibleTable:a.accessibleTable,xLabel:c?void 0:a.xLabel,yLabel:c?void 0:a.yLabel,categoryLabel:c?void 0:a.categoryLabel,valueLabel:c?void 0:a.valueLabel,marginDefaults:Si(l.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:wi(a.mobileInteraction,{mode:s,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}(e,t,n)}function Di(e,t){if(!function(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}(t))return e??((...e)=>({}));const n={};return void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(n.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...n}):(...e)=>({...n})}function zi(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>Oi(t(e))}function _i(e,t){const n=zi(t??"value"),r=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{const t=r?r(e):void 0;return{value:n(e),category:null==t?void 0:t+""}}}function Oi(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function Fi(e,t,n){const r=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&r!==e.eq)return!1;if(void 0!==e.ne&&r===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(r))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;const i=Oi(r);if(void 0===i)return!1;if(void 0!==e.gt&&e.gt>=i)return!1;if(void 0!==e.gte&&e.gte>i)return!1;if(void 0!==e.lt&&i>=e.lt)return!1;if(void 0!==e.lte&&i>e.lte)return!1;if(void 0!==e.within){const[t,n]=e.within;if(t>i||i>n)return!1}if(void 0!==e.outside){const[t,n]=e.outside;if(i>=t&&n>=i)return!1}return!0}function Wi(e,t,n){const r=e.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(t,n):Fi(r,t,n))}function Bi(e,t,n){if(!t||0===t.length)return{};let r={};for(const i of t){if(!Wi(i,e,n))continue;const t="function"==typeof i.style?i.style(e,n):i.style;t&&(r={...r,...t})}return r}function Hi(e,t,n,r=e=>e){const i=e??(()=>({}));return t&&0!==t.length?(e,o)=>{const a=r(e),s={...i(e,o)};return Object.assign(s,Bi(a,t,n(a,o))),s}:i}function $i({componentName:e,message:t,diagnosticHint:n,width:r,height:i}){return(0,ph.jsx)("div",{role:"alert",style:{width:r,height:Math.max(i,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:(0,ph.jsxs)("div",{style:{textAlign:"center",maxWidth:400},children:[(0,ph.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),(0,ph.jsx)("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&(0,ph.jsx)("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:n})]})})}function qi({componentName:e,width:t,height:n,children:r}){return(0,vh.jsx)(yh,{fallback:r=>(0,vh.jsx)($i,{componentName:e,message:r.message,width:t,height:n}),children:r})}function Gi(e,t,n,r){return!1===r||null==e||Array.isArray(e)&&e.length>0?null:Array.isArray(e)?(0,vh.jsx)("div",{style:{...xh,width:t,height:n},children:r||"No data available"}):null}function Vi(e,t,n,r){if(!e)return null;if(!1===r)return null;if(null!=r)return(0,vh.jsx)("div",{style:{width:t,height:n,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:r});const i=Math.min(5,Math.floor(n/40)),o=Math.max(8,Math.floor(n/(3*i))),a=Math.max(6,Math.floor(n/(2.5*i))),s=Math.floor((n-(i*(o+a)-a))/2);return(0,vh.jsx)("div",{style:{width:t,height:n,position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:Array.from({length:i},(e,n)=>(0,vh.jsx)("div",{className:"semiotic-loading-bar",style:{...wh,position:"absolute",top:s+n*(o+a),left:Math.floor(.1*t),width:30+(37*n+13)%50+"%",height:o,opacity:.5+n%2*.2}},n))})}function Ui(e,t,n,r){if(!bh)return;if(!t||0===t.length)return;if("string"!=typeof r)return;const i=t[0];if(!i||"object"!=typeof i)return;if(r in i)return;const o=Object.keys(i).join(", ");console.warn(`[semiotic] ${e}: ${n} "${r}" not found in data. Available keys: ${o}`)}function Yi(e){const t=(0,Sh.useThemeSelector)(e=>e.theme.colors.selectionOpacity);return(0,kh.useMemo)(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}function Xi(e){return"default"in e?e.default:e}async function Zi(e){const t=Ch.get(e);if(t)return t;const{topology:n,objectName:r}=await async function(e){try{switch(e){case"world-110m":return{topology:Xi(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:Xi(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:Xi(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:Xi(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){if(/Cannot find module|Failed to resolve|world-atlas/i.test(t instanceof Error?t.message:t+""))throw Error(`resolveReferenceGeography("${e}"): ${Rh}`,{cause:t});throw t}}(e);if(!n||!n.objects)throw Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof n} with keys: ${n?Object.keys(n).join(", "):"none"}`);const i=(0,Ah.feature)(n,n.objects[r]),o="features"in i?i.features:[i];return Ch.set(e,o),o}function Ki(e){const t=(0,jh.useMemo)(()=>Array.isArray(e)?e:void 0,[e]),[n,r]=(0,jh.useState)(null);return(0,jh.useEffect)(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(t=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(t)){let t=!1;return r(null),Zi(e).then(e=>{t||r(e)}),()=>{t=!0}}var t;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),r(null)}else r(null)},[e]),void 0!==t?t:n}function Qi(e){const{title:t,description:n,summary:r,accessibleTable:i,className:o,animate:a,maxDevicePixelRatio:s,axisExtent:l,autoPlaceAnnotations:c}=e,u={};return t&&(u.title=t),n&&(u.description=n),r&&(u.summary=r),void 0!==i&&(u.accessibleTable=i),o&&(u.className=o),null!=a&&(u.animate=a),void 0!==s&&(u.maxDevicePixelRatio=s),void 0!==l&&(u.axisExtent=l),void 0!==c&&(u.autoPlaceAnnotations=c),u}function Ji(e){const{linkedHover:t,selection:n,onObservation:r,onClick:i,hoverRadius:o,hoverHighlight:a,forceHoverBehavior:s,forceClickBehavior:l,mobileInteraction:c,customHoverBehavior:u,customClickBehavior:d,linkedHoverInClickPredicate:h=!0}=e,f={};r&&(f.annotationObservationCallback=r);const p=c?.enabled?Math.max(o??30,Math.ceil((c.targetSize||44)/2),24):o;return(s||t||r||i||a)&&(f.customHoverBehavior=u),d&&(l||(h?r||i||t:r||i)||c?.enabled&&(c.tapToSelect||c.tapToLockTooltip)&&(t||a||n))&&(f.customClickBehavior=d),null!=p&&(f.hoverRadius=p),f}function eo(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function to(e){const t=Ti(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=function(){const e=(0,rh.useTheme)();return e?.colors?.sequential||void 0}(),{areas:r,valueAccessor:i,styleRules:o,colorScheme:a,projection:s="equalEarth",graticule:l,fitPadding:c,zoomable:u,zoomExtent:d,onZoom:h,dragRotate:f,tileURL:p,tileAttribution:m,tileCacheSize:g,tooltip:y,areaOpacity:v=1,annotations:b,legendInteraction:x,legendPosition:w,margin:k,className:S,selection:M,linkedHover:j,onObservation:A,onClick:C,chartId:R,loading:L,loadingContent:P,emptyContent:N,frameProps:E={},stroke:I,strokeWidth:T,opacity:D}=e,z=u??!!p,_=Ki(r),O=(0,Zd.useMemo)(()=>_?gt(_):_,[_]),F=(0,Zd.useMemo)(()=>"function"==typeof i?i:e=>e?.properties?.[i]??e?.[i],[i]),W=a??n??"blues",B=(0,Zd.useMemo)(()=>{if(!O)return(0,Mh.scaleSequential)(Ze(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(const n of O){const r=F(n);null!=r&&isFinite(r)&&(e>r&&(e=r),r>t&&(t=r))}const n=Ze(W);return(0,Mh.scaleSequential)(n).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[O,F,W]),H=(0,Zd.useMemo)(()=>{const e=B.domain();return[e[0]??0,e[1]??1]},[B]),$=function(e,t,n,r=5){const[i,o]=n,[a,s]=(0,lh.useState)(null),[l,c]=(0,lh.useState)(new Map),u=(0,lh.useMemo)(()=>new Set,[]);(0,lh.useEffect)(()=>{s(null),c(new Map)},[i,o,r,e]);const d=(0,lh.useCallback)(t=>{if("highlight"!==e||!t)return void("highlight"===e&&s(null));const n=Pi(t);n&&s({key:Ni(t,n),range:n})},[e]),h=(0,lh.useCallback)(t=>{if("isolate"!==e)return;const n=Pi(t);n&&c(e=>{const i=new Map(e),o=Ni(t,n);return i.has(o)?i.delete(o):i.set(o,n),i.size===r?new Map:i})},[r,e]),f=(0,lh.useMemo)(()=>{const n="highlight"===e&&a?[a.range]:"isolate"===e?[...l.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{const r=t(e);return Number.isFinite(r)&&n.some(([e,t])=>r>=Math.min(e,t)&&Math.max(e,t)>=r)}}},[a,l,e,t]);return{highlightedCategory:"highlight"===e?a?.key??null:null,isolatedCategories:"isolate"===e?new Set(l.keys()):u,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}(x,F,H),{activeSelectionHook:q,hoverSelectionHook:G,customHoverBehavior:V,customClickBehavior:U}=Ii({selection:M,linkedHover:j,onObservation:A,onClick:C,chartType:"ChoroplethMap",chartId:R,mobileInteraction:t.mobileInteraction}),Y=Yi(M),X=G||$.legendSelectionHook||q,Z=(0,Zd.useMemo)(()=>{const e=Di(Hi(e=>{const t=F(e);return{fill:null!=t&&isFinite(t)?B(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:v}},o,e=>({value:F(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),{stroke:I,strokeWidth:T,opacity:D});return X?yi(e,X,Y,eo):e},[F,B,X,Y,v,I,T,D,o]),K=(0,Zd.useMemo)(()=>e=>{const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",n=F(e);return(0,Lh.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[(0,Lh.jsx)("div",{style:{fontWeight:600},children:t}),null!=n&&(0,Lh.jsx)("div",{style:{opacity:.7},children:(r=n,"number"==typeof r&&isFinite(r)?Number.isInteger(r)?r.toLocaleString():r.toLocaleString(void 0,{maximumFractionDigits:2}):(r??"")+"")})]});var r},[F]),Q=ki(t),J=(0,Zd.useMemo)(()=>{if(!1!==t.showLegend)return{gradient:{colorFn:e=>B(e),domain:H,label:"string"==typeof i?i:"value"}}},[B,t.showLegend,i,H]),{legend:ee,margin:te,legendPosition:ne,legendMarginReserved:re}=Li({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:w,userMargin:k,defaults:Q,additionalLegend:J,chartWidth:t.width,chartHeight:t.height,legendLayout:E.legendLayout,frameLegend:E,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),ie=Vi(L,t.width,t.height,P)||(O?null:Vi(!0,t.width,t.height,P)),oe=ie?null:Gi(O,t.width,t.height,N);if(Array.isArray(O)&&O.length>0){const e=O[0];if(!e||"object"!=typeof e||!e.geometry)return(0,Lh.jsx)($i,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}const ae={projection:s,areas:O,areaStyle:Z,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:te,enableHover:t.enableHover,...ee&&{legend:ee,legendPosition:ne},...re&&{__legendMarginReservedFor:ee},legendHoverBehavior:$.onLegendHover,legendClickBehavior:$.onLegendClick,legendHighlightedCategory:$.highlightedCategory,legendIsolatedCategories:"isolate"===x?$.isolatedCategories:void 0,tooltipContent:!1===y?()=>null:!0===y?K:ii(y)||K,...null!=l&&{graticule:l},...null!=c&&{fitPadding:c},...z&&{zoomable:!0},...d&&{zoomExtent:d},...h&&{onZoom:h},...null!=f&&{dragRotate:f},...p&&{tileURL:p},...m&&{tileAttribution:m},...g&&{tileCacheSize:g},...Ji({linkedHover:j,selection:M,onObservation:A,onClick:C,mobileInteraction:t.mobileInteraction,customHoverBehavior:V,customClickBehavior:U,linkedHoverInClickPredicate:!1}),...b&&b.length>0&&{annotations:b},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...S&&{className:S},...null!=e.animate&&{animate:e.animate},...E};return ie||oe||(0,Lh.jsx)(qi,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:(0,Lh.jsx)(Xd,{...ae})})}function no(e){const{data:t,rawData:n,colorBy:r,colorScheme:i,legendInteraction:o,legendPosition:a,selection:s,linkedHover:l,fallbackFields:c,unwrapData:u=!1,onObservation:d,chartType:h,chartId:f,showLegend:p,legend:m,legendLayout:g,frameLegend:y,userMargin:v,marginDefaults:b,onClick:x,hoverHighlight:w,mobileInteraction:k,mobileSemantics:S,loading:M,loadingContent:j,emptyContent:A,width:C,height:R,hasTitle:L,axisChrome:P}=e,N=void 0===n,E=(0,Nh.useMemo)(()=>gt(t),[t]),[I,T]=(0,Nh.useState)([]),D=(0,Nh.useCallback)(e=>{T(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[]),z="string"==typeof r?r:void 0,_=(0,Nh.useMemo)(()=>wi(k,{width:C,mobileSemantics:S}),[k,C,S]),{activeSelectionHook:O,hoverSelectionHook:F,customHoverBehavior:W,customClickBehavior:B,crosshairSourceId:H}=Ii({selection:s,linkedHover:l,fallbackFields:c,unwrapData:u,onObservation:d,chartType:h,chartId:f,onClick:x,hoverHighlight:w,colorByField:z,mobileInteraction:_}),$=function(e,t){const n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}(l,H),q=function(e,t,n){const r=(0,Qd.useCategoryColors)(),i=Ei();return(0,Kd.useMemo)(()=>{if(!t)return;const o=r??void 0,a=n??(i&&i.length>0?i:void 0)??"category10";if(0!==e.length){if("function"==typeof t){const n=Array.from(new Set(e.map(e=>t(e)+"")));if(o&&Ai(o)){const e=Je(n.map(e=>({_cat:e})),"_cat",a);return t=>Qe(o,t)??e(t)}return Je(n.map(e=>({_cat:e})),"_cat",a)}if(o&&Ai(o)){const n=Je(e,t,a);return e=>Qe(o,e)??n(e)}return Je(e,t,a)}if(o&&Ai(o)){const e=Je([{_:"a"}],"_",a);return t=>Qe(o,t)??e(t)}},[e,t,n,r,i])}(E,r,i),G=(0,Nh.useMemo)(()=>Ci(E,r),[E,r]),V=(0,Nh.useMemo)(()=>N&&I.length>0?I:G,[N,I,G]),U=function(e,t,n,r=!0,i=!1){const[o,a]=(0,lh.useState)(null),[s,l]=(0,lh.useState)(new Set),c=(0,lh.useMemo)(()=>new Set,[]),u=(0,lh.useMemo)(()=>new Set(n),[n]),d=null!=o&&u.has(o)?o:null,h=(0,lh.useMemo)(()=>{if(0===s.size)return s;const e=new Set(Array.from(s).filter(e=>u.has(e)));return 0===e.size||e.size===u.size?c:e.size===s.size?s:e},[u,c,s]);(0,lh.useEffect)(()=>{r&&t&&e&&"none"!==e||(a(null),l(e=>0===e.size?e:new Set))},[t,r,e]),(0,lh.useEffect)(()=>{a(e=>null==e||u.has(e)?e:null),l(e=>{if(0===e.size)return e;const t=new Set(Array.from(e).filter(e=>u.has(e)));return 0===t.size||t.size===u.size?new Set:t.size===e.size?e:t})},[u]);const f=(0,lh.useCallback)(t=>{r&&"highlight"===e&&a(!t||!u.has(t.label)||i&&!0!==t.__semioticCategory?null:t.label)},[u,r,e,i]),p=(0,lh.useCallback)(t=>{!r||"isolate"!==e||!u.has(t.label)||i&&!0!==t.__semioticCategory||l(e=>{const n=new Set(Array.from(e).filter(e=>u.has(e)));return n.has(t.label)?n.delete(t.label):n.add(t.label),n.size===u.size?new Set:n})},[u,r,e,i]),m=(0,lh.useMemo)(()=>{if(!r||!e||"none"===e||!t)return null;const n=e=>{const n="function"==typeof t?t(e):e[t];return"string"==typeof n?n:n+""};return"highlight"===e&&null!=d?{isActive:!0,predicate:e=>n(e)===d}:"isolate"===e&&h.size>0?{isActive:!0,predicate:e=>h.has(n(e))}:null},[t,r,e,d,h]);return{highlightedCategory:r&&"highlight"===e?d:null,isolatedCategories:r&&"isolate"===e?h:c,onLegendHover:f,onLegendClick:p,legendSelectionHook:m}}(o,r,V),Y=(0,Nh.useMemo)(()=>F||(U.legendSelectionHook?U.legendSelectionHook:O),[F,U.legendSelectionHook,O]),X=Yi(s),Z=Ei(),K=(0,Eh.useCategoryColors)(),Q=(0,Nh.useMemo)(()=>{if(q)return q;if(!r||0===V.length)return;const e=Array.isArray(i)&&i.length>0||"string"==typeof i&&i.length>0?i:Z&&Z.length>0?Z:Rl,t="__streamCat",n=Je(V.map(e=>({[t]:e})),t,e);return e=>(K?Qe(K,e):void 0)??n(e)??"#999"},[q,r,V,i,Z,K]),{legend:J,margin:ee,legendPosition:te,legendLayout:ne,legendMarginReserved:re}=Li({data:E,colorBy:r,colorScale:Q,showLegend:p,legendPosition:a,userMargin:v,defaults:b,categories:V,additionalLegend:m,chartWidth:C,chartHeight:R,legendLayout:g,frameLegend:y,hasTitle:L,axisChrome:P}),ie=(0,Nh.useMemo)(()=>{const e={};return J&&(e.legend=J,e.legendPosition=te,re&&(e.__legendMarginReservedFor=J),ne&&(e.legendLayout=ne)),o&&"none"!==o&&(e.legendHoverBehavior=U.onLegendHover,e.legendClickBehavior=U.onLegendClick,e.legendHighlightedCategory=U.highlightedCategory,e.legendIsolatedCategories=U.isolatedCategories),N&&r&&(e.legendCategoryAccessor=r,e.onCategoriesChange=D),e},[J,te,ne,re,o,U.onLegendHover,U.onLegendClick,U.highlightedCategory,U.isolatedCategories,N,r,D]),oe=Array.isArray(n)?gt(n):n,ae=Vi(M,C,R,j),se=ae?null:Gi(oe,C,R,A);return{data:E,colorScale:q,allCategories:V,legendState:U,effectiveSelectionHook:Y,activeSelectionHook:O,customHoverBehavior:W,customClickBehavior:B,mobileInteraction:_,legend:J,margin:ee,legendPosition:te,earlyReturn:ae||se||null,legendBehaviorProps:ie,crosshairProps:$,resolvedSelection:X}}function ro(e,t){const{variant:n,frameRef:r,overrides:i}=t,o=(0,Ih.useRef)(i);o.current=i,(0,Ih.useImperativeHandle)(e,()=>{const e=function(e,t){if("xy"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,n)=>e.current?.update(t,n)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{const n=Array.isArray(t)?t:[t],r=e.current?.getTopology()?.nodes??[],i=[];for(const t of n){const n=r.find(e=>e.id===t);n&&i.push({...n.data??{},id:t}),e.current?.removeNode(t)}return i},update:(t,n)=>(Array.isArray(t)?t:[t]).flatMap(t=>{const r=e.current?.updateNode(t,n);return r?[{...r,id:t}]:[]}),clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,n)=>{const r=e.current?.removePoint(t)??[];for(const t of r)e.current?.push(n(t));return r},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}const n=t;return{push:e=>n.current?.pushLine(e),pushMany:e=>n.current?.pushManyLines(e),remove:e=>n.current?.removeLine(e)??[],update:(e,t)=>{const r=n.current?.removeLine(e)??[];for(const e of r)n.current?.pushLine(t(e));return r},clear:()=>n.current?.clear(),getData:()=>n.current?.getLines()??[],getCustomLayout:()=>n.current?.getCustomLayout?.()??null,getLayoutFailure:()=>n.current?.getLayoutFailure?.()??null}}(n,r);return new Proxy(e,{get(e,t,n){if("string"==typeof t){const e=o.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,n)},has:(e,t)=>!("string"!=typeof t||!o.current||!(t in o.current))||Reflect.has(e,t)})},[])}function io(e,t,n){const[r,i]=n;if(!t)return r;const[o,a]=t,s=a>o?a-o:0,l=Number(e),c=Number.isFinite(l)?l:o;return r+Math.max(0,Math.min(1,s>0?(c-o)/s:0))*(i-r)}function oo({bottomMargin:e,costLabel:t,layout:{cx:n,cy:r,maxCost:i,availableRadius:o,layout:a},ringStyle:s,ringValues:l,showNorth:c,showRingLabels:u,showRings:d}){const h="strip"===a,f={stroke:h?"var(--semiotic-border, #999)":"#999",strokeWidth:h?1:.8,strokeDasharray:h?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:h?8:10,...s};return(0,Uh.jsxs)("g",h?{children:[(0,Uh.jsx)("line",{x1:n,y1:r,x2:n+o,y2:r,stroke:f.stroke,strokeWidth:f.strokeWidth,strokeLinecap:"round",opacity:.85}),(0,Uh.jsx)("line",{x1:n,y1:r-3.5,x2:n,y2:r+3.5,stroke:f.stroke,strokeWidth:f.strokeWidth,opacity:.9}),d&&l.map(a=>{const s=n+(i>0?a/i*o:0);return(0,Uh.jsxs)("g",{children:[(0,Uh.jsx)("line",{x1:s,y1:r-2.5,x2:s,y2:r+2.5,stroke:f.stroke,strokeWidth:.9,opacity:.65}),u&&(0,Uh.jsxs)("text",{x:s,y:r+Math.min(10,(e??2)+8),textAnchor:"middle",fontSize:f.labelSize,fill:f.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[a,t?" "+t:""]})]},a)})]}:{children:[l.map(e=>{const a=e/i*o;return(0,Uh.jsxs)("g",{children:[(0,Uh.jsx)("circle",{cx:n,cy:r,r:a,fill:"none",stroke:f.stroke,strokeWidth:f.strokeWidth,strokeDasharray:f.strokeDasharray,opacity:.5}),u&&(0,Uh.jsxs)("text",{x:n+a+3,y:r-2,fontSize:f.labelSize,fill:f.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?" "+t:""]})]},e)}),c&&(0,Uh.jsxs)("g",{transform:"translate(24, 24)",children:[(0,Uh.jsx)("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),(0,Uh.jsx)("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),(0,Uh.jsx)("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),(0,Uh.jsx)("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),(0,Uh.jsx)("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),(0,Uh.jsx)("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function ao(e){const t=function(e){return null==e?void 0:e+""}(e.id);return{type:"point",x:e.x,y:e.y,r:e.r??tf,style:{...ef,cursor:e.cursor},datum:e.datum,pointId:t,_transitionKey:t}}function so(e){return ao(e)}function lo(e){const[[t,n],[r,i]]=e.bounds;return{type:"geoarea",pathData:e.pathData,centroid:e.centroid,bounds:e.bounds,screenArea:e.screenArea??Math.abs((r-t)*(i-n)),style:{...ef,cursor:e.cursor},datum:e.datum,group:e.group,interactive:!0}}function co(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function uo(e,t,n){return Math.max(t,Math.min(n,e))}function ho(e){let t=1/0,n=-1/0;for(const r of e)Number.isFinite(r)&&(t>r&&(t=r),r>n&&(n=r));return t===1/0?[0,0]:[t,n]}function fo(e,t){const n=t[1]-t[0];return 0===n?.5:(e-t[0])/n}function po(e,t={}){const n=e.map((e,t)=>({...e,index:t})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));if(0===n.length)return[];const r=uo(Number.isFinite(t.occupancy)?Number(t.occupancy):of,.2,1),i=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):af;let o=co(t.columns)??Math.max(1,Math.ceil(Math.sqrt(n.length*i/r))),a=co(t.rows)??Math.max(1,Math.ceil(n.length/(o*r)));n.length>o*a&&(null!=t.columns&&null==t.rows?a=Math.ceil(n.length/o):null!=t.rows&&null==t.columns?o=Math.ceil(n.length/a):a=Math.ceil(n.length/o));const s=ho(n.map(e=>e.x)),l=ho(n.map(e=>e.y)),c=n.map(e=>({...e,desiredColumn:fo(e.x,s)*Math.max(0,o-1),desiredRow:fo(e.y,l)*Math.max(0,a-1)})),u=(o-1)/2,d=(a-1)/2;c.sort((e,t)=>(t.desiredColumn-u)**2+(t.desiredRow-d)**2-((e.desiredColumn-u)**2+(e.desiredRow-d)**2)||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index);const h=new Set;for(let e=0;a>e;e+=1)for(let t=0;o>t;t+=1)h.add(e*o+t);const f=[];for(const e of c){let t=-1,n=1/0;for(const r of h){const i=(r%o-e.desiredColumn)**2+(Math.floor(r/o)-e.desiredRow)**2;(n>i||i===n&&t>r)&&(t=r,n=i)}0>t||(h.delete(t),f.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/o),column:t%o,index:e.index}))}return f.sort((e,t)=>e.index-t.index),f.map(({index:e,...t})=>t)}function mo(e,t,n=[]){if("function"==typeof t)return t(e);if("string"==typeof t)return e[t];for(const t of n)if(null!=e[t])return e[t]}function go(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e},${t}`).join("")+"Z"}function yo({marks:e,color:t,fontSize:n,fontFamily:r,fontWeight:i}){const o=(0,nf.useCustomLayoutSelection)();return(0,rf.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{const a=!o.isActive||o.predicate(e.datum);return(0,rf.jsx)("text",{x:e.x,y:e.y,fill:t,fontFamily:r,fontSize:n,fontWeight:i,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}function vo(e,t,n){return Math.max(t,Math.min(n,e))}function bo(e){if(Number.isFinite(e)&&Number(e)>0)return Number(e)}function xo(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function wo(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function ko(e,t){const n=wo(e);return(e.id??n.id??n.name??"feature-"+t)+""}function So(e,t,n,r){return[Math.ceil((e-n)/r-.5),Math.floor((t-n)/r-.5)]}function Mo(e){if(!e)return 0;const t=ff.get(e);if(t)return t;const n=pf;return pf+=1,ff.set(e,n),n}function jo(e,t){return!t||!(t[0][1]>e[1]||e[1]>t[1][1]||(n=e[0],r=t[0][0],i=t[1][0],r>i?r>n&&n>i:r>n||n>i));var n,r,i}function Ao(e,t){for(const n of e){const{feature:e,index:r}=n;if(e.geometry&&jo(t,n.bounds))try{if(ne(e,t))return{feature:e,index:r}}catch{}}return null}function Co(e,t,n,r={}){const i=e.filter((e,t)=>e.geometry&&(!r.featureFilter||r.featureFilter(e,t))),o=function(e,t){if(0===e.length)return null;const n=t.bounds({type:"FeatureCollection",features:e});return Number.isFinite(n[0][0])&&Number.isFinite(n[0][1])&&Number.isFinite(n[1][0])&&Number.isFinite(n[1][1])?n:null}(i,t.geoPath);if(!o)return{dots:[],cellSize:cf,features:i};const a=Math.max(0,r.layoutPadding??0),l=[[vo(o[0][0],a,Math.max(a,n.width-a)),vo(o[0][1],a,Math.max(a,n.height-a))],[vo(o[1][0],a,Math.max(a,n.width-a)),vo(o[1][1],a,Math.max(a,n.height-a))]],c=Math.max(0,l[1][0]-l[0][0]),u=Math.max(0,l[1][1]-l[0][1]);if(0===c||0===u)return{dots:[],cellSize:cf,features:i};const d=bo(r.columns);let h=Math.max(2,d?c/d:bo(r.cellSize)??cf);const f=Math.max(100,Math.round(bo(r.maxSamples)??uf)),p=Math.ceil(c/h)*Math.ceil(u/h);p>f&&(h*=Math.sqrt(p/f));const m=r.gridOrigin?.[0]??0,g=r.gridOrigin?.[1]??0,[y,v]=So(l[0][0],l[1][0],m,h),[b,x]=So(l[0][1],l[1][1],g,h),w=[],k=function(e){return e.map((e,t)=>{if(hf.has(e))return{feature:e,index:t,bounds:hf.get(e)??null};try{const n=function(e){var t,n,r,i,o,a,l;if(la=sa=-(oa=aa=1/0),pa=[],s(e,$a),n=pa.length){for(pa.sort(C),t=1,o=[r=pa[0]];n>t;++t)R(r,(i=pa[t])[0])||R(r,i[1])?(A(r[0],i[1])>A(r[0],r[1])&&(r[1]=i[1]),A(i[0],r[1])>A(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];n>=t;r=i,++t)(l=A(r[1],(i=o[t])[0]))>a&&(a=l,oa=i[0],sa=r[1])}return pa=ma=null,oa===1/0||aa===1/0?[[NaN,NaN],[NaN,NaN]]:[[oa,aa],[sa,la]]}(e);return hf.set(e,n),{feature:e,index:t,bounds:n}}catch{return hf.set(e,null),{feature:e,index:t,bounds:null}}})}(i);for(let e=b;x>=e;e+=1){const n=g+(e+.5)*h;for(let i=y;v>=i;i+=1){const o=t.invertedPoint(m+(i+.5)*h,n);if(!o||!Number.isFinite(o[0])||!Number.isFinite(o[1]))continue;const a=Ao(k,o);if(!a)continue;const s={...wo(a.feature),featureId:ko(a.feature,a.index),featureIndex:a.index,gridRow:e,gridColumn:i,longitude:o[0],latitude:o[1],dotIndex:w.length};r.dotFilter&&!r.dotFilter(s,w.length)||w.push(s)}}return{dots:w,cellSize:h,features:i}}function Ro(e){return Math.round(1e4*e)/1e4}function Lo(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${Ro(Number(e[0]))},${Ro(Number(e[1]))}`:"null"}function Po(e,t){const n=e[t];return"function"==typeof n?n.call(e):void 0}function No(e){return"number"==typeof e&&Number.isFinite(e)?Ro(e)+"":null===e?"null":"unavailable"}function Eo(e){const t=e.scales.projection;return[No(Po(t,"scale")),Lo(Po(t,"translate")),Lo(Po(t,"center")),(n=Po(t,"rotate"),Array.isArray(n)&&n.every(Number.isFinite)?n.map(e=>Ro(Number(e))).join(","):"unavailable"),No(Po(t,"clipAngle")),No(Po(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,n])=>Lo(e.scales.projectedPoint(t,n)))].join("|");var n}function Io(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e},${t}`).join("")+"Z"}function To(e,t,n){const{featureKey:r,dataKey:i}=n,o=new Map;for(const e of t){const t=(Object.prototype.hasOwnProperty.call(e,i)?e[i]:void 0)+"";o.set(t,e)}return e.map(e=>{const t=(e=>{const t=r.split(".");let n=e;for(const e of t)n=null!==n&&"object"==typeof n&&Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0;return(n??"")+""})(e),n=o.get(t);return n?{...e,properties:{...e.properties,...n}}:e})}var Do,zo,_o,Oo=Object.create,Fo=Object.defineProperty,Wo=Object.getOwnPropertyDescriptor,Bo=Object.getOwnPropertyNames,Ho=Object.getPrototypeOf,$o=Object.prototype.hasOwnProperty,qo=(e,t)=>{for(var n in t)Fo(e,n,{get:t[n],enumerable:!0})},Go=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of Bo(t))$o.call(e,i)||i===n||Fo(e,i,{get:()=>t[i],enumerable:!(r=Wo(t,i))||r.enumerable});return e},Vo=(e,t,n)=>(n=null!=e?Oo(Ho(e)):{},Go(!t&&e&&e.__esModule?n:Fo(n,"default",{value:e,enumerable:!0}),e)),Uo={};qo(Uo,{default:()=>e});var Yo,Xo,Zo,Ko,Qo=(Yo={"src/components/stream/AccessibleTablePortalImpl.tsx"(){Do=Vo(require("react")),zo=require("react-dom"),_o=require("react/jsx-runtime")}},function(){if(Zo)throw Zo[0];try{return Yo&&(Xo=(0,Yo[Bo(Yo)[0]])(Yo=0)),Xo}catch(e){throw Zo=[e],e}}),Jo={};qo(Jo,{ChoroplethMap:()=>to,DEFAULT_HIT_RADIUS:()=>tf,DistanceCartogram:()=>Xh,FlowMap:()=>Gh,GeoCustomChart:()=>Jh,MultiLineTooltip:()=>ri,ProportionalSymbolMap:()=>Oh,StreamGeoFrame:()=>Xd,Tooltip:()=>ni,TooltipRoot:()=>Mr,composeStyleRules:()=>Hi,geoAreaHitTarget:()=>lo,geoHitTarget:()=>so,geographicDotGridLayout:()=>mf,geographicGridLayout:()=>sf,glyphExtent:()=>kt,glyphPlacement:()=>wt,gridifyGeographicPoints:()=>po,hatchFillId:()=>kn,hatchPatternDef:()=>Sn,hitTargetPoint:()=>ao,isHatchFill:()=>xn,makeNodeRuleContext:()=>_i,makeRuleValueResolver:()=>zi,markTooltipChrome:()=>jr,matchesThreshold:()=>Fi,mergeData:()=>To,resolveReferenceGeography:()=>Zi,resolveResponsiveRules:()=>xi,resolveStyleRules:()=>Bi,resolveSvgFill:()=>Mn,responsiveRuleMatches:()=>bi,ruleMatches:()=>Wi,sampleGeographicDotGrid:()=>Co}),module.exports=(Ko=Jo,Go(Fo({},"__esModule",{value:!0}),Ko));var ea,ta,na,ra,ia,oa,aa,sa,la,ca,ua,da,ha,fa,pa,ma,ga=require("react"),ya=require("d3-array"),va=1e-6,ba=1e-12,xa=Math.PI,wa=xa/2,ka=xa/4,Sa=2*xa,Ma=180/xa,ja=xa/180,Aa=Math.abs,Ca=Math.atan,Ra=Math.atan2,La=Math.cos,Pa=Math.ceil,Na=Math.exp,Ea=Math.log,Ia=Math.sin,Ta=Math.sign||function(e){return e>0?1:0>e?-1:0},Da=Math.sqrt,za=Math.tan,_a={Feature:function(e,t){i(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)i(n[r].geometry,t)}},Oa={Sphere:function(e,t){t.sphere()},Point:function(e,t){t.point((e=e.coordinates)[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)t.point((e=n[r])[0],e[1],e[2])},LineString:function(e,t){o(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)o(n[r],t,0)},Polygon:function(e,t){a(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)a(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)i(n[r],t)}},Fa=new ya.Adder,Wa=new ya.Adder,Ba={point:r,lineStart:r,lineEnd:r,polygonStart:function(){Fa=new ya.Adder,Ba.lineStart=l,Ba.lineEnd=c},polygonEnd:function(){var e=+Fa;Wa.add(0>e?Sa+e:e),this.lineStart=this.lineEnd=this.point=r},sphere:function(){Wa.add(Sa)}},Ha=require("d3-array"),$a={point:b,lineStart:w,lineEnd:k,polygonStart:function(){$a.point=S,$a.lineStart=M,$a.lineEnd=j,fa=new Ha.Adder,Ba.polygonStart()},polygonEnd:function(){Ba.polygonEnd(),$a.point=b,$a.lineStart=w,$a.lineEnd=k,0>Fa?(oa=-(sa=180),aa=-(la=90)):fa>va?la=90:-va>fa&&(aa=-90),ma[0]=oa,ma[1]=sa},sphere:function(){oa=-(sa=180),aa=-(la=90)}};P.invert=P;var qa,Ga,Va,Ua,Ya,Xa,Za,Ka,Qa,Ja,es,ts,ns=require("d3-array"),rs=require("d3-array"),is=$(function(){return!0},function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?xa:-xa,l=Aa(o-n);Aa(l-xa)<va?(e.point(n,r=(r+a)/2>0?wa:-wa),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i===s||xa>l||(Aa(n-i)<va&&(n-=i*va),Aa(o-s)<va&&(o-=s*va),r=function(e,t,n,r){var i,o,a=Ia(e-n);return Aa(a)>va?Ca((Ia(t)*(o=La(r))*Ia(n)-Ia(r)*(i=La(t))*Ia(e))/(i*o*a)):(t+r)/2}(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}},function(e,t,n,r){var i;if(null==e)r.point(-xa,i=n*wa),r.point(0,i),r.point(xa,i),r.point(xa,0),r.point(xa,-i),r.point(0,-i),r.point(-xa,-i),r.point(-xa,0),r.point(-xa,i);else if(Aa(e[0]-t[0])>va){var o=t[0]>e[0]?xa:-xa;r.point(-o,i=n*o/2),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])},[-xa,-wa]),os=require("d3-array"),as=1e9,ss=-as,ls=require("d3-array"),cs={sphere:r,point:r,lineStart:function(){cs.point=U,cs.lineEnd=V},lineEnd:r,polygonStart:r,polygonEnd:r},us=[null,null],ds={type:"LineString",coordinates:us},hs={Feature:function(e,t){return Z(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(Z(n[r].geometry,t))return!0;return!1}},fs={Sphere:function(){return!0},Point:function(e,t){return K(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(K(n[r],t))return!0;return!1},LineString:function(e,t){return Q(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(Q(n[r],t))return!0;return!1},Polygon:function(e,t){return J(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(J(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(Z(n[r],t))return!0;return!1}},ps=require("d3-array"),ms=e=>e,gs=require("d3-array"),ys=new gs.Adder,vs=new gs.Adder,bs={point:r,lineStart:r,lineEnd:r,polygonStart:function(){bs.lineStart=ae,bs.lineEnd=ce},polygonEnd:function(){bs.lineStart=bs.lineEnd=bs.point=r,ys.add(Aa(vs)),vs=new gs.Adder},result:function(){var e=ys/2;return ys=new gs.Adder,e}},xs=bs,ws=1/0,ks=ws,Ss=-ws,Ms=Ss,js={point:function(e,t){ws>e&&(ws=e),e>Ss&&(Ss=e),ks>t&&(ks=t),t>Ms&&(Ms=t)},lineStart:r,lineEnd:r,polygonStart:r,polygonEnd:r,result:function(){var e=[[ws,ks],[Ss,Ms]];return Ss=Ms=-(ks=ws=1/0),e}},As=0,Cs=0,Rs=0,Ls=0,Ps=0,Ns=0,Es=0,Is=0,Ts=0,Ds={point:ue,lineStart:de,lineEnd:pe,polygonStart:function(){Ds.lineStart=me,Ds.lineEnd=ge},polygonEnd:function(){Ds.point=ue,Ds.lineStart=de,Ds.lineEnd=pe},result:function(){var e=Ts?[Es/Ts,Is/Ts]:Ns?[Ls/Ns,Ps/Ns]:Rs?[As/Rs,Cs/Rs]:[NaN,NaN];return As=Cs=Rs=Ls=Ps=Ns=Es=Is=Ts=0,e}},zs=Ds;be.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Sa)}},result:r};var _s,Os,Fs,Ws,Bs,Hs,$s,qs,Gs,Vs=require("d3-array"),Us=new Vs.Adder,Ys={point:r,lineStart:function(){Ys.point=xe},lineEnd:function(){_s&&we(Os,Fs),Ys.point=r},polygonStart:function(){_s=!0},polygonEnd:function(){_s=null},result:function(){var e=+Us;return Us=new Vs.Adder,e}},Xs=Ys,Zs=class{constructor(e){this._append=null==e?ke:function(e){const t=Math.floor(e);if(0>t)throw new RangeError("invalid digits: "+e);if(t>15)return ke;if(t!==Hs){const e=10**t;Hs=t,$s=function(t){let n=1;this._+=t[0];for(const r=t.length;r>n;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}return $s}(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(e,t){switch(this._point){case 0:this._append`M${e},${t}`,this._point=1;break;case 1:this._append`L${e},${t}`;break;default:if(this._append`M${e},${t}`,this._radius!==qs||this._append!==$s){const e=this._radius,t=this._;this._="",this._append`m0,${e}a${e},${e} 0 1,1 0,${-2*e}a${e},${e} 0 1,1 0,${2*e}z`,qs=e,$s=this._append,Gs=this._,this._=t}this._+=Gs}}result(){const e=this._;return this._="",e.length?e:null}};je.prototype={constructor:je,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Ks=La(30*ja),Qs=Me({point:function(e,t){this.stream.point(e*ja,t*ja)}});_e.invert=function(e,t){return[e,2*Ca(Na(t))-wa]},Oe.invert=Oe;var Js,el=1.340264,tl=-.081106,nl=893e-6,rl=.003796,il=Da(3)/2;Fe.invert=function(e,n){for(var r,i=n,o=i*i,a=o*o*o,s=0;12>s&&(a=(o=(i-=r=(i*(el+tl*o+a*(nl+rl*o))-n)/(el+3*tl*o+a*(7*nl+9*rl*o)))*i)*o*o,Aa(r)>=ba);++s);return[il*e*(el+3*tl*o+a*(7*nl+9*rl*o))/La(i),t(Ia(i)/il)]},Be.invert=function(e,t){var n,r=t,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-t)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(Aa(n)>va&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},He.invert=(Js=t,function(e,n){var r=Da(e*e+n*n),i=Js(r),o=Ia(i),a=La(i);return[Ra(e*o,r*a),t(r&&n*o/r)]});var ol=require("d3-quadtree"),al=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const n of e){const e=this.push(n);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++)e(this.buffer[(t+n)%this._capacity],n)}toArray(){const e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++)e[n]=this.buffer[(t+n)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");const t=this.toArray();let n=0,r=[];t.length>e&&(n=t.length-e,r=t.slice(0,n)),this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(let e=n;t.length>e;e++)this.push(t[e]);return r}update(e,t){const n=[],r=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;this._size>i;i++){const o=(r+i)%this._capacity,a=this.buffer[o];if(e(a)){let e;e="object"!=typeof a||null===a?a:Array.isArray(a)?[...a]:{...a},n.push(e),this.buffer[o]=t(a)}}return n}remove(e){const t=[],n=[];if(this.forEach(r=>{e(r)?n.push(r):t.push(r)}),0===n.length)return n;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return n}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},sl=1,ll=1.5,cl=3,ul=require("d3-scale"),dl=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],hl=Xe(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),fl=Xe(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),pl=Xe(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),ml=Xe(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),gl=Xe(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),yl=Xe(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),vl=Xe(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),bl=Xe(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),xl=Xe(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),wl=Xe(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),kl=Xe(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),Sl=Xe(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"]),Ml={blues:hl,reds:fl,greens:pl,viridis:vl,oranges:ml,purples:gl,greys:yl,plasma:bl,inferno:xl,magma:wl,cividis:kl,turbo:Sl},jl=(Xe(["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]),Xe(["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]),Xe(["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]),Xe(["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]),Xe(["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]),Xe(["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]),Xe(["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]),{category10:dl,tableau10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],...Ml}),Al=dl,Cl="#007bff",Rl=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],Ll=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),Pl={mercator:function(){return function(e){function t(){var t=xa*s(),a=o(function(e){function t(t){return(t=e(t[0]*ja,t[1]*ja))[0]*=Ma,t[1]*=Ma,t}return e=N(e[0]*ja,e[1]*ja,e.length>2?e[2]*ja:0),t.invert=function(t){return(t=e.invert(t[0]*ja,t[1]*ja))[0]*=Ma,t[1]*=Ma,t},t}(o.rotate()).invert([0,0]));return c(null==u?[[a[0]-t,a[1]-t],[a[0]+t,a[1]+t]]:e===_e?[[Math.max(a[0]-t,u),n],[Math.min(a[0]+t,r),i]]:[[u,Math.max(a[1]-t,n)],[r,Math.min(a[1]+t,i)]])}var n,r,i,o=Ie(e),a=o.center,s=o.scale,l=o.translate,c=o.clipExtent,u=null;return o.scale=function(e){return arguments.length?(s(e),t()):s()},o.translate=function(e){return arguments.length?(l(e),t()):l()},o.center=function(e){return arguments.length?(a(e),t()):a()},o.clipExtent=function(e){return arguments.length?(null==e?u=n=r=i=null:(u=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),t()):null==u?null:[[u,n],[r,i]]},t()}(_e).scale(961/Sa)},equalEarth:We,albersUsa:function(){function e(e){var t=e[0],n=e[1];return s=null,i.point(t,n),s||(o.point(t,n),s)||(a.point(t,n),s)}function t(){return n=r=null,e}var n,r,i,o,a,s,l=ze().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7]),c=ze().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=ze().rotate([157,0]).center([-3,19.9]).parallels([8,18]),d={point:function(e,t){s=[e,t]}};return e.invert=function(e){var t=l.scale(),n=l.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?c:i>=.166&&.234>i&&r>=-.214&&-.115>r?u:l).invert(e)},e.stream=function(e){return n&&r===e?n:(t=[l.stream(r=e),c.stream(e),u.stream(e)],i=t.length,n={point:function(e,n){for(var r=-1;++r<i;)t[r].point(e,n)},sphere:function(){for(var e=-1;++e<i;)t[e].sphere()},lineStart:function(){for(var e=-1;++e<i;)t[e].lineStart()},lineEnd:function(){for(var e=-1;++e<i;)t[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<i;)t[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<i;)t[e].polygonEnd()}});var t,i},e.precision=function(e){return arguments.length?(l.precision(e),c.precision(e),u.precision(e),t()):l.precision()},e.scale=function(t){return arguments.length?(l.scale(t),c.scale(.35*t),u.scale(t),e.translate(l.translate())):l.scale()},e.translate=function(e){if(!arguments.length)return l.translate();var n=l.scale(),r=+e[0],s=+e[1];return i=l.translate(e).clipExtent([[r-.455*n,s-.238*n],[r+.455*n,s+.238*n]]).stream(d),o=c.translate([r-.307*n,s+.201*n]).clipExtent([[r-.425*n+va,s+.12*n+va],[r-.214*n-va,s+.234*n-va]]).stream(d),a=u.translate([r-.205*n,s+.212*n]).clipExtent([[r-.214*n+va,s+.166*n+va],[r-.115*n-va,s+.234*n-va]]).stream(d),t()},e.fitExtent=function(t,n){return Ce(e,t,n)},e.fitSize=function(t,n){return Re(e,t,n)},e.fitWidth=function(t,n){return Le(e,t,n)},e.fitHeight=function(t,n){return Pe(e,t,n)},e.scale(1070)},orthographic:function(){return Ie(He).scale(249.5).clipAngle(90.000001)},naturalEarth:function(){return Ie(Be).scale(175.295)},equirectangular:function(){return Ie(Oe).scale(152.63)}},Nl=require("d3-scale"),El={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},Il=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=pt({kind:"initialize"},[],this.revisions),this.listeners=new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){const n=pt(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}},Tl=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Dl=["scene-style","data-paint","accessibility","evidence"],zl=(e,t)=>({retainedData:e,invalidations:t}),_l=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ol=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Fl=["scene-geometry","data-paint","accessibility","evidence"],Wl=["scene-style","data-paint","accessibility","evidence"],Bl=["overlay","accessibility","evidence"],Hl=[],$l={xAccessor:zl("rebuild",_l),yAccessor:zl("rebuild",_l),lineDataAccessor:zl("rebuild",_l),pointIdAccessor:zl("rebuild",Fl),lineIdAccessor:zl("rebuild",Fl),windowSize:zl("rebuild",_l),projection:zl("preserve",Ol),projectionExtent:zl("preserve",Ol),fitPadding:zl("preserve",Ol),lineType:zl("preserve",Ol),flowStyle:zl("preserve",Ol),graticule:zl("preserve",Ol),projectionTransform:zl("preserve",Ol),customLayout:zl("preserve",Ol),layoutConfig:zl("preserve",Ol),layoutMargin:zl("preserve",Ol),areaStyle:zl("preserve",Wl),pointStyle:zl("preserve",["scene-geometry","scene-style","data-paint","accessibility","evidence"]),lineStyle:zl("preserve",Wl),colorScheme:zl("preserve",Wl),themeCategorical:zl("preserve",Wl),themeDiverging:zl("preserve",Wl),themeSemantic:zl("preserve",Wl),themeSequential:zl("preserve",Wl),decay:zl("preserve",Wl),pulse:zl("preserve",Wl),layoutSelection:zl("preserve",Wl),annotations:zl("preserve",Bl),autoPlaceAnnotations:zl("preserve",Bl),clock:zl("preserve",Hl),transition:zl("preserve",Hl),introAnimation:zl("preserve",Hl),onLayoutError:zl("preserve",Hl)},ql=zl("preserve",Ol),Gl=class{constructor(){this.tracker=new Il}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},Tl)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Dl):this.recordNoop("restyle")}recordConfig(e,t={}){const n=function(e){let t="preserve";const n=new Set;for(const r of e){const e=$l[r]??ql;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)n.add(t)}return{retainedData:t,invalidations:n}}(e),r=new Set(n.invalidations);return t.retainedDataChanged&&r.add("data"),this.tracker.record({kind:"config",keys:e},r)}},Vl=new WeakMap,Ul=class e{constructor(e){this.updateResults=new Gl,this.scene=[],this.scales=null,this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutDiagnosticsWarned=new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this._quadtree=null,this._maxPointRadius=0,this.projection=null,this.geoPath=null,this.baseScale=0,this.baseTranslate=[0,0],this.baseRotation=[0,0,0],this.currentZoom=1,this.cartogramLayout=null,this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.streaming=!1,this.lastIngestTime=0,this.timestampBuffer=null,this.activeTransition=null,this.prevPositions=null,this._hasRenderedOnce=!1,this.config=function(e){return{...e,fitPadding:mt(e.fitPadding)}}(e)}currentTime(){return this.config.clock?.()??("undefined"!=typeof performance?performance.now():Date.now())}getConfiguredWindowSize(){const e=this.config.windowSize??500;if(!Number.isInteger(e)||1>e)throw Error("GeoPipelineStore windowSize must be a positive integer");return e}retainNewestLines(e=this.getConfiguredWindowSize()){this.lineData.length>e&&(this.lineData=this.lineData.slice(-e))}resizeStreamingWindow(e){if(this.pointBuffer){const t=this.pointBuffer.toArray(),n=this.timestampBuffer?.toArray()??[],r=t.slice(-e),i=n.slice(-r.length),o=this.currentTime();this.pointBuffer=new al(e),this.timestampBuffer=new al(e),r.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(i[t]??o)})}this.retainNewestLines(e)}updateConfig(e){const t=function(e){return"fitPadding"in e?{...e,fitPadding:mt(e.fitPadding)}:e}(e),n=this.config,r=this.getConfiguredWindowSize(),i=Object.keys(t).filter(e=>t[e]!==n[e]);this.config={...this.config,...t};const o=this.getConfiguredWindowSize(),a=this.streaming&&o!==r;a&&(this.resizeStreamingWindow(o),this.version++),"customLayout"in t&&!t.customLayout&&(this.lastCustomLayoutFailure=null),this.updateResults.recordConfig(i,{retainedDataChanged:a})}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}setAreas(e){this.areas=e,this.updateResults.recordData("replace",e.length)}setAreasWithResult(e){return this.setAreas(e),this.updateResults.last}setPoints(e){this.pointData=e.slice(),this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.updateResults.recordData("replace",e.length)}setPointsWithResult(e){return this.setPoints(e),this.updateResults.last}setLines(e){this.lineData=e.slice(),this.streaming&&this.retainNewestLines(),this.updateResults.recordData("replace",e.length)}setLinesWithResult(e){return this.setLines(e),this.updateResults.last}initStreaming(e){void 0!==e&&e!==this.config.windowSize&&(this.config={...this.config,windowSize:e});const t=this.getConfiguredWindowSize(),n=this.pointBuffer?this.pointBuffer.toArray():this.pointData,r=this.timestampBuffer?.toArray()??[],i=n.slice(-t),o=r.slice(-i.length),a=this.currentTime();this.pointBuffer=new al(t),this.timestampBuffer=new al(t),i.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(o[t]??a)}),this.pointData=[],this.retainNewestLines(t),this.streaming=!0}pushPoint(e){this.pointBuffer||this.initStreaming();const t=this.currentTime();ht(this.pointBuffer,e,this.timestampBuffer,t),this.lastIngestTime=t,this.updateResults.recordData("ingest",1)}pushPointWithResult(e){return this.pushPoint(e),this.updateResults.last}pushMany(e){this.pointBuffer||this.initStreaming();const t=this.currentTime();for(const n of e)ht(this.pointBuffer,n,this.timestampBuffer,t);this.lastIngestTime=t,this.updateResults.recordData("ingest",e.length)}pushManyWithResult(e){return this.pushMany(e),this.updateResults.last}pushLine(e){null!=e&&"object"==typeof e?(this.streaming||this.initStreaming(),this.lineData.push(e),this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",1)):this.updateResults.recordNoop("ingest")}pushManyLines(e){if(!Array.isArray(e)||0===e.length)return void this.updateResults.recordNoop("ingest");const t=e.filter(e=>null!=e&&"object"==typeof e);if(0!==t.length){this.streaming||this.initStreaming();for(const e of t)this.lineData.push(e);this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",t.length)}else this.updateResults.recordNoop("ingest")}removeLine(e){const{lineIdAccessor:t}=this.config;if(!t)throw Error("removeLine() requires lineIdAccessor to be configured");const n="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]),i=[];return this.lineData=this.lineData.filter(e=>!r.has(n(e)+"")||(i.push(e),!1)),i.length>0?(this.version++,this.updateResults.recordData("remove",i.length)):this.updateResults.recordNoop("remove"),i}getLines(){return this.lineData.slice()}removePoint(e){const{pointIdAccessor:t}=this.config;if(!t)throw Error("removePoint() requires pointIdAccessor to be configured");const n="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]);if(this.streaming&&this.pointBuffer){const e=e=>r.has(n(e)+"");!function(e,t,n){if(!t||0===t.size)return;const r=new Set;if(e.forEach((e,t)=>{n(e)&&r.add(t)}),0===r.size)return;const i=t.toArray();t.clear();for(let e=0;i.length>e;e++)r.has(e)||t.push(i[e])}(this.pointBuffer,this.timestampBuffer,e);const t=this.pointBuffer.remove(e);return t.length>0?(this.version++,this.updateResults.recordData("remove",t.length)):this.updateResults.recordNoop("remove"),t}{const e=[];return this.pointData=this.pointData.filter(t=>!r.has(n(t)+"")||(e.push(t),!1)),e.length>0?(this.version++,this.updateResults.recordData("remove",e.length)):this.updateResults.recordNoop("remove"),e}}clear(){this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.scene=[],this.scales=null,this._hasRenderedOnce=!1,this.activeTransition=null,this.prevPositions=null,this._quadtree=null,this._maxPointRadius=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,this._customLayoutFailedThisBuild=!1,this.version++,this.updateResults.recordData("clear")}restyleScene(e){const t=this._customRestyle;if(t){for(const n of this.scene){const r=this._baseStyles.get(n)??n.style,i=t(n,e);n.style=i?{...r,...i}:r}this.markStylePaintPending(),this.updateResults.recordRestyle(!0)}else this.updateResults.recordRestyle(!1)}computeScene(e){const{config:t}=this,n=this.projection,r=this.geoPath,i=this.scales,o=this.baseScale,a=[...this.baseTranslate],s=[...this.baseRotation],l=this.scene;this.projection=function(e){if(!e)return We();if("string"==typeof e){const t=Pl[e];return t?t():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${e}", falling back to equalEarth`),We())}if("object"==typeof e&&"type"in e){const t=Pl[e.type],n=t?t():We();return e.rotate&&"rotate"in n&&n.rotate(e.rotate),e.center&&"center"in n&&n.center(e.center),n}return e}(t.projection),this.geoPath=Se(this.projection),this.fitProjection(e),this.geoPath=Se(this.projection);const c=this.projection;this.scales={projection:c,geoPath:this.geoPath,projectedPoint:(e,t)=>c([e,t]),invertedPoint:(e,t)=>c.invert?c.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const u=this.buildSceneNodes(e);if(this._customLayoutFailedThisBuild)!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.projection=n,this.geoPath=r,this.scales=i,this.baseScale=o,this.baseTranslate=a,this.baseRotation=s):(this.scene=[],this.rebuildQuadtree());else{if(this.scene=u,this.rebuildQuadtree(),t.projectionTransform&&this.applyCartogramTransform(t.projectionTransform,e),t.decay&&this.streaming&&this.applyDecay(),t.pulse&&this.streaming&&this.applyPulse(),t.transition&&!this._hasRenderedOnce&&this.scene.length>0&&t.introAnimation){const t=e.width/2,n=e.height/2,r=this.scene.filter(e=>"point"===e.type).map(e=>({...e,x:t,y:n}));r.length>0&&this.startTransition(r)}this._hasRenderedOnce=!0,t.transition&&l.length>0&&this.startTransition(l),this.version++}}fitProjection(e){const t=this.projection,n=this.config,r=[...this.areas],i=it(n.xAccessor,"lon"),o=it(n.yAccessor,"lat"),a=this.getPoints();if(a.length>0){const e=a.map(e=>[i(e),o(e)]);r.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:e}})}const s=ot(n.lineDataAccessor);for(const e of this.lineData){const t=s(e);if(t&&t.length>0){const e=t.map(e=>[i(e),o(e)]);r.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}})}}if(0!==r.length){if(n.projectionExtent){const[[r,i],[o,a]]=n.projectionExtent;t.fitExtent([[0,0],[e.width,e.height]],{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[r,i],[r,a],[o,a],[o,i],[r,i]]]}})}else if(t.clipAngle&&(t.clipAngle()??0)>0){const r=n.fitPadding??0,i=Math.min(e.width,e.height);t.scale(i/2-i*r),t.translate([e.width/2,e.height/2])}else{const i=n.fitPadding??0,o=e.width*i,a=e.height*i;t.fitExtent([[o,a],[e.width-o,e.height-a]],{type:"FeatureCollection",features:r})}this.baseScale=t.scale(),this.baseTranslate=t.translate(),this.baseRotation=t.rotate?.()??[0,0,0]}}applyZoomTransform(e,t){const n=this.projection;if(!n)return;const r=this.geoPath,i=this.scales,o=n.scale(),a=[...n.translate()],s=this.currentZoom;n.scale(this.baseScale*e.k),n.translate([this.baseTranslate[0]*e.k+e.x,this.baseTranslate[1]*e.k+e.y]),this.currentZoom=e.k,this.geoPath=Se(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyZoomScale(e,t){const n=this.projection;if(!n)return;const r=this.geoPath,i=this.scales,o=n.scale(),a=[...n.translate()],s=this.currentZoom;n.scale(this.baseScale*e),n.translate(this.baseTranslate),this.currentZoom=e,this.geoPath=Se(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyRotation(e,t){const n=this.projection;if(!n||!n.rotate)return;const r=this.geoPath,i=this.scales,o=[...n.rotate()];n.rotate(e),this.geoPath=Se(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const a=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.rotate(o),this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=a,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}setRotation(e){const t=this.projection;t&&t.rotate&&t.rotate(e)}hasProjection(){return null!=this.projection}getRotation(){return this.projection?.rotate?.()??this.baseRotation}getBaseProjectionState(){return{scale:this.baseScale,translate:[...this.baseTranslate]}}getPoints(){return this.streaming&&this.pointBuffer?this.pointBuffer.toArray():this.pointData}rebuildQuadtree(){let t=0,n=0;for(const e of this.scene)"point"===e.type&&!1!==e.interactive&&(n++,e.r>t&&(t=e.r));if(this._maxPointRadius=t,e.QUADTREE_THRESHOLD>=n)return void(this._quadtree=null);const r=Array(n);let i=0;for(const e of this.scene)"point"===e.type&&!1!==e.interactive&&(r[i++]=e);this._quadtree=(0,ol.quadtree)().x(e=>e.x).y(e=>e.y).addAll(r)}get quadtree(){return this._quadtree}get maxPointRadius(){return this._maxPointRadius}buildSceneNodes(e){this._customLayoutFailedThisBuild=!1;const{config:t}=this,n=this.projection,r=this.geoPath;if(t.customLayout&&this.scales){const n=t.layoutMargin??{top:0,right:0,bottom:0,left:0},r=function(e,t,n=Al){if(e&&"object"==typeof e&&!Array.isArray(e)){const t=Object.values(e).filter(e=>"string"==typeof e&&e.length>0);if(t.length>0)return t}if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e){const t=Object.prototype.hasOwnProperty.call(jl,e)?jl[e]:void 0;if(Array.isArray(t)&&t.length>0)return t}return t&&t.length>0?t:n}(t.colorScheme,t.themeCategorical,Rl),i={areas:this.areas.slice(),points:this.getPoints().slice(),lines:this.lineData.slice(),scales:this.scales,dimensions:{width:e.width,height:e.height,margin:n,plot:{x:0,y:0,width:e.width,height:e.height}},theme:{semantic:t.themeSemantic??{},categorical:[...r]},resolveColor:tt(r,t.colorScheme),config:t.layoutConfig??{},selection:t.layoutSelection??null},o=function(e){try{return{kind:"success",result:e.run()}}catch(t){const n=e.hasPreviousResult,r=function(e,t,n,r){const i=function(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message||"Custom layout threw."};if("string"==typeof e)return{name:"Error",message:e};if(null==e)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:e+""}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}(t),o="network"===e?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:e,source:o,message:`Semiotic ${e} ${o} failed: ${i.message}`,error:i,recovery:n?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:n,affectedRevision:r}}(e.family,t,n,e.revision);"production"!==process.env.NODE_ENV&&console.error(`[semiotic] ${e.logLabel} threw:`,t);try{e.onLayoutError?.(r)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:r,preservedLastGoodScene:n}}}({family:"geo",logLabel:"geo customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:t.onLayoutError,run:()=>t.customLayout(i)});if("failure"===o.kind)return this.lastCustomLayoutFailure=o.diagnostic,this._customLayoutFailedThisBuild=!0,o.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,[]);const a=o.result,s=a.nodes??[];if(this.customLayoutOverlays=a.overlays??null,this.lastCustomLayoutResult=a,this.lastCustomLayoutFailure=null,this._customRestyle=a.restyle,this.hasCustomRestyle=!!a.restyle,this._baseStyles=new WeakMap,this.hasCustomRestyle)for(const e of s){this._baseStyles.set(e,e.style);const n=a.restyle?.(e,t.layoutSelection??null);n&&(e.style={...e.style,...n})}return function(e){if("production"===process.env.NODE_ENV)return;const{label:t,nodes:n,overlays:r,warned:i}=e;nt(r)&&0===n.length&&rt(i,"overlay-only",`[semiotic] ${t} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),n.length>0&&n.every(e=>null==e.datum)&&rt(i,"null-datums",`[semiotic] ${t} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}({label:"geo customLayout",nodes:s,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),s}return this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=new WeakMap,function({config:e,projection:t,path:n,areas:r,points:i,lines:o,layout:a}){const s=it(e.xAccessor,"lon"),l=it(e.yAccessor,"lat"),c=[],u=function(e){return{fill:e.themeSemantic?.surface||"#e0e0e0",stroke:e.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}(e),d=function(e){return{stroke:e.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}(e),h=function(e){return{fill:e.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}(e);if(e.graticule){const t=!0===e.graticule?{}:e.graticule,r=function(){function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return(0,ps.range)(Pa(o/g)*g,i,g).map(h).concat((0,ps.range)(Pa(c/y)*y,l,y).map(f)).concat((0,ps.range)(Pa(r/p)*p,n,p).filter(function(e){return Aa(e%g)>va}).map(u)).concat((0,ps.range)(Pa(s/m)*m,a,m).filter(function(e){return Aa(e%y)>va}).map(d))}var n,r,i,o,a,s,l,c,u,d,h,f,p=10,m=p,g=90,y=360,v=2.5;return e.lines=function(){return t().map(function(e){return{type:"LineString",coordinates:e}})},e.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(f(l).slice(1),h(i).reverse().slice(1),f(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()},e.extentMajor=function(t){return arguments.length?(c=+t[0][1],l=+t[1][1],(o=+t[0][0])>(i=+t[1][0])&&(t=o,o=i,i=t),c>l&&(t=c,c=l,l=t),e.precision(v)):[[o,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(s=+t[0][1],a=+t[1][1],(r=+t[0][0])>(n=+t[1][0])&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),e.precision(v)):[[r,s],[n,a]]},e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()},e.stepMajor=function(t){return arguments.length?(g=+t[0],y=+t[1],e):[g,y]},e.stepMinor=function(t){return arguments.length?(p=+t[0],m=+t[1],e):[p,m]},e.precision=function(t){return arguments.length?(v=+t,u=re(s,a,90),d=ie(r,n,v),h=re(c,l,90),f=ie(o,i,v),e):v},e.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}();t.step&&r.step(t.step);const i=n(r())||"";i&&c.push({type:"geoarea",pathData:i,centroid:[a.width/2,a.height/2],bounds:[[0,0],[a.width,a.height]],screenArea:0,style:{fill:"none",stroke:t.stroke||"#e0e0e0",strokeWidth:t.strokeWidth??.5,strokeDasharray:t.strokeDasharray||"2,2"},datum:null,interactive:!1})}for(const t of r){const r=n(t);if(!r)continue;const i=n.centroid(t),o=n.bounds(t),a=n.area(t);c.push({type:"geoarea",pathData:r,centroid:i,bounds:o,screenArea:a,style:at(e.areaStyle,t,u),datum:t,interactive:!0})}const f=ot(e.lineDataAccessor);for(const n of o){const r=f(n);if(!r||2>r.length)continue;let i=[];if("geo"===e.lineType){const e=Array(r.length);for(let t=0;r.length>t;t++)e[t]=[s(r[t]),l(r[t])];for(let n=0;e.length-1>n;n++){const r=e[n],o=e[n+1],a=X(r,o)||0,s=Math.max(2,Math.ceil(a/(Math.PI/180))),l=oe(r,o);for(let e=0;s>=e;e++){if(n>0&&0===e)continue;const r=t(l(e/s));null!=r&&i.push(r)}}}else for(let e=0;r.length>e;e++){const n=r[e],o=t([s(n),l(n)]);null!=o&&i.push(o)}if(2>i.length)continue;const o=at(e.lineStyle,n,d),u="number"==typeof o.strokeWidth?o.strokeWidth:1;2!==r.length||2>i.length||"arc"!==e.flowStyle?2!==r.length||2>i.length||"offset"!==e.flowStyle||(i="geo"===e.lineType?ct(i,u):ut(i[0],i[i.length-1],0,0,u)):i=lt(i[0],i[i.length-1]);const h=st(i,a.width);if(h.length>1)for(const e of h)2>e.length||c.push({type:"line",path:e,style:{...o,_edgeFade:!0},datum:n});else c.push({type:"line",path:2>i.length&&h[0]||i,style:o,datum:n})}const p=e.pointIdAccessor?"function"==typeof e.pointIdAccessor?e.pointIdAccessor:t=>t[e.pointIdAccessor]:null,m=t.clipAngle?t.clipAngle()??0:0,g=m>0?m*Math.PI/180:null,y=t.rotate?t.rotate():[0,0,0],v="function"==typeof t.center?t.center():[0,0],b=[(v[0]??0)-y[0],(v[1]??0)-y[1]];for(const n of i){const r=s(n),i=l(n);if(null!=g&&X([r,i],b)>g)continue;const o=t([r,i]);if(!o)continue;const a=e.pointStyle?e.pointStyle(n):{...h},u={type:"point",x:o[0],y:o[1],r:a.r||4,style:a,datum:n,pointId:p?p(n)+"":void 0};c.push(u)}return c}({config:t,projection:n,path:r,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:e})}applyCartogramTransform(e,t){const n=function(e,t,n,r){const i=e.filter(e=>"point"===e.type);if(2>i.length)return null;const o=t.strength??1,a=Number.isFinite(o)?Math.max(0,Math.min(1,o)):1,s="strip"===t.layout?"strip":"radial";if("radial"===s&&0===a)return null;const l=t.centerAccessor?"function"==typeof t.centerAccessor?t.centerAccessor:e=>e[t.centerAccessor]:e=>e.id,c="function"==typeof t.costAccessor?t.costAccessor:e=>e[t.costAccessor],u=i.find(e=>e.datum&&l(e.datum)+""==t.center+"");if(!u)return"production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Distance cartogram center "${t.center}" not found in point data`),null;const d=function(e,t=-1/0){let n=t;for(const t of e)t>n&&(n=t);return n}(i.map(e=>e.datum?Number(c(e.datum)):NaN).filter(e=>isFinite(e)&&e>=0),1);r>0&&"production"!==process.env.NODE_ENV&&console.warn("GeoFrame: Distance cartogram does not support area rendering. Areas will be ignored. Remove areas or set projectionTransform to null to render them.");for(let t=e.length-1;t>=0;t--){const n=e[t];"geoarea"===n.type&&n.interactive&&e.splice(t,1)}const h="strip"===s?function(e,t,n,r,i){const o=Math.max(3,Math.min(8,.35*i.height)),a=Math.max(1,i.width-2*o),s=i.height/2,l=(0,Nl.scaleLinear)().domain([0,r]).range([0,a]);t.x=o,t.y=s;const c=[];for(const i of e){if(i===t)continue;if(!i.datum){i.x=o,i.y=s;continue}const e=Number(n(i.datum)),a=o+(isFinite(e)&&e>=0&&r>0?l(e):0);i.x=a,i.y=s,c.push({node:i,x:a})}c.sort((e,t)=>e.x-t.x);const u=Math.max(0,Math.min(i.height/2-1,6));let d=0;for(;c.length>d;){let e=d+1;for(;c.length>e&&3>Math.abs(c[e].x-c[d].x);)e++;const t=e-d;if(t>1&&u>0)for(let e=0;t>e;e++)c[d+e].node.y=s+(e-(t-1)/2)*Math.min(2.5,2*u/Math.max(1,t-1));d=e}return{cx:o,cy:s,maxCost:r,availableRadius:a,layout:"strip"}}(i,u,c,d,n):function(e,t,n,r,i,o){const a=t.x,s=t.y,l=o.width/2,c=o.height/2,u=Math.min(o.width,o.height)/2,d=(0,Nl.scaleLinear)().domain([0,r]).range([0,u]);for(const o of e){if(o===t)continue;if(!o.datum)continue;const e=o.x,u=o.y,h=Math.atan2(u-s,e-a),f=Math.hypot(e-a,u-s),p=Number(n(o.datum)),m=isFinite(p)&&p>=0?r>0?d(p):0:f,g=l+Math.cos(h)*m,y=c+Math.sin(h)*m;o.x=e+(g-e)*i,o.y=u+(y-u)*i}return t.x=a+(l-a)*i,t.y=s+(c-s)*i,{cx:t.x,cy:t.y,maxCost:r,availableRadius:u,layout:"radial"}}(i,u,c,d,a,n),f=e.filter(e=>"line"===e.type);if(f.length>0){const e=new Map;for(const t of i)null!=t.pointId&&e.set(t.pointId+"",[t.x,t.y]);for(const n of f){const r=n.datum?.source,i=n.datum?.target;if(null!=r&&null!=i){const o=e.get(r+""),a=e.get(i+"");if(o&&a)if("fractional"===t.lineMode&&n.path.length>2){const e=n.path[0],t=n.path[n.path.length-1],r=[o[0]-e[0],o[1]-e[1]],i=[a[0]-t[0],a[1]-t[1]],s=[0];for(let e=1;n.path.length>e;e++)s.push(s[e-1]+Math.hypot(n.path[e][0]-n.path[e-1][0],n.path[e][1]-n.path[e-1][1]));const l=s[s.length-1];n.path=n.path.map((e,t)=>{const o=l>0?s[t]/l:t/(n.path.length-1);return[e[0]+r[0]*(1-o)+i[0]*o,e[1]+r[1]*(1-o)+i[1]*o]})}else n.path=[o,a]}}}return h}(this.scene,e,t,this.areas.length);n&&(this.cartogramLayout=n)}applyDecay(){const e=this.config.decay;if(!e||!this.pointBuffer)return;const t=this.pointBuffer.size;if(0===t)return;const n=this.scene.filter(e=>"point"===e.type);for(let r=0;n.length>r;r++){const i=qe(e,r,t);n[r]._decayOpacity=i,n[r].style={...n[r].style,opacity:i}}}applyPulse(e=this.currentTime()){const t=this.config.pulse;if(!t||!this.timestampBuffer)return!1;const n=this.scene.filter(e=>"point"===e.type),r=this.timestampBuffer.toArray(),i=t.color||"rgba(255,255,255,0.6)",o=t.glowRadius??4;let a=!1;for(let s=0;n.length>s&&r.length>s;s++){const l=Ge(t,r[s],e);a=Ve(n[s],l,i,o)||a}return a}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(e)}hasActivePulsesAt(e){return!!this.config.pulse&&function(e,t,n=("undefined"!=typeof performance?performance.now():Date.now())){if(!t||0===t.size)return!1;const r=e.duration??500,i=t.peek();return null!=i&&r>n-i}(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}startTransition(e){const t=this.config.transition?.duration??300;if(0>=t)return;const n=new Map;for(const t of e)"point"===t.type&&t.pointId&&n.set(t.pointId,[t.x,t.y]);const r=this.scene.filter(e=>"point"===e.type);let i=!1;for(const e of r)if(e.pointId){const t=n.get(e.pointId);t&&(e._targetX=e.x,e._targetY=e.y,e.x=t[0],e.y=t[1],(Math.abs(t[0]-e._targetX)>.5||Math.abs(t[1]-e._targetY)>.5)&&(i=!0))}for(const e of r)e.pointId&&!n.has(e.pointId)&&(e._targetOpacity=e.style?.opacity??e.style?.fillOpacity??1,e.style={...e.style,opacity:0},i=!0);i&&(this.activeTransition={startTime:this.currentTime(),duration:t})}cancelIntroAnimation(){this.activeTransition=null;for(const e of this.scene)"point"===e.type&&(null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0),null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0))}advanceTransition(e){if(!this.activeTransition)return!1;const t=function(e,t){return Math.min((e-t.startTime)/t.duration,1)}(e,this.activeTransition),n=function(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}(t),r=this.scene.filter(e=>"point"===e.type);for(const e of r){if(null!=e._targetX&&null!=e._targetY){const t=e.y;e.x=$e(e.x,e._targetX,n),e.y=$e(t,e._targetY,n)}null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity*n})}if(t>=1){for(const e of r)null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0),null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0);return this.activeTransition=null,!1}return!0}};Ul.QUADTREE_THRESHOLD=500;var Yl=Ul;Object.assign(Yl.prototype,{getLastUpdateResult:function(){return this.updateResults.last},getUpdateSnapshot:function(){return this.updateResults.last},subscribeUpdateResult:function(e){return this.updateResults.subscribe(e)},setLayoutSelection:function(e){this.config.layoutSelection=e},markStylePaintPending:function(){Vl.set(this,!0)},consumeStylePaintPending:function(){const e=!0===Vl.get(this);return Vl.delete(this),e}});var Xl=require("react"),Zl=require("d3-selection"),Kl=require("d3-zoom"),Ql=Object.freeze([]),Jl=require("react"),ec={sceneGeometry:0,layout:0,domain:0},tc="production"!==process.env.NODE_ENV,nc={revisions:ec,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},rc=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=ec,this.lastObserved=ec,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){tc&&(this.lastObserved=vt(this.lastObserved,yt(e)))}beforeCompute(e,t){if(!tc)return nc;const n=vt(yt(e),this.lastObserved),r=function(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}(n),i=!((o=n).sceneGeometry===(a=this.lastConsumed).sceneGeometry&&o.layout===a.layout&&o.domain===a.domain);var o,a;return{revisions:n,signature:r,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:i,warnUnconsumed:!t&&i&&this.lastUnconsumedWarning!==r}}afterCompute(e,t,n){if(tc){if(t&&e.wasUnconsumed&&(this.lastConsumed=e.revisions),e.warnUnconsumed&&!t)return console.warn(`[semiotic] ${this.hostName} observed scene-affecting revisions without a scene rebuild: ${e.signature}.`),void(this.lastUnconsumedWarning=e.signature);t&&e.sawSignals&&!e.wasUnconsumed&&!n&&this.lastDuplicateWarning!==e.signature?(console.warn(`[semiotic] ${this.hostName} performed scene rebuild with unchanged scene revisions: ${e.signature}.`),this.lastDuplicateWarning=e.signature):t&&!e.sawSignals&&(this.lastDuplicateWarning="")}}},ic=(0,Jl.memo)(function({store:e,diagnostics:t}){return(0,Jl.useEffect)(()=>{const n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null}),oc=[40,40],ac=[.5,.5],sc=null,lc=Vo(require("react")),cc=require("react"),uc=require("./semiotic-client-cjs-shared.min.js"),dc=require("react"),hc=require("react"),fc="undefined"==typeof window?hc.useEffect:hc.useLayoutEffect,pc=new WeakMap,mc=0,gc=!1,yc=null,vc=null,bc=null,xc=null,wc=new Set,kc=()=>"undefined"!=typeof performance?performance.now():Date.now(),Sc=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??kc,this.lastWallTime=Et(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){const e=Et(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??kc;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=Et(t,this.lastWallTime))}setRandomSource(e,t){const n=function(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:function(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}(n)))}},Mc=34,jc=58,Ac=16,Cc=6,Rc=10,Lc=22,Pc=100,Nc=10,Ec=3,Ic=46,Tc=26,Dc=22,zc=46,_c=64,Oc=34,Fc=70,Wc="undefined"==typeof window?cc.useEffect:cc.useLayoutEffect,Bc={requestAnimationFrame:e=>("undefined"==typeof window?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>("undefined"==typeof window?globalThis:window).cancelAnimationFrame(e)},Hc=require("react"),$c=require("react"),qc={fresh:1,aging:.7,stale:.45,expired:.25},Gc={alpha:1,band:"fresh",isStale:!1},Vc=require("react/jsx-runtime"),Uc=Vo(require("react")),Yc=require("./semiotic-client-cjs-shared.min.js"),Xc=require("react"),Zc=require("react/jsx-runtime"),Kc="var(--semiotic-bg, #ffffff)",Qc=require("react/jsx-runtime"),Jc=require("react/jsx-runtime"),eu=Vo(require("react")),tu=require("react/jsx-runtime"),nu=require("d3-hierarchy"),ru=require("d3-shape"),iu=null,ou=require("react/jsx-runtime"),au=new Map,su=new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]),lu=require("react/jsx-runtime"),cu={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"},uu=require("react/jsx-runtime"),du={secondary:0,primary:3},hu=require("react/jsx-runtime"),fu={linear:ru.curveLinear,monotoneX:ru.curveMonotoneX,monotoneY:ru.curveMonotoneY,step:ru.curveStep,stepAfter:ru.curveStepAfter,stepBefore:ru.curveStepBefore,basis:ru.curveBasis,cardinal:ru.curveCardinal,catmullRom:ru.curveCatmullRom},pu=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),mu=(new Set(["label","callout","callout-circle","callout-rect"]),32),gu=6,yu=4,vu=8,bu=72,xu={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"},wu=Vo(require("react")),ku={fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},Su={fontSize:"var(--semiotic-legend-font-size, 12px)"},Mu=Vo(require("react")),ju=require("react/jsx-runtime"),Au=require("react/jsx-runtime"),Cu=(e,t,n,r,i,o,a,s,l,c,u)=>{const{items:d}=e,h=[];let f=0;const p={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=i,metrics:u};return d.forEach((e,t)=>{h.push(Xn(p,e,t,`translate(0,${f})`,"ArrowUp","ArrowDown")),f+=u.rowHeight}),h},Ru=require("react/jsx-runtime"),Lu=require("react/jsx-runtime"),Pu=require("react/jsx-runtime"),Nu=Vo(require("react")),Eu=(Vo(require("react")),require("react/jsx-runtime")),Iu=Vo(require("react")),Tu=require("react/jsx-runtime"),Du=require("react/jsx-runtime"),zu="undefined"==typeof window||"undefined"==typeof document,_u=require("react"),Ou="undefined"!=typeof window?_u.useLayoutEffect:_u.useEffect,Fu=()=>()=>{},Wu=()=>!1,Bu=()=>!0,Hu=require("react"),$u=require("react/jsx-runtime"),qu="undefined"==typeof window?Hu.useEffect:Hu.useLayoutEffect,Gu=require("react"),Vu=Vo(require("react")),Uu=Vo(require("react")),Yu=(require("react/jsx-runtime"),Uu.createContext(null)),Xu=require("react/jsx-runtime"),Zu={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},Ku=e=>{if(null==e)return"";const t=Math.round(100*e)/100;return Number.isNaN(t)?"":t+""},Qu=require("react/jsx-runtime"),Ju=Vu.lazy(()=>Promise.resolve().then(()=>(Qo(),Uo))),ed="semiotic-accessible-data-table",td=ed+" semiotic-accessible-data-table-hidden",nd=ed+" semiotic-accessible-data-table-visible",rd={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},id={position:"absolute",top:0,left:0,right:0,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",padding:"14px 16px 12px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontFamily:"var(--semiotic-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)",fontSize:13,lineHeight:1.5,color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",borderRadius:"var(--semiotic-border-radius, 0px) var(--semiotic-border-radius, 0px) 0 0"},od={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},ad={position:"absolute",top:10,right:10,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",cursor:"pointer",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:13,lineHeight:1,padding:0,borderRadius:"var(--semiotic-border-radius, 4px)"},sd={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},ld={textAlign:"left",padding:"5px 10px",borderBottom:"2px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))"},cd={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},ud={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},dd={marginTop:8,padding:"4px 10px",fontSize:12,cursor:"pointer",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",borderRadius:"var(--semiotic-border-radius, 4px)",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",fontFamily:"inherit"},hd=require("react"),fd=require("react/jsx-runtime"),pd="var(--semiotic-focus, #005fcc)",md=Vo(require("react")),gd=Vo(require("react")),yd=require("react/jsx-runtime"),vd={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};jr(Mr);var bd,xd=require("react/jsx-runtime"),wd=require("d3-zoom"),kd=require("d3-selection"),Sd=require("d3-shape"),Md=require("d3-shape"),jd=new WeakMap,Ad=1,Cd=class{constructor(e=256){this.cache=new Map,this.limit=Hr(e)}setLimit(e){this.limit=Hr(e),this.cache.size>this.limit&&this.evict()}get(e){const t=this.cache.get(e);return t&&(t.lastUsed=performance.now()),t}set(e,t){this.cache.set(e,t),this.cache.size>this.limit&&this.evict()}evict(){for(;this.cache.size>this.limit;){let e,t=1/0;for(const[n,r]of this.cache)t>r.lastUsed&&(t=r.lastUsed,e=n);if(!e)break;{const t=this.cache.get(e);t&&(t.img.onload=null,t.img.onerror=null,t.img.src=""),this.cache.delete(e)}}}clear(){for(const e of this.cache.values())e.img.onload=null,e.img.onerror=null,e.img.src="";this.cache.clear()}},Rd=class{constructor(e){this.capacity=e,this.particles=Array(e);for(let t=0;e>t;t++)this.particles[t]={t:0,offset:0,lineIndex:0,active:!1,x:0,y:0}}spawn(e,t=Math.random){for(let n=0;this.capacity>n;n++){const r=this.particles[n];if(!r.active)return r.active=!0,r.t=0,r.offset=.6*(t()-.5),r.lineIndex=e,r.x=0,r.y=0,r}return null}step(e,t,n,r){for(let i=0;this.capacity>i;i++){const o=this.particles[i];if(!o.active)continue;const a=n[o.lineIndex];if(!a||2>a.length){o.active=!1;continue}if(o.t+=e*t,o.t>=1){o.active=!1;continue}const s=$r(a),l=qr(a,o.t*s),c=(r[o.lineIndex]||2)/2;o.x=l.x+l.nx*o.offset*c*2,o.y=l.y+l.ny*o.offset*c*2}}countForLine(e){let t=0;for(let n=0;this.capacity>n;n++)this.particles[n].active&&this.particles[n].lineIndex===e&&t++;return t}clear(){for(let e=0;this.capacity>e;e++)this.particles[e].active=!1}},Ld=Vo(require("react")),Pd=Vo(require("react")),Nd=require("react/jsx-runtime"),Ed=new Set,Id=["name","label","title"],Td=["type","kind","category","group","class","status","role","shape"],Dd=["value","amount","total","count","weight","score"],zd=new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]),_d=require("react/jsx-runtime"),Od=(require("react/jsx-runtime"),require("react/jsx-runtime"));oi.ownsChrome=!0;var Fd={top:10,right:10,bottom:10,left:10},Wd=null,Bd={width:28,height:28,border:"1px solid rgba(0,0,0,0.2)",borderRadius:4,background:"rgba(255,255,255,0.9)",color:"#333",fontSize:16,fontWeight:600,lineHeight:1,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},Hd=require("react"),$d=require("react"),qd="__semioticSelectionData",Gd=Vo(require("react")),Vd=require("react"),Ud=require("react/jsx-runtime"),Yd=(0,ga.memo)((0,ga.forwardRef)(function(e,t){const{projection:n,projectionExtent:r,fitPadding:i,projectionTransform:o,areas:a,points:s,lines:l,customLayout:c,layoutConfig:u,layoutSelection:d,onLayoutError:h,xAccessor:f,yAccessor:p,lineDataAccessor:m,pointIdAccessor:g,lineIdAccessor:y,lineType:v="geo",flowStyle:b="basic",graticule:x,zoomable:w,zoomExtent:k,onZoom:S,dragRotate:M,showParticles:j,particleStyle:A,tileURL:C,tileAttribution:R,tileCacheSize:L,size:P,width:N,height:E,responsiveWidth:I,responsiveHeight:T,margin:D,className:z,background:_,maxDevicePixelRatio:O,windowSize:F=500,renderMode:W,areaStyle:B,pointStyle:H,lineStyle:$,colorScheme:q,enableHover:G=!0,hoverAnnotation:V,tooltipContent:U,allowTooltipOverflow:Y=!1,customClickBehavior:X,customHoverBehavior:Z,onObservation:K,annotationObservationCallback:Q,chartId:J,annotations:ee,onAnnotationActivate:te,autoPlaceAnnotations:ne,svgAnnotationRules:re,decay:ie,pulse:oe,transition:ae,animate:se,staleness:le,frameScheduler:ce,clock:ue,random:de,seed:he,paused:fe=!1,suspendWhenHidden:pe=!0,backgroundGraphics:me,foregroundGraphics:ge,title:ye,legend:ve,legendPosition:be,legendLayout:xe,legendHoverBehavior:we,legendClickBehavior:ke,legendHighlightedCategory:Se,legendIsolatedCategories:Me,legendCategoryAccessor:je,onCategoriesChange:Ae,showAxes:Ce,accessibleTable:Re=!0,description:Le,summary:Pe}=e,{customHoverBehavior:Ne,customClickBehavior:Ee,hasClickBehavior:Ie}=function({customHoverBehavior:e,customClickBehavior:t,onObservation:n,chartId:r,chartType:i}){const o=!(!e&&!n),a=!(!t&&!n),s=(0,Hd.useCallback)((t,o)=>{e?.(t,o),di({onObservation:n,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:i,chartId:r,context:o})},[r,i,e,n]),l=(0,Hd.useCallback)((e,o)=>{t?.(e,o),hi({onObservation:n,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:i,chartId:r,context:o})},[r,i,t,n]);return{customHoverBehavior:o?s:void 0,customClickBehavior:a?l:void 0,hasClickBehavior:a}}({customHoverBehavior:Z,customClickBehavior:X,onObservation:K,chartId:J,chartType:"StreamGeoFrame"}),Te=P||[N||600,E||400],De=(0,ga.useRef)(!0),ze=Yt({sizeProp:Te,responsiveWidth:I,responsiveHeight:T,userMargin:D,marginDefault:Fd,title:ye,legend:ve,legendPosition:be,legendLayout:xe,legendMarginReserved:e.__legendMarginReservedFor===ve,animate:se,transitionProp:ae,frameScheduler:ce,clock:ue,random:de,seed:he,paused:fe,suspendWhenHidden:pe,themeDirtyRef:De}),{reducedMotionRef:_e,responsiveRef:Oe,size:Fe,margin:We,adjustedWidth:Be,adjustedHeight:He,transition:$e,introEnabled:qe,tableId:Ge,frameRuntime:Ve,rafRef:Ue,renderFnRef:Ye,scheduleRender:Xe,currentTheme:Ze}=ze,Ke=function(){const[e,t]=(0,_u.useState)(!1);return Ou(()=>{t(!0)},[]),e}(),Qe=function(){const e=(0,_u.useSyncExternalStore)(Fu,Wu,Bu);return(0,_u.useRef)(e).current}(),Je=(0,ga.useMemo)(()=>Array.isArray(a)?gt(a):a,[a]),et=(0,ga.useMemo)(()=>gt(s),[s]),tt=(0,ga.useMemo)(()=>gt(l),[l]),nt=M??"orthographic"===li(n),rt=function(e){const t=(0,Gu.useRef)(e);return function(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return dr(e,t);if(!hr(e)||!hr(t))return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;const n=e[r],i=t[r];if(!Object.is(n,i))if(Array.isArray(n)&&Array.isArray(i)){if(!dr(n,i))return!1}else{if(!hr(n)||!hr(i))return!1;if(!ur(n,i))return!1}}return!0}(t.current,e)||(t.current=e),t.current}((0,ga.useMemo)(()=>({projection:n,projectionExtent:r,fitPadding:i,xAccessor:f,yAccessor:p,lineDataAccessor:m,lineType:v,flowStyle:b,areaStyle:B,pointStyle:H,lineStyle:$,colorScheme:q,themeSemantic:Xt(Ze),themeSequential:Ze?.colors?.sequential,themeDiverging:Ze?.colors?.diverging,themeCategorical:Ze?.colors?.categorical,graticule:x,projectionTransform:o,windowSize:F,clock:Ve.now,decay:ie,pulse:oe,transition:$e,introAnimation:qe,annotations:ee,pointIdAccessor:g,lineIdAccessor:y,customLayout:c,layoutConfig:u,onLayoutError:h,layoutMargin:We}),[n,r,i,f,p,m,v,b,B,H,$,q,Ze,x,o,F,Ve.now,ie,oe,$e,qe,ee,g,y,c,u,h,We])),it=(0,ga.useRef)(null);it.current||(it.current=new Yl(rt));const ot=it.current,at=(0,ga.useRef)(null),st=at.current??(at.current=function(e){const t=new Set;let n=0,r=e;return{subscribe:e=>(t.add(e),()=>t.delete(e)),getSnapshot:()=>n,sync(e){if(e!==r){r=e,n+=1;for(const e of t)e()}}}}(ot.scales)),lt=zu||!Ke&&Qe;lt&&(Je||s||l)&&(Je&&ot.setAreas(Je),s&&ot.setPoints(et),l&&ot.setLines(tt),ot.computeScene({width:Be,height:He}));const{resolvedForeground:ct,resolvedBackground:ut,themeBackground:dt,surfaceBackground:ht}=function({tracker:e,readScales:t,...n}){const r=r=>"function"==typeof r?Gd.createElement(mi,{graphics:r,size:n.size,margin:n.margin,readScales:t,tracker:e}):r;return{...function({foregroundGraphics:e,backgroundGraphics:t,size:n,margin:r,scales:i,background:o,themeBackgroundColor:a,resolveScaleAwareGraphics:s=!0}){const l=`var(--semiotic-bg, ${a})`;return{resolvedForeground:s||"function"!=typeof e?pi(e,n,r,i):null,resolvedBackground:s||"function"!=typeof t?pi(t,n,r,i):null,themeBackground:l,surfaceBackground:fr({background:o,hasBackgroundGraphics:!!t,themeBackground:l})}}({...n,resolveScaleAwareGraphics:!1}),resolvedForeground:r(n.foregroundGraphics),resolvedBackground:r(n.backgroundGraphics)}}({foregroundGraphics:ge,backgroundGraphics:me,size:Fe,margin:We,scales:ot.scales,background:_,themeBackgroundColor:Ze.colors.background,tracker:st,readScales:()=>ot.scales}),ft=(0,ga.useRef)(null),pt=(0,ga.useRef)(null),mt=(0,ga.useRef)(null);C&&!mt.current&&(mt.current=new Cd(L??256)),mt.current?.setLimit(L??256);const yt=(0,ga.useRef)(ee),vt=(0,ga.useRef)(null),bt=(0,ga.useRef)(wd.zoomIdentity),xt=(0,ga.useRef)(!1),kt=(0,ga.useRef)(null),Mt=(0,ga.useCallback)(e=>{kt.current=e,Oe&&"object"==typeof Oe&&(Oe.current=e)},[Oe]),Ct=(0,ga.useRef)(null),Lt=(0,ga.useRef)(null),Pt=(0,ga.useRef)(null),Et=(0,ga.useRef)(0);if(j&&!Pt.current){const e=A?.maxPerLine??si();Pt.current=new Rd(50*e)}const It=(0,ga.useRef)(null),Tt=(0,ga.useRef)(!1),Dt=(0,ga.useRef)(null),zt=(0,ga.useRef)(!1),_t=(0,ga.useRef)(!1),Ot=(0,Jl.useRef)(new rc("StreamGeoFrame")),Ft=(0,ga.useRef)(void 0),[Wt,Bt]=(0,ga.useState)(null),[,Ht]=(0,ga.useState)(0),$t=(0,ga.useRef)(0),[qt,Gt]=(0,ga.useState)(!1),Vt=function(e,t,n,r){const i=(0,hd.useRef)({accessor:t,onChange:n,readData:r}),o=(0,hd.useRef)([]);i.current={accessor:t,onChange:n,readData:r};const a=(0,hd.useCallback)(()=>{const{accessor:t,onChange:n,readData:r}=i.current;if(!n||!t)return;const a=function(e,t){if(!t)return[];const n=new Set,r=[];for(const i of e){if(!i||"object"!=typeof i)continue;const e=("function"==typeof t?t(i):i[t])+"";n.has(e)||(n.add(e),r.push(e))}return r}(e.current?r(e.current):[],t);(function(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0})(a,o.current)||(o.current=a,n(a))},[e]);return(0,hd.useEffect)(()=>{o.current=[],a()},[t,a,n]),a}(it,je,Ae,e=>e.getPoints());!function(e,t,n,r){(0,Hc.useEffect)(()=>{e.current?.updateConfig(t),n.current=!0,r()},[t,r,e,n])}(it,rt,De,Xe),function(e,t,n,r){const i=(0,Hc.useRef)(null);(0,Hc.useEffect)(()=>{const o=e.current;if(!o)return;const a=t??null;i.current!==a&&(i.current=a,o.setLayoutSelection(a),o.hasCustomRestyle?o.restyleScene(a):n.current=!0,r())},[t,r,e,n])}(it,d,De,Xe),(0,ga.useEffect)(()=>{const e=it.current;e&&(Je&&e.setAreas(Je),s&&e.setPoints(et),l&&e.setLines(tt),De.current=!0,Xe())},[Je,s,et,l,tt,Xe]),function(e,{storeRef:t,dirtyRef:n,scheduleRender:r,zoomTransformRef:i,containerRef:o,zoomBehaviorRef:a}){const s=(0,Xl.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushPoint(e),n.current=!0,r())},[t,n,r]),l=(0,Xl.useCallback)(e=>{const i=gt(e);0!==i.length&&(t.current?.pushMany(i),n.current=!0,r())},[t,n,r]),c=(0,Xl.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushLine(e),n.current=!0,r())},[t,n,r]),u=(0,Xl.useCallback)(e=>{const i=gt(e);0!==i.length&&(t.current?.pushManyLines(i),n.current=!0,r())},[t,n,r]),d=(0,Xl.useCallback)(()=>{t.current?.clear(),n.current=!0,r()},[t,n,r]);(0,Xl.useImperativeHandle)(e,()=>({push:s,pushMany:l,removePoint:e=>{const i=t.current?.removePoint(e)??[];return i.length>0&&(n.current=!0,r()),i},pushLine:c,pushManyLines:u,removeLine:e=>{const i=t.current?.removeLine(e)??[];return i.length>0&&(n.current=!0,r()),i},getLines:()=>t.current?.getLines()??[],clear:d,getProjection:()=>t.current?.scales?.projection??null,getGeoPath:()=>t.current?.scales?.geoPath??null,getCartogramLayout:()=>t.current?.cartogramLayout??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null,getZoom:()=>i.current.k,resetZoom:()=>{const e=o.current;e&&a.current&&(0,Zl.select)(e).call(a.current.transform,Kl.zoomIdentity)},getData:()=>t.current?.getPoints()??[]}),[s,l,c,u,d,r,t,n,i,o,a])}(t,{storeRef:it,dirtyRef:De,scheduleRender:Xe,zoomTransformRef:bt,containerRef:kt,zoomBehaviorRef:vt});const{hoverHandlerRef:Ut,onPointerMove:Kt,onPointerLeave:Qt,pointerStateRef:Jt}=ze,{canvasRef:en,interactionCanvasRef:tn,resolutionDirtyRef:nn}=function(e,t){return lr({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}(ze,{hydrated:Ke,wasHydratingFromSSR:Qe,storeRef:it,dirtyRef:De,cleanup:()=>mt.current?.clear(),maxDevicePixelRatio:O,canvasPaintDependencies:[Be,He,_,me,W,C,L,Xe]});(0,ga.useEffect)(()=>{Ut.current=e=>{const t=en.current;if(!t)return;const n=it.current;if(!n||!n.scene.length)return void ir(t);const r=ui({pointer:e,canvasRect:t.getBoundingClientRect(),margin:We,width:Be,height:He,scene:n.scene,pointQuadtree:n.quadtree,maxPointRadius:n.maxPointRadius,hitCanvasRef:pt});ir(t,"hit"===r.kind?rr(r.node):void 0),G&&!1!==V&&("hit"===r.kind?(It.current=r.hover,Dt.current=r.node,Bt(r.hover),Ne?.(r.hover),Xe()):("outside"===r.kind||"miss"===r.kind&&It.current)&&(It.current=null,Dt.current=null,Bt(null),Ne?.(null),Xe()))}},[G,V,Be,He,We,Ne,Xe,Ut,en]),ze.hoverLeaveRef.current=()=>{ir(en.current),G&&!1!==V&&(It.current=null,Dt.current=null,Bt(null),Ne?.(null),Xe())},function(e){const t=Iu.useRef(null);Iu.useEffect(()=>{e.current&&(t.current=e.current)}),Iu.useEffect(()=>()=>ir(t.current),[])}(en);const rn=(0,ga.useCallback)(e=>{if((t=e.target)instanceof Element&&null!=t.closest("[data-semiotic-annotation-widget]"))return;var t;if(!Ee)return;const n=it.current;if(!n||!n.scene.length)return void Ee(null);const r=e.currentTarget.getBoundingClientRect(),i=e.clientX-r.left-We.left,o=e.clientY-r.top-We.top;if(0>i||i>Be||0>o||o>He)return void Ee(null);pt.current||(pt.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const a=ci(pt.current);if(!a)return void Ee(null);const s=Gr(30,Ft.current),l=Gr(6,Ft.current),c=Rt(n.scene,i,o,s,a,n.quadtree,n.maxPointRadius,l);if(c){const e=c.node.datum,t=Array.isArray(e)?null:e?.properties?e:e?.data||e,n=t?.properties?{...t,...t.properties}:t;return void Ee({...n,data:t,properties:t?.properties,__semioticHoverData:!0,x:i,y:o,time:i,value:o},{type:"activate",inputType:(u=Ft.current,"touch"===u?"touch":"pointer")})}var u;Ee(null)},[He,Be,Ee,We]),{kbFocusIndexRef:on,focusedNavPointRef:an,onKeyDown:sn}=function({storeRef:e,hoverRef:t,hoveredNodeRef:n,setHoverPoint:r,customHoverBehavior:i,customClickBehavior:o,scheduleRender:a}){const s=(0,$d.useRef)(-1),l=(0,$d.useRef)(null),c=(0,$d.useCallback)(c=>{if(function(e){const t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}(c))return;const u=e.current;if(!u)return;const d=()=>{s.current=-1,l.current=null,t.current=null,n&&(n.current=null),r(null),i?.(null),a()};if(0===u.scene.length)return void(0>s.current||d());const h=function(e){const t=[];for(const n of e)if("point"===n.type&&null!=n.x&&!1!==n.interactive)t.push({x:n.x,y:n.y,datum:n.datum,shape:"circle"});else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const e=At(n.glyph,n.size);t.push({x:n.x+e.centerDx,y:n.y+e.centerDy,datum:n.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight})}else"geoarea"===n.type&&n.centroid&&!1!==n.interactive&&t.push({x:n.centroid[0],y:n.centroid[1],datum:n.datum,shape:"geoarea",pathData:n.pathData});return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}(u.scene);if(0===h.length)return void(0>s.current||d());let f=s.current;if(h.length>f||(d(),f=-1),("Enter"===c.key||" "===c.key)&&f>=0)return c.preventDefault(),void o?.(fi(h[f]),{type:"activate",inputType:"keyboard"});const p=function(e,t,n){switch(e){case"ArrowRight":case"ArrowDown":return n-1>t?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":return Math.min(t+Math.max(1,Math.floor(.1*n)),n-1);case"PageUp":return Math.max(t-Math.max(1,Math.floor(.1*n)),0);case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}(c.key,0>f?-1:f,h.length);if(null===p)return;if(c.preventDefault(),0>p)return void d();const m=0>f?0:p;s.current=m;const g=h[m];l.current=g;const y=fi(g);t.current=y,r(y),i?.(y,{type:"focus",inputType:"keyboard"}),a()},[o,i,t,n,a,r,e]);return{kbFocusIndexRef:s,focusedNavPointRef:l,onKeyDown:c}}({storeRef:it,hoverRef:It,hoveredNodeRef:Dt,setHoverPoint:Bt,customHoverBehavior:Ne,customClickBehavior:Ee,scheduleRender:Xe}),ln=(0,ga.useCallback)(e=>{var t,n,r,i;n=G&&!1!==V,r=Tt.current,i=en.current,function(e,t,n){const r=e.current;r.inside=!0,r.clientX=t.clientX,r.clientY=t.clientY,r.pointerType=t.pointerType??n}(t=Jt,e,void 0),(n||r)&&(n||"touch"!==t.current.pointerType||(ir(i),0))&&(Ft.current=e.pointerType,on.current=-1,an.current=null,Kt(e))},[en,G,V,an,on,Kt,Jt]),cn=(0,ga.useCallback)(e=>{Ft.current=e.pointerType},[]);Ye.current=()=>{if(Ue.current=null,st.sync(it.current?.scales??null),!Ve.isActive)return;const e=en.current,t=it.current;if(!e||!t)return;const n=Ve.now();let r=!1;const i=Lt.current;let o=!1;i&&(Lt.current=null,t.applyRotation(i,{width:Be,height:He}),o=!0);const a=null!=t.activeTransition,s=t.advanceTransition(_e.current?n+1e6:n),l=!_e.current&&s,c=Ot.current.beforeCompute(t.getLastUpdateResult(),l);let u=!1;if(De.current&&!s){const e={width:Be,height:He},n=t.hasProjection(),r=nt&&n?t.getRotation():null;t.computeScene(e);const i=bt.current,o=1!==i.k||0!==i.x||0!==i.y;nt&&r?o?(t.setRotation(r),t.applyZoomScale(i.k,e)):t.applyRotation(r,e):o&&t.applyZoomTransform(i,e),De.current=!1,u=!0,Vt()}st.sync(t.scales),Ot.current.afterCompute(c,u,!1);const d=sr(O,Fe),h=j&&!_e.current&&!!Pt.current,f=t.consumeStylePaintPending();(u||o||f)&&(Tt.current=function(e){if(!e)return!1;for(const t of e)if(rr(t))return!0;return!1}(t.scene),Tt.current||ir(e)),Tt.current&&(a||u||o||f)&&function(e){var t,n,r;n=e.pointer,r=t=>{const n=ui({pointer:t,canvasRect:e.canvas.getBoundingClientRect(),margin:e.margin,width:e.width,height:e.height,scene:e.store.scene,pointQuadtree:e.geometryMoved?null:e.store.quadtree,maxPointRadius:e.store.maxPointRadius,hitCanvasRef:e.hitCanvasRef});return"hit"===n.kind?rr(n.node):void 0},(t=e.canvas)&&(n.inside&&"touch"!==n.pointerType?ir(t,r(n)):ir(t))}({canvas:e,pointer:Jt.current,store:t,margin:We,width:Be,height:He,hitCanvasRef:pt,geometryMoved:a||u||o});const p=function(e,t,n,r){const i=r.current,o=!0===e.lastCustomLayoutFailure?.preservedLastGoodScene,a=!o&&e.hasActivePulsesAt(t),s=!(n||o||!a&&!i)&&e.refreshPulse(t);return r.current=a,{changed:s,pending:a}}(t,n,u,_t),m=!!((g={dirtyOrRebuilt:u,transitioning:a,continuous:h,liveEncoding:p.changed,forced:o||f||nn.current}).dirtyOrRebuilt||g.transitioning||g.animationTicked||g.continuous||g.liveEncoding||g.forced);var g;if(nn.current=!1,C&&mt.current){const e=ft.current;if(e&&t.scales?.projection){const n=ar(e,Fe,We,d);n&&(n.clearRect(-We.left,-We.top,Fe[0],Fe[1]),n.save(),n.beginPath(),n.rect(0,0,Be,He),n.clip(),function(e,t){const{tileURL:n,projection:r,width:i,height:o,tileCache:a,onTileLoad:s,maxDevicePixelRatio:l}=t,c=r.scale(),u=r.translate(),d=function(e){const{size:t,scale:n,translate:r,clampX:i=!0,clampY:o=!0}=e,a=Math.max(Math.log(n)/Math.LN2-8,0),s=Math.round(a),l=1<<s,c=Math.pow(2,a-s+8),u=r[0]-n/2,d=r[1]-n/2,h=Math.max(i?0:-1/0,Math.floor((0-u)/c)),f=Math.min(i?l:1/0,Math.ceil((t[0]-u)/c)),p=Math.max(o?0:-1/0,Math.floor((0-d)/c)),m=Math.min(o?l:1/0,Math.ceil((t[1]-d)/c)),g=[];for(let e=p;m>e;++e)for(let t=h;f>t;++t)g.push([t,e,s]);return{tiles:g,translate:[u/c,d/c],scale:c}}({size:[i,o],scale:2*c*Math.PI,translate:u}),h=sr(l,[i,o]),f=function(e){if("string"==typeof e)return"template:"+e;const t=e;let n=jd.get(t);return null==n&&(n=Ad++,jd.set(t,n)),"provider:"+n}(n);let p=!0;for(const t of d.tiles){const[r,i,o]=Wr(t),l=Br(n,o,r,i,h),c=`${f}|dpr:${h}|${o}/${r}/${i}|${l}`;let u=a.get(c);if(!u){const e=new Image;e.crossOrigin="anonymous";const t={img:e,loaded:!1,failed:!1,key:c,lastUsed:performance.now()};a.set(c,t),e.onload=()=>{t.loaded=!0,s?.()},e.onerror=()=>{t.loaded=!0,t.failed=!0,s?.()},e.src=l,u=t}if(!u.loaded){p=!1;continue}if(u.failed)continue;const m=d.scale;e.drawImage(u.img,(t[0]+d.translate[0])*m-.5,(t[1]+d.translate[1])*m-.5,m+1,m+1)}}(n,{tileURL:C,projection:t.scales.projection,width:Be,height:He,tileCache:mt.current,maxDevicePixelRatio:O,onTileLoad:()=>Xe()}),n.restore())}}if(m){const i=ar(e,Fe,We,d);if(!i)return;i.clearRect(-We.left,-We.top,Fe[0],Fe[1]),C||function(e,t){const{background:n,hasBackgroundGraphics:r=!1,themeBackground:i="",x:o=0,y:a=0,width:s,height:l}=t,c=function(e){const{background:t,hasBackgroundGraphics:n=!1,themeBackground:r=""}=e;return"transparent"===t||n?null:t||(r&&"transparent"!==r?r:"")||null}({background:n,hasBackgroundGraphics:r,themeBackground:i});if(!c)return!1;const u=Nt(e,c);!u||"transparent"===u.trim().toLowerCase()||(e.fillStyle=u,e.fillRect(o,a,s,l))}(i,{background:_,themeBackground:dt,hasBackgroundGraphics:!!me,x:-We.left,y:-We.top,width:Fe[0],height:Fe[1]}),i.save(),i.beginPath(),i.rect(0,0,Be,He),i.clip();const o=t.scene,a={width:Be,height:He};if(function(e){const{context:t,nodes:n,renderMode:r,pixelRatio:i,paintBuiltIn:o}=e;if(!r||"sketchy"===r)return void o(n);let a=[];const s=()=>{a.length&&(o(a),a=[])};for(const e of n){const n=Xr(r,e);if(!n){a.push(e);continue}let l;s(),t.save();try{l=n.drawCanvas({context:t,node:e,style:e.style??{},pixelRatio:i})}finally{t.restore()}l||(Zr(n.id,e.type??"unknown"),o([e]))}s()}({context:i,nodes:o,renderMode:W,pixelRatio:d,paintBuiltIn:e=>{!function(e,t){const n=t.filter(e=>"geoarea"===e.type);for(const t of n){if(!t.pathData)continue;t._cachedPath2D||(t._cachedPath2D=new Path2D(t.pathData));const n=t._cachedPath2D,r=Nr(e,t.style.fill)||"#e0e0e0";"none"!==r&&(e.fillStyle=r,e.globalAlpha=(t._decayOpacity??1)*(t.style.fillOpacity??1),e.fill(n));const i=t.style.strokeWidth??.5;if(t.style.stroke&&"none"!==t.style.stroke&&i>0){if(e.strokeStyle=Nt(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.globalAlpha=t._decayOpacity??1,t.style.strokeDasharray){const n=t.style.strokeDasharray.split(",").map(Number);e.setLineDash(n)}else e.setLineDash([]);e.stroke(n)}Dr(e,t,n),e.globalAlpha=1,e.setLineDash([])}}(i,e),((e,t,n,r)=>{const i=t.filter(e=>"line"===e.type);for(const t of i){if(2>t.path.length)continue;const n=t._introClipFraction;void 0!==n&&1>n&&(e.save(),e.beginPath(),e.rect(0,0,r.width*n,r.height),e.clip());const i=t.style.stroke||"#007bff",o=Nt(e,i)||i,a=t.style.strokeWidth??2,s=t.colorThresholds,l=t.rawValues;if(e.setLineDash(t.style.strokeDasharray?t.style.strokeDasharray.split(/[\s,]+/).map(Number):[]),null!=t.style.opacity&&(e.globalAlpha=t.style.opacity),a>0&&(e.lineWidth=a),e.lineCap=t.style.strokeLinecap||"butt",t.style._edgeFade&&a>0){Or(e,t.path,o,a,t.style.opacity??1,t.style.strokeLinecap||"butt"),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt";continue}const c=Lr(t.curve),u=s&&s.length>0&&l&&l.length===t.path.length,d=t._decayOpacities;if(a>0&&d&&d.length===t.path.length&&!u){e.strokeStyle=o;const n=t.style.opacity??1;for(let r=0;t.path.length-1>r;r++)e.globalAlpha=.5*(d[r]+d[r+1])*n,e.beginPath(),e.moveTo(t.path[r][0],t.path[r][1]),e.lineTo(t.path[r+1][0],t.path[r+1][1]),e.stroke()}else if(a>0&&!u){e.beginPath();const n=t.strokeGradient&&t.path.length>=2?Er(e,t.strokeGradient,o,t.path[0][0],0,t.path[t.path.length-1][0],0):null;if(e.strokeStyle=n||o,c)(0,Md.line)().x(e=>e[0]).y(e=>e[1]).curve(c).context(e)(t.path);else{const[n,r]=t.path[0];e.moveTo(n,r);for(let n=1;t.path.length>n;n++)e.lineTo(t.path[n][0],t.path[n][1])}e.stroke()}else if(a>0){const n=_r(t.path,l,s,o);for(const t of n){e.beginPath(),e.strokeStyle=Nt(e,t.color)||t.color,e.moveTo(t.path[0][0],t.path[0][1]);for(let n=1;t.path.length>n;n++)e.lineTo(t.path[n][0],t.path[n][1]);e.stroke()}}if(t.style.fill&&t.style.fillOpacity&&t.style.fillOpacity>0){if(e.beginPath(),e.globalAlpha=t.style.fillOpacity,e.fillStyle=Pr(e,t.style.fill,t.style.fill),c&&!u)(0,Md.line)().x(e=>e[0]).y(e=>e[1]).curve(c).context(e)(t.path);else{const[n,r]=t.path[0];e.moveTo(n,r);for(let n=1;t.path.length>n;n++)e.lineTo(t.path[n][0],t.path[n][1])}const n=t.path[0][0];e.lineTo(t.path[t.path.length-1][0],r.height),e.lineTo(n,r.height),e.closePath(),e.fill()}void 0!==n&&1>n&&e.restore(),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt"}})(i,e,0,a),((e,t)=>{const n=t.filter(e=>"point"===e.type);if(0!==n.length){e.save();try{const t=e.globalAlpha;let r=[],i="";const o=n=>{e.beginPath(),e.arc(n.x,n.y,n.r,0,2*Math.PI),e.globalAlpha=t*(n.style.opacity??n.style.fillOpacity??1),e.fillStyle=Pr(e,n.style.fill,"#4e79a7"),e.fill();const r=n.style.strokeWidth??1;n.style.stroke&&"none"!==n.style.stroke&&r>0&&(e.strokeStyle=Pr(e,n.style.stroke,n.style.stroke),e.lineWidth=r,e.stroke()),function(e,t,n=.6){if(!Tr(t))return;const r=t.r+(t._pulseGlowRadius??4)*t._pulseIntensity,i=t.cx??t.x??0,o=t.cy??t.y??0;e.beginPath(),e.arc(i,o,r,0,2*Math.PI),e.strokeStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.lineWidth=2*t._pulseIntensity,e.globalAlpha=t._pulseIntensity*n,e.stroke()}(e,n)},a=()=>{if(0===r.length)return;if(1===r.length)return o(r[0]),r=[],void(i="");const n=r[0];e.globalAlpha=t*(n.style.opacity??n.style.fillOpacity??1),e.beginPath();for(const t of r)e.moveTo(t.x+t.r,t.y),e.arc(t.x,t.y,t.r,0,2*Math.PI);e.fillStyle=Pr(e,n.style.fill,"#4e79a7"),e.fill();const a=n.style.strokeWidth??1;n.style.stroke&&"none"!==n.style.stroke&&a>0&&(e.strokeStyle=Pr(e,n.style.stroke,n.style.stroke),e.lineWidth=a,e.stroke()),r=[],i=""};for(const e of n){const t=e.style.opacity??e.style.fillOpacity??1,n=e.style.fill;if(Tr(e)||null!=n&&"string"!=typeof n||1>t){a(),o(e);continue}const s=e.style.strokeWidth??1,l=`${n??"#4e79a7"}\0${e.style.stroke&&"none"!==e.style.stroke&&s>0?e.style.stroke+"":""}\0${s}\0${e.r}\0${t}`;r.length>0&&l!==i&&a(),i=l,r.push(e),2048>r.length||a()}a()}finally{e.restore()}}})(i,e),((e,t)=>{const n=e.globalAlpha;for(const r of t)"glyph"===r.type&&Fr(e,r,r.x,r.y,n);e.globalAlpha=n})(i,e)}}),h&&Pt.current){const e=Pt.current,t=o.filter(e=>"line"===e.type);if(t.length>0){const o=A||{},a=.3*(o.speedMultiplier??1),s=o.maxPerLine??si(),l=o.spawnRate??(ai()?.06:.15),c=o.radius??2,u=o.opacity??.7,d=n/1e3,h=Et.current>0?Math.min(d-Et.current,.1):.016;Et.current=d;const f=t.map(e=>e.path),p=t.map(e=>e.style.strokeWidth??2);for(let n=0;t.length>n;n++)Ve.random()<l&&e.countForLine(n)<s&&e.spawn(n,Ve.random);e.step(h,a,f,p),i.globalAlpha=u;for(let n=0;e.particles.length>n;n++){const r=e.particles[n];if(!r.active)continue;const a=t[r.lineIndex],s="function"==typeof o.color?o.color(a?.datum??{}):"source"!==o.color&&o.color?o.color:a?.style.stroke||"#fff";i.beginPath(),i.arc(r.x,r.y,c,0,2*Math.PI),i.fillStyle=s,i.fill()}i.globalAlpha=1,r=!0}}i.restore()}(u||a&&!s)&&e.setAttribute("aria-label",br(t.scene,"Geographic chart"));const y=Dt.current,v=!(!y||"geoarea"!==y.type&&"point"!==y.type),b=v||zt.current;const x=tn.current;if(x&&b){const e=ar(x,Fe,We,d);if(e){if(e.clearRect(-We.left,-We.top,Fe[0],Fe[1]),y&&"geoarea"===y.type){const t=new Path2D(y.pathData);e.fillStyle="rgba(255, 255, 255, 0.3)",e.fill(t),e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke(t)}if(y&&"point"===y.type){const t=y,n="object"==typeof V?V:void 0,r=n?.pointColor||function(e){if(!e)return null;if("heatcell"===e.type)return e.fill||null;if("candlestick"===e.type)return e.isUp?e.upColor:e.downColor;const{style:t}=e;if(!t)return null;const n="string"==typeof t.fill?t.fill:null;return"line"===e.type||"area"===e.type?t.stroke||n||null:n||t.stroke||null}(y);e.beginPath(),e.arc(t.x,t.y,t.r+3,0,2*Math.PI),r?(e.save(),e.globalAlpha=.4,e.fillStyle=r,e.fill(),e.restore()):(e.fillStyle="rgba(255, 255, 255, 0.4)",e.fill()),e.strokeStyle=r||"rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke()}}zt.current=v}const w=ee!==yt.current;w&&(yt.current=ee),(u||w||a&&ee&&ee.length>0)&&(u||w||a&&!s||n-$t.current>=33)&&(Ht(e=>e+1),$t.current=n),(l||null!=t.activeTransition||p.pending||r)&&Xe()},function(e,t,n,r,i,o,a){const s=(0,$c.useRef)("fresh");(0,$c.useEffect)(()=>{if(!e)return void(s.current="fresh");const l=setInterval(()=>{const l=t.current;if(!l||0===l.lastIngestTime)return;const c=function(e,t){if(!e||0>=t)return Gc;const n=null!=e.threshold&&e.threshold>0?e.threshold:5e3,r=e.graded;if(r){const e="object"==typeof r?r:{},i=function(e,t,n={}){return Number.isFinite(t)&&t>0?Number.isNaN(e)?"fresh":e===1/0?"expired":0>e||t*(n.fresh??sl)>e?"fresh":t*(n.aging??ll)>e?"aging":t*(n.stale??cl)>e?"stale":"expired":"fresh"}(t,n,e.thresholds);return{alpha:{...qc,...e.opacities??{}}[i],band:i,isStale:"fresh"!==i}}return t>n?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:Gc}(e,i()-l.lastIngestTime);c.band===s.current&&c.isStale===o||(s.current=c.band,c.isStale!==o&&a(c.isStale),n.current=!0,r())},1e3);return()=>clearInterval(l)},[e,o,r,i,t,a,n])}(le,it,De,Xe,Ve.now,qt,Gt),(0,ga.useEffect)(()=>{if("production"!==process.env.NODE_ENV&&C){const e=li(n);e&&"mercator"!==e&&console.warn(`[StreamGeoFrame] tileURL is set but projection is "${e}". Raster tiles use Web Mercator and will not align with other projections.`)}},[C,n]),(0,ga.useEffect)(()=>{const e=kt.current;if(!w||!e)return vt.current&&e&&((0,kd.select)(e).on(".zoom",null),vt.current=null),void(e&&(0,kd.select)(e).on("mousedown.rotate",null).on("touchstart.rotate",null));const[t,n]=k||[1,8],r={width:Be,height:He};if(nt){let i=bt.current.k;const o=e=>{i=Math.max(t,Math.min(n,e)),bt.current=wd.zoomIdentity.scale(i);const o=it.current;o&&(o.applyZoomScale(i,r),De.current=!1,Xe(),o.scales?.projection&&S?.({projection:o.scales.projection,zoom:o.currentZoom}))};vt.current={scaleBy:(e,t)=>o(i*t),transform:(e,t)=>o(t?.k??1)};const a=e=>{e.preventDefault(),o(i*(0>e.deltaY?1.1:1/1.1))},s=e=>{const t=e.target;t&&(t.closest("button")||t.closest(".stream-geo-zoom-controls"))||(e.preventDefault(),o(1.5*i))};e.addEventListener("wheel",a,{passive:!1}),e.addEventListener("dblclick",s);const l=.4,c=t=>{if(0!==t.button)return;const n=t.target;if(n.closest("button")||n.closest(".stream-geo-zoom-controls"))return;const r=it.current;if(!r)return;const i=r.getRotation();Ct.current={x:t.clientX,y:t.clientY,rotation:[...i]},e.setPointerCapture(t.pointerId),t.preventDefault()},u=e=>{const t=Ct.current;t&&(Lt.current=[t.rotation[0]+(e.clientX-t.x)*l,Math.max(-90,Math.min(90,t.rotation[1]-(e.clientY-t.y)*l)),t.rotation[2]],Xe())},d=t=>{if(!Ct.current)return;Ct.current=null,e.releasePointerCapture(t.pointerId);const n=Lt.current;if(n){Lt.current=null;const e=it.current;e&&(e.applyRotation(n,r),Xe())}const i=it.current;i?.scales?.projection&&S?.({projection:i.scales.projection,zoom:i.currentZoom})};return e.addEventListener("pointerdown",c),e.addEventListener("pointermove",u),e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("wheel",a),e.removeEventListener("dblclick",s),e.removeEventListener("pointerdown",c),e.removeEventListener("pointermove",u),e.removeEventListener("pointerup",d),e.removeEventListener("pointercancel",d),vt.current=null}}const i=(0,wd.zoom)().scaleExtent([t,n]).extent([[0,0],[Fe[0],Fe[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",e=>{const t=e.transform;bt.current=t,xt.current=!0;const n=it.current;n&&(n.applyZoomTransform(t,r),De.current=!1,Xe())}).on("end",e=>{bt.current=e.transform,xt.current=!1;const t=it.current;t?.scales?.projection&&S?.({projection:t.scales.projection,zoom:t.currentZoom})});return vt.current=i,(0,kd.select)(e).call(i),()=>{(0,kd.select)(e).on(".zoom",null)}},[w,k,nt,Fe,Be,He,We,S,Xe]);const un=G&&!1!==V,dn=un&&Wt?U?U(Wt):(0,Ud.jsx)(oi,{data:Wt}):null,hn=dn?(0,Ud.jsx)(Rr,{x:Wt.x,y:Wt.y,containerWidth:Be,containerHeight:He,margin:We,className:"stream-frame-tooltip",zIndex:10,children:dn}):null;if(lt){const e=ot.scene;return(0,Ud.jsxs)("div",{ref:Mt,className:"stream-geo-frame"+(z?" "+z:""),role:"img","aria-label":Le||("string"==typeof ye?ye:"Geographic chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:I?"100%":Fe[0],height:T?"100%":Fe[1]},children:[(0,Ud.jsx)(wr,{summary:Pe}),(0,Ud.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:Fe[0],height:Fe[1],style:{position:"absolute",left:0,top:0},children:[ht?(0,Ud.jsx)("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:Fe[0],height:Fe[1],fill:ht}):null,(0,Ud.jsx)("g",{transform:`translate(${We.left},${We.top})`,children:ut}),(0,Ud.jsx)("g",{transform:`translate(${We.left},${We.top})`,children:e.map((e,t)=>{return n={node:e,index:t,renderMode:W,fallback:()=>function(e,t){return or(function(e,t){switch(e.type){case"geoarea":{const n=e;if(!n.pathData)return null;const r=xn(n.style.fill)?Sn(n.style.fill,`geoarea-${t}-hatch`):void 0;return(0,Du.jsxs)(Nu.Fragment,{children:[r&&(0,Du.jsx)("defs",{children:r}),(0,Du.jsx)("path",{d:n.pathData,fill:r?`url(#geoarea-${t}-hatch)`:nr(n.style.fill,"#e0e0e0"),fillOpacity:n.style.fillOpacity??1,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth??.5,strokeDasharray:n.style.strokeDasharray,opacity:(n.style.opacity??1)*(n._decayOpacity??1)})]},"geoarea-"+t)}case"point":{const n=e,r=xn(n.style.fill)?Sn(n.style.fill,`geopoint-${t}-hatch`):void 0;return(0,Du.jsxs)(Nu.Fragment,{children:[r&&(0,Du.jsx)("defs",{children:r}),(0,Du.jsx)("circle",{cx:n.x,cy:n.y,r:n.r,fill:r?`url(#geopoint-${t}-hatch)`:nr(n.style.fill),fillOpacity:n.style.fillOpacity??.8,stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,opacity:n._decayOpacity??n.style.opacity??1})]},"point-"+t)}case"line":{const n=e;if(2>n.path.length)return null;const r="M"+n.path.map(e=>`${e[0]},${e[1]}`).join("L");return(0,Du.jsx)("path",{d:r,fill:"none",stroke:n.style.stroke||"#4e79a7",strokeWidth:n.style.strokeWidth??1.5,strokeDasharray:n.style.strokeDasharray,opacity:n.style.opacity??1},"line-"+t)}case"glyph":return function(e,t,n,r){const i=e.glyph;if(!i?.parts?.length||0>=e.size)return null;const o=wt(i,e.size);if(0>=o.scale)return null;const a=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${o.offsetX},${o.offsetY}) scale(${o.scale})`,s=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),l=jt(i,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=l?function(e){const t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?"s_"+t:t}(r+"-clip"):void 0,u=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),d=t=>i.parts.map((n,r)=>{const i=t?"none"===n.fill?void 0:t:St(n.fill,s,e.accent),o=t?n.stroke&&"none"!==n.stroke?t:void 0:St(n.stroke??"none",s,e.accent);return i||o?(0,Eu.jsx)("path",{d:n.d,fill:i??"none",stroke:o,strokeWidth:o?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},r):null});return(0,Eu.jsxs)("g",{transform:a,opacity:1===u?void 0:u,children:[l&&c&&(0,Eu.jsx)("clipPath",{id:c,children:(0,Eu.jsx)("rect",{x:l.x,y:l.y,width:l.width,height:l.height})}),l&&e.ghostColor?(0,Eu.jsx)("g",{children:d(e.ghostColor)}):null,l&&c?(0,Eu.jsx)("g",{clipPath:`url(#${c})`,children:d()}):d()]},r)}(e,e.x,e.y,"geo-glyph-"+(e.pointId??t));default:return null}}(e,t),e,"geo-cursor-"+t)}(e,t)},function(e){const{node:t,index:n,renderMode:r,fallback:i}=e,o=Xr(r,t);if(!o)return{element:i(),renderedByBackend:!1};const a=o.renderStaticSVG({node:t,style:t.style??{},key:`${o.id}-${n}`});return null!=a?{element:or(a,t,`${o.id}-${n}-cursor`),renderedByBackend:!0}:(Zr(o.id,t.type??"unknown"),{element:i(),renderedByBackend:!1})}(n).element;var n})})]}),(0,Ud.jsx)(tr,{width:Be,height:He,totalWidth:Fe[0],totalHeight:Fe[1],margin:We,showAxes:!1,title:ye,description:Le,legend:ve,legendPosition:be,legendLayout:xe,legendHoverBehavior:we,legendClickBehavior:ke,legendHighlightedCategory:Se,legendIsolatedCategories:Me,foregroundGraphics:Vr(ct,Yr(it.current?.customLayoutOverlays,d??null)),annotations:ee,onAnnotationActivate:te,onObservation:Q??K,chartId:J,chartType:"StreamGeoFrame",autoPlaceAnnotations:ne,svgAnnotationRules:re,pointNodes:Kr(e),geoProjection:it.current?.scales?.projectedPoint})]})}return(0,Ud.jsxs)("div",{ref:Mt,className:"stream-geo-frame"+(z?" "+z:""),role:"group","aria-label":Le||("string"==typeof ye?ye:"Geographic chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:I?"100%":Fe[0],height:T?"100%":Fe[1],overflow:Y?"visible":"hidden",...w?{touchAction:"none"}:{}},onKeyDown:sn,children:["production"!==process.env.NODE_ENV&&it.current&&(0,Ud.jsx)(ic,{store:it.current,diagnostics:Ot.current}),Re&&(0,Ud.jsxs)(vr,{accessibleTable:Re,children:[(0,Ud.jsx)(kr,{tableId:Ge}),(0,Ud.jsx)(xr,{scene:it.current?.scene??[],chartType:"Geographic chart",tableId:Ge,chartTitle:"string"==typeof ye?ye:void 0})]}),(0,Ud.jsx)(wr,{summary:Pe}),(0,Ud.jsx)(pr,{hoverPoint:Wt}),(0,Ud.jsxs)("div",{role:"img","aria-label":Le||("string"==typeof ye?ye:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:ln,onPointerLeave:Qt,onPointerDown:un||Ie?cn:void 0,onClick:Ie?rn:void 0,children:[(0,Ud.jsx)(cr,{size:Fe,margin:We,backdropFill:ht??void 0,children:ut}),C&&(0,Ud.jsx)("canvas",{ref:ft,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),(0,Ud.jsx)("canvas",{ref:en,"aria-label":br(it.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0}}),(0,Ud.jsx)("canvas",{ref:tn,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),(0,Ud.jsx)(tr,{width:Be,height:He,totalWidth:Fe[0],totalHeight:Fe[1],margin:We,showAxes:Ce,title:ye,description:Le,legend:ve,legendPosition:be,legendLayout:xe,legendHoverBehavior:we,legendClickBehavior:ke,legendHighlightedCategory:Se,legendIsolatedCategories:Me,foregroundGraphics:Vr(ct,Yr(it.current?.customLayoutOverlays,d??null)),annotations:ee,onAnnotationActivate:te,onObservation:Q??K,chartId:J,chartType:"StreamGeoFrame",autoPlaceAnnotations:ne,svgAnnotationRules:re,pointNodes:Kr(it.current?.scene),geoProjection:it.current?.scales?.projectedPoint}),le?.showBadge&&(0,Ud.jsx)(Zt,{isStale:qt,position:le.badgePosition}),w&&(0,Ud.jsxs)("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:We.bottom+8,left:We.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[(0,Ud.jsx)("button",{type:"button","aria-label":"Zoom in",onClick:e=>{e.stopPropagation();const t=kt.current,n=vt.current;t&&n?.scaleBy&&n.scaleBy((0,kd.select)(t),1.5)},style:Bd,children:"+"}),(0,Ud.jsx)("button",{type:"button","aria-label":"Zoom out",onClick:e=>{e.stopPropagation();const t=kt.current,n=vt.current;t&&n?.scaleBy&&n.scaleBy((0,kd.select)(t),1/1.5)},style:Bd,children:"−"})]}),R&&(0,Ud.jsx)("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:We.bottom+2,right:We.right+4,fontSize:10,color:"rgba(0,0,0,0.6)",background:"rgba(255,255,255,0.7)",padding:"1px 4px",borderRadius:2,pointerEvents:"none",zIndex:2},children:R}),(0,Ud.jsx)(Sr,{active:on.current>=0,hoverPoint:Wt,margin:We,size:Fe,shape:an.current?.shape,width:an.current?.w,height:an.current?.h,pathData:an.current?.pathData}),hn]})]})}));Yd.displayName="StreamGeoFrame";var Xd=Yd,Zd=require("react"),Kd=require("react"),Qd=require("./semiotic-client-cjs-shared.min.js"),Jd=.5,eh=require("./semiotic-client-cjs-shared.min.js"),th=require("./semiotic-client-cjs-shared.min.js"),nh=require("./semiotic-client-cjs-shared.min.js"),rh=require("./semiotic-client-cjs-shared.min.js"),ih=44,oh={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:ih,snap:"nearestDatum",brushHandleSize:ih,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},ah={primary:{width:600,height:400,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:void 0,showLabels:void 0,marginDefaults:{top:50,bottom:60,left:70,right:40}},context:{width:400,height:250,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:10,bottom:10,left:10,right:10}},sparkline:{width:120,height:24,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:2,bottom:2,left:0,right:0}},mobile:{width:390,height:300,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:!1,showLabels:!0,marginDefaults:{top:28,bottom:42,left:44,right:16}}},sh={top:10,bottom:10,left:10,right:10},lh=require("react"),ch=require("react"),uh=(require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("react/jsx-runtime"),(0,ch.createContext)(!1)),dh=((0,ch.createContext)(!1),(0,ch.createContext)(null)),hh="undefined"==typeof window?ch.useEffect:ch.useLayoutEffect,fh=[],ph=require("react/jsx-runtime"),mh=Vo(require("react")),gh=require("react/jsx-runtime"),yh=class extends mh.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:(0,gh.jsx)($i,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}},vh=require("react/jsx-runtime"),bh="undefined"!=typeof process&&"production"!==process.env?.NODE_ENV,xh={display:"flex",alignItems:"center",justifyContent:"center",color:"var(--semiotic-text-secondary, #666)",fontSize:13,fontFamily:"inherit",border:"1px dashed var(--semiotic-border, #ddd)",borderRadius:4,boxSizing:"border-box"},wh={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2},kh=require("react"),Sh=require("./semiotic-client-cjs-shared.min.js"),Mh=require("d3-scale"),jh=require("react"),Ah=require("topojson-client"),Ch=new Map,Rh="Install the optional peer dependency `world-atlas` (`npm install world-atlas`) to use built-in reference geographies, or pass GeoJSON Feature[] to `areas`.",Lh=require("react/jsx-runtime");to.displayName="ChoroplethMap";var Ph=require("react"),Nh=require("react"),Eh=require("./semiotic-client-cjs-shared.min.js"),Ih=require("react"),Th={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5},Dh=require("react/jsx-runtime"),zh=[3,30],_h=[1,4],Oh=(0,Ph.forwardRef)(function(e,t){const n=(0,Ph.useRef)(null);ro(t,{variant:"geo-points",frameRef:n});const r=Ti(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:i,xAccessor:o="lon",yAccessor:a="lat",sizeBy:s,sizeRange:l,colorBy:c,styleRules:u,colorScheme:d,projection:h="equalEarth",graticule:f,fitPadding:p,zoomable:m,zoomExtent:g,onZoom:y,dragRotate:v,tileURL:b,tileAttribution:x,tileCacheSize:w,areas:k,areaStyle:S=Th,tooltip:M,annotations:j,margin:A,className:C,selection:R,linkedHover:L,onObservation:P,onClick:N,chartId:E,loading:I,loadingContent:T,emptyContent:D,legendInteraction:z,legendPosition:_,frameProps:O={},stroke:F,strokeWidth:W,opacity:B}=e,H=l??("sparkline"===r.mode?_h:zh),$="sparkline"===r.mode?1.5:6,q=m??!!b,G=Ki(k),V=no({data:i??Ql,rawData:i,colorBy:c,colorScheme:d,legendInteraction:z,legendPosition:_,frameLegend:O,selection:R,linkedHover:L,fallbackFields:c?["string"==typeof c?c:""]:[],unwrapData:!1,onObservation:P,onClick:N,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:E,showLegend:r.showLegend,userMargin:A,marginDefaults:ki(r),loading:I,loadingContent:T,emptyContent:D,width:r.width,height:r.height,hasTitle:!!r.title}),U=V.data,Y=(0,Ph.useMemo)(()=>{if(!s)return;const e="function"==typeof s?s:e=>e?.[s],t=U.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?dt(t):void 0},[U,s]),X=(0,Ph.useMemo)(()=>{const e=Di(Hi(e=>({fill:c?Ke(e,c,V.colorScale):Cl,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?et(e,s,H,Y):$}),u,_i(c,s)),{stroke:F,strokeWidth:W,opacity:B});return V.effectiveSelectionHook?yi(e,V.effectiveSelectionHook,V.resolvedSelection):e},[c,V.colorScale,V.effectiveSelectionHook,V.resolvedSelection,s,H,Y,$,F,W,B,u]),Z=(0,Ph.useMemo)(()=>e=>{const t=e?.name||e?.label||e?.NAME||e?.id,n="string"==typeof s?s:null,r=("function"==typeof s?s:e=>e[s])(e),i=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",o="string"==typeof c?c:null,a=o?e?.[o]:null;return(0,Dh.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&(0,Dh.jsx)("div",{style:{fontWeight:600,marginBottom:2},children:t}),n&&null!=r&&(0,Dh.jsxs)("div",{children:[(0,Dh.jsxs)("span",{style:{opacity:.7},children:[n,": "]}),i(r)]}),o&&null!=a&&(0,Dh.jsxs)("div",{children:[(0,Dh.jsxs)("span",{style:{opacity:.7},children:[o,": "]}),a+""]}),!t&&!n&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>(0,Dh.jsxs)("div",{children:[(0,Dh.jsxs)("span",{style:{opacity:.7},children:[e,": "]}),i(t)]},e))]})},[s,c]);if(V.earlyReturn)return V.earlyReturn;Ui("ProportionalSymbolMap",U,"xAccessor",o),Ui("ProportionalSymbolMap",U,"yAccessor",a);const K={projection:h,...null!=i&&{points:U},xAccessor:o,yAccessor:a,pointStyle:X,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...G&&{areas:G,areaStyle:S},...null!=f&&{graticule:f},...null!=p&&{fitPadding:p},...q&&{zoomable:!0},...g&&{zoomExtent:g},...y&&{onZoom:y},...null!=v&&{dragRotate:v},...b&&{tileURL:b},...x&&{tileAttribution:x},...w&&{tileCacheSize:w},size:[r.width,r.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:V.margin,enableHover:r.enableHover,tooltipContent:!1===M?()=>null:ii(M)||Z,...V.legendBehaviorProps,...Ji({linkedHover:L,selection:R,onObservation:P,onClick:N,mobileInteraction:V.mobileInteraction,customHoverBehavior:V.customHoverBehavior,customClickBehavior:V.customClickBehavior,linkedHoverInClickPredicate:!1}),...j&&j.length>0&&{annotations:j},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...r.title&&{title:r.title},...r.description&&{description:r.description},...r.summary&&{summary:r.summary},...void 0!==r.accessibleTable&&{accessibleTable:r.accessibleTable},...C&&{className:C},...null!=e.animate&&{animate:e.animate},...O};return(0,Dh.jsx)(qi,{componentName:"ProportionalSymbolMap",width:r.width,height:r.height,children:(0,Dh.jsx)(Xd,{ref:n,...K})})});Oh.displayName="ProportionalSymbolMap";var Fh=require("react"),Wh=require("./semiotic-client-cjs-shared.min.js"),Bh=require("./semiotic-client-cjs-shared.min.js"),Hh=require("react/jsx-runtime"),$h="__semiotic_x",qh="__semiotic_y",Gh=(0,Fh.forwardRef)(function(e,t){const n=Ti(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:r,nodes:i,nodeIdAccessor:o="id",xAccessor:a="lon",yAccessor:s="lat",valueAccessor:l="value",projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:h,zoomExtent:f,onZoom:p,dragRotate:m,tileURL:g,tileAttribution:y,tileCacheSize:v,lineType:b="geo",flowStyle:x="basic",areas:w,areaStyle:k=Th,edgeColorBy:S,edgeOpacity:M=.6,edgeWidthRange:j=[1,8],pointRadius:A,edgeLinecap:C="round",colorScheme:R,styleRules:L,showParticles:P,particleStyle:N,tooltip:E,annotations:I,margin:T,className:D,selection:z,linkedHover:_,onObservation:O,onClick:F,chartId:W,loading:B,loadingContent:H,emptyContent:$,frameProps:q={},legendInteraction:G,legendPosition:V,stroke:U,strokeWidth:Y,opacity:X,lineIdAccessor:Z}=e,K=h??!!g,Q=Ki(w),J=(0,Fh.useMemo)(()=>gt(i),[i]),ee=no({data:r??Ql,rawData:r,colorBy:S,colorScheme:R,legendInteraction:G,legendPosition:V,frameLegend:q,selection:z,linkedHover:_,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:O,onClick:F,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"FlowMap",chartId:W,showLegend:n.showLegend,userMargin:T,marginDefaults:ki(n),loading:B,loadingContent:H,emptyContent:$,width:n.width,height:n.height,hasTitle:!!n.title}),te=ee.data,ne=gi(_),re=(0,Wh.useLinkedHover)({name:ne?.name||"hover",fields:ne?.fields||[]}),ie=(0,Bh.useObservationSelector)(e=>e.pushObservation),oe=(0,Fh.useMemo)(()=>{const e=new Map;for(const t of J)e.set(t[o]+"",t);return e},[J,o]),ae=(0,Fh.useRef)(null),se=(0,Fh.useRef)(oe);se.current=oe;const le=(0,Fh.useRef)(a);le.current=a;const ce=(0,Fh.useRef)(s);ce.current=s;const ue=(0,Fh.useCallback)(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;const t=se.current,n=t.get(e.source+""),r=t.get(e.target+"");if(!n||!r)return null;const i="function"==typeof le.current?le.current:e=>e[le.current],o="function"==typeof ce.current?ce.current:e=>e[ce.current];return{...e,coordinates:[{[$h]:i(n),[qh]:o(n)},{[$h]:i(r),[qh]:o(r)}]}},[]);ro(t,{variant:"geo-lines",frameRef:ae,overrides:{push:e=>{const t=ue(e);t&&ae.current?.pushLine(t)},pushMany:e=>{const t=[];for(const n of e){const e=ue(n);e&&t.push(e)}t.length>0&&ae.current?.pushManyLines(t)}}});const de=(0,Fh.useMemo)(()=>{const e=new Map;for(const t of te)t&&"object"==typeof t&&(null==t.source||e.has(t.source)||e.set(t.source,t),null==t.target||e.has(t.target)||e.set(t.target,t));return e},[te]),he=(0,Fh.useCallback)(e=>{if(_)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){const e=de.get(t[o]+"");e&&re.onHover(e)}else re.onHover(t)}else re.onHover(null);if(O||ie){const t={timestamp:Date.now(),chartType:"FlowMap",chartId:W};if(e){let n=e.data||e.datum||e;Array.isArray(n)&&(n=n[0]);const r={...t,type:"hover",datum:n||{},x:e.x??0,y:e.y??0};O&&O(r),ie&&ie(r)}else{const e={...t,type:"hover-end"};O&&O(e),ie&&ie(e)}}},[_,re,o,de,O,W,ie]),fe=ee.customClickBehavior,pe=(0,Fh.useMemo)(()=>{const e="function"==typeof a?a:e=>e[a],t="function"==typeof s?s:e=>e[s];return te.map(n=>{if(!n||"object"!=typeof n||null==n.source||null==n.target)return null;const r=oe.get(n.source+""),i=oe.get(n.target+"");return r&&i?{...n,coordinates:[{[$h]:e(r),[qh]:t(r)},{[$h]:e(i),[qh]:t(i)}]}:null}).filter(Boolean)},[te,oe,a,s]),me=(0,Fh.useMemo)(()=>{const e="function"==typeof a?a:e=>e[a];return t=>null!=t&&"object"==typeof t&&$h in t?t[$h]:e(t)},[a]),ge=(0,Fh.useMemo)(()=>{const e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&qh in t?t[qh]:e(t)},[s]),ye=(0,Fh.useMemo)(()=>{const e=te.filter(e=>e&&"object"==typeof e).map(e=>Number(e[l]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return dt(e)},[te,l]),ve=(0,Fh.useMemo)(()=>function(e){const{valueAccessor:t,valueDomain:n,edgeWidthRange:r,resolveStroke:i,edgeOpacity:o,edgeLinecap:a,styleRules:s}=e,l=zi(t);return Hi(e=>({stroke:i(e),strokeWidth:io(e[t],n,r),strokeLinecap:a,opacity:o,fillOpacity:0}),s,e=>({value:l(e)}))}({valueAccessor:l,valueDomain:ye,edgeWidthRange:j,resolveStroke:e=>S?Ke(e,S,ee.colorScale):Cl,edgeOpacity:M,edgeLinecap:C,styleRules:L}),[l,ye,j,S,ee.colorScale,M,C,L]),be=(0,Fh.useMemo)(()=>{const e=Di(ve,{stroke:U,strokeWidth:Y,opacity:X});if(!ee.effectiveSelectionHook)return e;const t={...ee.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return yi(e,ee.effectiveSelectionHook,{...ee.resolvedSelection||{},unselectedStyle:t})},[ve,ee.effectiveSelectionHook,ee.resolvedSelection,U,Y,X]),xe=A??("sparkline"===n.mode?1.5:5),we=(0,Fh.useMemo)(()=>Di(()=>({fill:"#333",r:xe,fillOpacity:.8}),{stroke:U,strokeWidth:Y,opacity:X}),[xe,U,Y,X]),ke=(0,Fh.useMemo)(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)return(0,Hh.jsx)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:(0,Hh.jsx)("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){const t=e[l];return(0,Hh.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[(0,Hh.jsxs)("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&(0,Hh.jsx)("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}const t=e?.name||e?.label||e?.[o];return null!=t?(0,Hh.jsx)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:(0,Hh.jsx)("div",{style:{fontWeight:600},children:t})}):null},[l,o]);if(ee.earlyReturn)return ee.earlyReturn;const Se={projection:c,...null!=r&&{lines:pe},points:J,xAccessor:me,yAccessor:ge,lineDataAccessor:"coordinates",...null!=Z&&{lineIdAccessor:Z},lineType:b,flowStyle:x,lineStyle:be,pointStyle:we,...Q&&{areas:Q,areaStyle:k},...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...K&&{zoomable:!0},...f&&{zoomExtent:f},...p&&{onZoom:p},...null!=m&&{dragRotate:m},...P&&{showParticles:P},...N&&{particleStyle:N},...g&&{tileURL:g},...y&&{tileAttribution:y},...v&&{tileCacheSize:v},size:[n.width,n.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ee.margin,enableHover:n.enableHover,tooltipContent:!1===E?()=>null:ii(E)||ke,...ee.legendBehaviorProps,...Ji({linkedHover:_,selection:z,onObservation:O,onClick:F,mobileInteraction:ee.mobileInteraction,customHoverBehavior:he,customClickBehavior:fe,linkedHoverInClickPredicate:!1}),...I&&I.length>0&&{annotations:I},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...n.title&&{title:n.title},...n.description&&{description:n.description},...n.summary&&{summary:n.summary},...void 0!==n.accessibleTable&&{accessibleTable:n.accessibleTable},...D&&{className:D},...null!=e.animate&&{animate:e.animate},...q};return(0,Hh.jsx)(qi,{componentName:"FlowMap",width:n.width,height:n.height,children:(0,Hh.jsx)(Xd,{ref:ae,...Se})})});Gh.displayName="FlowMap";var Vh=require("react"),Uh=require("react/jsx-runtime"),Yh=require("react/jsx-runtime"),Xh=(0,Vh.forwardRef)(function(e,t){const n=Ti(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:r,lines:i,xAccessor:o="lon",yAccessor:a="lat",nodeIdAccessor:s="id",center:l,costAccessor:c,strength:u=1,lineMode:d="straight",projection:h="mercator",graticule:f,fitPadding:p,zoomable:m,zoomExtent:g,onZoom:y,dragRotate:v,tileURL:b,tileAttribution:x,tileCacheSize:w,transition:k,colorBy:S,styleRules:M,colorScheme:j,pointRadius:A,tooltip:C,showRings:R,showRingLabels:L,ringStyle:P,showNorth:N,costLabel:E,cartogramLayout:I,annotations:T,margin:D,className:z,selection:_,linkedHover:O,onObservation:F,onClick:W,chartId:B,loading:H,loadingContent:$,emptyContent:q,legendPosition:G,frameProps:V={},stroke:U,strokeWidth:Y,opacity:X}=e,Z="sparkline"===n.mode,K=I??(Z?"strip":"radial"),Q=A??(Z?1.5:5),J=R??!0,ee=L??("strip"!==K&&!n.compactMode),te=N??("strip"!==K&&!Z),ne=m??!!b,re=(0,Vh.useMemo)(()=>gt(r),[r]),ie=no({data:re,rawData:r,colorBy:S,colorScheme:j,legendInteraction:void 0,legendPosition:G,frameLegend:V,selection:_,linkedHover:O,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:F,onClick:W,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"DistanceCartogram",chartId:B,showLegend:n.showLegend,userMargin:D,marginDefaults:ki(n),loading:H,loadingContent:$,emptyContent:q,width:n.width,height:n.height,hasTitle:!!n.title}),oe=(0,Vh.useMemo)(()=>{const e=Di(Hi(e=>{const t=e?.[s],n=null!=t&&t+""==l+"";return{fill:S?Ke(e,S,ie.colorScale):Cl,fillOpacity:n?1:.8,stroke:n?"var(--semiotic-text, #222)":"#fff",strokeWidth:n?1.25:1,r:n?1.35*Q:Q}},M,_i(S)),{stroke:U,strokeWidth:Y,opacity:X});return ie.effectiveSelectionHook?yi(e,ie.effectiveSelectionHook,ie.resolvedSelection):e},[S,ie.colorScale,ie.effectiveSelectionHook,ie.resolvedSelection,Q,U,Y,X,M,l,s]),ae=(0,Vh.useMemo)(()=>({center:l,centerAccessor:s,costAccessor:c,strength:u,lineMode:d,layout:K}),[l,s,c,u,d,K]),se=(0,Vh.useMemo)(()=>{if(!i)return;const e="function"==typeof o?o:e=>e[o],t="function"==typeof a?a:e=>e[a],n=new Map;for(const e of re)n.set(e[s]+"",e);return i.map(r=>{if(r.coordinates)return r;const i=n.get(r.source+""),s=n.get(r.target+"");return i&&s?{...r,coordinates:[{[o]:e(i),[a]:t(i)},{[o]:e(s),[a]:t(s)}]}:null}).filter(Boolean)},[i,re,o,a,s]),le=(0,Vh.useMemo)(()=>e=>{const t=("function"==typeof c?c:e=>e[c])(e);return(0,Yh.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[(0,Yh.jsx)("div",{style:{fontWeight:600},children:e[s]||e.name||e.id||"Point"}),null!=t&&(0,Yh.jsxs)("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[c,s]),ce=(0,Vh.useRef)(null);ro(t,{variant:"geo-points",frameRef:ce});const[ue,de]=(0,Vh.useState)(null),he=(0,Vh.useCallback)(()=>{const e=ce.current?.getCartogramLayout?.();e&&de(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius&&t.layout===(e.layout??"radial")?t:{cx:e.cx,cy:e.cy,maxCost:e.maxCost,availableRadius:e.availableRadius,layout:e.layout??"radial"})},[]);(0,Vh.useEffect)(()=>{const e=requestAnimationFrame(he);return()=>cancelAnimationFrame(e)},[he,u,l,n.width,n.height,re,K]);const fe=(0,Vh.useMemo)(()=>{if(!J||!ue)return[];const{maxCost:e}=ue;if(0>=e)return[];if(Array.isArray(J))return J.filter(t=>t>0&&e>=t);const t="number"==typeof J?J:Math.min("strip"===ue.layout?3:5,Math.max(2,Math.ceil(e/5))),n=e/t,r=[];for(let e=1;t>=e;e++)r.push(Math.round(n*e*10)/10);return r},[J,ue]),pe=(0,Vh.useMemo)(()=>{if(!ue)return V.foregroundGraphics||null;const e=(0,Yh.jsx)(oo,{bottomMargin:ie.margin.bottom,costLabel:E,layout:ue,ringStyle:P,ringValues:fe,showNorth:te,showRingLabels:ee,showRings:J}),t=V.foregroundGraphics;return"function"==typeof t?n=>(0,Yh.jsxs)(Yh.Fragment,{children:[e,t(n)]}):(0,Yh.jsxs)(Yh.Fragment,{children:[e,t]})},[ue,fe,J,ee,te,E,P,ie.margin.bottom,V.foregroundGraphics]);if(ie.earlyReturn)return ie.earlyReturn;Ui("DistanceCartogram",re,"xAccessor",o),Ui("DistanceCartogram",re,"yAccessor",a);const me={projection:h,...null!=r&&{points:re},...se&&{lines:se,lineDataAccessor:"coordinates"},xAccessor:o,yAccessor:a,pointIdAccessor:s,pointStyle:oe,projectionTransform:ae,...k&&{transition:{duration:k}},...null!=f&&{graticule:f},...null!=p&&{fitPadding:p},...ne&&{zoomable:!0},...g&&{zoomExtent:g},...y&&{onZoom:y},...null!=v&&{dragRotate:v},...b&&{tileURL:b},...x&&{tileAttribution:x},...w&&{tileCacheSize:w},size:[n.width,n.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ie.margin,enableHover:n.enableHover,tooltipContent:!1===C?()=>null:ii(C)||le,...ie.legendBehaviorProps,...Ji({linkedHover:O,selection:_,onObservation:F,onClick:W,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior,linkedHoverInClickPredicate:!1}),...T&&T.length>0&&{annotations:T},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...n.title&&{title:n.title},...n.description&&{description:n.description},...n.summary&&{summary:n.summary},...void 0!==n.accessibleTable&&{accessibleTable:n.accessibleTable},...z&&{className:z},...null!=e.animate&&{animate:e.animate},...V,foregroundGraphics:pe};return(0,Yh.jsx)(qi,{componentName:"DistanceCartogram",width:n.width,height:n.height,children:(0,Yh.jsx)(Xd,{ref:ce,...me})})});Xh.displayName="DistanceCartogram";var Zh=require("react"),Kh=require("react"),Qh=require("react/jsx-runtime"),Jh=(0,Zh.forwardRef)(function(e,t){const{points:n,areas:r,lines:i,layout:o,layoutConfig:a,onLayoutError:s,projection:l="equirectangular",xAccessor:c="lon",yAccessor:u="lat",lineDataAccessor:d,colorBy:h,colorScheme:f,tooltip:p,annotations:m,margin:g,selection:y,linkedHover:v,onObservation:b,onClick:x,chartId:w,loading:k,loadingContent:S,emptyContent:M,className:j,frameProps:A={}}=e,{frameRef:C,resolved:R,normalizedMargin:L}=function(e){const t=(0,Kh.useRef)(null);return ro(e.imperativeRef,{variant:e.imperativeVariant,frameRef:t}),{frameRef:t,resolved:Ti(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),normalizedMargin:(0,Kh.useMemo)(()=>function(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}(e.margin),[e.margin])}}({imperativeRef:t,imperativeVariant:"geo-points",margin:g,width:e.width,height:e.height,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),P=(0,Zh.useMemo)(()=>gt(n),[n]),N=(0,Zh.useMemo)(()=>gt(r),[r]),E=(0,Zh.useMemo)(()=>gt(i),[i]),I=(0,Zh.useMemo)(()=>[...P,...E,...N],[P,E,N]),T=no({data:I,rawData:void 0!==n||void 0!==i||void 0!==r?I:void 0,colorBy:h,colorScheme:f,legendInteraction:void 0,selection:y,linkedHover:v,fallbackFields:"string"==typeof h?[h]:[],unwrapData:!1,onObservation:b,onClick:x,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:"GeoCustomChart",chartId:w,showLegend:!1,userMargin:L,marginDefaults:R.marginDefaults,loading:k,loadingContent:S,emptyContent:M,width:R.width,height:R.height,hasTitle:!!R.title}),D=T.effectiveSelectionHook,z=(0,Zh.useMemo)(()=>D?.isActive?{isActive:!0,predicate:D.predicate}:null,[D?.isActive,D?.predicate]);if(T.earlyReturn)return T.earlyReturn;const{width:_,height:O,enableHover:F,title:W,description:B,summary:H,accessibleTable:$}=R,q=ii(p),G={projection:l,...null!=n&&{points:P},...null!=r&&{areas:N},...null!=i&&{lines:E},xAccessor:c,yAccessor:u,...null!=d&&{lineDataAccessor:d},customLayout:o,layoutConfig:a,onLayoutError:s,layoutSelection:z,colorBy:h,colorScheme:f,size:[_,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:T.margin,enableHover:F,...Qi({title:W,description:B,summary:H,accessibleTable:$,className:j,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===p?{tooltipContent:()=>null}:q?{tooltipContent:q}:{},...Ji({linkedHover:v,selection:y,onObservation:b,onClick:x,hoverHighlight:!1,mobileInteraction:T.mobileInteraction,customHoverBehavior:T.customHoverBehavior,customClickBehavior:T.customClickBehavior,linkedHoverInClickPredicate:!1}),...m&&m.length>0&&{annotations:m},...A};return(0,Qh.jsx)(qi,{componentName:"GeoCustomChart",width:_,height:O,children:(0,Qh.jsx)(Xd,{ref:C,...G})})});Jh.displayName="GeoCustomChart";var ef={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",opacity:0},tf=8,nf=require("./semiotic-custom-layout-selection-cjs-shared.min.js"),rf=require("react/jsx-runtime"),of=.72,af=1.8,sf=e=>{const t=e.config,n=t.source??"auto",r="areas"===n||"auto"===n&&e.areas.length>0,i=r?function(e){return e.areas.map((t,n)=>{const r=function(e,t){const n=e.properties&&"object"==typeof e.properties?e.properties:{},r=e.id??n.id??n.name??"area-"+t;return{...n,id:r+""}}(t,n),i=e.scales.geoPath.centroid(t),o=Number.isFinite(i[0])&&Number.isFinite(i[1])?e.scales.invertedPoint(i[0],i[1]):null;return{datum:{...r,gridLongitude:o?.[0],gridLatitude:o?.[1]},x:i[0],y:i[1]}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}(e):e.points.map((e,t)=>({datum:e,x:t,y:t})),o=i.filter((e,n)=>!t.filter||t.filter(e.datum,n)),a=function(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;const n=e.map(e=>({datum:e,x:Number(mo(e,t.columnAccessor)),y:Number(mo(e,t.rowAccessor))})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));return n.length!==e.length?null:n.map(e=>({...e,row:e.y,column:e.x}))}(o.map(e=>e.datum),t),s=r?o:function(e){return e.points.map(t=>{const n=Number(mo(t,e.config.longitudeAccessor,["lon","longitude"])),r=Number(mo(t,e.config.latitudeAccessor,["lat","latitude"])),i=Number.isFinite(n)&&Number.isFinite(r)?e.scales.projectedPoint(n,r):null;return{datum:t,x:i?.[0]??NaN,y:i?.[1]??NaN}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}({...e,points:o.map(e=>e.datum)}),l=a??po(s,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===l.length)return{nodes:[]};const c=ho(l.map(e=>e.row)),u=ho(l.map(e=>e.column)),d=Math.max(1,Math.round(c[1]-c[0])+1),h=Math.max(1,Math.round(u[1]-u[0])+1),f=Math.max(0,t.layoutPadding??8),p=Math.max(1,e.dimensions.width-2*f)/h,m=Math.max(1,e.dimensions.height-2*f)/d,g=(e.dimensions.width-p*h)/2,y=(e.dimensions.height-m*d)/2,v=uo(t.cellPadding??.12,0,.8),b=Math.max(1,.5*Math.min(p,m)*(1-v)),x=t.sizeAccessor?l.map(e=>Number(mo(e.datum,t.sizeAccessor))):[],w=t.sizeDomain??ho(x),k=t.sizeRange??[.36,1],S=uo(Math.min(k[0],k[1]),.05,1),M=uo(Math.max(k[0],k[1]),S,1),j=l.map((n,r)=>{const i={...n.datum,gridRow:n.row,gridColumn:n.column},o=(mo(i,t.idAccessor,["id","key","name"])??"grid-"+r)+"",a=(mo(i,t.labelAccessor,["abbr","code","label","name","id"])??o)+"",s=Math.max(1,t.maxLabelLength??4),l=a.length>s?a.slice(0,s):a,d=mo(i,t.categoryAccessor),h=null==d?void 0:d+"",f=mo(i,t.fillAccessor),v=null!=f?f+"":h?e.resolveColor(h):e.theme.categorical[0]??"#4f86c6",x=t.sizeAccessor?Number(mo(i,t.sizeAccessor)):NaN,k=t.sizeAccessor&&Number.isFinite(x)?Math.sqrt(uo(fo(x,w),0,1)):1,j=b*(S+k*(M-S)),A="function"==typeof t.markStyle?t.markStyle(i,r):t.markStyle;return{datum:i,id:o,label:l,category:h,row:n.row,column:n.column,x:g+(n.column-u[0]+.5)*p,y:y+(n.row-c[0]+.5)*m,radius:j,style:{fill:v,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...A}}}),A=t.shape??"circle",C=j.map(e=>{if("circle"===A)return{type:"point",x:e.x,y:e.y,r:e.radius,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},pointId:e.id,_transitionKey:e.id};const t="hexagon"===A?function(e,t,n){const r=[];for(let i=0;6>i;i+=1){const o=-Math.PI/2+i*(Math.PI/3);r.push([e+Math.cos(o)*n,t+Math.sin(o)*n])}return go(r)}(e.x,e.y,e.radius):go([[(n=e.x)-(i=e.radius),(r=e.y)-i],[n+i,r-i],[n+i,r+i],[n-i,r+i]]);var n,r,i;return{type:"geoarea",pathData:t,centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===A?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0}});return{nodes:C,overlays:!1===t.showLabels?null:(0,rf.jsx)(yo,{marks:j,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??uo(.23*Math.min(p,m),7,14),fontFamily:t.labelFontFamily,fontWeight:t.labelFontWeight??700}),restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.18}:{opacity:1}}},lf=require("react/jsx-runtime"),cf=10,uf=25e3,df=new WeakMap,hf=new WeakMap,ff=new WeakMap,pf=1,mf=e=>{const t=function(e){let t=df.get(e.areas);t||(t=new Map,df.set(e.areas,t));const n=function(e){const t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",Mo(t.featureFilter),Mo(t.dotFilter),Eo(e)].join("::")}(e),r=t.get(n);if(r)return r;const i=Co(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){const e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(n,i),i}(e),n=e.config,r=n.shape??"circle",i=Math.max(.5,bo(n.dotRadius)??t.cellSize*vo(n.radiusRatio??.24,.05,.5)),o=n.gridOrigin?.[0]??0,a=n.gridOrigin?.[1]??0,s=t.dots.map((s,l)=>{const c=o+(s.gridColumn+.5)*t.cellSize,u=a+(s.gridRow+.5)*t.cellSize,d=xo(s,n.categoryAccessor),h=xo(s,n.fillAccessor),f={fill:null!=h?h+"":null!=d?e.resolveColor(d+""):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof n.markStyle?n.markStyle(s,l):n.markStyle},p=`dot-${s.gridRow}-${s.gridColumn}`;if("circle"===r)return{type:"point",x:c,y:u,r:i,style:f,datum:s,interactive:!1,pointId:p,_transitionKey:p};const m="hexagon"===r?function(e,t,n){return Io(Array.from({length:6},(r,i)=>{const o=-Math.PI/2+i*(Math.PI/3);return[e+Math.cos(o)*n,t+Math.sin(o)*n]}))}(c,u,i):function(e,t,n){return Io([[e-n,t-n],[e+n,t-n],[e+n,t+n],[e-n,t+n]])}(c,u,i);return{type:"geoarea",pathData:m,centroid:[c,u],bounds:[[c-i,u-i],[c+i,u+i]],screenArea:"hexagon"===r?3*Math.sqrt(3)*i*i/2:(2*i)**2,style:f,datum:s,group:s.featureId,interactive:!1}});return{nodes:s,overlays:n.showOutline?(0,lf.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,r)=>{const i=e.scales.geoPath(t);return i?(0,lf.jsx)("path",{d:i,fill:"none",stroke:n.outlineStyle?.stroke??"currentColor",strokeOpacity:n.outlineStyle?.opacity??n.outlineStyle?.fillOpacity??.22,strokeWidth:n.outlineStyle?.strokeWidth??.7,strokeDasharray:n.outlineStyle?.strokeDasharray,strokeLinecap:n.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},ko(t,r)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};
|
|
2
|
+
function e(e){return"string"==typeof e?document.getElementById(e):"function"==typeof e?e():e}function t({target:t,children:n}){const[r,i]=Yl.useState({requestedTarget:t,resolved:!1,target:null});return Yl.useEffect(()=>{const n=e(t);"production"!==process.env.NODE_ENV&&null==n&&"string"==typeof t&&console.warn(`[Semiotic] accessibleTable portal target "${t}" was not found. Rendering the data-summary controls inline instead.`),i({requestedTarget:t,resolved:!0,target:n})},[t]),r.requestedTarget===t&&r.resolved?r.target?(0,Xl.createPortal)(n,r.target):/* @__PURE__ */ /* @__PURE__ */(0,Zl.jsx)(Zl.Fragment,{children:n}):null}function n(e){return e>1?Tc:-1>e?-Tc:Math.asin(e)}function r(e){return(e=Vc(e/2))*e}function i(){}function o(e,t){e&&Kc.hasOwnProperty(e.type)&&Kc[e.type](e,t)}function a(e,t,n){var r,i=-1,o=e.length-n;for(t.lineStart();++i<o;)t.point((r=e[i])[0],r[1],r[2]);t.lineEnd()}function s(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)a(e[n],t,1);t.polygonEnd()}function l(e,t){e&&Zc.hasOwnProperty(e.type)?Zc[e.type](e,t):o(e,t)}function c(){eu.point=d}function u(){h(fc,pc)}function d(e,t){eu.point=h,fc=e,pc=t,mc=e*=Oc,gc=Hc(t=(t*=Oc)/2+Dc),yc=Vc(t)}function h(e,t){var n=(e*=Oc)-mc,r=0>n?-1:1,i=r*n,o=Hc(t=(t*=Oc)/2+Dc),a=Vc(t),s=yc*a,l=gc*o+s*Hc(i),c=s*r*Vc(i);Qc.add(Bc(c,l)),mc=e,gc=o,yc=a}function f(e){return[Bc(e[1],e[0]),n(e[2])]}function p(e){var t=e[0],n=e[1],r=Hc(n);return[r*Hc(t),r*Vc(t),Vc(n)]}function m(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function g(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function y(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function v(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function b(e){var t=Yc(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function x(e,t){Cc.push(Rc=[vc=e,xc=e]),bc>t&&(bc=t),t>wc&&(wc=t)}function w(e,t){var n=p([e*Oc,t*Oc]);if(jc){var r=g(jc,n),i=g([r[1],-r[0],0],r);b(i),i=f(i);var o,a=e-kc,s=a>0?1:-1,l=i[0]*_c*s,c=Fc(a)>180;c^(l>s*kc&&s*e>l)?(o=i[1]*_c)>wc&&(wc=o):c^((l=(l+360)%360-180)>s*kc&&s*e>l)?bc>(o=-i[1]*_c)&&(bc=o):(bc>t&&(bc=t),t>wc&&(wc=t)),c?kc>e?C(vc,e)>C(vc,xc)&&(xc=e):C(e,xc)>C(vc,xc)&&(vc=e):vc>xc?e>kc?C(vc,e)>C(vc,xc)&&(xc=e):C(e,xc)>C(vc,xc)&&(vc=e):(vc>e&&(vc=e),e>xc&&(xc=e))}else Cc.push(Rc=[vc=e,xc=e]);bc>t&&(bc=t),t>wc&&(wc=t),jc=n,kc=e}function k(){nu.point=w}function S(){Rc[0]=vc,Rc[1]=xc,nu.point=x,jc=null}function M(e,t){if(jc){var n=e-kc;Ac.add(Fc(n)>180?n+(n>0?360:-360):n)}else Sc=e,Mc=t;eu.point(e,t),w(e,t)}function j(){eu.lineStart()}function A(){M(Sc,Mc),eu.lineEnd(),Fc(Ac)>Nc&&(vc=-(xc=180)),Rc[0]=vc,Rc[1]=xc,jc=null}function C(e,t){return 0>(t-=e)?t+360:t}function R(e,t){return e[0]-t[0]}function L(e,t){return e[0]>e[1]?e[0]>t||t>e[1]:t>=e[0]&&e[1]>=t}function P(e){var t,n,r,i,o,a,s;if(wc=xc=-(vc=bc=1/0),Cc=[],l(e,nu),n=Cc.length){for(Cc.sort(R),t=1,o=[r=Cc[0]];n>t;++t)L(r,(i=Cc[t])[0])||L(r,i[1])?(C(r[0],i[1])>C(r[0],r[1])&&(r[1]=i[1]),C(i[0],r[1])>C(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];n>=t;r=i,++t)(s=C(r[1],(i=o[t])[0]))>a&&(a=s,vc=i[0],xc=r[1])}return Cc=Rc=null,vc===1/0||bc===1/0?[[NaN,NaN],[NaN,NaN]]:[[vc,bc],[xc,wc]]}function N(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function E(e,t){return Fc(e)>Ic&&(e-=Math.round(e/zc)*zc),[e,t]}function I(e,t,n){return(e%=zc)?t||n?N(D(e),z(t,n)):D(e):t||n?z(t,n):E}function T(e){return function(t,n){return Fc(t+=e)>Ic&&(t-=Math.round(t/zc)*zc),[t,n]}}function D(e){var t=T(e);return t.invert=T(-e),t}function z(e,t){function r(e,t){var r=Hc(t),l=Hc(e)*r,c=Vc(e)*r,u=Vc(t),d=u*i+l*o;return[Bc(c*a-d*s,l*i-u*o),n(d*a+c*s)]}var i=Hc(e),o=Vc(e),a=Hc(t),s=Vc(t);return r.invert=function(e,t){var r=Hc(t),l=Hc(e)*r,c=Vc(e)*r,u=Vc(t),d=u*a-c*s;return[Bc(c*a+u*s,l*i+d*o),n(d*i-l*o)]},r}function _(e){function t(t){return(t=e(t[0]*Oc,t[1]*Oc))[0]*=_c,t[1]*=_c,t}return e=I(e[0]*Oc,e[1]*Oc,e.length>2?e[2]*Oc:0),t.invert=function(t){return(t=e.invert(t[0]*Oc,t[1]*Oc))[0]*=_c,t[1]*=_c,t},t}function O(e,t,n,r,i,o){if(n){var a=Hc(t),s=Vc(t),l=r*n;null==i?(i=t+r*zc,o=t-l/2):(i=F(a,i),o=F(a,o),(r>0?o>i:i>o)&&(i+=r*zc));for(var c,u=i;r>0?u>o:o>u;u-=l)c=f([a,-s*Hc(u),-s*Vc(u)]),e.point(c[0],c[1])}}function F(e,t){(t=p(t))[0]-=e,b(t);var n,r=(n=-t[1])>1?0:-1>n?Ic:Math.acos(n);return((0>-t[2]?-r:r)+zc-Nc)%zc}function W(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:i,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function B(e,t){return Fc(e[0]-t[0])<Nc&&Fc(e[1]-t[1])<Nc}function H(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function $(e,t,n,r,i){var o,a,s=[],l=[];if(e.forEach(function(e){if((t=e.length-1)>0){var t,n,r=e[0],a=e[t];if(B(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;t>o;++o)i.point((r=e[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}s.push(n=new H(r,e,null,!0)),l.push(n.o=new H(r,null,n,!1)),s.push(n=new H(a,e,null,!1)),l.push(n.o=new H(a,null,n,!0))}}),s.length){for(l.sort(t),q(s),q(l),o=0,a=l.length;a>o;++o)l[o].e=n=!n;for(var c,u,d=s[0];;){for(var h=d,f=!0;h.v;)if((h=h.n)===d)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(f)for(o=0,a=c.length;a>o;++o)i.point((u=c[o])[0],u[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(f)for(o=(c=h.p.z).length-1;o>=0;--o)i.point((u=c[o])[0],u[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,f=!f}while(!h.v);i.lineEnd()}}}function q(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r<t;)i.n=n=e[r],n.p=i,i=n;i.n=n=e[0],n.p=i}}function G(e){return Fc(e[0])>Ic?Uc(e[0])*((Fc(e[0])+Ic)%zc-Ic):e[0]}function V(e,t){var r=G(t),i=t[1],o=Vc(i),a=[Vc(r),-Hc(r),0],s=0,l=0,c=new mu.Adder;1===o?i=Tc+Nc:-1===o&&(i=-Tc-Nc);for(var u=0,d=e.length;d>u;++u)if(f=(h=e[u]).length)for(var h,f,m=h[f-1],y=G(m),v=m[1]/2+Dc,x=Vc(v),w=Hc(v),k=0;f>k;++k,y=M,x=A,w=C,m=S){var S=h[k],M=G(S),j=S[1]/2+Dc,A=Vc(j),C=Hc(j),R=M-y,L=0>R?-1:1,P=L*R,N=P>Ic,E=x*A;if(c.add(Bc(E*L*Vc(P),w*C+E*Hc(P))),s+=N?R+L*zc:R,N^y>=r^M>=r){var I=g(p(m),p(S));b(I);var T=g(a,I);b(T);var D=(N^R>=0?-1:1)*n(T[2]);(i>D||i===D&&(I[0]||I[1]))&&(l+=N^R>=0?1:-1)}}return(-Nc>s||Nc>s&&-1e-12>c)^1&l}function U(e,t,n,r){return function(i){function o(t,n){e(t,n)&&i.point(t,n)}function a(e,t){m.point(e,t)}function s(){b.point=a,m.lineStart()}function l(){b.point=o,m.lineEnd()}function c(e,t){p.push([e,t]),y.point(e,t)}function u(){y.lineStart(),p=[]}function d(){c(p[0][0],p[0][1]),y.lineEnd();var e,t,n,r,o=y.clean(),a=g.result(),s=a.length;if(p.pop(),h.push(p),p=null,s)if(1&o){if((t=(n=a[0]).length-1)>0){for(v||(i.polygonStart(),v=!0),i.lineStart(),e=0;t>e;++e)i.point((r=n[e])[0],r[1]);i.lineEnd()}}else s>1&&2&o&&a.push(a.pop().concat(a.shift())),f.push(a.filter(Y))}var h,f,p,m=t(i),g=W(),y=t(g),v=!1,b={point:o,lineStart:s,lineEnd:l,polygonStart:function(){b.point=c,b.lineStart=u,b.lineEnd=d,f=[],h=[]},polygonEnd:function(){b.point=o,b.lineStart=s,b.lineEnd=l,f=(0,gu.merge)(f);var e=V(h,r);f.length?(v||(i.polygonStart(),v=!0),$(f,X,e,n,i)):e&&(v||(i.polygonStart(),v=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),v&&(i.polygonEnd(),v=!1),f=h=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};return b}}function Y(e){return e.length>1}function X(e,t){return(0>(e=e.x)[0]?e[1]-Tc-Nc:Tc-e[1])-(0>(t=t.x)[0]?t[1]-Tc-Nc:Tc-t[1])}function Z(e,t,n,r){var i,o,a=Vc(e-n);return Fc(a)>Nc?Wc((Vc(t)*(o=Hc(r))*Vc(n)-Vc(r)*(i=Hc(t))*Vc(e))/(i*o*a)):(t+r)/2}function K(e){function t(e,t){return Hc(e)*Hc(t)>i}function n(e,t,n){var r=[1,0,0],o=g(p(e),p(t)),a=m(o,o),s=o[0],l=a-s*s;if(!l)return!n&&e;var c=i*a/l,u=-i*s/l,d=g(r,o),h=v(r,c);y(h,v(o,u));var b=d,x=m(h,b),w=m(b,b),k=x*x-w*(m(h,h)-1);if(k>=0){var S=Yc(k),M=v(b,(-x-S)/w);if(y(M,h),M=f(M),!n)return M;var j,A=e[0],C=t[0],R=e[1],L=t[1];A>C&&(j=A,A=C,C=j);var P=C-A,N=Fc(P-Ic)<Nc;if(!N&&R>L&&(j=R,R=L,L=j),N||Nc>P?N?R+L>0^M[1]<(Fc(M[0]-A)<Nc?R:L):M[1]>=R&&L>=M[1]:P>Ic^(M[0]>=A&&C>=M[0])){var E=v(b,(-x+S)/w);return y(E,h),[M,f(E)]}}}function r(t,n){var r=a?e:Ic-e,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>n?i|=4:n>r&&(i|=8),i}var i=Hc(e),o=2*Oc,a=i>0,s=Fc(i)>Nc;return U(t,function(e){var i,o,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(d,h){var f,p=[d,h],m=t(d,h),g=a?m?0:r(d,h):m?r(d+(0>d?Ic:-Ic),h):0;if(!i&&(c=l=m)&&e.lineStart(),m!==l&&(!(f=n(i,p))||B(i,f)||B(p,f))&&(p[2]=1),m!==l)u=0,m?(e.lineStart(),f=n(p,i),e.point(f[0],f[1])):(f=n(i,p),e.point(f[0],f[1],2),e.lineEnd()),i=f;else if(s&&i&&a^m){var y;g&o||!(y=n(p,i,!0))||(u=0,a?(e.lineStart(),e.point(y[0][0],y[0][1]),e.point(y[1][0],y[1][1]),e.lineEnd()):(e.point(y[1][0],y[1][1]),e.lineEnd(),e.lineStart(),e.point(y[0][0],y[0][1],3)))}!m||i&&B(i,p)||e.point(p[0],p[1]),i=p,l=m,o=g},lineEnd:function(){l&&e.lineEnd(),i=null},clean:function(){return u|(c&&l)<<1}}},function(t,n,r,i){O(i,e,o,r,t,n)},a?[0,-e]:[-Ic,e-Ic])}function Q(e,t,n,r,i,o){var a,s=e[0],l=e[1],c=0,u=1,d=t[0]-s,h=t[1]-l;if(a=n-s,d||0>=a){if(a/=d,0>d){if(c>a)return;u>a&&(u=a)}else if(d>0){if(a>u)return;a>c&&(c=a)}if(a=i-s,d||a>=0){if(a/=d,0>d){if(a>u)return;a>c&&(c=a)}else if(d>0){if(c>a)return;u>a&&(u=a)}if(a=r-l,h||0>=a){if(a/=h,0>h){if(c>a)return;u>a&&(u=a)}else if(h>0){if(a>u)return;a>c&&(c=a)}if(a=o-l,h||a>=0){if(a/=h,0>h){if(a>u)return;a>c&&(c=a)}else if(h>0){if(c>a)return;u>a&&(u=a)}return c>0&&(e[0]=s+c*d,e[1]=l+c*h),1>u&&(t[0]=s+u*d,t[1]=l+u*h),!0}}}}}function J(e,t,n,r){function i(i,o){return!(e>i||i>n||t>o||o>r)}function o(i,o,s,c){var u=0,d=0;if(null==i||(u=a(i,s))!==(d=a(o,s))||0>l(i,o)^s>0)do{c.point(0===u||3===u?e:n,u>1?r:t)}while((u=(u+s+4)%4)!==d);else c.point(o[0],o[1])}function a(r,i){return Fc(r[0]-e)<Nc?i>0?0:3:Fc(r[0]-n)<Nc?i>0?2:1:Fc(r[1]-t)<Nc?i>0?1:0:i>0?3:2}function s(e,t){return l(e.x,t.x)}function l(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){function l(e,t){i(e,t)&&k.point(e,t)}function c(){for(var t=0,n=0,i=h.length;i>n;++n)for(var o,a,s=h[n],l=1,c=s.length,u=s[0],d=u[0],f=u[1];c>l;++l)o=d,a=f,d=(u=s[l])[0],f=u[1],a>r?r>=f&&(f-a)*(e-o)>(d-o)*(r-a)&&--t:f>r&&(d-o)*(r-a)>(f-a)*(e-o)&&++t;return t}function u(o,a){var s=i(o,a);if(h&&f.push([o,a]),x)p=o,m=a,g=s,x=!1,s&&(k.lineStart(),k.point(o,a));else if(s&&b)k.point(o,a);else{var l=[y=Math.max(xu,Math.min(bu,y)),v=Math.max(xu,Math.min(bu,v))],c=[o=Math.max(xu,Math.min(bu,o)),a=Math.max(xu,Math.min(bu,a))];Q(l,c,e,t,n,r)?(b||(k.lineStart(),k.point(l[0],l[1])),k.point(c[0],c[1]),s||k.lineEnd(),w=!1):s&&(k.lineStart(),k.point(o,a),w=!1)}y=o,v=a,b=s}var d,h,f,p,m,g,y,v,b,x,w,k=a,S=W(),M={point:l,lineStart:function(){M.point=u,h&&h.push(f=[]),x=!0,b=!1,y=v=NaN},lineEnd:function(){d&&(u(p,m),g&&b&&S.rejoin(),d.push(S.result())),M.point=l,b&&k.lineEnd()},polygonStart:function(){k=S,d=[],h=[],w=!0},polygonEnd:function(){var e=c(),t=w&&e,n=(d=(0,vu.merge)(d)).length;(t||n)&&(a.polygonStart(),t&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),n&&$(d,s,e,o,a),a.polygonEnd()),k=a,d=h=f=null}};return M}}function ee(){ku.point=ku.lineEnd=i}function te(e,t){iu=e*=Oc,ou=Vc(t*=Oc),au=Hc(t),ku.point=ne}function ne(e,t){e*=Oc;var n=Vc(t*=Oc),r=Hc(t),i=Fc(e-iu),o=Hc(i),a=r*Vc(i),s=au*n-ou*r*o,l=ou*n+au*r*o;ru.add(Bc(Yc(a*a+s*s),l)),iu=e,ou=n,au=r}function re(e,t){return Su[0]=e,Su[1]=t,n=Mu,ru=new wu.Adder,l(n,ku),+ru;var n}function ie(e,t){return!(!e||!Au.hasOwnProperty(e.type))&&Au[e.type](e,t)}function oe(e,t){return 0===re(e,t)}function ae(e,t){for(var n,r,i,o=0,a=e.length;a>o;o++){if(0===(r=re(e[o],t)))return!0;if(o>0&&(i=re(e[o],e[o-1]))>0&&i>=n&&i>=r&&Ec*i>(n+r-i)*(1-Math.pow((n-r)/i,2)))return!0;n=r}return!1}function se(e,t){return!!V(e.map(le),ce(t))}function le(e){return(e=e.map(ce)).pop(),e}function ce(e){return[e[0]*Oc,e[1]*Oc]}function ue(e,t){return(e&&ju.hasOwnProperty(e.type)?ju[e.type]:ie)(e,t)}function de(e,t,n){var r=(0,Cu.range)(e,t-Nc,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function he(e,t,n){var r=(0,Cu.range)(e,t-Nc,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function fe(){function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return(0,Cu.range)($c(o/g)*g,i,g).map(h).concat((0,Cu.range)($c(c/y)*y,l,y).map(f)).concat((0,Cu.range)($c(r/p)*p,n,p).filter(function(e){return Fc(e%g)>Nc}).map(u)).concat((0,Cu.range)($c(s/m)*m,a,m).filter(function(e){return Fc(e%y)>Nc}).map(d))}var n,r,i,o,a,s,l,c,u,d,h,f,p=10,m=p,g=90,y=360,v=2.5;return e.lines=function(){return t().map(function(e){return{type:"LineString",coordinates:e}})},e.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(f(l).slice(1),h(i).reverse().slice(1),f(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()},e.extentMajor=function(t){return arguments.length?(c=+t[0][1],l=+t[1][1],(o=+t[0][0])>(i=+t[1][0])&&(t=o,o=i,i=t),c>l&&(t=c,c=l,l=t),e.precision(v)):[[o,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(s=+t[0][1],a=+t[1][1],(r=+t[0][0])>(n=+t[1][0])&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),e.precision(v)):[[r,s],[n,a]]},e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()},e.stepMajor=function(t){return arguments.length?(g=+t[0],y=+t[1],e):[g,y]},e.stepMinor=function(t){return arguments.length?(p=+t[0],m=+t[1],e):[p,m]},e.precision=function(t){return arguments.length?(v=+t,u=de(s,a,90),d=he(r,n,v),h=de(c,l,90),f=he(o,i,v),e):v},e.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function pe(e,t){var i=e[0]*Oc,o=e[1]*Oc,a=t[0]*Oc,s=t[1]*Oc,l=Hc(o),c=Vc(o),u=Hc(s),d=Vc(s),h=l*Hc(i),f=l*Vc(i),p=u*Hc(a),m=u*Vc(a),g=2*n(Yc(r(s-o)+l*u*r(a-i))),y=Vc(g),v=g?function(e){var t=Vc(e*=g)/y,n=Vc(g-e)/y,r=n*h+t*p,i=n*f+t*m,o=n*c+t*d;return[Bc(i,r)*_c,Bc(o,Yc(r*r+i*i))*_c]}:function(){return[i*_c,o*_c]};return v.distance=g,v}function me(){Eu.point=ge}function ge(e,t){Eu.point=ye,su=cu=e,lu=uu=t}function ye(e,t){Nu.add(uu*e-cu*t),cu=e,uu=t}function ve(){ye(su,lu)}function be(e,t){Fu+=e,Wu+=t,++Bu}function xe(){Yu.point=we}function we(e,t){Yu.point=ke,be(fu=e,pu=t)}function ke(e,t){var n=e-fu,r=t-pu,i=Yc(n*n+r*r);Hu+=i*(fu+e)/2,$u+=i*(pu+t)/2,qu+=i,be(fu=e,pu=t)}function Se(){Yu.point=be}function Me(){Yu.point=Ae}function je(){Ce(du,hu)}function Ae(e,t){Yu.point=Ce,be(du=fu=e,hu=pu=t)}function Ce(e,t){var n=e-fu,r=t-pu,i=Yc(n*n+r*r);Hu+=i*(fu+e)/2,$u+=i*(pu+t)/2,qu+=i,Gu+=(i=pu*e-fu*t)*(fu+e),Vu+=i*(pu+t),Uu+=3*i,be(fu=e,pu=t)}function Re(e){this._context=e}function Le(e,t){sd.point=Pe,Ku=Ju=e,Qu=ed=t}function Pe(e,t){ad.add(Yc((Ju-=e)*Ju+(ed-=t)*ed)),Ju=e,ed=t}function Ne(e){let t=1;this._+=e[0];for(const n=e.length;n>t;++t)this._+=arguments[t]+e[t]}function Ee(e){const t=Math.floor(e);if(0>t)throw new RangeError("invalid digits: "+e);if(t>15)return Ne;if(t!==td){const e=10**t;td=t,nd=function(t){let n=1;this._+=t[0];for(const r=t.length;r>n;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}return nd}function Ie(e,t){function n(e){return e&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),l(e,r(i))),i.result()}let r,i,o=3,a=4.5;return n.area=function(e){return l(e,r(Iu)),Iu.result()},n.measure=function(e){return l(e,r(ld)),ld.result()},n.bounds=function(e){return l(e,r(Ou)),Ou.result()},n.centroid=function(e){return l(e,r(Xu)),Xu.result()},n.projection=function(t){return arguments.length?(r=null==t?(e=null,Ru):(e=t).stream,n):e},n.context=function(e){return arguments.length?(i=null==e?(t=null,new cd(o)):new Re(t=e),"function"!=typeof a&&i.pointRadius(a),n):t},n.pointRadius=function(e){return arguments.length?(a="function"==typeof e?e:(i.pointRadius(+e),+e),n):a},n.digits=function(e){if(!arguments.length)return o;if(null==e)o=null;else{const t=Math.floor(e);if(0>t)throw new RangeError("invalid digits: "+e);o=t}return null===t&&(i=new cd(o)),n},n.projection(e).digits(o).context(t)}function Te(e){return function(t){var n=new De;for(var r in e)n[r]=e[r];return n.stream=t,n}}function De(){}function ze(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),l(n,e.stream(Ou)),t(Ou.result()),null!=r&&e.clipExtent(r),e}function _e(e,t,n){return ze(e,function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])},n)}function Oe(e,t,n){return _e(e,[[0,0],t],n)}function Fe(e,t,n){return ze(e,function(n){var r=+t,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([o,a])},n)}function We(e,t,n){return ze(e,function(n){var r=+t,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([o,a])},n)}function Be(e,t){return+t?$e(e,t):He(e)}function He(e){return Te({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function $e(e,t){function r(i,o,a,s,l,c,u,d,h,f,p,m,g,y){var v=u-i,b=d-o,x=v*v+b*b;if(x>4*t&&g--){var w=s+f,k=l+p,S=c+m,M=Yc(w*w+k*k+S*S),j=n(S/=M),A=Fc(Fc(S)-1)<Nc||Fc(a-h)<Nc?(a+h)/2:Bc(k,w),C=e(A,j),R=C[0],L=C[1],P=R-i,N=L-o,E=b*P-v*N;(E*E/x>t||Fc((v*P+b*N)/x-.5)>.3||ud>s*f+l*p+c*m)&&(r(i,o,a,s,l,c,R,L,A,w/=M,k/=M,S,g,y),y.point(R,L),r(R,L,A,w,k,S,u,d,h,f,p,m,g,y))}}return function(t){function n(n,r){n=e(n,r),t.point(n[0],n[1])}function i(){v=NaN,S.point=o,t.lineStart()}function o(n,i){var o=p([n,i]),a=e(n,i);r(v,b,y,x,w,k,v=a[0],b=a[1],y=n,x=o[0],w=o[1],k=o[2],16,t),t.point(v,b)}function a(){S.point=n,t.lineEnd()}function s(){i(),S.point=l,S.lineEnd=c}function l(e,t){o(u=e,t),d=v,h=b,f=x,m=w,g=k,S.point=o}function c(){r(v,b,y,x,w,k,d,h,u,f,m,g,16,t),S.lineEnd=a,a()}var u,d,h,f,m,g,y,v,b,x,w,k,S={point:n,lineStart:i,lineEnd:a,polygonStart:function(){t.polygonStart(),S.lineStart=s},polygonEnd:function(){t.polygonEnd(),S.lineStart=i}};return S}}function qe(e){return Te({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Ge(e,t,n,r,i){function o(o,a){return[t+e*(o*=r),n-e*(a*=i)]}return o.invert=function(o,a){return[(o-t)/e*r,(n-a)/e*i]},o}function Ve(e,t,n,r,i,o){function a(e,o){return[c*(e*=r)-u*(o*=i)+t,n-u*e-c*o]}if(!o)return Ge(e,t,n,r,i);var s=Hc(o),l=Vc(o),c=s*e,u=l*e,d=s/e,h=l/e,f=(l*n-s*t)/e,p=(l*t+s*n)/e;return a.invert=function(e,t){return[r*(d*e-h*t+f),i*(p-h*e-d*t)]},a}function Ue(e){return Ye(function(){return e})()}function Ye(e){function t(e){return h(e[0]*Oc,e[1]*Oc)}function n(e){return(e=h.invert(e[0],e[1]))&&[e[0]*_c,e[1]*_c]}function r(){var e=Ve(m,0,0,M,j,S).apply(null,o(v,b)),t=Ve(m,g-e[0],y-e[1],M,j,S);return a=I(x,w,k),d=N(o,t),h=N(a,d),u=Be(d,P),i()}function i(){return f=p=null,t}var o,a,s,l,c,u,d,h,f,p,m=150,g=480,y=250,v=0,b=0,x=0,w=0,k=0,S=0,M=1,j=1,A=null,C=yu,R=null,L=Ru,P=.5;return t.stream=function(e){return f&&p===e?f:f=dd(qe(a)(C(u(L(p=e)))))},t.preclip=function(e){return arguments.length?(C=e,A=void 0,i()):C},t.postclip=function(e){return arguments.length?(L=e,R=s=l=c=null,i()):L},t.clipAngle=function(e){return arguments.length?(C=+e?K(A=e*Oc):(A=null,yu),i()):A*_c},t.clipExtent=function(e){return arguments.length?(L=null==e?(R=s=l=c=null,Ru):J(R=+e[0][0],s=+e[0][1],l=+e[1][0],c=+e[1][1]),i()):null==R?null:[[R,s],[l,c]]},t.scale=function(e){return arguments.length?(m=+e,r()):m},t.translate=function(e){return arguments.length?(g=+e[0],y=+e[1],r()):[g,y]},t.center=function(e){return arguments.length?(v=e[0]%360*Oc,b=e[1]%360*Oc,r()):[v*_c,b*_c]},t.rotate=function(e){return arguments.length?(x=e[0]%360*Oc,w=e[1]%360*Oc,k=e.length>2?e[2]%360*Oc:0,r()):[x*_c,w*_c,k*_c]},t.angle=function(e){return arguments.length?(S=e%360*Oc,r()):S*_c},t.reflectX=function(e){return arguments.length?(M=e?-1:1,r()):0>M},t.reflectY=function(e){return arguments.length?(j=e?-1:1,r()):0>j},t.precision=function(e){return arguments.length?(u=Be(d,P=e*e),i()):Yc(P)},t.fitExtent=function(e,n){return _e(t,e,n)},t.fitSize=function(e,n){return Oe(t,e,n)},t.fitWidth=function(e,n){return Fe(t,e,n)},t.fitHeight=function(e,n){return We(t,e,n)},function(){return o=e.apply(this,arguments),t.invert=o.invert&&n,r()}}function Xe(e){function t(e,t){return[e*r,Vc(t)/r]}var r=Hc(e);return t.invert=function(e,t){return[e/r,n(t*r)]},t}function Ze(e,t){function r(e,t){var n=Yc(a-2*o*Vc(t))/o;return[n*Vc(e*=o),s-n*Hc(e)]}var i=Vc(e),o=(i+Vc(t))/2;if(Fc(o)<Nc)return Xe(e);var a=1+i*(2*o-i),s=Yc(a)/o;return r.invert=function(e,t){var r=s-t,i=Bc(e,Fc(r))*Uc(r);return 0>r*o&&(i-=Ic*Uc(e)*Uc(r)),[i/o,n((a-(e*e+r*r)*o*o)/(2*o))]},r}function Ke(){return(e=Ze,t=0,n=Ic/3,r=Ye(e),i=r(t,n),i.parallels=function(e){return arguments.length?r(t=e[0]*Oc,n=e[1]*Oc):[t*_c,n*_c]},i).scale(155.424).center([0,33.6442]);var e,t,n,r,i}function Qe(e,t){return[e,Gc(Xc((Tc+t)/2))]}function Je(e){function t(){var t=Ic*s(),a=o(_(o.rotate()).invert([0,0]));return c(null==u?[[a[0]-t,a[1]-t],[a[0]+t,a[1]+t]]:e===Qe?[[Math.max(a[0]-t,u),n],[Math.min(a[0]+t,r),i]]:[[u,Math.max(a[1]-t,n)],[r,Math.min(a[1]+t,i)]])}var n,r,i,o=Ue(e),a=o.center,s=o.scale,l=o.translate,c=o.clipExtent,u=null;return o.scale=function(e){return arguments.length?(s(e),t()):s()},o.translate=function(e){return arguments.length?(l(e),t()):l()},o.center=function(e){return arguments.length?(a(e),t()):a()},o.clipExtent=function(e){return arguments.length?(null==e?u=n=r=i=null:(u=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),t()):null==u?null:[[u,n],[r,i]]},t()}function et(e,t){return[e,t]}function tt(e,t){var r=n(yd*Vc(t)),i=r*r,o=i*i*i;return[e*Hc(r)/(yd*(fd+3*pd*i+o*(7*md+9*gd*i))),r*(fd+pd*i+o*(md+gd*i))]}function nt(){return Ue(tt).scale(177.158)}function rt(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),t*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function it(e,t){return[Hc(t)*Vc(e),Vc(t)]}function ot(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}function at(e,t){return Math.min((e-t.startTime)/t.duration,1)}function st(e,t,n){return e+(t-e)*n}function lt(e,t){if(!1===e)return{transition:void 0,introEnabled:!1};const n="undefined"!=typeof window&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;return{transition:e?!0===e?{duration:300}:{duration:e.duration??300,easing:"linear"===e.easing?"linear":"ease-out"}:t,introEnabled:!(n||!e||!0!==e&&!1===e.intro)}}function ct(e,t,n={}){return Number.isFinite(t)&&t>0?Number.isNaN(e)?"fresh":e===1/0?"expired":0>e||t*(n.fresh??xd)>e?"fresh":t*(n.aging??wd)>e?"aging":t*(n.stale??kd)>e?"stale":"expired":"fresh"}function ut(e){const t=Math.max(0,Math.min(1,e.minOpacity??.1));if(Number.isNaN(e.age))return 1;if(e.age===1/0)return t;if(!Number.isFinite(e.extent)||0>=e.extent)return 1;const n=Math.max(0,e.age);if("step"===e.type)return(e.threshold??.5*e.extent)>n?1:t;if("exponential"===e.type){const r=e.halfLife??e.extent/2;return t+Math.pow(.5,n/(r>0?r:e.extent/2))*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}function dt(e,t,n){if(1>=n)return 1;const r=n-1;return ut({age:r-t,extent:r,type:e.type,halfLife:e.halfLife??n/2,threshold:e.stepThreshold??.5*n,minOpacity:e.minOpacity??.1})}function ht(e,t,n){const r=e.duration??500,i=n-t;return r>i?1-i/r:0}function ft(e,t,n,r){let i=!1;return t>0?(e._pulseIntensity!==t&&(e._pulseIntensity=t,i=!0),e._pulseColor!==n&&(e._pulseColor=n,i=!0),e._pulseGlowRadius!==r&&(e._pulseGlowRadius=r,i=!0),i):(0!==e._pulseIntensity&&(e._pulseIntensity=0,i=!0),void 0!==e._pulseColor&&(e._pulseColor=void 0,i=!0),void 0!==e._pulseGlowRadius&&(e._pulseGlowRadius=void 0,i=!0),i)}function pt(e,t,n=("undefined"!=typeof performance?performance.now():Date.now())){if(!t||0===t.size)return!1;const r=e.duration??500,i=t.peek();return null!=i&&r>n-i}function mt(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function gt(e,t,n){const r=e=>e.toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function yt(e){const t=e.map(mt),n=t.length-1;return e=>{if(Number.isNaN(e)&&(e=0),0>=e){const[e,n,r]=t[0];return gt(e,n,r)}if(e>=1){const[e,r,i]=t[n];return gt(e,r,i)}const r=e*n,i=Math.floor(r),o=r-i,[a,s,l]=t[i],[c,u,d]=t[i+1];return gt(Math.round(a+(c-a)*o),Math.round(s+(u-s)*o),Math.round(l+(d-l)*o))}}function vt(e){return e&&Object.prototype.hasOwnProperty.call(_d,e)?_d[e]:jd}function bt(e,t,n=Fd){if(e&&"object"==typeof e&&!Array.isArray(e)){const t=Object.values(e).filter(e=>"string"==typeof e&&e.length>0);if(t.length>0)return t}if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e){const t=Object.prototype.hasOwnProperty.call(Od,e)?Od[e]:void 0;if(Array.isArray(t)&&t.length>0)return t}return t&&t.length>0?t:n}function xt(e){const t=e.toLowerCase();return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")||Hd.has(t)}function wt(e,t,n){if("function"==typeof t){const r=t(e);return n&&r&&"string"==typeof r&&!xt(r)?n(r):r}const r=e?.[t]+"";return n?n(r):Fd[Math.abs(Mt(r))%Fd.length]}function kt(e,t){if(null==t||!Object.prototype.hasOwnProperty.call(e,t))return;const n=e[t];return"string"==typeof n&&n.length>0?n:void 0}function St(e,t,n="category10"){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;return t=>kt(e,t)??"#999"}const r=Array.from(new Set(e.map(e=>e?.[t]).filter(e=>null!=e).map(e=>e+""))),i=r.every(e=>!isNaN(Number(e)));if(Array.isArray(n))return(0,Sd.scaleOrdinal)().domain(r).range(n).unknown("#999");const o=Object.prototype.hasOwnProperty.call(Od,n)?Od[n]:Od.category10;if(i&&"function"==typeof o){let e=-1/0;for(const t of r){const n=Number(t);n>e&&(e=n)}return t=>o(0===e?0:Number(t)/e)}{const e=Array.isArray(o)?o:Fd;return(0,Sd.scaleOrdinal)().domain(r).range(e).unknown("#999")}}function Mt(e){let t=0;for(let n=0;e.length>n;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}function jt(e,t,n=[3,20],r){let i;if(i="function"==typeof t?t(e):e?.[t],!r)return i;const[o,a]=r,[s,l]=n;if(a===o)return(s+l)/2;let c=(i-o)/(a-o);return 0>c?c=0:c>1&&(c=1),s+c*(l-s)}function At(e,t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:void 0;return 0===e.length?e=>n&&kt(n,e)||"#4e79a7":t=>{if(n){const e=kt(n,t);if(e)return e}let r=0;for(let e=0;t.length>e;e++)r=31*r+t.charCodeAt(e)|0;return e[Math.abs(r)%e.length]??"#4e79a7"}}function Ct(e){if("production"===process.env.NODE_ENV)return;const{label:t,nodes:n,overlays:r,warned:i}=e;Rt(r)&&0===n.length&&Lt(i,"overlay-only",`[semiotic] ${t} returned overlays but no data-bearing scene nodes. Overlays do not participate in hover, selection, transitions, SSR evidence, or accessibility tables. Emit at least one scene node with a datum, or mark the overlay-only chart as intentionally decorative.`),n.length>0&&n.every(e=>null==e.datum)&&Lt(i,"null-datums",`[semiotic] ${t} returned scene nodes, but every scene-node datum is null. Hover, callbacks, selection, and tooltip helpers need data-bearing nodes. Attach a user-facing datum to each interactive node, or set interactive overlays outside the chart.`)}function Rt(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(Rt))}function Lt(e,t,n){e.has(t)||(e.add(t),console.warn(n))}function Pt(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message||"Custom layout threw."};if("string"==typeof e)return{name:"Error",message:e};if(null==e)return{name:"Error",message:"Custom layout threw a nullish value."};try{return{name:"Error",message:e+""}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}function Nt(e,t,n,r){const i=Pt(t),o="network"===e?"customNetworkLayout":"customLayout";return{code:"CUSTOM_LAYOUT_ERROR",severity:"error",phase:"layout",component:e,source:o,message:`Semiotic ${e} ${o} failed: ${i.message}`,error:i,recovery:n?"preserved-last-good-scene":"empty-scene",preservedLastGoodScene:n,affectedRevision:r}}function Et(e){try{return{kind:"success",result:e.run()}}catch(t){const n=e.hasPreviousResult,r=Nt(e.family,t,n,e.revision);"production"!==process.env.NODE_ENV&&console.error(`[semiotic] ${e.logLabel} threw:`,t);try{e.onLayoutError?.(r)}catch(e){"production"!==process.env.NODE_ENV&&console.error("[semiotic] onLayoutError threw:",e)}return{kind:"failure",diagnostic:r,preservedLastGoodScene:n}}}function It(e){if(!e)return nt();if("string"==typeof e){const t=$d[e];return t?t():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${e}", falling back to equalEarth`),nt())}if("object"==typeof e&&"type"in e){const t=$d[e.type],n=t?t():nt();return e.rotate&&"rotate"in n&&n.rotate(e.rotate),e.center&&"center"in n&&n.center(e.center),n}return e}function Tt(e,t){return e?"function"==typeof e?e:t=>t[e]:e=>e[t]}function Dt(e){return e?"function"==typeof e?e:t=>t[e]:e=>e.coordinates||e.data||[]}function zt(e,t,n){return e?"function"==typeof e?{...n,...e(t)}:{...n,...e}:{...n}}function _t(e){return{fill:e.themeSemantic?.surface||"#e0e0e0",stroke:e.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}function Ot(e){return{fill:e.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}function Ft(e){return{stroke:e.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}function Wt(e,t){if(2>e.length)return[e];const n=.4*t,r=[];let i=[e[0]];for(let t=1;e.length>t;t++){const o=e[t];Math.abs(o[0]-e[t-1][0])>n?(2>i.length||r.push(i),i=[o]):i.push(o)}return 2>i.length||r.push(i),r}function Bt(e,t,n=24){const r=t[0]-e[0],i=t[1]-e[1],o=Math.sqrt(r*r+i*i);if(0===o)return[e,t];const a=-i/o,s=r/o,l=Math.min(.3*o,80),c=(e[0]+t[0])/2+a*l,u=(e[1]+t[1])/2+s*l,d=[];for(let r=0;n>=r;r++){const i=r/n,o=1-i;d.push([o*o*e[0]+2*o*i*c+i*i*t[0],o*o*e[1]+2*o*i*u+i*i*t[1]])}return d}function Ht(e,t){if(2>e.length)return e;const n=t/2+1,r=[];for(let t=0;e.length>t;t++){const i=e[t];let o,a;0===t?(o=e[1][0]-i[0],a=e[1][1]-i[1]):t===e.length-1?(o=i[0]-e[t-1][0],a=i[1]-e[t-1][1]):(o=e[t+1][0]-e[t-1][0],a=e[t+1][1]-e[t-1][1]);const s=Math.sqrt(o*o+a*a)||1;r.push([i[0]+a/s*n,i[1]+-o/s*n])}return r}function $t(e,t,n,r,i){const o=t[0]-e[0],a=t[1]-e[1],s=Math.sqrt(o*o+a*a);if(0===s)return[e,t];const l=a/s,c=-o/s,u=i/2+1;return[[e[0]+l*u,e[1]+c*u],[t[0]+l*u,t[1]+c*u]]}function qt(e){let t=1/0,n=-1/0;for(const r of e)t>r&&(t=r),r>n&&(n=r);return[t,n]}function Gt(e,t=-1/0){let n=t;for(const t of e)t>n&&(n=t);return n}function Vt(e,t,n,r){const i=e.filter(e=>"point"===e.type);if(2>i.length)return null;const o=t.strength??1,a=Number.isFinite(o)?Math.max(0,Math.min(1,o)):1,s="strip"===t.layout?"strip":"radial";if("radial"===s&&0===a)return null;const l=t.centerAccessor?"function"==typeof t.centerAccessor?t.centerAccessor:e=>e[t.centerAccessor]:e=>e.id,c="function"==typeof t.costAccessor?t.costAccessor:e=>e[t.costAccessor],u=i.find(e=>e.datum&&l(e.datum)+""==t.center+"");if(!u)return"production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Distance cartogram center "${t.center}" not found in point data`),null;const d=Gt(i.map(e=>e.datum?Number(c(e.datum)):NaN).filter(e=>isFinite(e)&&e>=0),1);r>0&&"production"!==process.env.NODE_ENV&&console.warn("GeoFrame: Distance cartogram does not support area rendering. Areas will be ignored. Remove areas or set projectionTransform to null to render them.");for(let t=e.length-1;t>=0;t--){const n=e[t];"geoarea"===n.type&&n.interactive&&e.splice(t,1)}const h="strip"===s?Yt(i,u,c,d,n):Ut(i,u,c,d,a,n),f=e.filter(e=>"line"===e.type);if(f.length>0){const e=/* @__PURE__ */new Map;for(const t of i)null!=t.pointId&&e.set(t.pointId+"",[t.x,t.y]);for(const n of f){const r=n.datum?.source,i=n.datum?.target;if(null!=r&&null!=i){const o=e.get(r+""),a=e.get(i+"");if(o&&a)if("fractional"===t.lineMode&&n.path.length>2){const e=n.path[0],t=n.path[n.path.length-1],r=[o[0]-e[0],o[1]-e[1]],i=[a[0]-t[0],a[1]-t[1]],s=[0];for(let e=1;n.path.length>e;e++)s.push(s[e-1]+Math.hypot(n.path[e][0]-n.path[e-1][0],n.path[e][1]-n.path[e-1][1]));const l=s[s.length-1];n.path=n.path.map((e,t)=>{const o=l>0?s[t]/l:t/(n.path.length-1);return[e[0]+r[0]*(1-o)+i[0]*o,e[1]+r[1]*(1-o)+i[1]*o]})}else n.path=[o,a]}}}return h}function Ut(e,t,n,r,i,o){const a=t.x,s=t.y,l=o.width/2,c=o.height/2,u=Math.min(o.width,o.height)/2,d=(0,qd.scaleLinear)().domain([0,r]).range([0,u]);for(const o of e){if(o===t)continue;if(!o.datum)continue;const e=o.x,u=o.y,h=Math.atan2(u-s,e-a),f=Math.hypot(e-a,u-s),p=Number(n(o.datum)),m=isFinite(p)&&p>=0?r>0?d(p):0:f,g=l+Math.cos(h)*m,y=c+Math.sin(h)*m;o.x=e+(g-e)*i,o.y=u+(y-u)*i}return t.x=a+(l-a)*i,t.y=s+(c-s)*i,{cx:t.x,cy:t.y,maxCost:r,availableRadius:u,layout:"radial"}}function Yt(e,t,n,r,i){const o=Math.max(3,Math.min(8,.35*i.height)),a=Math.max(1,i.width-2*o),s=i.height/2,l=(0,qd.scaleLinear)().domain([0,r]).range([0,a]);t.x=o,t.y=s;const c=[];for(const i of e){if(i===t)continue;if(!i.datum){i.x=o,i.y=s;continue}const e=Number(n(i.datum)),a=o+(isFinite(e)&&e>=0&&r>0?l(e):0);i.x=a,i.y=s,c.push({node:i,x:a})}c.sort((e,t)=>e.x-t.x);const u=Math.max(0,Math.min(i.height/2-1,6));let d=0;for(;c.length>d;){let e=d+1;for(;c.length>e&&3>Math.abs(c[e].x-c[d].x);)e++;const t=e-d;if(t>1&&u>0)for(let e=0;t>e;e++)c[d+e].node.y=s+(e-(t-1)/2)*Math.min(2.5,2*u/Math.max(1,t-1));d=e}return{cx:o,cy:s,maxCost:r,availableRadius:a,layout:"strip"}}function Xt(e,t,n,r){const i=e.push(t);return n&&n.push(r),i}function Zt(e,t,n){if(!t||0===t.size)return;const r=/* @__PURE__ */new Set;if(e.forEach((e,t)=>{n(e)&&r.add(t)}),0===r.size)return;const i=t.toArray();t.clear();for(let e=0;i.length>e;e++)r.has(e)||t.push(i[e])}function Kt(e,t){const n={...e};for(const e of t)n[Gd[e]]++;return n}function Qt(e,t,n){const r=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:r,revisions:Kt(n,r)}}function Jt(e){let t="preserve";const n=/* @__PURE__ */new Set;for(const r of e){const e=nh[r]??rh;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)n.add(t)}return{retainedData:t,invalidations:n}}function en({config:e,projection:t,path:n,areas:r,points:i,lines:o,layout:a}){const s=Tt(e.xAccessor,"lon"),l=Tt(e.yAccessor,"lat"),c=[],u=_t(e),d=Ft(e),h=Ot(e);if(e.graticule){const t=!0===e.graticule?{}:e.graticule,r=fe();t.step&&r.step(t.step);const i=n(r())||"";i&&c.push({type:"geoarea",pathData:i,centroid:[a.width/2,a.height/2],bounds:[[0,0],[a.width,a.height]],screenArea:0,style:{fill:"none",stroke:t.stroke||"#e0e0e0",strokeWidth:t.strokeWidth??.5,strokeDasharray:t.strokeDasharray||"2,2"},datum:null,interactive:!1})}for(const t of r){const r=n(t);if(!r)continue;const i=n.centroid(t),o=n.bounds(t),a=n.area(t);c.push({type:"geoarea",pathData:r,centroid:i,bounds:o,screenArea:a,style:zt(e.areaStyle,t,u),datum:t,interactive:!0})}const f=Dt(e.lineDataAccessor);for(const n of o){const r=f(n);if(!r||2>r.length)continue;let i=[];if("geo"===e.lineType){const e=Array(r.length);for(let t=0;r.length>t;t++)e[t]=[s(r[t]),l(r[t])];for(let n=0;e.length-1>n;n++){const r=e[n],o=e[n+1],a=re(r,o)||0,s=Math.max(2,Math.ceil(a/(Math.PI/180))),l=pe(r,o);for(let e=0;s>=e;e++){if(n>0&&0===e)continue;const r=t(l(e/s));null!=r&&i.push(r)}}}else for(let e=0;r.length>e;e++){const n=r[e],o=t([s(n),l(n)]);null!=o&&i.push(o)}if(2>i.length)continue;const o=zt(e.lineStyle,n,d),u="number"==typeof o.strokeWidth?o.strokeWidth:1;2!==r.length||2>i.length||"arc"!==e.flowStyle?2!==r.length||2>i.length||"offset"!==e.flowStyle||(i="geo"===e.lineType?Ht(i,u):$t(i[0],i[i.length-1],0,0,u)):i=Bt(i[0],i[i.length-1]);const h=Wt(i,a.width);if(h.length>1)for(const e of h)2>e.length||c.push({type:"line",path:e,style:{...o,_edgeFade:!0},datum:n});else c.push({type:"line",path:2>i.length&&h[0]||i,style:o,datum:n})}const p=e.pointIdAccessor?"function"==typeof e.pointIdAccessor?e.pointIdAccessor:t=>t[e.pointIdAccessor]:null,m=t.clipAngle?t.clipAngle()??0:0,g=m>0?m*Math.PI/180:null,y=t.rotate?t.rotate():[0,0,0],v="function"==typeof t.center?t.center():[0,0],b=[(v[0]??0)-y[0],(v[1]??0)-y[1]];for(const n of i){const r=s(n),i=l(n);if(null!=g&&re([r,i],b)>g)continue;const o=t([r,i]);if(!o)continue;const a=e.pointStyle?e.pointStyle(n):{...h},u={type:"point",x:o[0],y:o[1],r:a.r||4,style:a,datum:n,pointId:p?p(n)+"":void 0};c.push(u)}return c}function tn(e){if(null==e)return 0;if("number"==typeof e&&Number.isFinite(e)&&e>=0&&.5>e)return e;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${e+""}.`)}function nn(e){return{...e,fitPadding:tn(e.fitPadding)}}function rn(e){return"fitPadding"in e?{...e,fitPadding:tn(e.fitPadding)}:e}function on(e){if(!e)return dh;let t=!1;for(let n=0;e.length>n;n++){const r=e[n];if(null==r||"object"!=typeof r){t=!0;break}}if(!t)return e;const n=[];for(const t of e)null!=t&&"object"==typeof t&&n.push(t);return n}function an(e,{storeRef:t,dirtyRef:n,scheduleRender:r,zoomTransformRef:i,containerRef:o,zoomBehaviorRef:a}){const s=(0,lh.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushPoint(e),n.current=!0,r())},[t,n,r]),l=(0,lh.useCallback)(e=>{const i=on(e);0!==i.length&&(t.current?.pushMany(i),n.current=!0,r())},[t,n,r]),c=(0,lh.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushLine(e),n.current=!0,r())},[t,n,r]),u=(0,lh.useCallback)(e=>{const i=on(e);0!==i.length&&(t.current?.pushManyLines(i),n.current=!0,r())},[t,n,r]),d=(0,lh.useCallback)(()=>{t.current?.clear(),n.current=!0,r()},[t,n,r]);(0,lh.useImperativeHandle)(e,()=>({push:s,pushMany:l,removePoint:e=>{const i=t.current?.removePoint(e)??[];return i.length>0&&(n.current=!0,r()),i},pushLine:c,pushManyLines:u,removeLine:e=>{const i=t.current?.removeLine(e)??[];return i.length>0&&(n.current=!0,r()),i},getLines:()=>t.current?.getLines()??[],clear:d,getProjection:()=>t.current?.scales?.projection??null,getGeoPath:()=>t.current?.scales?.geoPath??null,getCartogramLayout:()=>t.current?.cartogramLayout??null,getCustomLayout:()=>t.current?.lastCustomLayoutResult??null,getLayoutFailure:()=>t.current?.lastCustomLayoutFailure??null,getZoom:()=>i.current.k,resetZoom:()=>{const e=o.current;e&&a.current&&(0,ch.select)(e).call(a.current.transform,uh.zoomIdentity)},getData:()=>t.current?.getPoints()??[]}),[s,l,c,u,d,r,t,n,i,o,a])}function sn(e){const{domain:t,layout:n,sceneGeometry:r}=e.revisions;return{domain:t,layout:n,sceneGeometry:r}}function ln(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}function cn(e,t){return{sceneGeometry:Math.max(e.sceneGeometry,t.sceneGeometry),layout:Math.max(e.layout,t.layout),domain:Math.max(e.domain,t.domain)}}function un(e,t,n,r){const i=r.current,o=!0===e.lastCustomLayoutFailure?.preservedLastGoodScene,a=!o&&e.hasActivePulsesAt(t),s=!(n||o||!a&&!i)&&e.refreshPulse(t);return r.current=a,{changed:s,pending:a}}function dn(e,t,n,r,i,o){const a=i-n,s=o-r,l=a*a+s*s;if(0===l)return Math.sqrt((e-n)**2+(t-r)**2);let c=((e-n)*a+(t-r)*s)/l;return c=Math.max(0,Math.min(1,c)),Math.sqrt((e-(n+c*a))**2+(t-(r+c*s))**2)}function hn(e,t=30){return Math.max((e??4)+5,12,t)}function fn(e,t,n,r,i,o=e=>e.x,a=e=>e.y,s=e=>e.r){const l=Math.max(r,i+5,12),c=t-l,u=t+l,d=n-l,h=n+l;let f=null,p=1/0;return e.visit((e,i,l,m,g)=>{if(i>u||c>m||l>h||d>g)return!0;if(!e.length){let i=e;do{const e=i.data,l=o(e)-t,c=a(e)-n,u=Math.sqrt(l*l+c*c);hn(s(e),r)>=u&&p>u&&(f=e,p=u),i=i.next}while(i)}return!1}),f?{node:f,distance:p}:null}function pn(e,t){const[n,r]=e.viewBox??vh,[i,o]=e.anchor??bh,a=r>0?r:1,s=Math.max(0,t)/a,l=(n>0?n:a)*s,c=a*s;return{width:l,height:c,scale:s,offsetX:-i*l,offsetY:-o*c}}function mn(e,t){const n=pn(e,t),r=[[n.offsetX,n.offsetY],[n.offsetX+n.width,n.offsetY],[n.offsetX,n.offsetY+n.height],[n.offsetX+n.width,n.offsetY+n.height]];let i=0;for(const[e,t]of r){const n=Math.sqrt(e*e+t*t);n>i&&(i=n)}return i}function gn(e,t,n,r){if("none"!==e)return"color"===e||null==e?t??r:"accent"===e?n:e}function yn(e){if("undefined"==typeof Path2D)return null;xh||(xh=/* @__PURE__ */new Map);const t=xh.get(e);if(t)return t;const n=new Path2D(e);return xh.size>1024&&xh.clear(),xh.set(e,n),n}function vn(e,t,n=0,r="horizontal"){const[i,o]=e.viewBox??vh,a=Math.min(1,Math.max(0,n)),s=Math.min(1,Math.max(0,t));return s>a?a>0||1>s?"vertical"===r?{x:0,y:o*(1-s),width:i,height:o*(s-a)}:{x:i*a,y:0,width:i*(s-a),height:o}:null:{x:0,y:0,width:0,height:0}}function bn(e,t){const n=pn(e,t);return{centerDx:n.offsetX+n.width/2,centerDy:n.offsetY+n.height/2,halfWidth:n.width/2,halfHeight:n.height/2,radius:Math.hypot(n.width,n.height)/2}}function xn(e,t,n,r,i,o=e=>e){for(const a of t.parts){const t=yn(a.d);if(!t)continue;const s=a.opacity??1,l=e.globalAlpha;1!==s&&(e.globalAlpha=l*s);const c=i?"none"===a.fill?void 0:i:gn(a.fill,n,r);c&&(e.fillStyle=o(c),e.fill(t));const u=i?a.stroke&&"none"!==a.stroke?i:void 0:gn(a.stroke??"none",n,r);u&&(e.strokeStyle=o(u),e.lineWidth=a.strokeWidth??1,e.lineCap=a.strokeLinecap??"butt",e.lineJoin=a.strokeLinejoin??"miter",e.stroke(t)),1!==s&&(e.globalAlpha=l)}}function wn(e,t,n,r,i,o,a=0,s=r){if(o){const e=fn(o,t,n,r,a);if(e&&!1!==e.node.interactive)return e}else{let i=null,o=1/0;for(const a of e){if("point"!==a.type)continue;if(!1===a.interactive)continue;const e=a.x-t,s=a.y-n,l=Math.sqrt(e*e+s*s);hn(a.r,r)>=l&&o>l&&(i=a,o=l)}if(i)return{node:i,distance:o}}let l=null,c=1/0;for(const i of e){if("glyph"!==i.type)continue;if(null==i.datum)continue;const e=bn(i.glyph,i.size),o=i.x+e.centerDx-t,a=i.y+e.centerDy-n,s=Math.sqrt(o*o+a*a);hn(e.radius,r)>=s&&c>s&&(l=i,c=s)}if(l)return{node:l,distance:c};for(let r=e.length-1;r>=0;r--){const o=e[r];if("geoarea"!==o.type)continue;const a=o;if(!1===a.interactive)continue;const[[s,l],[c,u]]=a.bounds;if(!(s>t||t>c||l>n||n>u)&&(a._cachedPath2D||(a._cachedPath2D=new Path2D(a.pathData)),i.isPointInPath(a._cachedPath2D,t,n)))return{node:a,distance:0}}let u=null,d=1/0;for(const r of e){if("line"!==r.type)continue;const e=r,{path:i}=e,o=Math.max((e.style.strokeWidth??2)+4,5,s),a=t-o,l=t+o,c=n-o,h=n+o;for(let r=0;i.length-1>r;r++){const s=i[r],f=i[r+1],p=s[0],m=s[1],g=f[0],y=f[1];if(a>p&&a>g||p>l&&g>l||c>m&&c>y||m>h&&y>h)continue;const v=dn(t,n,p,m,g,y);o>=v&&d>v&&(u=e,d=v)}}return u?{node:u,distance:d}:null}function kn(e,t){if("function"==typeof e.addEventListener)return e.addEventListener("change",t),()=>e.removeEventListener("change",t);const n=e;return n.addListener(t),()=>n.removeListener(t)}function Sn(){const[e,t]=(0,Mh.useState)(()=>!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return(0,Mh.useEffect)(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),kn(e,e=>t(e.matches))},[]),e}function Mn(e,t=0,n=1/0,r=0){const i=Number.isFinite(t)?t:0,o=Number.isFinite(n)?Math.max(i,n):1/0,a=Number.isFinite(e)?Math.floor(e):i,s=Math.max(i,Math.min(o,a));return r>0&&Number.isFinite(r)?Math.max(i,Math.min(o,Math.round(s/r)*r)):s}function jn(e,t,n,r={}){const i=(0,jh.useRef)(null),[o,a]=(0,jh.useState)(null);return Ah(()=>{if(!t&&!n)return;const e=i.current;if(!e||"undefined"==typeof ResizeObserver)return;const o=(e,t)=>({w:Mn(e,r.minWidth,r.maxWidth,r.widthStep),h:Mn(t,r.minHeight,r.maxHeight,r.heightStep)}),s=e.getBoundingClientRect();(s.width>0||s.height>0)&&a(o(s.width,s.height));const l=new ResizeObserver(e=>{for(const t of e){const{width:e,height:n}=t.contentRect,r=o(e,n);a(e=>e&&e.w===r.w&&e.h===r.h?e:r)}});return l.observe(e),()=>l.disconnect()},[t,n,r.minWidth,r.maxWidth,r.widthStep,r.minHeight,r.maxHeight,r.heightStep]),[i,[t&&o?o.w:e[0],n&&o?o.h:e[1]]]}function An(e){return 0!==e.fontfaces?.length}function Cn(e){const t="undefined"==typeof document?void 0:document.fonts;if(!t||"function"!=typeof t.addEventListener)return()=>{};const n=t=>{An(t)&&e()};return t.addEventListener("loadingdone",n),()=>t.removeEventListener("loadingdone",n)}function Rn(e){const t=e.trim();if(!t.startsWith("var(")||!t.endsWith(")"))return null;const n=t.slice(4,-1),r=n.indexOf(",");if(-1===r){const e=n.trim();return e.startsWith("--")?{name:e}:null}const i=n.slice(0,r).trim(),o=n.slice(r+1).trim();return i.startsWith("--")?{name:i,fallback:o||void 0}:null}function Ln(){if(Lh)return;if("undefined"==typeof window||"undefined"==typeof document)return;Lh=!0;const e=e=>{if(!e?.includes("--"))return"";const t=document.createElement("span").style;return t.cssText=e,Array.from(t).filter(e=>e.startsWith("--")).sort().map(e=>`${e}:${t.getPropertyValue(e)}!${t.getPropertyPriority(e)}`).join(";")},t=(t,n)=>{const r=t.target;if(!(r instanceof Element))return!1;if(r===n||r.contains(n))return!0;if(!n.contains(r))return!1;const i="CANVAS"===r.tagName;return!(!i&&!r.querySelector("canvas")||i&&"style"===t.attributeName&&e(t.oldValue)===e(r.getAttribute("style")))},n=e=>{const n=[];for(const r of Th){const i=r.getElement();i&&(!e||e.some(e=>t(e,i)))&&n.push(r)}if(!e||0!==n.length){Rh++;for(const e of n)e.listener()}};if("undefined"!=typeof MutationObserver&&document.documentElement&&(Ph=new MutationObserver(e=>{n(e)})).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme","data-semiotic-theme","data-semiotic-theme-mode"],attributeOldValue:!0,subtree:!0}),"function"==typeof window.matchMedia)try{Nh=window.matchMedia("(prefers-color-scheme: dark)"),Eh=()=>n(),"function"==typeof Nh.addEventListener?Nh.addEventListener("change",Eh):"function"==typeof Nh.addListener&&Nh.addListener(Eh)}catch{}Ih=Cn(()=>n())}function Pn(e,t){Ln();const n={getElement:e,listener:t};return Th.add(n),()=>{Th.delete(n)&&0===Th.size&&(Ph?.disconnect(),Ph=null,Nh&&Eh&&("function"==typeof Nh.removeEventListener?Nh.removeEventListener("change",Eh):"function"==typeof Nh.removeListener&&Nh.removeListener(Eh)),Nh=null,Eh=null,Ih?.(),Ih=null,Lh=!1)}}function Nn(e,t){if(!t)return t;const n=Rn(t);if(!n)return t;const r=()=>n.fallback?Nn(e,n.fallback):t,i=e.canvas;if(!i)return r();let o=Ch.get(i);o&&o.version===Rh||(o={version:Rh,map:/* @__PURE__ */new Map},Ch.set(i,o));const a=o.map.get(t);if(void 0!==a)return a;const s=getComputedStyle(i).getPropertyValue(n.name).trim()||r()||t;return o.map.set(t,s),s}function En(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296}}function In(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}function Tn(e,t){const n=e();return Number.isFinite(n)?n:t}function Dn(e,t,n=!1){const r=n?t?Oh:_h:t?36:0;return r>e.top?{...e,top:r}:e}function zn(e){let t=6;for(let n=1;e.length>n;n++){const r=Math.abs(e[n]-e[n-1]);r>0&&Number.isFinite(r)&&(t=Math.max(t,Math.ceil(Math.log10(Math.max(Math.abs(e[n]),Math.abs(e[n-1]))/r))+1))}const n=Math.min(17,t);return e=>Number.isInteger(e)?e+"":Number(e.toPrecision(n))+""}function _n(...e){let t;for(const n of e)n&&(t=On(t)&&On(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function On(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function Fn(e){return"object"==typeof e&&null!==e&&"gradient"in e}function Wn(e,t,n,r,i=8){const o=r,a="left"===r?"right":"right"===r?"left":"top"===r?"bottom":"top",s=Math.max(t[o],Math.max(0,("left"===r||"right"===r?n[0]:n[1])-i)-e[a]);e[o]>s&&(e[o]=s)}function Bn(e){return Math.ceil(7*e.length)}function Hn(e,t){if(On(e)){const n=Kn(t);let r=$h;for(const t of e.legendGroups){t.label&&(r=Math.max(r,Bn(t.label)));for(const e of t.items)r=Math.max(r,n.swatchSize+n.labelGap+Bn(e.label))}return r}if(Fn(e)){const{gradient:t}=e,n=t.format||zn(t.domain),r=Math.max(Bn(n(t.domain[0])),Bn(n(t.domain[1]))),i=t.label?Bn(t.label):0;return Math.max($h,19+r,i)}return $h}function $n(e){return(On(e)||Fn(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):qh}function qn(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?Qh:Kh:0}function Gn(e){return Math.max(0,e?.edgeGutter??Gh)}function Vn(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?Zh:Xh:Yh:0}function Un(e,t,n){if(Fn(e))return e.gradient.label?Vh:Uh;if(!On(e))return 20;const r=Kn(n),i=Math.max(1,n?.maxWidth??t);let o=r.rowHeight;for(const t of e.legendGroups){let e=0,n=0;for(const o of t.items){const t=r.swatchSize+r.labelGap+Bn(o.label),a=0===n?t:n+r.itemGap+t;n>0&&a>i?(e+=1,n=t):n=a}t.items.length>0&&(e+=1),o=Math.max(o,e*r.rowHeight,t.label?Bn(t.label):0)}return o+(e.legendGroups.length>1?16:0)}function Yn(e,t,n){return Hn(e,t)+$n(e)+qn(t,n)+Gn(t)}function Xn(e,t){const{legend:n}=t;if(!n)return;const r=t.position??"right",i=Un(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout)+$n(n)+Vn("bottom"===r?t.axisChrome:"top"===r?t.axisChrome?.topAxis:void 0,t.legendLayout)+("top"===r&&t.hasTitle?24:0),o=Math.max(t.minimumMargin??0,"top"===r?t.hasTitle?Oh:_h:0);"right"===r?e.right=Math.max(e.right,o,Yn(n,t.legendLayout,t.axisChrome?.rightAxis)):"left"===r?e.left=Math.max(e.left,o,Yn(n,t.legendLayout,t.axisChrome?.leftAxis)):"top"===r?e.top=Math.max(e.top,o,i):e.bottom=Math.max(e.bottom,o,i)}function Zn(e,t){const n=t.position??"right",r="top"===n||"bottom"===n,i=Math.max(0,t.totalWidth-t.margin.left-t.margin.right),o=Math.max(1,r?t.legendLayout?.maxWidth??i:t.reservedWidth??Hn(e,t.legendLayout)),a=$n(e),s=qn(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),l=Gn(t.legendLayout),c=Un(e,i,t.legendLayout),u=Vn(t.axisChrome,t.legendLayout),d=Vn(t.axisChrome?.topAxis,t.legendLayout);if("left"===n)return{x:Math.max(l,t.margin.left-s-o-a),y:t.margin.top,width:o,height:c};if("top"===n)return{x:t.margin.left,y:t.margin.top-d-a-c,width:o,height:c};if("bottom"===n){const e=t.totalHeight-t.margin.bottom;return{x:t.margin.left,y:Math.max(e+a,Math.min(e+u+a,t.totalHeight-c)),width:o,height:c}}return{x:Math.min(t.totalWidth-o-l,t.totalWidth-t.margin.right+s+a),y:t.margin.top,width:o,height:c}}function Kn(e){const t=Math.max(1,e?.swatchSize??Fh),n=Math.max(t,e?.rowHeight??Hh);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??Wh),itemGap:Math.max(0,e?.itemGap??Bh),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}function Qn(e,t){let n=24;return e.map(({hasLabel:e,itemCount:r})=>{n+=5;const i=n;let o;n+=8,e&&(n+=16,o=n,n+=8);const a=n;return n+=r*t+8,{lineY:i,labelY:o,itemsY:a,endY:n}})}function Jn(e,t,n=!1){const r={...e};for(const e of t??[])!1!==e.visible||"top"===e.orient&&n||(r[e.orient]=0);return r}function er(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function tr(e){const t=Sn(),n=(0,kh.useRef)(t);n.current=t;const[r,i]=jn(e.sizeProp,e.responsiveWidth,e.responsiveHeight),o=i[0],a=i[1],s=(0,kh.useMemo)(()=>[o,a],[o,a]),l=!!e.title,c=!!e.legend&&"top"===e.legendPosition,u=(0,kh.useMemo)(()=>{const t=Dn({...e.marginDefault,...e.userMargin},l,c);if(e.legend&&!e.legendMarginReserved){const n={...t},r=e.legendPosition??"right";Xn(t,{legend:e.legend,position:r,size:s,hasTitle:l,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),Wn(t,n,s,r)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,l,c,s]),d=i[0]-u.left-u.right,h=i[1]-u.top-u.bottom,f=er(e.foregroundGraphics,i,u),p=er(e.backgroundGraphics,i,u),m=(0,Sh.useThemeSelector)(e=>e.theme),{transition:g,introEnabled:y}=lt(e.animate,e.transitionProp),v="semiotic-table-"+wh.useId(),b=(0,kh.useRef)(null);if(!b.current){const t=!e.suspendWhenHidden||"undefined"==typeof document||!document.hidden;b.current=new zh({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}const x=b.current;x.configure({clock:e.clock,random:e.random,seed:e.seed});const w=(0,kh.useRef)(null),k=(0,kh.useRef)(e.frameScheduler??ef);k.current=e.frameScheduler??ef;const S=(0,kh.useRef)(null),M=(0,kh.useRef)(!1),j=(0,kh.useRef)(()=>{}),A=(0,kh.useCallback)(()=>{if(null!==w.current||M.current)return;const e=k.current;let t=!1,n=!1;const r=e.requestAnimationFrame(()=>{t=!0;const e=!n;e&&(M.current=!0),w.current=null,S.current=null;try{j.current()}finally{e&&(M.current=!1)}});n=!0,t||(w.current=r,S.current=e)},[]),C=(0,kh.useCallback)(()=>{null!==w.current&&((S.current??k.current).cancelAnimationFrame(w.current),w.current=null,S.current=null)},[]);Jh(()=>{x.setPaused(!0===e.paused)},[x,e.paused]),(0,kh.useEffect)(()=>{if(!e.suspendWhenHidden||"undefined"==typeof document)return void x.setVisible(!0);const t=()=>x.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[x,e.suspendWhenHidden]),(0,kh.useEffect)(()=>()=>{C()},[C]);const R=(0,kh.useRef)(()=>{}),L=(0,kh.useRef)(()=>{}),P=(0,kh.useRef)({inside:!1,clientX:0,clientY:0,pointerType:void 0}),N=(0,kh.useRef)(null),E=(0,kh.useRef)(null),I=(0,kh.useRef)(null),T=(0,kh.useCallback)(()=>{const e=N.current;N.current=null,e&&R.current(e)},[]),D=(0,kh.useCallback)(e=>{const t=P.current;if(t.inside=!0,t.clientX=e.clientX,t.clientY=e.clientY,t.pointerType=e.pointerType,N.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===E.current){const e=k.current;let t=!1;const n=e.requestAnimationFrame(()=>{t=!0,E.current=null,I.current=null,T()});t||(E.current=n,I.current=e)}},[T]),z=(0,kh.useCallback)(()=>{P.current.inside=!1,N.current=null,null!==E.current&&((I.current??k.current).cancelAnimationFrame(E.current),E.current=null,I.current=null),L.current()},[]);(0,kh.useEffect)(()=>()=>{N.current=null,null!==E.current&&((I.current??k.current).cancelAnimationFrame(E.current),E.current=null,I.current=null)},[]);const _=e.themeDirtyRef,O=(0,kh.useRef)(!1);return Jh(()=>{if(!_)return;const t=!O.current;O.current=!0,t&&e.skipInitialThemeInvalidation||(Rh++,_.current=!0,A())},[m,e.skipInitialThemeInvalidation,A,_]),(0,kh.useEffect)(()=>{if(_)return Pn(()=>r.current,()=>{_.current=!0,A()})},[r,A,_]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:r,size:i,margin:u,adjustedWidth:d,adjustedHeight:h,resolvedForeground:f,resolvedBackground:p,currentTheme:m,transition:g,introEnabled:y,tableId:v,frameRuntime:x,rafRef:w,renderFnRef:j,scheduleRender:A,cancelRender:C,hoverHandlerRef:R,hoverLeaveRef:L,onPointerMove:D,onPointerLeave:z,pointerStateRef:P}}function nr(e,t,n,r){(0,tf.useEffect)(()=>{e.current?.updateConfig(t),n.current=!0,r()},[t,r,e,n])}function rr(e,t,n,r){const i=(0,tf.useRef)(null);(0,tf.useEffect)(()=>{const o=e.current;if(!o)return;const a=t??null;i.current!==a&&(i.current=a,o.setLayoutSelection(a),o.hasCustomRestyle?o.restyleScene(a):n.current=!0,r())},[t,r,e,n])}function ir(e){if(!e?.colors)return;const t=e.colors;return{primary:t.primary,secondary:t.secondary||t.primary,surface:t.surface||t.background,success:t.success,danger:t.danger,warning:t.warning,error:t.error,info:t.info,text:t.text,textSecondary:t.textSecondary,border:t.border,grid:t.grid}}function or(e,t){const n=e?.state??(e?.settling?"settling":void 0);if("live"===n)return of;if("stopped"===n||"failed"===n||"stale"===n)return{alpha:e?.dimOpacity??.5,band:"stale",isStale:!0};if("settling"===n)return{alpha:.85,band:"aging",isStale:!1};if(!e||0>=t)return of;const r=null!=e.threshold&&e.threshold>0?e.threshold:5e3,i=e.graded;if(i){const e="object"==typeof i?i:{},n=ct(t,r,e.thresholds);return{alpha:{...rf,...e.opacities??{}}[n],band:n,isStale:"fresh"!==n}}return t>r?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:of}function ar(e,t,n,r,i,o,a){const s=(0,nf.useRef)("fresh");(0,nf.useEffect)(()=>{if(!e)return void(s.current="fresh");const l=setInterval(()=>{const l=t.current;if(!l||0===l.lastIngestTime)return;const c=or(e,i()-l.lastIngestTime);c.band===s.current&&c.isStale===o||(s.current=c.band,c.isStale!==o&&a(c.isStale),n.current=!0,r())},1e3);return()=>clearInterval(l)},[e,o,r,i,t,a,n])}function sr(e,t,n){return t||(n?"settling":e?"stale":"live")}function lr({isStale:e,position:t,state:n,settling:r}){const i=sr(e,n,r),o=sf[i]??sf.live,a=Object.hasOwn(sf,i)?i.toUpperCase():"LIVE";/* @__PURE__ */ /* @__PURE__ */
|
|
3
|
+
return(0,af.jsx)("div",{className:"stream-staleness-badge",style:{position:"absolute",..."top-left"===t?{top:4,left:4}:"bottom-left"===t?{bottom:4,left:4}:"bottom-right"===t?{bottom:4,right:4}:{top:4,right:4},padding:"2px 8px",borderRadius:4,fontSize:11,fontWeight:600,pointerEvents:"none",zIndex:3,background:o,color:"white"},children:a})}function cr(e){const t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:n+""}function ur(e){const t=(0,cf.useObservationSelector)(e=>e.pushObservation),n=lf.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return lf.useMemo(()=>({...e,onObservation:n}),[n,e])}function dr(e){const t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}function hr(e,t={}){const n=cr(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(r){const i=dr(r);t.onAnnotationActivate?.({annotation:e,annotationId:n,chartId:t.chartId,inputType:i}),n&&t.onObservation&&t.onObservation({type:"annotation-activate",annotationId:n,inputType:i,timestamp:Date.now(),chartType:t.chartType??"unknown",chartId:t.chartId})}}}function fr(e,t){return(e+"").length*t*.6}function pr(e){return void 0===e||!0===e||"halo"===e?{type:"halo"}:!1===e||"none"===e?null:"box"===e?{type:"box"}:{...e,type:e.type??"halo"}}function mr(e){const{x:t,y:n,text:r,fill:i,fontSize:o=12,fontWeight:a,fontFamily:s,textAnchor:l="start",dominantBaseline:c,background:u,className:d}=e,h=pr(u),f=e=>/* @__PURE__ */ /* @__PURE__ */(0,df.jsx)("text",{x:t,y:n,textAnchor:l,dominantBaseline:c,fill:i,fontSize:o,fontWeight:a,fontFamily:s,className:d,...e?{style:{stroke:e.stroke,strokeWidth:e.strokeWidth,paintOrder:"stroke"}}:{},children:r});if(!h)return f();if("halo"===h.type)return f({stroke:h.fill??hf,strokeWidth:h.haloWidth??3});const p=h.padding??{x:6,y:3},m="number"==typeof p?p:p.x,g="number"==typeof p?p:p.y,y=fr(r,o),v=o+2*g;let b,x;return b="middle"===l?t-y/2-m:"end"===l?t-y-m:t-m,x="middle"===c||"central"===c?n-v/2:"hanging"===c||"text-before-edge"===c?n-g:n-.8*o-g,/* @__PURE__ */ /* @__PURE__ */(0,df.jsxs)("g",{className:d,children:[
|
|
4
|
+
/* @__PURE__ */
|
|
5
|
+
/* @__PURE__ */(0,df.jsx)("rect",{x:b,y:x,width:y+2*m,height:v,rx:h.radius??3,ry:h.radius??3,fill:h.fill??hf,fillOpacity:h.opacity??.85,stroke:h.stroke,strokeWidth:h.strokeWidth}),f()]})}function gr(e,t,n){if(!e)return null;const r="object"==typeof e?e:{};/* @__PURE__ */ /* @__PURE__ */
|
|
6
|
+
return(0,ff.jsx)("circle",{className:"semiotic-threshold-end-cap",cx:t[0],cy:t[1],r:Math.max(0,r.radius??4),fill:r.fill??n})}function yr({ann:e,position:t,vertical:n,width:r,height:i,color:o,fontSize:a=12,fontFamily:s,bold:l,background:c,dash:u="6,3",labelGap:d=4}){const h=e.labelPosition,f=t>.6*r,p=n?t+(f?-4:4):"left"===h?4:"center"===h?r/2:r-4,m=n?"bottom"===h?i-4:"center"===h?i/2:16:20>t?Math.min(i-4,t+16):t-d,g=n?f?"end":"start":"left"===h?"start":"center"===h?"middle":"end",y=n?[t,0]:[0,t],v=n?[t,i]:[r,t];/* @__PURE__ */ /* @__PURE__ */
|
|
7
|
+
return(0,pf.jsxs)("g",{opacity:e.opacity,children:[
|
|
8
|
+
/* @__PURE__ */
|
|
9
|
+
/* @__PURE__ */(0,pf.jsx)("line",{x1:y[0],y1:y[1],x2:v[0],y2:v[1],stroke:o,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray||u}),gr(e.endCap,y,o),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,pf.jsx)(mr,{x:p,y:m,text:e.label,textAnchor:g,fill:o,fontSize:a,fontFamily:s,fontWeight:l?"bold":void 0,background:c??e.labelBackground??"halo"})]})}function vr(e){return{label:e.label,title:e.title,wrap:e.wrap||120,noWrap:"function"==typeof e._noteLayout?e.noWrap:void 0,_noteLayout:e._noteLayout}}function br(e){return"function"==typeof e._noteLayout?e._noteLayout(e):void 0}function xr(e,t,n){if(!e)return[];const r=Math.max(1,Math.floor(t/n)),i=[];let o="";for(const t of e.split(/\s+/))t&&(o&&o.length+1+t.length>r?(i.push(o),o=t):o=o?`${o} ${t}`:t);return o&&i.push(o),i}function wr(e,t,n,r){return"curly"===e?r?`M0,0 C${.6*n},0 ${.4*n},${t/2} ${n},${t/2} C${.4*n},${t/2} ${.6*n},${t} 0,${t}`:`M0,0 C0,${.6*n} ${t/2},${.4*n} ${t/2},${n} C${t/2},${.4*n} ${t},${.6*n} ${t},0`:r?`M0,0 L${n},0 L${n},${t} L0,${t}`:`M0,0 L0,${n} L${t},${n} L${t},0`}function kr(e,t,n,r){if(!e)/* @__PURE__ */ /* @__PURE__ */return(0,gf.jsx)("g",{className:"annotation-note"});const{label:i,title:o,orientation:a,align:s,wrap:l=120,noWrap:c}=e;if(!i&&!o)/* @__PURE__ */ /* @__PURE__ */return(0,gf.jsx)("g",{className:"annotation-note"});let u=a;u||(u=Math.abs(t)>Math.abs(n)?"leftRight":"topBottom");const d="topBottom"===u,h="leftRight"===u;let f=s;f&&"dynamic"!==f||(f=d?0>t?"right":"left":0>n?"bottom":"top");let p="start";d?"right"===f?p="end":"middle"===f&&(p="middle"):p=0>t?"end":"start";const m=e.useHTML||e.html,g=m?void 0:br(e),y=g?.lineHeight??16,v=g?.titleLines??(o?c?[o]:xr(o,l,8):[]),b=g?.labelLines??(i?c?[i]:xr(i,l,8):[]),x=v.length+b.length,w=h?"end"===p?-4:4:0,k=[],S=r||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";if(m)k.push(
|
|
10
|
+
/* @__PURE__ */
|
|
11
|
+
/* @__PURE__ */(0,gf.jsx)("foreignObject",{className:"annotation-note-html",x:"end"===p?w-l:"middle"===p?w-l/2:w,y:-y,width:l,height:Math.max(y,x*y+(o&&i?2:0))+y,style:{overflow:"visible"},children:/* @__PURE__ */ /* @__PURE__ */(0,gf.jsxs)("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:S,fontSize:"12px",lineHeight:y+"px",overflow:"visible",textAlign:"end"===p?"right":"middle"===p?"center":"left",whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[o&&/* @__PURE__ */ /* @__PURE__ */(0,gf.jsx)("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:o}),i&&/* @__PURE__ */ /* @__PURE__ */(0,gf.jsx)("div",{className:"annotation-note-label",children:i})]})},"annotation-note-html"));else for(const e of[!0,!1]){const t=e?v:b;if(0===t.length)continue;const n="annotation-note-"+(e?"title":"label");k.push(
|
|
12
|
+
/* @__PURE__ */
|
|
13
|
+
/* @__PURE__ */(0,gf.jsx)("text",{className:n,fill:S,textAnchor:p,fontWeight:e?g?.titleFontWeight??"bold":void 0,y:e?void 0:v.length*y,children:t.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,gf.jsx)("tspan",{x:w,dy:0===t?0:y,children:e},t))},n))}let M=null;if((o||i)&&(0!==t||0!==n)){const e=d?g?g.width:Math.min(l,120):(v.length+b.length+(b.length>0?1:0))*y,t=d?p:f,n="end"===t||"bottom"===t?-e:"middle"===t?-e/2:0;M=/* @__PURE__ */ /* @__PURE__ */(0,gf.jsx)("line",{className:"note-line",x1:d?n:0,x2:d?n+e:0,y1:d?0:n,y2:d?0:n+e,stroke:r||"var(--semiotic-text-secondary, currentColor)"})}const j=Math.max(0,x-1)*y;let A=0;(d||h)&&(A=h&&"middle"===f?-(j+y+(b.length>0&&v.length>0?2:0))/2+y/2:0>n||h&&"bottom"===f?-(j+2):2+y);const C=0!==A?`translate(0,${A})`:void 0;/* @__PURE__ */ /* @__PURE__ */
|
|
14
|
+
return(0,gf.jsxs)("g",{className:"annotation-note",transform:`translate(${t},${n})`,...g?.textProps,children:[
|
|
15
|
+
/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */(0,gf.jsx)("g",{className:"annotation-note-content",transform:C,children:k}),M]})}function Sr(e,t,n,r,i){let o=null;const a=n||"var(--semiotic-text-secondary, currentColor)";switch(e){case"callout-circle":{const e=(t?.radius||0)+(t?.radiusPadding||0);e>0&&(o=/* @__PURE__ */ /* @__PURE__ */(0,gf.jsx)("circle",{r:e,fill:"none",stroke:a},"subject-circle"));break}case"callout-rect":{const e=t?.width||0,n=t?.height||0;(e>0||n>0)&&(o=/* @__PURE__ */ /* @__PURE__ */(0,gf.jsx)("rect",{width:e,height:n,fill:"none",stroke:a},"subject-rect"));break}case"callout-custom":o=t?.custom;break;case"xy-threshold":{const e=r||0,n=i||0;let s=0,l=0,c=0,u=0;if(void 0!==t?.x)s=l=(t.x||0)-e,c=(t.y1||0)-n,u=(t.y2||0)-n;else if(void 0!==t?.y)c=u=(t.y||0)-n,s=(t.x1||0)-e,l=(t.x2||0)-e;else if(void 0!==t?.x1||void 0!==t?.x2)s=(t.x1||0)-e,l=(t.x2||0)-e;else{if(void 0===t?.y1&&void 0===t?.y2)break;c=(t.y1||0)-n,u=(t.y2||0)-n}o=/* @__PURE__ */ /* @__PURE__ */(0,gf.jsx)("line",{x1:s,y1:c,x2:l,y2:u,stroke:a,strokeDasharray:"5,5"},"threshold-line");break}case"bracket":{const e=t?.type||"curly",n=t?.width??t?.height;void 0!==n&&(o=/* @__PURE__ */ /* @__PURE__ */(0,gf.jsx)("path",{d:wr(e,n,t?.depth||30,void 0===t?.width),fill:"none",stroke:a},"bracket-path"));break}}/* @__PURE__ */ /* @__PURE__ */
|
|
17
|
+
return(0,gf.jsx)("g",{className:"annotation-subject",children:o})}function Mr(e,t,n,r,i,o){let a,s,l=0,c=0;if("callout-circle"!==i&&"label"!==i||!o?.radius){if("callout-rect"===i&&o){const n=o.width||0,r=o.height||0;if(n>0||r>0){const i=n/2,o=r/2,a=e-i,s=t-o;if(0!==a||0!==s){const e=Math.abs(a),t=Math.abs(s),u=n/2,d=r/2,h=e*d>t*u?u/e:d/t;l=i+a*h,c=o+s*h}}}else if("bracket"===i&&o){const e=o.width,t=o.height,n=o.depth||30;void 0!==e?(l=e/2,c=n):void 0!==t&&(l=n,c=t/2)}}else{const n=(o.radius||0)+(o.radiusPadding||0);if(n>0&&(0!==e||0!==t)){const r=Math.atan2(t,e);l=Math.cos(r)*n,c=Math.sin(r)*n}}const u=e-l,d=t-c,h=Math.hypot(u,d);if(h>.5){const i=r||"var(--semiotic-text-secondary, currentColor)",o="curve"===n?.type;let f=Math.atan2(d,u);if(o){const r=(l+e)/2,o=(c+t)/2,s=-d/h,p=u/h,m=(n?.curve??.25)*h,g=r+s*m,y=o+p*m;a=/* @__PURE__ */ /* @__PURE__ */(0,gf.jsx)("path",{className:"connector-curve",d:`M${l},${c}Q${g},${y} ${e},${t}`,fill:"none",stroke:i},"connector-line"),f=Math.atan2(y-c,g-l)}else a=/* @__PURE__ */ /* @__PURE__ */(0,gf.jsx)("line",{x1:l,y1:c,x2:e,y2:t,stroke:i},"connector-line");if("arrow"===n?.end){const e=10,t=16/180*Math.PI;s=/* @__PURE__ */ /* @__PURE__ */(0,gf.jsx)("path",{d:`M${l},${c}L${l+e*Math.cos(f+t)},${c+e*Math.sin(f+t)}L${l+e*Math.cos(f-t)},${c+e*Math.sin(f-t)}Z`,fill:i,stroke:"none"},"connector-arrow")}}/* @__PURE__ */ /* @__PURE__ */
|
|
18
|
+
return(0,gf.jsxs)("g",{className:"annotation-connector",children:[a,s]})}function jr(e){const{x:t=0,y:n=0,dx:r,dy:i,nx:o,ny:a,note:s,connector:l,subject:c,type:u,color:d,className:h,disable:f,opacity:p,strokeDasharray:m,events:g={},"data-testid":y}=e,v=Array.isArray(t)?t[0]??0:t,b=Array.isArray(n)?n[0]??0:n,x=Array.isArray(f)?f:[];let w=r||0,k=i||0;null!=o&&(w=o-v),null!=a&&(k=a-b);const S="string"==typeof u?u:"label";if("bracket"===S&&c&&0===w&&0===k)if(void 0!==c.width){w=c.width/2;const e=c.depth||30;k=e+(0>e?-5:5)}else if(void 0!==c.height){const e=c.depth||30;w=e+(0>e?-5:5),k=c.height/2}/* @__PURE__ */ /* @__PURE__ */
|
|
19
|
+
return(0,gf.jsxs)("g",{className:("annotation "+(h||"")).trim(),transform:`translate(${v},${b})`,"data-testid":y,...null!=p&&{opacity:p},...m&&{strokeDasharray:m},...g,children:[!x.includes("connector")&&Mr(w,k,l,d,S,c),!x.includes("subject")&&Sr(S,c,d,v,b),!x.includes("note")&&kr(s,w,k,d)]})}function Ar(e){const{noteData:t}=e,{screenCoordinates:n}=t,r="string"==typeof t.type?t.type:"label",i=t.eventListeners||t.events||{};if(t.coordinates&&n){const e=t.nx||n[0][0]+(t.dx??0),i=t.ny||n[0][1]+(t.dy??0),o=n.map((n,o)=>{const a=Object.assign({},t,{note:0===o?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:i});/* @__PURE__ */ /* @__PURE__ */
|
|
20
|
+
return(0,gf.jsx)(jr,{"data-testid":"semiotic-annotation",...a,type:r},"multi-annotation-"+o)});/* @__PURE__ */ /* @__PURE__ */
|
|
21
|
+
return(0,gf.jsx)("g",{children:o})}const o=t.note||{title:"none",label:t.label},a=`${o.label}-${o.title}-${t.i}`;/* @__PURE__ */ /* @__PURE__ */
|
|
22
|
+
return(0,gf.jsx)(jr,{"data-testid":"semiotic-annotation",events:i,...t,type:r},a)}function Cr(e,t=.3){const n=e.length;if(2>n)return e.slice();const r=e.slice().sort((e,t)=>e[0]-t[0]),i=r.map(e=>e[0]),o=r.map(e=>e[1]),a=Math.min(n,Math.max(2,Math.ceil(t*n))),s=Number.isFinite(a)&&i.every(Number.isFinite);let l=0,c=a-1;const u=[];for(let e=0;n>e;e++){const t=i[e];let r,d=0,h=n-1;if(s){for(;n-1>c&&Math.abs(i[l]-t)>=Math.abs(i[c+1]-t);)l++,c++;const e=Math.max(Math.abs(i[l]-t),Math.abs(i[c]-t));r=e||1,e>0&&(d=l,h=c)}else r=i.map(e=>Math.abs(e-t)).sort((e,t)=>e-t)[a-1]||1;let f=0,p=0,m=0,g=0,y=0;for(let e=d;h>=e;e++){const n=Math.abs(i[e]-t)/r,a=1>n?Math.pow(1-Math.pow(n,3),3):0;0!==a&&(f+=a,p+=a*i[e],m+=a*o[e],g+=a*i[e]*i[e],y+=a*i[e]*o[e])}if(0===f){u.push([t,o[e]]);continue}const v=f*g-p*p;if(1e-12>Math.abs(v))u.push([t,m/f]);else{const e=(f*y-p*m)/v;u.push([t,(m-e*p)/f+e*t])}}return u}function Rr(e){return Math.round(100*e)/100}function Lr(e,t){const n=e,r=e.length-1,i=[t];for(let e=0;r>e;e++){let t=e;for(let i=e+1;r>i;i++)Math.abs(n[e][i])>Math.abs(n[e][t])&&(t=i);for(let i=e;r+1>i;i++){const r=n[i][e];n[i][e]=n[i][t],n[i][t]=r}for(let t=e+1;r>t;t++)for(let i=r;i>=e;i--)n[i][t]-=n[i][e]*n[e][t]/n[e][e]}for(let e=r-1;e>=0;e--){let t=0;for(let o=e+1;r>o;o++)t+=n[o][e]*i[o];i[e]=(n[r][e]-t)/n[e][e]}return i}function Pr(e){const t=[0,0,0,0];let n=0;for(const[r,i]of e)null!==i&&(n++,t[0]+=r,t[1]+=i,t[2]+=r*r,t[3]+=r*i);const r=n*t[2]-t[0]*t[0],i=0===r?0:Rr((n*t[3]-t[0]*t[1])/r),o=Rr(t[1]/n-i*t[0]/n);return{points:e.map(([e])=>[Rr(e),Rr(i*e+o)]),equation:[i,o]}}function Nr(e,t=2){const n=[],r=[],i=t+1;for(let t=0;i>t;t++){let o=0;for(const[n,r]of e)null!==r&&(o+=n**t*r);n.push(o);const a=[];for(let n=0;i>n;n++){let r=0;for(const[i,o]of e)null!==o&&(r+=i**(t+n));a.push(r)}r.push(a)}r.push(n);const o=Lr(r,i).map(Rr);return{points:e.map(([e])=>[Rr(e),Rr(o.reduce((t,n,r)=>t+n*e**r,0))]),equation:[...o].reverse()}}function Er(e){const t=e.length;let n=0,r=0,i=0,o=0;for(const[t,a]of e)n+=t,r+=a,i+=t*t,o+=t*a;const a=t*i-n*n;if(1e-12>Math.abs(a))return null;const s=(t*o-n*r)/a,l=(r-s*n)/t;return e=>l+s*e}function Ir(e,t){const n=e.length,r=e.map(([e,n])=>n-t(e)).reduce((e,t)=>e+t*t,0),i=Math.sqrt(r/Math.max(n-2,1)),o=e.reduce((e,t)=>e+t[0],0)/n,a=e.reduce((e,t)=>e+(t[0]-o)**2,0);return{se:i,meanX:o,ssX:a}}function Tr(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?n(e.x):t.xAccessor&&null!=e[t.xAccessor]?n(e[t.xAccessor]):null:null}function Dr(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?n(e.y):t.yAccessor&&null!=e[t.yAccessor]?n(e[t.yAccessor]):null:null}function zr(e){const t=e.data;if(!t||0===t.length)return null;const n=t[t.length-1],r=e.scales?.x??e.scales?.time,i=e.scales?.y??e.scales?.value;if(!r||!i)return null;const o=n[e.xAccessor||"x"],a=n[e.yAccessor||"y"];return null==o||null==a?null:{x:r(o),y:i(a)}}function _r(e){return null==e?null:e+""}function Or(e){return _r(e.provenance?.stableId??e.stableId)}function Fr(e){return _r(e.stableId??e.id??e.provenance?.stableId)}function Wr(e,t,n){return t.stickyPositionCache?.set(e,n),n}function Br(e,t,n){const r=Or(e);if(!r)return null;const i=n.pointNodes?.find(e=>_r(e.pointId)===r);if(i)return Wr(t,n,{x:i.x,y:i.y});const o=n.data?.find(e=>Fr(e)===r);if(!o)return null;const a=Tr(o,n),s=Dr(o,n);return null==a||null==s?null:Wr(t,n,{x:a,y:s})}function Hr(e,t,n){const r=e.anchor||e.lifecycle?.anchor||"fixed";if("latest"===r){if(null!=e.pointId&&n.pointNodes&&n.pointNodes.length>0)for(let r=n.pointNodes.length-1;r>=0;r--){const i=n.pointNodes[r];if(i.pointId===e.pointId)return Wr(t,n,{x:i.x,y:i.y})}const r=zr(n);return r?Wr(t,n,r):null}if("semantic"===r){const r=Br(e,t,n);if(r)return r}let i=null,o=null;if(null!=e.pointId&&n.pointNodes){const t=n.pointNodes.find(t=>t.pointId===e.pointId);t&&(i=t.x,o=t.y)}if(null!=i&&null!=o||(i=Tr(e,n),o=Dr(e,n)),null!=i&&null!=o)return Wr(t,n,{x:i,y:o});if("sticky"===r){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function $r(e,t,n,r=50){return!(-r>e||e>(n.width||0)+r||-r>t||t>(n.height||0)+r)}function qr(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle}}function Gr(e){return"undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,e):(bf||(bf=document.createElement("canvas")),bf.width=e,bf.height=e,bf)}function Vr(e={},t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45}=e,s={background:n,stroke:r,lineWidth:i,spacing:o,angle:a},l=Math.max(8,Math.ceil(2*o));let c;try{c=Gr(l)}catch{return qr(s)}const u=c.getContext("2d");if(!u)return qr(s);n&&"transparent"!==n?(u.fillStyle=n,u.fillRect(0,0,l,l)):u.clearRect(0,0,l,l),u.strokeStyle=r,u.lineWidth=i,u.lineCap="square";const d=a*Math.PI/180;if(45===a||-45===a){const e=a>0?1:-1;for(let t=-l;2*l>=t;t+=o)u.beginPath(),u.moveTo(t,0),u.lineTo(t+e*l,l),u.stroke()}else{u.save(),u.translate(l/2,l/2),u.rotate(d);const e=2*l;for(let t=-e;e>=t;t+=o)u.beginPath(),u.moveTo(-e,t),u.lineTo(e,t),u.stroke();u.restore()}return(t||u).createPattern(c,"repeat")}function Ur(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function Yr(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function Xr(e,t){let n=2166136261;const r=Yr(t);for(let e=0;r.length>e;e++)n^=r.charCodeAt(e),n=Math.imul(n,16777619);return`${e}-hatch-${(n>>>0).toString(36)}`}function Zr(e,t){const n=e.background??"transparent",r=e.stroke??"#000",i="transparent"===n||"none"===n?n:Nn(t,n)||n,o=Nn(t,r)||r||"#000",a="undefined"!=typeof window&&window.devicePixelRatio||1,s=`${Yr(e)}|${i}|${o}@${a}`,l=wf.get(s);if(void 0!==l)return l;const c=Vr({background:i,stroke:o,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle},t),u=Ur(c)?null:c;return wf.set(s,u),u}function Kr(e,t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45,lineOpacity:s=1}=e,l=Math.max(8,Math.ceil(2*o));/* @__PURE__ */ /* @__PURE__ */
|
|
23
|
+
return(0,xf.jsxs)("pattern",{id:t,width:l,height:l,patternUnits:"userSpaceOnUse",patternTransform:0!==a?`rotate(${a})`:void 0,children:[n&&"transparent"!==n&&/* @__PURE__ */ /* @__PURE__ */(0,xf.jsx)("rect",{width:l,height:l,fill:n}),
|
|
24
|
+
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */(0,xf.jsx)("line",{x1:0,y1:0,x2:0,y2:l,stroke:r,strokeWidth:i,strokeOpacity:s}),
|
|
26
|
+
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */(0,xf.jsx)("line",{x1:o,y1:0,x2:o,y2:l,stroke:r,strokeWidth:i,strokeOpacity:s})]},t)}function Qr(e,t,n="#4e79a7"){if(Ur(e)){const n=Xr(t,e);return{fill:`url(#${n})`,def:Kr(e,n)}}return e&&"string"==typeof e?{fill:e}:{fill:n}}function Jr(e,t,n,r){if(!e||"object"!=typeof e)return;const i=e;if(!Array.isArray(i.stops))return;const o=i.stops.flatMap(e=>{if(!e||"object"!=typeof e)return[];const{offset:t,color:n,opacity:i}=e;return"number"==typeof t&&Number.isFinite(t)?[{offset:Math.max(0,Math.min(1,t)),color:"string"==typeof n&&n?n:r,opacity:"number"==typeof i&&Number.isFinite(i)?Math.max(0,Math.min(1,i)):void 0}]:[]}).sort((e,t)=>e.offset-t.offset);if(!o.length)return;const a="horizontal"===i.direction?"horizontal":"vertical"===i.direction?"vertical":n,s=t+"-gradient";return{fill:`url(#${s})`,def:/* @__PURE__ */ /* @__PURE__ */(0,xf.jsx)("linearGradient",{id:s,x1:0,y1:0,x2:"horizontal"===a?"100%":0,y2:"vertical"===a?"100%":0,children:o.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,xf.jsx)("stop",{offset:100*e.offset+"%",stopColor:e.color,stopOpacity:e.opacity},`${e.offset}-${t}`))},s)}}function ei(e,t,n,r){const i=Qr(e.fill??e.color,t,r);return Jr(e.gradient,t,n,"string"==typeof e.fill&&e.fill?e.fill:"string"==typeof e.color&&e.color?e.color:r)??i}function ti(e,t,n){const r=e.position,i="string"==typeof r&&kf.has(r)?r:"bottom-left",o=i.endsWith("left")?"left":i.endsWith("right")?"right":"center",a=i.startsWith("top")?"top":i.startsWith("bottom")?"bottom":"middle",s="top"===a?0:"bottom"===a?n:n/2;return{x:("left"===o?0:"right"===o?t:t/2)+("number"==typeof e.dx&&Number.isFinite(e.dx)?e.dx:0),y:s+("number"==typeof e.dy&&Number.isFinite(e.dy)?e.dy:0),textAnchor:"start"===e.textAnchor||"middle"===e.textAnchor||"end"===e.textAnchor?e.textAnchor:"left"===o?"start":"right"===o?"end":"middle",dominantBaseline:"auto"===e.dominantBaseline||"middle"===e.dominantBaseline||"hanging"===e.dominantBaseline?e.dominantBaseline:"top"===a?"hanging":"bottom"===a?"auto":"middle"}}function ni(e,t,n,r){return{...ti(e,t,n),fill:e.fill??e.color??r.fill,fontSize:e.fontSize??r.fontSize,fontFamily:e.fontFamily??r.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,letterSpacing:e.letterSpacing,opacity:e.opacity,className:e.className,style:{pointerEvents:"none"}}}function ri({annotation:e,width:t,height:n,defaults:r=Mf}){const i=e.label??e.text;return null==i?null:/* @__PURE__ */ /* @__PURE__ */(0,Sf.jsx)("text",{...ni(e,t,n,r),children:i})}function ii(e){return!0===e?._annotationDeferred}function oi(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function ai(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function si(e){return Math.max(.72,.95-.06*e)}function li(e){const t=e.map((e,t)=>{return{p:e,i:t,emphasis:(n=e.annotation,"primary"===n?.emphasis||"secondary"===n?.emphasis?n.emphasis:null),confidence:ai(e.annotation),readingOrder:null,rank:1};var n}),n=t.some(e=>null!=e.emphasis||null!=e.confidence),r=e.some(e=>ii(e.annotation)),i=e.some(e=>null!=oi(e.annotation)),o=e.some(e=>"layer"===oi(e.annotation));if(!n&&!r&&!i)return e.map(e=>e.node);const a=t.filter(e=>null==e.emphasis&&null!=e.confidence).slice().sort((e,t)=>(t.confidence??0)-(e.confidence??0)||e.i-t.i);a.forEach((e,t)=>{e.readingOrder=t,e.rank=2-t/Math.max(1,a.length)});for(const e of t)e.emphasis&&(e.rank=Af[e.emphasis]);const s=t.sort((e,t)=>e.rank-t.rank||e.i-t.i).map(e=>{const{p:t,i:n,emphasis:r,readingOrder:i}=e,o=ii(t.annotation);let a=t.node;if("primary"===r||"secondary"===r||null!=i){const e=null==r&&null!=i;a=/* @__PURE__ */ /* @__PURE__ */(0,jf.jsx)("g",{className:e?"annotation-emphasis annotation-emphasis--inferred":"annotation-emphasis annotation-emphasis--"+r,..."secondary"===r?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:si(i),"data-annotation-reading-order":i}:{},children:t.node},"annotation-emphasis-"+n)}const s=oi(t.annotation);return s&&(a=/* @__PURE__ */ /* @__PURE__ */(0,jf.jsx)("g",{className:"annotation-cohesion--"+s,children:a},"annotation-cohesion-"+n)),o&&(a=/* @__PURE__ */ /* @__PURE__ */(0,jf.jsx)("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:a},"annotation-deferred-"+n)),a});return r&&s.unshift(
|
|
28
|
+
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */(0,jf.jsx)("style",{children:".annotation-deferred{opacity:0;pointer-events:none;transition:opacity .12s ease}.stream-xy-frame:hover .annotation-deferred,.stream-ordinal-frame:hover .annotation-deferred,.stream-network-frame:hover .annotation-deferred,.stream-geo-frame:hover .annotation-deferred,.stream-xy-frame:focus-within .annotation-deferred,.stream-ordinal-frame:focus-within .annotation-deferred,.stream-network-frame:focus-within .annotation-deferred,.stream-geo-frame:focus-within .annotation-deferred{opacity:1;pointer-events:auto}@media (prefers-reduced-motion:reduce){.annotation-deferred{transition:none}}"},"annotation-disclosure-style")),o&&s.unshift(
|
|
30
|
+
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */(0,jf.jsx)("style",{children:".annotation-cohesion--layer text,.annotation-cohesion--layer tspan{fill:var(--semiotic-annotation-color,var(--semiotic-text-secondary,#666));font-style:italic}"},"annotation-cohesion-style")),s}function ci(e,t,n,r){return ui(e,t,n,r).nodes}function ui(e,t,n,r){const i=[];return e.forEach((e,o)=>{let a;if(n){const i=n(e,o,r);a=null!=i?i:t(e,o,r)}else a=t(e,o,r);a&&i.push({node:a,annotation:e})}),{nodes:li(i),renderedAnnotations:i.map(e=>e.annotation)}}function di(e,t={}){return function(e,n,r){switch(e.type){case"label":case"callout":case"callout-circle":case"callout-rect":{const t=Hr(e,n,r);if(!t)return null;const{x:i,y:o}=t;if(!$r(i,o,r))return null;const a="callout"===e.type?"callout-circle":e.type,s="callout-circle"===a?{radius:e.radius??12,radiusPadding:e.radiusPadding}:"callout-rect"===a?{width:e.width,height:e.height}:void 0;/* @__PURE__ */ /* @__PURE__ */
|
|
32
|
+
return(0,Cf.jsx)(Ar,{noteData:{x:i,y:o,dx:e.dx??30,dy:e.dy??-30,note:vr(e),type:a,...s?{subject:s}:{},connector:e.connector||{end:"arrow"},color:e.color,disable:e.disable,opacity:e.opacity,strokeDasharray:e.strokeDasharray,className:e.className}},"ann-"+n)}case"x-threshold":case"y-threshold":{const t="x-threshold"===e.type,i=null!=e.value?{...e,[t?"x":"y"]:e.value}:e,o=t?Tr(i,r):Dr(i,r);return null==o?null:/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)(yr,{ann:e,position:o,vertical:t,width:r.width||0,height:r.height||0,color:e.color||"#f97316",bold:!0},"ann-"+n)}case"enclose":{const t=(e.coordinates||[]).map(e=>({x:Tr({...e,type:"point"},r),y:Dr({...e,type:"point"},r),r:1})).filter(e=>null!=e.x&&null!=e.y);if(2>t.length)return null;const i=(0,yf.packEnclose)(t),o=e.padding||10;/* @__PURE__ */ /* @__PURE__ */
|
|
33
|
+
return(0,Cf.jsxs)("g",{children:[
|
|
34
|
+
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */(0,Cf.jsx)("circle",{cx:i.x,cy:i.y,r:i.r+o,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)(mr,{x:i.x,y:i.y-i.r-o-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+n)}case"rect-enclose":{const t=(e.coordinates||[]).map(e=>({x:Tr({...e,type:"point"},r),y:Dr({...e,type:"point"},r)})).filter(e=>null!=e.x&&null!=e.y);if(2>t.length)return null;const i=e.padding||10,o=t.map(e=>e.x),a=t.map(e=>e.y),[s,l]=qt(o),[c,u]=qt(a),d=s-i,h=l+i,f=c-i;/* @__PURE__ */ /* @__PURE__ */
|
|
36
|
+
return(0,Cf.jsxs)("g",{children:[
|
|
37
|
+
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */(0,Cf.jsx)("rect",{x:d,y:f,width:h-d,height:u+i-f,fill:e.fill||"none",fillOpacity:e.fillOpacity??.1,stroke:e.color||"var(--semiotic-text-secondary, #666)",strokeWidth:1.5,strokeDasharray:"4,2"}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)(mr,{x:(d+h)/2,y:f-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},"ann-"+n)}case"highlight":{const t=r.data||[],i="function"==typeof e.filter?t.filter(e.filter):e.field&&null!=e.value?t.filter(t=>t[e.field]===e.value):[],o={stroke:e.color||"#f97316",strokeWidth:2,fill:"none"};/* @__PURE__ */ /* @__PURE__ */
|
|
39
|
+
return(0,Cf.jsx)("g",{children:i.map((t,n)=>{const i=Tr(t,r),a=Dr(t,r);if(null==i||null==a)return null;const s="function"==typeof e.r?e.r(t):e.r||6,l="function"==typeof e.style?e.style(t):e.style||o;/* @__PURE__ */ /* @__PURE__ */
|
|
40
|
+
return(0,Cf.jsx)("circle",{cx:i,cy:a,r:s,...l},"hl-"+n)})},"ann-"+n)}case"bracket":{const t=Tr(e,r),i=Dr(e,r);/* @__PURE__ */ /* @__PURE__ */
|
|
41
|
+
return(0,Cf.jsx)(Ar,{noteData:{x:t??0,y:i??0,dx:e.dx||0,dy:e.dy||0,note:vr(e),type:"bracket",subject:{type:e.bracketType||"curly",width:e.width,height:e.height,depth:e.depth||30},color:e.color}},"ann-"+n)}case"trend":{const t=r.data||[];if(2>t.length)return null;const i=r.xAccessor||"x",o=r.yAccessor||"y",a="ordinal"===r.frameType,s="horizontal"===r.projection,l=a?i:null,c=a?o:null;let u;const d=[],h=/* @__PURE__ */new Map;if(a&&l&&c){for(const e of t){const t=e[l];if(null==t)continue;const n=t+"";h.has(n)||(h.set(n,d.length),d.push(n))}u=t.map(e=>{const t=e[l],n=e[c];if(null==t||null==n)return null;const r=h.get(t+"");return null!=r?[r,+n]:null}).filter(e=>null!==e)}else u=t.map(e=>[e[i],e[o]]).filter(e=>null!=e[0]&&null!=e[1]);if(2>u.length)return null;const f=r.scales?.x??r.scales?.time,p=r.scales?.y??r.scales?.value;if(!f||!p)return null;const m=e=>t=>{const n=Math.max(0,Math.floor(t)),r=Math.min(d.length-1,n+1),i=t-n,o=e(d[n]);return o+(e(d[r])-o)*i},g=f,y=p;let v;if(a)if(s){const e=m(y);v=(t,n)=>[g(n),e(t)]}else{const e=m(g);v=(t,n)=>[e(t),y(n)]}else v=(e,t)=>[g(e),y(t)];const b=e.method||"linear";let x;x="loess"===b?Cr(u,e.bandwidth??.3):("polynomial"===b?Nr(u,e.order||2):Pr(u)).points;const w=x.map(([e,t])=>{const[n,r]=v(e,t);return`${n},${r}`}).join(" "),k=e.color||"#6366f1",S=x[x.length-1],[M,j]=v(S[0],S[1]);/* @__PURE__ */ /* @__PURE__ */
|
|
42
|
+
return(0,Cf.jsxs)("g",{children:[
|
|
43
|
+
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */(0,Cf.jsx)("polyline",{points:w,fill:"none",stroke:k,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)("text",{x:M+4,y:j-4,fill:k,fontSize:11,children:e.label})]},"ann-"+n)}case"band":{const t=r.scales?.y??r.scales?.value,i=t?.domain?.(),s=e.y0??i?.[0],l=e.y1??i?.[1],c=null!=s&&t?t(s):0,u=null!=l&&t?t(l):r.height||0,d=ei(e,"ann-"+n,"vertical","var(--semiotic-primary, #6366f1)");/* @__PURE__ */ /* @__PURE__ */
|
|
45
|
+
return(0,Cf.jsxs)("g",{opacity:e.opacity,children:[d.def&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)("defs",{children:d.def}),
|
|
46
|
+
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */(0,Cf.jsx)("rect",{x:0,y:Math.min(c,u),width:r.width||0,height:Math.abs(u-c),fill:d.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)(mr,{x:(r.width||0)-4,y:(o=c,a=u,Math.max(Math.min(o,a),0)+16),textAnchor:"end",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+n)}case"x-band":{const t=r.scales?.x??r.scales?.time,i=t?.domain?.(),o=e.x0??i?.[0],a=e.x1??i?.[1],s=null!=o&&t?t(o):null,l=null!=a&&t?t(a):null;if(null==s||null==l)return null;const c=ei(e,"ann-"+n,"horizontal","var(--semiotic-primary, #6366f1)");/* @__PURE__ */ /* @__PURE__ */
|
|
48
|
+
return(0,Cf.jsxs)("g",{opacity:e.opacity,children:[c.def&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)("defs",{children:c.def}),
|
|
49
|
+
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */(0,Cf.jsx)("rect",{x:Math.min(s,l),y:0,width:Math.abs(l-s),height:r.height||0,fill:c.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)(mr,{x:Math.min(s,l)+4,y:16,textAnchor:"start",fill:e.color||"var(--semiotic-primary, #6366f1)",fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},"ann-"+n)}case"envelope":{const t=r.data||[];if(2>t.length)return null;const i=r.xAccessor||"x",o=r.scales?.x??r.scales?.time,a=r.scales?.y??r.scales?.value;if(!o||!a)return null;const s=e.upperAccessor||"upperBounds",l=e.lowerAccessor||"lowerBounds",c=e.filter,u=t.filter(e=>null!=e[s]&&null!=e[l]&&!(c&&!c(e))).sort((e,t)=>e[i]-t[i]);if(2>u.length)return null;const d=Rf[r.curve||"linear"]||vf.curveLinear,h=(0,vf.area)().x(e=>o(e[i])).y0(e=>a(e[l])).y1(e=>a(e[s])).curve(d)(u);if(!h)return null;const f=e.fill||"#6366f1";/* @__PURE__ */ /* @__PURE__ */
|
|
51
|
+
return(0,Cf.jsxs)("g",{children:[
|
|
52
|
+
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */(0,Cf.jsx)("path",{d:h,fill:f,fillOpacity:e.fillOpacity??.15,stroke:"none"}),e.label&&u.length>0&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)("text",{x:o(u[u.length-1][i])+4,y:a(u[u.length-1][s])-4,fill:f,fontSize:11,children:e.label})]},"ann-"+n)}case"anomaly-band":{const t=r.data||[];if(2>t.length)return null;const i=r.yAccessor||"y",o=r.scales?.x??r.scales?.time,a=r.scales?.y??r.scales?.value;if(!o||!a)return null;const s=t.map(e=>e[i]).filter(e=>null!=e&&isFinite(e));if(2>s.length)return null;const l=s.reduce((e,t)=>e+t,0)/s.length,c=s.reduce((e,t)=>e+(t-l)**2,0)/s.length,u=Math.sqrt(c),d=e.threshold??2,h=l-d*u,f=!1!==e.showBand,p=e.fill||"#6366f1",m=e.fillOpacity??.1,g=e.anomalyColor||"#ef4444",y=e.anomalyRadius??6,v=a(l+d*u),b=a(h),x=t.filter(e=>{const t=e[i];return null!=t&&Math.abs(t-l)>d*u});/* @__PURE__ */ /* @__PURE__ */
|
|
54
|
+
return(0,Cf.jsxs)("g",{children:[f&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)("rect",{x:0,y:Math.min(v,b),width:r.width||0,height:Math.abs(b-v),fill:p,fillOpacity:m}),x.map((e,t)=>{const n=Tr(e,r),i=Dr(e,r);return null==n||null==i?null:/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)("circle",{cx:n,cy:i,r:y,fill:g,fillOpacity:.7,stroke:g,strokeWidth:1.5},"anomaly-"+t)}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)("text",{x:(r.width||0)-4,y:Math.min(v,b)-4,textAnchor:"end",fill:p,fontSize:11,children:e.label})]},"ann-"+n)}case"forecast":{const t=r.data||[];if(3>t.length)return null;const o=r.xAccessor||"x",a=r.yAccessor||"y",s=r.scales?.x??r.scales?.time,l=r.scales?.y??r.scales?.value;if(!s||!l)return null;const c=t.map(e=>[e[o],e[a]]).filter(e=>null!=e[0]&&null!=e[1]&&isFinite(e[0])&&isFinite(e[1])).sort((e,t)=>e[0]-t[0]);if(3>c.length)return null;let u;if("polynomial"===(e.method||"linear")){const t=Nr(c,e.order||2).equation;u=e=>t.reduce((t,n,r)=>t+n*Math.pow(e,r),0)}else{const e=Er(c);if(!e)return null;u=e}const d=c.length,{se:h,meanX:f,ssX:p}=Ir(c,u),m=.99>(i=e.confidence??.95)?.95>i?.9>i?1:1.645:1.96:2.576,g=e.steps??5,y=c[d-1][0],v=(y-c[0][0])/Math.max(d-1,1),b=[];for(let e=1;g>=e;e++)b.push(y+e*v);const x=[];for(const e of b){const t=u(e),n=h*Math.sqrt(1+1/d+(p>0?(e-f)**2/p:0))*m;x.push({x:e,yCenter:t,yUpper:t+n,yLower:t-n})}const w=`M${x.map(e=>`${s(e.x)},${l(e.yUpper)}`).join(" L")} L${x.slice().reverse().map(e=>`${s(e.x)},${l(e.yLower)}`).join(" L")} Z`,k=x.map(e=>`${s(e.x)},${l(e.yCenter)}`).join(" "),S=`${s(y)},${l(u(y))}`,M=e.strokeColor||"#6366f1";/* @__PURE__ */ /* @__PURE__ */
|
|
55
|
+
return(0,Cf.jsxs)("g",{children:[
|
|
56
|
+
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */(0,Cf.jsx)("path",{d:w,fill:e.fill||"#6366f1",fillOpacity:e.fillOpacity??.15,stroke:"none"}),
|
|
58
|
+
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */(0,Cf.jsx)("polyline",{points:`${S} ${k}`,fill:"none",stroke:M,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray??"6,3"}),e.label&&x.length>0&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)("text",{x:s(x[x.length-1].x)+4,y:l(x[x.length-1].yCenter)-4,fill:M,fontSize:11,children:e.label})]},"ann-"+n)}case"widget":{let i,o;if(null!=e.px&&null!=e.py)i=e.px,o=e.py;else{const t=Hr(e,n,r);if(!t)return null;i=t.x,o=t.y}if(!$r(i,o,r))return null;const a=e.dx??0,s=e.dy??0,l=e.width??32,c=e.height??32,u=e.content??/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)("span",{style:{fontSize:18,cursor:"default"},title:e.label||"Info",children:"ℹ️"});/* @__PURE__ */ /* @__PURE__ */
|
|
60
|
+
return(0,Cf.jsx)("foreignObject",{x:i+a-l/2,y:o+s-c/2,width:l,height:c,style:{overflow:"visible",pointerEvents:"auto"},children:/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)("div",{...hr(e,t),style:{width:l,height:c,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},"ann-"+n)}case"text":{const t=Hr(e,n,r);if(!t)return null;const{x:i,y:o}=t,a=i+(e.dx||0),s=o+(e.dy||0),l=e.color||"var(--semiotic-text, #333)",c=/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)("text",{x:a,y:s,fill:l,fontSize:e.fontSize||11,opacity:e.opacity,strokeDasharray:e.strokeDasharray,dominantBaseline:"middle",style:{fontFamily:"inherit"},children:e.label});return!0!==e._redundantConnector?mf.cloneElement(c,{key:"ann-text-"+n}):/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsxs)("g",{opacity:e.opacity,strokeDasharray:e.strokeDasharray,children:[
|
|
61
|
+
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */(0,Cf.jsx)("line",{x1:i,y1:o,x2:a,y2:s,stroke:l,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),mf.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},"ann-text-"+n)}case"frame-text":/* @__PURE__ */ /* @__PURE__ */
|
|
63
|
+
return(0,Cf.jsx)(ri,{annotation:e,width:r.width||0,height:r.height||0},"ann-frame-text-"+n);case"category-highlight":{const t=e.category;if(null==t)return null;const i=e=>"function"==typeof e&&"function"==typeof e.bandwidth,o=r.scales?.o,a=r.scales?.x,s=r.scales?.y,l=i(o)?o:i(a)?a:i(s)?s:null;if(!l)return null;const c=l(t+"");if(null==c)return null;const u=l.bandwidth(),d=e.color||"var(--semiotic-primary, #4589ff)",h=e.opacity??.15,f=e.label;/* @__PURE__ */ /* @__PURE__ */
|
|
64
|
+
return(0,Cf.jsxs)("g",(r.projection?"vertical"===r.projection:l===a)?{children:[
|
|
65
|
+
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */(0,Cf.jsx)("rect",{x:c,y:0,width:u,height:r.height||0,fill:d,fillOpacity:h}),f&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)(mr,{x:c+u/2,y:16,textAnchor:"middle",fill:d,fontSize:12,fontWeight:"bold",text:f,background:e.labelBackground??"none"})]}:{children:[
|
|
67
|
+
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */(0,Cf.jsx)("rect",{x:0,y:c,width:r.width||0,height:u,fill:d,fillOpacity:h}),f&&/* @__PURE__ */ /* @__PURE__ */(0,Cf.jsx)(mr,{x:12,y:c+u/2,dominantBaseline:"middle",fill:d,fontSize:12,fontWeight:"bold",text:f,background:e.labelBackground??"none"})]},"ann-"+n)}default:return null}var i,o,a}}function hi(e){return"string"==typeof e?.type?e.type:""}function fi(e){return!!e&&"object"==typeof e&&Lf.has(hi(e))}function pi(e){return"primary"===e?.emphasis||!0===e?.defensive}function mi(e,t,n={}){return"number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations)?Math.max(0,Math.floor(n.maxAnnotations)):e>0&&t>0?Math.max(1,Math.round(e*t/(n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4))):1/0}function gi(e){let t;const n=e?.emphasis;t="primary"===n?100:"secondary"===n?10:50;const r=e?.provenance?.confidence;switch("number"==typeof r&&Number.isFinite(r)&&(t+=15*Math.max(0,Math.min(1,r))),e?.lifecycle?.freshness){case"fresh":t+=8;break;case"aging":t+=4;break;case"stale":t+=1;break;case"expired":t-=200}return t}function yi(e){const{annotations:t,width:n,height:r}=e,i=Math.max(0,e.minVisible??1),o=mi(n,r,e),a=t.map((e,t)=>{return{annotation:e,index:t,note:(n=e,fi(n))};var n}),s=a.filter(e=>e.note);if(0===s.length||o>=s.length)return{visible:t.slice(),deferred:[],budget:o};const l=s.filter(e=>pi(e.annotation)),c=s.filter(e=>!pi(e.annotation)).sort((e,t)=>gi(t.annotation)-gi(e.annotation)||e.index-t.index),u=Math.min(c.length,Math.max(Math.max(0,o-l.length),Math.max(0,i-l.length))),d=/* @__PURE__ */new Set([...l.map(e=>e.index),...c.slice(0,u).map(e=>e.index)]),h=[],f=[];for(const{annotation:e,index:t,note:n}of a)!n||d.has(t)?h.push(e):f.push(e);return{visible:h,deferred:f,budget:o}}function vi(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}function bi(e){const t=e?.familiarity;if(!t)return 3;const n=Object.values(t).filter(e=>"number"==typeof e&&Number.isFinite(e));return 0===n.length?3:n.reduce((e,t)=>e+t,0)/n.length}function xi(e){if(!e)return 1;const t=bi(e);return t>2?4>t?1:.6:1.5}function wi(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?Object.prototype.hasOwnProperty.call(Df,t.source)?Df[t.source]:t.source:null,r="number"==typeof t.confidence&&Number.isFinite(t.confidence)?Math.round(100*Math.max(0,Math.min(1,t.confidence)))+"%":null;if(!n&&!r)return e;if(null!=e.label&&"string"!=typeof e.label)return e;const i=[n,r].filter(Boolean).join(" · "),o="string"==typeof e.label?e.label:"";return o.includes(`(${i})`)?e:{...e,label:o?`${o} (${i})`:`(${i})`}}function ki(e,t){let n=!1;const r=e.map(e=>ji(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?r:e}function Si(e){if(!ji(e))return e;const t=("string"==typeof e.mobileText?e.mobileText:void 0)??("string"==typeof e.shortText?e.shortText:void 0);return!t||"string"!=typeof e.label&&null!=e.label?e:{...e,label:t}}function Mi(e){return"text"!==e.type||"string"!=typeof e.color||8>Math.hypot("number"==typeof e.dx?e.dx:0,"number"==typeof e.dy?e.dy:0)?e:{...e,_redundantConnector:!0}}function ji(e){return fi(e)}function Ai(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t=br(e);if(t)return{width:Math.max(24,t.width+10),height:Math.max(18,t.height+6)};const n="number"==typeof e.wrap?e.wrap:120,r=[...xr("string"==typeof e.title?e.title:void 0,n,7),...xr("string"==typeof e.label?e.label:void 0,n,7)],i=r.reduce((e,t)=>Math.max(e,t.length),0);return{width:Math.max(24,Math.min(n,7*i)+10),height:Math.max(18,16*r.length+6)}}function Ci(e,t,n,r,i){const o=e+n,a=t+r;return Math.abs(n)>Math.abs(r)?{x:0>n?o-i.width-4:o+4,y:0>r?a-i.height:a,width:i.width,height:i.height}:{x:0>n?o-i.width:o,y:0>r?a-i.height-4:a+4,width:i.width,height:i.height}}function Ri(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function Li(e,t){return Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))}function Pi(e,t,n,r){const i=Math.max(0,r-e.x),o=Math.max(0,r-e.y);return(i+Math.max(0,e.x+e.width-(t-r)))*e.height+(o+Math.max(0,e.y+e.height-(n-r)))*e.width}function Ni(e){const t=1.6*e;return[{dx:e,dy:-e},{dx:-e,dy:-e},{dx:e,dy:e},{dx:-e,dy:e},{dx:e,dy:0},{dx:-e,dy:0},{dx:0,dy:-e},{dx:0,dy:e},{dx:t,dy:-t},{dx:-t,dy:-t},{dx:t,dy:t},{dx:-t,dy:t}]}function Ei(e,t){return(e.pointNodes||[]).map(e=>{const n=Math.max(1,e.r||1)+t;return{x:e.x-n,y:e.y-n,width:2*n,height:2*n}})}function Ii(e,t,n,r,i,o,a,s){const l=Ri(e,a);let c=.4*Math.hypot(t.dx,t.dy)+80*Pi(l,i,o,s);for(const e of n)c+=12*Li(l,e);for(const e of r)c+=4*Li(l,e);return c}function Ti(e,t,n){if("widget"===e.type&&"number"==typeof e.px&&"number"==typeof e.py)return{x:e.px,y:e.py};const r=e.pointId??e.nodeId;if(null!=r&&n.pointNodes){const e=n.pointNodes.find(e=>e.pointId===r);if(e)return{x:e.x,y:e.y}}const i=e.coordinates,o=n.scales?.geoProjection;if(Array.isArray(i)&&i.length>=2&&o){const e=i[0],t=i[1];if("number"==typeof e&&"number"==typeof t){const n=o([e,t]);if(n&&"number"==typeof n[0]&&"number"==typeof n[1])return{x:n[0],y:n[1]}}}return n.scales||"number"!=typeof e.x||"number"!=typeof e.y?Hr(e,t,n):{x:e.x,y:e.y}}function Di(e){const{annotations:t,context:n,defaultOffset:r=Pf,notePadding:i=Nf,markPadding:o=Ef,edgePadding:a=If,preserveManualOffsets:s=!0,routeLongConnectors:l=!0,connectorThreshold:c=Tf,density:u,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:p,cohesion:m,audience:g}=e,y=n.width||0,v=n.height||0,b="object"==typeof p?p:{},x=b.breakpoint??480,w=!!p&&x>=y,k=w&&!1!==b.preferShortText?t.map(Si):t,S=w&&!u?{maxAnnotations:b.maxAnnotations??("callout-list"===b.strategy?1:2),minVisible:b.minVisible??1}:u,M=d||w&&(!1!==b.progressiveDisclosure||"callout-list"===b.strategy),j=w&&!f?b.responsive??{minWidth:x}:f,A=w&&!m?b.cohesion:m;if(0===k.length||0>=y||0>=v)return k.slice();const C=[],R=Ei(n,o);let L=!1;const P=k.map((e,t)=>{if(!ji(e))return e;const o=Ti(e,t,n);if(!o)return e;const u=Ai(!0===e.defensive?wi(e):e);if(s&&("number"==typeof(d=e).dx||"number"==typeof d.dy)){const t=vi(e);return C.push(Ri(Ci(o.x,o.y,"number"==typeof e.dx?e.dx:t.dx,"number"==typeof e.dy?e.dy:t.dy,u),i)),e}var d;let h=null,f=1/0;for(const e of Ni(r)){const t=Ii(Ci(o.x,o.y,e.dx,e.dy,u),e,C,R,y,v,i,a);f>t&&(h=e,f=t)}if(!h)return e;const p=Ri(Ci(o.x,o.y,h.dx,h.dy,u),i);C.push(p);const m=Math.hypot(h.dx,h.dy),g=l&&m>=c&&"text"!==e.type&&"widget"!==e.type?{...e.connector||{end:"arrow"},type:"curve"}:e.connector;return L=!0,{...e,dx:h.dx,dy:h.dy,...g?{connector:g}:{}}}),N=L?P:k.slice();let E=N;if(h){let e=!1;const t=N.map(t=>{const n=Mi(t);return n!==t&&(e=!0),n});E=e?t:N}{let e=!1;const t=E.map(t=>{if(!0!==t?.defensive)return t;const n=wi(t);return n!==t&&(e=!0),n});E=e?t:E}const I=/* @__PURE__ */new Set;if(S){const e="object"==typeof S?S:{},t=xi(g),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??mi(y,v,e))*t))},{deferred:r}=yi({annotations:E,width:y,height:v,...n});for(const e of r)I.add(e)}if(j&&("object"==typeof j&&"number"==typeof j.minWidth?j.minWidth:480)>=y)for(const e of E)ji(e)&&"secondary"===e.emphasis&&I.add(e);if(I.size>0)for(const e of E)!0===e?.defensive&&I.delete(e);let T;return T=0===I.size?E:M?E.map(e=>I.has(e)?{...e,_annotationDeferred:!0}:e):E.filter(e=>!I.has(e)),A?ki(T,A):T}function zi(e,t={}){const n=!0===t.showRetractedAnnotations,r=!0===t.showSupersededAnnotations,i=/* @__PURE__ */new Set;for(const t of e){const e=t?.lifecycle?.supersedes;e&&"retracted"!==t?.lifecycle?.status&&i.add(e)}return e.filter(e=>{if("retracted"===e?.lifecycle?.status&&!n)return!1;const t=e?.provenance?.stableId;return!(t&&i.has(t)&&!r)})}function _i({config:e,orientation:t="vertical",width:n=100,customClickBehavior:r,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:a,legendInteraction:s}){const{colorFn:l,domain:c,label:u,format:d}=e,h="horizontal"===t,f=d||zn(c),p="grad-legend-"+Ff.useId(),m=!(!r&&!i),g="isolate"===s||void 0===s&&null!=a,[y,v]=Ff.useState(0),[b,x]=Ff.useState(null),w=Ff.useRef([]),k=e=>{const t=h?e:5-e-1,n=c[0]+t/5*(c[1]-c[0]),r=c[0]+(t+1)/5*(c[1]-c[0]);return{label:`${f(n)} – ${f(r)}`,valueRange:[n,r],interactionKey:`${n}:${r}`}},S=(e,n,s)=>{const l="string"==typeof e.interactionKey?e.interactionKey:e.label,c=a?.has(l)??!1,u=o===l,d=b===s,h=e=>{const t=(e+5)%5;v(t),w.current[t]?.focus()};/* @__PURE__ */ /* @__PURE__ */
|
|
69
|
+
return(0,Wf.jsx)("rect",{ref:e=>{w.current[s]=e},className:"semiotic-gradient-legend-bin",...n,fill:a?.size&&!c||null!=o&&!u?"rgba(255,255,255,0.65)":"transparent",stroke:d||c||u?"var(--semiotic-focus, #005fcc)":"transparent",strokeWidth:d?3:2,tabIndex:s===y?0:-1,role:"option","aria-label":e.label,"aria-selected":g?c:void 0,"aria-current":!(g||!u)||void 0,onClick:r?()=>r(e):void 0,onMouseEnter:i?()=>i(e):void 0,onMouseLeave:i?()=>i(null):void 0,onFocus:()=>{v(s),x(s),i?.(e)},onBlur:()=>{x(null),i?.(null)},onKeyDown:n=>{if(("Enter"===n.key||" "===n.key)&&r)return n.preventDefault(),void r(e);const i="horizontal"===t?"ArrowRight":"ArrowDown";n.key===("horizontal"===t?"ArrowLeft":"ArrowUp")||n.key===i?(n.preventDefault(),h(s+(n.key===i?1:-1))):"Home"!==n.key&&"End"!==n.key||(n.preventDefault(),h("Home"===n.key?0:4))},style:{cursor:"pointer",pointerEvents:"all"}},"gradient-interaction-"+s)},[M,j]=c,A=Ff.useMemo(()=>Array.from({length:65},(e,t)=>{const n=t/64;/* @__PURE__ */ /* @__PURE__ */
|
|
70
|
+
return(0,Wf.jsx)("stop",{offset:n,stopColor:l(h?M+n*(j-M):j-n*(j-M))},t)}),[l,M,j,h]),C=h?Math.min(n,200):14,R=h?12:100,L=h?Math.max(0,(n-C)/2):0,P=u?18:0;/* @__PURE__ */ /* @__PURE__ */
|
|
71
|
+
return(0,Wf.jsxs)("g",{"aria-label":u||"Gradient legend",role:m?"listbox":void 0,"aria-orientation":m?t:void 0,"aria-multiselectable":!(!m||!g)||void 0,style:_f,children:[
|
|
72
|
+
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */(0,Wf.jsx)("defs",{children:/* @__PURE__ */ /* @__PURE__ */(0,Wf.jsx)("linearGradient",{id:p,x1:"0%",y1:"0%",x2:h?"100%":"0%",y2:h?"0%":"100%",children:A})}),u&&/* @__PURE__ */ /* @__PURE__ */(0,Wf.jsx)("text",{x:h?L+C/2:0,y:12,textAnchor:h?"middle":"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),
|
|
74
|
+
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */(0,Wf.jsx)("rect",{x:L,y:P,width:C,height:R,fill:`url(#${p})`,rx:2}),m&&Array.from({length:5},(e,t)=>S(k(t),{x:h?L+t*C/5:0,y:h?P:P+t*R/5,width:h?C/5:C,height:h?R:R/5},t)),[0,1].map(e=>/* @__PURE__ */ /* @__PURE__ */(0,Wf.jsx)("text",{x:h?L+e*C:C+5,y:P+(h?R+12:e?R:10),textAnchor:h?e?"end":"start":void 0,fontSize:10,fill:"var(--semiotic-text-secondary, #666)",children:f(c[h?e:1-e])},e))]})}function Oi(e,t,n,r,i){if("function"==typeof n)return n(e);const o=r(e,t);return"fill"===n?/* @__PURE__ */ /* @__PURE__ */(0,Bf.jsx)("rect",{style:o,width:i,height:i}):/* @__PURE__ */ /* @__PURE__ */(0,Bf.jsx)("line",{style:o,x1:0,y1:0,x2:i,y2:i})}function Fi({swatchSize:e}){/* @__PURE__ */ /* @__PURE__ */
|
|
76
|
+
return(0,Bf.jsx)("path",{d:`M${.25*e},${.55*e} L${.45*e},${.75*e} L${.8*e},${.3*e}`,fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})}function Wi(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}function Bi(e,t,n,r,i,o){const{legendGroup:{type:a="fill",styleFn:s,items:l},customClickBehavior:c,customHoverBehavior:u,highlightedCategory:d,isolatedCategories:h,focusedGroupIndex:f,focusedItemIndex:p,groupIndex:m,onFocusedIndexChange:g,interactive:y,useIsolateAria:v,metrics:{swatchSize:b,labelGap:x}}=e,w=!!h?.size&&h.has(t.label);/* @__PURE__ */ /* @__PURE__ */
|
|
77
|
+
return(0,Bf.jsxs)("g",{transform:r,onClick:c?()=>c(t):void 0,onMouseEnter:u?()=>u(t):void 0,onMouseLeave:u?()=>u(null):void 0,tabIndex:y?m===f&&n===p?0:-1:void 0,role:y?"option":void 0,"aria-selected":y&&v?w:void 0,"aria-current":!(!y||v||null==d||t.label!==d)||void 0,"aria-label":t.label,onKeyDown:y?e=>{if("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c?.(t)),e.key===i||e.key===o){e.preventDefault();const t=(n+(e.key===o?1:-1)+l.length)%l.length;g(m,t);const r=e.currentTarget.parentElement?.children[t];r instanceof SVGElement&&r.focus()}}:void 0,onFocus:y?e=>{g(m,n),u?.(t),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","visible")}:void 0,onBlur:y?e=>{u?.(null),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","hidden")}:void 0,style:{cursor:y?"pointer":"default",opacity:Wi(t,d,h),transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[y&&/* @__PURE__ */ /* @__PURE__ */(0,Bf.jsx)("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:b+x+2+7*t.label.length,height:b+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),Oi(t,n,a,s,b),w&&/* @__PURE__ */ /* @__PURE__ */(0,Bf.jsx)(Fi,{swatchSize:b}),
|
|
78
|
+
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */(0,Bf.jsx)("text",{y:b/2,x:b+x,dominantBaseline:"central",fontSize:12,style:Of,fill:"var(--semiotic-text, #333)",children:t.label})]},"legend-item-"+n)}function Hi(e){const{legendGroups:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,legendInteraction:a,title:s="Legend",width:l=100,height:c=20,orientation:u="vertical",legendLayout:d}=e,h=Kn(d),[f,p]=zf.useState(0),[m,g]=zf.useState(0),y=zf.useCallback((e,t)=>{p(e),g(t)},[]),v="vertical"===u?qf({legendGroups:t||[],width:l,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:m,onFocusedIndexChange:y,legendInteraction:a,metrics:h}):Gf({legendGroups:t||[],title:s,height:c,width:l,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:f,focusedItemIndex:m,onFocusedIndexChange:y,legendInteraction:a,metrics:h}),b=!(!n&&!r);/* @__PURE__ */ /* @__PURE__ */
|
|
80
|
+
return(0,Bf.jsxs)("g",{role:b?"listbox":void 0,"aria-multiselectable":!(!b||"isolate"!==a&&(void 0!==a||null==o))||void 0,"aria-label":"Chart legend",style:_f,children:[void 0!==s&&""!==s&&"vertical"===u&&/* @__PURE__ */ /* @__PURE__ */(0,Bf.jsx)("text",{className:"legend-title",y:16,x:l/2,textAnchor:"middle",fontSize:12,style:Of,fill:"var(--semiotic-text, #333)",children:s}),v]})}function $i(e){const{legend:t,totalWidth:n,totalHeight:r,margin:i,legendPosition:o="right",legendLayout:a,legendHoverBehavior:s,legendClickBehavior:l,legendHighlightedCategory:c,legendIsolatedCategories:u,legendInteraction:d}=e;if(!t)return null;const{x:h,y:f,width:p}=Zn(t,{totalWidth:n,totalHeight:r,margin:i,position:o,legendLayout:a,axisChrome:e.axisChrome}),m="top"===o||"bottom"===o;/* @__PURE__ */ /* @__PURE__ */
|
|
81
|
+
return(0,Vf.jsx)("g",{transform:`translate(${h}, ${f})`,children:Fn(t)?/* @__PURE__ */ /* @__PURE__ */(0,Vf.jsx)(_i,{config:t.gradient,orientation:m?"horizontal":"vertical",width:p,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):On(t)?/* @__PURE__ */ /* @__PURE__ */(0,Vf.jsx)(Hi,{legendGroups:t.legendGroups,title:"",width:p,orientation:m?"horizontal":"vertical",legendLayout:a,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}function qi({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?/* @__PURE__ */ /* @__PURE__ */(0,Uf.jsx)("foreignObject",{x:0,y:0,width:t,height:n,children:e}):/* @__PURE__ */ /* @__PURE__ */(0,Uf.jsx)("text",{x:t/2,y:22,textAnchor:"middle",fontWeight:"bold",fill:"var(--semiotic-text, #333)",fontSize:14,className:"semiotic-chart-title",style:{userSelect:"none",fontSize:"var(--semiotic-title-font-size, 14px)",fontFamily:"var(--semiotic-title-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-title-font-weight, bold)"},children:e}):null}function Gi(e,t){return"string"==typeof e&&e.length>0?e:t}function Vi(e,t,n){return"string"==typeof t&&t.length>0?t:"string"==typeof e&&e.length>0?`${e} (${n.familyPhrase})`:n.fallback}function Ui(e){const t=(e+"").replace(/[^a-zA-Z0-9_-]/g,"_"),n=/^[A-Za-z_]/.test(t)?t:"c"+t,r=n+"-semiotic-title",i=n+"-semiotic-desc";return{titleId:r,descId:i,labelledBy:`${r} ${i}`}}function Yi(e){const{width:t,height:n,totalWidth:r,totalHeight:i,margin:o,showAxes:a,title:s,description:l,idPrefix:c,legend:u,legendHoverBehavior:d,legendClickBehavior:h,legendHighlightedCategory:f,legendIsolatedCategories:p,legendPosition:m,legendLayout:g,foregroundGraphics:y,annotations:v,onAnnotationActivate:b,onObservation:x,chartId:w,chartType:k,autoPlaceAnnotations:S,svgAnnotationRules:M,pointNodes:j,geoProjection:A}=e,C=ur({onAnnotationActivate:b,onObservation:x,chartId:w,chartType:k}),R=(0,uf.useRef)([v?.length??0,/* @__PURE__ */new Map]),L=v?.length??0;R.current[0]!==L&&(R.current=[L,/* @__PURE__ */new Map]);const P=(0,uf.useMemo)(()=>{if(!v||0===v.length)return null;const e=zi(v),r=A?e.map(e=>{if(!Array.isArray(e.coordinates)||2>e.coordinates.length)return e;const t=A(Number(e.coordinates[0]),Number(e.coordinates[1]));return t?{...e,x:t[0],y:t[1]}:e}):e,i={scales:{x:e=>Number(e),y:e=>Number(e)},timeAxis:"x",width:t,height:n,frameType:"xy",pointNodes:j,stickyPositionCache:R.current[1]};return ci(S?Di({annotations:r,context:i,..."object"==typeof S?S:{}}):r,di(0,C),M,i)},[v,S,M,t,n,j,C,A]),N=a||s||l||u||y||P&&P.length>0,E=(0,uf.useId)(),{titleId:I,descId:T,labelledBy:D}=Ui(c||w||E);return N?/* @__PURE__ */ /* @__PURE__ */(0,Yf.jsxs)("svg",{role:"img","aria-labelledby":D,width:r,height:i,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[
|
|
82
|
+
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */(0,Yf.jsx)("title",{id:I,children:Gi(s,"Geographic chart")}),
|
|
84
|
+
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */(0,Yf.jsx)("desc",{id:T,children:Vi(s,l,{familyPhrase:"geographic data visualization",fallback:"geographic data visualization"})}),
|
|
86
|
+
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */(0,Yf.jsxs)("g",{transform:"translate("+o.left+","+o.top+")",children:[P,y]}),
|
|
88
|
+
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */(0,Yf.jsx)(qi,{title:s,totalWidth:r,marginTop:o.top}),$i({legend:u,totalWidth:r,totalHeight:i,margin:o,legendPosition:m,title:s,legendLayout:g,legendHoverBehavior:d,legendClickBehavior:h,legendHighlightedCategory:f,legendIsolatedCategories:p})]}):null}function Xi(e,t="#4e79a7"){return Ur(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function Zi(e){const t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?"s_"+t:t}function Ki(e,t,n,r){const i=e.glyph;if(!i?.parts?.length||0>=e.size)return null;const o=pn(i,e.size);if(0>=o.scale)return null;const a=`translate(${t},${n})${e.rotation?` rotate(${180*e.rotation/Math.PI})`:""} translate(${o.offsetX},${o.offsetY}) scale(${o.scale})`,s=e.color??("string"==typeof e.style.fill?e.style.fill:void 0),l=vn(i,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=l?Zi(r+"-clip"):void 0,u=(e.style.opacity??1)*(e._decayOpacity??1)*(e.style.fillOpacity??1),d=t=>i.parts.map((n,r)=>{const i=t?"none"===n.fill?void 0:t:gn(n.fill,s,e.accent),o=t?n.stroke&&"none"!==n.stroke?t:void 0:gn(n.stroke??"none",s,e.accent);return i||o?/* @__PURE__ */ /* @__PURE__ */(0,Zf.jsx)("path",{d:n.d,fill:i??"none",stroke:o,strokeWidth:o?n.strokeWidth??1:void 0,strokeLinecap:n.strokeLinecap,strokeLinejoin:n.strokeLinejoin,opacity:n.opacity},r):null});/* @__PURE__ */ /* @__PURE__ */
|
|
90
|
+
return(0,Zf.jsxs)("g",{transform:a,opacity:1===u?void 0:u,children:[l&&c&&/* @__PURE__ */ /* @__PURE__ */(0,Zf.jsx)("clipPath",{id:c,children:/* @__PURE__ */ /* @__PURE__ */(0,Zf.jsx)("rect",{x:l.x,y:l.y,width:l.width,height:l.height})}),l&&e.ghostColor?/* @__PURE__ */ /* @__PURE__ */(0,Zf.jsx)("g",{children:d(e.ghostColor)}):null,l&&c?/* @__PURE__ */ /* @__PURE__ */(0,Zf.jsx)("g",{clipPath:`url(#${c})`,children:d()}):d()]},r)}function Qi(e){if(!1!==e?.interactive)return e?.style?.cursor}function Ji(e){if(!e)return!1;for(const t of e)if(Qi(t))return!0;return!1}function eo(e,t){if(!e)return;const n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function to(e){const t=Kf.useRef(null);Kf.useEffect(()=>{e.current&&(t.current=e.current)}),Kf.useEffect(()=>()=>eo(t.current),[])}function no(e,t,n){const r=Qi(t);return r&&null!=e&&!1!==e?/* @__PURE__ */ /* @__PURE__ */(0,Qf.jsx)("g",{style:{cursor:r},"data-semiotic-mark-cursor":r,children:e},n):e}function ro(e,t){return no(io(e,t),e,"geo-cursor-"+t)}function io(e,t){switch(e.type){case"geoarea":{const n=e;if(!n.pathData)return null;const r=Ur(n.style.fill)?Kr(n.style.fill,`geoarea-${t}-hatch`):void 0;/* @__PURE__ */ /* @__PURE__ */
|
|
91
|
+
return(0,Jf.jsxs)(Xf.Fragment,{children:[r&&/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("defs",{children:r}),
|
|
92
|
+
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */(0,Jf.jsx)("path",{d:n.pathData,fill:r?`url(#geoarea-${t}-hatch)`:Xi(n.style.fill,"#e0e0e0"),fillOpacity:n.style.fillOpacity??1,stroke:n.style.stroke||"none",strokeWidth:n.style.strokeWidth??.5,strokeDasharray:n.style.strokeDasharray,opacity:(n.style.opacity??1)*(n._decayOpacity??1)})]},"geoarea-"+t)}case"point":{const n=e,r=Ur(n.style.fill)?Kr(n.style.fill,`geopoint-${t}-hatch`):void 0;/* @__PURE__ */ /* @__PURE__ */
|
|
94
|
+
return(0,Jf.jsxs)(Xf.Fragment,{children:[r&&/* @__PURE__ */ /* @__PURE__ */(0,Jf.jsx)("defs",{children:r}),
|
|
95
|
+
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */(0,Jf.jsx)("circle",{cx:n.x,cy:n.y,r:n.r,fill:r?`url(#geopoint-${t}-hatch)`:Xi(n.style.fill),fillOpacity:n.style.fillOpacity??.8,stroke:n.style.stroke,strokeWidth:n.style.strokeWidth,opacity:n._decayOpacity??n.style.opacity??1})]},"point-"+t)}case"line":{const n=e;if(2>n.path.length)return null;const r="M"+n.path.map(e=>`${e[0]},${e[1]}`).join("L");/* @__PURE__ */ /* @__PURE__ */
|
|
97
|
+
return(0,Jf.jsx)("path",{d:r,fill:"none",stroke:n.style.stroke||"#4e79a7",strokeWidth:n.style.strokeWidth??1.5,strokeDasharray:n.style.strokeDasharray,opacity:n.style.opacity??1},"line-"+t)}case"glyph":return Ki(e,e.x,e.y,"geo-glyph-"+(e.pointId??t));default:return null}}function oo(){const[e,t]=(0,tp.useState)(!1);return np(()=>{t(!0)},[]),e}function ao(){const e=(0,tp.useSyncExternalStore)(rp,ip,op);return(0,tp.useRef)(e).current}function so(e){const{hydrated:t,wasHydratingFromSSR:n,storeRef:r,dirtyRef:i,renderFnRef:o,cancelRender:a,cleanup:s}=e;np(()=>{if(!t)return;const e=r.current;t&&n&&e?.cancelIntroAnimation?.(),!n&&e?.sceneNodes&&e.sceneNodes.length>0&&e?.markStylePaintPending?e.markStylePaintPending():i.current=!0,a?.(),o.current()},[t,n]);const l=(0,tp.useRef)(s);l.current=s,(0,tp.useEffect)(()=>()=>l.current?.(),[])}function lo(e,t,n){const r=Math.round(t[0]*n),i=Math.round(t[1]*n),o=0===t[0]?n:r/t[0],a=0===t[1]?n:i/t[1],s=t[0]+"px",l=t[1]+"px";return e.style.width!==s&&(e.style.width=s),e.style.height!==l&&(e.style.height=l),e.width!==r&&(e.width=r),e.height!==i&&(e.height=i),{effectiveDprX:o,effectiveDprY:a}}function co(e,t,n,r){const i=e.getContext("2d");if(!i)return null;const{effectiveDprX:o,effectiveDprY:a}=lo(e,t,r);return i.setTransform(o,0,0,a,0,0),i.translate(n.left,n.top),i}function uo(e,t){if("undefined"==typeof window)return 1;const n=window.devicePixelRatio||1,r="undefined"!=typeof window&&("function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches||768>Math.min(window.innerWidth||1/0,window.innerHeight||1/0))?2:3,i="number"==typeof e&&e>0?e:r;if(!t)return Math.max(1,Math.min(n,i));const[o,a]=t,s=Math.min(Math.sqrt(8388608/(o*a)),16384/Math.max(o,a));return Math.max(1>s?0:1,Math.min(n,i,s))}function ho(e){function t(){r||(i(),n=null,e(),queueMicrotask(()=>{r||o()}))}if("undefined"==typeof window||"function"!=typeof window.matchMedia)return()=>{};let n=null,r=!1;const i=()=>{n&&("function"==typeof n.removeEventListener?n.removeEventListener("change",t):"function"==typeof n.removeListener&&n.removeListener(t))},o=()=>{const e=`(resolution: ${window.devicePixelRatio||1}dppx)`;n=window.matchMedia(e),n.media.includes("resolution")?"function"==typeof n.addEventListener?n.addEventListener("change",t):"function"==typeof n.addListener&&n.addListener(t):n=null};return o(),()=>{r=!0,i(),n=null}}function fo(e){const{cancelRender:t,dirtyRef:n,frameRuntime:r,manageFrameRuntime:i,maxDevicePixelRatio:o,scheduleRender:a}=e,s=(0,ap.useRef)(null),l=(0,ap.useRef)(null),c=(0,ap.useRef)(!1),u=(0,ap.useRef)(!1),d=(0,ap.useRef)(!1);return lp(()=>{!u.current&&(u.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),so({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,cleanup:e.cleanup}),(0,ap.useEffect)(()=>{if(!1!==i)return r.subscribe(()=>{r.isActive?(n.current=!0,a()):t()})},[t,n,r,i,a]),(0,ap.useEffect)(()=>ho(()=>{c.current=!0,a()}),[a]),(0,ap.useEffect)(()=>{d.current?(c.current=!0,a()):d.current=!0},[o,a]),{canvasRef:s,interactionCanvasRef:l,resolutionDirtyRef:c}}function po(e,t){return fo({...t,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,frameRuntime:e.frameRuntime})}function mo({children:e,size:t,margin:n,backdropFill:r,overflowVisible:i=!1}){return e||r?/* @__PURE__ */ /* @__PURE__ */(0,sp.jsxs)("svg",{style:{position:"absolute",left:0,top:0,width:t[0],height:t[1],pointerEvents:"none",overflow:i?"visible":void 0},children:[r&&"transparent"!==r?/* @__PURE__ */ /* @__PURE__ */(0,sp.jsx)("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:t[0],height:t[1],fill:r}):null,
|
|
98
|
+
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */(0,sp.jsx)("g",{transform:`translate(${n.left},${n.top})`,children:e})]}):null}function go(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return vo(e,t);if(!bo(e)||!bo(t))return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;const n=e[r],i=t[r];if(!Object.is(n,i))if(Array.isArray(n)&&Array.isArray(i)){if(!vo(n,i))return!1}else{if(!bo(n)||!bo(i))return!1;if(!yo(n,i))return!1}}return!0}function yo(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(!Object.is(e[r],t[r]))return!1}return!0}function vo(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function bo(e){if(null===e||"object"!=typeof e)return!1;if(Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function xo(e){const t=(0,cp.useRef)(e);return go(t.current,e)||(t.current=e),t.current}function wo(e){const{background:t,hasBackgroundGraphics:n=!1,themeBackground:r=""}=e;return"transparent"===t?null:n?t||null:t||(r&&"transparent"!==r?r:"")||null}function ko(e){const{background:t,hasBackgroundGraphics:n=!1,themeBackground:r=""}=e;return"transparent"===t||n?null:t||(r&&"transparent"!==r?r:"")||null}function So(e,t){const{background:n,hasBackgroundGraphics:r=!1,themeBackground:i="",x:o=0,y:a=0,width:s,height:l}=t,c=ko({background:n,hasBackgroundGraphics:r,themeBackground:i});if(!c)return!1;const u=Nn(e,c);return!(!u||"transparent"===u.trim().toLowerCase()||(e.fillStyle=u,e.fillRect(o,a,s,l),0))}function Mo({hoverPoint:e}){let t="";if(e){const n=e.data||e;t="object"==typeof n?"Data point: "+Object.entries(n).filter(([,e])=>"object"!=typeof e&&"function"!=typeof e).map(([e,t])=>`${e}: ${t}`).join(", "):"Data point: "+n}/* @__PURE__ */ /* @__PURE__ */
|
|
100
|
+
return(0,fp.jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:pp,children:t})}function jo(e){const t={};if(null==e||"object"!=typeof e)return t;for(const[n,r]of Object.entries(e))n.startsWith("_")||null!=r&&""!==r&&("number"==typeof r?Number.isFinite(r)&&(t[n]=r):"string"==typeof r?t[n]=r:"boolean"==typeof r?t[n]=r+"":r instanceof Date&&(t[n]=r.toISOString().slice(0,10)));return t}function Ao(e){return e&&"object"==typeof e?e:{}}function Co(e){return Ao(e.accessibility).tableFields??e.accessibleDatum??e.datum}function Ro(e){const t=[];if(!Array.isArray(e))return t;const n=e.some(e=>e&&("line"===e.type||"area"===e.type));for(const r of e)if(r&&"object"==typeof r&&null!==r.datum)try{switch(r.type){case"point":if(n)break;t.push({label:"Point",values:jo(Co(r))});break;case"line":case"area":{const e=Co(r),n=Array.isArray(e)?e:[],i="line"===r.type?"Line point":"Area point";for(const e of n)t.push({label:i,values:jo(e)});break}case"rect":{const e=Co(r),n=null!=e&&"object"==typeof e?e:{},i=n.category??r.group??"",o=n.value??n.__aggregateValue??n.total,a=jo(n);null==a.category&&""!==i&&(a.category=i+""),null==a.value&&null!=o&&(a.value="number"==typeof o||"string"==typeof o?o:o+""),t.push({label:"Bar",values:a});break}case"heatcell":{const e=jo(Co(r));null==e.value&&"number"==typeof r.value&&Number.isFinite(r.value)&&(e.value=r.value),t.push({label:"Cell",values:e});break}case"wedge":{const e=Co(r),n=jo(e);if(null==n.category){const t=Ao(e),r=t.category??t.label;null!=r&&(n.category=r+"")}t.push({label:"Wedge",values:n});break}case"circle":t.push({label:"Node",values:jo(Co(r))});break;case"arc":t.push({label:"Arc",values:jo(Co(r))});break;case"candlestick":t.push({label:"Candlestick",values:jo(Co(r))});break;case"geoarea":{const e=Ao(Co(r)),n=jo(e);if(null==n.name){const t=Ao(e.properties).name??e.name;null!=t&&(n.name=t+"")}t.push({label:"Region",values:n});break}}}catch{}return t}function Lo(e){const t=/* @__PURE__ */new Map;for(const n of e??[])for(const[e,r]of Object.entries(n?.values??{})){if(null==r||""===r)continue;let n=t.get(e);if(n||(n={count:0,min:1/0,max:-1/0,sum:0,strings:/* @__PURE__ */new Set},t.set(e,n)),"number"==typeof r){if(!Number.isFinite(r))continue;n.count++,n.sum+=r,n.min>r&&(n.min=r),r>n.max&&(n.max=r)}else"object"!=typeof r&&"function"!=typeof r&&n.strings.add(r+"")}return Array.from(t,([e,t])=>{if(t.count)return{name:e,count:t.count,numeric:!0,min:t.min,max:t.max,mean:t.sum/t.count};const n=Array.from(t.strings);return{name:e,count:n.length,numeric:!1,uniqueValues:n.slice(0,5)}}).filter(e=>e.count>0)}function Po(e,t){const n=[e+" data points."];for(const e of t)if(e.numeric)n.push(`${e.name}: ${mp(e.min)} to ${mp(e.max)}, mean ${mp(e.mean)}.`);else{const t=e.uniqueValues,r=t.length>3?`${t.slice(0,3).join(", ")}… (${e.count} unique)`:t.join(", ");n.push(`${e.name}: ${r}.`)}return n.join(" ")}function No({accessibleTable:e,children:t}){return"object"!=typeof e?t:"undefined"==typeof document?null:/* @__PURE__ */ /* @__PURE__ */(0,gp.jsx)(up.Suspense,{fallback:null,children:/* @__PURE__ */ /* @__PURE__ */(0,gp.jsx)(yp,{target:e.portalTarget,children:t})})}function Eo(e,t){if(!e||0===e.length)return t+", empty";const n={};for(const t of e){if(null===t?.datum)continue;const e=t.type+"";n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return t+", empty";const r=[],i={point:"points",line:"lines",area:"areas",rect:"bars",heatcell:"cells",circle:"nodes",candlestick:"candlesticks",wedge:"wedges",arc:"arcs",geoarea:"regions"},o=["point","line","area","rect","heatcell","circle","candlestick","wedge","arc","geoarea"],a=Object.keys(n).sort((e,t)=>{const n=o.indexOf(e),r=o.indexOf(t);return(-1===n?999:n)-(-1===r?999:r)});for(const e of a)r.push(`${n[e]} ${i[e]||e}`);return`${t}, ${r.join(", ")}`}function Io({scene:e,chartType:t,tableId:n,chartTitle:r}){const[i,o]=up.useState(!1),[a,s]=up.useState(5),l=dp.useContext(hp),c=l?.visible??!1,u=i||c,d=up.useRef(null),h=r?"Data summary for "+r:n?`Data summary for ${t} ${n}`:"Data summary for "+t;up.useEffect(()=>{u||s(5)},[u]);const f=up.useCallback(e=>{e.target===e.currentTarget&&(i||c||o(!0))},[i,c]),p=up.useCallback(e=>{c||d.current?.contains(e.relatedTarget)||o(!1)},[c]);if(!e||0===e.length)return n?/* @__PURE__ */ /* @__PURE__ */(0,gp.jsx)("span",{id:n,tabIndex:-1,style:pp}):null;if(!u)/* @__PURE__ */ /* @__PURE__ */
|
|
101
|
+
return(0,gp.jsx)("div",{id:n,className:bp,tabIndex:-1,onFocus:f,style:pp,role:"region","aria-label":h,children:/* @__PURE__ */ /* @__PURE__ */(0,gp.jsxs)("button",{type:"button",onClick:()=>o(!0),style:wp,children:["View data summary (",e.length," elements)"]})});const m=Ro(e),g=Lo(m),y=Po(m.length,g),v=Math.min(a,m.length),b=m.slice(0,v),x=m.length-v,w=/* @__PURE__ */new Set;for(const e of b)for(const t of Object.keys(e.values))w.add(t);const k=Array.from(w);/* @__PURE__ */ /* @__PURE__ */
|
|
102
|
+
return(0,gp.jsxs)("div",{ref:d,id:n,className:xp,tabIndex:-1,onBlur:p,style:kp,role:"region","aria-label":h,children:[
|
|
103
|
+
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */(0,gp.jsx)("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:()=>{c&&l&&l.setVisible(!1),o(!1)},"aria-label":"Close data summary",style:Mp,children:"×"}),
|
|
105
|
+
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */(0,gp.jsx)("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:Sp,children:y}),
|
|
107
|
+
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */(0,gp.jsxs)("table",{className:"semiotic-accessible-data-table-table",role:"table","aria-label":"Sample data for "+t,style:jp,children:[
|
|
109
|
+
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */(0,gp.jsx)("caption",{className:"semiotic-accessible-data-table-caption",style:Rp,children:x>0?`First ${v} of ${m.length} data points`:`All ${m.length} data points`}),
|
|
111
|
+
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */(0,gp.jsx)("thead",{children:/* @__PURE__ */ /* @__PURE__ */(0,gp.jsxs)("tr",{children:[
|
|
113
|
+
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */(0,gp.jsx)("th",{style:Ap,children:"type"}),k.map(e=>/* @__PURE__ */ /* @__PURE__ */(0,gp.jsx)("th",{style:Ap,children:e},e))]})}),
|
|
115
|
+
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */(0,gp.jsx)("tbody",{children:b.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,gp.jsxs)("tr",{children:[
|
|
117
|
+
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */(0,gp.jsx)("td",{style:Cp,children:e.label}),k.map(t=>{/* @__PURE__ */ /* @__PURE__ */return(0,gp.jsx)("td",{style:Cp,children:(n=e.values[t],null==n||""===n?"—":"number"==typeof n?Number.isNaN(n)?"—":mp(n):"boolean"==typeof n?n?"true":"false":"object"==typeof n?"—":n+"")},t);var n})]},t))})]}),x>0&&/* @__PURE__ */ /* @__PURE__ */(0,gp.jsxs)("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:()=>s(e=>e+25),style:Lp,children:["Show ",Math.min(25,x)," more"," ",1===x?"row":"rows"," (",x," remaining)"]})]})}function To({summary:e}){return e?/* @__PURE__ */ /* @__PURE__ */(0,gp.jsx)("div",{role:"note",style:pp,children:e}):null}function Do({tableId:e}){/* @__PURE__ */ /* @__PURE__ */
|
|
119
|
+
return(0,gp.jsx)("a",{href:"#"+e,style:pp,onClick:t=>{t.preventDefault();const n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:e=>{Object.assign(e.currentTarget.style,{position:"absolute",width:"auto",height:"auto",overflow:"visible",clip:"auto",whiteSpace:"normal",padding:"4px 8px",background:"var(--semiotic-bg, #fff)",color:"var(--semiotic-text, #000)",border:"2px solid var(--semiotic-focus, #005fcc)",borderRadius:"4px",zIndex:"10",fontSize:"12px",top:"4px",left:"4px"})},onBlur:e=>{const t=e.currentTarget;t.removeAttribute("style"),Object.assign(t.style,pp)},children:"Skip to data table"})}function zo(e,t){if(!t)return[];const n=/* @__PURE__ */new Set,r=[];for(const i of e){if(!i||"object"!=typeof i)continue;const e=("function"==typeof t?t(i):i[t])+"";n.has(e)||(n.add(e),r.push(e))}return r}function _o(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function Oo(e,t,n,r){const i=(0,Pp.useRef)({accessor:t,onChange:n,readData:r}),o=(0,Pp.useRef)([]);i.current={accessor:t,onChange:n,readData:r};const a=(0,Pp.useCallback)(()=>{const{accessor:t,onChange:n,readData:r}=i.current;if(!n||!t)return;const a=zo(e.current?r(e.current):[],t);_o(a,o.current)||(o.current=a,n(a))},[e]);return(0,Pp.useEffect)(()=>{o.current=[],a()},[t,a,n]),a}function Fo({active:e,hoverPoint:t,margin:n,size:r,shape:i="circle",width:o,height:a,pathData:s}){if(!e||!t)return null;const l=t.x+n.left,c=t.y+n.top;let u;if("geoarea"!==i&&"path"!==i||!s)if("rect"===i&&null!=o&&null!=a){const e=Math.max(o,4),t=Math.max(a,4);u=/* @__PURE__ */ /* @__PURE__ */(0,Np.jsx)("rect",{x:l-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:Ep,strokeWidth:2,strokeDasharray:"4,2"})}else u=/* @__PURE__ */ /* @__PURE__ */(0,Np.jsx)("circle","wedge"===i?{cx:l,cy:c,r:12,fill:"none",stroke:Ep,strokeWidth:2.5,strokeDasharray:"6,3"}:{cx:l,cy:c,r:8,fill:"none",stroke:Ep,strokeWidth:2,strokeDasharray:"4,2"});else u=/* @__PURE__ */ /* @__PURE__ */(0,Np.jsx)("g",{transform:`translate(${n.left},${n.top})`,children:/* @__PURE__ */ /* @__PURE__ */(0,Np.jsx)("path",{d:s,fill:"none",stroke:Ep,strokeWidth:2.5,strokeDasharray:"6,3"})});/* @__PURE__ */ /* @__PURE__ */
|
|
120
|
+
return(0,Np.jsx)("svg",{style:{position:"absolute",left:0,top:0,width:r[0],height:r[1],pointerEvents:"none",zIndex:2},"aria-hidden":"true",children:u})}function Wo({chrome:e="default",className:t="",style:n,children:r,...i}){const o="default"===e?{...zp,...n}:n;/* @__PURE__ */ /* @__PURE__ */
|
|
121
|
+
return(0,Dp.jsx)("div",{...i,"data-semiotic-tooltip-chrome":!0,className:("semiotic-tooltip "+t).trim(),style:o,children:r})}function Bo(e){return e.ownsChrome=!0,e}function Ho(e){if("string"!=typeof e)return null!=e;const t=e.trim().toLowerCase();return!(!t||"transparent"===t||/^rgba\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t)||/^hsla\([^)]*,\s*0(?:\.0+)?\s*\)$/.test(t))}function $o(e){if(!Tp.isValidElement(e))return!1;const t=e.type;if("string"!=typeof t&&t&&!0===t.ownsChrome)return!0;const n=e.props,r=n["data-semiotic-tooltip-chrome"];if(null!=r&&!1!==r&&"false"!==r)return!0;const i=n.style;if(i&&"object"==typeof i){if(Ho(i.background))return!0;if(Ho(i.backgroundColor))return!0}return!1}function qo({x:e,y:t,containerWidth:n,containerHeight:r,margin:i,children:o,className:a="stream-frame-tooltip",zIndex:s=1}){const l=Number.isFinite(e)&&Number.isFinite(t),c=Ip.useRef(null),[u,d]=Ip.useState(null);let h;Ip.useLayoutEffect(()=>{const e=c.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect();Number.isFinite(t.width)&&Number.isFinite(t.height)&&d(e=>e&&.5>Math.abs(e.width-t.width)&&.5>Math.abs(e.height-t.height)?e:{width:t.width,height:t.height})};if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[a,n,r,l]),h=u?`translate(${u.width+12>n-e?"calc(-100% - 12px)":"12px"}, ${u.height+12>r-t?"calc(-100% - 4px)":"4px"})`:`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${.3*r>t?"4px":"calc(-100% - 4px)"})`;const f=$o(o),p=f?null:zp;return l?/* @__PURE__ */ /* @__PURE__ */(0,Op.jsx)("div",{ref:c,className:f?a:(a+" semiotic-tooltip").trim(),style:{...p||{},position:"absolute",left:i.left+e,top:i.top+t,transform:h,pointerEvents:"none",zIndex:s,width:"max-content"},children:o}):null}function Go(e,t){const n=e.fillStyle,r="#010203";try{e.fillStyle=r,e.fillStyle=t}catch{return e.fillStyle=n,[78,121,167]}const i=e.fillStyle;if(e.fillStyle=n,"string"!=typeof i)return[78,121,167];if(i.toLowerCase()===r&&t.trim().toLowerCase()!==r)return[78,121,167];if(i.startsWith("#"))return[parseInt(i.slice(1,3),16),parseInt(i.slice(3,5),16),parseInt(i.slice(5,7),16)];const o=i.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);return o?[+o[1],+o[2],+o[3]]:[78,121,167]}function Vo(e){switch(e){case"monotoneX":return Bp.curveMonotoneX;case"monotoneY":return Bp.curveMonotoneY;case"cardinal":return Bp.curveCardinal;case"catmullRom":return Bp.curveCatmullRom;case"step":return Bp.curveStep;case"stepBefore":return Bp.curveStepBefore;case"stepAfter":return Bp.curveStepAfter;case"basis":return Bp.curveBasis;case"natural":return Bp.curveNatural;default:return null}}function Uo(e,t,n){return null==t?n:Ur(t)?Zr(t,e)||t.background&&Nn(e,t.background)||n:"string"!=typeof t?t:Nn(e,t)||n}function Yo(e,t){if(null==t)return;const n=Uo(e,t,"");return""===n?void 0:n}function Xo(e,t,n,r,i,o,a){const s=t.stops.filter(e=>Number.isFinite(e.offset)&&(null==e.opacity||Number.isFinite(e.opacity)));if(2>s.length)return null;const l=e.createLinearGradient(r,i,o,a);for(const t of s)l.addColorStop(Math.max(0,Math.min(1,t.offset)),Zo(e,t,n));return l}function Zo(e,t,n){const r=t.color??n,i=Nn(e,r)||r;if(null==t.opacity)return i;const o=Math.max(0,Math.min(1,t.opacity)),[a,s,l]=Go(e,i);return`rgba(${a},${s},${l},${o})`}function Ko(e){return!(!e._pulseIntensity||0>=e._pulseIntensity)}function Qo(e,t,n=.6){if(!Ko(t))return;const r=t.r+(t._pulseGlowRadius??4)*t._pulseIntensity,i=t.cx??t.x??0,o=t.cy??t.y??0;e.beginPath(),e.arc(i,o,r,0,2*Math.PI),e.strokeStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.lineWidth=2*t._pulseIntensity,e.globalAlpha=t._pulseIntensity*n,e.stroke()}function Jo(e,t,n,r=.35){Ko(t)&&(e.globalAlpha=t._pulseIntensity*r,e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",n?e.fill(n):e.fill())}function ea(e,t,n,r){const i=t.filter(e=>"geoarea"===e.type);for(const t of i){if(!t.pathData)continue;t._cachedPath2D||(t._cachedPath2D=new Path2D(t.pathData));const n=t._cachedPath2D,r=Yo(e,t.style.fill)||"#e0e0e0";"none"!==r&&(e.fillStyle=r,e.globalAlpha=(t._decayOpacity??1)*(t.style.fillOpacity??1),e.fill(n));const i=t.style.strokeWidth??.5;if(t.style.stroke&&"none"!==t.style.stroke&&i>0){if(e.strokeStyle=Nn(e,t.style.stroke)||t.style.stroke,e.lineWidth=i,e.globalAlpha=t._decayOpacity??1,t.style.strokeDasharray){const n=t.style.strokeDasharray.split(",").map(Number);e.setLineDash(n)}else e.setLineDash([]);e.stroke(n)}Jo(e,t,n),e.globalAlpha=1,e.setLineDash([])}}function ta(e,t,n){let r=n;for(const n of t)"lesser"===n.thresholdType?n.value>e&&(r=n.color):e>n.value&&(r=n.color);return r}function na(e,t,n,r){if(2>e.length||t.length!==e.length||0===n.length)return[];const i=[],o=(e,t,n)=>{const r=i[i.length-1];r?.color===e?r.path.push(n):i.push({color:e,path:[t,n]})};for(let i=1;e.length>i;i++){const[a,s]=e[i-1],[l,c]=e[i],u=t[i-1],d=t[i]-u,h=[0,...0===d?[]:n.map(({value:e})=>(e-u)/d).filter(e=>e>0&&1>e&&Number.isFinite(e)).sort((e,t)=>e-t).filter((e,t,n)=>0===t||e!==n[t-1]),1];for(let e=1;h.length>e;e++){const t=h[e-1],i=h[e];o(ta(u+d*((t+i)/2),n,r),[a+(l-a)*t,s+(c-s)*t],[a+(l-a)*i,s+(c-s)*i])}}return i}function ra(e,t,n,r,i,o){if(2>t.length)return;const a=[0];for(let e=1;t.length>e;e++){const n=t[e][0]-t[e-1][0],r=t[e][1]-t[e-1][1];a.push(a[e-1]+Math.sqrt(n*n+r*r))}const s=a[a.length-1];if(0===s)return;const l=Math.min(.2*s,40);e.strokeStyle=n,e.lineWidth=r,e.lineCap=o;for(let n=0;t.length-1>n;n++){const r=(a[n]+a[n+1])/2;let o=i;l>r&&(o*=r/l),l>s-r&&(o*=(s-r)/l),e.globalAlpha=Math.max(0,o),e.beginPath(),e.moveTo(t[n][0],t[n][1]),e.lineTo(t[n+1][0],t[n+1][1]),e.stroke()}}function ia(e,t,n,r,i){if(0>=t.size)return;const o=t.glyph;if(!o||!o.parts?.length)return;const a=pn(o,t.size);if(0>=a.scale)return;const s=(t.style.opacity??1)*(t._decayOpacity??1);if(0>=s)return;const l=t=>{const n=Uo(e,t,t);return"string"==typeof n?n:t},c=t.color??("string"==typeof t.style.fill?t.style.fill:void 0);e.save(),e.translate(n,r),t.rotation&&e.rotate(t.rotation),e.translate(a.offsetX,a.offsetY),e.scale(a.scale,a.scale),e.globalAlpha=i*s*(t.style.fillOpacity??1);const u=vn(o,t.fraction??1,t.fractionStart??0,t.fractionDirection??"horizontal");u&&t.ghostColor&&xn(e,o,c,t.accent,t.ghostColor,l),u&&(e.beginPath(),e.rect(u.x,u.y,u.width,u.height),e.clip()),xn(e,o,c,t.accent,void 0,l),e.restore()}function oa(e){const{size:t,scale:n,translate:r,clampX:i=!0,clampY:o=!0}=e,a=Math.max(Math.log(n)/Math.LN2-8,0),s=Math.round(a),l=1<<s,c=Math.pow(2,a-s+8),u=r[0]-n/2,d=r[1]-n/2,h=Math.max(i?0:-1/0,Math.floor((0-u)/c)),f=Math.min(i?l:1/0,Math.ceil((t[0]-u)/c)),p=Math.max(o?0:-1/0,Math.floor((0-d)/c)),m=Math.min(o?l:1/0,Math.ceil((t[1]-d)/c)),g=[];for(let e=p;m>e;++e)for(let t=h;f>t;++t)g.push([t,e,s]);return{tiles:g,translate:[u/c,d/c],scale:c}}function aa([e,t,n]){const r=1<<n;return[e-Math.floor(e/r)*r,t,n]}function sa(e,t,n,r,i){return"function"==typeof e?e(t,n,r,i):e.replace("{z}",t+"").replace("{x}",n+"").replace("{y}",r+"").replace("{r}",i>1?"@2x":"")}function la(e){if("string"==typeof e)return"template:"+e;const t=e;let n=Vp.get(t);return null==n&&(n=Up++,Vp.set(t,n)),"provider:"+n}function ca(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):256}function ua(e,t){const{tileURL:n,projection:r,width:i,height:o,tileCache:a,onTileLoad:s,maxDevicePixelRatio:l}=t,c=r.scale(),u=r.translate(),d=oa({size:[i,o],scale:2*c*Math.PI,translate:u}),h=uo(l,[i,o]),f=la(n);let p=!0;for(const t of d.tiles){const[r,i,o]=aa(t),l=sa(n,o,r,i,h),c=`${f}|dpr:${h}|${o}/${r}/${i}|${l}`;let u=a.get(c);if(!u){const e=new Image;e.crossOrigin="anonymous";const t={img:e,loaded:!1,failed:!1,key:c,lastUsed:performance.now()};a.set(c,t),e.onload=()=>{t.loaded=!0,s?.()},e.onerror=()=>{t.loaded=!0,t.failed=!0,s?.()},e.src=l,u=t}if(!u.loaded){p=!1;continue}if(u.failed)continue;const m=d.scale;e.drawImage(u.img,(t[0]+d.translate[0])*m-.5,(t[1]+d.translate[1])*m-.5,m+1,m+1)}return p}function da(e){let t=0;for(let n=1;e.length>n;n++){const r=e[n][0]-e[n-1][0],i=e[n][1]-e[n-1][1];t+=Math.sqrt(r*r+i*i)}return t}function ha(e,t){let n=0;for(let r=1;e.length>r;r++){const i=e[r][0]-e[r-1][0],o=e[r][1]-e[r-1][1],a=Math.sqrt(i*i+o*o);if(n+a>=t||r===e.length-1){const s=a>0?(t-n)/a:0,l=a>.001?a:1;return{x:e[r-1][0]+i*s,y:e[r-1][1]+o*s,nx:-o/l,ny:i/l}}n+=a}const r=e[e.length-1];return{x:r[0],y:r[1],nx:0,ny:0}}function fa(e,t){return"touch"===t?Math.max(e,24):e}function pa(e){if(!e)return null;if("heatcell"===e.type)return e.fill||null;if("candlestick"===e.type)return e.isUp?e.upColor:e.downColor;const{style:t}=e;if(!t)return null;const n="string"==typeof t.fill?t.fill:null;return"line"===e.type||"area"===e.type?t.stroke||n||null:n||t.stroke||null}function ma(...e){const t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:Zp.createElement(Zp.Fragment,null,...t)}function ga({value:e,children:t}){const n=(_p??(_p=Kp.createContext(null)),_p);/* @__PURE__ */ /* @__PURE__ */
|
|
122
|
+
return(0,Qp.jsx)(n.Provider,{value:e,children:t})}function ya(e,t){return null!=e?/* @__PURE__ */ /* @__PURE__ */(0,Qp.jsx)(ga,{value:t,children:e}):e}function va(e,t){const n="function"==typeof e?e(t.datum??null,t):e;return(r=n)&&"object"==typeof r&&"string"==typeof r.id&&"function"==typeof r.cacheKey&&"function"==typeof r.drawCanvas&&"function"==typeof r.renderStaticSVG?n:void 0;var r}function ba(e,t){if("undefined"!=typeof process&&"production"===process.env?.NODE_ENV)return;const n=`${e}:${t}`;Jp.has(n)||(Jp.add(n),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}function xa(e){const{context:t,nodes:n,renderMode:r,pixelRatio:i,paintBuiltIn:o}=e;if(!r||"sketchy"===r)return void o(n);let a=[];const s=()=>{a.length&&(o(a),a=[])};for(const e of n){const n=va(r,e);if(!n){a.push(e);continue}let l;s(),t.save();try{l=n.drawCanvas({context:t,node:e,style:e.style??{},pixelRatio:i})}finally{t.restore()}l||(ba(n.id,e.type??"unknown"),o([e]))}s()}function wa(e){const{node:t,index:n,renderMode:r,fallback:i}=e,o=va(r,t);if(!o)return{element:i(),renderedByBackend:!1};const a=o.renderStaticSVG({node:t,style:t.style??{},key:`${o.id}-${n}`});return null!=a?{element:no(a,t,`${o.id}-${n}-cursor`),renderedByBackend:!0}:(ba(o.id,t.type??"unknown"),{element:i(),renderedByBackend:!1})}function ka(e){if(!e)return;const t=[];for(const n of e)if("point"===n.type)t.push(n);else if("glyph"===n.type){const e=n,r=bn(e.glyph,e.size);t.push({pointId:e.pointId,x:e.x+r.centerDx,y:e.y+r.centerDy,r:r.radius})}return t}function Sa(e,t){for(const n of t){const t=e.find(e=>e.lower===n);if(t)return t}}function Ma(e,t={}){if(!e||"object"!=typeof e)return{entries:[]};const n=t.maxEntries??6,r=!1!==t.skipPositional,i=[];for(const[t,n]of Object.entries(e)){if(t.startsWith("_"))continue;if("data"===t)continue;const e=t.toLowerCase();if(r&&rm.has(e))continue;if(null==n)continue;const o=typeof n;("string"===o||"number"===o||"boolean"===o||n instanceof Date)&&i.push({key:t,lower:e,value:n})}if(0===i.length)return{entries:[]};let o=i.findIndex(e=>em.includes(e.lower));const a=o>=0;0>o&&(o=i.findIndex(e=>"id"===e.lower)),0>o&&(o=i.findIndex(e=>"string"==typeof e.value));const s=0>o?void 0:i[o],l=i.filter((e,t)=>t!==o&&(!a||"id"!==e.lower)),c=Sa(l,tm),u=Sa(l,nm),d=[];c&&d.push({key:c.key,value:c.value}),u&&d.push({key:u.key,value:u.value});for(const e of l){if(d.length>=n)break;tm.includes(e.lower)||nm.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}function ja(e,t){return"function"==typeof t?t(e):e[t]}function Aa(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e){if(!Number.isFinite(e))return e+"";const t=Number.isInteger(e)?e:parseFloat(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():t+""}if(e instanceof Date)return e.toLocaleDateString();if("object"==typeof e&&null!==e){if(void 0!==e.id)return e.id+"";if(void 0!==e.name)return e.name+"";try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return e+""}function Ca(e={}){const{fields:t,title:n,format:r,style:i={},className:o=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let a;const s=[];if(n){const t=ja(e,n);a=Aa(t,r)}if(t&&t.length>0)t.forEach(t=>{let n,i,o;"string"==typeof t?(n=t,i=t,o=r):(n=t.label,i=t.accessor||t.key||"",o=t.format||r);const a=ja(e,i);s.push({label:n,value:Aa(a,o)})});else if(!n){const t=["value","y","name","id","label"];for(const n of t)if(void 0!==e[n]){a=Aa(e[n],r);break}if(!a){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(a=Aa(e[t[0]],r))}}/* @__PURE__ */ /* @__PURE__ */
|
|
123
|
+
return(0,im.jsxs)(Wo,{className:o,style:i,children:[a&&/* @__PURE__ */ /* @__PURE__ */(0,im.jsx)("div",{style:{fontWeight:s.length>0?"bold":"normal"},children:a}),s.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,im.jsxs)("div",{style:{marginTop:0===t&&a?"4px":0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,im.jsxs)("span",{children:[e.label,": "]}),e.value]},t))]})}}function Ra(e={}){const{fields:t=[],title:n,format:r,style:i={},className:o="",showLabels:a=!0,separator:s=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const l=[];if(n){const t=ja(e,n);l.push({value:Aa(t,r)})}if(t&&Array.isArray(t)&&t.length>0)t.forEach(t=>{let n,i,o;"string"==typeof t?(n=t,i=t,o=r):(n=t.label,i=t.accessor||t.key||"",o=t.format||r);const s=Aa(ja(e,i),o);l.push({label:a?n:void 0,value:s})});else{const t=Ma(e,{skipPositional:!1});null!=t.title&&l.push({label:void 0,value:Aa(t.title,r),bold:!0}),t.entries.forEach(e=>{l.push({label:a?e.key:void 0,value:Aa(e.value,r)})})}return Array.isArray(l)&&0!==l.length?/* @__PURE__ */ /* @__PURE__ */(0,im.jsx)(Wo,{className:("semiotic-tooltip-multiline "+o).trim(),style:i,children:l.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,im.jsxs)("div",{style:{marginBottom:l.length-1>t?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,im.jsxs)("strong",{children:[e.label,s]}),e.value]},t))}):null}}function La(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function Pa(e){if(!0!==e){if("function"==typeof e){const t=e;return e=>{const n=!0===e?.__semioticHoverData||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType);let r=Array.isArray(i=n?e.data??{}:e)?i[0]:i;var i;if(!r)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof r?.x0&&"number"==typeof r?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof r?.sankeyWidth)&&r.data&&"object"==typeof r.data&&(r=r.data),!r)return null;if(n&&(void 0!==e.allSeries||void 0!==e.xValue)){const t={...r};void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),r=t}const o=t(r);return null==o?null:$o(o)?o:/* @__PURE__ */ /* @__PURE__ */(0,im.jsx)(Wo,{children:o})}}if(!1===e||void 0===e)return!1;if(La(e)){if("function"==typeof e.content)return Pa(e.content);"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip={{ mode: "multi" }} reached normalizeTooltip without a chart that wires tooltipMode. Use a line/area-family chart with multi support, or pass frameProps.tooltipMode: "multi" to StreamXYFrame.');const t=Ra();return Pa(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e)){const t=Ca(e);return Pa(e=>t(e))}if("multi"===e){"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&console.warn('[semiotic] tooltip="multi" reached normalizeTooltip on a single-tooltip chart. Rendering multi-field content as a backward-compatible fallback.');const e=Ra();return Pa(t=>e(t))}return Ca()}}function Na({data:e}){if(!e)return null;if(e.properties)/* @__PURE__ */ /* @__PURE__ */
|
|
124
|
+
return(0,om.jsx)("div",{className:"semiotic-tooltip",style:zp,children:/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)("div",{style:{fontWeight:600},children:e.properties.name||e.properties.NAME||e.properties.id||"Feature"})});const t=null!=e.data?e.data:e;if(!t||"object"!=typeof t)return null;const n=Ma(t),r=null!=n.title?n.title+"":null;return null==r&&0===n.entries.length?null:/* @__PURE__ */ /* @__PURE__ */(0,om.jsxs)("div",{className:"semiotic-tooltip",style:zp,children:[null!=r&&/* @__PURE__ */ /* @__PURE__ */(0,om.jsx)("div",{style:{fontWeight:600,marginBottom:n.entries.length?2:0},children:r}),n.entries.map(e=>{/* @__PURE__ */ /* @__PURE__ */return(0,om.jsxs)("div",{children:[
|
|
125
|
+
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */(0,om.jsxs)("span",{style:{opacity:.7},children:[e.key,": "]}),
|
|
127
|
+
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */(0,om.jsx)("span",{style:{fontWeight:600},children:(t=e.value,null==t?"–":"number"==typeof t?Math.abs(t)>9999?t.toLocaleString():t+"":t instanceof Date?t.toLocaleDateString():t+"")})]},e.key);var t})]})}function Ea(){if(null!==sm)return sm;if("undefined"==typeof window)return!1;const e="function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,t="undefined"!=typeof navigator&&"number"==typeof navigator.hardwareConcurrency&&4>=navigator.hardwareConcurrency,n="undefined"!=typeof navigator&&"number"==typeof navigator.deviceMemory&&4>=navigator.deviceMemory;return sm=e||t||n}function Ia(){return Ea()?12:30}function Ta(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function Da(e){return e?e.getContext("2d"):null}function za(e){const t=e.pointer.clientX-e.canvasRect.left-e.margin.left,n=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(0>t||t>e.width||0>n||n>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const r=Da(e.hitCanvasRef.current);if(!r)return{kind:"unavailable"};const i=wn(e.scene,t,n,fa(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,fa(6,e.pointer.pointerType));if(!i)return{kind:"miss"};const{node:o}=i,a=o.datum,s=Array.isArray(a)?null:a?.properties?a:a?.data||a,l="point"===o.type?o.x:"geoarea"===o.type?o.centroid[0]:t,c="point"===o.type?o.y:"geoarea"===o.type?o.centroid[1]:n;return{kind:"hit",node:o,hover:{...s,...s?.properties||{},data:s,properties:s?.properties,__semioticHoverData:!0,x:l,y:c}}}function _a(e){const t=e.target;return t instanceof Element&&t!==e.currentTarget&&null!=t.closest("button, a[href], input, select, textarea, summary, [contenteditable='true'], [role='button'], [role='link'], [role='checkbox'], [role='radio'], [role='switch']")}function Oa(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"hover",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"focus"===s?.type&&t({type:"focus",datum:n,inputType:"touch"===s.inputType?"pointer":s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"hover-end",timestamp:l,chartType:o,chartId:a}))}function Fa(e){const{onObservation:t,datum:n,x:r=0,y:i=0,chartType:o,chartId:a,context:s,timestamp:l=Date.now()}=e;t&&(n?(t({type:"click",datum:n,x:r,y:i,timestamp:l,chartType:o,chartId:a}),"activate"===s?.type&&t({type:"activate",datum:n,inputType:s.inputType,timestamp:l,chartType:o,chartId:a})):t({type:"click-end",timestamp:l,chartType:o,chartId:a}))}function Wa({customHoverBehavior:e,customClickBehavior:t,onObservation:n,chartId:r,chartType:i}){const o=!(!e&&!n),a=!(!t&&!n),s=(0,cm.useCallback)((t,o)=>{e?.(t,o),Oa({onObservation:n,datum:t?t.data||t:null,x:t?.x,y:t?.y,chartType:i,chartId:r,context:o})},[r,i,e,n]),l=(0,cm.useCallback)((e,o)=>{t?.(e,o),Fa({onObservation:n,datum:e?e.data||e:null,x:e?.x,y:e?.y,chartType:i,chartId:r,context:o})},[r,i,t,n]);return{customHoverBehavior:o?s:void 0,customClickBehavior:a?l:void 0,hasClickBehavior:a}}function Ba(e){const t=[];for(const n of e)if("point"===n.type&&null!=n.x&&!1!==n.interactive)t.push({x:n.x,y:n.y,datum:n.datum,shape:"circle"});else if("glyph"===n.type){if(0>=n.size||null==n.datum)continue;const e=bn(n.glyph,n.size);t.push({x:n.x+e.centerDx,y:n.y+e.centerDy,datum:n.datum,shape:"rect",w:2*e.halfWidth,h:2*e.halfHeight})}else"geoarea"===n.type&&n.centroid&&!1!==n.interactive&&t.push({x:n.centroid[0],y:n.centroid[1],datum:n.datum,shape:"geoarea",pathData:n.pathData});return t.sort((e,t)=>e.x-t.x||e.y-t.y),t}function Ha(e,t,n){switch(e){case"ArrowRight":case"ArrowDown":return n-1>t?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":return Math.min(t+Math.max(1,Math.floor(.1*n)),n-1);case"PageUp":return Math.max(t-Math.max(1,Math.floor(.1*n)),0);case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}function $a(e){const t=e.datum;return{...t||{},...t?.properties||{},data:t,properties:t?.properties,x:e.x,y:e.y,__semioticHoverData:!0}}function qa({storeRef:e,hoverRef:t,hoveredNodeRef:n,setHoverPoint:r,customHoverBehavior:i,customClickBehavior:o,scheduleRender:a}){const s=(0,um.useRef)(-1),l=(0,um.useRef)(null),c=(0,um.useCallback)(c=>{if(_a(c))return;const u=e.current;if(!u)return;const d=()=>{s.current=-1,l.current=null,t.current=null,n&&(n.current=null),r(null),i?.(null),a()};if(0===u.scene.length)return void(0>s.current||d());const h=Ba(u.scene);if(0===h.length)return void(0>s.current||d());let f=s.current;if(h.length>f||(d(),f=-1),("Enter"===c.key||" "===c.key)&&f>=0)return c.preventDefault(),void o?.($a(h[f]),{type:"activate",inputType:"keyboard"});const p=Ha(c.key,0>f?-1:f,h.length);if(null===p)return;if(c.preventDefault(),0>p)return void d();const m=0>f?0:p;s.current=m;const g=h[m];l.current=g;const y=$a(g);t.current=y,r(y),i?.(y,{type:"focus",inputType:"keyboard"}),a()},[o,i,t,n,a,r,e]);return{kbFocusIndexRef:s,focusedNavPointRef:l,onKeyDown:c}}function Ga(e,t,n,r){return"function"==typeof e?e({size:t,margin:n,scales:r}):e}function Va({foregroundGraphics:e,backgroundGraphics:t,size:n,margin:r,scales:i,background:o,themeBackgroundColor:a,resolveScaleAwareGraphics:s=!0}){const l=`var(--semiotic-bg, ${a})`;return{resolvedForeground:s||"function"!=typeof e?Ga(e,n,r,i):null,resolvedBackground:s||"function"!=typeof t?Ga(t,n,r,i):null,themeBackground:l,surfaceBackground:wo({background:o,hasBackgroundGraphics:!!t,themeBackground:l})}}function Ua(e){const t=/* @__PURE__ */new Set;let n=0,r=e;return{subscribe:e=>(t.add(e),()=>t.delete(e)),getSnapshot:()=>n,sync(e){if(e!==r){r=e,n+=1;for(const e of t)e()}}}}function Ya({graphics:e,size:t,margin:n,readScales:r,tracker:i}){return(0,fm.useSyncExternalStore)(i.subscribe,i.getSnapshot,i.getSnapshot),hm.createElement(hm.Fragment,null,Ga(e,t,n,r()))}function Xa({tracker:e,readScales:t,...n}){const r=r=>"function"==typeof r?hm.createElement(Ya,{graphics:r,size:n.size,margin:n.margin,readScales:t,tracker:e}):r;return{...Va({...n,resolveScaleAwareGraphics:!1}),resolvedForeground:r(n.foregroundGraphics),resolvedBackground:r(n.backgroundGraphics)}}function Za(e,t,n){const r=e.current;r.inside=!0,r.clientX=t.clientX,r.clientY=t.clientY,r.pointerType=t.pointerType??n}function Ka(e){var t,n,r;n=e.pointer,r=t=>{const n=za({pointer:t,canvasRect:e.canvas.getBoundingClientRect(),margin:e.margin,width:e.width,height:e.height,scene:e.store.scene,pointQuadtree:e.geometryMoved?null:e.store.quadtree,maxPointRadius:e.store.maxPointRadius,hitCanvasRef:e.hitCanvasRef});return"hit"===n.kind?Qi(n.node):void 0},(t=e.canvas)&&(n.inside&&"touch"!==n.pointerType?eo(t,r(n)):eo(t))}function Qa(e,t){return e?!0===e?{name:"hover",fields:t||[]}:"string"==typeof e?{name:e,fields:t||[]}:{name:e.name||"hover",fields:e.fields||t||[],mode:e.mode,xField:e.xField,seriesField:e.seriesField}:null}function Ja(e,t,n,r){if(!t)return e;const i=(i,...o)=>{const a={...e(i,...o)};if(t.isActive)if(t.predicate(r?r(i):i))n?.selectedStyle&&Object.assign(a,n.selectedStyle);else{const e=n?.unselectedOpacity??xm;a.opacity=e,a.fillOpacity=e,a.strokeOpacity=e,n?.unselectedStyle&&Object.assign(a,n.unselectedStyle)}return a};return o=i,a=[i],a?.length?(Object.defineProperty(o,dm,{configurable:!0,enumerable:!1,value:a}),o):o;var o,a}function es(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ts(e){if("number"==typeof e.height&&e.height>0)return e.height>e.width?"portrait":"landscape"}function ns(e){if("number"==typeof e.height&&e.height>0)return e.width/e.height}function rs(e,t){const{when:n}=e,r=t.width,i=t.height,o=ns(t),a=ts(t);return!("number"==typeof n.minWidth&&n.minWidth>r||"number"==typeof n.maxWidth&&r>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof i||n.minHeight>i)||"number"==typeof n.maxHeight&&("number"!=typeof i||i>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||n.minAspectRatio>o)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function is(e,t){const n={...e,...t};for(const r of["margin","frameProps","mobileSemantics","style"])es(e[r])&&es(t[r])&&(n[r]={...e[r],...t[r]});return"string"==typeof e.className&&"string"==typeof t.className&&(n.className=`${e.className} ${t.className}`),n}function os(e,t,n=e.responsiveRules){if(!Array.isArray(n)||0===n.length)return{props:e,matches:[]};const r=n.map((e,t)=>({rule:e,index:t})).filter(e=>rs(e.rule,t)).sort((e,t)=>("number"==typeof e.rule.priority?e.rule.priority:e.index)-("number"==typeof t.rule.priority?t.rule.priority:t.index));return{props:r.reduce((e,t)=>is(e,t.rule.transform),e),matches:r}}function as(e,t={}){const n=t.mobileSemantics?.interaction,r="number"==typeof n?.targetSize?n.targetSize:"number"==typeof t.mobileSemantics?.minimumHitTarget?t.mobileSemantics.minimumHitTarget:void 0,i="mobile"===t.mode||"number"==typeof t.width&&480>=t.width,o=!!n||void 0!==r,a=e&&"object"==typeof e?e:void 0;if(!1===e||!1===a?.enabled||void 0===e&&!i&&!o)return Am;const s=a??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??r??jm,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??jm,standardControls:s.standardControls??!1}}function ss(e,t,n){const r=Cm[e||"primary"],i=e&&"primary"!==e||!n?.width?r.width:n.width,o=e&&"primary"!==e||!n?.height?r.height:n.height,a=os({...t,mode:e},{width:t.width??i,height:t.height??o}).props,s=a.mode||e||"primary",l=Cm[s],c="context"===s||"sparkline"===s,u="primary"===s&&n?.width?n.width:l.width;return{mode:s,width:a.width??u,height:a.height??("primary"===s&&n?.height?n.height:l.height),showAxes:a.showAxes??l.showAxes,showGrid:a.showGrid??l.showGrid,enableHover:a.enableHover??(!!a.linkedHover||l.enableHover),showLegend:a.showLegend??l.showLegend,showLabels:a.showLabels??l.showLabels,title:c?void 0:a.title,description:a.description,summary:a.summary,accessibleTable:a.accessibleTable,xLabel:c?void 0:a.xLabel,yLabel:c?void 0:a.yLabel,categoryLabel:c?void 0:a.categoryLabel,valueLabel:c?void 0:a.valueLabel,marginDefaults:cs(l.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:as(a.mobileInteraction,{mode:s,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}function ls(e){return e.compactMode?e.marginDefaults:Rm}function cs(e,t,n){if(!1!==t)return e;const r={...e};return"horizontal"===n?r.left=Math.min(r.left,15):r.bottom=Math.min(r.bottom,15),r}function us(e,t,n){const r=e.xValue??t?.[n];if(null==r)return null;const i=Number(r);return Number.isFinite(i)?i:null}function ds(e){let t=e.data||e.datum||e;return Array.isArray(t)&&(t=t[0]),null!=e.xValue&&t&&"object"==typeof t&&!Array.isArray(t)&&null==t.xValue?{...t,xValue:e.xValue}:t||{}}function hs(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function fs(e){const t=/* @__PURE__ */new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function ps(e,t){if(e.length!==t.length)return!1;for(let n=0;e.length>n;n++)if(e[n]!==t[n])return!1;return!0}function ms(e){const t=(0,Pm.useContext)(Em),n=(0,Pm.useId)(),r=fs(e),i=(0,Pm.useRef)([]);ps(i.current,r)||(i.current=r);const o=i.current;Im(()=>{if(t)return()=>t.unregisterCategories(n)},[t,n]),Im(()=>{t&&t.registerCategories(n,o)},[t,n,o])}function gs({data:e,colorBy:t,colorScale:n,getColor:r,strokeColor:i,strokeWidth:o,categories:a}){return{legendGroups:[{styleFn:e=>{const t=e.color||"#333",n={fill:t,stroke:t};return void 0!==i&&(n.stroke=i),void 0!==o&&(n.strokeWidth=o),n},type:"fill",items:(void 0!==a?a:Array.from(new Set(e.map(e=>"function"==typeof t?t(e):e[t])))).map((i,o)=>{const a=e.find("function"==typeof t?e=>t(e)===i:e=>e[t]===i),s=a?r(a,t,n):n?n(i):Bd[o%Bd.length];return{label:i+"",color:s,__semioticCategory:!0}}),label:""}]}}function ys(e,t){if(!t)return[];const n=/* @__PURE__ */new Set;for(const r of e){const e="function"==typeof t?t(r):r[t];null!=e&&n.add(e+"")}return Array.from(n)}function vs(e,t){return null!=e&&Object.hasOwn(e,t)}function bs(e,t,n){const r=vs(n,"legendPosition"),i=vs(n,"legendLayout");return{legendPosition:r?n?.legendPosition??"right":e??"right",legendLayout:i?n?.legendLayout:t}}function xs({data:e,colorBy:t,colorScale:n,showLegend:r,legendPosition:i,userMargin:o,defaults:a={top:50,bottom:60,left:70,right:40},categories:s,additionalLegend:l,chartWidth:c,chartHeight:u,legendLayout:d,frameLegend:h,hasTitle:f=!1,axisChrome:p}){const{legendPosition:m,legendLayout:g}=bs(i,d,h),y=vs(h,"legend"),v=(0,Pm.useContext)(Nm),b=null!==(0,Pm.useContext)(Em),x=void 0!==r?r:!v&&!!t,w=!!t&&(x||b),k=(0,Lm.useMemo)(()=>w?void 0!==s?s:ys(e,t):[],[s,t,e,w]);ms(b&&t?k:[]);const S=(0,Lm.useMemo)(()=>{if(!x||!t)return;const r=gs({data:e,colorBy:t,colorScale:n,getColor:wt,categories:k});return 0!==r.legendGroups.reduce((e,t)=>e+t.items.length,0)?r:void 0},[x,t,e,n,k]),M=(0,Lm.useMemo)(()=>y?h?.legend:_n(S,l),[S,l,h?.legend,y]),{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:R,leftAxis:L,rightAxis:P}=p??{},N=void 0!==R,E=void 0!==L,I=void 0!==P,{hasAxis:T,hasAxisLabel:D,rotatedTicks:z}=R??{},{hasAxis:_,hasAxisLabel:O}=L??{},{hasAxis:F,hasAxisLabel:W}=P??{},B=(0,Lm.useMemo)(()=>{const e="number"==typeof o?{top:o,bottom:o,left:o,right:o}:o??{},t=Jn(a,h?.axes,f),n=n=>{const r=e[n];return"number"==typeof r?r:t[n]},r={top:n("top"),right:n("right"),bottom:n("bottom"),left:n("left")},i={...r};return M&&(Xn(r,{legend:M,position:m,size:[c??600,u??400],hasTitle:f,legendLayout:g,minimumMargin:"bottom"===m?80:"top"===m?50:0,axisChrome:void 0===j?{hasAxis:!0,hasAxisLabel:!0}:{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:N?{hasAxis:T,hasAxisLabel:D,rotatedTicks:z}:void 0,leftAxis:E?{hasAxis:_,hasAxisLabel:O}:void 0,rightAxis:I?{hasAxis:F,hasAxisLabel:W}:void 0}}),null!=c&&null!=u&&Wn(r,i,[c,u],m)),r},[a,h?.axes,o,M,m,c,u,g,f,j,A,C,N,T,D,z,E,_,O,I,F,W]);return{legend:M,margin:B,legendPosition:m,legendLayout:g,legendMarginReserved:void 0!==M&&!vs(h,"margin"),hasAutomaticLegend:void 0!==S}}function ws(e){const t=e.valueRange;return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]?[t[0],t[1]]:null}function ks(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function Ss(e,t,n,r=!0,i=!1){const[o,a]=(0,Lm.useState)(null),[s,l]=(0,Lm.useState)(
|
|
129
|
+
/* @__PURE__ */new Set),c=(0,Lm.useMemo)(()=>/* @__PURE__ */new Set,[]),u=(0,Lm.useMemo)(()=>new Set(n),[n]),d=null!=o&&u.has(o)?o:null,h=(0,Lm.useMemo)(()=>{if(0===s.size)return s;const e=new Set(Array.from(s).filter(e=>u.has(e)));return 0===e.size||e.size===u.size?c:e.size===s.size?s:e},[u,c,s]);(0,Lm.useEffect)(()=>{r&&t&&e&&"none"!==e||(a(null),l(e=>0===e.size?e:/* @__PURE__ */new Set))},[t,r,e]),(0,Lm.useEffect)(()=>{a(e=>null==e||u.has(e)?e:null),l(e=>{if(0===e.size)return e;const t=new Set(Array.from(e).filter(e=>u.has(e)));return 0===t.size||t.size===u.size?/* @__PURE__ */new Set:t.size===e.size?e:t})},[u]);const f=(0,Lm.useCallback)(t=>{r&&"highlight"===e&&a(!t||!u.has(t.label)||i&&!0!==t.__semioticCategory?null:t.label)},[u,r,e,i]),p=(0,Lm.useCallback)(t=>{!r||"isolate"!==e||!u.has(t.label)||i&&!0!==t.__semioticCategory||l(e=>{const n=new Set(Array.from(e).filter(e=>u.has(e)));return n.has(t.label)?n.delete(t.label):n.add(t.label),n.size===u.size?/* @__PURE__ */new Set:n})},[u,r,e,i]),m=(0,Lm.useMemo)(()=>{if(!r||!e||"none"===e||!t)return null;const n=e=>{const n="function"==typeof t?t(e):e[t];return"string"==typeof n?n:n+""};return"highlight"===e&&null!=d?{isActive:!0,predicate:e=>n(e)===d}:"isolate"===e&&h.size>0?{isActive:!0,predicate:e=>h.has(n(e))}:null},[t,r,e,d,h]);return{highlightedCategory:r&&"highlight"===e?d:null,isolatedCategories:r&&"isolate"===e?h:c,onLegendHover:f,onLegendClick:p,legendSelectionHook:m}}function Ms(e,t,n,r=5){const[i,o]=n,[a,s]=(0,Lm.useState)(null),[l,c]=(0,Lm.useState)(/* @__PURE__ */new Map),u=(0,Lm.useMemo)(()=>/* @__PURE__ */new Set,[]);(0,Lm.useEffect)(()=>{s(null),c(/* @__PURE__ */new Map)},[i,o,r,e]);const d=(0,Lm.useCallback)(t=>{if("highlight"!==e||!t)return void("highlight"===e&&s(null));const n=ws(t);n&&s({key:ks(t,n),range:n})},[e]),h=(0,Lm.useCallback)(t=>{if("isolate"!==e)return;const n=ws(t);n&&c(e=>{const i=new Map(e),o=ks(t,n);return i.has(o)?i.delete(o):i.set(o,n),i.size===r?/* @__PURE__ */new Map:i})},[r,e]),f=(0,Lm.useMemo)(()=>{const n="highlight"===e&&a?[a.range]:"isolate"===e?[...l.values()]:[];return 0===n.length?null:{isActive:!0,predicate:e=>{const r=t(e);return Number.isFinite(r)&&n.some(([e,t])=>r>=Math.min(e,t)&&Math.max(e,t)>=r)}}},[a,l,e,t]);return{highlightedCategory:"highlight"===e?a?.key??null:null,isolatedCategories:"isolate"===e?new Set(l.keys()):u,onLegendHover:d,onLegendClick:h,legendSelectionHook:f}}function js(){const e=(0,Mm.useTheme)(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function As(){const e=(0,Mm.useTheme)();return e?.colors?.sequential||void 0}function Cs(e,t,n){const r=(0,bm.useCategoryColors)(),i=js();return(0,vm.useMemo)(()=>{if(!t)return;const o=r??void 0,a=n??(i&&i.length>0?i:void 0)??"category10";if(0!==e.length){if("function"==typeof t){const n=Array.from(new Set(e.map(e=>t(e)+"")));if(o&&hs(o)){const e=St(n.map(e=>({_cat:e})),"_cat",a);return t=>kt(o,t)??e(t)}return St(n.map(e=>({_cat:e})),"_cat",a)}if(o&&hs(o)){const n=St(e,t,a);return e=>kt(o,e)??n(e)}return St(e,t,a)}if(o&&hs(o)){const e=St([{_:"a"}],"_",a);return t=>kt(o,t)??e(t)}},[e,t,n,r,i])}function Rs({selection:e,linkedHover:t,fallbackFields:n=Tm,unwrapData:r=!1,onObservation:i,chartType:o,chartId:a,onClick:s,hoverHighlight:l,colorByField:c,mobileInteraction:u,emitObservations:d=!0}){const h=(0,vm.useId)(),f=(0,vm.useMemo)(()=>Qa(t,n),[t,n]),p=(0,vm.useMemo)(()=>"series"===f?.mode?[f.seriesField||c||n[0]].filter(e=>!!e):f?.fields||n,[f,c,n]),m=(0,wm.useSelection)({name:e?.name||"__unused__",fields:p}),g=(0,wm.useLinkedHover)({name:f?.name||"hover",fields:p}),y=(0,Sm.useObservationSelector)(e=>e.pushObservation),v=(0,vm.useCallback)(e=>{i?.(e),y?.(e)},[i,y]),b=e?{isActive:m.isActive,predicate:m.predicate}:null,[x,w]=(0,vm.useState)(null),k=(0,vm.useRef)(!1),S=c||n[0],M=(0,vm.useMemo)(()=>{if(!l||null==x||!S)return null;const e=x,t=S;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:(n[t]??"")+"")===e}},[l,x,S]),j=(0,vm.useCallback)((e,n)=>{const r=!e&&k.current&&!!u?.enabled&&u.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===f?.mode&&f.xField){const n=us(e,t,f.xField);null!=n&&(0,km.setCrosshairPosition)(f.name||"hover",n,h)}"x-position"!==f?.mode&&g.onHover(t)}else"x-position"!==f?.mode||r||(0,km.clearCrosshairPosition)(f.name||"hover",h),"x-position"===f?.mode||r||g.onHover(null);if(l&&S)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[S];w(null!=n?n+"":null)}else r||w(null);d&&(i||y)&&Oa({onObservation:v,datum:e?ds(e):null,x:e?.x,y:e?.y,chartType:o||"unknown",chartId:a,context:n})},[t,g,f,h,i,o,a,y,v,d,l,S,u]),A=(0,vm.useCallback)((n=!0)=>{k.current=!1,t&&"x-position"!==f?.mode&&g.onHover(null),e&&u?.tapToSelect&&m.clear(),n&&l&&w(null),"x-position"===f?.mode&&((0,km.unlockCrosshair)(f.name||"hover",h),(0,km.clearCrosshairPosition)(f.name||"hover",h))},[t,f,g,e,u,m,l,h]),C=(0,vm.useCallback)((n,r)=>{const c=!!u?.enabled&&(u.tapToLockTooltip||u.tapToSelect),b=!!u?.enabled&&"backgroundTap"===u.clearSelection;if("x-position"===f?.mode&&f.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=us(n,e,f.xField);null!=t&&(0,km.toggleCrosshairLock)(f.name||"hover",t,h)}if(c)if(n){k.current=!0;const r=ds(n);if(t&&"x-position"!==f?.mode&&g.onHover(r),e&&u?.tapToSelect&&p.length>0){const e={};for(const t of p){const n=r[t];void 0!==n&&(e[t]=[n])}hs(e)&&m.selectPoints(e)}if(l&&S){const e=r?.[S];w(null!=e?e+"":null)}}else b&&A();if(n||b){if(n&&s){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]),s(e,{x:n.x??0,y:n.y??0})}d&&(i||y)&&Fa({onObservation:v,datum:n?ds(n):null,x:n?.x,y:n?.y,chartType:o||"unknown",chartId:a,context:r})}},[s,d,i,y,v,o,a,f,h,u,t,g,e,m,p,l,S,A]);return(0,vm.useEffect)(()=>{if(!u?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&k.current&&A()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u?.enabled,A]),(0,vm.useEffect)(()=>()=>{k.current&&A(!1)},[A]),(0,vm.useEffect)(()=>{if("x-position"!==f?.mode)return;const e=f.name||"hover";return()=>{(0,km.unlockCrosshair)(e,h),(0,km.clearCrosshairPosition)(e,h)}},[f?.mode,f?.name,h]),{activeSelectionHook:b,hoverSelectionHook:M,customHoverBehavior:j,customClickBehavior:C,crosshairSourceId:h}}function Ls(e,t){const n="object"==typeof e&&null!==e?e:void 0;if("x-position"===n?.mode)return{linkedCrosshairName:n.name||"hover",linkedCrosshairSourceId:t}}function Ps(e,t,n){return ss(e,t,n)}function Ns(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}function Es(e,t){if(!Ns(t))return e??((...e)=>({}));const n={};return void 0!==t.stroke&&(n.stroke=t.stroke),void 0!==t.strokeWidth&&(n.strokeWidth=t.strokeWidth),void 0!==t.opacity&&(n.opacity=t.opacity),e?(...t)=>({...e(...t)||{},...n}):(...e)=>({...n})}function Is(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>Ds(t(e))}function Ts(e,t){const n=Is(t??"value"),r=null==e?void 0:"function"==typeof e?e:t=>t[e];return e=>{const t=r?r(e):void 0;return{value:n(e),category:null==t?void 0:t+""}}}function Ds(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e&&""!==e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function zs(e,t,n){const r=null!=e.axis?n[e.axis]:null!=e.field?t[e.field]:n.value;if(void 0!==e.eq&&r!==e.eq)return!1;if(void 0!==e.ne&&r===e.ne)return!1;if(void 0!==e.in&&!e.in.includes(r))return!1;if(void 0===e.gt&&void 0===e.gte&&void 0===e.lt&&void 0===e.lte&&void 0===e.within&&void 0===e.outside)return!0;const i=Ds(r);if(void 0===i)return!1;if(void 0!==e.gt&&e.gt>=i)return!1;if(void 0!==e.gte&&e.gte>i)return!1;if(void 0!==e.lt&&i>=e.lt)return!1;if(void 0!==e.lte&&i>e.lte)return!1;if(void 0!==e.within){const[t,n]=e.within;if(t>i||i>n)return!1}if(void 0!==e.outside){const[t,n]=e.outside;if(i>=t&&n>=i)return!1}return!0}function _s(e,t,n){const r=e.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(t,n):zs(r,t,n))}function Os(e,t,n){if(!t||0===t.length)return{};let r={};for(const i of t){if(!_s(i,e,n))continue;const t="function"==typeof i.style?i.style(e,n):i.style;t&&(r={...r,...t})}return r}function Fs(e,t,n,r=e=>e){const i=e??(()=>({}));return t&&0!==t.length?(e,o)=>{const a=r(e),s={...i(e,o)};return Object.assign(s,Os(a,t,n(a,o))),s}:i}function Ws({componentName:e,message:t,diagnosticHint:n,width:r,height:i}){/* @__PURE__ */ /* @__PURE__ */
|
|
130
|
+
return(0,Dm.jsx)("div",{role:"alert",style:{width:r,height:Math.max(i,120),display:"flex",alignItems:"center",justifyContent:"center",border:"1px dashed rgba(128, 128, 128, 0.4)",borderRadius:8,background:"rgba(128, 128, 128, 0.04)",padding:24,boxSizing:"border-box"},children:/* @__PURE__ */ /* @__PURE__ */(0,Dm.jsxs)("div",{style:{textAlign:"center",maxWidth:400},children:[
|
|
131
|
+
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */(0,Dm.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),
|
|
133
|
+
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */(0,Dm.jsx)("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t}),n&&/* @__PURE__ */ /* @__PURE__ */(0,Dm.jsx)("div",{"data-testid":"semiotic-diagnostic-hint",style:{marginTop:10,padding:"8px 12px",background:"rgba(128, 128, 128, 0.06)",borderRadius:4,fontSize:12,color:"rgba(128, 128, 128, 0.8)",fontFamily:"monospace",textAlign:"left",whiteSpace:"pre-wrap",lineHeight:1.6},children:n})]})})}function Bs({componentName:e,width:t,height:n,children:r}){/* @__PURE__ */ /* @__PURE__ */
|
|
135
|
+
return(0,Fm.jsx)(Om,{fallback:r=>/* @__PURE__ */ /* @__PURE__ */(0,Fm.jsx)(Ws,{componentName:e,message:r.message,width:t,height:n}),children:r})}function Hs(e,t,n,r){return!1===r||null==e||Array.isArray(e)&&e.length>0?null:Array.isArray(e)?/* @__PURE__ */ /* @__PURE__ */(0,Fm.jsx)("div",{style:{...Bm,width:t,height:n},children:r||"No data available"}):null}function $s(e,t,n,r){if(!e)return null;if(!1===r)return null;if(null!=r)/* @__PURE__ */ /* @__PURE__ */
|
|
136
|
+
return(0,Fm.jsx)("div",{style:{width:t,height:n,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},children:r});const i=Math.min(5,Math.floor(n/40)),o=Math.max(8,Math.floor(n/(3*i))),a=Math.max(6,Math.floor(n/(2.5*i))),s=Math.floor((n-(i*(o+a)-a))/2);/* @__PURE__ */ /* @__PURE__ */
|
|
137
|
+
return(0,Fm.jsx)("div",{style:{width:t,height:n,position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:Array.from({length:i},(e,n)=>/* @__PURE__ */ /* @__PURE__ */(0,Fm.jsx)("div",{className:"semiotic-loading-bar",style:{...Hm,position:"absolute",top:s+n*(o+a),left:Math.floor(.1*t),width:30+(37*n+13)%50+"%",height:o,opacity:.5+n%2*.2}},n))})}function qs(e,t,n,r){if(!Wm)return;if(!t||0===t.length)return;if("string"!=typeof r)return;const i=t[0];if(!i||"object"!=typeof i)return;if(r in i)return;const o=Object.keys(i).join(", ");console.warn(`[semiotic] ${e}: ${n} "${r}" not found in data. Available keys: ${o}`)}function Gs(e){const t=(0,qm.useThemeSelector)(e=>e.theme.colors.selectionOpacity);return(0,$m.useMemo)(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}function Vs(e){return"default"in e?e.default:e}async function Us(e){try{switch(e){case"world-110m":return{topology:Vs(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:Vs(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:Vs(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:Vs(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){if(/Cannot find module|Failed to resolve|world-atlas/i.test(t instanceof Error?t.message:t+""))throw Error(`resolveReferenceGeography("${e}"): ${Xm}`,{cause:t});throw t}}async function Ys(e){const t=Ym.get(e);if(t)return t;const{topology:n,objectName:r}=await Us(e);if(!n||!n.objects)throw Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof n} with keys: ${n?Object.keys(n).join(", "):"none"}`);const i=(0,Um.feature)(n,n.objects[r]),o="features"in i?i.features:[i];return Ym.set(e,o),o}function Xs(e){const t=(0,Vm.useMemo)(()=>Array.isArray(e)?e:void 0,[e]),[n,r]=(0,Vm.useState)(null);return(0,Vm.useEffect)(()=>{if(e&&!Array.isArray(e)){if("string"==typeof(t=e)&&["world-110m","world-50m","land-110m","land-50m"].includes(t)){let t=!1;return r(null),Ys(e).then(e=>{t||r(e)}),()=>{t=!0}}var t;"production"!==process.env.NODE_ENV&&console.warn(`[semiotic] Unknown areas reference: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`),r(null)}else r(null)},[e]),void 0!==t?t:n}function Zs(e){const{title:t,description:n,summary:r,accessibleTable:i,className:o,animate:a,maxDevicePixelRatio:s,axisExtent:l,autoPlaceAnnotations:c}=e,u={};return t&&(u.title=t),n&&(u.description=n),r&&(u.summary=r),void 0!==i&&(u.accessibleTable=i),o&&(u.className=o),null!=a&&(u.animate=a),void 0!==s&&(u.maxDevicePixelRatio=s),void 0!==l&&(u.axisExtent=l),void 0!==c&&(u.autoPlaceAnnotations=c),u}function Ks(e){const{linkedHover:t,selection:n,onObservation:r,onClick:i,hoverRadius:o,hoverHighlight:a,forceHoverBehavior:s,forceClickBehavior:l,mobileInteraction:c,customHoverBehavior:u,customClickBehavior:d,linkedHoverInClickPredicate:h=!0}=e,f={};r&&(f.annotationObservationCallback=r);const p=c?.enabled?Math.max(o??30,Math.ceil((c.targetSize||44)/2),24):o;return(s||t||r||i||a)&&(f.customHoverBehavior=u),d&&(l||(h?r||i||t:r||i)||c?.enabled&&(c.tapToSelect||c.tapToLockTooltip)&&(t||a||n))&&(f.customClickBehavior=d),null!=p&&(f.hoverRadius=p),f}function Qs(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function Js(e){const t=Ps(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),n=As(),{areas:r,valueAccessor:i,styleRules:o,colorScheme:a,projection:s="equalEarth",graticule:l,fitPadding:c,zoomable:u,zoomExtent:d,onZoom:h,dragRotate:f,tileURL:p,tileAttribution:m,tileCacheSize:g,tooltip:y,areaOpacity:v=1,annotations:b,legendInteraction:x,legendPosition:w,margin:k,className:S,selection:M,linkedHover:j,onObservation:A,onClick:C,chartId:R,loading:L,loadingContent:P,emptyContent:N,frameProps:E={},stroke:I,strokeWidth:T,opacity:D}=e,z=u??!!p,_=Xs(r),O=(0,ym.useMemo)(()=>_?on(_):_,[_]),F=(0,ym.useMemo)(()=>"function"==typeof i?i:e=>e?.properties?.[i]??e?.[i],[i]),W=a??n??"blues",B=(0,ym.useMemo)(()=>{if(!O)return(0,Gm.scaleSequential)(vt(void 0)).domain([0,1]);let e=1/0,t=-1/0;for(const n of O){const r=F(n);null!=r&&isFinite(r)&&(e>r&&(e=r),r>t&&(t=r))}const n=vt(W);return(0,Gm.scaleSequential)(n).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[O,F,W]),H=(0,ym.useMemo)(()=>{const e=B.domain();return[e[0]??0,e[1]??1]},[B]),$=Ms(x,F,H),{activeSelectionHook:q,hoverSelectionHook:G,customHoverBehavior:V,customClickBehavior:U}=Rs({selection:M,linkedHover:j,onObservation:A,onClick:C,chartType:"ChoroplethMap",chartId:R,mobileInteraction:t.mobileInteraction}),Y=Gs(M),X=G||$.legendSelectionHook||q,Z=(0,ym.useMemo)(()=>{const e=Es(Fs(e=>{const t=F(e);return{fill:null!=t&&isFinite(t)?B(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:v}},o,e=>({value:F(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),{stroke:I,strokeWidth:T,opacity:D});return X?Ja(e,X,Y,Qs):e},[F,B,X,Y,v,I,T,D,o]),K=(0,ym.useMemo)(()=>e=>{const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",n=F(e);/* @__PURE__ */ /* @__PURE__ */
|
|
138
|
+
return(0,Zm.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
|
|
139
|
+
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */(0,Zm.jsx)("div",{style:{fontWeight:600},children:t}),null!=n&&/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)("div",{style:{opacity:.7},children:(r=n,"number"==typeof r&&isFinite(r)?Number.isInteger(r)?r.toLocaleString():r.toLocaleString(void 0,{maximumFractionDigits:2}):(r??"")+"")})]});var r},[F]),Q=ls(t),J=(0,ym.useMemo)(()=>{if(!1!==t.showLegend)return{gradient:{colorFn:e=>B(e),domain:H,label:"string"==typeof i?i:"value"}}},[B,t.showLegend,i,H]),{legend:ee,margin:te,legendPosition:ne,legendMarginReserved:re}=xs({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:w,userMargin:k,defaults:Q,additionalLegend:J,chartWidth:t.width,chartHeight:t.height,legendLayout:E.legendLayout,frameLegend:E,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),ie=$s(L,t.width,t.height,P)||(O?null:$s(!0,t.width,t.height,P)),oe=ie?null:Hs(O,t.width,t.height,N);if(Array.isArray(O)&&O.length>0){const e=O[0];if(!e||"object"!=typeof e||!e.geometry)/* @__PURE__ */ /* @__PURE__ */
|
|
141
|
+
return(0,Zm.jsx)(Ws,{componentName:"ChoroplethMap",message:"ChoroplethMap: areas must be an array of GeoJSON Features with a geometry property.",width:t.width,height:t.height})}const ae={projection:s,areas:O,areaStyle:Z,size:[t.width,t.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:te,enableHover:t.enableHover,...ee&&{legend:ee,legendPosition:ne},...re&&{__legendMarginReservedFor:ee},legendHoverBehavior:$.onLegendHover,legendClickBehavior:$.onLegendClick,legendHighlightedCategory:$.highlightedCategory,legendIsolatedCategories:"isolate"===x?$.isolatedCategories:void 0,tooltipContent:!1===y?()=>null:!0===y?K:Pa(y)||K,...null!=l&&{graticule:l},...null!=c&&{fitPadding:c},...z&&{zoomable:!0},...d&&{zoomExtent:d},...h&&{onZoom:h},...null!=f&&{dragRotate:f},...p&&{tileURL:p},...m&&{tileAttribution:m},...g&&{tileCacheSize:g},...Ks({linkedHover:j,selection:M,onObservation:A,onClick:C,mobileInteraction:t.mobileInteraction,customHoverBehavior:V,customClickBehavior:U,linkedHoverInClickPredicate:!1}),...b&&b.length>0&&{annotations:b},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...t.title&&{title:t.title},...t.description&&{description:t.description},...t.summary&&{summary:t.summary},...void 0!==t.accessibleTable&&{accessibleTable:t.accessibleTable},...S&&{className:S},...null!=e.animate&&{animate:e.animate},...E};return ie||oe||/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)(Bs,{componentName:"ChoroplethMap",width:t.width,height:t.height,children:/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)(gm,{...ae})})}function el(e){const{data:t,rawData:n,colorBy:r,colorScheme:i,legendInteraction:o,legendPosition:a,selection:s,linkedHover:l,fallbackFields:c,unwrapData:u=!1,onObservation:d,chartType:h,chartId:f,showLegend:p,legend:m,legendLayout:g,frameLegend:y,userMargin:v,marginDefaults:b,onClick:x,hoverHighlight:w,mobileInteraction:k,mobileSemantics:S,loading:M,loadingContent:j,emptyContent:A,width:C,height:R,hasTitle:L,axisChrome:P}=e,N=void 0===n,E=(0,Qm.useMemo)(()=>on(t),[t]),[I,T]=(0,Qm.useState)([]),D=(0,Qm.useCallback)(e=>{T(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[]),z="string"==typeof r?r:void 0,_=(0,Qm.useMemo)(()=>as(k,{width:C,mobileSemantics:S}),[k,C,S]),{activeSelectionHook:O,hoverSelectionHook:F,customHoverBehavior:W,customClickBehavior:B,crosshairSourceId:H}=Rs({selection:s,linkedHover:l,fallbackFields:c,unwrapData:u,onObservation:d,chartType:h,chartId:f,onClick:x,hoverHighlight:w,colorByField:z,mobileInteraction:_}),$=Ls(l,H),q=Cs(E,r,i),G=(0,Qm.useMemo)(()=>ys(E,r),[E,r]),V=(0,Qm.useMemo)(()=>N&&I.length>0?I:G,[N,I,G]),U=Ss(o,r,V),Y=(0,Qm.useMemo)(()=>F||(U.legendSelectionHook?U.legendSelectionHook:O),[F,U.legendSelectionHook,O]),X=Gs(s),Z=js(),K=(0,Jm.useCategoryColors)(),Q=(0,Qm.useMemo)(()=>{if(q)return q;if(!r||0===V.length)return;const e=Array.isArray(i)&&i.length>0||"string"==typeof i&&i.length>0?i:Z&&Z.length>0?Z:Bd,t="__streamCat",n=St(V.map(e=>({[t]:e})),t,e);return e=>(K?kt(K,e):void 0)??(i&&"object"==typeof i&&!Array.isArray(i)?kt(i,e):void 0)??n(e)??"#999"},[q,r,V,i,Z,K]),{legend:J,margin:ee,legendPosition:te,legendLayout:ne,legendMarginReserved:re}=xs({data:E,colorBy:r,colorScale:Q,showLegend:p,legendPosition:a,userMargin:v,defaults:b,categories:V,additionalLegend:m,chartWidth:C,chartHeight:R,legendLayout:g,frameLegend:y,hasTitle:L,axisChrome:P}),ie=(0,Qm.useMemo)(()=>{const e={};return J&&(e.legend=J,e.legendPosition=te,re&&(e.__legendMarginReservedFor=J),ne&&(e.legendLayout=ne)),o&&"none"!==o&&(e.legendHoverBehavior=U.onLegendHover,e.legendClickBehavior=U.onLegendClick,e.legendHighlightedCategory=U.highlightedCategory,e.legendIsolatedCategories=U.isolatedCategories),N&&r&&(e.legendCategoryAccessor=r,e.onCategoriesChange=D),e},[J,te,ne,re,o,U.onLegendHover,U.onLegendClick,U.highlightedCategory,U.isolatedCategories,N,r,D]),oe=Array.isArray(n)?on(n):n,ae=$s(M,C,R,j),se=ae?null:Hs(oe,C,R,A);return{data:E,colorScale:q,categoryColorScale:Q,allCategories:V,legendState:U,effectiveSelectionHook:Y,activeSelectionHook:O,customHoverBehavior:W,customClickBehavior:B,mobileInteraction:_,legend:J,margin:ee,legendPosition:te,earlyReturn:ae||se||null,legendBehaviorProps:ie,crosshairProps:$,resolvedSelection:X}}function tl(e,t){const{variant:n,frameRef:r,overrides:i}=t,o=(0,eg.useRef)(i);o.current=i,(0,eg.useImperativeHandle)(e,()=>{const e=nl(n,r);return new Proxy(e,{get(e,t,n){if("string"==typeof t){const e=o.current?.[t];if("function"==typeof e)return e}return Reflect.get(e,t,n)},has:(e,t)=>!("string"!=typeof t||!o.current||!(t in o.current))||Reflect.has(e,t)})},[])}function nl(e,t){if("xy"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.remove(t)??[],update:(t,n)=>e.current?.update(t,n)??[],replace:t=>e.current?.replace?.(t),clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getScales:()=>e.current?.getScales()??null,getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("network"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>{const n=Array.isArray(t)?t:[t],r=e.current?.getTopology()?.nodes??[],i=[];for(const t of n){const n=r.find(e=>e.id===t);n&&i.push({...n.data??{},id:t}),e.current?.removeNode(t)}return i},update:(t,n)=>(Array.isArray(t)?t:[t]).flatMap(t=>{const r=e.current?.updateNode(t,n);return r?[{...r,id:t}]:[]}),clear:()=>e.current?.clear(),getData:()=>e.current?.getTopology()?.nodes?.map(e=>e.data)??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}if("geo-points"===e){const e=t;return{push:t=>e.current?.push(t),pushMany:t=>e.current?.pushMany(t),remove:t=>e.current?.removePoint(t)??[],update:(t,n)=>{const r=e.current?.removePoint(t)??[];for(const t of r)e.current?.push(n(t));return r},clear:()=>e.current?.clear(),getData:()=>e.current?.getData()??[],getCustomLayout:()=>e.current?.getCustomLayout?.()??null,getLayoutFailure:()=>e.current?.getLayoutFailure?.()??null}}const n=t;return{push:e=>n.current?.pushLine(e),pushMany:e=>n.current?.pushManyLines(e),remove:e=>n.current?.removeLine(e)??[],update:(e,t)=>{const r=n.current?.removeLine(e)??[];for(const e of r)n.current?.pushLine(t(e));return r},clear:()=>n.current?.clear(),getData:()=>n.current?.getLines()??[],getCustomLayout:()=>n.current?.getCustomLayout?.()??null,getLayoutFailure:()=>n.current?.getLayoutFailure?.()??null}}function rl(e,t,n){const[r,i]=n;if(!t)return r;const[o,a]=t,s=a>o?a-o:0,l=Number(e),c=Number.isFinite(l)?l:o;return r+Math.max(0,Math.min(1,s>0?(c-o)/s:0))*(i-r)}function il(e){const{valueAccessor:t,valueDomain:n,edgeWidthRange:r,resolveStroke:i,edgeOpacity:o,edgeLinecap:a,styleRules:s}=e,l=Is(t);return Fs(e=>({stroke:i(e),strokeWidth:rl(e[t],n,r),strokeLinecap:a,opacity:o,fillOpacity:0}),s,e=>({value:l(e)}))}function ol({bottomMargin:e,costLabel:t,layout:{cx:n,cy:r,maxCost:i,availableRadius:o,layout:a},ringStyle:s,ringValues:l,showNorth:c,showRingLabels:u,showRings:d}){const h="strip"===a,f={stroke:h?"var(--semiotic-border, #999)":"#999",strokeWidth:h?1:.8,strokeDasharray:h?"none":"4,3",labelColor:"var(--semiotic-text-secondary, #777)",labelSize:h?8:10,...s};/* @__PURE__ */ /* @__PURE__ */
|
|
142
|
+
return(0,pg.jsxs)("g",h?{children:[
|
|
143
|
+
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */(0,pg.jsx)("line",{x1:n,y1:r,x2:n+o,y2:r,stroke:f.stroke,strokeWidth:f.strokeWidth,strokeLinecap:"round",opacity:.85}),
|
|
145
|
+
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */(0,pg.jsx)("line",{x1:n,y1:r-3.5,x2:n,y2:r+3.5,stroke:f.stroke,strokeWidth:f.strokeWidth,opacity:.9}),d&&l.map(a=>{const s=n+(i>0?a/i*o:0);/* @__PURE__ */ /* @__PURE__ */
|
|
147
|
+
return(0,pg.jsxs)("g",{children:[
|
|
148
|
+
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */(0,pg.jsx)("line",{x1:s,y1:r-2.5,x2:s,y2:r+2.5,stroke:f.stroke,strokeWidth:.9,opacity:.65}),u&&/* @__PURE__ */ /* @__PURE__ */(0,pg.jsxs)("text",{x:s,y:r+Math.min(10,(e??2)+8),textAnchor:"middle",fontSize:f.labelSize,fill:f.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[a,t?" "+t:""]})]},a)})]}:{children:[l.map(e=>{const a=e/i*o;/* @__PURE__ */ /* @__PURE__ */
|
|
150
|
+
return(0,pg.jsxs)("g",{children:[
|
|
151
|
+
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */(0,pg.jsx)("circle",{cx:n,cy:r,r:a,fill:"none",stroke:f.stroke,strokeWidth:f.strokeWidth,strokeDasharray:f.strokeDasharray,opacity:.5}),u&&/* @__PURE__ */ /* @__PURE__ */(0,pg.jsxs)("text",{x:n+a+3,y:r-2,fontSize:f.labelSize,fill:f.labelColor,fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:[e,t?" "+t:""]})]},e)}),c&&/* @__PURE__ */ /* @__PURE__ */(0,pg.jsxs)("g",{transform:"translate(24, 24)",children:[
|
|
153
|
+
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */(0,pg.jsx)("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),
|
|
155
|
+
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */(0,pg.jsx)("path",{d:"M0,-11 L3,-3 L1,-4 L1,7 L-1,7 L-1,-4 L-3,-3 Z",fill:"#555",stroke:"none"}),
|
|
157
|
+
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */(0,pg.jsx)("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),
|
|
159
|
+
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */(0,pg.jsx)("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),
|
|
161
|
+
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */(0,pg.jsx)("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),
|
|
163
|
+
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */(0,pg.jsx)("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function al(e){if(null==e)return;if("number"==typeof e)return{top:e,right:e,bottom:e,left:e};const t={};return"number"==typeof e.top&&(t.top=e.top),"number"==typeof e.right&&(t.right=e.right),"number"==typeof e.bottom&&(t.bottom=e.bottom),"number"==typeof e.left&&(t.left=e.left),t}function sl(e){const t=(0,vg.useRef)(null);return tl(e.imperativeRef,{variant:e.imperativeVariant,frameRef:t}),{frameRef:t,resolved:Ps(e.mode,{width:e.width,height:e.height,showGrid:e.showGrid,enableHover:e.enableHover,showLegend:e.showLegend,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,xLabel:e.xLabel,yLabel:e.yLabel,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),normalizedMargin:(0,vg.useMemo)(()=>al(e.margin),[e.margin])}}function ll(e){return null==e?void 0:e+""}function cl(e){const t=ll(e.id);return{type:"point",x:e.x,y:e.y,r:e.r??kg,style:{...wg,cursor:e.cursor},datum:e.datum,pointId:t,_transitionKey:t}}function ul(e){return cl(e)}function dl(e){const[[t,n],[r,i]]=e.bounds;return{type:"geoarea",pathData:e.pathData,centroid:e.centroid,bounds:e.bounds,screenArea:e.screenArea??Math.abs((r-t)*(i-n)),style:{...wg,cursor:e.cursor},datum:e.datum,group:e.group,interactive:!0}}function hl(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function fl(e,t,n){return Math.max(t,Math.min(n,e))}function pl(e){let t=1/0,n=-1/0;for(const r of e)Number.isFinite(r)&&(t>r&&(t=r),r>n&&(n=r));return t===1/0?[0,0]:[t,n]}function ml(e,t){const n=t[1]-t[0];return 0===n?.5:(e-t[0])/n}function gl(e,t={}){const n=e.map((e,t)=>({...e,index:t})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));if(0===n.length)return[];const r=fl(Number.isFinite(t.occupancy)?Number(t.occupancy):jg,.2,1),i=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):Ag;let o=hl(t.columns)??Math.max(1,Math.ceil(Math.sqrt(n.length*i/r))),a=hl(t.rows)??Math.max(1,Math.ceil(n.length/(o*r)));n.length>o*a&&(null!=t.columns&&null==t.rows?a=Math.ceil(n.length/o):null!=t.rows&&null==t.columns?o=Math.ceil(n.length/a):a=Math.ceil(n.length/o));const s=pl(n.map(e=>e.x)),l=pl(n.map(e=>e.y)),c=n.map(e=>({...e,desiredColumn:ml(e.x,s)*Math.max(0,o-1),desiredRow:ml(e.y,l)*Math.max(0,a-1)})),u=(o-1)/2,d=(a-1)/2;c.sort((e,t)=>(t.desiredColumn-u)**2+(t.desiredRow-d)**2-((e.desiredColumn-u)**2+(e.desiredRow-d)**2)||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index);const h=/* @__PURE__ */new Set;for(let e=0;a>e;e+=1)for(let t=0;o>t;t+=1)h.add(e*o+t);const f=[];for(const e of c){let t=-1,n=1/0;for(const r of h){const i=(r%o-e.desiredColumn)**2+(Math.floor(r/o)-e.desiredRow)**2;(n>i||i===n&&t>r)&&(t=r,n=i)}0>t||(h.delete(t),f.push({datum:e.datum,x:e.x,y:e.y,row:Math.floor(t/o),column:t%o,index:e.index}))}return f.sort((e,t)=>e.index-t.index),f.map(({index:e,...t})=>t)}function yl(e,t,n=[]){if("function"==typeof t)return t(e);if("string"==typeof t)return e[t];for(const t of n)if(null!=e[t])return e[t]}function vl(e,t){const n=e.properties&&"object"==typeof e.properties?e.properties:{},r=e.id??n.id??n.name??"area-"+t;return{...n,id:r+""}}function bl(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e},${t}`).join("")+"Z"}function xl(e,t,n){const r=[];for(let i=0;6>i;i+=1){const o=-Math.PI/2+i*(Math.PI/3);r.push([e+Math.cos(o)*n,t+Math.sin(o)*n])}return bl(r)}function wl(e){return e.areas.map((t,n)=>{const r=vl(t,n),i=e.scales.geoPath.centroid(t),o=Number.isFinite(i[0])&&Number.isFinite(i[1])?e.scales.invertedPoint(i[0],i[1]):null;return{datum:{...r,gridLongitude:o?.[0],gridLatitude:o?.[1]},x:i[0],y:i[1]}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}function kl(e){return e.points.map(t=>{const n=Number(yl(t,e.config.longitudeAccessor,["lon","longitude"])),r=Number(yl(t,e.config.latitudeAccessor,["lat","latitude"])),i=Number.isFinite(n)&&Number.isFinite(r)?e.scales.projectedPoint(n,r):null;return{datum:t,x:i?.[0]??NaN,y:i?.[1]??NaN}}).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}function Sl(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;const n=e.map(e=>({datum:e,x:Number(yl(e,t.columnAccessor)),y:Number(yl(e,t.rowAccessor))})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y));return n.length!==e.length?null:n.map(e=>({...e,row:e.y,column:e.x}))}function Ml({marks:e,color:t,fontSize:n,fontFamily:r,fontWeight:i}){const o=(0,Sg.useCustomLayoutSelection)();/* @__PURE__ */ /* @__PURE__ */
|
|
165
|
+
return(0,Mg.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{const a=!o.isActive||o.predicate(e.datum);/* @__PURE__ */ /* @__PURE__ */
|
|
166
|
+
return(0,Mg.jsx)("text",{x:e.x,y:e.y,fill:t,fontFamily:r,fontSize:n,fontWeight:i,opacity:a?1:.18,textAnchor:"middle",dominantBaseline:"central",children:e.label},e.id)})})}function jl(e,t,n){return Math.max(t,Math.min(n,e))}function Al(e){if(Number.isFinite(e)&&Number(e)>0)return Number(e)}function Cl(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function Rl(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function Ll(e,t){const n=Rl(e);return(e.id??n.id??n.name??"feature-"+t)+""}function Pl(e,t){if(0===e.length)return null;const n=t.bounds({type:"FeatureCollection",features:e});return Number.isFinite(n[0][0])&&Number.isFinite(n[0][1])&&Number.isFinite(n[1][0])&&Number.isFinite(n[1][1])?n:null}function Nl(e,t,n,r){return[Math.ceil((e-n)/r-.5),Math.floor((t-n)/r-.5)]}function El(e){if(!e)return 0;const t=Ig.get(e);if(t)return t;const n=Tg;return Tg+=1,Ig.set(e,n),n}function Il(e){return e.map((e,t)=>{if(Eg.has(e))return{feature:e,index:t,bounds:Eg.get(e)??null};try{const n=P(e);return Eg.set(e,n),{feature:e,index:t,bounds:n}}catch{return Eg.set(e,null),{feature:e,index:t,bounds:null}}})}function Tl(e,t){return!t||!(t[0][1]>e[1]||e[1]>t[1][1]||(n=e[0],r=t[0][0],i=t[1][0],r>i?r>n&&n>i:r>n||n>i));var n,r,i}function Dl(e,t){for(const n of e){const{feature:e,index:r}=n;if(e.geometry&&Tl(t,n.bounds))try{if(ue(e,t))return{feature:e,index:r}}catch{}}return null}function zl(e,t,n,r={}){const i=e.filter((e,t)=>e.geometry&&(!r.featureFilter||r.featureFilter(e,t))),o=Pl(i,t.geoPath);if(!o)return{dots:[],cellSize:Lg,features:i};const a=Math.max(0,r.layoutPadding??0),s=[[jl(o[0][0],a,Math.max(a,n.width-a)),jl(o[0][1],a,Math.max(a,n.height-a))],[jl(o[1][0],a,Math.max(a,n.width-a)),jl(o[1][1],a,Math.max(a,n.height-a))]],l=Math.max(0,s[1][0]-s[0][0]),c=Math.max(0,s[1][1]-s[0][1]);if(0===l||0===c)return{dots:[],cellSize:Lg,features:i};const u=Al(r.columns);let d=Math.max(2,u?l/u:Al(r.cellSize)??Lg);const h=Math.max(100,Math.round(Al(r.maxSamples)??Pg)),f=Math.ceil(l/d)*Math.ceil(c/d);f>h&&(d*=Math.sqrt(f/h));const p=r.gridOrigin?.[0]??0,m=r.gridOrigin?.[1]??0,[g,y]=Nl(s[0][0],s[1][0],p,d),[v,b]=Nl(s[0][1],s[1][1],m,d),x=[],w=Il(i);for(let e=v;b>=e;e+=1){const n=m+(e+.5)*d;for(let i=g;y>=i;i+=1){const o=t.invertedPoint(p+(i+.5)*d,n);if(!o||!Number.isFinite(o[0])||!Number.isFinite(o[1]))continue;const a=Dl(w,o);if(!a)continue;const s={...Rl(a.feature),featureId:Ll(a.feature,a.index),featureIndex:a.index,gridRow:e,gridColumn:i,longitude:o[0],latitude:o[1],dotIndex:x.length};r.dotFilter&&!r.dotFilter(s,x.length)||x.push(s)}}return{dots:x,cellSize:d,features:i}}function _l(e){return Math.round(1e4*e)/1e4}function Ol(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${_l(Number(e[0]))},${_l(Number(e[1]))}`:"null"}function Fl(e,t){const n=e[t];return"function"==typeof n?n.call(e):void 0}function Wl(e){return"number"==typeof e&&Number.isFinite(e)?_l(e)+"":null===e?"null":"unavailable"}function Bl(e){const t=e.scales.projection;return[Wl(Fl(t,"scale")),Ol(Fl(t,"translate")),Ol(Fl(t,"center")),(n=Fl(t,"rotate"),Array.isArray(n)&&n.every(Number.isFinite)?n.map(e=>_l(Number(e))).join(","):"unavailable"),Wl(Fl(t,"clipAngle")),Wl(Fl(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,n])=>Ol(e.scales.projectedPoint(t,n)))].join("|");var n}function Hl(e){const t=e.config;return[e.areas.length,e.dimensions.width,e.dimensions.height,t.cellSize??"",t.columns??"",t.layoutPadding??"",t.gridOrigin?.join(",")??"",t.maxSamples??"",El(t.featureFilter),El(t.dotFilter),Bl(e)].join("::")}function $l(e){let t=Ng.get(e.areas);t||(t=/* @__PURE__ */new Map,Ng.set(e.areas,t));const n=Hl(e),r=t.get(n);if(r)return r;const i=zl(e.areas,e.scales,e.dimensions,e.config);if(t.size>=12){const e=t.keys().next().value;void 0!==e&&t.delete(e)}return t.set(n,i),i}function ql(e){return e.map(([e,t],n)=>`${0===n?"M":"L"}${e},${t}`).join("")+"Z"}function Gl(e,t,n){return ql([[e-n,t-n],[e+n,t-n],[e+n,t+n],[e-n,t+n]])}function Vl(e,t,n){return ql(Array.from({length:6},(r,i)=>{const o=-Math.PI/2+i*(Math.PI/3);return[e+Math.cos(o)*n,t+Math.sin(o)*n]}))}function Ul(e,t,n){const{featureKey:r,dataKey:i}=n,o=/* @__PURE__ */new Map;for(const e of t){const t=(Object.prototype.hasOwnProperty.call(e,i)?e[i]:void 0)+"";o.set(t,e)}const a=e=>{const t=r.split(".");let n=e;for(const e of t)n=null!==n&&"object"==typeof n&&Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0;return(n??"")+""};return e.map(e=>{const t=a(e),n=o.get(t);return n?{...e,properties:{...e.properties,...n}}:e})}var Yl,Xl,Zl,Kl=Object.create,Ql=Object.defineProperty,Jl=Object.getOwnPropertyDescriptor,ec=Object.getOwnPropertyNames,tc=Object.getPrototypeOf,nc=Object.prototype.hasOwnProperty,rc=(e,t)=>{for(var n in t)Ql(e,n,{get:t[n],enumerable:!0})},ic=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of ec(t))nc.call(e,i)||i===n||Ql(e,i,{get:()=>t[i],enumerable:!(r=Jl(t,i))||r.enumerable});return e},oc=(e,t,n)=>(n=null!=e?Kl(tc(e)):{},ic(!t&&e&&e.__esModule?n:Ql(n,"default",{value:e,enumerable:!0}),e)),ac={};rc(ac,{default:()=>t});var sc,lc,cc,uc,dc=(sc={"src/components/stream/AccessibleTablePortalImpl.tsx"(){Yl=oc(require("react")),Xl=require("react-dom"),Zl=require("react/jsx-runtime")}},function(){if(cc)throw cc[0];try{return sc&&(lc=(0,sc[ec(sc)[0]])(sc=0)),lc}catch(e){throw cc=[e],e}}),hc={};rc(hc,{ChoroplethMap:()=>Js,DEFAULT_HIT_RADIUS:()=>kg,DistanceCartogram:()=>gg,FlowMap:()=>hg,GeoCustomChart:()=>xg,MultiLineTooltip:()=>Ra,ProportionalSymbolMap:()=>og,StreamGeoFrame:()=>gm,Tooltip:()=>Ca,TooltipRoot:()=>Wo,composeStyleRules:()=>Fs,geoAreaHitTarget:()=>dl,geoHitTarget:()=>ul,geographicDotGridLayout:()=>Dg,geographicGridLayout:()=>Cg,glyphExtent:()=>mn,glyphPlacement:()=>pn,gridifyGeographicPoints:()=>gl,hatchFillId:()=>Xr,hatchPatternDef:()=>Kr,hitTargetPoint:()=>cl,isHatchFill:()=>Ur,makeNodeRuleContext:()=>Ts,makeRuleValueResolver:()=>Is,markTooltipChrome:()=>Bo,matchesThreshold:()=>zs,mergeData:()=>Ul,resolveReferenceGeography:()=>Ys,resolveResponsiveRules:()=>os,resolveStyleRules:()=>Os,resolveSvgFill:()=>Qr,responsiveRuleMatches:()=>rs,ruleMatches:()=>_s,sampleGeographicDotGrid:()=>zl}),module.exports=(uc=hc,ic(Ql({},"__esModule",{value:!0}),uc));var fc,pc,mc,gc,yc,vc,bc,xc,wc,kc,Sc,Mc,jc,Ac,Cc,Rc,Lc=require("react"),Pc=require("d3-array"),Nc=1e-6,Ec=1e-12,Ic=Math.PI,Tc=Ic/2,Dc=Ic/4,zc=2*Ic,_c=180/Ic,Oc=Ic/180,Fc=Math.abs,Wc=Math.atan,Bc=Math.atan2,Hc=Math.cos,$c=Math.ceil,qc=Math.exp,Gc=Math.log,Vc=Math.sin,Uc=Math.sign||function(e){return e>0?1:0>e?-1:0},Yc=Math.sqrt,Xc=Math.tan,Zc={Feature:function(e,t){o(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)o(n[r].geometry,t)}},Kc={Sphere:function(e,t){t.sphere()},Point:function(e,t){t.point((e=e.coordinates)[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)t.point((e=n[r])[0],e[1],e[2])},LineString:function(e,t){a(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)a(n[r],t,0)},Polygon:function(e,t){s(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)s(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)o(n[r],t)}},Qc=new Pc.Adder,Jc=new Pc.Adder,eu={point:i,lineStart:i,lineEnd:i,polygonStart:function(){Qc=new Pc.Adder,eu.lineStart=c,eu.lineEnd=u},polygonEnd:function(){var e=+Qc;Jc.add(0>e?zc+e:e),this.lineStart=this.lineEnd=this.point=i},sphere:function(){Jc.add(zc)}},tu=require("d3-array"),nu={point:x,lineStart:k,lineEnd:S,polygonStart:function(){nu.point=M,nu.lineStart=j,nu.lineEnd=A,Ac=new tu.Adder,eu.polygonStart()},polygonEnd:function(){eu.polygonEnd(),nu.point=x,nu.lineStart=k,nu.lineEnd=S,0>Qc?(vc=-(xc=180),bc=-(wc=90)):Ac>Nc?wc=90:-Nc>Ac&&(bc=-90),Rc[0]=vc,Rc[1]=xc},sphere:function(){vc=-(xc=180),bc=-(wc=90)}};E.invert=E;var ru,iu,ou,au,su,lu,cu,uu,du,hu,fu,pu,mu=require("d3-array"),gu=require("d3-array"),yu=U(function(){return!0},function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?Ic:-Ic,l=Fc(o-n);Fc(l-Ic)<Nc?(e.point(n,r=(r+a)/2>0?Tc:-Tc),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i===s||Ic>l||(Fc(n-i)<Nc&&(n-=i*Nc),Fc(o-s)<Nc&&(o-=s*Nc),r=Z(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}},function(e,t,n,r){var i;if(null==e)r.point(-Ic,i=n*Tc),r.point(0,i),r.point(Ic,i),r.point(Ic,0),r.point(Ic,-i),r.point(0,-i),r.point(-Ic,-i),r.point(-Ic,0),r.point(-Ic,i);else if(Fc(e[0]-t[0])>Nc){var o=t[0]>e[0]?Ic:-Ic;r.point(-o,i=n*o/2),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])},[-Ic,-Tc]),vu=require("d3-array"),bu=1e9,xu=-bu,wu=require("d3-array"),ku={sphere:i,point:i,lineStart:function(){ku.point=te,ku.lineEnd=ee},lineEnd:i,polygonStart:i,polygonEnd:i},Su=[null,null],Mu={type:"LineString",coordinates:Su},ju={Feature:function(e,t){return ie(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(ie(n[r].geometry,t))return!0;return!1}},Au={Sphere:function(){return!0},Point:function(e,t){return oe(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(oe(n[r],t))return!0;return!1},LineString:function(e,t){return ae(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(ae(n[r],t))return!0;return!1},Polygon:function(e,t){return se(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(se(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(ie(n[r],t))return!0;return!1}},Cu=require("d3-array"),Ru=e=>e,Lu=require("d3-array"),Pu=new Lu.Adder,Nu=new Lu.Adder,Eu={point:i,lineStart:i,lineEnd:i,polygonStart:function(){Eu.lineStart=me,Eu.lineEnd=ve},polygonEnd:function(){Eu.lineStart=Eu.lineEnd=Eu.point=i,Pu.add(Fc(Nu)),Nu=new Lu.Adder},result:function(){var e=Pu/2;return Pu=new Lu.Adder,e}},Iu=Eu,Tu=1/0,Du=Tu,zu=-Tu,_u=zu,Ou={point:function(e,t){Tu>e&&(Tu=e),e>zu&&(zu=e),Du>t&&(Du=t),t>_u&&(_u=t)},lineStart:i,lineEnd:i,polygonStart:i,polygonEnd:i,result:function(){var e=[[Tu,Du],[zu,_u]];return zu=_u=-(Du=Tu=1/0),e}},Fu=0,Wu=0,Bu=0,Hu=0,$u=0,qu=0,Gu=0,Vu=0,Uu=0,Yu={point:be,lineStart:xe,lineEnd:Se,polygonStart:function(){Yu.lineStart=Me,Yu.lineEnd=je},polygonEnd:function(){Yu.point=be,Yu.lineStart=xe,Yu.lineEnd=Se},result:function(){var e=Uu?[Gu/Uu,Vu/Uu]:qu?[Hu/qu,$u/qu]:Bu?[Fu/Bu,Wu/Bu]:[NaN,NaN];return Fu=Wu=Bu=Hu=$u=qu=Gu=Vu=Uu=0,e}},Xu=Yu;Re.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,zc)}},result:i};var Zu,Ku,Qu,Ju,ed,td,nd,rd,id,od=require("d3-array"),ad=new od.Adder,sd={point:i,lineStart:function(){sd.point=Le},lineEnd:function(){Zu&&Pe(Ku,Qu),sd.point=i},polygonStart:function(){Zu=!0},polygonEnd:function(){Zu=null},result:function(){var e=+ad;return ad=new od.Adder,e}},ld=sd,cd=class{constructor(e){this._append=null==e?Ne:Ee(e),this._radius=4.5,this._=""}pointRadius(e){return this._radius=+e,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(e,t){switch(this._point){case 0:this._append`M${e},${t}`,this._point=1;break;case 1:this._append`L${e},${t}`;break;default:if(this._append`M${e},${t}`,this._radius!==rd||this._append!==nd){const e=this._radius,t=this._;this._="",this._append`m0,${e}a${e},${e} 0 1,1 0,${-2*e}a${e},${e} 0 1,1 0,${2*e}z`,rd=e,nd=this._append,id=this._,this._=t}this._+=id}}result(){const e=this._;return this._="",e.length?e:null}};De.prototype={constructor:De,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var ud=Hc(30*Oc),dd=Te({point:function(e,t){this.stream.point(e*Oc,t*Oc)}});Qe.invert=function(e,t){return[e,2*Wc(qc(t))-Tc]},et.invert=et;var hd,fd=1.340264,pd=-.081106,md=893e-6,gd=.003796,yd=Yc(3)/2;tt.invert=function(e,t){for(var r,i=t,o=i*i,a=o*o*o,s=0;12>s&&(a=(o=(i-=r=(i*(fd+pd*o+a*(md+gd*o))-t)/(fd+3*pd*o+a*(7*md+9*gd*o)))*i)*o*o,Fc(r)>=Ec);++s);return[yd*e*(fd+3*pd*o+a*(7*md+9*gd*o))/Hc(i),n(Vc(i)/yd)]},rt.invert=function(e,t){var n,r=t,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-t)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(Fc(n)>Nc&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},it.invert=(hd=n,function(e,t){var r=Yc(e*e+t*t),i=hd(r),o=Vc(i),a=Hc(i);return[Bc(e*o,r*a),n(r&&t*o/r)]});var vd=require("d3-quadtree"),bd=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,1>e)throw Error("RingBuffer capacity must be at least 1");this.buffer=Array(e)}push(e){let t;return this._size===this._capacity?t=this.buffer[this.head]:this._size++,this.buffer[this.head]=e,this.head=(this.head+1)%this._capacity,t}pushMany(e){const t=[];for(const n of e){const e=this.push(n);void 0!==e&&t.push(e)}return t}get(e){if(e>=0&&this._size>e)return this.buffer[(this.head-this._size+e+this._capacity)%this._capacity]}peek(){if(0!==this._size)return this.buffer[(this.head-1+this._capacity)%this._capacity]}peekOldest(){if(0!==this._size)return this.buffer[(this.head-this._size+this._capacity)%this._capacity]}[Symbol.iterator](){let e=0;return{next:()=>this._size>e?{done:!1,value:this.get(e++)}:{done:!0,value:void 0}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++)e(this.buffer[(t+n)%this._capacity],n)}toArray(){const e=Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;this._size>n;n++)e[n]=this.buffer[(t+n)%this._capacity];return e}resize(e){if(1>e)throw Error("RingBuffer capacity must be at least 1");const t=this.toArray();let n=0,r=[];t.length>e&&(n=t.length-e,r=t.slice(0,n)),this._capacity=e,this.buffer=Array(e),this.head=0,this._size=0;for(let e=n;t.length>e;e++)this.push(t[e]);return r}update(e,t){const n=[],r=(this.head-this._size+this._capacity)%this._capacity;for(let i=0;this._size>i;i++){const o=(r+i)%this._capacity,a=this.buffer[o];if(e(a)){let e;e="object"!=typeof a||null===a?a:Array.isArray(a)?[...a]:{...a},n.push(e),this.buffer[o]=t(a)}}return n}remove(e){const t=[],n=[];if(this.forEach(r=>{e(r)?n.push(r):t.push(r)}),0===n.length)return n;this.buffer=Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return n}clear(){this.buffer=Array(this._capacity),this.head=0,this._size=0}get size(){return this._size}get capacity(){return this._capacity}get full(){return this._size===this._capacity}},xd=1,wd=1.5,kd=3,Sd=require("d3-scale"),Md=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],jd=yt(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),Ad=yt(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),Cd=yt(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),Rd=yt(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),Ld=yt(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),Pd=yt(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),Nd=yt(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),Ed=yt(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),Id=yt(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),Td=yt(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),Dd=yt(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),zd=yt(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"]),_d={blues:jd,reds:Ad,greens:Cd,viridis:Nd,oranges:Rd,purples:Ld,greys:Pd,plasma:Ed,inferno:Id,magma:Td,cividis:Dd,turbo:zd},Od=(yt(["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]),yt(["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]),yt(["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]),yt(["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]),yt(["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]),yt(["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]),yt(["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]),{category10:Md,tableau10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],..._d}),Fd=Md,Wd="#007bff",Bd=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],Hd=/* @__PURE__ */new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),$d={mercator:function(){return Je(Qe).scale(961/zc)},equalEarth:nt,albersUsa:function(){function e(e){var t=e[0],n=e[1];return s=null,i.point(t,n),s||(o.point(t,n),s)||(a.point(t,n),s)}function t(){return n=r=null,e}var n,r,i,o,a,s,l=Ke().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7]),c=Ke().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=Ke().rotate([157,0]).center([-3,19.9]).parallels([8,18]),d={point:function(e,t){s=[e,t]}};return e.invert=function(e){var t=l.scale(),n=l.translate(),r=(e[0]-n[0])/t,i=(e[1]-n[1])/t;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?c:i>=.166&&.234>i&&r>=-.214&&-.115>r?u:l).invert(e)},e.stream=function(e){return n&&r===e?n:(t=[l.stream(r=e),c.stream(e),u.stream(e)],i=t.length,n={point:function(e,n){for(var r=-1;++r<i;)t[r].point(e,n)},sphere:function(){for(var e=-1;++e<i;)t[e].sphere()},lineStart:function(){for(var e=-1;++e<i;)t[e].lineStart()},lineEnd:function(){for(var e=-1;++e<i;)t[e].lineEnd()},polygonStart:function(){for(var e=-1;++e<i;)t[e].polygonStart()},polygonEnd:function(){for(var e=-1;++e<i;)t[e].polygonEnd()}});var t,i},e.precision=function(e){return arguments.length?(l.precision(e),c.precision(e),u.precision(e),t()):l.precision()},e.scale=function(t){return arguments.length?(l.scale(t),c.scale(.35*t),u.scale(t),e.translate(l.translate())):l.scale()},e.translate=function(e){if(!arguments.length)return l.translate();var n=l.scale(),r=+e[0],s=+e[1];return i=l.translate(e).clipExtent([[r-.455*n,s-.238*n],[r+.455*n,s+.238*n]]).stream(d),o=c.translate([r-.307*n,s+.201*n]).clipExtent([[r-.425*n+Nc,s+.12*n+Nc],[r-.214*n-Nc,s+.234*n-Nc]]).stream(d),a=u.translate([r-.205*n,s+.212*n]).clipExtent([[r-.214*n+Nc,s+.166*n+Nc],[r-.115*n-Nc,s+.234*n-Nc]]).stream(d),t()},e.fitExtent=function(t,n){return _e(e,t,n)},e.fitSize=function(t,n){return Oe(e,t,n)},e.fitWidth=function(t,n){return Fe(e,t,n)},e.fitHeight=function(t,n){return We(e,t,n)},e.scale(1070)},orthographic:function(){return Ue(it).scale(249.5).clipAngle(90.000001)},naturalEarth:function(){return Ue(rt).scale(175.295)},equirectangular:function(){return Ue(et).scale(152.63)}},qd=require("d3-scale"),Gd={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},Vd=class{constructor(){this.revisions={data:0,domain:0,layout:0,sceneGeometry:0,sceneStyle:0,dataPaint:0,interactionPaint:0,overlay:0,accessibility:0,evidence:0},this.latest=Qt({kind:"initialize"},[],this.revisions),this.listeners=/* @__PURE__ */new Set}get last(){return this.latest}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}record(e,t){const n=Qt(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}},Ud=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Yd=["scene-style","data-paint","accessibility","evidence"],Xd=(e,t)=>({retainedData:e,invalidations:t}),Zd=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Kd=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Qd=["scene-geometry","data-paint","accessibility","evidence"],Jd=["scene-style","data-paint","accessibility","evidence"],eh=["overlay","accessibility","evidence"],th=[],nh={xAccessor:Xd("rebuild",Zd),yAccessor:Xd("rebuild",Zd),lineDataAccessor:Xd("rebuild",Zd),pointIdAccessor:Xd("rebuild",Qd),lineIdAccessor:Xd("rebuild",Qd),windowSize:Xd("rebuild",Zd),projection:Xd("preserve",Kd),projectionExtent:Xd("preserve",Kd),fitPadding:Xd("preserve",Kd),lineType:Xd("preserve",Kd),flowStyle:Xd("preserve",Kd),graticule:Xd("preserve",Kd),projectionTransform:Xd("preserve",Kd),customLayout:Xd("preserve",Kd),layoutConfig:Xd("preserve",Kd),layoutMargin:Xd("preserve",Kd),areaStyle:Xd("preserve",Jd),pointStyle:Xd("preserve",["scene-geometry","scene-style","data-paint","accessibility","evidence"]),lineStyle:Xd("preserve",Jd),colorScheme:Xd("preserve",Jd),themeCategorical:Xd("preserve",Jd),themeDiverging:Xd("preserve",Jd),themeSemantic:Xd("preserve",Jd),themeSequential:Xd("preserve",Jd),decay:Xd("preserve",Jd),pulse:Xd("preserve",Jd),layoutSelection:Xd("preserve",Jd),annotations:Xd("preserve",eh),autoPlaceAnnotations:Xd("preserve",eh),clock:Xd("preserve",th),transition:Xd("preserve",th),introAnimation:Xd("preserve",th),onLayoutError:Xd("preserve",th)},rh=Xd("preserve",Kd),ih=class{constructor(){this.tracker=new Vd}get last(){return this.tracker.last}subscribe(e){return this.tracker.subscribe(e)}recordData(e,t){return this.tracker.record({kind:e,...void 0===t?{}:{count:t}},Ud)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Yd):this.recordNoop("restyle")}recordConfig(e,t={}){const n=Jt(e),r=new Set(n.invalidations);return t.retainedDataChanged&&r.add("data"),this.tracker.record({kind:"config",keys:e},r)}},oh=/* @__PURE__ */new WeakMap,ah=class e{constructor(e){this.updateResults=new ih,this.scene=[],this.scales=null,this.version=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customLayoutDiagnosticsWarned=/* @__PURE__ */new Set,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this._customLayoutFailedThisBuild=!1,this._quadtree=null,this._maxPointRadius=0,this.projection=null,this.geoPath=null,this.baseScale=0,this.baseTranslate=[0,0],this.baseRotation=[0,0,0],this.currentZoom=1,this.cartogramLayout=null,this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.streaming=!1,this.lastIngestTime=0,this.timestampBuffer=null,this.activeTransition=null,this.prevPositions=null,this._hasRenderedOnce=!1,this.config=nn(e)}currentTime(){return this.config.clock?.()??("undefined"!=typeof performance?performance.now():Date.now())}getConfiguredWindowSize(){const e=this.config.windowSize??500;if(!Number.isInteger(e)||1>e)throw Error("GeoPipelineStore windowSize must be a positive integer");return e}retainNewestLines(e=this.getConfiguredWindowSize()){this.lineData.length>e&&(this.lineData=this.lineData.slice(-e))}resizeStreamingWindow(e){if(this.pointBuffer){const t=this.pointBuffer.toArray(),n=this.timestampBuffer?.toArray()??[],r=t.slice(-e),i=n.slice(-r.length),o=this.currentTime();this.pointBuffer=new bd(e),this.timestampBuffer=new bd(e),r.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(i[t]??o)})}this.retainNewestLines(e)}updateConfig(e){const t=rn(e),n=this.config,r=this.getConfiguredWindowSize(),i=Object.keys(t).filter(e=>t[e]!==n[e]);this.config={...this.config,...t};const o=this.getConfiguredWindowSize(),a=this.streaming&&o!==r;a&&(this.resizeStreamingWindow(o),this.version++),"customLayout"in t&&!t.customLayout&&(this.lastCustomLayoutFailure=null),this.updateResults.recordConfig(i,{retainedDataChanged:a})}updateConfigWithResult(e){return this.updateConfig(e),this.updateResults.last}setAreas(e){this.areas=e,this.updateResults.recordData("replace",e.length)}setAreasWithResult(e){return this.setAreas(e),this.updateResults.last}setPoints(e){this.pointData=e.slice(),this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.updateResults.recordData("replace",e.length)}setPointsWithResult(e){return this.setPoints(e),this.updateResults.last}setLines(e){this.lineData=e.slice(),this.streaming&&this.retainNewestLines(),this.updateResults.recordData("replace",e.length)}setLinesWithResult(e){return this.setLines(e),this.updateResults.last}initStreaming(e){void 0!==e&&e!==this.config.windowSize&&(this.config={...this.config,windowSize:e});const t=this.getConfiguredWindowSize(),n=this.pointBuffer?this.pointBuffer.toArray():this.pointData,r=this.timestampBuffer?.toArray()??[],i=n.slice(-t),o=r.slice(-i.length),a=this.currentTime();this.pointBuffer=new bd(t),this.timestampBuffer=new bd(t),i.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(o[t]??a)}),this.pointData=[],this.retainNewestLines(t),this.streaming=!0}pushPoint(e){this.pointBuffer||this.initStreaming();const t=this.currentTime();Xt(this.pointBuffer,e,this.timestampBuffer,t),this.lastIngestTime=t,this.updateResults.recordData("ingest",1)}pushPointWithResult(e){return this.pushPoint(e),this.updateResults.last}pushMany(e){this.pointBuffer||this.initStreaming();const t=this.currentTime();for(const n of e)Xt(this.pointBuffer,n,this.timestampBuffer,t);this.lastIngestTime=t,this.updateResults.recordData("ingest",e.length)}pushManyWithResult(e){return this.pushMany(e),this.updateResults.last}pushLine(e){null!=e&&"object"==typeof e?(this.streaming||this.initStreaming(),this.lineData.push(e),this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",1)):this.updateResults.recordNoop("ingest")}pushManyLines(e){if(!Array.isArray(e)||0===e.length)return void this.updateResults.recordNoop("ingest");const t=e.filter(e=>null!=e&&"object"==typeof e);if(0!==t.length){this.streaming||this.initStreaming();for(const e of t)this.lineData.push(e);this.retainNewestLines(),this.version++,this.updateResults.recordData("ingest",t.length)}else this.updateResults.recordNoop("ingest")}removeLine(e){const{lineIdAccessor:t}=this.config;if(!t)throw Error("removeLine() requires lineIdAccessor to be configured");const n="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]),i=[];return this.lineData=this.lineData.filter(e=>!r.has(n(e)+"")||(i.push(e),!1)),i.length>0?(this.version++,this.updateResults.recordData("remove",i.length)):this.updateResults.recordNoop("remove"),i}getLines(){return this.lineData.slice()}removePoint(e){const{pointIdAccessor:t}=this.config;if(!t)throw Error("removePoint() requires pointIdAccessor to be configured");const n="function"==typeof t?t:e=>e[t],r=new Set(Array.isArray(e)?e:[e]);if(this.streaming&&this.pointBuffer){const e=e=>r.has(n(e)+"");Zt(this.pointBuffer,this.timestampBuffer,e);const t=this.pointBuffer.remove(e);return t.length>0?(this.version++,this.updateResults.recordData("remove",t.length)):this.updateResults.recordNoop("remove"),t}{const e=[];return this.pointData=this.pointData.filter(t=>!r.has(n(t)+"")||(e.push(t),!1)),e.length>0?(this.version++,this.updateResults.recordData("remove",e.length)):this.updateResults.recordNoop("remove"),e}}clear(){this.areas=[],this.pointData=[],this.lineData=[],this.pointBuffer=null,this.timestampBuffer=null,this.streaming=!1,this.scene=[],this.scales=null,this._hasRenderedOnce=!1,this.activeTransition=null,this.prevPositions=null,this._quadtree=null,this._maxPointRadius=0,this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,this._customLayoutFailedThisBuild=!1,this.version++,this.updateResults.recordData("clear")}restyleScene(e){const t=this._customRestyle;if(t){for(const n of this.scene){const r=this._baseStyles.get(n)??n.style,i=t(n,e);n.style=i?{...r,...i}:r}this.markStylePaintPending(),this.updateResults.recordRestyle(!0)}else this.updateResults.recordRestyle(!1)}computeScene(e){const{config:t}=this,n=this.projection,r=this.geoPath,i=this.scales,o=this.baseScale,a=[...this.baseTranslate],s=[...this.baseRotation],l=this.scene;this.projection=It(t.projection),this.geoPath=Ie(this.projection),this.fitProjection(e),this.geoPath=Ie(this.projection);const c=this.projection;this.scales={projection:c,geoPath:this.geoPath,projectedPoint:(e,t)=>c([e,t]),invertedPoint:(e,t)=>c.invert?c.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const u=this.buildSceneNodes(e);if(this._customLayoutFailedThisBuild)!0===this.lastCustomLayoutFailure?.preservedLastGoodScene?(this.projection=n,this.geoPath=r,this.scales=i,this.baseScale=o,this.baseTranslate=a,this.baseRotation=s):(this.scene=[],this.rebuildQuadtree());else{if(this.scene=u,this.rebuildQuadtree(),t.projectionTransform&&this.applyCartogramTransform(t.projectionTransform,e),t.decay&&this.streaming&&this.applyDecay(),t.pulse&&this.streaming&&this.applyPulse(),t.transition&&!this._hasRenderedOnce&&this.scene.length>0&&t.introAnimation){const t=e.width/2,n=e.height/2,r=this.scene.filter(e=>"point"===e.type).map(e=>({...e,x:t,y:n}));r.length>0&&this.startTransition(r)}this._hasRenderedOnce=!0,t.transition&&l.length>0&&this.startTransition(l),this.version++}}fitProjection(e){const t=this.projection,n=this.config,r=[...this.areas],i=Tt(n.xAccessor,"lon"),o=Tt(n.yAccessor,"lat"),a=this.getPoints();if(a.length>0){const e=a.map(e=>[i(e),o(e)]);r.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:e}})}const s=Dt(n.lineDataAccessor);for(const e of this.lineData){const t=s(e);if(t&&t.length>0){const e=t.map(e=>[i(e),o(e)]);r.push({type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}})}}if(0!==r.length){if(n.projectionExtent){const[[r,i],[o,a]]=n.projectionExtent;t.fitExtent([[0,0],[e.width,e.height]],{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[r,i],[r,a],[o,a],[o,i],[r,i]]]}})}else if(t.clipAngle&&(t.clipAngle()??0)>0){const r=n.fitPadding??0,i=Math.min(e.width,e.height);t.scale(i/2-i*r),t.translate([e.width/2,e.height/2])}else{const i=n.fitPadding??0,o=e.width*i,a=e.height*i;t.fitExtent([[o,a],[e.width-o,e.height-a]],{type:"FeatureCollection",features:r})}this.baseScale=t.scale(),this.baseTranslate=t.translate(),this.baseRotation=t.rotate?.()??[0,0,0]}}applyZoomTransform(e,t){const n=this.projection;if(!n)return;const r=this.geoPath,i=this.scales,o=n.scale(),a=[...n.translate()],s=this.currentZoom;n.scale(this.baseScale*e.k),n.translate([this.baseTranslate[0]*e.k+e.x,this.baseTranslate[1]*e.k+e.y]),this.currentZoom=e.k,this.geoPath=Ie(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyZoomScale(e,t){const n=this.projection;if(!n)return;const r=this.geoPath,i=this.scales,o=n.scale(),a=[...n.translate()],s=this.currentZoom;n.scale(this.baseScale*e),n.translate(this.baseTranslate),this.currentZoom=e,this.geoPath=Ie(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const l=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=l,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}applyRotation(e,t){const n=this.projection;if(!n||!n.rotate)return;const r=this.geoPath,i=this.scales,o=[...n.rotate()];n.rotate(e),this.geoPath=Ie(n),this.scales={projection:n,geoPath:this.geoPath,projectedPoint:(e,t)=>n([e,t]),invertedPoint:(e,t)=>n.invert?n.invert([e,t]):null},this._customLayoutFailedThisBuild=!1;const a=this.buildSceneNodes(t);this._customLayoutFailedThisBuild?this.lastCustomLayoutFailure?.preservedLastGoodScene?(n.rotate(o),this.geoPath=r,this.scales=i):(this.scene=[],this.rebuildQuadtree()):(this.scene=a,this.rebuildQuadtree(),this.config.projectionTransform&&this.applyCartogramTransform(this.config.projectionTransform,t),this.version++)}setRotation(e){const t=this.projection;t&&t.rotate&&t.rotate(e)}hasProjection(){return null!=this.projection}getRotation(){return this.projection?.rotate?.()??this.baseRotation}getBaseProjectionState(){return{scale:this.baseScale,translate:[...this.baseTranslate]}}getPoints(){return this.streaming&&this.pointBuffer?this.pointBuffer.toArray():this.pointData}rebuildQuadtree(){let t=0,n=0;for(const e of this.scene)"point"===e.type&&!1!==e.interactive&&(n++,e.r>t&&(t=e.r));if(this._maxPointRadius=t,e.QUADTREE_THRESHOLD>=n)return void(this._quadtree=null);const r=Array(n);let i=0;for(const e of this.scene)"point"===e.type&&!1!==e.interactive&&(r[i++]=e);this._quadtree=(0,vd.quadtree)().x(e=>e.x).y(e=>e.y).addAll(r)}get quadtree(){return this._quadtree}get maxPointRadius(){return this._maxPointRadius}buildSceneNodes(e){this._customLayoutFailedThisBuild=!1;const{config:t}=this,n=this.projection,r=this.geoPath;if(t.customLayout&&this.scales){const n=t.layoutMargin??{top:0,right:0,bottom:0,left:0},r=bt(t.colorScheme,t.themeCategorical,Bd),i={areas:this.areas.slice(),points:this.getPoints().slice(),lines:this.lineData.slice(),scales:this.scales,dimensions:{width:e.width,height:e.height,margin:n,plot:{x:0,y:0,width:e.width,height:e.height}},theme:{semantic:t.themeSemantic??{},categorical:[...r]},resolveColor:At(r,t.colorScheme),config:t.layoutConfig??{},selection:t.layoutSelection??null},o=Et({family:"geo",logLabel:"geo customLayout",revision:this.version,hasPreviousResult:null!==this.lastCustomLayoutResult,onLayoutError:t.onLayoutError,run:()=>t.customLayout(i)});if("failure"===o.kind)return this.lastCustomLayoutFailure=o.diagnostic,this._customLayoutFailedThisBuild=!0,o.preservedLastGoodScene?this.scene:(this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,[]);const a=o.result,s=a.nodes??[];if(this.customLayoutOverlays=a.overlays??null,this.lastCustomLayoutResult=a,this.lastCustomLayoutFailure=null,this._customRestyle=a.restyle,this.hasCustomRestyle=!!a.restyle,this._baseStyles=/* @__PURE__ */new WeakMap,this.hasCustomRestyle)for(const e of s){this._baseStyles.set(e,e.style);const n=a.restyle?.(e,t.layoutSelection??null);n&&(e.style={...e.style,...n})}return Ct({label:"geo customLayout",nodes:s,overlays:this.customLayoutOverlays,warned:this._customLayoutDiagnosticsWarned}),s}return this.customLayoutOverlays=null,this.lastCustomLayoutResult=null,this.lastCustomLayoutFailure=null,this._customRestyle=void 0,this.hasCustomRestyle=!1,this._baseStyles=/* @__PURE__ */new WeakMap,en({config:t,projection:n,path:r,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:e})}applyCartogramTransform(e,t){const n=Vt(this.scene,e,t,this.areas.length);n&&(this.cartogramLayout=n)}applyDecay(){const e=this.config.decay;if(!e||!this.pointBuffer)return;const t=this.pointBuffer.size;if(0===t)return;const n=this.scene.filter(e=>"point"===e.type);for(let r=0;n.length>r;r++){const i=dt(e,r,t);n[r]._decayOpacity=i,n[r].style={...n[r].style,opacity:i}}}applyPulse(e=this.currentTime()){const t=this.config.pulse;if(!t||!this.timestampBuffer)return!1;const n=this.scene.filter(e=>"point"===e.type),r=this.timestampBuffer.toArray(),i=t.color||"rgba(255,255,255,0.6)",o=t.glowRadius??4;let a=!1;for(let s=0;n.length>s&&r.length>s;s++){const l=ht(t,r[s],e);a=ft(n[s],l,i,o)||a}return a}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(e)}hasActivePulsesAt(e){return!!this.config.pulse&&pt(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}startTransition(e){const t=this.config.transition?.duration??300;if(0>=t)return;const n=/* @__PURE__ */new Map;for(const t of e)"point"===t.type&&t.pointId&&n.set(t.pointId,[t.x,t.y]);const r=this.scene.filter(e=>"point"===e.type);let i=!1;for(const e of r)if(e.pointId){const t=n.get(e.pointId);t&&(e._targetX=e.x,e._targetY=e.y,e.x=t[0],e.y=t[1],(Math.abs(t[0]-e._targetX)>.5||Math.abs(t[1]-e._targetY)>.5)&&(i=!0))}for(const e of r)e.pointId&&!n.has(e.pointId)&&(e._targetOpacity=e.style?.opacity??e.style?.fillOpacity??1,e.style={...e.style,opacity:0},i=!0);i&&(this.activeTransition={startTime:this.currentTime(),duration:t})}cancelIntroAnimation(){this.activeTransition=null;for(const e of this.scene)"point"===e.type&&(null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0),null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0))}advanceTransition(e){if(!this.activeTransition)return!1;const t=at(e,this.activeTransition),n=ot(t),r=this.scene.filter(e=>"point"===e.type);for(const e of r){if(null!=e._targetX&&null!=e._targetY){const t=e.y;e.x=st(e.x,e._targetX,n),e.y=st(t,e._targetY,n)}null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity*n})}if(t>=1){for(const e of r)null!=e._targetX&&(e.x=e._targetX,e.y=e._targetY,e._targetX=void 0,e._targetY=void 0),null!=e._targetOpacity&&(e.style={...e.style,opacity:e._targetOpacity},e._targetOpacity=void 0);return this.activeTransition=null,!1}return!0}};ah.QUADTREE_THRESHOLD=500;var sh=ah;Object.assign(sh.prototype,{getLastUpdateResult:function(){return this.updateResults.last},getUpdateSnapshot:function(){return this.updateResults.last},subscribeUpdateResult:function(e){return this.updateResults.subscribe(e)},setLayoutSelection:function(e){this.config.layoutSelection=e},markStylePaintPending:function(){oh.set(this,!0)},consumeStylePaintPending:function(){const e=!0===oh.get(this);return oh.delete(this),e}});var lh=require("react"),ch=require("d3-selection"),uh=require("d3-zoom"),dh=Object.freeze([]),hh=require("react"),fh={sceneGeometry:0,layout:0,domain:0},ph="production"!==process.env.NODE_ENV,mh={revisions:fh,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},gh=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=fh,this.lastObserved=fh,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){ph&&(this.lastObserved=cn(this.lastObserved,sn(e)))}beforeCompute(e,t){if(!ph)return mh;const n=cn(sn(e),this.lastObserved),r=ln(n),i=!((o=n).sceneGeometry===(a=this.lastConsumed).sceneGeometry&&o.layout===a.layout&&o.domain===a.domain);var o,a;return{revisions:n,signature:r,sawSignals:e.changed.has("scene-geometry")||e.changed.has("layout")||e.changed.has("domain"),wasUnconsumed:i,warnUnconsumed:!t&&i&&this.lastUnconsumedWarning!==r}}afterCompute(e,t,n){if(ph){if(t&&e.wasUnconsumed&&(this.lastConsumed=e.revisions),e.warnUnconsumed&&!t)return console.warn(`[semiotic] ${this.hostName} observed scene-affecting revisions without a scene rebuild: ${e.signature}.`),void(this.lastUnconsumedWarning=e.signature);t&&e.sawSignals&&!e.wasUnconsumed&&!n&&this.lastDuplicateWarning!==e.signature?(console.warn(`[semiotic] ${this.hostName} performed scene rebuild with unchanged scene revisions: ${e.signature}.`),this.lastDuplicateWarning=e.signature):t&&!e.sawSignals&&(this.lastDuplicateWarning="")}}},yh=(0,hh.memo)(function({store:e,diagnostics:t}){return(0,hh.useEffect)(()=>{const n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null}),vh=[40,40],bh=[.5,.5],xh=null,wh=oc(require("react")),kh=require("react"),Sh=require("./semiotic-client-cjs-shared.min.js"),Mh=require("react"),jh=require("react"),Ah="undefined"==typeof window?jh.useEffect:jh.useLayoutEffect,Ch=/* @__PURE__ */new WeakMap,Rh=0,Lh=!1,Ph=null,Nh=null,Eh=null,Ih=null,Th=/* @__PURE__ */new Set,Dh=()=>"undefined"!=typeof performance?performance.now():Date.now(),zh=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=/* @__PURE__ */new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??Dh,this.lastWallTime=Tn(this.clock,0),this.logicalTime=this.lastWallTime,this.pausedValue=!0===e.paused,this.visibleValue=!1!==e.visible,this.setRandomSource(e.random,e.seed)}get isActive(){return!this.pausedValue&&this.visibleValue}get paused(){return this.pausedValue}get seed(){return this.seedValue}get visible(){return this.visibleValue}configure(e){this.setClock(e.clock),this.setRandomSource(e.random,e.seed)}setPaused(e){this.pausedValue!==e&&(this.advance(),this.pausedValue=e,this.emit())}setVisible(e){this.visibleValue!==e&&(this.advance(),this.visibleValue=e,this.emit())}snapshot(){return{now:this.now(),paused:this.pausedValue,seed:this.seedValue,visible:this.visibleValue}}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}advance(){const e=Tn(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??Dh;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=Tn(t,this.lastWallTime))}setRandomSource(e,t){const n=In(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:En(n)))}},_h=34,Oh=58,Fh=16,Wh=6,Bh=10,Hh=22,$h=100,qh=10,Gh=3,Vh=46,Uh=26,Yh=22,Xh=46,Zh=64,Kh=34,Qh=70,Jh="undefined"==typeof window?kh.useEffect:kh.useLayoutEffect,ef={requestAnimationFrame:e=>("undefined"==typeof window?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>("undefined"==typeof window?globalThis:window).cancelAnimationFrame(e)},tf=require("react"),nf=require("react"),rf={fresh:1,aging:.7,stale:.45,expired:.25},of={alpha:1,band:"fresh",isStale:!1},af=require("react/jsx-runtime"),sf={live:"#28a745",stale:"#dc3545",stopped:"#6c757d",failed:"#842029",settling:"#fd7e14"},lf=oc(require("react")),cf=require("./semiotic-client-cjs-shared.min.js"),uf=require("react"),df=require("react/jsx-runtime"),hf="var(--semiotic-bg, #ffffff)",ff=require("react/jsx-runtime"),pf=require("react/jsx-runtime"),mf=oc(require("react")),gf=require("react/jsx-runtime"),yf=require("d3-hierarchy"),vf=require("d3-shape"),bf=null,xf=require("react/jsx-runtime"),wf=/* @__PURE__ */new Map,kf=new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]),Sf=require("react/jsx-runtime"),Mf={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"},jf=require("react/jsx-runtime"),Af={secondary:0,primary:3},Cf=require("react/jsx-runtime"),Rf={linear:vf.curveLinear,monotoneX:vf.curveMonotoneX,monotoneY:vf.curveMonotoneY,step:vf.curveStep,stepAfter:vf.curveStepAfter,stepBefore:vf.curveStepBefore,basis:vf.curveBasis,cardinal:vf.curveCardinal,catmullRom:vf.curveCatmullRom},Lf=new Set(["label","callout","callout-circle","callout-rect","text","widget"]),Pf=(new Set(["label","callout","callout-circle","callout-rect"]),32),Nf=6,Ef=4,If=8,Tf=72,Df={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"},zf=oc(require("react")),_f={fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},Of={fontSize:"var(--semiotic-legend-font-size, 12px)"},Ff=oc(require("react")),Wf=require("react/jsx-runtime"),Bf=require("react/jsx-runtime"),Hf=(e,t,n,r,i,o,a,s,l,c,u)=>{const{items:d}=e,h=[];let f=0;const p={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=i,metrics:u};return d.forEach((e,t)=>{h.push(Bi(p,e,t,`translate(0,${f})`,"ArrowUp","ArrowDown")),f+=u.rowHeight}),h},$f=(e,t,n,r,i,o,a,s,l,c,u,d)=>{const{items:h}=e,f=[],{swatchSize:p,labelGap:m,itemGap:g,rowHeight:y,align:v}=u,b={legendGroup:e,customClickBehavior:t,customHoverBehavior:n,highlightedCategory:r,isolatedCategories:i,focusedGroupIndex:o,focusedItemIndex:a,groupIndex:s,onFocusedIndexChange:l,interactive:!(!t&&!n),useIsolateAria:"isolate"===c||void 0===c&&null!=i,metrics:u},x=h.map(e=>p+m+7*e.label.length),w=[];let k=0,S=0;x.forEach((e,t)=>{const n=0===S?e:S+g+e;d&&d>0&&S>0&&n>d?(w.push({start:k,end:t,width:S}),k=t,S=e):S=n}),h.length>0&&w.push({start:k,end:h.length,width:S}),w.forEach((e,t)=>{let n="center"===v?Math.max(0,((d??e.width)-e.width)/2):"end"===v?Math.max(0,(d??e.width)-e.width):0;for(let r=e.start;e.end>r;r++)f.push(Bi(b,h[r],r,`translate(${n},${t*y})`,"ArrowLeft","ArrowRight")),n+=x[r]+g});const M=w.reduce((e,t)=>Math.max(e,t.width),0),j=w.length;return{items:f,offset:M,totalRows:j,totalHeight:j*y}},qf=({legendGroups:e,width:t,customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:a,focusedItemIndex:s,onFocusedIndexChange:l,legendInteraction:c,metrics:u})=>{const d=[],h=Qn(e.map(e=>({hasLabel:!!e.label,itemCount:e.items.length})),u.rowHeight);return e.forEach((e,f)=>{const p=h[f];d.push(
|
|
167
|
+
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */(0,Bf.jsx)("line",{stroke:"gray",x1:0,y1:p.lineY,x2:t,y2:p.lineY},"legend-top-line legend-symbol-"+f)),e.label&&null!=p.labelY&&d.push(
|
|
169
|
+
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */(0,Bf.jsx)("text",{y:p.labelY,className:"legend-group-label",fontSize:12,style:Of,fill:"var(--semiotic-text, #333)",children:e.label},"legend-text-"+f)),d.push(
|
|
171
|
+
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */(0,Bf.jsx)("g",{className:"legend-item",transform:`translate(0,${p.itemsY})`,children:Hf(e,n,r,i,o,a,s,f,l,c,u)},"legend-group-"+f))}),d},Gf=({legendGroups:e,height:t,width:n,customClickBehavior:r,customHoverBehavior:i,highlightedCategory:o,isolatedCategories:a,focusedGroupIndex:s,focusedItemIndex:l,onFocusedIndexChange:c,legendInteraction:u,metrics:d})=>{let h=0;const f=[];e.forEach((e,t)=>{let p=0;e.label&&(p+=16);const m=$f(e,r,i,o,a,s,l,t,c,u,d,d.maxWidth??n);p+=m.offset+5,f.push({label:e.label,...m,offset:p,totalRows:m.totalRows,totalHeight:m.totalHeight}),h+=p+12});const p=d.maxWidth??n;let m=h>p?0:"center"===d.align?Math.max(0,(p-h)/2):"end"===d.align?Math.max(0,p-h):0;const g=[];return f.forEach((n,r)=>{const i=e[r];i.label&&(g.push(
|
|
173
|
+
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */(0,Bf.jsx)("text",{transform:`translate(${m},0) rotate(90)`,textAnchor:"start",className:"legend-group-label",fontSize:12,style:Of,fill:"var(--semiotic-text, #333)",children:i.label},"legend-text-"+r)),m+=16),g.push(
|
|
175
|
+
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */(0,Bf.jsx)("g",{className:"legend-item",transform:`translate(${m},0)`,children:n.items},"legend-group-"+r)),m+=n.offset+5,e[r+1]&&g.push(
|
|
177
|
+
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */(0,Bf.jsx)("line",{stroke:"gray",x1:m,y1:-8,x2:m,y2:(n.totalHeight||t)+0+8},"legend-top-line legend-symbol-"+r)),m+=12}),/* @__PURE__ */ /* @__PURE__ */(0,Bf.jsx)("g",{children:g})},Vf=require("react/jsx-runtime"),Uf=require("react/jsx-runtime"),Yf=require("react/jsx-runtime"),Xf=oc(require("react")),Zf=(oc(require("react")),require("react/jsx-runtime")),Kf=oc(require("react")),Qf=require("react/jsx-runtime"),Jf=require("react/jsx-runtime"),ep="undefined"==typeof window||"undefined"==typeof document,tp=require("react"),np="undefined"!=typeof window?tp.useLayoutEffect:tp.useEffect,rp=()=>()=>{},ip=()=>!1,op=()=>!0,ap=require("react"),sp=require("react/jsx-runtime"),lp="undefined"==typeof window?ap.useEffect:ap.useLayoutEffect,cp=require("react"),up=oc(require("react")),dp=oc(require("react")),hp=(require("react/jsx-runtime"),dp.createContext(null)),fp=require("react/jsx-runtime"),pp={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},mp=e=>{if(null==e)return"";const t=Math.round(100*e)/100;return Number.isNaN(t)?"":t+""},gp=require("react/jsx-runtime"),yp=up.lazy(()=>Promise.resolve().then(()=>(dc(),ac))),vp="semiotic-accessible-data-table",bp=vp+" semiotic-accessible-data-table-hidden",xp=vp+" semiotic-accessible-data-table-visible",wp={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},kp={position:"absolute",top:0,left:0,right:0,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",padding:"14px 16px 12px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontFamily:"var(--semiotic-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)",fontSize:13,lineHeight:1.5,color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",borderRadius:"var(--semiotic-border-radius, 0px) var(--semiotic-border-radius, 0px) 0 0"},Sp={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},Mp={position:"absolute",top:10,right:10,width:22,height:22,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",cursor:"pointer",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:13,lineHeight:1,padding:0,borderRadius:"var(--semiotic-border-radius, 4px)"},jp={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},Ap={textAlign:"left",padding:"5px 10px",borderBottom:"2px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",fontWeight:600,fontSize:11,textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))"},Cp={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},Rp={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},Lp={marginTop:8,padding:"4px 10px",fontSize:12,cursor:"pointer",border:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))",borderRadius:"var(--semiotic-border-radius, 4px)",background:"var(--semiotic-data-table-bg, var(--semiotic-surface, var(--semiotic-bg, #fff)))",color:"var(--semiotic-data-table-text, var(--semiotic-text, #333))",fontFamily:"inherit"},Pp=require("react"),Np=require("react/jsx-runtime"),Ep="var(--semiotic-focus, #005fcc)",Ip=oc(require("react")),Tp=oc(require("react")),Dp=require("react/jsx-runtime"),zp={background:"var(--semiotic-tooltip-bg, rgba(0, 0, 0, 0.85))",color:"var(--semiotic-tooltip-text, white)",padding:"8px 12px",borderRadius:"var(--semiotic-tooltip-radius, 6px)",fontSize:"var(--semiotic-tooltip-font-size, 14px)",fontFamily:"var(--semiotic-font-family, inherit)",lineHeight:"1.5",boxShadow:"var(--semiotic-tooltip-shadow, 0 2px 8px rgba(0, 0, 0, 0.15))",pointerEvents:"none",maxWidth:"300px",wordWrap:"break-word"};Bo(Wo);var _p,Op=require("react/jsx-runtime"),Fp=require("d3-zoom"),Wp=require("d3-selection"),Bp=require("d3-shape"),Hp=require("d3-shape"),$p=(e,t,n,r)=>{const i=t.filter(e=>"line"===e.type);for(const t of i){if(2>t.path.length)continue;const n=t._introClipFraction;void 0!==n&&1>n&&(e.save(),e.beginPath(),e.rect(0,0,r.width*n,r.height),e.clip());const i=t.style.stroke||"#007bff",o=Nn(e,i)||i,a=t.style.strokeWidth??2,s=t.colorThresholds,l=t.rawValues;if(e.setLineDash(t.style.strokeDasharray?t.style.strokeDasharray.split(/[\s,]+/).map(Number):[]),null!=t.style.opacity&&(e.globalAlpha=t.style.opacity),a>0&&(e.lineWidth=a),e.lineCap=t.style.strokeLinecap||"butt",t.style._edgeFade&&a>0){ra(e,t.path,o,a,t.style.opacity??1,t.style.strokeLinecap||"butt"),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt";continue}const c=Vo(t.curve),u=s&&s.length>0&&l&&l.length===t.path.length,d=t._decayOpacities;if(a>0&&d&&d.length===t.path.length&&!u){e.strokeStyle=o;const n=t.style.opacity??1;for(let r=0;t.path.length-1>r;r++)e.globalAlpha=.5*(d[r]+d[r+1])*n,e.beginPath(),e.moveTo(t.path[r][0],t.path[r][1]),e.lineTo(t.path[r+1][0],t.path[r+1][1]),e.stroke()}else if(a>0&&!u){e.beginPath();const n=t.strokeGradient&&t.path.length>=2?Xo(e,t.strokeGradient,o,t.path[0][0],0,t.path[t.path.length-1][0],0):null;if(e.strokeStyle=n||o,c)(0,Hp.line)().x(e=>e[0]).y(e=>e[1]).curve(c).context(e)(t.path);else{const[n,r]=t.path[0];e.moveTo(n,r);for(let n=1;t.path.length>n;n++)e.lineTo(t.path[n][0],t.path[n][1])}e.stroke()}else if(a>0){const n=na(t.path,l,s,o);for(const t of n){e.beginPath(),e.strokeStyle=Nn(e,t.color)||t.color,e.moveTo(t.path[0][0],t.path[0][1]);for(let n=1;t.path.length>n;n++)e.lineTo(t.path[n][0],t.path[n][1]);e.stroke()}}if(t.style.fill&&t.style.fillOpacity&&t.style.fillOpacity>0){if(e.beginPath(),e.globalAlpha=t.style.fillOpacity,e.fillStyle=Uo(e,t.style.fill,t.style.fill),c&&!u)(0,Hp.line)().x(e=>e[0]).y(e=>e[1]).curve(c).context(e)(t.path);else{const[n,r]=t.path[0];e.moveTo(n,r);for(let n=1;t.path.length>n;n++)e.lineTo(t.path[n][0],t.path[n][1])}const n=t.path[0][0];e.lineTo(t.path[t.path.length-1][0],r.height),e.lineTo(n,r.height),e.closePath(),e.fill()}void 0!==n&&1>n&&e.restore(),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt"}},qp=(e,t,n,r)=>{const i=t.filter(e=>"point"===e.type);if(0!==i.length){e.save();try{const t=e.globalAlpha;let n=[],r="";const o=n=>{e.beginPath(),e.arc(n.x,n.y,n.r,0,2*Math.PI),e.globalAlpha=t*(n.style.opacity??n.style.fillOpacity??1),e.fillStyle=Uo(e,n.style.fill,"#4e79a7"),e.fill();const r=n.style.strokeWidth??1;n.style.stroke&&"none"!==n.style.stroke&&r>0&&(e.strokeStyle=Uo(e,n.style.stroke,n.style.stroke),e.lineWidth=r,e.stroke()),Qo(e,n)},a=()=>{if(0===n.length)return;if(1===n.length)return o(n[0]),n=[],void(r="");const i=n[0];e.globalAlpha=t*(i.style.opacity??i.style.fillOpacity??1),e.beginPath();for(const t of n)e.moveTo(t.x+t.r,t.y),e.arc(t.x,t.y,t.r,0,2*Math.PI);e.fillStyle=Uo(e,i.style.fill,"#4e79a7"),e.fill();const a=i.style.strokeWidth??1;i.style.stroke&&"none"!==i.style.stroke&&a>0&&(e.strokeStyle=Uo(e,i.style.stroke,i.style.stroke),e.lineWidth=a,e.stroke()),n=[],r=""};for(const e of i){const t=e.style.opacity??e.style.fillOpacity??1,i=e.style.fill;if(Ko(e)||null!=i&&"string"!=typeof i||1>t){a(),o(e);continue}const s=e.style.strokeWidth??1,l=`${i??"#4e79a7"}\0${e.style.stroke&&"none"!==e.style.stroke&&s>0?e.style.stroke+"":""}\0${s}\0${e.r}\0${t}`;n.length>0&&l!==r&&a(),r=l,n.push(e),2048>n.length||a()}a()}finally{e.restore()}}},Gp=(e,t)=>{const n=e.globalAlpha;for(const r of t)"glyph"===r.type&&ia(e,r,r.x,r.y,n);e.globalAlpha=n},Vp=/* @__PURE__ */new WeakMap,Up=1,Yp=class{constructor(e=256){this.cache=/* @__PURE__ */new Map,this.limit=ca(e)}setLimit(e){this.limit=ca(e),this.cache.size>this.limit&&this.evict()}get(e){const t=this.cache.get(e);return t&&(t.lastUsed=performance.now()),t}set(e,t){this.cache.set(e,t),this.cache.size>this.limit&&this.evict()}evict(){for(;this.cache.size>this.limit;){let e,t=1/0;for(const[n,r]of this.cache)t>r.lastUsed&&(t=r.lastUsed,e=n);if(!e)break;{const t=this.cache.get(e);t&&(t.img.onload=null,t.img.onerror=null,t.img.src=""),this.cache.delete(e)}}}clear(){for(const e of this.cache.values())e.img.onload=null,e.img.onerror=null,e.img.src="";this.cache.clear()}},Xp=class{constructor(e){this.capacity=e,this.particles=Array(e);for(let t=0;e>t;t++)this.particles[t]={t:0,offset:0,lineIndex:0,active:!1,x:0,y:0}}spawn(e,t=Math.random){for(let n=0;this.capacity>n;n++){const r=this.particles[n];if(!r.active)return r.active=!0,r.t=0,r.offset=.6*(t()-.5),r.lineIndex=e,r.x=0,r.y=0,r}return null}step(e,t,n,r){for(let i=0;this.capacity>i;i++){const o=this.particles[i];if(!o.active)continue;const a=n[o.lineIndex];if(!a||2>a.length){o.active=!1;continue}if(o.t+=e*t,o.t>=1){o.active=!1;continue}const s=da(a),l=ha(a,o.t*s),c=(r[o.lineIndex]||2)/2;o.x=l.x+l.nx*o.offset*c*2,o.y=l.y+l.ny*o.offset*c*2}}countForLine(e){let t=0;for(let n=0;this.capacity>n;n++)this.particles[n].active&&this.particles[n].lineIndex===e&&t++;return t}clear(){for(let e=0;this.capacity>e;e++)this.particles[e].active=!1}},Zp=oc(require("react")),Kp=oc(require("react")),Qp=require("react/jsx-runtime"),Jp=/* @__PURE__ */new Set,em=["name","label","title"],tm=["type","kind","category","group","class","status","role","shape"],nm=["value","amount","total","count","weight","score"],rm=/* @__PURE__ */new Set(["x","y","z","x0","x1","y0","y1","r","cx","cy","radius","layer","row","rowindex","col","column","depth","index","order","sankeywidth","coincidentpoints","sourcelinks","targetlinks","parent","children","fx","fy","vx","vy"]),im=require("react/jsx-runtime"),om=(require("react/jsx-runtime"),require("react/jsx-runtime"));Na.ownsChrome=!0;var am={top:10,right:10,bottom:10,left:10},sm=null,lm={width:28,height:28,border:"1px solid rgba(0,0,0,0.2)",borderRadius:4,background:"rgba(255,255,255,0.9)",color:"#333",fontSize:16,fontWeight:600,lineHeight:1,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,boxShadow:"0 1px 3px rgba(0,0,0,0.1)"},cm=require("react"),um=require("react"),dm="__semioticSelectionData",hm=oc(require("react")),fm=require("react"),pm=require("react/jsx-runtime"),mm=(0,Lc.memo)((0,Lc.forwardRef)(function(e,t){const{projection:n,projectionExtent:r,fitPadding:i,projectionTransform:o,areas:a,points:s,lines:l,customLayout:c,layoutConfig:u,layoutSelection:d,onLayoutError:h,xAccessor:f,yAccessor:p,lineDataAccessor:m,pointIdAccessor:g,lineIdAccessor:y,lineType:v="geo",flowStyle:b="basic",graticule:x,zoomable:w,zoomExtent:k,onZoom:S,dragRotate:M,showParticles:j,particleStyle:A,tileURL:C,tileAttribution:R,tileCacheSize:L,size:P,width:N,height:E,responsiveWidth:I,responsiveHeight:T,margin:D,className:z,background:_,maxDevicePixelRatio:O,windowSize:F=500,renderMode:W,areaStyle:B,pointStyle:H,lineStyle:$,colorScheme:q,enableHover:G=!0,hoverAnnotation:V,tooltipContent:U,allowTooltipOverflow:Y=!1,customClickBehavior:X,customHoverBehavior:Z,onObservation:K,annotationObservationCallback:Q,chartId:J,annotations:ee,onAnnotationActivate:te,autoPlaceAnnotations:ne,svgAnnotationRules:re,decay:ie,pulse:oe,transition:ae,animate:se,staleness:le,frameScheduler:ce,clock:ue,random:de,seed:he,paused:fe=!1,suspendWhenHidden:pe=!0,backgroundGraphics:me,foregroundGraphics:ge,title:ye,legend:ve,legendPosition:be,legendLayout:xe,legendHoverBehavior:we,legendClickBehavior:ke,legendHighlightedCategory:Se,legendIsolatedCategories:Me,legendCategoryAccessor:je,onCategoriesChange:Ae,showAxes:Ce,accessibleTable:Re=!0,description:Le,summary:Pe}=e,{customHoverBehavior:Ne,customClickBehavior:Ee,hasClickBehavior:Ie}=Wa({customHoverBehavior:Z,customClickBehavior:X,onObservation:K,chartId:J,chartType:"StreamGeoFrame"}),Te=P||[N||600,E||400],De=(0,Lc.useRef)(!0),ze=tr({sizeProp:Te,responsiveWidth:I,responsiveHeight:T,userMargin:D,marginDefault:am,title:ye,legend:ve,legendPosition:be,legendLayout:xe,legendMarginReserved:e.__legendMarginReservedFor===ve,animate:se,transitionProp:ae,frameScheduler:ce,clock:ue,random:de,seed:he,paused:fe,suspendWhenHidden:pe,themeDirtyRef:De}),{reducedMotionRef:_e,responsiveRef:Oe,size:Fe,margin:We,adjustedWidth:Be,adjustedHeight:He,transition:$e,introEnabled:qe,tableId:Ge,frameRuntime:Ve,rafRef:Ue,renderFnRef:Ye,scheduleRender:Xe,currentTheme:Ze}=ze,Ke=oo(),Qe=ao(),Je=(0,Lc.useMemo)(()=>Array.isArray(a)?on(a):a,[a]),et=(0,Lc.useMemo)(()=>on(s),[s]),tt=(0,Lc.useMemo)(()=>on(l),[l]),nt=M??"orthographic"===Ta(n),rt=xo((0,Lc.useMemo)(()=>({projection:n,projectionExtent:r,fitPadding:i,xAccessor:f,yAccessor:p,lineDataAccessor:m,lineType:v,flowStyle:b,areaStyle:B,pointStyle:H,lineStyle:$,colorScheme:q,themeSemantic:ir(Ze),themeSequential:Ze?.colors?.sequential,themeDiverging:Ze?.colors?.diverging,themeCategorical:Ze?.colors?.categorical,graticule:x,projectionTransform:o,windowSize:F,clock:Ve.now,decay:ie,pulse:oe,transition:$e,introAnimation:qe,annotations:ee,pointIdAccessor:g,lineIdAccessor:y,customLayout:c,layoutConfig:u,onLayoutError:h,layoutMargin:We}),[n,r,i,f,p,m,v,b,B,H,$,q,Ze,x,o,F,Ve.now,ie,oe,$e,qe,ee,g,y,c,u,h,We])),it=(0,Lc.useRef)(null);it.current||(it.current=new sh(rt));const ot=it.current,at=(0,Lc.useRef)(null),st=at.current??(at.current=Ua(ot.scales)),lt=ep||!Ke&&Qe;lt&&(Je||s||l)&&(Je&&ot.setAreas(Je),s&&ot.setPoints(et),l&&ot.setLines(tt),ot.computeScene({width:Be,height:He}));const{resolvedForeground:ct,resolvedBackground:ut,themeBackground:dt,surfaceBackground:ht}=Xa({foregroundGraphics:ge,backgroundGraphics:me,size:Fe,margin:We,scales:ot.scales,background:_,themeBackgroundColor:Ze.colors.background,tracker:st,readScales:()=>ot.scales}),ft=(0,Lc.useRef)(null),pt=(0,Lc.useRef)(null),mt=(0,Lc.useRef)(null);C&&!mt.current&&(mt.current=new Yp(L??256)),mt.current?.setLimit(L??256);const gt=(0,Lc.useRef)(ee),yt=(0,Lc.useRef)(null),vt=(0,Lc.useRef)(Fp.zoomIdentity),bt=(0,Lc.useRef)(!1),xt=(0,Lc.useRef)(null),wt=(0,Lc.useCallback)(e=>{xt.current=e,Oe&&"object"==typeof Oe&&(Oe.current=e)},[Oe]),kt=(0,Lc.useRef)(null),St=(0,Lc.useRef)(null),Mt=(0,Lc.useRef)(null),jt=(0,Lc.useRef)(0);if(j&&!Mt.current){const e=A?.maxPerLine??Ia();Mt.current=new Xp(50*e)}const At=(0,Lc.useRef)(null),Ct=(0,Lc.useRef)(!1),Rt=(0,Lc.useRef)(null),Lt=(0,Lc.useRef)(!1),Pt=(0,Lc.useRef)(!1),Nt=(0,hh.useRef)(new gh("StreamGeoFrame")),Et=(0,Lc.useRef)(void 0),[It,Tt]=(0,Lc.useState)(null),[,Dt]=(0,Lc.useState)(0),zt=(0,Lc.useRef)(0),[_t,Ot]=(0,Lc.useState)(!1),Ft=Oo(it,je,Ae,e=>e.getPoints());nr(it,rt,De,Xe),rr(it,d,De,Xe),(0,Lc.useEffect)(()=>{const e=it.current;e&&(Je&&e.setAreas(Je),s&&e.setPoints(et),l&&e.setLines(tt),De.current=!0,Xe())},[Je,s,et,l,tt,Xe]),an(t,{storeRef:it,dirtyRef:De,scheduleRender:Xe,zoomTransformRef:vt,containerRef:xt,zoomBehaviorRef:yt});const{hoverHandlerRef:Wt,onPointerMove:Bt,onPointerLeave:Ht,pointerStateRef:$t}=ze,{canvasRef:qt,interactionCanvasRef:Gt,resolutionDirtyRef:Vt}=po(ze,{hydrated:Ke,wasHydratingFromSSR:Qe,storeRef:it,dirtyRef:De,cleanup:()=>mt.current?.clear(),maxDevicePixelRatio:O,canvasPaintDependencies:[Be,He,_,me,W,C,L,Xe]});(0,Lc.useEffect)(()=>{Wt.current=e=>{const t=qt.current;if(!t)return;const n=it.current;if(!n||!n.scene.length)return void eo(t);const r=za({pointer:e,canvasRect:t.getBoundingClientRect(),margin:We,width:Be,height:He,scene:n.scene,pointQuadtree:n.quadtree,maxPointRadius:n.maxPointRadius,hitCanvasRef:pt});eo(t,"hit"===r.kind?Qi(r.node):void 0),G&&!1!==V&&("hit"===r.kind?(At.current=r.hover,Rt.current=r.node,Tt(r.hover),Ne?.(r.hover),Xe()):("outside"===r.kind||"miss"===r.kind&&At.current)&&(At.current=null,Rt.current=null,Tt(null),Ne?.(null),Xe()))}},[G,V,Be,He,We,Ne,Xe,Wt,qt]),ze.hoverLeaveRef.current=()=>{eo(qt.current),G&&!1!==V&&(At.current=null,Rt.current=null,Tt(null),Ne?.(null),Xe())},to(qt);const Ut=(0,Lc.useCallback)(e=>{if((t=e.target)instanceof Element&&null!=t.closest("[data-semiotic-annotation-widget]"))return;var t;if(!Ee)return;const n=it.current;if(!n||!n.scene.length)return void Ee(null);const r=e.currentTarget.getBoundingClientRect(),i=e.clientX-r.left-We.left,o=e.clientY-r.top-We.top;if(0>i||i>Be||0>o||o>He)return void Ee(null);pt.current||(pt.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const a=Da(pt.current);if(!a)return void Ee(null);const s=fa(30,Et.current),l=fa(6,Et.current),c=wn(n.scene,i,o,s,a,n.quadtree,n.maxPointRadius,l);if(c){const e=c.node.datum,t=Array.isArray(e)?null:e?.properties?e:e?.data||e,n=t?.properties?{...t,...t.properties}:t;return void Ee({...n,data:t,properties:t?.properties,__semioticHoverData:!0,x:i,y:o,time:i,value:o},{type:"activate",inputType:(u=Et.current,"touch"===u?"touch":"pointer")})}var u;Ee(null)},[He,Be,Ee,We]),{kbFocusIndexRef:Yt,focusedNavPointRef:Xt,onKeyDown:Zt}=qa({storeRef:it,hoverRef:At,hoveredNodeRef:Rt,setHoverPoint:Tt,customHoverBehavior:Ne,customClickBehavior:Ee,scheduleRender:Xe}),Kt=(0,Lc.useCallback)(e=>{var t,n,r,i;n=G&&!1!==V,r=Ct.current,i=qt.current,Za(t=$t,e,void 0),(n||r)&&(n||"touch"!==t.current.pointerType||(eo(i),0))&&(Et.current=e.pointerType,Yt.current=-1,Xt.current=null,Bt(e))},[qt,G,V,Xt,Yt,Bt,$t]),Qt=(0,Lc.useCallback)(e=>{Et.current=e.pointerType},[]);Ye.current=()=>{if(Ue.current=null,st.sync(it.current?.scales??null),!Ve.isActive)return;const e=qt.current,t=it.current;if(!e||!t)return;const n=Ve.now();let r=!1;const i=St.current;let o=!1;i&&(St.current=null,t.applyRotation(i,{width:Be,height:He}),o=!0);const a=null!=t.activeTransition,s=t.advanceTransition(_e.current?n+1e6:n),l=!_e.current&&s,c=Nt.current.beforeCompute(t.getLastUpdateResult(),l);let u=!1;if(De.current&&!s){const e={width:Be,height:He},n=t.hasProjection(),r=nt&&n?t.getRotation():null;t.computeScene(e);const i=vt.current,o=1!==i.k||0!==i.x||0!==i.y;nt&&r?o?(t.setRotation(r),t.applyZoomScale(i.k,e)):t.applyRotation(r,e):o&&t.applyZoomTransform(i,e),De.current=!1,u=!0,Ft()}st.sync(t.scales),Nt.current.afterCompute(c,u,!1);const d=uo(O,Fe),h=j&&!_e.current&&!!Mt.current,f=t.consumeStylePaintPending();(u||o||f)&&(Ct.current=Ji(t.scene),Ct.current||eo(e)),Ct.current&&(a||u||o||f)&&Ka({canvas:e,pointer:$t.current,store:t,margin:We,width:Be,height:He,hitCanvasRef:pt,geometryMoved:a||u||o});const p=un(t,n,u,Pt),m=!!((g={dirtyOrRebuilt:u,transitioning:a,continuous:h,liveEncoding:p.changed,forced:o||f||Vt.current}).dirtyOrRebuilt||g.transitioning||g.animationTicked||g.continuous||g.liveEncoding||g.forced);var g;if(Vt.current=!1,C&&mt.current){const e=ft.current;if(e&&t.scales?.projection){const n=co(e,Fe,We,d);n&&(n.clearRect(-We.left,-We.top,Fe[0],Fe[1]),n.save(),n.beginPath(),n.rect(0,0,Be,He),n.clip(),ua(n,{tileURL:C,projection:t.scales.projection,width:Be,height:He,tileCache:mt.current,maxDevicePixelRatio:O,onTileLoad:()=>Xe()}),n.restore())}}if(m){const i=co(e,Fe,We,d);if(!i)return;i.clearRect(-We.left,-We.top,Fe[0],Fe[1]),C||So(i,{background:_,themeBackground:dt,hasBackgroundGraphics:!!me,x:-We.left,y:-We.top,width:Fe[0],height:Fe[1]}),i.save(),i.beginPath(),i.rect(0,0,Be,He),i.clip();const o=t.scene,a={width:Be,height:He};if(xa({context:i,nodes:o,renderMode:W,pixelRatio:d,paintBuiltIn:e=>{ea(i,e),$p(i,e,0,a),qp(i,e),Gp(i,e)}}),h&&Mt.current){const e=Mt.current,t=o.filter(e=>"line"===e.type);if(t.length>0){const o=A||{},a=.3*(o.speedMultiplier??1),s=o.maxPerLine??Ia(),l=o.spawnRate??(Ea()?.06:.15),c=o.radius??2,u=o.opacity??.7,d=n/1e3,h=jt.current>0?Math.min(d-jt.current,.1):.016;jt.current=d;const f=t.map(e=>e.path),p=t.map(e=>e.style.strokeWidth??2);for(let n=0;t.length>n;n++)Ve.random()<l&&e.countForLine(n)<s&&e.spawn(n,Ve.random);e.step(h,a,f,p),i.globalAlpha=u;for(let n=0;e.particles.length>n;n++){const r=e.particles[n];if(!r.active)continue;const a=t[r.lineIndex],s="function"==typeof o.color?o.color(a?.datum??{}):"source"!==o.color&&o.color?o.color:a?.style.stroke||"#fff";i.beginPath(),i.arc(r.x,r.y,c,0,2*Math.PI),i.fillStyle=s,i.fill()}i.globalAlpha=1,r=!0}}i.restore()}(u||a&&!s)&&e.setAttribute("aria-label",Eo(t.scene,"Geographic chart"));const y=Rt.current,v=!(!y||"geoarea"!==y.type&&"point"!==y.type),b=Gt.current;if(b&&(v||Lt.current)){const e=co(b,Fe,We,d);if(e){if(e.clearRect(-We.left,-We.top,Fe[0],Fe[1]),y&&"geoarea"===y.type){const t=new Path2D(y.pathData);e.fillStyle="rgba(255, 255, 255, 0.3)",e.fill(t),e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke(t)}if(y&&"point"===y.type){const t=y,n="object"==typeof V?V:void 0,r=n?.pointColor||pa(y);e.beginPath(),e.arc(t.x,t.y,t.r+3,0,2*Math.PI),r?(e.save(),e.globalAlpha=.4,e.fillStyle=r,e.fill(),e.restore()):(e.fillStyle="rgba(255, 255, 255, 0.4)",e.fill()),e.strokeStyle=r||"rgba(0, 0, 0, 0.5)",e.lineWidth=2,e.stroke()}}Lt.current=v}const x=ee!==gt.current;x&&(gt.current=ee),(u||x||a&&ee&&ee.length>0)&&(u||x||a&&!s||n-zt.current>=33)&&(Dt(e=>e+1),zt.current=n),(l||null!=t.activeTransition||p.pending||r)&&Xe()},ar(le,it,De,Xe,Ve.now,_t,Ot),(0,Lc.useEffect)(()=>{if("production"!==process.env.NODE_ENV&&C){const e=Ta(n);e&&"mercator"!==e&&console.warn(`[StreamGeoFrame] tileURL is set but projection is "${e}". Raster tiles use Web Mercator and will not align with other projections.`)}},[C,n]),(0,Lc.useEffect)(()=>{const e=xt.current;if(!w||!e)return yt.current&&e&&((0,Wp.select)(e).on(".zoom",null),yt.current=null),void(e&&(0,Wp.select)(e).on("mousedown.rotate",null).on("touchstart.rotate",null));const[t,n]=k||[1,8],r={width:Be,height:He};if(nt){let i=vt.current.k;const o=e=>{i=Math.max(t,Math.min(n,e)),vt.current=Fp.zoomIdentity.scale(i);const o=it.current;o&&(o.applyZoomScale(i,r),De.current=!1,Xe(),o.scales?.projection&&S?.({projection:o.scales.projection,zoom:o.currentZoom}))};yt.current={scaleBy:(e,t)=>o(i*t),transform:(e,t)=>o(t?.k??1)};const a=e=>{e.preventDefault(),o(i*(0>e.deltaY?1.1:1/1.1))},s=e=>{const t=e.target;t&&(t.closest("button")||t.closest(".stream-geo-zoom-controls"))||(e.preventDefault(),o(1.5*i))};e.addEventListener("wheel",a,{passive:!1}),e.addEventListener("dblclick",s);const l=.4,c=t=>{if(0!==t.button)return;const n=t.target;if(n.closest("button")||n.closest(".stream-geo-zoom-controls"))return;const r=it.current;if(!r)return;const i=r.getRotation();kt.current={x:t.clientX,y:t.clientY,rotation:[...i]},e.setPointerCapture(t.pointerId),t.preventDefault()},u=e=>{const t=kt.current;t&&(St.current=[t.rotation[0]+(e.clientX-t.x)*l,Math.max(-90,Math.min(90,t.rotation[1]-(e.clientY-t.y)*l)),t.rotation[2]],Xe())},d=t=>{if(!kt.current)return;kt.current=null,e.releasePointerCapture(t.pointerId);const n=St.current;if(n){St.current=null;const e=it.current;e&&(e.applyRotation(n,r),Xe())}const i=it.current;i?.scales?.projection&&S?.({projection:i.scales.projection,zoom:i.currentZoom})};return e.addEventListener("pointerdown",c),e.addEventListener("pointermove",u),e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("wheel",a),e.removeEventListener("dblclick",s),e.removeEventListener("pointerdown",c),e.removeEventListener("pointermove",u),e.removeEventListener("pointerup",d),e.removeEventListener("pointercancel",d),yt.current=null}}const i=(0,Fp.zoom)().scaleExtent([t,n]).extent([[0,0],[Fe[0],Fe[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",e=>{const t=e.transform;vt.current=t,bt.current=!0;const n=it.current;n&&(n.applyZoomTransform(t,r),De.current=!1,Xe())}).on("end",e=>{vt.current=e.transform,bt.current=!1;const t=it.current;t?.scales?.projection&&S?.({projection:t.scales.projection,zoom:t.currentZoom})});return yt.current=i,(0,Wp.select)(e).call(i),()=>{(0,Wp.select)(e).on(".zoom",null)}},[w,k,nt,Fe,Be,He,We,S,Xe]);const Jt=G&&!1!==V,en=Jt&&It?U?U(It):/* @__PURE__ */ /* @__PURE__ */(0,pm.jsx)(Na,{data:It}):null,tn=en?/* @__PURE__ */ /* @__PURE__ */(0,pm.jsx)(qo,{x:It.x,y:It.y,containerWidth:Be,containerHeight:He,margin:We,className:"stream-frame-tooltip",zIndex:10,children:en}):null;if(lt){const e=ot.scene;/* @__PURE__ */ /* @__PURE__ */
|
|
179
|
+
return(0,pm.jsxs)("div",{ref:wt,className:"stream-geo-frame"+(z?" "+z:""),role:"img","aria-label":Le||("string"==typeof ye?ye:"Geographic chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:I?"100%":Fe[0],height:T?"100%":Fe[1]},children:[
|
|
180
|
+
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */(0,pm.jsx)(To,{summary:Pe}),
|
|
182
|
+
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */(0,pm.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:Fe[0],height:Fe[1],style:{position:"absolute",left:0,top:0},children:[ht?/* @__PURE__ */ /* @__PURE__ */(0,pm.jsx)("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:Fe[0],height:Fe[1],fill:ht}):null,
|
|
184
|
+
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */(0,pm.jsx)("g",{transform:`translate(${We.left},${We.top})`,children:ut}),
|
|
186
|
+
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */(0,pm.jsx)("g",{transform:`translate(${We.left},${We.top})`,children:e.map((e,t)=>wa({node:e,index:t,renderMode:W,fallback:()=>ro(e,t)}).element)})]}),
|
|
188
|
+
/* @__PURE__ */
|
|
189
|
+
/* @__PURE__ */(0,pm.jsx)(Yi,{width:Be,height:He,totalWidth:Fe[0],totalHeight:Fe[1],margin:We,showAxes:!1,title:ye,description:Le,legend:ve,legendPosition:be,legendLayout:xe,legendHoverBehavior:we,legendClickBehavior:ke,legendHighlightedCategory:Se,legendIsolatedCategories:Me,foregroundGraphics:ma(ct,ya(it.current?.customLayoutOverlays,d??null)),annotations:ee,onAnnotationActivate:te,onObservation:Q??K,chartId:J,chartType:"StreamGeoFrame",autoPlaceAnnotations:ne,svgAnnotationRules:re,pointNodes:ka(e),geoProjection:it.current?.scales?.projectedPoint})]})}/* @__PURE__ */ /* @__PURE__ */
|
|
190
|
+
return(0,pm.jsxs)("div",{ref:wt,className:"stream-geo-frame"+(z?" "+z:""),role:"group","aria-label":Le||("string"==typeof ye?ye:"Geographic chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:I?"100%":Fe[0],height:T?"100%":Fe[1],overflow:Y?"visible":"hidden",...w?{touchAction:"none"}:{}},onKeyDown:Zt,children:["production"!==process.env.NODE_ENV&&it.current&&/* @__PURE__ */ /* @__PURE__ */(0,pm.jsx)(yh,{store:it.current,diagnostics:Nt.current}),Re&&/* @__PURE__ */ /* @__PURE__ */(0,pm.jsxs)(No,{accessibleTable:Re,children:[
|
|
191
|
+
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */(0,pm.jsx)(Do,{tableId:Ge}),
|
|
193
|
+
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */(0,pm.jsx)(Io,{scene:it.current?.scene??[],chartType:"Geographic chart",tableId:Ge,chartTitle:"string"==typeof ye?ye:void 0})]}),
|
|
195
|
+
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */(0,pm.jsx)(To,{summary:Pe}),
|
|
197
|
+
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */(0,pm.jsx)(Mo,{hoverPoint:It}),
|
|
199
|
+
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */(0,pm.jsxs)("div",{role:"img","aria-label":Le||("string"==typeof ye?ye:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:Kt,onPointerLeave:Ht,onPointerDown:Jt||Ie?Qt:void 0,onClick:Ie?Ut:void 0,children:[
|
|
201
|
+
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */(0,pm.jsx)(mo,{size:Fe,margin:We,backdropFill:ht??void 0,children:ut}),C&&/* @__PURE__ */ /* @__PURE__ */(0,pm.jsx)("canvas",{ref:ft,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),
|
|
203
|
+
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */(0,pm.jsx)("canvas",{ref:qt,"aria-label":Eo(it.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0}}),
|
|
205
|
+
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */(0,pm.jsx)("canvas",{ref:Gt,style:{position:"absolute",left:0,top:0,pointerEvents:"none"}}),
|
|
207
|
+
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */(0,pm.jsx)(Yi,{width:Be,height:He,totalWidth:Fe[0],totalHeight:Fe[1],margin:We,showAxes:Ce,title:ye,description:Le,legend:ve,legendPosition:be,legendLayout:xe,legendHoverBehavior:we,legendClickBehavior:ke,legendHighlightedCategory:Se,legendIsolatedCategories:Me,foregroundGraphics:ma(ct,ya(it.current?.customLayoutOverlays,d??null)),annotations:ee,onAnnotationActivate:te,onObservation:Q??K,chartId:J,chartType:"StreamGeoFrame",autoPlaceAnnotations:ne,svgAnnotationRules:re,pointNodes:ka(it.current?.scene),geoProjection:it.current?.scales?.projectedPoint}),le?.showBadge&&/* @__PURE__ */ /* @__PURE__ */(0,pm.jsx)(lr,{isStale:_t,position:le.badgePosition,state:le.state,settling:le.settling}),w&&/* @__PURE__ */ /* @__PURE__ */(0,pm.jsxs)("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:We.bottom+8,left:We.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[
|
|
209
|
+
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */(0,pm.jsx)("button",{type:"button","aria-label":"Zoom in",onClick:e=>{e.stopPropagation();const t=xt.current,n=yt.current;t&&n?.scaleBy&&n.scaleBy((0,Wp.select)(t),1.5)},style:lm,children:"+"}),
|
|
211
|
+
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */(0,pm.jsx)("button",{type:"button","aria-label":"Zoom out",onClick:e=>{e.stopPropagation();const t=xt.current,n=yt.current;t&&n?.scaleBy&&n.scaleBy((0,Wp.select)(t),1/1.5)},style:lm,children:"−"})]}),R&&/* @__PURE__ */ /* @__PURE__ */(0,pm.jsx)("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:We.bottom+2,right:We.right+4,fontSize:10,color:"rgba(0,0,0,0.6)",background:"rgba(255,255,255,0.7)",padding:"1px 4px",borderRadius:2,pointerEvents:"none",zIndex:2},children:R}),
|
|
213
|
+
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */(0,pm.jsx)(Fo,{active:Yt.current>=0,hoverPoint:It,margin:We,size:Fe,shape:Xt.current?.shape,width:Xt.current?.w,height:Xt.current?.h,pathData:Xt.current?.pathData}),tn]})]})}));mm.displayName="StreamGeoFrame";var gm=mm,ym=require("react"),vm=require("react"),bm=require("./semiotic-client-cjs-shared.min.js"),xm=.5,wm=require("./semiotic-client-cjs-shared.min.js"),km=require("./semiotic-client-cjs-shared.min.js"),Sm=require("./semiotic-client-cjs-shared.min.js"),Mm=require("./semiotic-client-cjs-shared.min.js"),jm=44,Am={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:jm,snap:"nearestDatum",brushHandleSize:jm,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},Cm={primary:{width:600,height:400,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:void 0,showLabels:void 0,marginDefaults:{top:50,bottom:60,left:70,right:40}},context:{width:400,height:250,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:10,bottom:10,left:10,right:10}},sparkline:{width:120,height:24,showAxes:!1,showGrid:!1,enableHover:!1,showLegend:!1,showLabels:!1,marginDefaults:{top:2,bottom:2,left:0,right:0}},mobile:{width:390,height:300,showAxes:!0,showGrid:!1,enableHover:!0,showLegend:!1,showLabels:!0,marginDefaults:{top:28,bottom:42,left:44,right:16}}},Rm={top:10,bottom:10,left:10,right:10},Lm=require("react"),Pm=require("react"),Nm=(require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("react/jsx-runtime"),(0,Pm.createContext)(!1)),Em=((0,Pm.createContext)(!1),(0,Pm.createContext)(null)),Im="undefined"==typeof window?Pm.useEffect:Pm.useLayoutEffect,Tm=[],Dm=require("react/jsx-runtime"),zm=oc(require("react")),_m=require("react/jsx-runtime"),Om=class extends zm.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}render(){if(this.state.error){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t):void 0!==e?e:/* @__PURE__ */ /* @__PURE__ */(0,_m.jsx)(Ws,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:600,height:400})}return this.props.children}},Fm=require("react/jsx-runtime"),Wm="undefined"!=typeof process&&"production"!==process.env?.NODE_ENV,Bm={display:"flex",alignItems:"center",justifyContent:"center",color:"var(--semiotic-text-secondary, #666)",fontSize:13,fontFamily:"inherit",border:"1px dashed var(--semiotic-border, #ddd)",borderRadius:4,boxSizing:"border-box"},Hm={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2},$m=require("react"),qm=require("./semiotic-client-cjs-shared.min.js"),Gm=require("d3-scale"),Vm=require("react"),Um=require("topojson-client"),Ym=/* @__PURE__ */new Map,Xm="Install the optional peer dependency `world-atlas` (`npm install world-atlas`) to use built-in reference geographies, or pass GeoJSON Feature[] to `areas`.",Zm=require("react/jsx-runtime");Js.displayName="ChoroplethMap";var Km=require("react"),Qm=require("react"),Jm=require("./semiotic-client-cjs-shared.min.js"),eg=require("react"),tg={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5},ng=require("react/jsx-runtime"),rg=[3,30],ig=[1,4],og=(0,Km.forwardRef)(function(e,t){const n=(0,Km.useRef)(null);tl(t,{variant:"geo-points",frameRef:n});const r=Ps(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:i,xAccessor:o="lon",yAccessor:a="lat",sizeBy:s,sizeRange:l,colorBy:c,styleRules:u,colorScheme:d,projection:h="equalEarth",graticule:f,fitPadding:p,zoomable:m,zoomExtent:g,onZoom:y,dragRotate:v,tileURL:b,tileAttribution:x,tileCacheSize:w,areas:k,areaStyle:S=tg,tooltip:M,annotations:j,margin:A,className:C,selection:R,linkedHover:L,onObservation:P,onClick:N,chartId:E,loading:I,loadingContent:T,emptyContent:D,legendInteraction:z,legendPosition:_,frameProps:O={},stroke:F,strokeWidth:W,opacity:B}=e,H=l??("sparkline"===r.mode?ig:rg),$="sparkline"===r.mode?1.5:6,q=m??!!b,G=Xs(k),V=el({data:i??dh,rawData:i,colorBy:c,colorScheme:d,legendInteraction:z,legendPosition:_,frameLegend:O,selection:R,linkedHover:L,fallbackFields:c?["string"==typeof c?c:""]:[],unwrapData:!1,onObservation:P,onClick:N,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:E,showLegend:r.showLegend,userMargin:A,marginDefaults:ls(r),loading:I,loadingContent:T,emptyContent:D,width:r.width,height:r.height,hasTitle:!!r.title}),U=V.data,Y=(0,Km.useMemo)(()=>{if(!s)return;const e="function"==typeof s?s:e=>e?.[s],t=U.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?qt(t):void 0},[U,s]),X=(0,Km.useMemo)(()=>{const e=Es(Fs(e=>({fill:c?wt(e,c,V.colorScale):Wd,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?jt(e,s,H,Y):$}),u,Ts(c,s)),{stroke:F,strokeWidth:W,opacity:B});return V.effectiveSelectionHook?Ja(e,V.effectiveSelectionHook,V.resolvedSelection):e},[c,V.colorScale,V.effectiveSelectionHook,V.resolvedSelection,s,H,Y,$,F,W,B,u]),Z=(0,Km.useMemo)(()=>e=>{const t=e?.name||e?.label||e?.NAME||e?.id,n="string"==typeof s?s:null,r=("function"==typeof s?s:e=>e[s])(e),i=e=>"number"==typeof e&&isFinite(e)?Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2}):(e??"")+"",o="string"==typeof c?c:null,a=o?e?.[o]:null;/* @__PURE__ */ /* @__PURE__ */
|
|
215
|
+
return(0,ng.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&/* @__PURE__ */ /* @__PURE__ */(0,ng.jsx)("div",{style:{fontWeight:600,marginBottom:2},children:t}),n&&null!=r&&/* @__PURE__ */ /* @__PURE__ */(0,ng.jsxs)("div",{children:[
|
|
216
|
+
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */(0,ng.jsxs)("span",{style:{opacity:.7},children:[n,": "]}),i(r)]}),o&&null!=a&&/* @__PURE__ */ /* @__PURE__ */(0,ng.jsxs)("div",{children:[
|
|
218
|
+
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */(0,ng.jsxs)("span",{style:{opacity:.7},children:[o,": "]}),a+""]}),!t&&!n&&Object.entries(e).filter(([e])=>"data"!==e&&"x"!==e&&"y"!==e&&"time"!==e).slice(0,4).map(([e,t])=>/* @__PURE__ */ /* @__PURE__ */(0,ng.jsxs)("div",{children:[
|
|
220
|
+
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */(0,ng.jsxs)("span",{style:{opacity:.7},children:[e,": "]}),i(t)]},e))]})},[s,c]);if(V.earlyReturn)return V.earlyReturn;qs("ProportionalSymbolMap",U,"xAccessor",o),qs("ProportionalSymbolMap",U,"yAccessor",a);const K={projection:h,...null!=i&&{points:U},xAccessor:o,yAccessor:a,pointStyle:X,...e.pointIdAccessor&&{pointIdAccessor:e.pointIdAccessor},...G&&{areas:G,areaStyle:S},...null!=f&&{graticule:f},...null!=p&&{fitPadding:p},...q&&{zoomable:!0},...g&&{zoomExtent:g},...y&&{onZoom:y},...null!=v&&{dragRotate:v},...b&&{tileURL:b},...x&&{tileAttribution:x},...w&&{tileCacheSize:w},size:[r.width,r.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:V.margin,enableHover:r.enableHover,tooltipContent:!1===M?()=>null:Pa(M)||Z,...V.legendBehaviorProps,...Ks({linkedHover:L,selection:R,onObservation:P,onClick:N,mobileInteraction:V.mobileInteraction,customHoverBehavior:V.customHoverBehavior,customClickBehavior:V.customClickBehavior,linkedHoverInClickPredicate:!1}),...j&&j.length>0&&{annotations:j},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...r.title&&{title:r.title},...r.description&&{description:r.description},...r.summary&&{summary:r.summary},...void 0!==r.accessibleTable&&{accessibleTable:r.accessibleTable},...C&&{className:C},...null!=e.animate&&{animate:e.animate},...O};/* @__PURE__ */ /* @__PURE__ */
|
|
222
|
+
return(0,ng.jsx)(Bs,{componentName:"ProportionalSymbolMap",width:r.width,height:r.height,children:/* @__PURE__ */ /* @__PURE__ */(0,ng.jsx)(gm,{ref:n,...K})})});og.displayName="ProportionalSymbolMap";var ag=require("react"),sg=require("./semiotic-client-cjs-shared.min.js"),lg=require("./semiotic-client-cjs-shared.min.js"),cg=require("react/jsx-runtime"),ug="__semiotic_x",dg="__semiotic_y",hg=(0,ag.forwardRef)(function(e,t){const n=Ps(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{flows:r,nodes:i,nodeIdAccessor:o="id",xAccessor:a="lon",yAccessor:s="lat",valueAccessor:l="value",projection:c="equalEarth",graticule:u,fitPadding:d,zoomable:h,zoomExtent:f,onZoom:p,dragRotate:m,tileURL:g,tileAttribution:y,tileCacheSize:v,lineType:b="geo",flowStyle:x="basic",areas:w,areaStyle:k=tg,edgeColorBy:S,edgeOpacity:M=.6,edgeWidthRange:j=[1,8],pointRadius:A,edgeLinecap:C="round",colorScheme:R,styleRules:L,showParticles:P,particleStyle:N,tooltip:E,annotations:I,margin:T,className:D,selection:z,linkedHover:_,onObservation:O,onClick:F,chartId:W,loading:B,loadingContent:H,emptyContent:$,frameProps:q={},legendInteraction:G,legendPosition:V,stroke:U,strokeWidth:Y,opacity:X,lineIdAccessor:Z}=e,K=h??!!g,Q=Xs(w),J=(0,ag.useMemo)(()=>on(i),[i]),ee=el({data:r??dh,rawData:r,colorBy:S,colorScheme:R,legendInteraction:G,legendPosition:V,frameLegend:q,selection:z,linkedHover:_,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:O,onClick:F,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"FlowMap",chartId:W,showLegend:n.showLegend,userMargin:T,marginDefaults:ls(n),loading:B,loadingContent:H,emptyContent:$,width:n.width,height:n.height,hasTitle:!!n.title}),te=ee.data,ne=Qa(_),re=(0,sg.useLinkedHover)({name:ne?.name||"hover",fields:ne?.fields||[]}),ie=(0,lg.useObservationSelector)(e=>e.pushObservation),oe=(0,ag.useMemo)(()=>{const e=/* @__PURE__ */new Map;for(const t of J)e.set(t[o]+"",t);return e},[J,o]),ae=(0,ag.useRef)(null),se=(0,ag.useRef)(oe);se.current=oe;const le=(0,ag.useRef)(a);le.current=a;const ce=(0,ag.useRef)(s);ce.current=s;const ue=(0,ag.useCallback)(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;const t=se.current,n=t.get(e.source+""),r=t.get(e.target+"");if(!n||!r)return null;const i="function"==typeof le.current?le.current:e=>e[le.current],o="function"==typeof ce.current?ce.current:e=>e[ce.current];return{...e,coordinates:[{[ug]:i(n),[dg]:o(n)},{[ug]:i(r),[dg]:o(r)}]}},[]);tl(t,{variant:"geo-lines",frameRef:ae,overrides:{push:e=>{const t=ue(e);t&&ae.current?.pushLine(t)},pushMany:e=>{const t=[];for(const n of e){const e=ue(n);e&&t.push(e)}t.length>0&&ae.current?.pushManyLines(t)}}});const de=(0,ag.useMemo)(()=>{const e=/* @__PURE__ */new Map;for(const t of te)t&&"object"==typeof t&&(null==t.source||e.has(t.source)||e.set(t.source,t),null==t.target||e.has(t.target)||e.set(t.target,t));return e},[te]),he=(0,ag.useCallback)(e=>{if(_)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){const e=de.get(t[o]+"");e&&re.onHover(e)}else re.onHover(t)}else re.onHover(null);if(O||ie){const t={timestamp:Date.now(),chartType:"FlowMap",chartId:W};if(e){let n=e.data||e.datum||e;Array.isArray(n)&&(n=n[0]);const r={...t,type:"hover",datum:n||{},x:e.x??0,y:e.y??0};O&&O(r),ie&&ie(r)}else{const e={...t,type:"hover-end"};O&&O(e),ie&&ie(e)}}},[_,re,o,de,O,W,ie]),fe=ee.customClickBehavior,pe=(0,ag.useMemo)(()=>{const e="function"==typeof a?a:e=>e[a],t="function"==typeof s?s:e=>e[s];return te.map(n=>{if(!n||"object"!=typeof n||null==n.source||null==n.target)return null;const r=oe.get(n.source+""),i=oe.get(n.target+"");return r&&i?{...n,coordinates:[{[ug]:e(r),[dg]:t(r)},{[ug]:e(i),[dg]:t(i)}]}:null}).filter(Boolean)},[te,oe,a,s]),me=(0,ag.useMemo)(()=>{const e="function"==typeof a?a:e=>e[a];return t=>null!=t&&"object"==typeof t&&ug in t?t[ug]:e(t)},[a]),ge=(0,ag.useMemo)(()=>{const e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&dg in t?t[dg]:e(t)},[s]),ye=(0,ag.useMemo)(()=>{const e=te.filter(e=>e&&"object"==typeof e).map(e=>Number(e[l]??0)).filter(e=>Number.isFinite(e));if(0!==e.length)return qt(e)},[te,l]),ve=(0,ag.useMemo)(()=>il({valueAccessor:l,valueDomain:ye,edgeWidthRange:j,resolveStroke:e=>S?wt(e,S,ee.colorScale):Wd,edgeOpacity:M,edgeLinecap:C,styleRules:L}),[l,ye,j,S,ee.colorScale,M,C,L]),be=(0,ag.useMemo)(()=>{const e=Es(ve,{stroke:U,strokeWidth:Y,opacity:X});if(!ee.effectiveSelectionHook)return e;const t={...ee.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return Ja(e,ee.effectiveSelectionHook,{...ee.resolvedSelection||{},unselectedStyle:t})},[ve,ee.effectiveSelectionHook,ee.resolvedSelection,U,Y,X]),xe=A??("sparkline"===n.mode?1.5:5),we=(0,ag.useMemo)(()=>Es(()=>({fill:"#333",r:xe,fillOpacity:.8}),{stroke:U,strokeWidth:Y,opacity:X}),[xe,U,Y,X]),ke=(0,ag.useMemo)(()=>e=>{if(e?.geometry||e?.properties||e?.data?.geometry){const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||e?.data?.properties?.name||e?.data?.properties?.NAME;if(t)/* @__PURE__ */ /* @__PURE__ */
|
|
223
|
+
return(0,cg.jsx)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */ /* @__PURE__ */(0,cg.jsx)("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){const t=e[l];/* @__PURE__ */ /* @__PURE__ */
|
|
224
|
+
return(0,cg.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
|
|
225
|
+
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */(0,cg.jsxs)("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&/* @__PURE__ */ /* @__PURE__ */(0,cg.jsx)("div",{style:{opacity:.7},children:"number"==typeof t?t.toLocaleString():t})]})}const t=e?.name||e?.label||e?.[o];return null!=t?/* @__PURE__ */ /* @__PURE__ */(0,cg.jsx)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */ /* @__PURE__ */(0,cg.jsx)("div",{style:{fontWeight:600},children:t})}):null},[l,o]);if(ee.earlyReturn)return ee.earlyReturn;const Se={projection:c,...null!=r&&{lines:pe},points:J,xAccessor:me,yAccessor:ge,lineDataAccessor:"coordinates",...null!=Z&&{lineIdAccessor:Z},lineType:b,flowStyle:x,lineStyle:be,pointStyle:we,...Q&&{areas:Q,areaStyle:k},...null!=u&&{graticule:u},...null!=d&&{fitPadding:d},...K&&{zoomable:!0},...f&&{zoomExtent:f},...p&&{onZoom:p},...null!=m&&{dragRotate:m},...P&&{showParticles:P},...N&&{particleStyle:N},...g&&{tileURL:g},...y&&{tileAttribution:y},...v&&{tileCacheSize:v},size:[n.width,n.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ee.margin,enableHover:n.enableHover,tooltipContent:!1===E?()=>null:Pa(E)||ke,...ee.legendBehaviorProps,...Ks({linkedHover:_,selection:z,onObservation:O,onClick:F,mobileInteraction:ee.mobileInteraction,customHoverBehavior:he,customClickBehavior:fe,linkedHoverInClickPredicate:!1}),...I&&I.length>0&&{annotations:I},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...n.title&&{title:n.title},...n.description&&{description:n.description},...n.summary&&{summary:n.summary},...void 0!==n.accessibleTable&&{accessibleTable:n.accessibleTable},...D&&{className:D},...null!=e.animate&&{animate:e.animate},...q};/* @__PURE__ */ /* @__PURE__ */
|
|
227
|
+
return(0,cg.jsx)(Bs,{componentName:"FlowMap",width:n.width,height:n.height,children:/* @__PURE__ */ /* @__PURE__ */(0,cg.jsx)(gm,{ref:ae,...Se})})});hg.displayName="FlowMap";var fg=require("react"),pg=require("react/jsx-runtime"),mg=require("react/jsx-runtime"),gg=(0,fg.forwardRef)(function(e,t){const n=Ps(e.mode,{width:e.width,height:e.height,showLegend:e.showLegend,enableHover:e.enableHover,linkedHover:e.linkedHover,title:e.title,description:e.description,accessibleTable:e.accessibleTable,summary:e.summary,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),{points:r,lines:i,xAccessor:o="lon",yAccessor:a="lat",nodeIdAccessor:s="id",center:l,costAccessor:c,strength:u=1,lineMode:d="straight",projection:h="mercator",graticule:f,fitPadding:p,zoomable:m,zoomExtent:g,onZoom:y,dragRotate:v,tileURL:b,tileAttribution:x,tileCacheSize:w,transition:k,colorBy:S,styleRules:M,colorScheme:j,pointRadius:A,tooltip:C,showRings:R,showRingLabels:L,ringStyle:P,showNorth:N,costLabel:E,cartogramLayout:I,annotations:T,margin:D,className:z,selection:_,linkedHover:O,onObservation:F,onClick:W,chartId:B,loading:H,loadingContent:$,emptyContent:q,legendPosition:G,frameProps:V={},stroke:U,strokeWidth:Y,opacity:X}=e,Z="sparkline"===n.mode,K=I??(Z?"strip":"radial"),Q=A??(Z?1.5:5),J=R??!0,ee=L??("strip"!==K&&!n.compactMode),te=N??("strip"!==K&&!Z),ne=m??!!b,re=(0,fg.useMemo)(()=>on(r),[r]),ie=el({data:re,rawData:r,colorBy:S,colorScheme:j,legendInteraction:void 0,legendPosition:G,frameLegend:V,selection:_,linkedHover:O,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:F,onClick:W,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"DistanceCartogram",chartId:B,showLegend:n.showLegend,userMargin:D,marginDefaults:ls(n),loading:H,loadingContent:$,emptyContent:q,width:n.width,height:n.height,hasTitle:!!n.title}),oe=(0,fg.useMemo)(()=>{const e=Es(Fs(e=>{const t=e?.[s],n=null!=t&&t+""==l+"";return{fill:S?wt(e,S,ie.colorScale):Wd,fillOpacity:n?1:.8,stroke:n?"var(--semiotic-text, #222)":"#fff",strokeWidth:n?1.25:1,r:n?1.35*Q:Q}},M,Ts(S)),{stroke:U,strokeWidth:Y,opacity:X});return ie.effectiveSelectionHook?Ja(e,ie.effectiveSelectionHook,ie.resolvedSelection):e},[S,ie.colorScale,ie.effectiveSelectionHook,ie.resolvedSelection,Q,U,Y,X,M,l,s]),ae=(0,fg.useMemo)(()=>({center:l,centerAccessor:s,costAccessor:c,strength:u,lineMode:d,layout:K}),[l,s,c,u,d,K]),se=(0,fg.useMemo)(()=>{if(!i)return;const e="function"==typeof o?o:e=>e[o],t="function"==typeof a?a:e=>e[a],n=/* @__PURE__ */new Map;for(const e of re)n.set(e[s]+"",e);return i.map(r=>{if(r.coordinates)return r;const i=n.get(r.source+""),s=n.get(r.target+"");return i&&s?{...r,coordinates:[{[o]:e(i),[a]:t(i)},{[o]:e(s),[a]:t(s)}]}:null}).filter(Boolean)},[i,re,o,a,s]),le=(0,fg.useMemo)(()=>e=>{const t=("function"==typeof c?c:e=>e[c])(e);/* @__PURE__ */ /* @__PURE__ */
|
|
228
|
+
return(0,mg.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
|
|
229
|
+
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */(0,mg.jsx)("div",{style:{fontWeight:600},children:e[s]||e.name||e.id||"Point"}),null!=t&&/* @__PURE__ */ /* @__PURE__ */(0,mg.jsxs)("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[c,s]),ce=(0,fg.useRef)(null);tl(t,{variant:"geo-points",frameRef:ce});const[ue,de]=(0,fg.useState)(null),he=(0,fg.useCallback)(()=>{const e=ce.current?.getCartogramLayout?.();e&&de(t=>t&&t.cx===e.cx&&t.cy===e.cy&&t.maxCost===e.maxCost&&t.availableRadius===e.availableRadius&&t.layout===(e.layout??"radial")?t:{cx:e.cx,cy:e.cy,maxCost:e.maxCost,availableRadius:e.availableRadius,layout:e.layout??"radial"})},[]);(0,fg.useEffect)(()=>{const e=requestAnimationFrame(he);return()=>cancelAnimationFrame(e)},[he,u,l,n.width,n.height,re,K]);const fe=(0,fg.useMemo)(()=>{if(!J||!ue)return[];const{maxCost:e}=ue;if(0>=e)return[];if(Array.isArray(J))return J.filter(t=>t>0&&e>=t);const t="number"==typeof J?J:Math.min("strip"===ue.layout?3:5,Math.max(2,Math.ceil(e/5))),n=e/t,r=[];for(let e=1;t>=e;e++)r.push(Math.round(n*e*10)/10);return r},[J,ue]),pe=(0,fg.useMemo)(()=>{if(!ue)return V.foregroundGraphics||null;const e=/* @__PURE__ */ /* @__PURE__ */(0,mg.jsx)(ol,{bottomMargin:ie.margin.bottom,costLabel:E,layout:ue,ringStyle:P,ringValues:fe,showNorth:te,showRingLabels:ee,showRings:J}),t=V.foregroundGraphics;return"function"==typeof t?n=>/* @__PURE__ */ /* @__PURE__ */(0,mg.jsxs)(mg.Fragment,{children:[e,t(n)]}):/* @__PURE__ */ /* @__PURE__ */(0,mg.jsxs)(mg.Fragment,{children:[e,t]})},[ue,fe,J,ee,te,E,P,ie.margin.bottom,V.foregroundGraphics]);if(ie.earlyReturn)return ie.earlyReturn;qs("DistanceCartogram",re,"xAccessor",o),qs("DistanceCartogram",re,"yAccessor",a);const me={projection:h,...null!=r&&{points:re},...se&&{lines:se,lineDataAccessor:"coordinates"},xAccessor:o,yAccessor:a,pointIdAccessor:s,pointStyle:oe,projectionTransform:ae,...k&&{transition:{duration:k}},...null!=f&&{graticule:f},...null!=p&&{fitPadding:p},...ne&&{zoomable:!0},...g&&{zoomExtent:g},...y&&{onZoom:y},...null!=v&&{dragRotate:v},...b&&{tileURL:b},...x&&{tileAttribution:x},...w&&{tileCacheSize:w},size:[n.width,n.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ie.margin,enableHover:n.enableHover,tooltipContent:!1===C?()=>null:Pa(C)||le,...ie.legendBehaviorProps,...Ks({linkedHover:O,selection:_,onObservation:F,onClick:W,mobileInteraction:ie.mobileInteraction,customHoverBehavior:ie.customHoverBehavior,customClickBehavior:ie.customClickBehavior,linkedHoverInClickPredicate:!1}),...T&&T.length>0&&{annotations:T},...void 0!==e.autoPlaceAnnotations&&{autoPlaceAnnotations:e.autoPlaceAnnotations},...n.title&&{title:n.title},...n.description&&{description:n.description},...n.summary&&{summary:n.summary},...void 0!==n.accessibleTable&&{accessibleTable:n.accessibleTable},...z&&{className:z},...null!=e.animate&&{animate:e.animate},...V,foregroundGraphics:pe};/* @__PURE__ */ /* @__PURE__ */
|
|
231
|
+
return(0,mg.jsx)(Bs,{componentName:"DistanceCartogram",width:n.width,height:n.height,children:/* @__PURE__ */ /* @__PURE__ */(0,mg.jsx)(gm,{ref:ce,...me})})});gg.displayName="DistanceCartogram";var yg=require("react"),vg=require("react"),bg=require("react/jsx-runtime"),xg=(0,yg.forwardRef)(function(e,t){const{points:n,areas:r,lines:i,layout:o,layoutConfig:a,onLayoutError:s,projection:l="equirectangular",xAccessor:c="lon",yAccessor:u="lat",lineDataAccessor:d,colorBy:h,colorScheme:f,tooltip:p,annotations:m,margin:g,selection:y,linkedHover:v,onObservation:b,onClick:x,chartId:w,loading:k,loadingContent:S,emptyContent:M,className:j,frameProps:A={}}=e,{frameRef:C,resolved:R,normalizedMargin:L}=sl({imperativeRef:t,imperativeVariant:"geo-points",margin:g,width:e.width,height:e.height,enableHover:e.enableHover,title:e.title,description:e.description,summary:e.summary,accessibleTable:e.accessibleTable,mode:e.mode,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,responsiveRules:e.responsiveRules}),P=(0,yg.useMemo)(()=>on(n),[n]),N=(0,yg.useMemo)(()=>on(r),[r]),E=(0,yg.useMemo)(()=>on(i),[i]),I=(0,yg.useMemo)(()=>[...P,...E,...N],[P,E,N]),T=el({data:I,rawData:void 0!==n||void 0!==i||void 0!==r?I:void 0,colorBy:h,colorScheme:f,legendInteraction:void 0,selection:y,linkedHover:v,fallbackFields:"string"==typeof h?[h]:[],unwrapData:!1,onObservation:b,onClick:x,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:"GeoCustomChart",chartId:w,showLegend:!1,userMargin:L,marginDefaults:R.marginDefaults,loading:k,loadingContent:S,emptyContent:M,width:R.width,height:R.height,hasTitle:!!R.title}),D=T.effectiveSelectionHook,z=(0,yg.useMemo)(()=>D?.isActive?{isActive:!0,predicate:D.predicate}:null,[D?.isActive,D?.predicate]);if(T.earlyReturn)return T.earlyReturn;const{width:_,height:O,enableHover:F,title:W,description:B,summary:H,accessibleTable:$}=R,q=Pa(p),G={projection:l,...null!=n&&{points:P},...null!=r&&{areas:N},...null!=i&&{lines:E},xAccessor:c,yAccessor:u,...null!=d&&{lineDataAccessor:d},customLayout:o,layoutConfig:a,onLayoutError:s,layoutSelection:z,colorBy:h,colorScheme:f,size:[_,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:T.margin,enableHover:F,...Zs({title:W,description:B,summary:H,accessibleTable:$,className:j,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===p?{tooltipContent:()=>null}:q?{tooltipContent:q}:{},...Ks({linkedHover:v,selection:y,onObservation:b,onClick:x,hoverHighlight:!1,mobileInteraction:T.mobileInteraction,customHoverBehavior:T.customHoverBehavior,customClickBehavior:T.customClickBehavior,linkedHoverInClickPredicate:!1}),...m&&m.length>0&&{annotations:m},...A};/* @__PURE__ */ /* @__PURE__ */
|
|
232
|
+
return(0,bg.jsx)(Bs,{componentName:"GeoCustomChart",width:_,height:O,children:/* @__PURE__ */ /* @__PURE__ */(0,bg.jsx)(gm,{ref:C,...G})})});xg.displayName="GeoCustomChart";var wg={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",opacity:0},kg=8,Sg=require("./semiotic-custom-layout-selection-cjs-shared.min.js"),Mg=require("react/jsx-runtime"),jg=.72,Ag=1.8,Cg=e=>{const t=e.config,n=t.source??"auto",r="areas"===n||"auto"===n&&e.areas.length>0,i=(r?wl(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,n)=>!t.filter||t.filter(e.datum,n)),o=Sl(i.map(e=>e.datum),t),a=r?i:kl({...e,points:i.map(e=>e.datum)}),s=o??gl(a,{columns:t.columns,rows:t.rows,occupancy:t.occupancy,aspectRatio:e.dimensions.width/Math.max(1,e.dimensions.height)});if(0===s.length)return{nodes:[]};const l=pl(s.map(e=>e.row)),c=pl(s.map(e=>e.column)),u=Math.max(1,Math.round(l[1]-l[0])+1),d=Math.max(1,Math.round(c[1]-c[0])+1),h=Math.max(0,t.layoutPadding??8),f=Math.max(1,e.dimensions.width-2*h)/d,p=Math.max(1,e.dimensions.height-2*h)/u,m=(e.dimensions.width-f*d)/2,g=(e.dimensions.height-p*u)/2,y=fl(t.cellPadding??.12,0,.8),v=Math.max(1,.5*Math.min(f,p)*(1-y)),b=t.sizeAccessor?s.map(e=>Number(yl(e.datum,t.sizeAccessor))):[],x=t.sizeDomain??pl(b),w=t.sizeRange??[.36,1],k=fl(Math.min(w[0],w[1]),.05,1),S=fl(Math.max(w[0],w[1]),k,1),M=s.map((n,r)=>{const i={...n.datum,gridRow:n.row,gridColumn:n.column},o=(yl(i,t.idAccessor,["id","key","name"])??"grid-"+r)+"",a=(yl(i,t.labelAccessor,["abbr","code","label","name","id"])??o)+"",s=Math.max(1,t.maxLabelLength??4),u=a.length>s?a.slice(0,s):a,d=yl(i,t.categoryAccessor),h=null==d?void 0:d+"",y=yl(i,t.fillAccessor),b=null!=y?y+"":h?e.resolveColor(h):e.theme.categorical[0]??"#4f86c6",w=t.sizeAccessor?Number(yl(i,t.sizeAccessor)):NaN,M=t.sizeAccessor&&Number.isFinite(w)?Math.sqrt(fl(ml(w,x),0,1)):1,j=v*(k+M*(S-k)),A="function"==typeof t.markStyle?t.markStyle(i,r):t.markStyle;return{datum:i,id:o,label:u,category:h,row:n.row,column:n.column,x:m+(n.column-c[0]+.5)*f,y:g+(n.row-l[0]+.5)*p,radius:j,style:{fill:b,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...A}}}),j=t.shape??"circle";return{nodes:M.map(e=>{return"circle"===j?{type:"point",x:e.x,y:e.y,r:e.radius,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},pointId:e.id,_transitionKey:e.id}:{type:"geoarea",pathData:"hexagon"===j?xl(e.x,e.y,e.radius):bl([[(t=e.x)-(r=e.radius),(n=e.y)-r],[t+r,n-r],[t+r,n+r],[t-r,n+r]]),centroid:[e.x,e.y],bounds:[[e.x-e.radius,e.y-e.radius],[e.x+e.radius,e.y+e.radius]],screenArea:"hexagon"===j?3*Math.sqrt(3)*e.radius*e.radius/2:(2*e.radius)**2,style:e.style,datum:e.datum,accessibleDatum:e.datum,accessibility:{label:e.label,tableFields:{name:e.datum.name??e.label,label:e.label,row:e.row,column:e.column,...e.category?{category:e.category}:{}}},group:e.category,interactive:!0};var t,n,r}),overlays:!1===t.showLabels?null:/* @__PURE__ */ /* @__PURE__ */(0,Mg.jsx)(Ml,{marks:M,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??fl(.23*Math.min(f,p),7,14),fontFamily:t.labelFontFamily,fontWeight:t.labelFontWeight??700}),restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.18}:{opacity:1}}},Rg=require("react/jsx-runtime"),Lg=10,Pg=25e3,Ng=/* @__PURE__ */new WeakMap,Eg=/* @__PURE__ */new WeakMap,Ig=/* @__PURE__ */new WeakMap,Tg=1,Dg=e=>{const t=$l(e),n=e.config,r=n.shape??"circle",i=Math.max(.5,Al(n.dotRadius)??t.cellSize*jl(n.radiusRatio??.24,.05,.5)),o=n.gridOrigin?.[0]??0,a=n.gridOrigin?.[1]??0;return{nodes:t.dots.map((s,l)=>{const c=o+(s.gridColumn+.5)*t.cellSize,u=a+(s.gridRow+.5)*t.cellSize,d=Cl(s,n.categoryAccessor),h=Cl(s,n.fillAccessor),f={fill:null!=h?h+"":null!=d?e.resolveColor(d+""):e.theme.categorical[0]??"#4f86c6",fillOpacity:.92,strokeWidth:0,..."function"==typeof n.markStyle?n.markStyle(s,l):n.markStyle},p=`dot-${s.gridRow}-${s.gridColumn}`;return"circle"===r?{type:"point",x:c,y:u,r:i,style:f,datum:s,interactive:!1,pointId:p,_transitionKey:p}:{type:"geoarea",pathData:"hexagon"===r?Vl(c,u,i):Gl(c,u,i),centroid:[c,u],bounds:[[c-i,u-i],[c+i,u+i]],screenArea:"hexagon"===r?3*Math.sqrt(3)*i*i/2:(2*i)**2,style:f,datum:s,group:s.featureId,interactive:!1}}),overlays:n.showOutline?/* @__PURE__ */ /* @__PURE__ */(0,Rg.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,r)=>{const i=e.scales.geoPath(t);return i?/* @__PURE__ */ /* @__PURE__ */(0,Rg.jsx)("path",{d:i,fill:"none",stroke:n.outlineStyle?.stroke??"currentColor",strokeOpacity:n.outlineStyle?.opacity??n.outlineStyle?.fillOpacity??.22,strokeWidth:n.outlineStyle?.strokeWidth??.7,strokeDasharray:n.outlineStyle?.strokeDasharray,strokeLinecap:n.outlineStyle?.strokeLinecap,vectorEffect:"non-scaling-stroke"},Ll(t,r)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};
|