semiotic 3.13.1 → 3.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -48
- package/ai/artifact-surface-inventory.json +1 -1
- package/ai/dist/mcp-server.js +4 -4
- package/ai/reference.md +23 -12
- package/ai/schema.json +258 -96
- package/ai/surface-manifest.json +1 -1
- package/ai/task-packets/compare-category-totals.json +5 -5
- package/ai/task-packets/compare-category-totals.md +2 -2
- package/ai/task-packets/correct-published-chart.json +5 -5
- package/ai/task-packets/correct-published-chart.md +2 -2
- package/ai/task-packets/index.json +6 -6
- package/ai/task-packets/update-live-chart.json +5 -5
- package/ai/task-packets/update-live-chart.md +2 -2
- package/dist/c-2YFVDRU4.min.js +1 -0
- package/dist/c-4OVDIXAR.min.js +1 -0
- package/dist/c-57IIWW46.min.js +1 -0
- package/dist/c-5HTUQRJT.min.js +1 -0
- package/dist/c-5NAU4JAY.min.js +1 -0
- package/dist/c-62UTMRQE.min.js +1 -0
- package/dist/c-6QV6F3U7.min.js +1 -0
- package/dist/c-73ORHEHO.min.js +1 -0
- package/dist/c-7S46KBYD.min.js +2 -0
- package/dist/c-AJSS332Z.min.js +2 -0
- package/dist/{c-ZWJDTDEV.min.js → c-AMQAAW7G.min.js} +1 -1
- package/dist/c-B3X2IJRQ.min.js +1 -0
- package/dist/c-BLLDBVFK.min.js +38 -0
- package/dist/c-BQWX6NBX.min.js +1 -0
- package/dist/c-C7TT4J7K.min.js +1 -0
- package/dist/c-CJ5GA7DM.min.js +1 -0
- package/dist/c-D7YDFHLY.min.js +1 -0
- package/dist/c-DHNROAXY.min.js +1 -0
- package/dist/c-DMDFJQU4.min.js +1 -0
- package/dist/{c-RAIBDXDV.min.js → c-FRVHZIGR.min.js} +1 -1
- package/dist/{c-I54V24WG.min.js → c-HAZCVHI7.min.js} +1 -1
- package/dist/c-HN5U72U7.min.js +1 -0
- package/dist/c-JA5F7ITS.min.js +1 -0
- package/dist/{c-VZNIIKL6.min.js → c-JDI7HKEM.min.js} +1 -1
- package/dist/{c-ISHYKYII.min.js → c-JVZRD4GL.min.js} +1 -1
- package/dist/{c-HGWITEJI.min.js → c-KJGJEOSV.min.js} +1 -1
- package/dist/c-LDGV6TDQ.min.js +1 -0
- package/dist/c-LW3GP7RY.min.js +1 -0
- package/dist/c-M2TPZE7P.min.js +1 -0
- package/dist/{c-XOGN3524.min.js → c-NBBYSAQY.min.js} +2 -2
- package/dist/c-OA6RJZ7S.min.js +1 -0
- package/dist/c-OBBSIOYU.min.js +1 -0
- package/dist/c-OMTJIC3P.min.js +1 -0
- package/dist/{c-SQQZPFVY.min.js → c-QPHM7AWW.min.js} +1 -1
- package/dist/{c-XZJWL7UL.min.js → c-QSEAAHEU.min.js} +1 -1
- package/dist/c-RQWI623R.min.js +1 -0
- package/dist/{c-62JIVHK5.min.js → c-RWFADOKS.min.js} +1 -1
- package/dist/c-TFESQSWE.min.js +1 -0
- package/dist/{c-SDGGMIYI.min.js → c-TJGC5JEM.min.js} +1 -1
- package/dist/{c-4P2EM44G.min.js → c-TOXWQRXS.min.js} +3 -3
- package/dist/c-TX53234M.min.js +1 -0
- package/dist/c-TZBEQ5UY.min.js +1 -0
- package/dist/c-UALVQIIJ.min.js +1 -0
- package/dist/c-VBDWHTC7.min.js +1 -0
- package/dist/c-VBIPDCE7.min.js +1 -0
- package/dist/c-WTNRBWZZ.min.js +51 -0
- package/dist/{c-3GIPT46Z.min.js → c-XG4LL2VI.min.js} +1 -1
- package/dist/c-XPNBS3W2.min.js +1 -0
- package/dist/c-XT3G3YWU.min.js +1 -0
- package/dist/c-YCBCZFOC.min.js +1 -0
- package/dist/c-ZBSL4Y32.min.js +1 -0
- package/dist/c-ZP6O6UHV.min.js +1 -0
- package/dist/c-ZVL7ULNH.min.js +1 -0
- package/dist/components/ChartErrorBoundary.d.ts +5 -1
- package/dist/components/ai/intentWeights.d.ts +22 -0
- package/dist/components/ai/streamSchema.d.ts +98 -0
- package/dist/components/ai/streamingTypes.d.ts +27 -4
- package/dist/components/ai/suggestCharts.d.ts +10 -2
- package/dist/components/ai/suggestStreamCharts.d.ts +60 -13
- package/dist/components/ai/suggestStreamDashboard.d.ts +9 -1
- package/dist/components/charts/network/processSankey/frameMargins.d.ts +1 -1
- package/dist/components/charts/network/processSankey/labelPlacement.d.ts +1 -1
- package/dist/components/charts/physics/physicsHocUtils.d.ts +1 -1
- package/dist/components/charts/realtime/RealtimeAccumulator.d.ts +7 -0
- package/dist/components/charts/realtime/RealtimeHeatmap.d.ts +9 -2
- package/dist/components/charts/realtime/RealtimeHistogram.d.ts +13 -1
- package/dist/components/charts/realtime/RealtimeLineChart.types.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeSwarmChart.d.ts +5 -1
- package/dist/components/charts/realtime/RealtimeWaterfallChart.d.ts +7 -1
- package/dist/components/charts/realtime/TemporalHistogram.capability.d.ts +5 -3
- package/dist/components/charts/realtime/aggregate.d.ts +11 -12
- package/dist/components/charts/realtime/defaultRealtimeTooltip.d.ts +9 -0
- package/dist/components/charts/realtime/eventTime.d.ts +7 -1
- package/dist/components/charts/realtime/useRealtimeLineIngestion.d.ts +13 -0
- package/dist/components/charts/shared/ChartError.d.ts +4 -6
- package/dist/components/charts/shared/GaugeReadout.d.ts +39 -4
- package/dist/components/charts/shared/axisExtent.d.ts +2 -1
- package/dist/components/charts/shared/chartMode.d.ts +2 -2
- package/dist/components/charts/shared/gaugeLayout.d.ts +69 -0
- package/dist/components/charts/shared/types.d.ts +4 -1
- package/dist/components/charts/shared/useNetworkChartSetup.d.ts +3 -0
- package/dist/components/charts/shared/useStreamStatus.d.ts +2 -2
- package/dist/components/charts/shared/withChartErrorBoundary.d.ts +14 -0
- package/dist/components/charts/xy/Scatterplot.streamCapability.d.ts +2 -0
- package/dist/components/charts/xy/WaterfallChart.d.ts +2 -0
- package/dist/components/charts/xy/WaterfallIndex.d.ts +12 -0
- package/dist/components/charts/xy/lineGapStrategy.d.ts +15 -3
- package/dist/components/legendGeometry.d.ts +148 -0
- package/dist/components/legendLayout.d.ts +20 -38
- package/dist/components/realtime/ReorderBuffer.d.ts +14 -0
- package/dist/components/realtime/SlidingExtent.d.ts +18 -0
- package/dist/components/realtime/WindowAccumulator.d.ts +5 -1
- package/dist/components/realtime/renderers/types.d.ts +1 -0
- package/dist/components/realtime/renderers/waterfallRenderer.d.ts +1 -1
- package/dist/components/recipes/atlas/resolution/appearance.d.ts +1 -1
- package/dist/components/recipes/atlas/resolution/scene.d.ts +1 -1
- package/dist/components/recipes/compositional/edgeRouting.d.ts +9 -0
- package/dist/components/recipes/compositional/metrics.d.ts +2 -2
- package/dist/components/recipes/compositional/projection.d.ts +3 -1
- package/dist/components/recipes/compositional/routing.d.ts +3 -1
- package/dist/components/recipes/compositional/testFixtures.d.ts +4 -0
- package/dist/components/recipes/compositional/topology.d.ts +2 -0
- package/dist/components/recipes/compositional/types.d.ts +10 -1
- package/dist/components/recipes/compositional/useCompositionalInterfaces.d.ts +20 -0
- package/dist/components/semiotic-ai-core.d.ts +3 -2
- package/dist/components/semiotic-ai-stream.d.ts +3 -2
- package/dist/components/semiotic-network-zoom.d.ts +1 -1
- package/dist/components/semiotic-recipes-react.d.ts +2 -0
- package/dist/components/semiotic-utils-core.d.ts +2 -0
- package/dist/components/server/serverChartConfigHeatmap.d.ts +13 -0
- package/dist/components/server/staticLegend.d.ts +5 -0
- package/dist/components/server/staticLegendText.d.ts +13 -0
- package/dist/components/server/staticSVGChrome.d.ts +2 -2
- package/dist/components/store/ThemeStore.d.ts +4 -1
- package/dist/components/store/themeCore.d.ts +2 -0
- package/dist/components/stream/DataSourceAdapter.d.ts +15 -62
- package/dist/components/stream/FrameRuntime.d.ts +3 -0
- package/dist/components/stream/GeoPipelineStore.d.ts +2 -0
- package/dist/components/stream/IngestActivity.d.ts +9 -0
- package/dist/components/stream/NetworkPipelineStore.d.ts +3 -1
- package/dist/components/stream/OrdinalPipelineStore.d.ts +5 -2
- package/dist/components/stream/OrdinalSVGOverlay.d.ts +1 -1
- package/dist/components/stream/PipelineStore.d.ts +8 -3
- package/dist/components/stream/accessibleDataRows.d.ts +1 -0
- package/dist/components/stream/axisTickUtils.d.ts +25 -5
- package/dist/components/stream/frameDefaultMargins.d.ts +26 -4
- package/dist/components/stream/frameKeyboardNavigation.d.ts +8 -1
- package/dist/components/stream/geoTypes.d.ts +2 -0
- package/dist/components/stream/graphKeyboardNavigation.d.ts +4 -2
- package/dist/components/stream/hitTestUtils.d.ts +7 -0
- package/dist/components/stream/keyboardNav.d.ts +3 -1
- package/dist/components/stream/mediaQuery.d.ts +2 -0
- package/dist/components/stream/navigationGraph.d.ts +10 -3
- package/dist/components/stream/networkEdgeHitIndex.d.ts +6 -2
- package/dist/components/stream/networkFrameKeyboardNavigation.d.ts +2 -0
- package/dist/components/stream/networkNavGroups.d.ts +3 -0
- package/dist/components/stream/networkPipelineConfig.d.ts +1 -0
- package/dist/components/stream/networkSceneTypes.d.ts +10 -0
- package/dist/components/stream/networkSpatialNavigation.d.ts +3 -0
- package/dist/components/stream/networkTypes.d.ts +2 -0
- package/dist/components/stream/networkZoom/ZoomableNetworkCustomChart.d.ts +6 -4
- package/dist/components/stream/networkZoom/gestures.d.ts +5 -0
- package/dist/components/stream/networkZoom/types.d.ts +10 -0
- package/dist/components/stream/ordinalAxisTicks.d.ts +27 -0
- package/dist/components/stream/ordinalSceneBuilders/pieScene.d.ts +10 -0
- package/dist/components/stream/ordinalSceneBuilders/types.d.ts +2 -0
- package/dist/components/stream/ordinalTypes.d.ts +11 -2
- package/dist/components/stream/pipelineBufferUtils.d.ts +9 -0
- package/dist/components/stream/pipelineConfig.d.ts +7 -0
- package/dist/components/stream/pipelineDomainResolution.d.ts +3 -2
- package/dist/components/stream/pipelineTransitionTypes.d.ts +3 -5
- package/dist/components/stream/pipelineTransitionUtils.d.ts +4 -0
- package/dist/components/stream/pipelineTransitions.d.ts +1 -13
- package/dist/components/stream/renderers/networkArcRenderer.d.ts +1 -3
- package/dist/components/stream/renderers/networkCircleRenderer.d.ts +1 -3
- package/dist/components/stream/renderers/networkPrimitiveRenderer.d.ts +5 -0
- package/dist/components/stream/renderers/networkRectRenderer.d.ts +1 -3
- package/dist/components/stream/renderers/renderPulse.d.ts +8 -14
- package/dist/components/stream/roundScaleDomain.d.ts +9 -0
- package/dist/components/stream/sceneToSVGShared.d.ts +9 -0
- package/dist/components/stream/shallowEqual.d.ts +2 -0
- package/dist/components/stream/stalenessBands.d.ts +1 -1
- package/dist/components/stream/svgOverlayUtils.d.ts +12 -0
- package/dist/components/stream/types.d.ts +10 -2
- package/dist/components/stream/useFrame.d.ts +7 -4
- package/dist/components/stream/useMediaPreferences.d.ts +1 -4
- package/dist/components/stream/useOrdinalFrameHandle.d.ts +4 -14
- package/dist/components/stream/useStalenessCheck.d.ts +5 -3
- package/dist/components/stream/useStreamingDataHandle.d.ts +24 -0
- package/dist/components/stream/useXYFrameHandle.d.ts +4 -14
- package/dist/components/stream/xyDateTicks.d.ts +33 -4
- package/dist/components/stream/xyFrameAxisTypes.d.ts +2 -0
- package/dist/components/stream/xyPlugins/registry.d.ts +7 -0
- package/dist/components/stream/xySceneBuilders/heatmapScene.d.ts +11 -2
- package/dist/components/stream/xySceneBuilders/types.d.ts +4 -0
- package/dist/components/types/legendTypes.d.ts +12 -1
- package/dist/geo.min.js +155 -152
- package/dist/geo.module.min.js +1 -1
- package/dist/network.module.min.js +1 -1
- package/dist/ordinal.module.min.js +1 -1
- package/dist/physics.module.min.js +1 -1
- package/dist/processSankeyLayoutWorker.js +1 -1
- package/dist/semiotic-ai-core.d.ts +3 -2
- package/dist/semiotic-ai-core.min.js +5 -5
- package/dist/semiotic-ai-core.module.min.js +4 -4
- package/dist/semiotic-ai.module.min.js +2 -2
- package/dist/semiotic-artifact.min.js +6 -6
- package/dist/semiotic-artifact.module.min.js +5 -5
- package/dist/semiotic-atlas-selection.module.min.js +1 -1
- package/dist/semiotic-atlas.module.min.js +1 -1
- package/dist/semiotic-client-cjs-shared.min.js +1021 -1024
- package/dist/semiotic-client-compositional.module.min.js +1 -1
- package/dist/semiotic-client-shared.module.min.js +1 -1
- package/dist/semiotic-experimental-auxiliary.module.min.js +2 -2
- package/dist/semiotic-experimental-network-resolution-react.module.min.js +1 -1
- package/dist/semiotic-experimental-node-auxiliary.module.min.js +3 -3
- package/dist/semiotic-line.module.min.js +1 -1
- package/dist/semiotic-network-zoom.d.ts +1 -1
- package/dist/semiotic-network-zoom.min.js +7 -7
- package/dist/semiotic-network-zoom.module.min.js +1 -1
- 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 +101 -101
- package/dist/semiotic-recipes-core.module.min.js +1 -1
- package/dist/semiotic-recipes-react.d.ts +2 -0
- package/dist/semiotic-recipes-react.min.js +8 -8
- package/dist/semiotic-server-edge-node.module.min.js +3 -3
- package/dist/semiotic-server-edge.min.js +399 -397
- package/dist/semiotic-server-edge.module.min.js +3 -3
- package/dist/semiotic-server-node.min.js +399 -397
- package/dist/semiotic-themes-core.min.js +2 -2
- package/dist/semiotic-themes-core.module.min.js +1 -1
- package/dist/semiotic-themes.min.js +2 -2
- package/dist/semiotic-themes.module.min.js +1 -1
- package/dist/semiotic-utils-core.d.ts +2 -0
- package/dist/semiotic-utils-core.min.js +11 -11
- package/dist/semiotic-utils-core.module.min.js +3 -3
- package/dist/semiotic-value.module.min.js +1 -1
- package/dist/semiotic.module.min.js +1 -1
- package/dist/server.min.js +399 -397
- package/dist/server.module.min.js +3 -3
- package/dist/xy.module.min.js +1 -1
- package/package.json +11 -11
- package/dist/c-2M2OPWVA.min.js +0 -37
- package/dist/c-2N7IU2NY.min.js +0 -1
- package/dist/c-3UXQGCQT.min.js +0 -1
- package/dist/c-4RVDKSMQ.min.js +0 -1
- package/dist/c-4YPPVFZH.min.js +0 -1
- package/dist/c-6WJKNYIG.min.js +0 -1
- package/dist/c-7UN2WUMI.min.js +0 -1
- package/dist/c-AQUX6L2O.min.js +0 -1
- package/dist/c-BR5QDUCR.min.js +0 -1
- package/dist/c-C3YQVUB6.min.js +0 -1
- package/dist/c-COP4OISO.min.js +0 -1
- package/dist/c-ENRZPF5E.min.js +0 -1
- package/dist/c-FAOZZE77.min.js +0 -1
- package/dist/c-HBLICBM6.min.js +0 -1
- package/dist/c-I4BEWAKT.min.js +0 -1
- package/dist/c-IDCFMBA4.min.js +0 -2
- package/dist/c-KLJDKRD5.min.js +0 -1
- package/dist/c-LEICSI5V.min.js +0 -1
- package/dist/c-MOK4RWNO.min.js +0 -1
- package/dist/c-N2TVSOYL.min.js +0 -2
- package/dist/c-NHZ2E3CI.min.js +0 -1
- package/dist/c-OIJL2WZH.min.js +0 -1
- package/dist/c-OSLNYZ3Q.min.js +0 -51
- package/dist/c-OWRVBUSL.min.js +0 -1
- package/dist/c-QIVKWHDL.min.js +0 -1
- package/dist/c-QUAEYF34.min.js +0 -1
- package/dist/c-RDFFLRKC.min.js +0 -1
- package/dist/c-RTU5425Z.min.js +0 -1
- package/dist/c-SIQVOV6A.min.js +0 -1
- package/dist/c-SU6Z75M2.min.js +0 -1
- package/dist/c-SWVXFUDL.min.js +0 -1
- package/dist/c-TC47SNSI.min.js +0 -1
- package/dist/c-VLWWXOM5.min.js +0 -1
- package/dist/c-VNFIRKU5.min.js +0 -1
- package/dist/c-W5ATXREF.min.js +0 -1
- package/dist/c-WFX456JK.min.js +0 -5
- package/dist/c-WSWMQDFZ.min.js +0 -1
- package/dist/c-XORVM6C5.min.js +0 -1
- package/dist/c-YGTMWEEF.min.js +0 -1
- package/dist/c-ZDCTFRA6.min.js +0 -1
package/dist/geo.min.js
CHANGED
|
@@ -1,236 +1,239 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";function e(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]=String(r):r instanceof Date&&(t[n]=r.toISOString().slice(0,10)));return t}function t(e){return e&&"object"==typeof e?e:{}}function n(e){return t(e.accessibility).tableFields??e.accessibleDatum??e.datum}function r(e){const t=/* @__PURE__ */new Set;if(!e.some(e=>e&&("point"===e.type||"symbol"===e.type||"glyph"===e.type)))return t;for(const n of e)if(n&&["line","area","boxplot","violin"].includes(String(n.type))&&Array.isArray(n.datum))for(const e of n.datum)t.add(e);return t}function i(e){if(!Array.isArray(e))return 0;const t=r(e);let i=0;for(const r of e)if(r&&"object"==typeof r&&null!==r.datum)switch(r.type){case"point":case"symbol":case"glyph":t.has(r.datum)||i++;break;case"line":case"area":{const e=n(r);i+=Array.isArray(e)?e.length:null!=e&&"object"==typeof e?1:0;break}case"boxplot":case"violin":{const e=n(r);i+=Array.isArray(e)?e.length+1:1;break}case"rect":case"heatcell":case"wedge":case"circle":case"arc":case"candlestick":case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":case"geoarea":i++}return i}function o(i){const o=[];if(!Array.isArray(i))return o;const a=r(i);for(const r of i)if(r&&"object"==typeof r&&null!==r.datum)try{switch(r.type){case"point":case"symbol":case"glyph":if(a.has(r.datum))break;o.push({label:"Point",values:e(n(r))});break;case"line":case"area":{const t=n(r),i=Array.isArray(t)?t:null!=t&&"object"==typeof t?[t]:[],a="line"===r.type?"Line point":"Area point";for(const t of i)o.push({label:a,values:e(t)});break}case"boxplot":case"violin":{const t=n(r),i="boxplot"===r.type?"Boxplot":"Distribution",a="string"==typeof r.category?{category:r.category}:{};if(Array.isArray(t)){o.push({label:i,values:{...a,...e(r.stats)}});for(const n of t)o.push({label:`${i} observation`,values:{...a,...e(n)}})}else o.push({label:i,values:{...a,...e(t)}});break}case"rect":{const t=n(r),i=null!=t&&"object"==typeof t?t:{},a=i.category??r.group??"",s=i.value??i.__aggregateValue??i.total,l=e(i);null==l.category&&""!==a&&(l.category=String(a)),null==l.value&&null!=s&&(l.value="number"==typeof s||"string"==typeof s?s:String(s)),o.push({label:"Bar",values:l});break}case"heatcell":{const t=e(n(r));null==t.value&&"number"==typeof r.value&&Number.isFinite(r.value)&&(t.value=r.value),o.push({label:"Cell",values:t});break}case"wedge":{const i=n(r),a=e(i);if(null==a.category){const e=t(i),n=e.category??e.label;null!=n&&(a.category=String(n))}o.push({label:"Wedge",values:a});break}case"circle":o.push({label:"Node",values:e(n(r))});break;case"arc":o.push({label:"Arc",values:e(n(r))});break;case"candlestick":o.push({label:"Candlestick",values:e(n(r))});break;case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":o.push({label:"Connection",values:e(n(r))});break;case"geoarea":{const i=t(n(r)),a={...e(i.properties),...e(i)};o.push({label:"Region",values:a});break}}}catch{}return o}function a(e,t,n=`${t}s`){return`${e} ${1===e?t:n}`}function s(e){return"string"==typeof e?document.getElementById(e):"function"==typeof e?e():e}function l({target:e,children:t}){const[n,r]=
|
|
3
|
-
return(0,
|
|
2
|
+
"use strict";function e(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]=String(r):r instanceof Date&&(t[n]=r.toISOString().slice(0,10)));return t}function t(e){return e&&"object"==typeof e?e:{}}function n(e){return t(e.accessibility).tableFields??e.accessibleDatum??e.datum}function r(e){const t=/* @__PURE__ */new Set;if(!e.some(e=>e&&("point"===e.type||"symbol"===e.type||"glyph"===e.type)))return t;for(const n of e)if(n&&["line","area","boxplot","violin"].includes(String(n.type))&&Array.isArray(n.datum))for(const e of n.datum)t.add(e);return t}function i(e){if(!Array.isArray(e))return 0;const t=r(e);let i=0;for(const r of e)if(r&&"object"==typeof r&&null!==r.datum)switch(r.type){case"point":case"symbol":case"glyph":t.has(r.datum)||i++;break;case"line":case"area":{const e=n(r);i+=Array.isArray(e)?e.length:null!=e&&"object"==typeof e?1:0;break}case"boxplot":case"violin":{const e=n(r);i+=Array.isArray(e)?e.length+1:1;break}case"rect":case"heatcell":case"wedge":case"circle":case"arc":case"candlestick":case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":case"geoarea":i++}return i}function o(i){const o=[];if(!Array.isArray(i))return o;const a=r(i);for(const r of i)if(r&&"object"==typeof r&&null!==r.datum)try{switch(r.type){case"point":case"symbol":case"glyph":if(a.has(r.datum))break;o.push({label:"Point",values:e(n(r))});break;case"line":case"area":{const t=n(r),i=Array.isArray(t)?t:null!=t&&"object"==typeof t?[t]:[],a="line"===r.type?"Line point":"Area point";for(const t of i)o.push({label:a,values:e(t)});break}case"boxplot":case"violin":{const t=n(r),i="boxplot"===r.type?"Boxplot":"Distribution",a="string"==typeof r.category?{category:r.category}:{};if(Array.isArray(t)){o.push({label:i,values:{...a,...e(r.stats)}});for(const n of t)o.push({label:`${i} observation`,values:{...a,...e(n)}})}else o.push({label:i,values:{...a,...e(t)}});break}case"rect":{const t=n(r),i=null!=t&&"object"==typeof t?t:{},a=i.category??r.group??"",s=i.value??i.__aggregateValue??i.total,l=e(i);null==l.category&&""!==a&&(l.category=String(a)),null==l.value&&null!=s&&(l.value="number"==typeof s||"string"==typeof s?s:String(s)),o.push({label:"Bar",values:l});break}case"heatcell":{const t=e(n(r));null==t.value&&"number"==typeof r.value&&Number.isFinite(r.value)&&(t.value=r.value),o.push({label:"Cell",values:t});break}case"wedge":{const i=n(r),a=e(i);if(null==a.category){const e=t(i),n=e.category??e.label;null!=n&&(a.category=String(n))}o.push({label:"Wedge",values:a});break}case"circle":o.push({label:"Node",values:e(n(r))});break;case"arc":o.push({label:"Arc",values:e(n(r))});break;case"candlestick":o.push({label:"Candlestick",values:e(n(r))});break;case"connector":case"trapezoid":case"bezier":case"ribbon":case"curved":o.push({label:"Connection",values:e(n(r))});break;case"geoarea":{const i=t(n(r)),a={...e(i.properties),...e(i)};o.push({label:"Region",values:a});break}}}catch{}return o}function a(e,t,n=`${t}s`){return`${e} ${1===e?t:n}`}function s(e){return"string"==typeof e?document.getElementById(e):"function"==typeof e?e():e}function l({target:e,children:t}){const[n,r]=Wu.useState({requestedTarget:e,resolved:!1,target:null});return Wu.useEffect(()=>{const t=s(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,Bu.createPortal)(t,n.target):/* @__PURE__ */ /* @__PURE__ */(0,Hu.jsx)(Hu.Fragment,{children:t}):null}function c(e){return null==e||""===e?"—":"number"==typeof e?Number.isNaN(e)?"—":id(e):"boolean"==typeof e?e?"true":"false":"object"==typeof e?"—":String(e)}function u(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,r<n.min&&(n.min=r),r>n.max&&(n.max=r)}else"object"!=typeof r&&"function"!=typeof r&&n.strings.add(String(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 d(e,t){const n=[`${a(e,"data point","data points")}.`];for(const e of t)if(e.numeric)n.push(`${e.name}: ${id(e.min)} to ${id(e.max)}, mean ${id(e.mean)}.`);else{const t=e.uniqueValues,r=t.length<=3?t.join(", "):`${t.slice(0,3).join(", ")}… (${e.count} unique)`;n.push(`${e.name}: ${r}.`)}return n.join(" ")}function h({rows:e,label:t,caption:n,typeLabel:r,labelRows:i=!1,className:o="semiotic-accessible-data-table-table",style:a,extraColumns:s=[]}){const l=Array.from(new Set(e.flatMap(e=>Object.keys(e.values))));/* @__PURE__ */ /* @__PURE__ */
|
|
3
|
+
return(0,od.jsxs)("table",{className:o,role:"table","aria-label":t,style:a??$u,children:[
|
|
4
4
|
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */(0,
|
|
5
|
+
/* @__PURE__ */(0,od.jsx)("caption",{className:"semiotic-accessible-data-table-caption",style:Fu,children:n}),
|
|
6
6
|
/* @__PURE__ */
|
|
7
|
-
/* @__PURE__ */(0,
|
|
7
|
+
/* @__PURE__ */(0,od.jsx)("thead",{children:/* @__PURE__ */ /* @__PURE__ */(0,od.jsx)("tr",{children:[r,...l,...s.map(e=>e.label)].map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,od.jsx)("th",{style:Du,children:e},t))})}),
|
|
8
8
|
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */(0,
|
|
9
|
+
/* @__PURE__ */(0,od.jsx)("tbody",{children:e.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,od.jsxs)("tr",{tabIndex:-1,"aria-label":i?e.label:void 0,children:[
|
|
10
10
|
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */(0,
|
|
12
|
-
return(0,
|
|
11
|
+
/* @__PURE__ */(0,od.jsx)("td",{style:Ou,children:e.label}),l.map(t=>/* @__PURE__ */ /* @__PURE__ */(0,od.jsx)("td",{style:Ou,children:c(e.values[t])},t)),s.map((e,n)=>/* @__PURE__ */ /* @__PURE__ */(0,od.jsx)("td",{style:Ou,children:c(e.values[t])},n))]},t))})]})}function f({remaining:e,kind:t="row",onClick:n}){return e<=0?null:/* @__PURE__ */ /* @__PURE__ */(0,ad.jsxs)("button",{type:"button",className:"semiotic-accessible-data-table-show-more",onClick:n,style:_u,children:["Show ",Math.min(Lu,e)," more ",t,1===e?"":"s"," (",e," remaining)"]})}function p({scene:e,sceneRevision:t,chartType:n,revealRows:r}){const[i,s]=sd.useState(Ru),l=t??e,{allRows:c,summary:p}=sd.useMemo(()=>{const t=o(e);return{allRows:t,summary:d(t.length,u(t))}},[l]),m=Math.min(i,c.length),g=c.length-m;/* @__PURE__ */ /* @__PURE__ */
|
|
12
|
+
return(0,ld.jsxs)(ld.Fragment,{children:[
|
|
13
13
|
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */(0,
|
|
14
|
+
/* @__PURE__ */(0,ld.jsx)("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:Tu,children:p}),
|
|
15
15
|
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */(0,
|
|
16
|
+
/* @__PURE__ */(0,ld.jsx)(h,{rows:c.slice(0,m),label:`Sample data for ${n}`,typeLabel:"type",caption:g>0?`First ${m} of ${a(c.length,"data point","data points")}`:`All ${a(c.length,"data point","data points")}`}),
|
|
17
17
|
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */(0,Uu.jsx)(f,{remaining:g,onClick:e=>{r(e.currentTarget,m,Math.min(m+pu,c.length),c.length),s(e=>e+pu)},kind:"row"})]})}function m(e,t){xd(()=>{t&&(e.current=t)},[e,t])}function g(e){return e>1?Ad:e<-1?-Ad:Math.asin(e)}function y(e){return(e=Fd(e/2))*e}function b(){}function v(e,t){e&&Hd.hasOwnProperty(e.type)&&Hd[e.type](e,t)}function x(e,t,n){var r,i=-1,o=e.length-n;for(t.lineStart();++i<o;)r=e[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function w(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)x(e[n],t,1);t.polygonEnd()}function k(e,t){e&&Wd.hasOwnProperty(e.type)?Wd[e.type](e,t):v(e,t)}function S(){Vd.point=j}function M(){A(nd,rd)}function j(e,t){Vd.point=A,nd=e,rd=t,id=e*=Nd,od=Td(t=(t*=Nd)/2+Rd),ad=Fd(t)}function A(e,t){var n=(e*=Nd)-id,r=n>=0?1:-1,i=r*n,o=Td(t=(t*=Nd)/2+Rd),a=Fd(t),s=ad*a,l=od*o+s*Td(i),c=s*r*Fd(i);qd.add(Id(c,l)),id=e,od=o,ad=a}function R(e){return[Id(e[1],e[0]),g(e[2])]}function C(e){var t=e[0],n=e[1],r=Td(n);return[r*Td(t),r*Fd(t),Fd(n)]}function L(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function N(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 P(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function E(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function I(e){var t=_d(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function T(e,t){gd.push(yd=[sd=e,cd=e]),t<ld&&(ld=t),t>ud&&(ud=t)}function z(e,t){var n=C([e*Nd,t*Nd]);if(pd){var r=N(pd,n),i=N([r[1],-r[0],0],r);I(i),i=R(i);var o,a=e-dd,s=a>0?1:-1,l=i[0]*Ld*s,c=Pd(a)>180;c^(s*dd<l&&l<s*e)?(o=i[1]*Ld)>ud&&(ud=o):c^(s*dd<(l=(l+360)%360-180)&&l<s*e)?(o=-i[1]*Ld)<ld&&(ld=o):(t<ld&&(ld=t),t>ud&&(ud=t)),c?e<dd?B(sd,e)>B(sd,cd)&&(cd=e):B(e,cd)>B(sd,cd)&&(sd=e):cd>=sd?(e<sd&&(sd=e),e>cd&&(cd=e)):e>dd?B(sd,e)>B(sd,cd)&&(cd=e):B(e,cd)>B(sd,cd)&&(sd=e)}else gd.push(yd=[sd=e,cd=e]);t<ld&&(ld=t),t>ud&&(ud=t),pd=n,dd=e}function D(){Yd.point=z}function $(){yd[0]=sd,yd[1]=cd,Yd.point=T,pd=null}function F(e,t){if(pd){var n=e-dd;md.add(Pd(n)>180?n+(n>0?360:-360):n)}else hd=e,fd=t;Vd.point(e,t),z(e,t)}function O(){Vd.lineStart()}function _(){F(hd,fd),Vd.lineEnd(),Pd(md)>Sd&&(sd=-(cd=180)),yd[0]=sd,yd[1]=cd,pd=null}function B(e,t){return(t-=e)<0?t+360:t}function W(e,t){return e[0]-t[0]}function H(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function q(e){var t,n,r,i,o,a,s;if(ud=cd=-(sd=ld=1/0),gd=[],k(e,Yd),n=gd.length){for(gd.sort(W),t=1,o=[r=gd[0]];t<n;++t)H(r,(i=gd[t])[0])||H(r,i[1])?(B(r[0],i[1])>B(r[0],r[1])&&(r[1]=i[1]),B(i[0],r[1])>B(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=B(r[1],i[0]))>a&&(a=s,sd=i[0],cd=r[1])}return gd=yd=null,sd===1/0||ld===1/0?[[NaN,NaN],[NaN,NaN]]:[[sd,ld],[cd,ud]]}function G(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 V(e,t){return Pd(e)>jd&&(e-=Math.round(e/Cd)*Cd),[e,t]}function U(e,t,n){return(e%=Cd)?t||n?G(X(e),Z(t,n)):X(e):t||n?Z(t,n):V}function Y(e){return function(t,n){return Pd(t+=e)>jd&&(t-=Math.round(t/Cd)*Cd),[t,n]}}function X(e){var t=Y(e);return t.invert=Y(-e),t}function Z(e,t){function n(e,t){var n=Td(t),s=Td(e)*n,l=Fd(e)*n,c=Fd(t),u=c*r+s*i;return[Id(l*o-u*a,s*r-c*i),g(u*o+l*a)]}var r=Td(e),i=Fd(e),o=Td(t),a=Fd(t);return n.invert=function(e,t){var n=Td(t),s=Td(e)*n,l=Fd(e)*n,c=Fd(t),u=c*o-l*a;return[Id(l*o+c*a,s*r+u*i),g(u*r-s*i)]},n}function K(e){function t(t){return(t=e(t[0]*Nd,t[1]*Nd))[0]*=Ld,t[1]*=Ld,t}return e=U(e[0]*Nd,e[1]*Nd,e.length>2?e[2]*Nd:0),t.invert=function(t){return(t=e.invert(t[0]*Nd,t[1]*Nd))[0]*=Ld,t[1]*=Ld,t},t}function Q(e,t,n,r,i,o){if(n){var a=Td(t),s=Fd(t),l=r*n;null==i?(i=t+r*Cd,o=t-l/2):(i=J(a,i),o=J(a,o),(r>0?i<o:i>o)&&(i+=r*Cd));for(var c,u=i;r>0?u>o:u<o;u-=l)c=R([a,-s*Td(u),-s*Fd(u)]),e.point(c[0],c[1])}}function J(e,t){(t=C(t))[0]-=e,I(t);var n,r=(n=-t[1])>1?0:n<-1?jd:Math.acos(n);return((-t[2]<0?-r:r)+Cd-Sd)%Cd}function ee(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:b,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function te(e,t){return Pd(e[0]-t[0])<Sd&&Pd(e[1]-t[1])<Sd}function ne(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 re(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(te(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<t;++o)i.point((r=e[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}s.push(n=new ne(r,e,null,!0)),l.push(n.o=new ne(r,null,n,!1)),s.push(n=new ne(a,e,null,!1)),l.push(n.o=new ne(a,null,n,!0))}}),s.length){for(l.sort(t),ie(s),ie(l),o=0,a=l.length;o<a;++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;o<a;++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(c=h.p.z,o=c.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 ie(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 oe(e){return Pd(e[0])<=jd?e[0]:Od(e[0])*((Pd(e[0])+jd)%Cd-jd)}function ae(e,t){var n=oe(t),r=t[1],i=Fd(r),o=[Fd(n),-Td(n),0],a=0,s=0,l=new sh.Adder;1===i?r=Ad+Sd:-1===i&&(r=-Ad-Sd);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,f=d[h-1],p=oe(f),m=f[1]/2+Rd,y=Fd(m),b=Td(m),v=0;v<h;++v,p=w,y=S,b=M,f=x){var x=d[v],w=oe(x),k=x[1]/2+Rd,S=Fd(k),M=Td(k),j=w-p,A=j>=0?1:-1,R=A*j,L=R>jd,P=y*S;if(l.add(Id(P*A*Fd(R),b*M+P*Td(R))),a+=L?j+A*Cd:j,L^p>=n^w>=n){var E=N(C(f),C(x));I(E);var T=N(o,E);I(T);var z=(L^j>=0?-1:1)*g(T[2]);(r>z||r===z&&(E[0]||E[1]))&&(s+=L^j>=0?1:-1)}}return(a<-Sd||a<Sd&&l<-1e-12)^1&s}function se(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(){v.point=a,m.lineStart()}function l(){v.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(b||(i.polygonStart(),b=!0),i.lineStart(),e=0;e<t;++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(le))}var h,f,p,m=t(i),g=ee(),y=t(g),b=!1,v={point:o,lineStart:s,lineEnd:l,polygonStart:function(){v.point=c,v.lineStart=u,v.lineEnd=d,f=[],h=[]},polygonEnd:function(){v.point=o,v.lineStart=s,v.lineEnd=l,f=(0,lh.merge)(f);var e=ae(h,r);f.length?(b||(i.polygonStart(),b=!0),re(f,ce,e,n,i)):e&&(b||(i.polygonStart(),b=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),f=h=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};return v}}function le(e){return e.length>1}function ce(e,t){return((e=e.x)[0]<0?e[1]-Ad-Sd:Ad-e[1])-((t=t.x)[0]<0?t[1]-Ad-Sd:Ad-t[1])}function ue(e,t,n,r){var i,o,a=Fd(e-n);return Pd(a)>Sd?Ed((Fd(t)*(o=Td(r))*Fd(n)-Fd(r)*(i=Td(t))*Fd(e))/(i*o*a)):(t+r)/2}function de(e){function t(e,t){return Td(e)*Td(t)>i}function n(e,t,n){var r=[1,0,0],o=N(C(e),C(t)),a=L(o,o),s=o[0],l=a-s*s;if(!l)return!n&&e;var c=i*a/l,u=-i*s/l,d=N(r,o),h=E(r,c);P(h,E(o,u));var f=d,p=L(h,f),m=L(f,f),g=p*p-m*(L(h,h)-1);if(!(g<0)){var y=_d(g),b=E(f,(-p-y)/m);if(P(b,h),b=R(b),!n)return b;var v,x=e[0],w=t[0],k=e[1],S=t[1];w<x&&(v=x,x=w,w=v);var M=w-x,j=Pd(M-jd)<Sd;if(!j&&S<k&&(v=k,k=S,S=v),j||M<Sd?j?k+S>0^b[1]<(Pd(b[0]-x)<Sd?k:S):k<=b[1]&&b[1]<=S:M>jd^(x<=b[0]&&b[0]<=w)){var A=E(f,(-p+y)/m);return P(A,h),[b,R(A)]}}}function r(t,n){var r=a?e:jd-e,i=0;return t<-r?i|=1:t>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var i=Td(e),o=2*Nd,a=i>0,s=Pd(i)>Sd;return se(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+(d<0?jd:-jd),h):0;if(!i&&(c=l=m)&&e.lineStart(),m!==l&&(!(f=n(i,p))||te(i,f)||te(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&&te(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){Q(i,e,o,r,t,n)},a?[0,-e]:[-jd,e-jd])}function he(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||!(a>0)){if(a/=d,d<0){if(a<c)return;a<u&&(u=a)}else if(d>0){if(a>u)return;a>c&&(c=a)}if(a=i-s,d||!(a<0)){if(a/=d,d<0){if(a>u)return;a>c&&(c=a)}else if(d>0){if(a<c)return;a<u&&(u=a)}if(a=r-l,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<u&&(u=a)}else if(h>0){if(a>u)return;a>c&&(c=a)}if(a=o-l,h||!(a<0)){if(a/=h,h<0){if(a>u)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<u&&(u=a)}return c>0&&(e[0]=s+c*d,e[1]=l+c*h),u<1&&(t[0]=s+u*d,t[1]=l+u*h),!0}}}}}function fe(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))||l(i,o)<0^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 Pd(r[0]-e)<Sd?i>0?0:3:Pd(r[0]-n)<Sd?i>0?2:1:Pd(r[1]-t)<Sd?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;n<i;++n)for(var o,a,s=h[n],l=1,c=s.length,u=s[0],d=u[0],f=u[1];l<c;++l)o=d,a=f,d=(u=s[l])[0],f=u[1],a<=r?f>r&&(d-o)*(r-a)>(f-a)*(e-o)&&++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&&v)k.point(o,a);else{var l=[y=Math.max(hh,Math.min(dh,y)),b=Math.max(hh,Math.min(dh,b))],c=[o=Math.max(hh,Math.min(dh,o)),a=Math.max(hh,Math.min(dh,a))];he(l,c,e,t,n,r)?(v||(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,b=a,v=s}var d,h,f,p,m,g,y,b,v,x,w,k=a,S=ee(),M={point:l,lineStart:function(){M.point=u,h&&h.push(f=[]),x=!0,v=!1,y=b=NaN},lineEnd:function(){d&&(u(p,m),g&&v&&S.rejoin(),d.push(S.result())),M.point=l,v&&k.lineEnd()},polygonStart:function(){k=S,d=[],h=[],w=!0},polygonEnd:function(){var e=c(),t=w&&e,n=(d=(0,uh.merge)(d)).length;(t||n)&&(a.polygonStart(),t&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),n&&re(d,s,e,o,a),a.polygonEnd()),k=a,d=h=f=null}};return M}}function pe(){ph.point=ph.lineEnd=b}function me(e,t){Zd=e*=Nd,Kd=Fd(t*=Nd),Qd=Td(t),ph.point=ge}function ge(e,t){e*=Nd;var n=Fd(t*=Nd),r=Td(t),i=Pd(e-Zd),o=Td(i),a=r*Fd(i),s=Qd*n-Kd*r*o,l=Kd*n+Qd*r*o;Xd.add(Id(_d(a*a+s*s),l)),Zd=e,Kd=n,Qd=r}function ye(e,t){return mh[0]=e,mh[1]=t,n=gh,Xd=new fh.Adder,k(n,ph),+Xd;var n}function be(e,t){return!(!e||!bh.hasOwnProperty(e.type))&&bh[e.type](e,t)}function ve(e,t){return 0===ye(e,t)}function xe(e,t){for(var n,r,i,o=0,a=e.length;o<a;o++){if(0===(r=ye(e[o],t)))return!0;if(o>0&&(i=ye(e[o],e[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<Md*i)return!0;n=r}return!1}function we(e,t){return!!ae(e.map(ke),Se(t))}function ke(e){return(e=e.map(Se)).pop(),e}function Se(e){return[e[0]*Nd,e[1]*Nd]}function Me(e,t){return(e&&yh.hasOwnProperty(e.type)?yh[e.type]:be)(e,t)}function je(e,t,n){var r=(0,vh.range)(e,t-Sd,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function Ae(e,t,n){var r=(0,vh.range)(e,t-Sd,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function Re(){function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return(0,vh.range)(zd(o/g)*g,i,g).map(h).concat((0,vh.range)(zd(c/y)*y,l,y).map(f)).concat((0,vh.range)(zd(r/p)*p,n,p).filter(function(e){return Pd(e%g)>Sd}).map(u)).concat((0,vh.range)(zd(s/m)*m,a,m).filter(function(e){return Pd(e%y)>Sd}).map(d))}var n,r,i,o,a,s,l,c,u,d,h,f,p=10,m=p,g=90,y=360,b=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?(o=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],o>i&&(t=o,o=i,i=t),c>l&&(t=c,c=l,l=t),e.precision(b)):[[o,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),e.precision(b)):[[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?(b=+t,u=je(s,a,90),d=Ae(r,n,b),h=je(c,l,90),f=Ae(o,i,b),e):b},e.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Ce(e,t){var n=e[0]*Nd,r=e[1]*Nd,i=t[0]*Nd,o=t[1]*Nd,a=Td(r),s=Fd(r),l=Td(o),c=Fd(o),u=a*Td(n),d=a*Fd(n),h=l*Td(i),f=l*Fd(i),p=2*g(_d(y(o-r)+a*l*y(i-n))),m=Fd(p),b=p?function(e){var t=Fd(e*=p)/m,n=Fd(p-e)/m,r=n*u+t*h,i=n*d+t*f,o=n*s+t*c;return[Id(i,r)*Ld,Id(o,_d(r*r+i*i))*Ld]}:function(){return[n*Ld,r*Ld]};return b.distance=p,b}function Le(){Mh.point=Ne}function Ne(e,t){Mh.point=Pe,Jd=th=e,eh=nh=t}function Pe(e,t){Sh.add(nh*e-th*t),th=e,nh=t}function Ee(){Pe(Jd,eh)}function Ie(e,t){Ph+=e,Eh+=t,++Ih}function Te(){_h.point=ze}function ze(e,t){_h.point=De,Ie(oh=e,ah=t)}function De(e,t){var n=e-oh,r=t-ah,i=_d(n*n+r*r);Th+=i*(oh+e)/2,zh+=i*(ah+t)/2,Dh+=i,Ie(oh=e,ah=t)}function $e(){_h.point=Ie}function Fe(){_h.point=_e}function Oe(){Be(rh,ih)}function _e(e,t){_h.point=Be,Ie(rh=oh=e,ih=ah=t)}function Be(e,t){var n=e-oh,r=t-ah,i=_d(n*n+r*r);Th+=i*(oh+e)/2,zh+=i*(ah+t)/2,Dh+=i,$h+=(i=ah*e-oh*t)*(oh+e),Fh+=i*(ah+t),Oh+=3*i,Ie(oh=e,ah=t)}function We(e){this._context=e}function He(e,t){Jh.point=qe,Hh=Gh=e,qh=Vh=t}function qe(e,t){Gh-=e,Vh-=t,Qh.add(_d(Gh*Gh+Vh*Vh)),Gh=e,Vh=t}function Ge(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Ve(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Ge;if(t!==Uh){const e=10**t;Uh=t,Yh=function(t){let n=1;this._+=t[0];for(const r=t.length;n<r;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}return Yh}function Ue(e,t){function n(e){return e&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),k(e,r(i))),i.result()}let r,i,o=3,a=4.5;return n.area=function(e){return k(e,r(jh)),jh.result()},n.measure=function(e){return k(e,r(ef)),ef.result()},n.bounds=function(e){return k(e,r(Nh)),Nh.result()},n.centroid=function(e){return k(e,r(Bh)),Bh.result()},n.projection=function(t){return arguments.length?(r=null==t?(e=null,xh):(e=t).stream,n):e},n.context=function(e){return arguments.length?(i=null==e?(t=null,new tf(o)):new We(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(!(t>=0))throw new RangeError(`invalid digits: ${e}`);o=t}return null===t&&(i=new tf(o)),n},n.projection(e).digits(o).context(t)}function Ye(e){return function(t){var n=new Xe;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Xe(){}function Ze(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),k(n,e.stream(Nh)),t(Nh.result()),null!=r&&e.clipExtent(r),e}function Ke(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 Qe(e,t,n){return Ke(e,[[0,0],t],n)}function Je(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 et(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 tt(e,t){return+t?rt(e,t):nt(e)}function nt(e){return Ye({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function rt(e,t){function n(r,i,o,a,s,l,c,u,d,h,f,p,m,y){var b=c-r,v=u-i,x=b*b+v*v;if(x>4*t&&m--){var w=a+h,k=s+f,S=l+p,M=_d(w*w+k*k+S*S),j=g(S/=M),A=Pd(Pd(S)-1)<Sd||Pd(o-d)<Sd?(o+d)/2:Id(k,w),R=e(A,j),C=R[0],L=R[1],N=C-r,P=L-i,E=v*N-b*P;(E*E/x>t||Pd((b*N+v*P)/x-.5)>.3||a*h+s*f+l*p<nf)&&(n(r,i,o,a,s,l,C,L,A,w/=M,k/=M,S,m,y),y.point(C,L),n(C,L,A,w,k,S,c,u,d,h,f,p,m,y))}}return function(t){function r(n,r){n=e(n,r),t.point(n[0],n[1])}function i(){y=NaN,k.point=o,t.lineStart()}function o(r,i){var o=C([r,i]),a=e(r,i);n(y,b,g,v,x,w,y=a[0],b=a[1],g=r,v=o[0],x=o[1],w=o[2],16,t),t.point(y,b)}function a(){k.point=r,t.lineEnd()}function s(){i(),k.point=l,k.lineEnd=c}function l(e,t){o(u=e,t),d=y,h=b,f=v,p=x,m=w,k.point=o}function c(){n(y,b,g,v,x,w,d,h,u,f,p,m,16,t),k.lineEnd=a,a()}var u,d,h,f,p,m,g,y,b,v,x,w,k={point:r,lineStart:i,lineEnd:a,polygonStart:function(){t.polygonStart(),k.lineStart=s},polygonEnd:function(){t.polygonEnd(),k.lineStart=i}};return k}}function it(e){return Ye({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function ot(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 at(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 ot(e,t,n,r,i);var s=Td(o),l=Fd(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 st(e){return lt(function(){return e})()}function lt(e){function t(e){return h(e[0]*Nd,e[1]*Nd)}function n(e){return(e=h.invert(e[0],e[1]))&&[e[0]*Ld,e[1]*Ld]}function r(){var e=at(m,0,0,M,j,S).apply(null,o(b,v)),t=at(m,g-e[0],y-e[1],M,j,S);return a=U(x,w,k),d=G(o,t),h=G(a,d),u=tt(d,N),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,b=0,v=0,x=0,w=0,k=0,S=0,M=1,j=1,A=null,R=ch,C=null,L=xh,N=.5;return t.stream=function(e){return f&&p===e?f:f=rf(it(a)(R(u(L(p=e)))))},t.preclip=function(e){return arguments.length?(R=e,A=void 0,i()):R},t.postclip=function(e){return arguments.length?(L=e,C=s=l=c=null,i()):L},t.clipAngle=function(e){return arguments.length?(R=+e?de(A=e*Nd):(A=null,ch),i()):A*Ld},t.clipExtent=function(e){return arguments.length?(L=null==e?(C=s=l=c=null,xh):fe(C=+e[0][0],s=+e[0][1],l=+e[1][0],c=+e[1][1]),i()):null==C?null:[[C,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?(b=e[0]%360*Nd,v=e[1]%360*Nd,r()):[b*Ld,v*Ld]},t.rotate=function(e){return arguments.length?(x=e[0]%360*Nd,w=e[1]%360*Nd,k=e.length>2?e[2]%360*Nd:0,r()):[x*Ld,w*Ld,k*Ld]},t.angle=function(e){return arguments.length?(S=e%360*Nd,r()):S*Ld},t.reflectX=function(e){return arguments.length?(M=e?-1:1,r()):M<0},t.reflectY=function(e){return arguments.length?(j=e?-1:1,r()):j<0},t.precision=function(e){return arguments.length?(u=tt(d,N=e*e),i()):_d(N)},t.fitExtent=function(e,n){return Ke(t,e,n)},t.fitSize=function(e,n){return Qe(t,e,n)},t.fitWidth=function(e,n){return Je(t,e,n)},t.fitHeight=function(e,n){return et(t,e,n)},function(){return o=e.apply(this,arguments),t.invert=o.invert&&n,r()}}function ct(e){function t(e,t){return[e*n,Fd(t)/n]}var n=Td(e);return t.invert=function(e,t){return[e/n,g(t*n)]},t}function ut(e,t){function n(e,t){var n=_d(o-2*i*Fd(t))/i;return[n*Fd(e*=i),a-n*Td(e)]}var r=Fd(e),i=(r+Fd(t))/2;if(Pd(i)<Sd)return ct(e);var o=1+r*(2*i-r),a=_d(o)/i;return n.invert=function(e,t){var n=a-t,r=Id(e,Pd(n))*Od(n);return n*i<0&&(r-=jd*Od(e)*Od(n)),[r/i,g((o-(e*e+n*n)*i*i)/(2*i))]},n}function dt(){return(e=ut,t=0,n=jd/3,r=lt(e),i=r(t,n),i.parallels=function(e){return arguments.length?r(t=e[0]*Nd,n=e[1]*Nd):[t*Ld,n*Ld]},i).scale(155.424).center([0,33.6442]);var e,t,n,r,i}function ht(e,t){return[e,$d(Bd((Ad+t)/2))]}function ft(e){function t(){var t=jd*s(),a=o(K(o.rotate()).invert([0,0]));return c(null==u?[[a[0]-t,a[1]-t],[a[0]+t,a[1]+t]]:e===ht?[[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=st(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 pt(e,t){return[e,t]}function mt(e,t){var n=g(uf*Fd(t)),r=n*n,i=r*r*r;return[e*Td(n)/(uf*(af+3*sf*r+i*(7*lf+9*cf*r))),n*(af+sf*r+i*(lf+cf*r))]}function gt(){return st(mt).scale(177.158)}function yt(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 bt(e,t){return[Td(t)*Fd(e),Fd(t)]}function vt(e,t,n){if(Number.isFinite(e.scale())&&e.translate().every(Number.isFinite))return;e.scale(Math.max(1,Math.min(n.width,n.height)/(2*Math.PI))),e.translate([n.width/2,n.height/2]);const r=Ue(e).bounds(t);if(!r.flat().every(Number.isFinite))return;const i=e.translate();e.translate([i[0]+n.width/2-(r[0][0]+r[1][0])/2,i[1]+n.height/2-(r[0][1]+r[1][1])/2])}function xt(e,t){ff.set(e,t)}function wt(e,t){let n;const r=/* @__PURE__ */new Map;return e.map(e=>{const i=ff.get(e);if(void 0!==i)return i;if(!n){const e=/* @__PURE__ */new Map;n=e,t.forEach((t,n)=>{const r=e.get(t);r?r.push(n):e.set(t,[n])})}const o=r.get(e.datum)??0;return r.set(e.datum,o+1),n.get(e.datum)?.[o]??-1})}function kt(e){return{projection:e,geoPath:Ue(e),projectedPoint:(t,n)=>e([t,n]),invertedPoint:(t,n)=>e.invert?.([t,n])??null}}function St(e,t="ease-out-cubic"){return"linear"===t?e:1-Math.pow(1-e,3)}function Mt(e,t){const n=e-t.startTime;return Math.min(n/t.duration,1)}function jt(e,t,n){return e+(t-e)*n}function At(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 Rt(e,t,n={}){if(!Number.isFinite(t)||t<=0)return"fresh";if(Number.isNaN(e))return"fresh";if(e===1/0)return"expired";if(e<0)return"fresh";const r=n.fresh??gf,i=n.aging??yf,o=n.stale??bf;return e<t*r?"fresh":e<t*i?"aging":e<t*o?"stale":"expired"}function Ct(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)||e.extent<=0)return 1;const n=Math.max(0,e.age);if("step"===e.type)return n<(e.threshold??.5*e.extent)?1:t;if("exponential"===e.type){const r=e.halfLife??e.extent/2,i=r>0?r:e.extent/2;return t+Math.pow(.5,n/i)*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}function Lt(e,t,n){if(n<=1)return 1;const r=n-1;return Ct({age:r-t,extent:r,type:e.type,halfLife:e.halfLife??n/2,threshold:e.stepThreshold??.5*n,minOpacity:e.minOpacity??.1})}function Nt(e,t,n){const r=e.duration??500,i=n-t;return i>=r?0:1-i/r}function Pt(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 Et(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&&n-i<r}function It(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function Tt(e,t,n){const r=e=>e.toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function zt(e){const t=e.map(It),n=t.length-1;return e=>{if(Number.isNaN(e)&&(e=0),e<=0){const[e,n,r]=t[0];return Tt(e,n,r)}if(e>=1){const[e,r,i]=t[n];return Tt(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 Tt(Math.round(a+(c-a)*o),Math.round(s+(u-s)*o),Math.round(l+(d-l)*o))}}function Dt(e){return e&&Object.prototype.hasOwnProperty.call(Rf,e)?Rf[e]:wf}function $t(e,t,n=Lf){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(Cf,e)?Cf[e]:void 0;if(Array.isArray(t)&&t.length>0)return t}return t&&t.length>0?t:n}function Ft(e){const t=e.toLowerCase();return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")||Ef.has(t)}function Ot(e,t,n){if("function"==typeof t){const r=t(e);return n&&r&&"string"==typeof r&&!Ft(r)?n(r):r}const r=String(e?.[t]);return n?n(r):Lf[Math.abs(Wt(r))%Lf.length]}function _t(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 Bt(e,t,n="category10"){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;return t=>_t(e,t)??"#999"}const r=Array.from(new Set(e.map(e=>e?.[t]).filter(e=>null!=e).map(e=>String(e)))),i=r.every(e=>!isNaN(Number(e)));if(Array.isArray(n))return(0,vf.scaleOrdinal)().domain(r).range(n).unknown("#999");const o=Object.prototype.hasOwnProperty.call(Cf,n)?Cf[n]:Cf.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:Lf;return(0,vf.scaleOrdinal)().domain(r).range(e).unknown("#999")}}function Wt(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}function Ht(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 c<0?c=0:c>1&&(c=1),s+c*(l-s)}function qt(e,t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:void 0;return 0===e.length?e=>n&&_t(n,e)||"#4e79a7":t=>{if(n){const e=_t(n,t);if(e)return e}let r=0;for(let e=0;e<t.length;e++)r=31*r+t.charCodeAt(e)|0;return e[Math.abs(r)%e.length]??"#4e79a7"}}function Gt(e){if("production"===process.env.NODE_ENV)return;const{label:t,nodes:n,overlays:r,warned:i}=e;Vt(r)&&0===n.length&&Ut(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)&&Ut(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 Vt(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(Vt))}function Ut(e,t,n){e.has(t)||(e.add(t),console.warn(n))}function Yt(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:String(e)}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}function Xt(e,t,n,r){const i=Yt(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 Zt(e){try{return{kind:"success",result:e.run()}}catch(t){const n=e.hasPreviousResult,r=Xt(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 Kt(e){if(!e)return gt();if("string"==typeof e){const t=If[e];return t?t():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${e}", falling back to equalEarth`),gt())}if("object"==typeof e&&"type"in e){const t=If[e.type],n=t?t():gt();return e.rotate&&"rotate"in n&&n.rotate(e.rotate),e.center&&"center"in n&&n.center(e.center),n}return e}function Qt(e,t){return e?"function"==typeof e?e:t=>t[e]:e=>e[t]}function Jt(e){return e?"function"==typeof e?e:t=>t[e]:e=>e.coordinates||e.data||[]}function en(e,t,n){return e?"function"==typeof e?{...n,...e(t)}:{...n,...e}:{...n}}function tn(e){return{fill:e.themeSemantic?.surface||"#e0e0e0",stroke:e.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}function nn(e){return{fill:e.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}function rn(e){return{stroke:e.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}function on(e,t){if(e.length<2)return[e];const n=.4*t,r=[];let i=[e[0]];for(let t=1;t<e.length;t++){const o=e[t-1],a=e[t];Math.abs(a[0]-o[0])>n?(i.length>=2&&r.push(i),i=[a]):i.push(a)}return i.length>=2&&r.push(i),r}function an(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;r<=n;r++){const i=r/n,o=1-i,a=o*o*e[0]+2*o*i*c+i*i*t[0],s=o*o*e[1]+2*o*i*u+i*i*t[1];d.push([a,s])}return d}function sn(e,t){if(e.length<2)return e;const n=t/2+1,r=[];for(let t=0;t<e.length;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,l=a/s,c=-o/s;r.push([i[0]+l*n,i[1]+c*n])}return r}function ln(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 cn(e,t){let n=1/0,r=-1/0;for(const i of e){const e=t?t(i):i;e<n&&(n=e),e>r&&(r=e)}return[n,r]}function un(e,t=-1/0){let n=t;for(const t of e)t>n&&(n=t);return n}function dn(e,t,n,r){const i=e.filter(e=>"point"===e.type);if(i.length<2)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&&String(l(e.datum))===String(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=un(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?fn(i,u,c,d,n):hn(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(String(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(String(r)),a=e.get(String(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;e<n.path.length;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 hn(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,Tf.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 fn(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,Tf.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(;d<c.length;){let e=d+1;for(;e<c.length&&Math.abs(c[e].x-c[d].x)<3;)e++;const t=e-d;if(t>1&&u>0)for(let e=0;e<t;e++){const n=e-(t-1)/2,r=Math.min(2.5,2*u/Math.max(1,t-1));c[d+e].node.y=s+n*r}d=e}return{cx:o,cy:s,maxCost:r,availableRadius:a,layout:"strip"}}function pn(e,t,n,r){const i=e.push(t);return n&&n.push(r),i}function mn(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;e<i.length;e++)r.has(e)||t.push(i[e])}function gn(e,t){const n={...e};for(const e of t)n[zf[e]]++;return n}function yn(e,t,n){const r=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:r,revisions:gn(n,r)}}function bn(e){let t="preserve";const n=/* @__PURE__ */new Set;for(const r of e){const e=Object.prototype.hasOwnProperty.call(Uf,r)?Uf[r]:Yf;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)n.add(t)}return{retainedData:t,invalidations:n}}function vn({config:e,projection:t,path:n,areas:r,points:i,lines:o,layout:a}){const s=Qt(e.xAccessor,"lon"),l=Qt(e.yAccessor,"lat"),c=[],u=tn(e),d=rn(e),h=nn(e);if(e.graticule){const t=!0===e.graticule?{}:e.graticule,r=Re();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:en(e.areaStyle,t,u),datum:t,interactive:!0})}const f=Jt(e.lineDataAccessor);for(const n of o){const r=f(n);if(!r||r.length<2)continue;let i=[];if("geo"===e.lineType){const e=new Array(r.length);for(let t=0;t<r.length;t++)e[t]=[s(r[t]),l(r[t])];for(let n=0;n<e.length-1;n++){const r=e[n],o=e[n+1],a=ye(r,o)||0,s=Math.max(2,Math.ceil(a/(Math.PI/180))),l=Ce(r,o);for(let e=0;e<=s;e++){if(n>0&&0===e)continue;const r=t(l(e/s));null!=r&&i.push(r)}}}else for(let e=0;e<r.length;e++){const n=r[e],o=t([s(n),l(n)]);null!=o&&i.push(o)}if(i.length<2)continue;const o=en(e.lineStyle,n,d),u="number"==typeof o.strokeWidth?o.strokeWidth:1;2===r.length&&i.length>=2&&"arc"===e.flowStyle?i=an(i[0],i[i.length-1]):2===r.length&&i.length>=2&&"offset"===e.flowStyle&&(i="geo"===e.lineType?sn(i,u):ln(i[0],i[i.length-1],0,0,u));const h=on(i,a.width);if(h.length<=1)c.push({type:"line",path:i.length>=2?i:h[0]||i,style:o,datum:n});else for(const e of h)e.length<2||c.push({type:"line",path:e,style:{...o,_edgeFade:!0},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],b="function"==typeof t.center?t.center():[0,0],v=[(b[0]??0)-y[0],(b[1]??0)-y[1]];for(const[n,r]of i.entries()){const i=s(r),o=l(r);if(!Number.isFinite(i)||!Number.isFinite(o))continue;if(null!=g&&ye([i,o],v)>g)continue;const a=t([i,o]);if(!a||!Number.isFinite(a[0])||!Number.isFinite(a[1]))continue;const u=e.pointStyle?e.pointStyle(r):{...h},d={type:"point",x:a[0],y:a[1],r:u.r||4,style:u,datum:r,pointId:p?String(p(r)):void 0};xt(d,n),c.push(d)}return c}function xn(e){if(null==e)return 0;if("number"==typeof e&&Number.isFinite(e)&&e>=0&&e<.5)return e;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${String(e)}.`)}function wn(e){return{...e,fitPadding:xn(e.fitPadding)}}function kn(e){return"fitPadding"in e?{...e,fitPadding:xn(e.fitPadding)}:e}function Sn(e){if(!e)return np;for(const t of e)if(null==t||"object"!=typeof t)return e.filter(e=>null!=e&&"object"==typeof e);return e}function Mn(e,{storeRef:t,dirtyRef:n,scheduleRender:r,zoomTransformRef:i,containerRef:o,zoomBehaviorRef:a}){const s=(0,Jf.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushPoint(e),n.current=!0,r())},[t,n,r]),l=(0,Jf.useCallback)(e=>{const i=Sn(e);0!==i.length&&(t.current?.pushMany(i),n.current=!0,r())},[t,n,r]),c=(0,Jf.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushLine(e),n.current=!0,r())},[t,n,r]),u=(0,Jf.useCallback)(e=>{const i=Sn(e);0!==i.length&&(t.current?.pushManyLines(i),n.current=!0,r())},[t,n,r]),d=(0,Jf.useCallback)(()=>{t.current?.clear(),n.current=!0,r()},[t,n,r]);(0,Jf.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,ep.select)(e).call(a.current.transform,tp.zoomIdentity)},getData:()=>t.current?.getPoints()??[]}),[s,l,c,u,d,r,t,n,i,o,a])}function jn(e){const{domain:t,layout:n,sceneGeometry:r}=e.revisions;return{domain:t,layout:n,sceneGeometry:r}}function An(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}function Rn(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 Cn(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 Ln(e,t){return"function"==typeof e?.addEventListener?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e?.addListener?.(t),()=>e?.removeListener?.(t))}function Nn(){const[e,t]=(0,fp.useState)(()=>!("undefined"==typeof window||!window.matchMedia)&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return(0,fp.useEffect)(()=>{if("undefined"==typeof window||!window.matchMedia)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)");return t(e.matches),Ln(e,e=>t(e.matches))},[]),e}function Pn(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 En(e,t,n,r={}){const i=(0,pp.useRef)(null),[o,a]=(0,pp.useState)(null);mp(()=>{if(!t&&!n)return;const e=i.current;if(!e||"undefined"==typeof ResizeObserver)return;const o=(e,t)=>({w:Pn(e,r.minWidth,r.maxWidth,r.widthStep),h:Pn(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]);const s=[t&&o?o.w:e[0],n&&o?o.h:e[1]];return[i,s]}function In(e){return 0!==e.fontfaces?.length}function Tn(e){const t="undefined"==typeof document?void 0:document.fonts;if(!t||"function"!=typeof t.addEventListener)return()=>{};const n=t=>{In(t)&&e()};return t.addEventListener("loadingdone",n),()=>t.removeEventListener("loadingdone",n)}function zn(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 Dn(){if(bp)return;if("undefined"==typeof window||"undefined"==typeof document)return;bp=!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 Sp){const i=r.getElement();i&&(!e||e.some(e=>t(e,i)))&&n.push(r)}if(!e||0!==n.length){yp++;for(const e of n)e.listener()}};if("undefined"!=typeof MutationObserver&&document.documentElement&&(vp=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{xp=window.matchMedia("(prefers-color-scheme: dark)"),wp=()=>n(),"function"==typeof xp.addEventListener?xp.addEventListener("change",wp):"function"==typeof xp.addListener&&xp.addListener(wp)}catch{}kp=Tn(()=>n())}function $n(e,t){Dn();const n={getElement:e,listener:t};return Sp.add(n),()=>{Sp.delete(n)&&0===Sp.size&&(vp?.disconnect(),vp=null,xp&&wp&&("function"==typeof xp.removeEventListener?xp.removeEventListener("change",wp):"function"==typeof xp.removeListener&&xp.removeListener(wp)),xp=null,wp=null,kp?.(),kp=null,bp=!1)}}function Fn(e,t){if(!t)return t;const n=zn(t);if(!n)return t;const r=()=>n.fallback?Fn(e,n.fallback):t,i=e.canvas;if(!i)return r();let o=gp.get(i);o&&o.version===yp||(o={version:yp,map:/* @__PURE__ */new Map},gp.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 On(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 _n(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}function Bn(e,t){const n=e();return Number.isFinite(n)?n:t}function Wn(e,t){const n=t?36:0;return e.top>=n?e:{...e,top:n}}function Hn(e){let t=6;for(let n=1;n<e.length;n++){const r=Math.abs(e[n]-e[n-1]);if(r>0&&Number.isFinite(r)){const i=Math.max(Math.abs(e[n]),Math.abs(e[n-1]));t=Math.max(t,Math.ceil(Math.log10(i/r))+1)}}const n=Math.min(17,t);return e=>Number.isInteger(e)?String(e):String(Number(e.toPrecision(n)))}function qn(...e){let t;for(const n of e)n&&(t=Gn(t)&&Gn(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function Gn(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function Vn(e){return"object"==typeof e&&null!==e&&"gradient"in e}function Un(e,t,n,r,i=8){const o="left"===r||"right"===r,a=r,s="left"===r?"right":"right"===r?"left":"top"===r?"bottom":"top",l=Math.max(0,(o?n[0]:n[1])-i),c=Math.max(t[a],l-e[s]);e[a]>c&&(e[a]=c)}function Yn(e){return Math.ceil(7*e.length)}function Xn(e,t){if(Gn(e)){const n=ir(t);let r=100;for(const t of e.legendGroups){t.label&&(r=Math.max(r,Yn(t.label)));for(const e of t.items)r=Math.max(r,n.swatchSize+n.labelGap+Yn(e.label))}return r}if(Vn(e)){const{gradient:t}=e,n=t.format||Hn(t.domain),r=Math.max(Yn(n(t.domain[0])),Yn(n(t.domain[1]))),i=t.label?Yn(t.label):0;return Math.max(100,19+r,i)}return 100}function Zn(e){return(Gn(e)||Vn(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):10}function Kn(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?Rp:Ap:0}function Qn(e){return Math.max(0,e?.edgeGutter??3)}function Jn(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?64:46:22:0}function er(e,t,n){if(Vn(e))return e.gradient.label?46:26;if(!Gn(e))return 20;const r=ir(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+Yn(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?Yn(t.label):0)}return o+(e.legendGroups.length>1?16:0)}function tr(e,t,n){return Xn(e,t)+Zn(e)+Kn(t,n)+Qn(t)}function nr(e,t){const{legend:n}=t;if(!n)return;const r=t.position??"right",i=er(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout)+Zn(n)+Jn("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?58:34:0);"right"===r?e.right=Math.max(e.right,o,tr(n,t.legendLayout,t.axisChrome?.rightAxis)):"left"===r?e.left=Math.max(e.left,o,tr(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 rr(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??Xn(e,t.legendLayout)),a=Zn(e),s=Kn(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),l=Qn(t.legendLayout),c=er(e,i,t.legendLayout),u=Jn(t.axisChrome,t.legendLayout),d=Jn(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 ir(e){const t=Math.max(1,e?.swatchSize??16),n=Math.max(t,e?.rowHeight??22);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??6),itemGap:Math.max(0,e?.itemGap??10),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}function or(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 ar(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 sr(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function lr(e){const t=Nn(),n=(0,up.useRef)(t);n.current=t;const[r,i]=En(e.sizeProp,e.responsiveWidth,e.responsiveHeight),o=i[0],a=i[1],s=(0,up.useMemo)(()=>[o,a],[o,a]),l=Boolean(e.title),c=(0,up.useMemo)(()=>{const t=Wn({...e.marginDefault,...e.userMargin},l);if(e.legend&&!e.legendMarginReserved){const n={...t},r=e.legendPosition??"right";nr(t,{legend:e.legend,position:r,size:s,hasTitle:l,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),Un(t,n,s,r)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,l,s]),u=Math.max(1,i[0]-c.left-c.right),d=Math.max(1,i[1]-c.top-c.bottom),h=sr(e.foregroundGraphics,i,c),f=sr(e.backgroundGraphics,i,c),p=(0,hp.useThemeSelector)(e=>e.theme),{transition:m,introEnabled:g}=At(e.animate,e.transitionProp),y=`semiotic-table-${cp.useId()}`,b=(0,up.useRef)(null);if(!b.current){const t=!e.suspendWhenHidden||"undefined"==typeof document||!document.hidden;b.current=new jp({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}const v=b.current;v.configure({clock:e.clock,random:e.random,seed:e.seed});const x=(0,up.useRef)(null),w=(0,up.useRef)(e.frameScheduler??Lp);w.current=e.frameScheduler??Lp;const k=(0,up.useRef)(null),S=(0,up.useRef)(!1),M=(0,up.useRef)(()=>{}),j=(0,up.useCallback)(()=>{if(null!==x.current||S.current)return;const e=w.current;let t=!1,n=!1;const r=e.requestAnimationFrame(()=>{t=!0;const e=!n;e&&(S.current=!0),x.current=null,k.current=null;try{e?M.current():(0,dp.flushSync)(M.current)}finally{e&&(S.current=!1)}});n=!0,t||(x.current=r,k.current=e)},[]),A=(0,up.useCallback)(()=>{null!==x.current&&((k.current??w.current).cancelAnimationFrame(x.current),x.current=null,k.current=null)},[]),R=(0,up.useCallback)(()=>{null!==x.current&&(A(),M.current())},[A]);Cp(()=>{v.setPaused(!0===e.paused)},[v,e.paused]),(0,up.useEffect)(()=>{if(!e.suspendWhenHidden||"undefined"==typeof document)return void v.setVisible(!0);const t=()=>v.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[v,e.suspendWhenHidden]),(0,up.useEffect)(()=>()=>{A()},[A]);const C=(0,up.useRef)(()=>{}),L=(0,up.useRef)(()=>{}),N=(0,up.useRef)({inside:!1,clientX:0,clientY:0,pointerType:void 0}),P=(0,up.useRef)(null),E=(0,up.useRef)(null),I=(0,up.useRef)(null),T=(0,up.useCallback)(()=>{const e=P.current;P.current=null,e&&C.current(e)},[]),z=(0,up.useCallback)(e=>{const t=N.current;if(t.inside=!0,t.clientX=e.clientX,t.clientY=e.clientY,t.pointerType=e.pointerType,P.current={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType},null===E.current){const e=w.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]),D=(0,up.useCallback)(()=>{null!==E.current&&((I.current??w.current).cancelAnimationFrame(E.current),E.current=null,I.current=null),T()},[T]),$=(0,up.useCallback)(()=>{N.current.inside=!1,P.current=null,D(),L.current()},[D]);(0,up.useEffect)(()=>{if("undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&N.current.inside&&$()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[$]),(0,up.useEffect)(()=>()=>{P.current=null,null!==E.current&&((I.current??w.current).cancelAnimationFrame(E.current),E.current=null,I.current=null)},[]);const F=e.themeDirtyRef,O=(0,up.useRef)(!1);return Cp(()=>{if(!F)return;const t=!O.current;O.current=!0,t&&e.skipInitialThemeInvalidation||(yp++,F.current=!0,j())},[p,e.skipInitialThemeInvalidation,j,F]),(0,up.useEffect)(()=>{if(F)return $n(()=>r.current,()=>{F.current=!0,j()})},[r,j,F]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:r,size:i,margin:c,adjustedWidth:u,adjustedHeight:d,resolvedForeground:h,resolvedBackground:f,currentTheme:p,transition:m,introEnabled:g,tableId:y,frameRuntime:v,rafRef:x,renderFnRef:M,scheduleRender:j,cancelRender:A,flushRender:R,hoverHandlerRef:C,hoverLeaveRef:L,onPointerMove:z,flushPointerMove:D,onPointerLeave:$,pointerStateRef:N}}function cr(e,t,n,r){(0,Np.useEffect)(()=>{e.current?.updateConfig(t),n.current=!0,r()},[t,r,e,n])}function ur(e,t,n,r){const i=(0,Np.useRef)(null);(0,Np.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 dr(e,t="dark"===e.mode){if(!e.accessibility)return e;let n=e;return e.accessibility.colorBlindSafe&&(n={...n,colors:{...n.colors,categorical:Pp}}),e.accessibility.highContrast&&(n={...n,colors:{...n.colors,text:t?"#ffffff":"#000000",textSecondary:t?"#cccccc":"#333333",grid:t?"#666666":"#999999",border:t?"#888888":"#000000"}}),n}function hr(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));const n=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!n)return null;const[r,i,o]=[parseInt(n[1],16)/255,parseInt(n[2],16)/255,parseInt(n[3],16)/255],a=e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4);return.2126*a(r)+.7152*a(i)+.0722*a(o)}function fr(e,t){const n=hr(e),r=hr(t);return null===n||null===r?null:(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function pr(e){return function e(t){return Array.isArray(t)?t.map(e):null!==t&&"object"==typeof t?Object.fromEntries(Object.entries(t).map(([t,n])=>[t,e(n)])):t}(e)}function mr(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 gr(e){return dr(e,"dark"===e.mode||"auto"===e.mode&&(fr(e.colors.background,"#ffffff")??1)>Math.sqrt(21))}function yr(e,t){if("light"===t)return pr(Ep);if("dark"===t)return pr(Ip);if("high-contrast"===t)return pr(Tp);if("string"==typeof t)return"undefined"!=typeof console&&console.warn(`[ThemeStore] Unknown theme preset "${t}". Keeping current theme.`),e;const n=t.mode&&"auto"!==t.mode?"dark"===t.mode?Ip:Ep:e;return pr(gr({...n,...t,colors:{...n.colors,...t.colors||{}},typography:{...n.typography,...t.typography||{}},aesthetics:(r=n.aesthetics,t.aesthetics?{...r,...t.aesthetics,weights:{...r?.weights,...t.aesthetics.weights},thresholds:{...r?.thresholds,...t.aesthetics.thresholds},rationales:{...r?.rationales,...t.aesthetics.rationales}}:r)}));var r}function br(e,t){const n=e?.state??(e?.settling?"settling":void 0);if("live"===n)return $p;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&&t>0))return $p;const r=null!=e.threshold&&e.threshold>0?e.threshold:5e3,i=e.graded;if(i){const e="object"==typeof i?i:{},n=Rt(t,r,e.thresholds);return{alpha:{...Dp,...e.opacities??{}}[n],band:n,isStale:"fresh"!==n}}return t>r?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:$p}function vr(e,t,n,r,i,o,a){const s=(0,zp.useRef)("fresh");(0,zp.useEffect)(()=>{if(!e)return void(s.current="fresh");const l=setInterval(()=>{const l=t.current;if(!l||0===l.lastIngestTime)return;const c=br(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 xr(e,t,n){return t||(n?"settling":e?"stale":"live")}function wr({isStale:e,position:t,state:n,settling:r}){const i=xr(e,n,r),o=Op[i]??Op.live,a=Object.hasOwn(Op,i)?i.toUpperCase():"LIVE";/* @__PURE__ */ /* @__PURE__ */
|
|
19
|
-
return(0,
|
|
18
|
+
/* @__PURE__ */(0,ld.jsx)(f,{remaining:g,onClick:e=>{r(e.currentTarget,m,Math.min(m+Lu,c.length),c.length),s(e=>e+Lu)},kind:"row"})]})}function m(e,t){zd(()=>{t&&(e.current=t)},[e,t])}function g(e){return e>1?Bd:e<-1?-Bd:Math.asin(e)}function y(e){return(e=eh(e/2))*e}function b(){}function v(e,t){e&&oh.hasOwnProperty(e.type)&&oh[e.type](e,t)}function x(e,t,n){var r,i=-1,o=e.length-n;for(t.lineStart();++i<o;)r=e[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function w(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)x(e[n],t,1);t.polygonEnd()}function k(e,t){e&&ih.hasOwnProperty(e.type)?ih[e.type](e,t):v(e,t)}function S(){lh.point=j}function M(){A(yd,bd)}function j(e,t){lh.point=A,yd=e,bd=t,vd=e*=Vd,xd=Zd(t=(t*=Vd)/2+Hd),wd=eh(t)}function A(e,t){var n=(e*=Vd)-vd,r=n>=0?1:-1,i=r*n,o=Zd(t=(t*=Vd)/2+Hd),a=eh(t),s=wd*a,l=xd*o+s*Zd(i),c=s*r*eh(i);ah.add(Xd(c,l)),vd=e,xd=o,wd=a}function C(e){return[Xd(e[1],e[0]),g(e[2])]}function R(e){var t=e[0],n=e[1],r=Zd(n);return[r*Zd(t),r*eh(t),eh(n)]}function L(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function N(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 P(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function I(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function E(e){var t=nh(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function T(e,t){Pd.push(Id=[kd=e,Md=e]),t<Sd&&(Sd=t),t>jd&&(jd=t)}function z(e,t){var n=R([e*Vd,t*Vd]);if(Ld){var r=N(Ld,n),i=N([r[1],-r[0],0],r);E(i),i=C(i);var o,a=e-Ad,s=a>0?1:-1,l=i[0]*Gd*s,c=Yd(a)>180;c^(s*Ad<l&&l<s*e)?(o=i[1]*Gd)>jd&&(jd=o):c^(s*Ad<(l=(l+360)%360-180)&&l<s*e)?(o=-i[1]*Gd)<Sd&&(Sd=o):(t<Sd&&(Sd=t),t>jd&&(jd=t)),c?e<Ad?W(kd,e)>W(kd,Md)&&(Md=e):W(e,Md)>W(kd,Md)&&(kd=e):Md>=kd?(e<kd&&(kd=e),e>Md&&(Md=e)):e>Ad?W(kd,e)>W(kd,Md)&&(Md=e):W(e,Md)>W(kd,Md)&&(kd=e)}else Pd.push(Id=[kd=e,Md=e]);t<Sd&&(Sd=t),t>jd&&(jd=t),Ld=n,Ad=e}function $(){uh.point=z}function D(){Id[0]=kd,Id[1]=Md,uh.point=T,Ld=null}function O(e,t){if(Ld){var n=e-Ad;Nd.add(Yd(n)>180?n+(n>0?360:-360):n)}else Cd=e,Rd=t;lh.point(e,t),z(e,t)}function F(){lh.lineStart()}function _(){O(Cd,Rd),lh.lineEnd(),Yd(Nd)>Fd&&(kd=-(Md=180)),Id[0]=kd,Id[1]=Md,Ld=null}function W(e,t){return(t-=e)<0?t+360:t}function B(e,t){return e[0]-t[0]}function H(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function q(e){var t,n,r,i,o,a,s;if(jd=Md=-(kd=Sd=1/0),Pd=[],k(e,uh),n=Pd.length){for(Pd.sort(B),t=1,o=[r=Pd[0]];t<n;++t)H(r,(i=Pd[t])[0])||H(r,i[1])?(W(r[0],i[1])>W(r[0],r[1])&&(r[1]=i[1]),W(i[0],r[1])>W(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=W(r[1],i[0]))>a&&(a=s,kd=i[0],Md=r[1])}return Pd=Id=null,kd===1/0||Sd===1/0?[[NaN,NaN],[NaN,NaN]]:[[kd,Sd],[Md,jd]]}function G(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 V(e,t){return Yd(e)>Wd&&(e-=Math.round(e/qd)*qd),[e,t]}function Y(e,t,n){return(e%=qd)?t||n?G(X(e),Z(t,n)):X(e):t||n?Z(t,n):V}function U(e){return function(t,n){return Yd(t+=e)>Wd&&(t-=Math.round(t/qd)*qd),[t,n]}}function X(e){var t=U(e);return t.invert=U(-e),t}function Z(e,t){function n(e,t){var n=Zd(t),s=Zd(e)*n,l=eh(e)*n,c=eh(t),u=c*r+s*i;return[Xd(l*o-u*a,s*r-c*i),g(u*o+l*a)]}var r=Zd(e),i=eh(e),o=Zd(t),a=eh(t);return n.invert=function(e,t){var n=Zd(t),s=Zd(e)*n,l=eh(e)*n,c=eh(t),u=c*o-l*a;return[Xd(l*o+c*a,s*r+u*i),g(u*r-s*i)]},n}function K(e){function t(t){return(t=e(t[0]*Vd,t[1]*Vd))[0]*=Gd,t[1]*=Gd,t}return e=Y(e[0]*Vd,e[1]*Vd,e.length>2?e[2]*Vd:0),t.invert=function(t){return(t=e.invert(t[0]*Vd,t[1]*Vd))[0]*=Gd,t[1]*=Gd,t},t}function Q(e,t,n,r,i,o){if(n){var a=Zd(t),s=eh(t),l=r*n;null==i?(i=t+r*qd,o=t-l/2):(i=J(a,i),o=J(a,o),(r>0?i<o:i>o)&&(i+=r*qd));for(var c,u=i;r>0?u>o:u<o;u-=l)c=C([a,-s*Zd(u),-s*eh(u)]),e.point(c[0],c[1])}}function J(e,t){(t=R(t))[0]-=e,E(t);var n,r=(n=-t[1])>1?0:n<-1?Wd:Math.acos(n);return((-t[2]<0?-r:r)+qd-Fd)%qd}function ee(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:b,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function te(e,t){return Yd(e[0]-t[0])<Fd&&Yd(e[1]-t[1])<Fd}function ne(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 re(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(te(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<t;++o)i.point((r=e[o])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}s.push(n=new ne(r,e,null,!0)),l.push(n.o=new ne(r,null,n,!1)),s.push(n=new ne(a,e,null,!1)),l.push(n.o=new ne(a,null,n,!0))}}),s.length){for(l.sort(t),ie(s),ie(l),o=0,a=l.length;o<a;++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;o<a;++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(c=h.p.z,o=c.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 ie(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 oe(e){return Yd(e[0])<=Wd?e[0]:th(e[0])*((Yd(e[0])+Wd)%qd-Wd)}function ae(e,t){var n=oe(t),r=t[1],i=eh(r),o=[eh(n),-Zd(n),0],a=0,s=0,l=new Sh.Adder;1===i?r=Bd+Fd:-1===i&&(r=-Bd-Fd);for(var c=0,u=e.length;c<u;++c)if(h=(d=e[c]).length)for(var d,h,f=d[h-1],p=oe(f),m=f[1]/2+Hd,y=eh(m),b=Zd(m),v=0;v<h;++v,p=w,y=S,b=M,f=x){var x=d[v],w=oe(x),k=x[1]/2+Hd,S=eh(k),M=Zd(k),j=w-p,A=j>=0?1:-1,C=A*j,L=C>Wd,P=y*S;if(l.add(Xd(P*A*eh(C),b*M+P*Zd(C))),a+=L?j+A*qd:j,L^p>=n^w>=n){var I=N(R(f),R(x));E(I);var T=N(o,I);E(T);var z=(L^j>=0?-1:1)*g(T[2]);(r>z||r===z&&(I[0]||I[1]))&&(s+=L^j>=0?1:-1)}}return(a<-Fd||a<Fd&&l<-1e-12)^1&s}function se(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(){v.point=a,m.lineStart()}function l(){v.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(b||(i.polygonStart(),b=!0),i.lineStart(),e=0;e<t;++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(le))}var h,f,p,m=t(i),g=ee(),y=t(g),b=!1,v={point:o,lineStart:s,lineEnd:l,polygonStart:function(){v.point=c,v.lineStart=u,v.lineEnd=d,f=[],h=[]},polygonEnd:function(){v.point=o,v.lineStart=s,v.lineEnd=l,f=(0,Mh.merge)(f);var e=ae(h,r);f.length?(b||(i.polygonStart(),b=!0),re(f,ce,e,n,i)):e&&(b||(i.polygonStart(),b=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),f=h=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};return v}}function le(e){return e.length>1}function ce(e,t){return((e=e.x)[0]<0?e[1]-Bd-Fd:Bd-e[1])-((t=t.x)[0]<0?t[1]-Bd-Fd:Bd-t[1])}function ue(e,t,n,r){var i,o,a=eh(e-n);return Yd(a)>Fd?Ud((eh(t)*(o=Zd(r))*eh(n)-eh(r)*(i=Zd(t))*eh(e))/(i*o*a)):(t+r)/2}function de(e){function t(e,t){return Zd(e)*Zd(t)>i}function n(e,t,n){var r=[1,0,0],o=N(R(e),R(t)),a=L(o,o),s=o[0],l=a-s*s;if(!l)return!n&&e;var c=i*a/l,u=-i*s/l,d=N(r,o),h=I(r,c);P(h,I(o,u));var f=d,p=L(h,f),m=L(f,f),g=p*p-m*(L(h,h)-1);if(!(g<0)){var y=nh(g),b=I(f,(-p-y)/m);if(P(b,h),b=C(b),!n)return b;var v,x=e[0],w=t[0],k=e[1],S=t[1];w<x&&(v=x,x=w,w=v);var M=w-x,j=Yd(M-Wd)<Fd;if(!j&&S<k&&(v=k,k=S,S=v),j||M<Fd?j?k+S>0^b[1]<(Yd(b[0]-x)<Fd?k:S):k<=b[1]&&b[1]<=S:M>Wd^(x<=b[0]&&b[0]<=w)){var A=I(f,(-p+y)/m);return P(A,h),[b,C(A)]}}}function r(t,n){var r=a?e:Wd-e,i=0;return t<-r?i|=1:t>r&&(i|=2),n<-r?i|=4:n>r&&(i|=8),i}var i=Zd(e),o=2*Vd,a=i>0,s=Yd(i)>Fd;return se(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+(d<0?Wd:-Wd),h):0;if(!i&&(c=l=m)&&e.lineStart(),m!==l&&(!(f=n(i,p))||te(i,f)||te(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&&te(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){Q(i,e,o,r,t,n)},a?[0,-e]:[-Wd,e-Wd])}function he(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||!(a>0)){if(a/=d,d<0){if(a<c)return;a<u&&(u=a)}else if(d>0){if(a>u)return;a>c&&(c=a)}if(a=i-s,d||!(a<0)){if(a/=d,d<0){if(a>u)return;a>c&&(c=a)}else if(d>0){if(a<c)return;a<u&&(u=a)}if(a=r-l,h||!(a>0)){if(a/=h,h<0){if(a<c)return;a<u&&(u=a)}else if(h>0){if(a>u)return;a>c&&(c=a)}if(a=o-l,h||!(a<0)){if(a/=h,h<0){if(a>u)return;a>c&&(c=a)}else if(h>0){if(a<c)return;a<u&&(u=a)}return c>0&&(e[0]=s+c*d,e[1]=l+c*h),u<1&&(t[0]=s+u*d,t[1]=l+u*h),!0}}}}}function fe(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))||l(i,o)<0^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 Yd(r[0]-e)<Fd?i>0?0:3:Yd(r[0]-n)<Fd?i>0?2:1:Yd(r[1]-t)<Fd?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;n<i;++n)for(var o,a,s=h[n],l=1,c=s.length,u=s[0],d=u[0],f=u[1];l<c;++l)o=d,a=f,d=(u=s[l])[0],f=u[1],a<=r?f>r&&(d-o)*(r-a)>(f-a)*(e-o)&&++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&&v)k.point(o,a);else{var l=[y=Math.max(Rh,Math.min(Ch,y)),b=Math.max(Rh,Math.min(Ch,b))],c=[o=Math.max(Rh,Math.min(Ch,o)),a=Math.max(Rh,Math.min(Ch,a))];he(l,c,e,t,n,r)?(v||(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,b=a,v=s}var d,h,f,p,m,g,y,b,v,x,w,k=a,S=ee(),M={point:l,lineStart:function(){M.point=u,h&&h.push(f=[]),x=!0,v=!1,y=b=NaN},lineEnd:function(){d&&(u(p,m),g&&v&&S.rejoin(),d.push(S.result())),M.point=l,v&&k.lineEnd()},polygonStart:function(){k=S,d=[],h=[],w=!0},polygonEnd:function(){var e=c(),t=w&&e,n=(d=(0,Ah.merge)(d)).length;(t||n)&&(a.polygonStart(),t&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),n&&re(d,s,e,o,a),a.polygonEnd()),k=a,d=h=f=null}};return M}}function pe(){Nh.point=Nh.lineEnd=b}function me(e,t){hh=e*=Vd,fh=eh(t*=Vd),ph=Zd(t),Nh.point=ge}function ge(e,t){e*=Vd;var n=eh(t*=Vd),r=Zd(t),i=Yd(e-hh),o=Zd(i),a=r*eh(i),s=ph*n-fh*r*o,l=fh*n+ph*r*o;dh.add(Xd(nh(a*a+s*s),l)),hh=e,fh=n,ph=r}function ye(e,t){return Ph[0]=e,Ph[1]=t,n=Ih,dh=new Lh.Adder,k(n,Nh),+dh;var n}function be(e,t){return!(!e||!Th.hasOwnProperty(e.type))&&Th[e.type](e,t)}function ve(e,t){return 0===ye(e,t)}function xe(e,t){for(var n,r,i,o=0,a=e.length;o<a;o++){if(0===(r=ye(e[o],t)))return!0;if(o>0&&(i=ye(e[o],e[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<_d*i)return!0;n=r}return!1}function we(e,t){return!!ae(e.map(ke),Se(t))}function ke(e){return(e=e.map(Se)).pop(),e}function Se(e){return[e[0]*Vd,e[1]*Vd]}function Me(e,t){return(e&&Eh.hasOwnProperty(e.type)?Eh[e.type]:be)(e,t)}function je(e,t,n){var r=(0,zh.range)(e,t-Fd,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function Ae(e,t,n){var r=(0,zh.range)(e,t-Fd,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function Ce(){function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return(0,zh.range)(Kd(o/g)*g,i,g).map(h).concat((0,zh.range)(Kd(c/y)*y,l,y).map(f)).concat((0,zh.range)(Kd(r/p)*p,n,p).filter(function(e){return Yd(e%g)>Fd}).map(u)).concat((0,zh.range)(Kd(s/m)*m,a,m).filter(function(e){return Yd(e%y)>Fd}).map(d))}var n,r,i,o,a,s,l,c,u,d,h,f,p=10,m=p,g=90,y=360,b=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?(o=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],o>i&&(t=o,o=i,i=t),c>l&&(t=c,c=l,l=t),e.precision(b)):[[o,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),e.precision(b)):[[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?(b=+t,u=je(s,a,90),d=Ae(r,n,b),h=je(c,l,90),f=Ae(o,i,b),e):b},e.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Re(e,t){var n=e[0]*Vd,r=e[1]*Vd,i=t[0]*Vd,o=t[1]*Vd,a=Zd(r),s=eh(r),l=Zd(o),c=eh(o),u=a*Zd(n),d=a*eh(n),h=l*Zd(i),f=l*eh(i),p=2*g(nh(y(o-r)+a*l*y(i-n))),m=eh(p),b=p?function(e){var t=eh(e*=p)/m,n=eh(p-e)/m,r=n*u+t*h,i=n*d+t*f,o=n*s+t*c;return[Xd(i,r)*Gd,Xd(o,nh(r*r+i*i))*Gd]}:function(){return[n*Gd,r*Gd]};return b.distance=p,b}function Le(){_h.point=Ne}function Ne(e,t){_h.point=Pe,mh=yh=e,gh=bh=t}function Pe(e,t){Fh.add(bh*e-yh*t),yh=e,bh=t}function Ie(){Pe(mh,gh)}function Ee(e,t){Yh+=e,Uh+=t,++Xh}function Te(){nf.point=ze}function ze(e,t){nf.point=$e,Ee(wh=e,kh=t)}function $e(e,t){var n=e-wh,r=t-kh,i=nh(n*n+r*r);Zh+=i*(wh+e)/2,Kh+=i*(kh+t)/2,Qh+=i,Ee(wh=e,kh=t)}function De(){nf.point=Ee}function Oe(){nf.point=_e}function Fe(){We(vh,xh)}function _e(e,t){nf.point=We,Ee(vh=wh=e,xh=kh=t)}function We(e,t){var n=e-wh,r=t-kh,i=nh(n*n+r*r);Zh+=i*(wh+e)/2,Kh+=i*(kh+t)/2,Qh+=i,Jh+=(i=kh*e-wh*t)*(wh+e),ef+=i*(kh+t),tf+=3*i,Ee(wh=e,kh=t)}function Be(e){this._context=e}function He(e,t){gf.point=qe,af=lf=e,sf=cf=t}function qe(e,t){lf-=e,cf-=t,mf.add(nh(lf*lf+cf*cf)),lf=e,cf=t}function Ge(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Ve(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return Ge;if(t!==uf){const e=10**t;uf=t,df=function(t){let n=1;this._+=t[0];for(const r=t.length;n<r;++n)this._+=Math.round(arguments[n]*e)/e+t[n]}}return df}function Ye(e,t){function n(e){return e&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),k(e,r(i))),i.result()}let r,i,o=3,a=4.5;return n.area=function(e){return k(e,r(Wh)),Wh.result()},n.measure=function(e){return k(e,r(yf)),yf.result()},n.bounds=function(e){return k(e,r(Vh)),Vh.result()},n.centroid=function(e){return k(e,r(rf)),rf.result()},n.projection=function(t){return arguments.length?(r=null==t?(e=null,$h):(e=t).stream,n):e},n.context=function(e){return arguments.length?(i=null==e?(t=null,new bf(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(!(t>=0))throw new RangeError(`invalid digits: ${e}`);o=t}return null===t&&(i=new bf(o)),n},n.projection(e).digits(o).context(t)}function Ue(e){return function(t){var n=new Xe;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Xe(){}function Ze(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),k(n,e.stream(Vh)),t(Vh.result()),null!=r&&e.clipExtent(r),e}function Ke(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 Qe(e,t,n){return Ke(e,[[0,0],t],n)}function Je(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 et(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 tt(e,t){return+t?rt(e,t):nt(e)}function nt(e){return Ue({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function rt(e,t){function n(r,i,o,a,s,l,c,u,d,h,f,p,m,y){var b=c-r,v=u-i,x=b*b+v*v;if(x>4*t&&m--){var w=a+h,k=s+f,S=l+p,M=nh(w*w+k*k+S*S),j=g(S/=M),A=Yd(Yd(S)-1)<Fd||Yd(o-d)<Fd?(o+d)/2:Xd(k,w),C=e(A,j),R=C[0],L=C[1],N=R-r,P=L-i,I=v*N-b*P;(I*I/x>t||Yd((b*N+v*P)/x-.5)>.3||a*h+s*f+l*p<vf)&&(n(r,i,o,a,s,l,R,L,A,w/=M,k/=M,S,m,y),y.point(R,L),n(R,L,A,w,k,S,c,u,d,h,f,p,m,y))}}return function(t){function r(n,r){n=e(n,r),t.point(n[0],n[1])}function i(){y=NaN,k.point=o,t.lineStart()}function o(r,i){var o=R([r,i]),a=e(r,i);n(y,b,g,v,x,w,y=a[0],b=a[1],g=r,v=o[0],x=o[1],w=o[2],16,t),t.point(y,b)}function a(){k.point=r,t.lineEnd()}function s(){i(),k.point=l,k.lineEnd=c}function l(e,t){o(u=e,t),d=y,h=b,f=v,p=x,m=w,k.point=o}function c(){n(y,b,g,v,x,w,d,h,u,f,p,m,16,t),k.lineEnd=a,a()}var u,d,h,f,p,m,g,y,b,v,x,w,k={point:r,lineStart:i,lineEnd:a,polygonStart:function(){t.polygonStart(),k.lineStart=s},polygonEnd:function(){t.polygonEnd(),k.lineStart=i}};return k}}function it(e){return Ue({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function ot(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 at(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 ot(e,t,n,r,i);var s=Zd(o),l=eh(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 st(e){return lt(function(){return e})()}function lt(e){function t(e){return h(e[0]*Vd,e[1]*Vd)}function n(e){return(e=h.invert(e[0],e[1]))&&[e[0]*Gd,e[1]*Gd]}function r(){var e=at(m,0,0,M,j,S).apply(null,o(b,v)),t=at(m,g-e[0],y-e[1],M,j,S);return a=Y(x,w,k),d=G(o,t),h=G(a,d),u=tt(d,N),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,b=0,v=0,x=0,w=0,k=0,S=0,M=1,j=1,A=null,C=jh,R=null,L=$h,N=.5;return t.stream=function(e){return f&&p===e?f:f=xf(it(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?de(A=e*Vd):(A=null,jh),i()):A*Gd},t.clipExtent=function(e){return arguments.length?(L=null==e?(R=s=l=c=null,$h):fe(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?(b=e[0]%360*Vd,v=e[1]%360*Vd,r()):[b*Gd,v*Gd]},t.rotate=function(e){return arguments.length?(x=e[0]%360*Vd,w=e[1]%360*Vd,k=e.length>2?e[2]%360*Vd:0,r()):[x*Gd,w*Gd,k*Gd]},t.angle=function(e){return arguments.length?(S=e%360*Vd,r()):S*Gd},t.reflectX=function(e){return arguments.length?(M=e?-1:1,r()):M<0},t.reflectY=function(e){return arguments.length?(j=e?-1:1,r()):j<0},t.precision=function(e){return arguments.length?(u=tt(d,N=e*e),i()):nh(N)},t.fitExtent=function(e,n){return Ke(t,e,n)},t.fitSize=function(e,n){return Qe(t,e,n)},t.fitWidth=function(e,n){return Je(t,e,n)},t.fitHeight=function(e,n){return et(t,e,n)},function(){return o=e.apply(this,arguments),t.invert=o.invert&&n,r()}}function ct(e){function t(e,t){return[e*n,eh(t)/n]}var n=Zd(e);return t.invert=function(e,t){return[e/n,g(t*n)]},t}function ut(e,t){function n(e,t){var n=nh(o-2*i*eh(t))/i;return[n*eh(e*=i),a-n*Zd(e)]}var r=eh(e),i=(r+eh(t))/2;if(Yd(i)<Fd)return ct(e);var o=1+r*(2*i-r),a=nh(o)/i;return n.invert=function(e,t){var n=a-t,r=Xd(e,Yd(n))*th(n);return n*i<0&&(r-=Wd*th(e)*th(n)),[r/i,g((o-(e*e+n*n)*i*i)/(2*i))]},n}function dt(){return(e=ut,t=0,n=Wd/3,r=lt(e),i=r(t,n),i.parallels=function(e){return arguments.length?r(t=e[0]*Vd,n=e[1]*Vd):[t*Gd,n*Gd]},i).scale(155.424).center([0,33.6442]);var e,t,n,r,i}function ht(e,t){return[e,Jd(rh((Bd+t)/2))]}function ft(e){function t(){var t=Wd*s(),a=o(K(o.rotate()).invert([0,0]));return c(null==u?[[a[0]-t,a[1]-t],[a[0]+t,a[1]+t]]:e===ht?[[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=st(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 pt(e,t){return[e,t]}function mt(e,t){var n=g(Af*eh(t)),r=n*n,i=r*r*r;return[e*Zd(n)/(Af*(kf+3*Sf*r+i*(7*Mf+9*jf*r))),n*(kf+Sf*r+i*(Mf+jf*r))]}function gt(){return st(mt).scale(177.158)}function yt(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 bt(e,t){return[Zd(t)*eh(e),eh(t)]}function vt(e,t,n){if(Number.isFinite(e.scale())&&e.translate().every(Number.isFinite))return;e.scale(Math.max(1,Math.min(n.width,n.height)/(2*Math.PI))),e.translate([n.width/2,n.height/2]);const r=Ye(e).bounds(t);if(!r.flat().every(Number.isFinite))return;const i=e.translate();e.translate([i[0]+n.width/2-(r[0][0]+r[1][0])/2,i[1]+n.height/2-(r[0][1]+r[1][1])/2])}function xt(e,t){Lf.set(e,t)}function wt(e,t){let n;const r=/* @__PURE__ */new Map;return e.map(e=>{const i=Lf.get(e);if(void 0!==i)return i;if(!n){const e=/* @__PURE__ */new Map;n=e,t.forEach((t,n)=>{const r=e.get(t);r?r.push(n):e.set(t,[n])})}const o=r.get(e.datum)??0;return r.set(e.datum,o+1),n.get(e.datum)?.[o]??-1})}function kt(e){return{projection:e,geoPath:Ye(e),projectedPoint:(t,n)=>e([t,n]),invertedPoint:(t,n)=>e.invert?.([t,n])??null}}function St(e,t){return"linear"===t?e:1-Math.pow(1-e,3)}function Mt(e,t){const n=e-t.startTime;return Math.min(n/t.duration,1)}function jt(e,t,n){return e+(t-e)*n}function At(e,t,n={}){if(!Number.isFinite(t)||t<=0)return"fresh";if(Number.isNaN(e))return"fresh";if(e===1/0)return"expired";if(e<0)return"fresh";const r=n.fresh??If,i=n.aging??Ef,o=n.stale??Tf;return e<t*r?"fresh":e<t*i?"aging":e<t*o?"stale":"expired"}function Ct(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)||e.extent<=0)return 1;const n=Math.max(0,e.age);if("step"===e.type)return n<(e.threshold??.5*e.extent)?1:t;if("exponential"===e.type){const r=e.halfLife??e.extent/2,i=r>0?r:e.extent/2;return t+Math.pow(.5,n/i)*(1-t)}return t+Math.max(0,Math.min(1,1-n/e.extent))*(1-t)}function Rt(e,t,n){if(n<=1)return 1;const r=n-1;return Ct({age:r-t,extent:r,type:e.type,halfLife:e.halfLife??n/2,threshold:e.stepThreshold??.5*n,minOpacity:e.minOpacity??.1})}function Lt(e,t,n){const r=e.duration??500,i=n-t;return i>=r?0:1-i/r}function Nt(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&&n-i<r}function It(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}function Et(e,t,n){const r=e=>e.toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(n)}`}function Tt(e){const t=e.map(It),n=t.length-1;return e=>{if(Number.isNaN(e)&&(e=0),e<=0){const[e,n,r]=t[0];return Et(e,n,r)}if(e>=1){const[e,r,i]=t[n];return Et(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 Et(Math.round(a+(c-a)*o),Math.round(s+(u-s)*o),Math.round(l+(d-l)*o))}}function zt(e){return e&&Object.prototype.hasOwnProperty.call(Hf,e)?Hf[e]:Df}function $t(e,t,n=Gf){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(qf,e)?qf[e]:void 0;if(Array.isArray(t)&&t.length>0)return t}return t&&t.length>0?t:n}function Dt(e){const t=e.toLowerCase();return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")||Uf.has(t)}function Ot(e,t,n){if("function"==typeof t){const r=t(e);return n&&r&&"string"==typeof r&&!Dt(r)?n(r):r}const r=String(e?.[t]);return n?n(r):Gf[Math.abs(Wt(r))%Gf.length]}function Ft(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 _t(e,t,n="category10"){if(n&&"object"==typeof n&&!Array.isArray(n)){const e=n;return t=>Ft(e,t)??"#999"}const r=Array.from(new Set(e.map(e=>e?.[t]).filter(e=>null!=e).map(e=>String(e)))),i=r.every(e=>!isNaN(Number(e)));if(Array.isArray(n))return(0,zf.scaleOrdinal)().domain(r).range(n).unknown("#999");const o=Object.prototype.hasOwnProperty.call(qf,n)?qf[n]:qf.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:Gf;return(0,zf.scaleOrdinal)().domain(r).range(e).unknown("#999")}}function Wt(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t)}function Bt(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 c<0?c=0:c>1&&(c=1),s+c*(l-s)}function Ht(e,t){const n=t&&"object"==typeof t&&!Array.isArray(t)?t:void 0;return 0===e.length?e=>n&&Ft(n,e)||"#4e79a7":t=>{if(n){const e=Ft(n,t);if(e)return e}let r=0;for(let e=0;e<t.length;e++)r=31*r+t.charCodeAt(e)|0;return e[Math.abs(r)%e.length]??"#4e79a7"}}function qt(e){if("production"===process.env.NODE_ENV)return;const{label:t,nodes:n,overlays:r,warned:i}=e;Gt(r)&&0===n.length&&Vt(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)&&Vt(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 Gt(e){return null!=e&&!1!==e&&""!==e&&(!Array.isArray(e)||e.some(Gt))}function Vt(e,t,n){e.has(t)||(e.add(t),console.warn(n))}function Yt(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:String(e)}}catch{return{name:"Error",message:"Custom layout threw a non-stringifiable value."}}}function Ut(e,t,n,r){const i=Yt(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 Xt(e){try{return{kind:"success",result:e.run()}}catch(t){const n=e.hasPreviousResult,r=Ut(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 Zt(e){if(!e)return gt();if("string"==typeof e){const t=Xf[e];return t?t():("production"!==process.env.NODE_ENV&&console.warn(`GeoFrame: Unknown projection "${e}", falling back to equalEarth`),gt())}if("object"==typeof e&&"type"in e){const t=Xf[e.type],n=t?t():gt();return e.rotate&&"rotate"in n&&n.rotate(e.rotate),e.center&&"center"in n&&n.center(e.center),n}return e}function Kt(e,t){return e?"function"==typeof e?e:t=>t[e]:e=>e[t]}function Qt(e){return e?"function"==typeof e?e:t=>t[e]:e=>e.coordinates||e.data||[]}function Jt(e,t,n){return e?"function"==typeof e?{...n,...e(t)}:{...n,...e}:{...n}}function en(e){return{fill:e.themeSemantic?.surface||"#e0e0e0",stroke:e.themeSemantic?.border||"#999",strokeWidth:.5,fillOpacity:1}}function tn(e){return{fill:e.themeSemantic?.primary||"#4e79a7",r:4,fillOpacity:.8}}function nn(e){return{stroke:e.themeSemantic?.primary||"#4e79a7",strokeWidth:1.5,fill:"none"}}function rn(e,t){if(e.length<2)return[e];const n=.4*t,r=[];let i=[e[0]];for(let t=1;t<e.length;t++){const o=e[t-1],a=e[t];Math.abs(a[0]-o[0])>n?(i.length>=2&&r.push(i),i=[a]):i.push(a)}return i.length>=2&&r.push(i),r}function on(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;r<=n;r++){const i=r/n,o=1-i,a=o*o*e[0]+2*o*i*c+i*i*t[0],s=o*o*e[1]+2*o*i*u+i*i*t[1];d.push([a,s])}return d}function an(e,t){if(e.length<2)return e;const n=t/2+1,r=[];for(let t=0;t<e.length;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,l=a/s,c=-o/s;r.push([i[0]+l*n,i[1]+c*n])}return r}function sn(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 ln(e,t){let n=1/0,r=-1/0;for(const i of e){const e=t?t(i):i;e<n&&(n=e),e>r&&(r=e)}return[n,r]}function cn(e,t=-1/0){let n=t;for(const t of e)t>n&&(n=t);return n}function un(e,t,n,r){const i=e.filter(e=>"point"===e.type);if(i.length<2)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&&String(l(e.datum))===String(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=cn(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?hn(i,u,c,d,n):dn(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(String(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(String(r)),a=e.get(String(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;e<n.path.length;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 dn(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,Zf.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 hn(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,Zf.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(;d<c.length;){let e=d+1;for(;e<c.length&&Math.abs(c[e].x-c[d].x)<3;)e++;const t=e-d;if(t>1&&u>0)for(let e=0;e<t;e++){const n=e-(t-1)/2,r=Math.min(2.5,2*u/Math.max(1,t-1));c[d+e].node.y=s+n*r}d=e}return{cx:o,cy:s,maxCost:r,availableRadius:a,layout:"strip"}}function fn(e,t,n,r){const i=e.push(t);return n&&n.push(r),i}function pn(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;e<i.length;e++)r.has(e)||t.push(i[e])}function mn(e,t){const n={...e};for(const e of t)n[Kf[e]]++;return n}function gn(e,t,n){const r=new Set(t);return{changeSet:{...e,...e.keys?{keys:[...e.keys]}:{}},changed:r,revisions:mn(n,r)}}function yn(e){let t="preserve";const n=/* @__PURE__ */new Set;for(const r of e){const e=Object.prototype.hasOwnProperty.call(cp,r)?cp[r]:up;"rebuild"===e.retainedData&&(t="rebuild");for(const t of e.invalidations)n.add(t)}return{retainedData:t,invalidations:n}}function bn({config:e,projection:t,path:n,areas:r,points:i,lines:o,layout:a}){const s=Kt(e.xAccessor,"lon"),l=Kt(e.yAccessor,"lat"),c=[],u=en(e),d=nn(e),h=tn(e);if(e.graticule){const t=!0===e.graticule?{}:e.graticule,r=Ce();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:Jt(e.areaStyle,t,u),datum:t,interactive:!0})}const f=Qt(e.lineDataAccessor);for(const n of o){const r=f(n);if(!r||r.length<2)continue;let i=[];if("geo"===e.lineType){const e=new Array(r.length);for(let t=0;t<r.length;t++)e[t]=[s(r[t]),l(r[t])];for(let n=0;n<e.length-1;n++){const r=e[n],o=e[n+1],a=ye(r,o)||0,s=Math.max(2,Math.ceil(a/(Math.PI/180))),l=Re(r,o);for(let e=0;e<=s;e++){if(n>0&&0===e)continue;const r=t(l(e/s));null!=r&&i.push(r)}}}else for(let e=0;e<r.length;e++){const n=r[e],o=t([s(n),l(n)]);null!=o&&i.push(o)}if(i.length<2)continue;const o=Jt(e.lineStyle,n,d),u="number"==typeof o.strokeWidth?o.strokeWidth:1;2===r.length&&i.length>=2&&"arc"===e.flowStyle?i=on(i[0],i[i.length-1]):2===r.length&&i.length>=2&&"offset"===e.flowStyle&&(i="geo"===e.lineType?an(i,u):sn(i[0],i[i.length-1],0,0,u));const h=rn(i,a.width);if(h.length<=1)c.push({type:"line",path:i.length>=2?i:h[0]||i,style:o,datum:n});else for(const e of h)e.length<2||c.push({type:"line",path:e,style:{...o,_edgeFade:!0},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],b="function"==typeof t.center?t.center():[0,0],v=[(b[0]??0)-y[0],(b[1]??0)-y[1]];for(const[n,r]of i.entries()){const i=s(r),o=l(r);if(!Number.isFinite(i)||!Number.isFinite(o))continue;if(null!=g&&ye([i,o],v)>g)continue;const a=t([i,o]);if(!a||!Number.isFinite(a[0])||!Number.isFinite(a[1]))continue;const u=e.pointStyle?e.pointStyle(r):{...h},d={type:"point",x:a[0],y:a[1],r:u.r||4,style:u,datum:r,pointId:p?String(p(r)):void 0};xt(d,n),c.push(d)}return c}function vn(e){if(null==e)return 0;if("number"==typeof e&&Number.isFinite(e)&&e>=0&&e<.5)return e;throw new RangeError(`[semiotic] fitPadding must be a finite fraction in [0, 0.5); received ${String(e)}.`)}function xn(e){return{...e,fitPadding:vn(e.fitPadding)}}function wn(e){return"fitPadding"in e?{...e,fitPadding:vn(e.fitPadding)}:e}function kn(e){if(!e)return bp;for(const t of e)if(null==t||"object"!=typeof t)return e.filter(e=>null!=e&&"object"==typeof e);return e}function Sn(e,{storeRef:t,dirtyRef:n,scheduleRender:r,zoomTransformRef:i,containerRef:o,zoomBehaviorRef:a}){const s=(0,mp.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushPoint(e),n.current=!0,r())},[t,n,r]),l=(0,mp.useCallback)(e=>{const i=kn(e);0!==i.length&&(t.current?.pushMany(i),n.current=!0,r())},[t,n,r]),c=(0,mp.useCallback)(e=>{null!=e&&"object"==typeof e&&(t.current?.pushLine(e),n.current=!0,r())},[t,n,r]),u=(0,mp.useCallback)(e=>{const i=kn(e);0!==i.length&&(t.current?.pushManyLines(i),n.current=!0,r())},[t,n,r]),d=(0,mp.useCallback)(()=>{t.current?.clear(),n.current=!0,r()},[t,n,r]);(0,mp.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,gp.select)(e).call(a.current.transform,yp.zoomIdentity)},getData:()=>t.current?.getPoints()??[]}),[s,l,c,u,d,r,t,n,i,o,a])}function Mn(e){const{domain:t,layout:n,sceneGeometry:r}=e.revisions;return{domain:t,layout:n,sceneGeometry:r}}function jn(e){return`${e.sceneGeometry}|${e.layout}|${e.domain}`}function An(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 Cn(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 Rn(e){return"undefined"==typeof window?void 0:window.matchMedia?.(e)}function Ln(e,t){return"function"==typeof e?.addEventListener?(e.addEventListener("change",t),()=>e.removeEventListener("change",t)):(e?.addListener?.(t),()=>e?.removeListener?.(t))}function Nn(e){const[t,n]=(0,Lp.useState)(()=>Rn(e)?.matches??!1);return(0,Lp.useEffect)(()=>{const t=Rn(e);return n(t?.matches??!1),Ln(t,e=>n(e.matches))},[e]),t}function Pn(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 In(e,t,n,r={}){const i=(0,Np.useRef)(null),[o,a]=(0,Np.useState)(null);Pp(()=>{if(!t&&!n)return;const e=i.current;if(!e||"undefined"==typeof ResizeObserver)return;const o=(e,t)=>({w:Pn(e,r.minWidth,r.maxWidth,r.widthStep),h:Pn(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]);const s=[t&&o?o.w:e[0],n&&o?o.h:e[1]];return[i,s]}function En(e){return 0!==e.fontfaces?.length}function Tn(e){const t="undefined"==typeof document?void 0:document.fonts;if(!t||"function"!=typeof t.addEventListener)return()=>{};const n=t=>{En(t)&&e()};return t.addEventListener("loadingdone",n),()=>t.removeEventListener("loadingdone",n)}function zn(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 $n(){if(Tp)return;if("undefined"==typeof window||"undefined"==typeof document)return;Tp=!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 Fp){const i=r.getElement();i&&(!e||e.some(e=>t(e,i)))&&n.push(r)}if(!e||0!==n.length){Ep++;for(const e of n)e.listener()}};if("undefined"!=typeof MutationObserver&&document.documentElement&&(zp=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{$p=window.matchMedia("(prefers-color-scheme: dark)"),Dp=()=>n(),"function"==typeof $p.addEventListener?$p.addEventListener("change",Dp):"function"==typeof $p.addListener&&$p.addListener(Dp)}catch{}Op=Tn(()=>n())}function Dn(e,t){$n();const n={getElement:e,listener:t};return Fp.add(n),()=>{Fp.delete(n)&&0===Fp.size&&(zp?.disconnect(),zp=null,$p&&Dp&&("function"==typeof $p.removeEventListener?$p.removeEventListener("change",Dp):"function"==typeof $p.removeListener&&$p.removeListener(Dp)),$p=null,Dp=null,Op?.(),Op=null,Tp=!1)}}function On(e,t){if(!t)return t;const n=zn(t);if(!n)return t;const r=()=>n.fallback?On(e,n.fallback):t,i=e.canvas;if(!i)return r();let o=Ip.get(i);o&&o.version===Ep||(o={version:Ep,map:/* @__PURE__ */new Map},Ip.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 Fn(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 _n(e){return"number"==typeof e&&Number.isFinite(e)?Math.trunc(e):void 0}function Wn(e,t){const n=e();return Number.isFinite(n)?n:t}function Bn(e,t){const n=t?36:0;return e.top>=n?e:{...e,top:n}}function Hn(e){let t=6;for(let n=1;n<e.length;n++){const r=Math.abs(e[n]-e[n-1]);if(r>0&&Number.isFinite(r)){const i=Math.max(Math.abs(e[n]),Math.abs(e[n-1]));t=Math.max(t,Math.ceil(Math.log10(i/r))+1)}}const n=Math.min(17,t);return e=>Number.isInteger(e)?String(e):String(Number(e.toPrecision(n)))}function qn(...e){let t;for(const n of e)n&&(t=Gn(t)&&Gn(n)?{legendGroups:[...t.legendGroups,...n.legendGroups],legendDistance:n.legendDistance??t.legendDistance}:n);return t}function Gn(e){return"object"==typeof e&&null!==e&&"legendGroups"in e&&Array.isArray(e.legendGroups)}function Vn(e){return"object"==typeof e&&null!==e&&"gradient"in e}function Yn(e){const t=Math.max(1,e?.swatchSize??16),n=Math.max(t,e?.rowHeight??22);return{swatchSize:t,labelGap:Math.max(0,e?.labelGap??6),itemGap:Math.max(0,e?.itemGap??10),rowHeight:n,align:"left"===e?.align?"start":"right"===e?.align?"end":e?.align??"start",maxWidth:e?.maxWidth}}function Un(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 Xn(e){return Math.ceil(e.length*Hp)}function Zn(e){const t=null==e?"":String(e);return""===t.trim()?"(empty)":t}function Kn(e,t,n=Hp){if(Math.ceil(e.length*n)<=t)return e;const r=Math.max(1,Math.floor(t/n)-1);return`${Array.from(e).slice(0,r).join("").trimEnd()}…`}function Qn(e){return`+${e} more`}function Jn(e,t){const n=e.slice(t,t+20).map(e=>Zn(e?.label));return e.length-t>20&&n.push("…"),n.join(", ")}function er(e,t,n){return Math.max(1,Math.floor((e-(n>1?16:0))/t))}function tr(e,t){const{itemGap:n,labelOffset:r,maxRows:i=Number.POSITIVE_INFINITY,charWidth:o=Hp}=t,a=null!=t.maxWidth&&t.maxWidth>0?t.maxWidth:Number.POSITIVE_INFINITY,s=Math.max(a,r+Math.ceil(2*o)),l=e.map(e=>Math.min(e,s)),c=[];let u=0,d=0;l.forEach((e,t)=>{const r=0===d?e:d+n+e;d>0&&r>a?(c.push({start:u,end:t,width:d}),u=t,d=e):d=r}),l.length>0&&c.push({start:u,end:l.length,width:d});let h=-1;if(c.length>Math.max(1,i)){c.length=Math.max(1,Math.floor(i));const e=c[c.length-1];for(;;){h=e.end>e.start?e.width+n:0;const t=Math.ceil(Qn(l.length-e.end).length*o);if(h+t<=a||e.end===e.start){e.width=h+t;break}e.end-=1,e.width=e.end>e.start?e.width-n-l[e.end]:0}}const f=c.length>0?c[c.length-1].end:0;return{rows:c,widths:l,visibleCount:f,hiddenCount:l.length-f,moreX:h,width:c.reduce((e,t)=>Math.max(e,t.width),0)}}function nr(e,t,n){const{swatchSize:r,labelGap:i,itemGap:o,rowHeight:a}=Yn(t),s=r+i;let l=0,c=0,u=0;for(const t of e){t.label&&(l=Math.max(l,Xn(t.label))),c+=t.items.length,u=Math.max(u,t.items.length);for(const e of t.items)l=Math.max(l,s+Xn(Zn(e?.label)))}const d=Math.max(s+2*Hp,n?.maxWidth??Number.POSITIVE_INFINITY),h=n?.maxHeight??Number.POSITIVE_INFINITY,f=t=>Un(e.map((e,n)=>({hasLabel:Boolean(e.label),itemCount:t[n]})),a),p=e=>f(e).at(-1)?.endY??0,m=t=>e.map(e=>Math.ceil(e.items.length/t)),g=e=>p(m(e))<=h,y=t=>{const n=Math.min(t,s+6*Hp),r=e=>Math.min(t,Math.floor((d-(e-1)*o)/e));let i=Math.max(1,Math.min(u,Math.floor((d+o)/(n+o))));for(;i>1&&r(i)<n;)i-=1;let l=1;if(!g(1))if(g(i)){let e=1,t=i;for(;t-e>1;){const n=Math.floor((e+t)/2);g(n)?t=n:e=n}l=t}else l=i;let c=m(l);if(p(c)>h){let t=Math.max(0,Math.floor((h-p(e.map(()=>0)))/a));c=e.map(e=>{if(0===e.items.length)return 0;const n=Math.max(1,Math.min(Math.ceil(e.items.length/l),t));return t=Math.max(0,t-n),n})}let y=1;const b=e.map((e,t)=>{const n=c[t]*l,r=e.items.length,i=r>n?Math.max(0,n-1):r,o=r-i,a=i+(o>0?1:0);return c[t]>0&&(y=Math.max(y,Math.ceil(a/c[t]))),{visibleCount:i,hiddenCount:o}}),v=1===y?Math.min(d,Math.max(Bp,t)):r(y),x=1===y?v:Math.min(d,Math.max(Bp,y*v+(y-1)*o)),w=f(c);return{width:x,height:w.at(-1)?.endY??0,columns:y,columnWidth:v,columnStep:v+o,labelWidth:Math.max(0,v-s),rowHeight:a,groups:w.map((e,t)=>({...e,rows:c[t],...b[t]}))}},b=y(l);return b.groups.some(e=>e.hiddenCount>0)?y(Math.max(l,Xn(Qn(c)))):b}function rr(e,t,n){const r=Math.max(1,t.rows);return{x:Math.floor(n/r)*e.columnStep,y:n%r*e.rowHeight}}function ir(e,t,n,r,i=8){const o="left"===r||"right"===r,a=r,s="left"===r?"right":"right"===r?"left":"top"===r?"bottom":"top",l=Math.max(0,(o?n[0]:n[1])-i),c=Math.max(t[a],l-e[s]);e[a]>c&&(e[a]=c)}function or(e,t){const n=t.position??"right";if("top"===n||"bottom"===n){const r="top"===n?t.margin.top-dr(t.axisChrome?.topAxis,t.legendLayout)-(t.hasTitle?24:0):t.margin.bottom-dr(t.axisChrome,t.legendLayout);return{maxHeight:Math.max(0,r-lr(e))}}const r="left"===n,i=t.margin[r?"left":"right"]-cr(t.legendLayout,r?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis)-lr(e)-ur(t.legendLayout),o=Math.max(Bp,i);return{maxWidth:null!=t.legendLayout?.maxWidth?Math.min(o,Math.max(1,t.legendLayout.maxWidth)):o,maxHeight:Math.max(0,t.totalHeight-t.margin.top)}}function ar(e,t){return er(or(e,t).maxHeight??0,Yn(t.legendLayout).rowHeight,Gn(e)?e.legendGroups.length:1)}function sr(e,t,n){if(Gn(e))return nr(e.legendGroups,t,n).width;if(Vn(e)){const{gradient:t}=e,n=t.format||Hn(t.domain),r=Math.max(Xn(n(t.domain[0])),Xn(n(t.domain[1]))),i=t.label?Xn(t.label):0;return Math.max(Bp,19+r,i)}return Bp}function lr(e){return(Gn(e)||Vn(e))&&Number.isFinite(e.legendDistance)?Math.max(0,e.legendDistance):10}function cr(e,t){return null!=e?.sideGutter?Math.max(0,e.sideGutter):t?.hasAxis?t.hasAxisLabel?Up:Yp:0}function ur(e){return Math.max(0,e?.edgeGutter??3)}function dr(e,t){return null!=t?.axisGutter?Math.max(0,t.axisGutter):e?.hasAxis?e.hasAxisLabel?e.rotatedTicks?Vp:Gp:qp:0}function hr(e,t,n,r){if(Vn(e))return e.gradient.label?46:26;if(!Gn(e))return 20;const i=Yn(n),o=Math.max(1,n?.maxWidth??t),a=i.swatchSize+i.labelGap;let s=i.rowHeight;for(const t of e.legendGroups){const{rows:e}=tr(t.items.map(e=>a+Xn(Zn(e.label))),{itemGap:i.itemGap,labelOffset:a,maxWidth:o,maxRows:r});s=Math.max(s,e.length*i.rowHeight,t.label?Xn(t.label):0)}return s+(e.legendGroups.length>1?16:0)}function fr(e,t,n,r){return sr(e,t,r)+lr(e)+cr(t,n)+ur(t)}function pr(e,t){const{legend:n}=t;if(!n)return;const r=t.position??"right",i=hr(n,Math.max(1,t.size[0]-e.left-e.right),t.legendLayout,er(.4*t.size[1],Yn(t.legendLayout).rowHeight,Gn(n)?n.legendGroups.length:1))+lr(n)+dr("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?58:34:0),a={maxWidth:(s=t.size[0],l=t.legendLayout,null!=l?.maxWidth?Math.max(1,l.maxWidth):Math.max(Bp,Math.floor(.3*s))),maxHeight:Math.max(0,t.size[1]-e.top)};var s,l;"right"===r?e.right=Math.max(e.right,o,fr(n,t.legendLayout,t.axisChrome?.rightAxis,a)):"left"===r?e.left=Math.max(e.left,o,fr(n,t.legendLayout,t.axisChrome?.leftAxis,a)):"top"===r?e.top=Math.max(e.top,o,i):e.bottom=Math.max(e.bottom,o,i)}function mr(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??sr(e,t.legendLayout,or(e,t))),a=lr(e),s=cr(t.legendLayout,"left"===n?t.axisChrome?.leftAxis:t.axisChrome?.rightAxis),l=ur(t.legendLayout),c=hr(e,i,t.legendLayout,r?ar(e,t):void 0),u=dr(t.axisChrome,t.legendLayout),d=dr(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 gr(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 yr(e,t,n){return"function"==typeof e?e({size:t,margin:n}):e}function br(e){const t=Nn("(prefers-reduced-motion: reduce)"),n=(0,Ap.useRef)(t);n.current=t;const[r,i]=In(e.sizeProp,e.responsiveWidth,e.responsiveHeight),o=i[0],a=i[1],s=(0,Ap.useMemo)(()=>[o,a],[o,a]),l=Boolean(e.title),c=(0,Ap.useMemo)(()=>{const t=Bn({...e.marginDefault,...e.userMargin},l);if(e.legend&&!e.legendMarginReserved){const n={...t},r=e.legendPosition??"right";pr(t,{legend:e.legend,position:r,size:s,hasTitle:l,legendLayout:e.legendLayout,axisChrome:e.axisChrome}),ir(t,n,s,r)}return t},[e.marginDefault,e.userMargin,e.legend,e.legendPosition,e.legendLayout,e.axisChrome,e.legendMarginReserved,l,s]),u=Math.max(1,i[0]-c.left-c.right),d=Math.max(1,i[1]-c.top-c.bottom),h=yr(e.foregroundGraphics,i,c),f=yr(e.backgroundGraphics,i,c),p=(0,Rp.useThemeSelector)(e=>e.theme),{transition:m,introEnabled:g}=(y=e.animate,b=e.transitionProp,{transition:!1===y?void 0:y?!0===y?{duration:300}:{duration:y.duration??300,easing:"linear"===y.easing?"linear":"ease-out"}:b,introEnabled:!(!y||globalThis.window?.matchMedia?.("(prefers-reduced-motion: reduce)").matches||!0!==y&&!1===y.intro)});var y,b;const v=`semiotic-table-${jp.useId()}`,x=(0,Ap.useRef)(null);if(!x.current){const t=!e.suspendWhenHidden||"undefined"==typeof document||!document.hidden;x.current=new Wp({clock:e.clock,random:e.random,seed:e.seed,paused:e.paused,visible:t})}const w=x.current;w.configure({clock:e.clock,random:e.random,seed:e.seed});const k=(0,Ap.useRef)(null),S=(0,Ap.useRef)(e.frameScheduler??Zp);S.current=e.frameScheduler??Zp;const M=(0,Ap.useRef)(null),j=(0,Ap.useRef)(!1),A=(0,Ap.useRef)(()=>{}),C=(0,Ap.useCallback)(()=>{if(null!==k.current||j.current)return;const e=S.current;let t=!1,n=!1;const r=e.requestAnimationFrame(()=>{t=!0;const e=!n;e&&(j.current=!0),k.current=null,M.current=null;try{e?A.current():(0,Cp.flushSync)(A.current)}finally{e&&(j.current=!1)}});n=!0,t||(k.current=r,M.current=e)},[]),R=(0,Ap.useCallback)(()=>{null!==k.current&&((M.current??S.current).cancelAnimationFrame(k.current),k.current=null,M.current=null)},[]),L=(0,Ap.useCallback)(()=>{null!==k.current&&(R(),A.current())},[R]);Xp(()=>{w.setPaused(!0===e.paused)},[w,e.paused]),(0,Ap.useEffect)(()=>{if(!e.suspendWhenHidden||"undefined"==typeof document)return void w.setVisible(!0);const t=()=>w.setVisible(!document.hidden);return t(),document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[w,e.suspendWhenHidden]),(0,Ap.useEffect)(()=>R,[R]);const N=(0,Ap.useRef)(()=>{}),P=(0,Ap.useRef)(()=>{}),I=(0,Ap.useRef)({inside:!1,clientX:0,clientY:0,pointerType:void 0}),E=(0,Ap.useRef)(null),T=(0,Ap.useRef)(null),z=(0,Ap.useRef)(null),$=(0,Ap.useCallback)(()=>{const e=E.current;E.current=null,e&&N.current(e)},[]),D=(0,Ap.useCallback)(e=>{const t={clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType};if(Object.assign(I.current,t).inside=!0,E.current=t,null===T.current){const e=S.current;let t=!1;const n=e.requestAnimationFrame(()=>{t=!0,T.current=null,z.current=null,$()});t||(T.current=n,z.current=e)}},[$]),O=(0,Ap.useCallback)(e=>{e&&"touch"===e.nativeEvent.pointerType&&D({clientX:e.clientX,clientY:e.clientY,pointerType:"touch"}),null!==T.current&&((z.current??S.current).cancelAnimationFrame(T.current),T.current=null,z.current=null),$()},[$,D]),F=(0,Ap.useCallback)(e=>{"mouseleave"===e?.type&&"touch"===I.current.pointerType||(I.current.inside=!1,E.current=null,O(),P.current())},[O]);(0,Ap.useEffect)(()=>{if("undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&I.current.inside&&F()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[F]),(0,Ap.useEffect)(()=>()=>{E.current=null,O()},[O]);const _=e.themeDirtyRef,W=(0,Ap.useRef)(!1);return Xp(()=>{if(!_)return;const t=!W.current;W.current=!0,t&&e.skipInitialThemeInvalidation||(Ep++,_.current=!0,C())},[p,e.skipInitialThemeInvalidation,C,_]),(0,Ap.useEffect)(()=>{if(_)return Dn(()=>r.current,()=>{_.current=!0,C()})},[r,C,_]),{reducedMotion:t,reducedMotionRef:n,responsiveRef:r,size:i,margin:c,adjustedWidth:u,adjustedHeight:d,resolvedForeground:h,resolvedBackground:f,currentTheme:p,transition:m,introEnabled:g,tableId:v,frameRuntime:w,rafRef:k,renderFnRef:A,scheduleRender:C,cancelRender:R,flushRender:L,hoverHandlerRef:N,hoverLeaveRef:P,onPointerMove:D,flushPointerMove:O,onPointerLeave:F,pointerStateRef:I}}function vr(e,t,n,r){(0,Kp.useEffect)(()=>{e.current?.updateConfig(t),n.current=!0,r()},[t,r,e,n])}function xr(e,t,n,r){const i=(0,Kp.useRef)(null);(0,Kp.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 wr(e,t="dark"===e.mode){const{colorBlindSafe:n,highContrast:r}=e.accessibility??{};return n||r?{...e,colors:{...e.colors,...n&&{categorical:Qp},...r&&{text:t?"#ffffff":"#000000",textSecondary:t?"#cccccc":"#333333",grid:t?"#666666":"#999999",border:t?"#888888":"#000000"}}}:e}function kr(e){let t=e.replace(/^#/,"");/^[a-f\d]{3}$/i.test(t)&&(t=t.split("").map(e=>e+e).join(""));const n=t.match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(!n)return null;const[r,i,o]=[parseInt(n[1],16)/255,parseInt(n[2],16)/255,parseInt(n[3],16)/255],a=e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4);return.2126*a(r)+.7152*a(i)+.0722*a(o)}function Sr(e,t){const n=kr(e),r=kr(t);return null===n||null===r?null:(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Mr(e){return Array.isArray(e)?e.map(Mr):null!==e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,Mr(t)])):e}function jr(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 Ar(e){return wr(e,"dark"===e.mode||"auto"===e.mode&&(Sr(e.colors.background,"#ffffff")??1)>Math.sqrt(21))}function Cr(e,t){const n={...e,...t};for(const[r,i]of Object.entries(e))i&&"object"==typeof i&&!Array.isArray(i)&&(n[r]=Cr(i,t[r]??{}));return n}function Rr(e,t){return"light"===t?Mr(Jp):"dark"===t?Mr(em):"high-contrast"===t?Mr(tm):"string"==typeof t?("undefined"!=typeof console&&console.warn(`[ThemeStore] Unknown theme preset "${t}". Keeping current theme.`),e):Mr(Ar(Cr(t.mode&&"auto"!==t.mode?"dark"===t.mode?em:Jp:e,t)))}function Lr(e,t){const n=e?.state??(e?.settling?"settling":void 0);if("live"===n)return im;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&&t>0))return im;const r=null!=e.threshold&&e.threshold>0?e.threshold:5e3,i=e.graded;if(i){const e="object"==typeof i?i:{},n=At(t,r,e.thresholds);return{alpha:{...rm,...e.opacities??{}}[n],band:n,isStale:"fresh"!==n}}return t>r?{alpha:e.dimOpacity??.5,band:"stale",isStale:!0}:im}function Nr(e,t,n,r,i,o){const a=(0,nm.useRef)("fresh");(0,nm.useEffect)(()=>{if(!e)return a.current="fresh",void(i&&o(!1));const s=setInterval(()=>{const s=t.current;if(!s)return;const l=Lr(e,s.activity.elapsed());l.band===a.current&&l.isStale===i||(a.current=l.band,l.isStale!==i&&o(l.isStale),n.current=!0,r())},1e3);return()=>clearInterval(s)},[e,i,r,t,o,n])}function Pr(e){let t=null;const n=()=>(t||(t=(0,om.createContext)(null)),t),r=Ir(e);return[function({children:t,initialState:r}){const i=(0,om.useRef)(r),o=(0,om.useMemo)(()=>Ir(e,i.current),[]),a=n();/* @__PURE__ */ /* @__PURE__ */
|
|
19
|
+
return(0,am.jsx)(a.Provider,{value:o,children:t})},(e,t)=>{const i=n(),o=(0,om.useContext)(i)??r,a=(0,om.useRef)(e);a.current=e;const s=(0,om.useRef)({hasValue:!1,value:void 0}),l=(0,om.useCallback)(()=>{const e=a.current(o.getState()),n=s.current;return n.hasValue&&t&&t(n.value,e)?n.value:(s.current={hasValue:!0,value:e},e)},[o,t]),c=(0,om.useCallback)(()=>a.current(o.getState()),[o]);return(0,om.useSyncExternalStore)(o.subscribe,l,c)}]}function Ir(e,t){const n=/* @__PURE__ */new Set;let r={...e(function(e){const t=e(r);if(Er(t)){r={...r,...t};for(const e of n)e()}}),...t??{}};return{getState:()=>r,subscribe:function(e){return n.add(e),()=>{n.delete(e)}}}}function Er(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function Tr(){return lm(e=>e.theme)}function zr(e,t,n){return t||(n?"settling":e?"stale":"live")}function $r({isStale:e,position:t,state:n,settling:r}){const i=zr(e,n,r),{colors:o}=Tr(),a={live:o.success,stale:o.danger,stopped:o.textSecondary,failed:o.error,settling:o.warning}[i]??um[i],s=(Sr(a,"#ffffff")??0)>=4.5?"#ffffff":"#000000",l=Object.hasOwn(um,i)?i.toUpperCase():"LIVE";/* @__PURE__ */ /* @__PURE__ */
|
|
20
|
+
return(0,cm.jsx)("div",{className:"stream-staleness-badge",role:"status","aria-live":"polite","aria-atomic":"true",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:a,color:s},children:l})}function Dr(e){const t=e.provenance,n=e.id??e.stableId??t?.stableId;return null==n||""===n?void 0:String(n)}function Or(e){const t=(0,hm.useObservationSelector)(e=>e.pushObservation),n=dm.useCallback(n=>{e.onObservation?.(n),t?.(n)},[e,t]);return dm.useMemo(()=>({...e,onObservation:n}),[n,e])}function Fr(e){const t=e.nativeEvent;return"touch"===t.pointerType?"touch":0===t.detail?"keyboard":"pointer"}function _r(e,t={}){const n=Dr(e);return{"data-semiotic-annotation-widget":"",...n?{"data-semiotic-annotation-id":n}:{},onClickCapture(r){const i=Fr(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 Wr(e){return"string"==typeof e&&e.includes("var(")}function Br(e){const t=pm.exec(e);if(!t)return Wr(e)?void 0:e;const n=t[1]?.trim();return n?Br(n):void 0}function Hr(e,t){return String(e).length*t*.6}function qr(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 Gr(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=qr(u),f=e=>/* @__PURE__ */ /* @__PURE__ */(0,mm.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??gm,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=Hr(r,o),b=y+2*m,v=o+2*g;let x,w;x="middle"===l?t-y/2-m:"end"===l?t-y-m:t-m,w="middle"===c||"central"===c?n-v/2:"hanging"===c||"text-before-edge"===c?n-g:n-.8*o-g;const k=h.fill??gm,S={};return Wr(k)&&(S.fill=k),Wr(h.stroke)&&(S.stroke=h.stroke),/* @__PURE__ */ /* @__PURE__ */(0,mm.jsxs)("g",{className:d,children:[
|
|
20
21
|
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */(0,
|
|
22
|
-
return(0,
|
|
23
|
-
return(0,
|
|
22
|
+
/* @__PURE__ */(0,mm.jsx)("rect",{x:x,y:w,width:b,height:v,rx:h.radius??3,ry:h.radius??3,fill:Wr(k)?Br(k):k,fillOpacity:h.opacity??.85,stroke:Wr(h.stroke)?Br(h.stroke):h.stroke,strokeWidth:h.strokeWidth,...S.fill||S.stroke?{style:S}:{}}),f()]})}function Vr(e,t,n){if(!e)return null;const r="object"==typeof e?e:{};/* @__PURE__ */ /* @__PURE__ */
|
|
23
|
+
return(0,ym.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(e,t){return Math.max(Math.min(e,t),0)+16}function Ur({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:t<20?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],b=n?[t,i]:[r,t];/* @__PURE__ */ /* @__PURE__ */
|
|
24
|
+
return(0,bm.jsxs)("g",{opacity:e.opacity,children:[
|
|
24
25
|
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */(0,
|
|
26
|
+
/* @__PURE__ */(0,bm.jsx)("line",{x1:y[0],y1:y[1],x2:b[0],y2:b[1],stroke:o,strokeWidth:e.strokeWidth??1.5,strokeDasharray:e.strokeDasharray||u}),Vr(e.endCap,y,o),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,bm.jsx)(Gr,{x:p,y:m,text:e.label,textAnchor:g,fill:e.labelColor??o,fontSize:a,fontFamily:s,fontWeight:l?"bold":void 0,background:c??e.labelBackground??"halo"})]})}function Xr(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 Zr(e){return"function"==typeof e._noteLayout?e._noteLayout(e):void 0}function Kr(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 Qr(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 Jr(e,t,n,r){if(!e)/* @__PURE__ */ /* @__PURE__ */return(0,xm.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,xm.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?t>=0?"left":"right":n>=0?"top":"bottom");let p="start";d?"right"===f?p="end":"middle"===f&&(p="middle"):p=t>=0?"start":"end";const m=e.useHTML||e.html,g=m?void 0:Zr(e),y=g?.lineHeight??16,b=g?.titleLines??(o?c?[o]:Kr(o,l,8):[]),v=g?.labelLines??(i?c?[i]:Kr(i,l,8):[]),x=b.length+v.length,w=h?"end"===p?-4:4:0,k=[],S=r||"var(--semiotic-annotation-color, var(--semiotic-text, #333))";if(m){const e=l,t=Math.max(y,x*y+(o&&i?2:0)),n="end"===p?w-e:"middle"===p?w-e/2:w,r="end"===p?"right":"middle"===p?"center":"left";k.push(
|
|
26
27
|
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */(0,
|
|
28
|
+
/* @__PURE__ */(0,xm.jsx)("foreignObject",{className:"annotation-note-html",x:n,y:-y,width:e,height:t+y,style:{overflow:"visible"},children:/* @__PURE__ */ /* @__PURE__ */(0,xm.jsxs)("div",{xmlns:"http://www.w3.org/1999/xhtml",style:{color:S,fontSize:"12px",lineHeight:`${y}px`,overflow:"visible",textAlign:r,whiteSpace:c?"nowrap":"normal",wordBreak:"break-word"},children:[o&&/* @__PURE__ */ /* @__PURE__ */(0,xm.jsx)("div",{className:"annotation-note-title",style:{fontWeight:"bold"},children:o}),i&&/* @__PURE__ */ /* @__PURE__ */(0,xm.jsx)("div",{className:"annotation-note-label",children:i})]})},"annotation-note-html"))}else for(const e of[!0,!1]){const t=e?b:v;if(0===t.length)continue;const n="annotation-note-"+(e?"title":"label");k.push(
|
|
28
29
|
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */(0,
|
|
30
|
-
return(0,
|
|
30
|
+
/* @__PURE__ */(0,xm.jsx)("text",{className:n,fill:S,textAnchor:p,fontWeight:e?g?.titleFontWeight??"bold":void 0,y:e?void 0:b.length*y,children:t.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,xm.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):(b.length+v.length+(v.length>0?1:0))*y,t=d?p:f,n="end"===t||"bottom"===t?-e:"middle"===t?-e/2:0;M=/* @__PURE__ */ /* @__PURE__ */(0,xm.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,A=v.length>0&&b.length>0?2:0;let C=0;(d||h)&&(C=h&&"middle"===f?-(j+y+A)/2+y/2:n<0||h&&"bottom"===f?-(j+2):2+y);const R=0!==C?`translate(0,${C})`:void 0;/* @__PURE__ */ /* @__PURE__ */
|
|
31
|
+
return(0,xm.jsxs)("g",{className:"annotation-note",transform:`translate(${t},${n})`,...g?.textProps,children:[
|
|
31
32
|
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */(0,
|
|
33
|
-
return(0,
|
|
34
|
-
return(0,
|
|
35
|
-
return(0,
|
|
36
|
-
return(0,
|
|
37
|
-
return(0,
|
|
38
|
-
return(0,Xp.jsx)(Br,{"data-testid":"semiotic-annotation",events:i,...t,type:r},a)}function Hr(e){return e instanceof Date&&(e=e.getTime()),"string"==typeof e&&""!==e.trim()&&(e=Number(e)),"number"==typeof e&&Number.isFinite(e)?e:null}function qr(e){const t=[];for(const[n,r]of e){const e=Hr(n),i=Hr(r);null!==e&&null!==i&&t.push([e,i])}return t.sort((e,t)=>e[0]-t[0])}function Gr(){return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN}}function Vr(e){const t=qr(e);if(!t.length)return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN};const n=t[0][0],r=t.reduce((e,[r])=>e+(r-n)/t.length,0),i=t.reduce((e,[,n])=>e+n/t.length,0);let o=0,a=0;for(const[e,s]of t){const t=e-n-r;o+=t*t,a+=t*(s-i)}const s=0===o?0:a/o,l=e=>i+s*(e-n-r);return{points:t.map(([e])=>[e,l(e)]),parameterCount:2,leverage:e=>1/t.length+(o>0?(e-n-r)**2/o:0),predict:l}}function Ur(e,t=2){const n=qr(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN};const r=n[0][0]/2+n[n.length-1][0]/2,i=Math.max(Math.abs(n[0][0]-r),Math.abs(n[n.length-1][0]-r))||1,o=n.map(([e])=>(e-r)/i),a=[],s=Array.from({length:t+1},()=>Array(t+1).fill(0));for(let e=0;e<=t;e++){const t=o.map(t=>t**e);for(let n=0;n<2;n++)for(let n=0;n<e;n++){const r=t.reduce((e,t,r)=>e+t*a[n][r],0);s[n][e]+=r;for(let e=0;e<t.length;e++)t[e]-=r*a[n][e]}const r=Math.sqrt(t.reduce((e,t)=>e+t*t,0));if(!Number.isFinite(r)||r<=Number.EPSILON*n.length)return Gr();s[e][e]=r,a.push(t.map(e=>e/r))}const l=a.map(e=>e.reduce((e,t,r)=>e+t*n[r][1],0));for(let e=t;e>=0;e--){for(let n=e+1;n<=t;n++)l[e]-=s[e][n]*l[n];l[e]/=s[e][e]}const c=e=>{const n=(e-r)/i;let o=0;for(let e=t;e>=0;e--)o=o*n+l[e];return o};return{points:n.map(([e])=>[e,c(e)]),parameterCount:t+1,predict:c,leverage:e=>{const n=(e-r)/i,o=[];for(let e=0;e<=t;e++){let t=n**e;for(let n=0;n<e;n++)t-=s[n][e]*o[n];o.push(t/s[e][e])}return o.reduce((e,t)=>e+t*t,0)}}}function Yr(e,t,n=2){const r=e.length,i=e.reduce((e,[n,r])=>e+(r-t(n))**2,0);return{se:Math.sqrt(i/Math.max(r-n,1))}}function Xr(e,t=.3){if(!Number.isFinite(t)||t<0||t>1)return[];const n=qr(e),r=n.length;if(r<2)return n;const i=n.map(e=>e[0]),o=n.map(e=>e[1]);let a=0,s=Math.min(r,Math.max(2,Math.ceil(t*r)))-1;const l=[];for(let e=0;e<r;e++){const t=i[e];let n=0,c=r-1;for(;s<r-1&&Math.abs(i[s+1]-t)<=Math.abs(i[a]-t);)a++,s++;const u=Math.max(Math.abs(i[a]-t),Math.abs(i[s]-t)),d=u||1;u>0&&(n=a,c=s);let h=0,f=0,p=0,m=0,g=0;for(let e=n;e<=c;e++){const n=Math.abs(i[e]-t)/d,r=n<1?Math.pow(1-Math.pow(n,3),3):0;if(0===r)continue;h+=r;const a=(i[e]-t)/d;f+=r*a,p+=r*o[e],m+=r*a*a,g+=r*a*o[e]}if(0===h){l.push([t,o[e]]);continue}const y=h*m-f*f;if(Math.abs(y)<1e-12)l.push([t,p/h]);else{const e=(p-(h*g-f*p)/y*f)/h;l.push([t,e])}}return l}function Zr(e,t=.3){const n=new Map(Xr(e,t));return n.size<2?null:(0,Qp.scaleLinear)().domain([...n.keys()]).range([...n.values()])}function Kr(e,t){if(e.length<3||e[0][0]===e[e.length-1][0])return null;const n="polynomial"===t.method?Ur(e,t.order??2):Vr(e);if(!n.points.length)return null;const r="loess"===t.method?Zr(e,t.bandwidth):n.predict;if(!r)return null;const{se:i}=Yr(e,r,n.parameterCount),o=(a=t.confidence??.95)>=.99?2.576:a>=.95?1.96:a>=.9?1.645:1;var a;const s=e[e.length-1][0],l=(s-e[0][0])/(e.length-1);return{predict:r,forecast:(e,t=s)=>!Number.isInteger(e)||e<=0?[]:Array.from({length:e},(e,a)=>{const s=t+(a+1)*l,c=r(s),u=i*o*Math.sqrt(1+n.leverage(s));return{x:s,y:c,upper:c+u,lower:c-u}})}}function Qr(e){if(!e)return null;const t=e[Jp];return t&&t.length>0?t:null}function Jr(e,t){if(t instanceof Date){const n=t.getTime();return Number.isFinite(n)?e.find(e=>e.label instanceof Date&&e.label.getTime()===n)?.value??null:null}if("number"==typeof t&&Number.isFinite(t)){const n=e.find(e=>"number"==typeof e.label&&e.label===t);return n?n.value:e.find(e=>e.label instanceof Date&&e.label.getTime()===t)?.value??null}return"string"==typeof t?e.find(e=>"string"==typeof e.label&&e.label===t)?.value??null:null}function ei(e,t){if(!e)return null;const n=Qr(e);if(!n)return e(t);const r=Jr(n,t);return null==r?null:e(r)}function ti(e,t,n){if("function"!=typeof e)return null;if(null==t){const t=e.domain?.()?.[n];if(null==t)return null;const r=e(t instanceof Date?t.getTime():Number(t));return Number.isFinite(r)?r:null}const r=ei(e,t);return null!=r&&Number.isFinite(r)?r:null}function ni(e,t){const n=t instanceof Date?t.getTime():t;if(!e||!Number.isFinite(n))return null;const r=Qr(e);if(!r)return e(n);const i=ii(r);if(!i)return e(n);const o=oi(r,i).get(n);if(null!=o)return e(o);const a=li(i,n);return null==a?null:e(a)}function ri(e,t){return"number"==typeof t&&Number.isFinite(t)?ni(e,t):ei(e,t)}function ii(e){const t=e;if(em in t)return t[em]??null;let n=null;return e.every(e=>"number"==typeof e.label&&Number.isFinite(e.label))?n=e.map(e=>e.label):e.every(e=>e.label instanceof Date&&Number.isFinite(e.label.getTime()))&&(n=e.map(e=>e.label.getTime())),Object.defineProperty(t,em,{value:n}),n}function oi(e,t){const n=e,r=n[tm];if(r)return r;const i=/* @__PURE__ */new Map;for(let e=0;e<t.length;e++)i.set(t[e],e);return Object.defineProperty(n,tm,{value:i}),i}function ai(e){const t=e,n=t[nm];if(null!=n)return n;let r=0;for(let t=1;t<e.length;t++){const n=e[t]-e[t-1];if(0===n){r=0;break}const i=n>0?1:-1;if(0===r)r=i;else if(r!==i){r=0;break}}return Object.defineProperty(t,nm,{value:r}),r}function si(e,t,n){let r=0,i=e.length;for(;r<i;){const o=r+i>>1;(1===n?e[o]<t:e[o]>t)?r=o+1:i=o}if(0===r)return(t-e[0])/(e[1]-e[0]);const o=e.length-1;return r>=e.length?o+(t-e[o])/(e[o]-e[o-1]):r-1+(t-e[r-1])/(e[r]-e[r-1])}function li(e,t){if(e.length<2)return 1===e.length?t-e[0]:null;const n=ai(e);if(1===n||-1===n)return si(e,t,n);for(let n=0;n<e.length-1;n++){const r=e[n],i=e[n+1];if(r===i)continue;const o=Math.min(r,i),a=Math.max(r,i);if(t>=o&&t<=a)return n+(t-r)/(i-r)}const r=e[1]-e[0];if(0!==r&&(t-e[0])/r<0)return(t-e[0])/r;const i=e.length-1,o=e[i]-e[i-1];return 0!==o&&(t-e[i])/o>0?i+(t-e[i])/o:null}function ci(e,t){const n=t.scales?.x??t.scales?.time,r=t.scales?.y??t.scales?.value;if(!n||!r)return[];const i=t.data||[];let o=t.xAccessor||"x",a=t.yAccessor||"y";const s="horizontal"===t.projection,l="ordinal"===t.frameType;l&&s&&([o,a]=[a,o]);const c=e=>{const t=ri(n,e);return null==t?Number.NaN:t},u=e=>{const t=ri(r,e);return null==t?Number.NaN:t},d=s?u:c,h=l?t.scales?.o?.domain().map(String)??[...new Set(i.filter(e=>null!=e[o]).map(e=>String(e[o])))].sort((e,t)=>d(e)-d(t)):[],f=new Map(h.map((e,t)=>[e,t])),p=qr(i.map(e=>[l?null==e[o]?void 0:f.get(String(e[o])):e[o],e[a]]));return p.length<2?[]:("loess"===e.method?Xr(p,e.bandwidth??.3):("polynomial"===e.method?Ur(p,e.order??2):Vr(p)).points).map(([e,t])=>{if(!l)return[c(e),u(t)];const n=d(h[e]);return s?[c(t),n]:[n,u(t)]}).filter(([e,t])=>Number.isFinite(e)&&Number.isFinite(t))}function ui(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?ei(n,e.x):t.xAccessor&&null!=e[t.xAccessor]?ei(n,e[t.xAccessor]):null:null}function di(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?ei(n,e.y):t.yAccessor&&null!=e[t.yAccessor]?ei(n,e[t.yAccessor]):null:null}function hi(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=e.xAccessor||"x",a=e.yAccessor||"y",s=n[o],l=n[a];if(null==s||null==l)return null;const c=ei(r,s),u=ei(i,l);return null==c||null==u?null:{x:c,y:u}}function fi(e){return null==e?null:String(e)}function pi(e){return fi(e.provenance?.stableId??e.stableId)}function mi(e){return fi(e.stableId??e.id??e.provenance?.stableId)}function gi(e,t,n){return t.stickyPositionCache?.set(e,n),n}function yi(e,t,n){const r=pi(e);if(!r)return null;const i=n.pointNodes?.find(e=>fi(e.pointId)===r);if(i)return gi(t,n,{x:i.x,y:i.y});const o=n.data?.find(e=>mi(e)===r);if(!o)return null;const a=ui(o,n),s=di(o,n);return null==a||null==s?null:gi(t,n,{x:a,y:s})}function bi(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 gi(t,n,{x:i.x,y:i.y})}const r=hi(n);return r?gi(t,n,r):null}if("semantic"===r){const r=yi(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=ui(e,n),o=di(e,n)),null!=i&&null!=o)return gi(t,n,{x:i,y:o});if("sticky"===r){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function vi(e,t,n,r=50){const i=n.width||0,o=n.height||0;return e>=-r&&e<=i+r&&t>=-r&&t<=o+r}function xi(e,t=2166136261){let n=t;for(let t=0;t<e.length;t++)n^=e.charCodeAt(t),n=Math.imul(n,16777619);return n>>>0}function wi(e){const t=Number.isFinite(e)&&e>0?e:6;return{width:Math.max(8,t),height:t,lineY:t/2}}function ki(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,...1!==e.lineOpacity?{lineOpacity:e.lineOpacity}:{}}}function Si(){const e="undefined"!=typeof window&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,e))}function Mi(e,t,n,r){t&&"transparent"!==t&&"none"!==t?(e.fillStyle=t,e.fillRect(0,0,n,r)):e.clearRect(0,0,n,r)}function ji(e={},t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45,lineOpacity:s=1}=e,l={background:n,stroke:r,lineWidth:i,spacing:o,angle:a,lineOpacity:s},c=wi(o),u=Si(),d=Math.max(1,Math.round(c.width*u)),h=Math.max(1,Math.round(c.height*u));let f;try{p=d,m=h,f="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(p,m):(rm||(rm=document.createElement("canvas")),rm.width=p,rm.height=m,rm)}catch{return ki(l)}var p,m;const g=f.getContext("2d");if(!g)return ki(l);Mi(g,n,d,h);const y=h/c.height,b=Math.max(0,i)*y;g.save(),g.globalAlpha=Math.min(1,Math.max(0,s)),g.fillStyle=r,g.fillRect(0,c.lineY*y-b/2,d,b),g.restore();const v=(t||g).createPattern(f,"repeat");if(!v)return v;const x=a*Math.PI/180,w=Math.cos(x),k=Math.sin(x),S=c.width/d,M=c.height/h;return v.setTransform?.({a:w*S,b:k*S,c:-k*M,d:w*M,e:0,f:0}),v}function Ai(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function Ri(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function Ci(e,t){return`${e}-hatch-${xi(Ri(t)).toString(36)}`}function Li(e,t){const n=e.background??"transparent",r=e.stroke??"#000",i="transparent"===n||"none"===n?n:Fn(t,n)||n,o=Fn(t,r)||r||"#000",a="undefined"!=typeof window&&window.devicePixelRatio||1,s=`${Ri(e)}|${i}|${o}@${a}`,l=om.get(s);if(void 0!==l)return l;const c=ji({background:i,stroke:o,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,lineOpacity:e.lineOpacity},t),u=Ai(c)?null:c;return om.set(s,u),u}function Ni(e,t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45,lineOpacity:s=1}=e,l=wi(o);/* @__PURE__ */ /* @__PURE__ */
|
|
39
|
-
return(0,
|
|
33
|
+
/* @__PURE__ */(0,xm.jsx)("g",{className:"annotation-note-content",transform:R,children:k}),M]})}function ei(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,xm.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,xm.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,xm.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,r=t?.depth??30,i=void 0===t?.width;void 0!==n&&(o=/* @__PURE__ */ /* @__PURE__ */(0,xm.jsx)("path",{d:Qr(e,n,r,i),fill:"none",stroke:a},"bracket-path"));break}}/* @__PURE__ */ /* @__PURE__ */
|
|
34
|
+
return(0,xm.jsx)("g",{className:"annotation-subject",children:o})}function ti(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,xm.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,xm.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,n=l+e*Math.cos(f+t),r=c+e*Math.sin(f+t),o=l+e*Math.cos(f-t),a=c+e*Math.sin(f-t);s=/* @__PURE__ */ /* @__PURE__ */(0,xm.jsx)("path",{d:`M${l},${c}L${n},${r}L${o},${a}Z`,fill:i,stroke:"none"},"connector-arrow")}}/* @__PURE__ */ /* @__PURE__ */
|
|
35
|
+
return(0,xm.jsxs)("g",{className:"annotation-connector",children:[a,s]})}function ni(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,b=Array.isArray(t)?t[0]??0:t,v=Array.isArray(n)?n[0]??0:n,x=Array.isArray(f)?f:[];let w=r||0,k=i||0;null!=o&&(w=o-b),null!=a&&(k=a-v);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+(e>=0?5:-5)}else if(void 0!==c.height){const e=c.depth??30;w=e+(e>=0?5:-5),k=c.height/2}/* @__PURE__ */ /* @__PURE__ */
|
|
36
|
+
return(0,xm.jsxs)("g",{className:`annotation ${h||""}`.trim(),transform:`translate(${b},${v})`,"data-testid":y,...null!=p&&{opacity:p},...m&&{strokeDasharray:m},...g,children:[!x.includes("connector")&&ti(w,k,l,d,S,c),!x.includes("subject")&&ei(S,c,d,b,v),!x.includes("note")&&Jr(s,w,k,d)]})}function ri(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),o=t.ny??n[0][1]+(t.dy??0),a=n.map((n,a)=>{const s={...t,note:0===a?t.note:{label:""},x:n[0],y:n[1],nx:e,ny:o};/* @__PURE__ */ /* @__PURE__ */
|
|
37
|
+
return(0,xm.jsx)(ni,{"data-testid":"semiotic-annotation",...s,events:i,type:r},`multi-annotation-${a}`)});/* @__PURE__ */ /* @__PURE__ */
|
|
38
|
+
return(0,xm.jsx)("g",{children:a})}const o=t.note||{title:"none",label:t.label},a=`${o.label}-${o.title}-${t.i}`;/* @__PURE__ */ /* @__PURE__ */
|
|
39
|
+
return(0,xm.jsx)(ni,{"data-testid":"semiotic-annotation",events:i,...t,type:r},a)}function ii(e){return e instanceof Date&&(e=e.getTime()),"string"==typeof e&&""!==e.trim()&&(e=Number(e)),"number"==typeof e&&Number.isFinite(e)?e:null}function oi(e){const t=[];for(const[n,r]of e){const e=ii(n),i=ii(r);null!==e&&null!==i&&t.push([e,i])}return t.sort((e,t)=>e[0]-t[0])}function ai(){return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN}}function si(e){const t=oi(e);if(!t.length)return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN};const n=t[0][0],r=t.reduce((e,[r])=>e+(r-n)/t.length,0),i=t.reduce((e,[,n])=>e+n/t.length,0);let o=0,a=0;for(const[e,s]of t){const t=e-n-r;o+=t*t,a+=t*(s-i)}const s=0===o?0:a/o,l=e=>i+s*(e-n-r);return{points:t.map(([e])=>[e,l(e)]),parameterCount:2,leverage:e=>1/t.length+(o>0?(e-n-r)**2/o:0),predict:l}}function li(e,t=2){const n=oi(e);if(!Number.isInteger(t)||t<0||t>=n.length)return{points:[],parameterCount:0,predict:()=>NaN,leverage:()=>NaN};const r=n[0][0]/2+n[n.length-1][0]/2,i=Math.max(Math.abs(n[0][0]-r),Math.abs(n[n.length-1][0]-r))||1,o=n.map(([e])=>(e-r)/i),a=[],s=Array.from({length:t+1},()=>Array(t+1).fill(0));for(let e=0;e<=t;e++){const t=o.map(t=>t**e);for(let n=0;n<2;n++)for(let n=0;n<e;n++){const r=t.reduce((e,t,r)=>e+t*a[n][r],0);s[n][e]+=r;for(let e=0;e<t.length;e++)t[e]-=r*a[n][e]}const r=Math.sqrt(t.reduce((e,t)=>e+t*t,0));if(!Number.isFinite(r)||r<=Number.EPSILON*n.length)return ai();s[e][e]=r,a.push(t.map(e=>e/r))}const l=a.map(e=>e.reduce((e,t,r)=>e+t*n[r][1],0));for(let e=t;e>=0;e--){for(let n=e+1;n<=t;n++)l[e]-=s[e][n]*l[n];l[e]/=s[e][e]}const c=e=>{const n=(e-r)/i;let o=0;for(let e=t;e>=0;e--)o=o*n+l[e];return o};return{points:n.map(([e])=>[e,c(e)]),parameterCount:t+1,predict:c,leverage:e=>{const n=(e-r)/i,o=[];for(let e=0;e<=t;e++){let t=n**e;for(let n=0;n<e;n++)t-=s[n][e]*o[n];o.push(t/s[e][e])}return o.reduce((e,t)=>e+t*t,0)}}}function ci(e,t,n=2){const r=e.length,i=e.reduce((e,[n,r])=>e+(r-t(n))**2,0);return{se:Math.sqrt(i/Math.max(r-n,1))}}function ui(e,t=.3){if(!Number.isFinite(t)||t<0||t>1)return[];const n=oi(e),r=n.length;if(r<2)return n;const i=n.map(e=>e[0]),o=n.map(e=>e[1]);let a=0,s=Math.min(r,Math.max(2,Math.ceil(t*r)))-1;const l=[];for(let e=0;e<r;e++){const t=i[e];let n=0,c=r-1;for(;s<r-1&&Math.abs(i[s+1]-t)<=Math.abs(i[a]-t);)a++,s++;const u=Math.max(Math.abs(i[a]-t),Math.abs(i[s]-t)),d=u||1;u>0&&(n=a,c=s);let h=0,f=0,p=0,m=0,g=0;for(let e=n;e<=c;e++){const n=Math.abs(i[e]-t)/d,r=n<1?Math.pow(1-Math.pow(n,3),3):0;if(0===r)continue;h+=r;const a=(i[e]-t)/d;f+=r*a,p+=r*o[e],m+=r*a*a,g+=r*a*o[e]}if(0===h){l.push([t,o[e]]);continue}const y=h*m-f*f;if(Math.abs(y)<1e-12)l.push([t,p/h]);else{const e=(p-(h*g-f*p)/y*f)/h;l.push([t,e])}}return l}function di(e,t=.3){const n=new Map(ui(e,t));return n.size<2?null:(0,Sm.scaleLinear)().domain([...n.keys()]).range([...n.values()])}function hi(e,t){if(e.length<3||e[0][0]===e[e.length-1][0])return null;const n="polynomial"===t.method?li(e,t.order??2):si(e);if(!n.points.length)return null;const r="loess"===t.method?di(e,t.bandwidth):n.predict;if(!r)return null;const{se:i}=ci(e,r,n.parameterCount),o=(a=t.confidence??.95)>=.99?2.576:a>=.95?1.96:a>=.9?1.645:1;var a;const s=e[e.length-1][0],l=(s-e[0][0])/(e.length-1);return{predict:r,forecast:(e,t=s)=>!Number.isInteger(e)||e<=0?[]:Array.from({length:e},(e,a)=>{const s=t+(a+1)*l,c=r(s),u=i*o*Math.sqrt(1+n.leverage(s));return{x:s,y:c,upper:c+u,lower:c-u}})}}function fi(e){if(!e)return null;const t=e[Mm];return t&&t.length>0?t:null}function pi(e,t){if(t instanceof Date){const n=t.getTime();return Number.isFinite(n)?e.find(e=>e.label instanceof Date&&e.label.getTime()===n)?.value??null:null}if("number"==typeof t&&Number.isFinite(t)){const n=e.find(e=>"number"==typeof e.label&&e.label===t);return n?n.value:e.find(e=>e.label instanceof Date&&e.label.getTime()===t)?.value??null}return"string"==typeof t?e.find(e=>"string"==typeof e.label&&e.label===t)?.value??null:null}function mi(e,t){if(!e)return null;const n=fi(e);if(!n)return e(t);const r=pi(n,t);return null==r?null:e(r)}function gi(e,t,n){if("function"!=typeof e)return null;if(null==t){const t=e.domain?.()?.[n];if(null==t)return null;const r=e(t instanceof Date?t.getTime():Number(t));return Number.isFinite(r)?r:null}const r=mi(e,t);return null!=r&&Number.isFinite(r)?r:null}function yi(e,t){const n=t instanceof Date?t.getTime():t;if(!e||!Number.isFinite(n))return null;const r=fi(e);if(!r)return e(n);const i=vi(r);if(!i)return e(n);const o=xi(r,i).get(n);if(null!=o)return e(o);const a=Si(i,n);return null==a?null:e(a)}function bi(e,t){return"number"==typeof t&&Number.isFinite(t)?yi(e,t):mi(e,t)}function vi(e){const t=e;if(jm in t)return t[jm]??null;let n=null;return e.every(e=>"number"==typeof e.label&&Number.isFinite(e.label))?n=e.map(e=>e.label):e.every(e=>e.label instanceof Date&&Number.isFinite(e.label.getTime()))&&(n=e.map(e=>e.label.getTime())),Object.defineProperty(t,jm,{value:n}),n}function xi(e,t){const n=e,r=n[Am];if(r)return r;const i=/* @__PURE__ */new Map;for(let e=0;e<t.length;e++)i.set(t[e],e);return Object.defineProperty(n,Am,{value:i}),i}function wi(e){const t=e,n=t[Cm];if(null!=n)return n;let r=0;for(let t=1;t<e.length;t++){const n=e[t]-e[t-1];if(0===n){r=0;break}const i=n>0?1:-1;if(0===r)r=i;else if(r!==i){r=0;break}}return Object.defineProperty(t,Cm,{value:r}),r}function ki(e,t,n){let r=0,i=e.length;for(;r<i;){const o=r+i>>1;(1===n?e[o]<t:e[o]>t)?r=o+1:i=o}if(0===r)return(t-e[0])/(e[1]-e[0]);const o=e.length-1;return r>=e.length?o+(t-e[o])/(e[o]-e[o-1]):r-1+(t-e[r-1])/(e[r]-e[r-1])}function Si(e,t){if(e.length<2)return 1===e.length?t-e[0]:null;const n=wi(e);if(1===n||-1===n)return ki(e,t,n);for(let n=0;n<e.length-1;n++){const r=e[n],i=e[n+1];if(r===i)continue;const o=Math.min(r,i),a=Math.max(r,i);if(t>=o&&t<=a)return n+(t-r)/(i-r)}const r=e[1]-e[0];if(0!==r&&(t-e[0])/r<0)return(t-e[0])/r;const i=e.length-1,o=e[i]-e[i-1];return 0!==o&&(t-e[i])/o>0?i+(t-e[i])/o:null}function Mi(e,t){const n=t.scales?.x??t.scales?.time,r=t.scales?.y??t.scales?.value;if(!n||!r)return[];const i=t.data||[];let o=t.xAccessor||"x",a=t.yAccessor||"y";const s="horizontal"===t.projection,l="ordinal"===t.frameType;l&&s&&([o,a]=[a,o]);const c=e=>{const t=bi(n,e);return null==t?Number.NaN:t},u=e=>{const t=bi(r,e);return null==t?Number.NaN:t},d=s?u:c,h=l?t.scales?.o?.domain().map(String)??[...new Set(i.filter(e=>null!=e[o]).map(e=>String(e[o])))].sort((e,t)=>d(e)-d(t)):[],f=new Map(h.map((e,t)=>[e,t])),p=oi(i.map(e=>[l?null==e[o]?void 0:f.get(String(e[o])):e[o],e[a]]));return p.length<2?[]:("loess"===e.method?ui(p,e.bandwidth??.3):("polynomial"===e.method?li(p,e.order??2):si(p)).points).map(([e,t])=>{if(!l)return[c(e),u(t)];const n=d(h[e]);return s?[c(t),n]:[n,u(t)]}).filter(([e,t])=>Number.isFinite(e)&&Number.isFinite(t))}function ji(e,t){const n=t.scales?.x??t.scales?.time;return n?null!=e.x?mi(n,e.x):t.xAccessor&&null!=e[t.xAccessor]?mi(n,e[t.xAccessor]):null:null}function Ai(e,t){const n=t.scales?.y??t.scales?.value;return n?null!=e.y?mi(n,e.y):t.yAccessor&&null!=e[t.yAccessor]?mi(n,e[t.yAccessor]):null:null}function Ci(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=e.xAccessor||"x",a=e.yAccessor||"y",s=n[o],l=n[a];if(null==s||null==l)return null;const c=mi(r,s),u=mi(i,l);return null==c||null==u?null:{x:c,y:u}}function Ri(e){return null==e?null:String(e)}function Li(e){return Ri(e.provenance?.stableId??e.stableId)}function Ni(e){return Ri(e.stableId??e.id??e.provenance?.stableId)}function Pi(e,t,n){return t.stickyPositionCache?.set(e,n),n}function Ii(e,t,n){const r=Li(e);if(!r)return null;const i=n.pointNodes?.find(e=>Ri(e.pointId)===r);if(i)return Pi(t,n,{x:i.x,y:i.y});const o=n.data?.find(e=>Ni(e)===r);if(!o)return null;const a=ji(o,n),s=Ai(o,n);return null==a||null==s?null:Pi(t,n,{x:a,y:s})}function Ei(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 Pi(t,n,{x:i.x,y:i.y})}const r=Ci(n);return r?Pi(t,n,r):null}if("semantic"===r){const r=Ii(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=ji(e,n),o=Ai(e,n)),null!=i&&null!=o)return Pi(t,n,{x:i,y:o});if("sticky"===r){const e=n.stickyPositionCache?.get(t);if(e)return e}return null}function Ti(e,t,n,r=50){const i=n.width||0,o=n.height||0;return e>=-r&&e<=i+r&&t>=-r&&t<=o+r}function zi(e,t=2166136261){let n=t;for(let t=0;t<e.length;t++)n^=e.charCodeAt(t),n=Math.imul(n,16777619);return n>>>0}function $i(e){const t=Number.isFinite(e)&&e>0?e:6;return{width:Math.max(8,t),height:t,lineY:t/2}}function Di(e){return{type:"hatch",background:e.background,stroke:e.stroke,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,...1!==e.lineOpacity?{lineOpacity:e.lineOpacity}:{}}}function Oi(){const e="undefined"!=typeof window&&window.devicePixelRatio||1;return Math.min(3,Math.max(1,e))}function Fi(e,t,n,r){t&&"transparent"!==t&&"none"!==t?(e.fillStyle=t,e.fillRect(0,0,n,r)):e.clearRect(0,0,n,r)}function _i(e={},t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45,lineOpacity:s=1}=e,l={background:n,stroke:r,lineWidth:i,spacing:o,angle:a,lineOpacity:s},c=$i(o),u=Oi(),d=Math.max(1,Math.round(c.width*u)),h=Math.max(1,Math.round(c.height*u));let f;try{p=d,m=h,f="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(p,m):(Rm||(Rm=document.createElement("canvas")),Rm.width=p,Rm.height=m,Rm)}catch{return Di(l)}var p,m;const g=f.getContext("2d");if(!g)return Di(l);Fi(g,n,d,h);const y=h/c.height,b=Math.max(0,i)*y;g.save(),g.globalAlpha=Math.min(1,Math.max(0,s)),g.fillStyle=r,g.fillRect(0,c.lineY*y-b/2,d,b),g.restore();const v=(t||g).createPattern(f,"repeat");if(!v)return v;const x=a*Math.PI/180,w=Math.cos(x),k=Math.sin(x),S=c.width/d,M=c.height/h;return v.setTransform?.({a:w*S,b:k*S,c:-k*M,d:w*M,e:0,f:0}),v}function Wi(e){return"object"==typeof e&&null!==e&&"hatch"===e.type}function Bi(e){return["hatch",e.background??"transparent",e.stroke??"#000",e.lineWidth??1.5,e.spacing??6,e.angle??45,e.lineOpacity??1].join("|")}function Hi(e,t){return`${e}-hatch-${zi(Bi(t)).toString(36)}`}function qi(e,t){const n=e.background??"transparent",r=e.stroke??"#000",i="transparent"===n||"none"===n?n:On(t,n)||n,o=On(t,r)||r||"#000",a="undefined"!=typeof window&&window.devicePixelRatio||1,s=`${Bi(e)}|${i}|${o}@${a}`,l=Nm.get(s);if(void 0!==l)return l;const c=_i({background:i,stroke:o,lineWidth:e.lineWidth,spacing:e.spacing,angle:e.angle,lineOpacity:e.lineOpacity},t),u=Wi(c)?null:c;return Nm.set(s,u),u}function Gi(e,t){const{background:n="transparent",stroke:r="#000",lineWidth:i=1.5,spacing:o=6,angle:a=45,lineOpacity:s=1}=e,l=$i(o);/* @__PURE__ */ /* @__PURE__ */
|
|
40
|
+
return(0,Lm.jsxs)("pattern",{id:t,width:l.width,height:l.height,patternUnits:"userSpaceOnUse",patternTransform:0!==a?`rotate(${a})`:void 0,children:[n&&"transparent"!==n&&"none"!==n&&/* @__PURE__ */ /* @__PURE__ */(0,Lm.jsx)("rect",{width:l.width,height:l.height,fill:n}),
|
|
40
41
|
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */(0,
|
|
42
|
+
/* @__PURE__ */(0,Lm.jsx)("line",{x1:0,y1:l.lineY,x2:l.width,y2:l.lineY,stroke:r,strokeWidth:i,...1!==s?{strokeOpacity:s}:{}})]},t)}function Vi(e,t,n="#4e79a7"){if(Wi(e)){const n=Hi(t,e);return{fill:`url(#${n})`,def:Gi(e,n)}}return e&&"string"==typeof e?{fill:e}:{fill:n}}function Yi(e,t,n){if(!e||"object"!=typeof e)return;const r=e;if(!Array.isArray(r.stops))return;const i=r.stops.flatMap(e=>{if(!e||"object"!=typeof e)return[];const{offset:t,color:r,opacity:i}=e;return"number"==typeof t&&Number.isFinite(t)?[{offset:Math.max(0,Math.min(1,t)),color:"string"==typeof r&&r?r:n,opacity:"number"==typeof i&&Number.isFinite(i)?Math.max(0,Math.min(1,i)):void 0}]:[]}).sort((e,t)=>e.offset-t.offset);return i.length?{direction:"horizontal"===r.direction?"horizontal":"vertical"===r.direction?"vertical":t,stops:i}:void 0}function Ui(e,t,n,r){const i=Yi(e,n,r);if(!i)return;const{direction:o,stops:a}=i,s=`${t}-gradient`;return{fill:`url(#${s})`,def:/* @__PURE__ */ /* @__PURE__ */(0,Lm.jsx)("linearGradient",{id:s,x1:0,y1:0,x2:"horizontal"===o?"100%":0,y2:"vertical"===o?"100%":0,children:a.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,Lm.jsx)("stop",{offset:100*e.offset+"%",stopColor:e.color,stopOpacity:e.opacity},`${e.offset}-${t}`))},s)}}function Xi(e,t,n,r){const i=Vi(e.fill??e.color,t,r),o="string"==typeof e.fill&&e.fill?e.fill:"string"==typeof e.color&&e.color?e.color:r;return Ui(e.gradient,t,n,o)??i}function Zi(e,t,n){const r=e.position,i="string"==typeof r&&Pm.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 Ki(e,t,n,r){return{...Zi(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 Qi({annotation:e,width:t,height:n,defaults:r=Em}){const i=e.label??e.text;return null==i?null:/* @__PURE__ */ /* @__PURE__ */(0,Im.jsx)("text",{...Ki(e,t,n,r),children:i})}function Ji(e){return!0===e?._annotationDeferred}function eo(e){return"blended"===e?.cohesion||"layer"===e?.cohesion?e.cohesion:null}function to(e){const t=e?.provenance?.confidence;return"number"==typeof t&&Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}function no(e){return Math.max(.72,.95-.06*e)}function ro(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:to(e.annotation),readingOrder:null,rank:1};var n}),n=t.some(e=>null!=e.emphasis||null!=e.confidence),r=e.some(e=>Ji(e.annotation)),i=e.some(e=>null!=eo(e.annotation)),o=e.some(e=>"layer"===eo(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=zm[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=Ji(t.annotation);let a=t.node;if("primary"===r||"secondary"===r||null!=i){const e=null==r&&null!=i,o=e?"annotation-emphasis annotation-emphasis--inferred":`annotation-emphasis annotation-emphasis--${r}`;a=/* @__PURE__ */ /* @__PURE__ */(0,Tm.jsx)("g",{className:o,..."secondary"===r?{opacity:.6,fontSize:"0.88em"}:{},...e?{opacity:no(i),"data-annotation-reading-order":i}:{},children:t.node},`annotation-emphasis-${n}`)}const s=eo(t.annotation);return s&&(a=/* @__PURE__ */ /* @__PURE__ */(0,Tm.jsx)("g",{className:`annotation-cohesion--${s}`,children:a},`annotation-cohesion-${n}`)),o&&(a=/* @__PURE__ */ /* @__PURE__ */(0,Tm.jsx)("g",{className:"annotation-deferred","data-annotation-disclosure":"deferred",children:a},`annotation-deferred-${n}`)),a});return r&&s.unshift(
|
|
42
43
|
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */(0,
|
|
44
|
+
/* @__PURE__ */(0,Tm.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(
|
|
44
45
|
/* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */(0,
|
|
46
|
-
return(0
|
|
47
|
-
return(0
|
|
46
|
+
/* @__PURE__ */(0,Tm.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 io(e,t,n,r){return oo(e,t,n,r).nodes}function oo(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:ro(i),renderedAnnotations:i.map(e=>e.annotation)}}function ao(e,t){const n=bi(e,t);return null!=n&&Number.isFinite(n)?n:Number.NaN}function so(e,t={},n=!1){return function(e,r,i){switch(e.type){case"label":case"callout":case"callout-circle":case"callout-rect":{const t=Ei(e,r,i);if(!t)return null;const{x:n,y:o}=t;if(!Ti(n,o,i))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__ */
|
|
47
|
+
return(0,$m.jsx)(ri,{noteData:{x:n,y:o,dx:e.dx??30,dy:e.dy??-30,note:Xr(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-${r}`)}case"x-threshold":case"y-threshold":{const t="x-threshold"===e.type,n=null!=e.value?{...e,[t?"x":"y"]:e.value}:e,o=t?ji(n,i):Ai(n,i);return null==o?null:/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)(Ur,{ann:e,position:o,vertical:t,width:i.width||0,height:i.height||0,color:e.color||"#f97316",bold:!0},`ann-${r}`)}case"enclose":{const t=(e.coordinates||[]).map(e=>({x:ji({...e,type:"point"},i),y:Ai({...e,type:"point"},i),r:1})).filter(e=>null!=e.x&&null!=e.y);if(t.length<2)return null;const n=(0,wm.packEnclose)(t),o=e.padding??10;/* @__PURE__ */ /* @__PURE__ */
|
|
48
|
+
return(0,$m.jsxs)("g",{children:[
|
|
48
49
|
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */(0
|
|
50
|
-
return(0
|
|
50
|
+
/* @__PURE__ */(0,$m.jsx)("circle",{cx:n.x,cy:n.y,r:n.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,$m.jsx)(Gr,{x:n.x,y:n.y-n.r-o-4,textAnchor:"middle",fill:e.color||"var(--semiotic-text-secondary, #666)",fontSize:12,text:e.label,background:e.labelBackground??"none"})]},`ann-${r}`)}case"rect-enclose":{const t=(e.coordinates||[]).map(e=>({x:ji({...e,type:"point"},i),y:Ai({...e,type:"point"},i)})).filter(e=>null!=e.x&&null!=e.y);if(t.length<2)return null;const n=e.padding??10,o=t.map(e=>e.x),a=t.map(e=>e.y),[s,l]=ln(o),[c,u]=ln(a),d=s-n,h=l+n,f=c-n,p=u+n;/* @__PURE__ */ /* @__PURE__ */
|
|
51
|
+
return(0,$m.jsxs)("g",{children:[
|
|
51
52
|
/* @__PURE__ */
|
|
52
|
-
/* @__PURE__ */(0
|
|
53
|
-
return(0
|
|
54
|
-
return(0
|
|
55
|
-
return(0
|
|
56
|
-
return(0,dm.jsxs)("g",{children:[
|
|
53
|
+
/* @__PURE__ */(0,$m.jsx)("rect",{x:d,y:f,width:h-d,height:p-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,$m.jsx)(Gr,{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-${r}`)}case"highlight":{const t=i.data||[],n="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__ */
|
|
54
|
+
return(0,$m.jsx)("g",{children:n.map((t,n)=>{const r=ji(t,i),a=Ai(t,i);if(null==r||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__ */
|
|
55
|
+
return(0,$m.jsx)("circle",{cx:r,cy:a,r:s,...l},`hl-${n}`)})},`ann-${r}`)}case"bracket":{const t=ji(e,i),n=Ai(e,i);return null==t||null==n?null:/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)(ri,{noteData:{x:t,y:n,dx:e.dx||0,dy:e.dy||0,note:Xr(e),type:"bracket",subject:{type:e.bracketType||"curly",width:e.width,height:e.height,depth:e.depth??30},color:e.color}},`ann-${r}`)}case"trend":{const t=Mi(e,i);if(t.length<2)return null;const n=t.map(([e,t])=>`${e},${t}`).join(" "),o=e.color||"#6366f1",[a,s]=t[t.length-1];/* @__PURE__ */ /* @__PURE__ */
|
|
56
|
+
return(0,$m.jsxs)("g",{children:[
|
|
57
57
|
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */(0
|
|
59
|
-
return(0
|
|
60
|
-
return(0
|
|
61
|
-
return(0
|
|
58
|
+
/* @__PURE__ */(0,$m.jsx)("polyline",{points:n,fill:"none",stroke:o,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray||"6,3"}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("text",{x:a+4,y:s-4,fill:o,fontSize:11,children:e.label})]},`ann-${r}`)}case"band":{const t=i.scales?.y??i.scales?.value,o=gi(t,e.y0,0),a=gi(t,e.y1,1);if(t&&(null!=e.y0&&null==o||null!=e.y1&&null==a))return null;const s=o??0,l=a??(i.height||0),c=Xi(e,`ann-${r}`,"vertical","var(--semiotic-primary, #6366f1)"),u=n&&"under"===e.layer;/* @__PURE__ */ /* @__PURE__ */
|
|
59
|
+
return(0,$m.jsxs)("g",{opacity:e.opacity,children:[!u&&c.def&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("defs",{children:c.def}),!u&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("rect",{x:0,y:Math.min(s,l),width:i.width||0,height:Math.abs(l-s),fill:c.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)(Gr,{x:(i.width||0)-4,y:Yr(s,l),textAnchor:"end",fill:e.labelColor??(e.color||"var(--semiotic-primary, #6366f1)"),fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},`ann-${r}`)}case"x-band":{const t=i.scales?.x??i.scales?.time,o=gi(t,e.x0,0),a=gi(t,e.x1,1);if(null!=e.x0&&null==o||null!=e.x1&&null==a)return null;const s=o??0,l=a??(i.width||0),c=Xi(e,`ann-${r}`,"horizontal","var(--semiotic-primary, #6366f1)"),u=n&&"under"===e.layer;/* @__PURE__ */ /* @__PURE__ */
|
|
60
|
+
return(0,$m.jsxs)("g",{opacity:e.opacity,children:[!u&&c.def&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("defs",{children:c.def}),!u&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("rect",{x:Math.min(s,l),y:0,width:Math.abs(l-s),height:i.height||0,fill:c.fill,fillOpacity:e.fillOpacity??.1}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)(Gr,{x:Math.min(s,l)+4,y:16,textAnchor:"start",fill:e.labelColor??(e.color||"var(--semiotic-primary, #6366f1)"),fontSize:11,fontWeight:"bold",text:e.label,background:e.labelBackground??"halo"})]},`ann-${r}`)}case"envelope":{const t=i.data||[];if(t.length<2)return null;const n=i.xAccessor||"x",o=i.scales?.x??i.scales?.time,a=i.scales?.y??i.scales?.value;if(!o||!a)return null;const s=e=>ao(o,e),l=e=>ao(a,e),c=e.upperAccessor||"upperBounds",u=e.lowerAccessor||"lowerBounds",d=e.filter,h=t.filter(e=>null!=e[c]&&null!=e[u]&&!(d&&!d(e))).sort((e,t)=>e[n]-t[n]);if(h.length<2)return null;const f=Dm[i.curve||"linear"]||km.curveLinear,p=(0,km.area)().x(e=>s(e[n])).y0(e=>l(e[u])).y1(e=>l(e[c])).curve(f)(h);if(!p)return null;const m=e.fill||"#6366f1";/* @__PURE__ */ /* @__PURE__ */
|
|
61
|
+
return(0,$m.jsxs)("g",{children:[
|
|
62
62
|
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */(0
|
|
64
|
-
return(0
|
|
65
|
-
return(0
|
|
63
|
+
/* @__PURE__ */(0,$m.jsx)("path",{d:p,fill:m,fillOpacity:e.fillOpacity??.15,stroke:"none"}),e.label&&h.length>0&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("text",{x:s(h[h.length-1][n])+4,y:l(h[h.length-1][c])-4,fill:m,fontSize:11,children:e.label})]},`ann-${r}`)}case"anomaly-band":{const t=(i.data||[]).filter(t=>!e.filter||e.filter(t));if(t.length<2)return null;const n=i.yAccessor||"y",o=i.scales?.x??i.scales?.time,a=i.scales?.y??i.scales?.value;if(!o||!a)return null;const s=e=>ao(a,e),l=t.map(e=>ii(e[n])).filter(e=>null!==e);if(l.length<2)return null;const c=l.reduce((e,t)=>e+t,0)/l.length,u=l.reduce((e,t)=>e+(t-c)**2,0)/l.length,d=Math.sqrt(u),h=e.threshold??2,f=c+h*d,p=c-h*d,m=!1!==e.showBand,g=e.fill||"#6366f1",y=e.fillOpacity??.1,b=e.anomalyColor||"#ef4444",v=e.anomalyRadius??6,x=s(f),w=s(p),k=t.filter(e=>{const t=ii(e[n]);return null!=t&&Math.abs(t-c)>h*d});/* @__PURE__ */ /* @__PURE__ */
|
|
64
|
+
return(0,$m.jsxs)("g",{children:[m&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("rect",{x:0,y:Math.min(x,w),width:i.width||0,height:Math.abs(w-x),fill:g,fillOpacity:y}),k.map((e,t)=>{const n=ji(e,i),r=Ai(e,i);return null==n||null==r?null:/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("circle",{cx:n,cy:r,r:v,fill:b,fillOpacity:.7,stroke:b,strokeWidth:1.5},`anomaly-${t}`)}),e.label&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("text",{x:(i.width||0)-4,y:Math.min(x,w)-4,textAnchor:"end",fill:g,fontSize:11,children:e.label})]},`ann-${r}`)}case"forecast":{const t=i.data||[],n=i.xAccessor||"x",o=i.yAccessor||"y",a=i.scales?.x??i.scales?.time,s=i.scales?.y??i.scales?.value;if(!a||!s)return null;const l=e=>ao(a,e),c=e=>ao(s,e),u=oi(t.map(e=>[e[n],e[o]])),d=hi(u,e);if(!d)return null;const{predict:h}=d,f=u[u.length-1][0],p=d.forecast(e.steps??5);if(!p.length)return null;const m=(0,km.area)().x(e=>l(e.x)).y0(e=>c(e.lower)).y1(e=>c(e.upper))(p);if(!m)return null;const g=p.map(e=>`${l(e.x)},${c(e.y)}`).join(" "),y=`${l(f)},${c(h(f))}`,b=e.fill||"#6366f1",v=e.strokeColor||"#6366f1";/* @__PURE__ */ /* @__PURE__ */
|
|
65
|
+
return(0,$m.jsxs)("g",{children:[
|
|
66
66
|
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */(0
|
|
67
|
+
/* @__PURE__ */(0,$m.jsx)("path",{d:m,fill:b,fillOpacity:e.fillOpacity??.15,stroke:"none"}),
|
|
68
68
|
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */(0
|
|
70
|
-
return(0
|
|
69
|
+
/* @__PURE__ */(0,$m.jsx)("polyline",{points:`${y} ${g}`,fill:"none",stroke:v,strokeWidth:e.strokeWidth??2,strokeDasharray:e.strokeDasharray??"6,3"}),e.label&&p.length>0&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("text",{x:l(p[p.length-1].x)+4,y:c(p[p.length-1].y)-4,fill:v,fontSize:11,children:e.label})]},`ann-${r}`)}case"widget":{let n,o;if(null!=e.px&&null!=e.py)n=e.px,o=e.py;else{const t=Ei(e,r,i);if(!t)return null;n=t.x,o=t.y}if(!Ti(n,o,i))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,$m.jsx)("span",{style:{fontSize:18,cursor:"default"},title:e.label||"Info",children:"ℹ️"});/* @__PURE__ */ /* @__PURE__ */
|
|
70
|
+
return(0,$m.jsx)("foreignObject",{x:n+a-l/2,y:o+s-c/2,width:l,height:c,style:{overflow:"visible",pointerEvents:"auto"},children:/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("div",{..._r(e,t),style:{width:l,height:c,display:"flex",alignItems:"center",justifyContent:"center"},children:u})},`ann-${r}`)}case"text":{const t=Ei(e,r,i);if(!t)return null;const{x:n,y:o}=t,a=n+(e.dx||0),s=o+(e.dy||0),l=e.color||"var(--semiotic-text, #333)",c=/* @__PURE__ */ /* @__PURE__ */(0,$m.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?vm.cloneElement(c,{key:`ann-text-${r}`}):/* @__PURE__ */ /* @__PURE__ */(0,$m.jsxs)("g",{opacity:e.opacity,strokeDasharray:e.strokeDasharray,children:[
|
|
71
71
|
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */(0
|
|
73
|
-
return(0
|
|
72
|
+
/* @__PURE__ */(0,$m.jsx)("line",{x1:n,y1:o,x2:a,y2:s,stroke:l,strokeWidth:1,strokeOpacity:.5,style:{pointerEvents:"none"}}),vm.cloneElement(c,{opacity:void 0,strokeDasharray:void 0})]},`ann-text-${r}`)}case"frame-text":/* @__PURE__ */ /* @__PURE__ */
|
|
73
|
+
return(0,$m.jsx)(Qi,{annotation:e,width:i.width||0,height:i.height||0},`ann-frame-text-${r}`);case"category-highlight":{const t=e.category;if(null==t)return null;const n=e=>"function"==typeof e&&"function"==typeof e.bandwidth,o=i.scales?.o,a=i.scales?.x,s=i.scales?.y,l=n(o)?o:n(a)?a:n(s)?s:null;if(!l)return null;const c=l(String(t));if(null==c)return null;const u=l.bandwidth(),d=i.projection?"vertical"===i.projection:l===a,h=e.color||"var(--semiotic-primary, #4589ff)",f=e.opacity??.15,p=e.label;return d?/* @__PURE__ */ /* @__PURE__ */(0,$m.jsxs)("g",{children:[
|
|
74
74
|
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */(0
|
|
75
|
+
/* @__PURE__ */(0,$m.jsx)("rect",{x:c,y:0,width:u,height:i.height||0,fill:h,fillOpacity:f}),p&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)(Gr,{x:c+u/2,y:16,textAnchor:"middle",fill:h,fontSize:12,fontWeight:"bold",text:p,background:e.labelBackground??"none"})]},`ann-${r}`):/* @__PURE__ */ /* @__PURE__ */(0,$m.jsxs)("g",{children:[
|
|
76
76
|
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */(0
|
|
78
|
-
return(0,
|
|
79
|
-
return(0,
|
|
80
|
-
return(0,
|
|
77
|
+
/* @__PURE__ */(0,$m.jsx)("rect",{x:0,y:c,width:i.width||0,height:u,fill:h,fillOpacity:f}),p&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)(Gr,{x:12,y:c+u/2,dominantBaseline:"middle",fill:h,fontSize:12,fontWeight:"bold",text:p,background:e.labelBackground??"none"})]},`ann-${r}`)}default:return null}}}function lo(e){return"string"==typeof e?.type?e.type:""}function co(e){return!!e&&"object"==typeof e&&Om.has(lo(e))}function uo(e,t,n){return Math.max(t,Math.min(n,e))}function ho(e){return"primary"===e?.emphasis||!0===e?.defensive}function fo(e,t,n={}){if("number"==typeof n.maxAnnotations&&Number.isFinite(n.maxAnnotations))return Math.max(0,Math.floor(n.maxAnnotations));if(!(e>0&&t>0))return 1/0;const r=n.areaPerAnnotation&&n.areaPerAnnotation>0?n.areaPerAnnotation:2e4;return Math.max(1,Math.round(e*t/r))}function po(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*uo(r,0,1)),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 mo(e){const{annotations:t,width:n,height:r}=e,i=Math.max(0,e.minVisible??1),o=fo(n,r,e),a=t.map((e,t)=>{return{annotation:e,index:t,note:(n=e,co(n))};var n}),s=a.filter(e=>e.note);if(0===s.length||s.length<=o)return{visible:t.slice(),deferred:[],budget:o};const l=s.filter(e=>ho(e.annotation)),c=s.filter(e=>!ho(e.annotation)).sort((e,t)=>po(t.annotation)-po(e.annotation)||e.index-t.index),u=Math.max(0,o-l.length),d=Math.max(0,i-l.length),h=Math.min(c.length,Math.max(u,d)),f=/* @__PURE__ */new Set([...l.map(e=>e.index),...c.slice(0,h).map(e=>e.index)]),p=[],m=[];for(const{annotation:e,index:t,note:n}of a)!n||f.has(t)?p.push(e):m.push(e);return{visible:p,deferred:m,budget:o}}function go(e){return"text"===e.type||"widget"===e.type?{dx:0,dy:0}:{dx:30,dy:-30}}function yo(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 bo(e){if(!e)return 1;const t=yo(e);return t<=2?1.5:t>=4?.6:1}function vo(e){const t=e?.provenance;if(!t||"object"!=typeof t)return e;const n="string"==typeof t.source?Object.prototype.hasOwnProperty.call(qm,t.source)?qm[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 xo(e,t){let n=!1;const r=e.map(e=>So(e)?"blended"===e.cohesion||"layer"===e.cohesion?e:(n=!0,{...e,cohesion:t}):e);return n?r:e}function wo(e){if(!So(e))return e;const t="string"==typeof e.mobileText?e.mobileText:void 0,n="string"==typeof e.shortText?e.shortText:void 0,r=t??n;return!r||"string"!=typeof e.label&&null!=e.label?e:{...e,label:r}}function ko(e){if("text"!==e.type||"string"!=typeof e.color)return e;const t="number"==typeof e.dx?e.dx:0,n="number"==typeof e.dy?e.dy:0;return Math.hypot(t,n)<8?e:{...e,_redundantConnector:!0}}function So(e){return co(e)}function Mo(e){if("widget"===e.type)return{width:"number"==typeof e.width?e.width:32,height:"number"==typeof e.height?e.height:32};const t=Zr(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=[...Kr("string"==typeof e.title?e.title:void 0,n,7),...Kr("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 jo(e,t,n,r,i){const o=e+n,a=t+r;return Math.abs(n)>Math.abs(r)?{x:n>=0?o+4:o-i.width-4,y:r<0?a-i.height:a,width:i.width,height:i.height}:{x:n>=0?o:o-i.width,y:r<0?a-i.height-4:a+4,width:i.width,height:i.height}}function Ao(e,t){return{x:e.x-t,y:e.y-t,width:e.width+2*t,height:e.height+2*t}}function Co(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 Ro(e,t,n,r){const i=Math.max(0,r-e.x),o=Math.max(0,r-e.y),a=Math.max(0,e.x+e.width-(t-r)),s=Math.max(0,e.y+e.height-(n-r));return(i+a)*e.height+(o+s)*e.width}function Lo(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 No(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 Po(e,t,n,r,i,o,a,s){const l=Ao(e,a);let c=.4*Math.hypot(t.dx,t.dy)+80*Ro(l,i,o,s);for(const e of n)c+=12*Co(l,e);for(const e of r)c+=4*Co(l,e);return c}function Io(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?Ei(e,t,n):{x:e.x,y:e.y}}function Eo(e){const{annotations:t,context:n,defaultOffset:r=Fm,notePadding:i=_m,markPadding:o=Wm,edgePadding:a=Bm,preserveManualOffsets:s=!0,routeLongConnectors:l=!0,connectorThreshold:c=Hm,density:u,progressiveDisclosure:d=!1,redundantCues:h=!1,responsive:f,mobile:p,cohesion:m,audience:g}=e,y=n.width||0,b=n.height||0,v="object"==typeof p?p:{},x=v.breakpoint??480,w=!!p&&y<=x,k=w&&!1!==v.preferShortText?t.map(wo):t,S=w&&!u?{maxAnnotations:v.maxAnnotations??("callout-list"===v.strategy?1:2),minVisible:v.minVisible??1}:u,M=d||w&&(!1!==v.progressiveDisclosure||"callout-list"===v.strategy),j=w&&!f?v.responsive??{minWidth:x}:f,A=w&&!m?v.cohesion:m;if(0===k.length||y<=0||b<=0)return k.slice();const C=[],R=No(n,o);let L=!1;const N=k.map((e,t)=>{if(!So(e))return e;const o=Io(e,t,n);if(!o)return e;const u=Mo(!0===e.defensive?vo(e):e);if(s&&("number"==typeof(d=e).dx||"number"==typeof d.dy)){const t=go(e),n="number"==typeof e.dx?e.dx:t.dx,r="number"==typeof e.dy?e.dy:t.dy;return C.push(Ao(jo(o.x,o.y,n,r,u),i)),e}var d;let h=null,f=1/0;for(const e of Lo(r)){const t=Po(jo(o.x,o.y,e.dx,e.dy,u),e,C,R,y,b,i,a);t<f&&(h=e,f=t)}if(!h)return e;const p=Ao(jo(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}:{}}}),P=L?N:k.slice();let I=P;if(h){let e=!1;const t=P.map(t=>{const n=ko(t);return n!==t&&(e=!0),n});I=e?t:P}{let e=!1;const t=I.map(t=>{if(!0!==t?.defensive)return t;const n=vo(t);return n!==t&&(e=!0),n});I=e?t:I}const E=/* @__PURE__ */new Set;if(S){const e="object"==typeof S?S:{},t=bo(g),n=1===t?e:{...e,maxAnnotations:Math.max(0,Math.round((e.maxAnnotations??fo(y,b,e))*t))},{deferred:r}=mo({annotations:I,width:y,height:b,...n});for(const e of r)E.add(e)}if(j){const e="object"==typeof j&&"number"==typeof j.minWidth?j.minWidth:480;if(y<=e)for(const e of I)So(e)&&"secondary"===e.emphasis&&E.add(e)}if(E.size>0)for(const e of I)!0===e?.defensive&&E.delete(e);let T;return T=0===E.size?I:M?I.map(e=>E.has(e)?{...e,_annotationDeferred:!0}:e):I.filter(e=>!E.has(e)),A?xo(T,A):T}function To(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 zo(e,t){const{key:n,currentTarget:r}=e,i=t?"ArrowRight":"ArrowDown";if(n!==(t?"ArrowLeft":"ArrowUp")&&n!==i&&"Home"!==n&&"End"!==n)return;e.preventDefault();const o=Array.from(r.closest("[role='listbox']")?.querySelectorAll("[role='option']")??[]),a="Home"===n?0:"End"===n?o.length-1:(o.indexOf(r)+(n===i?1:-1)+o.length)%o.length;o[a]?.focus()}function $o({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||Hn(c),p=`grad-legend-${Um.useId()}`,m=!(!r&&!i),g="isolate"===s||void 0===s&&null!=a,[y,b]=Um.useState(0),[v,x]=Um.useState(null),w=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}`}},k=(e,t,n)=>{const s="string"==typeof e.interactionKey?e.interactionKey:e.label,l=a?.has(s)??!1,c=o===s,u=v===n,d=a?.size&&!l||null!=o&&!c;/* @__PURE__ */ /* @__PURE__ */
|
|
78
|
+
return(0,Xm.jsx)("rect",{className:"semiotic-gradient-legend-bin",...t,fill:d?"rgba(255,255,255,0.65)":"transparent",stroke:u||l||c?"var(--semiotic-focus, #005fcc)":"transparent",strokeWidth:u?3:2,tabIndex:n===y?0:-1,role:"option","aria-label":e.label,"aria-selected":g?l:void 0,"aria-current":!(g||!c)||void 0,onClick:r?()=>r(e):void 0,onMouseEnter:i?()=>i(e):void 0,onMouseLeave:i?()=>i(null):void 0,onFocus:()=>{b(n),x(n),i?.(e)},onBlur:()=>{x(null),i?.(null)},onKeyDown:t=>{if(("Enter"===t.key||" "===t.key)&&r)return t.preventDefault(),void r(e);zo(t,h)},style:{cursor:"pointer",pointerEvents:"all"}},`gradient-interaction-${n}`)},[S,M]=c,j=Um.useMemo(()=>Array.from({length:65},(e,t)=>{const n=t/64,r=h?S+n*(M-S):M-n*(M-S);/* @__PURE__ */ /* @__PURE__ */
|
|
79
|
+
return(0,Xm.jsx)("stop",{offset:n,stopColor:l(r)},t)}),[l,S,M,h]),A=h?Math.min(n,200):14,C=h?12:100,R=h?Math.max(0,(n-A)/2):0,L=u?18:0;/* @__PURE__ */ /* @__PURE__ */
|
|
80
|
+
return(0,Xm.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:Vm,children:[
|
|
81
81
|
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */(0,
|
|
82
|
+
/* @__PURE__ */(0,Xm.jsx)("defs",{children:/* @__PURE__ */ /* @__PURE__ */(0,Xm.jsx)("linearGradient",{id:p,x1:"0%",y1:"0%",x2:h?"100%":"0%",y2:h?"0%":"100%",children:j})}),u&&/* @__PURE__ */ /* @__PURE__ */(0,Xm.jsx)("text",{x:h?R+A/2:0,y:12,textAnchor:h?"middle":"start",fontSize:11,fill:"var(--semiotic-text, #333)",children:u}),
|
|
83
83
|
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */(0,
|
|
85
|
-
return(0,
|
|
86
|
-
return(0,
|
|
84
|
+
/* @__PURE__ */(0,Xm.jsx)("rect",{x:R,y:L,width:A,height:C,fill:`url(#${p})`,rx:2}),m&&Array.from({length:5},(e,t)=>k(w(t),{x:h?R+t*A/5:0,y:h?L:L+t*C/5,width:h?A/5:A,height:h?C:C/5},t)),[0,1].map(e=>/* @__PURE__ */ /* @__PURE__ */(0,Xm.jsx)("text",{x:h?R+e*A:A+5,y:L+(h?C+12:e?C: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 Do(e,t,n,r,i){if("function"==typeof n)return n(e);const o=r(e,t);return"fill"===n?/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)("rect",{style:o,width:i,height:i}):/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)("line",{style:o,x1:0,y1:0,x2:i,y2:i})}function Oo({swatchSize:e}){/* @__PURE__ */ /* @__PURE__ */
|
|
85
|
+
return(0,Zm.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 Fo(e,t,n){return n&&n.size>0?n.has(e.label)?1:.3:null!=t?e.label===t?1:.3:1}function _o(e,t,n,r,i,o=Number.POSITIVE_INFINITY){const{legendGroup:{type:a="fill",styleFn:s},customClickBehavior:l,customHoverBehavior:c,highlightedCategory:u,isolatedCategories:d,focusedGroupIndex:h,focusedItemIndex:f,groupIndex:p,onFocusedIndexChange:m,interactive:g,useIsolateAria:y,metrics:{swatchSize:b,labelGap:v}}=e,x=!!d?.size&&d.has(t.label),w=Zn(t.label),k=Kn(w,o);/* @__PURE__ */ /* @__PURE__ */
|
|
86
|
+
return(0,Zm.jsxs)("g",{transform:r,onClick:l?()=>l(t):void 0,onMouseEnter:c?()=>c(t):void 0,onMouseLeave:c?()=>c(null):void 0,tabIndex:g?p===h&&n===f?0:-1:void 0,role:g?"option":void 0,"aria-selected":g&&y?x:void 0,"aria-label":w,onKeyDown:g?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),l?.(t)),zo(e,i)}:void 0,onFocus:g?e=>{m(p,n),c?.(t),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","visible")}:void 0,onBlur:g?e=>{c?.(null),e.currentTarget.querySelector(".semiotic-legend-focus-ring")?.setAttribute("visibility","hidden")}:void 0,style:{cursor:g?"pointer":"default",opacity:Fo(t,u,d),transition:"opacity 150ms ease",pointerEvents:"all",outline:"none"},children:[g&&/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)("rect",{className:"semiotic-legend-focus-ring",x:-2,y:-2,width:b+v+2+Xn(k),height:b+4,fill:"none",stroke:"var(--semiotic-focus, #005fcc)",strokeWidth:2,rx:3,visibility:"hidden"}),k!==w&&/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)("title",{children:w}),Do(t,n,a,s,b),x&&/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)(Oo,{swatchSize:b}),
|
|
87
87
|
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */(0,
|
|
89
|
-
return(0,
|
|
90
|
-
return(0,Nm.jsx)("g",{transform:`translate(${h}, ${f})`,children:Vn(t)?/* @__PURE__ */ /* @__PURE__ */(0,Nm.jsx)(wo,{config:t.gradient,orientation:m?"horizontal":"vertical",width:p,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):Gn(t)?/* @__PURE__ */ /* @__PURE__ */(0,Nm.jsx)(Ao,{legendGroups:t.legendGroups,title:"",width:p,orientation:m?"horizontal":"vertical",legendLayout:a,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}function Co({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?/* @__PURE__ */ /* @__PURE__ */(0,Pm.jsx)("foreignObject",{x:0,y:0,width:t,height:n,children:e}):/* @__PURE__ */ /* @__PURE__ */(0,Pm.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 Lo(e,t){return"string"==typeof e&&e.length>0?e:t}function No(e,t,n){return"string"==typeof t&&t.length>0?t:"string"==typeof e&&e.length>0?`${e} (${n.familyPhrase})`:n.fallback}function Po(e){const t=String(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 Eo(e){const{width:t,height:n,totalWidth:r,totalHeight:i,margin:o,showAxes:a,title:s,description:l,idPrefix:c,decorative:u=!1,legend:d,legendHoverBehavior:h,legendClickBehavior:f,legendHighlightedCategory:p,legendIsolatedCategories:m,legendPosition:g,legendLayout:y,foregroundGraphics:b,annotations:v,onAnnotationActivate:x,onObservation:w,chartId:k,chartType:S,autoPlaceAnnotations:M,svgAnnotationRules:j,pointNodes:A,geoProjection:R}=e,C=Sr({onAnnotationActivate:x,onObservation:w,chartId:k,chartType:S}),L=(0,Wp.useRef)([v?.length??0,/* @__PURE__ */new Map]),N=v?.length??0;L.current[0]!==N&&(L.current=[N,/* @__PURE__ */new Map]);const P=(0,Wp.useMemo)(()=>{if(!v||0===v.length)return null;const e=vo(v),r=R?e.map(e=>{if(!Array.isArray(e.coordinates)||e.coordinates.length<2)return e;const t=R(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:A,stickyPositionCache:L.current[1]};return Hi(M?bo({annotations:r,context:i,..."object"==typeof M?M:{}}):r,Vi(0,C),j,i)},[v,M,j,t,n,A,C,R]),E=a||s||l||d||b||P&&P.length>0,I=(0,Wp.useId)(),{titleId:T,descId:z,labelledBy:D}=Po(c||k||I);return E?/* @__PURE__ */ /* @__PURE__ */(0,Em.jsxs)("svg",{"data-semiotic-overlay":"",role:u?"presentation":"img","aria-labelledby":u?void 0:D,width:r,height:i,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[!u&&/* @__PURE__ */ /* @__PURE__ */(0,Em.jsxs)(Em.Fragment,{children:[
|
|
88
|
+
/* @__PURE__ */(0,Zm.jsx)("text",{y:b/2,x:b+v,dominantBaseline:"central",fontSize:12,style:Ym,fill:"var(--semiotic-text, #333)",children:k})]},`legend-item-${n}`)}function Wo(e,t,n,r){const{items:i}=e.legendGroup;/* @__PURE__ */ /* @__PURE__ */
|
|
89
|
+
return(0,Zm.jsxs)("text",{className:"semiotic-legend-more",transform:`translate(${t},${n})`,y:e.metrics.swatchSize/2,dominantBaseline:"central",fontSize:12,style:Ym,fill:"var(--semiotic-text-secondary, #666)",children:[
|
|
91
90
|
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */(0,
|
|
91
|
+
/* @__PURE__ */(0,Zm.jsx)("title",{children:Jn(i,r)}),Qn(i.length-r)]},"legend-more")}function Bo(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,maxHeight:h}=e,f=Yn(d),[p,m]=Gm.useState({group:0,item:0}),g=Gm.useRef(null),y=Gm.useRef(null),b=t||[],v=b[p.group]?.items.length?p.group:b.findIndex(e=>e.items.length>0),x=Math.min(p.item,(b[v]?.items.length??1)-1);Gm.useEffect(()=>{const e=y.current;e&&!e.isConnected&&document.activeElement===document.body&&g.current?.querySelector("[tabindex='0']")?.focus()});const w=Gm.useCallback((e,t)=>{m({group:e,item:t})},[]),k=Boolean(n||r),S={customClickBehavior:n,customHoverBehavior:r,highlightedCategory:i,isolatedCategories:o,focusedGroupIndex:v,focusedItemIndex:x,onFocusedIndexChange:w,interactive:k,useIsolateAria:"isolate"===a||void 0===a&&null!=o,metrics:f},M="vertical"===u?Jm(b,l,S,d,h):eg(b,l,c,S,h);/* @__PURE__ */ /* @__PURE__ */
|
|
92
|
+
return(0,Zm.jsxs)("g",{ref:g,onFocusCapture:e=>{e.target instanceof SVGElement&&"option"===e.target.getAttribute("role")&&(y.current=e.target)},onBlurCapture:e=>{e.currentTarget.contains(e.relatedTarget)||(y.current=null)},role:k?"listbox":void 0,"aria-multiselectable":!(!k||!S.useIsolateAria)||void 0,"aria-label":"string"==typeof s&&s?s:"Chart legend","aria-orientation":k?"vertical"===u?"vertical":"horizontal":void 0,style:Vm,children:[void 0!==s&&""!==s&&"vertical"===u&&/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)("text",{className:"legend-title","aria-hidden":k||void 0,y:16,x:l/2,textAnchor:"middle",fontSize:12,style:Ym,fill:"var(--semiotic-text, #333)",children:s}),M]})}function Ho(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 h={totalWidth:n,totalHeight:r,margin:i,position:o,legendLayout:a,axisChrome:e.axisChrome,hasTitle:Boolean(e.title)},{x:f,y:p,width:m}=mr(t,h),g="top"===o||"bottom"===o;/* @__PURE__ */ /* @__PURE__ */
|
|
93
|
+
return(0,tg.jsx)("g",{transform:`translate(${f}, ${p})`,children:Vn(t)?/* @__PURE__ */ /* @__PURE__ */(0,tg.jsx)($o,{config:t.gradient,orientation:g?"horizontal":"vertical",width:m,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):Gn(t)?/* @__PURE__ */ /* @__PURE__ */(0,tg.jsx)(Bo,{legendGroups:t.legendGroups,title:"",width:m,orientation:g?"horizontal":"vertical",legendLayout:a,maxHeight:or(t,h).maxHeight,customHoverBehavior:s,customClickBehavior:l,highlightedCategory:c,isolatedCategories:u,legendInteraction:d}):t})}function qo({title:e,totalWidth:t,marginTop:n}){return e?"string"!=typeof e?/* @__PURE__ */ /* @__PURE__ */(0,ng.jsx)("foreignObject",{x:0,y:0,width:t,height:n,children:e}):/* @__PURE__ */ /* @__PURE__ */(0,ng.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 Go(e,t){return"string"==typeof e&&e.length>0?e:t}function Vo(e,t,n){return"string"==typeof t&&t.length>0?t:"string"==typeof e&&e.length>0?`${e} (${n.familyPhrase})`:n.fallback}function Yo(e){const t=String(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 Uo(e){const{width:t,height:n,totalWidth:r,totalHeight:i,margin:o,showAxes:a,title:s,description:l,idPrefix:c,decorative:u=!1,legend:d,legendHoverBehavior:h,legendClickBehavior:f,legendHighlightedCategory:p,legendIsolatedCategories:m,legendPosition:g,legendLayout:y,foregroundGraphics:b,annotations:v,onAnnotationActivate:x,onObservation:w,chartId:k,chartType:S,autoPlaceAnnotations:M,svgAnnotationRules:j,pointNodes:A,geoProjection:C}=e,R=Or({onAnnotationActivate:x,onObservation:w,chartId:k,chartType:S}),L=(0,fm.useRef)([v?.length??0,/* @__PURE__ */new Map]),N=v?.length??0;L.current[0]!==N&&(L.current=[N,/* @__PURE__ */new Map]);const P=(0,fm.useMemo)(()=>{if(!v||0===v.length)return null;const e=To(v),r=C?e.map(e=>{if(!Array.isArray(e.coordinates)||e.coordinates.length<2)return e;const t=C(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:A,stickyPositionCache:L.current[1]};return io(M?Eo({annotations:r,context:i,..."object"==typeof M?M:{}}):r,so(0,R),j,i)},[v,M,j,t,n,A,R,C]),I=a||s||l||d||b||P&&P.length>0,E=(0,fm.useId)(),{titleId:T,descId:z,labelledBy:$}=Yo(c||k||E);return I?/* @__PURE__ */ /* @__PURE__ */(0,rg.jsxs)("svg",{"data-semiotic-overlay":"",role:u?"presentation":"img","aria-labelledby":u?void 0:$,width:r,height:i,overflow:"visible",style:{position:"absolute",top:0,left:0,pointerEvents:"none",overflow:"visible"},children:[!u&&/* @__PURE__ */ /* @__PURE__ */(0,rg.jsxs)(rg.Fragment,{children:[
|
|
93
94
|
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */(0,
|
|
95
|
+
/* @__PURE__ */(0,rg.jsx)("title",{id:T,children:Go(s,"Geographic chart")}),
|
|
95
96
|
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */(0,
|
|
97
|
+
/* @__PURE__ */(0,rg.jsx)("desc",{id:z,children:Vo(s,l,{familyPhrase:"geographic data visualization",fallback:"geographic data visualization"})})]}),
|
|
97
98
|
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */(0,
|
|
99
|
-
return(0,$m.jsxs)("g",{transform:a,opacity:1===u?void 0:u,children:[l&&c&&/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("clipPath",{id:c,children:/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("rect",{x:l.x,y:l.y,width:l.width,height:l.height})}),l&&e.ghostColor?/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("g",{children:d(e.ghostColor)}):null,l&&c?/* @__PURE__ */ /* @__PURE__ */(0,$m.jsx)("g",{clipPath:`url(#${c})`,children:d()}):d()]},r)}function Ho(e){if(!1!==e?.interactive)return e?.style?.cursor}function qo(e){if(!e)return!1;for(const t of e)if(Ho(t))return!0;return!1}function Go(e,t){if(!e)return;const n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function Vo(e){const t=Fm.useRef(null);Fm.useEffect(()=>{e.current&&(t.current=e.current)}),Fm.useEffect(()=>()=>Go(t.current),[])}function Uo(e,t,n){const r=Ho(t);return r&&null!=e&&!1!==e?/* @__PURE__ */ /* @__PURE__ */(0,Om.jsx)("g",{style:{cursor:r},"data-semiotic-mark-cursor":r,children:e},n):e}function Yo(e,t){return Uo(Xo(e,t),e,`geo-cursor-${t}`)}function Xo(e,t){switch(e.type){case"geoarea":{const n=e;if(!n.pathData)return null;const r=Ai(n.style.fill)?Ni(n.style.fill,`geoarea-${t}-hatch`):void 0;/* @__PURE__ */ /* @__PURE__ */
|
|
100
|
-
return(0,_m.jsxs)(Im.Fragment,{children:[r&&/* @__PURE__ */ /* @__PURE__ */(0,_m.jsx)("defs",{children:r}),
|
|
99
|
+
/* @__PURE__ */(0,rg.jsxs)("g",{transform:"translate("+o.left+","+o.top+")",children:[P,b]}),
|
|
101
100
|
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */(0,
|
|
103
|
-
return(0,
|
|
101
|
+
/* @__PURE__ */(0,rg.jsx)(qo,{title:s,totalWidth:r,marginTop:o.top}),Ho({legend:d,totalWidth:r,totalHeight:i,margin:o,legendPosition:g,title:s,legendLayout:y,legendHoverBehavior:h,legendClickBehavior:f,legendHighlightedCategory:p,legendIsolatedCategories:m})]}):null}function Xo(e,t){const[n,r]=e.viewBox??ag,[i,o]=e.anchor??sg,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 Zo(e,t){const n=Xo(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 Ko(e,t,n,r){if("none"!==e)return"color"===e||null==e?t??r:"accent"===e?n:e}function Qo(e){if("undefined"==typeof Path2D)return null;lg||(lg=/* @__PURE__ */new Map);const t=lg.get(e);if(t)return t;const n=new Path2D(e);return lg.size>1024&&lg.clear(),lg.set(e,n),n}function Jo(e,t,n=0,r="horizontal"){const[i,o]=e.viewBox??ag,a=Math.min(1,Math.max(0,n)),s=Math.min(1,Math.max(0,t));return s<=a?{x:0,y:0,width:0,height:0}:a<=0&&s>=1?null:"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}}function ea(e,t){const n=Xo(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 ta(e,t,n,r,i,o=e=>e){for(const a of t.parts){const t=Qo(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:Ko(a.fill,n,r);c&&(e.fillStyle=o(c),e.fill(t));const u=i?a.stroke&&"none"!==a.stroke?i:void 0:Ko(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 na(e){return{opacity:e.opacity,fillOpacity:e.fillOpacity,strokeOpacity:e.strokeOpacity,stroke:e.stroke,strokeWidth:e.strokeWidth}}function ra(e,t="#4e79a7"){return Wi(e)?e.background&&"transparent"!==e.background?e.background:t:e&&"string"==typeof e?e:t}function ia(e){const t=e.replace(/[^A-Za-z0-9_-]/g,"_");return!t||/^\d/.test(t)?`s_${t}`:t}function oa(e,t,n,r){const i=e.glyph;if(!i?.parts?.length||e.size<=0)return null;const o=Xo(i,e.size);if(o.scale<=0)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=Jo(i,e.fraction??1,e.fractionStart??0,e.fractionDirection??"horizontal"),c=l?ia(`${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:Ko(n.fill,s,e.accent),o=t?n.stroke&&"none"!==n.stroke?t:void 0:Ko(n.stroke??"none",s,e.accent);return i||o?/* @__PURE__ */ /* @__PURE__ */(0,cg.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__ */
|
|
102
|
+
return(0,cg.jsxs)("g",{transform:a,opacity:1===u?void 0:u,children:[l&&c&&/* @__PURE__ */ /* @__PURE__ */(0,cg.jsx)("clipPath",{id:c,children:/* @__PURE__ */ /* @__PURE__ */(0,cg.jsx)("rect",{x:l.x,y:l.y,width:l.width,height:l.height})}),l&&e.ghostColor?/* @__PURE__ */ /* @__PURE__ */(0,cg.jsx)("g",{children:d(e.ghostColor)}):null,l&&c?/* @__PURE__ */ /* @__PURE__ */(0,cg.jsx)("g",{clipPath:`url(#${c})`,children:d()}):d()]},r)}function aa(e,t,n="",r="point"){const i=`${n?`${n}-`:""}${r}-${t}-hatch`,o=Wi(e.style.fill)?Gi(e.style.fill,i):void 0;/* @__PURE__ */ /* @__PURE__ */
|
|
103
|
+
return(0,cg.jsxs)(og.Fragment,{children:[o&&/* @__PURE__ */ /* @__PURE__ */(0,cg.jsx)("defs",{children:o}),
|
|
104
104
|
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */(0,
|
|
106
|
-
return(0,
|
|
105
|
+
/* @__PURE__ */(0,cg.jsx)("circle",{cx:e.x,cy:e.y,r:e.r,fill:o?`url(#${i})`:ra(e.style.fill),...na(e.style),opacity:(e.style.opacity??1)*(e._decayOpacity??1)})]},`${n}${r}-${t}`)}function sa(e){if(!1!==e?.interactive)return e?.style?.cursor}function la(e){if(!e)return!1;for(const t of e)if(sa(t))return!0;return!1}function ca(e,t){if(!e)return;const n=t??"";e.style.cursor!==n&&(e.style.cursor=n)}function ua(e){const t=ug.useRef(null);ug.useEffect(()=>{e.current&&(t.current=e.current)}),ug.useEffect(()=>()=>ca(t.current),[])}function da(e,t,n){const r=sa(t);return r&&null!=e&&!1!==e?/* @__PURE__ */ /* @__PURE__ */(0,dg.jsx)("g",{style:{cursor:r},"data-semiotic-mark-cursor":r,children:e},n):e}function ha(e,t){return da(fa(e,t),e,`geo-cursor-${t}`)}function fa(e,t){switch(e.type){case"geoarea":{const n=e;if(!n.pathData)return null;const r=Wi(n.style.fill)?Gi(n.style.fill,`geoarea-${t}-hatch`):void 0;/* @__PURE__ */ /* @__PURE__ */
|
|
106
|
+
return(0,hg.jsxs)(ig.Fragment,{children:[r&&/* @__PURE__ */ /* @__PURE__ */(0,hg.jsx)("defs",{children:r}),
|
|
107
107
|
/* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */(0,
|
|
109
|
-
return(0,
|
|
110
|
-
return(0,sg.jsx)("div",{ref:l,id:t,className:s?a:mu,tabIndex:-1,onFocus:s?void 0:d,onBlur:s?h:void 0,style:s?bu:m?Jm:Qm,role:"region","aria-label":y,children:s?/* @__PURE__ */ /* @__PURE__ */(0,sg.jsxs)(sg.Fragment,{children:[
|
|
108
|
+
/* @__PURE__ */(0,hg.jsx)("path",{d:n.pathData,fill:r?`url(#geoarea-${t}-hatch)`:ra(n.style.fill,"#e0e0e0"),...na(n.style),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":return aa(e,t,"","geopoint");case"line":{const n=e;if(n.path.length<2)return null;const r="M"+n.path.map(e=>`${e[0]},${e[1]}`).join("L");/* @__PURE__ */ /* @__PURE__ */
|
|
109
|
+
return(0,hg.jsx)("path",{d:r,fill:"none",stroke:n.style.stroke||"#4e79a7",strokeOpacity:n.style.strokeOpacity,strokeWidth:n.style.strokeWidth??1.5,strokeDasharray:n.style.strokeDasharray,opacity:n.style.opacity??1},`line-${t}`)}case"glyph":{const n=e;return oa(n,n.x,n.y,`geo-glyph-${n.pointId??t}`)}default:return null}}function pa(){const e=(0,fg.useSyncExternalStore)(mg,gg,yg),[t,n]=(0,fg.useState)(()=>!e);return pg(()=>{n(!0)},[]),t}function ma(){const e=(0,fg.useSyncExternalStore)(mg,gg,yg);return(0,fg.useRef)(e).current}function ga(e){const{hydrated:t,wasHydratingFromSSR:n,storeRef:r,dirtyRef:i,renderFnRef:o,cancelRender:a,flushRender:s,cleanup:l}=e;pg(()=>{if(!t||!n)return;const e=r.current;e?.cancelIntroAnimation?.(),i.current=!0,a?.(),o.current()},[t,n]);const c=(0,fg.useRef)(s);c.current=s;const[u,d]=(0,fg.useState)(!1);pg(()=>{!n&&c.current&&d(!0)},[n]),pg(()=>{u&&c.current?.()},[u]);const h=(0,fg.useRef)(l);h.current=l,(0,fg.useEffect)(()=>()=>h.current?.(),[])}function ya(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`;e.style.width!==s&&(e.style.width=s),e.style.height!==l&&(e.style.height=l);const c=e.width!==r||e.height!==i;return e.width!==r&&(e.width=r),e.height!==i&&(e.height=i),{effectiveDprX:o,effectiveDprY:a,resized:c}}function ba(){if("undefined"!=typeof window&&"function"==typeof window.matchMedia)return Rf!==window.matchMedia&&(Rf=window.matchMedia,Cf=window.matchMedia("(pointer: coarse)")),Cf}function va(e,t,n,r){const i=e.getContext("2d");if(!i)return null;const{effectiveDprX:o,effectiveDprY:a}=ya(e,t,r);return i.setTransform(o,0,0,a,0,0),i.translate(n.left,n.top),i}function xa(e,t){if("undefined"==typeof window)return 1;const n=window.devicePixelRatio||1,r="undefined"!=typeof window&&(!0===ba()?.matches||Math.min(window.innerWidth||1/0,window.innerHeight||1/0)<768)?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(s<1?0:1,Math.min(n,i,s))}function wa(e){function t(){r||(n(),i=xa(),e(),queueMicrotask(()=>{r||o()}))}if("undefined"==typeof window)return()=>{};let n=()=>{},r=!1,i=0;const o=()=>{if("function"!=typeof window.matchMedia)return;const e=`(resolution: ${window.devicePixelRatio||1}dppx)`,r=window.matchMedia(e);r.media.includes("resolution")&&(n=Ln(r,t))};o(),i=xa();const a=ba(),s=()=>{if(r)return;const t=xa();t!==i&&(i=t,e())};window.addEventListener("resize",s);const l=Ln(a,s);return()=>{r=!0,window.removeEventListener("resize",s),l(),n()}}function ka(e){const{cancelRender:t,dirtyRef:n,frameRuntime:r,manageFrameRuntime:i,maxDevicePixelRatio:o,scheduleRender:a}=e,s=(0,bg.useRef)(null),l=(0,bg.useRef)(null),c=(0,bg.useRef)(!1),u=(0,bg.useRef)(!1),d=(0,bg.useRef)(!1);return xg(()=>{if(!e.size)return;const t=xa(o,e.size);for(const n of[s.current,l.current])n&&ya(n,e.size,t)},[e.size?.[0],e.size?.[1],o,e.hydrated]),xg(()=>{!u.current&&(u.current=!0,e.skipInitialCanvasPaintInvalidation)||(e.canvasPaintInvalidator?e.canvasPaintInvalidator():e.dirtyRef.current=!0,e.scheduleRender())},e.canvasPaintDependencies),ga({hydrated:e.hydrated,wasHydratingFromSSR:e.wasHydratingFromSSR,storeRef:e.storeRef,dirtyRef:e.dirtyRef,renderFnRef:e.renderFnRef,cancelRender:e.cancelRender,flushRender:e.flushRender,cleanup:e.cleanup}),(0,bg.useEffect)(()=>{if(!1!==i)return r.subscribe(()=>{r.isActive?(n.current=!0,a()):t()})},[t,n,r,i,a]),(0,bg.useEffect)(()=>wa(()=>{c.current=!0,a()}),[a]),(0,bg.useEffect)(()=>{d.current?(c.current=!0,a()):d.current=!0},[o,a]),{canvasRef:s,interactionCanvasRef:l,resolutionDirtyRef:c}}function Sa(e,t){return ka({...t,size:e.size,renderFnRef:e.renderFnRef,scheduleRender:e.scheduleRender,cancelRender:e.cancelRender,flushRender:e.flushRender,frameRuntime:e.frameRuntime})}function Ma({children:e,size:t,margin:n,backdropFill:r,overflowVisible:i=!1}){return e||r?/* @__PURE__ */ /* @__PURE__ */(0,vg.jsxs)("svg",{role:"presentation",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,vg.jsx)("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:t[0],height:t[1],fill:r}):null,
|
|
111
110
|
/* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */(0,
|
|
111
|
+
/* @__PURE__ */(0,vg.jsx)("g",{transform:`translate(${n.left},${n.top})`,children:e})]}):null}function ja(e,t,n){if(Object.is(e,t))return!0;if(0===n)return!1;if(Array.isArray(e)&&Array.isArray(t))return Aa(e,t);if(!Ca(e)||!Ca(t))return!1;const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const i of r){if(!Object.prototype.hasOwnProperty.call(t,i))return!1;if(!ja(e[i],t[i],n-1))return!1}return!0}function Aa(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function Ca(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 Ra(e){const t=(0,wg.useRef)(e);return ja(t.current,e,2)||(t.current=e),t.current}function La(e){const{background:t,hasBackgroundGraphics:n=!1,themeBackground:r=""}=e;return"transparent"===t?null:n?t||null:t||(r&&"transparent"!==r?r:"")||null}function Na(e){const{background:t,hasBackgroundGraphics:n=!1,themeBackground:r=""}=e;return"transparent"===t||n?null:t||(r&&"transparent"!==r?r:"")||null}function Pa(e,t){const{background:n,hasBackgroundGraphics:r=!1,themeBackground:i="",x:o=0,y:a=0,width:s,height:l}=t,c=Na({background:n,hasBackgroundGraphics:r,themeBackground:i});if(!c)return!1;const u=On(e,c);return!(!u||"transparent"===u.trim().toLowerCase()||(e.fillStyle=u,e.fillRect(o,a,s,l),0))}function Ia({hoverPoint:t,scene:r,active:i=!0}){let o="";if(i&&t){const i=t.data??t,a="stats"in t?t.stats:void 0,s=a&&r?.find(e=>e.stats===a)||r?.find(e=>e.datum===i)||r?.find(e=>Array.isArray(e.datum)&&e.datum.includes(i)),l=s?n(s):i,c=a&&s&&("boxplot"===s.type||"violin"===s.type)&&Array.isArray(l)?{category:s.category,...e(s.stats)}:l;if(null!=c&&"object"==typeof c){const t=(Array.isArray(c)?c:[c]).map(t=>Object.entries(e(t)).map(([e,t])=>`${e}: ${t}`).join(", ")).filter(Boolean);o=t.length>0?`Data point: ${t.join("; ")}`:""}else o=`Data point: ${String(c)}`}/* @__PURE__ */ /* @__PURE__ */
|
|
112
|
+
return(0,Ag.jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:Mg,children:o})}function Ea(e){return Pg?.ordinals.has(e)&&(Pg=null),Pg||(Pg={counts:/* @__PURE__ */new Map,ordinals:/* @__PURE__ */new Map},Ig||(Ig=!0,queueMicrotask(()=>{Pg=null,Ig=!1}))),Pg}function Ta(e,t,n){const r=e.ordinals.get(n);if(null!=r)return r;const i=(e.counts.get(t)??0)+1;return e.counts.set(t,i),e.ordinals.set(n,i),i}function za(e){let t=1;for(const n of e)Lg.get(n)?.(t),t+=1}function $a(e){const t=Cg.useId(),n=Cg.useRef(null);null==n.current&&(n.current=/* @__PURE__ */Symbol("summary-region"));const r=n.current,i=Cg.useContext(Ng),o=Cg.useRef(null);null==o.current&&(o.current=Ta(i??Ea(t),e,t));const[a,s]=Cg.useState(o.current);return Cg.useLayoutEffect(()=>{Lg.set(r,s);let t=Rg.get(e);return t||(t=/* @__PURE__ */new Set,Rg.set(e,t)),t.add(r),za(t),()=>{Lg.delete(r),t.delete(r),0===t.size?Rg.delete(e):za(t)}},[e,r]),1===a?e:`${e} (${a})`}function Da({interaction:e,tableId:t,regionLabel:n,countLabel:r,summary:i,children:o,className:a=Pu}){const{isExpanded:s,containerRef:l,triggerRef:c,open:u,handleFocus:d,handleBlur:h,dismiss:f,announcement:p}=e,[m,g]=Sg.useState(!1),y=$a(n);/* @__PURE__ */ /* @__PURE__ */
|
|
113
|
+
return(0,Eg.jsx)("div",{ref:l,id:t,className:s?a:Nu,tabIndex:-1,onFocus:s?void 0:d,onBlur:s?h:void 0,style:s?Eu:m?jg:Mg,role:"region","aria-label":y,children:s?/* @__PURE__ */ /* @__PURE__ */(0,Eg.jsxs)(Eg.Fragment,{children:[
|
|
113
114
|
/* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */(0,
|
|
115
|
+
/* @__PURE__ */(0,Eg.jsx)("div",{role:"status","aria-atomic":"true",style:Mg,children:p}),
|
|
115
116
|
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */(0,
|
|
117
|
+
/* @__PURE__ */(0,Eg.jsx)("button",{type:"button",className:"semiotic-accessible-data-table-close",onClick:f,"aria-label":"Close data summary",style:zu,children:"×"}),i&&/* @__PURE__ */ /* @__PURE__ */(0,Eg.jsx)("div",{className:"semiotic-accessible-data-table-summary",role:"note",style:Tu,children:i}),o]}):/* @__PURE__ */ /* @__PURE__ */(0,Eg.jsxs)("button",{ref:c,type:"button",onClick:u,onFocus:()=>g(!0),onBlur:()=>g(!1),style:Iu,children:["View data summary (",r,")"]})})}function Oa(){const[e,t]=Tg.useState(!1),[n,r]=Tg.useState(""),i=zg.useContext($g),o=i?.visible??!1,a=e||o,s=Tg.useRef(null),l=Tg.useRef(null),c=Tg.useRef(null),u=Tg.useRef(!1),d=Tg.useRef(!1),h=Tg.useRef(null);Dg(()=>{if(a&&!d.current){const e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&!s.current?.contains(e)&&(c.current=e),s.current?.focus()}else if(!a&&d.current){if(u.current){const e=c.current?.isConnected?c.current:l.current;e?.focus()}u.current=!1,c.current=null,h.current=null,r("")}d.current=a;const e=h.current;if(a&&e){const t=e.table.querySelectorAll("tbody tr");t[e.index]?.focus(),h.current=null}});const f=()=>t(!0);return{isExpanded:a,containerRef:s,triggerRef:l,open:f,handleFocus:e=>{e.target!==e.currentTarget||a||(e.relatedTarget instanceof HTMLElement&&(c.current=e.relatedTarget),f())},handleBlur:e=>{o||s.current?.contains(e.relatedTarget)||t(!1)},dismiss:()=>{u.current=!0,o&&i?.setVisible(!1),t(!1)},revealRows:(e,t,n,i,o="rows")=>{const a=e.previousElementSibling;a&&(h.current={table:a,index:t}),r(`${n} of ${i} ${o} shown.`)},announcement:n}}function Fa({accessibleTable:e,children:t}){const n=pa();return"object"!=typeof e?t:n?/* @__PURE__ */ /* @__PURE__ */(0,Fg.jsx)(kg.Suspense,{fallback:null,children:/* @__PURE__ */ /* @__PURE__ */(0,Fg.jsx)(_g,{target:e.portalTarget,children:t})}):null}function _a(e,t){if(!e||0===e.length)return`${t}, empty`;const n={};for(const t of e){if(null===t?.datum)continue;const e=String(t.type);n[e]=(n[e]||0)+1}if(0===Object.keys(n).length)return`${t}, empty`;const r=[],i={point:["point","points"],line:["line","lines"],area:["area","areas"],rect:["bar","bars"],heatcell:["cell","cells"],circle:["node","nodes"],candlestick:["candlestick","candlesticks"],wedge:["wedge","wedges"],arc:["arc","arcs"],geoarea:["region","regions"]},o=Object.keys(i),s=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 s){const t=i[e];r.push(t?a(n[e],t[0],t[1]):a(n[e],e))}return`${t}, ${r.join(", ")}`}function Wa({accessibleTable:e,...t}){return e?/* @__PURE__ */ /* @__PURE__ */(0,Fg.jsxs)(Fa,{accessibleTable:e,children:[
|
|
117
118
|
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */(0,
|
|
119
|
-
return(0,fg.jsx)("a",{href:`#${e}`,style:t?Jm:Qm,onClick:t=>{t.preventDefault();const n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:()=>n(!0),onBlur:()=>n(!1),children:"Skip to data table"})}function Ra(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],o=String(e);n.has(o)||(n.add(o),r.push(o))}return r}function Ca(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function La(e,t,n,r){const i=(0,gg.useRef)({accessor:t,onChange:n,readData:r}),o=(0,gg.useRef)([]);i.current={accessor:t,onChange:n,readData:r};const a=(0,gg.useCallback)(()=>{const{accessor:t,onChange:n,readData:r}=i.current;if(!n||!t)return;const a=Ra(e.current?r(e.current):[],t);Ca(a,o.current)||(o.current=a,n(a))},[e]);return(0,gg.useEffect)(()=>{o.current=[],a()},[t,a,n]),a}function Na({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,yg.jsx)("rect",{x:l-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:bg,strokeWidth:2,strokeDasharray:"4,2"})}else u="wedge"===i?/* @__PURE__ */ /* @__PURE__ */(0,yg.jsx)("circle",{cx:l,cy:c,r:12,fill:"none",stroke:bg,strokeWidth:2.5,strokeDasharray:"6,3"}):/* @__PURE__ */ /* @__PURE__ */(0,yg.jsx)("circle",{cx:l,cy:c,r:8,fill:"none",stroke:bg,strokeWidth:2,strokeDasharray:"4,2"});else u=/* @__PURE__ */ /* @__PURE__ */(0,yg.jsx)("g",{transform:`translate(${n.left},${n.top})`,children:/* @__PURE__ */ /* @__PURE__ */(0,yg.jsx)("path",{d:s,fill:"none",stroke:bg,strokeWidth:2.5,strokeDasharray:"6,3"})});/* @__PURE__ */ /* @__PURE__ */
|
|
120
|
-
return(0,yg.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 Pa(e){return null!=e&&"boolean"!=typeof e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.some(Pa):!wg.isValidElement(e)||e.type!==wg.Fragment||Pa(e.props.children))}function Ea(){const e=globalThis;return e[Mg]??(e[Mg]=wg.createContext(void 0))}function Ia(){return wg.useContext(Ea())}function Ta(e){let t;for(const n of e.childNodes)if(1===n.nodeType){if(t)return!1;t=n}else if(3===n.nodeType&&n.textContent?.trim())return!1;const n=t?.getAttribute("data-semiotic-tooltip-chrome");return!t||null!=n&&"false"!==n}function za(e,t){const[n,r]=wg.useState(!1);return("undefined"==typeof window?wg.useEffect:wg.useLayoutEffect)(()=>{const i=t&&null!==e.current&&Ta(e.current);i!==n&&r(i)}),wg.useEffect(()=>{const n=e.current;if(!t||!n)return;const i=new MutationObserver(()=>r(Ta(n)));return i.observe(n,{childList:!0,subtree:!0,characterData:!0,attributeFilter:["data-semiotic-tooltip-chrome"]}),()=>i.disconnect()},[t,e]),t&&n}function Da(e){return e.ownsChrome=!0,e}function $a(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 Fa(e){if("function"==typeof e)return!0===e.ownsChrome;if(!wg.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($a(i.background))return!0;if($a(i.backgroundColor))return!0}return!1}function Oa({x:e,y:t,containerWidth:n,containerHeight:r,margin:i,children:o,contentOwnsChrome:a=!1,className:s="stream-frame-tooltip",zIndex:l=1}){const c=Ia(),u=Number.isFinite(e)&&Number.isFinite(t),d=Pa(o),h=vg.useRef(null),f="none"===c||a||Fa(o),p=za(h,!f&&u&&d),m=f||p,[g,y]=vg.useState(null);vg.useLayoutEffect(()=>{const e=h.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect(),n=getComputedStyle(e),r=parseFloat(n.width)||t.width,i=parseFloat(n.height)||t.height;Number.isFinite(r)&&Number.isFinite(i)&&y(e=>e&&e.ownsChrome===m&&Math.abs(e.width-r)<.5&&Math.abs(e.height-i)<.5?e:{width:r,height:i,ownsChrome:m})};if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(()=>(0,xg.flushSync)(t));return n.observe(e),()=>n.disconnect()},[s,n,r,u,d,m]);const b=vg.useRef(null),v=g?.ownsChrome===m?g:null;let x,w=e,k=t,S=!1,M=!1;if(v){const i=r-t;S=n-e<v.width+12,M=i<v.height+12,w=Math.max(0,Math.min(e+(S?-v.width-12:12),n-v.width)),k=Math.max(0,Math.min(t+(M?-v.height-4:4),r-v.height)),x="none"}else x=`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${t<.3*r?"4px":"calc(-100% - 4px)"})`;const j=v?{flipX:S,flipY:M}:null,A=b.current,R=!j||!A||A.flipX!==j.flipX||A.flipY!==j.flipY;vg.useLayoutEffect(()=>{b.current=j});const C=m?null:Sg,L=m?s:`${s} semiotic-tooltip`.trim();return u&&d?/* @__PURE__ */ /* @__PURE__ */(0,Ag.jsx)("div",{ref:h,className:L,"data-placement":j?"placed":"pending","data-flip-x":S?"true":"false","data-flip-y":M?"true":"false",style:{...C||{},position:"absolute",left:i.left+w,top:i.top+k,transform:x,...R&&{transition:"none"},pointerEvents:"none",zIndex:l,width:"max-content",maxWidth:m?n:`min(${n}px, ${Sg.maxWidth})`,boxSizing:"border-box"},children:o}):null}function _a(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 Ba(e){switch(e){case"monotoneX":return Lg.curveMonotoneX;case"monotoneY":return Lg.curveMonotoneY;case"cardinal":return Lg.curveCardinal;case"catmullRom":return Lg.curveCatmullRom;case"step":return Lg.curveStep;case"stepBefore":return Lg.curveStepBefore;case"stepAfter":return Lg.curveStepAfter;case"basis":return Lg.curveBasis;case"natural":return Lg.curveNatural;default:return null}}function Wa(e){return"string"==typeof e&&"none"===e.trim().toLowerCase()}function Ha(e,t,n){return Wa(t)?"rgba(0,0,0,0)":null==t?n:Ai(t)?Li(t,e)||t.background&&Fn(e,t.background)||n:"string"!=typeof t?t:Fn(e,t)||n}function qa(e,t){if(null==t)return;const n=Ha(e,t,"");return""===n?void 0:n}function Ga(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(s.length<2)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)),Va(e,t,n));return l}function Va(e,t,n){const r=t.color??n,i=Fn(e,r)||r;if(null==t.opacity)return i;const o=Math.max(0,Math.min(1,t.opacity)),[a,s,l]=_a(e,i);return`rgba(${a},${s},${l},${o})`}function Ua(e){return!!(e._pulseIntensity&&e._pulseIntensity>0)}function Ya(e,t,n=.6){if(!Ua(t))return;const r=t._pulseGlowRadius??4,i=t.r+r*t._pulseIntensity,o=t.cx??t.x??0,a=t.cy??t.y??0;e.beginPath(),e.arc(o,a,i,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 Xa(e,t,n,r=.35){Ua(t)&&(e.globalAlpha=t._pulseIntensity*r,e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",n?e.fill(n):e.fill())}function Za(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=Wa(t.style.fill)?void 0:qa(e,t.style.fill)||"#e0e0e0";r&&!Wa(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=Fn(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)}Xa(e,t,n),e.globalAlpha=1,e.setLineDash([])}}function Ka(e,t,n){let r=n;for(const n of t)"lesser"===n.thresholdType?e<n.value&&(r=n.color):e>n.value&&(r=n.color);return r}function Qa(e,t,n,r){if(e.length<2||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;i<e.length;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&&e<1&&Number.isFinite(e)).sort((e,t)=>e-t).filter((e,t,n)=>0===t||e!==n[t-1]),1];for(let e=1;e<h.length;e++){const t=h[e-1],i=h[e];o(Ka(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 Ja(e,t,n,r,i,o){if(t.length<2)return;const a=[0];for(let e=1;e<t.length;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;n<t.length-1;n++){const r=(a[n]+a[n+1])/2;let o=i;r<l&&(o*=r/l),s-r<l&&(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 es(e,t,n){for(const r of t){if(r.path.length<2)continue;const t=r._introClipFraction;void 0!==t&&t<1&&(e.save(),e.beginPath(),e.rect(0,0,n.width*t,n.height),e.clip());const i=Wa(r.style.stroke),o=i?"#007bff":r.style.stroke||"#007bff",a=Fn(e,o)||o,s=i?0:r.style.strokeWidth??2,l=r.colorThresholds,c=r.rawValues;if(r.style.strokeDasharray?e.setLineDash(r.style.strokeDasharray.split(/[\s,]+/).map(Number)):e.setLineDash([]),null!=r.style.opacity&&(e.globalAlpha=r.style.opacity),s>0&&(e.lineWidth=s),e.lineCap=r.style.strokeLinecap||"butt",r.style._edgeFade&&s>0){const t=r.style.opacity??1;Ja(e,r.path,a,s,t,r.style.strokeLinecap||"butt"),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt";continue}const u=Ba(r.curve),d=l&&l.length>0&&c&&c.length===r.path.length,h=r._decayOpacities;if(s>0&&h&&h.length===r.path.length&&!d){e.strokeStyle=a;const t=r.style.opacity??1;for(let n=0;n<r.path.length-1;n++){const i=.5*(h[n]+h[n+1])*t;e.globalAlpha=i,e.beginPath(),e.moveTo(r.path[n][0],r.path[n][1]),e.lineTo(r.path[n+1][0],r.path[n+1][1]),e.stroke()}}else if(s>0&&!d){e.beginPath();const t=r.strokeGradient&&r.path.length>=2?Ga(e,r.strokeGradient,a,r.path[0][0],0,r.path[r.path.length-1][0],0):null;if(e.strokeStyle=t||a,u)(0,Ng.line)().x(e=>e[0]).y(e=>e[1]).curve(u).context(e)(r.path);else{const[t,n]=r.path[0];e.moveTo(t,n);for(let t=1;t<r.path.length;t++)e.lineTo(r.path[t][0],r.path[t][1])}e.stroke()}else if(s>0){const t=Qa(r.path,c,l,a);for(const n of t){e.beginPath(),e.strokeStyle=Fn(e,n.color)||n.color,e.moveTo(n.path[0][0],n.path[0][1]);for(let t=1;t<n.path.length;t++)e.lineTo(n.path[t][0],n.path[t][1]);e.stroke()}}if(r.style.fill&&r.style.fillOpacity&&r.style.fillOpacity>0){if(e.beginPath(),e.globalAlpha=r.style.fillOpacity,e.fillStyle=Ha(e,r.style.fill,r.style.fill),u&&!d)(0,Ng.line)().x(e=>e[0]).y(e=>e[1]).curve(u).context(e)(r.path);else{const[t,n]=r.path[0];e.moveTo(t,n);for(let t=1;t<r.path.length;t++)e.lineTo(r.path[t][0],r.path[t][1])}const t=r.path[r.path.length-1][0],i=r.path[0][0];e.lineTo(t,n.height),e.lineTo(i,n.height),e.closePath(),e.fill()}void 0!==t&&t<1&&e.restore(),e.globalAlpha=1,e.setLineDash([]),e.lineCap="butt"}}function ts(e,t){if(0!==t.length){e.save();try{const n=e.globalAlpha;let r=[],i="";const o=t=>{e.beginPath(),e.arc(t.x,t.y,t.r,0,2*Math.PI);const r=t.style.opacity??t.style.fillOpacity??1;e.globalAlpha=n*r,e.fillStyle=Ha(e,t.style.fill,"#4e79a7"),e.fill();const i=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&i>0&&(e.strokeStyle=Ha(e,t.style.stroke,t.style.stroke),e.lineWidth=i,e.stroke()),Ya(e,t)},a=()=>{if(0===r.length)return;if(1===r.length)return o(r[0]),r=[],void(i="");const t=r[0],a=t.style.opacity??t.style.fillOpacity??1;e.globalAlpha=n*a,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=Ha(e,t.style.fill,"#4e79a7"),e.fill();const s=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&s>0&&(e.strokeStyle=Ha(e,t.style.stroke,t.style.stroke),e.lineWidth=s,e.stroke()),r=[],i=""};for(const e of t){const t=e.style.opacity??e.style.fillOpacity??1,n=e.style.fill;if(Ua(e)||null!=n&&"string"!=typeof n||t<1){a(),o(e);continue}const s=e.style.strokeWidth??1,l=`${n??"#4e79a7"}\0${e.style.stroke&&"none"!==e.style.stroke&&s>0?String(e.style.stroke):""}\0${s}\0${e.r}\0${t}`;r.length>0&&l!==i&&a(),i=l,r.push(e),r.length>=2048&&a()}a()}finally{e.restore()}}}function ns(e,t,n,r,i){if(t.size<=0)return;const o=t.glyph;if(!o||!o.parts?.length)return;const a=Io(o,t.size);if(a.scale<=0)return;const s=t._decayOpacity??1,l=(t.style.opacity??1)*s;if(l<=0)return;const c=t=>{const n=Ha(e,t,t);return"string"==typeof n?n:t},u=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*l*(t.style.fillOpacity??1);const d=$o(o,t.fraction??1,t.fractionStart??0,t.fractionDirection??"horizontal");d&&t.ghostColor&&Oo(e,o,u,t.accent,t.ghostColor,c),d&&(e.beginPath(),e.rect(d.x,d.y,d.width,d.height),e.clip()),Oo(e,o,u,t.accent,void 0,c),e.restore()}function rs(e,t){const n=e.globalAlpha;for(const r of t){const t=r;ns(e,t,t.x,t.y,n)}e.globalAlpha=n}function is(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;e<m;++e)for(let t=h;t<f;++t)g.push([t,e,s]);return{tiles:g,translate:[u/c,d/c],scale:c}}function os([e,t,n]){const r=1<<n;return[e-Math.floor(e/r)*r,t,n]}function as(e,t,n,r,i){return"function"==typeof e?e(t,n,r,i):e.replaceAll("{z}",String(t)).replaceAll("{x}",String(n)).replaceAll("{y}",String(r)).replaceAll("{r}",i>1?"@2x":"")}function ss(e){if("string"==typeof e)return`template:${e}`;const t=e;let n=Pg.get(t);return null==n&&(n=Eg++,Pg.set(t,n)),`provider:${n}`}function ls(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):256}function cs(e,t){const{tileURL:n,projection:r,width:i,height:o,tileCache:a,onTileLoad:s,maxDevicePixelRatio:l}=t,c=r.scale(),u=r([0,0])??r.translate(),d=is({size:[i,o],scale:2*c*Math.PI,translate:u,clampX:!1}),h=na(l,[i,o]),f=ss(n);let p=!0;for(const t of d.tiles){const[r,i,o]=os(t),l=as(n,o,r,i,h),c=`${f}|dpr:${h}|${o}/${r}/${i}|${l}`;let u=a.get(c);if(!u||u.failed&&(u.attempts??1)<3&&Date.now()>=(u.retryAt??1/0)){const e=new Image;e.crossOrigin="anonymous";const t={img:e,loaded:!1,failed:!1,key:c,lastUsed:performance.now(),attempts:(u?.attempts??0)+1};a.set(c,t),e.onload=()=>{t.loaded=!0,s?.()},e.onerror=()=>{t.loaded=!0,t.failed=!0,t.retryAt=Date.now()+1e3,s?.()},e.src=l,u=t}if(!u.loaded){p=!1;continue}if(u.failed)continue;const m=d.scale,g=d.translate[0],y=d.translate[1],b=(t[0]+g)*m,v=(t[1]+y)*m;e.drawImage(u.img,b-.5,v-.5,m+1,m+1)}return p}function us(e){let t=0;for(let n=1;n<e.length;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 ds(e,t){let n=0;for(let r=1;r<e.length;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 hs(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 fs(...e){const t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:zg.createElement(zg.Fragment,null,...t)}function ps({value:e,children:t}){const n=(hg??(hg=Dg.createContext(null)),hg);/* @__PURE__ */ /* @__PURE__ */
|
|
121
|
-
return(0,$g.jsx)(n.Provider,{value:e,children:t})}function ms(e,t){return null!=e?/* @__PURE__ */ /* @__PURE__ */(0,$g.jsx)(ps,{value:t,children:e}):e}function gs(e){if(!e||"object"!=typeof e)return!1;const t=e;return"string"==typeof t.id&&"function"==typeof t.cacheKey&&"function"==typeof t.drawCanvas&&"function"==typeof t.renderStaticSVG}function ys(e,t){const n="function"==typeof e?e(t.datum??null,t):e;return gs(n)?n:void 0}function bs(e,t){if("production"===process.env.NODE_ENV)return;const n=`${e}:${t}`;Fg.has(n)||(Fg.add(n),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}function vs(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=ys(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||(bs(n.id,e.type??"unknown"),o([e]))}s()}function xs(e){const{node:t,index:n,renderMode:r,fallback:i}=e,o=ys(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:Uo(a,t,`${o.id}-${n}-cursor`),renderedByBackend:!0}:(bs(o.id,t.type??"unknown"),{element:i(),renderedByBackend:!1})}function ws(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=Fo(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 ks(e){if(!Number.isFinite(e))return String(e);const t=Number.isInteger(e)?e:Number(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():String(t)}function Ss(e,t){return"touch"===t?Math.max(e,24):e}function Ms(e){return Array.isArray(e)?e[0]:e}function js(e,t){return t?.length?(Object.defineProperty(e,Og,{configurable:!0,enumerable:!1,value:t}),e):e}function As(e){return e?.[Og]}function Rs(e){return e.parentLine?js({...e.parentLine,...e},As(e)):e}function Cs(e,t){const n=Rs(e),r={};for(const i of t){const t=n[i];if(void 0!==t){r[i]=[t];continue}const o=As(e)?.map(e=>Rs(e)[i]).filter(e=>void 0!==e);o?.length&&(r[i]=[...new Set(o)])}return r}function Ls(e){const t=!0===e?.__semioticHoverData,n=e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),r=t||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&n;let i=Ms(r?e.data??{}:e);if(!i)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof i?.x0&&"number"==typeof i?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof i?.sankeyWidth)&&i.data&&"object"==typeof i.data&&(i=i.data),!i)return null;if(r&&(void 0!==e.allSeries||void 0!==e.xValue)){const t=js({...i},As(i));void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),i=t}return i}function Ns(e){return e.getHours()||e.getMinutes()||e.getSeconds()||e.getMilliseconds()?e.toLocaleString():e.toLocaleDateString()}function Ps(e,t){for(const n of t){const t=e.find(e=>e.lower===n);if(t)return t}}function Es(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&&Hg.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=>_g.includes(e.lower));const a=o>=0;o<0&&(o=i.findIndex(e=>"id"===e.lower)),o<0&&(o=i.findIndex(e=>"string"==typeof e.value));const s=o>=0?i[o]:void 0,l=i.filter((e,t)=>t!==o&&(!a||"id"!==e.lower)),c=Ps(l,Bg),u=Ps(l,Wg),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;Bg.includes(e.lower)||Wg.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}function Is(e,t){return"function"==typeof t?t(e):e[t]}function Ts(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?ks(e):String(e);if(e instanceof Date)return Ns(e);if("object"==typeof e&&null!==e){const t=e;if(void 0!==t.id)return String(t.id);if(void 0!==t.name)return String(t.name);try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return String(e)}function zs(e,t,n){const r="string"==typeof t?t:t.accessor||t.key||"";return{label:"string"==typeof t?t:t.label,value:Ts(Is(e,r),"string"==typeof t?n:t.format||n)}}function Ds(e={}){const{fields:t,chrome:n,title:r,format:i,style:o={},className:a=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let s;const l=[];if(r){const t=Is(e,r);s=Ts(t,i)}if(t&&t.length>0)l.push(...t.map(t=>zs(e,t,i)));else if(!r){const t=["value","y","name","id","label"];for(const n of t)if(void 0!==e[n]){s=Ts(e[n],i);break}if(!s){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(s=Ts(e[t[0]],i))}}/* @__PURE__ */ /* @__PURE__ */
|
|
122
|
-
return(0,qg.jsxs)(jg,{chrome:n,className:a,style:o,children:[s&&/* @__PURE__ */ /* @__PURE__ */(0,qg.jsx)("div",{style:{fontWeight:l.length>0?"bold":"normal"},children:s}),l.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,qg.jsxs)("div",{style:{marginTop:0===t&&s?"4px":0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,qg.jsxs)("span",{children:[e.label,": "]}),e.value]},t))]})}}function $s(e={}){const{fields:t=[],chrome:n,title:r,format:i,style:o={},className:a="",showLabels:s=!0,separator:l=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const c=[];if(r){const t=Is(e,r);c.push({value:Ts(t,i)})}if(t&&Array.isArray(t)&&t.length>0)for(const n of t){const t=zs(e,n,i);c.push({...t,label:s?t.label:void 0})}else{const t=Es(e,{skipPositional:!1});null!=t.title&&c.push({label:void 0,value:Ts(t.title,i),bold:!0}),t.entries.forEach(e=>{c.push({label:s?e.key:void 0,value:Ts(e.value,i)})})}return Array.isArray(c)&&0!==c.length?/* @__PURE__ */ /* @__PURE__ */(0,qg.jsx)(jg,{chrome:n,className:`semiotic-tooltip-multiline ${a}`.trim(),style:o,children:c.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,qg.jsxs)("div",{style:{marginBottom:t<c.length-1?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,qg.jsxs)("strong",{children:[e.label,l]}),e.value]},t))}):null}}function Fs(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function Os(e){if(!0!==e){if("function"==typeof e||"object"==typeof e&&null!==e&&"content"in e&&"function"==typeof e.content&&!Fs(e)){const t="function"==typeof e?e:e.content,n="function"==typeof e?void 0:e.chrome,r=e=>{const r=Ls(e);if(!r)return null;const i=t(r);return Pa(i)?void 0===n&&(Fa(t)||Fa(i))?i:/* @__PURE__ */ /* @__PURE__ */(0,qg.jsx)(jg,{chrome:n,children:i}):null};return void 0===n&&Fa(t)?Da(r):r}if(!1===e||void 0===e)return!1;if(Fs(e)){if("function"==typeof e.content)return Gg||"production"===process.env.NODE_ENV||(Gg=!0,console.warn('[semiotic] tooltip={{ mode: "multi", content }} reached a chart without multi-series hover. content receives one datum and no allSeries.')),Os(void 0===e.chrome?e.content:{content:e.content,chrome:e.chrome});"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=$s({chrome:e.chrome});return Os(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e||"chrome"in e)){const t=Ds(e);return Os(e=>t(e))}if("multi"===e){"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=$s();return Os(t=>e(t))}return Ds()}}function _s(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;c=Math.max(0,Math.min(1,c));const u=n+c*a,d=r+c*s;return Math.sqrt((e-u)**2+(t-d)**2)}function Bs(e,t=30,n=1){return Math.max((e??4)+5/n,12/n,t)}function Ws(e,t,n,r,i,o=e=>e.x,a=e=>e.y,s=e=>e.r,l,c=1){const u=Bs(i,r,c),d=t-u,h=t+u,f=n-u,p=n+u;let m=null,g=1/0;return e.visit((e,i,u,y,b)=>{if(i>h||y<d||u>p||b<f)return!0;const v=e;if(!v.length){let e=v;do{const i=e.data,u=o(i)-t,d=a(i)-n,h=Math.sqrt(u*u+d*d);h<=Bs(s(i),r,c)&&(null===m||(l?l(i,m,h,g):h<g))&&(m=i,g=h),e=e.next}while(e)}return!1}),m?{node:m,distance:g}:null}function Hs(e,t,n,r,i,o,a=0,s=r){if(o){const e=Ws(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);l<=Bs(a.r,r)&&l<o&&(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=Fo(i.glyph,i.size),o=i.x+e.centerDx-t,a=i.y+e.centerDy-n,s=Math.sqrt(o*o+a*a);s<=Bs(e.radius,r)&&s<c&&(l=i,c=s)}if(l)return{node:l,distance:c};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;r<i.length-1;r++){const s=i[r],f=i[r+1],p=s[0],m=s[1],g=f[0],y=f[1];if(p<a&&g<a||p>l&&g>l||m<c&&y<c||m>h&&y>h)continue;const b=_s(t,n,p,m,g,y);b<=o&&b<d&&(u=e,d=b)}}if(u)return{node:u,distance:d};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(!(t<s||t>c||n<l||n>u)&&(a._cachedPath2D||(a._cachedPath2D=new Path2D(a.pathData)),i.isPointInPath(a._cachedPath2D,t,n)))return{node:a,distance:0}}return null}function qs(){if(null!==Xg)return Xg;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&&navigator.hardwareConcurrency<=4,n="undefined"!=typeof navigator&&"number"==typeof navigator.deviceMemory&&navigator.deviceMemory<=4;return Xg=e||t||n}function Gs(){return qs()?12:30}function Vs(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function Us(e){const t=e.pointer.clientX-e.canvasRect.left-e.margin.left,n=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(t<0||t>e.width||n<0||n>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const r=(i=e.hitCanvasRef.current)?i.getContext("2d"):null;var i;if(!r)return{kind:"unavailable"};const o=Hs(e.scene,t,n,Ss(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,Ss(6,e.pointer.pointerType));if(!o)return{kind:"miss"};const{node:a}=o,s=a.datum,l=Array.isArray(s)?null:s?.properties?s:s?.data||s,c="point"===a.type?a.x:"geoarea"===a.type?a.centroid[0]:t,u="point"===a.type?a.y:"geoarea"===a.type?a.centroid[1]:n;return{kind:"hit",node:a,hover:{...l,...l?.properties||{},data:l,properties:l?.properties,__semioticHoverData:!0,x:c,y:u}}}function Ys(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 Xs(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 Zs(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 Ks({customHoverBehavior:e,customClickBehavior:t,onObservation:n,chartId:r,chartType:i}){const o=Boolean(e||n),a=Boolean(t||n),s=(0,Kg.useCallback)((t,o)=>{e?.(t,o),Xs({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,Kg.useCallback)((e,o)=>{t?.(e,o),Zs({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 Qs(e){const t=/* @__PURE__ */new Map;for(const n of e){const e=n.group??"_default";let r=t.get(e);r||(r=[],t.set(e,r)),r.push(n)}for(const e of t.values()){e.sort((e,t)=>e.x-t.x||e.y-t.y);for(let t=0;t<e.length;t++)e[t]._groupIndex=t}const n=Array.from(t.keys()).sort((e,n)=>{const r=t.get(e),i=t.get(n);return(r.length>0?r[0].y:0)-(i.length>0?i[0].y:0)}),r=Array.from(t.values()).flat();r.sort((e,t)=>e.x-t.x||e.y-t.y);const i=/* @__PURE__ */new Map;for(let e=0;e<r.length;e++){r[e]._flatIndex=e;const t=r[e].datum?.id;null!=t&&i.set(String(t),e)}return{flat:r,groups:n,byGroup:t,idToIdx:i}}function Js(e,t){if(0===e.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};const n=Math.max(0,Math.min(t,e.flat.length-1)),r=e.flat[n];return{flatIndex:n,group:r.group??"_default",indexInGroup:r._groupIndex??0}}function el(e,t,n){const{group:r,indexInGroup:i}=t,o=n.byGroup.get(r);switch(e){case"ArrowRight":return i<o.length-1?o[i+1]._flatIndex:t.flatIndex;case"ArrowLeft":return i>0?o[i-1]._flatIndex:t.flatIndex;case"ArrowDown":{const e=n.groups.indexOf(r);return e<n.groups.length-1?tl(n,n.groups[e+1],o[i]):t.flatIndex}case"ArrowUp":{const e=n.groups.indexOf(r);return e>0?tl(n,n.groups[e-1],o[i]):t.flatIndex}case"PageDown":{const e=Math.max(1,Math.floor(.1*n.flat.length));return Math.min(t.flatIndex+e,n.flat.length-1)}case"PageUp":{const e=Math.max(1,Math.floor(.1*n.flat.length));return Math.max(t.flatIndex-e,0)}case"Home":return 0;case"End":return n.flat.length-1;case"Escape":return-1;default:return null}}function tl(e,t,n){const r=e.byGroup.get(t);let i=0,o=Math.abs(r[0].x-n.x);for(let e=1;e<r.length;e++){const t=Math.abs(r[e].x-n.x);t<o&&(o=t,i=e)}return r[i]._flatIndex}function nl(e,t,n){switch(e){case"ArrowRight":case"ArrowDown":return t<n-1?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":{const e=Math.max(1,Math.floor(.1*n));return Math.min(t+e,n-1)}case"PageUp":{const e=Math.max(1,Math.floor(.1*n));return Math.max(t-e,0)}case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}function rl(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(n.size<=0||null==n.datum)continue;const e=Fo(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 if("line"===n.type){if(null==n.datum||n.path.length<2)continue;const e=n.path.slice(1).map((e,t)=>Math.hypot(e[0]-n.path[t][0],e[1]-n.path[t][1]));let r=e.reduce((e,t)=>e+t,0)/2;if(!Number.isFinite(r)||r<=0)continue;for(let i=0;i<e.length;i++){const o=e[i];if(o>0&&r<=o){const e=n.path[i],a=n.path[i+1],s=r/o;t.push({x:e[0]+(a[0]-e[0])*s,y:e[1]+(a[1]-e[1])*s,datum:Ms(n.datum),shape:"path",pathData:`M${n.path.map(e=>e.join(",")).join("L")}`});break}r-=o}}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 il(e,t,n,r,i,o){const a=n.current;if(t.current<0||!a)return;const s=e=>(e.datum===a.datum||void 0!==a.semanticKey&&e.semanticKey===a.semanticKey)&&e.group===a.group&&e.shape===a.shape,l=e[t.current]&&s(e[t.current])?t.current:e.findIndex(s),c=e[l];if(t.current=l,n.current=c??null,c&&c.datum===a.datum&&c.x===a.x&&c.y===a.y&&c.w===a.w&&c.h===a.h&&c.pathData===a.pathData&&c.stats===a.stats)return;const u=c?o(c):null;r.current=u,i(u)}function ol({storeRef:e,hoverRef:t,hoveredNodeRef:n,setHoverPoint:r,customHoverBehavior:i,customClickBehavior:o,scheduleRender:a,clearPointerHover:s,extractPoints:l,toHover:c,navigation:u="graph",nextConnected:d}){const h=(0,Qg.useRef)(-1),f=(0,Qg.useRef)(-1),p=(0,Qg.useRef)(null),m=(0,Qg.useRef)(null),g=(0,Qg.useCallback)(()=>{const i=e.current;if(!i)return;if(f.current<0)return void(m.current=null);const o=Qs(l(i.scene));m.current={version:i.version,graph:o},il(o.flat,f,p,t,r,e=>c(e,i)),f.current<0&&n&&(n.current=null)},[l,t,n,r,e,c]),y=(0,Qg.useCallback)(g=>{if(Ys(g))return;const y=e.current;if(!y)return;const b=()=>{const e=null!==t.current;f.current=-1,p.current=null,h.current=-1,t.current=null,n&&(n.current=null),r(null),e&&i?.(null),a()};if("Escape"===g.key)return g.preventDefault(),s?.(),void b();if(0===y.scene.length)return void(f.current>=0&&b());let v;if(m.current?.version===y.version)v=m.current.graph;else{const e=l(y.scene);if(0===e.length)return void(f.current>=0&&b());v=Qs(e),m.current={version:y.version,graph:v}}let x,w=f.current;if(w>=v.flat.length&&(b(),w=-1),("Enter"===g.key&&!d||" "===g.key)&&w>=0)return g.preventDefault(),void o?.(c(v.flat[w],y),{type:"activate",inputType:"keyboard"});if(w<0){if(!(["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(g.key)||d&&"Enter"===g.key))return;h.current=-1,x=0}else x=d?d(g.key,v,w,h):"linear"===u?nl(g.key,w,v.flat.length):el(g.key,Js(v,w),v);if(null===x)return;if(g.preventDefault(),x<0)return void b();f.current=x;const k=v.flat[x];p.current=k;const S=c(k,y);t.current=S,r(S),i?.(S,{type:"focus",inputType:"keyboard"}),a()},[s,o,i,l,d,u,t,n,a,r,e,c]);return{kbFocusIndexRef:f,focusedNavPointRef:p,neighborIndexRef:h,onKeyDown:y,refreshKeyboardFocus:g}}function al(e){const t=e.datum;return{...t||{},...t?.properties||{},data:t,properties:t?.properties,x:e.x,y:e.y,__semioticHoverData:!0}}function sl(e,t,n,r){return"function"==typeof e?e({size:t,margin:n,scales:r}):e}function ll({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?sl(e,n,r,i):null,resolvedBackground:s||"function"!=typeof t?sl(t,n,r,i):null,themeBackground:l,surfaceBackground:da({background:o,hasBackgroundGraphics:Boolean(t),themeBackground:l})}}function cl(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 ul({graphics:e,size:t,margin:n,readScales:r,tracker:i}){return(0,ey.useSyncExternalStore)(i.subscribe,i.getSnapshot,i.getSnapshot),Jg.createElement(Jg.Fragment,null,sl(e,t,n,r()))}function dl({tracker:e,readScales:t,...n}){const r=r=>"function"==typeof r?Jg.createElement(ul,{graphics:r,size:n.size,margin:n.margin,readScales:t,tracker:e}):r;return{...ll({...n,resolveScaleAwareGraphics:!1}),resolvedForeground:r(n.foregroundGraphics),resolvedBackground:r(n.backgroundGraphics)}}function hl(e,t,n){const r=e.current;r.inside=!0,r.clientX=t.clientX,r.clientY=t.clientY,r.pointerType=t.pointerType??n}function fl(e){var t,n,r;t=e.canvas,n=e.pointer,r=t=>{const n=Us({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?Ho(n.node):void 0},t&&(n.inside&&"touch"!==n.pointerType?Go(t,r(n)):Go(t))}function pl(e,t){return e.displayName=t,e}function ml(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 gl(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??.5;a.opacity=e,a.fillOpacity=e,a.strokeOpacity=e,n?.unselectedStyle&&Object.assign(a,n.unselectedStyle)}return a};return js(i,[i])}function yl(e){let t=null;const n=()=>(t||(t=(0,cy.createContext)(null)),t),r=bl(e);return[function({children:t,initialState:r}){const i=(0,cy.useRef)(r),o=(0,cy.useMemo)(()=>bl(e,i.current),[]),a=n();/* @__PURE__ */ /* @__PURE__ */
|
|
123
|
-
return(0,uy.jsx)(a.Provider,{value:o,children:t})},(e,t)=>{const i=n(),o=(0,cy.useContext)(i)??r,a=(0,cy.useRef)(e);a.current=e;const s=(0,cy.useRef)({hasValue:!1,value:void 0}),l=(0,cy.useCallback)(()=>{const e=a.current(o.getState()),n=s.current;return n.hasValue&&t&&t(n.value,e)?n.value:(s.current={hasValue:!0,value:e},e)},[o,t]),c=(0,cy.useCallback)(()=>a.current(o.getState()),[o]);return(0,cy.useSyncExternalStore)(o.subscribe,l,c)}]}function bl(e,t){const n=/* @__PURE__ */new Set;let r={...e(function(e){const t=e(r);if(vl(t)){r={...r,...t};for(const e of n)e()}}),...t??{}};return{getState:()=>r,subscribe:function(e){return n.add(e),()=>{n.delete(e)}}}}function vl(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function xl(){return hy(e=>e.theme)}function wl(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function kl(e){if(!("number"!=typeof e.height||e.height<=0))return e.width>=e.height?"landscape":"portrait"}function Sl(e){if(!("number"!=typeof e.height||e.height<=0))return e.width/e.height}function Ml(e,t){const{when:n}=e,r=t.width,i=t.height,o=Sl(t),a=kl(t);return!("number"==typeof n.minWidth&&r<n.minWidth||"number"==typeof n.maxWidth&&r>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof i||i<n.minHeight)||"number"==typeof n.maxHeight&&("number"!=typeof i||i>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||o<n.minAspectRatio)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function jl(e,t){const n={...e,...t};for(const r of["margin","frameProps","mobileSemantics","style"])wl(e[r])&&wl(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 Al(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=>Ml(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)=>jl(e,t.rule.transform),e),matches:r}}function Rl(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&&t.width<=480,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 fy;const s=a??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??r??44,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??44,standardControls:s.standardControls??!1}}function Cl(e,t,n){const r=py[e||"primary"],i=e&&"primary"!==e||!n?.width?r.width:n.width,o=e&&"primary"!==e||!n?.height?r.height:n.height,a=Al({...t,mode:e},{width:t.width??i,height:t.height??o}).props,s=a.mode||e||"primary",l=py[s],c="context"===s||"sparkline"===s,u="primary"===s&&n?.width?n.width:l.width,d="primary"===s&&n?.height?n.height:l.height;return{mode:s,width:a.width??u,height:a.height??d,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:Nl(l.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:Rl(a.mobileInteraction,{mode:s,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}function Ll(e){return e.compactMode?e.marginDefaults:my}function Nl(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 Pl(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 El(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?js({...t,xValue:e.xValue},As(t)):t||{}}function Il(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function Tl(e){const t=/* @__PURE__ */new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function zl(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Dl(e,t){const n=(0,yy.useContext)(vy),r=(0,yy.useId)(),i=Tl(e),o=i.map(e=>t?.(e)),a=(0,yy.useRef)({categories:[],colors:[]});zl(a.current.categories,i)&&zl(a.current.colors,o)||(a.current={categories:i,colors:o});const s=a.current;xy(()=>{if(n)return()=>n.unregisterCategories(r)},[n,r]),xy(()=>{n&&n.registerCategories(r,s)},[n,r,s])}function $l({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="function"==typeof t?e.find(e=>t(e)===i):e.find(e=>e[t]===i),s=a?r(a,t,n):n?n(i):Pf[o%Pf.length];return{label:String(i),color:s,__semioticCategory:!0}}),label:""}]}}function Fl(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(String(e))}return Array.from(n)}function Ol(e,t){return null!=e&&Object.hasOwn(e,t)}function _l(e,t,n){const r=Ol(n,"legendPosition"),i=Ol(n,"legendLayout");return{legendPosition:r?n?.legendPosition??"right":e??"right",legendLayout:i?n?.legendLayout:t}}function Bl({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}=_l(i,d,h),y=Ol(h,"legend"),b=(0,yy.useContext)(by),v=null!==(0,yy.useContext)(vy),x=void 0!==r?r:!b&&!!t,w=!!t&&(x||v),k=(0,gy.useMemo)(()=>w?void 0!==s?s:Fl(e,t):[],[s,t,e,w]);Dl(v&&t?k:[],n);const S=(0,gy.useMemo)(()=>{if(!x||!t)return;const r=$l({data:e,colorBy:t,colorScale:n,getColor:Ot,categories:k});return 0!==r.legendGroups.reduce((e,t)=>e+t.items.length,0)?r:void 0},[x,t,e,n,k]),M=(0,gy.useMemo)(()=>y?h?.legend:qn(S,l),[S,l,h?.legend,y]),{hasAxis:j,hasAxisLabel:A,rotatedTicks:R,topAxis:C,leftAxis:L,rightAxis:N}=p??{},P=void 0!==C,E=void 0!==L,I=void 0!==N,{hasAxis:T,hasAxisLabel:z,rotatedTicks:D}=C??{},{hasAxis:$,hasAxisLabel:F}=L??{},{hasAxis:O,hasAxisLabel:_}=N??{},B=(0,gy.useMemo)(()=>{const e="number"==typeof o?{top:o,bottom:o,left:o,right:o}:o??{},t=ar(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&&(nr(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:R,topAxis:P?{hasAxis:T,hasAxisLabel:z,rotatedTicks:D}:void 0,leftAxis:E?{hasAxis:$,hasAxisLabel:F}:void 0,rightAxis:I?{hasAxis:O,hasAxisLabel:_}:void 0}}),null!=c&&null!=u&&Un(r,i,[c,u],m)),r},[a,h?.axes,o,M,m,c,u,g,f,j,A,R,P,T,z,D,E,$,F,I,O,_]);return{legend:M,margin:B,legendPosition:m,legendLayout:g,legendMarginReserved:void 0!==M&&!Ol(h,"margin"),hasAutomaticLegend:void 0!==S}}function Wl(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 Hl(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function ql(e,t,n,r=!0,i=!1){const[o,a]=(0,gy.useState)(null),[s,l]=(0,gy.useState)(
|
|
124
|
-
/* @__PURE__ */new Set),c=(0,gy.useMemo)(()=>/* @__PURE__ */new Set,[]),u=(0,gy.useMemo)(()=>new Set(n),[n]),d=null!=o&&u.has(o)?o:null,h=(0,gy.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,gy.useEffect)(()=>{r&&t&&e&&"none"!==e||(a(null),l(e=>0===e.size?e:/* @__PURE__ */new Set))},[t,r,e]),(0,gy.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,gy.useCallback)(t=>{r&&"highlight"===e&&a(!t||!u.has(t.label)||i&&!0!==t.__semioticCategory?null:t.label)},[u,r,e,i]),p=(0,gy.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,gy.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:String(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 Gl(e,t,n,r=5){const[i,o]=n,[a,s]=(0,gy.useState)(null),[l,c]=(0,gy.useState)(/* @__PURE__ */new Map),u=(0,gy.useMemo)(()=>/* @__PURE__ */new Set,[]);(0,gy.useEffect)(()=>{s(null),c(/* @__PURE__ */new Map)},[i,o,r,e]);const d=(0,gy.useCallback)(t=>{if("highlight"!==e||!t)return void("highlight"===e&&s(null));const n=Wl(t);n&&s({key:Hl(t,n),range:n})},[e]),h=(0,gy.useCallback)(t=>{if("isolate"!==e)return;const n=Wl(t);n&&c(e=>{const i=new Map(e),o=Hl(t,n);return i.has(o)?i.delete(o):i.set(o,n),i.size===r?/* @__PURE__ */new Map:i})},[r,e]),f=(0,gy.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)&&r<=Math.max(e,t))}}},[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 Vl(){const e=xl(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function Ul(){const e=xl();return e?.colors?.sequential||void 0}function Yl(e,t,n){const r=(0,oy.useChartCategoryColors)(null!=n),i=Vl();return(0,iy.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=>String(t(e)))));if(o&&Il(o)){const e=Bt(n.map(e=>({_cat:e})),"_cat",a);return t=>_t(o,t)??e(t)}return Bt(n.map(e=>({_cat:e})),"_cat",a)}if(o&&Il(o)){const n=Bt(e,t,a);return e=>_t(o,e)??n(e)}return Bt(e,t,a)}if(o&&Il(o)){const e=Bt([{_:"a"}],"_",a);return t=>_t(o,t)??e(t)}},[e,t,n,r,i])}function Xl({selection:e,linkedHover:t,fallbackFields:n=wy,unwrapData:r=!1,onObservation:i,chartType:o,chartId:a,onClick:s,hoverHighlight:l,hoverHighlightField:c,colorByField:u,mobileInteraction:d,emitObservations:h=!0}){const f=(0,iy.useId)(),p=(0,sy.useCrosshairActions)(),{setCrosshairPosition:m,clearCrosshairPosition:g,toggleCrosshairLock:y,unlockCrosshair:b}=p,v=(0,iy.useRef)(p);v.current=p;const x=(0,iy.useMemo)(()=>ml(t,n),[t,n]),w=(0,iy.useMemo)(()=>"series"===x?.mode?[x.seriesField||u||n[0]].filter(e=>!!e):x?.fields||n,[x,u,n]),k=(0,ay.useSelection)({name:e?.name||"__unused__",fields:w}),S=(0,ay.useLinkedHover)({name:x?.name||"hover",fields:w}),M=(0,ly.useObservationSelector)(e=>e.pushObservation),j=(0,iy.useCallback)(e=>{i?.(e),M?.(e)},[i,M]),A=e?{isActive:k.isActive,predicate:k.predicate}:null,[R,C]=(0,iy.useState)(null),L=(0,iy.useRef)(!1),N=c||u||n[0],P=(0,iy.useMemo)(()=>{if(!l||null==R||!N)return null;const e=R,t=N;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:String(n[t]??""))===e}},[l,R,N]),E=(0,iy.useCallback)((e,n)=>{const r=!e&&L.current&&!!d?.enabled&&d.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===x?.mode&&x.xField){const n=Pl(e,t,x.xField);null!=n&&m(x.name||"hover",n,f)}"x-position"!==x?.mode&&S.onHover(t)}else"x-position"!==x?.mode||r||g(x.name||"hover",f),"x-position"===x?.mode||r||S.onHover(null);if(l&&N)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[N];C(null!=n?String(n):null)}else r||C(null);h&&(i||M)&&Xs({onObservation:j,datum:e?El(e):null,x:e?.x,y:e?.y,chartType:o||"unknown",chartId:a,context:n})},[t,S,x,f,i,o,a,M,j,h,l,N,d,m,g]),I=(0,iy.useCallback)((n=!0)=>{L.current=!1,t&&"x-position"!==x?.mode&&S.onHover(null),e&&d?.tapToSelect&&k.clear(),n&&l&&C(null),"x-position"===x?.mode&&(b(x.name||"hover",f),g(x.name||"hover",f))},[t,x,S,e,d,k,l,f,g,b]),T=(0,iy.useCallback)((n,r)=>{const c=!!d?.enabled&&(d.tapToLockTooltip||d.tapToSelect),u=!!d?.enabled&&"backgroundTap"===d.clearSelection;if("x-position"===x?.mode&&x.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=Pl(n,e,x.xField);null!=t&&y(x.name||"hover",t,f)}if(c)if(n){L.current=!0;const r=El(n);if(t&&"x-position"!==x?.mode&&S.onHover(r),e&&d?.tapToSelect&&w.length>0){const e=Cs(r,w);Il(e)&&k.selectPoints(e)}if(l&&N){const e=r?.[N];C(null!=e?String(e):null)}}else u&&I();if(n||u){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})}h&&(i||M)&&Zs({onObservation:j,datum:n?El(n):null,x:n?.x,y:n?.y,chartType:o||"unknown",chartId:a,context:r})}},[s,h,i,M,j,o,a,x,f,d,t,S,e,k,w,l,N,I,y]);(0,iy.useEffect)(()=>{if(!d?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&L.current&&I()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d?.enabled,I]);const z=(0,iy.useRef)(I);return z.current=I,(0,iy.useEffect)(()=>()=>{L.current&&z.current(!1)},[]),(0,iy.useEffect)(()=>{if("x-position"!==x?.mode)return;const e=x.name||"hover";return()=>{v.current.releaseCrosshair(e,f)}},[x?.mode,x?.name,f]),{activeSelectionHook:A,hoverSelectionHook:P,customHoverBehavior:E,customClickBehavior:T,crosshairSourceId:f}}function Zl(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 Kl(e,t,n){return Cl(e,t,n)}function Ql(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}function Jl(e,t){if(!Ql(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 ec(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>nc(t(e))}function tc(e,t){const n=ec(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:String(t)}}}function nc(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 rc(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=nc(r);if(void 0===i)return!1;if(void 0!==e.gt&&!(i>e.gt))return!1;if(void 0!==e.gte&&!(i>=e.gte))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(!(i>=t&&i<=n))return!1}if(void 0!==e.outside){const[t,n]=e.outside;if(!(i<t||i>n))return!1}return!0}function ic(e,t,n){const r=e.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(t,n):rc(r,t,n))}function oc(e,t,n){if(!t||0===t.length)return{};let r={};for(const i of t){if(!ic(i,e,n))continue;const t="function"==typeof i.style?i.style(e,n):i.style;t&&(r={...r,...t})}return r}function ac(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,oc(a,t,n(a,o))),s}:i}function sc({componentName:e,message:t,diagnosticHint:n,width:r,height:i}){/* @__PURE__ */ /* @__PURE__ */
|
|
125
|
-
return(0,ky.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,ky.jsxs)("div",{style:{textAlign:"center",maxWidth:400},children:[
|
|
119
|
+
/* @__PURE__ */(0,Fg.jsx)(qa,{tableId:t.tableId}),
|
|
126
120
|
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */(0,
|
|
121
|
+
/* @__PURE__ */(0,Fg.jsx)(Ba,{...t})]}):null}function Ba(e){const{scene:t,chartType:n,tableId:r,chartTitle:o}=e,s=Oa(),l=`Data summary for ${o||n}`;return t&&0!==t.length?/* @__PURE__ */ /* @__PURE__ */(0,Fg.jsx)(Da,{interaction:s,tableId:r,regionLabel:l,countLabel:a(i(t),"element"),children:s.isExpanded&&/* @__PURE__ */ /* @__PURE__ */(0,Fg.jsx)(kg.Suspense,{fallback:/* @__PURE__ */ /* @__PURE__ */(0,Fg.jsx)("div",{role:"status",children:"Loading data summary…"}),children:/* @__PURE__ */ /* @__PURE__ */(0,Fg.jsx)(Wg,{...e,revealRows:s.revealRows})})}):r?/* @__PURE__ */ /* @__PURE__ */(0,Fg.jsx)("span",{id:r,tabIndex:-1,style:Mg}):null}function Ha({summary:e}){return e?/* @__PURE__ */ /* @__PURE__ */(0,Fg.jsx)("div",{role:"note",style:Mg,children:e}):null}function qa({tableId:e}){const[t,n]=kg.useState(!1);/* @__PURE__ */ /* @__PURE__ */
|
|
122
|
+
return(0,Fg.jsx)("a",{href:`#${e}`,style:t?jg:Mg,onClick:t=>{t.preventDefault();const n=document.getElementById(e);n&&requestAnimationFrame(()=>n.focus())},onFocus:()=>n(!0),onBlur:()=>n(!1),children:"Skip to data table"})}function Ga(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],o=String(e);n.has(o)||(n.add(o),r.push(o))}return r}function Va(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ya(e,t,n,r){const i=(0,Bg.useRef)({accessor:t,onChange:n,readData:r}),o=(0,Bg.useRef)([]);i.current={accessor:t,onChange:n,readData:r};const a=(0,Bg.useCallback)(()=>{const{accessor:t,onChange:n,readData:r}=i.current;if(!n||!t)return;const a=Ga(e.current?r(e.current):[],t);Va(a,o.current)||(o.current=a,n(a))},[e]);return(0,Bg.useEffect)(()=>{o.current=[],a()},[t,a,n]),a}function Ua({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,Hg.jsx)("rect",{x:l-e/2-3,y:c-t/2-3,width:e+6,height:t+6,rx:3,fill:"none",stroke:qg,strokeWidth:2,strokeDasharray:"4,2"})}else u="wedge"===i?/* @__PURE__ */ /* @__PURE__ */(0,Hg.jsx)("circle",{cx:l,cy:c,r:12,fill:"none",stroke:qg,strokeWidth:2.5,strokeDasharray:"6,3"}):/* @__PURE__ */ /* @__PURE__ */(0,Hg.jsx)("circle",{cx:l,cy:c,r:8,fill:"none",stroke:qg,strokeWidth:2,strokeDasharray:"4,2"});else u=/* @__PURE__ */ /* @__PURE__ */(0,Hg.jsx)("g",{transform:`translate(${n.left},${n.top})`,children:/* @__PURE__ */ /* @__PURE__ */(0,Hg.jsx)("path",{d:s,fill:"none",stroke:qg,strokeWidth:2.5,strokeDasharray:"6,3"})});/* @__PURE__ */ /* @__PURE__ */
|
|
123
|
+
return(0,Hg.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 Xa(e){return null!=e&&"boolean"!=typeof e&&("string"==typeof e?e.trim().length>0:Array.isArray(e)?e.some(Xa):!Yg.isValidElement(e)||e.type!==Yg.Fragment||Xa(e.props.children))}function Za(){const e=globalThis;return e[Zg]??(e[Zg]=Yg.createContext(void 0))}function Ka(){return Yg.useContext(Za())}function Qa(e){let t;for(const n of e.childNodes)if(1===n.nodeType){if(t)return!1;t=n}else if(3===n.nodeType&&n.textContent?.trim())return!1;const n=t?.getAttribute("data-semiotic-tooltip-chrome");return!t||null!=n&&"false"!==n}function Ja(e,t){const[n,r]=Yg.useState(!1);return("undefined"==typeof window?Yg.useEffect:Yg.useLayoutEffect)(()=>{const i=t&&null!==e.current&&Qa(e.current);i!==n&&r(i)}),Yg.useEffect(()=>{const n=e.current;if(!t||!n)return;const i=new MutationObserver(()=>r(Qa(n)));return i.observe(n,{childList:!0,subtree:!0,characterData:!0,attributeFilter:["data-semiotic-tooltip-chrome"]}),()=>i.disconnect()},[t,e]),t&&n}function es(e){return e.ownsChrome=!0,e}function ts(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 ns(e){if("function"==typeof e)return!0===e.ownsChrome;if(!Yg.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(ts(i.background))return!0;if(ts(i.backgroundColor))return!0}return!1}function rs({x:e,y:t,containerWidth:n,containerHeight:r,margin:i,children:o,contentOwnsChrome:a=!1,className:s="stream-frame-tooltip",zIndex:l=1}){const c=Ka(),u=Number.isFinite(e)&&Number.isFinite(t),d=Xa(o),h=Gg.useRef(null),f="none"===c||a||ns(o),p=Ja(h,!f&&u&&d),m=f||p,[g,y]=Gg.useState(null);Gg.useLayoutEffect(()=>{const e=h.current;if(!e)return;const t=()=>{const t=getComputedStyle(e);let n=parseFloat(t.width),r=parseFloat(t.height);if(!n||!r){const t=e.getBoundingClientRect();n=n||t.width,r=r||t.height}Number.isFinite(n)&&Number.isFinite(r)&&y(e=>e&&e.ownsChrome===m&&Math.abs(e.width-n)<.5&&Math.abs(e.height-r)<.5?e:{width:n,height:r,ownsChrome:m})};if(t(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(()=>(0,Vg.flushSync)(t));return n.observe(e),()=>n.disconnect()},[s,n,r,u,d,m]);const b=Gg.useRef(null),v=g?.ownsChrome===m?g:null;let x,w=e,k=t,S=!1,M=!1;if(v){const i=r-t;S=n-e<v.width+12,M=i<v.height+12,w=Math.max(0,Math.min(e+(S?-v.width-12:12),n-v.width)),k=Math.max(0,Math.min(t+(M?-v.height-4:4),r-v.height)),x="none"}else x=`translate(${e>.7*n?"calc(-100% - 12px)":"12px"}, ${t<.3*r?"4px":"calc(-100% - 4px)"})`;const j=v?{flipX:S,flipY:M}:null,A=b.current,C=!j||!A||A.flipX!==j.flipX||A.flipY!==j.flipY;Gg.useLayoutEffect(()=>{b.current=j});const R=m?null:Xg,L=m?s:`${s} semiotic-tooltip`.trim();return u&&d?/* @__PURE__ */ /* @__PURE__ */(0,Qg.jsx)("div",{ref:h,className:L,"data-placement":j?"placed":"pending","data-flip-x":S?"true":"false","data-flip-y":M?"true":"false",style:{...R,position:"absolute",left:i.left+w,top:i.top+k,transform:x,transition:C?"none":void 0,pointerEvents:"none",zIndex:l,width:"max-content",maxWidth:m?n:`min(${n}px, ${Xg.maxWidth})`,boxSizing:"border-box"},children:o}):null}function is(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 os(e){switch(e){case"monotoneX":return ty.curveMonotoneX;case"monotoneY":return ty.curveMonotoneY;case"cardinal":return ty.curveCardinal;case"catmullRom":return ty.curveCatmullRom;case"step":return ty.curveStep;case"stepBefore":return ty.curveStepBefore;case"stepAfter":return ty.curveStepAfter;case"basis":return ty.curveBasis;case"natural":return ty.curveNatural;default:return null}}function as(e){return"string"==typeof e&&"none"===e.trim().toLowerCase()}function ss(e,t,n){return as(t)?"rgba(0,0,0,0)":null==t?n:Wi(t)?qi(t,e)||t.background&&On(e,t.background)||n:"string"!=typeof t?t:On(e,t)||n}function ls(e,t){if(null==t)return;const n=ss(e,t,"");return""===n?void 0:n}function cs(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(s.length<2)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)),us(e,t,n));return l}function us(e,t,n){const r=t.color??n,i=On(e,r)||r;if(null==t.opacity)return i;const o=Math.max(0,Math.min(1,t.opacity)),[a,s,l]=is(e,i);return`rgba(${a},${s},${l},${o})`}function ds(e){return e._pulseIntensity>0}function hs(e,t,n,r){if(!ds(t))return;const i="w"in t;e.globalAlpha=n*t._pulseIntensity*(i?.3:.35),e.fillStyle=t._pulseColor||"rgba(255,255,255,0.6)",r?e.fill(r):i?e.fillRect(t.x,t.y,t.w,t.h):e.fill()}function fs(e,t,n){if(!ds(t))return;const r=t._pulseGlowRadius??4,i=t.r+r*t._pulseIntensity,o=t.cx??t.x??0,a=t.cy??t.y??0;e.beginPath(),e.arc(o,a,i,0,2*Math.PI),e.strokeStyle=t._pulseColor||"rgba(255,255,255,0.6)",e.lineWidth=2*t._pulseIntensity,e.globalAlpha=n*t._pulseIntensity*.6,e.stroke()}function ps(e,t,n,r){const i=t.filter(e=>"geoarea"===e.type),o=e.globalAlpha;for(const t of i){if(!t.pathData)continue;t._cachedPath2D||(t._cachedPath2D=new Path2D(t.pathData));const n=t._cachedPath2D,r=o*(t._decayOpacity??1)*(t.style.opacity??1),i=as(t.style.fill)?void 0:ls(e,t.style.fill)||"#e0e0e0";i&&!as(i)&&(e.fillStyle=i,e.globalAlpha=r*(t.style.fillOpacity??1),e.fill(n));const a=t.style.strokeWidth??.5;if(t.style.stroke&&"none"!==t.style.stroke&&a>0){if(e.strokeStyle=On(e,t.style.stroke)||t.style.stroke,e.lineWidth=a,e.globalAlpha=r*(t.style.strokeOpacity??1),t.style.strokeDasharray){const n=t.style.strokeDasharray.split(",").map(Number);e.setLineDash(n)}else e.setLineDash([]);e.stroke(n)}hs(e,t,o,n),e.globalAlpha=o,e.setLineDash([])}}function ms(e,t,n){let r=n;for(const n of t)"lesser"===n.thresholdType?e<n.value&&(r=n.color):e>n.value&&(r=n.color);return r}function gs(e,t,n,r){if(e.length<2||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;i<e.length;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&&e<1&&Number.isFinite(e)).sort((e,t)=>e-t).filter((e,t,n)=>0===t||e!==n[t-1]),1];for(let e=1;e<h.length;e++){const t=h[e-1],i=h[e];o(ms(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 ys(e,t,n,r,i,o){if(t.length<2)return;const a=[0];for(let e=1;e<t.length;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;n<t.length-1;n++){const r=(a[n]+a[n+1])/2;let o=i;r<l&&(o*=r/l),s-r<l&&(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 bs(e,t,n){const r=e.globalAlpha;for(const i of t){if(i.path.length<2)continue;const t=i._introClipFraction;void 0!==t&&t<1&&(e.save(),e.beginPath(),e.rect(0,0,n.width*t,n.height),e.clip());const o=as(i.style.stroke),a=o?"#007bff":i.style.stroke||"#007bff",s=On(e,a)||a,l=o?0:i.style.strokeWidth??2,c=i.colorThresholds,u=i.rawValues;i.style.strokeDasharray?e.setLineDash(i.style.strokeDasharray.split(/[\s,]+/).map(Number)):e.setLineDash([]);const d=r*(i.style.opacity??1),h=d*(i.style.strokeOpacity??1);if(e.globalAlpha=h,l>0&&(e.lineWidth=l),e.lineCap=i.style.strokeLinecap||"butt",i.style._edgeFade&&l>0){const n=h;ys(e,i.path,s,l,n,i.style.strokeLinecap||"butt"),void 0!==t&&t<1&&e.restore(),e.globalAlpha=r,e.setLineDash([]),e.lineCap="butt";continue}const f=os(i.curve),p=c&&c.length>0&&u&&u.length===i.path.length,m=i._decayOpacities;if(l>0&&m&&m.length===i.path.length&&!p){e.strokeStyle=s;const t=h;for(let n=0;n<i.path.length-1;n++){const r=.5*(m[n]+m[n+1])*t;e.globalAlpha=r,e.beginPath(),e.moveTo(i.path[n][0],i.path[n][1]),e.lineTo(i.path[n+1][0],i.path[n+1][1]),e.stroke()}}else if(l>0&&!p){e.beginPath();const t=i.strokeGradient&&i.path.length>=2?cs(e,i.strokeGradient,s,i.path[0][0],0,i.path[i.path.length-1][0],0):null;if(e.strokeStyle=t||s,f)(0,ny.line)().x(e=>e[0]).y(e=>e[1]).curve(f).context(e)(i.path);else{const[t,n]=i.path[0];e.moveTo(t,n);for(let t=1;t<i.path.length;t++)e.lineTo(i.path[t][0],i.path[t][1])}e.stroke()}else if(l>0){const t=gs(i.path,u,c,s);for(const n of t){e.beginPath(),e.strokeStyle=On(e,n.color)||n.color,e.moveTo(n.path[0][0],n.path[0][1]);for(let t=1;t<n.path.length;t++)e.lineTo(n.path[t][0],n.path[t][1]);e.stroke()}}if(i.style.fill&&i.style.fillOpacity&&i.style.fillOpacity>0){if(e.beginPath(),e.globalAlpha=d*i.style.fillOpacity,e.fillStyle=ss(e,i.style.fill,i.style.fill),f&&!p)(0,ny.line)().x(e=>e[0]).y(e=>e[1]).curve(f).context(e)(i.path);else{const[t,n]=i.path[0];e.moveTo(t,n);for(let t=1;t<i.path.length;t++)e.lineTo(i.path[t][0],i.path[t][1])}const t=i.path[i.path.length-1][0],r=i.path[0][0];e.lineTo(t,n.height),e.lineTo(r,n.height),e.closePath(),e.fill()}void 0!==t&&t<1&&e.restore(),e.globalAlpha=r,e.setLineDash([]),e.lineCap="butt"}}function vs(e,t){if(0!==t.length){e.save();try{const n=e.globalAlpha;let r=[],i="";const o=(t,r)=>{if(e.beginPath(),r)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);else e.arc(t.x,t.y,t.r,0,2*Math.PI);const i=n*(t.style.opacity??1)*(t._decayOpacity??1);e.globalAlpha=i*(t.style.fillOpacity??1),e.fillStyle=ss(e,t.style.fill,"#4e79a7"),e.fill();const o=t.style.strokeWidth??1;t.style.stroke&&"none"!==t.style.stroke&&o>0&&(e.strokeStyle=ss(e,t.style.stroke,t.style.stroke),e.lineWidth=o,e.globalAlpha=i*(t.style.strokeOpacity??1),e.stroke()),fs(e,t,n)},a=()=>{0!==r.length&&(o(r[0],r.length>1?r:void 0),r=[],i="")};for(const e of t){const t=n*(e.style.opacity??1)*(e._decayOpacity??1),s=e.style.fill;if(ds(e)||null!=s&&"string"!=typeof s||t*(e.style.fillOpacity??1)<1||t*(e.style.strokeOpacity??1)<1){a(),o(e);continue}const l=e.style.strokeWidth??1,c=`${s??"#4e79a7"}\0${e.style.stroke&&"none"!==e.style.stroke&&l>0?String(e.style.stroke):""}\0${l}\0${e.r}\0${t}`;r.length>0&&c!==i&&a(),i=c,r.push(e),r.length>=2048&&a()}a()}finally{e.restore()}}}function xs(e,t,n,r,i){if(t.size<=0)return;const o=t.glyph;if(!o||!o.parts?.length)return;const a=Xo(o,t.size);if(a.scale<=0)return;const s=t._decayOpacity??1,l=(t.style.opacity??1)*s;if(l<=0)return;const c=t=>{const n=ss(e,t,t);return"string"==typeof n?n:t},u=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*l*(t.style.fillOpacity??1);const d=Jo(o,t.fraction??1,t.fractionStart??0,t.fractionDirection??"horizontal");d&&t.ghostColor&&ta(e,o,u,t.accent,t.ghostColor,c),d&&(e.beginPath(),e.rect(d.x,d.y,d.width,d.height),e.clip()),ta(e,o,u,t.accent,void 0,c),e.restore()}function ws(e,t){const n=e.globalAlpha;for(const r of t){const t=r;xs(e,t,t.x,t.y,n)}e.globalAlpha=n}function ks(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;e<m;++e)for(let t=h;t<f;++t)g.push([t,e,s]);return{tiles:g,translate:[u/c,d/c],scale:c}}function Ss([e,t,n]){const r=1<<n;return[e-Math.floor(e/r)*r,t,n]}function Ms(e,t,n,r,i){return"function"==typeof e?e(t,n,r,i):e.replaceAll("{z}",String(t)).replaceAll("{x}",String(n)).replaceAll("{y}",String(r)).replaceAll("{r}",i>1?"@2x":"")}function js(e){if("string"==typeof e)return`template:${e}`;const t=e;let n=ry.get(t);return null==n&&(n=iy++,ry.set(t,n)),`provider:${n}`}function As(e){return Number.isFinite(e)?Math.max(1,Math.floor(e)):256}function Cs(e,t){const{tileURL:n,projection:r,width:i,height:o,tileCache:a,onTileLoad:s,maxDevicePixelRatio:l}=t,c=r.scale(),u=r([0,0])??r.translate(),d=ks({size:[i,o],scale:2*c*Math.PI,translate:u,clampX:!1}),h=xa(l,[i,o]),f=js(n);let p=!0;for(const t of d.tiles){const[r,i,o]=Ss(t),l=Ms(n,o,r,i,h),c=`${f}|dpr:${h}|${o}/${r}/${i}|${l}`;let u=a.get(c);if(!u||u.failed&&(u.attempts??1)<3&&Date.now()>=(u.retryAt??1/0)){const e=new Image;e.crossOrigin="anonymous";const t={img:e,loaded:!1,failed:!1,key:c,lastUsed:performance.now(),attempts:(u?.attempts??0)+1};a.set(c,t),e.onload=()=>{t.loaded=!0,s?.()},e.onerror=()=>{t.loaded=!0,t.failed=!0,t.retryAt=Date.now()+1e3,s?.()},e.src=l,u=t}if(!u.loaded){p=!1;continue}if(u.failed)continue;const m=d.scale,g=d.translate[0],y=d.translate[1],b=(t[0]+g)*m,v=(t[1]+y)*m;e.drawImage(u.img,b-.5,v-.5,m+1,m+1)}return p}function Rs(e){let t=0;for(let n=1;n<e.length;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 Ls(e,t){let n=0;for(let r=1;r<e.length;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 Ns(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 Ps(...e){const t=e.filter(e=>null!=e);return 0===t.length?null:1===t.length?t[0]:sy.createElement(sy.Fragment,null,...t)}function Is({value:e,children:t}){const n=(Og??(Og=ly.createContext(null)),Og);/* @__PURE__ */ /* @__PURE__ */
|
|
124
|
+
return(0,cy.jsx)(n.Provider,{value:e,children:t})}function Es(e,t){return null!=e?/* @__PURE__ */ /* @__PURE__ */(0,cy.jsx)(Is,{value:t,children:e}):e}function Ts(e){if(!e||"object"!=typeof e)return!1;const t=e;return"string"==typeof t.id&&"function"==typeof t.cacheKey&&"function"==typeof t.drawCanvas&&"function"==typeof t.renderStaticSVG}function zs(e,t){const n="function"==typeof e?e(t.datum??null,t):e;return Ts(n)?n:void 0}function $s(e,t){if("production"===process.env.NODE_ENV)return;const n=`${e}:${t}`;uy.has(n)||(uy.add(n),console.warn(`[Semiotic] Render backend "${e}" does not support scene node "${t}"; using the built-in renderer.`))}function Ds(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=zs(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||($s(n.id,e.type??"unknown"),o([e]))}s()}function Os(e){const{node:t,index:n,renderMode:r,fallback:i}=e,o=zs(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:da(a,t,`${o.id}-${n}-cursor`),renderedByBackend:!0}:($s(o.id,t.type??"unknown"),{element:i(),renderedByBackend:!1})}function Fs(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=ea(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 _s(e){if(!Number.isFinite(e))return String(e);const t=Number.isInteger(e)?e:Number(e.toPrecision(6));return Math.abs(t)>9999?t.toLocaleString():String(t)}function Ws(e,t){return"touch"===t?Math.max(e,24):e}function Bs(e){return Array.isArray(e)?e[0]:e}function Hs(e,t){return t?.length?(Object.defineProperty(e,dy,{configurable:!0,enumerable:!1,value:t}),e):e}function qs(e){return e?.[dy]}function Gs(e){return e.parentLine?Hs({...e.parentLine,...e},qs(e)):e}function Vs(e,t){const n=Gs(e),r={};for(const i of t){const t=n[i];if(void 0!==t){r[i]=[t];continue}const o=qs(e)?.map(e=>Gs(e)[i]).filter(e=>void 0!==e);o?.length&&(r[i]=[...new Set(o)])}return r}function Ys(e){const t=!0===e?.__semioticHoverData,n=e&&("node"===e.type||"edge"===e.type||void 0!==e.nodeOrEdge||void 0!==e.allSeries||void 0!==e.stats||void 0!==e.__chartType),r=t||e&&void 0!==e.data&&"number"==typeof e.x&&"number"==typeof e.y&&n;let i=Bs(r?e.data??{}:e);if(!i)return null;if(("node"===e?.nodeOrEdge&&"number"==typeof i?.x0&&"number"==typeof i?.x1||"edge"===e?.nodeOrEdge&&"number"==typeof i?.sankeyWidth)&&i.data&&"object"==typeof i.data&&(i=i.data),!i)return null;if(r&&(void 0!==e.allSeries||void 0!==e.xValue)){const t=Hs({...i},qs(i));void 0!==e.allSeries&&void 0===t.allSeries&&(t.allSeries=e.allSeries),void 0!==e.xValue&&void 0===t.xValue&&(t.xValue=e.xValue),i=t}return i}function Us(e){return e.getHours()||e.getMinutes()||e.getSeconds()||e.getMilliseconds()?e.toLocaleString():e.toLocaleDateString()}function Xs(e,t){for(const n of t){const t=e.find(e=>e.lower===n);if(t)return t}}function Zs(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&&my.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=>hy.includes(e.lower));const a=o>=0;o<0&&(o=i.findIndex(e=>"id"===e.lower)),o<0&&(o=i.findIndex(e=>"string"==typeof e.value));const s=o>=0?i[o]:void 0,l=i.filter((e,t)=>t!==o&&(!a||"id"!==e.lower)),c=Xs(l,fy),u=Xs(l,py),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;fy.includes(e.lower)||py.includes(e.lower)||d.push({key:e.key,value:e.value})}return{titleKey:s?.key,title:s?.value,entries:d}}function Ks(e,t){return"function"==typeof t?t(e):e[t]}function Qs(e,t){if(t)return t(e);if(null==e)return"";if("number"==typeof e)return Number.isFinite(e)?_s(e):String(e);if(e instanceof Date)return Us(e);if("object"==typeof e&&null!==e){const t=e;if(void 0!==t.id)return String(t.id);if(void 0!==t.name)return String(t.name);try{return JSON.stringify(e)}catch{return Array.isArray(e)?`[Array(${e.length})]`:"[Object]"}}return String(e)}function Js(e,t,n){const r="string"==typeof t?t:t.accessor||t.key||"";return{label:"string"==typeof t?t:t.label,value:Qs(Ks(e,r),"string"==typeof t?n:t.format||n)}}function el(e={}){const{fields:t,chrome:n,title:r,format:i,style:o={},className:a=""}=e;return e=>{if(!e||"object"!=typeof e)return null;let s;const l=[];if(r){const t=Ks(e,r);s=Qs(t,i)}if(t&&t.length>0)l.push(...t.map(t=>Js(e,t,i)));else if(!r){const t=["value","y","name","id","label"];for(const n of t)if(void 0!==e[n]){s=Qs(e[n],i);break}if(!s){const t=Object.keys(e).filter(e=>!e.startsWith("_"));t.length>0&&(s=Qs(e[t[0]],i))}}/* @__PURE__ */ /* @__PURE__ */
|
|
125
|
+
return(0,gy.jsxs)(Kg,{chrome:n,className:a,style:o,children:[s&&/* @__PURE__ */ /* @__PURE__ */(0,gy.jsx)("div",{style:{fontWeight:l.length>0?"bold":"normal"},children:s}),l.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,gy.jsxs)("div",{style:{marginTop:0===t&&s?"4px":0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,gy.jsxs)("span",{children:[e.label,": "]}),e.value]},t))]})}}function tl(e={}){const{fields:t=[],chrome:n,title:r,format:i,style:o={},className:a="",showLabels:s=!0,separator:l=": "}=e;return e=>{if(!e||"object"!=typeof e)return null;const c=[];if(r){const t=Ks(e,r);c.push({value:Qs(t,i)})}if(t&&Array.isArray(t)&&t.length>0)for(const n of t){const t=Js(e,n,i);c.push({...t,label:s?t.label:void 0})}else{const t=Zs(e,{skipPositional:!1});null!=t.title&&c.push({label:void 0,value:Qs(t.title,i),bold:!0}),t.entries.forEach(e=>{c.push({label:s?e.key:void 0,value:Qs(e.value,i)})})}return Array.isArray(c)&&0!==c.length?/* @__PURE__ */ /* @__PURE__ */(0,gy.jsx)(Kg,{chrome:n,className:`semiotic-tooltip-multiline ${a}`.trim(),style:o,children:c.map((e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,gy.jsxs)("div",{style:{marginBottom:t<c.length-1?"4px":0,fontWeight:e.bold?"bold":void 0},children:[e.label&&/* @__PURE__ */ /* @__PURE__ */(0,gy.jsxs)("strong",{children:[e.label,l]}),e.value]},t))}):null}}function nl(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&"mode"in e&&"multi"===e.mode}function rl(e){if(!0!==e){if("function"==typeof e||"object"==typeof e&&null!==e&&"content"in e&&"function"==typeof e.content&&!nl(e)){const t="function"==typeof e?e:e.content,n="function"==typeof e?void 0:e.chrome,r=e=>{const r=Ys(e);if(!r)return null;const i=t(r);return Xa(i)?void 0===n&&(ns(t)||ns(i))?i:/* @__PURE__ */ /* @__PURE__ */(0,gy.jsx)(Kg,{chrome:n,children:i}):null};return void 0===n&&ns(t)?es(r):r}if(!1===e||void 0===e)return!1;if(nl(e)){if("function"==typeof e.content)return yy||"production"===process.env.NODE_ENV||(yy=!0,console.warn('[semiotic] tooltip={{ mode: "multi", content }} reached a chart without multi-series hover. content receives one datum and no allSeries.')),rl(void 0===e.chrome?e.content:{content:e.content,chrome:e.chrome});"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=tl({chrome:e.chrome});return rl(e=>t(e))}if("object"==typeof e&&null!==e&&("fields"in e||"title"in e||"chrome"in e)){const t=el(e);return rl(e=>t(e))}if("multi"===e){"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=tl();return rl(t=>e(t))}return el()}}function il(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;c=Math.max(0,Math.min(1,c));const u=n+c*a,d=r+c*s;return Math.sqrt((e-u)**2+(t-d)**2)}function ol(e,t=30,n=1){return Math.max((e??4)+5/n,12/n,t)}function al(e,t,n,r,i,o=e=>e.x,a=e=>e.y,s=e=>e.r,l,c=1){const u=ol(i,r,c),d=t-u,h=t+u,f=n-u,p=n+u;let m=null,g=1/0;return e.visit((e,i,u,y,b)=>{if(i>h||y<d||u>p||b<f)return!0;const v=e;if(!v.length){let e=v;do{const i=e.data,u=o(i)-t,d=a(i)-n,h=Math.sqrt(u*u+d*d);h<=ol(s(i),r,c)&&(null===m||(l?l(i,m,h,g):h<g))&&(m=i,g=h),e=e.next}while(e)}return!1}),m?{node:m,distance:g}:null}function sl(e,t,n,r,i,o,a=0,s=r){if(o){const e=al(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);l<=ol(a.r,r)&&l<o&&(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=ea(i.glyph,i.size),o=i.x+e.centerDx-t,a=i.y+e.centerDy-n,s=Math.sqrt(o*o+a*a);s<=ol(e.radius,r)&&s<c&&(l=i,c=s)}if(l)return{node:l,distance:c};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;r<i.length-1;r++){const s=i[r],f=i[r+1],p=s[0],m=s[1],g=f[0],y=f[1];if(p<a&&g<a||p>l&&g>l||m<c&&y<c||m>h&&y>h)continue;const b=il(t,n,p,m,g,y);b<=o&&b<d&&(u=e,d=b)}}if(u)return{node:u,distance:d};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(!(t<s||t>c||n<l||n>u)&&(a._cachedPath2D||(a._cachedPath2D=new Path2D(a.pathData)),i.isPointInPath(a._cachedPath2D,t,n)))return{node:a,distance:0}}return null}function ll(){if(null!==wy)return wy;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&&navigator.hardwareConcurrency<=4,n="undefined"!=typeof navigator&&"number"==typeof navigator.deviceMemory&&navigator.deviceMemory<=4;return wy=e||t||n}function cl(){return ll()?12:30}function ul(e){return"string"==typeof e?e:"object"==typeof e&&e&&"type"in e?e.type:null}function dl(e){const t=e.pointer.clientX-e.canvasRect.left-e.margin.left,n=e.pointer.clientY-e.canvasRect.top-e.margin.top;if(t<0||t>e.width||n<0||n>e.height)return{kind:"outside"};e.hitCanvasRef.current||(e.hitCanvasRef.current="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"));const r=(i=e.hitCanvasRef.current)?i.getContext("2d"):null;var i;if(!r)return{kind:"unavailable"};const o=sl(e.scene,t,n,Ws(30,e.pointer.pointerType),r,e.pointQuadtree,e.maxPointRadius,Ws(6,e.pointer.pointerType));if(!o)return{kind:"miss"};const{node:a}=o,s=a.datum,l=Array.isArray(s)?null:s?.properties?s:s?.data||s,c="point"===a.type?a.x:"geoarea"===a.type?a.centroid[0]:t,u="point"===a.type?a.y:"geoarea"===a.type?a.centroid[1]:n;return{kind:"hit",node:a,hover:{...l,...l?.properties||{},data:l,properties:l?.properties,__semioticHoverData:!0,x:c,y:u}}}function hl(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 fl(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 pl(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 ml({customHoverBehavior:e,customClickBehavior:t,onObservation:n,chartId:r,chartType:i}){const o=Boolean(e||n),a=Boolean(t||n),s=(0,Sy.useCallback)((t,o)=>{e?.(t,o),fl({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,Sy.useCallback)((e,o)=>{t?.(e,o),pl({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 gl(e,t=!1){const n=(e,t)=>e.x-t.x||e.y-t.y,r=/* @__PURE__ */new Map;for(const t of e){const e=t.group??"_default";let n=r.get(e);n||(n=[],r.set(e,n)),n.push(t)}for(const e of r.values()){t||e.sort(n);for(let t=0;t<e.length;t++)e[t]._groupIndex=t}const i=Array.from(r.keys());t||i.sort((e,t)=>r.get(e)[0].y-r.get(t)[0].y);const o=t?e:Array.from(r.values()).flat().sort(n),a=/* @__PURE__ */new Map;for(let e=0;e<o.length;e++){o[e]._flatIndex=e;const t=o[e].navId??o[e].datum?.id;null!=t&&a.set(String(t),e);const n=o[e].datum?.id;null==n||a.has(String(n))||a.set(String(n),e)}return{flat:o,groups:i,byGroup:r,idToIdx:a}}function yl(e,t){if(0===e.flat.length)return{flatIndex:-1,group:"_default",indexInGroup:-1};const n=Math.max(0,Math.min(t,e.flat.length-1)),r=e.flat[n];return{flatIndex:n,group:r.group??"_default",indexInGroup:r._groupIndex??0}}function bl(e,t,n){const{group:r,indexInGroup:i}=t,o=n.byGroup.get(r);switch(e){case"ArrowRight":return i<o.length-1?o[i+1]._flatIndex:t.flatIndex;case"ArrowLeft":return i>0?o[i-1]._flatIndex:t.flatIndex;case"ArrowDown":{const e=n.groups.indexOf(r);return e<n.groups.length-1?vl(n,n.groups[e+1],o[i]):t.flatIndex}case"ArrowUp":{const e=n.groups.indexOf(r);return e>0?vl(n,n.groups[e-1],o[i]):t.flatIndex}case"PageDown":{const e=Math.max(1,Math.floor(.1*n.flat.length));return Math.min(t.flatIndex+e,n.flat.length-1)}case"PageUp":{const e=Math.max(1,Math.floor(.1*n.flat.length));return Math.max(t.flatIndex-e,0)}case"Home":return 0;case"End":return n.flat.length-1;case"Escape":return-1;default:return null}}function vl(e,t,n){const r=e.byGroup.get(t);let i=0,o=Math.abs(r[0].x-n.x);for(let e=1;e<r.length;e++){const t=Math.abs(r[e].x-n.x);t<o&&(o=t,i=e)}return r[i]._flatIndex}function xl(e,t,n){switch(e){case"ArrowRight":case"ArrowDown":return t<n-1?t+1:t;case"ArrowLeft":case"ArrowUp":return t>0?t-1:t;case"PageDown":{const e=Math.max(1,Math.floor(.1*n));return Math.min(t+e,n-1)}case"PageUp":{const e=Math.max(1,Math.floor(.1*n));return Math.max(t-e,0)}case"Home":return 0;case"End":return n-1;case"Escape":return-1;default:return null}}function wl(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(n.size<=0||null==n.datum)continue;const e=ea(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 if("line"===n.type){if(null==n.datum||n.path.length<2)continue;const e=n.path.slice(1).map((e,t)=>Math.hypot(e[0]-n.path[t][0],e[1]-n.path[t][1]));let r=e.reduce((e,t)=>e+t,0)/2;if(!Number.isFinite(r)||r<=0)continue;for(let i=0;i<e.length;i++){const o=e[i];if(o>0&&r<=o){const e=n.path[i],a=n.path[i+1],s=r/o;t.push({x:e[0]+(a[0]-e[0])*s,y:e[1]+(a[1]-e[1])*s,datum:Bs(n.datum),shape:"path",pathData:`M${n.path.map(e=>e.join(",")).join("L")}`});break}r-=o}}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 kl(e,t,n,r,i,o){const a=n.current;if(t.current<0||!a)return;const s=e=>(e.datum===a.datum||void 0!==a.semanticKey&&e.semanticKey===a.semanticKey)&&e.group===a.group&&e.shape===a.shape,l=e[t.current]&&s(e[t.current])?t.current:e.findIndex(s),c=e[l];if(t.current=l,n.current=c??null,c&&c.datum===a.datum&&c.x===a.x&&c.y===a.y&&c.w===a.w&&c.h===a.h&&c.pathData===a.pathData&&c.stats===a.stats)return;const u=c?o(c):null;r.current=u,i(u)}function Sl({storeRef:e,hoverRef:t,hoveredNodeRef:n,setHoverPoint:r,customHoverBehavior:i,customClickBehavior:o,scheduleRender:a,clearPointerHover:s,extractPoints:l,toHover:c,navigation:u="graph",nextConnected:d}){const h=(0,My.useRef)(-1),f=(0,My.useRef)(-1),p=(0,My.useRef)(null),m=(0,My.useRef)(null),g=(0,My.useCallback)(()=>{s?.();const e=null!==t.current;f.current=-1,p.current=null,h.current=-1,t.current=null,n&&(n.current=null),r(null),e&&i?.(null),a()},[s,t,n,r,i,a]),y=(0,My.useCallback)(e=>{e.currentTarget.contains(e.relatedTarget)||g()},[g]),b=(0,My.useRef)(i);b.current=i;const v=(0,My.useCallback)(()=>{const i=e.current;if(!i)return;if(f.current<0)return void(m.current=null);const o=gl(l(i.scene),"ordered"===u);m.current={version:i.version,graph:o};const a=t.current;kl(o.flat,f,p,t,r,e=>c(e,i)),a&&!t.current&&b.current?.(null),f.current<0&&n&&(n.current=null)},[u,l,t,n,r,e,c]),x=(0,My.useCallback)(n=>{if(hl(n))return;const y=e.current;if(!y)return;if(0===y.scene.length)return void((f.current>=0||"Escape"===n.key)&&g());let b;if(m.current?.version===y.version)b=m.current.graph;else{const e=l(y.scene);if(0===e.length)return void((f.current>=0||"Escape"===n.key)&&g());b=gl(e,"ordered"===u),m.current={version:y.version,graph:b}}if("Escape"===n.key){const e=d?.("Escape",b,f.current,h);if(null==e||e<0)return n.preventDefault(),s?.(),void g();n.stopPropagation()}let v,x=f.current;if(x>=b.flat.length&&(g(),x=-1),("Enter"===n.key&&!d||" "===n.key)&&x>=0)return n.preventDefault(),void o?.(c(b.flat[x],y),{type:"activate",inputType:"keyboard"});if(x<0){if(!(["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(n.key)||d&&"Enter"===n.key))return;h.current=-1,v=d&&b.flat.some(e=>null!=e.navParentId)?d(n.key,b,-1,h)??0:"End"===n.key?b.flat.length-1:"PageDown"===n.key?xl(n.key,-1,b.flat.length):0}else v=d?d(n.key,b,x,h):"linear"===u?xl(n.key,x,b.flat.length):bl(n.key,yl(b,x),b);if(null===v)return;if(n.preventDefault(),v<0)return void g();f.current=v;const w=b.flat[v];p.current=w;const k=c(w,y);t.current=k,r(k),i?.(k,{type:"focus",inputType:"keyboard"}),a()},[g,s,o,i,l,d,u,t,a,r,e,c]);return{kbFocusIndexRef:f,focusedNavPointRef:p,neighborIndexRef:h,onKeyDown:x,onBlur:y,clearFocus:g,refreshKeyboardFocus:v}}function Ml(e){const t=e.datum;return{...t||{},...t?.properties||{},data:t,properties:t?.properties,x:e.x,y:e.y,__semioticHoverData:!0}}function jl(e,t,n,r){return"function"==typeof e?e({size:t,margin:n,scales:r}):e}function Al({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?jl(e,n,r,i):null,resolvedBackground:s||"function"!=typeof t?jl(t,n,r,i):null,themeBackground:l,surfaceBackground:La({background:o,hasBackgroundGraphics:Boolean(t),themeBackground:l})}}function Cl(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 Rl({graphics:e,size:t,margin:n,readScales:r,tracker:i}){return(0,Ay.useSyncExternalStore)(i.subscribe,i.getSnapshot,i.getSnapshot),jy.createElement(jy.Fragment,null,jl(e,t,n,r()))}function Ll({tracker:e,readScales:t,...n}){const r=r=>"function"==typeof r?jy.createElement(Rl,{graphics:r,size:n.size,margin:n.margin,readScales:t,tracker:e}):r;return{...Al({...n,resolveScaleAwareGraphics:!1}),resolvedForeground:r(n.foregroundGraphics),resolvedBackground:r(n.backgroundGraphics)}}function Nl(e,t,n){const r=e.current;r.inside=!0,r.clientX=t.clientX,r.clientY=t.clientY,r.pointerType=t.pointerType??n}function Pl(e){var t,n,r;t=e.canvas,n=e.pointer,r=t=>{const n=dl({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?sa(n.node):void 0},t&&(n.inside&&"touch"!==n.pointerType?ca(t,r(n)):ca(t))}function Il(e,t){return e.displayName=t,e}function El(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 Tl(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??.5;a.opacity=(a.opacity??1)*e,n?.unselectedStyle&&Object.assign(a,n.unselectedStyle)}return a};return Hs(i,[i])}function zl(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function $l(e){if(!("number"!=typeof e.height||e.height<=0))return e.width>=e.height?"landscape":"portrait"}function Dl(e){if(!("number"!=typeof e.height||e.height<=0))return e.width/e.height}function Ol(e,t){const{when:n}=e,r=t.width,i=t.height,o=Dl(t),a=$l(t);return!("number"==typeof n.minWidth&&r<n.minWidth||"number"==typeof n.maxWidth&&r>n.maxWidth||"number"==typeof n.minHeight&&("number"!=typeof i||i<n.minHeight)||"number"==typeof n.maxHeight&&("number"!=typeof i||i>n.maxHeight)||"number"==typeof n.minAspectRatio&&("number"!=typeof o||o<n.minAspectRatio)||"number"==typeof n.maxAspectRatio&&("number"!=typeof o||o>n.maxAspectRatio)||n.orientation&&a!==n.orientation)}function Fl(e,t){const n={...e,...t};for(const r of["margin","frameProps","mobileSemantics","style"])zl(e[r])&&zl(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 _l(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=>Ol(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)=>Fl(e,t.rule.transform),e),matches:r}}function Wl(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&&t.width<=480,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 $y;const s=a??{};return{enabled:!0,tapToSelect:s.tapToSelect??!0,tapToLockTooltip:s.tapToLockTooltip??!0,clearSelection:s.clearSelection??"backgroundTap",targetSize:s.targetSize??r??44,snap:s.snap??"nearestDatum",brushHandleSize:s.brushHandleSize??44,standardControls:s.standardControls??!1}}function Bl(e,t,n){const r=Dy[e||"primary"],i=e&&"primary"!==e||!n?.width?r.width:n.width,o=e&&"primary"!==e||!n?.height?r.height:n.height,a=_l({...t,mode:e},{width:t.width??i,height:t.height??o}).props,s=a.mode||e||"primary",l=Dy[s],c="context"===s||"sparkline"===s,u="primary"===s&&n?.width?n.width:l.width,d="primary"===s&&n?.height?n.height:l.height;return{mode:s,width:a.width??u,height:a.height??d,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:ql(l.marginDefaults,a.showCategoryTicks,a.orientation),compactMode:c,mobileInteraction:Wl(a.mobileInteraction,{mode:s,width:a.width??u,mobileSemantics:a.mobileSemantics}),mobileSemantics:a.mobileSemantics}}function Hl(e,t=zy){return e.compactMode?e.marginDefaults:t}function ql(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 Gl(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 Vl(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?Hs({...t,xValue:e.xValue},qs(t)):t||{}}function Yl(e){if(!e)return!1;for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function Ul(e){const t=/* @__PURE__ */new Set,n=[];for(const r of e)t.has(r)||(t.add(r),n.push(r));return n}function Xl(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Zl(e,t){const n=(0,Fy.useContext)(Wy),r=(0,Fy.useId)(),i=Ul(e),o=i.map(e=>t?.(e)),a=(0,Fy.useRef)({categories:[],colors:[]});Xl(a.current.categories,i)&&Xl(a.current.colors,o)||(a.current={categories:i,colors:o});const s=a.current;By(()=>{if(n)return()=>n.unregisterCategories(r)},[n,r]),By(()=>{n&&n.registerCategories(r,s)},[n,r,s])}function Kl({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="function"==typeof t?e.find(e=>t(e)===i):e.find(e=>e[t]===i),s=a?r(a,t,n):n?n(i):Yf[o%Yf.length];return{label:String(i),color:s,__semioticCategory:!0}}),label:""}]}}function Ql(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(String(e))}return Array.from(n)}function Jl(e,t){return null!=e&&Object.hasOwn(e,t)}function ec(e,t,n){const r=Jl(n,"legendPosition"),i=Jl(n,"legendLayout");return{legendPosition:r?n?.legendPosition??"right":e??"right",legendLayout:i?n?.legendLayout:t}}function tc({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}=ec(i,d,h),y=Jl(h,"legend"),b=(0,Fy.useContext)(_y),v=null!==(0,Fy.useContext)(Wy),x=void 0!==r?r:!b&&!!t,w=!!t&&(x||v),k=(0,Oy.useMemo)(()=>w?void 0!==s?s:Ql(e,t):[],[s,t,e,w]);Zl(v&&t?k:[],n);const S=(0,Oy.useMemo)(()=>{if(!x||!t)return;const r=Kl({data:e,colorBy:t,colorScale:n,getColor:Ot,categories:k});return 0!==r.legendGroups.reduce((e,t)=>e+t.items.length,0)?r:void 0},[x,t,e,n,k]),M=(0,Oy.useMemo)(()=>y?h?.legend:qn(S,l),[S,l,h?.legend,y]),{hasAxis:j,hasAxisLabel:A,rotatedTicks:C,topAxis:R,leftAxis:L,rightAxis:N}=p??{},P=void 0!==R,I=void 0!==L,E=void 0!==N,{hasAxis:T,hasAxisLabel:z,rotatedTicks:$}=R??{},{hasAxis:D,hasAxisLabel:O}=L??{},{hasAxis:F,hasAxisLabel:_}=N??{},W=(0,Oy.useMemo)(()=>{const e="number"==typeof o?{top:o,bottom:o,left:o,right:o}:o??{},t=gr(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&&(pr(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:P?{hasAxis:T,hasAxisLabel:z,rotatedTicks:$}:void 0,leftAxis:I?{hasAxis:D,hasAxisLabel:O}:void 0,rightAxis:E?{hasAxis:F,hasAxisLabel:_}:void 0}}),null!=c&&null!=u&&ir(r,i,[c,u],m)),r},[a,h?.axes,o,M,m,c,u,g,f,j,A,C,P,T,z,$,I,D,O,E,F,_]);return{legend:M,margin:W,legendPosition:m,legendLayout:g,legendMarginReserved:void 0!==M&&!Jl(h,"margin"),hasAutomaticLegend:void 0!==S}}function nc(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 rc(e,t){return"string"==typeof e.interactionKey?e.interactionKey:`${t[0]}:${t[1]}`}function ic(e,t,n,r=!0,i=!1){const[o,a]=(0,Oy.useState)(null),[s,l]=(0,Oy.useState)(
|
|
126
|
+
/* @__PURE__ */new Set),c=(0,Oy.useMemo)(()=>/* @__PURE__ */new Set,[]),u=(0,Oy.useMemo)(()=>new Set(n),[n]),d=null!=o&&u.has(o)?o:null,h=(0,Oy.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,Oy.useEffect)(()=>{r&&t&&e&&"none"!==e||(a(null),l(e=>0===e.size?e:/* @__PURE__ */new Set))},[t,r,e]),(0,Oy.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,Oy.useCallback)(t=>{r&&"highlight"===e&&a(!t||!u.has(t.label)||i&&!0!==t.__semioticCategory?null:t.label)},[u,r,e,i]),p=(0,Oy.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,Oy.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:String(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 oc(e,t,n,r=5){const[i,o]=n,[a,s]=(0,Oy.useState)(null),[l,c]=(0,Oy.useState)(/* @__PURE__ */new Map),u=(0,Oy.useMemo)(()=>/* @__PURE__ */new Set,[]);(0,Oy.useEffect)(()=>{s(null),c(e=>0===e.size?e:/* @__PURE__ */new Map)},[i,o,r,e]);const d=(0,Oy.useCallback)(t=>{if("highlight"!==e||!t)return void("highlight"===e&&s(null));const n=nc(t);n&&s({key:rc(t,n),range:n})},[e]),h=(0,Oy.useCallback)(t=>{if("isolate"!==e)return;const n=nc(t);n&&c(e=>{const i=new Map(e),o=rc(t,n);return i.has(o)?i.delete(o):i.set(o,n),i.size===r?/* @__PURE__ */new Map:i})},[r,e]),f=(0,Oy.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)&&r<=Math.max(e,t))}}},[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 ac(){const e=Tr(),t=e?.colors?.categorical;return t&&t.length>0?t:void 0}function sc(){const e=Tr();return e?.colors?.sequential||void 0}function lc(e,t,n){const r=(0,Py.useChartCategoryColors)(null!=n),i=ac();return(0,Ny.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=>String(t(e)))));if(o&&Yl(o)){const e=_t(n.map(e=>({_cat:e})),"_cat",a);return t=>Ft(o,t)??e(t)}return _t(n.map(e=>({_cat:e})),"_cat",a)}if(o&&Yl(o)){const n=_t(e,t,a);return e=>Ft(o,e)??n(e)}return _t(e,t,a)}if(o&&Yl(o)){const e=_t([{_:"a"}],"_",a);return t=>Ft(o,t)??e(t)}},[e,t,n,r,i])}function cc({selection:e,linkedHover:t,fallbackFields:n=Hy,unwrapData:r=!1,onObservation:i,chartType:o,chartId:a,onClick:s,hoverHighlight:l,hoverHighlightField:c,colorByField:u,mobileInteraction:d,emitObservations:h=!0}){const f=(0,Ny.useId)(),p=(0,Ey.useCrosshairActions)(),{setCrosshairPosition:m,clearCrosshairPosition:g,toggleCrosshairLock:y,unlockCrosshair:b}=p,v=(0,Ny.useRef)(p);v.current=p;const x=(0,Ny.useMemo)(()=>El(t,n),[t,n]),w=(0,Ny.useMemo)(()=>"series"===x?.mode?[x.seriesField||u||n[0]].filter(e=>!!e):x?.fields||n,[x,u,n]),k=(0,Iy.useSelection)({name:e?.name||"__unused__",fields:w}),S=(0,Iy.useLinkedHover)({name:x?.name||"hover",fields:w}),M=(0,Ty.useObservationSelector)(e=>e.pushObservation),j=(0,Ny.useCallback)(e=>{i?.(e),M?.(e)},[i,M]),A=e?{isActive:k.isActive,predicate:k.predicate}:null,[C,R]=(0,Ny.useState)(null),L=(0,Ny.useRef)(!1),N=c||u||n[0],P=(0,Ny.useMemo)(()=>{if(!l||null==C||!N)return null;const e=C,t=N;return{isActive:!0,predicate:n=>("string"==typeof n[t]?n[t]:String(n[t]??""))===e}},[l,C,N]),I=(0,Ny.useCallback)((e,n)=>{const r=!e&&L.current&&!!d?.enabled&&d.tapToLockTooltip;if(t)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"x-position"===x?.mode&&x.xField){const n=Gl(e,t,x.xField);null!=n&&m(x.name||"hover",n,f)}"x-position"!==x?.mode&&S.onHover(t)}else"x-position"!==x?.mode||r||g(x.name||"hover",f),"x-position"===x?.mode||r||S.onHover(null);if(l&&N)if(e){let t=e.data||e.datum||e;Array.isArray(t)&&(t=t[0]);const n=t?.[N];R(null!=n?String(n):null)}else r||R(null);h&&(i||M)&&fl({onObservation:j,datum:e?Vl(e):null,x:e?.x,y:e?.y,chartType:o||"unknown",chartId:a,context:n})},[t,S,x,f,i,o,a,M,j,h,l,N,d,m,g]),E=(0,Ny.useCallback)((n=!0)=>{L.current=!1,t&&"x-position"!==x?.mode&&S.onHover(null),e&&d?.tapToSelect&&k.clear(),n&&l&&R(null),"x-position"===x?.mode&&(b(x.name||"hover",f),g(x.name||"hover",f))},[t,x,S,e,d,k,l,f,g,b]),T=(0,Ny.useCallback)((n,r)=>{const c=!!d?.enabled&&(d.tapToLockTooltip||d.tapToSelect),u=!!d?.enabled&&"backgroundTap"===d.clearSelection;if("x-position"===x?.mode&&x.xField&&n){let e=n.data||n.datum||n;Array.isArray(e)&&(e=e[0]);const t=Gl(n,e,x.xField);null!=t&&y(x.name||"hover",t,f)}if(c)if(n){L.current=!0;const r=Vl(n);if(t&&"x-position"!==x?.mode&&S.onHover(r),e&&d?.tapToSelect&&w.length>0){const e=Vs(r,w);Yl(e)&&k.selectPoints(e)}if(l&&N){const e=r?.[N];R(null!=e?String(e):null)}}else u&&E();if(n||u){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})}h&&(i||M)&&pl({onObservation:j,datum:n?Vl(n):null,x:n?.x,y:n?.y,chartType:o||"unknown",chartId:a,context:r})}},[s,h,i,M,j,o,a,x,f,d,t,S,e,k,w,l,N,E,y]);(0,Ny.useEffect)(()=>{if(!d?.enabled||"undefined"==typeof document)return;const e=e=>{"Escape"===e.key&&L.current&&E()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d?.enabled,E]);const z=(0,Ny.useRef)(E);return z.current=E,(0,Ny.useEffect)(()=>()=>{L.current&&z.current(!1)},[]),(0,Ny.useEffect)(()=>{if("x-position"!==x?.mode)return;const e=x.name||"hover";return()=>{v.current.releaseCrosshair(e,f)}},[x?.mode,x?.name,f]),{activeSelectionHook:A,hoverSelectionHook:P,customHoverBehavior:I,customClickBehavior:T,crosshairSourceId:f}}function uc(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 dc(e,t,n){return Bl(e,t,n)}function hc(e){return void 0!==e.stroke||void 0!==e.strokeWidth||void 0!==e.opacity}function fc(e,t){if(!hc(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 pc(e){if(null==e)return()=>{};const t="function"==typeof e?e:t=>t[e];return e=>gc(t(e))}function mc(e,t){const n=pc(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:String(t)}}}function gc(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 yc(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=gc(r);if(void 0===i)return!1;if(void 0!==e.gt&&!(i>e.gt))return!1;if(void 0!==e.gte&&!(i>=e.gte))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(!(i>=t&&i<=n))return!1}if(void 0!==e.outside){const[t,n]=e.outside;if(!(i<t||i>n))return!1}return!0}function bc(e,t,n){const r=e.when;return void 0===r||!0===r||!1!==r&&("function"==typeof r?r(t,n):yc(r,t,n))}function vc(e,t,n){if(!t||0===t.length)return{};let r={};for(const i of t){if(!bc(i,e,n))continue;const t="function"==typeof i.style?i.style(e,n):i.style;t&&(r={...r,...t})}return r}function xc(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,vc(a,t,n(a,o))),s}:i}function wc({componentName:e,message:t,width:n,height:r}){/* @__PURE__ */ /* @__PURE__ */
|
|
127
|
+
return(0,qy.jsx)("div",{role:"alert",style:{width:n,height:"number"==typeof r?Math.max(r,120):r,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,qy.jsxs)("div",{style:{textAlign:"center",maxWidth:400},children:[
|
|
128
128
|
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */(0,
|
|
130
|
-
return(0,Ay.jsx)(jy,{fallback:r=>/* @__PURE__ */ /* @__PURE__ */(0,Ay.jsx)(sc,{componentName:e,message:r.message,width:t,height:n}),children:r})}function uc(e,t,n,r,i){return!1===r||null==e?null:Array.isArray(e)?e.some(e=>null!=e&&"object"==typeof e)?null:/* @__PURE__ */ /* @__PURE__ */(0,Ay.jsx)("div",{style:{...Ry,...lc(t,n,i)},children:r||"No data available"}):null}function dc(e,t,n,r,i){if(!e)return null;if(!1===r)return null;if(null!=r)/* @__PURE__ */ /* @__PURE__ */
|
|
131
|
-
return(0,Ay.jsx)("div",{style:{...lc(t,n,i),display:"flex",flexDirection:"column",alignItems:"stretch",textAlign:"center",justifyContent:"center",boxSizing:"border-box"},children:r});const o=Math.max(1,Math.min(5,Math.floor(n/40))),a=Math.max(8,Math.floor(n/(3*o))),s=Math.max(6,Math.floor(n/(2.5*o))),l=Math.floor((n-(o*(a+s)-s))/2),c=e=>i?.responsiveHeight?100*e/Math.max(1,n)+"%":e,u=Array.from({length:o},(e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,Ay.jsx)("div",{className:"semiotic-loading-bar",style:{...Cy,position:"absolute",top:c(l+t*(a+s)),left:"10%",width:30+(37*t+13)%50+"%",height:c(a),opacity:.5+t%2*.2}},t));/* @__PURE__ */ /* @__PURE__ */
|
|
132
|
-
return(0,Ay.jsx)("div",{style:{...lc(t,n,i),position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:u})}function hc(e,t,n,r){if("production"===process.env.NODE_ENV)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 fc(e){const t=(0,Ny.useThemeSelector)(e=>e.theme.colors.selectionOpacity);return(0,Ly.useMemo)(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}function pc(e){return"default"in e?e.default:e}async function mc(e){try{switch(e){case"world-110m":return{topology:pc(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:pc(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:pc(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:pc(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw new Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){const n=t instanceof Error?t.message:String(t);if(/Cannot find module|Failed to resolve|world-atlas/i.test(n))throw new Error(`resolveReferenceGeography("${e}"): ${zy}`,{cause:t});throw t}}async function gc(e){const t=Ty.get(e);if(t)return t;const{topology:n,objectName:r}=await mc(e);if(!n||!n.objects)throw new Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof n} with keys: ${n?Object.keys(n).join(", "):"none"}`);const i=(0,Iy.feature)(n,n.objects[r]),o="features"in i?i.features:[i];return Ty.set(e,o),o}function yc(e){const t=(0,Ey.useMemo)(()=>Array.isArray(e)?e:void 0,[e]),[n,r]=(0,Ey.useState)(null);return(0,Ey.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),gc(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 bc(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 vc(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;(s||t||r||i||a)&&(f.customHoverBehavior=u);const m=h?r||i||t:r||i,g=c?.enabled&&(c.tapToSelect||c.tapToLockTooltip)&&(t||a||n);return d&&(l||m||g)&&(f.customClickBehavior=d),null!=p&&(f.hoverRadius=p),f}function xc(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function wc(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:b,marginDefaults:v,onClick:x,hoverHighlight:w,mobileInteraction:k,mobileSemantics:S,loading:M,loadingContent:j,emptyContent:A,width:R,height:C,hasTitle:L,axisChrome:N}=e,P=void 0===n,E=(0,Oy.useMemo)(()=>Sn(t),[t]),[I,T]=(0,Oy.useState)([]),z=(0,Oy.useCallback)(e=>{T(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[]),D="string"==typeof r?r:void 0,$=(0,Oy.useMemo)(()=>Rl(k,{width:R,mobileSemantics:S}),[k,R,S]),{activeSelectionHook:F,hoverSelectionHook:O,customHoverBehavior:_,customClickBehavior:B,crosshairSourceId:W}=Xl({selection:s,linkedHover:l,fallbackFields:c,unwrapData:u,onObservation:d,chartType:h,chartId:f,onClick:x,hoverHighlight:w,colorByField:D,mobileInteraction:$}),H=Zl(l,W),q=Yl(E,r,i),G=(0,Oy.useMemo)(()=>Fl(E,r),[E,r]),V=(0,Oy.useMemo)(()=>P&&I.length>0?I:G,[P,I,G]),U=ql(o,r,V),Y=(0,Oy.useMemo)(()=>O||(U.legendSelectionHook?U.legendSelectionHook:F),[O,U.legendSelectionHook,F]),X=fc(s),Z=Vl(),K=(0,_y.useChartCategoryColors)(null!=i),Q=(0,Oy.useMemo)(()=>{if(q&&(!P||0===V.length))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:Pf,t="__streamCat",n=Bt(V.map(e=>({[t]:e})),t,e);return e=>(K?_t(K,e):void 0)??(i&&"object"==typeof i&&!Array.isArray(i)?_t(i,e):void 0)??n(e)??"#999"},[q,P,r,V,i,Z,K]),{legend:J,margin:ee,legendPosition:te,legendLayout:ne,legendMarginReserved:re}=Bl({data:E,colorBy:r,colorScale:Q,showLegend:p,legendPosition:a,userMargin:b,defaults:v,categories:V,additionalLegend:m,chartWidth:R,chartHeight:C,legendLayout:g,frameLegend:y,hasTitle:L,axisChrome:N}),ie=(0,Oy.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),P&&r&&(e.legendCategoryAccessor=r,e.onCategoriesChange=z),e},[J,te,ne,re,o,U.onLegendHover,U.onLegendClick,U.highlightedCategory,U.isolatedCategories,P,r,z]),oe=dc(M,R,C,j,e.responsive),ae=oe?null:uc(n,R,C,A,e.responsive);return{data:E,colorScale:Q,categoryColorScale:Q,allCategories:V,legendState:U,effectiveSelectionHook:Y,activeSelectionHook:F,customHoverBehavior:_,customClickBehavior:B,mobileInteraction:$,legend:J,margin:ee,legendPosition:te,earlyReturn:oe||ae||null,legendBehaviorProps:ie,crosshairProps:H,resolvedSelection:X}}function kc(e,t){const{variant:n,frameRef:r,overrides:i}=t,o=(0,By.useRef)(i);o.current=i,(0,By.useImperativeHandle)(e,()=>{const e=Sc(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 Sc(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];if(e.current?.removeNodes)return e.current.removeNodes(n);const 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)=>{const r=Array.isArray(t)?t:[t];return e.current?.updateNodes?e.current.updateNodes(r,n):r.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 Mc(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,u=s>0?(c-o)/s:0;return r+Math.max(0,Math.min(1,u))*(i-r)}function jc(e){const{valueAccessor:t,valueDomain:n,edgeWidthRange:r,resolveStroke:i,edgeOpacity:o,edgeLinecap:a,styleRules:s}=e,l=ec(t);return ac(e=>({stroke:i(e),strokeWidth:Mc(e[t],n,r),strokeLinecap:a,opacity:o,fillOpacity:0}),s,e=>({value:l(e)}))}function Ac({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 h?/* @__PURE__ */ /* @__PURE__ */(0,tb.jsxs)("g",{children:[
|
|
129
|
+
/* @__PURE__ */(0,qy.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"rgba(128, 128, 128, 0.7)",marginBottom:6,fontFamily:"monospace"},children:e}),
|
|
133
130
|
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */(0,
|
|
131
|
+
/* @__PURE__ */(0,qy.jsx)("div",{style:{fontSize:14,color:"rgba(128, 128, 128, 0.9)",lineHeight:1.5},children:t})]})})}function kc(e,t,n){return{width:n?.responsiveWidth?"100%":e,height:n?.responsiveHeight?"100%":t}}function Sc(e,t,n,r,i){return!1===r||null==e?null:Array.isArray(e)?e.some(e=>null!=e&&"object"==typeof e)?null:/* @__PURE__ */ /* @__PURE__ */(0,Uy.jsx)("div",{style:{...Xy,...kc(t,n,i)},children:r||"No data available"}):null}function Mc(e,t,n,r,i){if(!e)return null;if(!1===r)return null;if(null!=r)/* @__PURE__ */ /* @__PURE__ */
|
|
132
|
+
return(0,Uy.jsx)("div",{style:{...kc(t,n,i),display:"flex",flexDirection:"column",alignItems:"stretch",textAlign:"center",justifyContent:"center",boxSizing:"border-box"},children:r});const o=Math.max(1,Math.min(5,Math.floor(n/40))),a=Math.max(8,Math.floor(n/(3*o))),s=Math.max(6,Math.floor(n/(2.5*o))),l=Math.floor((n-(o*(a+s)-s))/2),c=e=>i?.responsiveHeight?100*e/Math.max(1,n)+"%":e,u=Array.from({length:o},(e,t)=>/* @__PURE__ */ /* @__PURE__ */(0,Uy.jsx)("div",{className:"semiotic-loading-bar",style:{...Zy,position:"absolute",top:c(l+t*(a+s)),left:"10%",width:30+(37*t+13)%50+"%",height:c(a),opacity:.5+t%2*.2}},t));/* @__PURE__ */ /* @__PURE__ */
|
|
133
|
+
return(0,Uy.jsx)("div",{style:{...kc(t,n,i),position:"relative",overflow:"hidden",border:"1px solid var(--semiotic-border, #e0e0e0)",borderRadius:4,boxSizing:"border-box"},children:u})}function jc(e,t,n,r){if("production"===process.env.NODE_ENV)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 Ac(e){const t=(0,Qy.useThemeSelector)(e=>e.theme.colors.selectionOpacity);return(0,Ky.useMemo)(()=>{if(void 0!==e||void 0!==t)return{name:e?.name??"",...e,unselectedOpacity:e?.unselectedOpacity??t}},[e,t])}function Cc(e){return"default"in e?e.default:e}async function Rc(e){try{switch(e){case"world-110m":return{topology:Cc(await(import("world-atlas/countries-110m.json"))),objectName:"countries"};case"world-50m":return{topology:Cc(await(import("world-atlas/countries-50m.json"))),objectName:"countries"};case"land-110m":return{topology:Cc(await(import("world-atlas/land-110m.json"))),objectName:"land"};case"land-50m":return{topology:Cc(await(import("world-atlas/land-50m.json"))),objectName:"land"};default:throw new Error(`Unknown reference geography: "${e}". Supported: "world-110m", "world-50m", "land-110m", "land-50m".`)}}catch(t){const n=t instanceof Error?t.message:String(t);if(/Cannot find module|Failed to resolve|world-atlas/i.test(n))throw new Error(`resolveReferenceGeography("${e}"): ${rb}`,{cause:t});throw t}}async function Lc(e){const t=nb.get(e);if(t)return t;const{topology:n,objectName:r}=await Rc(e);if(!n||!n.objects)throw new Error(`resolveReferenceGeography("${e}"): Failed to load topology. Got ${typeof n} with keys: ${n?Object.keys(n).join(", "):"none"}`);const i=(0,tb.feature)(n,n.objects[r]),o="features"in i?i.features:[i];return nb.set(e,o),o}function Nc(e){const t=(0,eb.useMemo)(()=>Array.isArray(e)?e:void 0,[e]),[n,r]=(0,eb.useState)(null);return(0,eb.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),Lc(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 Pc(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 Ic(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;(s||t||r||i||a)&&(f.customHoverBehavior=u);const m=h?r||i||t:r||i,g=c?.enabled&&(c.tapToSelect||c.tapToLockTooltip)&&(t||a||n);return d&&(l||m||g)&&(f.customClickBehavior=d),null!=p&&(f.hoverRadius=p),f}function Ec(e,t,n){return Tc(e,t,e=>{const t=e;return n&&t.size?{width:Math.max(1,t.size[0]),height:Math.max(1,t.size[1])}:Bl("string"==typeof(r=t.mode)&&Object.prototype.hasOwnProperty.call(Dy,r)?t.mode:void 0,{...t,width:t.size?.[0]??t.width,height:t.size?.[1]??t.height},n);var r})}function Tc(e,t,n){const r=e,i=ib.forwardRef(function(e,i){/* @__PURE__ */ /* @__PURE__ */
|
|
134
|
+
return(0,ob.jsx)(Yy,{fallback:r=>{const i=n(e);/* @__PURE__ */ /* @__PURE__ */
|
|
135
|
+
return(0,ob.jsx)(wc,{componentName:t,message:r.message,width:e.responsiveWidth?"100%":i.width??"auto",height:e.responsiveHeight?"100%":"number"==typeof i.height?`${i.height}px`:i.height??"auto"})},children:/* @__PURE__ */ /* @__PURE__ */(0,ob.jsx)(r,{...e,...null==i?{}:{ref:i}})})});return i.displayName=t,i}function zc(e){return e.properties&&"object"==typeof e.properties?{...e.properties,...e}:e}function $c(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:b,marginDefaults:v,onClick:x,hoverHighlight:w,mobileInteraction:k,mobileSemantics:S,loading:M,loadingContent:j,emptyContent:A,width:C,height:R,hasTitle:L,axisChrome:N}=e,P=void 0===n,I=(0,cb.useMemo)(()=>kn(t),[t]),[E,T]=(0,cb.useState)([]),z=(0,cb.useCallback)(e=>{T(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[]),$="string"==typeof r?r:void 0,D=(0,cb.useMemo)(()=>Wl(k,{width:C,mobileSemantics:S}),[k,C,S]),{activeSelectionHook:O,hoverSelectionHook:F,customHoverBehavior:_,customClickBehavior:W,crosshairSourceId:B}=cc({selection:s,linkedHover:l,fallbackFields:c,unwrapData:u,onObservation:d,chartType:h,chartId:f,onClick:x,hoverHighlight:w,colorByField:$,mobileInteraction:D}),H=uc(l,B),q=lc(I,r,i),G=(0,cb.useMemo)(()=>Ql(I,r),[I,r]),V=(0,cb.useMemo)(()=>P&&E.length>0?E:G,[P,E,G]),Y=ic(o,r,V),U=(0,cb.useMemo)(()=>F||(Y.legendSelectionHook?Y.legendSelectionHook:O),[F,Y.legendSelectionHook,O]),X=Ac(s),Z=ac(),K=(0,ub.useChartCategoryColors)(null!=i),Q=(0,cb.useMemo)(()=>{if(q&&(!P||0===V.length))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:Yf,t="__streamCat",n=_t(V.map(e=>({[t]:e})),t,e);return e=>(K?Ft(K,e):void 0)??(i&&"object"==typeof i&&!Array.isArray(i)?Ft(i,e):void 0)??n(e)??"#999"},[q,P,r,V,i,Z,K]),{legend:J,margin:ee,legendPosition:te,legendLayout:ne,legendMarginReserved:re}=tc({data:I,colorBy:r,colorScale:Q,showLegend:p,legendPosition:a,userMargin:b,defaults:v,categories:V,additionalLegend:m,chartWidth:C,chartHeight:R,legendLayout:g,frameLegend:y,hasTitle:L,axisChrome:N}),ie=(0,cb.useMemo)(()=>{const e={};return J&&(e.legend=J,e.legendPosition=te,re&&(e.__legendMarginReservedFor=J),ne&&(e.legendLayout=ne)),o&&"none"!==o&&(e.legendHoverBehavior=Y.onLegendHover,e.legendClickBehavior=Y.onLegendClick,e.legendHighlightedCategory=Y.highlightedCategory,e.legendIsolatedCategories=Y.isolatedCategories),P&&r&&(e.legendCategoryAccessor=r,e.onCategoriesChange=z),e},[J,te,ne,re,o,Y.onLegendHover,Y.onLegendClick,Y.highlightedCategory,Y.isolatedCategories,P,r,z]),oe=Mc(M,C,R,j,e.responsive),ae=oe?null:Sc(n,C,R,A,e.responsive);return{data:I,colorScale:Q,categoryColorScale:Q,allCategories:V,legendState:Y,effectiveSelectionHook:U,activeSelectionHook:O,customHoverBehavior:_,customClickBehavior:W,mobileInteraction:D,legend:J,margin:ee,legendPosition:te,earlyReturn:oe||ae||null,legendBehaviorProps:ie,crosshairProps:H,resolvedSelection:X}}function Dc(e,t){const{variant:n,frameRef:r,overrides:i}=t,o=(0,db.useRef)(i);o.current=i,(0,db.useImperativeHandle)(e,()=>{const e=Oc(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 Oc(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];if(e.current?.removeNodes)return e.current.removeNodes(n);const 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)=>{const r=Array.isArray(t)?t:[t];return e.current?.updateNodes?e.current.updateNodes(r,n):r.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 Fc(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,u=s>0?(c-o)/s:0;return r+Math.max(0,Math.min(1,u))*(i-r)}function _c(e){const{valueAccessor:t,valueDomain:n,edgeWidthRange:r,resolveStroke:i,edgeOpacity:o,edgeLinecap:a,styleRules:s}=e,l=pc(t);return xc(e=>({stroke:i(e),strokeWidth:Fc(e[t],n,r),strokeLinecap:a,opacity:o,fillOpacity:0}),s,e=>({value:l(e)}))}function Wc({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 h?/* @__PURE__ */ /* @__PURE__ */(0,jb.jsxs)("g",{children:[
|
|
135
136
|
/* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */(0,
|
|
137
|
-
return(0,tb.jsxs)("g",{children:[
|
|
137
|
+
/* @__PURE__ */(0,jb.jsx)("line",{x1:n,y1:r,x2:n+o,y2:r,stroke:f.stroke,strokeWidth:f.strokeWidth,strokeLinecap:"round",opacity:.85}),
|
|
138
138
|
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */(0,
|
|
140
|
-
return(0,
|
|
139
|
+
/* @__PURE__ */(0,jb.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__ */
|
|
140
|
+
return(0,jb.jsxs)("g",{children:[
|
|
141
141
|
/* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */(0,
|
|
142
|
+
/* @__PURE__ */(0,jb.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,jb.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)})]}):/* @__PURE__ */ /* @__PURE__ */(0,jb.jsxs)("g",{children:[l.map(e=>{const a=e/i*o;/* @__PURE__ */ /* @__PURE__ */
|
|
143
|
+
return(0,jb.jsxs)("g",{children:[
|
|
143
144
|
/* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */(0,
|
|
145
|
+
/* @__PURE__ */(0,jb.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,jb.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,jb.jsxs)("g",{transform:"translate(24, 24)",children:[
|
|
145
146
|
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */(0,
|
|
147
|
+
/* @__PURE__ */(0,jb.jsx)("circle",{r:16,fill:"white",fillOpacity:.85,stroke:"#bbb",strokeWidth:.8}),
|
|
147
148
|
/* @__PURE__ */
|
|
148
|
-
/* @__PURE__ */(0,
|
|
149
|
+
/* @__PURE__ */(0,jb.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"}),
|
|
149
150
|
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */(0,
|
|
151
|
+
/* @__PURE__ */(0,jb.jsx)("text",{y:-12,textAnchor:"middle",fontSize:7,fontWeight:700,fill:"#555",fontFamily:"var(--semiotic-font-family, system-ui, sans-serif)",children:"N"}),
|
|
151
152
|
/* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */(0,
|
|
153
|
+
/* @__PURE__ */(0,jb.jsx)("line",{x1:11,y1:0,x2:13,y2:0,stroke:"#bbb",strokeWidth:.8}),
|
|
153
154
|
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */(0,
|
|
155
|
-
return(0,db.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{const a=!o.isActive||o.predicate(e.datum);/* @__PURE__ */ /* @__PURE__ */
|
|
156
|
-
return(0,db.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 Gc(e){if(Number.isFinite(e)&&!(Number(e)<=0))return Number(e)}function Vc(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function Uc(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function Yc(e,t){const n=Uc(e);return String(e.id??n.id??n.name??`feature-${t}`)}function Xc(e,t){if(0===e.length)return null;const n={type:"FeatureCollection",features:e},r=t.bounds(n);return Number.isFinite(r[0][0])&&Number.isFinite(r[0][1])&&Number.isFinite(r[1][0])&&Number.isFinite(r[1][1])?r:null}function Zc(e,t,n,r){return[Math.ceil((e-n)/r-.5),Math.floor((t-n)/r-.5)]}function Kc(e){if(!e)return 0;const t=xb.get(e);if(t)return t;const n=wb;return wb+=1,xb.set(e,n),n}function Qc(e){return e.map((e,t)=>{if(vb.has(e))return{feature:e,index:t,bounds:vb.get(e)??null};try{const n=q(e);return vb.set(e,n),{feature:e,index:t,bounds:n}}catch{return vb.set(e,null),{feature:e,index:t,bounds:null}}})}function Jc(e,t){return!t||e[1]>=t[0][1]&&e[1]<=t[1][1]&&(n=e[0],(r=t[0][0])<=(i=t[1][0])?n>=r&&n<=i:n>=r||n<=i);var n,r,i}function eu(e,t){for(const n of e){const{feature:e,index:r}=n;if(e.geometry&&Jc(t,n.bounds))try{if(Me(e,t))return{feature:e,index:r}}catch{}}return null}function tu(e,t,n,r={}){const i=e.filter((e,t)=>e.geometry&&(!r.featureFilter||r.featureFilter(e,t))),o=Xc(i,t.geoPath);if(!o)return{dots:[],cellSize:gb,features:i};const a=Math.max(0,r.layoutPadding??0),s=[[Xi(o[0][0],a,Math.max(a,n.width-a)),Xi(o[0][1],a,Math.max(a,n.height-a))],[Xi(o[1][0],a,Math.max(a,n.width-a)),Xi(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:gb,features:i};const u=Gc(r.columns);let d=Math.max(2,u?l/u:Gc(r.cellSize)??gb);const h=Math.max(100,Math.round(Gc(r.maxSamples)??yb)),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]=Zc(s[0][0],s[1][0],p,d),[b,v]=Zc(s[0][1],s[1][1],m,d),x=[],w=Qc(i);for(let e=b;e<=v;e+=1){const n=m+(e+.5)*d;for(let i=g;i<=y;i+=1){const o=p+(i+.5)*d,a=t.invertedPoint(o,n);if(!a||!Number.isFinite(a[0])||!Number.isFinite(a[1]))continue;const s=eu(w,a);if(!s)continue;const l={...Uc(s.feature),featureId:Yc(s.feature,s.index),featureIndex:s.index,gridRow:e,gridColumn:i,longitude:a[0],latitude:a[1],dotIndex:x.length};r.dotFilter&&!r.dotFilter(l,x.length)||x.push(l)}}return{dots:x,cellSize:d,features:i}}function nu(e){return Math.round(1e4*e)/1e4}function ru(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${nu(Number(e[0]))},${nu(Number(e[1]))}`:"null"}function iu(e,t){const n=e[t];return"function"==typeof n?n.call(e):void 0}function ou(e){return"number"==typeof e&&Number.isFinite(e)?String(nu(e)):null===e?"null":"unavailable"}function au(e){const t=e.scales.projection;return[ou(iu(t,"scale")),ru(iu(t,"translate")),ru(iu(t,"center")),(n=iu(t,"rotate"),Array.isArray(n)&&n.every(Number.isFinite)?n.map(e=>nu(Number(e))).join(","):"unavailable"),ou(iu(t,"clipAngle")),ou(iu(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,n])=>ru(e.scales.projectedPoint(t,n)))].join("|");var n}function su(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??"",Kc(t.featureFilter),Kc(t.dotFilter),au(e)].join("::")}function lu(e){let t=bb.get(e.areas);t||(t=/* @__PURE__ */new Map,bb.set(e.areas,t));const n=su(e),r=t.get(n);if(r)return r;const i=tu(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 cu(e){return`${e.map(([e,t],n)=>`${0===n?"M":"L"}${e},${t}`).join("")}Z`}function uu(e,t,n){return cu([[e-n,t-n],[e+n,t-n],[e+n,t+n],[e-n,t+n]])}function du(e,t,n){return cu(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 hu(e,t,n){const{featureKey:r,dataKey:i}=n,o=/* @__PURE__ */new Map;for(const e of t){const t=String(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 String(n??"")};return e.map(e=>{const t=a(e),n=o.get(t);return n?{...e,properties:{...e.properties,...n}}:e})}var fu,pu,mu,gu,yu,bu,vu,xu,wu,ku,Su,Mu,ju,Au,Ru,Cu,Lu=Object.create,Nu=Object.defineProperty,Pu=Object.getOwnPropertyDescriptor,Eu=Object.getOwnPropertyNames,Iu=Object.getPrototypeOf,Tu=Object.prototype.hasOwnProperty,zu=(e,t,n)=>function(){if(n)throw n[0];try{return e&&(t=(0,e[Eu(e)[0]])(e=0)),t}catch(e){throw n=[e],e}},Du=(e,t)=>{for(var n in t)Nu(e,n,{get:t[n],enumerable:!0})},$u=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of Eu(t))Tu.call(e,i)||i===n||Nu(e,i,{get:()=>t[i],enumerable:!(r=Pu(t,i))||r.enumerable});return e},Fu=(e,t,n)=>(n=null!=e?Lu(Iu(e)):{},$u(!t&&e&&e.__esModule?n:Nu(n,"default",{value:e,enumerable:!0}),e)),Ou=zu({"src/components/stream/accessibleDataRows.ts"(){}}),_u=zu({"src/components/stream/accessibleTableStyles.ts"(){fu=5,pu=25,mu="semiotic-accessible-data-table semiotic-accessible-data-table-hidden",gu="semiotic-accessible-data-table semiotic-accessible-data-table-visible",yu={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},bu={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"},vu={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},xu={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)"},wu={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},ku={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))"},Su={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},Mu={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},ju={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"}}}),Bu=zu({"src/components/stream/countNoun.ts"(){}}),Wu={};Du(Wu,{default:()=>l});var Hu,qu,Gu,Vu,Uu,Yu=zu({"src/components/stream/AccessibleTablePortalImpl.tsx"(){Au=Fu(require("react")),Ru=require("react-dom"),Cu=require("react/jsx-runtime")}}),Xu=zu({"src/components/stream/accessibleDataTableModel.ts"(){Bu(),Hu=e=>{if(null==e)return"";const t=Math.round(100*e)/100;return Number.isNaN(t)?"":String(t)}}}),Zu=zu({"src/components/stream/AccessibleDataRowsTable.tsx"(){Xu(),_u(),qu=require("react/jsx-runtime")}}),Ku=zu({"src/components/stream/AccessibleTableMoreRows.tsx"(){_u(),Gu=require("react/jsx-runtime")}}),Qu={};Du(Qu,{default:()=>p});var Ju,ed=zu({"src/components/stream/AccessibleDataTableContent.tsx"(){Vu=Fu(require("react")),Zu(),Ku(),_u(),Ou(),Xu(),Bu(),Uu=require("react/jsx-runtime")}}),td={};Du(td,{ChoroplethMap:()=>$y,DEFAULT_HIT_RADIUS:()=>cb,DistanceCartogram:()=>rb,FlowMap:()=>Jy,GeoCustomChart:()=>sb,MultiLineTooltip:()=>$s,ProportionalSymbolMap:()=>Vy,StreamGeoFrame:()=>ny,Tooltip:()=>Ds,TooltipRoot:()=>jg,composeStyleRules:()=>ac,geoAreaHitTarget:()=>Ec,geoHitTarget:()=>Pc,geographicDotGridLayout:()=>kb,geographicGridLayout:()=>pb,glyphExtent:()=>To,glyphPlacement:()=>Io,gridifyGeographicPoints:()=>Dc,hasOwnTooltipChrome:()=>Fa,hasTooltipContent:()=>Pa,hatchFillId:()=>Ci,hatchPatternDef:()=>Ni,hitTargetPoint:()=>Nc,isHatchFill:()=>Ai,makeNodeRuleContext:()=>tc,makeRuleValueResolver:()=>ec,markTooltipChrome:()=>Da,matchesThreshold:()=>rc,mergeData:()=>hu,resolveReferenceGeography:()=>gc,resolveResponsiveRules:()=>Al,resolveStyleRules:()=>oc,resolveSvgFill:()=>Pi,responsiveRuleMatches:()=>Ml,ruleMatches:()=>ic,sampleGeographicDotGrid:()=>tu}),module.exports=(Ju=td,$u(Nu({},"__esModule",{value:!0}),Ju));var nd,rd,id,od,ad,sd,ld,cd,ud,dd,hd,fd,pd,md,gd,yd,bd=require("react"),vd="undefined"==typeof window||"undefined"==typeof document,xd=vd?bd.useEffect:bd.useLayoutEffect,wd=require("react"),kd=require("d3-array"),Sd=1e-6,Md=1e-12,jd=Math.PI,Ad=jd/2,Rd=jd/4,Cd=2*jd,Ld=180/jd,Nd=jd/180,Pd=Math.abs,Ed=Math.atan,Id=Math.atan2,Td=Math.cos,zd=Math.ceil,Dd=Math.exp,$d=Math.log,Fd=Math.sin,Od=Math.sign||function(e){return e>0?1:e<0?-1:0},_d=Math.sqrt,Bd=Math.tan,Wd={Feature:function(e,t){v(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)v(n[r].geometry,t)}},Hd={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){x(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)x(n[r],t,0)},Polygon:function(e,t){w(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)w(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)v(n[r],t)}},qd=new kd.Adder,Gd=new kd.Adder,Vd={point:b,lineStart:b,lineEnd:b,polygonStart:function(){qd=new kd.Adder,Vd.lineStart=S,Vd.lineEnd=M},polygonEnd:function(){var e=+qd;Gd.add(e<0?Cd+e:e),this.lineStart=this.lineEnd=this.point=b},sphere:function(){Gd.add(Cd)}},Ud=require("d3-array"),Yd={point:T,lineStart:D,lineEnd:$,polygonStart:function(){Yd.point=F,Yd.lineStart=O,Yd.lineEnd=_,md=new Ud.Adder,Vd.polygonStart()},polygonEnd:function(){Vd.polygonEnd(),Yd.point=T,Yd.lineStart=D,Yd.lineEnd=$,qd<0?(sd=-(cd=180),ld=-(ud=90)):md>Sd?ud=90:md<-Sd&&(ld=-90),yd[0]=sd,yd[1]=cd},sphere:function(){sd=-(cd=180),ld=-(ud=90)}};V.invert=V;var Xd,Zd,Kd,Qd,Jd,eh,th,nh,rh,ih,oh,ah,sh=require("d3-array"),lh=require("d3-array"),ch=se(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?jd:-jd,l=Pd(o-n);Pd(l-jd)<Sd?(e.point(n,r=(r+a)/2>0?Ad:-Ad),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&l>=jd&&(Pd(n-i)<Sd&&(n-=i*Sd),Pd(o-s)<Sd&&(o-=s*Sd),r=ue(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)i=n*Ad,r.point(-jd,i),r.point(0,i),r.point(jd,i),r.point(jd,0),r.point(jd,-i),r.point(0,-i),r.point(-jd,-i),r.point(-jd,0),r.point(-jd,i);else if(Pd(e[0]-t[0])>Sd){var o=e[0]<t[0]?jd:-jd;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])},[-jd,-Ad]),uh=require("d3-array"),dh=1e9,hh=-dh,fh=require("d3-array"),ph={sphere:b,point:b,lineStart:function(){ph.point=me,ph.lineEnd=pe},lineEnd:b,polygonStart:b,polygonEnd:b},mh=[null,null],gh={type:"LineString",coordinates:mh},yh={Feature:function(e,t){return be(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(be(n[r].geometry,t))return!0;return!1}},bh={Sphere:function(){return!0},Point:function(e,t){return ve(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(ve(n[r],t))return!0;return!1},LineString:function(e,t){return xe(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(xe(n[r],t))return!0;return!1},Polygon:function(e,t){return we(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(we(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(be(n[r],t))return!0;return!1}},vh=require("d3-array"),xh=e=>e,wh=require("d3-array"),kh=new wh.Adder,Sh=new wh.Adder,Mh={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Mh.lineStart=Le,Mh.lineEnd=Ee},polygonEnd:function(){Mh.lineStart=Mh.lineEnd=Mh.point=b,kh.add(Pd(Sh)),Sh=new wh.Adder},result:function(){var e=kh/2;return kh=new wh.Adder,e}},jh=Mh,Ah=1/0,Rh=Ah,Ch=-Ah,Lh=Ch,Nh={point:function(e,t){e<Ah&&(Ah=e),e>Ch&&(Ch=e),t<Rh&&(Rh=t),t>Lh&&(Lh=t)},lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b,result:function(){var e=[[Ah,Rh],[Ch,Lh]];return Ch=Lh=-(Rh=Ah=1/0),e}},Ph=0,Eh=0,Ih=0,Th=0,zh=0,Dh=0,$h=0,Fh=0,Oh=0,_h={point:Ie,lineStart:Te,lineEnd:$e,polygonStart:function(){_h.lineStart=Fe,_h.lineEnd=Oe},polygonEnd:function(){_h.point=Ie,_h.lineStart=Te,_h.lineEnd=$e},result:function(){var e=Oh?[$h/Oh,Fh/Oh]:Dh?[Th/Dh,zh/Dh]:Ih?[Ph/Ih,Eh/Ih]:[NaN,NaN];return Ph=Eh=Ih=Th=zh=Dh=$h=Fh=Oh=0,e}},Bh=_h;We.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,Cd)}},result:b};var Wh,Hh,qh,Gh,Vh,Uh,Yh,Xh,Zh,Kh=require("d3-array"),Qh=new Kh.Adder,Jh={point:b,lineStart:function(){Jh.point=He},lineEnd:function(){Wh&&qe(Hh,qh),Jh.point=b},polygonStart:function(){Wh=!0},polygonEnd:function(){Wh=null},result:function(){var e=+Qh;return Qh=new Kh.Adder,e}},ef=Jh,tf=class{constructor(e){this._append=null==e?Ge:Ve(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!==Xh||this._append!==Yh){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`,Xh=e,Yh=this._append,Zh=this._,this._=t}this._+=Zh}}result(){const e=this._;return this._="",e.length?e:null}};Xe.prototype={constructor:Xe,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 nf=Td(30*Nd),rf=Ye({point:function(e,t){this.stream.point(e*Nd,t*Nd)}});ht.invert=function(e,t){return[e,2*Ed(Dd(t))-Ad]},pt.invert=pt;var of,af=1.340264,sf=-.081106,lf=893e-6,cf=.003796,uf=_d(3)/2;mt.invert=function(e,t){for(var n,r=t,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(af+sf*i+o*(lf+cf*i))-t)/(af+3*sf*i+o*(7*lf+9*cf*i)))*r)*i*i,!(Pd(n)<Md));++a);return[uf*e*(af+3*sf*i+o*(7*lf+9*cf*i))/Td(r),g(Fd(r)/uf)]},yt.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(Pd(n)>Sd&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},bt.invert=(of=g,function(e,t){var n=_d(e*e+t*t),r=of(n),i=Fd(r),o=Td(r);return[Id(e*i,n*o),g(n&&t*i/n)]});var df,hf,ff=/* @__PURE__ */new WeakMap,pf=require("d3-quadtree"),mf=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,e<1)throw new Error("RingBuffer capacity must be at least 1");this.buffer=new 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||e>=this._size)return;const t=(this.head-this._size+e+this._capacity)%this._capacity;return this.buffer[t]}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:()=>e>=this._size?{done:!0,value:void 0}:{done:!1,value:this.get(e++)}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;n<this._size;n++)e(this.buffer[(t+n)%this._capacity],n)}toArray(){const e=new Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;n<this._size;n++)e[n]=this.buffer[(t+n)%this._capacity];return e}resize(e){if(e<1)throw new 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=new Array(e),this.head=0,this._size=0;for(let e=n;e<t.length;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;i<this._size;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=new Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return n}clear(){this.buffer=new 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}},gf=1,yf=1.5,bf=3,vf=require("d3-scale"),xf=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],wf=/* @__PURE__ */zt(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),kf=/* @__PURE__ */zt(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),Sf=/* @__PURE__ */zt(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),Mf=/* @__PURE__ */zt(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),jf=/* @__PURE__ */zt(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),Af=/* @__PURE__ */zt(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),Rf={blues:wf,reds:kf,greens:Sf,viridis:/* @__PURE__ */zt(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),oranges:Mf,purples:jf,greys:Af,plasma:/* @__PURE__ */zt(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),inferno:/* @__PURE__ */zt(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),magma:/* @__PURE__ */zt(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),cividis:/* @__PURE__ */zt(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),turbo:/* @__PURE__ */zt(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"])},Cf={category10:xf,tableau10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],...Rf},Lf=xf,Nf="#007bff",Pf=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],Ef=/* @__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"]),If={mercator:function(){return ft(ht).scale(961/Cd)},equalEarth:gt,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=dt().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7]),c=dt().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=dt().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&&i<.234&&r>=-.425&&r<-.214?c:i>=.166&&i<.234&&r>=-.214&&r<-.115?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+Sd,s+.12*n+Sd],[r-.214*n-Sd,s+.234*n-Sd]]).stream(d),a=u.translate([r-.205*n,s+.212*n]).clipExtent([[r-.214*n+Sd,s+.166*n+Sd],[r-.115*n-Sd,s+.234*n-Sd]]).stream(d),t()},e.fitExtent=function(t,n){return Ke(e,t,n)},e.fitSize=function(t,n){return Qe(e,t,n)},e.fitWidth=function(t,n){return Je(e,t,n)},e.fitHeight=function(t,n){return et(e,t,n)},e.scale(1070)},orthographic:function(){return st(bt).scale(249.5).clipAngle(90.000001)},naturalEarth:function(){return st(yt).scale(175.295)},equirectangular:function(){return st(pt).scale(152.63)}},Tf=require("d3-scale"),zf={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},Df=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=yn({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=yn(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}},$f=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Ff=["scene-style","data-paint","accessibility","evidence"],Of=(e,t)=>({retainedData:e,invalidations:t}),_f=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Bf=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],Wf=["scene-geometry","data-paint","accessibility","evidence"],Hf=["scene-style","data-paint","accessibility","evidence"],qf=["scene-geometry","scene-style","data-paint","accessibility","evidence"],Gf=["overlay","accessibility","evidence"],Vf=[],Uf={xAccessor:/* @__PURE__ */Of("rebuild",_f),yAccessor:/* @__PURE__ */Of("rebuild",_f),lineDataAccessor:/* @__PURE__ */Of("rebuild",_f),pointIdAccessor:/* @__PURE__ */Of("rebuild",Wf),lineIdAccessor:/* @__PURE__ */Of("rebuild",Wf),windowSize:/* @__PURE__ */Of("rebuild",_f),projection:/* @__PURE__ */Of("preserve",Bf),projectionExtent:/* @__PURE__ */Of("preserve",Bf),fitPadding:/* @__PURE__ */Of("preserve",Bf),lineType:/* @__PURE__ */Of("preserve",Bf),flowStyle:/* @__PURE__ */Of("preserve",Bf),graticule:/* @__PURE__ */Of("preserve",Bf),projectionTransform:/* @__PURE__ */Of("preserve",Bf),customLayout:/* @__PURE__ */Of("preserve",Bf),layoutConfig:/* @__PURE__ */Of("preserve",Bf),layoutMargin:/* @__PURE__ */Of("preserve",Bf),areaStyle:/* @__PURE__ */Of("preserve",Hf),pointStyle:/* @__PURE__ */Of("preserve",qf),lineStyle:/* @__PURE__ */Of("preserve",Hf),colorScheme:/* @__PURE__ */Of("preserve",Hf),themeCategorical:/* @__PURE__ */Of("preserve",Hf),themeDiverging:/* @__PURE__ */Of("preserve",Hf),themeSemantic:/* @__PURE__ */Of("preserve",Hf),themeSequential:/* @__PURE__ */Of("preserve",Hf),decay:/* @__PURE__ */Of("preserve",Hf),pulse:/* @__PURE__ */Of("preserve",Hf),layoutSelection:/* @__PURE__ */Of("preserve",Hf),annotations:/* @__PURE__ */Of("preserve",Gf),autoPlaceAnnotations:/* @__PURE__ */Of("preserve",Gf),clock:/* @__PURE__ */Of("preserve",Vf),transition:/* @__PURE__ */Of("preserve",Vf),introAnimation:/* @__PURE__ */Of("preserve",Vf),onLayoutError:/* @__PURE__ */Of("preserve",Vf)},Yf=/* @__PURE__ */Of("preserve",Bf),Xf=class{constructor(){this.tracker=new Df}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}},$f)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},Ff):this.recordNoop("restyle")}recordConfig(e,t={}){const n=bn(e),r=new Set(n.invalidations);return t.retainedDataChanged&&r.add("data"),this.tracker.record({kind:"config",keys:e},r)}},Zf=/* @__PURE__ */new WeakMap,Kf=class{getLastUpdateResult(){return this.updateResults.last}getUpdateSnapshot(){return this.updateResults.last}subscribeUpdateResult(e){return this.updateResults.subscribe(e)}setLayoutSelection(e){this.config.layoutSelection=e}markStylePaintPending(){Zf.set(this,!0)}consumeStylePaintPending(){const e=!0===Zf.get(this);return Zf.delete(this),e}},Qf=class extends Kf{constructor(e){super(),this.updateResults=new Xf,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=wn(e)}currentTime(){return this.config.clock?.()??("undefined"!=typeof performance?performance.now():Date.now())}getConfiguredWindowSize(){const e=this.config.windowSize??500;if(!Number.isInteger(e)||e<1)throw new 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 mf(e),this.timestampBuffer=new mf(e),r.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(i[t]??o)})}this.retainNewestLines(e)}updateConfig(e){const t=kn(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 mf(t),this.timestampBuffer=new mf(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();pn(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)pn(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 new 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(String(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 new 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(String(n(e)));mn(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(String(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)}rebuildProjectedScene(e,t){this._customLayoutFailedThisBuild=!1;const n=this.buildSceneNodes(e);return this._customLayoutFailedThisBuild?(this.lastCustomLayoutFailure?.preservedLastGoodScene?t():(this.scene=[],this.rebuildQuadtree()),!1):(this.scene=n,this.rebuildQuadtree(),!0)}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=Kt(t.projection),this.geoPath=Ue(this.projection),this.fitProjection(e),this.geoPath=Ue(this.projection);const c=this.projection;if(this.scales=kt(c),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(e,()=>{this.projection=n,this.geoPath=r,this.scales=i,this.baseScale=o,this.baseTranslate=a,this.baseRotation=s})){if(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=Qt(n.xAccessor,"lon"),o=Qt(n.yAccessor,"lat"),a=this.getPoints();if(a.length>0){const e=a.map(e=>[i(e),o(e)]).filter(e=>e.every(Number.isFinite));r.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:e}})}const s=Jt(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,s={type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[r,i],[r,a],[o,a],[o,i],[r,i]]]}};t.fitExtent([[0,0],[e.width,e.height]],s)}else if(t.clipAngle&&(t.clipAngle()??0)>0){const r=n.fitPadding??0,i=Math.min(e.width,e.height),o=i/2-i*r;t.scale(o),t.translate([e.width/2,e.height/2])}else{const i={type:"FeatureCollection",features:r},o=n.fitPadding??0,a=e.width*o,s=e.height*o;t.fitExtent([[a,s],[e.width-a,e.height-s]],i),vt(t,i,e)}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=Ue(n),this.scales=kt(n),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(t,()=>{n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i})&&(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=Ue(n),this.scales=kt(n),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(t,()=>{n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i})&&(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=Ue(n),this.scales=kt(n),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(t,()=>{n.rotate(o),this.geoPath=r,this.scales=i})&&(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 e=0,t=0;for(const n of this.scene)"point"===n.type&&!1!==n.interactive&&(t++,n.r>e&&(e=n.r));if(this._maxPointRadius=e,t<=500)return void(this._quadtree=null);const n=new Array(t);let r=0;for(const e of this.scene)"point"===e.type&&!1!==e.interactive&&(n[r++]=e);this._quadtree=(0,pf.quadtree)().x(e=>e.x).y(e=>e.y).addAll(n)}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=$t(t.colorScheme,t.themeCategorical,Pf),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:qt(r,t.colorScheme),config:t.layoutConfig??{},selection:t.layoutSelection??null},o=Zt({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 Gt({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,vn({config:t,projection:n,path:r,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:e})}applyCartogramTransform(e,t){const n=dn(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),r=wt(n,this.getPoints());for(let i=0;i<n.length;i++){if(r[i]<0)continue;const o=Lt(e,r[i],t);n[i]._decayOpacity=o,n[i].style={...n[i].style,opacity:o}}}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=wt(n,this.getPoints()),o=t.color||"rgba(255,255,255,0.6)",a=t.glowRadius??4;let s=!1;for(let l=0;l<n.length;l++){const c=r[i[l]];if(void 0===c)continue;const u=Nt(t,c,e);s=Pt(n[l],u,o,a)||s}return s}refreshPulse(e){return!0!==this.lastCustomLayoutFailure?.preservedLastGoodScene&&this.applyPulse(e)}hasActivePulsesAt(e){return!!this.config.pulse&&Et(this.config.pulse,this.timestampBuffer,e)}get hasActivePulses(){return this.hasActivePulsesAt(this.currentTime())}startTransition(e){const t=this.config.transition?.duration??300;if(t<=0)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=Mt(e,this.activeTransition),n=St(t,this.config.transition?.easing),r=this.scene.filter(e=>"point"===e.type);for(const e of r){if(null!=e._targetX&&null!=e._targetY){const t=e.x,r=e.y;e.x=jt(t,e._targetX,n),e.y=jt(r,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}},Jf=require("react"),ep=require("d3-selection"),tp=require("d3-zoom"),np=Object.freeze([]),rp=require("react"),ip={sceneGeometry:0,layout:0,domain:0},op="production"!==process.env.NODE_ENV,ap={revisions:ip,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},sp=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=ip,this.lastObserved=ip,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){op&&(this.lastObserved=Rn(this.lastObserved,jn(e)))}beforeCompute(e,t){if(!op)return ap;const n=Rn(jn(e),this.lastObserved),r=An(n),i=(o=n,a=this.lastConsumed,!(o.sceneGeometry===a.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(op){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="")}}},lp=/* @__PURE__ */ /* @__PURE__ */(0,rp.memo)(function({store:e,diagnostics:t}){return(0,rp.useEffect)(()=>{const n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null}),cp=Fu(require("react")),up=require("react"),dp=require("react-dom"),hp=require("./semiotic-client-cjs-shared.min.js"),fp=require("react"),pp=require("react"),mp="undefined"==typeof window?pp.useEffect:pp.useLayoutEffect,gp=/* @__PURE__ */new WeakMap,yp=0,bp=!1,vp=null,xp=null,wp=null,kp=null,Sp=/* @__PURE__ */new Set,Mp=()=>"undefined"!=typeof performance?performance.now():Date.now(),jp=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=/* @__PURE__ */new Set,this.now=()=>this.advance(),this.random=()=>this.randomSource(),this.clock=e.clock??Mp,this.lastWallTime=Bn(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=Bn(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??Mp;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=Bn(t,this.lastWallTime))}setRandomSource(e,t){const n=_n(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:On(n)))}},Ap=34,Rp=70,Cp="undefined"==typeof window?up.useEffect:up.useLayoutEffect,Lp={requestAnimationFrame:e=>("undefined"==typeof window?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>("undefined"==typeof window?globalThis:window).cancelAnimationFrame(e)},Np=require("react"),Pp=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],Ep={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},Ip={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},Tp={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:Pp,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},zp=require("react"),Dp={fresh:1,aging:.7,stale:.45,expired:.25},$p={alpha:1,band:"fresh",isStale:!1},Fp=require("react/jsx-runtime"),Op={live:"#28a745",stale:"#dc3545",stopped:"#6c757d",failed:"#842029",settling:"#fd7e14"},_p=Fu(require("react")),Bp=require("./semiotic-client-cjs-shared.min.js"),Wp=require("react"),Hp=/^\s*var\(\s*--[^,)\s]+\s*(?:,\s*([\s\S]*))?\)\s*$/,qp=require("react/jsx-runtime"),Gp="var(--semiotic-bg, #ffffff)",Vp=require("react/jsx-runtime"),Up=require("react/jsx-runtime"),Yp=Fu(require("react")),Xp=require("react/jsx-runtime"),Zp=require("d3-hierarchy"),Kp=require("d3-shape"),Qp=require("d3-scale"),Jp=(/* @__PURE__ */require("d3-scale"),Symbol.for("semiotic.heatmapBandTicks")),em=/* @__PURE__ */Symbol.for("semiotic.heatmapBandKeys"),tm=/* @__PURE__ */Symbol.for("semiotic.heatmapBandKeyIndex"),nm=/* @__PURE__ */Symbol.for("semiotic.heatmapBandDirection"),rm=null,im=require("react/jsx-runtime"),om=/* @__PURE__ */new Map,am=/* @__PURE__ */new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]),sm=require("react/jsx-runtime"),lm={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"},cm=require("react/jsx-runtime"),um={secondary:0,primary:3},dm=require("react/jsx-runtime"),hm={linear:Kp.curveLinear,monotoneX:Kp.curveMonotoneX,monotoneY:Kp.curveMonotoneY,step:Kp.curveStep,stepAfter:Kp.curveStepAfter,stepBefore:Kp.curveStepBefore,basis:Kp.curveBasis,cardinal:Kp.curveCardinal,catmullRom:Kp.curveCatmullRom},fm=/* @__PURE__ */new Set(["label","callout","callout-circle","callout-rect","text","widget"]),pm=32,mm=6,gm=4,ym=8,bm=72,vm={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"},xm=Fu(require("react")),wm={fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},km={fontSize:"var(--semiotic-legend-font-size, 12px)"},Sm=Fu(require("react")),Mm=require("react/jsx-runtime"),jm=require("react/jsx-runtime"),Am=e=>e.legendGroup.items.map((t,n)=>jo(e,t,n,`translate(0,${n*e.metrics.rowHeight})`,!1)),Rm=(e,t)=>{const{items:n}=e.legendGroup,r=[],{swatchSize:i,labelGap:o,itemGap:a,rowHeight:s,align:l}=e.metrics,c=n.map(e=>i+o+7*e.label.length),u=[];let d=0,h=0;c.forEach((e,n)=>{const r=0===h?e:h+a+e;t&&t>0&&h>0&&r>t?(u.push({start:d,end:n,width:h}),d=n,h=e):h=r}),n.length>0&&u.push({start:d,end:n.length,width:h}),u.forEach((i,o)=>{let u="center"===l?Math.max(0,((t??i.width)-i.width)/2):"end"===l?Math.max(0,(t??i.width)-i.width):0;for(let t=i.start;t<i.end;t++)r.push(jo(e,n[t],t,`translate(${u},${o*s})`,!0)),u+=c[t]+a});const f=u.reduce((e,t)=>Math.max(e,t.width),0),p=u.length;return{items:r,offset:f,totalRows:p,totalHeight:p*s}},Cm=(e,t,n)=>{const r=[],i=or(e.map(e=>({hasLabel:Boolean(e.label),itemCount:e.items.length})),n.metrics.rowHeight);return e.forEach((e,o)=>{const a=i[o];r.push(
|
|
155
|
+
/* @__PURE__ */(0,jb.jsx)("line",{x1:-11,y1:0,x2:-13,y2:0,stroke:"#bbb",strokeWidth:.8}),
|
|
157
156
|
/* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */(0,
|
|
157
|
+
/* @__PURE__ */(0,jb.jsx)("line",{x1:0,y1:11,x2:0,y2:13,stroke:"#bbb",strokeWidth:.8})]})]})}function Bc(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 Hc(e){const t=(0,Lb.useRef)(null);return Dc(e.imperativeRef,{variant:e.imperativeVariant,frameRef:t}),{frameRef:t,resolved:dc(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,Lb.useMemo)(()=>Bc(e.margin),[e.margin])}}function qc(e){return null==e?void 0:String(e)}function Gc(e){const t=qc(e.id);return{type:"point",x:e.x,y:e.y,r:e.r??Eb,style:{...Ib,cursor:e.cursor},datum:e.datum,pointId:t,_transitionKey:t}}function Vc(e){return Gc(e)}function Yc(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:{...Ib,cursor:e.cursor},datum:e.datum,group:e.group,interactive:!0}}function Uc(e){if(Number.isFinite(e))return Math.max(1,Math.round(e))}function Xc(e){let t=1/0,n=-1/0;for(const r of e)Number.isFinite(r)&&(r<t&&(t=r),r>n&&(n=r));return t===1/0?[0,0]:[t,n]}function Zc(e,t){const n=t[1]-t[0];return 0===n?.5:(e-t[0])/n}function Kc(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):$b,.2,1),i=Number.isFinite(t.aspectRatio)&&Number(t.aspectRatio)>0?Number(t.aspectRatio):Db;let o=Uc(t.columns)??Math.max(1,Math.ceil(Math.sqrt(n.length*i/r))),a=Uc(t.rows)??Math.max(1,Math.ceil(n.length/(o*r)));o*a<n.length&&(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=Xc(n.map(e=>e.x)),l=Xc(n.map(e=>e.y)),c=n.map(e=>({...e,desiredColumn:Zc(e.x,s)*Math.max(0,o-1),desiredRow:Zc(e.y,l)*Math.max(0,a-1)})),u=(o-1)/2,d=(a-1)/2;c.sort((e,t)=>{const n=(e.desiredColumn-u)**2+(e.desiredRow-d)**2;return(t.desiredColumn-u)**2+(t.desiredRow-d)**2-n||e.desiredRow-t.desiredRow||e.desiredColumn-t.desiredColumn||e.index-t.index});const h=/* @__PURE__ */new Set;for(let e=0;e<a;e+=1)for(let t=0;t<o;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=Math.floor(r/o),a=(r%o-e.desiredColumn)**2+(i-e.desiredRow)**2;(a<n||a===n&&r<t)&&(t=r,n=a)}t<0||(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 Qc(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 Jc(e,t){const n=e.properties&&"object"==typeof e.properties?e.properties:{},r=e.id??n.id??n.name??`area-${t}`;return{...n,id:String(r)}}function eu(e){return`${e.map(([e,t],n)=>`${0===n?"M":"L"}${e},${t}`).join("")}Z`}function tu(e,t,n){const r=[];for(let i=0;i<6;i+=1){const o=-Math.PI/2+i*(Math.PI/3);r.push([e+Math.cos(o)*n,t+Math.sin(o)*n])}return eu(r)}function nu(e){return e.areas.map((t,n)=>{const r=Jc(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 ru(e){return e.points.map(t=>{const n=Number(Qc(t,e.config.longitudeAccessor,["lon","longitude"])),r=Number(Qc(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 iu(e,t){if(!t.rowAccessor||!t.columnAccessor)return null;const n=e.map(e=>({datum:e,x:Number(Qc(e,t.columnAccessor)),y:Number(Qc(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 ou({marks:e,color:t,fontSize:n,fontFamily:r,fontWeight:i}){const o=(0,Tb.useCustomLayoutSelection)();/* @__PURE__ */ /* @__PURE__ */
|
|
158
|
+
return(0,zb.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:e.map(e=>{const a=!o.isActive||o.predicate(e.datum);/* @__PURE__ */ /* @__PURE__ */
|
|
159
|
+
return(0,zb.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 au(e){if(Number.isFinite(e)&&!(Number(e)<=0))return Number(e)}function su(e,t){return"function"==typeof t?t(e,e.dotIndex):"string"==typeof t?e[t]:void 0}function lu(e){return e.properties&&"object"==typeof e.properties?{...e.properties}:{}}function cu(e,t){const n=lu(e);return String(e.id??n.id??n.name??`feature-${t}`)}function uu(e,t){if(0===e.length)return null;const n={type:"FeatureCollection",features:e},r=t.bounds(n);return Number.isFinite(r[0][0])&&Number.isFinite(r[0][1])&&Number.isFinite(r[1][0])&&Number.isFinite(r[1][1])?r:null}function du(e,t,n,r){return[Math.ceil((e-n)/r-.5),Math.floor((t-n)/r-.5)]}function hu(e){if(!e)return 0;const t=qb.get(e);if(t)return t;const n=Gb;return Gb+=1,qb.set(e,n),n}function fu(e){return e.map((e,t)=>{if(Hb.has(e))return{feature:e,index:t,bounds:Hb.get(e)??null};try{const n=q(e);return Hb.set(e,n),{feature:e,index:t,bounds:n}}catch{return Hb.set(e,null),{feature:e,index:t,bounds:null}}})}function pu(e,t){return!t||e[1]>=t[0][1]&&e[1]<=t[1][1]&&(n=e[0],(r=t[0][0])<=(i=t[1][0])?n>=r&&n<=i:n>=r||n<=i);var n,r,i}function mu(e,t){for(const n of e){const{feature:e,index:r}=n;if(e.geometry&&pu(t,n.bounds))try{if(Me(e,t))return{feature:e,index:r}}catch{}}return null}function gu(e,t,n,r={}){const i=e.filter((e,t)=>e.geometry&&(!r.featureFilter||r.featureFilter(e,t))),o=uu(i,t.geoPath);if(!o)return{dots:[],cellSize:_b,features:i};const a=Math.max(0,r.layoutPadding??0),s=[[uo(o[0][0],a,Math.max(a,n.width-a)),uo(o[0][1],a,Math.max(a,n.height-a))],[uo(o[1][0],a,Math.max(a,n.width-a)),uo(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:_b,features:i};const u=au(r.columns);let d=Math.max(2,u?l/u:au(r.cellSize)??_b);const h=Math.max(100,Math.round(au(r.maxSamples)??Wb)),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]=du(s[0][0],s[1][0],p,d),[b,v]=du(s[0][1],s[1][1],m,d),x=[],w=fu(i);for(let e=b;e<=v;e+=1){const n=m+(e+.5)*d;for(let i=g;i<=y;i+=1){const o=p+(i+.5)*d,a=t.invertedPoint(o,n);if(!a||!Number.isFinite(a[0])||!Number.isFinite(a[1]))continue;const s=mu(w,a);if(!s)continue;const l={...lu(s.feature),featureId:cu(s.feature,s.index),featureIndex:s.index,gridRow:e,gridColumn:i,longitude:a[0],latitude:a[1],dotIndex:x.length};r.dotFilter&&!r.dotFilter(l,x.length)||x.push(l)}}return{dots:x,cellSize:d,features:i}}function yu(e){return Math.round(1e4*e)/1e4}function bu(e){return Array.isArray(e)&&e.length>=2&&Number.isFinite(e[0])&&Number.isFinite(e[1])?`${yu(Number(e[0]))},${yu(Number(e[1]))}`:"null"}function vu(e,t){const n=e[t];return"function"==typeof n?n.call(e):void 0}function xu(e){return"number"==typeof e&&Number.isFinite(e)?String(yu(e)):null===e?"null":"unavailable"}function wu(e){const t=e.scales.projection;return[xu(vu(t,"scale")),bu(vu(t,"translate")),bu(vu(t,"center")),(n=vu(t,"rotate"),Array.isArray(n)&&n.every(Number.isFinite)?n.map(e=>yu(Number(e))).join(","):"unavailable"),xu(vu(t,"clipAngle")),xu(vu(t,"precision")),...[[0,0],[-120,35],[45,45],[120,-30]].map(([t,n])=>bu(e.scales.projectedPoint(t,n)))].join("|");var n}function ku(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??"",hu(t.featureFilter),hu(t.dotFilter),wu(e)].join("::")}function Su(e){let t=Bb.get(e.areas);t||(t=/* @__PURE__ */new Map,Bb.set(e.areas,t));const n=ku(e),r=t.get(n);if(r)return r;const i=gu(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 Mu(e){return`${e.map(([e,t],n)=>`${0===n?"M":"L"}${e},${t}`).join("")}Z`}function ju(e,t,n){return Mu([[e-n,t-n],[e+n,t-n],[e+n,t+n],[e-n,t+n]])}function Au(e,t,n){return Mu(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 Cu(e,t,n){const{featureKey:r,dataKey:i}=n,o=/* @__PURE__ */new Map;for(const e of t){const t=String(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 String(n??"")};return e.map(e=>{const t=a(e),n=o.get(t);return n?{...e,properties:{...e.properties,...n}}:e})}var Ru,Lu,Nu,Pu,Iu,Eu,Tu,zu,$u,Du,Ou,Fu,_u,Wu,Bu,Hu,qu=Object.create,Gu=Object.defineProperty,Vu=Object.getOwnPropertyDescriptor,Yu=Object.getOwnPropertyNames,Uu=Object.getPrototypeOf,Xu=Object.prototype.hasOwnProperty,Zu=(e,t,n)=>function(){if(n)throw n[0];try{return e&&(t=(0,e[Yu(e)[0]])(e=0)),t}catch(e){throw n=[e],e}},Ku=(e,t)=>{for(var n in t)Gu(e,n,{get:t[n],enumerable:!0})},Qu=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of Yu(t))Xu.call(e,i)||i===n||Gu(e,i,{get:()=>t[i],enumerable:!(r=Vu(t,i))||r.enumerable});return e},Ju=(e,t,n)=>(n=null!=e?qu(Uu(e)):{},Qu(!t&&e&&e.__esModule?n:Gu(n,"default",{value:e,enumerable:!0}),e)),ed=Zu({"src/components/stream/accessibleDataRows.ts"(){}}),td=Zu({"src/components/stream/accessibleTableStyles.ts"(){Ru=5,Lu=25,Nu="semiotic-accessible-data-table semiotic-accessible-data-table-hidden",Pu="semiotic-accessible-data-table semiotic-accessible-data-table-visible",Iu={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Eu={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"},Tu={marginBottom:8,paddingRight:28,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",fontSize:12,letterSpacing:"0.01em"},zu={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)"},$u={width:"100%",borderCollapse:"collapse",fontSize:12,marginTop:4,fontVariantNumeric:"tabular-nums"},Du={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))"},Ou={padding:"4px 10px",borderBottom:"1px solid var(--semiotic-data-table-border, var(--semiotic-border, #e0e0e0))"},Fu={textAlign:"left",fontSize:11,color:"var(--semiotic-data-table-muted-text, var(--semiotic-text-secondary, #666))",marginBottom:4,fontStyle:"italic"},_u={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"}}}),nd=Zu({"src/components/stream/countNoun.ts"(){}}),rd={};Ku(rd,{default:()=>l});var id,od,ad,sd,ld,cd=Zu({"src/components/stream/AccessibleTablePortalImpl.tsx"(){Wu=Ju(require("react")),Bu=require("react-dom"),Hu=require("react/jsx-runtime")}}),ud=Zu({"src/components/stream/accessibleDataTableModel.ts"(){nd(),id=e=>{if(null==e)return"";const t=Math.round(100*e)/100;return Number.isNaN(t)?"":String(t)}}}),dd=Zu({"src/components/stream/AccessibleDataRowsTable.tsx"(){ud(),td(),od=require("react/jsx-runtime")}}),hd=Zu({"src/components/stream/AccessibleTableMoreRows.tsx"(){td(),ad=require("react/jsx-runtime")}}),fd={};Ku(fd,{default:()=>p});var pd,md=Zu({"src/components/stream/AccessibleDataTableContent.tsx"(){sd=Ju(require("react")),dd(),hd(),td(),ed(),ud(),nd(),ld=require("react/jsx-runtime")}}),gd={};Ku(gd,{ChoroplethMap:()=>sb,DEFAULT_HIT_RADIUS:()=>Eb,DistanceCartogram:()=>Cb,FlowMap:()=>Sb,GeoCustomChart:()=>Pb,MultiLineTooltip:()=>tl,ProportionalSymbolMap:()=>gb,StreamGeoFrame:()=>Ry,Tooltip:()=>el,TooltipRoot:()=>Kg,composeStyleRules:()=>xc,geoAreaHitTarget:()=>Yc,geoHitTarget:()=>Vc,geographicDotGridLayout:()=>Vb,geographicGridLayout:()=>Ob,glyphExtent:()=>Zo,glyphPlacement:()=>Xo,gridifyGeographicPoints:()=>Kc,hasOwnTooltipChrome:()=>ns,hasTooltipContent:()=>Xa,hatchFillId:()=>Hi,hatchPatternDef:()=>Gi,hitTargetPoint:()=>Gc,isHatchFill:()=>Wi,makeNodeRuleContext:()=>mc,makeRuleValueResolver:()=>pc,markTooltipChrome:()=>es,matchesThreshold:()=>yc,mergeData:()=>Cu,resolveReferenceGeography:()=>Lc,resolveResponsiveRules:()=>_l,resolveStyleRules:()=>vc,resolveSvgFill:()=>Vi,responsiveRuleMatches:()=>Ol,ruleMatches:()=>bc,sampleGeographicDotGrid:()=>gu}),module.exports=(pd=gd,Qu(Gu({},"__esModule",{value:!0}),pd));var yd,bd,vd,xd,wd,kd,Sd,Md,jd,Ad,Cd,Rd,Ld,Nd,Pd,Id,Ed=require("react"),Td="undefined"==typeof window||"undefined"==typeof document,zd=Td?Ed.useEffect:Ed.useLayoutEffect,$d=require("react"),Dd=class{constructor(e){this.now=e,this.last=null}touch(){this.last=this.now()}clear(){this.last=null}elapsed(){return null==this.last?0:Math.max(0,this.now()-this.last)}},Od=require("d3-array"),Fd=1e-6,_d=1e-12,Wd=Math.PI,Bd=Wd/2,Hd=Wd/4,qd=2*Wd,Gd=180/Wd,Vd=Wd/180,Yd=Math.abs,Ud=Math.atan,Xd=Math.atan2,Zd=Math.cos,Kd=Math.ceil,Qd=Math.exp,Jd=Math.log,eh=Math.sin,th=Math.sign||function(e){return e>0?1:e<0?-1:0},nh=Math.sqrt,rh=Math.tan,ih={Feature:function(e,t){v(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)v(n[r].geometry,t)}},oh={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){x(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)x(n[r],t,0)},Polygon:function(e,t){w(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)w(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)v(n[r],t)}},ah=new Od.Adder,sh=new Od.Adder,lh={point:b,lineStart:b,lineEnd:b,polygonStart:function(){ah=new Od.Adder,lh.lineStart=S,lh.lineEnd=M},polygonEnd:function(){var e=+ah;sh.add(e<0?qd+e:e),this.lineStart=this.lineEnd=this.point=b},sphere:function(){sh.add(qd)}},ch=require("d3-array"),uh={point:T,lineStart:$,lineEnd:D,polygonStart:function(){uh.point=O,uh.lineStart=F,uh.lineEnd=_,Nd=new ch.Adder,lh.polygonStart()},polygonEnd:function(){lh.polygonEnd(),uh.point=T,uh.lineStart=$,uh.lineEnd=D,ah<0?(kd=-(Md=180),Sd=-(jd=90)):Nd>Fd?jd=90:Nd<-Fd&&(Sd=-90),Id[0]=kd,Id[1]=Md},sphere:function(){kd=-(Md=180),Sd=-(jd=90)}};V.invert=V;var dh,hh,fh,ph,mh,gh,yh,bh,vh,xh,wh,kh,Sh=require("d3-array"),Mh=require("d3-array"),jh=se(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?Wd:-Wd,l=Yd(o-n);Yd(l-Wd)<Fd?(e.point(n,r=(r+a)/2>0?Bd:-Bd),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&l>=Wd&&(Yd(n-i)<Fd&&(n-=i*Fd),Yd(o-s)<Fd&&(o-=s*Fd),r=ue(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)i=n*Bd,r.point(-Wd,i),r.point(0,i),r.point(Wd,i),r.point(Wd,0),r.point(Wd,-i),r.point(0,-i),r.point(-Wd,-i),r.point(-Wd,0),r.point(-Wd,i);else if(Yd(e[0]-t[0])>Fd){var o=e[0]<t[0]?Wd:-Wd;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])},[-Wd,-Bd]),Ah=require("d3-array"),Ch=1e9,Rh=-Ch,Lh=require("d3-array"),Nh={sphere:b,point:b,lineStart:function(){Nh.point=me,Nh.lineEnd=pe},lineEnd:b,polygonStart:b,polygonEnd:b},Ph=[null,null],Ih={type:"LineString",coordinates:Ph},Eh={Feature:function(e,t){return be(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(be(n[r].geometry,t))return!0;return!1}},Th={Sphere:function(){return!0},Point:function(e,t){return ve(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(ve(n[r],t))return!0;return!1},LineString:function(e,t){return xe(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(xe(n[r],t))return!0;return!1},Polygon:function(e,t){return we(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(we(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(be(n[r],t))return!0;return!1}},zh=require("d3-array"),$h=e=>e,Dh=require("d3-array"),Oh=new Dh.Adder,Fh=new Dh.Adder,_h={point:b,lineStart:b,lineEnd:b,polygonStart:function(){_h.lineStart=Le,_h.lineEnd=Ie},polygonEnd:function(){_h.lineStart=_h.lineEnd=_h.point=b,Oh.add(Yd(Fh)),Fh=new Dh.Adder},result:function(){var e=Oh/2;return Oh=new Dh.Adder,e}},Wh=_h,Bh=1/0,Hh=Bh,qh=-Bh,Gh=qh,Vh={point:function(e,t){e<Bh&&(Bh=e),e>qh&&(qh=e),t<Hh&&(Hh=t),t>Gh&&(Gh=t)},lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b,result:function(){var e=[[Bh,Hh],[qh,Gh]];return qh=Gh=-(Hh=Bh=1/0),e}},Yh=0,Uh=0,Xh=0,Zh=0,Kh=0,Qh=0,Jh=0,ef=0,tf=0,nf={point:Ee,lineStart:Te,lineEnd:De,polygonStart:function(){nf.lineStart=Oe,nf.lineEnd=Fe},polygonEnd:function(){nf.point=Ee,nf.lineStart=Te,nf.lineEnd=De},result:function(){var e=tf?[Jh/tf,ef/tf]:Qh?[Zh/Qh,Kh/Qh]:Xh?[Yh/Xh,Uh/Xh]:[NaN,NaN];return Yh=Uh=Xh=Zh=Kh=Qh=Jh=ef=tf=0,e}},rf=nf;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,qd)}},result:b};var of,af,sf,lf,cf,uf,df,hf,ff,pf=require("d3-array"),mf=new pf.Adder,gf={point:b,lineStart:function(){gf.point=He},lineEnd:function(){of&&qe(af,sf),gf.point=b},polygonStart:function(){of=!0},polygonEnd:function(){of=null},result:function(){var e=+mf;return mf=new pf.Adder,e}},yf=gf,bf=class{constructor(e){this._append=null==e?Ge:Ve(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!==hf||this._append!==df){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`,hf=e,df=this._append,ff=this._,this._=t}this._+=ff}}result(){const e=this._;return this._="",e.length?e:null}};Xe.prototype={constructor:Xe,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 vf=Zd(30*Vd),xf=Ue({point:function(e,t){this.stream.point(e*Vd,t*Vd)}});ht.invert=function(e,t){return[e,2*Ud(Qd(t))-Bd]},pt.invert=pt;var wf,kf=1.340264,Sf=-.081106,Mf=893e-6,jf=.003796,Af=nh(3)/2;mt.invert=function(e,t){for(var n,r=t,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(kf+Sf*i+o*(Mf+jf*i))-t)/(kf+3*Sf*i+o*(7*Mf+9*jf*i)))*r)*i*i,!(Yd(n)<_d));++a);return[Af*e*(kf+3*Sf*i+o*(7*Mf+9*jf*i))/Zd(r),g(eh(r)/Af)]},yt.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(Yd(n)>Fd&&--i>0);return[e/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},bt.invert=(wf=g,function(e,t){var n=nh(e*e+t*t),r=wf(n),i=eh(r),o=Zd(r);return[Xd(e*i,n*o),g(n&&t*i/n)]});var Cf,Rf,Lf=/* @__PURE__ */new WeakMap,Nf=require("d3-quadtree"),Pf=class{constructor(e){if(this._capacity=e,this.head=0,this._size=0,!Number.isSafeInteger(e)||e<1)throw new Error("RingBuffer capacity must be a positive safe integer");this.buffer=new 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||e>=this._size)return;const t=(this.head-this._size+e+this._capacity)%this._capacity;return this.buffer[t]}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:()=>e>=this._size?{done:!0,value:void 0}:{done:!1,value:this.get(e++)}}}forEach(e){const t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;n<this._size;n++)e(this.buffer[(t+n)%this._capacity],n)}toArray(){const e=new Array(this._size),t=(this.head-this._size+this._capacity)%this._capacity;for(let n=0;n<this._size;n++)e[n]=this.buffer[(t+n)%this._capacity];return e}resize(e){if(!Number.isSafeInteger(e)||e<1)throw new Error("RingBuffer capacity must be a positive safe integer");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=new Array(e),this.head=0,this._size=0;for(let e=n;e<t.length;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;i<this._size;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=new Array(this._capacity),this.head=0,this._size=0;for(const e of t)this.push(e);return n}clear(){this.buffer=new 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}},If=1,Ef=1.5,Tf=3,zf=require("d3-scale"),$f=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],Df=/* @__PURE__ */Tt(["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]),Of=/* @__PURE__ */Tt(["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]),Ff=/* @__PURE__ */Tt(["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]),_f=/* @__PURE__ */Tt(["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]),Wf=/* @__PURE__ */Tt(["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]),Bf=/* @__PURE__ */Tt(["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]),Hf={blues:Df,reds:Of,greens:Ff,viridis:/* @__PURE__ */Tt(["#440154","#482878","#3e4989","#31688e","#26828e","#1f9e89","#35b779","#6ece58","#b5de2b","#fde725"]),oranges:_f,purples:Wf,greys:Bf,plasma:/* @__PURE__ */Tt(["#0d0887","#41049d","#6a00a8","#8f0da4","#b12a90","#cb4679","#e16462","#f1844b","#fca636","#fcce25","#f0f921"]),inferno:/* @__PURE__ */Tt(["#000004","#160b39","#420a68","#6a176e","#932667","#bc3754","#dd513a","#f3771a","#fca50a","#f6d746","#fcffa4"]),magma:/* @__PURE__ */Tt(["#000004","#140e36","#3b0f70","#641a80","#8c2981","#b73779","#de4968","#f7705c","#fe9f6d","#fecf92","#fcfdbf"]),cividis:/* @__PURE__ */Tt(["#00224e","#123570","#3b496c","#575d6d","#707173","#8a8678","#a59c74","#c3b369","#e1cc55","#fee838","#ffea46"]),turbo:/* @__PURE__ */Tt(["#23171b","#4a58dd","#3f9ee9","#46c7af","#7eed5a","#cdf134","#fbb91f","#f56918","#c52f06","#7a0403"])},qf={category10:$f,tableau10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],...Hf},Gf=$f,Vf="#007bff",Yf=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7","#9c755f","#bab0ac"],Uf=/* @__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"]),Xf={mercator:function(){return ft(ht).scale(961/qd)},equalEarth:gt,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=dt().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7]),c=dt().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=dt().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&&i<.234&&r>=-.425&&r<-.214?c:i>=.166&&i<.234&&r>=-.214&&r<-.115?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+Fd,s+.12*n+Fd],[r-.214*n-Fd,s+.234*n-Fd]]).stream(d),a=u.translate([r-.205*n,s+.212*n]).clipExtent([[r-.214*n+Fd,s+.166*n+Fd],[r-.115*n-Fd,s+.234*n-Fd]]).stream(d),t()},e.fitExtent=function(t,n){return Ke(e,t,n)},e.fitSize=function(t,n){return Qe(e,t,n)},e.fitWidth=function(t,n){return Je(e,t,n)},e.fitHeight=function(t,n){return et(e,t,n)},e.scale(1070)},orthographic:function(){return st(bt).scale(249.5).clipAngle(90.000001)},naturalEarth:function(){return st(yt).scale(175.295)},equirectangular:function(){return st(pt).scale(152.63)}},Zf=require("d3-scale"),Kf={data:"data",domain:"domain",layout:"layout","scene-geometry":"sceneGeometry","scene-style":"sceneStyle","data-paint":"dataPaint","interaction-paint":"interactionPaint",overlay:"overlay",accessibility:"accessibility",evidence:"evidence"},Qf=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=gn({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=gn(e,t,this.revisions);this.revisions=n.revisions,this.latest=n;for(const e of[...this.listeners])e();return n}},Jf=["data","domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ep=["scene-style","data-paint","accessibility","evidence"],tp=(e,t)=>({retainedData:e,invalidations:t}),np=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],rp=["domain","layout","scene-geometry","data-paint","overlay","accessibility","evidence"],ip=["scene-geometry","data-paint","accessibility","evidence"],op=["scene-style","data-paint","accessibility","evidence"],ap=["scene-geometry","scene-style","data-paint","accessibility","evidence"],sp=["overlay","accessibility","evidence"],lp=[],cp={xAccessor:/* @__PURE__ */tp("rebuild",np),yAccessor:/* @__PURE__ */tp("rebuild",np),lineDataAccessor:/* @__PURE__ */tp("rebuild",np),pointIdAccessor:/* @__PURE__ */tp("rebuild",ip),lineIdAccessor:/* @__PURE__ */tp("rebuild",ip),windowSize:/* @__PURE__ */tp("rebuild",np),projection:/* @__PURE__ */tp("preserve",rp),projectionExtent:/* @__PURE__ */tp("preserve",rp),fitPadding:/* @__PURE__ */tp("preserve",rp),lineType:/* @__PURE__ */tp("preserve",rp),flowStyle:/* @__PURE__ */tp("preserve",rp),graticule:/* @__PURE__ */tp("preserve",rp),projectionTransform:/* @__PURE__ */tp("preserve",rp),customLayout:/* @__PURE__ */tp("preserve",rp),layoutConfig:/* @__PURE__ */tp("preserve",rp),layoutMargin:/* @__PURE__ */tp("preserve",rp),areaStyle:/* @__PURE__ */tp("preserve",op),pointStyle:/* @__PURE__ */tp("preserve",ap),lineStyle:/* @__PURE__ */tp("preserve",op),colorScheme:/* @__PURE__ */tp("preserve",op),themeCategorical:/* @__PURE__ */tp("preserve",op),themeDiverging:/* @__PURE__ */tp("preserve",op),themeSemantic:/* @__PURE__ */tp("preserve",op),themeSequential:/* @__PURE__ */tp("preserve",op),decay:/* @__PURE__ */tp("preserve",op),pulse:/* @__PURE__ */tp("preserve",op),layoutSelection:/* @__PURE__ */tp("preserve",op),annotations:/* @__PURE__ */tp("preserve",sp),autoPlaceAnnotations:/* @__PURE__ */tp("preserve",sp),clock:/* @__PURE__ */tp("preserve",lp),activityClock:/* @__PURE__ */tp("preserve",lp),transition:/* @__PURE__ */tp("preserve",lp),introAnimation:/* @__PURE__ */tp("preserve",lp),onLayoutError:/* @__PURE__ */tp("preserve",lp)},up=/* @__PURE__ */tp("preserve",rp),dp=class{constructor(){this.tracker=new Qf}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}},Jf)}recordNoop(e){return this.tracker.record({kind:e,..."restyle"===e?{}:{count:0}},[])}recordRestyle(e){return e?this.tracker.record({kind:"restyle"},ep):this.recordNoop("restyle")}recordConfig(e,t={}){const n=yn(e),r=new Set(n.invalidations);return t.retainedDataChanged&&r.add("data"),this.tracker.record({kind:"config",keys:e},r)}},hp=/* @__PURE__ */new WeakMap,fp=class{getLastUpdateResult(){return this.updateResults.last}getUpdateSnapshot(){return this.updateResults.last}subscribeUpdateResult(e){return this.updateResults.subscribe(e)}setLayoutSelection(e){this.config.layoutSelection=e}markStylePaintPending(){hp.set(this,!0)}consumeStylePaintPending(){const e=!0===hp.get(this);return hp.delete(this),e}},pp=class extends fp{constructor(e){super(),this.updateResults=new dp,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.activity=new Dd(()=>this.config.activityClock?.()??this.currentTime()),this.timestampBuffer=null,this.activeTransition=null,this.prevPositions=null,this._hasRenderedOnce=!1,this.config=xn(e)}currentTime(){return this.config.clock?.()??globalThis.performance?.now()??Date.now()}getConfiguredWindowSize(){const e=this.config.windowSize??500;if(!Number.isInteger(e)||e<1)throw new 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 Pf(e),this.timestampBuffer=new Pf(e),r.forEach((e,t)=>{this.pointBuffer.push(e),this.timestampBuffer.push(i[t]??o)})}this.retainNewestLines(e)}updateConfig(e){const t=wn(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.activity.touch(),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.activity.touch(),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.activity.touch(),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 Pf(t),this.timestampBuffer=new Pf(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();fn(this.pointBuffer,e,this.timestampBuffer,t),this.activity.touch(),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)fn(this.pointBuffer,n,this.timestampBuffer,t);this.activity.touch(),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.activity.touch(),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.activity.touch(),this.updateResults.recordData("ingest",t.length)}else this.updateResults.recordNoop("ingest")}removeLine(e){const{lineIdAccessor:t}=this.config;if(!t)throw new 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(String(n(e)))||(i.push(e),!1)),i.length>0?(this.version++,this.activity.touch(),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 new 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(String(n(e)));pn(this.pointBuffer,this.timestampBuffer,e);const t=this.pointBuffer.remove(e);return t.length>0?(this.version++,this.activity.touch(),this.updateResults.recordData("remove",t.length)):this.updateResults.recordNoop("remove"),t}{const e=[];return this.pointData=this.pointData.filter(t=>!r.has(String(n(t)))||(e.push(t),!1)),e.length>0?(this.version++,this.activity.touch(),this.updateResults.recordData("remove",e.length)):this.updateResults.recordNoop("remove"),e}}clear(){this.activity.clear(),this.lastIngestTime=0,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)}rebuildProjectedScene(e,t){this._customLayoutFailedThisBuild=!1;const n=this.buildSceneNodes(e);return this._customLayoutFailedThisBuild?(this.lastCustomLayoutFailure?.preservedLastGoodScene?t():(this.scene=[],this.rebuildQuadtree()),!1):(this.scene=n,this.rebuildQuadtree(),!0)}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=Zt(t.projection),this.geoPath=Ye(this.projection),this.fitProjection(e),this.geoPath=Ye(this.projection);const c=this.projection;if(this.scales=kt(c),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(e,()=>{this.projection=n,this.geoPath=r,this.scales=i,this.baseScale=o,this.baseTranslate=a,this.baseRotation=s})){if(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=Kt(n.xAccessor,"lon"),o=Kt(n.yAccessor,"lat"),a=this.getPoints();if(a.length>0){const e=a.map(e=>[i(e),o(e)]).filter(e=>e.every(Number.isFinite));r.push({type:"Feature",properties:{},geometry:{type:"MultiPoint",coordinates:e}})}const s=Qt(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,s={type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:[[[r,i],[r,a],[o,a],[o,i],[r,i]]]}};t.fitExtent([[0,0],[e.width,e.height]],s)}else if(t.clipAngle&&(t.clipAngle()??0)>0){const r=n.fitPadding??0,i=Math.min(e.width,e.height),o=i/2-i*r;t.scale(o),t.translate([e.width/2,e.height/2])}else{const i={type:"FeatureCollection",features:r},o=n.fitPadding??0,a=e.width*o,s=e.height*o;t.fitExtent([[a,s],[e.width-a,e.height-s]],i),vt(t,i,e)}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=Ye(n),this.scales=kt(n),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(t,()=>{n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i})&&(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=Ye(n),this.scales=kt(n),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(t,()=>{n.scale(o),n.translate(a),this.currentZoom=s,this.geoPath=r,this.scales=i})&&(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=Ye(n),this.scales=kt(n),this.geoPath=this.scales.geoPath,this.rebuildProjectedScene(t,()=>{n.rotate(o),this.geoPath=r,this.scales=i})&&(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 e=0,t=0;for(const n of this.scene)"point"===n.type&&!1!==n.interactive&&(t++,n.r>e&&(e=n.r));if(this._maxPointRadius=e,t<=500)return void(this._quadtree=null);const n=new Array(t);let r=0;for(const e of this.scene)"point"===e.type&&!1!==e.interactive&&(n[r++]=e);this._quadtree=(0,Nf.quadtree)().x(e=>e.x).y(e=>e.y).addAll(n)}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=$t(t.colorScheme,t.themeCategorical,Yf),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:Ht(r,t.colorScheme),config:t.layoutConfig??{},selection:t.layoutSelection??null},o=Xt({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 qt({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,bn({config:t,projection:n,path:r,areas:this.areas,points:this.getPoints(),lines:this.lineData,layout:e})}applyCartogramTransform(e,t){const n=un(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),r=wt(n,this.getPoints());for(let i=0;i<n.length;i++){if(r[i]<0)continue;const o=Rt(e,r[i],t);n[i]._decayOpacity=o}}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=wt(n,this.getPoints()),o=t.color||"rgba(255,255,255,0.6)",a=t.glowRadius??4;let s=!1;for(let l=0;l<n.length;l++){const c=r[i[l]];if(void 0===c)continue;const u=Lt(t,c,e);s=Nt(n[l],u,o,a)||s}return s}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(t<=0)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??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=Mt(e,this.activeTransition),n=St(t,this.config.transition?.easing),r=this.scene.filter(e=>"point"===e.type);for(const e of r){if(null!=e._targetX&&null!=e._targetY){const t=e.x,r=e.y;e.x=jt(t,e._targetX,n),e.y=jt(r,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}},mp=require("react"),gp=require("d3-selection"),yp=require("d3-zoom"),bp=Object.freeze([]),vp=require("react"),xp={sceneGeometry:0,layout:0,domain:0},wp="production"!==process.env.NODE_ENV,kp={revisions:xp,signature:"",sawSignals:!1,wasUnconsumed:!1,warnUnconsumed:!1},Sp=class{constructor(e="scene host"){this.hostName=e,this.lastConsumed=xp,this.lastObserved=xp,this.lastDuplicateWarning="",this.lastUnconsumedWarning=""}observeUpdateResult(e){wp&&(this.lastObserved=An(this.lastObserved,Mn(e)))}beforeCompute(e,t){if(!wp)return kp;const n=An(Mn(e),this.lastObserved),r=jn(n),i=(o=n,a=this.lastConsumed,!(o.sceneGeometry===a.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(wp){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="")}}},Mp=/* @__PURE__ */ /* @__PURE__ */(0,vp.memo)(function({store:e,diagnostics:t}){return(0,vp.useEffect)(()=>{const n=()=>t.observeUpdateResult(e.getUpdateSnapshot());return n(),e.subscribeUpdateResult(n)},[t,e]),null}),jp=Ju(require("react")),Ap=require("react"),Cp=require("react-dom"),Rp=require("./semiotic-client-cjs-shared.min.js"),Lp=require("react"),Np=require("react"),Pp="undefined"==typeof window?Np.useEffect:Np.useLayoutEffect,Ip=/* @__PURE__ */new WeakMap,Ep=0,Tp=!1,zp=null,$p=null,Dp=null,Op=null,Fp=/* @__PURE__ */new Set,_p=()=>"undefined"!=typeof performance?performance.now():Date.now(),Wp=class{constructor(e={}){this.randomSource=Math.random,this.subscribers=/* @__PURE__ */new Set,this.now=()=>this.advance(),this.wallNow=()=>(this.advance(),this.wallTime),this.random=()=>this.randomSource(),this.clock=e.clock??_p,this.lastWallTime=Wn(this.clock,0),this.logicalTime=this.lastWallTime,this.wallTime=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=Wn(this.clock,this.lastWallTime),t=Math.max(0,e-this.lastWallTime);return this.lastWallTime=e,this.wallTime+=t,this.isActive&&(this.logicalTime+=t),this.logicalTime}emit(){for(const e of this.subscribers)e()}setClock(e){const t=e??_p;t!==this.clock&&(this.advance(),this.clock=t,this.lastWallTime=Wn(t,this.lastWallTime))}setRandomSource(e,t){const n=_n(t);e===this.randomInput&&n===this.seedValue||(this.randomInput=e,this.seedValue=n,this.randomSource=e??(void 0===n?Math.random:Fn(n)))}},Bp=100,Hp=7,qp=22,Gp=46,Vp=64,Yp=34,Up=70,Xp="undefined"==typeof window?Ap.useEffect:Ap.useLayoutEffect,Zp={requestAnimationFrame:e=>("undefined"==typeof window?globalThis:window).requestAnimationFrame(e),cancelAnimationFrame:e=>("undefined"==typeof window?globalThis:window).cancelAnimationFrame(e)},Kp=require("react"),Qp=["#0072B2","#E69F00","#009E73","#CC79A7","#56B4E9","#D55E00","#F0E442","#000000"],Jp={mode:"light",colors:{primary:"#00a2ce",secondary:"#6c757d",categorical:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#333",textSecondary:"#666",grid:"#e0e0e0",border:"#ccc",selection:"#00a2ce",selectionOpacity:.15,success:"#2ca02c",danger:"#d62728",warning:"#f0ad4e",error:"#b4181b",info:"#00a2ce"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},em={mode:"dark",colors:{primary:"#4fc3f7",secondary:"#90a4ae",categorical:["#4fc3f7","#ffb74d","#81c784","#ef5350","#ba68c8","#a1887f","#f06292","#90a4ae","#dce775","#4dd0e1"],sequential:"blues",diverging:"RdBu",background:"#1a1a2e",surface:"#252540",text:"#e0e0e0",textSecondary:"#aaa",grid:"#333",border:"#555",selection:"#4fc3f7",selectionOpacity:.15,success:"#81c784",danger:"#ef5350",warning:"#ffb74d",error:"#d84848",info:"#4fc3f7"},typography:{fontFamily:"sans-serif",titleSize:16,labelSize:12,tickSize:12}},tm={mode:"light",colors:{primary:"#0000cc",secondary:"#333333",categorical:Qp,sequential:"blues",diverging:"RdBu",background:"#ffffff",surface:"#ffffff",text:"#000000",textSecondary:"#333333",grid:"#999999",border:"#000000",focus:"#0000cc",selection:"#0000cc",selectionOpacity:.1,success:"#006400",danger:"#cc0000",warning:"#b15a00",error:"#8b0000",info:"#0000cc"},typography:{fontFamily:"system-ui, sans-serif",titleSize:18,labelSize:14,tickSize:12},tooltip:{background:"#000000",text:"#ffffff",borderRadius:"4px",fontSize:"14px",shadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},borderRadius:"4px"},nm=require("react"),rm={fresh:1,aging:.7,stale:.45,expired:.25},im={alpha:1,band:"fresh",isStale:!1},om=require("react"),am=require("react/jsx-runtime"),[sm,lm]=/* @__PURE__ */Pr(e=>({theme:Mr(Jp),setTheme(t,n=!1){e(e=>{const r=n?Mr(t):Rr(e.theme,t);return e.equals?.(e.theme,r)?{}:{theme:r}})}})),cm=require("react/jsx-runtime"),um={live:"#28a745",stale:"#dc3545",stopped:"#6c757d",failed:"#842029",settling:"#fd7e14"},dm=Ju(require("react")),hm=require("./semiotic-client-cjs-shared.min.js"),fm=require("react"),pm=/^\s*var\(\s*--[^,)\s]+\s*(?:,\s*([\s\S]*))?\)\s*$/,mm=require("react/jsx-runtime"),gm="var(--semiotic-bg, #ffffff)",ym=require("react/jsx-runtime"),bm=require("react/jsx-runtime"),vm=Ju(require("react")),xm=require("react/jsx-runtime"),wm=require("d3-hierarchy"),km=require("d3-shape"),Sm=require("d3-scale"),Mm=(/* @__PURE__ */require("d3-scale"),Symbol.for("semiotic.heatmapBandTicks")),jm=/* @__PURE__ */Symbol.for("semiotic.heatmapBandKeys"),Am=/* @__PURE__ */Symbol.for("semiotic.heatmapBandKeyIndex"),Cm=/* @__PURE__ */Symbol.for("semiotic.heatmapBandDirection"),Rm=null,Lm=require("react/jsx-runtime"),Nm=/* @__PURE__ */new Map,Pm=/* @__PURE__ */new Set(["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"]),Im=require("react/jsx-runtime"),Em={fill:"var(--semiotic-text, #333)",fontSize:11,fontFamily:"inherit"},Tm=require("react/jsx-runtime"),zm={secondary:0,primary:3},$m=require("react/jsx-runtime"),Dm={linear:km.curveLinear,monotoneX:km.curveMonotoneX,monotoneY:km.curveMonotoneY,step:km.curveStep,stepAfter:km.curveStepAfter,stepBefore:km.curveStepBefore,basis:km.curveBasis,cardinal:km.curveCardinal,catmullRom:km.curveCatmullRom},Om=/* @__PURE__ */new Set(["label","callout","callout-circle","callout-rect","text","widget"]),Fm=32,_m=6,Wm=4,Bm=8,Hm=72,qm={ai:"AI",agent:"agent",watcher:"watcher",system:"system",import:"imported",computed:"computed",user:"you"},Gm=Ju(require("react")),Vm={fontFamily:"var(--semiotic-legend-font-family, var(--semiotic-font-family, sans-serif))",fontWeight:"var(--semiotic-legend-font-weight, normal)"},Ym={fontSize:"var(--semiotic-legend-font-size, 12px)"},Um=Ju(require("react")),Xm=require("react/jsx-runtime"),Zm=require("react/jsx-runtime"),Km=(e,t,n)=>{const{items:r}=e.legendGroup,i=[];for(let o=0;o<n.visibleCount;o++){const a=r[o];if(!a)continue;const{x:s,y:l}=rr(t,n,o);i.push(_o(e,a,o,`translate(${s},${l})`,!1,t.labelWidth))}if(n.hiddenCount>0){const{x:r,y:o}=rr(t,n,n.visibleCount);i.push(Wo(e,r,o,n.visibleCount))}return i},Qm=(e,t,n)=>{const{items:r}=e.legendGroup,i=[],{swatchSize:o,labelGap:a,itemGap:s,rowHeight:l,align:c}=e.metrics,u=o+a,d=tr(r.map(e=>u+Xn(Zn(e.label))),{itemGap:s,labelOffset:u,maxWidth:t,maxRows:n});d.rows.forEach((n,o)=>{const a="center"===c?Math.max(0,((t??n.width)-n.width)/2):"end"===c?Math.max(0,(t??n.width)-n.width):0;let h=a;for(let t=n.start;t<n.end;t++)i.push(_o(e,r[t],t,`translate(${h},${o*l})`,!0,d.widths[t]-u)),h+=d.widths[t]+s;d.hiddenCount>0&&o===d.rows.length-1&&i.push(Wo(e,a+d.moreX,o*l,d.visibleCount))});const h=d.rows.length,f=h*l;return{items:i,offset:d.width,totalRows:h,totalHeight:f}},Jm=(e,t,n,r,i)=>{const o=[],a=nr(e,r,null!=i?{maxWidth:t,maxHeight:i}:void 0),s=null!=i?t:Number.POSITIVE_INFINITY;return e.forEach((e,r)=>{const i=a.groups[r],l=e.label?Kn(e.label,s):e.label;o.push(
|
|
159
160
|
/* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */(0,
|
|
161
|
+
/* @__PURE__ */(0,Zm.jsx)("line",{"aria-hidden":"true",stroke:"var(--semiotic-border, #808080)",x1:0,y1:i.lineY,x2:t,y2:i.lineY},`legend-top-line legend-symbol-${r}`)),e.label&&null!=i.labelY&&o.push(
|
|
161
162
|
/* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */(0,
|
|
163
|
+
/* @__PURE__ */(0,Zm.jsxs)("text",{y:i.labelY,className:"legend-group-label","aria-hidden":n.interactive||void 0,fontSize:12,style:Ym,fill:"var(--semiotic-text, #333)",children:[l!==e.label&&/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)("title",{children:e.label}),l]},`legend-text-${r}`)),o.push(
|
|
163
164
|
/* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */(0,
|
|
165
|
+
/* @__PURE__ */(0,Zm.jsx)("g",{className:"legend-item",role:n.interactive?"group":void 0,"aria-label":e.label,transform:`translate(0,${i.itemsY})`,children:Km({...n,legendGroup:e,groupIndex:r},a,i)},`legend-group-${r}`))}),o},eg=(e,t,n,r,i)=>{const{metrics:o}=r,a=null!=i?er(i,o.rowHeight,e.length):Number.POSITIVE_INFINITY;let s=0;const l=[];e.forEach((e,n)=>{let i=0;e.label&&(i+=16);const c=Qm({...r,legendGroup:e,groupIndex:n},o.maxWidth??t,a);i+=c.offset+5,l.push({...c,offset:i}),s+=i+12});const c=o.maxWidth??t;let u=s>c?0:"center"===o.align?Math.max(0,(c-s)/2):"end"===o.align?Math.max(0,c-s):0;const d=[];return l.forEach((t,i)=>{const o=e[i];if(o.label&&(d.push(
|
|
165
166
|
/* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */(0,
|
|
167
|
+
/* @__PURE__ */(0,Zm.jsx)("text",{transform:`translate(${u},0) rotate(90)`,textAnchor:"start",className:"legend-group-label","aria-hidden":r.interactive||void 0,fontSize:12,style:Ym,fill:"var(--semiotic-text, #333)",children:o.label},`legend-text-${i}`)),u+=16),d.push(
|
|
167
168
|
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */(0,
|
|
169
|
-
return(0,kg.jsx)("div",{...i,ref:s,"data-semiotic-tooltip-chrome":!0,className:l?t:`semiotic-tooltip ${t}`.trim(),style:a&&!l?{...Sg,...n}:n,children:r})}),Ag=require("react/jsx-runtime"),Rg=require("d3-zoom"),Cg=require("d3-selection"),Lg=require("d3-shape"),Ng=require("d3-shape"),Pg=/* @__PURE__ */new WeakMap,Eg=1,Ig=class{constructor(e=256){this.cache=/* @__PURE__ */new Map,this.limit=ls(e)}setLimit(e){this.limit=ls(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)r.lastUsed<t&&(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()}},Tg=class{constructor(e){this.capacity=e,this.particles=new Array(e);for(let t=0;t<e;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;n<this.capacity;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;i<this.capacity;i++){const o=this.particles[i];if(!o.active)continue;const a=n[o.lineIndex];if(!a||a.length<2){o.active=!1;continue}if(o.t+=e*t,o.t>=1){o.active=!1;continue}const s=us(a),l=ds(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;n<this.capacity;n++)this.particles[n].active&&this.particles[n].lineIndex===e&&t++;return t}clear(){for(let e=0;e<this.capacity;e++)this.particles[e].active=!1}},zg=Fu(require("react")),Dg=Fu(require("react")),$g=require("react/jsx-runtime"),Fg=/* @__PURE__ */new Set,Og="__semioticSelectionData",_g=["name","label","title"],Bg=["type","kind","category","group","class","status","role","shape"],Wg=["value","amount","total","count","weight","score"],Hg=/* @__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"]),qg=require("react/jsx-runtime"),Gg=!1,Vg=(require("react/jsx-runtime"),require("react/jsx-runtime")),Ug=/* @__PURE__ */Da(function({data:e}){if(!e)return null;if(e.properties){const t=e.properties.name||e.properties.NAME||e.properties.id||"Feature";/* @__PURE__ */ /* @__PURE__ */
|
|
170
|
-
return(0,Vg.jsx)("div",{className:"semiotic-tooltip",style:Sg,children:/* @__PURE__ */ /* @__PURE__ */(0,Vg.jsx)("div",{style:{fontWeight:600},children:t})})}const t=null!=e.data?e.data:e;if(!t||"object"!=typeof t)return null;const n=Es(t),r=null!=n.title?String(n.title):null;return null==r&&0===n.entries.length?null:/* @__PURE__ */ /* @__PURE__ */(0,Vg.jsxs)("div",{className:"semiotic-tooltip",style:Sg,children:[null!=r&&/* @__PURE__ */ /* @__PURE__ */(0,Vg.jsx)("div",{style:{fontWeight:600,marginBottom:n.entries.length?2:0},children:r}),n.entries.map(e=>{/* @__PURE__ */ /* @__PURE__ */return(0,Vg.jsxs)("div",{children:[
|
|
169
|
+
/* @__PURE__ */(0,Zm.jsx)("g",{className:"legend-item",role:r.interactive?"group":void 0,"aria-label":o.label,transform:`translate(${u},0)`,children:t.items},`legend-group-${i}`)),u+=t.offset+5,e[i+1]){const e=t.totalHeight||n;d.push(
|
|
171
170
|
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */(0,
|
|
171
|
+
/* @__PURE__ */(0,Zm.jsx)("line",{"aria-hidden":"true",stroke:"var(--semiotic-border, #808080)",x1:u,y1:-8,x2:u,y2:e+0+8},`legend-top-line legend-symbol-${i}`))}u+=12}),/* @__PURE__ */ /* @__PURE__ */(0,Zm.jsx)("g",{children:d})},tg=require("react/jsx-runtime"),ng=require("react/jsx-runtime"),rg=require("react/jsx-runtime"),ig=Ju(require("react")),og=Ju(require("react")),ag=[40,40],sg=[.5,.5],lg=null,cg=require("react/jsx-runtime"),ug=Ju(require("react")),dg=require("react/jsx-runtime"),hg=require("react/jsx-runtime"),fg=require("react"),pg="undefined"!=typeof window?fg.useLayoutEffect:fg.useEffect,mg=()=>()=>{},gg=()=>!1,yg=()=>!0,bg=require("react"),vg=require("react/jsx-runtime"),xg="undefined"==typeof window?bg.useEffect:bg.useLayoutEffect,wg=require("react"),kg=Ju(require("react")),Sg=Ju(require("react")),Mg={position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},jg={position:"absolute",top:4,left:4,zIndex:"var(--semiotic-data-table-z-index, var(--semiotic-overlay-z-index, 20))",width:"auto",height:"auto",maxWidth:"calc(100% - 8px)",overflow:"visible",whiteSpace:"normal",padding:"4px 8px",fontSize:12,background:"var(--semiotic-bg, #fff)",color:"var(--semiotic-text, #000)",border:"2px solid var(--semiotic-focus, #005fcc)",borderRadius:4};ed();var Ag=require("react/jsx-runtime");td();var Cg=Ju(require("react")),Rg=/* @__PURE__ */new Map,Lg=/* @__PURE__ */new Map,Ng=/* @__PURE__ */Cg.createContext(null),Pg=null,Ig=!1,Eg=require("react/jsx-runtime"),Tg=Ju(require("react")),zg=Ju(require("react")),$g=(/* @__PURE__ */require("react/jsx-runtime"),zg.createContext(null)),Dg="undefined"==typeof window?Tg.useEffect:Tg.useLayoutEffect;ed(),nd();var Og,Fg=require("react/jsx-runtime"),_g=/* @__PURE__ */kg.lazy(()=>Promise.resolve().then(()=>(cd(),rd))),Wg=/* @__PURE__ */kg.lazy(()=>Promise.resolve().then(()=>(md(),fd))),Bg=require("react"),Hg=require("react/jsx-runtime"),qg="var(--semiotic-focus, #005fcc)",Gg=Ju(require("react")),Vg=require("react-dom"),Yg=Ju(require("react")),Ug=require("react/jsx-runtime"),Xg={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"},Zg=/* @__PURE__ */Symbol.for("semiotic.tooltipChromeContext"),Kg=/* @__PURE__ */es(function({chrome:e,className:t="",style:n,children:r,...i}){const o=Ka(),a="default"===(e??o??"default"),s=Yg.useRef(null);Yg.useImperativeHandle(i.ref,()=>s.current);const l=Ja(s,void 0===e&&a);/* @__PURE__ */ /* @__PURE__ */
|
|
172
|
+
return(0,Ug.jsx)("div",{...i,ref:s,"data-semiotic-tooltip-chrome":!0,className:l?t:`semiotic-tooltip ${t}`.trim(),style:a&&!l?{...Xg,...n}:n,children:r})}),Qg=require("react/jsx-runtime"),Jg=require("d3-zoom"),ey=require("d3-selection"),ty=require("d3-shape"),ny=require("d3-shape"),ry=/* @__PURE__ */new WeakMap,iy=1,oy=class{constructor(e=256){this.cache=/* @__PURE__ */new Map,this.limit=As(e)}setLimit(e){this.limit=As(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)r.lastUsed<t&&(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()}},ay=class{constructor(e){this.capacity=e,this.particles=new Array(e);for(let t=0;t<e;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;n<this.capacity;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;i<this.capacity;i++){const o=this.particles[i];if(!o.active)continue;const a=n[o.lineIndex];if(!a||a.length<2){o.active=!1;continue}if(o.t+=e*t,o.t>=1){o.active=!1;continue}const s=Rs(a),l=Ls(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;n<this.capacity;n++)this.particles[n].active&&this.particles[n].lineIndex===e&&t++;return t}clear(){for(let e=0;e<this.capacity;e++)this.particles[e].active=!1}},sy=Ju(require("react")),ly=Ju(require("react")),cy=require("react/jsx-runtime"),uy=/* @__PURE__ */new Set,dy="__semioticSelectionData",hy=["name","label","title"],fy=["type","kind","category","group","class","status","role","shape"],py=["value","amount","total","count","weight","score"],my=/* @__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"]),gy=require("react/jsx-runtime"),yy=!1,by=(require("react/jsx-runtime"),require("react/jsx-runtime")),vy=/* @__PURE__ */es(function({data:e}){if(!e)return null;if(e.properties){const t=e.properties.name||e.properties.NAME||e.properties.id||"Feature";/* @__PURE__ */ /* @__PURE__ */
|
|
173
|
+
return(0,by.jsx)("div",{className:"semiotic-tooltip",style:Xg,children:/* @__PURE__ */ /* @__PURE__ */(0,by.jsx)("div",{style:{fontWeight:600},children:t})})}const t=null!=e.data?e.data:e;if(!t||"object"!=typeof t)return null;const n=Zs(t),r=null!=n.title?String(n.title):null;return null==r&&0===n.entries.length?null:/* @__PURE__ */ /* @__PURE__ */(0,by.jsxs)("div",{className:"semiotic-tooltip",style:Xg,children:[null!=r&&/* @__PURE__ */ /* @__PURE__ */(0,by.jsx)("div",{style:{fontWeight:600,marginBottom:n.entries.length?2:0},children:r}),n.entries.map(e=>{/* @__PURE__ */ /* @__PURE__ */return(0,by.jsxs)("div",{children:[
|
|
173
174
|
/* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */(0,
|
|
175
|
+
/* @__PURE__ */(0,by.jsxs)("span",{style:{opacity:.7},children:[e.key,": "]}),
|
|
175
176
|
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */(0,wd.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:g,pointIdAccessor:y,lineIdAccessor:b,lineType:v="geo",flowStyle:x="basic",graticule:w,zoomable:k,zoomExtent:S,onZoom:M,dragRotate:j,showParticles:A,particleStyle:R,tileURL:C,tileAttribution:L,tileCacheSize:N,size:P,width:E,height:I,responsiveWidth:T,responsiveHeight:z,margin:D,className:$,background:F,maxDevicePixelRatio:O,runtimeMode:_,windowSize:B=500,renderMode:W,areaStyle:H,pointStyle:q,lineStyle:G,colorScheme:V,enableHover:U=!0,hoverAnnotation:Y,tooltipContent:X,allowTooltipOverflow:Z=!1,customClickBehavior:K,customHoverBehavior:Q,onObservation:J,annotationObservationCallback:ee,chartId:te,annotations:ne,onAnnotationActivate:re,autoPlaceAnnotations:ie,svgAnnotationRules:oe,decay:ae,pulse:se,transition:le,animate:ce,staleness:ue,frameScheduler:de,clock:he,random:fe,seed:pe,paused:me=!1,suspendWhenHidden:ge=!0,backgroundGraphics:ye,foregroundGraphics:be,title:ve,legend:xe,legendPosition:we,legendLayout:ke,legendHoverBehavior:Se,legendClickBehavior:Me,legendHighlightedCategory:je,legendIsolatedCategories:Ae,legendCategoryAccessor:Re,onCategoriesChange:Ce,showAxes:Le,accessibleTable:Ne=!0,description:Pe,summary:Ee}=e,{customHoverBehavior:Ie,customClickBehavior:Te,hasClickBehavior:ze}=Ks({customHoverBehavior:Q,customClickBehavior:K,onObservation:J,chartId:te,chartType:"StreamGeoFrame"}),De=P||[E||600,I||400],$e=(0,wd.useRef)(!0),Fe=lr({sizeProp:De,responsiveWidth:T,responsiveHeight:z,userMargin:D,marginDefault:Yg,title:ve,legend:xe,legendPosition:we,legendLayout:ke,legendMarginReserved:e.__legendMarginReservedFor===xe,animate:ce,transitionProp:le,frameScheduler:de,clock:he,random:fe,seed:pe,paused:me,suspendWhenHidden:ge,themeDirtyRef:$e}),{reducedMotionRef:Oe,responsiveRef:_e,size:Be,margin:We,adjustedWidth:He,adjustedHeight:qe,transition:Ge,introEnabled:Ve,tableId:Ue,frameRuntime:Ye,rafRef:Xe,renderFnRef:Ze,scheduleRender:Ke,currentTheme:Qe}=Fe,Je=Zo(),et=Ko(),tt=(0,wd.useMemo)(()=>Array.isArray(a)?Sn(a):a,[a]),nt=(0,wd.useMemo)(()=>Sn(s),[s]),rt=(0,wd.useMemo)(()=>Sn(l),[l]),it=j??"orthographic"===Vs(n),ot=ua((0,wd.useMemo)(()=>({projection:n,projectionExtent:r,fitPadding:i,xAccessor:f,yAccessor:p,lineDataAccessor:g,lineType:v,flowStyle:x,areaStyle:H,pointStyle:q,lineStyle:G,colorScheme:V,themeSemantic:mr(Qe),themeSequential:Qe?.colors?.sequential,themeDiverging:Qe?.colors?.diverging,themeCategorical:Qe?.colors?.categorical,graticule:w,projectionTransform:o,windowSize:B,clock:Ye.now,decay:ae,pulse:se,transition:Ge,introAnimation:Ve,annotations:ne,pointIdAccessor:y,lineIdAccessor:b,customLayout:c,layoutConfig:u,onLayoutError:h,layoutMargin:We}),[n,r,i,f,p,g,v,x,H,q,G,V,Qe,w,o,B,Ye.now,ae,se,Ge,Ve,ne,y,b,c,u,h,We])),at=(0,wd.useRef)(null);at.current||(at.current=new Qf(ot));const st=vd||!Je&&et,lt=(0,wd.useMemo)(()=>{if(!st)return null;const e=new Qf(ot);return tt&&e.setAreas(tt),s&&e.setPoints(nt),l&&e.setLines(rt),e.computeScene({width:He,height:qe}),e.cancelIntroAnimation(),e},[st,ot,tt,s,nt,l,rt,He,qe]);m(at,lt);const ct=lt??at.current,ut=(0,wd.useRef)(null),dt=ut.current??(ut.current=cl(ct.scales)),{resolvedForeground:ht,resolvedBackground:ft,themeBackground:pt,surfaceBackground:mt}=dl({foregroundGraphics:be,backgroundGraphics:ye,size:Be,margin:We,scales:ct.scales,background:F,themeBackgroundColor:Qe.colors.background,tracker:dt,readScales:()=>ct.scales}),gt=(0,wd.useRef)(null),yt=(0,wd.useRef)(null),bt=(0,wd.useRef)(null);C&&!bt.current&&(bt.current=new Ig(N??256)),bt.current?.setLimit(N??256);const vt=(0,wd.useRef)(ne),xt=(0,wd.useRef)(null),wt=(0,wd.useRef)(Rg.zoomIdentity),kt=(0,wd.useRef)(!1),St=(0,wd.useRef)(null),Mt=(0,wd.useCallback)(e=>{St.current=e,_e&&"object"==typeof _e&&(_e.current=e)},[_e]),jt=(0,wd.useRef)(null),At=(0,wd.useRef)(null),Rt=(0,wd.useRef)(null),Ct=(0,wd.useRef)(0);if(A&&!Rt.current){const e=R?.maxPerLine??Gs();Rt.current=new Tg(50*e)}const Lt=(0,wd.useRef)(null),Nt=(0,wd.useRef)(!1),Pt=(0,wd.useRef)(null),Et=(0,wd.useRef)(!1),It=(0,wd.useRef)(!1),Tt=(0,rp.useRef)(new sp("StreamGeoFrame")),zt=(0,wd.useRef)(void 0),[Dt,$t]=(0,wd.useState)(null),[,Ft]=(0,wd.useState)(0),Ot=(0,wd.useRef)(0),[_t,Bt]=(0,wd.useState)(!1),Wt=La(at,Re,Ce,e=>e.getPoints());cr(at,ot,$e,Ke),ur(at,d,$e,Ke),(0,wd.useEffect)(()=>{const e=at.current;e&&(tt&&e.setAreas(tt),s&&e.setPoints(nt),l&&e.setLines(rt),$e.current=!0,Ke())},[tt,s,nt,l,rt,Ke]),Mn(t,{storeRef:at,dirtyRef:$e,scheduleRender:Ke,zoomTransformRef:wt,containerRef:St,zoomBehaviorRef:xt});const{hoverHandlerRef:Ht,onPointerMove:qt,onPointerLeave:Gt,flushPointerMove:Vt,pointerStateRef:Ut}=Fe,{canvasRef:Yt,interactionCanvasRef:Xt,resolutionDirtyRef:Zt}=oa(Fe,{hydrated:Je,wasHydratingFromSSR:et,storeRef:at,dirtyRef:$e,cleanup:()=>bt.current?.clear(),maxDevicePixelRatio:O,canvasPaintDependencies:[He,qe,F,ye,W,C,N,Ke]});(0,wd.useEffect)(()=>{Ht.current=e=>{const t=Yt.current;if(!t)return;const n=at.current;if(!n||!n.scene.length)return void Go(t);const r=Us({pointer:e,canvasRect:t.getBoundingClientRect(),margin:We,width:He,height:qe,scene:n.scene,pointQuadtree:n.quadtree,maxPointRadius:n.maxPointRadius,hitCanvasRef:yt});Go(t,"hit"===r.kind?Ho(r.node):void 0),U&&!1!==Y&&("hit"===r.kind?(Lt.current=r.hover,Pt.current=r.node,$t(r.hover),Ie?.(r.hover),Ke()):("outside"===r.kind||"miss"===r.kind&&Lt.current)&&(Lt.current=null,Pt.current=null,$t(null),Ie?.(null),Ke()))}},[U,Y,He,qe,We,Ie,Ke,Ht,Yt]),Fe.hoverLeaveRef.current=()=>{Go(Yt.current),U&&!1!==Y&&(Lt.current=null,Pt.current=null,$t(null),Ie?.(null),Ke())},Vo(Yt);const Kt=(0,wd.useCallback)(e=>{if((t=e.target)instanceof Element&&null!=t.closest("[data-semiotic-annotation-widget]"))return;var t;if(!Te)return;Vt();const n=at.current;if(!n||!n.scene.length)return void Te(null);const r=Us({pointer:{clientX:e.clientX,clientY:e.clientY,pointerType:zt.current},canvasRect:e.currentTarget.getBoundingClientRect(),margin:We,width:He,height:qe,scene:n.scene,pointQuadtree:n.quadtree,maxPointRadius:n.maxPointRadius,hitCanvasRef:yt});var i;Te("hit"===r.kind?r.hover:null,{type:"activate",inputType:(i=zt.current,"touch"===i?"touch":"pointer")})},[qe,He,Te,We,Vt]),{kbFocusIndexRef:Qt,focusedNavPointRef:Jt,onKeyDown:en,refreshKeyboardFocus:tn}=(nn={clearPointerHover:Gt,storeRef:at,hoverRef:Lt,hoveredNodeRef:Pt,setHoverPoint:$t,customHoverBehavior:Ie,customClickBehavior:Te,scheduleRender:Ke},ol({...nn,extractPoints:rl,toHover:al,navigation:"linear"}));var nn;const rn=(0,wd.useCallback)(e=>{var t,n,r,i,o;t=Ut,n=e,r=U&&!1!==Y,i=Nt.current,o=Yt.current,hl(t,n,void 0),(r||i)&&(r||"touch"!==t.current.pointerType||(Go(o),0))&&(zt.current=e.pointerType,Qt.current=-1,Jt.current=null,qt(e))},[Yt,U,Y,Jt,Qt,qt,Ut]),on=(0,wd.useCallback)(e=>{zt.current=e.pointerType},[]);Ze.current=()=>{if(Xe.current=null,dt.sync(at.current?.scales??null),!Ye.isActive)return;const e=Yt.current,t=at.current;if(!e||!t)return;const n=Ye.now();let r=!1;const i=At.current;let o=!1;if(i){At.current=null;const e={width:He,height:qe};t.applyRotation(i,e),o=!0}const a=null!=t.activeTransition,s=t.advanceTransition(Oe.current?n+1e6:n),l=!Oe.current&&s,c=Tt.current.beforeCompute(t.getLastUpdateResult(),l);let u=!1;if($e.current&&!s){const e={width:He,height:qe},n=t.hasProjection(),r=it&&n?t.getRotation():null;t.computeScene(e);const i=wt.current,o=1!==i.k||0!==i.x||0!==i.y;it&&r?o?(t.setRotation(r),t.applyZoomScale(i.k,e)):t.applyRotation(r,e):o&&t.applyZoomTransform(i,e),tn(),$e.current=!1,u=!0,Wt()}dt.sync(t.scales),Tt.current.afterCompute(c,u,!1);const d=na(O,Be),h=Xt.current;h&&Jo(h,Be,d);const f=A&&!Oe.current&&!!Rt.current,p=t.consumeStylePaintPending();(u||o||p)&&(Nt.current=qo(t.scene),Nt.current||Go(e)),Nt.current&&(a||u||o||p)&&fl({canvas:e,pointer:Ut.current,store:t,margin:We,width:He,height:qe,hitCanvasRef:yt,geometryMoved:a||u||o});const m=Cn(t,n,u,It),g=Zt.current,y=(b={dirtyOrRebuilt:u,transitioning:a,continuous:f,liveEncoding:m.changed,forced:o||p||g},Boolean(b.dirtyOrRebuilt||b.transitioning||b.animationTicked||b.continuous||b.liveEncoding||b.forced));var b;if(Zt.current=!1,C&&bt.current){const e=gt.current;if(e&&t.scales?.projection){const n=ta(e,Be,We,d);n&&(n.clearRect(-We.left,-We.top,Be[0],Be[1]),n.save(),n.beginPath(),n.rect(0,0,He,qe),n.clip(),cs(n,{tileURL:C,projection:t.scales.projection,width:He,height:qe,tileCache:bt.current,maxDevicePixelRatio:O,onTileLoad:()=>Ke()}),n.restore())}}if(y){const i=ta(e,Be,We,d);if(!i)return;i.clearRect(-We.left,-We.top,Be[0],Be[1]),C||fa(i,{background:F,themeBackground:pt,hasBackgroundGraphics:Boolean(ye),x:-We.left,y:-We.top,width:Be[0],height:Be[1]}),i.save(),i.beginPath(),i.rect(0,0,He,qe),i.clip();const o=t.scene,a=(t.scales,{width:He,height:qe});if(vs({context:i,nodes:o,renderMode:W,pixelRatio:d,paintBuiltIn:e=>{Za(i,e),es(i,e.filter(e=>"line"===e.type),a),ts(i,e.filter(e=>"point"===e.type)),rs(i,e.filter(e=>"glyph"===e.type))}}),f&&Rt.current){const e=Rt.current,t=o.filter(e=>"line"===e.type);if(t.length>0){const o=R||{},a=.3*(o.speedMultiplier??1),s=o.maxPerLine??Gs(),l=o.spawnRate??(qs()?.06:.15),c=o.radius??2,u=o.opacity??.7,d=n/1e3,h=Ct.current>0?Math.min(d-Ct.current,.1):.016;Ct.current=d;const f=t.map(e=>e.path),p=t.map(e=>e.style.strokeWidth??2);for(let n=0;n<t.length;n++)Ye.random()<l&&e.countForLine(n)<s&&e.spawn(n,Ye.random);e.step(h,a,f,p),i.globalAlpha=u;for(let n=0;n<e.particles.length;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",ka(t.scene,"Geographic chart"));const v=Pt.current,x=Boolean(v&&("geoarea"===v.type||"point"===v.type)),w=(k=x,S=Et.current,k||S);var k,S;const M=Xt.current;if(M&&w){const e=ta(M,Be,We,d);if(e){if(e.clearRect(-We.left,-We.top,Be[0],Be[1]),v&&"geoarea"===v.type){const t=new Path2D(v.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(v&&"point"===v.type){const t=v,n="object"==typeof Y?Y:void 0,r=n?.pointColor||hs(v);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()}}Et.current=x}const j=ne!==vt.current;j&&(vt.current=ne),(u||j||a&&ne&&ne.length>0)&&(u||j||a&&!s||n-Ot.current>=33)&&(Ft(e=>e+1),Ot.current=n),(l||null!=t.activeTransition||m.pending||r)&&Ke()},vr(ue,at,$e,Ke,Ye.now,_t,Bt),(0,wd.useEffect)(()=>{if("production"!==process.env.NODE_ENV&&C){const e=Vs(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,wd.useEffect)(()=>{const e=St.current;if(!k||!e)return xt.current&&e&&((0,Cg.select)(e).on(".zoom",null),xt.current=null),void(e&&(0,Cg.select)(e).on("mousedown.rotate",null).on("touchstart.rotate",null));const[t,n]=S||[1,8],r={width:He,height:qe};if(it){let i=wt.current.k;const o=e=>{i=Math.max(t,Math.min(n,e)),wt.current=Rg.zoomIdentity.scale(i);const o=at.current;o&&(o.applyZoomScale(i,r),$e.current=!1,Ke(),o.scales?.projection&&M?.({projection:o.scales.projection,zoom:o.currentZoom}))};xt.current={scaleBy:(e,t)=>o(i*t),transform:(e,t)=>o(t?.k??1)};const a=e=>{e.preventDefault();const t=e.deltaY<0?1.1:1/1.1;o(i*t)},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=at.current;if(!r)return;const i=r.getRotation();jt.current={x:t.clientX,y:t.clientY,rotation:[...i]},e.setPointerCapture(t.pointerId),t.preventDefault()},u=e=>{const t=jt.current;if(!t)return;const n=e.clientX-t.x,r=e.clientY-t.y,i=[t.rotation[0]+n*l,Math.max(-90,Math.min(90,t.rotation[1]-r*l)),t.rotation[2]];At.current=i,Ke()},d=t=>{if(!jt.current)return;jt.current=null,e.releasePointerCapture(t.pointerId);const n=At.current;if(n){At.current=null;const e=at.current;e&&(e.applyRotation(n,r),Ke())}const i=at.current;i?.scales?.projection&&M?.({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),xt.current=null}}const i=(0,Rg.zoom)().scaleExtent([t,n]).extent([[0,0],[Be[0],Be[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",e=>{const t=e.transform;wt.current=t,kt.current=!0;const n=at.current;n&&(n.applyZoomTransform(t,r),$e.current=!1,Ke())}).on("end",e=>{wt.current=e.transform,kt.current=!1;const t=at.current;t?.scales?.projection&&M?.({projection:t.scales.projection,zoom:t.currentZoom})});return xt.current=i,(0,Cg.select)(e).call(i),()=>{(0,Cg.select)(e).on(".zoom",null)}},[k,S,it,Be,He,qe,We,M,Ke]);const an=U&&!1!==Y,sn=an&&Dt?X?X(Dt):/* @__PURE__ */ /* @__PURE__ */(0,ty.jsx)(Ug,{data:Dt}):null,ln=Pa(sn)?/* @__PURE__ */ /* @__PURE__ */(0,ty.jsx)(Oa,{contentOwnsChrome:Fa(X),x:Dt.x,y:Dt.y,containerWidth:He,containerHeight:qe,margin:We,className:"stream-frame-tooltip",zIndex:10,children:sn}):null;if(st){const e=ct.scene;/* @__PURE__ */ /* @__PURE__ */
|
|
177
|
-
return(0,ty.jsxs)("div",{ref:Mt,className:"stream-geo-frame"+($?` ${$}`:""),role:"group","aria-label":Pe||("string"==typeof ve?ve:"Geographic chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:T?"100%":Be[0],height:z?"100%":Be[1]},children:[
|
|
177
|
+
/* @__PURE__ */(0,by.jsx)("span",{style:{fontWeight:600},children:(t=e.value,null==t?"–":"number"==typeof t?_s(t):t instanceof Date?Us(t):String(t))})]},e.key);var t})]})}),xy={top:10,right:10,bottom:10,left:10},wy=null,ky={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)"},Sy=require("react"),My=require("react"),jy=Ju(require("react")),Ay=require("react"),Cy=require("react/jsx-runtime"),Ry=/* @__PURE__ */Il(/* @__PURE__ */ /* @__PURE__ */(0,$d.memo)(
|
|
178
178
|
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */(0,ty.jsx)(Sa,{accessibleTable:Ne,scene:e,chartType:"Geographic chart",tableId:Ue,chartTitle:"string"==typeof ve?ve:void 0}),
|
|
179
|
+
/* @__PURE__ */(0,$d.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:g,pointIdAccessor:y,lineIdAccessor:b,lineType:v="geo",flowStyle:x="basic",graticule:w,zoomable:k,zoomExtent:S,onZoom:M,dragRotate:j,showParticles:A,particleStyle:C,tileURL:R,tileAttribution:L,tileCacheSize:N,size:P,width:I,height:E,responsiveWidth:T,responsiveHeight:z,margin:$,className:D,background:O,maxDevicePixelRatio:F,runtimeMode:_,windowSize:W=500,renderMode:B,areaStyle:H,pointStyle:q,lineStyle:G,colorScheme:V,enableHover:Y=!0,hoverAnnotation:U,tooltipContent:X,allowTooltipOverflow:Z=!1,customClickBehavior:K,customHoverBehavior:Q,onObservation:J,annotationObservationCallback:ee,chartId:te,annotations:ne,onAnnotationActivate:re,autoPlaceAnnotations:ie,svgAnnotationRules:oe,decay:ae,pulse:se,transition:le,animate:ce,staleness:ue,frameScheduler:de,clock:he,random:fe,seed:pe,paused:me=!1,suspendWhenHidden:ge=!0,backgroundGraphics:ye,foregroundGraphics:be,title:ve,legend:xe,legendPosition:we,legendLayout:ke,legendHoverBehavior:Se,legendClickBehavior:Me,legendHighlightedCategory:je,legendIsolatedCategories:Ae,legendCategoryAccessor:Ce,onCategoriesChange:Re,showAxes:Le,accessibleTable:Ne=!0,description:Pe,summary:Ie}=e,{customHoverBehavior:Ee,customClickBehavior:Te,hasClickBehavior:ze}=ml({customHoverBehavior:Q,customClickBehavior:K,onObservation:J,chartId:te,chartType:"StreamGeoFrame"}),$e=P||[I||600,E||400],De=(0,$d.useRef)(!0),Oe=br({sizeProp:$e,responsiveWidth:T,responsiveHeight:z,userMargin:$,marginDefault:xy,title:ve,legend:xe,legendPosition:we,legendLayout:ke,legendMarginReserved:e.__legendMarginReservedFor===xe,animate:ce,transitionProp:le,frameScheduler:de,clock:he,random:fe,seed:pe,paused:me,suspendWhenHidden:ge,themeDirtyRef:De}),{reducedMotionRef:Fe,responsiveRef:_e,size:We,margin:Be,adjustedWidth:He,adjustedHeight:qe,transition:Ge,introEnabled:Ve,tableId:Ye,frameRuntime:Ue,rafRef:Xe,renderFnRef:Ze,scheduleRender:Ke,currentTheme:Qe}=Oe,Je=pa(),et=ma(),tt=(0,$d.useMemo)(()=>Array.isArray(a)?kn(a):a,[a]),nt=(0,$d.useMemo)(()=>kn(s),[s]),rt=(0,$d.useMemo)(()=>kn(l),[l]),it=j??"orthographic"===ul(n),ot=Ra((0,$d.useMemo)(()=>({projection:n,projectionExtent:r,fitPadding:i,xAccessor:f,yAccessor:p,lineDataAccessor:g,lineType:v,flowStyle:x,areaStyle:H,pointStyle:q,lineStyle:G,colorScheme:V,themeSemantic:jr(Qe),themeSequential:Qe?.colors?.sequential,themeDiverging:Qe?.colors?.diverging,themeCategorical:Qe?.colors?.categorical,graticule:w,projectionTransform:o,windowSize:W,clock:Ue.now,activityClock:Ue.wallNow,decay:ae,pulse:se,transition:Ge,introAnimation:Ve,annotations:ne,pointIdAccessor:y,lineIdAccessor:b,customLayout:c,layoutConfig:u,onLayoutError:h,layoutMargin:Be}),[n,r,i,f,p,g,v,x,H,q,G,V,Qe,w,o,W,Ue.now,Ue.wallNow,ae,se,Ge,Ve,ne,y,b,c,u,h,Be])),at=(0,$d.useRef)(null);at.current||(at.current=new pp(ot));const st=Td||!Je&&et,lt=(0,$d.useMemo)(()=>{if(!st)return null;const e=new pp(ot);return tt&&e.setAreas(tt),s&&e.setPoints(nt),l&&e.setLines(rt),e.computeScene({width:He,height:qe}),e.cancelIntroAnimation(),e},[st,ot,tt,s,nt,l,rt,He,qe]);m(at,lt);const ct=lt??at.current,ut=(0,$d.useRef)(null),dt=ut.current??(ut.current=Cl(ct.scales)),{resolvedForeground:ht,resolvedBackground:ft,themeBackground:pt,surfaceBackground:mt}=Ll({foregroundGraphics:be,backgroundGraphics:ye,size:We,margin:Be,scales:ct.scales,background:O,themeBackgroundColor:Qe.colors.background,tracker:dt,readScales:()=>ct.scales}),gt=(0,$d.useRef)(null),yt=(0,$d.useRef)(null),bt=(0,$d.useRef)(null);R&&!bt.current&&(bt.current=new oy(N??256)),bt.current?.setLimit(N??256);const vt=(0,$d.useRef)(ne),xt=(0,$d.useRef)(null),wt=(0,$d.useRef)(Jg.zoomIdentity),kt=(0,$d.useRef)(!1),St=(0,$d.useRef)(null),Mt=(0,$d.useCallback)(e=>{St.current=e,_e&&"object"==typeof _e&&(_e.current=e)},[_e]),jt=(0,$d.useRef)(null),At=(0,$d.useRef)(null),Ct=(0,$d.useRef)(null),Rt=(0,$d.useRef)(0);if(A&&!Ct.current){const e=C?.maxPerLine??cl();Ct.current=new ay(50*e)}const Lt=(0,$d.useRef)(null),Nt=(0,$d.useRef)(!1),Pt=(0,$d.useRef)(null),It=(0,$d.useRef)(!1),Et=(0,$d.useRef)(!1),Tt=(0,vp.useRef)(new Sp("StreamGeoFrame")),zt=(0,$d.useRef)(void 0),[$t,Dt]=(0,$d.useState)(null),[,Ot]=(0,$d.useState)(0),Ft=(0,$d.useRef)(0),[_t,Wt]=(0,$d.useState)(!1),Bt=Ya(at,Ce,Re,e=>e.getPoints());vr(at,ot,De,Ke),xr(at,d,De,Ke),(0,$d.useEffect)(()=>{const e=at.current;e&&(tt&&e.setAreas(tt),s&&e.setPoints(nt),l&&e.setLines(rt),De.current=!0,Ke())},[tt,s,nt,l,rt,Ke]),Sn(t,{storeRef:at,dirtyRef:De,scheduleRender:Ke,zoomTransformRef:wt,containerRef:St,zoomBehaviorRef:xt});const{hoverHandlerRef:Ht,onPointerMove:qt,onPointerLeave:Gt,flushPointerMove:Vt,pointerStateRef:Yt}=Oe,{canvasRef:Ut,interactionCanvasRef:Xt,resolutionDirtyRef:Zt}=Sa(Oe,{hydrated:Je,wasHydratingFromSSR:et,storeRef:at,dirtyRef:De,cleanup:()=>bt.current?.clear(),maxDevicePixelRatio:F,canvasPaintDependencies:[He,qe,O,ye,B,R,N,Ke]});(0,$d.useEffect)(()=>{Ht.current=e=>{const t=Ut.current;if(!t)return;const n=at.current;if(!n||!n.scene.length)return void ca(t);const r=dl({pointer:e,canvasRect:t.getBoundingClientRect(),margin:Be,width:He,height:qe,scene:n.scene,pointQuadtree:n.quadtree,maxPointRadius:n.maxPointRadius,hitCanvasRef:yt});ca(t,"hit"===r.kind?sa(r.node):void 0),Y&&!1!==U&&("hit"===r.kind?(Lt.current=r.hover,Pt.current=r.node,Dt(r.hover),Ee?.(r.hover),Ke()):("outside"===r.kind||"miss"===r.kind&&Lt.current)&&(Lt.current=null,Pt.current=null,Dt(null),Ee?.(null),Ke()))}},[Y,U,He,qe,Be,Ee,Ke,Ht,Ut]),Oe.hoverLeaveRef.current=()=>{ca(Ut.current),Y&&!1!==U&&(Lt.current=null,Pt.current=null,Dt(null),Ee?.(null),Ke())},ua(Ut);const Kt=(0,$d.useCallback)(e=>{if((t=e.target)instanceof Element&&null!=t.closest("[data-semiotic-annotation-widget]"))return;var t;if(!Te)return;Vt(e);const n=at.current;if(!n||!n.scene.length)return void Te(null);const r=dl({pointer:{clientX:e.clientX,clientY:e.clientY,pointerType:zt.current},canvasRect:e.currentTarget.getBoundingClientRect(),margin:Be,width:He,height:qe,scene:n.scene,pointQuadtree:n.quadtree,maxPointRadius:n.maxPointRadius,hitCanvasRef:yt});var i;Te("hit"===r.kind?r.hover:null,{type:"activate",inputType:(i=zt.current,"touch"===i?"touch":"pointer")})},[qe,He,Te,Be,Vt]),{kbFocusIndexRef:Qt,focusedNavPointRef:Jt,onKeyDown:en,onBlur:tn,refreshKeyboardFocus:nn}=(rn={clearPointerHover:Gt,storeRef:at,hoverRef:Lt,hoveredNodeRef:Pt,setHoverPoint:Dt,customHoverBehavior:Ee,customClickBehavior:Te,scheduleRender:Ke},Sl({...rn,extractPoints:wl,toHover:Ml,navigation:"linear"}));var rn;const on=(0,$d.useCallback)(e=>{var t,n,r,i,o;t=Yt,n=e,r=Y&&!1!==U,i=Nt.current,o=Ut.current,Nl(t,n,void 0),(r||i)&&(r||"touch"!==t.current.pointerType||(ca(o),0))&&(zt.current=e.pointerType,Qt.current=-1,Jt.current=null,qt(e))},[Ut,Y,U,Jt,Qt,qt,Yt]),an=(0,$d.useCallback)(e=>{zt.current=e.pointerType},[]);Ze.current=()=>{if(Xe.current=null,dt.sync(at.current?.scales??null),!Ue.isActive)return;const e=Ut.current,t=at.current;if(!e||!t)return;const n=Ue.now();let r=!1;const i=At.current;let o=!1;if(i){At.current=null;const e={width:He,height:qe};t.applyRotation(i,e),o=!0}const a=null!=t.activeTransition,s=t.advanceTransition(Fe.current?n+1e6:n),l=!Fe.current&&s,c=Tt.current.beforeCompute(t.getLastUpdateResult(),l);let u=!1;if(De.current&&!s){const e={width:He,height:qe},n=t.hasProjection(),r=it&&n?t.getRotation():null;t.computeScene(e);const i=wt.current,o=1!==i.k||0!==i.x||0!==i.y;it&&r?o?(t.setRotation(r),t.applyZoomScale(i.k,e)):t.applyRotation(r,e):o&&t.applyZoomTransform(i,e),nn(),De.current=!1,u=!0,Bt()}dt.sync(t.scales),Tt.current.afterCompute(c,u,!1);const d=xa(F,We),h=Xt.current;h&&ya(h,We,d);const f=A&&!Fe.current&&!!Ct.current,p=t.consumeStylePaintPending();(u||o||p)&&(Nt.current=la(t.scene),Nt.current||ca(e)),Nt.current&&(a||u||o||p)&&Pl({canvas:e,pointer:Yt.current,store:t,margin:Be,width:He,height:qe,hitCanvasRef:yt,geometryMoved:a||u||o});const m=Cn(t,n,u,Et),g=Zt.current,y=(b={dirtyOrRebuilt:u,transitioning:a,continuous:f,liveEncoding:m.changed,forced:o||p||g},Boolean(b.dirtyOrRebuilt||b.transitioning||b.animationTicked||b.continuous||b.liveEncoding||b.forced));var b;if(Zt.current=!1,R&&bt.current){const e=gt.current;if(e&&t.scales?.projection){const n=va(e,We,Be,d);n&&(n.clearRect(-Be.left,-Be.top,We[0],We[1]),n.save(),n.beginPath(),n.rect(0,0,He,qe),n.clip(),Cs(n,{tileURL:R,projection:t.scales.projection,width:He,height:qe,tileCache:bt.current,maxDevicePixelRatio:F,onTileLoad:()=>Ke()}),n.restore())}}if(y){const i=va(e,We,Be,d);if(!i)return;i.clearRect(-Be.left,-Be.top,We[0],We[1]),R||Pa(i,{background:O,themeBackground:pt,hasBackgroundGraphics:Boolean(ye),x:-Be.left,y:-Be.top,width:We[0],height:We[1]}),i.save(),i.beginPath(),i.rect(0,0,He,qe),i.clip();const o=t.scene,a=(t.scales,{width:He,height:qe});if(Ds({context:i,nodes:o,renderMode:B,pixelRatio:d,paintBuiltIn:e=>{ps(i,e),bs(i,e.filter(e=>"line"===e.type),a),vs(i,e.filter(e=>"point"===e.type)),ws(i,e.filter(e=>"glyph"===e.type))}}),f&&Ct.current){const e=Ct.current,t=o.filter(e=>"line"===e.type);if(t.length>0){const o=C||{},a=.3*(o.speedMultiplier??1),s=o.maxPerLine??cl(),l=o.spawnRate??(ll()?.06:.15),c=o.radius??2,u=o.opacity??.7,d=n/1e3,h=Rt.current>0?Math.min(d-Rt.current,.1):.016;Rt.current=d;const f=t.map(e=>e.path),p=t.map(e=>e.style.strokeWidth??2);for(let n=0;n<t.length;n++)Ue.random()<l&&e.countForLine(n)<s&&e.spawn(n,Ue.random);e.step(h,a,f,p),i.globalAlpha=u;for(let n=0;n<e.particles.length;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",_a(t.scene,"Geographic chart"));const v=Pt.current,x=Boolean(v&&("geoarea"===v.type||"point"===v.type)),w=(k=x,S=It.current,k||S);var k,S;const M=Xt.current;if(M&&w){const e=va(M,We,Be,d);if(e){if(e.clearRect(-Be.left,-Be.top,We[0],We[1]),v&&"geoarea"===v.type){const t=new Path2D(v.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(v&&"point"===v.type){const t=v,n="object"==typeof U?U:void 0,r=n?.pointColor||Ns(v);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()}}It.current=x}const j=ne!==vt.current;j&&(vt.current=ne),(u||j||a&&ne&&ne.length>0)&&(u||j||a&&!s||n-Ft.current>=33)&&(Ot(e=>e+1),Ft.current=n),(l||null!=t.activeTransition||m.pending||r)&&Ke()},Nr(ue,at,De,Ke,_t,Wt),(0,$d.useEffect)(()=>{if("production"!==process.env.NODE_ENV&&R){const e=ul(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.`)}},[R,n]),(0,$d.useEffect)(()=>{const e=St.current;if(!k||!e)return xt.current&&e&&((0,ey.select)(e).on(".zoom",null),xt.current=null),void(e&&(0,ey.select)(e).on("mousedown.rotate",null).on("touchstart.rotate",null));const[t,n]=S||[1,8],r={width:He,height:qe};if(it){let i=wt.current.k;const o=e=>{i=Math.max(t,Math.min(n,e)),wt.current=Jg.zoomIdentity.scale(i);const o=at.current;o&&(o.applyZoomScale(i,r),De.current=!1,Ke(),o.scales?.projection&&M?.({projection:o.scales.projection,zoom:o.currentZoom}))};xt.current={scaleBy:(e,t)=>o(i*t),transform:(e,t)=>o(t?.k??1)};const a=e=>{e.preventDefault();const t=e.deltaY<0?1.1:1/1.1;o(i*t)},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=at.current;if(!r)return;const i=r.getRotation();jt.current={x:t.clientX,y:t.clientY,rotation:[...i]},e.setPointerCapture(t.pointerId),t.preventDefault()},u=e=>{const t=jt.current;if(!t)return;const n=e.clientX-t.x,r=e.clientY-t.y,i=[t.rotation[0]+n*l,Math.max(-90,Math.min(90,t.rotation[1]-r*l)),t.rotation[2]];At.current=i,Ke()},d=t=>{if(!jt.current)return;jt.current=null,e.releasePointerCapture(t.pointerId);const n=At.current;if(n){At.current=null;const e=at.current;e&&(e.applyRotation(n,r),Ke())}const i=at.current;i?.scales?.projection&&M?.({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),xt.current=null}}const i=(0,Jg.zoom)().scaleExtent([t,n]).extent([[0,0],[We[0],We[1]]]).translateExtent([[-1/0,-1/0],[1/0,1/0]]).on("zoom",e=>{const t=e.transform;wt.current=t,kt.current=!0;const n=at.current;n&&(n.applyZoomTransform(t,r),De.current=!1,Ke())}).on("end",e=>{wt.current=e.transform,kt.current=!1;const t=at.current;t?.scales?.projection&&M?.({projection:t.scales.projection,zoom:t.currentZoom})});return xt.current=i,(0,ey.select)(e).call(i),()=>{(0,ey.select)(e).on(".zoom",null)}},[k,S,it,We,He,qe,Be,M,Ke]);const sn=Y&&!1!==U,ln=sn&&$t?X?X($t):/* @__PURE__ */ /* @__PURE__ */(0,Cy.jsx)(vy,{data:$t}):null,cn=Xa(ln)?/* @__PURE__ */ /* @__PURE__ */(0,Cy.jsx)(rs,{contentOwnsChrome:ns(X),x:$t.x,y:$t.y,containerWidth:He,containerHeight:qe,margin:Be,className:"stream-frame-tooltip",zIndex:10,children:ln}):null;if(st){const e=ct.scene;/* @__PURE__ */ /* @__PURE__ */
|
|
180
|
+
return(0,Cy.jsxs)("div",{ref:Mt,className:"stream-geo-frame"+(D?` ${D}`:""),role:"group","aria-label":Pe||("string"==typeof ve?ve:"Geographic chart"),style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:T?"100%":We[0],height:z?"100%":We[1]},children:[
|
|
180
181
|
/* @__PURE__ */
|
|
181
|
-
/* @__PURE__ */(0,
|
|
182
|
+
/* @__PURE__ */(0,Cy.jsx)(Wa,{accessibleTable:Ne,scene:e,chartType:"Geographic chart",tableId:Ye,chartTitle:"string"==typeof ve?ve:void 0}),
|
|
182
183
|
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */(0,
|
|
184
|
+
/* @__PURE__ */(0,Cy.jsx)(Ha,{summary:Ie}),
|
|
184
185
|
/* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */(0,
|
|
186
|
+
/* @__PURE__ */(0,Cy.jsxs)("div",{role:"img","aria-label":Pe||("string"==typeof ve?ve:"Geographic chart"),children:[
|
|
186
187
|
/* @__PURE__ */
|
|
187
|
-
/* @__PURE__ */(0,
|
|
188
|
+
/* @__PURE__ */(0,Cy.jsxs)("svg",{role:"presentation",xmlns:"http://www.w3.org/2000/svg",width:We[0],height:We[1],style:{position:"absolute",left:0,top:0},children:[mt?/* @__PURE__ */ /* @__PURE__ */(0,Cy.jsx)("rect",{className:"stream-frame-background__backdrop",x:0,y:0,width:We[0],height:We[1],fill:mt}):null,
|
|
188
189
|
/* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */(0,
|
|
190
|
+
/* @__PURE__ */(0,Cy.jsx)("g",{transform:`translate(${Be.left},${Be.top})`,children:ft}),
|
|
190
191
|
/* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */(0,
|
|
192
|
-
return(0,ty.jsxs)("div",{ref:Mt,className:"stream-geo-frame"+($?` ${$}`:""),role:"group","aria-label":Pe||("string"==typeof ve?ve:"Geographic chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:T?"100%":Be[0],height:z?"100%":Be[1],overflow:Z?"visible":"hidden",...k?{touchAction:"none"}:{}},onKeyDown:en,children:["production"!==process.env.NODE_ENV&&at.current&&/* @__PURE__ */ /* @__PURE__ */(0,ty.jsx)(lp,{store:at.current,diagnostics:Tt.current}),
|
|
192
|
+
/* @__PURE__ */(0,Cy.jsx)("g",{transform:`translate(${Be.left},${Be.top})`,children:e.map((e,t)=>Os({node:e,index:t,renderMode:B,fallback:()=>ha(e,t)}).element)})]}),
|
|
193
193
|
/* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */(0,
|
|
194
|
+
/* @__PURE__ */(0,Cy.jsx)(Uo,{decorative:!0,width:He,height:qe,totalWidth:We[0],totalHeight:We[1],margin:Be,showAxes:!1,title:ve,description:Pe,legend:xe,legendPosition:we,legendLayout:ke,legendHoverBehavior:Se,legendClickBehavior:Me,legendHighlightedCategory:je,legendIsolatedCategories:Ae,foregroundGraphics:Ps(ht,Es(ct.customLayoutOverlays,d??null)),annotations:ne,onAnnotationActivate:re,onObservation:ee??J,chartId:te,chartType:"StreamGeoFrame",autoPlaceAnnotations:ie,svgAnnotationRules:oe,pointNodes:Fs(e),geoProjection:ct.scales?.projectedPoint})]})]})}/* @__PURE__ */ /* @__PURE__ */
|
|
195
|
+
return(0,Cy.jsxs)("div",{ref:Mt,className:"stream-geo-frame"+(D?` ${D}`:""),role:"group","aria-label":Pe||("string"==typeof ve?ve:"Geographic chart"),tabIndex:0,style:{position:"relative",fontFamily:"var(--semiotic-font-family, sans-serif)",width:T?"100%":We[0],height:z?"100%":We[1],overflow:Z?"visible":"hidden",...k?{touchAction:"none"}:{}},onKeyDown:en,onBlur:tn,children:["production"!==process.env.NODE_ENV&&at.current&&/* @__PURE__ */ /* @__PURE__ */(0,Cy.jsx)(Mp,{store:at.current,diagnostics:Tt.current}),
|
|
195
196
|
/* @__PURE__ */
|
|
196
|
-
/* @__PURE__ */(0,
|
|
197
|
+
/* @__PURE__ */(0,Cy.jsx)(Wa,{accessibleTable:Ne,sceneRevision:at.current?.getUpdateSnapshot().revisions.accessibility,scene:at.current?.scene??[],chartType:"Geographic chart",tableId:Ye,chartTitle:"string"==typeof ve?ve:void 0}),
|
|
197
198
|
/* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */(0,
|
|
199
|
+
/* @__PURE__ */(0,Cy.jsx)(Ha,{summary:Ie}),
|
|
199
200
|
/* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */(0,
|
|
201
|
+
/* @__PURE__ */(0,Cy.jsx)(Ia,{active:Qt.current>=0,hoverPoint:$t}),
|
|
201
202
|
/* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */(0,
|
|
203
|
+
/* @__PURE__ */(0,Cy.jsxs)("div",{role:"img","aria-label":Pe||("string"==typeof ve?ve:"Geographic chart"),style:{position:"relative",width:"100%",height:"100%"},onPointerMove:on,onPointerLeave:Gt,onPointerDown:sn||ze?an:void 0,onClick:ze?Kt:void 0,children:[
|
|
203
204
|
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */(0,
|
|
205
|
+
/* @__PURE__ */(0,Cy.jsx)(Ma,{size:We,margin:Be,backdropFill:mt??void 0,children:ft}),R&&/* @__PURE__ */ /* @__PURE__ */(0,Cy.jsx)("canvas",{ref:gt,style:{position:"absolute",left:0,top:0,width:We[0],height:We[1],pointerEvents:"none"}}),
|
|
205
206
|
/* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */(0,
|
|
207
|
+
/* @__PURE__ */(0,Cy.jsx)("canvas",{"aria-hidden":"true",ref:Ut,"aria-label":_a(at.current?.scene??[],"Geographic chart"),style:{position:"absolute",left:0,top:0,width:We[0],height:We[1]}}),
|
|
207
208
|
/* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */(0,
|
|
209
|
+
/* @__PURE__ */(0,Cy.jsx)("canvas",{ref:Xt,style:{position:"absolute",left:0,top:0,width:We[0],height:We[1],pointerEvents:"none"}}),
|
|
209
210
|
/* @__PURE__ */
|
|
210
|
-
/* @__PURE__ */(0,
|
|
211
|
+
/* @__PURE__ */(0,Cy.jsx)(Uo,{decorative:!0,width:He,height:qe,totalWidth:We[0],totalHeight:We[1],margin:Be,showAxes:Le,title:ve,description:Pe,legend:xe,legendPosition:we,legendLayout:ke,legendHoverBehavior:Se,legendClickBehavior:Me,legendHighlightedCategory:je,legendIsolatedCategories:Ae,foregroundGraphics:Ps(ht,Es(ct.customLayoutOverlays,d??null)),annotations:ne,onAnnotationActivate:re,onObservation:ee??J,chartId:te,chartType:"StreamGeoFrame",autoPlaceAnnotations:ie,svgAnnotationRules:oe,pointNodes:Fs(at.current?.scene),geoProjection:ct.scales?.projectedPoint}),
|
|
211
212
|
/* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */(0,
|
|
213
|
+
/* @__PURE__ */(0,Cy.jsx)(Ua,{active:Qt.current>=0,hoverPoint:$t,margin:Be,size:We,shape:Jt.current?.shape,width:Jt.current?.w,height:Jt.current?.h,pathData:Jt.current?.pathData}),cn]}),ue?.showBadge&&/* @__PURE__ */ /* @__PURE__ */(0,Cy.jsx)($r,{isStale:_t,position:ue.badgePosition,state:ue.state,settling:ue.settling}),k&&/* @__PURE__ */ /* @__PURE__ */(0,Cy.jsxs)("div",{className:"stream-geo-zoom-controls",style:{position:"absolute",bottom:Be.bottom+8,left:Be.left+8,display:"flex",flexDirection:"column",gap:2,zIndex:2},children:[
|
|
213
214
|
/* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */(0,
|
|
215
|
-
return(0,Dy.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
|
|
215
|
+
/* @__PURE__ */(0,Cy.jsx)("button",{type:"button","aria-label":"Zoom in",onClick:e=>{e.stopPropagation();const t=St.current,n=xt.current;t&&n?.scaleBy&&n.scaleBy((0,ey.select)(t),1.5)},style:ky,children:"+"}),
|
|
216
216
|
/* @__PURE__ */
|
|
217
|
-
/* @__PURE__ */(0,
|
|
218
|
-
return(0,
|
|
219
|
-
return(0,Hy.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&/* @__PURE__ */ /* @__PURE__ */(0,Hy.jsx)("div",{style:{fontWeight:600,marginBottom:2},children:t}),n&&null!=r&&/* @__PURE__ */ /* @__PURE__ */(0,Hy.jsxs)("div",{children:[
|
|
217
|
+
/* @__PURE__ */(0,Cy.jsx)("button",{type:"button","aria-label":"Zoom out",onClick:e=>{e.stopPropagation();const t=St.current,n=xt.current;t&&n?.scaleBy&&n.scaleBy((0,ey.select)(t),1/1.5)},style:ky,children:"−"})]}),L&&/* @__PURE__ */ /* @__PURE__ */(0,Cy.jsx)("div",{className:"stream-geo-tile-attribution",style:{position:"absolute",bottom:Be.bottom+2,right:Be.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:L})]})})),"StreamGeoFrame"),Ly=require("react"),Ny=require("react"),Py=require("./semiotic-client-cjs-shared.min.js"),Iy=require("./semiotic-client-cjs-shared.min.js"),Ey=require("./semiotic-client-cjs-shared.min.js"),Ty=require("./semiotic-client-cjs-shared.min.js"),zy={top:10,right:10,bottom:10,left:10},$y={enabled:!0,tapToSelect:!0,tapToLockTooltip:!0,clearSelection:"backgroundTap",targetSize:44,snap:"nearestDatum",brushHandleSize:44,standardControls:!1,enabled:!1,tapToSelect:!1,tapToLockTooltip:!1},Dy={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}}},Oy=require("react"),Fy=require("react"),_y=(/* @__PURE__ */ /* @__PURE__ */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("./semiotic-client-cjs-shared.min.js"),require("./semiotic-client-cjs-shared.min.js"),require("react/jsx-runtime"),(0,Fy.createContext)(!1)),Wy=/* @__PURE__ */ /* @__PURE__ */(0,Fy.createContext)(null),By="undefined"==typeof window?Fy.useEffect:Fy.useLayoutEffect,Hy=[],qy=require("react/jsx-runtime"),Gy=require("react"),Vy=require("react/jsx-runtime"),Yy=class extends Gy.Component{constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){if(!this.state.error||!t.error)return;const n=e.resetKeys??[e.children],r=this.props.resetKeys??[this.props.children];(n.length!==r.length||r.some((e,t)=>!Object.is(e,n[t])))&&this.reset()}render(){if(this.state.error){const{fallback:e}=this.props,t=this.state.error;return"function"==typeof e?e(t,this.reset):void 0!==e?e:/* @__PURE__ */ /* @__PURE__ */(0,Vy.jsx)(wc,{componentName:"ChartErrorBoundary",message:t.message||"An unexpected error occurred while rendering this chart.",width:"100%",height:"100%"})}return this.props.children}},Uy=require("react/jsx-runtime"),Xy={display:"flex",alignItems:"stretch",flexDirection:"column",textAlign:"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"},Zy={background:"var(--semiotic-border, #e0e0e0)",borderRadius:2},Ky=require("react"),Qy=require("./semiotic-client-cjs-shared.min.js"),Jy=require("d3-scale"),eb=require("react"),tb=require("topojson-client"),nb=/* @__PURE__ */new Map,rb="Install the optional peer dependency `world-atlas` (`npm install world-atlas`) to use built-in reference geographies, or pass GeoJSON Feature[] to `areas`.",ib=Ju(require("react")),ob=require("react/jsx-runtime"),ab=require("react/jsx-runtime"),sb=/* @__PURE__ */Ec(function(e){const t=dc(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=sc(),{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:b=1,annotations:v,legendInteraction:x,legendPosition:w,margin:k,className:S,selection:M,linkedHover:j,onObservation:A,onClick:C,chartId:R,loading:L,loadingContent:N,emptyContent:P,frameProps:I={},stroke:E,strokeWidth:T,opacity:z}=e,$=u??!!p,D=Nc(r),O=(0,Ly.useMemo)(()=>D?kn(D):D,[D]),F=(0,Ly.useMemo)(()=>"function"==typeof i?i:e=>e?.properties?.[i]??e?.[i],[i]),_=a??n??"blues",W=(0,Ly.useMemo)(()=>{if(!O)return(0,Jy.scaleSequential)(zt(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)&&(r<e&&(e=r),r>t&&(t=r))}const n=zt(_);return(0,Jy.scaleSequential)(n).domain([Number.isFinite(e)?e:0,Number.isFinite(t)?t:1])},[O,F,_]),B=(0,Ly.useMemo)(()=>{const e=W.domain();return[e[0]??0,e[1]??1]},[W]),H=oc(x,F,B),{activeSelectionHook:q,hoverSelectionHook:G,customHoverBehavior:V,customClickBehavior:Y}=cc({selection:M,linkedHover:j,onObservation:A,onClick:C,chartType:"ChoroplethMap",chartId:R,mobileInteraction:t.mobileInteraction}),U=Ac(M),X=G||H.legendSelectionHook||q,Z=(0,Ly.useMemo)(()=>{const e=fc(xc(e=>{const t=F(e);return{fill:null!=t&&isFinite(t)?W(t):"#ccc",stroke:"#999",strokeWidth:.5,fillOpacity:b}},o,e=>({value:F(e)}),e=>e&&"object"==typeof e&&e.properties?{...e.properties,...e}:e),{stroke:E,strokeWidth:T,opacity:z});return X?Tl(e,X,U,zc):e},[F,W,X,U,b,E,T,z,o]),K=(0,Ly.useMemo)(()=>e=>{const t=e?.properties?.name||e?.properties?.NAME||e?.name||e?.NAME||"Feature",n=F(e);/* @__PURE__ */ /* @__PURE__ */
|
|
218
|
+
return(0,ab.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
|
|
220
219
|
/* @__PURE__ */
|
|
221
|
-
/* @__PURE__ */(0,
|
|
220
|
+
/* @__PURE__ */(0,ab.jsx)("div",{style:{fontWeight:600},children:t}),null!=n&&/* @__PURE__ */ /* @__PURE__ */(0,ab.jsx)("div",{style:{opacity:.7},children:(r=n,"number"==typeof r&&isFinite(r)?Number.isInteger(r)?r.toLocaleString():r.toLocaleString(void 0,{maximumFractionDigits:2}):String(r??""))})]});var r},[F]),Q=Hl(t),J=(0,Ly.useMemo)(()=>{if(!1!==t.showLegend)return{gradient:{colorFn:e=>W(e),domain:B,label:"string"==typeof i?i:"value"}}},[W,t.showLegend,i,B]),{legend:ee,margin:te,legendPosition:ne,legendMarginReserved:re}=tc({data:[],colorBy:void 0,colorScale:void 0,showLegend:!1,legendPosition:w,userMargin:k,defaults:Q,additionalLegend:J,chartWidth:t.width,chartHeight:t.height,legendLayout:I.legendLayout,frameLegend:I,hasTitle:!!t.title,axisChrome:{hasAxis:!1}}),ie=Mc(L,t.width,t.height,N,e)||(O?null:Mc(!0,t.width,t.height,N,e)),oe=ie?null:Sc(O,t.width,t.height,P,e);if(Array.isArray(O)&&O.length>0){const e=O[0];if(!e||"object"!=typeof e||!e.geometry)/* @__PURE__ */ /* @__PURE__ */
|
|
221
|
+
return(0,ab.jsx)(wc,{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:H.onLegendHover,legendClickBehavior:H.onLegendClick,legendHighlightedCategory:H.highlightedCategory,legendIsolatedCategories:"isolate"===x?H.isolatedCategories:void 0,tooltipContent:!1===y?()=>null:!0===y?K:rl(y)||K,...null!=l&&{graticule:l},...null!=c&&{fitPadding:c},...$&&{zoomable:!0},...d&&{zoomExtent:d},...h&&{onZoom:h},...null!=f&&{dragRotate:f},...p&&{tileURL:p},...m&&{tileAttribution:m},...g&&{tileCacheSize:g},...Ic({linkedHover:j,selection:M,onObservation:A,onClick:C,mobileInteraction:t.mobileInteraction,customHoverBehavior:V,customClickBehavior:Y,linkedHoverInClickPredicate:!1}),...v&&v.length>0&&{annotations:v},...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},...I};return ie||oe||/* @__PURE__ */ /* @__PURE__ */(0,ab.jsx)(Ry,{...ae})},"ChoroplethMap"),lb=require("react"),cb=require("react"),ub=require("./semiotic-client-cjs-shared.min.js"),db=require("react"),hb={fill:"#f0f0f0",stroke:"#ccc",strokeWidth:.5},fb=require("react/jsx-runtime"),pb=[3,30],mb=[1,4],gb=/* @__PURE__ */Ec(/* @__PURE__ */ /* @__PURE__ */(0,lb.forwardRef)(function(e,t){const n=(0,lb.useRef)(null);Dc(t,{variant:"geo-points",frameRef:n});const r=dc(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:b,tileURL:v,tileAttribution:x,tileCacheSize:w,areas:k,areaStyle:S=hb,tooltip:M,annotations:j,margin:A,className:C,selection:R,linkedHover:L,onObservation:N,onClick:P,chartId:I,loading:E,loadingContent:T,emptyContent:z,legendInteraction:$,legendPosition:D,frameProps:O={},stroke:F,strokeWidth:_,opacity:W}=e,B=l??("sparkline"===r.mode?mb:pb),H="sparkline"===r.mode?1.5:6,q=m??!!v,G=Nc(k),V=$c({responsive:e,data:i??bp,rawData:i,colorBy:c,colorScheme:d,legendInteraction:$,legendPosition:D,frameLegend:O,selection:R,linkedHover:L,fallbackFields:c?["string"==typeof c?c:""]:[],unwrapData:!1,onObservation:N,onClick:P,mobileInteraction:r.mobileInteraction,mobileSemantics:r.mobileSemantics,chartType:"ProportionalSymbolMap",chartId:I,showLegend:r.showLegend,userMargin:A,marginDefaults:Hl(r),loading:E,loadingContent:T,emptyContent:z,width:r.width,height:r.height,hasTitle:!!r.title,axisChrome:{hasAxis:!1}}),Y=V.data,U=(0,lb.useMemo)(()=>{if(!s)return;const e="function"==typeof s?s:e=>e?.[s],t=Y.filter(Boolean).map(t=>e(t)).filter(e=>null!=e&&isFinite(e));return 0!==t.length?ln(t):void 0},[Y,s]),X=(0,lb.useMemo)(()=>{const e=fc(xc(e=>({fill:c?Ot(e,c,V.colorScale):Vf,fillOpacity:.7,stroke:"#fff",strokeWidth:.5,r:s?Bt(e,s,B,U):H}),u,mc(c,s)),{stroke:F,strokeWidth:_,opacity:W});return V.effectiveSelectionHook?Tl(e,V.effectiveSelectionHook,V.resolvedSelection):e},[c,V.colorScale,V.effectiveSelectionHook,V.resolvedSelection,s,B,U,H,F,_,W,u]),Z=(0,lb.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}):String(e??""),o="string"==typeof c?c:null,a=o?e?.[o]:null;/* @__PURE__ */ /* @__PURE__ */
|
|
222
|
+
return(0,fb.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[t&&/* @__PURE__ */ /* @__PURE__ */(0,fb.jsx)("div",{style:{fontWeight:600,marginBottom:2},children:t}),n&&null!=r&&/* @__PURE__ */ /* @__PURE__ */(0,fb.jsxs)("div",{children:[
|
|
222
223
|
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */(0,
|
|
224
|
+
/* @__PURE__ */(0,fb.jsxs)("span",{style:{opacity:.7},children:[n,": "]}),i(r)]}),o&&null!=a&&/* @__PURE__ */ /* @__PURE__ */(0,fb.jsxs)("div",{children:[
|
|
224
225
|
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */(0,
|
|
226
|
-
return(0,Hy.jsx)(cc,{componentName:"ProportionalSymbolMap",width:r.width,height:r.height,children:/* @__PURE__ */ /* @__PURE__ */(0,Hy.jsx)(ny,{ref:n,...K})})}),"ProportionalSymbolMap"),Uy=require("react"),Yy=require("./semiotic-client-cjs-shared.min.js"),Xy=require("./semiotic-client-cjs-shared.min.js"),Zy=require("react/jsx-runtime"),Ky="__semiotic_x",Qy="__semiotic_y",Jy=/* @__PURE__ */pl(/* @__PURE__ */ /* @__PURE__ */(0,Uy.forwardRef)(function(e,t){const n=Kl(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:b,lineType:v="geo",flowStyle:x="basic",areas:w,areaStyle:k=Wy,edgeColorBy:S,edgeOpacity:M=.6,edgeWidthRange:j=[1,8],pointRadius:A,edgeLinecap:R="round",colorScheme:C,styleRules:L,showParticles:N,particleStyle:P,tooltip:E,annotations:I,margin:T,className:z,selection:D,linkedHover:$,onObservation:F,onClick:O,chartId:_,loading:B,loadingContent:W,emptyContent:H,frameProps:q={},legendInteraction:G,legendPosition:V,stroke:U,strokeWidth:Y,opacity:X,lineIdAccessor:Z}=e,K=h??!!g,Q=yc(w),J=(0,Uy.useMemo)(()=>Sn(i),[i]),ee=wc({responsive:e,data:r??np,rawData:r,colorBy:S,colorScheme:C,legendInteraction:G,legendPosition:V,frameLegend:q,selection:D,linkedHover:$,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:F,onClick:O,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"FlowMap",chartId:_,showLegend:n.showLegend,userMargin:T,marginDefaults:Ll(n),loading:B,loadingContent:W,emptyContent:H,width:n.width,height:n.height,hasTitle:!!n.title}),te=ee.data,ne=ml($),re=(0,Yy.useLinkedHover)({name:ne?.name||"hover",fields:ne?.fields||[]}),ie=(0,Xy.useObservationSelector)(e=>e.pushObservation),oe=(0,Uy.useMemo)(()=>{const e=/* @__PURE__ */new Map;for(const t of J)e.set(String(t[o]),t);return e},[J,o]),ae=(0,Uy.useRef)(null),se=(0,Uy.useRef)(oe);se.current=oe;const le=(0,Uy.useRef)(a);le.current=a;const ce=(0,Uy.useRef)(s);ce.current=s;const ue=(0,Uy.useCallback)(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;const t=se.current,n=t.get(String(e.source)),r=t.get(String(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:[{[Ky]:i(n),[Qy]:o(n)},{[Ky]:i(r),[Qy]:o(r)}]}},[]);kc(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,Uy.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,Uy.useCallback)(e=>{if($)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){const e=String(t[o]),n=de.get(e);n&&re.onHover(n)}else re.onHover(t)}else re.onHover(null);if(F||ie){const t={timestamp:Date.now(),chartType:"FlowMap",chartId:_};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};F&&F(r),ie&&ie(r)}else{const e={...t,type:"hover-end"};F&&F(e),ie&&ie(e)}}},[$,re,o,de,F,_,ie]),fe=ee.customClickBehavior,pe=(0,Uy.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(String(n.source)),i=oe.get(String(n.target));return r&&i?{...n,coordinates:[{[Ky]:e(r),[Qy]:t(r)},{[Ky]:e(i),[Qy]:t(i)}]}:null}).filter(Boolean)},[te,oe,a,s]),me=(0,Uy.useMemo)(()=>{const e="function"==typeof a?a:e=>e[a];return t=>null!=t&&"object"==typeof t&&Ky in t?t[Ky]:e(t)},[a]),ge=(0,Uy.useMemo)(()=>{const e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&Qy in t?t[Qy]:e(t)},[s]),ye=(0,Uy.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 cn(e)},[te,l]),be=(0,Uy.useMemo)(()=>jc({valueAccessor:l,valueDomain:ye,edgeWidthRange:j,resolveStroke:e=>S?Ot(e,S,ee.colorScale):Nf,edgeOpacity:M,edgeLinecap:R,styleRules:L}),[l,ye,j,S,ee.colorScale,M,R,L]),ve=(0,Uy.useMemo)(()=>{const e=Jl(be,{stroke:U,strokeWidth:Y,opacity:X});if(!ee.effectiveSelectionHook)return e;const t={...ee.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return gl(e,ee.effectiveSelectionHook,{...ee.resolvedSelection||{},unselectedStyle:t})},[be,ee.effectiveSelectionHook,ee.resolvedSelection,U,Y,X]),xe=A??("sparkline"===n.mode?1.5:5),we=(0,Uy.useMemo)(()=>Jl(()=>({fill:"#333",r:xe,fillOpacity:.8}),{stroke:U,strokeWidth:Y,opacity:X}),[xe,U,Y,X]),ke=(0,Uy.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__ */
|
|
227
|
-
return(0,Zy.jsx)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */ /* @__PURE__ */(0,Zy.jsx)("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){const t=e[l];/* @__PURE__ */ /* @__PURE__ */
|
|
228
|
-
return(0,Zy.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
|
|
226
|
+
/* @__PURE__ */(0,fb.jsxs)("span",{style:{opacity:.7},children:[o,": "]}),String(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,fb.jsxs)("div",{children:[
|
|
229
227
|
/* @__PURE__ */
|
|
230
|
-
/* @__PURE__ */(0,
|
|
231
|
-
return(0,
|
|
232
|
-
return(0,
|
|
228
|
+
/* @__PURE__ */(0,fb.jsxs)("span",{style:{opacity:.7},children:[e,": "]}),i(t)]},e))]})},[s,c]);if(V.earlyReturn)return V.earlyReturn;jc("ProportionalSymbolMap",Y,"xAccessor",o),jc("ProportionalSymbolMap",Y,"yAccessor",a);const K={projection:h,...null!=i&&{points:Y},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!=b&&{dragRotate:b},...v&&{tileURL:v},...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:rl(M)||Z,...V.legendBehaviorProps,...Ic({linkedHover:L,selection:R,onObservation:N,onClick:P,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__ */
|
|
229
|
+
return(0,fb.jsx)(Ry,{ref:n,...K})}),"ProportionalSymbolMap"),yb=require("react"),bb=require("./semiotic-client-cjs-shared.min.js"),vb=require("./semiotic-client-cjs-shared.min.js"),xb=require("react/jsx-runtime"),wb="__semiotic_x",kb="__semiotic_y",Sb=/* @__PURE__ */Ec(/* @__PURE__ */ /* @__PURE__ */(0,yb.forwardRef)(function(e,t){const n=dc(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:b,lineType:v="geo",flowStyle:x="basic",areas:w,areaStyle:k=hb,edgeColorBy:S,edgeOpacity:M=.6,edgeWidthRange:j=[1,8],pointRadius:A,edgeLinecap:C="round",colorScheme:R,styleRules:L,showParticles:N,particleStyle:P,tooltip:I,annotations:E,margin:T,className:z,selection:$,linkedHover:D,onObservation:O,onClick:F,chartId:_,loading:W,loadingContent:B,emptyContent:H,frameProps:q={},legendInteraction:G,legendPosition:V,stroke:Y,strokeWidth:U,opacity:X,lineIdAccessor:Z}=e,K=h??!!g,Q=Nc(w),J=(0,yb.useMemo)(()=>kn(i),[i]),ee=$c({responsive:e,data:r??bp,rawData:r,colorBy:S,colorScheme:R,legendInteraction:G,legendPosition:V,frameLegend:q,selection:$,linkedHover:D,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:O,onClick:F,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"FlowMap",chartId:_,showLegend:n.showLegend,userMargin:T,marginDefaults:Hl(n),loading:W,loadingContent:B,emptyContent:H,width:n.width,height:n.height,hasTitle:!!n.title,axisChrome:{hasAxis:!1}}),te=ee.data,ne=El(D),re=(0,bb.useLinkedHover)({name:ne?.name||"hover",fields:ne?.fields||[]}),ie=(0,vb.useObservationSelector)(e=>e.pushObservation),oe=(0,yb.useMemo)(()=>{const e=/* @__PURE__ */new Map;for(const t of J)e.set(String(t[o]),t);return e},[J,o]),ae=(0,yb.useRef)(null),se=(0,yb.useRef)(oe);se.current=oe;const le=(0,yb.useRef)(a);le.current=a;const ce=(0,yb.useRef)(s);ce.current=s;const ue=(0,yb.useCallback)(e=>{if(!e||"object"!=typeof e||null==e.source||null==e.target)return null;const t=se.current,n=t.get(String(e.source)),r=t.get(String(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:[{[wb]:i(n),[kb]:o(n)},{[wb]:i(r),[kb]:o(r)}]}},[]);Dc(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,yb.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,yb.useCallback)(e=>{if(D)if(e){let t=e.data||e.datum||e;if(Array.isArray(t)&&(t=t[0]),"point"===e.type){const e=String(t[o]),n=de.get(e);n&&re.onHover(n)}else re.onHover(t)}else re.onHover(null);if(O||ie){const t={timestamp:Date.now(),chartType:"FlowMap",chartId:_};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)}}},[D,re,o,de,O,_,ie]),fe=ee.customClickBehavior,pe=(0,yb.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(String(n.source)),i=oe.get(String(n.target));return r&&i?{...n,coordinates:[{[wb]:e(r),[kb]:t(r)},{[wb]:e(i),[kb]:t(i)}]}:null}).filter(Boolean)},[te,oe,a,s]),me=(0,yb.useMemo)(()=>{const e="function"==typeof a?a:e=>e[a];return t=>null!=t&&"object"==typeof t&&wb in t?t[wb]:e(t)},[a]),ge=(0,yb.useMemo)(()=>{const e="function"==typeof s?s:e=>e[s];return t=>null!=t&&"object"==typeof t&&kb in t?t[kb]:e(t)},[s]),ye=(0,yb.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 ln(e)},[te,l]),be=(0,yb.useMemo)(()=>_c({valueAccessor:l,valueDomain:ye,edgeWidthRange:j,resolveStroke:e=>S?Ot(e,S,ee.colorScale):Vf,edgeOpacity:M,edgeLinecap:C,styleRules:L}),[l,ye,j,S,ee.colorScale,M,C,L]),ve=(0,yb.useMemo)(()=>{const e=fc(be,{stroke:Y,strokeWidth:U,opacity:X});if(!ee.effectiveSelectionHook)return e;const t={...ee.resolvedSelection?.unselectedStyle||{},fillOpacity:0};return Tl(e,ee.effectiveSelectionHook,{...ee.resolvedSelection||{},unselectedStyle:t})},[be,ee.effectiveSelectionHook,ee.resolvedSelection,Y,U,X]),xe=A??("sparkline"===n.mode?1.5:5),we=(0,yb.useMemo)(()=>fc(()=>({fill:"#333",r:xe,fillOpacity:.8}),{stroke:Y,strokeWidth:U,opacity:X}),[xe,Y,U,X]),ke=(0,yb.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__ */
|
|
230
|
+
return(0,xb.jsx)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */ /* @__PURE__ */(0,xb.jsx)("div",{style:{fontWeight:600},children:t})})}if(null!=e?.source&&null!=e?.target){const t=e[l];/* @__PURE__ */ /* @__PURE__ */
|
|
231
|
+
return(0,xb.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
|
|
233
232
|
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */(0,
|
|
235
|
-
return(0,
|
|
236
|
-
return(0,
|
|
233
|
+
/* @__PURE__ */(0,xb.jsxs)("div",{style:{fontWeight:600},children:[e.source," → ",e.target]}),null!=t&&/* @__PURE__ */ /* @__PURE__ */(0,xb.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,xb.jsx)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:/* @__PURE__ */ /* @__PURE__ */(0,xb.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:v,flowStyle:x,lineStyle:ve,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},...N&&{showParticles:N},...P&&{particleStyle:P},...g&&{tileURL:g},...y&&{tileAttribution:y},...b&&{tileCacheSize:b},size:[n.width,n.height],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ee.margin,enableHover:n.enableHover,tooltipContent:!1===I?()=>null:rl(I)||ke,...ee.legendBehaviorProps,...Ic({linkedHover:D,selection:$,onObservation:O,onClick:F,mobileInteraction:ee.mobileInteraction,customHoverBehavior:he,customClickBehavior:fe,linkedHoverInClickPredicate:!1}),...E&&E.length>0&&{annotations:E},...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},...q};/* @__PURE__ */ /* @__PURE__ */
|
|
234
|
+
return(0,xb.jsx)(Ry,{ref:ae,...Se})}),"FlowMap"),Mb=require("react"),jb=require("react/jsx-runtime"),Ab=require("react/jsx-runtime"),Cb=/* @__PURE__ */Ec(/* @__PURE__ */ /* @__PURE__ */(0,Mb.forwardRef)(function(e,t){const n=dc(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:b,tileURL:v,tileAttribution:x,tileCacheSize:w,transition:k,colorBy:S,styleRules:M,colorScheme:j,pointRadius:A,tooltip:C,showRings:R,showRingLabels:L,ringStyle:N,showNorth:P,costLabel:I,cartogramLayout:E,annotations:T,margin:z,className:$,selection:D,linkedHover:O,onObservation:F,onClick:_,chartId:W,loading:B,loadingContent:H,emptyContent:q,legendPosition:G,frameProps:V={},stroke:Y,strokeWidth:U,opacity:X}=e,Z="sparkline"===n.mode,K=E??(Z?"strip":"radial"),Q=A??(Z?1.5:5),J=R??!0,ee=L??("strip"!==K&&!n.compactMode),te=P??("strip"!==K&&!Z),ne=m??!!v,re=(0,Mb.useMemo)(()=>kn(r),[r]),ie=$c({responsive:e,data:re,rawData:r,colorBy:S,colorScheme:j,legendInteraction:void 0,legendPosition:G,frameLegend:V,selection:D,linkedHover:O,fallbackFields:S?["string"==typeof S?S:""]:[],unwrapData:!1,onObservation:F,onClick:_,mobileInteraction:n.mobileInteraction,mobileSemantics:n.mobileSemantics,chartType:"DistanceCartogram",chartId:W,showLegend:n.showLegend,userMargin:z,marginDefaults:Hl(n),loading:B,loadingContent:H,emptyContent:q,width:n.width,height:n.height,hasTitle:!!n.title,axisChrome:{hasAxis:!1}}),oe=(0,Mb.useMemo)(()=>{const e=fc(xc(e=>{const t=e?.[s],n=null!=t&&String(t)===String(l);return{fill:S?Ot(e,S,ie.colorScale):Vf,fillOpacity:n?1:.8,stroke:n?"var(--semiotic-text, #222)":"#fff",strokeWidth:n?1.25:1,r:n?1.35*Q:Q}},M,mc(S)),{stroke:Y,strokeWidth:U,opacity:X});return ie.effectiveSelectionHook?Tl(e,ie.effectiveSelectionHook,ie.resolvedSelection):e},[S,ie.colorScale,ie.effectiveSelectionHook,ie.resolvedSelection,Q,Y,U,X,M,l,s]),ae=(0,Mb.useMemo)(()=>({center:l,centerAccessor:s,costAccessor:c,strength:u,lineMode:d,layout:K}),[l,s,c,u,d,K]),se=(0,Mb.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(String(e[s]),e);return i.map(r=>{if(r.coordinates)return r;const i=n.get(String(r.source)),s=n.get(String(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,Mb.useMemo)(()=>e=>{const t=("function"==typeof c?c:e=>e[c])(e),n=e[s]||e.name||e.id||"Point";/* @__PURE__ */ /* @__PURE__ */
|
|
235
|
+
return(0,Ab.jsxs)("div",{style:{background:"rgba(0,0,0,0.85)",color:"white",padding:"6px 10px",borderRadius:4,fontSize:12},children:[
|
|
236
|
+
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */(0,Ab.jsx)("div",{style:{fontWeight:600},children:n}),null!=t&&/* @__PURE__ */ /* @__PURE__ */(0,Ab.jsxs)("div",{style:{opacity:.7},children:["Cost: ","number"==typeof t?t.toFixed(1):t]})]})},[c,s]),ce=(0,Mb.useRef)(null);Dc(t,{variant:"geo-points",frameRef:ce});const[ue,de]=(0,Mb.useState)(null),he=(0,Mb.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,Mb.useEffect)(()=>{const e=requestAnimationFrame(he);return()=>cancelAnimationFrame(e)},[he,u,l,n.width,n.height,re,K]);const fe=(0,Mb.useMemo)(()=>{if(!J||!ue)return[];const{maxCost:e}=ue;if(e<=0)return[];if(Array.isArray(J))return J.filter(t=>t>0&&t<=e);const t="strip"===ue.layout?3:5,n="number"==typeof J?J:Math.min(t,Math.max(2,Math.ceil(e/5))),r=e/n,i=[];for(let e=1;e<=n;e++)i.push(Math.round(r*e*10)/10);return i},[J,ue]),pe=(0,Mb.useMemo)(()=>{if(!ue)return V.foregroundGraphics||null;const e=/* @__PURE__ */ /* @__PURE__ */(0,Ab.jsx)(Wc,{bottomMargin:ie.margin.bottom,costLabel:I,layout:ue,ringStyle:N,ringValues:fe,showNorth:te,showRingLabels:ee,showRings:J}),t=V.foregroundGraphics;return"function"==typeof t?n=>/* @__PURE__ */ /* @__PURE__ */(0,Ab.jsxs)(Ab.Fragment,{children:[e,t(n)]}):/* @__PURE__ */ /* @__PURE__ */(0,Ab.jsxs)(Ab.Fragment,{children:[e,t]})},[ue,fe,J,ee,te,I,N,ie.margin.bottom,V.foregroundGraphics]);if(ie.earlyReturn)return ie.earlyReturn;jc("DistanceCartogram",re,"xAccessor",o),jc("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!=b&&{dragRotate:b},...v&&{tileURL:v},...x&&{tileAttribution:x},...w&&{tileCacheSize:w},size:[n.width,n.height],maxDevicePixelRatio:e.maxDevicePixelRatio,margin:ie.margin,enableHover:n.enableHover,tooltipContent:!1===C?()=>null:rl(C)||le,...ie.legendBehaviorProps,...Ic({linkedHover:O,selection:D,onObservation:F,onClick:_,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},...$&&{className:$},...null!=e.animate&&{animate:e.animate},...V,foregroundGraphics:pe};/* @__PURE__ */ /* @__PURE__ */
|
|
238
|
+
return(0,Ab.jsx)(Ry,{ref:ce,...me})}),"DistanceCartogram"),Rb=require("react"),Lb=require("react"),Nb=require("react/jsx-runtime"),Pb=/* @__PURE__ */Ec(/* @__PURE__ */ /* @__PURE__ */(0,Rb.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:b,onObservation:v,onClick:x,chartId:w,loading:k,loadingContent:S,emptyContent:M,className:j,frameProps:A={}}=e,{frameRef:C,resolved:R,normalizedMargin:L}=Hc({responsive:e,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}),N=(0,Rb.useMemo)(()=>kn(n),[n]),P=(0,Rb.useMemo)(()=>kn(r),[r]),I=(0,Rb.useMemo)(()=>kn(i),[i]),E=(0,Rb.useMemo)(()=>[...N,...I,...P],[N,I,P]),T=$c({responsive:e,data:E,rawData:void 0!==n||void 0!==i||void 0!==r?E:void 0,colorBy:h,colorScheme:f,legendInteraction:void 0,selection:y,linkedHover:b,fallbackFields:"string"==typeof h?[h]:[],unwrapData:!1,onObservation:v,onClick:x,mobileInteraction:e.mobileInteraction,mobileSemantics:e.mobileSemantics,chartType:"GeoCustomChart",chartId:w,showLegend:!1,userMargin:L,marginDefaults:Hl(R),loading:k,loadingContent:S,emptyContent:M,width:R.width,height:R.height,hasTitle:!!R.title,axisChrome:{hasAxis:!1}}),z=T.effectiveSelectionHook,$=(0,Rb.useMemo)(()=>z?.isActive?{isActive:!0,predicate:z.predicate}:null,[z?.isActive,z?.predicate]);if(T.earlyReturn)return T.earlyReturn;const{width:D,height:O,enableHover:F,title:_,description:W,summary:B,accessibleTable:H}=R,q=rl(p),G={projection:l,...null!=n&&{points:N},...null!=r&&{areas:P},...null!=i&&{lines:I},xAccessor:c,yAccessor:u,...null!=d&&{lineDataAccessor:d},customLayout:o,layoutConfig:a,onLayoutError:s,layoutSelection:$,colorBy:h,colorScheme:f,size:[D,O],responsiveWidth:e.responsiveWidth,responsiveHeight:e.responsiveHeight,margin:T.margin,enableHover:F,...Pc({title:_,description:W,summary:B,accessibleTable:H,className:j,animate:e.animate,maxDevicePixelRatio:e.maxDevicePixelRatio,autoPlaceAnnotations:e.autoPlaceAnnotations}),...!1===p?{tooltipContent:()=>null}:q?{tooltipContent:q}:{},...Ic({linkedHover:b,selection:y,onObservation:v,onClick:x,hoverHighlight:!1,mobileInteraction:T.mobileInteraction,customHoverBehavior:T.customHoverBehavior,customClickBehavior:T.customClickBehavior,linkedHoverInClickPredicate:!1}),...m&&m.length>0&&{annotations:m},...A};/* @__PURE__ */ /* @__PURE__ */
|
|
239
|
+
return(0,Nb.jsx)(Ry,{ref:C,...G})}),"GeoCustomChart"),Ib={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",opacity:0},Eb=8,Tb=require("./semiotic-custom-layout-selection-cjs-shared.min.js"),zb=require("react/jsx-runtime"),$b=.72,Db=1.8,Ob=e=>{const t=e.config,n=t.source??"auto",r="areas"===n||"auto"===n&&e.areas.length>0,i=(r?nu(e):e.points.map((e,t)=>({datum:e,x:t,y:t}))).filter((e,n)=>!t.filter||t.filter(e.datum,n)),o=iu(i.map(e=>e.datum),t),a=r?i:ru({...e,points:i.map(e=>e.datum)}),s=o??Kc(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=Xc(s.map(e=>e.row)),c=Xc(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),p=Math.max(1,e.dimensions.height-2*h),m=f/d,g=p/u,y=m*d,b=g*u,v=(e.dimensions.width-y)/2,x=(e.dimensions.height-b)/2,w=uo(t.cellPadding??.12,0,.8),k=Math.max(1,.5*Math.min(m,g)*(1-w)),S=t.sizeAccessor?s.map(e=>Number(Qc(e.datum,t.sizeAccessor))):[],M=t.sizeDomain??Xc(S),j=t.sizeRange??[.36,1],A=uo(Math.min(j[0],j[1]),.05,1),C=uo(Math.max(j[0],j[1]),A,1),R=s.map((n,r)=>{const i={...n.datum,gridRow:n.row,gridColumn:n.column},o=String(Qc(i,t.idAccessor,["id","key","name"])??`grid-${r}`),a=String(Qc(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=Qc(i,t.categoryAccessor),h=null==d?void 0:String(d),f=Qc(i,t.fillAccessor),p=null!=f?String(f):h?e.resolveColor(h):e.theme.categorical[0]??"#4f86c6",y=t.sizeAccessor?Number(Qc(i,t.sizeAccessor)):NaN,b=t.sizeAccessor&&Number.isFinite(y)?Math.sqrt(uo(Zc(y,M),0,1)):1,w=k*(A+b*(C-A)),S="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:v+(n.column-c[0]+.5)*m,y:x+(n.row-l[0]+.5)*g,radius:w,style:{fill:p,fillOpacity:.94,stroke:"rgba(255,255,255,0.9)",strokeWidth:1,...S}}}),L=t.shape??"circle";return{nodes:R.map(e=>{return"circle"===L?{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"===L?tu(e.x,e.y,e.radius):(t=e.x,n=e.y,r=e.radius,eu([[t-r,n-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"===L?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,zb.jsx)(ou,{marks:R,color:t.labelColor??"#ffffff",fontSize:t.labelFontSize??uo(.23*Math.min(m,g),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}}},Fb=require("react/jsx-runtime"),_b=10,Wb=25e3,Bb=/* @__PURE__ */new WeakMap,Hb=/* @__PURE__ */new WeakMap,qb=/* @__PURE__ */new WeakMap,Gb=1,Vb=e=>{const t=Su(e),n=e.config,r=n.shape??"circle",i=Math.max(.5,au(n.dotRadius)??t.cellSize*uo(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=su(s,n.categoryAccessor),h=su(s,n.fillAccessor),f={fill:null!=h?String(h):null!=d?e.resolveColor(String(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?Au(c,u,i):ju(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,Fb.jsx)("g",{"aria-hidden":"true",pointerEvents:"none",children:t.features.map((t,r)=>{const i=e.scales.geoPath(t);return i?/* @__PURE__ */ /* @__PURE__ */(0,Fb.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"},cu(t,r)):null})}):null,restyle:(e,t)=>t?.isActive&&e.datum?{opacity:t.predicate(e.datum)?1:.14}:{opacity:1}}};
|