streamlit-nightly 1.41.2.dev20241227__py2.py3-none-any.whl → 1.41.2.dev20250124__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. streamlit/__init__.py +11 -2
  2. streamlit/__main__.py +1 -1
  3. streamlit/auth_util.py +209 -0
  4. streamlit/cli_util.py +1 -1
  5. streamlit/column_config.py +1 -1
  6. streamlit/commands/__init__.py +1 -1
  7. streamlit/commands/echo.py +1 -1
  8. streamlit/commands/execution_control.py +1 -1
  9. streamlit/commands/experimental_query_params.py +1 -1
  10. streamlit/commands/logo.py +1 -1
  11. streamlit/commands/navigation.py +16 -15
  12. streamlit/commands/page_config.py +1 -1
  13. streamlit/components/__init__.py +1 -1
  14. streamlit/components/lib/__init__.py +1 -1
  15. streamlit/components/lib/local_component_registry.py +1 -1
  16. streamlit/components/types/__init__.py +1 -1
  17. streamlit/components/types/base_component_registry.py +1 -1
  18. streamlit/components/types/base_custom_component.py +1 -1
  19. streamlit/components/v1/__init__.py +1 -1
  20. streamlit/components/v1/component_arrow.py +1 -1
  21. streamlit/components/v1/component_registry.py +1 -1
  22. streamlit/components/v1/components.py +1 -1
  23. streamlit/components/v1/custom_component.py +1 -1
  24. streamlit/config.py +18 -3
  25. streamlit/config_option.py +10 -19
  26. streamlit/config_util.py +1 -1
  27. streamlit/connections/__init__.py +1 -1
  28. streamlit/connections/base_connection.py +1 -1
  29. streamlit/connections/snowflake_connection.py +31 -50
  30. streamlit/connections/snowpark_connection.py +1 -1
  31. streamlit/connections/sql_connection.py +1 -1
  32. streamlit/connections/util.py +1 -1
  33. streamlit/cursor.py +1 -1
  34. streamlit/dataframe_util.py +3 -3
  35. streamlit/delta_generator.py +7 -3
  36. streamlit/delta_generator_singletons.py +1 -1
  37. streamlit/deprecation_util.py +1 -1
  38. streamlit/development.py +1 -1
  39. streamlit/elements/__init__.py +1 -1
  40. streamlit/elements/alert.py +1 -1
  41. streamlit/elements/arrow.py +25 -3
  42. streamlit/elements/balloons.py +1 -1
  43. streamlit/elements/bokeh_chart.py +1 -1
  44. streamlit/elements/code.py +9 -1
  45. streamlit/elements/deck_gl_json_chart.py +1 -1
  46. streamlit/elements/dialog_decorator.py +1 -1
  47. streamlit/elements/doc_string.py +1 -1
  48. streamlit/elements/empty.py +1 -1
  49. streamlit/elements/exception.py +8 -10
  50. streamlit/elements/form.py +1 -1
  51. streamlit/elements/graphviz_chart.py +1 -1
  52. streamlit/elements/heading.py +1 -1
  53. streamlit/elements/html.py +1 -1
  54. streamlit/elements/iframe.py +1 -1
  55. streamlit/elements/image.py +1 -1
  56. streamlit/elements/json.py +1 -1
  57. streamlit/elements/layouts.py +1 -1
  58. streamlit/elements/lib/__init__.py +1 -1
  59. streamlit/elements/lib/built_in_chart_utils.py +1 -1
  60. streamlit/elements/lib/color_util.py +1 -1
  61. streamlit/elements/lib/column_config_utils.py +1 -1
  62. streamlit/elements/lib/column_types.py +1 -1
  63. streamlit/elements/lib/dialog.py +1 -1
  64. streamlit/elements/lib/dicttools.py +1 -1
  65. streamlit/elements/lib/event_utils.py +1 -1
  66. streamlit/elements/lib/file_uploader_utils.py +1 -1
  67. streamlit/elements/lib/form_utils.py +1 -1
  68. streamlit/elements/lib/image_utils.py +1 -1
  69. streamlit/elements/lib/js_number.py +1 -1
  70. streamlit/elements/lib/mutable_status_container.py +1 -1
  71. streamlit/elements/lib/options_selector_utils.py +1 -1
  72. streamlit/elements/lib/pandas_styler_utils.py +1 -1
  73. streamlit/elements/lib/policies.py +1 -1
  74. streamlit/elements/lib/streamlit_plotly_theme.py +1 -1
  75. streamlit/elements/lib/subtitle_utils.py +1 -1
  76. streamlit/elements/lib/utils.py +1 -1
  77. streamlit/elements/map.py +1 -1
  78. streamlit/elements/markdown.py +3 -3
  79. streamlit/elements/media.py +1 -1
  80. streamlit/elements/metric.py +1 -1
  81. streamlit/elements/plotly_chart.py +1 -1
  82. streamlit/elements/progress.py +1 -1
  83. streamlit/elements/pyplot.py +1 -1
  84. streamlit/elements/snow.py +1 -1
  85. streamlit/elements/spinner.py +14 -7
  86. streamlit/elements/text.py +1 -1
  87. streamlit/elements/toast.py +1 -1
  88. streamlit/elements/vega_charts.py +20 -6
  89. streamlit/elements/widgets/__init__.py +1 -1
  90. streamlit/elements/widgets/audio_input.py +1 -1
  91. streamlit/elements/widgets/button.py +9 -8
  92. streamlit/elements/widgets/button_group.py +6 -4
  93. streamlit/elements/widgets/camera_input.py +1 -1
  94. streamlit/elements/widgets/chat.py +1 -1
  95. streamlit/elements/widgets/checkbox.py +1 -1
  96. streamlit/elements/widgets/color_picker.py +1 -1
  97. streamlit/elements/widgets/data_editor.py +6 -5
  98. streamlit/elements/widgets/file_uploader.py +1 -1
  99. streamlit/elements/widgets/multiselect.py +1 -1
  100. streamlit/elements/widgets/number_input.py +1 -1
  101. streamlit/elements/widgets/radio.py +1 -1
  102. streamlit/elements/widgets/select_slider.py +1 -1
  103. streamlit/elements/widgets/selectbox.py +1 -1
  104. streamlit/elements/widgets/slider.py +1 -1
  105. streamlit/elements/widgets/text_widgets.py +1 -1
  106. streamlit/elements/widgets/time_widgets.py +63 -3
  107. streamlit/elements/write.py +2 -2
  108. streamlit/emojis.py +2 -2
  109. streamlit/env_util.py +1 -1
  110. streamlit/error_util.py +9 -3
  111. streamlit/errors.py +5 -1
  112. streamlit/external/__init__.py +1 -1
  113. streamlit/external/langchain/__init__.py +1 -1
  114. streamlit/external/langchain/streamlit_callback_handler.py +1 -1
  115. streamlit/file_util.py +1 -1
  116. streamlit/git_util.py +1 -1
  117. streamlit/hello/__init__.py +1 -1
  118. streamlit/hello/animation_demo.py +1 -1
  119. streamlit/hello/dataframe_demo.py +1 -1
  120. streamlit/hello/hello.py +1 -1
  121. streamlit/hello/mapping_demo.py +1 -1
  122. streamlit/hello/plotting_demo.py +1 -1
  123. streamlit/hello/streamlit_app.py +1 -1
  124. streamlit/hello/utils.py +1 -1
  125. streamlit/logger.py +1 -1
  126. streamlit/material_icon_names.py +2 -2
  127. streamlit/navigation/__init__.py +1 -1
  128. streamlit/navigation/page.py +7 -4
  129. streamlit/net_util.py +1 -1
  130. streamlit/platform.py +1 -1
  131. streamlit/proto/Alert_pb2.pyi +1 -1
  132. streamlit/proto/AppPage_pb2.pyi +1 -1
  133. streamlit/proto/ArrowNamedDataSet_pb2.pyi +1 -1
  134. streamlit/proto/ArrowVegaLiteChart_pb2.pyi +1 -1
  135. streamlit/proto/Arrow_pb2.pyi +1 -1
  136. streamlit/proto/AudioInput_pb2.pyi +1 -1
  137. streamlit/proto/Audio_pb2.pyi +1 -1
  138. streamlit/proto/AuthRedirect_pb2.py +27 -0
  139. streamlit/proto/AuthRedirect_pb2.pyi +41 -0
  140. streamlit/proto/AutoRerun_pb2.pyi +1 -1
  141. streamlit/proto/BackMsg_pb2.pyi +1 -1
  142. streamlit/proto/Balloons_pb2.pyi +1 -1
  143. streamlit/proto/Block_pb2.pyi +1 -1
  144. streamlit/proto/BokehChart_pb2.pyi +1 -1
  145. streamlit/proto/ButtonGroup_pb2.pyi +1 -1
  146. streamlit/proto/Button_pb2.pyi +1 -1
  147. streamlit/proto/CameraInput_pb2.pyi +1 -1
  148. streamlit/proto/ChatInput_pb2.pyi +1 -1
  149. streamlit/proto/Checkbox_pb2.pyi +1 -1
  150. streamlit/proto/ClientState_pb2.pyi +1 -1
  151. streamlit/proto/Code_pb2.py +2 -2
  152. streamlit/proto/Code_pb2.pyi +5 -2
  153. streamlit/proto/ColorPicker_pb2.pyi +1 -1
  154. streamlit/proto/Common_pb2.pyi +1 -1
  155. streamlit/proto/Components_pb2.pyi +1 -1
  156. streamlit/proto/DataFrame_pb2.pyi +1 -1
  157. streamlit/proto/DateInput_pb2.pyi +1 -1
  158. streamlit/proto/DeckGlJsonChart_pb2.pyi +1 -1
  159. streamlit/proto/Delta_pb2.pyi +1 -1
  160. streamlit/proto/DocString_pb2.pyi +1 -1
  161. streamlit/proto/DownloadButton_pb2.pyi +1 -1
  162. streamlit/proto/Element_pb2.pyi +1 -1
  163. streamlit/proto/Empty_pb2.pyi +1 -1
  164. streamlit/proto/Exception_pb2.pyi +1 -1
  165. streamlit/proto/Favicon_pb2.pyi +1 -1
  166. streamlit/proto/FileUploader_pb2.pyi +1 -1
  167. streamlit/proto/ForwardMsg_pb2.py +12 -9
  168. streamlit/proto/ForwardMsg_pb2.pyi +34 -4
  169. streamlit/proto/GitInfo_pb2.pyi +1 -1
  170. streamlit/proto/GraphVizChart_pb2.pyi +1 -1
  171. streamlit/proto/Heading_pb2.pyi +1 -1
  172. streamlit/proto/Html_pb2.pyi +1 -1
  173. streamlit/proto/IFrame_pb2.pyi +1 -1
  174. streamlit/proto/Image_pb2.pyi +1 -1
  175. streamlit/proto/Json_pb2.pyi +1 -1
  176. streamlit/proto/LabelVisibilityMessage_pb2.pyi +1 -1
  177. streamlit/proto/LinkButton_pb2.pyi +1 -1
  178. streamlit/proto/Logo_pb2.pyi +1 -1
  179. streamlit/proto/Markdown_pb2.pyi +1 -1
  180. streamlit/proto/Metric_pb2.pyi +1 -1
  181. streamlit/proto/MetricsEvent_pb2.pyi +1 -1
  182. streamlit/proto/MultiSelect_pb2.pyi +1 -1
  183. streamlit/proto/NamedDataSet_pb2.pyi +1 -1
  184. streamlit/proto/Navigation_pb2.pyi +1 -1
  185. streamlit/proto/NewSession_pb2.pyi +1 -1
  186. streamlit/proto/NumberInput_pb2.pyi +1 -1
  187. streamlit/proto/PageConfig_pb2.pyi +1 -1
  188. streamlit/proto/PageInfo_pb2.pyi +1 -1
  189. streamlit/proto/PageLink_pb2.pyi +1 -1
  190. streamlit/proto/PageNotFound_pb2.pyi +1 -1
  191. streamlit/proto/PageProfile_pb2.pyi +1 -1
  192. streamlit/proto/PagesChanged_pb2.pyi +1 -1
  193. streamlit/proto/ParentMessage_pb2.pyi +1 -1
  194. streamlit/proto/PlotlyChart_pb2.pyi +1 -1
  195. streamlit/proto/Progress_pb2.pyi +1 -1
  196. streamlit/proto/Radio_pb2.pyi +1 -1
  197. streamlit/proto/RootContainer_pb2.pyi +1 -1
  198. streamlit/proto/Selectbox_pb2.pyi +1 -1
  199. streamlit/proto/SessionEvent_pb2.pyi +1 -1
  200. streamlit/proto/SessionStatus_pb2.pyi +1 -1
  201. streamlit/proto/Skeleton_pb2.pyi +1 -1
  202. streamlit/proto/Slider_pb2.pyi +1 -1
  203. streamlit/proto/Snow_pb2.pyi +1 -1
  204. streamlit/proto/Spinner_pb2.py +2 -2
  205. streamlit/proto/Spinner_pb2.pyi +6 -2
  206. streamlit/proto/TextArea_pb2.pyi +1 -1
  207. streamlit/proto/TextInput_pb2.pyi +1 -1
  208. streamlit/proto/Text_pb2.pyi +1 -1
  209. streamlit/proto/TimeInput_pb2.pyi +1 -1
  210. streamlit/proto/Toast_pb2.pyi +1 -1
  211. streamlit/proto/VegaLiteChart_pb2.pyi +1 -1
  212. streamlit/proto/Video_pb2.pyi +1 -1
  213. streamlit/proto/WidgetStates_pb2.pyi +1 -1
  214. streamlit/proto/__init__.py +1 -1
  215. streamlit/runtime/__init__.py +1 -1
  216. streamlit/runtime/app_session.py +29 -5
  217. streamlit/runtime/caching/__init__.py +1 -1
  218. streamlit/runtime/caching/cache_data_api.py +3 -3
  219. streamlit/runtime/caching/cache_errors.py +1 -1
  220. streamlit/runtime/caching/cache_resource_api.py +1 -1
  221. streamlit/runtime/caching/cache_type.py +1 -1
  222. streamlit/runtime/caching/cache_utils.py +5 -4
  223. streamlit/runtime/caching/cached_message_replay.py +1 -1
  224. streamlit/runtime/caching/hashing.py +1 -1
  225. streamlit/runtime/caching/legacy_cache_api.py +1 -1
  226. streamlit/runtime/caching/storage/__init__.py +1 -1
  227. streamlit/runtime/caching/storage/cache_storage_protocol.py +1 -1
  228. streamlit/runtime/caching/storage/dummy_cache_storage.py +1 -1
  229. streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py +1 -1
  230. streamlit/runtime/caching/storage/local_disk_cache_storage.py +5 -5
  231. streamlit/runtime/connection_factory.py +1 -1
  232. streamlit/runtime/context.py +1 -1
  233. streamlit/runtime/credentials.py +5 -5
  234. streamlit/runtime/forward_msg_cache.py +4 -2
  235. streamlit/runtime/forward_msg_queue.py +33 -5
  236. streamlit/runtime/fragment.py +2 -2
  237. streamlit/runtime/media_file_manager.py +1 -1
  238. streamlit/runtime/media_file_storage.py +1 -1
  239. streamlit/runtime/memory_media_file_storage.py +1 -1
  240. streamlit/runtime/memory_session_storage.py +1 -1
  241. streamlit/runtime/memory_uploaded_file_manager.py +1 -1
  242. streamlit/runtime/metrics_util.py +2 -1
  243. streamlit/runtime/pages_manager.py +4 -2
  244. streamlit/runtime/runtime.py +22 -6
  245. streamlit/runtime/runtime_util.py +1 -1
  246. streamlit/runtime/script_data.py +1 -1
  247. streamlit/runtime/scriptrunner/__init__.py +1 -1
  248. streamlit/runtime/scriptrunner/exec_code.py +34 -1
  249. streamlit/runtime/scriptrunner/magic.py +1 -1
  250. streamlit/runtime/scriptrunner/magic_funcs.py +1 -1
  251. streamlit/runtime/scriptrunner/script_cache.py +1 -1
  252. streamlit/runtime/scriptrunner/script_runner.py +23 -12
  253. streamlit/runtime/scriptrunner_utils/__init__.py +1 -1
  254. streamlit/runtime/scriptrunner_utils/exceptions.py +1 -1
  255. streamlit/runtime/scriptrunner_utils/script_requests.py +2 -1
  256. streamlit/runtime/scriptrunner_utils/script_run_context.py +2 -2
  257. streamlit/runtime/secrets.py +1 -1
  258. streamlit/runtime/session_manager.py +2 -2
  259. streamlit/runtime/state/__init__.py +1 -1
  260. streamlit/runtime/state/common.py +1 -1
  261. streamlit/runtime/state/query_params.py +2 -2
  262. streamlit/runtime/state/query_params_proxy.py +15 -5
  263. streamlit/runtime/state/safe_session_state.py +1 -1
  264. streamlit/runtime/state/session_state.py +1 -1
  265. streamlit/runtime/state/session_state_proxy.py +1 -1
  266. streamlit/runtime/state/widgets.py +1 -1
  267. streamlit/runtime/stats.py +1 -1
  268. streamlit/runtime/uploaded_file_manager.py +1 -1
  269. streamlit/runtime/websocket_session_manager.py +2 -2
  270. streamlit/source_util.py +1 -1
  271. streamlit/static/index.html +3 -3
  272. streamlit/static/static/css/index.mUTQuMqR.css +1 -0
  273. streamlit/static/static/js/{FileDownload.esm.WslOojMp.js → FileDownload.esm.C1QvS8Zm.js} +1 -1
  274. streamlit/static/static/js/{FormClearHelper.DSgVZ-NK.js → FormClearHelper.mT4-5rFn.js} +1 -1
  275. streamlit/static/static/js/{Hooks.wzeYp0oD.js → Hooks.CVNEuaGG.js} +1 -1
  276. streamlit/static/static/js/InputInstructions.BCvAGBeC.js +1 -0
  277. streamlit/static/static/js/{ProgressBar.D1he2Gib.js → ProgressBar.CcQcYD9u.js} +2 -2
  278. streamlit/static/static/js/RenderInPortalIfExists.DHDG9PHn.js +1 -0
  279. streamlit/static/static/js/Toolbar.yTE_O6B7.js +1 -0
  280. streamlit/static/static/js/{base-input.gDrmzpbY.js → base-input.CQPY9_oN.js} +4 -4
  281. streamlit/static/static/js/createSuper.DE47Tkz4.js +1 -0
  282. streamlit/static/static/js/data-grid-overlay-editor.5JEQwfzp.js +1 -0
  283. streamlit/static/static/js/{downloader.B-SkHjg2.js → downloader.CX7_KkfB.js} +1 -1
  284. streamlit/static/static/js/{es6.DoVDVSd_.js → es6.Be2vwxoI.js} +2 -2
  285. streamlit/static/static/js/{iframeResizer.contentWindow.Exq_q4jU.js → iframeResizer.contentWindow.CFHofqC-.js} +1 -1
  286. streamlit/static/static/js/index.0OeiPvr3.js +1 -0
  287. streamlit/static/static/js/index.1GBg_Cdb.js +1 -0
  288. streamlit/static/static/js/index.4nNgvhbk.js +4 -0
  289. streamlit/static/static/js/index.5F9_LJ-9.js +1 -0
  290. streamlit/static/static/js/index.6v5ZgUAy.js +1 -0
  291. streamlit/static/static/js/index.8tVXPrLX.js +1 -0
  292. streamlit/static/static/js/index.AExANgn1.js +1 -0
  293. streamlit/static/static/js/index.AXOgS1NM.js +1 -0
  294. streamlit/static/static/js/index.B-xzXPZE.js +3 -0
  295. streamlit/static/static/js/index.B0pfFJGU.js +1 -0
  296. streamlit/static/static/js/index.BBjf7kH1.js +1 -0
  297. streamlit/static/static/js/index.BGICDmL0.js +201 -0
  298. streamlit/static/static/js/{index.rDDlhQFp.js → index.BOeLQ18h.js} +1 -1
  299. streamlit/static/static/js/index.BUgJRfqp.js +3 -0
  300. streamlit/static/static/js/index.BpeIAypN.js +1 -0
  301. streamlit/static/static/js/{index.BjQJsYG6.js → index.C0ZNaKGF.js} +1 -1
  302. streamlit/static/static/js/index.C3eR9AQ5.js +1 -0
  303. streamlit/static/static/js/index.CCmrDm8Z.js +2 -0
  304. streamlit/static/static/js/index.CHuo89tL.js +1 -0
  305. streamlit/static/static/js/index.Cbi_d9ak.js +197 -0
  306. streamlit/static/static/js/{index.CyRDf6c5.js → index.Cg7T4wJt.js} +3 -3
  307. streamlit/static/static/js/index.Ci3iebpl.js +1 -0
  308. streamlit/static/static/js/index.CjsaBedq.js +1 -0
  309. streamlit/static/static/js/{index.CLHVvMN0.js → index.CvqaNor_.js} +139 -128
  310. streamlit/static/static/js/index.D0lxtOCO.js +2 -0
  311. streamlit/static/static/js/index.D1AD4NsW.js +1 -0
  312. streamlit/static/static/js/{index.4lqQPLdu.js → index.DLjk_wlB.js} +1 -1
  313. streamlit/static/static/js/{index.DfwGDOWW.js → index.DNDhYAPI.js} +2 -2
  314. streamlit/static/static/js/index.DY6666R7.js +1 -0
  315. streamlit/static/static/js/{index.DaTKmBKa.js → index.Dkr_c_9x.js} +100 -100
  316. streamlit/static/static/js/{index.Bcz23DKe.js → index.Hhv6gSq2.js} +12 -12
  317. streamlit/static/static/js/{index.Bm2n8u7I.js → index.OM83ZHKg.js} +2 -2
  318. streamlit/static/static/js/index.SLleoa9s.js +1 -0
  319. streamlit/static/static/js/{index.2Rr5kbVL.js → index.XCwDes79.js} +1 -1
  320. streamlit/static/static/js/{index.B_RzfO7U.js → index.a6pesEXT.js} +1 -1
  321. streamlit/static/static/js/{index.CAkYXoVB.js → index.er3Zfn3e.js} +2 -2
  322. streamlit/static/static/js/{index.CZ-znj8N.js → index.mtSGfsND.js} +1 -1
  323. streamlit/static/static/js/{input.28wXD4uV.js → input.B07wSbwn.js} +2 -2
  324. streamlit/static/static/js/{memory.jbWyoc5k.js → memory.CC_p93jh.js} +1 -1
  325. streamlit/static/static/js/mergeWith.ivc75cD1.js +1 -0
  326. streamlit/static/static/js/number-overlay-editor.Db2Be6nq.js +9 -0
  327. streamlit/static/static/js/possibleConstructorReturn.BNprLGNF.js +1 -0
  328. streamlit/static/static/js/{sandbox.CfK9-cKf.js → sandbox.BlG3HhHL.js} +1 -1
  329. streamlit/static/static/js/{textarea.C5OZk1uL.js → textarea.Bz6Z-kmO.js} +2 -2
  330. streamlit/static/static/js/threshold.B8r8f5kt.js +1 -0
  331. streamlit/static/static/js/{timepicker.DEpQEk7W.js → timepicker.BMSb5NlP.js} +3 -3
  332. streamlit/static/static/js/timer.RueuYoQV.js +1 -0
  333. streamlit/static/static/js/toConsumableArray.uYLXBIlD.js +3 -0
  334. streamlit/static/static/js/uniqueId.BdisvZXg.js +1 -0
  335. streamlit/static/static/js/{useBasicWidgetState.C2DsWpWi.js → useBasicWidgetState.BJFGEQDL.js} +1 -1
  336. streamlit/static/static/js/{useOnInputChange.Bw6YkmJD.js → useOnInputChange.BmSN_ACz.js} +1 -1
  337. streamlit/static/static/js/value.iufjd77T.js +1 -0
  338. streamlit/static/static/js/withFullScreenWrapper.CbOOMX5j.js +1 -0
  339. streamlit/static/static/media/MaterialSymbols-Rounded.DzyB5T7Y.woff2 +0 -0
  340. streamlit/string_util.py +1 -1
  341. streamlit/temporary_directory.py +1 -1
  342. streamlit/testing/__init__.py +1 -1
  343. streamlit/testing/v1/__init__.py +1 -1
  344. streamlit/testing/v1/app_test.py +1 -1
  345. streamlit/testing/v1/element_tree.py +1 -1
  346. streamlit/testing/v1/local_script_runner.py +1 -1
  347. streamlit/testing/v1/util.py +1 -1
  348. streamlit/time_util.py +1 -1
  349. streamlit/type_util.py +2 -2
  350. streamlit/url_util.py +24 -1
  351. streamlit/user_info.py +445 -25
  352. streamlit/util.py +1 -1
  353. streamlit/version.py +1 -1
  354. streamlit/watcher/__init__.py +1 -1
  355. streamlit/watcher/event_based_path_watcher.py +1 -1
  356. streamlit/watcher/folder_black_list.py +1 -1
  357. streamlit/watcher/local_sources_watcher.py +5 -3
  358. streamlit/watcher/path_watcher.py +1 -1
  359. streamlit/watcher/polling_path_watcher.py +1 -1
  360. streamlit/watcher/util.py +87 -21
  361. streamlit/web/__init__.py +1 -1
  362. streamlit/web/bootstrap.py +22 -2
  363. streamlit/web/cache_storage_manager_config.py +1 -1
  364. streamlit/web/cli.py +1 -1
  365. streamlit/web/server/__init__.py +1 -1
  366. streamlit/web/server/app_static_file_handler.py +1 -1
  367. streamlit/web/server/authlib_tornado_integration.py +58 -0
  368. streamlit/web/server/browser_websocket_handler.py +73 -7
  369. streamlit/web/server/component_request_handler.py +1 -1
  370. streamlit/web/server/media_file_handler.py +1 -1
  371. streamlit/web/server/oauth_authlib_routes.py +176 -0
  372. streamlit/web/server/oidc_mixin.py +108 -0
  373. streamlit/web/server/routes.py +6 -4
  374. streamlit/web/server/server.py +41 -4
  375. streamlit/web/server/server_util.py +25 -1
  376. streamlit/web/server/stats_request_handler.py +1 -1
  377. streamlit/web/server/upload_file_request_handler.py +3 -2
  378. streamlit/web/server/websocket_headers.py +1 -1
  379. {streamlit_nightly-1.41.2.dev20241227.data → streamlit_nightly-1.41.2.dev20250124.data}/scripts/streamlit.cmd +1 -1
  380. {streamlit_nightly-1.41.2.dev20241227.dist-info → streamlit_nightly-1.41.2.dev20250124.dist-info}/METADATA +16 -4
  381. streamlit_nightly-1.41.2.dev20250124.dist-info/RECORD +560 -0
  382. {streamlit_nightly-1.41.2.dev20241227.dist-info → streamlit_nightly-1.41.2.dev20250124.dist-info}/WHEEL +1 -1
  383. streamlit/static/static/css/index.ZIJkhegp.css +0 -1
  384. streamlit/static/static/js/InputInstructions.DpTmOmkP.js +0 -1
  385. streamlit/static/static/js/RenderInPortalIfExists.CphMKHZ_.js +0 -1
  386. streamlit/static/static/js/Toolbar.YZjXpW2P.js +0 -1
  387. streamlit/static/static/js/_commonjs-dynamic-modules.TDtrdbi3.js +0 -1
  388. streamlit/static/static/js/createSuper.Cj3WfXha.js +0 -1
  389. streamlit/static/static/js/data-grid-overlay-editor.CXW3Vrt9.js +0 -1
  390. streamlit/static/static/js/getPrototypeOf.BZAK2f3t.js +0 -1
  391. streamlit/static/static/js/index.1auHKWgw.js +0 -3
  392. streamlit/static/static/js/index.2XFKVtzu.js +0 -1
  393. streamlit/static/static/js/index.B9O1l5Yf.js +0 -32
  394. streamlit/static/static/js/index.BjtDBCFh.js +0 -2
  395. streamlit/static/static/js/index.Bp-uIPRI.js +0 -1
  396. streamlit/static/static/js/index.BrGYP4fV.js +0 -1
  397. streamlit/static/static/js/index.BwUmNKlx.js +0 -1
  398. streamlit/static/static/js/index.CCVCD0op.js +0 -1
  399. streamlit/static/static/js/index.CP7C0jmi.js +0 -1
  400. streamlit/static/static/js/index.CVNaQiWI.js +0 -4
  401. streamlit/static/static/js/index.CX7qwffH.js +0 -1
  402. streamlit/static/static/js/index.CaCnIXu_.js +0 -1
  403. streamlit/static/static/js/index.Ck6XWYeb.js +0 -1
  404. streamlit/static/static/js/index.CmD2DSvp.js +0 -201
  405. streamlit/static/static/js/index.CnX4MRBV.js +0 -1
  406. streamlit/static/static/js/index.DR8k91Kp.js +0 -1
  407. streamlit/static/static/js/index.Dc0EFNHf.js +0 -197
  408. streamlit/static/static/js/index.M9USxdKN.js +0 -1
  409. streamlit/static/static/js/index.MCDV8ab_.js +0 -1
  410. streamlit/static/static/js/index.T4c5nSGV.js +0 -2
  411. streamlit/static/static/js/index.brVZtr01.js +0 -1
  412. streamlit/static/static/js/index.fm1fEqFi.js +0 -1
  413. streamlit/static/static/js/index.vm3Bds7I.js +0 -1
  414. streamlit/static/static/js/index.y_EIxzAg.js +0 -1
  415. streamlit/static/static/js/number-overlay-editor.D5dgP2YW.js +0 -9
  416. streamlit/static/static/js/slicedToArray.DVgs1NsC.js +0 -2
  417. streamlit/static/static/js/string.Bl9OLDCw.js +0 -1
  418. streamlit/static/static/js/threshold.skajmqVB.js +0 -1
  419. streamlit/static/static/js/timer.DwZfkapc.js +0 -1
  420. streamlit/static/static/js/uniqueId.OJw6SDpp.js +0 -1
  421. streamlit/static/static/js/withFullScreenWrapper.BjS0eA06.js +0 -1
  422. streamlit/static/static/media/MaterialSymbols-Rounded.MYSe4dsi.woff2 +0 -0
  423. streamlit/vendor/ipython/__init__.py +0 -0
  424. streamlit/vendor/ipython/modified_sys_path.py +0 -67
  425. streamlit_nightly-1.41.2.dev20241227.dist-info/RECORD +0 -556
  426. /streamlit/static/static/css/{index.B26BQfSF.css → index.Bmkmz40k.css} +0 -0
  427. /streamlit/static/static/css/{index.CG16XVnL.css → index.DzuxGC_t.css} +0 -0
  428. {streamlit_nightly-1.41.2.dev20241227.dist-info → streamlit_nightly-1.41.2.dev20250124.dist-info}/entry_points.txt +0 -0
  429. {streamlit_nightly-1.41.2.dev20241227.dist-info → streamlit_nightly-1.41.2.dev20250124.dist-info}/top_level.txt +0 -0
@@ -1,201 +0,0 @@
1
- import{g as zk,a9 as Qu,A as Jy,J as bE,aa as rL,ab as sL,ac as ga,ad as Pd,S as eo,ae as oL,af as aL,ag as vE,ah as uL,B as lL,Q as cL,n as fL,M as dL,j as fd,r as hL,D as xE,ai as pL,$ as ym,a7 as gL,aj as mL,ak as wE}from"./index.CLHVvMN0.js";import{a as oc,n as yL,b as bL,c as fp,t as Oo,f as vL,d as j0,p as xL,e as wL,g as EL,h as Ik,i as SL,j as Bs,k as Nc,l as _L,m as $L,o as AL,q as kL,r as dp,s as EE,u as ku,v as Qy,w as hp,x as SE,y as fs,z as Va,A as CL,B as Us,C as FL,D as TL,E as ML,F as DL}from"./threshold.skajmqVB.js";import{d as Zy,e as eb,R as pp,C as tb,r as Bk,b as _E,a as $E,h as gp,c as q0,n as Pt,f as OL,g as RL,i as NL,j as LL,k as PL,l as zL,m as IL,o as zd}from"./string.Bl9OLDCw.js";import{i as BL,a as UL,n as jL,T as qL,t as WL}from"./timer.DwZfkapc.js";import{F as HL}from"./FormClearHelper.DSgVZ-NK.js";import{S as AE,T as GL}from"./Toolbar.YZjXpW2P.js";import{w as VL,u as XL,E as YL}from"./withFullScreenWrapper.BjS0eA06.js";/*!
2
- * https://github.com/Starcounter-Jack/JSON-Patch
3
- * (c) 2017-2022 Joachim Wester
4
- * MIT licensed
5
- */var KL=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),JL=Object.prototype.hasOwnProperty;function W0(e,t){return JL.call(e,t)}function H0(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var i=[];for(var r in e)W0(e,r)&&i.push(r);return i}function Cn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function G0(e){for(var t=0,n=e.length,i;t<n;){if(i=e.charCodeAt(t),i>=48&&i<=57){t++;continue}return!1}return!0}function ho(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Uk(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function V0(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(V0(e[t]))return!0}else if(typeof e=="object"){for(var i=H0(e),r=i.length,s=0;s<r;s++)if(V0(e[i[s]]))return!0}}return!1}function kE(e,t){var n=[e];for(var i in t){var r=typeof t[i]=="object"?JSON.stringify(t[i],null,2):t[i];typeof r<"u"&&n.push(i+": "+r)}return n.join(`
6
- `)}var jk=function(e){KL(t,e);function t(n,i,r,s,o){var a=this.constructor,u=e.call(this,kE(n,{name:i,index:r,operation:s,tree:o}))||this;return u.name=i,u.index=r,u.operation=s,u.tree=o,Object.setPrototypeOf(u,a.prototype),u.message=kE(n,{name:i,index:r,operation:s,tree:o}),u}return t}(Error),Xe=jk,QL=Cn,Ma={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var i=e[t];return delete e[t],{newDocument:n,removed:i}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:function(e,t,n){var i=Id(n,this.path);i&&(i=Cn(i));var r=_o(n,{op:"remove",path:this.from}).removed;return _o(n,{op:"add",path:this.path,value:r}),{newDocument:n,removed:i}},copy:function(e,t,n){var i=Id(n,this.from);return _o(n,{op:"add",path:this.path,value:Cn(i)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:ac(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},ZL={add:function(e,t,n){return G0(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var i=e.splice(t,1);return{newDocument:n,removed:i[0]}},replace:function(e,t,n){var i=e[t];return e[t]=this.value,{newDocument:n,removed:i}},move:Ma.move,copy:Ma.copy,test:Ma.test,_get:Ma._get};function Id(e,t){if(t=="")return e;var n={op:"_get",path:t};return _o(e,n),n.value}function _o(e,t,n,i,r,s){if(n===void 0&&(n=!1),i===void 0&&(i=!0),r===void 0&&(r=!0),s===void 0&&(s=0),n&&(typeof n=="function"?n(t,0,e,t.path):Bd(t,0)),t.path===""){var o={newDocument:e};if(t.op==="add")return o.newDocument=t.value,o;if(t.op==="replace")return o.newDocument=t.value,o.removed=e,o;if(t.op==="move"||t.op==="copy")return o.newDocument=Id(e,t.from),t.op==="move"&&(o.removed=e),o;if(t.op==="test"){if(o.test=ac(e,t.value),o.test===!1)throw new Xe("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o.newDocument=e,o}else{if(t.op==="remove")return o.removed=e,o.newDocument=null,o;if(t.op==="_get")return t.value=e,o;if(n)throw new Xe("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return o}}else{i||(e=Cn(e));var a=t.path||"",u=a.split("/"),l=e,c=1,f=u.length,d=void 0,h=void 0,p=void 0;for(typeof n=="function"?p=n:p=Bd;;){if(h=u[c],h&&h.indexOf("~")!=-1&&(h=Uk(h)),r&&(h=="__proto__"||h=="prototype"&&c>0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!G0(h))throw new Xe("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);G0(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new Xe("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=ZL[t.op].call(t,l,h,e);if(o.test===!1)throw new Xe("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=Ma[t.op].call(t,l,h,e);if(o.test===!1)throw new Xe("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(l=l[h],n&&c<f&&(!l||typeof l!="object"))throw new Xe("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}function mp(e,t,n,i,r){if(i===void 0&&(i=!0),r===void 0&&(r=!0),n&&!Array.isArray(t))throw new Xe("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");i||(e=Cn(e));for(var s=new Array(t.length),o=0,a=t.length;o<a;o++)s[o]=_o(e,t[o],n,!0,r,o),e=s[o].newDocument;return s.newDocument=e,s}function eP(e,t,n){var i=_o(e,t);if(i.test===!1)throw new Xe("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return i.newDocument}function Bd(e,t,n,i){if(typeof e!="object"||e===null||Array.isArray(e))throw new Xe("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(Ma[e.op]){if(typeof e.path!="string")throw new Xe("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Xe('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Xe("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Xe("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&V0(e.value))throw new Xe("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,s=i.split("/").length;if(r!==s+1&&r!==s)throw new Xe("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new Xe("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=qk([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Xe("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Xe("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function qk(e,t,n){try{if(!Array.isArray(e))throw new Xe("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)mp(Cn(t),Cn(e),n||!0);else{n=n||Bd;for(var i=0;i<e.length;i++)n(e[i],i,t,void 0)}}catch(r){if(r instanceof Xe)return r;throw r}}function ac(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),i=Array.isArray(t),r,s,o;if(n&&i){if(s=e.length,s!=t.length)return!1;for(r=s;r--!==0;)if(!ac(e[r],t[r]))return!1;return!0}if(n!=i)return!1;var a=Object.keys(e);if(s=a.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!t.hasOwnProperty(a[r]))return!1;for(r=s;r--!==0;)if(o=a[r],!ac(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}const tP=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:Xe,_areEquals:ac,applyOperation:_o,applyPatch:mp,applyReducer:eP,deepClone:QL,getValueByPointer:Id,validate:qk,validator:Bd},Symbol.toStringTag,{value:"Module"}));/*!
7
- * https://github.com/Starcounter-Jack/JSON-Patch
8
- * (c) 2017-2021 Joachim Wester
9
- * MIT license
10
- */var nb=new WeakMap,nP=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),iP=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function rP(e){return nb.get(e)}function sP(e,t){return e.observers.get(t)}function oP(e,t){e.observers.delete(t.callback)}function aP(e,t){t.unobserve()}function uP(e,t){var n=[],i,r=rP(e);if(!r)r=new nP(e),nb.set(e,r);else{var s=sP(r,t);i=s&&s.observer}if(i)return i;if(i={},r.value=Cn(e),t){i.callback=t,i.next=null;var o=function(){X0(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=n,i.object=e,i.unobserve=function(){X0(i),clearTimeout(i.next),oP(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new iP(t,i)),i}function X0(e,t){t===void 0&&(t=!1);var n=nb.get(e.object);ib(n.value,e.object,e.patches,"",t),e.patches.length&&mp(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function ib(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=H0(t),o=H0(e),a=!1,u=o.length-1;u>=0;u--){var l=o[u],c=e[l];if(W0(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?ib(c,f,n,i+"/"+ho(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+ho(l),value:Cn(c)}),n.push({op:"replace",path:i+"/"+ho(l),value:Cn(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+ho(l),value:Cn(c)}),n.push({op:"remove",path:i+"/"+ho(l)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&s.length==o.length))for(var u=0;u<s.length;u++){var l=s[u];!W0(e,l)&&t[l]!==void 0&&n.push({op:"add",path:i+"/"+ho(l),value:Cn(t[l])})}}}function lP(e,t,n){n===void 0&&(n=!1);var i=[];return ib(e,t,i,"",n),i}const cP=Object.freeze(Object.defineProperty({__proto__:null,compare:lP,generate:X0,observe:uP,unobserve:aP},Symbol.toStringTag,{value:"Module"}));Object.assign({},tP,cP,{JsonPatchError:jk,deepClone:Cn,escapePathComponent:ho,unescapePathComponent:Uk});var fP=/("(?:[^\\"]|\\.)*")|[:,]/g,dP=function(t,n){var i,r,s;return n=n||{},i=JSON.stringify([1],void 0,n.indent===void 0?2:n.indent).slice(2,-3),r=i===""?1/0:n.maxLength===void 0?80:n.maxLength,s=n.replacer,function o(a,u,l){var c,f,d,h,p,g,m,y,b,v,x,E;if(a&&typeof a.toJSON=="function"&&(a=a.toJSON()),x=JSON.stringify(a,s),x===void 0)return x;if(m=r-u.length-l,x.length<=m&&(b=x.replace(fP,function(S,w){return w||S+" "}),b.length<=m))return b;if(s!=null&&(a=JSON.parse(x),s=void 0),typeof a=="object"&&a!==null){if(y=u+i,d=[],f=0,Array.isArray(a))for(v="[",c="]",m=a.length;f<m;f++)d.push(o(a[f],y,f===m-1?0:1)||"null");else for(v="{",c="}",g=Object.keys(a),m=g.length;f<m;f++)h=g[f],p=JSON.stringify(h)+": ",E=o(a[h],y,p.length+(f===m-1?0:1)),E!==void 0&&d.push(p+E);if(d.length>0)return[v,i+d.join(`,
11
- `+y),c].join(`
12
- `+u)}return x}(t,"",0)};const bm=zk(dP);function En(e,t,n){return e.fields=t||[],e.fname=n,e}function Je(e){return e==null?null:e.fname}function Bt(e){return e==null?null:e.fields}function Wk(e){return e.length===1?hP(e[0]):pP(e)}const hP=e=>function(t){return t[e]},pP=e=>{const t=e.length;return function(n){for(let i=0;i<t;++i)n=n[e[i]];return n}};function N(e){throw Error(e)}function or(e){const t=[],n=e.length;let i=null,r=0,s="",o,a,u;e=e+"";function l(){t.push(s+e.substring(o,a)),s="",o=a+1}for(o=a=0;a<n;++a)if(u=e[a],u==="\\")s+=e.substring(o,a++),o=a;else if(u===i)l(),i=null,r=-1;else{if(i)continue;o===r&&u==='"'||o===r&&u==="'"?(o=a+1,i=u):u==="."&&!r?a>o?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||N("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&N("Access path missing closing bracket: "+e),i&&N("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Yn(e,t,n){const i=or(e);return e=i.length===1?i[0]:e,En((n&&n.get||Wk)(i),[e],t||e)}const Lc=Yn("id"),Wt=En(e=>e,[],"identity"),cs=En(()=>0,[],"zero"),Cu=En(()=>1,[],"one"),Rn=En(()=>!0,[],"true"),ns=En(()=>!1,[],"false");function gP(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const Hk=0,rb=1,sb=2,Gk=3,Vk=4;function ob(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gP,i=e||Hk;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=rb&&n(t||"error","ERROR",arguments),this},warn(){return i>=sb&&n(t||"warn","WARN",arguments),this},info(){return i>=Gk&&n(t||"log","INFO",arguments),this},debug(){return i>=Vk&&n(t||"log","DEBUG",arguments),this}}}var L=Array.isArray;function X(e){return e===Object(e)}const CE=e=>e!=="__proto__";function Fu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((i,r)=>{for(const s in r)if(s==="signals")i.signals=mP(i.signals,r.signals);else{const o=s==="legend"?{layout:1}:s==="style"?!0:null;Tu(i,s,r[s],o)}return i},{})}function Tu(e,t,n,i){if(!CE(t))return;let r,s;if(X(n)&&!L(n)){s=X(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Tu(s,r,n[r]):CE(r)&&(s[r]=n[r])}else e[t]=n}function mP(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function xe(e){return e[e.length-1]}function zt(e){return e==null||e===""?null:+e}const Xk=e=>t=>e*Math.exp(t),Yk=e=>t=>Math.log(e*t),Kk=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),Jk=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Ud=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function yp(e,t,n,i){const r=n(e[0]),s=n(xe(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function Qk(e,t){return yp(e,t,zt,Wt)}function Zk(e,t){var n=Math.sign(e[0]);return yp(e,t,Yk(n),Xk(n))}function eC(e,t,n){return yp(e,t,Ud(n),Ud(1/n))}function tC(e,t,n){return yp(e,t,Kk(n),Jk(n))}function bp(e,t,n,i,r){const s=i(e[0]),o=i(xe(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function ab(e,t,n){return bp(e,t,n,zt,Wt)}function ub(e,t,n){const i=Math.sign(e[0]);return bp(e,t,n,Yk(i),Xk(i))}function jd(e,t,n,i){return bp(e,t,n,Ud(i),Ud(1/i))}function lb(e,t,n,i){return bp(e,t,n,Kk(i),Jk(i))}function nC(e){return 1+~~(new Date(e).getMonth()/3)}function iC(e){return 1+~~(new Date(e).getUTCMonth()/3)}function Y(e){return e!=null?L(e)?e:[e]:[]}function rC(e,t,n){let i=e[0],r=e[1],s;return r<i&&(s=r,r=i,i=s),s=r-i,s>=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function fe(e){return typeof e=="function"}const yP="descending";function cb(e,t,n){n=n||{},t=Y(t)||[];const i=[],r=[],s={},o=n.comparator||bP;return Y(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===yP?-1:1),r.push(a=fe(a)?a:Yn(a,null,n)),(Bt(a)||[]).forEach(l=>s[l]=1))}),r.length===0?null:En(o(r,i),Object.keys(s))}const vp=(e,t)=>(e<t||e==null)&&t!=null?-1:(e>t||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),bP=(e,t)=>e.length===1?vP(e[0],t[0]):xP(e,t,e.length),vP=(e,t)=>function(n,i){return vp(e(n),e(i))*t},xP=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++a<n;)s=e[a],o=vp(s(i),s(r));return o*t[a]});function Ht(e){return fe(e)?e:()=>e}function fb(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function ce(e){for(let t,n,i=1,r=arguments.length;i<r;++i){t=arguments[i];for(n in t)e[n]=t[n]}return e}function Ji(e,t){let n=0,i,r,s,o;if(e&&(i=e.length))if(t==null){for(r=e[n];n<i&&(r==null||r!==r);r=e[++n]);for(s=o=r;n<i;++n)r=e[n],r!=null&&(r<s&&(s=r),r>o&&(o=r))}else{for(r=t(e[n]);n<i&&(r==null||r!==r);r=t(e[++n]));for(s=o=r;n<i;++n)r=t(e[n]),r!=null&&(r<s&&(s=r),r>o&&(o=r))}return[s,o]}function sC(e,t){const n=e.length;let i=-1,r,s,o,a,u;if(t==null){for(;++i<n;)if(s=e[i],s!=null&&s>=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)s=e[i],s!=null&&(r>s&&(r=s,a=i),o<s&&(o=s,u=i))}else{for(;++i<n;)if(s=t(e[i],i,e),s!=null&&s>=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++i<n;)s=t(e[i],i,e),s!=null&&(r>s&&(r=s,a=i),o<s&&(o=s,u=i))}return[a,u]}const wP=Object.prototype.hasOwnProperty;function J(e,t){return wP.call(e,t)}const kf={};function Mu(e){let t={},n;function i(s){return J(t,s)&&t[s]!==kf}const r={size:0,empty:0,object:t,has:i,get(s){return i(s)?t[s]:void 0},set(s,o){return i(s)||(++r.size,t[s]===kf&&--r.empty),t[s]=o,this},delete(s){return i(s)&&(--r.size,++r.empty,t[s]=kf),this},clear(){r.size=r.empty=0,r.object=t={}},test(s){return arguments.length?(n=s,r):n},clean(){const s={};let o=0;for(const a in t){const u=t[a];u!==kf&&(!n||!n(u))&&(s[a]=u,++o)}r.size=o,r.empty=0,r.object=t=s}};return e&&Object.keys(e).forEach(s=>{r.set(s,e[s])}),r}function oC(e,t,n,i,r,s){if(!n&&n!==0)return s;const o=+n;let a=e[0],u=xe(e),l;u<a&&(l=a,a=u,u=l),l=Math.abs(t-a);const c=Math.abs(u-t);return l<c&&l<=o?i:c<=o?r:s}function G(e,t,n){const i=e.prototype=Object.create(t.prototype);return Object.defineProperty(i,"constructor",{value:e,writable:!0,enumerable:!0,configurable:!0}),ce(i,n)}function Da(e,t,n,i){let r=t[0],s=t[t.length-1],o;return r>s&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:r<e)&&(i?e<=s:e<s)}function js(e){return typeof e=="boolean"}function ws(e){return Object.prototype.toString.call(e)==="[object Date]"}function aC(e){return e&&fe(e[Symbol.iterator])}function $e(e){return typeof e=="number"}function uC(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function K(e){return typeof e=="string"}function db(e,t,n){e&&(e=t?Y(e).map(a=>a.replace(/\\(.)/g,"$1")):Y(e));const i=e&&e.length,r=n&&n.get||Wk,s=a=>r(t?[a]:or(a));let o;if(!i)o=function(){return""};else if(i===1){const a=s(e[0]);o=function(u){return""+a(u)}}else{const a=e.map(s);o=function(u){let l=""+a[0](u),c=0;for(;++c<i;)l+="|"+a[c](u);return l}}return En(o,e,"key")}function lC(e,t){const n=e[0],i=xe(e),r=+t;return r?r===1?i:n+r*(i-n):n}const EP=1e4;function cC(e){e=+e||EP;let t,n,i;const r=()=>{t={},n={},i=0},s=(o,a)=>(++i>e&&(n=t,t={},i=1),t[o]=a);return r(),{clear:r,has:o=>J(t,o)||J(n,o),get:o=>J(t,o)?t[o]:J(n,o)?s(o,n[o]):void 0,set:(o,a)=>J(t,o)?t[o]=a:s(o,a)}}function fC(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=i||new t.constructor(r+s);let a=0,u=0,l=0;for(;a<r&&u<s;++l)o[l]=e(t[a],n[u])>0?n[u++]:t[a++];for(;a<r;++a,++l)o[l]=t[a];for(;u<s;++u,++l)o[l]=n[u];return o}function Sl(e,t){let n="";for(;--t>=0;)n+=e;return n}function dC(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:i==="left"?Sl(r,o)+s:i==="center"?Sl(r,~~(o/2))+s+Sl(r,Math.ceil(o/2)):s+Sl(r,o)}function Pc(e){return e&&xe(e)-e[0]||0}function H(e){return L(e)?"["+e.map(H)+"]":X(e)||K(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function hb(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const SP=e=>$e(e)||ws(e)?e:Date.parse(e);function pb(e,t){return t=t||SP,e==null||e===""?null:t(e)}function gb(e){return e==null||e===""?null:e+""}function yi(e){const t={},n=e.length;for(let i=0;i<n;++i)t[e[i]]=!0;return t}function hC(e,t,n,i){const r=i??"…",s=e+"",o=s.length,a=Math.max(0,t-r.length);return o<=t?s:n==="left"?r+s.slice(o-a):n==="center"?s.slice(0,Math.ceil(a/2))+r+s.slice(o-~~(a/2)):s.slice(0,a)+r}function ss(e,t,n){if(e)if(t){const i=e.length;for(let r=0;r<i;++r){const s=t(e[r]);s&&n(s,r,e)}}else e.forEach(n)}var FE={},vm={},xm=34,Zu=10,wm=13;function pC(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function _P(e,t){var n=pC(e);return function(i,r){return t(n(i),r,e)}}function TE(e){var t=Object.create(null),n=[];return e.forEach(function(i){for(var r in i)r in t||n.push(t[r]=r)}),n}function cn(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function $P(e){return e<0?"-"+cn(-e,6):e>9999?"+"+cn(e,6):cn(e,4)}function AP(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":$P(e.getUTCFullYear())+"-"+cn(e.getUTCMonth()+1,2)+"-"+cn(e.getUTCDate(),2)+(r?"T"+cn(t,2)+":"+cn(n,2)+":"+cn(i,2)+"."+cn(r,3)+"Z":i?"T"+cn(t,2)+":"+cn(n,2)+":"+cn(i,2)+"Z":n||t?"T"+cn(t,2)+":"+cn(n,2)+"Z":"")}function kP(e){var t=new RegExp('["'+e+`
13
- \r]`),n=e.charCodeAt(0);function i(f,d){var h,p,g=r(f,function(m,y){if(h)return h(m,y-1);p=m,h=d?_P(m,d):pC(m)});return g.columns=p||[],g}function r(f,d){var h=[],p=f.length,g=0,m=0,y,b=p<=0,v=!1;f.charCodeAt(p-1)===Zu&&--p,f.charCodeAt(p-1)===wm&&--p;function x(){if(b)return vm;if(v)return v=!1,FE;var S,w=g,_;if(f.charCodeAt(w)===xm){for(;g++<p&&f.charCodeAt(g)!==xm||f.charCodeAt(++g)===xm;);return(S=g)>=p?b=!0:(_=f.charCodeAt(g++))===Zu?v=!0:_===wm&&(v=!0,f.charCodeAt(g)===Zu&&++g),f.slice(w+1,S-1).replace(/""/g,'"')}for(;g<p;){if((_=f.charCodeAt(S=g++))===Zu)v=!0;else if(_===wm)v=!0,f.charCodeAt(g)===Zu&&++g;else if(_!==n)continue;return f.slice(w,S)}return b=!0,f.slice(w,p)}for(;(y=x())!==vm;){for(var E=[];y!==FE&&y!==vm;)E.push(y),y=x();d&&(E=d(E,m++))==null||h.push(E)}return h}function s(f,d){return f.map(function(h){return d.map(function(p){return c(h[p])}).join(e)})}function o(f,d){return d==null&&(d=TE(f)),[d.map(c).join(e)].concat(s(f,d)).join(`
14
- `)}function a(f,d){return d==null&&(d=TE(f)),s(f,d).join(`
15
- `)}function u(f){return f.map(l).join(`
16
- `)}function l(f){return f.map(c).join(e)}function c(f){return f==null?"":f instanceof Date?AP(f):t.test(f+="")?'"'+f.replace(/"/g,'""')+'"':f}return{parse:i,parseRows:r,format:o,formatBody:a,formatRows:u,formatRow:l,formatValue:c}}function CP(e){return e}function FP(e){if(e==null)return CP;var t,n,i=e.scale[0],r=e.scale[1],s=e.translate[0],o=e.translate[1];return function(a,u){u||(t=n=0);var l=2,c=a.length,f=new Array(c);for(f[0]=(t+=a[0])*i+s,f[1]=(n+=a[1])*r+o;l<c;)f[l]=a[l],++l;return f}}function TP(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function MP(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return ME(e,n)})}:ME(e,t)}function ME(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,s=gC(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:s}:i==null?{type:"Feature",id:n,properties:r,geometry:s}:{type:"Feature",id:n,bbox:i,properties:r,geometry:s}}function gC(e,t){var n=FP(e.transform),i=e.arcs;function r(c,f){f.length&&f.pop();for(var d=i[c<0?~c:c],h=0,p=d.length;h<p;++h)f.push(n(d[h],h));c<0&&TP(f,p)}function s(c){return n(c)}function o(c){for(var f=[],d=0,h=c.length;d<h;++d)r(c[d],f);return f.length<2&&f.push(f[0]),f}function a(c){for(var f=o(c);f.length<4;)f.push(f[0]);return f}function u(c){return c.map(a)}function l(c){var f=c.type,d;switch(f){case"GeometryCollection":return{type:f,geometries:c.geometries.map(l)};case"Point":d=s(c.coordinates);break;case"MultiPoint":d=c.coordinates.map(s);break;case"LineString":d=o(c.arcs);break;case"MultiLineString":d=c.arcs.map(o);break;case"Polygon":d=u(c.arcs);break;case"MultiPolygon":d=c.arcs.map(u);break;default:return null}return{type:f,coordinates:d}}return l(t)}function DP(e,t){var n={},i={},r={},s=[],o=-1;t.forEach(function(l,c){var f=e.arcs[l<0?~l:l],d;f.length<3&&!f[1][0]&&!f[1][1]&&(d=t[++o],t[o]=l,t[c]=d)}),t.forEach(function(l){var c=a(l),f=c[0],d=c[1],h,p;if(h=r[f])if(delete r[h.end],h.push(l),h.end=d,p=i[d]){delete i[p.start];var g=p===h?h:h.concat(p);i[g.start=h.start]=r[g.end=p.end]=g}else i[h.start]=r[h.end]=h;else if(h=i[d])if(delete i[h.start],h.unshift(l),h.start=f,p=r[f]){delete r[p.end];var m=p===h?h:p.concat(h);i[m.start=p.start]=r[m.end=h.end]=m}else i[h.start]=r[h.end]=h;else h=[l],i[h.start=f]=r[h.end=d]=h});function a(l){var c=e.arcs[l<0?~l:l],f=c[0],d;return e.transform?(d=[0,0],c.forEach(function(h){d[0]+=h[0],d[1]+=h[1]})):d=c[c.length-1],l<0?[d,f]:[f,d]}function u(l,c){for(var f in l){var d=l[f];delete c[d.start],delete d.start,delete d.end,d.forEach(function(h){n[h<0?~h:h]=1}),s.push(d)}}return u(r,i),u(i,r),t.forEach(function(l){n[l<0?~l:l]||s.push([l])}),s}function OP(e){return gC(e,RP.apply(this,arguments))}function RP(e,t,n){var i,r,s;if(arguments.length>1)i=NP(e,t,n);else for(r=0,i=new Array(s=e.arcs.length);r<s;++r)i[r]=r;return{type:"MultiLineString",arcs:DP(e,i)}}function NP(e,t,n){var i=[],r=[],s;function o(f){var d=f<0?~f:f;(r[d]||(r[d]=[])).push({i:f,g:s})}function a(f){f.forEach(o)}function u(f){f.forEach(a)}function l(f){f.forEach(u)}function c(f){switch(s=f,f.type){case"GeometryCollection":f.geometries.forEach(c);break;case"LineString":a(f.arcs);break;case"MultiLineString":case"Polygon":u(f.arcs);break;case"MultiPolygon":l(f.arcs);break}}return c(t),r.forEach(n==null?function(f){i.push(f[0].i)}:function(f){n(f[0].g,f[f.length-1].g)&&i.push(f[0].i)}),i}function LP(e,t){let n=0,i,r=0,s=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(i=o-r,r+=i/++n,s+=i*(o-r));else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,s+=i*(a-r))}if(n>1)return s/(n-1)}function PP(e,t){const n=LP(e,t);return n&&Math.sqrt(n)}class nn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r<this._n&&r<32;r++){const s=n[r],o=t+s,a=Math.abs(t)<Math.abs(s)?t-(o-s):s-(o-t);a&&(n[i++]=a),t=o}return n[i]=t,this._n=i+1,this}valueOf(){const t=this._partials;let n=this._n,i,r,s,o=0;if(n>0){for(o=t[--n];n>0&&(i=o,r=t[--n],o=i+r,s=r-(o-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=o+r,r==i-o&&(o=i))}return o}}class DE extends Map{constructor(t,n=bC){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(Y0(this,t))}has(t){return super.has(Y0(this,t))}set(t,n){return super.set(mC(this,t),n)}delete(t){return super.delete(yC(this,t))}}class qd extends Set{constructor(t,n=bC){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(Y0(this,t))}add(t){return super.add(mC(this,t))}delete(t){return super.delete(yC(this,t))}}function Y0({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function mC({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function yC({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function bC(e){return e!==null&&typeof e=="object"?e.valueOf():e}function zP(e,t){return Array.from(t,n=>e[n])}function IP(e=oc){if(e===oc)return vC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function vC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function $o(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n<i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function K0(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function xC(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?vC:IP(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(i,Math.floor(t+(u-l)*f/u+d));xC(e,t,h,p,r)}const s=e[t];let o=n,a=i;for(el(e,n,t),r(e[i],s)>0&&el(e,n,i);o<a;){for(el(e,o,a),++o,--a;r(e[o],s)<0;)++o;for(;r(e[a],s)>0;)--a}r(e[n],s)===0?el(e,n,a):(++a,el(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function el(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function J0(e,t,n){if(e=Float64Array.from(yL(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return K0(e);if(t>=1)return $o(e);var i,r=(i-1)*t,s=Math.floor(r),o=$o(xC(e,s).subarray(0,s+1)),a=K0(e.subarray(s+1));return o+(a-o)*(r-s)}}function wC(e,t,n=bL){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e),a=+n(e[s+1],s+1,e);return o+(a-o)*(r-s)}}function BP(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}function EC(e,t){return J0(e,.5,t)}function*UP(e){for(const t of e)yield*t}function SC(e){return Array.from(UP(e))}function Fn(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i<r;)s[i]=e+i*n;return s}function _C(e,t){let n=0;for(let i of e)(i=+i)&&(n+=i);return n}function jP(e,...t){e=new qd(e),t=t.map(qP);e:for(const n of e)for(const i of t)if(!i.has(n)){e.delete(n);continue e}return e}function qP(e){return e instanceof qd?e:new qd(e)}function WP(...e){const t=new qd;for(const n of e)for(const i of n)t.add(i);return t}const Em=new Date,Sm=new Date;function ut(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const o=r(s),a=r.ceil(s);return s-o<a-s?o:a},r.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),r.range=(s,o,a)=>{const u=[];if(s=r.ceil(s),a=a==null?1:Math.floor(a),!(s<o)||!(a>0))return u;let l;do u.push(l=new Date(+s)),t(s,a),e(s);while(l<s&&s<o);return u},r.filter=s=>ut(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(r.count=(s,o)=>(Em.setTime(+s),Sm.setTime(+o),e(Em),e(Sm),Math.floor(n(Em,Sm))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?o=>i(o)%s===0:o=>r.count(0,o)%s===0):r)),r}const Xa=ut(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Xa.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ut(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Xa);Xa.range;const kr=1e3,qn=kr*60,Cr=qn*60,Br=Cr*24,mb=Br*7,OE=Br*30,_m=Br*365,Fr=ut(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*kr)},(e,t)=>(t-e)/kr,e=>e.getUTCSeconds());Fr.range;const xp=ut(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*kr)},(e,t)=>{e.setTime(+e+t*qn)},(e,t)=>(t-e)/qn,e=>e.getMinutes());xp.range;const wp=ut(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qn)},(e,t)=>(t-e)/qn,e=>e.getUTCMinutes());wp.range;const Ep=ut(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*kr-e.getMinutes()*qn)},(e,t)=>{e.setTime(+e+t*Cr)},(e,t)=>(t-e)/Cr,e=>e.getHours());Ep.range;const Sp=ut(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Cr)},(e,t)=>(t-e)/Cr,e=>e.getUTCHours());Sp.range;const Or=ut(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qn)/Br,e=>e.getDate()-1);Or.range;const Es=ut(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Br,e=>e.getUTCDate()-1);Es.range;const $C=ut(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Br,e=>Math.floor(e/Br));$C.range;function Qo(e){return ut(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*qn)/mb)}const Du=Qo(0),Wd=Qo(1),HP=Qo(2),GP=Qo(3),Ya=Qo(4),VP=Qo(5),XP=Qo(6);Du.range;Wd.range;HP.range;GP.range;Ya.range;VP.range;XP.range;function Zo(e){return ut(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/mb)}const Ou=Zo(0),Hd=Zo(1),YP=Zo(2),KP=Zo(3),Ka=Zo(4),JP=Zo(5),QP=Zo(6);Ou.range;Hd.range;YP.range;KP.range;Ka.range;JP.range;QP.range;const uc=ut(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());uc.range;const lc=ut(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());lc.range;const Qi=ut(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Qi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ut(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Qi.range;const Zi=ut(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Zi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ut(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Zi.range;function AC(e,t,n,i,r,s){const o=[[Fr,1,kr],[Fr,5,5*kr],[Fr,15,15*kr],[Fr,30,30*kr],[s,1,qn],[s,5,5*qn],[s,15,15*qn],[s,30,30*qn],[r,1,Cr],[r,3,3*Cr],[r,6,6*Cr],[r,12,12*Cr],[i,1,Br],[i,2,2*Br],[n,1,mb],[t,1,OE],[t,3,3*OE],[e,1,_m]];function a(l,c,f){const d=c<l;d&&([l,c]=[c,l]);const h=f&&typeof f.range=="function"?f:u(l,c,f),p=h?h.range(l,+c+1):[];return d?p.reverse():p}function u(l,c,f){const d=Math.abs(c-l)/f,h=fp(([,,m])=>m).right(o,d);if(h===o.length)return e.every(Oo(l/_m,c/_m,f));if(h===0)return Xa.every(Math.max(Oo(l,c,f),1));const[p,g]=o[d/o[h-1][2]<o[h][2]/d?h-1:h];return p.every(g)}return[a,u]}const[ZP,ez]=AC(Zi,lc,Ou,$C,Sp,wp),[tz,nz]=AC(Qi,uc,Du,Or,Ep,xp),At="year",mn="quarter",Ut="month",st="week",yn="date",Lt="day",er="dayofyear",Nn="hours",Ln="minutes",Kn="seconds",bi="milliseconds",yb=[At,mn,Ut,st,yn,Lt,er,Nn,Ln,Kn,bi],$m=yb.reduce((e,t,n)=>(e[t]=1+n,e),{});function bb(e){const t=Y(e).slice(),n={};return t.length||N("Missing time unit."),t.forEach(r=>{J($m,r)?n[r]=1:N(`Invalid time unit: ${r}.`)}),(n[st]||n[Lt]?1:0)+(n[mn]||n[Ut]||n[yn]?1:0)+(n[er]?1:0)>1&&N(`Incompatible time units: ${e}`),t.sort((r,s)=>$m[r]-$m[s]),t}const iz={[At]:"%Y ",[mn]:"Q%q ",[Ut]:"%b ",[yn]:"%d ",[st]:"W%U ",[Lt]:"%a ",[er]:"%j ",[Nn]:"%H:00",[Ln]:"00:%M",[Kn]:":%S",[bi]:".%L",[`${At}-${Ut}`]:"%Y-%m ",[`${At}-${Ut}-${yn}`]:"%Y-%m-%d ",[`${Nn}-${Ln}`]:"%H:%M"};function kC(e,t){const n=ce({},iz,t),i=bb(e),r=i.length;let s="",o=0,a,u;for(o=0;o<r;)for(a=i.length;a>o;--a)if(u=i.slice(o,a).join("-"),n[u]!=null){s+=n[u],o=a;break}return s.trim()}const mo=new Date;function vb(e){return mo.setFullYear(e),mo.setMonth(0),mo.setDate(1),mo.setHours(0,0,0,0),mo}function CC(e){return TC(new Date(e))}function FC(e){return Q0(new Date(e))}function TC(e){return Or.count(vb(e.getFullYear())-1,e)}function Q0(e){return Du.count(vb(e.getFullYear())-1,e)}function Z0(e){return vb(e).getDay()}function rz(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function MC(e){return OC(new Date(e))}function DC(e){return e1(new Date(e))}function OC(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Es.count(t-1,e)}function e1(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Ou.count(t-1,e)}function t1(e){return mo.setTime(Date.UTC(e,0,1)),mo.getUTCDay()}function sz(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,s,o));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,s,o))}function RC(e,t,n,i,r){const s=t||1,o=xe(e),a=(y,b,v)=>(v=v||y,oz(n[v],i[v],y===o&&s,b)),u=new Date,l=yi(e),c=l[At]?a(At):Ht(2012),f=l[Ut]?a(Ut):l[mn]?a(mn):cs,d=l[st]&&l[Lt]?a(Lt,1,st+Lt):l[st]?a(st,1):l[Lt]?a(Lt,1):l[yn]?a(yn,1):l[er]?a(er,1):Cu,h=l[Nn]?a(Nn):cs,p=l[Ln]?a(Ln):cs,g=l[Kn]?a(Kn):cs,m=l[bi]?a(bi):cs;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),p(u),g(u),m(u))}}function oz(e,t,n,i){const r=n<=1?e:i?(s,o)=>i+n*Math.floor((e(s,o)-i)/n):(s,o)=>n*Math.floor(e(s,o)/n);return t?(s,o)=>t(r(s,o),o):r}function Ja(e,t,n){return t+e*7-(n+6)%7}const az={[At]:e=>e.getFullYear(),[mn]:e=>Math.floor(e.getMonth()/3),[Ut]:e=>e.getMonth(),[yn]:e=>e.getDate(),[Nn]:e=>e.getHours(),[Ln]:e=>e.getMinutes(),[Kn]:e=>e.getSeconds(),[bi]:e=>e.getMilliseconds(),[er]:e=>TC(e),[st]:e=>Q0(e),[st+Lt]:(e,t)=>Ja(Q0(e),e.getDay(),Z0(t)),[Lt]:(e,t)=>Ja(1,e.getDay(),Z0(t))},uz={[mn]:e=>3*e,[st]:(e,t)=>Ja(e,0,Z0(t))};function NC(e,t){return RC(e,t||1,az,uz,rz)}const lz={[At]:e=>e.getUTCFullYear(),[mn]:e=>Math.floor(e.getUTCMonth()/3),[Ut]:e=>e.getUTCMonth(),[yn]:e=>e.getUTCDate(),[Nn]:e=>e.getUTCHours(),[Ln]:e=>e.getUTCMinutes(),[Kn]:e=>e.getUTCSeconds(),[bi]:e=>e.getUTCMilliseconds(),[er]:e=>OC(e),[st]:e=>e1(e),[Lt]:(e,t)=>Ja(1,e.getUTCDay(),t1(t)),[st+Lt]:(e,t)=>Ja(e1(e),e.getUTCDay(),t1(t))},cz={[mn]:e=>3*e,[st]:(e,t)=>Ja(e,0,t1(t))};function LC(e,t){return RC(e,t||1,lz,cz,sz)}const fz={[At]:Qi,[mn]:uc.every(3),[Ut]:uc,[st]:Du,[yn]:Or,[Lt]:Or,[er]:Or,[Nn]:Ep,[Ln]:xp,[Kn]:Fr,[bi]:Xa},dz={[At]:Zi,[mn]:lc.every(3),[Ut]:lc,[st]:Ou,[yn]:Es,[Lt]:Es,[er]:Es,[Nn]:Sp,[Ln]:wp,[Kn]:Fr,[bi]:Xa};function Ru(e){return fz[e]}function Nu(e){return dz[e]}function PC(e,t,n){return e?e.offset(t,n):void 0}function zC(e,t,n){return PC(Ru(e),t,n)}function IC(e,t,n){return PC(Nu(e),t,n)}function BC(e,t,n,i){return e?e.range(t,n,i):void 0}function UC(e,t,n,i){return BC(Ru(e),t,n,i)}function jC(e,t,n,i){return BC(Nu(e),t,n,i)}const _l=1e3,$l=_l*60,Al=$l*60,_p=Al*24,hz=_p*7,RE=_p*30,n1=_p*365,qC=[At,Ut,yn,Nn,Ln,Kn,bi],kl=qC.slice(0,-1),Cl=kl.slice(0,-1),Fl=Cl.slice(0,-1),pz=Fl.slice(0,-1),gz=[At,st],NE=[At,Ut],WC=[At],tl=[[kl,1,_l],[kl,5,5*_l],[kl,15,15*_l],[kl,30,30*_l],[Cl,1,$l],[Cl,5,5*$l],[Cl,15,15*$l],[Cl,30,30*$l],[Fl,1,Al],[Fl,3,3*Al],[Fl,6,6*Al],[Fl,12,12*Al],[pz,1,_p],[gz,1,hz],[NE,1,RE],[NE,3,3*RE],[WC,1,n1]];function HC(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Pc(t))/n;let r=fp(a=>a[2]).right(tl,i),s,o;return r===tl.length?(s=WC,o=Oo(t[0]/n1,t[1]/n1,n)):r?(r=tl[i/tl[r-1][2]<tl[r][2]/i?r-1:r],s=r[0],o=r[1]):(s=qC,o=Math.max(Oo(t[0],t[1],n),1)),{units:s,step:o}}function Am(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function km(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function nl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function GC(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,s=e.days,o=e.shortDays,a=e.months,u=e.shortMonths,l=il(r),c=rl(r),f=il(s),d=rl(s),h=il(o),p=rl(o),g=il(a),m=rl(a),y=il(u),b=rl(u),v={a:P,A:z,b:U,B:te,c:null,d:UE,e:UE,f:zz,g:Xz,G:Kz,H:Nz,I:Lz,j:Pz,L:VC,m:Iz,M:Bz,p:ne,q:de,Q:WE,s:HE,S:Uz,u:jz,U:qz,V:Wz,w:Hz,W:Gz,x:null,X:null,y:Vz,Y:Yz,Z:Jz,"%":qE},x={a:Se,A:we,b:Pe,B:Di,c:null,d:jE,e:jE,f:tI,g:fI,G:hI,H:Qz,I:Zz,j:eI,L:YC,m:nI,M:iI,p:Zs,q:es,Q:WE,s:HE,S:rI,u:sI,U:oI,V:aI,w:uI,W:lI,x:null,X:null,y:cI,Y:dI,Z:pI,"%":qE},E={a:C,A:T,b:O,B:k,c:F,d:IE,e:IE,f:Mz,g:zE,G:PE,H:BE,I:BE,j:kz,L:Tz,m:Az,M:Cz,p:$,q:$z,Q:Oz,s:Rz,S:Fz,u:xz,U:wz,V:Ez,w:vz,W:Sz,x:A,X:M,y:zE,Y:PE,Z:_z,"%":Dz};v.x=S(n,v),v.X=S(i,v),v.c=S(t,v),x.x=S(n,x),x.X=S(i,x),x.c=S(t,x);function S(Q,he){return function(ge){var W=[],vt=-1,Te=0,Tt=Q.length,ct,Oi,Af;for(ge instanceof Date||(ge=new Date(+ge));++vt<Tt;)Q.charCodeAt(vt)===37&&(W.push(Q.slice(Te,vt)),(Oi=LE[ct=Q.charAt(++vt)])!=null?ct=Q.charAt(++vt):Oi=ct==="e"?" ":"0",(Af=he[ct])&&(ct=Af(ge,Oi)),W.push(ct),Te=vt+1);return W.push(Q.slice(Te,vt)),W.join("")}}function w(Q,he){return function(ge){var W=nl(1900,void 0,1),vt=_(W,Q,ge+="",0),Te,Tt;if(vt!=ge.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(he&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(Te=km(nl(W.y,0,1)),Tt=Te.getUTCDay(),Te=Tt>4||Tt===0?Hd.ceil(Te):Hd(Te),Te=Es.offset(Te,(W.V-1)*7),W.y=Te.getUTCFullYear(),W.m=Te.getUTCMonth(),W.d=Te.getUTCDate()+(W.w+6)%7):(Te=Am(nl(W.y,0,1)),Tt=Te.getDay(),Te=Tt>4||Tt===0?Wd.ceil(Te):Wd(Te),Te=Or.offset(Te,(W.V-1)*7),W.y=Te.getFullYear(),W.m=Te.getMonth(),W.d=Te.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),Tt="Z"in W?km(nl(W.y,0,1)).getUTCDay():Am(nl(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Tt+5)%7:W.w+W.U*7-(Tt+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,km(W)):Am(W)}}function _(Q,he,ge,W){for(var vt=0,Te=he.length,Tt=ge.length,ct,Oi;vt<Te;){if(W>=Tt)return-1;if(ct=he.charCodeAt(vt++),ct===37){if(ct=he.charAt(vt++),Oi=E[ct in LE?he.charAt(vt++):ct],!Oi||(W=Oi(Q,ge,W))<0)return-1}else if(ct!=ge.charCodeAt(W++))return-1}return W}function $(Q,he,ge){var W=l.exec(he.slice(ge));return W?(Q.p=c.get(W[0].toLowerCase()),ge+W[0].length):-1}function C(Q,he,ge){var W=h.exec(he.slice(ge));return W?(Q.w=p.get(W[0].toLowerCase()),ge+W[0].length):-1}function T(Q,he,ge){var W=f.exec(he.slice(ge));return W?(Q.w=d.get(W[0].toLowerCase()),ge+W[0].length):-1}function O(Q,he,ge){var W=y.exec(he.slice(ge));return W?(Q.m=b.get(W[0].toLowerCase()),ge+W[0].length):-1}function k(Q,he,ge){var W=g.exec(he.slice(ge));return W?(Q.m=m.get(W[0].toLowerCase()),ge+W[0].length):-1}function F(Q,he,ge){return _(Q,t,he,ge)}function A(Q,he,ge){return _(Q,n,he,ge)}function M(Q,he,ge){return _(Q,i,he,ge)}function P(Q){return o[Q.getDay()]}function z(Q){return s[Q.getDay()]}function U(Q){return u[Q.getMonth()]}function te(Q){return a[Q.getMonth()]}function ne(Q){return r[+(Q.getHours()>=12)]}function de(Q){return 1+~~(Q.getMonth()/3)}function Se(Q){return o[Q.getUTCDay()]}function we(Q){return s[Q.getUTCDay()]}function Pe(Q){return u[Q.getUTCMonth()]}function Di(Q){return a[Q.getUTCMonth()]}function Zs(Q){return r[+(Q.getUTCHours()>=12)]}function es(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var he=S(Q+="",v);return he.toString=function(){return Q},he},parse:function(Q){var he=w(Q+="",!1);return he.toString=function(){return Q},he},utcFormat:function(Q){var he=S(Q+="",x);return he.toString=function(){return Q},he},utcParse:function(Q){var he=w(Q+="",!0);return he.toString=function(){return Q},he}}}var LE={"-":"",_:" ",0:"0"},yt=/^\s*\d+/,mz=/^%/,yz=/[\\^$*+?|[\]().{}]/g;function Ae(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s<n?new Array(n-s+1).join(t)+r:r)}function bz(e){return e.replace(yz,"\\$&")}function il(e){return new RegExp("^(?:"+e.map(bz).join("|")+")","i")}function rl(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function vz(e,t,n){var i=yt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function xz(e,t,n){var i=yt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function wz(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Ez(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function Sz(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function PE(e,t,n){var i=yt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function zE(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function _z(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function $z(e,t,n){var i=yt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function Az(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function IE(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function kz(e,t,n){var i=yt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function BE(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Cz(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Fz(e,t,n){var i=yt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Tz(e,t,n){var i=yt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Mz(e,t,n){var i=yt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Dz(e,t,n){var i=mz.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Oz(e,t,n){var i=yt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Rz(e,t,n){var i=yt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function UE(e,t){return Ae(e.getDate(),t,2)}function Nz(e,t){return Ae(e.getHours(),t,2)}function Lz(e,t){return Ae(e.getHours()%12||12,t,2)}function Pz(e,t){return Ae(1+Or.count(Qi(e),e),t,3)}function VC(e,t){return Ae(e.getMilliseconds(),t,3)}function zz(e,t){return VC(e,t)+"000"}function Iz(e,t){return Ae(e.getMonth()+1,t,2)}function Bz(e,t){return Ae(e.getMinutes(),t,2)}function Uz(e,t){return Ae(e.getSeconds(),t,2)}function jz(e){var t=e.getDay();return t===0?7:t}function qz(e,t){return Ae(Du.count(Qi(e)-1,e),t,2)}function XC(e){var t=e.getDay();return t>=4||t===0?Ya(e):Ya.ceil(e)}function Wz(e,t){return e=XC(e),Ae(Ya.count(Qi(e),e)+(Qi(e).getDay()===4),t,2)}function Hz(e){return e.getDay()}function Gz(e,t){return Ae(Wd.count(Qi(e)-1,e),t,2)}function Vz(e,t){return Ae(e.getFullYear()%100,t,2)}function Xz(e,t){return e=XC(e),Ae(e.getFullYear()%100,t,2)}function Yz(e,t){return Ae(e.getFullYear()%1e4,t,4)}function Kz(e,t){var n=e.getDay();return e=n>=4||n===0?Ya(e):Ya.ceil(e),Ae(e.getFullYear()%1e4,t,4)}function Jz(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ae(t/60|0,"0",2)+Ae(t%60,"0",2)}function jE(e,t){return Ae(e.getUTCDate(),t,2)}function Qz(e,t){return Ae(e.getUTCHours(),t,2)}function Zz(e,t){return Ae(e.getUTCHours()%12||12,t,2)}function eI(e,t){return Ae(1+Es.count(Zi(e),e),t,3)}function YC(e,t){return Ae(e.getUTCMilliseconds(),t,3)}function tI(e,t){return YC(e,t)+"000"}function nI(e,t){return Ae(e.getUTCMonth()+1,t,2)}function iI(e,t){return Ae(e.getUTCMinutes(),t,2)}function rI(e,t){return Ae(e.getUTCSeconds(),t,2)}function sI(e){var t=e.getUTCDay();return t===0?7:t}function oI(e,t){return Ae(Ou.count(Zi(e)-1,e),t,2)}function KC(e){var t=e.getUTCDay();return t>=4||t===0?Ka(e):Ka.ceil(e)}function aI(e,t){return e=KC(e),Ae(Ka.count(Zi(e),e)+(Zi(e).getUTCDay()===4),t,2)}function uI(e){return e.getUTCDay()}function lI(e,t){return Ae(Hd.count(Zi(e)-1,e),t,2)}function cI(e,t){return Ae(e.getUTCFullYear()%100,t,2)}function fI(e,t){return e=KC(e),Ae(e.getUTCFullYear()%100,t,2)}function dI(e,t){return Ae(e.getUTCFullYear()%1e4,t,4)}function hI(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ka(e):Ka.ceil(e),Ae(e.getUTCFullYear()%1e4,t,4)}function pI(){return"+0000"}function qE(){return"%"}function WE(e){return+e}function HE(e){return Math.floor(+e/1e3)}var ma,xb,JC,wb,QC;gI({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function gI(e){return ma=GC(e),xb=ma.format,JC=ma.parse,wb=ma.utcFormat,QC=ma.utcParse,ma}function Tl(e){const t={};return n=>t[n]||(t[n]=e(n))}function mI(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=yI(i,r);const o=s<i.length?i.slice(s):"";for(;--s>r;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+o}}function yI(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function ZC(e){const t=Tl(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=j0(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return mI(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,o){o=j0(o??",f");const a=Oo(i,r,s),u=Math.max(Math.abs(i),Math.abs(r));let l;if(o.precision==null)switch(o.type){case"s":return isNaN(l=EL(a,u))||(o.precision=l),n(o,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=wL(a,u))||(o.precision=l-(o.type==="e"));break}case"f":case"%":{isNaN(l=xL(a))||(o.precision=l-(o.type==="%")*2);break}}return t(o)}}}let i1;eF();function eF(){return i1=ZC({format:Ik,formatPrefix:SL})}function tF(e){return ZC(vL(e))}function Gd(e){return arguments.length?i1=tF(e):i1}function GE(e,t,n){n=n||{},X(n)||N(`Invalid time multi-format specifier: ${n}`);const i=t(Kn),r=t(Ln),s=t(Nn),o=t(yn),a=t(st),u=t(Ut),l=t(mn),c=t(At),f=e(n[bi]||".%L"),d=e(n[Kn]||":%S"),h=e(n[Ln]||"%I:%M"),p=e(n[Nn]||"%I %p"),g=e(n[yn]||n[Lt]||"%a %d"),m=e(n[st]||"%b %d"),y=e(n[Ut]||"%B"),b=e(n[mn]||"%B"),v=e(n[At]||"%Y");return x=>(i(x)<x?f:r(x)<x?d:s(x)<x?h:o(x)<x?p:u(x)<x?a(x)<x?g:m:c(x)<x?l(x)<x?y:b:v)(x)}function nF(e){const t=Tl(e.format),n=Tl(e.utcFormat);return{timeFormat:i=>K(i)?t(i):GE(t,Ru,i),utcFormat:i=>K(i)?n(i):GE(n,Nu,i),timeParse:Tl(e.parse),utcParse:Tl(e.utcParse)}}let r1;iF();function iF(){return r1=nF({format:xb,parse:JC,utcFormat:wb,utcParse:QC})}function rF(e){return nF(GC(e))}function cc(e){return arguments.length?r1=rF(e):r1}const s1=(e,t)=>ce({},e,t);function sF(e,t){const n=e?tF(e):Gd(),i=t?rF(t):cc();return s1(n,i)}function Eb(e,t){const n=arguments.length;return n&&n!==2&&N("defaultLocale expects either zero or two arguments."),n?s1(Gd(e),cc(t)):s1(Gd(),cc())}function bI(){return eF(),iF(),Eb()}const vI=/^(data:|([A-Za-z]+:)?\/\/)/,xI=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,wI=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,VE="file://";function EI(e,t){return n=>({options:n||{},sanitize:_I,load:SI,fileAccess:!!t,file:$I(t),http:kI(e)})}async function SI(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function _I(e,t){t=ce({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=xI.test(e.replace(wI,""));(e==null||typeof e!="string"||!a)&&N("Sanitize failure, invalid URI: "+H(e));const u=vI.test(e);return(o=t.baseURL)&&!u&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),s=(r=e.startsWith(VE))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(VE.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function $I(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,s)=>{r?i(r):n(s)})}):AI}async function AI(){N("No file system access.")}function kI(e){return e?async function(t,n){const i=ce({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?fe(s[r])?s[r]():s.text():N(s.status+""+s.statusText)}:CI}async function CI(){N("No HTTP fetch method available.")}const FI=e=>e!=null&&e===e,TI=e=>e==="true"||e==="false"||e===!0||e===!1,MI=e=>!Number.isNaN(Date.parse(e)),oF=e=>!Number.isNaN(+e)&&!(e instanceof Date),DI=e=>oF(e)&&Number.isInteger(+e),o1={boolean:hb,integer:zt,number:zt,date:pb,string:gb,unknown:Wt},Cf=[TI,DI,oF,MI],OI=["boolean","integer","number","date"];function aF(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=Cf.length,r=Cf.map((s,o)=>o+1);for(let s=0,o=0,a,u;s<n;++s)for(u=t?e[s][t]:e[s],a=0;a<i;++a)if(r[a]&&FI(u)&&!Cf[a](u)&&(r[a]=0,++o,o===Cf.length))return"string";return OI[r.reduce((s,o)=>s===0?o:s,0)-1]}function uF(e,t){return t.reduce((n,i)=>(n[i]=aF(e,i),n),{})}function XE(e){const t=function(n,i){const r={delimiter:e};return Sb(n,i?ce(i,r):r)};return t.responseType="text",t}function Sb(e,t){return t.header&&(e=t.header.map(H).join(t.delimiter)+`
17
- `+e),kP(t.delimiter).parse(e+"")}Sb.responseType="text";function RI(e){return typeof Buffer=="function"&&fe(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function _b(e,t){const n=t&&t.property?Yn(t.property):Wt;return X(e)&&!RI(e)?NI(n(e),t):n(JSON.parse(e))}_b.responseType="json";function NI(e,t){return!L(e)&&aC(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const LI={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function lF(e,t){let n,i,r,s;return e=_b(e,t),t&&t.feature?(n=MP,r=t.feature):t&&t.mesh?(n=OP,r=t.mesh,s=LI[t.filter]):N("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):N("Invalid TopoJSON object: "+r),i&&i.features||[i]}lF.responseType="json";const dd={dsv:Sb,csv:XE(","),tsv:XE(" "),json:_b,topojson:lF};function $b(e,t){return arguments.length>1?(dd[e]=t,this):J(dd,e)?dd[e]:null}function cF(e){const t=$b(e);return t&&t.responseType||"text"}function fF(e,t,n,i){t=t||{};const r=$b(t.type||"json");return r||N("Unknown data format type: "+t.type),e=r(e,t),t.parse&&PI(e,t.parse,n,i),J(e,"columns")&&delete e.columns,e}function PI(e,t,n,i){if(!e.length)return;const r=cc();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,u,l,c,f;t==="auto"&&(t=uF(e,s)),s=Object.keys(t);const d=s.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!o1[p])throw Error("Illegal format pattern: "+h+":"+p);return o1[p]});for(u=0,c=e.length,f=s.length;u<c;++u)for(o=e[u],l=0;l<f;++l)a=s[l],o[a]=d[l](o[a])}const $p=EI(typeof fetch<"u"&&fetch,null);function Ap(e){const t=e||Wt,n=[],i={};return n.add=r=>{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function hd(e,t){try{await t(e)}catch(n){e.error(n)}}const dF=Symbol("vega_id");let zI=1;function kp(e){return!!(e&&re(e))}function re(e){return e[dF]}function hF(e,t){return e[dF]=t,e}function Ce(e){const t=e===Object(e)?e:{data:e};return re(t)?t:hF(t,zI++)}function Ab(e){return Cp(e,Ce({}))}function Cp(e,t){for(const n in e)t[n]=e[n];return t}function pF(e,t){return hF(t,re(e))}function ea(e,t){return e?t?(n,i)=>e(n,i)||re(t(n))-re(t(i)):(n,i)=>e(n,i)||re(n)-re(i):null}function gF(e){return e&&e.constructor===ta}function ta(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:ta,insert(a){const u=Y(a),l=u.length;for(let c=0;c<l;++c)e.push(u[c]);return this},remove(a){const u=fe(a)?i:t,l=Y(a),c=l.length;for(let f=0;f<c;++f)u.push(l[f]);return this},modify(a,u,l){const c={field:u,value:Ht(l)};return fe(a)?(c.filter=a,r.push(c)):(c.tuple=a,n.push(c)),this},encode(a,u){return fe(a)?r.push({filter:a,field:u}):n.push({tuple:a,field:u}),this},clean(a){return s=a,this},reflow(){return o=!0,this},pulse(a,u){const l={},c={};let f,d,h,p,g,m;for(f=0,d=u.length;f<d;++f)l[re(u[f])]=1;for(f=0,d=t.length;f<d;++f)g=t[f],l[re(g)]=-1;for(f=0,d=i.length;f<d;++f)p=i[f],u.forEach(b=>{p(b)&&(l[re(b)]=-1)});for(f=0,d=e.length;f<d;++f)g=e[f],m=re(g),l[m]?l[m]=1:a.add.push(Ce(e[f]));for(f=0,d=u.length;f<d;++f)g=u[f],l[re(g)]<0&&a.rem.push(g);function y(b,v,x){x?b[v]=x(b):a.encode=v,o||(c[re(b)]=b)}for(f=0,d=n.length;f<d;++f)h=n[f],g=h.tuple,p=h.field,m=l[re(g)],m>0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f<d;++f)h=r[f],p=h.filter,u.forEach(b=>{p(b)&&l[re(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(o)a.mod=t.length||i.length?u.filter(b=>l[re(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const pd="_:mod:_";function Fp(){Object.defineProperty(this,pd,{writable:!0,value:{}})}Fp.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[pd];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=L(n)?1+n.length:-1),r},modified(e,t){const n=this[pd];if(arguments.length){if(L(e)){for(let i=0;i<e.length;++i)if(n[e[i]])return!0;return!1}}else{for(const i in n)if(n[i])return!0;return!1}return t!=null&&t>=0?t+1<n[e]||!!n[t+":"+e]:!!n[e]},clear(){return this[pd]={},this}};let II=0;const BI="pulse",UI=new Fp,jI=1,qI=2;function ze(e,t,n,i){this.id=++II,this.value=e,this.stamp=-1,this.rank=-1,this.qrank=-1,this.flags=0,t&&(this._update=t),n&&this.parameters(n,i)}function YE(e){return function(t){const n=this.flags;return arguments.length===0?!!(n&e):(this.flags=t?n|e:n&~e,this)}}ze.prototype={targets(){return this._targets||(this._targets=Ap(Lc))},set(e){return this.value!==e?(this.value=e,1):0},skip:YE(jI),modified:YE(qI),parameters(e,t,n){t=t!==!1;const i=this._argval=this._argval||new Fp,r=this._argops=this._argops||[],s=[];let o,a,u,l;const c=(f,d,h)=>{h instanceof ze?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(o in e)if(a=e[o],o===BI)Y(a).forEach(f=>{f instanceof ze?f!==this&&(f.targets().add(this),s.push(f)):N("Pulse parameters must be operator instances.")}),this.source=a;else if(L(a))for(i.set(o,-1,Array(u=a.length)),l=0;l<u;++l)c(o,l,a[l]);else c(o,-1,a);return this.marshall().clear(),n&&(r.initonly=!0),s},marshall(e){const t=this._argval||UI,n=this._argops;let i,r,s,o;if(n){const a=n.length;for(r=0;r<a;++r)i=n[r],s=i.op,o=s.modified()&&s.stamp===e,t.set(i.name,i.index,s.value,o);if(n.initonly){for(r=0;r<a;++r)i=n[r],i.op.targets().remove(this);this._argops=null,this._update=null}}return t},detach(){const e=this._argops;let t,n,i,r;if(e)for(t=0,n=e.length;t<n;++t)i=e[t],r=i.op,r._targets&&r._targets.remove(this);this.pulse=null,this.source=null},evaluate(e){const t=this._update;if(t){const n=this.marshall(e.stamp),i=t.call(this,n,e);if(n.clear(),i!==this.value)this.value=i;else if(!this.modified())return e.StopPropagation}},run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?(this.skip(!1),t=0):t=this.evaluate(e),this.pulse=t||e}};function WI(e,t,n,i){let r=1,s;return e instanceof ze?s=e:e&&e.prototype instanceof ze?s=new e:fe(e)?s=new ze(null,e):(r=0,s=new ze(e,t)),this.rank(s),r&&(i=n,n=t),n&&this.connect(s,s.parameters(n,i)),this.touch(s),s}function HI(e,t){const n=e.rank,i=t.length;for(let r=0;r<i;++r)if(n<t[r].rank){this.rerank(e);return}}let GI=0;function Tp(e,t,n){this.id=++GI,this.value=null,n&&(this.receive=n),e&&(this._filter=e),t&&(this._apply=t)}function is(e,t,n){return new Tp(e,t,n)}Tp.prototype={_filter:Rn,_apply:Wt,targets(){return this._targets||(this._targets=Ap(Lc))},consume(e){return arguments.length?(this._consume=!!e,this):!!this._consume},receive(e){if(this._filter(e)){const t=this.value=this._apply(e),n=this._targets,i=n?n.length:0;for(let r=0;r<i;++r)n[r].receive(t);this._consume&&(e.preventDefault(),e.stopPropagation())}},filter(e){const t=is(e);return this.targets().add(t),t},apply(e){const t=is(null,e);return this.targets().add(t),t},merge(){const e=is();this.targets().add(e);for(let t=0,n=arguments.length;t<n;++t)arguments[t].targets().add(e);return e},throttle(e){let t=-1;return this.filter(()=>{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=is();return this.targets().add(is(null,null,fb(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(is(null,null,()=>n=!0)),t.targets().add(is(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Rn,this._targets=null}};function VI(e,t,n,i){const r=this,s=is(n,i),o=function(l){l.dataflow=r;try{s.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=Y(e);const u=a.length;for(let l=0;l<u;++l)a[l].addEventListener(t,o);return s}function XI(e,t){const n=this.locale();return fF(e,t,n.timeParse,n.utcParse)}function YI(e,t,n){return t=this.parse(t,n),this.pulse(e,this.changeset().insert(t))}async function KI(e,t){const n=this;let i=0,r;try{r=await n.loader().load(e,{context:"dataflow",response:cF(t&&t.type)});try{r=n.parse(r,t)}catch(s){i=-2,n.warn("Data ingestion failed",e,s)}}catch(s){i=-1,n.warn("Loading failed",e,s)}return{data:r,status:i}}async function JI(e,t,n){const i=this,r=i._pending||QI(i);r.requests+=1;const s=await i.request(t,n);return i.pulse(e,i.changeset().remove(Rn).insert(s.data||[])),r.done(),s}function QI(e){let t;const n=new Promise(i=>t=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const ZI={skip:!0};function e4(e,t,n,i,r){return(e instanceof ze?n4:t4)(this,e,t,n,i,r),this}function t4(e,t,n,i,r,s){const o=ce({},s,ZI);let a,u;fe(n)||(n=Ht(n)),i===void 0?a=l=>e.touch(n(l)):fe(i)?(u=new ze(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;gF(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=l=>e.update(n(l),i,o),t.apply(a)}function n4(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new ze(null,i4(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function i4(e,t){return t=fe(t)?t:Ht(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function r4(e){e.rank=++this._rank}function s4(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&N("Cycle detected in dataflow graph.")}const Vd={},Ii=1,os=2,Er=4,o4=Ii|os,KE=Ii|Er,ya=Ii|os|Er,JE=8,sl=16,QE=32,ZE=64;function Ss(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function Cm(e,t){const n=[];return ss(e,t,i=>n.push(i)),n}function eS(e,t){const n={};return e.visit(t,i=>{n[re(i)]=1}),i=>n[re(i)]?null:i}function Ff(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}Ss.prototype={StopPropagation:Vd,ADD:Ii,REM:os,MOD:Er,ADD_REM:o4,ADD_MOD:KE,ALL:ya,REFLOW:JE,SOURCE:sl,NO_SOURCE:QE,NO_FIELDS:ZE,fork(e){return new Ss(this.dataflow).init(this,e)},clone(){const e=this.fork(ya);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(ya|sl)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new Ss(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&ZE)&&(n.fields=e.fields),t&Ii?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&os?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Er?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&QE?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||ya;return t&Ii&&this.add.length||t&os&&this.rem.length||t&Er&&this.mod.length},reflow(e){if(e)return this.fork(ya).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Er,eS(this,Ii))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return L(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?L(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Ii&&(n.addF=Ff(n.addF,t)),e&os&&(n.remF=Ff(n.remF,t)),e&Er&&(n.modF=Ff(n.modF,t)),e&sl&&(n.srcF=Ff(n.srcF,t)),n},materialize(e){e=e||ya;const t=this;return e&Ii&&t.addF&&(t.add=Cm(t.add,t.addF),t.addF=null),e&os&&t.remF&&(t.rem=Cm(t.rem,t.remF),t.remF=null),e&Er&&t.modF&&(t.mod=Cm(t.mod,t.modF),t.modF=null),e&sl&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&sl)return ss(n.source,n.srcF,i),n;e&Ii&&ss(n.add,n.addF,i),e&os&&ss(n.rem,n.remF,i),e&Er&&ss(n.mod,n.modF,i);const r=n.source;if(e&JE&&r){const s=n.add.length+n.mod.length;s===r.length||(s?ss(r,eS(n,KE),i):ss(r,n.srcF,i))}return n}};function kb(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const u in o.fields)a[u]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}G(kb,Ss,{fork(e){const t=new Ss(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?L(e)?e.some(i=>n[i]):n[e]:0},filter(){N("MultiPulse does not support filtering.")},materialize(){N("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;s<r;++s)i[s].visit(e,t);else for(;s<r;++s)i[s].stamp===n.stamp&&i[s].visit(e,t);return n}});async function a4(e,t,n){const i=this,r=[];if(i._pulse)return mF(i);if(i._pending&&await i._pending,t&&await hd(i,t),!i._touched.length)return i.debug("Dataflow invoked, but nothing to do."),i;const s=++i._clock;i._pulse=new Ss(i,s,e),i._touched.forEach(c=>i._enqueue(c,!0)),i._touched=Ap(Lc);let o=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=Vd),u!==Vd&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;f<c.length;++f)await hd(i,c[f].callback)}return n&&await hd(i,n),r.length&&Promise.all(r).then(c=>i.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function u4(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function l4(e,t,n){return this._pulse?mF(this):(this.evaluate(e,t,n),this)}function c4(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function mF(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function f4(e,t){const n=e.stamp<this._clock;n&&(e.stamp=this._clock),(n||t)&&(e.qrank=e.rank,this._heap.push(e))}function d4(e,t){const n=e.source,i=this._clock;return n&&L(n)?new kb(this,i,n.map(r=>r.pulse),t):this._input[e.id]||h4(this._pulse,n&&n.pulse)}function h4(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Vd&&(e.source=t.source),e)}const Cb={skip:!1,force:!1};function p4(e,t){const n=t||Cb;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function g4(e,t,n){const i=n||Cb;return(e.set(t)||i.force)&&this.touch(e,i),this}function m4(e,t,n){this.touch(e,n||Cb);const i=new Ss(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function y4(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),yF(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,b4(t,0,e)):i=n,i}}}function yF(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function b4(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o<r;)a=o+1,a<r&&n(e[o],e[a])>=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,yF(e,i,t,n)}function za(){this.logger(ob()),this.logLevel(rb),this._clock=0,this._rank=0,this._locale=Eb();try{this._loader=$p()}catch{}this._touched=Ap(Lc),this._input={},this._pulse=null,this._heap=y4((e,t)=>e.qrank-t.qrank),this._postrun=[]}function ol(e){return function(){return this._log[e].apply(this,arguments)}}za.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:ol("error"),warn:ol("warn"),info:ol("info"),debug:ol("debug"),logLevel:ol("level"),cleanThreshold:1e4,add:WI,connect:HI,rank:r4,rerank:s4,pulse:m4,touch:p4,update:g4,changeset:ta,ingest:YI,parse:XI,preload:JI,request:KI,events:VI,on:e4,evaluate:a4,run:l4,runAsync:u4,runAfter:c4,_enqueue:f4,_getPulse:d4};function D(e,t){ze.call(this,e,null,t)}G(D,ze,{run(e){if(e.stamp<this.stamp)return e.StopPropagation;let t;return this.skip()?this.skip(!1):t=this.evaluate(e),t=t||e,t.then?t=t.then(n=>this.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const Qa={};function bF(e){const t=vF(e);return t&&t.Definition||null}function vF(e){return e=e&&e.toLowerCase(),J(Qa,e)?Qa[e]:null}function*xF(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function Fb(e,t,n){const i=Float64Array.from(xF(e,n));return i.sort(oc),t.map(r=>wC(i,r))}function Tb(e,t){return Fb(e,[.25,.5,.75],t)}function Mb(e,t){const n=e.length,i=PP(e,t),r=Tb(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function wF(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,u,l,c,f,d;const h=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;f<d&&e.steps[f]<c;++f);a=e.steps[Math.max(0,f-1)]}else{for(u=Math.ceil(Math.log(t)/i),l=e.minstep||0,a=Math.max(l,Math.pow(n,Math.round(Math.log(h)/i)-u));Math.ceil(h/a)>t;)a*=n;for(f=0,d=r.length;f<d;++f)c=a/r[f],c>=l&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+g)*a,s=s<c?c-a:c,o=Math.ceil(o/a)*a),{start:s,stop:o===s?s+a:o,step:a}}var Jn=Math.random;function v4(e){Jn=e}function EF(e,t,n,i){if(!e.length)return[void 0,void 0];const r=Float64Array.from(xF(e,i)),s=r.length,o=t;let a,u,l,c;for(l=0,c=Array(o);l<o;++l){for(a=0,u=0;u<s;++u)a+=r[~~(Jn()*s)];c[l]=a/s}return c.sort(oc),[J0(c,n/2),J0(c,1-n/2)]}function SF(e,t,n,i){i=i||(d=>d);const r=e.length,s=new Float64Array(r);let o=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a<r;++a){if(f=i(e[a]),f>=c){for(l=(u+l)/2;o<a;++o)s[o]=l;c=f+t,u=f}l=f}for(l=(u+l)/2;o<a;++o)s[o]=l;return n?x4(s,t+t/4):s}function x4(e,t){const n=e.length;let i=0,r=1,s,o;for(;e[i]===e[r];)++r;for(;r<n;){for(s=r+1;e[r]===e[s];)++s;if(e[r]-e[r-1]<t){for(o=r+(i+s-r-r>>1);o<r;)e[o++]=e[r];for(;o>r;)e[o--]=e[i]}i=r,r=s}return e}function w4(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function E4(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*Jn())},pdf(o){return o===Math.floor(o)&&o>=n&&o<i?1/r:0},cdf(o){const a=Math.floor(o);return a<n?0:a>=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const _F=Math.sqrt(2*Math.PI),S4=Math.SQRT2;let al=NaN;function Mp(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(al===al)n=al,al=NaN;else{do n=Jn()*2-1,i=Jn()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,al=i*s}return e+n*t}function Db(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*_F)}function Dp(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function Op(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*S4*_4(2*e-1)}function _4(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function Ob(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>Mp(n,i),pdf:s=>Db(s,n,i),cdf:s=>Dp(s,n,i),icdf:s=>Op(s,n,i)};return r.mean(e).stdev(t)}function Rb(e,t){const n=Ob();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=Mb(e)),r):t},sample(){return e[~~(Jn()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;a<i;++a)o+=n.pdf((s-e[a])/t);return o/t/i},cdf(s){let o=0,a=0;for(;a<i;++a)o+=n.cdf((s-e[a])/t);return o/i},icdf(){throw Error("KDE icdf not supported.")}};return r.data(e)}function Nb(e,t){return e=e||0,t=t??1,Math.exp(e+Mp()*t)}function Lb(e,t,n){if(e<=0)return 0;t=t||0,n=n??1;const i=(Math.log(e)-t)/n;return Math.exp(-.5*i*i)/(n*_F*e)}function Pb(e,t,n){return Dp(Math.log(e),t,n)}function zb(e,t,n){return Math.exp(Op(e,t,n))}function $F(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>Nb(n,i),pdf:s=>Lb(s,n,i),cdf:s=>Pb(s,n,i),icdf:s=>zb(s,n,i)};return r.mean(e).stdev(t)}function AF(e,t){let n=0,i;function r(o){const a=[];let u=0,l;for(l=0;l<n;++l)u+=a[l]=o[l]==null?1:+o[l];for(l=0;l<n;++l)a[l]/=u;return a}const s={weights(o){return arguments.length?(i=r(t=o||[]),s):t},distributions(o){return arguments.length?(o?(n=o.length,e=o):(n=0,e=[]),s.weights(t)):e},sample(){const o=Jn();let a=e[n-1],u=i[0],l=0;for(;l<n-1;u+=i[++l])if(o<u){a=e[l];break}return a.sample()},pdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].pdf(o);return a},cdf(o){let a=0,u=0;for(;u<n;++u)a+=i[u]*e[u].cdf(o);return a},icdf(){throw Error("Mixture icdf not supported.")}};return s.distributions(e).weights(t)}function Ib(e,t){return t==null&&(t=e??1,e=0),e+(t-e)*Jn()}function Bb(e,t,n){return n==null&&(n=t??1,t=0),e>=t&&e<=n?1/(n-t):0}function Ub(e,t,n){return n==null&&(n=t??1,t=0),e<t?0:e>n?1:(e-t)/(n-t)}function jb(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function kF(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>Ib(n,i),pdf:s=>Bb(s,n,i),cdf:s=>Ub(s,n,i),icdf:s=>jb(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function qb(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function zc(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function Rp(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a<r;++a)s[a]-=u,o[a]-=l;return[s,o,u,l]}function Ic(e,t,n,i){let r=-1,s,o;for(const a of e)s=t(a),o=n(a),s!=null&&(s=+s)>=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function Lu(e,t,n,i,r){let s=0,o=0;return Ic(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;s+=l*l,o+=c*c}),1-s/o}function Wb(e,t,n){let i=0,r=0,s=0,o=0,a=0;Ic(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=zc(i,r,s,o),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:Lu(e,t,n,r,l)}}function CF(e,t,n){let i=0,r=0,s=0,o=0,a=0;Ic(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=zc(i,r,s,o),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:Lu(e,t,n,r,l)}}function FF(e,t,n){const[i,r,s,o]=Rp(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,p;Ic(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,u+=(p-u)/f,l+=(p*h-l)/f,c+=(d*p-c)/f});const[g,m]=zc(u/o,a/o,l/o,c/o),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:Lu(e,t,n,o,y)}}function TF(e,t,n){let i=0,r=0,s=0,o=0,a=0,u=0;Ic(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++u,i+=(h-i)/u,r+=(p-r)/u,s+=(h*p-s)/u,o+=(h*h-o)/u,a+=(d-a)/u});const l=zc(i,r,s,o),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:Lu(e,t,n,a,c)}}function Hb(e,t,n){const[i,r,s,o]=Rp(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h<a;)p=i[h],g=r[h++],m=p*p,u+=(m-u)/h,l+=(m*p-l)/h,c+=(m*m-c)/h,f+=(p*g-f)/h,d+=(m*g-d)/h;const y=c-u*u,b=u*y-l*l,v=(d*u-f*l)/b,x=(f*y-d*l)/b,E=-v*u,S=w=>(w=w-s,v*w*w+x*w+E+o);return{coef:[E-x*s+v*s*s+o,x-2*v*s,v],predict:S,rSquared:Lu(e,t,n,o,S)}}function MF(e,t,n,i){if(i===0)return qb(e,t,n);if(i===1)return Wb(e,t,n);if(i===2)return Hb(e,t,n);const[r,s,o,a]=Rp(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d<f;++d){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d)*s[p];for(l.push(g),m=new Float64Array(f),h=0;h<f;++h){for(p=0,g=0;p<u;++p)g+=Math.pow(r[p],d+h);m[h]=g}c.push(m)}c.push(l);const y=A4(c),b=v=>{v-=o;let x=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d<f;++d)x+=y[d]*Math.pow(v,d);return x};return{coef:$4(f,y,-o,a),predict:b,rSquared:Lu(e,t,n,a,b)}}function $4(e,t,n,i){const r=Array(e);let s,o,a,u;for(s=0;s<e;++s)r[s]=0;for(s=e-1;s>=0;--s)for(a=t[s],u=1,r[s]+=a,o=1;o<=s;++o)u*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*u;return r[0]+=i,r}function A4(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;i<t;++i){for(o=i,r=i+1;r<t;++r)Math.abs(e[i][r])>Math.abs(e[i][o])&&(o=r);for(s=i;s<t+1;++s)a=e[s][i],e[s][i]=e[s][o],e[s][o]=a;for(r=i+1;r<t;++r)for(s=t;s>=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;s<t;++s)a+=e[s][r]*n[s];n[r]=(e[t][r]-a)/e[r][r]}return n}const tS=2,nS=1e-12;function DF(e,t,n,i){const[r,s,o,a]=Rp(e,t,n,!0),u=r.length,l=Math.max(2,~~(i*u)),c=new Float64Array(u),f=new Float64Array(u),d=new Float64Array(u).fill(1);for(let h=-1;++h<=tS;){const p=[0,l-1];for(let m=0;m<u;++m){const y=r[m],b=p[0],v=p[1],x=y-r[b]>r[v]-y?b:v;let E=0,S=0,w=0,_=0,$=0;const C=1/Math.abs(r[x]-y||1);for(let k=b;k<=v;++k){const F=r[k],A=s[k],M=k4(Math.abs(y-F)*C)*d[k],P=F*M;E+=M,S+=P,w+=A*M,_+=A*P,$+=F*P}const[T,O]=zc(S/E,w/E,_/E,$/E);c[m]=T+O*y,f[m]=Math.abs(s[m]-c[m]),C4(r,m+1,p)}if(h===tS)break;const g=EC(f);if(Math.abs(g)<nS)break;for(let m=0,y,b;m<u;++m)y=f[m]/(6*g),d[m]=y>=1?nS:(b=1-y*y)*b}return F4(r,c,o,a)}function k4(e){return(e=1-e*e*e)*e*e}function C4(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function F4(e,t,n,i){const r=e.length,s=[];let o=0,a=0,u=[],l;for(;o<r;++o)l=e[o]+n,u[0]===l?u[1]+=(t[o]-u[1])/++a:(a=0,u[1]+=i,u=[l,t[o]],s.push(u));return u[1]+=i,s}const T4=.5*Math.PI/180;function Np(e,t,n,i){n=n||25,i=Math.max(n,i||200);const r=g=>[g,e(g)],s=t[0],o=t[1],a=o-s,u=a/i,l=[r(s)],c=[];if(n===i){for(let g=1;g<i;++g)l.push(r(s+g/n*a));return l.push(r(o)),l}else{c.push(r(o));for(let g=n;--g>0;)c.push(r(s+g/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,p=M4(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&D4(f,g,d,h,p)>T4?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function M4(e,t){let n=e,i=e;const r=t.length;for(let s=0;s<r;++s){const o=t[s][1];o<n&&(n=o),o>i&&(i=o)}return 1/(i-n)}function D4(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function O4(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i<n;++i)r+="|"+e[i](t);return r}}function a1(e){return!e||!e.length?function(){return""}:e.length===1?e[0]:O4(e)}function OF(e,t,n){return n||e+(t?"_"+t:"")}const Fm=()=>{},R4={init:Fm,add:Fm,rem:Fm,idx:0},fc={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t<e.min||e.min===void 0)&&(e.min=t)},rem:(e,t)=>{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t<e.min&&(e.argmin=n)},rem:(e,t)=>{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},Bc=Object.keys(fc).filter(e=>e!=="__count__");function N4(e,t){return(n,i)=>ce({name:e,aggregate_param:i,out:n||e},R4,t)}[...Bc,"__count__"].forEach(e=>{fc[e]=N4(e,fc[e])});function RF(e,t,n){return fc[e](n,t)}function NF(e,t){return e.idx-t.idx}function L4(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=fc[r]())})};return e.forEach(n),Object.values(t).sort(NF)}function P4(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function z4(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function I4(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function B4(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function LF(e,t){const n=t||Wt,i=L4(e),r=e.slice().sort(NF);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=P4,s.prototype.add=z4,s.prototype.rem=I4,s.prototype.set=B4,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function Gb(e){this._key=e?Yn(e):re,this.reset()}const Ft=Gb.prototype;Ft.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null};Ft.add=function(e){this._add.push(e)};Ft.rem=function(e){this._rem.push(e)};Ft.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,u,l;for(a=0;a<r;++a)o[n(t[a])]=1;for(a=0,u=0;a<i;++a)o[n(l=e[a])]?o[n(l)]=0:s[u++]=l;return this._rem=[],this._add=s};Ft.distinct=function(e){const t=this.values(),n={};let i=t.length,r=0,s;for(;--i>=0;)s=e(t[i])+"",J(n,s)||(n[s]=1,++r);return r};Ft.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=sC(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext};Ft.argmin=function(e){return this.extent(e)[0]||{}};Ft.argmax=function(e){return this.extent(e)[1]||{}};Ft.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0};Ft.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0};Ft.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=Tb(this.values(),e),this._get=e),this._q};Ft.q1=function(e){return this.quartile(e)[0]};Ft.q2=function(e){return this.quartile(e)[1]};Ft.q3=function(e){return this.quartile(e)[2]};Ft.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=EF(this.values(),1e3,.05,e),this._get=e),this._ci};Ft.ci0=function(e){return this.ci(e)[0]};Ft.ci1=function(e){return this.ci(e)[1]};function ks(e){D.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}ks.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Bc},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]};G(ks,D,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l<r;++l)i[l][f=c[n[l]]]=f}s(e._prev),s(t);function o(a,u,l){const c=n[l],f=i[l++];for(const d in f){const h=a?a+"|"+d:d;u[c]=f[d],l<r?o(h,u,l):t[h]||e.cell(h,u)}}o("",{},0)},init(e){const t=this._inputs=[],n=this._outputs=[],i={};function r(b){const v=Y(Bt(b)),x=v.length;let E=0,S;for(;E<x;++E)i[S=v[E]]||(i[S]=1,t.push(S))}this._dims=Y(e.groupby),this._dnames=this._dims.map(b=>{const v=Je(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:a1(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=s.length,c={};let f,d,h,p,g,m,y;for(l!==o.length&&N("Unmatched number of fields and aggregate ops."),y=0;y<l;++y){if(f=s[y],d=o[y],h=a[y]||null,f==null&&d!=="count"&&N("Null aggregate field specified."),g=Je(f),m=OF(d,g,u[y]),n.push(m),d==="count"){this._counts.push(m);continue}p=c[g],p||(r(f),p=c[g]=[],p.field=f,this._measures.push(p)),d!=="count"&&(this._countOnly=!1),p.push(RF(d,h,m))}return this._measures=this._measures.map(b=>LF(b,b.field)),Object.create(null)},cellkey:a1(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp<this.stamp?(n.stamp=this.stamp,this._adds[this._alen++]=n):n.stamp<this.stamp&&(n.stamp=this.stamp,this._mods[this._mlen++]=n):(n=this.value[e]=this.newcell(e,t),this._adds[this._alen++]=n),n},newcell(e,t){const n={key:e,num:0,agg:null,tuple:this.newtuple(t,this._prev&&this._prev[e]),stamp:this.stamp,store:!1};if(!this._countOnly){const i=this._measures,r=i.length;n.agg=Array(r);for(let s=0;s<r;++s)n.agg[s]=new i[s](n)}return n.store&&(n.data=new Gb),n},newtuple(e,t){const n=this._dnames,i=this._dims,r=i.length,s={};for(let o=0;o<r;++o)s[n[o]]=i[o](e);return t?pF(t.tuple,s):Ce(s)},clean(){const e=this.value;for(const t in e)e[t].num===0&&delete e[t]},add(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num+=1,this._countOnly)return;n.store&&n.data.add(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].add(i[r].get(e),e)},rem(e){const t=this.cellkey(e),n=this.cell(t,e);if(n.num-=1,this._countOnly)return;n.store&&n.data.rem(e);const i=n.agg;for(let r=0,s=i.length;r<s;++r)i[r].rem(i[r].get(e),e)},celltuple(e){const t=e.tuple,n=this._counts;e.store&&e.data.values();for(let i=0,r=n.length;i<r;++i)t[n[i]]=e.num;if(!this._countOnly){const i=e.agg;for(let r=0,s=i.length;r<s;++r)i[r].set(t)}return t},changes(e){const t=this._adds,n=this._mods,i=this._prev,r=this._drop,s=e.add,o=e.rem,a=e.mod;let u,l,c,f;if(i)for(l in i)u=i[l],(!r||u.num)&&o.push(u.tuple);for(c=0,f=this._alen;c<f;++c)s.push(this.celltuple(t[c])),t[c]=null;for(c=0,f=this._mlen;c<f;++c)u=n[c],(u.num===0&&r?o:a).push(this.celltuple(u)),n[c]=null;return this._alen=this._mlen=0,this._prev=null,e}});const U4=1e-14;function Vb(e){D.call(this,null,e)}Vb.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]};G(Vb,D,{transform(e,t){const n=e.interval!==!1,i=this._bins(e),r=i.start,s=i.step,o=e.as||["bin0","bin1"],a=o[0],u=o[1];let l;return e.modified()?(t=t.reflow(!0),l=t.SOURCE):l=t.modified(Bt(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?c=>{const f=i(c);c[a]=f,c[u]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=wF(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const u=function(l){let c=zt(t(l));return c==null?null:c<r?-1/0:c>s?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(U4+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=En(u,Bt(t),e.name||"bin_"+Je(t))}});function PF(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:u=>s.push(u),remove:u=>o[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),l&&u&&r.sort(u),s.length&&(r=u?fC(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function Xb(e){D.call(this,[],e)}Xb.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]};G(Xb,D,{transform(e,t){const n=t.fork(t.ALL),i=PF(re,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(ea(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function zF(e){ze.call(this,null,j4,e)}G(zF,ze);function j4(e){return this.value&&!e.modified()?this.value:cb(e.fields,e.orders)}function Yb(e){D.call(this,null,e)}Yb.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function q4(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}G(Yb,D,{transform(e,t){const n=f=>d=>{for(var h=q4(a(d),e.case,s)||[],p,g=0,m=h.length;g<m;++g)o.test(p=h[g])||f(p)},i=this._parameterCheck(e,t),r=this._counts,s=this._match,o=this._stop,a=e.field,u=e.as||["text","count"],l=n(f=>r[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=Ce({}),u[r]=a,u[s]=l,o.add.push(u)):l===0?(u&&o.rem.push(u),n[a]=null,i[a]=null):u[s]!==l&&(u[s]=l,o.mod.push(u));return o.modifies(t)}});function Kb(e){D.call(this,null,e)}Kb.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]};G(Kb,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=W4(a,r,s,e.filter||Rn)):n.mod=a,n.source=this.value,n.modifies(i)}});function W4(e,t,n,i){for(var r=[],s={},o=e.length,a=0,u,l;a<o;++a)for(s[t]=l=e[a],u=0;u<o;++u)s[n]=e[u],i(s)&&(r.push(Ce(s)),s={},s[t]=l);return r}const iS={kde:Rb,mixture:AF,normal:Ob,lognormal:$F,uniform:kF},H4="distributions",rS="function",G4="field";function IF(e,t){const n=e[rS];J(iS,n)||N("Unknown distribution function: "+n);const i=iS[n]();for(const r in e)r===G4?i.data((e.from||t()).map(e[r])):r===H4?i[r](e[r].map(s=>IF(s,t))):typeof i[r]===rS&&i[r](e[r]);return i}function Jb(e){D.call(this,null,e)}const BF=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],V4={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:BF},{name:"weights",type:"number",array:!0}]};Jb.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:BF.concat(V4)},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(Jb,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=IF(e.distribution,X4(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&N("Invalid density method: "+o),!e.extent&&!i.data&&N("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],u=e.extent||Ji(i.data()),l=Np(o,u,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],Ce(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function X4(e){return()=>e.materialize(e.SOURCE).source}function UF(e,t){return e?e.map((n,i)=>t[i]||Je(n)):null}function Qb(e,t,n){const i=[],r=f=>f(u);let s,o,a,u,l,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;o<a;++o)u=e[o],l=t.map(r),c=s[l],c||(s[l]=c=[],c.dims=l,i.push(c)),c.push(n(u));return i}const jF="bin";function Zb(e){D.call(this,null,e)}Zb.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:jF}]};const Y4=(e,t)=>Pc(Ji(e,t))/30;G(Zb,D,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=Qb(t.source,e.groupby,Wt),r=e.smooth||!1,s=e.field,o=e.step||Y4(n,s),a=ea((p,g)=>s(p)-s(g)),u=e.as||jF,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;d<l;++d){const p=i[d].sort(a);h=-1;for(const g of SF(p,o,r,s))g<c&&(c=g),g>f&&(f=g),p[++h][u]=g}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(u)}});function qF(e){ze.call(this,null,K4,e),this.modified(!0)}G(qF,ze);function K4(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:En(n=>t(n,e),Bt(t),Je(t))}function ev(e){D.call(this,[void 0,void 0],e)}ev.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]};G(ev,D,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=zt(i(a));u!=null&&(u<s&&(s=u),u>o&&(o=u))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=Je(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function tv(e,t){ze.call(this,e),this.parent=t,this.count=0}G(tv,ze,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function Lp(e){D.call(this,{},e),this._keys=Mu();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;i<r;++i)n(t[i],i,t)}}G(Lp,D,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,i){const r=this.value;let s=J(r,e)&&r[e],o,a;return s?s.value.stamp<n.stamp&&(s.init(n),this.activate(s)):(a=i||(a=this._group[e])&&a.tuple,o=n.dataflow,s=new tv(n.fork(n.NO_SOURCE),this),o.add(s).connect(t(o,e,a)),r[e]=s,this.activate(s)),s},clean(){const e=this.value;let t=0;for(const n in e)if(e[n].count===0){const i=e[n].detachSubflow;i&&i(),delete e[n],++t}if(t){const n=this._targets.filter(i=>i&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;r<i;++r)t[r]=e[r];for(;r<n&&t[r]!=null;++r)t[r]=null;t.active=i},transform(e,t){const n=t.dataflow,i=e.key,r=e.subflow,s=this._keys,o=e.modified("key"),a=u=>this.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=re(u),c=s.get(l);c!==void 0&&(s.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);s.set(re(u),l),a(l).add(u)}),o||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=re(u),c=s.get(l),f=i(u);c===f?a(f).mod(u):(s.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(s.get(re(u))).mod(u)}),o&&t.visit(t.REFLOW,u=>{const l=re(u),c=s.get(l),f=i(u);c!==f&&(s.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function WF(e){ze.call(this,null,J4,e)}G(WF,ze);function J4(e){return this.value&&!e.modified()?this.value:L(e.name)?Y(e.name).map(t=>Yn(t)):Yn(e.name,e.as)}function nv(e){D.call(this,Mu(),e)}nv.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]};G(nv,D,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=re(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(re(f),1)});function c(f){const d=re(f),h=u(f,e),p=i.get(d);h&&p?(i.delete(d),s.push(f)):!h&&!p?(i.set(d,1),o.push(f)):l&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function iv(e){D.call(this,[],e)}iv.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]};G(iv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=UF(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(p=>p(a)),l=u.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c<l;++c){for(d=Ab(a),f=0;f<o;++f)d[r[f]]=(h=u[f][c])==null?null:h;s&&(d[s]=c),n.add.push(d)}}),this.value=n.source=n.add,s&&n.modifies(s),n.modifies(r)}});function rv(e){D.call(this,[],e)}rv.Definition={type:"Fold",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0,length:2,default:["key","value"]}]};G(rv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=i.map(Je),s=e.as||["key","value"],o=s[0],a=s[1],u=i.length;return n.rem=this.value,t.visit(t.SOURCE,l=>{for(let c=0,f;c<u;++c)f=Ab(l),f[o]=r[c],f[a]=i[c](l),n.add.push(f)}),this.value=n.source=n.add,n.modifies(s)}});function sv(e){D.call(this,null,e)}sv.Definition={type:"Formula",metadata:{modifies:!0},params:[{name:"expr",type:"expr",required:!0},{name:"as",type:"string",required:!0},{name:"initonly",type:"boolean"}]};G(sv,D,{transform(e,t){const n=e.expr,i=e.as,r=e.modified(),s=e.initonly?t.ADD:r?t.SOURCE:t.modified(n.fields)||t.modified(i)?t.ADD_MOD:t.ADD;return r&&(t=t.materialize().reflow(!0)),e.initonly||t.modifies(i),t.visit(s,o=>o[i]=n(o,e))}});function HF(e){D.call(this,[],e)}G(HF,D,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,u;if(s>0){for(o=[];--s>=0;)o.push(u=Ce(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const Tf={value:"value",median:EC,mean:BP,min:K0,max:$o},Q4=[];function ov(e){D.call(this,[],e)}ov.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function Z4(e){var t=e.method||Tf.value,n;if(Tf[t]==null)N("Unrecognized imputation method: "+t);else return t===Tf.value?(n=e.value!==void 0?e.value:0,()=>n):Tf[t]}function e9(e){const t=e.field;return n=>n?t(n):NaN}G(ov,D,{transform(e,t){var n=t.fork(t.ALL),i=Z4(e),r=e9(e),s=Je(e.field),o=Je(e.key),a=(e.groupby||[]).map(Je),u=t9(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,p,g,m,y,b,v,x,E;for(m=0,v=u.length;m<v;++m)for(d=u[m],p=d.values,h=NaN,b=0;b<f;++b)if(d[b]==null){for(g=u.domain[b],E={_impute:!0},y=0,x=p.length;y<x;++y)E[a[y]]=p[y];E[o]=g,E[s]=Number.isNaN(h)?h=i(d,r):h,l.push(Ce(E))}return l.length&&(n.add=n.materialize(n.ADD).add.concat(l)),c.length&&(n.rem=n.materialize(n.REM).rem.concat(c)),this.value=l,n}});function t9(e,t,n,i){var r=y=>y(m),s=[],o=i?i.slice():[],a={},u={},l,c,f,d,h,p,g,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;d<g;++d)m=e[d],p=n(m),h=a[p]||(a[p]=o.push(p)),c=(l=t?t.map(r):Q4)+"",(f=u[c])||(f=u[c]=[],s.push(f),f.values=l),f[h-1]=m;return s.domain=o,s}function av(e){ks.call(this,e)}av.Definition={type:"JoinAggregate",metadata:{modifies:!0},params:[{name:"groupby",type:"field",array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"ops",type:"enum",array:!0,values:Bc},{name:"as",type:"string",null:!0,array:!0},{name:"key",type:"field"}]};G(av,ks,{transform(e,t){const n=this,i=e.modified();let r;return n.value&&(i||t.modified(n._inputs,!0))?(r=n.value=i?n.init(e):{},t.visit(t.SOURCE,s=>n.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{ce(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n<i;++n)this.celltuple(e[n]),e[n]=null;for(n=0,i=this._mlen;n<i;++n)this.celltuple(t[n]),t[n]=null;this._alen=this._mlen=0}});function uv(e){D.call(this,null,e)}uv.Definition={type:"KDE",metadata:{generates:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"cumulative",type:"boolean",default:!1},{name:"counts",type:"boolean",default:!1},{name:"bandwidth",type:"number",default:0},{name:"extent",type:"number",array:!0,length:2},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"as",type:"string",array:!0,default:["value","density"]}]};G(uv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=Qb(i,e.groupby,e.field),s=(e.groupby||[]).map(Je),o=e.bandwidth,a=e.cumulative?"cdf":"pdf",u=e.as||["value","density"],l=[];let c=e.extent,f=e.steps||e.minsteps||25,d=e.steps||e.maxsteps||200;a!=="pdf"&&a!=="cdf"&&N("Invalid density method: "+a),e.resolve==="shared"&&(c||(c=Ji(i,e.field)),f=d=e.steps||d),r.forEach(h=>{const p=Rb(h,o)[a],g=e.counts?h.length:1,m=c||Ji(h);Np(p,m,f,d).forEach(y=>{const b={};for(let v=0;v<s.length;++v)b[s[v]]=h.dims[v];b[u[0]]=y[0],b[u[1]]=y[1]*g,l.push(Ce(b))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function GF(e){ze.call(this,null,n9,e)}G(GF,ze);function n9(e){return this.value&&!e.modified()?this.value:db(e.fields,e.flat)}function VF(e){D.call(this,[],e),this._pending=null}G(VF,D,{transform(e,t){const n=t.dataflow;return this._pending?Tm(this,t,this._pending):i9(e)?t.StopPropagation:e.values?Tm(this,t,n.parse(e.values,e.format)):e.async?{async:n.request(e.url,e.format).then(r=>(this._pending=Y(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>Tm(this,t,Y(i.data)))}});function i9(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Tm(e,t,n){n.forEach(Ce);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function lv(e){D.call(this,{},e)}lv.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]};G(lv,D,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let u=o?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&N('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&N('The "as" parameter has too few output field names.'),c=c||r.map(Je),f=function(p){for(var g=0,m=0,y,b;g<a;++g)if(b=i.get(n[g](p)),b==null)for(y=0;y<d;++y,++m)p[c[m]]=s;else for(y=0;y<d;++y,++m)p[c[m]]=r[y](b)}):(c||N("Missing output field names."),f=function(p){for(var g=0,m;g<a;++g)m=i.get(n[g](p)),p[c[g]]=m??s}),o?l=t.reflow(!0):(h=n.some(p=>t.modified(p.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function XF(e){ze.call(this,null,r9,e)}G(XF,ze);function r9(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;s<n;++s)o=t[s],o[0]<i&&(i=o[0]),o[1]>r&&(r=o[1]);return[i,r]}function YF(e){ze.call(this,null,s9,e)}G(YF,ze);function s9(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function KF(e){D.call(this,null,e)}G(KF,D,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function cv(e){ks.call(this,e)}cv.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Bc,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};G(cv,ks,{_transform:ks.prototype.transform,transform(e,t){return this._transform(o9(e,t),t)}});function o9(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=Bt(n).concat(Bt(i)),o=u9(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>a9(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function a9(e,t,n,i){return En(r=>t(r)===e?n(r):NaN,i,e+"")}function u9(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(vp),t?r.slice(0,t):r}function JF(e){Lp.call(this,e)}G(JF,Lp,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(re(s),n,t,s);return(e.modified("field")||i&&t.modified(Bt(i)))&&N("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(Ce(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function fv(e){D.call(this,null,e)}fv.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]};G(fv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=UF(e.fields,e.as||[]),s=i?(a,u)=>l9(a,u,i,r):Cp;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const u=re(a);n.rem.push(o[u]),o[u]=null}),t.visit(t.ADD,a=>{const u=s(a,Ce({}));o[re(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[re(a)]))}),n}});function l9(e,t,n,i){for(let r=0,s=n.length;r<s;++r)t[i[r]]=n[r](e);return t}function QF(e){D.call(this,null,e)}G(QF,D,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function dv(e){D.call(this,null,e)}dv.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};const c9=1e-14;G(dv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,s=Qb(r,e.groupby,e.field),o=(e.groupby||[]).map(Je),a=[],u=e.step||.01,l=e.probs||Fn(u/2,1-c9,u),c=l.length;return s.forEach(f=>{const d=Fb(f,l);for(let h=0;h<c;++h){const p={};for(let g=0;g<o.length;++g)p[o[g]]=f.dims[g];p[i[0]]=l[h],p[i[1]]=d[h],a.push(Ce(p))}}),this.value&&(n.rem=this.value),this.value=n.add=n.source=a,n}});function ZF(e){D.call(this,null,e)}G(ZF,D,{transform(e,t){let n,i;return this.value?i=this.value:(n=t=t.addAll(),i=this.value={}),e.derive&&(n=t.fork(t.NO_SOURCE),t.visit(t.REM,r=>{const s=re(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=Ab(r);i[re(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[re(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function hv(e){D.call(this,[],e),this.count=0}hv.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};G(hv,D,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[re(f)]=1,c),{});let o=this.value,a=this.count,u=0;function l(c){let f,d;o.length<r?o.push(c):(d=~~((a+1)*Jn()),d<o.length&&d>=u&&(f=o[d],s[re(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=re(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[re(c)]!==-1)),(t.rem.length||i)&&o.length<r&&t.source&&(u=a=o.length,t.visit(t.SOURCE,c=>{s[re(c)]||l(c)}),u=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f<c;++f)s[re(o[f])]=-1,n.rem.push(o[f]);o=o.slice(c)}return t.mod.length&&t.visit(t.MOD,c=>{s[re(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=o.filter(c=>!s[re(c)])),this.count=a,this.value=n.source=o,n}});function pv(e){D.call(this,null,e)}pv.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};G(pv,D,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Fn(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,Ce(s)}),n.add=t.add.concat(this.value),n}});function eT(e){D.call(this,null,e),this.modified(!0)}G(eT,D,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function gv(e){D.call(this,null,e)}const tT=["unit0","unit1"];gv.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:yb,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:tT}]};G(gv,D,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?Nu:Ru)(s.unit).offset,a=e.as||tT,u=a[0],l=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(Bt(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[u]=null,i&&(p[l]=null)):(p[u]=m=y=s(g),i&&(p[l]=y=o(m,c)),m<f&&(f=m),y>d&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:HC({extent:e.extent||Ji(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=bb(i),o=this.value||{},a=(n?LC:NC)(s,r);return a.unit=xe(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function nT(e){D.call(this,Mu(),e)}G(nT,D,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function iT(e){D.call(this,null,e)}G(iT,D,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(ea(e.sort)):t.source).map(e.field))}});function f9(e,t,n,i){const r=dc[e](t,n);return{init:r.init||cs,update:function(s,o){o[i]=r.next(s)}}}const dc={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=dc.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e<r){for(;r+1<n.length&&!i(n[r],n[r+1]);)++r;e=r}return(1+e)/n.length}}},ntile:function(e,t){t=+t,t>0||N("ntile num must be greater than zero.");const n=dc.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return i<r.length?e(r[i]):null}}},first_value:function(e){return{next:t=>e(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||N("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return i<n.i1?e(n.data[i]):null}}},prev_value:function(e){let t;return{init:()=>t=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=d9(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function d9(e,t,n){for(let i=t.length;n<i;++n)if(e(t[n])!=null)return n;return-1}const h9=Object.keys(dc);function rT(e){const t=Y(e.ops),n=Y(e.fields),i=Y(e.params),r=Y(e.aggregate_params),s=Y(e.as),o=this.outputs=[],a=this.windows=[],u={},l={},c=[],f=[];let d=!0;function h(p){Y(Bt(p)).forEach(g=>u[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Je(m),x=OF(p,v,s[g]);if(h(m),o.push(x),J(dc,p))a.push(f9(p,m,y,x));else{if(m==null&&p!=="count"&&N("Null aggregate field specified."),p==="count"){c.push(x);return}d=!1;let E=l[v];E||(E=l[v]=[],E.field=m,f.push(E)),E.push(RF(p,b,x))}}),(c.length||f.length)&&(this.cell=p9(f,c,d)),this.inputs=Object.keys(u)}const sT=rT.prototype;sT.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()};sT.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;o<e.i0;++o)n.rem(r[o]);for(o=e.p1;o<e.i1;++o)n.add(r[o]);n.set(t)}for(o=0;o<s;++o)i[o].update(e,t)};function p9(e,t,n){e=e.map(u=>LF(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;o<r;++o)s[o]=new e[o](i);if(i.store)var a=i.data=new Gb;return i.add=function(u){if(i.num+=1,!n){a&&a.add(u);for(let l=0;l<r;++l)s[l].add(s[l].get(u),u)}},i.rem=function(u){if(i.num-=1,!n){a&&a.rem(u);for(let l=0;l<r;++l)s[l].rem(s[l].get(u),u)}},i.set=function(u){let l,c;for(a&&a.values(),l=0,c=t.length;l<c;++l)u[t[l]]=i.num;if(!n)for(l=0,c=s.length;l<c;++l)s[l].set(u)},i.init=function(){i.num=0,a&&a.reset();for(let u=0;u<r;++u)s[u].init()},i}function mv(e){D.call(this,{},e),this._mlen=0,this._mods=[]}mv.Definition={type:"Window",metadata:{modifies:!0},params:[{name:"sort",type:"compare"},{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:h9.concat(Bc)},{name:"params",type:"number",null:!0,array:!0},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"frame",type:"number",null:!0,array:!0,length:2,default:[null,0]},{name:"ignorePeers",type:"boolean",default:!1}]};G(mv,D,{transform(e,t){this.stamp=t.stamp;const n=e.modified(),i=ea(e.sort),r=a1(e.groupby),s=a=>this.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new rT(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,u=this._mlen;a<u;++a)g9(this._mods[a],o,i,e);return this._mlen=0,this._mods=[],t.reflow(n).modifies(o.outputs)},group(e){let t=this.value[e];return t||(t=this.value[e]=PF(re),t.stamp=-1),t.stamp<this.stamp&&(t.stamp=this.stamp,this._mods[this._mlen++]=t),t}});function g9(e,t,n,i){const r=i.sort,s=r&&!i.ignorePeers,o=i.frame||[null,0],a=e.data(n),u=a.length,l=s?fp(r):null,c={i0:0,i1:0,p0:0,p1:0,index:0,data:a,compare:r||Ht(-1)};t.init();for(let f=0;f<u;++f)m9(c,o,f,u),s&&y9(c,l),t.update(c,a[f])}function m9(e,t,n,i){e.p0=e.i0,e.p1=e.i1,e.i0=t[0]==null?0:Math.max(0,n-Math.abs(t[0])),e.i1=t[1]==null?i:Math.min(i,n+Math.abs(t[1])+1),e.index=n}function y9(e,t){const n=e.i0,i=e.i1-1,r=e.compare,s=e.data,o=s.length-1;n>0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i<o&&!r(s[i],s[i+1])&&(e.i1=t.right(s,s[i]))}const b9=Object.freeze(Object.defineProperty({__proto__:null,aggregate:ks,bin:Vb,collect:Xb,compare:zF,countpattern:Yb,cross:Kb,density:Jb,dotbin:Zb,expression:qF,extent:ev,facet:Lp,field:WF,filter:nv,flatten:iv,fold:rv,formula:sv,generate:HF,impute:ov,joinaggregate:av,kde:uv,key:GF,load:VF,lookup:lv,multiextent:XF,multivalues:YF,params:KF,pivot:cv,prefacet:JF,project:fv,proxy:QF,quantile:dv,relay:ZF,sample:hv,sequence:pv,sieve:eT,subflow:tv,timeunit:gv,tupleindex:nT,values:iT,window:mv},Symbol.toStringTag,{value:"Module"}));function Fe(e){return function(){return e}}const sS=Math.abs,Mt=Math.atan2,to=Math.cos,v9=Math.max,Mm=Math.min,Ri=Math.sin,wo=Math.sqrt,Ot=1e-12,Za=Math.PI,Xd=Za/2,oT=2*Za;function x9(e){return e>1?0:e<-1?Za:Math.acos(e)}function oS(e){return e>=1?Xd:e<=-1?-Xd:Math.asin(e)}const u1=Math.PI,l1=2*u1,po=1e-6,w9=l1-po;function aT(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function E9(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return aT;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;r<s;++r)this._+=Math.round(arguments[r]*n)/n+i[r]}}let yv=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?aT:E9(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,i,r){this._append`Q${+t},${+n},${this._x1=+i},${this._y1=+r}`}bezierCurveTo(t,n,i,r,s,o){this._append`C${+t},${+n},${+i},${+r},${this._x1=+s},${this._y1=+o}`}arcTo(t,n,i,r,s){if(t=+t,n=+n,i=+i,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,a=this._y1,u=i-t,l=r-n,c=o-t,f=a-n,d=c*c+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>po)if(!(Math.abs(f*u-l*c)>po)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-o,p=r-a,g=u*u+l*l,m=h*h+p*p,y=Math.sqrt(g),b=Math.sqrt(d),v=s*Math.tan((u1-Math.acos((g+d-m)/(2*y*b)))/2),x=v/b,E=v/y;Math.abs(x-1)>po&&this._append`L${t+x*c},${n+x*f}`,this._append`A${s},${s},0,0,${+(f*h>c*p)},${this._x1=t+E*u},${this._y1=n+E*l}`}}arc(t,n,i,r,s,o){if(t=+t,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),u=i*Math.sin(r),l=t+a,c=n+u,f=1^o,d=o?r-s:s-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>po||Math.abs(this._y1-c)>po)&&this._append`L${l},${c}`,i&&(d<0&&(d=d%l1+l1),d>w9?this._append`A${i},${i},0,1,${f},${t-a},${n-u}A${i},${i},0,1,${f},${this._x1=l},${this._y1=c}`:d>po&&this._append`A${i},${i},0,${+(d>=u1)},${f},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function Pp(){return new yv}Pp.prototype=yv.prototype;function zp(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new yv(t)}function S9(e){return e.innerRadius}function _9(e){return e.outerRadius}function $9(e){return e.startAngle}function A9(e){return e.endAngle}function k9(e){return e&&e.padAngle}function C9(e,t,n,i,r,s,o,a){var u=n-e,l=i-t,c=o-r,f=a-s,d=f*u-c*l;if(!(d*d<Ot))return d=(c*(t-s)-f*(e-r))/d,[e+d*u,t+d*l]}function Mf(e,t,n,i,r,s,o){var a=e-n,u=t-i,l=(o?s:-s)/wo(a*a+u*u),c=l*u,f=-l*a,d=e+c,h=t+f,p=n+c,g=i+f,m=(d+p)/2,y=(h+g)/2,b=p-d,v=g-h,x=b*b+v*v,E=r-s,S=d*g-p*h,w=(v<0?-1:1)*wo(v9(0,E*E*x-S*S)),_=(S*v-b*w)/x,$=(-S*b-v*w)/x,C=(S*v+b*w)/x,T=(-S*b+v*w)/x,O=_-m,k=$-y,F=C-m,A=T-y;return O*O+k*k>F*F+A*A&&(_=C,$=T),{cx:_,cy:$,x01:-c,y01:-f,x11:_*(r/E-1),y11:$*(r/E-1)}}function F9(){var e=S9,t=_9,n=Fe(0),i=null,r=$9,s=A9,o=k9,a=null,u=zp(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-Xd,g=s.apply(this,arguments)-Xd,m=sS(g-p),y=g>p;if(a||(a=c=u()),h<d&&(f=h,h=d,d=f),!(h>Ot))a.moveTo(0,0);else if(m>oT-Ot)a.moveTo(h*to(p),h*Ri(p)),a.arc(0,0,h,p,g,!y),d>Ot&&(a.moveTo(d*to(g),d*Ri(g)),a.arc(0,0,d,g,p,y));else{var b=p,v=g,x=p,E=g,S=m,w=m,_=o.apply(this,arguments)/2,$=_>Ot&&(i?+i.apply(this,arguments):wo(d*d+h*h)),C=Mm(sS(h-d)/2,+n.apply(this,arguments)),T=C,O=C,k,F;if($>Ot){var A=oS($/d*Ri(_)),M=oS($/h*Ri(_));(S-=A*2)>Ot?(A*=y?1:-1,x+=A,E-=A):(S=0,x=E=(p+g)/2),(w-=M*2)>Ot?(M*=y?1:-1,b+=M,v-=M):(w=0,b=v=(p+g)/2)}var P=h*to(b),z=h*Ri(b),U=d*to(E),te=d*Ri(E);if(C>Ot){var ne=h*to(v),de=h*Ri(v),Se=d*to(x),we=d*Ri(x),Pe;if(m<Za)if(Pe=C9(P,z,Se,we,ne,de,U,te)){var Di=P-Pe[0],Zs=z-Pe[1],es=ne-Pe[0],Q=de-Pe[1],he=1/Ri(x9((Di*es+Zs*Q)/(wo(Di*Di+Zs*Zs)*wo(es*es+Q*Q)))/2),ge=wo(Pe[0]*Pe[0]+Pe[1]*Pe[1]);T=Mm(C,(d-ge)/(he-1)),O=Mm(C,(h-ge)/(he+1))}else T=O=0}w>Ot?O>Ot?(k=Mf(Se,we,P,z,h,O,y),F=Mf(ne,de,U,te,h,O,y),a.moveTo(k.cx+k.x01,k.cy+k.y01),O<C?a.arc(k.cx,k.cy,O,Mt(k.y01,k.x01),Mt(F.y01,F.x01),!y):(a.arc(k.cx,k.cy,O,Mt(k.y01,k.x01),Mt(k.y11,k.x11),!y),a.arc(0,0,h,Mt(k.cy+k.y11,k.cx+k.x11),Mt(F.cy+F.y11,F.cx+F.x11),!y),a.arc(F.cx,F.cy,O,Mt(F.y11,F.x11),Mt(F.y01,F.x01),!y))):(a.moveTo(P,z),a.arc(0,0,h,b,v,!y)):a.moveTo(P,z),!(d>Ot)||!(S>Ot)?a.lineTo(U,te):T>Ot?(k=Mf(U,te,ne,de,d,-T,y),F=Mf(P,z,Se,we,d,-T,y),a.lineTo(k.cx+k.x01,k.cy+k.y01),T<C?a.arc(k.cx,k.cy,T,Mt(k.y01,k.x01),Mt(F.y01,F.x01),!y):(a.arc(k.cx,k.cy,T,Mt(k.y01,k.x01),Mt(k.y11,k.x11),!y),a.arc(0,0,d,Mt(k.cy+k.y11,k.cx+k.x11),Mt(F.cy+F.y11,F.cx+F.x11),y),a.arc(F.cx,F.cy,T,Mt(F.y11,F.x11),Mt(F.y01,F.x01),!y))):a.arc(0,0,d,E,x,y)}if(a.closePath(),c)return a=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+r.apply(this,arguments)+ +s.apply(this,arguments))/2-Za/2;return[to(f)*c,Ri(f)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Fe(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:Fe(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:Fe(+c),l):n},l.padRadius=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:Fe(+c),l):i},l.startAngle=function(c){return arguments.length?(r=typeof c=="function"?c:Fe(+c),l):r},l.endAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Fe(+c),l):s},l.padAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Fe(+c),l):o},l.context=function(c){return arguments.length?(a=c??null,l):a},l}function uT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lT(e){this._context=e}lT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function bv(e){return new lT(e)}function cT(e){return e[0]}function fT(e){return e[1]}function dT(e,t){var n=Fe(!0),i=null,r=bv,s=null,o=zp(a);e=typeof e=="function"?e:e===void 0?cT:Fe(e),t=typeof t=="function"?t:t===void 0?fT:Fe(t);function a(u){var l,c=(u=uT(u)).length,f,d=!1,h;for(i==null&&(s=r(h=o())),l=0;l<=c;++l)!(l<c&&n(f=u[l],l,u))===d&&((d=!d)?s.lineStart():s.lineEnd()),d&&s.point(+e(f,l,u),+t(f,l,u));if(h)return s=null,h+""||null}return a.x=function(u){return arguments.length?(e=typeof u=="function"?u:Fe(+u),a):e},a.y=function(u){return arguments.length?(t=typeof u=="function"?u:Fe(+u),a):t},a.defined=function(u){return arguments.length?(n=typeof u=="function"?u:Fe(!!u),a):n},a.curve=function(u){return arguments.length?(r=u,i!=null&&(s=r(i)),a):r},a.context=function(u){return arguments.length?(u==null?i=s=null:s=r(i=u),a):i},a}function hT(e,t,n){var i=null,r=Fe(!0),s=null,o=bv,a=null,u=zp(l);e=typeof e=="function"?e:e===void 0?cT:Fe(+e),t=typeof t=="function"?t:Fe(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?fT:Fe(+n);function l(f){var d,h,p,g=(f=uT(f)).length,m,y=!1,b,v=new Array(g),x=new Array(g);for(s==null&&(a=o(b=u())),d=0;d<=g;++d){if(!(d<g&&r(m=f[d],d,f))===y)if(y=!y)h=d,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),p=d-1;p>=h;--p)a.point(v[p],x[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),x[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):x[d]))}if(b)return a=null,b+""||null}function c(){return dT().defined(r).curve(o).context(s)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:Fe(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Fe(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:Fe(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:Fe(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Fe(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Fe(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:Fe(!!f),l):r},l.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),l):o},l.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),l):s},l}const T9={draw(e,t){const n=wo(t/Za);e.moveTo(n,0),e.arc(0,0,n,0,oT)}};function M9(e,t){let n=null,i=zp(r);e=typeof e=="function"?e:Fe(e||T9),t=typeof t=="function"?t:Fe(t===void 0?64:+t);function r(){let s;if(n||(n=s=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return r.type=function(s){return arguments.length?(e=typeof s=="function"?s:Fe(s),r):e},r.size=function(s){return arguments.length?(t=typeof s=="function"?s:Fe(+s),r):t},r.context=function(s){return arguments.length?(n=s??null,r):n},r}function Cs(){}function Yd(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ip(e){this._context=e}Ip.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Yd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function D9(e){return new Ip(e)}function pT(e){this._context=e}pT.prototype={areaStart:Cs,areaEnd:Cs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function O9(e){return new pT(e)}function gT(e){this._context=e}gT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Yd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function R9(e){return new gT(e)}function mT(e,t){this._basis=new Ip(e),this._beta=t}mT.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],s=e[n]-i,o=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*s),this._beta*t[a]+(1-this._beta)*(r+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const N9=function e(t){function n(i){return t===1?new Ip(i):new mT(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function Kd(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function vv(e,t){this._context=e,this._k=(1-t)/6}vv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Kd(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Kd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const L9=function e(t){function n(i){return new vv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function xv(e,t){this._context=e,this._k=(1-t)/6}xv.prototype={areaStart:Cs,areaEnd:Cs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Kd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const P9=function e(t){function n(i){return new xv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function wv(e,t){this._context=e,this._k=(1-t)/6}wv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Kd(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const z9=function e(t){function n(i){return new wv(i,t)}return n.tension=function(i){return e(+i)},n}(0);function Ev(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>Ot){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Ot){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*l+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function yT(e,t){this._context=e,this._alpha=t}yT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Ev(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const I9=function e(t){function n(i){return t?new yT(i,t):new vv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function bT(e,t){this._context=e,this._alpha=t}bT.prototype={areaStart:Cs,areaEnd:Cs,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Ev(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const B9=function e(t){function n(i){return t?new bT(i,t):new xv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function vT(e,t){this._context=e,this._alpha=t}vT.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ev(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const U9=function e(t){function n(i){return t?new vT(i,t):new wv(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function xT(e){this._context=e}xT.prototype={areaStart:Cs,areaEnd:Cs,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function j9(e){return new xT(e)}function aS(e){return e<0?-1:1}function uS(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(aS(s)+aS(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function lS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Dm(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function Jd(e){this._context=e}Jd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Dm(this,this._t0,lS(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Dm(this,lS(this,n=uS(this,e,t)),n);break;default:Dm(this,this._t0,n=uS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function wT(e){this._context=new ET(e)}(wT.prototype=Object.create(Jd.prototype)).point=function(e,t){Jd.prototype.point.call(this,t,e)};function ET(e){this._context=e}ET.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function q9(e){return new Jd(e)}function W9(e){return new wT(e)}function ST(e){this._context=e}ST.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=cS(e),r=cS(t),s=0,o=1;o<n;++s,++o)this._context.bezierCurveTo(i[0][s],r[0][s],i[1][s],r[1][s],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function cS(e){var t,n=e.length-1,i,r=new Array(n),s=new Array(n),o=new Array(n);for(r[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)r[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(r[n-1]=2,s[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)i=r[t]/s[t-1],s[t]-=i,o[t]-=i*o[t-1];for(r[n-1]=o[n-1]/s[n-1],t=n-2;t>=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-r[t+1];return[r,s]}function H9(e){return new ST(e)}function Bp(e,t){this._context=e,this._t=t}Bp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function G9(e){return new Bp(e,.5)}function V9(e){return new Bp(e,0)}function X9(e){return new Bp(e,1)}function _s(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const Y9=()=>typeof Image<"u"?Image:null,c1=Symbol("implicit");function Sv(){var e=new DE,t=[],n=[],i=c1;function r(s){let o=e.get(s);if(o===void 0){if(i!==c1)return i;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new DE;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return Sv(t,n).unknown(i)},Bs.apply(r,arguments),r}const _T=Math.PI/180,$T=180/Math.PI,Qd=18,AT=.96422,kT=1,CT=.82521,FT=4/29,Ia=6/29,TT=3*Ia*Ia,K9=Ia*Ia*Ia;function MT(e){if(e instanceof Vi)return new Vi(e.l,e.a,e.b,e.opacity);if(e instanceof Tr)return DT(e);e instanceof pp||(e=Bk(e));var t=Lm(e.r),n=Lm(e.g),i=Lm(e.b),r=Om((.2225045*t+.7168786*n+.0606169*i)/kT),s,o;return t===n&&n===i?s=o=r:(s=Om((.4360747*t+.3850649*n+.1430804*i)/AT),o=Om((.0139322*t+.0971045*n+.7141733*i)/CT)),new Vi(116*r-16,500*(s-r),200*(r-o),e.opacity)}function Zd(e,t,n,i){return arguments.length===1?MT(e):new Vi(e,t,n,i??1)}function Vi(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}Zy(Vi,Zd,eb(tb,{brighter(e){return new Vi(this.l+Qd*(e??1),this.a,this.b,this.opacity)},darker(e){return new Vi(this.l-Qd*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=AT*Rm(t),e=kT*Rm(e),n=CT*Rm(n),new pp(Nm(3.1338561*t-1.6168667*e-.4906146*n),Nm(-.9787684*t+1.9161415*e+.033454*n),Nm(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Om(e){return e>K9?Math.pow(e,1/3):e/TT+FT}function Rm(e){return e>Ia?e*e*e:TT*(e-FT)}function Nm(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Lm(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function J9(e){if(e instanceof Tr)return new Tr(e.h,e.c,e.l,e.opacity);if(e instanceof Vi||(e=MT(e)),e.a===0&&e.b===0)return new Tr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*$T;return new Tr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function eh(e,t,n,i){return arguments.length===1?J9(e):new Tr(e,t,n,i??1)}function Tr(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function DT(e){if(isNaN(e.h))return new Vi(e.l,0,0,e.opacity);var t=e.h*_T;return new Vi(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Zy(Tr,eh,eb(tb,{brighter(e){return new Tr(this.h,this.c,this.l+Qd*(e??1),this.opacity)},darker(e){return new Tr(this.h,this.c,this.l-Qd*(e??1),this.opacity)},rgb(){return DT(this).rgb()}}));var OT=-.14861,_v=1.78277,$v=-.29227,Up=-.90649,hc=1.97294,fS=hc*Up,dS=hc*_v,hS=_v*$v-Up*OT;function Q9(e){if(e instanceof Ao)return new Ao(e.h,e.s,e.l,e.opacity);e instanceof pp||(e=Bk(e));var t=e.r/255,n=e.g/255,i=e.b/255,r=(hS*i+fS*t-dS*n)/(hS+fS-dS),s=i-r,o=(hc*(n-r)-$v*s)/Up,a=Math.sqrt(o*o+s*s)/(hc*r*(1-r)),u=a?Math.atan2(o,s)*$T-120:NaN;return new Ao(u<0?u+360:u,a,r,e.opacity)}function f1(e,t,n,i){return arguments.length===1?Q9(e):new Ao(e,t,n,i??1)}function Ao(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}Zy(Ao,f1,eb(tb,{brighter(e){return e=e==null?_E:Math.pow(_E,e),new Ao(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$E:Math.pow($E,e),new Ao(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*_T,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),r=Math.sin(e);return new pp(255*(t+n*(OT*i+_v*r)),255*(t+n*($v*i+Up*r)),255*(t+n*(hc*i)),this.opacity)}}));function Z9(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function e7(e,t){var n=gp(+e,+t);return function(i){var r=n(i);return r-360*Math.floor(r/360)}}var t7=1e-12;function pS(e){return((e=Math.exp(e))+1/e)/2}function n7(e){return((e=Math.exp(e))-1/e)/2}function i7(e){return((e=Math.exp(2*e))-1)/(e+1)}const r7=function e(t,n,i){function r(s,o){var a=s[0],u=s[1],l=s[2],c=o[0],f=o[1],d=o[2],h=c-a,p=f-u,g=h*h+p*p,m,y;if(g<t7)y=Math.log(d/l)/t,m=function(w){return[a+w*h,u+w*p,l*Math.exp(t*w*y)]};else{var b=Math.sqrt(g),v=(d*d-l*l+i*g)/(2*l*n*b),x=(d*d-l*l-i*g)/(2*d*n*b),E=Math.log(Math.sqrt(v*v+1)-v),S=Math.log(Math.sqrt(x*x+1)-x);y=(S-E)/t,m=function(w){var _=w*y,$=pS(E),C=l/(n*b)*($*i7(t*_+E)-n7(E));return[a+C*h,u+C*p,l*$/pS(t*_+E)]}}return m.duration=y*1e3*t/Math.SQRT2,m}return r.rho=function(s){var o=Math.max(.001,+s),a=o*o,u=a*a;return e(o,a,u)},r}(Math.SQRT2,2,4);function RT(e){return function(t,n){var i=e((t=q0(t)).h,(n=q0(n)).h),r=Pt(t.s,n.s),s=Pt(t.l,n.l),o=Pt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.s=r(a),t.l=s(a),t.opacity=o(a),t+""}}}const s7=RT(gp);var o7=RT(Pt);function a7(e,t){var n=Pt((e=Zd(e)).l,(t=Zd(t)).l),i=Pt(e.a,t.a),r=Pt(e.b,t.b),s=Pt(e.opacity,t.opacity);return function(o){return e.l=n(o),e.a=i(o),e.b=r(o),e.opacity=s(o),e+""}}function NT(e){return function(t,n){var i=e((t=eh(t)).h,(n=eh(n)).h),r=Pt(t.c,n.c),s=Pt(t.l,n.l),o=Pt(t.opacity,n.opacity);return function(a){return t.h=i(a),t.c=r(a),t.l=s(a),t.opacity=o(a),t+""}}}const u7=NT(gp);var l7=NT(Pt);function LT(e){return function t(n){n=+n;function i(r,s){var o=e((r=f1(r)).h,(s=f1(s)).h),a=Pt(r.s,s.s),u=Pt(r.l,s.l),l=Pt(r.opacity,s.opacity);return function(c){return r.h=o(c),r.s=a(c),r.l=u(Math.pow(c,n)),r.opacity=l(c),r+""}}return i.gamma=t,i}(1)}const c7=LT(gp);var f7=LT(Pt);function Av(e,t){t===void 0&&(t=e,e=Nc);for(var n=0,i=t.length-1,r=t[0],s=new Array(i<0?0:i);n<i;)s[n]=e(r,r=t[++n]);return function(o){var a=Math.max(0,Math.min(i-1,Math.floor(o*=i)));return s[a](o-a)}}function d7(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e(i/(t-1));return n}const h7=Object.freeze(Object.defineProperty({__proto__:null,interpolate:Nc,interpolateArray:_L,interpolateBasis:OL,interpolateBasisClosed:RL,interpolateCubehelix:c7,interpolateCubehelixLong:f7,interpolateDate:$L,interpolateDiscrete:Z9,interpolateHcl:u7,interpolateHclLong:l7,interpolateHsl:s7,interpolateHslLong:o7,interpolateHue:e7,interpolateLab:a7,interpolateNumber:NL,interpolateNumberArray:AL,interpolateObject:kL,interpolateRgb:LL,interpolateRgbBasis:PL,interpolateRgbBasisClosed:zL,interpolateRound:dp,interpolateString:IL,interpolateTransformCss:BL,interpolateTransformSvg:UL,interpolateZoom:r7,piecewise:Av,quantize:d7},Symbol.toStringTag,{value:"Module"}));function PT(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,EE),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return PT(e).unknown(t)},e=arguments.length?Array.from(e,EE):[0,1],ku(n)}function zT(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],o;return s<r&&(o=n,n=i,i=o,o=r,r=s,s=o),e[n]=t.floor(r),e[i]=t.ceil(s),e}function gS(e){return Math.log(e)}function mS(e){return Math.exp(e)}function p7(e){return-Math.log(-e)}function g7(e){return-Math.exp(-e)}function m7(e){return isFinite(e)?+("1e"+e):e<0?0:e}function y7(e){return e===10?m7:e===Math.E?Math.exp:t=>Math.pow(e,t)}function b7(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function yS(e){return(t,n)=>-e(-t,n)}function kv(e){const t=e(gS,mS),n=t.domain;let i=10,r,s;function o(){return r=b7(i),s=y7(i),n()[0]<0?(r=yS(r),s=yS(s),e(p7,g7)):e(gS,mS),t}return t.base=function(a){return arguments.length?(i=+a,o()):i},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c<l;f&&([l,c]=[c,l]);let d=r(l),h=r(c),p,g;const m=a==null?10:+a;let y=[];if(!(i%1)&&h-d<m){if(d=Math.floor(d),h=Math.ceil(h),l>0){for(;d<=h;++d)for(p=1;p<i;++p)if(g=d<0?p/s(-d):p*s(d),!(g<l)){if(g>c)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/s(-d):p*s(d),!(g<l)){if(g>c)break;y.push(g)}y.length*2<m&&(y=SE(l,c,m))}else y=SE(d,h,Math.min(h-d,m)).map(s);return f?y.reverse():y},t.tickFormat=(a,u)=>{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=j0(u)).precision==null&&(u.trim=!0),u=Ik(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*i<i-.5&&(f*=i),f<=l?u(c):""}},t.nice=()=>n(zT(n(),{floor:a=>s(Math.floor(r(a))),ceil:a=>s(Math.ceil(r(a)))})),t}function IT(){const e=kv(Qy()).domain([1,10]);return e.copy=()=>hp(e,IT()).base(e.base()),Bs.apply(e,arguments),e}function bS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function vS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Cv(e){var t=1,n=e(bS(t),vS(t));return n.constant=function(i){return arguments.length?e(bS(t=+i),vS(t)):t},ku(n)}function BT(){var e=Cv(Qy());return e.copy=function(){return hp(e,BT()).constant(e.constant())},Bs.apply(e,arguments)}function xS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function v7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function x7(e){return e<0?-e*e:e*e}function Fv(e){var t=e(fs,fs),n=1;function i(){return n===1?e(fs,fs):n===.5?e(v7,x7):e(xS(n),xS(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},ku(t)}function Tv(){var e=Fv(Qy());return e.copy=function(){return hp(e,Tv()).exponent(e.exponent())},Bs.apply(e,arguments),e}function w7(){return Tv.apply(null,arguments).exponent(.5)}function UT(){var e=[],t=[],n=[],i;function r(){var o=0,a=Math.max(1,t.length);for(n=new Array(a-1);++o<a;)n[o-1]=wC(e,o/a);return s}function s(o){return o==null||isNaN(o=+o)?i:t[Va(n,o)]}return s.invertExtent=function(o){var a=t.indexOf(o);return a<0?[NaN,NaN]:[a>0?n[a-1]:e[0],a<n.length?n[a]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let a of o)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(oc),r()},s.range=function(o){return arguments.length?(t=Array.from(o),r()):t.slice()},s.unknown=function(o){return arguments.length?(i=o,s):i},s.quantiles=function(){return n.slice()},s.copy=function(){return UT().domain(e).range(t).unknown(i)},Bs.apply(s,arguments)}function jT(){var e=0,t=1,n=1,i=[.5],r=[0,1],s;function o(u){return u!=null&&u<=u?r[Va(i,u,0,n)]:s}function a(){var u=-1;for(i=new Array(n);++u<n;)i[u]=((u+1)*t-(u-n)*e)/(n+1);return o}return o.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,a()):[e,t]},o.range=function(u){return arguments.length?(n=(r=Array.from(u)).length-1,a()):r.slice()},o.invertExtent=function(u){var l=r.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,i[0]]:l>=n?[i[n-1],t]:[i[l-1],i[l]]},o.unknown=function(u){return arguments.length&&(s=u),o},o.thresholds=function(){return i.slice()},o.copy=function(){return jT().domain([e,t]).range(r).unknown(s)},Bs.apply(ku(o),arguments)}function E7(e){return new Date(e)}function S7(e){return e instanceof Date?+e:+new Date(+e)}function Mv(e,t,n,i,r,s,o,a,u,l){var c=CL(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),x=l("%Y");function E(S){return(u(S)<S?h:a(S)<S?p:o(S)<S?g:s(S)<S?m:i(S)<S?r(S)<S?y:b:n(S)<S?v:x)(S)}return c.invert=function(S){return new Date(f(S))},c.domain=function(S){return arguments.length?d(Array.from(S,S7)):d().map(E7)},c.ticks=function(S){var w=d();return e(w[0],w[w.length-1],S??10)},c.tickFormat=function(S,w){return w==null?E:l(w)},c.nice=function(S){var w=d();return(!S||typeof S.range!="function")&&(S=t(w[0],w[w.length-1],S??10)),S?d(zT(w,S)):c},c.copy=function(){return hp(c,Mv(e,t,n,i,r,s,o,a,u,l))},c}function _7(){return Bs.apply(Mv(tz,nz,Qi,uc,Du,Or,Ep,xp,Fr,xb).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function $7(){return Bs.apply(Mv(ZP,ez,Zi,lc,Ou,Es,Sp,wp,Fr,wb).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function jp(){var e=0,t=1,n,i,r,s,o=fs,a=!1,u;function l(f){return f==null||isNaN(f=+f)?u:o(r===0?.5:(f=(s(f)-n)*r,a?Math.max(0,Math.min(1,f)):f))}l.domain=function(f){return arguments.length?([e,t]=f,n=s(e=+e),i=s(t=+t),r=n===i?0:1/(i-n),l):[e,t]},l.clamp=function(f){return arguments.length?(a=!!f,l):a},l.interpolator=function(f){return arguments.length?(o=f,l):o};function c(f){return function(d){var h,p;return arguments.length?([h,p]=d,o=f(h,p),l):[o(0),o(1)]}}return l.range=c(Nc),l.rangeRound=c(dp),l.unknown=function(f){return arguments.length?(u=f,l):u},function(f){return s=f,n=f(e),i=f(t),r=n===i?0:1/(i-n),l}}function qs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Dv(){var e=ku(jp()(fs));return e.copy=function(){return qs(e,Dv())},Us.apply(e,arguments)}function qT(){var e=kv(jp()).domain([1,10]);return e.copy=function(){return qs(e,qT()).base(e.base())},Us.apply(e,arguments)}function WT(){var e=Cv(jp());return e.copy=function(){return qs(e,WT()).constant(e.constant())},Us.apply(e,arguments)}function Ov(){var e=Fv(jp());return e.copy=function(){return qs(e,Ov()).exponent(e.exponent())},Us.apply(e,arguments)}function A7(){return Ov.apply(null,arguments).exponent(.5)}function qp(){var e=0,t=.5,n=1,i=1,r,s,o,a,u,l=fs,c,f=!1,d;function h(g){return isNaN(g=+g)?d:(g=.5+((g=+c(g))-s)*(i*g<i*s?a:u),l(f?Math.max(0,Math.min(1,g)):g))}h.domain=function(g){return arguments.length?([e,t,n]=g,r=c(e=+e),s=c(t=+t),o=c(n=+n),a=r===s?0:.5/(s-r),u=s===o?0:.5/(o-s),i=s<r?-1:1,h):[e,t,n]},h.clamp=function(g){return arguments.length?(f=!!g,h):f},h.interpolator=function(g){return arguments.length?(l=g,h):l};function p(g){return function(m){var y,b,v;return arguments.length?([y,b,v]=m,l=Av(g,[y,b,v]),h):[l(0),l(.5),l(1)]}}return h.range=p(Nc),h.rangeRound=p(dp),h.unknown=function(g){return arguments.length?(d=g,h):d},function(g){return c=g,r=g(e),s=g(t),o=g(n),a=r===s?0:.5/(s-r),u=s===o?0:.5/(o-s),i=s<r?-1:1,h}}function HT(){var e=ku(qp()(fs));return e.copy=function(){return qs(e,HT())},Us.apply(e,arguments)}function GT(){var e=kv(qp()).domain([.1,1,10]);return e.copy=function(){return qs(e,GT()).base(e.base())},Us.apply(e,arguments)}function VT(){var e=Cv(qp());return e.copy=function(){return qs(e,VT()).constant(e.constant())},Us.apply(e,arguments)}function Rv(){var e=Fv(qp());return e.copy=function(){return qs(e,Rv()).exponent(e.exponent())},Us.apply(e,arguments)}function k7(){return Rv.apply(null,arguments).exponent(.5)}function ar(e){for(var t=e.length/6|0,n=new Array(t),i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}const C7=ar("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),F7=ar("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),T7=ar("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),M7=ar("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),D7=ar("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),O7=ar("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),R7=ar("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),N7=ar("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),L7=ar("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),P7=ar("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function Nv(e,t,n){const i=e-t+n*2;return e?i>0?i:1:0}const z7="identity",eu="linear",Ur="log",Uc="pow",jc="sqrt",Wp="symlog",Ro="time",No="utc",Xi="sequential",Pu="diverging",tu="quantile",Hp="quantize",Gp="threshold",Lv="ordinal",d1="point",XT="band",Pv="bin-ordinal",lt="continuous",qc="discrete",Wc="discretizing",ti="interpolating",zv="temporal";function I7(e){return function(t){let n=t[0],i=t[1],r;return i<n&&(r=n,n=i,i=r),[e.invert(n),e.invert(i)]}}function B7(e){return function(t){const n=e.range();let i=t[0],r=t[1],s=-1,o,a,u,l;for(r<i&&(a=i,i=r,r=a),u=0,l=n.length;u<l;++u)n[u]>=i&&n[u]<=r&&(s<0&&(s=u),o=u);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Iv(){const e=Sv().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]<i[0],h=i[1-d],p=Nv(f,a,u);let g=i[d-0];r=(h-g)/(p||1),o&&(r=Math.floor(r)),g+=(h-g-r*(f-a))*l,s=r*(1-a),o&&(g=Math.round(g),s=Math.round(s));const m=Fn(f).map(y=>g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]<i[0],h=d?n().reverse():n(),p=h.length-1;let g=+f[0],m=+f[1],y,b,v;if(!(g!==g||m!==m)&&(m<g&&(v=g,g=m,m=v),!(m<h[0]||g>i[1-d])))return y=Math.max(0,Va(h,g)-1),b=g===m?y:Va(h,m)-1,g-h[y]>s+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Iv().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(u).align(l)},c()}function YT(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return YT(t())},e}function U7(){return YT(Iv().paddingInner(1))}var j7=Array.prototype.map;function q7(e){return j7.call(e,zt)}const W7=Array.prototype.slice;function KT(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Va(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=q7(i),n):e.slice()},n.range=function(i){return arguments.length?(t=W7.call(i),n):t.slice()},n.tickFormat=function(i,r){return ML(e[0],xe(e),i??10,r)},n.copy=function(){return KT().domain(n.domain()).range(n.range())},n}const th=new Map,JT=Symbol("vega_scale");function QT(e){return e[JT]=!0,e}function H7(e){return e&&e[JT]===!0}function G7(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?I7(s):s.invertExtent?B7(s):void 0),s.type=e,QT(s)};return i.metadata=yi(Y(n)),i}function ke(e,t,n){return arguments.length>1?(th.set(e,G7(e,t,n)),this):ZT(e)?th.get(e):void 0}ke(z7,PT);ke(eu,FL,lt);ke(Ur,IT,[lt,Ur]);ke(Uc,Tv,lt);ke(jc,w7,lt);ke(Wp,BT,lt);ke(Ro,_7,[lt,zv]);ke(No,$7,[lt,zv]);ke(Xi,Dv,[lt,ti]);ke(`${Xi}-${eu}`,Dv,[lt,ti]);ke(`${Xi}-${Ur}`,qT,[lt,ti,Ur]);ke(`${Xi}-${Uc}`,Ov,[lt,ti]);ke(`${Xi}-${jc}`,A7,[lt,ti]);ke(`${Xi}-${Wp}`,WT,[lt,ti]);ke(`${Pu}-${eu}`,HT,[lt,ti]);ke(`${Pu}-${Ur}`,GT,[lt,ti,Ur]);ke(`${Pu}-${Uc}`,Rv,[lt,ti]);ke(`${Pu}-${jc}`,k7,[lt,ti]);ke(`${Pu}-${Wp}`,VT,[lt,ti]);ke(tu,UT,[Wc,tu]);ke(Hp,jT,Wc);ke(Gp,TL,Wc);ke(Pv,KT,[qc,Wc]);ke(Lv,Sv,qc);ke(XT,Iv,qc);ke(d1,U7,qc);function ZT(e){return th.has(e)}function na(e,t){const n=th.get(e);return n&&n.metadata[t]}function Bv(e){return na(e,lt)}function nu(e){return na(e,qc)}function h1(e){return na(e,Wc)}function eM(e){return na(e,Ur)}function V7(e){return na(e,zv)}function tM(e){return na(e,ti)}function nM(e){return na(e,tu)}const X7=["clamp","base","constant","exponent"];function iM(e,t){const n=t[0],i=xe(t)-n;return function(r){return e(n+r*i)}}function Vp(e,t,n){return Av(Uv(t||"rgb",n),e)}function rM(e,t){const n=new Array(t),i=t+1;for(let r=0;r<t;)n[r]=e(++r/i);return n}function sM(e,t,n){const i=n-t;let r,s,o;return!i||!Number.isFinite(i)?Ht(.5):(r=(s=e.type).indexOf("-"),s=r<0?s:s.slice(r+1),o=ke(s)().domain([t,n]).range([0,1]),X7.forEach(a=>e[a]?o[a](e[a]()):0),o)}function Uv(e,t){const n=h7[Y7(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function Y7(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const K7={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},J7={accent:F7,category10:C7,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:T7,observable10:M7,paired:D7,pastel1:O7,pastel2:R7,set1:N7,set2:L7,set3:P7,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function oM(e){if(L(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;i<t;)n[i]="#"+e.slice(i*6,++i*6);return n}function aM(e,t){for(const n in e)jv(n,t(e[n]))}const wS={};aM(J7,oM);aM(K7,e=>Vp(oM(e)));function jv(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(wS[e]=t,this):wS[e]}const gd="symbol",Q7="discrete",Z7="gradient",e8=e=>L(e)?e.map(t=>String(t)):String(e),t8=(e,t)=>e[1]-t[1],n8=(e,t)=>t[1]-e[1];function qv(e,t,n){let i;return $e(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Pc(e.domain())/n||1)+1))),X(t)&&(i=t.step,t=t.interval),K(t)&&(t=e.type===Ro?Ru(t):e.type==No?Nu(t):N("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function uM(e,t,n){let i=e.range(),r=i[0],s=xe(i),o=t8;if(r>s&&(i=s,s=r,r=i,o=n8),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],xe(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function Wv(e,t){return e.bins?uM(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function lM(e,t,n,i,r,s){const o=t.type;let a=e8;if(o===Ro||r===Ro)a=e.timeFormat(i);else if(o===No||r===No)a=e.utcFormat(i);else if(eM(o)){const u=e.formatFloat(i);if(s||t.bins)a=u;else{const l=cM(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function cM(e,t,n){const i=Wv(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/s));return l*r<r-.5&&(l*=r),l<=o};return n?i.filter(a):a}const p1={[tu]:"quantiles",[Hp]:"thresholds",[Gp]:"domain"},fM={[tu]:"quantiles",[Hp]:"domain"};function dM(e,t){return e.bins?s8(e.bins):e.type===Ur?cM(e,t,!0):p1[e.type]?r8(e[p1[e.type]]()):Wv(e,t)}function i8(e,t,n){const i=t[fM[t.type]](),r=i.length;let s=r>1?i[1]-i[0]:i[0],o;for(o=1;o<r;++o)s=Math.min(s,i[o]-i[o-1]);return e.formatSpan(0,s,3*10,n)}function r8(e){const t=[-1/0].concat(e);return t.max=1/0,t}function s8(e){const t=e.slice(0,-1);return t.max=xe(e),t}const o8=e=>p1[e.type]||e.bins;function hM(e,t,n,i,r,s,o){const a=fM[t.type]&&s!==Ro&&s!==No?i8(e,t,r):lM(e,t,n,r,s,o);return i===gd&&o8(t)?a8(a):i===Q7?u8(a):l8(a)}const a8=e=>(t,n,i)=>{const r=ES(i[n+1],ES(i.max,1/0)),s=SS(t,e),o=SS(r,e);return s&&o?s+" – "+o:o?"< "+o:"≥ "+s},ES=(e,t)=>e??t,u8=e=>(t,n)=>n?e(t):null,l8=e=>t=>e(t),SS=(e,t)=>Number.isFinite(e)?t(e):null;function c8(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+xe(t),s=r-i;if(e.type===Gp){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function f8(e,t,n,i){const r=i||t.type;return K(n)&&V7(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ro?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===No?e.utcFormat("%A, %d %B %Y, %X UTC"):hM(e,t,5,null,n,i,!0)}function pM(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=f8(e,t,n.format,n.formatType);if(h1(t.type)){const s=dM(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(nu(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(xe(s))}`}}let gM=0;function d8(){gM=0}const nh="p_";function Hv(e){return e&&e.gradient}function mM(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?nh:"";return r||(r=e.id="gradient_"+gM++,i==="radial"?(e.x1=Ni(e.x1,.5),e.y1=Ni(e.y1,.5),e.r1=Ni(e.r1,0),e.x2=Ni(e.x2,.5),e.y2=Ni(e.y2,.5),e.r2=Ni(e.r2,.5),s=nh):(e.x1=Ni(e.x1,0),e.y1=Ni(e.y1,0),e.x2=Ni(e.x2,1),e.y2=Ni(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function Ni(e,t){return e??t}function yM(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const _S={basis:{curve:D9},"basis-closed":{curve:O9},"basis-open":{curve:R9},bundle:{curve:N9,tension:"beta",value:.85},cardinal:{curve:L9,tension:"tension",value:0},"cardinal-open":{curve:z9,tension:"tension",value:0},"cardinal-closed":{curve:P9,tension:"tension",value:0},"catmull-rom":{curve:I9,tension:"alpha",value:.5},"catmull-rom-closed":{curve:B9,tension:"alpha",value:.5},"catmull-rom-open":{curve:U9,tension:"alpha",value:.5},linear:{curve:bv},"linear-closed":{curve:j9},monotone:{horizontal:W9,vertical:q9},natural:{curve:H9},step:{curve:G9},"step-after":{curve:X9},"step-before":{curve:V9}};function Gv(e,t,n){var i=J(_S,e)&&_S[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const h8={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},p8=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,g8=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,m8=/^((\s+,?\s*)|(,\s*))/,y8=/^[01]/;function iu(e){const t=[];return(e.match(p8)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=h8[s],a=b8(s,o,i.slice(1).trim()),u=a.length;if(u<o||u&&u%o!==0)throw Error("Invalid SVG path, incorrect parameter count");if(t.push([r,...a.slice(0,o)]),u!==o){s==="m"&&(r=r==="M"?"L":"l");for(let l=o;l<u;l+=o)t.push([r,...a.slice(l,l+o)])}}),t}function b8(e,t,n){const i=[];for(let r=0;t&&r<n.length;)for(let s=0;s<t;++s){const o=e==="a"&&(s===3||s===4)?y8:g8,a=n.slice(r).match(o);if(a===null)throw Error("Invalid SVG path, incorrect parameter type");r+=a[0].length,i.push(+a[0]);const u=n.slice(r).match(m8);u!==null&&(r+=u[0].length)}return i}const Fs=Math.PI/180,v8=1e-14,yo=Math.PI/2,ji=Math.PI*2,ba=Math.sqrt(3)/2;var Pm={},zm={},bM=[].join;function x8(e,t,n,i,r,s,o,a,u){const l=bM.call(arguments);if(Pm[l])return Pm[l];const c=o*Fs,f=Math.sin(c),d=Math.cos(c);n=Math.abs(n),i=Math.abs(i);const h=d*(a-e)*.5+f*(u-t)*.5,p=d*(u-t)*.5-f*(a-e)*.5;let g=h*h/(n*n)+p*p/(i*i);g>1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,x=m*a+y*u,E=b*a+v*u,S=m*e+y*t,w=b*e+v*t;let $=1/((S-x)*(S-x)+(w-E)*(w-E))-.25;$<0&&($=0);let C=Math.sqrt($);s==r&&(C=-C);const T=.5*(x+S)-C*(w-E),O=.5*(E+w)+C*(S-x),k=Math.atan2(E-O,x-T);let A=Math.atan2(w-O,S-T)-k;A<0&&s===1?A+=ji:A>0&&s===0&&(A-=ji);const M=Math.ceil(Math.abs(A/(yo+.001))),P=[];for(let z=0;z<M;++z){const U=k+z*A/M,te=k+(z+1)*A/M;P[z]=[T,O,U,te,n,i,f,d]}return Pm[l]=P}function w8(e){const t=bM.call(e);if(zm[t])return zm[t];var n=e[0],i=e[1],r=e[2],s=e[3],o=e[4],a=e[5],u=e[6],l=e[7];const c=l*o,f=-u*a,d=u*o,h=l*a,p=Math.cos(r),g=Math.sin(r),m=Math.cos(s),y=Math.sin(s),b=.5*(s-r),v=Math.sin(b*.5),x=8/3*v*v/Math.sin(b),E=n+p-x*g,S=i+g+x*p,w=n+m,_=i+y,$=w+x*y,C=_-x*m;return zm[t]=[c*E+f*S,d*E+h*S,c*$+f*C,d*$+h*C,c*w+f*_,d*w+h*_]}const In=["l",0,0,0,0,0,0,0];function E8(e,t,n){const i=In[0]=e[0];if(i==="a"||i==="A")In[1]=t*e[1],In[2]=n*e[2],In[3]=e[3],In[4]=e[4],In[5]=e[5],In[6]=t*e[6],In[7]=n*e[7];else if(i==="h"||i==="H")In[1]=t*e[1];else if(i==="v"||i==="V")In[1]=n*e[1];else for(var r=1,s=e.length;r<s;++r)In[r]=(r%2==1?t:n)*e[r];return In}function pc(e,t,n,i,r,s){var o,a=null,u=0,l=0,c=0,f=0,d,h,p,g,m=0,y=0;n==null&&(n=0),i==null&&(i=0),r==null&&(r=1),s==null&&(s=r),e.beginPath&&e.beginPath();for(var b=0,v=t.length;b<v;++b){switch(o=t[b],(r!==1||s!==1)&&(o=E8(o,r,s)),o[0]){case"l":u+=o[1],l+=o[2],e.lineTo(u+n,l+i);break;case"L":u=o[1],l=o[2],e.lineTo(u+n,l+i);break;case"h":u+=o[1],e.lineTo(u+n,l+i);break;case"H":u=o[1],e.lineTo(u+n,l+i);break;case"v":l+=o[1],e.lineTo(u+n,l+i);break;case"V":l=o[1],e.lineTo(u+n,l+i);break;case"m":u+=o[1],l+=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"M":u=o[1],l=o[2],m=u,y=l,e.moveTo(u+n,l+i);break;case"c":d=u+o[5],h=l+o[6],c=u+o[3],f=l+o[4],e.bezierCurveTo(u+o[1]+n,l+o[2]+i,c+n,f+i,d+n,h+i),u=d,l=h;break;case"C":u=o[5],l=o[6],c=o[3],f=o[4],e.bezierCurveTo(o[1]+n,o[2]+i,c+n,f+i,u+n,l+i);break;case"s":d=u+o[3],h=l+o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,u+o[1]+n,l+o[2]+i,d+n,h+i),c=u+o[1],f=l+o[2],u=d,l=h;break;case"S":d=o[3],h=o[4],c=2*u-c,f=2*l-f,e.bezierCurveTo(c+n,f+i,o[1]+n,o[2]+i,d+n,h+i),u=d,l=h,c=o[1],f=o[2];break;case"q":d=u+o[3],h=l+o[4],c=u+o[1],f=l+o[2],e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"Q":d=o[3],h=o[4],e.quadraticCurveTo(o[1]+n,o[2]+i,d+n,h+i),u=d,l=h,c=o[1],f=o[2];break;case"t":d=u+o[1],h=l+o[2],a[0].match(/[QqTt]/)===null?(c=u,f=l):a[0]==="t"?(c=2*u-p,f=2*l-g):a[0]==="q"&&(c=2*u-c,f=2*l-f),p=c,g=f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h,c=u+o[1],f=l+o[2];break;case"T":d=o[1],h=o[2],c=2*u-c,f=2*l-f,e.quadraticCurveTo(c+n,f+i,d+n,h+i),u=d,l=h;break;case"a":$S(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+u+n,o[7]+l+i]),u+=o[6],l+=o[7];break;case"A":$S(e,u+n,l+i,[o[1],o[2],o[3],o[4],o[5],o[6]+n,o[7]+i]),u=o[6],l=o[7];break;case"z":case"Z":u=m,l=y,e.closePath();break}a=o}}function $S(e,t,n,i){const r=x8(i[5],i[6],i[0],i[1],i[3],i[4],i[2],t,n);for(let s=0;s<r.length;++s){const o=w8(r[s]);e.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}const AS=.5773502691896257,kS={circle:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(n,0),e.arc(0,0,n,0,ji)}},cross:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/2.5;e.moveTo(-n,-i),e.lineTo(-n,i),e.lineTo(-i,i),e.lineTo(-i,n),e.lineTo(i,n),e.lineTo(i,i),e.lineTo(n,i),e.lineTo(n,-i),e.lineTo(i,-i),e.lineTo(i,-n),e.lineTo(-i,-n),e.lineTo(-i,-i),e.closePath()}},diamond:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(0,-n),e.lineTo(n,0),e.lineTo(0,n),e.closePath()}},square:{draw:function(e,t){var n=Math.sqrt(t),i=-n/2;e.rect(i,i,n,n)}},arrow:{draw:function(e,t){var n=Math.sqrt(t)/2,i=n/7,r=n/2.5,s=n/8;e.moveTo(-i,n),e.lineTo(i,n),e.lineTo(i,-s),e.lineTo(r,-s),e.lineTo(0,-n),e.lineTo(-r,-s),e.lineTo(-i,-s),e.closePath()}},wedge:{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n,r=i-n*AS,s=n/4;e.moveTo(0,-i-r),e.lineTo(-s,i-r),e.lineTo(s,i-r),e.closePath()}},triangle:{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n,r=i-n*AS;e.moveTo(0,-i-r),e.lineTo(-n,i-r),e.lineTo(n,i-r),e.closePath()}},"triangle-up":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(0,-i),e.lineTo(-n,i),e.lineTo(n,i),e.closePath()}},"triangle-down":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(0,i),e.lineTo(-n,-i),e.lineTo(n,-i),e.closePath()}},"triangle-right":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(i,0),e.lineTo(-i,-n),e.lineTo(-i,n),e.closePath()}},"triangle-left":{draw:function(e,t){var n=Math.sqrt(t)/2,i=ba*n;e.moveTo(-i,0),e.lineTo(i,-n),e.lineTo(i,n),e.closePath()}},stroke:{draw:function(e,t){const n=Math.sqrt(t)/2;e.moveTo(-n,0),e.lineTo(n,0)}}};function vM(e){return J(kS,e)?kS[e]:S8(e)}var Im={};function S8(e){if(!J(Im,e)){const t=iu(e);Im[e]={draw:function(n,i){pc(n,t,0,0,Math.sqrt(i)/2)}}}return Im[e]}const ts=.448084975506;function _8(e){return e.x}function $8(e){return e.y}function A8(e){return e.width}function k8(e){return e.height}function br(e){return typeof e=="function"?e:()=>+e}function Df(e,t,n){return Math.max(t,Math.min(e,n))}function xM(){var e=_8,t=$8,n=A8,i=k8,r=br(0),s=r,o=r,a=r,u=null;function l(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Df(+r.call(this,c),0,b),x=Df(+s.call(this,c),0,b),E=Df(+o.call(this,c),0,b),S=Df(+a.call(this,c),0,b);if(u||(u=h=Pp()),v<=0&&x<=0&&E<=0&&S<=0)u.rect(p,g,m,y);else{var w=p+m,_=g+y;u.moveTo(p+v,g),u.lineTo(w-x,g),u.bezierCurveTo(w-ts*x,g,w,g+ts*x,w,g+x),u.lineTo(w,_-S),u.bezierCurveTo(w,_-ts*S,w-ts*S,_,w-S,_),u.lineTo(p+E,_),u.bezierCurveTo(p+ts*E,_,p,_-ts*E,p,_-E),u.lineTo(p,g+v),u.bezierCurveTo(p,g+ts*v,p+ts*v,g,p+v,g),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=br(c),l):e},l.y=function(c){return arguments.length?(t=br(c),l):t},l.width=function(c){return arguments.length?(n=br(c),l):n},l.height=function(c){return arguments.length?(i=br(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=br(c),s=f!=null?br(f):r,a=d!=null?br(d):r,o=h!=null?br(h):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function wM(){var e,t,n,i,r=null,s,o,a,u;function l(f,d,h){const p=h/2;if(s){var g=a-d,m=f-o;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,x=Math.atan2(m,g);r.moveTo(o-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,x-Math.PI,x),r.lineTo(o+b,a+v),r.arc(o,a,u,x,x+Math.PI)}else r.arc(f,d,p,0,ji);r.closePath()}else s=1;o=f,a=d,u=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=Pp()),d=0;d<=h;++d)!(d<h&&i(p=f[d],d,f))===g&&(g=!g)&&(s=0),g&&l(+e(p,d,f),+t(p,d,f),+n(p,d,f));if(m)return r=null,m+""||null}return c.x=function(f){return arguments.length?(e=f,c):e},c.y=function(f){return arguments.length?(t=f,c):t},c.size=function(f){return arguments.length?(n=f,c):n},c.defined=function(f){return arguments.length?(i=f,c):i},c.context=function(f){return arguments.length?(f==null?r=null:r=f,c):r},c}function Hc(e,t){return e??t}const Gc=e=>e.x||0,Vc=e=>e.y||0,C8=e=>e.width||0,F8=e=>e.height||0,T8=e=>(e.x||0)+(e.width||0),M8=e=>(e.y||0)+(e.height||0),D8=e=>e.startAngle||0,O8=e=>e.endAngle||0,R8=e=>e.padAngle||0,N8=e=>e.innerRadius||0,L8=e=>e.outerRadius||0,P8=e=>e.cornerRadius||0,z8=e=>Hc(e.cornerRadiusTopLeft,e.cornerRadius)||0,I8=e=>Hc(e.cornerRadiusTopRight,e.cornerRadius)||0,B8=e=>Hc(e.cornerRadiusBottomRight,e.cornerRadius)||0,U8=e=>Hc(e.cornerRadiusBottomLeft,e.cornerRadius)||0,j8=e=>Hc(e.size,64),q8=e=>e.size||1,Xp=e=>e.defined!==!1,W8=e=>vM(e.shape||"circle"),H8=F9().startAngle(D8).endAngle(O8).padAngle(R8).innerRadius(N8).outerRadius(L8).cornerRadius(P8),G8=hT().x(Gc).y1(Vc).y0(M8).defined(Xp),V8=hT().y(Vc).x1(Gc).x0(T8).defined(Xp),X8=dT().x(Gc).y(Vc).defined(Xp),Y8=xM().x(Gc).y(Vc).width(C8).height(F8).cornerRadius(z8,I8,B8,U8),K8=M9().type(W8).size(j8),J8=wM().x(Gc).y(Vc).defined(Xp).size(q8);function Vv(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function Q8(e,t){return H8.context(e)(t)}function Z8(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?V8:G8).curve(Gv(i,n.orient,n.tension)).context(e)(t)}function eB(e,t){const n=t[0],i=n.interpolate||"linear";return X8.curve(Gv(i,n.orient,n.tension)).context(e)(t)}function zu(e,t,n,i){return Y8.context(e)(t,n,i)}function tB(e,t){return(t.mark.shape||t.shape).context(e)(t)}function nB(e,t){return K8.context(e)(t)}function iB(e,t){return J8.context(e)(t)}var EM=1;function SM(){EM=1}function Xv(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+EM++),o=r.clipping[s]||(r.clipping[s]={id:s});return fe(i)?o.path=i(null):Vv(n)?o.path=zu(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function nt(e){this.clear(),e&&this.union(e)}nt.prototype={clone(){return new nt(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return n<e?(this.x2=e,this.x1=n):(this.x1=e,this.x2=n),i<t?(this.y2=t,this.y1=i):(this.y1=t,this.y2=i),this},add(e,t){return e<this.x1&&(this.x1=e),t<this.y1&&(this.y1=t),e>this.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*o+l,u*i+a*o+c,a*s-u*r+l,u*s+a*r+c,a*s-u*o+l,u*s+a*o+c]},union(e){return e.x1<this.x1&&(this.x1=e.x1),e.y1<this.y1&&(this.y1=e.y1),e.x2>this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2<this.x2&&(this.x2=e.x2),e.y2<this.y2&&(this.y2=e.y2),this},encloses(e){return e&&this.x1<=e.x1&&this.x2>=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2<e.x1||this.x1>e.x2||this.y2<e.y1||this.y1>e.y2)},contains(e,t){return!(e<this.x1||e>this.x2||t<this.y1||t>this.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Yp(e){this.mark=e,this.bounds=this.bounds||new nt}function Kp(e){Yp.call(this,e),this.items=this.items||[]}G(Kp,Yp);class _M{constructor(t){this._pending=0,this._loader=t||$p()}pending(){return this._pending}sanitizeURL(t){const n=this;return CS(n),n._loader.sanitize(t,{context:"href"}).then(i=>(ul(n),i)).catch(()=>(ul(n),null))}loadImage(t){const n=this,i=Y9();return CS(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const o=new i,a=J(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(o.crossOrigin=a),o.onload=()=>ul(n),o.onerror=()=>ul(n),o.src=s,o}).catch(r=>(ul(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function CS(e){e._pending+=1}function ul(e){e._pending-=1}function Hr(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?rB(t,i):0))}return e}function rB(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const sB=ji-1e-8;let Jp,md,yd,Eo,g1,bd,m1,y1;const ds=(e,t)=>Jp.add(e,t),vd=(e,t)=>ds(md=e,yd=t),FS=e=>ds(e,Jp.y1),TS=e=>ds(Jp.x1,e),bo=(e,t)=>g1*e+m1*t,vo=(e,t)=>bd*e+y1*t,Bm=(e,t)=>ds(bo(e,t),vo(e,t)),Um=(e,t)=>vd(bo(e,t),vo(e,t));function Xc(e,t){return Jp=e,t?(Eo=t*Fs,g1=y1=Math.cos(Eo),bd=Math.sin(Eo),m1=-bd):(g1=y1=1,Eo=bd=m1=0),oB}const oB={beginPath(){},closePath(){},moveTo:Um,lineTo:Um,rect(e,t,n,i){Eo?(Bm(e+n,t),Bm(e+n,t+i),Bm(e,t+i),Um(e,t)):(ds(e+n,t+i),vd(e,t))},quadraticCurveTo(e,t,n,i){const r=bo(e,t),s=vo(e,t),o=bo(n,i),a=vo(n,i);MS(md,r,o,FS),MS(yd,s,a,TS),vd(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=bo(e,t),a=vo(e,t),u=bo(n,i),l=vo(n,i),c=bo(r,s),f=vo(r,s);DS(md,o,u,c,FS),DS(yd,a,l,f,TS),vd(c,f)},arc(e,t,n,i,r,s){if(i+=Eo,r+=Eo,md=n*Math.cos(r)+e,yd=n*Math.sin(r)+t,Math.abs(r-i)>sB)ds(e-n,t-n),ds(e+n,t+n);else{const o=l=>ds(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(o(i),o(r),r!==i)if(i=i%ji,i<0&&(i+=ji),r=r%ji,r<0&&(r+=ji),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=ji,a=i-i%yo,u=0;u<4&&a>r;++u,a-=yo)o(a);else for(a=i-i%yo+yo,u=0;u<4&&a<r;++u,a=a+yo)o(a)}}};function MS(e,t,n,i){const r=(e-t)/(e+n-2*t);0<r&&r<1&&i(e+(t-e)*r)}function DS(e,t,n,i,r){const s=i-e+3*t-3*n,o=e+n-2*t,a=e-t;let u=0,l=0,c;Math.abs(s)>v8?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),u=(-o+c)/s,l=(-o-c)/s)):u=.5*a/o,0<u&&u<1&&r(OS(u,e,t,n,i)),0<l&&l<1&&r(OS(l,e,t,n,i))}function OS(e,t,n,i,r){const s=1-e,o=s*s,a=e*e;return o*s*t+3*o*e*n+3*s*a*i+a*e*r}var $s=($s=_s(1,1))?$s.getContext("2d"):null;const b1=new nt;function Yv(e){return function(t,n){if(!$s)return!0;e($s,t),b1.clear().union(t.bounds).intersect(n).round();const{x1:i,y1:r,x2:s,y2:o}=b1;for(let a=r;a<=o;++a)for(let u=i;u<=s;++u)if($s.isPointInPath(u,a))return!0;return!1}}function Kv(e,t){return t.contains(e.x||0,e.y||0)}function $M(e,t){const n=e.x||0,i=e.y||0,r=e.width||0,s=e.height||0;return t.intersects(b1.set(n,i,n+r,i+s))}function AM(e,t){const n=e.x||0,i=e.y||0,r=e.x2!=null?e.x2:n,s=e.y2!=null?e.y2:i;return Oa(t,n,i,r,s)}function Oa(e,t,n,i,r){const{x1:s,y1:o,x2:a,y2:u}=e,l=i-t,c=r-n;let f=0,d=1,h,p,g,m;for(m=0;m<4;++m){if(m===0&&(h=-l,p=-(s-t)),m===1&&(h=l,p=a-t),m===2&&(h=-c,p=-(o-n)),m===3&&(h=c,p=u-n),Math.abs(h)<1e-10&&p<0)return!1;if(g=p/h,h<0){if(g>d)return!1;g>f&&(f=g)}else if(h>0){if(g<f)return!1;g<d&&(d=g)}}return!0}function ru(e,t){e.globalCompositeOperation=t.blend||"source-over"}function si(e,t){return e??t}function RS(e,t){const n=t.length;for(let i=0;i<n;++i)e.addColorStop(t[i].offset,t[i].color);return e}function aB(e,t,n){const i=n.width(),r=n.height();let s;if(t.gradient==="radial")s=e.createRadialGradient(n.x1+si(t.x1,.5)*i,n.y1+si(t.y1,.5)*r,Math.max(i,r)*si(t.r1,0),n.x1+si(t.x2,.5)*i,n.y1+si(t.y2,.5)*r,Math.max(i,r)*si(t.r2,.5));else{const o=si(t.x1,0),a=si(t.y1,0),u=si(t.x2,1),l=si(t.y2,0);if(o===u||a===l||i===r)s=e.createLinearGradient(n.x1+o*i,n.y1+a*r,n.x1+u*i,n.y1+l*r);else{const c=_s(Math.ceil(i),Math.ceil(r)),f=c.getContext("2d");return f.scale(i,r),f.fillStyle=RS(f.createLinearGradient(o,a,u,l),t.stops),f.fillRect(0,0,i,r),e.createPattern(c,"no-repeat")}}return RS(s,t.stops)}function kM(e,t,n){return Hv(n)?aB(e,n,t.bounds):n}function ih(e,t,n){return n*=t.fillOpacity==null?1:t.fillOpacity,n>0?(e.globalAlpha=n,e.fillStyle=kM(e,t,t.fill),!0):!1}var uB=[];function su(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=kM(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||uB),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function lB(e,t){return e.zindex-t.zindex||e.index-t.index}function Jv(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r<s;++r)i=t[r],i.index=r,i.zindex&&n.push(i);return e.zdirty=!1,e.zitems=n.sort(lB)}function vi(e,t){var n=e.items,i,r;if(!n||!n.length)return;const s=Jv(e);if(s&&s.length){for(i=0,r=n.length;i<r;++i)n[i].zindex||t(n[i]);n=s}for(i=0,r=n.length;i<r;++i)t(n[i])}function rh(e,t){var n=e.items,i,r;if(!n||!n.length)return null;const s=Jv(e);for(s&&s.length&&(n=s),r=n.length;--r>=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function Qv(e){return function(t,n,i){vi(n,r=>{(!i||i.intersects(r.bounds))&&CM(e,t,r,r)})}}function cB(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&CM(e,t,n.items[0],n.items)}}function CM(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(ru(t,n),n.fill&&ih(t,n,r)&&t.fill(),n.stroke&&su(t,n,r)&&t.stroke()))}function Qp(e){return e=e||Rn,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,rh(n,a=>{const u=a.bounds;if(!(u&&!u.contains(s,o)||!u)&&e(t,a,i,r,s,o))return a})}}function Yc(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,u=o.stroke&&n.isPointInStroke,l,c;return u&&(l=o.strokeWidth,c=o.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function Zv(e){return Qp(Yc(e))}function ko(e,t){return"translate("+e+","+t+")"}function ex(e){return"rotate("+e+")"}function fB(e,t){return"scale("+e+","+t+")"}function FM(e){return ko(e.x||0,e.y||0)}function dB(e){return ko(e.x||0,e.y||0)+(e.angle?" "+ex(e.angle):"")}function hB(e){return ko(e.x||0,e.y||0)+(e.angle?" "+ex(e.angle):"")+(e.scaleX||e.scaleY?" "+fB(e.scaleX||1,e.scaleY||1):"")}function tx(e,t,n){function i(o,a){o("transform",dB(a)),o("d",t(null,a))}function r(o,a){return t(Xc(o,a.angle),a),Hr(o,a).translate(a.x||0,a.y||0)}function s(o,a){var u=a.x||0,l=a.y||0,c=a.angle||0;o.translate(u,l),c&&o.rotate(c*=Fs),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:Qv(s),pick:Zv(s),isect:n||Yv(s)}}var pB=tx("arc",Q8);function gB(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a<s&&(s=a,o=e[r]));return o}function mB(e,t){for(var n=Math.pow(e[0].strokeWidth||1,2),i=e.length,r,s,o;--i>=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o<n))return e[i];return null}function yB(e,t){for(var n=e.length,i,r,s;--n>=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s<i*i))return e[n];return null}function nx(e,t,n){function i(u,l){var c=l.mark.items;c.length&&u("d",t(null,c))}function r(u,l){var c=l.items;return c.length===0?u:(t(Xc(u),c),Hr(u,c[0]))}function s(u,l){u.beginPath(),t(u,l)}const o=Yc(s);function a(u,l,c,f,d,h){var p=l.items,g=l.bounds;return!p||!p.length||g&&!g.contains(d,h)?null:(c*=u.pixelRatio,f*=u.pixelRatio,o(u,p,c,f)?p[0]:null)}return{type:e,tag:"path",nested:!0,attr:i,bound:r,draw:cB(s),pick:a,isect:Kv,tip:n}}var bB=nx("area",Z8,gB);function vB(e,t){var n=t.clip;e.save(),fe(n)?(e.beginPath(),n(e),e.clip()):TM(e,t.group)}function TM(e,t){e.beginPath(),Vv(t)?zu(e,t,0,0):e.rect(0,0,t.width||0,t.height||0),e.clip()}function MM(e){const t=si(e.strokeWidth,1);return e.strokeOffset!=null?e.strokeOffset:e.stroke&&t>.5&&t<1.5?.5-Math.abs(t-1):0}function xB(e,t){e("transform",FM(t))}function DM(e,t){const n=MM(t);e("d",zu(null,t,n,n))}function wB(e,t){e("class","background"),e("aria-hidden",!0),DM(e,t)}function EB(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?DM(e,t):e("d","")}function SB(e,t,n){const i=t.clip?Xv(n,t,t):null;e("clip-path",i)}function _B(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r<i;++r)e.union(n[r].bounds)}return(t.clip||t.width||t.height)&&!t.noBound&&e.add(0,0).add(t.width||0,t.height||0),Hr(e,t),e.translate(t.x||0,t.y||0)}function gc(e,t,n,i){const r=MM(t);e.beginPath(),zu(e,t,(n||0)+r,(i||0)+r)}const $B=Yc(gc),AB=Yc(gc,!1),kB=Yc(gc,!0);function CB(e,t,n,i){vi(t,r=>{const s=r.x||0,o=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(gc(e,r,s,o),ru(e,r),r.fill&&ih(e,r,u)&&e.fill(),r.stroke&&!a&&su(e,r,u)&&e.stroke()),e.save(),e.translate(s,o),r.clip&&TM(e,r),n&&n.translate(-s,-o),vi(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(s,o),e.restore(),a&&r.stroke&&u&&(gc(e,r,s,o),ru(e,r),su(e,r,u)&&e.stroke())})}function FB(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return rh(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(r<c||r>h||s<f||s>p))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&Vv(u)&&!kB(e,u,o,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&AB(e,u,o,a)?(e.restore(),u):(l=rh(u,b=>TB(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&$B(e,u,o,a)&&(l=u),e.restore(),l||null)})}function TB(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var MB={type:"group",tag:"g",nested:!1,attr:xB,bound:_B,draw:CB,pick:FB,isect:$M,content:SB,background:wB,foreground:EB},mc={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function ix(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function rx(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function sx(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function Zp(e,t){return e==="center"?t/2:e==="right"?t:0}function eg(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function DB(e,t,n){const i=ix(t,n),r=rx(t,i),s=sx(t,i),o=(t.x||0)-Zp(t.align,r),a=(t.y||0)-eg(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,mc["xmlns:xlink"],"xlink:href"),e("transform",ko(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function OB(e,t){const n=t.image,i=rx(t,n),r=sx(t,n),s=(t.x||0)-Zp(t.align,i),o=(t.y||0)-eg(t.baseline,r);return e.set(s,o,s+i,o+r)}function RB(e,t,n){vi(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=ix(i,this);let s=rx(i,r),o=sx(i,r);if(s===0||o===0)return;let a=(i.x||0)-Zp(i.align,s),u=(i.y||0)-eg(i.baseline,o),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f<c?(d=s/c,u+=(o-d)/2,o=d):(d=o*c,a+=(s-d)/2,s=d))),(r.complete||r.toDataURL)&&(ru(e,i),e.globalAlpha=(l=i.opacity)!=null?l:1,e.imageSmoothingEnabled=i.smooth!==!1,e.drawImage(r,a,u,s,o))})}var NB={type:"image",tag:"image",nested:!1,attr:DB,bound:OB,draw:RB,pick:Qp(),isect:Rn,get:ix,xOffset:Zp,yOffset:eg},LB=nx("line",eB,mB);function PB(e,t){var n=t.scaleX||1,i=t.scaleY||1;(n!==1||i!==1)&&e("vector-effect","non-scaling-stroke"),e("transform",hB(t)),e("d",t.path)}function xd(e,t){var n=t.path;if(n==null)return!0;var i=t.x||0,r=t.y||0,s=t.scaleX||1,o=t.scaleY||1,a=(t.angle||0)*Fs,u=t.pathCache;(!u||u.path!==n)&&((t.pathCache=u=iu(n)).path=n),a&&e.rotate&&e.translate?(e.translate(i,r),e.rotate(a),pc(e,u,0,0,s,o),e.rotate(-a),e.translate(-i,-r)):pc(e,u,i,r,s,o)}function zB(e,t){return xd(Xc(e,t.angle),t)?e.set(0,0,0,0):Hr(e,t,!0)}var IB={type:"path",tag:"path",nested:!1,attr:PB,bound:zB,draw:Qv(xd),pick:Zv(xd),isect:Yv(xd)};function BB(e,t){e("d",zu(null,t))}function UB(e,t){var n,i;return Hr(e.set(n=t.x||0,i=t.y||0,n+t.width||0,i+t.height||0),t)}function NS(e,t){e.beginPath(),zu(e,t)}var jB={type:"rect",tag:"path",nested:!1,attr:BB,bound:UB,draw:Qv(NS),pick:Zv(NS),isect:$M};function qB(e,t){e("transform",FM(t)),e("x2",t.x2!=null?t.x2-(t.x||0):0),e("y2",t.y2!=null?t.y2-(t.y||0):0)}function WB(e,t){var n,i;return Hr(e.set(n=t.x||0,i=t.y||0,t.x2!=null?t.x2:n,t.y2!=null?t.y2:i),t)}function OM(e,t,n){var i,r,s,o;return t.stroke&&su(e,t,n)?(i=t.x||0,r=t.y||0,s=t.x2!=null?t.x2:i,o=t.y2!=null?t.y2:r,e.beginPath(),e.moveTo(i,r),e.lineTo(s,o),!0):!1}function HB(e,t,n){vi(t,i=>{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&OM(e,i,r)&&(ru(e,i),e.stroke())}})}function GB(e,t,n,i){return e.isPointInStroke?OM(e,t,1)&&e.isPointInStroke(n,i):!1}var VB={type:"rule",tag:"line",nested:!1,attr:qB,bound:WB,draw:HB,pick:Qp(GB),isect:AM},XB=tx("shape",tB),YB=tx("symbol",nB,Kv);const LS=cC();var Mn={height:ur,measureWidth:ox,estimateWidth:sh,width:sh,canvas:RM};RM(!0);function RM(e){Mn.width=e&&$s?ox:sh}function sh(e,t){return NM(Ms(e,t),ur(e))}function NM(e,t){return~~(.8*e.length*t)}function ox(e,t){return ur(e)<=0||!(t=Ms(e,t))?0:LM(t,tg(e))}function LM(e,t){const n=`(${t}) ${e}`;let i=LS.get(n);return i===void 0&&($s.font=t,i=$s.measureText(e).width,LS.set(n,i)),i}function ur(e){return e.fontSize!=null?+e.fontSize||0:11}function Ts(e){return e.lineHeight!=null?e.lineHeight:ur(e)+2}function KB(e){return L(e)?e.length>1?e:e[0]:e}function Kc(e){return KB(e.lineBreak&&e.text&&!L(e.text)?e.text.split(e.lineBreak):e.text)}function ax(e){const t=Kc(e);return(L(t)?t.length-1:0)*Ts(e)}function Ms(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?QB(e,n):n}function JB(e){if(Mn.width===ox){const t=tg(e);return n=>LM(n,t)}else if(Mn.width===sh){const t=ur(e);return n=>NM(n,t)}else return t=>Mn.width(e,t)}function QB(e,t){var n=+e.limit,i=JB(e);if(i(t)<n)return t;var r=e.ellipsis||"…",s=e.dir==="rtl",o=0,a=t.length,u;if(n-=i(r),s){for(;o<a;)u=o+a>>>1,i(t.slice(u))>n?o=u+1:a=u;return r+t.slice(o)}else{for(;o<a;)u=1+(o+a>>>1),i(t.slice(0,u))<n?o=u:a=u-1;return t.slice(0,o)+r}}function Jc(e,t){var n=e.font;return(t&&n?String(n).replace(/"/g,"'"):n)||"sans-serif"}function tg(e,t){return(e.fontStyle?e.fontStyle+" ":"")+(e.fontVariant?e.fontVariant+" ":"")+(e.fontWeight?e.fontWeight+" ":"")+ur(e)+"px "+Jc(e,t)}function ux(e){var t=e.baseline,n=ur(e);return Math.round(t==="top"?.79*n:t==="middle"?.3*n:t==="bottom"?-.21*n:t==="line-top"?.29*n+.5*Ts(e):t==="line-bottom"?.29*n-.5*Ts(e):0)}const ZB={left:"start",center:"middle",right:"end"},Hl=new nt;function ng(e){var t=e.x||0,n=e.y||0,i=e.radius||0,r;return i&&(r=(e.theta||0)-yo,t+=i*Math.cos(r),n+=i*Math.sin(r)),Hl.x1=t,Hl.y1=n,Hl}function eU(e,t){var n=t.dx||0,i=(t.dy||0)+ux(t),r=ng(t),s=r.x1,o=r.y1,a=t.angle||0,u;e("text-anchor",ZB[t.align]||"start"),a?(u=ko(s,o)+" "+ex(a),(n||i)&&(u+=" "+ko(n,i))):u=ko(s+n,o+i),e("transform",u)}function lx(e,t,n){var i=Mn.height(t),r=t.align,s=ng(t),o=s.x1,a=s.y1,u=t.dx||0,l=(t.dy||0)+ux(t)-Math.round(.8*i),c=Kc(t),f;if(L(c)?(i+=Ts(t)*(c.length-1),f=c.reduce((d,h)=>Math.max(d,Mn.width(t,h)),0)):f=Mn.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=o,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Fs,o,a);else if(n===2)return e.rotatedPoints(t.angle*Fs,o,a);return e}function tU(e,t,n){vi(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=tg(i),e.textAlign=i.align||"left",s=ng(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*Fs),o=a=0),o+=i.dx||0,a+=(i.dy||0)+ux(i),c=Kc(i),ru(e,i),L(c))for(l=Ts(i),u=0;u<c.length;++u)f=Ms(i,c[u]),i.fill&&ih(e,i,r)&&e.fillText(f,o,a),i.stroke&&su(e,i,r)&&e.strokeText(f,o,a),a+=l;else f=Ms(i,c),i.fill&&ih(e,i,r)&&e.fillText(f,o,a),i.stroke&&su(e,i,r)&&e.strokeText(f,o,a);i.angle&&e.restore()}})}function nU(e,t,n,i,r,s){if(t.fontSize<=0)return!1;if(!t.angle)return!0;var o=ng(t),a=o.x1,u=o.y1,l=lx(Hl,t,1),c=-t.angle*Fs,f=Math.cos(c),d=Math.sin(c),h=f*r-d*s+(a-f*a+d*u),p=d*r+f*s+(u-d*a-f*u);return l.contains(h,p)}function iU(e,t){const n=lx(Hl,e,2);return Oa(t,n[0],n[1],n[2],n[3])||Oa(t,n[0],n[1],n[4],n[5])||Oa(t,n[4],n[5],n[6],n[7])||Oa(t,n[2],n[3],n[6],n[7])}var rU={type:"text",tag:"text",nested:!1,attr:eU,bound:lx,draw:tU,pick:Qp(nU),isect:iU},sU=nx("trail",iB,yB),Pn={arc:pB,area:bB,group:MB,image:NB,line:LB,path:IB,rect:jB,rule:VB,shape:XB,symbol:YB,text:rU,trail:sU};function v1(e,t,n){var i=Pn[e.mark.marktype],r=t||i.bound;return i.nested&&(e=e.mark),r(e.bounds||(e.bounds=new nt),e,n)}var PS={mark:null};function PM(e,t,n){var i=Pn[e.marktype],r=i.bound,s=e.items,o=s&&s.length,a,u,l,c;if(i.nested)return o?l=s[0]:(PS.mark=e,l=PS),c=v1(l,r,n),t=t&&t.union(c)||c,t;if(t=t||e.bounds&&e.bounds.clear()||new nt,o)for(a=0,u=s.length;a<u;++a)t.union(v1(s[a],r,n));return e.bounds=t}const oU=["marktype","name","role","interactive","clip","items","zindex","x","y","width","height","align","baseline","fill","fillOpacity","opacity","blend","stroke","strokeOpacity","strokeWidth","strokeCap","strokeDash","strokeDashOffset","strokeForeground","strokeOffset","startAngle","endAngle","innerRadius","outerRadius","cornerRadius","padAngle","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight","interpolate","tension","orient","defined","url","aspect","smooth","path","scaleX","scaleY","x2","y2","size","shape","text","angle","theta","radius","dir","dx","dy","ellipsis","limit","lineBreak","lineHeight","font","fontSize","fontWeight","fontStyle","fontVariant","description","aria","ariaRole","ariaRoleDescription"];function zM(e,t){return JSON.stringify(e,oU,t)}function IM(e){const t=typeof e=="string"?JSON.parse(e):e;return BM(t)}function BM(e){var t=e.marktype,n=e.items,i,r,s;if(n)for(r=0,s=n.length;r<s;++r)i=t?"mark":"group",n[r][i]=e,n[r].zindex&&(n[r][i].zdirty=!0),(t||i)==="group"&&BM(n[r]);return t&&PM(e),e}class UM{constructor(t){arguments.length?this.root=IM(t):(this.root=zS({marktype:"group",name:"root",role:"frame"}),this.root.items=[new Kp(this.root)])}toJSON(t){return zM(this.root,t||0)}mark(t,n,i){n=n||this.root.items[0];const r=zS(t,n);return n.items[i]=r,r.zindex&&(r.group.zdirty=!0),r}}function zS(e,t){const n={bounds:new nt,clip:!!e.clip,group:t,interactive:e.interactive!==!1,items:[],marktype:e.marktype,name:e.name||void 0,role:e.role||void 0,zindex:e.zindex||0};return e.aria!=null&&(n.aria=e.aria),e.description&&(n.description=e.description),n}function hs(e,t,n){return!e&&typeof document<"u"&&document.createElement&&(e=document),e?n?e.createElementNS(n,t):e.createElement(t):null}function cx(e,t){t=t.toLowerCase();for(var n=e.childNodes,i=0,r=n.length;i<r;++i)if(n[i].tagName.toLowerCase()===t)return n[i]}function rt(e,t,n,i){var r=e.childNodes[t],s;return(!r||r.tagName.toLowerCase()!==n.toLowerCase())&&(s=r||null,r=hs(e.ownerDocument,n,i),e.insertBefore(r,s)),r}function Un(e,t){for(var n=e.childNodes,i=n.length;i>t;)e.removeChild(n[--i]);return e}function jM(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function ig(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function aU(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=Pn[r.marktype]).tip){for(o=ig(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}let fx=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||$p(),this._tooltip=n||uU}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const s=new MouseEvent(t.type,t),o=hs(null,"a");for(const a in r)o.setAttribute(a,r[a]);o.dispatchEvent(s)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=aU(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,s=t.bounds,o=s.width(),a=s.height();let u=s.x1+r[0]+i.left,l=s.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:o,height:a,left:u,top:l,right:u+o,bottom:l+a}}};function uU(e,t,n,i){e.element().setAttribute("title",i||"")}class Qc{constructor(t){this._el=null,this._bgcolor=null,this._loader=new _M(t)}initialize(t,n,i,r,s){return this._el=t,this.resize(n,i,r,s)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const s=i._call;i._ready=i._loader.ready().then(o=>{o&&s(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const lU="keydown",cU="keypress",fU="keyup",qM="dragenter",wd="dragleave",WM="dragover",x1="pointerdown",dU="pointerup",oh="pointermove",Ed="pointerout",HM="pointerover",w1="mousedown",hU="mouseup",GM="mousemove",ah="mouseout",VM="mouseover",uh="click",pU="dblclick",gU="wheel",XM="mousewheel",lh="touchstart",ch="touchmove",fh="touchend",mU=[lU,cU,fU,qM,wd,WM,x1,dU,oh,Ed,HM,w1,hU,GM,ah,VM,uh,pU,gU,XM,lh,ch,fh],E1=oh,Gl=ah,S1=uh;class Zc extends fx{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=mU,this.pointermove=BS([oh,GM],[HM,VM],[Ed,ah]),this.dragover=BS([WM],[qM],[wd]),this.pointerout=US([Ed,ah]),this.dragleave=US([wd])}initialize(t,n,i){return this._canvas=t&&cx(t,"canvas"),[uh,w1,x1,oh,Ed,wd].forEach(r=>IS(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(XM,t)}pointerdown(t){this._down=this._active,this.fire(x1,t)}mousedown(t){this._down=this._active,this.fire(w1,t)}click(t){this._down===this._active&&(this.fire(uh,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(lh,t,!0)}touchmove(t){this.fire(ch,t,!0)}touchend(t){this.fire(fh,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,s=this._handlers[t];if(n.vegaType=t,t===S1&&r&&r.href?this.handleHref(n,r,r.href):(t===E1||t===Gl)&&this.handleTooltip(n,r,t!==Gl),s)for(let o=0,a=s.length;o<a;++o)s[o].handler.call(this._obj,n,r)}on(t,n){const i=this.eventName(t),r=this._handlers;return this._handlerIndex(r[i],t,n)<0&&(IS(this,t),(r[i]||(r[i]=[])).push({type:t,handler:n})),this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&r.splice(s,1),this}pickEvent(t){const n=ig(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,s){const o=this.context();return Pn[t.marktype].pick.call(this,o,t,n,i,r,s)}}const yU=e=>e===lh||e===ch||e===fh?[lh,ch,fh]:[e];function IS(e,t){yU(t).forEach(n=>bU(e,n))}function bU(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Ml(e,t,n){t.forEach(i=>e.fire(i,n))}function BS(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?Ml(this,e,i):((!r||!r.exit)&&Ml(this,n,i),this._active=s,Ml(this,t,i),Ml(this,e,i))}}function US(e){return function(t){Ml(this,e,t),this._active=null}}function vU(){return typeof window<"u"&&window.devicePixelRatio||1}function xU(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=o?vU():r;e.width=t*u,e.height=n*u;for(const l in s)a[l]=s[l];return o&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class dh extends Qc{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new nt,this._tempb=new nt}initialize(t,n,i,r,s,o){return this._options=o||{},this._canvas=this._options.externalContext?null:_s(1,1,this._options.type),t&&this._canvas&&(Un(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,s)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)xU(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||N("CanvasRenderer is missing a valid canvas or context"),s.scale(this._scale,this._scale),s.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,s=this._width,o=this._height,a=this._dirty,u=wU(r,s,o);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):EU(i,u.intersect(a),r);return this.clear(-r[0],-r[1],s,o),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const s=Pn[n.marktype];n.clip&&vB(t,n),s.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const s=this._options,o=this.context();s.type!=="pdf"&&!s.externalContext&&o.clearRect(t,n,i,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(t,n,i,r))}}const wU=(e,t,n)=>new nt().set(0,0,t,n).translate(-e[0],-e[1]);function EU(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class YM extends fx{constructor(t,n){super(t,n);const i=this;i._hrefHandler=jm(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=jm(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Gl)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(S1,this._hrefHandler),r.removeEventListener(E1,this._tooltipHandler),r.removeEventListener(Gl,this._tooltipHandler)),this._svg=r=t&&cx(t,"svg"),r&&(r.addEventListener(S1,this._hrefHandler),r.addEventListener(E1,this._tooltipHandler),r.addEventListener(Gl,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const o={type:t,handler:n,listener:jm(this,n)};(r[i]||(r[i]=[])).push(o),this._svg&&this._svg.addEventListener(i,o.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&(this._svg&&this._svg.removeEventListener(i,r[s].listener),r.splice(s,1)),this}}const jm=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},KM="aria-hidden",dx="aria-label",hx="role",px="aria-roledescription",JM="graphics-object",gx="graphics-symbol",QM=(e,t,n)=>({[hx]:e,[px]:t,[dx]:n||void 0}),SU=yi(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),jS={axis:{desc:"axis",caption:AU},legend:{desc:"legend",caption:kU},"title-text":{desc:"title",caption:e=>`Title text '${WS(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${WS(e)}'`}},qS={ariaRole:hx,ariaRoleDescription:px,description:dx};function ZM(e,t){const n=t.aria===!1;if(e(KM,n||void 0),n||t.description==null)for(const i in qS)e(qS[i],void 0);else{const i=t.mark.marktype;e(dx,t.description),e(hx,t.ariaRole||(i==="group"?JM:gx)),e(px,t.ariaRoleDescription||`${i} mark`)}}function eD(e){return e.aria===!1?{[KM]:!0}:SU[e.role]?null:jS[e.role]?$U(e,jS[e.role]):_U(e)}function _U(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return QM(n?JM:gx,`${t} mark container`,e.description)}function $U(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return QM(t.role||gx,t.desc,n.description||i(n))}catch{return null}}function WS(e){return Y(e.text).join(" ")}function AU(e){const t=e.datum,n=e.orient,i=t.title?tD(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${nu(a)?"discrete":a} scale with ${pM(o,s,e)}`}function kU(e){const t=e.datum,n=t.title?tD(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,u=o.dataflow.locale();return FU(i)+(n?` titled '${n}'`:"")+` for ${CU(s)} with ${pM(u,a,e)}`}function tD(e){try{return Y(xe(e.items).items[0].text).join(" ")}catch{return null}}function CU(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+xe(e)}function FU(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const nD=e=>(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),TU=e=>nD(e).replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;");function mx(){let e="",t="",n="";const i=[],r=()=>t=n="",s=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},o=(u,l)=>(l!=null&&(t+=` ${u}="${TU(l)}"`),a),a={open(u){s(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f<l;f++)c[f-1]=arguments[f];for(const d of c)for(const h in d)o(h,d[h]);return a},close(){const u=i.pop();return t?e+=t+(n?`>${n}</${u}>`:"/>"):e+=`</${u}>`,r(),a},attr:o,text:u=>(n+=nD(u),a),toString:()=>e};return a}const iD=e=>rD(mx(),e)+"";function rD(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r<i;++r)e.attr(n[r].name,n[r].value)}if(t.hasChildNodes()){const n=t.childNodes;for(const i of n)i.nodeType===3?e.text(i.nodeValue):rD(e,i)}return e.close()}const hh={fill:"fill",fillOpacity:"fill-opacity",stroke:"stroke",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",strokeCap:"stroke-linecap",strokeJoin:"stroke-linejoin",strokeDash:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeMiterLimit:"stroke-miterlimit",opacity:"opacity"},ph={blend:"mix-blend-mode"},sD={fill:"none","stroke-miterlimit":10},ll=0,HS="http://www.w3.org/2000/xmlns/",it=mc.xmlns;class yx extends Qc{constructor(t){super(t),this._dirtyID=0,this._dirty=[],this._svg=null,this._root=null,this._defs=null}initialize(t,n,i,r,s){return this._defs={},this._clearDefs(),t&&(this._svg=rt(t,0,"svg",it),this._svg.setAttributeNS(HS,"xmlns",it),this._svg.setAttributeNS(HS,"xmlns:xlink",mc["xmlns:xlink"]),this._svg.setAttribute("version",mc.version),this._svg.setAttribute("class","marks"),Un(t,1),this._root=rt(this._svg,ll,"g",it),ps(this._root,sD),Un(this._svg,ll+1)),this.background(this._bgcolor),super.initialize(t,n,i,r,s)}background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),super.background(...arguments)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svg&&(ps(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}),this._root.setAttribute("transform",`translate(${this._origin})`)),this._dirty=[],this}canvas(){return this._svg}svg(){const t=this._svg,n=this._bgcolor;if(!t)return null;let i;n&&(t.removeAttribute("style"),i=rt(t,ll,"rect",it),ps(i,{width:this._width,height:this._height,fill:n}));const r=iD(t);return n&&(t.removeChild(i),this._svg.style.setProperty("background-color",n)),r}_render(t,n){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t,void 0,n),Un(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this}dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))}isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID}_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const n=++this._dirtyID;let i,r,s,o,a,u,l;for(a=0,u=t.length;a<u;++a)if(i=t[a],r=i.mark,r.marktype!==s&&(s=r.marktype,o=Pn[s]),r.zdirty&&r.dirty!==n&&(this._dirtyAll=!1,GS(i,n),r.items.forEach(c=>{c.dirty=n})),!r.zdirty){if(i.exit){o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=o.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,GS(i,n)):this._update(o,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const s=this._svg,o=n.marktype,a=Pn[o],u=n.interactive===!1?"none":null,l=a.tag==="g",c=VS(n,t,i,"g",s);if(o!=="group"&&r!=null&&!r.includes(o))return Un(c,0),n._svg;c.setAttribute("class",jM(n));const f=eD(n);for(const g in f)Xt(c,g,f[g]);l||Xt(c,"pointer-events",u),Xt(c,"clip-path",n.clip?Xv(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),y=VS(g,c,d,a.tag,s);m&&(this._update(a,y,g),l&&OU(this,y,g,r)),d=y,++h};return a.nested?n.items.length&&p(n.items[0]):vi(n,p),Un(c,h),c}_update(t,n,i){Mr=n,Nt=n.__values__,ZM(Vl,i),t.attr(Vl,i,this);const r=NU[t.type];r&&r.call(this,t,n,i),Mr&&this.style(Mr,i)}style(t,n){if(n!=null){for(const i in hh){let r=i==="font"?Jc(n):n[i];if(r===Nt[i])continue;const s=hh[i];r==null?t.removeAttribute(s):(Hv(r)&&(r=mM(r,this._defs.gradient,oD())),t.setAttribute(s,r+"")),Nt[i]=r}for(const i in ph)Sd(t,ph[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const s in n.gradient)i||(n.el=i=rt(t,ll+1,"defs",it)),r=MU(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=rt(t,ll+1,"defs",it)),r=DU(i,n.clipping[s],r);i&&(r===0?(t.removeChild(i),n.el=null):Un(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function GS(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function MU(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=rt(e,n++,"pattern",it);ps(o,{id:nh+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=rt(o,0,"rect",it),ps(o,{width:1,height:1,fill:`url(${oD()}#${t.id})`}),e=rt(e,n++,"radialGradient",it),ps(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=rt(e,n++,"linearGradient",it),ps(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i<r;++i)s=rt(e,i,"stop",it),s.setAttribute("offset",t.stops[i].offset),s.setAttribute("stop-color",t.stops[i].color);return Un(e,i),n}function DU(e,t,n){let i;return e=rt(e,n,"clipPath",it),e.setAttribute("id",t.id),t.path?(i=rt(e,0,"path",it),i.setAttribute("d",t.path)):(i=rt(e,0,"rect",it),ps(i,{x:0,y:0,width:t.width,height:t.height})),Un(e,1),n+1}function OU(e,t,n,i){t=t.lastChild.previousSibling;let r,s=0;vi(n,o=>{r=e.mark(t,o,r,i),++s}),Un(t,1+s)}function VS(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=hs(o,i,it),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=hs(o,"path",it);s.appendChild(a),a.__data__=e;const u=hs(o,"g",it);s.appendChild(u),u.__data__=e;const l=hs(o,"path",it);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||RU(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function RU(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Mr=null,Nt=null;const NU={group(e,t,n){const i=Mr=t.childNodes[2];Nt=i.__values__,e.foreground(Vl,n,this),Nt=t.__values__,Mr=t.childNodes[1],e.content(Vl,n,this);const r=Mr=t.childNodes[0];e.background(Vl,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==Nt.events&&(Xt(i,"pointer-events",s),Xt(r,"pointer-events",s),Nt.events=s),n.strokeForeground&&n.stroke){const o=n.fill;Xt(i,"display",null),this.style(r,n),Xt(r,"stroke",null),o&&(n.fill=null),Nt=i.__values__,this.style(i,n),o&&(n.fill=o),Mr=null}else Xt(i,"display","none")},image(e,t,n){n.smooth===!1?(Sd(t,"image-rendering","optimizeSpeed"),Sd(t,"image-rendering","pixelated")):Sd(t,"image-rendering",null)},text(e,t,n){const i=Kc(n);let r,s,o,a;L(i)?(s=i.map(u=>Ms(n,u)),r=s.join(`
18
- `),r!==Nt.text&&(Un(t,0),o=t.ownerDocument,a=Ts(n),s.forEach((u,l)=>{const c=hs(o,"tspan",it);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Nt.text=r)):(s=Ms(n,i),s!==Nt.text&&(t.textContent=s,Nt.text=s)),Xt(t,"font-family",Jc(n)),Xt(t,"font-size",ur(n)+"px"),Xt(t,"font-style",n.fontStyle),Xt(t,"font-variant",n.fontVariant),Xt(t,"font-weight",n.fontWeight)}};function Vl(e,t,n){t!==Nt[e]&&(n?LU(Mr,e,t,n):Xt(Mr,e,t),Nt[e]=t)}function Sd(e,t,n){n!==Nt[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Nt[t]=n)}function ps(e,t){for(const n in t)Xt(e,n,t[n])}function Xt(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function LU(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function oD(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class aD extends Qc{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=mx();n.open("svg",ce({},mc,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",sD,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=Pn[n.marktype],r=i.tag,s=[ZM,i.attr];t.open("g",{class:jM(n),"clip-path":n.clip?Xv(this,n,n.group):null},eD(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const o=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,s,r!=="g"?r:null)),r==="text"){const l=Kc(a);if(L(l)){const c={x:0,dy:Ts(a)};for(let f=0;f<l.length;++f)t.open("tspan",f?c:null).text(Ms(a,l[f])).close()}else t.text(Ms(a,l))}else if(r==="g"){const l=a.strokeForeground,c=a.fill,f=a.stroke;l&&f&&(a.stroke=null),t.open("path",this.attr(n,a,i.background,"bgrect")).close(),t.open("g",this.attr(n,a,i.content)),vi(a,d=>this.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&o(n.items[0]):vi(n,o),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const s={},o=(a,u,l,c)=>{s[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(o,n,this)):i(o,n,this),r&&PU(s,n,t,r,this._defs),s}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const s in n){const o=n[s],a=o.stops;o.gradient==="radial"?(t.open("pattern",{id:nh+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):t.open("linearGradient",{id:s,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let u=0;u<a.length;++u)t.open("stop",{offset:a[u].offset,"stop-color":a[u].color}).close();t.close()}for(const s in i){const o=i[s];t.open("clipPath",{id:s}),o.path?t.open("path",{d:o.path}).close():t.open("rect",{x:0,y:0,width:o.width,height:o.height}).close(),t.close()}t.close()}}}function PU(e,t,n,i,r){let s;if(t==null||(i==="bgrect"&&n.interactive===!1&&(e["pointer-events"]="none"),i==="bgfore"&&(n.interactive===!1&&(e["pointer-events"]="none"),e.display="none",t.fill!==null)))return e;i==="image"&&t.smooth===!1&&(s=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),i==="text"&&(e["font-family"]=Jc(t),e["font-size"]=ur(t)+"px",e["font-style"]=t.fontStyle,e["font-variant"]=t.fontVariant,e["font-weight"]=t.fontWeight);for(const o in hh){let a=t[o];const u=hh[o];a==="transparent"&&(u==="fill"||u==="stroke")||a!=null&&(Hv(a)&&(a=mM(a,r.gradient,"")),e[u]=a)}for(const o in ph){const a=t[o];a!=null&&(s=s||[],s.push(`${ph[o]}: ${a};`))}return s&&(e.style=s.join(" ")),e}const ai={svgMarkTypes:["text"],svgOnTop:!0,debug:!1};function zU(e){ai.svgMarkTypes=e.svgMarkTypes??["text"],ai.svgOnTop=e.svgOnTop??!0,ai.debug=e.debug??!1}class _1 extends Qc{constructor(t){super(t),this._svgRenderer=new yx(t),this._canvasRenderer=new dh(t)}initialize(t,n,i,r,s){this._root_el=rt(t,0,"div");const o=rt(this._root_el,0,"div"),a=rt(this._root_el,1,"div");return this._root_el.style.position="relative",ai.debug||(o.style.height="100%",a.style.position="absolute",a.style.top="0",a.style.left="0",a.style.height="100%",a.style.width="100%"),this._svgEl=ai.svgOnTop?a:o,this._canvasEl=ai.svgOnTop?o:a,this._svgEl.style.pointerEvents="none",this._canvasRenderer.initialize(this._canvasEl,n,i,r,s),this._svgRenderer.initialize(this._svgEl,n,i,r,s),super.initialize(t,n,i,r,s)}dirty(t){return ai.svgMarkTypes.includes(t.mark.marktype)?this._svgRenderer.dirty(t):this._canvasRenderer.dirty(t),this}_render(t,n){const r=(n??["arc","area","image","line","path","rect","rule","shape","symbol","text","trail"]).filter(s=>!ai.svgMarkTypes.includes(s));this._svgRenderer.render(t,ai.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return ai.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class uD extends Zc{constructor(t,n){super(t,n)}initialize(t,n,i){const r=rt(rt(t,0,"div"),ai.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const lD="canvas",cD="hybrid",fD="png",dD="svg",hD="none",gs={Canvas:lD,PNG:fD,SVG:dD,Hybrid:cD,None:hD},Lo={};Lo[lD]=Lo[fD]={renderer:dh,headless:dh,handler:Zc};Lo[dD]={renderer:yx,headless:aD,handler:YM};Lo[cD]={renderer:_1,headless:_1,handler:uD};Lo[hD]={};function rg(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Lo[e]=t,this):Lo[e]}function pD(e,t,n){const i=[],r=new nt().union(t),s=e.marktype;return s?gD(e,r,n,i):s==="group"?mD(e,r,n,i):N("Intersect scene must be mark node or group item.")}function gD(e,t,n,i){if(IU(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a<o;++a)mD(r[a],t,n,i);else for(const u=Pn[s].isect;a<o;++a){const l=r[a];yD(l,t,u)&&i.push(l)}}return i}function IU(e,t,n){return e.bounds&&t.intersects(e.bounds)&&(e.marktype==="group"||e.interactive!==!1&&(!n||n(e)))}function mD(e,t,n,i){n&&n(e.mark)&&yD(e,t,Pn.group.isect)&&i.push(e);const r=e.items,s=r&&r.length;if(s){const o=e.x||0,a=e.y||0;t.translate(-o,-a);for(let u=0;u<s;++u)gD(r[u],t,n,i);t.translate(o,a)}return i}function yD(e,t,n){const i=e.bounds;return t.encloses(i)||t.intersects(i)&&n(e,t)}const qm=new nt;function bD(e){const t=e.clip;if(fe(t))t(Xc(qm.clear()));else if(t)qm.set(0,0,e.group.width,e.group.height);else return;e.bounds.intersect(qm)}const BU=1e-9;function bx(e,t,n){return e===t?!0:n==="path"?vD(e,t):e instanceof Date&&t instanceof Date?+e==+t:$e(e)&&$e(t)?Math.abs(e-t)<=BU:!e||!t||!X(e)&&!X(t)?e==t:UU(e,t)}function vD(e,t){return bx(iu(e),iu(t))}function UU(e,t){var n=Object.keys(e),i=Object.keys(t),r,s;if(n.length!==i.length)return!1;for(n.sort(),i.sort(),s=n.length-1;s>=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!bx(e[r],t[r],r))return!1;return typeof e==typeof t}function jU(){SM(),d8()}const ou="top",ci="left",fi="right",Ds="bottom",qU="top-left",WU="top-right",HU="bottom-left",GU="bottom-right",vx="start",$1="middle",Yt="end",VU="x",XU="y",sg="group",xx="axis",wx="title",YU="frame",KU="scope",Ex="legend",xD="row-header",wD="row-footer",ED="row-title",SD="column-header",_D="column-footer",$D="column-title",JU="padding",QU="symbol",AD="fit",kD="fit-x",CD="fit-y",ZU="pad",Sx="none",Of="all",A1="each",_x="flush",ms="column",ys="row";function FD(e){D.call(this,null,e)}G(FD,D,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=Pn[r],o=s.bound;let a=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=Rf(i,o),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===sg||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(Rf(l,o))),i.role){case xx:case Ex:case wx:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(Rf(l,o))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(Rf(l,o))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return bD(i),t.modifies("bounds")}});function Rf(e,t,n){return t(e.bounds.clear(),e,n)}const XS=":vega_identifier:";function $x(e){D.call(this,0,e)}$x.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]};G($x,D,{transform(e,t){const n=ej(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function ej(e){return e._signals[XS]||(e._signals[XS]=e.add(0))}function TD(e){D.call(this,null,e)}G(TD,D,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,tj(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===sg?Kp:Yp;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function tj(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function MD(e){D.call(this,null,e)}const YS={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!DD(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},DD=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),KS=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n<i;r=s,++n)if(DD(r,s=e[n].bounds,t))return!0},nj=e=>{const t=e.bounds;return t.width()>1&&t.height()>1},ij=(e,t,n)=>{var i=e.range(),r=new nt;return t===ou||t===Ds?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},JS=e=>(e.forEach(t=>t.opacity=1),e),QS=(e,t)=>e.reflow(t.modified()).modifies("opacity");G(MD,D,{transform(e,t){const n=YS[e.method]||YS.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(JS(r),t=QS(t,e)),t;if(r=r.filter(nj),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=JS(r),t=QS(t,e),s.length>=3&&KS(s,i)){do s=n(s,i);while(s.length>=3&&KS(s,i));s.length<3&&!xe(r).opacity&&(s.length>1&&(xe(s).opacity=0),xe(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=ij(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{o(u)||(u.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function OD(e){D.call(this,null,e)}G(OD,D,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const Rt=new nt;function Ra(e,t,n){return e[t]===n?0:(e[t]=n,1)}function rj(e){var t=e.items[0].orient;return t===ci||t===fi}function sj(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function oj(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,u=sj(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=s.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&ax(p),b=0,v=0,x,E;switch(Rt.clear().union(m),m.clear(),(x=u[0])>-1&&m.union(r.items[x].bounds),(x=u[1])>-1&&m.union(r.items[x].bounds),a){case ou:b=f||0,v=-c,E=Math.max(d,Math.min(h,-m.y1)),m.add(0,-E).add(l,0),p&&Nf(e,p,E,g,y,0,-1,m);break;case ci:b=-c,v=f||0,E=Math.max(d,Math.min(h,-m.x1)),m.add(-E,0).add(0,l),p&&Nf(e,p,E,g,y,1,-1,m);break;case fi:b=n+c,v=f||0,E=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(E,l),p&&Nf(e,p,E,g,y,1,1,m);break;case Ds:b=f||0,v=i+c,E=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,E),p&&Nf(e,p,E,g,0,0,1,m);break;default:b=r.x,v=r.y}return Hr(m.translate(b,v),r),Ra(r,"x",b+o)|Ra(r,"y",v+o)&&(r.bounds=Rt,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function Nf(e,t,n,i,r,s,o,a){const u=t.bounds;if(t.auto){const l=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const ZS=(e,t)=>Math.floor(Math.min(e,t)),e_=(e,t)=>Math.ceil(Math.max(e,t));function aj(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i<n;++i)if(r=t[i],s=r.items,r.marktype===sg)switch(r.role){case xx:case Ex:case wx:break;case xD:o.rowheaders.push(...s);break;case wD:o.rowfooters.push(...s);break;case SD:o.colheaders.push(...s);break;case _D:o.colfooters.push(...s);break;case ED:o.rowtitle=s[0];break;case $D:o.coltitle=s[0];break;default:o.marks.push(...s)}return o}function uj(e){return new nt().set(0,0,e.width||0,e.height||0)}function lj(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function je(e,t,n){const i=X(e)?e[t]:e;return i??(n!==void 0?n:0)}function t_(e){return e<0?Math.ceil(-e):0}function RD(e,t,n){var i=!n.nodirty,r=n.bounds===_x?uj:lj,s=Rt.set(0,0,0,0),o=je(n.align,ms),a=je(n.align,ys),u=je(n.padding,ms),l=je(n.padding,ys),c=n.columns||t.length,f=c<=0?1:Math.ceil(t.length/c),d=t.length,h=Array(d),p=Array(c),g=0,m=Array(d),y=Array(f),b=0,v=Array(d),x=Array(d),E=Array(d),S,w,_,$,C,T,O,k,F,A,M;for(w=0;w<c;++w)p[w]=0;for(w=0;w<f;++w)y[w]=0;for(w=0;w<d;++w)T=t[w],C=E[w]=r(T),T.x=T.x||0,v[w]=0,T.y=T.y||0,x[w]=0,_=w%c,$=~~(w/c),g=Math.max(g,O=Math.ceil(C.x2)),b=Math.max(b,k=Math.ceil(C.y2)),p[_]=Math.max(p[_],O),y[$]=Math.max(y[$],k),h[w]=u+t_(C.x1),m[w]=l+t_(C.y1),i&&e.dirty(t[w]);for(w=0;w<d;++w)w%c===0&&(h[w]=0),w<c&&(m[w]=0);if(o===A1)for(_=1;_<c;++_){for(M=0,w=_;w<d;w+=c)M<h[w]&&(M=h[w]);for(w=_;w<d;w+=c)h[w]=M+p[_-1]}else if(o===Of){for(M=0,w=0;w<d;++w)w%c&&M<h[w]&&(M=h[w]);for(w=0;w<d;++w)w%c&&(h[w]=M+g)}else for(o=!1,_=1;_<c;++_)for(w=_;w<d;w+=c)h[w]+=p[_-1];if(a===A1)for($=1;$<f;++$){for(M=0,w=$*c,S=w+c;w<S;++w)M<m[w]&&(M=m[w]);for(w=$*c;w<S;++w)m[w]=M+y[$-1]}else if(a===Of){for(M=0,w=c;w<d;++w)M<m[w]&&(M=m[w]);for(w=c;w<d;++w)m[w]=M+b}else for(a=!1,$=1;$<f;++$)for(w=$*c,S=w+c;w<S;++w)m[w]+=y[$-1];for(F=0,w=0;w<d;++w)F=h[w]+(w%c?F:0),v[w]+=F-t[w].x;for(_=0;_<c;++_)for(A=0,w=_;w<d;w+=c)A+=m[w],x[w]+=A-t[w].y;if(o&&je(n.center,ms)&&f>1)for(w=0;w<d;++w)C=o===Of?g:p[w%c],F=C-E[w].x2-t[w].x-v[w],F>0&&(v[w]+=F/2);if(a&&je(n.center,ys)&&c!==1)for(w=0;w<d;++w)C=a===Of?b:y[~~(w/c)],A=C-E[w].y2-t[w].y-x[w],A>0&&(x[w]+=A/2);for(w=0;w<d;++w)s.union(E[w].translate(v[w],x[w]));switch(F=je(n.anchor,VU),A=je(n.anchor,XU),je(n.anchor,ms)){case Yt:F-=s.width();break;case $1:F-=s.width()/2}switch(je(n.anchor,ys)){case Yt:A-=s.height();break;case $1:A-=s.height()/2}for(F=Math.round(F),A=Math.round(A),s.clear(),w=0;w<d;++w)t[w].mark.bounds.clear();for(w=0;w<d;++w)T=t[w],T.x+=v[w]+=F,T.y+=x[w]+=A,s.union(T.mark.bounds.union(T.bounds.translate(v[w],x[w]))),i&&e.dirty(T);return s}function cj(e,t,n){var i=aj(t),r=i.marks,s=n.bounds===_x?fj:dj,o=n.offset,a=n.columns||r.length,u=a<=0?1:Math.ceil(r.length/a),l=u*a,c,f,d,h,p,g,m;const y=RD(e,r,n);y.empty()&&y.set(0,0,0,0),i.rowheaders&&(g=je(n.headerBand,ys,null),c=Lf(e,i.rowheaders,r,a,u,-je(o,"rowHeader"),ZS,0,s,"x1",0,a,1,g)),i.colheaders&&(g=je(n.headerBand,ms,null),f=Lf(e,i.colheaders,r,a,a,-je(o,"columnHeader"),ZS,1,s,"y1",0,1,a,g)),i.rowfooters&&(g=je(n.footerBand,ys,null),d=Lf(e,i.rowfooters,r,a,u,je(o,"rowFooter"),e_,0,s,"x2",a-1,a,1,g)),i.colfooters&&(g=je(n.footerBand,ms,null),h=Lf(e,i.colfooters,r,a,a,je(o,"columnFooter"),e_,1,s,"y2",l-a,1,a,g)),i.rowtitle&&(p=je(n.titleAnchor,ys),m=je(o,"rowTitle"),m=p===Yt?d+m:c-m,g=je(n.titleBand,ys,.5),n_(e,i.rowtitle,m,0,y,g)),i.coltitle&&(p=je(n.titleAnchor,ms),m=je(o,"columnTitle"),m=p===Yt?h+m:f-m,g=je(n.titleBand,ms,.5),n_(e,i.coltitle,m,1,y,g))}function fj(e,t){return t==="x1"?e.x||0:t==="y1"?e.y||0:t==="x2"?(e.x||0)+(e.width||0):t==="y2"?(e.y||0)+(e.height||0):void 0}function dj(e,t){return e.bounds[t]}function Lf(e,t,n,i,r,s,o,a,u,l,c,f,d,h){var p=n.length,g=0,m=0,y,b,v,x,E,S,w,_,$;if(!p)return g;for(y=c;y<p;y+=f)n[y]&&(g=o(g,u(n[y],l)));if(!t.length)return g;for(t.length>r&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,x=t.length;b<x;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,x=t.length;b<x;++b,y+=f){for(S=t[b],E=S.mark.bounds,v=y;v>=0&&(w=n[v])==null;v-=d);a?(_=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),$=g):(_=g,$=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),E.union(S.bounds.translate(_-(S.x||0),$-(S.y||0))),S.x=_,S.y=$,e.dirty(S),m=o(m,E[l])}return m}function n_(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function hj(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function pj(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function gj(e,t,n,i,r,s,o){const a=hj(n,t),u=pj(e,a("offset",0)),l=a("anchor",vx),c=l===Yt?1:l===$1?.5:0,f={align:A1,bounds:a("bounds",_x),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case ci:f.anchor={x:Math.floor(i.x1)-u,column:Yt,y:c*(o||i.height()+2*i.y1),row:l};break;case fi:f.anchor={x:Math.ceil(i.x2)+u,y:c*(o||i.height()+2*i.y1),row:l};break;case ou:f.anchor={y:Math.floor(r.y1)-u,row:Yt,x:c*(s||r.width()+2*r.x1),column:l};break;case Ds:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case qU:f.anchor={x:u,y:u};break;case WU:f.anchor={x:s-u,y:u,column:Yt};break;case HU:f.anchor={x:u,y:o-u,row:Yt};break;case GU:f.anchor={x:s-u,y:o-u,column:Yt,row:Yt};break}return f}function mj(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),bj(e,n,n.items[0].items[0]),s=yj(n,s),u=2*n.padding,l=2*n.padding,s.empty()||(u=Math.ceil(s.width()+u),l=Math.ceil(s.height()+l)),i.type===QU&&vj(n.items[0].items[0].items[0].items),r!==Sx&&(n.x=o=0,n.y=a=0),n.width=u,n.height=l,Hr(s.set(o,a,o+u,a+l),n),n.mark.bounds.clear().union(s),n}function yj(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function bj(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&cl(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,u=t.titlePadding||0,l=i-o.x,c=i-o.y;switch(o.orient){case ci:r+=Math.ceil(o.bounds.width())+u;break;case fi:case Ds:break;default:s+=o.bounds.height()+u}switch((r||s)&&cl(e,n,r,s),o.orient){case ci:c+=va(t,n,o,a,1,1);break;case fi:l+=va(t,n,o,Yt,0,0)+u,c+=va(t,n,o,a,1,1);break;case Ds:l+=va(t,n,o,a,0,0),c+=va(t,n,o,Yt,-1,0,1)+u;break;default:l+=va(t,n,o,a,0,0)}(l||c)&&cl(e,o,l,c),(l=Math.round(o.bounds.x1-i))<0&&(cl(e,n,-l,0),cl(e,o,-l,0))}}function va(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(s||!u)&&!o?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&s?c:0,d=u&&s?0:c,h=r<=0?0:ax(n);return Math.round(i===vx?f:i===Yt?d-h:.5*(c-h))}function cl(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function vj(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function xj(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=a===ci||a===fi?i:n,p=0,g=0,m=0,y=0,b=0,v;if(o!==sg?a===ci?(p=r.y2,h=r.y1):a===fi?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===ci&&(p=i,h=0),v=u===vx?p:u===Yt?h:(p+h)/2,d&&d.text){switch(a){case ou:case Ds:b=f.bounds.height()+c;break;case ci:y=f.bounds.width()+c;break;case fi:y=-f.bounds.width()-c;break}Rt.clear().union(d.bounds),Rt.translate(y-(d.x||0),b-(d.y||0)),Ra(d,"x",y)|Ra(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Rt),d.mark.bounds.clear().union(Rt),e.dirty(d)),Rt.clear().union(d.bounds)}else Rt.clear();switch(Rt.union(f.bounds),a){case ou:g=v,m=r.y1-Rt.height()-l;break;case ci:g=r.x1-Rt.width()-l,m=v;break;case fi:g=r.x2+Rt.width()+l,m=v;break;case Ds:g=v,m=r.y2+l;break;default:g=s.x,m=s.y}return Ra(s,"x",g)|Ra(s,"y",m)&&(Rt.translate(g,m),e.dirty(s),s.bounds.clear().union(Rt),t.bounds.clear().union(Rt),e.dirty(s)),s.bounds}function ND(e){D.call(this,null,e)}G(ND,D,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&cj(n,i,e.layout),Ej(n,i,e)}),wj(e.mark.group)?t.reflow():t}});function wj(e){return e&&e.mark.role!=="legend-entry"}function Ej(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new nt().set(0,0,r,s),a=o.clone(),u=o.clone(),l=[],c,f,d,h,p,g;for(p=0,g=i.length;p<g;++p)switch(f=i[p],f.role){case xx:h=rj(f)?a:u,h.union(oj(e,f,r,s));break;case wx:c=f;break;case Ex:l.push(mj(e,f));break;case YU:case KU:case xD:case wD:case ED:case SD:case _D:case $D:a.union(f.bounds),u.union(f.bounds);break;default:o.union(f.bounds)}if(l.length){const m={};l.forEach(y=>{d=y.orient||fi,d!==Sx&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];RD(e,b,gj(b,y,n.legends,a,u,r,s))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===AD||n.autosize.type===kD||n.autosize.type===CD))switch(y.orient){case ci:case fi:o.add(b.x1,0).add(b.x2,0);break;case ou:case Ds:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(u),c&&o.union(xj(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),Sj(e,t,o,n)}function Sj(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===JU){const p=e.padding();o-=p.left+p.right,a-=p.top+p.bottom}s===Sx?(l=0,f=0,u=o,c=a):s===AD?(u=Math.max(0,o-l-d),c=Math.max(0,a-f-h)):s===kD?(u=Math.max(0,o-l-d),a=c+f+h):s===CD?(o=u+l+d,c=Math.max(0,a-f-h)):s===ZU&&(o=u+l+d,a=c+f+h),e._resizeView(o,a,u,c,[l,f],r.resize)}const _j=Object.freeze(Object.defineProperty({__proto__:null,bound:FD,identifier:$x,mark:TD,overlap:MD,render:OD,viewlayout:ND},Symbol.toStringTag,{value:"Module"}));function LD(e){D.call(this,null,e)}G(LD,D,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=qv(s,o,e.minstep),u=e.format||lM(n,s,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?uM(s,e.values,a):Wv(s,a);return r&&(i.rem=r),r=l.map((c,f)=>Ce({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(Ce({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function PD(e){D.call(this,null,e)}function $j(){return Ce({})}function Aj(e){const t=Mu().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}G(PD,D,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||$j,s=e.key||re,o=this.value;return L(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&N("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=Aj(s)),t.visit(t.ADD,a=>{const u=s(a);let l=o.get(u);l?l.exit?(o.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),o.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=s(a),l=o.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=s(a),l=o.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function zD(e){D.call(this,null,e)}G(zD,D,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(L(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||ns,u=r.enter||ns,l=r.exit||ns,c=(s&&!o?r[s]:a)||ns;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==ns&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==ns&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),o||c!==ns){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function ID(e){D.call(this,[],e)}G(ID,D,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||gd,o=e.scale,a=+e.limit,u=qv(o,e.count==null?5:e.count,e.minstep),l=!!e.values||s===gd,c=e.format||hM(n,o,u,s,e.formatSpecifier,e.formatType,l),f=e.values||dM(o,u),d,h,p,g,m;return r&&(i.rem=r),s===gd?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,fe(p=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=Ht(g=p||8),r=r.map((y,b)=>Ce({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(Ce({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):s===Z7?(d=o.domain(),h=sM(o,d[0],xe(d)),f.length<3&&!e.values&&d[0]!==xe(d)&&(f=[d[0],xe(d)]),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=c8(o),r=f.map((y,b)=>Ce({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const kj=e=>e.source.x,Cj=e=>e.source.y,Fj=e=>e.target.x,Tj=e=>e.target.y;function Ax(e){D.call(this,{},e)}Ax.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};G(Ax,D,{transform(e,t){var n=e.sourceX||kj,i=e.sourceY||Cj,r=e.targetX||Fj,s=e.targetY||Tj,o=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=i_.get(u+"-"+a)||i_.get(u);return l||N("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=l(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const BD=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,Mj=(e,t,n,i)=>BD(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),UD=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},Dj=(e,t,n,i)=>UD(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),jD=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},Oj=(e,t,n,i)=>jD(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),Rj=(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,Nj=(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,Lj=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},Pj=(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},zj=(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},Ij=(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*s+"C"+u*r+","+u*s+" "+u*o+","+u*a+" "+i*o+","+i*a},i_=Mu({line:BD,"line-radial":Mj,arc:UD,"arc-radial":Dj,curve:jD,"curve-radial":Oj,"orthogonal-horizontal":Rj,"orthogonal-vertical":Nj,"orthogonal-radial":Lj,"diagonal-horizontal":Pj,"diagonal-vertical":zj,"diagonal-radial":Ij});function kx(e){D.call(this,null,e)}kx.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]};G(kx,D,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||Cu,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(s),c=l.length,f=o,d=(a-o)/_C(l),h=Fn(c),p,g,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),p=0;p<c;++p)m=l[h[p]],g=u[h[p]],g[i]=f,g[r]=f+=m*d;return this.value=l,t.reflow(e.modified()).modifies(n)}});const Bj=5;function Uj(e){const t=e.type;return!e.bins&&(t===eu||t===Uc||t===jc)}function qD(e){return Bv(e)&&e!==Xi}const jj=yi(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma"]);function WD(e){D.call(this,null,e),this.modified(!0)}G(WD,D,{transform(e,t){var n=t.dataflow,i=this.value,r=qj(e);(!i||r!==i.type)&&(this.value=i=ke(r)());for(r in e)if(!jj[r]){if(r==="padding"&&qD(i.type))continue;fe(i[r])?i[r](e[r]):n.warn("Unsupported scale property: "+r)}return Yj(i,e,Xj(i,e,Hj(i,e,n))),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function qj(e){var t=e.type,n="",i;return t===Xi?Xi+"-"+eu:(Wj(e)&&(i=e.rawDomain?e.rawDomain.length:e.domain?e.domain.length+ +(e.domainMid!=null):0,n=i===2?Xi+"-":i===3?Pu+"-":""),(n+t||eu).toLowerCase())}function Wj(e){const t=e.type;return Bv(t)&&t!==Ro&&t!==No&&(e.scheme||e.range&&e.range.length&&e.range.every(K))}function Hj(e,t,n){const i=Gj(e,t.domainRaw,n);if(i>-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&Uj(e),a,u;if(!r)return 0;if((o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:u<r[0]?0:a;l!==a&&n.warn("Scale domainMid exceeds domain min or max.",u),r.splice(l,0,u)}return qD(s)&&t.padding&&r[0]!==xe(r)&&(r=Vj(s,r,t.range,t.padding,t.exponent,t.constant)),e.domain(HD(s,r,n)),s===Lv&&e.unknown(t.domainImplicit?c1:void 0),t.nice&&e.nice&&e.nice(t.nice!==!0&&qv(e,t.nice)||null),r.length}function Gj(e,t,n){return t?(e.domain(HD(e.type,t,n)),t.length):-1}function Vj(e,t,n,i,r,s){var o=Math.abs(xe(n)-n[0]),a=o/(o-2*i),u=e===Ur?ub(t,null,a):e===jc?jd(t,null,a,.5):e===Uc?jd(t,null,a,r||1):e===Wp?lb(t,null,a,s||1):ab(t,null,a);return t=t.slice(),t[0]=u[0],t[t.length-1]=u[1],t}function HD(e,t,n){if(eM(e)){var i=Math.abs(t.reduce((r,s)=>r+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+H(t))}return t}function Xj(e,t,n){let i=t.bins;if(i&&!L(i)){const r=e.domain(),s=r[0],o=xe(r),a=i.step;let u=i.start==null?s:i.start,l=i.stop==null?o:i.stop;a||N("Scale bins parameter missing step property."),u<s&&(u=a*Math.ceil(s/a)),l>o&&(l=a*Math.floor(o/a)),i=Fn(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Pv&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function Yj(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=Kj(i,t,n);else if(t.scheme&&(s=Jj(i,t,n),fe(s))){if(e.interpolator)return e.interpolator(s);N(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&tM(i))return e.interpolator(Vp(k1(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(Uv(t.interpolate,t.interpolateGamma)):fe(e.round)?e.round(r):fe(e.rangeRound)&&e.interpolate(r?dp:Nc),s&&e.range(k1(s,t.reverse))}function Kj(e,t,n){e!==XT&&e!==d1&&N("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===d1?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Nv(n,r,i)]}function Jj(e,t,n){var i=t.schemeExtent,r,s;return L(t.scheme)?s=Vp(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=jv(r),s||N(`Unrecognized scheme name: ${t.scheme}`)),n=e===Gp?n+1:e===Pv?n-1:e===tu||e===Hp?+t.schemeCount||Bj:n,tM(e)?r_(s,i,t.reverse):fe(s)?rM(r_(s,i),n):e===Lv?s:s.slice(0,n)}function r_(e,t,n){return fe(e)&&(t||n)?iM(e,k1(t||[0,1],n)):e}function k1(e,t){return t?e.slice().reverse():e}function GD(e){D.call(this,null,e)}G(GD,D,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(ea(e.sort)),this.modified(n),t}});const s_="zero",VD="center",XD="normalize",YD=["y0","y1"];function Cx(e){D.call(this,null,e)}Cx.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:s_,values:[s_,VD,XD]},{name:"as",type:"string",array:!0,length:2,default:YD}]};G(Cx,D,{transform(e,t){var n=e.as||YD,i=n[0],r=n[1],s=ea(e.sort),o=e.field||Cu,a=e.offset===VD?Qj:e.offset===XD?Zj:eq,u,l,c,f;for(u=tq(t.source,e.groupby,s,o),l=0,c=u.length,f=u.max;l<c;++l)a(u[l],f,o,i,r);return t.reflow(e.modified()).modifies(n)}});function Qj(e,t,n,i,r){for(var s=(t-e.sum)/2,o=e.length,a=0,u;a<o;++a)u=e[a],u[i]=s,u[r]=s+=Math.abs(n(u))}function Zj(e,t,n,i,r){for(var s=1/e.sum,o=0,a=e.length,u=0,l=0,c;u<a;++u)c=e[u],c[i]=o,c[r]=o=s*(l+=Math.abs(n(c)))}function eq(e,t,n,i,r){for(var s=0,o=0,a=e.length,u=0,l,c;u<a;++u)c=e[u],l=+n(c),l<0?(c[i]=o,c[r]=o+=l):(c[i]=s,c[r]=s+=l)}function tq(e,t,n,i){var r=[],s=g=>g(c),o,a,u,l,c,f,d,h,p;if(t==null)r.push(e.slice());else for(o={},a=0,u=e.length;a<u;++a)c=e[a],f=t.map(s),d=o[f],d||(o[f]=d=[],r.push(d)),d.push(c);for(f=0,p=0,l=r.length;f<l;++f){for(d=r[f],a=0,h=0,u=d.length;a<u;++a)h+=Math.abs(i(d[a]));d.sum=h,h>p&&(p=h),n&&d.sort(n)}return r.max=p,r}const nq=Object.freeze(Object.defineProperty({__proto__:null,axisticks:LD,datajoin:PD,encode:zD,legendentries:ID,linkpath:Ax,pie:kx,scale:WD,sortitems:GD,stack:Cx},Symbol.toStringTag,{value:"Module"}));var oe=1e-6,gh=1e-12,me=Math.PI,Ye=me/2,mh=me/4,sn=me*2,Qe=180/me,pe=me/180,ve=Math.abs,Iu=Math.atan,Qn=Math.atan2,ae=Math.cos,Pf=Math.ceil,KD=Math.exp,C1=Math.hypot,yh=Math.log,Wm=Math.pow,se=Math.sin,Wn=Math.sign||function(e){return e>0?1:e<0?-1:0},on=Math.sqrt,Fx=Math.tan;function JD(e){return e>1?0:e<-1?me:Math.acos(e)}function bn(e){return e>1?Ye:e<-1?-Ye:Math.asin(e)}function _t(){}function bh(e,t){e&&a_.hasOwnProperty(e.type)&&a_[e.type](e,t)}var o_={Feature:function(e,t){bh(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i<r;)bh(n[i].geometry,t)}},a_={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,i=-1,r=n.length;++i<r;)e=n[i],t.point(e[0],e[1],e[2])},LineString:function(e,t){F1(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)F1(n[i],t,0)},Polygon:function(e,t){u_(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,i=-1,r=n.length;++i<r;)u_(n[i],t)},GeometryCollection:function(e,t){for(var n=e.geometries,i=-1,r=n.length;++i<r;)bh(n[i],t)}};function F1(e,t,n){var i=-1,r=e.length-n,s;for(t.lineStart();++i<r;)s=e[i],t.point(s[0],s[1],s[2]);t.lineEnd()}function u_(e,t){var n=-1,i=e.length;for(t.polygonStart();++n<i;)F1(e[n],t,1);t.polygonEnd()}function $r(e,t){e&&o_.hasOwnProperty(e.type)?o_[e.type](e,t):bh(e,t)}var vh=new nn,xh=new nn,QD,ZD,T1,M1,D1,tr={point:_t,lineStart:_t,lineEnd:_t,polygonStart:function(){vh=new nn,tr.lineStart=iq,tr.lineEnd=rq},polygonEnd:function(){var e=+vh;xh.add(e<0?sn+e:e),this.lineStart=this.lineEnd=this.point=_t},sphere:function(){xh.add(sn)}};function iq(){tr.point=sq}function rq(){e3(QD,ZD)}function sq(e,t){tr.point=e3,QD=e,ZD=t,e*=pe,t*=pe,T1=e,M1=ae(t=t/2+mh),D1=se(t)}function e3(e,t){e*=pe,t*=pe,t=t/2+mh;var n=e-T1,i=n>=0?1:-1,r=i*n,s=ae(t),o=se(t),a=D1*o,u=M1*s+a*ae(r),l=a*i*se(r);vh.add(Qn(l,u)),T1=e,M1=s,D1=o}function oq(e){return xh=new nn,$r(e,tr),xh*2}function wh(e){return[Qn(e[1],e[0]),bn(e[2])]}function Po(e){var t=e[0],n=e[1],i=ae(n);return[i*ae(t),i*se(t),se(n)]}function zf(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function au(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 Hm(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function If(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Eh(e){var t=on(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var He,dn,Ve,An,go,t3,n3,Ba,Xl,as,jr,Sr={point:O1,lineStart:l_,lineEnd:c_,polygonStart:function(){Sr.point=r3,Sr.lineStart=aq,Sr.lineEnd=uq,Xl=new nn,tr.polygonStart()},polygonEnd:function(){tr.polygonEnd(),Sr.point=O1,Sr.lineStart=l_,Sr.lineEnd=c_,vh<0?(He=-(Ve=180),dn=-(An=90)):Xl>oe?An=90:Xl<-oe&&(dn=-90),jr[0]=He,jr[1]=Ve},sphere:function(){He=-(Ve=180),dn=-(An=90)}};function O1(e,t){as.push(jr=[He=e,Ve=e]),t<dn&&(dn=t),t>An&&(An=t)}function i3(e,t){var n=Po([e*pe,t*pe]);if(Ba){var i=au(Ba,n),r=[i[1],-i[0],0],s=au(r,i);Eh(s),s=wh(s);var o=e-go,a=o>0?1:-1,u=s[0]*Qe*a,l,c=ve(o)>180;c^(a*go<u&&u<a*e)?(l=s[1]*Qe,l>An&&(An=l)):(u=(u+360)%360-180,c^(a*go<u&&u<a*e)?(l=-s[1]*Qe,l<dn&&(dn=l)):(t<dn&&(dn=t),t>An&&(An=t))),c?e<go?$n(He,e)>$n(He,Ve)&&(Ve=e):$n(e,Ve)>$n(He,Ve)&&(He=e):Ve>=He?(e<He&&(He=e),e>Ve&&(Ve=e)):e>go?$n(He,e)>$n(He,Ve)&&(Ve=e):$n(e,Ve)>$n(He,Ve)&&(He=e)}else as.push(jr=[He=e,Ve=e]);t<dn&&(dn=t),t>An&&(An=t),Ba=n,go=e}function l_(){Sr.point=i3}function c_(){jr[0]=He,jr[1]=Ve,Sr.point=O1,Ba=null}function r3(e,t){if(Ba){var n=e-go;Xl.add(ve(n)>180?n+(n>0?360:-360):n)}else t3=e,n3=t;tr.point(e,t),i3(e,t)}function aq(){tr.lineStart()}function uq(){r3(t3,n3),tr.lineEnd(),ve(Xl)>oe&&(He=-(Ve=180)),jr[0]=He,jr[1]=Ve,Ba=null}function $n(e,t){return(t-=e)<0?t+360:t}function lq(e,t){return e[0]-t[0]}function f_(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function cq(e){var t,n,i,r,s,o,a;if(An=Ve=-(He=dn=1/0),as=[],$r(e,Sr),n=as.length){for(as.sort(lq),t=1,i=as[0],s=[i];t<n;++t)r=as[t],f_(i,r[0])||f_(i,r[1])?($n(i[0],r[1])>$n(i[0],i[1])&&(i[1]=r[1]),$n(r[0],i[1])>$n(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(a=$n(i[1],r[0]))>o&&(o=a,He=r[0],Ve=i[1])}return as=jr=null,He===1/0||dn===1/0?[[NaN,NaN],[NaN,NaN]]:[[He,dn],[Ve,An]]}var Dl,Sh,_h,$h,Ah,kh,Ch,Fh,R1,N1,L1,s3,o3,Kt,Jt,Qt,di={sphere:_t,point:Tx,lineStart:d_,lineEnd:h_,polygonStart:function(){di.lineStart=hq,di.lineEnd=pq},polygonEnd:function(){di.lineStart=d_,di.lineEnd=h_}};function Tx(e,t){e*=pe,t*=pe;var n=ae(t);ef(n*ae(e),n*se(e),se(t))}function ef(e,t,n){++Dl,_h+=(e-_h)/Dl,$h+=(t-$h)/Dl,Ah+=(n-Ah)/Dl}function d_(){di.point=fq}function fq(e,t){e*=pe,t*=pe;var n=ae(t);Kt=n*ae(e),Jt=n*se(e),Qt=se(t),di.point=dq,ef(Kt,Jt,Qt)}function dq(e,t){e*=pe,t*=pe;var n=ae(t),i=n*ae(e),r=n*se(e),s=se(t),o=Qn(on((o=Jt*s-Qt*r)*o+(o=Qt*i-Kt*s)*o+(o=Kt*r-Jt*i)*o),Kt*i+Jt*r+Qt*s);Sh+=o,kh+=o*(Kt+(Kt=i)),Ch+=o*(Jt+(Jt=r)),Fh+=o*(Qt+(Qt=s)),ef(Kt,Jt,Qt)}function h_(){di.point=Tx}function hq(){di.point=gq}function pq(){a3(s3,o3),di.point=Tx}function gq(e,t){s3=e,o3=t,e*=pe,t*=pe,di.point=a3;var n=ae(t);Kt=n*ae(e),Jt=n*se(e),Qt=se(t),ef(Kt,Jt,Qt)}function a3(e,t){e*=pe,t*=pe;var n=ae(t),i=n*ae(e),r=n*se(e),s=se(t),o=Jt*s-Qt*r,a=Qt*i-Kt*s,u=Kt*r-Jt*i,l=C1(o,a,u),c=bn(l),f=l&&-c/l;R1.add(f*o),N1.add(f*a),L1.add(f*u),Sh+=c,kh+=c*(Kt+(Kt=i)),Ch+=c*(Jt+(Jt=r)),Fh+=c*(Qt+(Qt=s)),ef(Kt,Jt,Qt)}function mq(e){Dl=Sh=_h=$h=Ah=kh=Ch=Fh=0,R1=new nn,N1=new nn,L1=new nn,$r(e,di);var t=+R1,n=+N1,i=+L1,r=C1(t,n,i);return r<gh&&(t=kh,n=Ch,i=Fh,Sh<oe&&(t=_h,n=$h,i=Ah),r=C1(t,n,i),r<gh)?[NaN,NaN]:[Qn(n,t)*Qe,bn(i/r)*Qe]}function P1(e,t){function n(i,r){return i=e(i,r),t(i[0],i[1])}return e.invert&&t.invert&&(n.invert=function(i,r){return i=t.invert(i,r),i&&e.invert(i[0],i[1])}),n}function z1(e,t){return ve(e)>me&&(e-=Math.round(e/sn)*sn),[e,t]}z1.invert=z1;function u3(e,t,n){return(e%=sn)?t||n?P1(g_(e),m_(t,n)):g_(e):t||n?m_(t,n):z1}function p_(e){return function(t,n){return t+=e,ve(t)>me&&(t-=Math.round(t/sn)*sn),[t,n]}}function g_(e){var t=p_(e);return t.invert=p_(-e),t}function m_(e,t){var n=ae(e),i=se(e),r=ae(t),s=se(t);function o(a,u){var l=ae(u),c=ae(a)*l,f=se(a)*l,d=se(u),h=d*n+c*i;return[Qn(f*r-h*s,c*n-d*i),bn(h*r+f*s)]}return o.invert=function(a,u){var l=ae(u),c=ae(a)*l,f=se(a)*l,d=se(u),h=d*r-f*s;return[Qn(f*r+d*s,c*n+h*i),bn(h*n-c*i)]},o}function yq(e){e=u3(e[0]*pe,e[1]*pe,e.length>2?e[2]*pe:0);function t(n){return n=e(n[0]*pe,n[1]*pe),n[0]*=Qe,n[1]*=Qe,n}return t.invert=function(n){return n=e.invert(n[0]*pe,n[1]*pe),n[0]*=Qe,n[1]*=Qe,n},t}function bq(e,t,n,i,r,s){if(n){var o=ae(t),a=se(t),u=i*n;r==null?(r=t+i*sn,s=t-u/2):(r=y_(o,r),s=y_(o,s),(i>0?r<s:r>s)&&(r+=i*sn));for(var l,c=r;i>0?c>s:c<s;c-=u)l=wh([o,-a*ae(c),-a*se(c)]),e.point(l[0],l[1])}}function y_(e,t){t=Po(t),t[0]-=e,Eh(t);var n=JD(-t[1]);return((-t[2]<0?-n:n)+sn-oe)%sn}function l3(){var e=[],t;return{point:function(n,i,r){t.push([n,i,r])},lineStart:function(){e.push(t=[])},lineEnd:_t,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function _d(e,t){return ve(e[0]-t[0])<oe&&ve(e[1]-t[1])<oe}function Bf(e,t,n,i){this.x=e,this.z=t,this.o=n,this.e=i,this.v=!1,this.n=this.p=null}function c3(e,t,n,i,r){var s=[],o=[],a,u;if(e.forEach(function(p){if(!((g=p.length-1)<=0)){var g,m=p[0],y=p[g],b;if(_d(m,y)){if(!m[2]&&!y[2]){for(r.lineStart(),a=0;a<g;++a)r.point((m=p[a])[0],m[1]);r.lineEnd();return}y[0]+=2*oe}s.push(b=new Bf(m,p,null,!0)),o.push(b.o=new Bf(m,null,b,!1)),s.push(b=new Bf(y,p,null,!1)),o.push(b.o=new Bf(y,null,b,!0))}}),!!s.length){for(o.sort(t),b_(s),b_(o),a=0,u=o.length;a<u;++a)o[a].e=n=!n;for(var l=s[0],c,f;;){for(var d=l,h=!0;d.v;)if((d=d.n)===l)return;c=d.z,r.lineStart();do{if(d.v=d.o.v=!0,d.e){if(h)for(a=0,u=c.length;a<u;++a)r.point((f=c[a])[0],f[1]);else i(d.x,d.n.x,1,r);d=d.n}else{if(h)for(c=d.p.z,a=c.length-1;a>=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function b_(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}function Gm(e){return ve(e[0])<=me?e[0]:Wn(e[0])*((ve(e[0])+me)%sn-me)}function vq(e,t){var n=Gm(t),i=t[1],r=se(i),s=[se(n),-ae(n),0],o=0,a=0,u=new nn;r===1?i=Ye+oe:r===-1&&(i=-Ye-oe);for(var l=0,c=e.length;l<c;++l)if(d=(f=e[l]).length)for(var f,d,h=f[d-1],p=Gm(h),g=h[1]/2+mh,m=se(g),y=ae(g),b=0;b<d;++b,p=x,m=S,y=w,h=v){var v=f[b],x=Gm(v),E=v[1]/2+mh,S=se(E),w=ae(E),_=x-p,$=_>=0?1:-1,C=$*_,T=C>me,O=m*S;if(u.add(Qn(O*$*se(C),y*w+O*ae(C))),o+=T?_+$*sn:_,T^p>=n^x>=n){var k=au(Po(h),Po(v));Eh(k);var F=au(s,k);Eh(F);var A=(T^_>=0?-1:1)*bn(F[2]);(i>A||i===A&&(k[0]||k[1]))&&(a+=T^_>=0?1:-1)}}return(o<-oe||o<oe&&u<-gh)^a&1}function f3(e,t,n,i){return function(r){var s=t(r),o=l3(),a=t(o),u=!1,l,c,f,d={point:h,lineStart:g,lineEnd:m,polygonStart:function(){d.point=y,d.lineStart=b,d.lineEnd=v,c=[],l=[]},polygonEnd:function(){d.point=h,d.lineStart=g,d.lineEnd=m,c=SC(c);var x=vq(l,i);c.length?(u||(r.polygonStart(),u=!0),c3(c,wq,x,n,r)):x&&(u||(r.polygonStart(),u=!0),r.lineStart(),n(null,null,1,r),r.lineEnd()),u&&(r.polygonEnd(),u=!1),c=l=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}};function h(x,E){e(x,E)&&r.point(x,E)}function p(x,E){s.point(x,E)}function g(){d.point=p,s.lineStart()}function m(){d.point=h,s.lineEnd()}function y(x,E){f.push([x,E]),a.point(x,E)}function b(){a.lineStart(),f=[]}function v(){y(f[0][0],f[0][1]),a.lineEnd();var x=a.clean(),E=o.result(),S,w=E.length,_,$,C;if(f.pop(),l.push(f),f=null,!!w){if(x&1){if($=E[0],(_=$.length-1)>0){for(u||(r.polygonStart(),u=!0),r.lineStart(),S=0;S<_;++S)r.point((C=$[S])[0],C[1]);r.lineEnd()}return}w>1&&x&2&&E.push(E.pop().concat(E.shift())),c.push(E.filter(xq))}}return d}}function xq(e){return e.length>1}function wq(e,t){return((e=e.x)[0]<0?e[1]-Ye-oe:Ye-e[1])-((t=t.x)[0]<0?t[1]-Ye-oe:Ye-t[1])}const v_=f3(function(){return!0},Eq,_q,[-me,-Ye]);function Eq(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,o){var a=s>0?me:-me,u=ve(s-t);ve(u-me)<oe?(e.point(t,n=(n+o)/2>0?Ye:-Ye),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(s,n),r=0):i!==a&&u>=me&&(ve(t-i)<oe&&(t-=i*oe),ve(s-a)<oe&&(s-=a*oe),n=Sq(t,n,s,o),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),r=0),e.point(t=s,n=o),i=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-r}}}function Sq(e,t,n,i){var r,s,o=se(e-n);return ve(o)>oe?Iu((se(t)*(s=ae(i))*se(n)-se(i)*(r=ae(t))*se(e))/(r*s*o)):(t+i)/2}function _q(e,t,n,i){var r;if(e==null)r=n*Ye,i.point(-me,r),i.point(0,r),i.point(me,r),i.point(me,0),i.point(me,-r),i.point(0,-r),i.point(-me,-r),i.point(-me,0),i.point(-me,r);else if(ve(e[0]-t[0])>oe){var s=e[0]<t[0]?me:-me;r=n*s/2,i.point(-s,r),i.point(0,r),i.point(s,r)}else i.point(t[0],t[1])}function $q(e){var t=ae(e),n=2*pe,i=t>0,r=ve(t)>oe;function s(c,f,d,h){bq(h,e,n,d,c,f)}function o(c,f){return ae(c)*ae(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,x=o(m,y),E=i?x?0:l(m,y):x?l(m+(m<0?me:-me),y):0;if(!f&&(p=h=x)&&c.lineStart(),x!==h&&(v=u(f,b),(!v||_d(f,v)||_d(b,v))&&(b[2]=1)),x!==h)g=0,x?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^x){var S;!(E&d)&&(S=u(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1],3)))}x&&(!f||!_d(f,b))&&c.point(b[0],b[1]),f=b,h=x,d=E},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function u(c,f,d){var h=Po(c),p=Po(f),g=[1,0,0],m=au(h,p),y=zf(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var x=t*y/v,E=-t*b/v,S=au(g,m),w=If(g,x),_=If(m,E);Hm(w,_);var $=S,C=zf(w,$),T=zf($,$),O=C*C-T*(zf(w,w)-1);if(!(O<0)){var k=on(O),F=If($,(-C-k)/T);if(Hm(F,w),F=wh(F),!d)return F;var A=c[0],M=f[0],P=c[1],z=f[1],U;M<A&&(U=A,A=M,M=U);var te=M-A,ne=ve(te-me)<oe,de=ne||te<oe;if(!ne&&z<P&&(U=P,P=z,z=U),de?ne?P+z>0^F[1]<(ve(F[0]-A)<oe?P:z):P<=F[1]&&F[1]<=z:te>me^(A<=F[0]&&F[0]<=M)){var Se=If($,(-C+k)/T);return Hm(Se,w),[F,wh(Se)]}}}function l(c,f){var d=i?e:me-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return f3(o,a,s,i?[0,-e]:[-me,e-me])}function Aq(e,t,n,i,r,s){var o=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-o,h=l-a,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p<c)return;p<f&&(f=p)}else if(d>0){if(p>f)return;p>c&&(c=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p<c)return;p<f&&(f=p)}if(p=i-a,!(!h&&p>0)){if(p/=h,h<0){if(p<c)return;p<f&&(f=p)}else if(h>0){if(p>f)return;p>c&&(c=p)}if(p=s-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p<c)return;p<f&&(f=p)}return c>0&&(e[0]=o+c*d,e[1]=a+c*h),f<1&&(t[0]=o+f*d,t[1]=a+f*h),!0}}}}}var Ol=1e9,Uf=-Ol;function d3(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function s(l,c,f,d){var h=0,p=0;if(l==null||(h=o(l,f))!==(p=o(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function o(l,c){return ve(l[0]-e)<oe?c>0?0:3:ve(l[0]-n)<oe?c>0?2:1:ve(l[1]-t)<oe?c>0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=o(l,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=l3(),d,h,p,g,m,y,b,v,x,E,S,w={point:_,lineStart:O,lineEnd:k,polygonStart:C,polygonEnd:T};function _(A,M){r(A,M)&&c.point(A,M)}function $(){for(var A=0,M=0,P=h.length;M<P;++M)for(var z=h[M],U=1,te=z.length,ne=z[0],de,Se,we=ne[0],Pe=ne[1];U<te;++U)de=we,Se=Pe,ne=z[U],we=ne[0],Pe=ne[1],Se<=i?Pe>i&&(we-de)*(i-Se)>(Pe-Se)*(e-de)&&++A:Pe<=i&&(we-de)*(i-Se)<(Pe-Se)*(e-de)&&--A;return A}function C(){c=f,d=[],h=[],S=!0}function T(){var A=$(),M=S&&A,P=(d=SC(d)).length;(M||P)&&(l.polygonStart(),M&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),P&&c3(d,a,A,s,l),l.polygonEnd()),c=l,d=h=p=null}function O(){w.point=F,h&&h.push(p=[]),E=!0,x=!1,b=v=NaN}function k(){d&&(F(g,m),y&&x&&f.rejoin(),d.push(f.result())),w.point=_,x&&c.lineEnd()}function F(A,M){var P=r(A,M);if(h&&p.push([A,M]),E)g=A,m=M,y=P,E=!1,P&&(c.lineStart(),c.point(A,M));else if(P&&x)c.point(A,M);else{var z=[b=Math.max(Uf,Math.min(Ol,b)),v=Math.max(Uf,Math.min(Ol,v))],U=[A=Math.max(Uf,Math.min(Ol,A)),M=Math.max(Uf,Math.min(Ol,M))];Aq(z,U,e,t,n,i)?(x||(c.lineStart(),c.point(z[0],z[1])),c.point(U[0],U[1]),P||c.lineEnd(),S=!1):P&&(c.lineStart(),c.point(A,M),S=!1)}b=A,v=M,x=P}return w}}function x_(e,t,n){var i=Fn(e,t-oe,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function w_(e,t,n){var i=Fn(e,t-oe,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function kq(){var e,t,n,i,r,s,o,a,u=10,l=u,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Fn(Pf(i/c)*c,n,c).map(p).concat(Fn(Pf(a/f)*f,o,f).map(g)).concat(Fn(Pf(t/u)*u,e,u).filter(function(v){return ve(v%c)>oe}).map(d)).concat(Fn(Pf(s/l)*l,r,l).filter(function(v){return ve(v%f)>oe}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(o).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],o=+v[1][1],i>n&&(v=i,i=n,n=v),a>o&&(v=a,a=o,o=v),y.precision(m)):[[i,a],[n,o]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],s=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),s>r&&(v=s,s=r,r=v),y.precision(m)):[[t,s],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=x_(s,r,90),h=w_(t,e,m),p=x_(a,o,90),g=w_(i,n,m),y):m},y.extentMajor([[-180,-90+oe],[180,90-oe]]).extentMinor([[-180,-80-oe],[180,80+oe]])}const yc=e=>e;var Vm=new nn,I1=new nn,h3,p3,B1,U1,Ar={point:_t,lineStart:_t,lineEnd:_t,polygonStart:function(){Ar.lineStart=Cq,Ar.lineEnd=Tq},polygonEnd:function(){Ar.lineStart=Ar.lineEnd=Ar.point=_t,Vm.add(ve(I1)),I1=new nn},result:function(){var e=Vm/2;return Vm=new nn,e}};function Cq(){Ar.point=Fq}function Fq(e,t){Ar.point=g3,h3=B1=e,p3=U1=t}function g3(e,t){I1.add(U1*e-B1*t),B1=e,U1=t}function Tq(){g3(h3,p3)}var uu=1/0,Th=uu,bc=-uu,Mh=bc,Dh={point:Mq,lineStart:_t,lineEnd:_t,polygonStart:_t,polygonEnd:_t,result:function(){var e=[[uu,Th],[bc,Mh]];return bc=Mh=-(Th=uu=1/0),e}};function Mq(e,t){e<uu&&(uu=e),e>bc&&(bc=e),t<Th&&(Th=t),t>Mh&&(Mh=t)}var j1=0,q1=0,Rl=0,Oh=0,Rh=0,Na=0,W1=0,H1=0,Nl=0,m3,y3,qi,Wi,jn={point:zo,lineStart:E_,lineEnd:S_,polygonStart:function(){jn.lineStart=Rq,jn.lineEnd=Nq},polygonEnd:function(){jn.point=zo,jn.lineStart=E_,jn.lineEnd=S_},result:function(){var e=Nl?[W1/Nl,H1/Nl]:Na?[Oh/Na,Rh/Na]:Rl?[j1/Rl,q1/Rl]:[NaN,NaN];return j1=q1=Rl=Oh=Rh=Na=W1=H1=Nl=0,e}};function zo(e,t){j1+=e,q1+=t,++Rl}function E_(){jn.point=Dq}function Dq(e,t){jn.point=Oq,zo(qi=e,Wi=t)}function Oq(e,t){var n=e-qi,i=t-Wi,r=on(n*n+i*i);Oh+=r*(qi+e)/2,Rh+=r*(Wi+t)/2,Na+=r,zo(qi=e,Wi=t)}function S_(){jn.point=zo}function Rq(){jn.point=Lq}function Nq(){b3(m3,y3)}function Lq(e,t){jn.point=b3,zo(m3=qi=e,y3=Wi=t)}function b3(e,t){var n=e-qi,i=t-Wi,r=on(n*n+i*i);Oh+=r*(qi+e)/2,Rh+=r*(Wi+t)/2,Na+=r,r=Wi*e-qi*t,W1+=r*(qi+e),H1+=r*(Wi+t),Nl+=r*3,zo(qi=e,Wi=t)}function v3(e){this._context=e}v3.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(){this._line===0&&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,sn);break}}},result:_t};var G1=new nn,Xm,x3,w3,Ll,Pl,vc={point:_t,lineStart:function(){vc.point=Pq},lineEnd:function(){Xm&&E3(x3,w3),vc.point=_t},polygonStart:function(){Xm=!0},polygonEnd:function(){Xm=null},result:function(){var e=+G1;return G1=new nn,e}};function Pq(e,t){vc.point=E3,x3=Ll=e,w3=Pl=t}function E3(e,t){Ll-=e,Pl-=t,G1.add(on(Ll*Ll+Pl*Pl)),Ll=e,Pl=t}let __,Nh,$_,A_;class k_{constructor(t){this._append=t==null?S3:zq(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==$_||this._append!==Nh){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,$_=i,Nh=this._append,A_=this._,this._=r}this._+=A_;break}}}result(){const t=this._;return this._="",t.length?t:null}}function S3(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function zq(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return S3;if(t!==__){const n=10**t;__=t,Nh=function(r){let s=1;this._+=r[0];for(const o=r.length;s<o;++s)this._+=Math.round(arguments[s]*n)/n+r[s]}}return Nh}function _3(e,t){let n=3,i=4.5,r,s;function o(a){return a&&(typeof i=="function"&&s.pointRadius(+i.apply(this,arguments)),$r(a,r(s))),s.result()}return o.area=function(a){return $r(a,r(Ar)),Ar.result()},o.measure=function(a){return $r(a,r(vc)),vc.result()},o.bounds=function(a){return $r(a,r(Dh)),Dh.result()},o.centroid=function(a){return $r(a,r(jn)),jn.result()},o.projection=function(a){return arguments.length?(r=a==null?(e=null,yc):(e=a).stream,o):e},o.context=function(a){return arguments.length?(s=a==null?(t=null,new k_(n)):new v3(t=a),typeof i!="function"&&s.pointRadius(i),o):t},o.pointRadius=function(a){return arguments.length?(i=typeof a=="function"?a:(s.pointRadius(+a),+a),o):i},o.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const u=Math.floor(a);if(!(u>=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(s=new k_(n)),o},o.projection(e).digits(n).context(t)}function og(e){return function(t){var n=new V1;for(var i in e)n[i]=e[i];return n.stream=t,n}}function V1(){}V1.prototype={constructor:V1,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()}};function Mx(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),$r(n,e.stream(Dh)),t(Dh.result()),i!=null&&e.clipExtent(i),e}function ag(e,t,n){return Mx(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],o=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),a=+t[0][0]+(r-o*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(s-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([a,u])},n)}function Dx(e,t,n){return ag(e,[[0,0],t],n)}function Ox(e,t,n){return Mx(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),o=(r-s*(i[1][0]+i[0][0]))/2,a=-s*i[0][1];e.scale(150*s).translate([o,a])},n)}function Rx(e,t,n){return Mx(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),o=-s*i[0][0],a=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([o,a])},n)}var C_=16,Iq=ae(30*pe);function F_(e,t){return+t?Uq(e,t):Bq(e)}function Bq(e){return og({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Uq(e,t){function n(i,r,s,o,a,u,l,c,f,d,h,p,g,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var x=o+d,E=a+h,S=u+p,w=on(x*x+E*E+S*S),_=bn(S/=w),$=ve(ve(S)-1)<oe||ve(s-f)<oe?(s+f)/2:Qn(E,x),C=e($,_),T=C[0],O=C[1],k=T-i,F=O-r,A=b*k-y*F;(A*A/v>t||ve((y*k+b*F)/v-.5)>.3||o*d+a*h+u*p<Iq)&&(n(i,r,s,o,a,u,T,O,$,x/=w,E/=w,S,g,m),m.point(T,O),n(T,O,$,x,E,S,l,c,f,d,h,p,g,m))}}return function(i){var r,s,o,a,u,l,c,f,d,h,p,g,m={point:y,lineStart:b,lineEnd:x,polygonStart:function(){i.polygonStart(),m.lineStart=E},polygonEnd:function(){i.polygonEnd(),m.lineStart=b}};function y(_,$){_=e(_,$),i.point(_[0],_[1])}function b(){f=NaN,m.point=v,i.lineStart()}function v(_,$){var C=Po([_,$]),T=e(_,$);n(f,d,c,h,p,g,f=T[0],d=T[1],c=_,h=C[0],p=C[1],g=C[2],C_,i),i.point(f,d)}function x(){m.point=y,i.lineEnd()}function E(){b(),m.point=S,m.lineEnd=w}function S(_,$){v(r=_,$),s=f,o=d,a=h,u=p,l=g,m.point=v}function w(){n(f,d,c,h,p,g,s,o,r,a,u,l,C_,i),m.lineEnd=x,x()}return m}}var jq=og({point:function(e,t){this.stream.point(e*pe,t*pe)}});function qq(e){return og({point:function(t,n){var i=e(t,n);return this.stream.point(i[0],i[1])}})}function Wq(e,t,n,i,r){function s(o,a){return o*=i,a*=r,[t+e*o,n-e*a]}return s.invert=function(o,a){return[(o-t)/e*i,(n-a)/e*r]},s}function T_(e,t,n,i,r,s){if(!s)return Wq(e,t,n,i,r);var o=ae(s),a=se(s),u=o*e,l=a*e,c=o/e,f=a/e,d=(a*n-o*t)/e,h=(a*t+o*n)/e;function p(g,m){return g*=i,m*=r,[u*g-l*m+t,n-l*g-u*m]}return p.invert=function(g,m){return[i*(c*g-f*m+d),r*(h-f*g-c*m)]},p}function lr(e){return $3(function(){return e})()}function $3(e){var t,n=150,i=480,r=250,s=0,o=0,a=0,u=0,l=0,c,f=0,d=1,h=1,p=null,g=v_,m=null,y,b,v,x=yc,E=.5,S,w,_,$,C;function T(A){return _(A[0]*pe,A[1]*pe)}function O(A){return A=_.invert(A[0],A[1]),A&&[A[0]*Qe,A[1]*Qe]}T.stream=function(A){return $&&C===A?$:$=jq(qq(c)(g(S(x(C=A)))))},T.preclip=function(A){return arguments.length?(g=A,p=void 0,F()):g},T.postclip=function(A){return arguments.length?(x=A,m=y=b=v=null,F()):x},T.clipAngle=function(A){return arguments.length?(g=+A?$q(p=A*pe):(p=null,v_),F()):p*Qe},T.clipExtent=function(A){return arguments.length?(x=A==null?(m=y=b=v=null,yc):d3(m=+A[0][0],y=+A[0][1],b=+A[1][0],v=+A[1][1]),F()):m==null?null:[[m,y],[b,v]]},T.scale=function(A){return arguments.length?(n=+A,k()):n},T.translate=function(A){return arguments.length?(i=+A[0],r=+A[1],k()):[i,r]},T.center=function(A){return arguments.length?(s=A[0]%360*pe,o=A[1]%360*pe,k()):[s*Qe,o*Qe]},T.rotate=function(A){return arguments.length?(a=A[0]%360*pe,u=A[1]%360*pe,l=A.length>2?A[2]%360*pe:0,k()):[a*Qe,u*Qe,l*Qe]},T.angle=function(A){return arguments.length?(f=A%360*pe,k()):f*Qe},T.reflectX=function(A){return arguments.length?(d=A?-1:1,k()):d<0},T.reflectY=function(A){return arguments.length?(h=A?-1:1,k()):h<0},T.precision=function(A){return arguments.length?(S=F_(w,E=A*A),F()):on(E)},T.fitExtent=function(A,M){return ag(T,A,M)},T.fitSize=function(A,M){return Dx(T,A,M)},T.fitWidth=function(A,M){return Ox(T,A,M)},T.fitHeight=function(A,M){return Rx(T,A,M)};function k(){var A=T_(n,0,0,d,h,f).apply(null,t(s,o)),M=T_(n,i-A[0],r-A[1],d,h,f);return c=u3(a,u,l),w=P1(t,M),_=P1(c,w),S=F_(w,E),F()}function F(){return $=C=null,T}return function(){return t=e.apply(this,arguments),T.invert=t.invert&&O,k()}}function Nx(e){var t=0,n=me/3,i=$3(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*pe,n=s[1]*pe):[t*Qe,n*Qe]},r}function Hq(e){var t=ae(e);function n(i,r){return[i*t,se(r)/t]}return n.invert=function(i,r){return[i/t,bn(r*t)]},n}function Gq(e,t){var n=se(e),i=(n+se(t))/2;if(ve(i)<oe)return Hq(e);var r=1+n*(2*i-n),s=on(r)/i;function o(a,u){var l=on(r-2*i*se(u))/i;return[l*se(a*=i),s-l*ae(a)]}return o.invert=function(a,u){var l=s-u,c=Qn(a,ve(l))*Wn(l);return l*i<0&&(c-=me*Wn(a)*Wn(l)),[c/i,bn((r-(a*a+l*l)*i*i)/(2*i))]},o}function Lh(){return Nx(Gq).scale(155.424).center([0,33.6442])}function A3(){return Lh().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Vq(e){var t=e.length;return{point:function(n,i){for(var r=-1;++r<t;)e[r].point(n,i)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function Xq(){var e,t,n=A3(),i,r=Lh().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s,o=Lh().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,u,l={point:function(d,h){u=[d,h]}};function c(d){var h=d[0],p=d[1];return u=null,i.point(h,p),u||(s.point(h,p),u)||(a.point(h,p),u)}c.invert=function(d){var h=n.scale(),p=n.translate(),g=(d[0]-p[0])/h,m=(d[1]-p[1])/h;return(m>=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?o:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=Vq([n.stream(t=d),r.stream(d),o.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(l),s=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+oe,g+.12*h+oe],[p-.214*h-oe,g+.234*h-oe]]).stream(l),a=o.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+oe,g+.166*h+oe],[p-.115*h-oe,g+.234*h-oe]]).stream(l),f()},c.fitExtent=function(d,h){return ag(c,d,h)},c.fitSize=function(d,h){return Dx(c,d,h)},c.fitWidth=function(d,h){return Ox(c,d,h)},c.fitHeight=function(d,h){return Rx(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function k3(e){return function(t,n){var i=ae(t),r=ae(n),s=e(i*r);return s===1/0?[2,0]:[s*r*se(t),s*se(n)]}}function tf(e){return function(t,n){var i=on(t*t+n*n),r=e(i),s=se(r),o=ae(r);return[Qn(t*s,i*o),bn(i&&n*s/i)]}}var C3=k3(function(e){return on(2/(1+e))});C3.invert=tf(function(e){return 2*bn(e/2)});function Yq(){return lr(C3).scale(124.75).clipAngle(180-.001)}var F3=k3(function(e){return(e=JD(e))&&e/se(e)});F3.invert=tf(function(e){return e});function Kq(){return lr(F3).scale(79.4188).clipAngle(180-.001)}function ug(e,t){return[e,yh(Fx((Ye+t)/2))]}ug.invert=function(e,t){return[e,2*Iu(KD(t))-Ye]};function Jq(){return T3(ug).scale(961/sn)}function T3(e){var t=lr(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,o=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?o=a=u=l=null:(o=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):o==null?null:[[o,a],[u,l]]};function c(){var f=me*i(),d=t(yq(t.rotate()).invert([0,0]));return s(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===ug?[[Math.max(d[0]-f,o),a],[Math.min(d[0]+f,u),l]]:[[o,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function jf(e){return Fx((Ye+e)/2)}function Qq(e,t){var n=ae(e),i=e===t?se(e):yh(n/ae(t))/yh(jf(t)/jf(e)),r=n*Wm(jf(e),i)/i;if(!i)return ug;function s(o,a){r>0?a<-Ye+oe&&(a=-Ye+oe):a>Ye-oe&&(a=Ye-oe);var u=r/Wm(jf(a),i);return[u*se(i*o),r-u*ae(i*o)]}return s.invert=function(o,a){var u=r-a,l=Wn(i)*on(o*o+u*u),c=Qn(o,ve(u))*Wn(u);return u*i<0&&(c-=me*Wn(o)*Wn(u)),[c/i,2*Iu(Wm(r/l,1/i))-Ye]},s}function Zq(){return Nx(Qq).scale(109.5).parallels([30,30])}function Ph(e,t){return[e,t]}Ph.invert=Ph;function eW(){return lr(Ph).scale(152.63)}function tW(e,t){var n=ae(e),i=e===t?se(e):(n-ae(t))/(t-e),r=n/i+e;if(ve(i)<oe)return Ph;function s(o,a){var u=r-a,l=i*o;return[u*se(l),r-u*ae(l)]}return s.invert=function(o,a){var u=r-a,l=Qn(o,ve(u))*Wn(u);return u*i<0&&(l-=me*Wn(o)*Wn(u)),[l/i,r-Wn(i)*on(o*o+u*u)]},s}function nW(){return Nx(tW).scale(131.154).center([0,13.9389])}var Yl=1.340264,Kl=-.081106,Jl=893e-6,Ql=.003796,zh=on(3)/2,iW=12;function M3(e,t){var n=bn(zh*se(t)),i=n*n,r=i*i*i;return[e*ae(n)/(zh*(Yl+3*Kl*i+r*(7*Jl+9*Ql*i))),n*(Yl+Kl*i+r*(Jl+Ql*i))]}M3.invert=function(e,t){for(var n=t,i=n*n,r=i*i*i,s=0,o,a,u;s<iW&&(a=n*(Yl+Kl*i+r*(Jl+Ql*i))-t,u=Yl+3*Kl*i+r*(7*Jl+9*Ql*i),n-=o=a/u,i=n*n,r=i*i*i,!(ve(o)<gh));++s);return[zh*e*(Yl+3*Kl*i+r*(7*Jl+9*Ql*i))/ae(n),bn(se(n)/zh)]};function rW(){return lr(M3).scale(177.158)}function D3(e,t){var n=ae(t),i=ae(e)*n;return[n*se(e)/i,se(t)/i]}D3.invert=tf(Iu);function sW(){return lr(D3).scale(144.049).clipAngle(60)}function oW(){var e=1,t=0,n=0,i=1,r=1,s=0,o,a,u=null,l,c,f,d=1,h=1,p=og({point:function(x,E){var S=v([x,E]);this.stream.point(S[0],S[1])}}),g=yc,m,y;function b(){return d=e*i,h=e*r,m=y=null,v}function v(x){var E=x[0]*d,S=x[1]*h;if(s){var w=S*o-E*a;E=E*o+S*a,S=w}return[E+t,S+n]}return v.invert=function(x){var E=x[0]-t,S=x[1]-n;if(s){var w=S*o+E*a;E=E*o-S*a,S=w}return[E/d,S/h]},v.stream=function(x){return m&&y===x?m:m=p(g(y=x))},v.postclip=function(x){return arguments.length?(g=x,u=l=c=f=null,b()):g},v.clipExtent=function(x){return arguments.length?(g=x==null?(u=l=c=f=null,yc):d3(u=+x[0][0],l=+x[0][1],c=+x[1][0],f=+x[1][1]),b()):u==null?null:[[u,l],[c,f]]},v.scale=function(x){return arguments.length?(e=+x,b()):e},v.translate=function(x){return arguments.length?(t=+x[0],n=+x[1],b()):[t,n]},v.angle=function(x){return arguments.length?(s=x%360*pe,a=se(s),o=ae(s),b()):s*Qe},v.reflectX=function(x){return arguments.length?(i=x?-1:1,b()):i<0},v.reflectY=function(x){return arguments.length?(r=x?-1:1,b()):r<0},v.fitExtent=function(x,E){return ag(v,x,E)},v.fitSize=function(x,E){return Dx(v,x,E)},v.fitWidth=function(x,E){return Ox(v,x,E)},v.fitHeight=function(x,E){return Rx(v,x,E)},v}function O3(e,t){var n=t*t,i=n*n;return[e*(.8707-.131979*n+i*(-.013791+i*(.003971*n-.001529*i))),t*(1.007226+n*(.015085+i*(-.044475+.028874*n-.005916*i)))]}O3.invert=function(e,t){var n=t,i=25,r;do{var s=n*n,o=s*s;n-=r=(n*(1.007226+s*(.015085+o*(-.044475+.028874*s-.005916*o)))-t)/(1.007226+s*(.015085*3+o*(-.044475*7+.028874*9*s-.005916*11*o)))}while(ve(r)>oe&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function aW(){return lr(O3).scale(175.295)}function R3(e,t){return[ae(t)*se(e),se(t)]}R3.invert=tf(bn);function uW(){return lr(R3).scale(249.5).clipAngle(90+oe)}function N3(e,t){var n=ae(t),i=1+ae(e)*n;return[n*se(e)/i,se(t)/i]}N3.invert=tf(function(e){return 2*Iu(e)});function lW(){return lr(N3).scale(250).clipAngle(142)}function L3(e,t){return[yh(Fx((Ye+t)/2)),-e]}L3.invert=function(e,t){return[-t,2*Iu(KD(e))-Ye]};function cW(){var e=T3(L3),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var fW=Math.abs,X1=Math.cos,Ih=Math.sin,dW=1e-6,P3=Math.PI,Y1=P3/2,M_=hW(2);function D_(e){return e>1?Y1:e<-1?-Y1:Math.asin(e)}function hW(e){return e>0?Math.sqrt(e):0}function pW(e,t){var n=e*Ih(t),i=30,r;do t-=r=(t+Ih(t)-n)/(1+X1(t));while(fW(r)>dW&&--i>0);return t/2}function gW(e,t,n){function i(r,s){return[e*r*X1(s=pW(n,s)),t*Ih(s)]}return i.invert=function(r,s){return s=D_(s/t),[r/(e*X1(s)),D_((2*s+Ih(2*s))/n)]},i}var mW=gW(M_/Y1,M_,P3);function yW(){return lr(mW).scale(169.529)}const bW=_3(),K1=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function vW(e,t){return function n(){const i=t();return i.type=e,i.path=_3().projection(i),i.copy=i.copy||function(){const r=n();return K1.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},QT(i)}}function Lx(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Bh[e]=vW(e,t),this):Bh[e]||null}function z3(e){return e&&e.path||bW}const Bh={albers:A3,albersusa:Xq,azimuthalequalarea:Yq,azimuthalequidistant:Kq,conicconformal:Zq,conicequalarea:Lh,conicequidistant:nW,equalEarth:rW,equirectangular:eW,gnomonic:sW,identity:oW,mercator:Jq,mollweide:yW,naturalEarth1:aW,orthographic:uW,stereographic:lW,transversemercator:cW};for(const e in Bh)Lx(e,Bh[e]);function xW(){}const vr=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function I3(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return s(u,l,d=>{n(d,u,l),wW(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h<p;++h)if(EW((g=c[h])[0],d)!==-1){g.push(d);return}}),{type:"MultiPolygon",value:l,coordinates:c}}function s(u,l,c){var f=[],d=[],h,p,g,m,y,b;for(h=p=-1,m=u[0]>=l,vr[m<<1].forEach(v);++h<e-1;)g=m,m=u[h+1]>=l,vr[g|m<<1].forEach(v);for(vr[m<<0].forEach(v);++p<t-1;){for(h=-1,m=u[p*e+e]>=l,y=u[p*e]>=l,vr[m<<1|y<<2].forEach(v);++h<e-1;)g=m,m=u[p*e+e+h+1]>=l,b=y,y=u[p*e+h+1]>=l,vr[g|m<<1|y<<2|b<<3].forEach(v);vr[m|y<<3].forEach(v)}for(h=-1,y=u[p*e]>=l,vr[y<<2].forEach(v);++h<e-1;)b=y,y=u[p*e+h+1]>=l,vr[y<<2|b<<3].forEach(v);vr[y<<3].forEach(v);function v(x){var E=[x[0][0]+h,x[0][1]+p],S=[x[1][0]+h,x[1][1]+p],w=o(E),_=o(S),$,C;($=d[w])?(C=f[_])?(delete d[$.end],delete f[C.start],$===C?($.ring.push(S),c($.ring)):f[$.start]=d[C.end]={start:$.start,end:C.end,ring:$.ring.concat(C.ring)}):(delete d[$.end],$.ring.push(S),d[$.end=_]=$):($=f[_])?(C=d[w])?(delete f[$.start],delete d[C.end],$===C?($.ring.push(S),c($.ring)):f[C.start]=d[$.end]={start:C.start,end:$.end,ring:C.ring.concat($.ring)}):(delete f[$.start],$.ring.unshift(E),f[$.start=w]=$):f[w]=d[_]={start:w,end:_,ring:[E,S]}}}function o(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=l[g*e+p];d>0&&d<e&&p===d&&(m=l[g*e+p-1],f[0]=d+(c-m)/(y-m)-.5),h>0&&h<t&&g===h&&(m=l[(g-1)*e+p],f[1]=h+(c-m)/(y-m)-.5)})}return i.contour=r,i.size=function(u){if(!arguments.length)return[e,t];var l=Math.floor(u[0]),c=Math.floor(u[1]);return l>=0&&c>=0||N("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:xW,i):n===a},i}function wW(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)i+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return i}function EW(e,t){for(var n=-1,i=t.length,r;++n<i;)if(r=SW(e,t[n]))return r;return 0}function SW(e,t){for(var n=t[0],i=t[1],r=-1,s=0,o=e.length,a=o-1;s<o;a=s++){var u=e[s],l=u[0],c=u[1],f=e[a],d=f[0],h=f[1];if(_W(u,f,t))return 0;c>i!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function _W(e,t,n){var i;return $W(e,t,n)&&AW(e[i=+(e[0]===t[0])],n[i],t[i])}function $W(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function AW(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function B3(e,t,n){return function(i){var r=Ji(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,u=t?Oo(s,o,e):a/(e+1);return Fn(s+u,o,u)}}function Px(e){D.call(this,null,e)}Px.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]};G(Px,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||Wt,s=I3().smooth(e.smooth!==!1),o=e.thresholds||kW(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=s.size([c.width,c.height])(c.values,L(o)?o:o(c.values));CW(f,c,l,e),f.forEach(d=>{u.push(Cp(l,Ce(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function kW(e,t,n){const i=B3(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>$o(t(r).values)))}function CW(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(fe(r)&&(r=r(n,i)),fe(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=($e(r)?r:r[0])||1,a=($e(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(U3(t,o,a,u,l))}function U3(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(u),f}}function O_(e,t,n){const i=e>=0?e:Mb(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Ym(e){return fe(e)?e:Ht(+e)}function j3(){var e=u=>u[0],t=u=>u[1],n=Cu,i=[-1,-1],r=960,s=500,o=2;function a(u,l){const c=O_(i[0],u,e)>>o,f=O_(i[1],u,t)>>o,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>o),g=2*h+(s>>o),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;u.forEach(x=>{const E=d+(+e(x)>>o),S=h+(+t(x)>>o);E>=0&&E<p&&S>=0&&S<g&&(m[E+S*p]+=+n(x))}),c>0&&f>0?(xa(p,g,m,y,c),wa(p,g,y,m,f),xa(p,g,m,y,c),wa(p,g,y,m,f),xa(p,g,m,y,c),wa(p,g,y,m,f)):c>0?(xa(p,g,m,y,c),xa(p,g,y,m,c),xa(p,g,m,y,c),b=y):f>0&&(wa(p,g,m,y,f),wa(p,g,y,m,f),wa(p,g,m,y,f),b=y);const v=l?Math.pow(2,-2*o):1/_C(b);for(let x=0,E=p*g;x<E;++x)b[x]*=v;return{values:b,scale:1<<o,width:p,height:g,x1:d,y1:h,x2:d+(r>>o),y2:h+(s>>o)}}return a.x=function(u){return arguments.length?(e=Ym(u),a):e},a.y=function(u){return arguments.length?(t=Ym(u),a):t},a.weight=function(u){return arguments.length?(n=Ym(u),a):n},a.size=function(u){if(!arguments.length)return[r,s];var l=+u[0],c=+u[1];return l>=0&&c>=0||N("invalid size"),r=l,s=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||N("invalid cell size"),o=Math.floor(Math.log(u)/Math.LN2),a):1<<o},a.bandwidth=function(u){return arguments.length?(u=Y(u),u.length===1&&(u=[+u[0],+u[0]]),u.length!==2&&N("invalid bandwidth"),i=u,a):i},a}function xa(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<t;++o)for(let a=0,u=0;a<e+r;++a)a<e&&(u+=n[a+o*e]),a>=r&&(a>=s&&(u-=n[a-s+o*e]),i[a-r+o*e]=u/Math.min(a+1,e-1+s-a,s))}function wa(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o<e;++o)for(let a=0,u=0;a<t+r;++a)a<t&&(u+=n[o+a*e]),a>=r&&(a>=s&&(u-=n[o+(a-s)*e]),i[o+(a-r)*e]=u/Math.min(a+1,t-1+s-a,s))}function zx(e){D.call(this,null,e)}zx.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const FW=["x","y","weight","size","cellSize","bandwidth"];function q3(e,t){return FW.forEach(n=>t[n]!=null?e[n](t[n]):0),e}G(zx,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=TW(i,e.groupby),s=(e.groupby||[]).map(Je),o=q3(j3(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;d<s.length;++d)c[s[d]]=f[d];return c}return u=r.map(c=>Ce(l({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function TW(e,t){var n=[],i=c=>c(a),r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function Ix(e){D.call(this,null,e)}Ix.Definition={type:"Contour",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"values",type:"number",array:!0},{name:"x",type:"field"},{name:"y",type:"field"},{name:"weight",type:"field"},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number"},{name:"count",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"thresholds",type:"number",array:!0},{name:"smooth",type:"boolean",default:!0}]};G(Ix,D,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=I3().smooth(e.smooth!==!1),r=e.values,s=e.thresholds||B3(e.count||10,e.nice,!!r),o=e.size,a,u;return r||(r=t.materialize(t.SOURCE).source,a=q3(j3(),e)(r,!0),u=U3(a,a.scale||1,a.scale||1,0,0),o=[a.width,a.height],r=a.values),s=L(s)?s:s(r),r=i.size(o)(r,s),u&&r.forEach(u),this.value&&(n.rem=this.value),this.value=n.source=n.add=(r||[]).map(Ce),n}});const J1="Feature",Bx="FeatureCollection",MW="MultiPoint";function Ux(e){D.call(this,null,e)}Ux.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]};G(Ux,D,{transform(e,t){var n=this._features,i=this._points,r=e.fields,s=r&&r[0],o=r&&r[1],a=e.geojson||!r&&Wt,u=t.ADD,l;l=e.modified()||t.changed(t.REM)||t.modified(Bt(a))||s&&t.modified(Bt(s))||o&&t.modified(Bt(o)),(!this.value||l)&&(u=t.SOURCE,this._features=n=[],this._points=i=[]),a&&t.visit(u,c=>n.push(a(c))),s&&o&&(t.visit(u,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:J1,geometry:{type:MW,coordinates:i}})),this.value={type:Bx,features:n}}});function jx(e){D.call(this,null,e)}jx.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]};G(jx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Wt,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=z3(e.projection),n.materialize().reflow()):o=r===Wt||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=DW(i,e.pointRadius);return n.visit(o,u=>u[s]=i(r(u))),i.pointRadius(a),n.modifies(s)}});function DW(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function qx(e){D.call(this,null,e)}qx.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]};G(qx,D,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(s)}});function Wx(e){D.call(this,null,e)}Wx.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]};G(Wx,D,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=OW(z3(e.projection),e.field||Yn("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function OW(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function Hx(e){D.call(this,[],e),this.generator=kq()}Hx.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};G(Hx,D,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)fe(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(pF(n[0],r)):t.add.push(Ce(r)),n[0]=r,t}});function Gx(e){D.call(this,null,e)}Gx.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};G(Gx,D,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||Wt,s=NW(e.opacity,e),o=RW(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?$o(n.map(l=>$o(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=ce({},l,u);i||(f.$max=$o(c.values||[])),l[a]=LW(c,f,o.dep?o:Ht(o(f)),s.dep?s:Ht(s(f)))}),t.reflow(!0).modifies(a)}});function RW(e,t){let n;return fe(e)?(n=i=>zd(e(i,t)),n.dep=W3(e)):n=Ht(zd(e||"#888")),n}function NW(e,t){let n;return fe(e)?(n=i=>e(i,t),n.dep=W3(e)):e?n=Ht(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function W3(e){if(!fe(e))return!1;const t=yi(Bt(e));return t.$x||t.$y||t.$value||t.$max}function LW(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||s,c=e.values,f=c?m=>c[m]:cs,d=_s(u-o,l-a),h=d.getContext("2d"),p=h.getImageData(0,0,u-o,l-a),g=p.data;for(let m=a,y=0;m<l;++m){t.$y=m-a;for(let b=o,v=m*r;b<u;++b,y+=4){t.$x=b-o,t.$value=f(b+v);const x=n(t);g[y+0]=x.r,g[y+1]=x.g,g[y+2]=x.b,g[y+3]=~~(255*i(t))}}return h.putImageData(p,0,0),d}function H3(e){D.call(this,null,e),this.modified(!0)}G(H3,D,{transform(e,t){let n=this.value;return!n||e.modified("type")?(this.value=n=zW(e.type),K1.forEach(i=>{e[i]!=null&&R_(n,i,e[i])})):K1.forEach(i=>{e.modified(i)&&R_(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&PW(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function PW(e,t){const n=IW(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function zW(e){const t=Lx((e||"mercator").toLowerCase());return t||N("Unrecognized projection type: "+e),t()}function R_(e,t,n){fe(e[t])&&e[t](n)}function IW(e){return e=Y(e),e.length===1?e[0]:{type:Bx,features:e.reduce((t,n)=>t.concat(BW(n)),[])}}function BW(e){return e.type===Bx?e.features:Y(e).filter(t=>t!=null).map(t=>t.type===J1?t:{type:J1,geometry:t})}const UW=Object.freeze(Object.defineProperty({__proto__:null,contour:Ix,geojson:Ux,geopath:jx,geopoint:qx,geoshape:Wx,graticule:Hx,heatmap:Gx,isocontour:Px,kde2d:zx,projection:H3},Symbol.toStringTag,{value:"Module"}));function jW(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,o=n.length,a,u=0,l=0;for(s=0;s<o;++s)a=n[s],u+=a.x,l+=a.y;for(u=(u/o-e)*i,l=(l/o-t)*i,s=0;s<o;++s)a=n[s],a.x-=u,a.y-=l}return r.initialize=function(s){n=s},r.x=function(s){return arguments.length?(e=+s,r):e},r.y=function(s){return arguments.length?(t=+s,r):t},r.strength=function(s){return arguments.length?(i=+s,r):i},r}function qW(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return G3(this.cover(t,n),t,n,e)}function G3(e,t,n,i){if(isNaN(t)||isNaN(n))return e;var r,s=e._root,o={data:i},a=e._x0,u=e._y0,l=e._x1,c=e._y1,f,d,h,p,g,m,y,b;if(!s)return e._root=o,e;for(;s.length;)if((g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=s,!(s=s[y=m<<1|g]))return r[y]=o,e;if(h=+e._x.call(null,s.data),p=+e._y.call(null,s.data),t===h&&n===p)return o.next=s,r?r[y]=o:e._root=o,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=s,r[y]=o,e}function WW(e){var t,n,i=e.length,r,s,o=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;n<i;++n)isNaN(r=+this._x.call(null,t=e[n]))||isNaN(s=+this._y.call(null,t))||(o[n]=r,a[n]=s,r<u&&(u=r),r>c&&(c=r),s<l&&(l=s),s>f&&(f=s));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;n<i;++n)G3(this,o[n],a[n],e[n]);return this}function HW(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,i=this._y0,r=this._x1,s=this._y1;if(isNaN(n))r=(n=Math.floor(e))+1,s=(i=Math.floor(t))+1;else{for(var o=r-n||1,a=this._root,u,l;n>e||e>=r||i>t||t>=s;)switch(l=(t<i)<<1|e<n,u=new Array(4),u[l]=a,a=u,o*=2,l){case 0:r=n+o,s=i+o;break;case 1:n=r-o,s=i+o;break;case 2:r=n+o,i=s-o;break;case 3:n=r-o,i=s-o;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=i,this._x1=r,this._y1=s,this}function GW(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function VW(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Zt(e,t,n,i,r){this.node=e,this.x0=t,this.y0=n,this.x1=i,this.y1=r}function XW(e,t,n){var i,r=this._x0,s=this._y0,o,a,u,l,c=this._x1,f=this._y1,d=[],h=this._root,p,g;for(h&&d.push(new Zt(h,r,s,c,f)),n==null?n=1/0:(r=e-n,s=t-n,c=e+n,f=t+n,n*=n);p=d.pop();)if(!(!(h=p.node)||(o=p.x0)>c||(a=p.y0)>f||(u=p.x1)<r||(l=p.y1)<s))if(h.length){var m=(o+u)/2,y=(a+l)/2;d.push(new Zt(h[3],m,y,u,l),new Zt(h[2],o,y,m,l),new Zt(h[1],m,a,u,y),new Zt(h[0],o,a,m,y)),(g=(t>=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),x=b*b+v*v;if(x<n){var E=Math.sqrt(n=x);r=e-E,s=t-E,c=e+E,f=t+E,i=h.data}}return i}function YW(e){if(isNaN(c=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var t,n=this._root,i,r,s,o=this._x0,a=this._y0,u=this._x1,l=this._y1,c,f,d,h,p,g,m,y;if(!n)return this;if(n.length)for(;;){if((p=c>=(d=(o+u)/2))?o=d:u=d,(g=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function KW(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function JW(){return this._root}function QW(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function ZW(e){var t=[],n,i=this._root,r,s,o,a,u;for(i&&t.push(new Zt(i,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(i=n.node,s=n.x0,o=n.y0,a=n.x1,u=n.y1)&&i.length){var l=(s+a)/2,c=(o+u)/2;(r=i[3])&&t.push(new Zt(r,l,c,a,u)),(r=i[2])&&t.push(new Zt(r,s,c,l,u)),(r=i[1])&&t.push(new Zt(r,l,o,a,c)),(r=i[0])&&t.push(new Zt(r,s,o,l,c))}return this}function eH(e){var t=[],n=[],i;for(this._root&&t.push(new Zt(this._root,this._x0,this._y0,this._x1,this._y1));i=t.pop();){var r=i.node;if(r.length){var s,o=i.x0,a=i.y0,u=i.x1,l=i.y1,c=(o+u)/2,f=(a+l)/2;(s=r[0])&&t.push(new Zt(s,o,a,c,f)),(s=r[1])&&t.push(new Zt(s,c,a,u,f)),(s=r[2])&&t.push(new Zt(s,o,f,c,l)),(s=r[3])&&t.push(new Zt(s,c,f,u,l))}n.push(i)}for(;i=n.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function tH(e){return e[0]}function nH(e){return arguments.length?(this._x=e,this):this._x}function iH(e){return e[1]}function rH(e){return arguments.length?(this._y=e,this):this._y}function Vx(e,t,n){var i=new Xx(t??tH,n??iH,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function Xx(e,t,n,i,r,s){this._x=e,this._y=t,this._x0=n,this._y0=i,this._x1=r,this._y1=s,this._root=void 0}function N_(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var un=Vx.prototype=Xx.prototype;un.copy=function(){var e=new Xx(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,i;if(!t)return e;if(!t.length)return e._root=N_(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var r=0;r<4;++r)(i=t.source[r])&&(i.length?n.push({source:i,target:t.target[r]=new Array(4)}):t.target[r]=N_(i));return e};un.add=qW;un.addAll=WW;un.cover=HW;un.data=GW;un.extent=VW;un.find=XW;un.remove=YW;un.removeAll=KW;un.root=JW;un.size=QW;un.visit=ZW;un.visitAfter=eH;un.x=nH;un.y=rH;function en(e){return function(){return e}}function bs(e){return(e()-.5)*1e-6}function sH(e){return e.x+e.vx}function oH(e){return e.y+e.vy}function aH(e){var t,n,i,r=1,s=1;typeof e!="function"&&(e=en(e==null?1:+e));function o(){for(var l,c=t.length,f,d,h,p,g,m,y=0;y<s;++y)for(f=Vx(t,sH,oH).visitAfter(a),l=0;l<c;++l)d=t[l],g=n[d.index],m=g*g,h=d.x+d.vx,p=d.y+d.vy,f.visit(b);function b(v,x,E,S,w){var _=v.data,$=v.r,C=g+$;if(_){if(_.index>d.index){var T=h-_.x-_.vx,O=p-_.y-_.vy,k=T*T+O*O;k<C*C&&(T===0&&(T=bs(i),k+=T*T),O===0&&(O=bs(i),k+=O*O),k=(C-(k=Math.sqrt(k)))/k*r,d.vx+=(T*=k)*(C=($*=$)/(m+$)),d.vy+=(O*=k)*C,_.vx-=T*(C=1-C),_.vy-=O*C)}return}return x>h+C||S<h-C||E>p+C||w<p-C}}function a(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l<c;++l)f=t[l],n[f.index]=+e(f,l,t)}}return o.initialize=function(l,c){t=l,i=c,u()},o.iterations=function(l){return arguments.length?(s=+l,o):s},o.strength=function(l){return arguments.length?(r=+l,o):r},o.radius=function(l){return arguments.length?(e=typeof l=="function"?l:en(+l),u(),o):e},o}function uH(e){return e.index}function L_(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function lH(e){var t=uH,n=f,i,r=en(30),s,o,a,u,l,c=1;e==null&&(e=[]);function f(m){return 1/Math.min(a[m.source.index],a[m.target.index])}function d(m){for(var y=0,b=e.length;y<c;++y)for(var v=0,x,E,S,w,_,$,C;v<b;++v)x=e[v],E=x.source,S=x.target,w=S.x+S.vx-E.x-E.vx||bs(l),_=S.y+S.vy-E.y-E.vy||bs(l),$=Math.sqrt(w*w+_*_),$=($-s[v])/$*m*i[v],w*=$,_*=$,S.vx-=w*(C=u[v]),S.vy-=_*C,E.vx+=w*(C=1-C),E.vy+=_*C}function h(){if(o){var m,y=o.length,b=e.length,v=new Map(o.map((E,S)=>[t(E,S,o),E])),x;for(m=0,a=new Array(y);m<b;++m)x=e[m],x.index=m,typeof x.source!="object"&&(x.source=L_(v,x.source)),typeof x.target!="object"&&(x.target=L_(v,x.target)),a[x.source.index]=(a[x.source.index]||0)+1,a[x.target.index]=(a[x.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)x=e[m],u[m]=a[x.source.index]/(a[x.source.index]+a[x.target.index]);i=new Array(b),p(),s=new Array(b),g()}}function p(){if(o)for(var m=0,y=e.length;m<y;++m)i[m]=+n(e[m],m,e)}function g(){if(o)for(var m=0,y=e.length;m<y;++m)s[m]=+r(e[m],m,e)}return d.initialize=function(m,y){o=m,l=y,h()},d.links=function(m){return arguments.length?(e=m,h(),d):e},d.id=function(m){return arguments.length?(t=m,d):t},d.iterations=function(m){return arguments.length?(c=+m,d):c},d.strength=function(m){return arguments.length?(n=typeof m=="function"?m:en(+m),p(),d):n},d.distance=function(m){return arguments.length?(r=typeof m=="function"?m:en(+m),g(),d):r},d}var cH={value:()=>{}};function V3(){for(var e=0,t=arguments.length,n={},i;e<t;++e){if(!(i=arguments[e]+"")||i in n||/[\s.]/.test(i))throw new Error("illegal type: "+i);n[i]=[]}return new $d(n)}function $d(e){this._=e}function fH(e,t){return e.trim().split(/^|\s+/).map(function(n){var i="",r=n.indexOf(".");if(r>=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}$d.prototype=V3.prototype={constructor:$d,on:function(e,t){var n=this._,i=fH(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s<o;)if((r=(e=i[s]).type)&&(r=dH(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(r=(e=i[s]).type)n[r]=P_(n[r],e.name,t);else if(t==null)for(r in n)n[r]=P_(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new $d(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),i=0,r,s;i<r;++i)n[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],i=0,r=s.length;i<r;++i)s[i].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],r=0,s=i.length;r<s;++r)i[r].value.apply(t,n)}};function dH(e,t){for(var n=0,i=e.length,r;n<i;++n)if((r=e[n]).name===t)return r.value}function P_(e,t,n){for(var i=0,r=e.length;i<r;++i)if(e[i].name===t){e[i]=cH,e=e.slice(0,i).concat(e.slice(i+1));break}return n!=null&&e.push({name:t,value:n}),e}function hH(e,t,n){var i=new qL,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,o,a){o=+o,a=a==null?jL():+a,i._restart(function u(l){l+=r,i._restart(u,r+=o,a),s(l)},o,a)},i.restart(e,t,n),i)}const pH=1664525,gH=1013904223,z_=4294967296;function mH(){let e=1;return()=>(e=(pH*e+gH)%z_)/z_}function yH(e){return e.x}function bH(e){return e.y}var vH=10,xH=Math.PI*(3-Math.sqrt(5));function wH(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,u=WL(f),l=V3("tick","end"),c=mH();e==null&&(e=[]);function f(){d(),l.call("tick",t),n<i&&(u.stop(),l.call("end",t))}function d(g){var m,y=e.length,b;g===void 0&&(g=1);for(var v=0;v<g;++v)for(n+=(s-n)*r,a.forEach(function(x){x(n)}),m=0;m<y;++m)b=e[m],b.fx==null?b.x+=b.vx*=o:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=o:(b.y=b.fy,b.vy=0);return t}function h(){for(var g=0,m=e.length,y;g<m;++g){if(y=e[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=vH*Math.sqrt(.5+g),v=g*xH;y.x=b*Math.cos(v),y.y=b*Math.sin(v)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function p(g){return g.initialize&&g.initialize(e,c),g}return h(),t={tick:d,restart:function(){return u.restart(f),t},stop:function(){return u.stop(),t},nodes:function(g){return arguments.length?(e=g,h(),a.forEach(p),t):e},alpha:function(g){return arguments.length?(n=+g,t):n},alphaMin:function(g){return arguments.length?(i=+g,t):i},alphaDecay:function(g){return arguments.length?(r=+g,t):+r},alphaTarget:function(g){return arguments.length?(s=+g,t):s},velocityDecay:function(g){return arguments.length?(o=1-g,t):1-o},randomSource:function(g){return arguments.length?(c=g,a.forEach(p),t):c},force:function(g,m){return arguments.length>1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,x,E,S,w,_;for(y==null?y=1/0:y*=y,b=0;b<v;++b)w=e[b],x=g-w.x,E=m-w.y,S=x*x+E*E,S<y&&(_=w,y=S);return _},on:function(g,m){return arguments.length>1?(l.on(g,m),t):l.on(g)}}}function EH(){var e,t,n,i,r=en(-30),s,o=1,a=1/0,u=.81;function l(h){var p,g=e.length,m=Vx(e,yH,bH).visitAfter(f);for(i=h,p=0;p<g;++p)t=e[p],m.visit(d)}function c(){if(e){var h,p=e.length,g;for(s=new Array(p),h=0;h<p;++h)g=e[h],s[g.index]=+r(g,h,e)}}function f(h){var p=0,g,m,y=0,b,v,x;if(h.length){for(b=v=x=0;x<4;++x)(g=h[x])&&(m=Math.abs(g.value))&&(p+=g.value,y+=m,b+=m*g.x,v+=m*g.y);h.x=b/y,h.y=v/y}else{g=h,g.x=g.data.x,g.y=g.data.y;do p+=s[g.data.index];while(g=g.next)}h.value=p}function d(h,p,g,m){if(!h.value)return!0;var y=h.x-t.x,b=h.y-t.y,v=m-p,x=y*y+b*b;if(v*v/u<x)return x<a&&(y===0&&(y=bs(n),x+=y*y),b===0&&(b=bs(n),x+=b*b),x<o&&(x=Math.sqrt(o*x)),t.vx+=y*h.value*i/x,t.vy+=b*h.value*i/x),!0;if(h.length||x>=a)return;(h.data!==t||h.next)&&(y===0&&(y=bs(n),x+=y*y),b===0&&(b=bs(n),x+=b*b),x<o&&(x=Math.sqrt(o*x)));do h.data!==t&&(v=s[h.data.index]*i/x,t.vx+=y*v,t.vy+=b*v);while(h=h.next)}return l.initialize=function(h,p){e=h,n=p,c()},l.strength=function(h){return arguments.length?(r=typeof h=="function"?h:en(+h),c(),l):r},l.distanceMin=function(h){return arguments.length?(o=h*h,l):Math.sqrt(o)},l.distanceMax=function(h){return arguments.length?(a=h*h,l):Math.sqrt(a)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function SH(e){var t=en(.1),n,i,r;typeof e!="function"&&(e=en(e==null?0:+e));function s(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(r[u]-c.x)*i[u]*a}function o(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(t=typeof a=="function"?a:en(+a),o(),s):t},s.x=function(a){return arguments.length?(e=typeof a=="function"?a:en(+a),o(),s):e},s}function _H(e){var t=en(.1),n,i,r;typeof e!="function"&&(e=en(e==null?0:+e));function s(a){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(r[u]-c.y)*i[u]*a}function o(){if(n){var a,u=n.length;for(i=new Array(u),r=new Array(u),a=0;a<u;++a)i[a]=isNaN(r[a]=+e(n[a],a,n))?0:+t(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(t=typeof a=="function"?a:en(+a),o(),s):t},s.y=function(a){return arguments.length?(e=typeof a=="function"?a:en(+a),o(),s):e},s}const I_={center:jW,collide:aH,nbody:EH,link:lH,x:SH,y:_H},zl="forces",Q1=["alpha","alphaMin","alphaTarget","velocityDecay","forces"],$H=["static","iterations"],X3=["x","y","vx","vy"];function Yx(e){D.call(this,null,e)}Yx.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30,expr:!0},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:X3}]};G(Yx,D,{transform(e,t){var n=this.value,i=t.changed(t.ADD_REM),r=e.modified(Q1),s=e.iterations||300;if(n?(i&&(t.modifies("index"),n.nodes(t.source)),(r||t.changed(t.MOD))&&Y3(n,e,0,t)):(this.value=n=kH(t.source,e),n.on("tick",AH(t.dataflow,this)),e.static||(i=!0,n.tick()),t.modifies("index")),r||i||e.modified($H)||t.changed()&&e.restart){if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/s)),e.static)for(n.stop();--s>=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;u<l;++u)if(c=a[u],!(c.name!==zl||c.op._argval.force!=="link")){for(var i=c.op._argops,r=0,s=i.length,o;r<s;++r)if(i[r].name==="links"&&(o=i[r].op.source)){n.pulse(o,n.changeset().reflow());break}}return t.reflow(e.modified()).modifies(X3)}});function AH(e,t){return()=>e.touch(t).run()}function kH(e,t){const n=wH(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),Y3(n,t,!0).on("end",()=>s=!0)}function Y3(e,t,n,i){var r=Y(t.forces),s,o,a,u;for(s=0,o=Q1.length;s<o;++s)a=Q1[s],a!==zl&&t.modified(a)&&e[a](t[a]);for(s=0,o=r.length;s<o;++s)u=zl+s,a=n||t.modified(zl,s)?FH(r[s]):i&&CH(r[s],i)?e.force(u):null,a&&e.force(u,a);for(o=e.numForces||0;s<o;++s)e.force(zl+s,null);return e.numForces=r.length,e}function CH(e,t){var n,i;for(n in e)if(fe(i=e[n])&&t.modified(Bt(i)))return 1;return 0}function FH(e){var t,n;J(I_,e.force)||N("Unrecognized force: "+e.force),t=I_[e.force]();for(n in e)fe(t[n])&&TH(t[n],e[n],e);return t}function TH(e,t,n){e(fe(t)?i=>t(i,n):t)}const MH=Object.freeze(Object.defineProperty({__proto__:null,force:Yx},Symbol.toStringTag,{value:"Module"}));function DH(e,t){return e.parent===t.parent?1:2}function OH(e){return e.reduce(RH,0)/e.length}function RH(e,t){return e+t.x}function NH(e){return 1+e.reduce(LH,0)}function LH(e,t){return Math.max(e,t.y)}function PH(e){for(var t;t=e.children;)e=t[0];return e}function zH(e){for(var t;t=e.children;)e=t[t.length-1];return e}function IH(){var e=DH,t=1,n=1,i=!1;function r(s){var o,a=0;s.eachAfter(function(d){var h=d.children;h?(d.x=OH(h),d.y=NH(h)):(d.x=o?a+=e(d,o):0,d.y=0,o=d)});var u=PH(s),l=zH(s),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function BH(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function UH(){return this.eachAfter(BH)}function jH(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function qH(e,t){for(var n=this,i=[n],r,s,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function WH(e,t){for(var n=this,i=[n],r=[],s,o,a,u=-1;n=i.pop();)if(r.push(n),s=n.children)for(o=0,a=s.length;o<a;++o)i.push(s[o]);for(;n=r.pop();)e.call(t,n,++u,this);return this}function HH(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i}function GH(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n})}function VH(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function XH(e){for(var t=this,n=YH(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function YH(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function KH(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function JH(){return Array.from(this)}function QH(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function ZH(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*eG(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r<s;++r)n.push(i[r]);while(n.length)}function Kx(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=iG)):t===void 0&&(t=nG);for(var n=new lu(e),i,r=[n],s,o,a,u;i=r.pop();)if((o=t(i.data))&&(u=(o=Array.from(o)).length))for(i.children=o,a=u-1;a>=0;--a)r.push(s=o[a]=new lu(o[a])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(K3)}function tG(){return Kx(this).eachBefore(rG)}function nG(e){return e.children}function iG(e){return Array.isArray(e)?e[1]:null}function rG(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function K3(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function lu(e){this.data=e,this.depth=this.height=0,this.parent=null}lu.prototype=Kx.prototype={constructor:lu,count:UH,each:jH,eachAfter:WH,eachBefore:qH,find:HH,sum:GH,sort:VH,path:XH,ancestors:KH,descendants:JH,leaves:QH,links:ZH,copy:tG,[Symbol.iterator]:eG};function Ad(e){return e==null?null:J3(e)}function J3(e){if(typeof e!="function")throw new Error;return e}function xo(){return 0}function Fa(e){return function(){return e}}const sG=1664525,oG=1013904223,B_=4294967296;function aG(){let e=1;return()=>(e=(sG*e+oG)%B_)/B_}function uG(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lG(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function cG(e,t){for(var n=0,i=(e=lG(Array.from(e),t)).length,r=[],s,o;n<i;)s=e[n],o&&Q3(o,s)?++n:(o=dG(r=fG(r,s)),n=0);return o}function fG(e,t){var n,i;if(Km(t,e))return[t];for(n=0;n<e.length;++n)if(qf(t,e[n])&&Km(Il(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(i=n+1;i<e.length;++i)if(qf(Il(e[n],e[i]),t)&&qf(Il(e[n],t),e[i])&&qf(Il(e[i],t),e[n])&&Km(Z3(e[n],e[i],t),e))return[e[n],e[i],t];throw new Error}function qf(e,t){var n=e.r-t.r,i=t.x-e.x,r=t.y-e.y;return n<0||n*n<i*i+r*r}function Q3(e,t){var n=e.r-t.r+Math.max(e.r,t.r,1)*1e-9,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function Km(e,t){for(var n=0;n<t.length;++n)if(!Q3(e,t[n]))return!1;return!0}function dG(e){switch(e.length){case 1:return hG(e[0]);case 2:return Il(e[0],e[1]);case 3:return Z3(e[0],e[1],e[2])}}function hG(e){return{x:e.x,y:e.y,r:e.r}}function Il(e,t){var n=e.x,i=e.y,r=e.r,s=t.x,o=t.y,a=t.r,u=s-n,l=o-i,c=a-r,f=Math.sqrt(u*u+l*l);return{x:(n+s+u/f*c)/2,y:(i+o+l/f*c)/2,r:(f+r+a)/2}}function Z3(e,t,n){var i=e.x,r=e.y,s=e.r,o=t.x,a=t.y,u=t.r,l=n.x,c=n.y,f=n.r,d=i-o,h=i-l,p=r-a,g=r-c,m=u-s,y=f-s,b=i*i+r*r-s*s,v=b-o*o-a*a+u*u,x=b-l*l-c*c+f*f,E=h*p-d*g,S=(p*x-g*v)/(E*2)-i,w=(g*m-p*y)/E,_=(h*v-d*x)/(E*2)-r,$=(d*y-h*m)/E,C=w*w+$*$-1,T=2*(s+S*w+_*$),O=S*S+_*_-s*s,k=-(Math.abs(C)>1e-6?(T+Math.sqrt(T*T-4*C*O))/(2*C):O/T);return{x:i+S+w*k,y:r+_+$*k,r:k}}function U_(e,t,n){var i=e.x-t.x,r,s,o=e.y-t.y,a,u,l=i*i+o*o;l?(s=t.r+n.r,s*=s,u=e.r+n.r,u*=u,s>u?(r=(l+u-s)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*o,n.y=e.y-r*o+a*i):(r=(l+s-u)/(2*l),a=Math.sqrt(Math.max(0,s/l-r*r)),n.x=t.x+r*i-a*o,n.y=t.y+r*o+a*i)):(n.x=t.x+n.r,n.y=t.y)}function j_(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function q_(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function Wf(e){this._=e,this.next=null,this.previous=null}function pG(e,t){if(!(s=(e=uG(e)).length))return 0;var n,i,r,s,o,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;U_(i,n,r=e[2]),n=new Wf(n),i=new Wf(i),r=new Wf(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;u<s;++u){U_(n._,i._,r=e[u]),r=new Wf(r),l=i.next,c=n.previous,f=i._.r,d=n._.r;do if(f<=d){if(j_(l._,r._)){i=l,n.next=i,i.previous=n,--u;continue e}f+=l._.r,l=l.next}else{if(j_(c._,r._)){n=c,n.next=i,i.previous=n,--u;continue e}d+=c._.r,c=c.previous}while(l!==c.next);for(r.previous=n,r.next=i,n.next=i.previous=i=r,o=q_(n);(r=r.next)!==i;)(a=q_(r))<o&&(n=r,o=a);i=n.next}for(n=[i._],r=i;(r=r.next)!==i;)n.push(r._);for(r=cG(n,t),u=0;u<s;++u)n=e[u],n.x-=r.x,n.y-=r.y;return r.r}function gG(e){return Math.sqrt(e.value)}function mG(){var e=null,t=1,n=1,i=xo;function r(s){const o=aG();return s.x=t/2,s.y=n/2,e?s.eachBefore(W_(e)).eachAfter(Jm(i,.5,o)).eachBefore(H_(1)):s.eachBefore(W_(gG)).eachAfter(Jm(xo,1,o)).eachAfter(Jm(i,s.r/Math.min(t,n),o)).eachBefore(H_(Math.min(t,n)/(2*s.r))),s}return r.radius=function(s){return arguments.length?(e=Ad(s),r):e},r.size=function(s){return arguments.length?(t=+s[0],n=+s[1],r):[t,n]},r.padding=function(s){return arguments.length?(i=typeof s=="function"?s:Fa(+s),r):i},r}function W_(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Jm(e,t,n){return function(i){if(r=i.children){var r,s,o=r.length,a=e(i)*t||0,u;if(a)for(s=0;s<o;++s)r[s].r+=a;if(u=pG(r,n),a)for(s=0;s<o;++s)r[s].r-=a;i.r=u+a}}}function H_(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}function eO(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function nf(e,t,n,i,r){for(var s=e.children,o,a=-1,u=s.length,l=e.value&&(i-t)/e.value;++a<u;)o=s[a],o.y0=n,o.y1=r,o.x0=t,o.x1=t+=o.value*l}function yG(){var e=1,t=1,n=0,i=!1;function r(o){var a=o.height+1;return o.x0=o.y0=n,o.x1=e,o.y1=t/a,o.eachBefore(s(t,a)),i&&o.eachBefore(eO),o}function s(o,a){return function(u){u.children&&nf(u,u.x0,o*(u.depth+1)/a,u.x1,o*(u.depth+2)/a);var l=u.x0,c=u.y0,f=u.x1-n,d=u.y1-n;f<l&&(l=f=(l+f)/2),d<c&&(c=d=(c+d)/2),u.x0=l,u.y0=c,u.x1=f,u.y1=d}}return r.round=function(o){return arguments.length?(i=!!o,r):i},r.size=function(o){return arguments.length?(e=+o[0],t=+o[1],r):[e,t]},r.padding=function(o){return arguments.length?(n=+o,r):n},r}var bG={depth:-1},G_={},Qm={};function vG(e){return e.id}function xG(e){return e.parentId}function V_(){var e=vG,t=xG,n;function i(r){var s=Array.from(r),o=e,a=t,u,l,c,f,d,h,p,g,m=new Map;if(n!=null){const y=s.map((x,E)=>wG(n(x,E,r))),b=y.map(X_),v=new Set(y).add("");for(const x of b)v.has(x)||(v.add(x),y.push(x),b.push(X_(x)),s.push(Qm));o=(x,E)=>y[E],a=(x,E)=>b[E]}for(c=0,u=s.length;c<u;++c)l=s[c],h=s[c]=new lu(l),(p=o(l,c,r))!=null&&(p+="")&&(g=h.id=p,m.set(g,m.has(g)?G_:h)),(p=a(l,c,r))!=null&&(p+="")&&(h.parent=p);for(c=0;c<u;++c)if(h=s[c],p=h.parent){if(d=m.get(p),!d)throw new Error("missing: "+p);if(d===G_)throw new Error("ambiguous: "+p);d.children?d.children.push(h):d.children=[h],h.parent=d}else{if(f)throw new Error("multiple roots");f=h}if(!f)throw new Error("no root");if(n!=null){for(;f.data===Qm&&f.children.length===1;)f=f.children[0],--u;for(let y=s.length-1;y>=0&&(h=s[y],h.data===Qm);--y)h.data=null}if(f.parent=bG,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(K3),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=Ad(r),i):e},i.parentId=function(r){return arguments.length?(t=Ad(r),i):t},i.path=function(r){return arguments.length?(n=Ad(r),i):n},i}function wG(e){e=`${e}`;let t=e.length;return Z1(e,t-1)&&!Z1(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function X_(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Z1(e,t););return e.slice(0,t)}function Z1(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function EG(e,t){return e.parent===t.parent?1:2}function Zm(e){var t=e.children;return t?t[0]:e.t}function e0(e){var t=e.children;return t?t[t.length-1]:e.t}function SG(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function _G(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function $G(e,t,n){return e.a.parent===t.parent?e.a:n}function kd(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}kd.prototype=Object.create(lu.prototype);function AG(e){for(var t=new kd(e,0),n,i=[t],r,s,o,a;n=i.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)i.push(r=n.children[o]=new kd(s[o],o)),r.parent=n;return(t.parent=new kd(null,0)).children=[t],t}function kG(){var e=EG,t=1,n=1,i=null;function r(l){var c=AG(l);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.x<f.x&&(f=b),b.x>d.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function s(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){_G(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function o(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,x;p=e0(p),d=Zm(d),p&&d;)g=Zm(g),h=e0(h),h.a=l,x=p.z+b-d.z-m+e(p._,d._),x>0&&(SG($G(p,l,f),l,x),m+=x,y+=x),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!e0(h)&&(h.t=p,h.m+=b-y),d&&!Zm(g)&&(g.t=d,g.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function lg(e,t,n,i,r){for(var s=e.children,o,a=-1,u=s.length,l=e.value&&(r-n)/e.value;++a<u;)o=s[a],o.x0=t,o.x1=i,o.y0=n,o.y1=n+=o.value*l}var tO=(1+Math.sqrt(5))/2;function nO(e,t,n,i,r,s){for(var o=[],a=t.children,u,l,c=0,f=0,d=a.length,h,p,g=t.value,m,y,b,v,x,E,S;c<d;){h=r-n,p=s-i;do m=a[f++].value;while(!m&&f<d);for(y=b=m,E=Math.max(p/h,h/p)/(g*e),S=m*m*E,x=Math.max(b/S,S/y);f<d;++f){if(m+=l=a[f].value,l<y&&(y=l),l>b&&(b=l),S=m*m*E,v=Math.max(b/S,S/y),v>x){m-=l;break}x=v}o.push(u={value:m,dice:h<p,children:a.slice(c,f)}),u.dice?nf(u,n,i,r,g?i+=p*m/g:s):lg(u,n,i,g?n+=h*m/g:r,s),g-=m,c=f}return o}const iO=function e(t){function n(i,r,s,o,a){nO(t,i,r,s,o,a)}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(tO);function CG(){var e=iO,t=!1,n=1,i=1,r=[0],s=xo,o=xo,a=xo,u=xo,l=xo;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(eO),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),d.x0=p,d.y0=g,d.x1=m,d.y1=y,d.children&&(h=r[d.depth+1]=s(d)/2,p+=l(d)-h,g+=o(d)-h,m-=a(d)-h,y-=u(d)-h,m<p&&(p=m=(p+m)/2),y<g&&(g=y=(g+y)/2),e(d,p,g,m,y))}return c.round=function(d){return arguments.length?(t=!!d,c):t},c.size=function(d){return arguments.length?(n=+d[0],i=+d[1],c):[n,i]},c.tile=function(d){return arguments.length?(e=J3(d),c):e},c.padding=function(d){return arguments.length?c.paddingInner(d).paddingOuter(d):c.paddingInner()},c.paddingInner=function(d){return arguments.length?(s=typeof d=="function"?d:Fa(+d),c):s},c.paddingOuter=function(d){return arguments.length?c.paddingTop(d).paddingRight(d).paddingBottom(d).paddingLeft(d):c.paddingTop()},c.paddingTop=function(d){return arguments.length?(o=typeof d=="function"?d:Fa(+d),c):o},c.paddingRight=function(d){return arguments.length?(a=typeof d=="function"?d:Fa(+d),c):a},c.paddingBottom=function(d){return arguments.length?(u=typeof d=="function"?d:Fa(+d),c):u},c.paddingLeft=function(d){return arguments.length?(l=typeof d=="function"?d:Fa(+d),c):l},c}function FG(e,t,n,i,r){var s=e.children,o,a=s.length,u,l=new Array(a+1);for(l[0]=u=o=0;o<a;++o)l[o+1]=u+=s[o].value;c(0,a,e.value,t,n,i,r);function c(f,d,h,p,g,m,y){if(f>=d-1){var b=s[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=l[f],x=h/2+v,E=f+1,S=d-1;E<S;){var w=E+S>>>1;l[w]<x?E=w+1:S=w}x-l[E-1]<l[E]-x&&f+1<E&&--E;var _=l[E]-v,$=h-_;if(m-p>y-g){var C=h?(p*$+m*_)/h:m;c(f,E,_,p,g,C,y),c(E,d,$,C,g,m,y)}else{var T=h?(g*$+y*_)/h:y;c(f,E,_,p,g,m,T),c(E,d,$,p,T,m,y)}}}function TG(e,t,n,i,r){(e.depth&1?lg:nf)(e,t,n,i,r)}const MG=function e(t){function n(i,r,s,o,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,p=u.length,g=i.value;++d<p;){for(l=u[d],c=l.children,f=l.value=0,h=c.length;f<h;++f)l.value+=c[f].value;l.dice?nf(l,r,s,o,g?s+=(a-s)*l.value/g:a):lg(l,r,s,g?r+=(o-r)*l.value/g:o,a),g-=l.value}else i._squarify=u=nO(t,i,r,s,o,a),u.ratio=t}return n.ratio=function(i){return e((i=+i)>1?i:1)},n}(tO);function ey(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function Jx(e){D.call(this,null,e)}Jx.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const DG=e=>e.values;G(Jx,D,{transform(e,t){t.source||N("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&kp(o.data)&&r.rem.push(o.data)}),this.value=s=Kx({values:Y(e.keys).reduce((o,a)=>(o.key(a),o),OG()).entries(r.source)},DG),n&&s.each(o=>{o.children&&(o=Ce(o.data),r.add.push(o),r.source.push(o))}),ey(s,re,re)),r.source.root=s,r}});function OG(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],u={},l={};let c=-1,f,d,h;for(;++c<o;)f=a(d=r[c])+"",(h=u[f])?h.push(d):u[f]=[d];for(f in u)l[f]=n(u[f],s);return l}function i(r,s){if(++s>e.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Gr(e){D.call(this,null,e)}const RG=(e,t)=>e.parent===t.parent?1:2;G(Gr,D,{transform(e,t){(!t.source||!t.source.root)&&N(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(ea(e.sort,o=>o.data)),NG(n,this.params,e),n.separation&&n.separation(e.separation!==!1?RG:Cu);try{this.value=n(r)}catch(o){N(o)}return r.each(o=>LG(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function NG(e,t,n){for(let i,r=0,s=t.length;r<s;++r)i=t[r],i in n&&e[i](n[i])}function LG(e,t,n){const i=e.data,r=t.length-1;for(let s=0;s<r;++s)i[n[s]]=e[t[s]];i[n[r]]=e.children?e.children.length:0}const ty=["x","y","r","depth","children"];function Qx(e){Gr.call(this,e)}Qx.Definition={type:"Pack",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"radius",type:"field",default:null},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ty.length,default:ty}]};G(Qx,Gr,{layout:mG,params:["radius","size","padding"],fields:ty});const ny=["x0","y0","x1","y1","depth","children"];function Zx(e){Gr.call(this,e)}Zx.Definition={type:"Partition",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"padding",type:"number",default:0},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ny.length,default:ny}]};G(Zx,Gr,{layout:yG,params:["size","round","padding"],fields:ny});function e2(e){D.call(this,null,e)}e2.Definition={type:"Stratify",metadata:{treesource:!0},params:[{name:"key",type:"field",required:!0},{name:"parentKey",type:"field",required:!0}]};G(e2,D,{transform(e,t){t.source||N("Stratify transform requires an upstream data source.");let n=this.value;const i=e.modified(),r=t.fork(t.ALL).materialize(t.SOURCE),s=!n||i||t.changed(t.ADD_REM)||t.modified(e.key.fields)||t.modified(e.parentKey.fields);return r.source=r.source.slice(),s&&(n=r.source.length?ey(V_().id(e.key).parentId(e.parentKey)(r.source),e.key,Rn):ey(V_()([{}]),e.key,e.key)),r.source.root=this.value=n,r}});const Y_={tidy:kG,cluster:IH},iy=["x","y","depth","children"];function t2(e){Gr.call(this,e)}t2.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:iy.length,default:iy}]};G(t2,Gr,{layout(e){const t=e||"tidy";if(J(Y_,t))return Y_[t]();N("Unrecognized Tree layout method: "+t)},params:["size","nodeSize"],fields:iy});function n2(e){D.call(this,[],e)}n2.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]};G(n2,D,{transform(e,t){const n=this.value,i=t.source&&t.source.root,r=t.fork(t.NO_SOURCE),s={};return i||N("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(r.rem=n,t.visit(t.SOURCE,o=>s[re(o)]=1),i.each(o=>{const a=o.data,u=o.parent&&o.parent.data;u&&s[re(a)]&&s[re(u)]&&r.add.push(Ce({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[re(o)]=1),n.forEach(o=>{(s[re(o.source)]||s[re(o.target)])&&r.mod.push(o)})),r}});const K_={binary:FG,dice:nf,slice:lg,slicedice:TG,squarify:iO,resquarify:MG},ry=["x0","y0","x1","y1","depth","children"];function i2(e){Gr.call(this,e)}i2.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:ry.length,default:ry}]};G(i2,Gr,{layout(){const e=CG();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{J(K_,t)?e.tile(K_[t]):N("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:ry});const PG=Object.freeze(Object.defineProperty({__proto__:null,nest:Jx,pack:Qx,partition:Zx,stratify:e2,tree:t2,treelinks:n2,treemap:i2},Symbol.toStringTag,{value:"Module"})),t0=4278190080;function zG(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function IG(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,u=_s(s,o).getContext("2d"),l=_s(s,o).getContext("2d"),c=a&&_s(s,o).getContext("2d");n.forEach(_=>Cd(u,_,!1)),Cd(l,t,!1),a&&Cd(c,t,!0);const f=n0(u,s,o),d=n0(l,s,o),h=a&&n0(c,s,o),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,x,E,S,w;for(y=0;y<o;++y)for(m=0;m<s;++m)x=y*s+m,E=f[x]&t0,w=d[x]&t0,S=a&&h[x]&t0,(E||S||w)&&(b=e(m),v=e(y),!r&&(E||w)&&p.set(b,v),a&&(E||S)&&g.set(b,v));return[p,g]}function n0(e,t,n){return new Uint32Array(e.getImageData(0,0,t,n).data.buffer)}function Cd(e,t,n){if(!t.length)return;const i=t[0].mark.marktype;i==="group"?t.forEach(r=>{r.items.forEach(s=>Cd(e,s.items,n))}):Pn[i].draw(e,{items:n?t.map(BG):t})}function BG(e){const t=Cp(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const xr=5,Gt=31,xc=32,us=new Uint32Array(xc+1),li=new Uint32Array(xc+1);li[0]=0;us[0]=~li[0];for(let e=1;e<=xc;++e)li[e]=li[e-1]<<1|1,us[e]=~li[e];function UG(e,t){const n=new Uint32Array(~~((e*t+xc)/xc));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>xr]&1<<(a&Gt)},set:(s,o)=>{const a=o*e+s;i(a>>>xr,1<<(a&Gt))},clear:(s,o)=>{const a=o*e+s;r(a>>>xr,~(1<<(a&Gt)))},getRange:(s,o,a,u)=>{let l=u,c,f,d,h;for(;l>=o;--l)if(c=l*e+s,f=l*e+a,d=c>>>xr,h=f>>>xr,d===h){if(n[d]&us[c&Gt]&li[(f&Gt)+1])return!0}else{if(n[d]&us[c&Gt]||n[h]&li[(f&Gt)+1])return!0;for(let p=d+1;p<h;++p)if(n[p])return!0}return!1},setRange:(s,o,a,u)=>{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>xr,d=c>>>xr,f===d)i(f,us[l&Gt]&li[(c&Gt)+1]);else for(i(f,us[l&Gt]),i(d,li[(c&Gt)+1]),h=f+1;h<d;++h)i(h,4294967295)},clearRange:(s,o,a,u)=>{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>xr,d=c>>>xr,f===d)r(f,li[l&Gt]|us[(c&Gt)+1]);else for(r(f,li[l&Gt]),r(d,us[(c&Gt)+1]),h=f+1;h<d;++h)r(h,0)},outOfBounds:(s,o,a,u)=>s<0||o<0||u>=t||a>=e}}function jG(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>UG(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function qG(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,u=a.length,l=o.datum.fontSize,c=Mn.width(o.datum,o.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v<u;++v)d=a[v].x,p=a[v].y,h=a[v].x2===void 0?d:a[v].x2,g=a[v].y2===void 0?p:a[v].y2,m=(d+h)/2,y=(p+g)/2,b=Math.abs(h-d+g-p),b>=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=l/2,d=o.x-m,h=o.x+m,p=o.y-y,g=o.y+y,o.align="center",d<0&&h<=r?o.align="left":0<=d&&r<h&&(o.align="right"),o.baseline="middle",p<0&&g<=s?o.baseline="top":0<=p&&s<g&&(o.baseline="bottom"),!0}}function Uh(e,t,n,i,r,s){let o=n/2;return e-o<0||e+o>r||t-(o=i/2)<0||t+o>s}function vs(e,t,n,i,r,s,o,a){const u=r*s/(i*2),l=e(t-u),c=e(t+u),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(l,f,c,d)||o.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function WG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function u(l,c,f,d,h){const p=e.invert(l),g=e.invert(c);let m=f,y=s,b;if(!Uh(p,g,d,h,r,s)&&!vs(e,p,g,h,d,m,o,a)&&!vs(e,p,g,h,d,h,o,null)){for(;y-m>=1;)b=(m+y)/2,vs(e,p,g,h,d,b,o,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Mn.width(l.datum,l.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,x,E,S,w,_,$,C,T,O,k,F,A,M,P,z;for(let U=0;U<f;++U){for(b=c[U].x,x=c[U].y,v=c[U].x2===void 0?b:c[U].x2,E=c[U].y2===void 0?x:c[U].y2,b>v&&(z=b,b=v,v=z),x>E&&(z=x,x=E,E=z),C=e(b),O=e(v),T=~~((C+O)/2),k=e(x),A=e(E),F=~~((k+A)/2),_=T;_>=C;--_)for($=F;$>=k;--$)P=u(_,$,p,h,d),P&&([l.x,l.y,p,g]=P);for(_=T;_<=O;++_)for($=F;$<=A;++$)P=u(_,$,p,h,d),P&&([l.x,l.y,p,g]=P);!g&&!n&&(M=Math.abs(v-b+E-x),S=(b+v)/2,w=(x+E)/2,M>=y&&!Uh(S,w,h,d,r,s)&&!vs(e,S,w,d,h,d,o,null)&&(y=M,l.x=S,l.y=w,m=!0))}return g||m?(S=h/2,w=d/2,o.setRange(e(l.x-S),e(l.y-w),e(l.x+S),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const HG=[-1,-1,1,1],GG=[-1,1,-1,1];function VG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Mn.width(l.datum,l.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,x,E,S,w,_,$,C,T,O,k,F;for(let A=0;A<f;++A){for(v=c[A].x,E=c[A].y,x=c[A].x2===void 0?v:c[A].x2,S=c[A].y2===void 0?E:c[A].y2,p.push([e((v+x)/2),e((E+S)/2)]);p.length;)if([$,C]=p.pop(),!(o.get($,C)||a.get($,C)||u.get($,C))){u.set($,C);for(let M=0;M<4;++M)w=$+HG[M],_=C+GG[M],u.outOfBounds(w,_,w,_)||p.push([w,_]);if(w=e.invert($),_=e.invert(C),T=g,O=s,!Uh(w,_,h,d,r,s)&&!vs(e,w,_,d,h,T,o,a)&&!vs(e,w,_,d,h,d,o,null)){for(;O-T>=1;)k=(T+O)/2,vs(e,w,_,d,h,k,o,a)?O=k:T=k;T>g&&(l.x=w,l.y=_,g=T,m=!0)}}!m&&!n&&(F=Math.abs(x-v+S-E),w=(v+x)/2,_=(E+S)/2,F>=b&&!Uh(w,_,h,d,r,s)&&!vs(e,w,_,d,h,d,o,null)&&(b=F,l.x=w,l.y=_,y=!0))}return m||y?(w=h/2,_=d/2,o.setRange(e(l.x-w),e(l.y-_),e(l.x+w),e(l.y+_)),l.align="center",l.baseline="middle",!0):!1}}const XG=["right","center","left"],YG=["bottom","middle","top"];function KG(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=l.textWidth??0,h,p,g,m,y,b,v,x,E,S,w,_,$,C,T;for(let O=0;O<u;++O){if(h=(n[O]&3)-1,p=(n[O]>>>2&3)-1,g=h===0&&p===0||i[O]<0,m=h&&p?Math.SQRT1_2:1,y=i[O]<0?-1:1,b=c[1+h]+i[O]*h*m,w=c[4+p]+y*f*p/2+i[O]*p*m,x=w-f/2,E=w+f/2,_=e(b),C=e(x),T=e(E),!d)if(J_(_,_,C,T,o,a,b,b,x,E,c,g))d=Mn.width(l.datum,l.datum.text);else continue;if(S=b+y*d*h/2,b=S-d/2,v=S+d/2,_=e(b),$=e(v),J_(_,$,C,T,o,a,b,v,x,E,c,g))return l.x=h?h*y<0?v:b:S,l.y=p?p*y<0?E:x:w,l.align=XG[h*y+1],l.baseline=YG[p*y+1],o.setRange(_,C,$,T),!0}return!1}}function J_(e,t,n,i,r,s,o,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const i0=0,r0=4,s0=8,o0=0,a0=1,u0=2,JG={"top-left":i0+o0,top:i0+a0,"top-right":i0+u0,left:r0+o0,middle:r0+a0,right:r0+u0,"bottom-left":s0+o0,bottom:s0+a0,"bottom-right":s0+u0},QG={naive:qG,"reduced-search":WG,floodfill:VG};function ZG(e,t,n,i,r,s,o,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=eV(i,f),h=tV(r,f),p=nV(e[0].datum),g=p==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=iV(p,g,a,u),b=l===null||l===1/0,v=m&&c==="naive";let x=-1,E=-1;const S=e.map(C=>{const T=b?Mn.width(C,C.text):void 0;return x=Math.max(x,T),E=Math.max(E,C.fontSize),{datum:C,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(C),textWidth:T}});l=l===null||l===1/0?Math.max(x,E)+Math.max(...i):l;const w=jG(t[0],t[1],l);let _;if(!v){n&&S.sort((O,k)=>n(O.datum,k.datum));let C=!1;for(let O=0;O<h.length&&!C;++O)C=h[O]===5||d[O]<0;const T=(p&&o||m)&&e.map(O=>O.datum);_=s.length||T?IG(w,T||[],s,C,m):zG(w,o&&S)}const $=m?QG[c](w,_,o,u):KG(w,_,h,d);return S.forEach(C=>C.opacity=+$(C)),S}function eV(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r<i;++r)n[r]=e[r]||0;for(let r=i;r<t;++r)n[r]=n[i-1];return n}function tV(e,t){const n=new Int8Array(t),i=e.length;for(let r=0;r<i;++r)n[r]|=JG[e[r]];for(let r=i;r<t;++r)n[r]=n[i-1];return n}function nV(e){return e&&e.mark&&e.mark.marktype}function iV(e,t,n,i){const r=s=>[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const sy=["x","y","opacity","align","baseline"],rO=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function r2(e){D.call(this,null,e)}r2.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:rO},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:sy.length,default:sy}]};G(r2,D,{transform(e,t){function n(s){const o=e[s];return fe(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&N("Size parameter should be specified as a [width, height] array.");const r=e.as||sy;return ZG(t.materialize(t.SOURCE).source||[],e.size,e.sort,Y(e.offset==null?1:e.offset),Y(e.anchor||rO),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const rV=Object.freeze(Object.defineProperty({__proto__:null,label:r2},Symbol.toStringTag,{value:"Module"}));function sO(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s<o;++s)a=e[s],u=t.map(i),l=r[u],l||(r[u]=l=[],l.dims=u,n.push(l)),l.push(a);return n}function s2(e){D.call(this,null,e)}s2.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]};G(s2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=sO(i,e.groupby),s=(e.groupby||[]).map(Je),o=s.length,a=e.as||[Je(e.x),Je(e.y)],u=[];r.forEach(l=>{DF(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;d<o;++d)f[s[d]]=l.dims[d];f[a[0]]=c[0],f[a[1]]=c[1],u.push(Ce(f))})}),this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});const oy={constant:qb,linear:Wb,log:CF,exp:FF,pow:TF,quad:Hb,poly:MF},sV=(e,t)=>e==="poly"?t:e==="quad"?2:1;function o2(e){D.call(this,null,e)}o2.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(oy)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]};G(o2,D,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=sO(i,e.groupby),s=(e.groupby||[]).map(Je),o=e.method||"linear",a=e.order==null?3:e.order,u=sV(o,a),l=e.as||[Je(e.x),Je(e.y)],c=oy[o],f=[];let d=e.extent;J(oy,o)||N("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(Ce({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Ji(h,e.x),y=b=>{const v={};for(let x=0;x<s.length;++x)v[s[x]]=h.dims[x];v[l[0]]=b[0],v[l[1]]=b[1],f.push(Ce(v))};o==="linear"||o==="constant"?m.forEach(b=>y([b,g.predict(b)])):Np(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const oV=Object.freeze(Object.defineProperty({__proto__:null,loess:s2,regression:o2},Symbol.toStringTag,{value:"Module"})),Rr=11102230246251565e-32,Dt=134217729,aV=(3+8*Rr)*Rr;function l0(e,t,n,i,r){let s,o,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(s=l,l=t[++f]):(s=c,c=i[++d]);let h=0;if(f<e&&d<n)for(c>l==c>-l?(o=l+s,a=s-(o-l),l=t[++f]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[h++]=a);f<e&&d<n;)c>l==c>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f]):(o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d]),s=o,a!==0&&(r[h++]=a);for(;f<e;)o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f],s=o,a!==0&&(r[h++]=a);for(;d<n;)o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d],s=o,a!==0&&(r[h++]=a);return(s!==0||h===0)&&(r[h++]=s),h}function uV(e,t){let n=t[0];for(let i=1;i<e;i++)n+=t[i];return n}function rf(e){return new Float64Array(e)}const lV=(3+16*Rr)*Rr,cV=(2+12*Rr)*Rr,fV=(9+64*Rr)*Rr*Rr,Ea=rf(4),Q_=rf(8),Z_=rf(12),e$=rf(16),Vt=rf(4);function dV(e,t,n,i,r,s,o){let a,u,l,c,f,d,h,p,g,m,y,b,v,x,E,S,w,_;const $=e-r,C=n-r,T=t-s,O=i-s;x=$*O,d=Dt*$,h=d-(d-$),p=$-h,d=Dt*O,g=d-(d-O),m=O-g,E=p*m-(x-h*g-p*g-h*m),S=T*C,d=Dt*T,h=d-(d-T),p=T-h,d=Dt*C,g=d-(d-C),m=C-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Ea[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Ea[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Ea[2]=b-(_-f)+(y-f),Ea[3]=_;let k=uV(4,Ea),F=cV*o;if(k>=F||-k>=F||(f=e-$,a=e-($+f)+(f-r),f=n-C,l=n-(C+f)+(f-r),f=t-T,u=t-(T+f)+(f-s),f=i-O,c=i-(O+f)+(f-s),a===0&&u===0&&l===0&&c===0)||(F=fV*o+aV*Math.abs(k),k+=$*c+O*a-(T*l+C*u),k>=F||-k>=F))return k;x=a*O,d=Dt*a,h=d-(d-a),p=a-h,d=Dt*O,g=d-(d-O),m=O-g,E=p*m-(x-h*g-p*g-h*m),S=u*C,d=Dt*u,h=d-(d-u),p=u-h,d=Dt*C,g=d-(d-C),m=C-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Vt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Vt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Vt[2]=b-(_-f)+(y-f),Vt[3]=_;const A=l0(4,Ea,4,Vt,Q_);x=$*c,d=Dt*$,h=d-(d-$),p=$-h,d=Dt*c,g=d-(d-c),m=c-g,E=p*m-(x-h*g-p*g-h*m),S=T*l,d=Dt*T,h=d-(d-T),p=T-h,d=Dt*l,g=d-(d-l),m=l-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Vt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Vt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Vt[2]=b-(_-f)+(y-f),Vt[3]=_;const M=l0(A,Q_,4,Vt,Z_);x=a*c,d=Dt*a,h=d-(d-a),p=a-h,d=Dt*c,g=d-(d-c),m=c-g,E=p*m-(x-h*g-p*g-h*m),S=u*l,d=Dt*u,h=d-(d-u),p=u-h,d=Dt*l,g=d-(d-l),m=l-g,w=p*m-(S-h*g-p*g-h*m),y=E-w,f=E-y,Vt[0]=E-(y+f)+(f-w),b=x+y,f=b-x,v=x-(b-f)+(y-f),y=v-S,f=v-y,Vt[1]=v-(y+f)+(f-S),_=b+y,f=_-b,Vt[2]=b-(_-f)+(y-f),Vt[3]=_;const P=l0(M,Z_,4,Vt,e$);return e$[P-1]}function Hf(e,t,n,i,r,s){const o=(t-s)*(n-r),a=(e-r)*(i-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=lV*l?u:-dV(e,t,n,i,r,s,l)}const t$=Math.pow(2,-52),Gf=new Uint32Array(512);class jh{static from(t,n=yV,i=bV){const r=t.length,s=new Float64Array(r*2);for(let o=0;o<r;o++){const a=t[o];s[2*o]=n(a),s[2*o+1]=i(a)}return new jh(s)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,o=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let $=0;$<o;$++){const C=t[2*$],T=t[2*$+1];C<a&&(a=C),T<u&&(u=T),C>l&&(l=C),T>c&&(c=T),this._ids[$]=$}const f=(a+l)/2,d=(u+c)/2;let h,p,g;for(let $=0,C=1/0;$<o;$++){const T=c0(f,d,t[2*$],t[2*$+1]);T<C&&(h=$,C=T)}const m=t[2*h],y=t[2*h+1];for(let $=0,C=1/0;$<o;$++){if($===h)continue;const T=c0(m,y,t[2*$],t[2*$+1]);T<C&&T>0&&(p=$,C=T)}let b=t[2*p],v=t[2*p+1],x=1/0;for(let $=0;$<o;$++){if($===h||$===p)continue;const C=gV(m,y,b,v,t[2*$],t[2*$+1]);C<x&&(g=$,x=C)}let E=t[2*g],S=t[2*g+1];if(x===1/0){for(let T=0;T<o;T++)this._dists[T]=t[2*T]-t[0]||t[2*T+1]-t[1];La(this._ids,this._dists,0,o-1);const $=new Uint32Array(o);let C=0;for(let T=0,O=-1/0;T<o;T++){const k=this._ids[T],F=this._dists[k];F>O&&($[C++]=k,O=F)}this.hull=$.subarray(0,C),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Hf(m,y,b,v,E,S)<0){const $=p,C=b,T=v;p=g,b=E,v=S,g=$,E=C,S=T}const w=mV(m,y,b,v,E,S);this._cx=w.x,this._cy=w.y;for(let $=0;$<o;$++)this._dists[$]=c0(t[2*$],t[2*$+1],w.x,w.y);La(this._ids,this._dists,0,o-1),this._hullStart=h;let _=3;i[h]=n[g]=p,i[p]=n[h]=g,i[g]=n[p]=h,r[h]=0,r[p]=1,r[g]=2,s.fill(-1),s[this._hashKey(m,y)]=h,s[this._hashKey(b,v)]=p,s[this._hashKey(E,S)]=g,this.trianglesLen=0,this._addTriangle(h,p,g,-1,-1,-1);for(let $=0,C,T;$<this._ids.length;$++){const O=this._ids[$],k=t[2*O],F=t[2*O+1];if($>0&&Math.abs(k-C)<=t$&&Math.abs(F-T)<=t$||(C=k,T=F,O===h||O===p||O===g))continue;let A=0;for(let te=0,ne=this._hashKey(k,F);te<this._hashSize&&(A=s[(ne+te)%this._hashSize],!(A!==-1&&A!==i[A]));te++);A=n[A];let M=A,P;for(;P=i[M],Hf(k,F,t[2*M],t[2*M+1],t[2*P],t[2*P+1])>=0;)if(M=P,M===A){M=-1;break}if(M===-1)continue;let z=this._addTriangle(M,O,i[M],-1,-1,r[M]);r[O]=this._legalize(z+2),r[M]=z,_++;let U=i[M];for(;P=i[U],Hf(k,F,t[2*U],t[2*U+1],t[2*P],t[2*P+1])<0;)z=this._addTriangle(U,O,P,r[O],-1,r[U]),r[O]=this._legalize(z+2),i[U]=U,_--,U=P;if(M===A)for(;P=n[M],Hf(k,F,t[2*P],t[2*P+1],t[2*M],t[2*M+1])<0;)z=this._addTriangle(P,O,M,-1,r[M],r[P]),this._legalize(z+2),r[P]=z,i[M]=M,_--,M=P;this._hullStart=n[O]=M,i[M]=n[U]=O,i[O]=U,s[this._hashKey(k,F)]=O,s[this._hashKey(t[2*M],t[2*M+1])]=M}this.hull=new Uint32Array(_);for(let $=0,C=this._hullStart;$<_;$++)this.hull[$]=C,C=i[C];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(hV(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:i,coords:r}=this;let s=0,o=0;for(;;){const a=i[t],u=t-t%3;if(o=u+(t+2)%3,a===-1){if(s===0)break;t=Gf[--s];continue}const l=a-a%3,c=u+(t+1)%3,f=l+(a+2)%3,d=n[o],h=n[t],p=n[c],g=n[f];if(pV(r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1],r[2*g],r[2*g+1])){n[t]=g,n[a]=d;const y=i[f];if(y===-1){let v=this._hullStart;do{if(this._hullTri[v]===f){this._hullTri[v]=t;break}v=this._hullPrev[v]}while(v!==this._hullStart)}this._link(t,y),this._link(a,i[o]),this._link(o,f);const b=l+(a+1)%3;s<Gf.length&&(Gf[s++]=b)}else{if(s===0)break;t=Gf[--s]}}return o}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,i,r,s,o){const a=this.trianglesLen;return this._triangles[a]=t,this._triangles[a+1]=n,this._triangles[a+2]=i,this._link(a,r),this._link(a+1,s),this._link(a+2,o),this.trianglesLen+=3,a}}function hV(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function c0(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function pV(e,t,n,i,r,s,o,a){const u=e-o,l=t-a,c=n-o,f=i-a,d=r-o,h=s-a,p=u*u+l*l,g=c*c+f*f,m=d*d+h*h;return u*(f*m-g*h)-l*(c*m-g*d)+p*(c*h-f*d)<0}function gV(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=(l*c-a*f)*d,p=(o*f-u*c)*d;return h*h+p*p}function mV(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=e+(l*c-a*f)*d,p=t+(o*f-u*c)*d;return{x:h,y:p}}function La(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],o=t[s];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=s}else{const r=n+i>>1;let s=n+1,o=i;fl(e,r,s),t[e[n]]>t[e[i]]&&fl(e,n,i),t[e[s]]>t[e[i]]&&fl(e,s,i),t[e[n]]>t[e[s]]&&fl(e,n,s);const a=e[s],u=t[a];for(;;){do s++;while(t[e[s]]<u);do o--;while(t[e[o]]>u);if(o<s)break;fl(e,s,o)}e[n+1]=e[o],e[o]=a,i-s+1>=o-n?(La(e,t,s,i),La(e,t,n,o-1)):(La(e,t,n,o-1),La(e,t,s,i))}}function fl(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function yV(e){return e[0]}function bV(e){return e[1]}const n$=1e-6;class So{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>n$||Math.abs(this._y1-s)>n$)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class ay{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let vV=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g<y;g+=3,m+=2){const x=i[g]*2,E=i[g+1]*2,S=i[g+2]*2,w=t[x],_=t[x+1],$=t[E],C=t[E+1],T=t[S],O=t[S+1],k=$-w,F=C-_,A=T-w,M=O-_,P=(k*M-F*A)*2;if(Math.abs(P)<1e-9){if(s===void 0){s=o=0;for(const U of n)s+=t[U*2],o+=t[U*2+1];s/=n.length,o/=n.length}const z=1e9*Math.sign((s-w)*M-(o-_)*A);b=(w+T)/2-z*M,v=(_+O)/2+z*A}else{const z=1/P,U=k*k+F*F,te=A*A+M*M;b=w+(M*U-F*te)*z,v=_+(k*te-A*U)*z}a[m]=b,a[m+1]=v}let u=n[n.length-1],l,c=u*4,f,d=t[2*u],h,p=t[2*u+1];r.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,f=d,h=p,c=u*4,d=t[2*u],p=t[2*u+1],r[l+2]=r[c]=h-p,r[l+3]=r[c+1]=d-f}render(t){const n=t==null?t=new So:void 0,{delaunay:{halfedges:i,inedges:r,hull:s},circumcenters:o,vectors:a}=this;if(s.length<=1)return null;for(let c=0,f=i.length;c<f;++c){const d=i[c];if(d<c)continue;const h=Math.floor(c/3)*2,p=Math.floor(d/3)*2,g=o[h],m=o[h+1],y=o[p],b=o[p+1];this._renderSegment(g,m,y,b,t)}let u,l=s[s.length-1];for(let c=0;c<s.length;++c){u=l,l=s[c];const f=Math.floor(r[l]/3)*2,d=o[f],h=o[f+1],p=u*4,g=this._project(d,h,a[p+2],a[p+3]);g&&this._renderSegment(d,h,g[0],g[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new So:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const i=n==null?n=new So:void 0,r=this._clip(t);if(r===null||!r.length)return;n.moveTo(r[0],r[1]);let s=r.length;for(;r[0]===r[s-2]&&r[1]===r[s-1]&&s>1;)s-=2;for(let o=2;o<s;o+=2)(r[o]!==r[o-2]||r[o+1]!==r[o-1])&&n.lineTo(r[o],r[o+1]);return n.closePath(),i&&i.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,i=t.length/2;n<i;++n){const r=this.cellPolygon(n);r&&(r.index=n,yield r)}}cellPolygon(t){const n=new ay;return this.renderCell(t,n),n.value()}_renderSegment(t,n,i,r,s){let o;const a=this._regioncode(t,n),u=this._regioncode(i,r);a===0&&u===0?(s.moveTo(t,n),s.lineTo(i,r)):(o=this._clipSegment(t,n,i,r,a,u))&&(s.moveTo(o[0],o[1]),s.lineTo(o[2],o[3]))}contains(t,n,i){return n=+n,n!==n||(i=+i,i!==i)?!1:this.delaunay._step(t,n,i)===t}*neighbors(t){const n=this._clip(t);if(n)for(const i of this.delaunay.neighbors(t)){const r=this._clip(i);if(r){e:for(let s=0,o=n.length;s<o;s+=2)for(let a=0,u=r.length;a<u;a+=2)if(n[s]===r[a]&&n[s+1]===r[a+1]&&n[(s+2)%o]===r[(a+u-2)%u]&&n[(s+3)%o]===r[(a+u-1)%u]){yield i;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:i,halfedges:r,triangles:s}}=this,o=i[t];if(o===-1)return null;const a=[];let u=o;do{const l=Math.floor(u/3);if(a.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,s[u]!==t)break;u=r[u]}while(u!==o&&u!==-1);return a}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:i}=this,r=t*4;return this._simplify(i[r]||i[r+1]?this._clipInfinite(t,n,i[r],i[r+1],i[r+2],i[r+3]):this._clipFinite(t,n))}_clipFinite(t,n){const i=n.length;let r=null,s,o,a=n[i-2],u=n[i-1],l,c=this._regioncode(a,u),f,d=0;for(let h=0;h<i;h+=2)if(s=a,o=u,a=n[h],u=n[h+1],l=c,c=this._regioncode(a,u),l===0&&c===0)f=d,d=0,r?r.push(a,u):r=[a,u];else{let p,g,m,y,b;if(l===0){if((p=this._clipSegment(s,o,a,u,l,c))===null)continue;[g,m,y,b]=p}else{if((p=this._clipSegment(a,u,s,o,c,l))===null)continue;[y,b,g,m]=p,f=d,d=this._edgecode(g,m),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(g,m):r=[g,m]}f=d,d=this._edgecode(y,b),f&&d&&this._edge(t,f,d,r,r.length),r?r.push(y,b):r=[y,b]}if(r)f=d,d=this._edgecode(r[0],r[1]),f&&d&&this._edge(t,f,d,r,r.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return r}_clipSegment(t,n,i,r,s,o){const a=s<o;for(a&&([t,n,i,r,s,o]=[i,r,t,n,o,s]);;){if(s===0&&o===0)return a?[i,r,t,n]:[t,n,i,r];if(s&o)return null;let u,l,c=s||o;c&8?(u=t+(i-t)*(this.ymax-n)/(r-n),l=this.ymax):c&4?(u=t+(i-t)*(this.ymin-n)/(r-n),l=this.ymin):c&2?(l=n+(r-n)*(this.xmax-t)/(i-t),u=this.xmax):(l=n+(r-n)*(this.xmin-t)/(i-t),u=this.xmin),s?(t=u,n=l,s=this._regioncode(t,n)):(i=u,r=l,o=this._regioncode(i,r))}}_clipInfinite(t,n,i,r,s,o){let a=Array.from(n),u;if((u=this._project(a[0],a[1],i,r))&&a.unshift(u[0],u[1]),(u=this._project(a[a.length-2],a[a.length-1],s,o))&&a.push(u[0],u[1]),a=this._clipFinite(t,a))for(let l=0,c=a.length,f,d=this._edgecode(a[c-2],a[c-1]);l<c;l+=2)f=d,d=this._edgecode(a[l],a[l+1]),f&&d&&(l=this._edge(t,f,d,a,l),c=a.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(a=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return a}_edge(t,n,i,r,s){for(;n!==i;){let o,a;switch(n){case 5:n=4;continue;case 4:n=6,o=this.xmax,a=this.ymin;break;case 6:n=2;continue;case 2:n=10,o=this.xmax,a=this.ymax;break;case 10:n=8;continue;case 8:n=9,o=this.xmin,a=this.ymax;break;case 9:n=1;continue;case 1:n=5,o=this.xmin,a=this.ymin;break}(r[s]!==o||r[s+1]!==a)&&this.contains(t,o,a)&&(r.splice(s,0,o,a),s+=2)}return s}_project(t,n,i,r){let s=1/0,o,a,u;if(r<0){if(n<=this.ymin)return null;(o=(this.ymin-n)/r)<s&&(u=this.ymin,a=t+(s=o)*i)}else if(r>0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)<s&&(u=this.ymax,a=t+(s=o)*i)}if(i>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/i)<s&&(a=this.xmax,u=n+(s=o)*r)}else if(i<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/i)<s&&(a=this.xmin,u=n+(s=o)*r)}return[a,u]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const i=(n+2)%t.length,r=(n+4)%t.length;(t[n]===t[i]&&t[i]===t[r]||t[n+1]===t[i+1]&&t[i+1]===t[r+1])&&(t.splice(i,2),n-=2)}t.length||(t=null)}return t}};const xV=2*Math.PI,Sa=Math.pow;function wV(e){return e[0]}function EV(e){return e[1]}function SV(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const r=2*t[i],s=2*t[i+1],o=2*t[i+2];if((n[o]-n[r])*(n[s+1]-n[r+1])-(n[s]-n[r])*(n[o+1]-n[r+1])>1e-10)return!1}return!0}function _V(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class a2{static from(t,n=wV,i=EV,r){return new a2("length"in t?$V(t,n,i,r):Float64Array.from(AV(t,n,i,r)))}constructor(t){this._delaunator=new jh(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&SV(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d<h;++d){const p=_V(n[2*d],n[2*d+1],f);n[2*d]=p[0],n[2*d+1]=p[1]}this._delaunator=new jh(n)}else delete this.collinear;const i=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,s=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let u=0,l=i.length;u<l;++u){const c=s[u%3===2?u-2:u+1];(i[u]===-1||o[c]===-1)&&(o[c]=u)}for(let u=0,l=r.length;u<l;++u)a[r[u]]=u;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new vV(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f<a.length-1&&(yield a[f+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=o[l],l=l%3===2?l-2:l+1,o[l]!==t)return;if(l=s[l],l===-1){const f=i[(r[t]+1)%i.length];f!==c&&(yield f);return}}while(l!==u)}find(t,n,i=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const r=i;let s;for(;(s=this._step(i,t,n))>=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Sa(n-l[t*2],2)+Sa(i-l[t*2+1],2);const d=r[t];let h=d;do{let p=u[h];const g=Sa(n-l[p*2],2)+Sa(i-l[p*2+1],2);if(g<f&&(f=g,c=p),h=h%3===2?h-2:h+1,u[h]!==t)break;if(h=a[h],h===-1){if(h=s[(o[t]+1)%s.length],h!==p&&Sa(n-l[h*2],2)+Sa(i-l[h*2+1],2)<f)return h;break}}while(h!==d);return c}render(t){const n=t==null?t=new So:void 0,{points:i,halfedges:r,triangles:s}=this;for(let o=0,a=r.length;o<a;++o){const u=r[o];if(u<o)continue;const l=s[o]*2,c=s[u]*2;t.moveTo(i[l],i[l+1]),t.lineTo(i[c],i[c+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const i=t==null?t=new So:void 0,{points:r}=this;for(let s=0,o=r.length;s<o;s+=2){const a=r[s],u=r[s+1];t.moveTo(a+n,u),t.arc(a,u,n,0,xV)}return i&&i.value()}renderHull(t){const n=t==null?t=new So:void 0,{hull:i,points:r}=this,s=i[0]*2,o=i.length;t.moveTo(r[s],r[s+1]);for(let a=1;a<o;++a){const u=2*i[a];t.lineTo(r[u],r[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new ay;return this.renderHull(t),t.value()}renderTriangle(t,n){const i=n==null?n=new So:void 0,{points:r,triangles:s}=this,o=s[t*=3]*2,a=s[t+1]*2,u=s[t+2]*2;return n.moveTo(r[o],r[o+1]),n.lineTo(r[a],r[a+1]),n.lineTo(r[u],r[u+1]),n.closePath(),i&&i.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,i=t.length/3;n<i;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new ay;return this.renderTriangle(t,n),n.value()}}function $V(e,t,n,i){const r=e.length,s=new Float64Array(r*2);for(let o=0;o<r;++o){const a=e[o];s[o*2]=t.call(i,a,o,e),s[o*2+1]=n.call(i,a,o,e)}return s}function*AV(e,t,n,i){let r=0;for(const s of e)yield t.call(i,s,r,e),yield n.call(i,s,r,e),++r}function u2(e){D.call(this,null,e)}u2.Definition={type:"Voronoi",metadata:{modifies:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"size",type:"number",array:!0,length:2},{name:"extent",type:"array",array:!0,length:2,default:[[-1e5,-1e5],[1e5,1e5]],content:{type:"number",array:!0,length:2}},{name:"as",type:"string",default:"path"}]};const kV=[-1e5,-1e5,1e5,1e5];G(u2,D,{transform(e,t){const n=e.as||"path",i=t.source;if(!i||!i.length)return t;let r=e.size;r=r?[0,0,r[0],r[1]]:(r=e.extent)?[r[0][0],r[0][1],r[1][0],r[1][1]]:kV;const s=this.value=a2.from(i,e.x,e.y).voronoi(r);for(let o=0,a=i.length;o<a;++o){const u=s.cellPolygon(o);i[o][n]=u&&!FV(u)?CV(u):null}return t.reflow(e.modified()).modifies(n)}});function CV(e){const t=e[0][0],n=e[0][1];let i=e.length-1;for(;e[i][0]===t&&e[i][1]===n;--i);return"M"+e.slice(0,i+1).join("L")+"Z"}function FV(e){return e.length===2&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]}const TV=Object.freeze(Object.defineProperty({__proto__:null,voronoi:u2},Symbol.toStringTag,{value:"Module"}));var f0=Math.PI/180,Bl=64,Fd=2048;function MV(){var e=[256,256],t,n,i,r,s,o,a,u=oO,l=[],c=Math.random,f={};f.layout=function(){for(var p=d(_s()),g=PV((e[0]>>5)*e[1]),m=null,y=l.length,b=-1,v=[],x=l.map(S=>({text:t(S),font:n(S),style:r(S),weight:s(S),rotate:o(S),size:~~(i(S)+1e-14),padding:a(S),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:S})).sort((S,w)=>w.size-S.size);++b<y;){var E=x[b];E.x=e[0]*(c()+.5)>>1,E.y=e[1]*(c()+.5)>>1,DV(p,E,x,b),E.hasText&&h(g,E,m)&&(v.push(E),m?RV(m,E):m=[{x:E.x+E.x0,y:E.y+E.y0},{x:E.x+E.x1,y:E.y+E.y1}],E.x-=e[0]>>1,E.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(Bl<<5)/g,p.height=Fd/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),x=u(e),E=c()<.5?1:-1,S=-E,w,_,$;(w=x(S+=E))&&(_=~~w[0],$=~~w[1],!(Math.min(Math.abs(_),Math.abs($))>=v));)if(g.x=y+_,g.y=b+$,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!OV(g,p,e[0]))&&(!m||NV(g,m))){for(var C=g.sprite,T=g.width>>5,O=e[0]>>5,k=g.x-(T<<4),F=k&127,A=32-F,M=g.y1-g.y0,P=(g.y+g.y0)*O+(k>>5),z,U=0;U<M;U++){z=0;for(var te=0;te<=T;te++)p[P+te]|=z<<A|(te<T?(z=C[U*T+te])>>>F:0);P+=O}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(l=p,f):l},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=no(p),f):n},f.fontStyle=function(p){return arguments.length?(r=no(p),f):r},f.fontWeight=function(p){return arguments.length?(s=no(p),f):s},f.rotate=function(p){return arguments.length?(o=no(p),f):o},f.text=function(p){return arguments.length?(t=no(p),f):t},f.spiral=function(p){return arguments.length?(u=zV[p]||p,f):u},f.fontSize=function(p){return arguments.length?(i=no(p),f):i},f.padding=function(p){return arguments.length?(a=no(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function DV(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(Bl<<5)/s,Fd/s);var o=0,a=0,u=0,l=n.length,c,f,d,h,p;for(--i;++i<l;){if(t=n[i],r.save(),r.font=t.style+" "+t.weight+" "+~~((t.size+1)/s)+"px "+t.font,c=r.measureText(t.text+"m").width*s,d=t.size<<1,t.rotate){var g=Math.sin(t.rotate*f0),m=Math.cos(t.rotate*f0),y=c*m,b=c*g,v=d*m,x=d*g;c=Math.max(Math.abs(y+x),Math.abs(y-x))+31>>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),o+c>=Bl<<5&&(o=0,a+=u,u=0),a+d>=Fd)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*f0),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var E=r.getImageData(0,0,(Bl<<5)/s,Fd/s).data,S=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h<d*f;h++)S[h]=0;if(o=t.xoff,o==null)return;a=t.yoff;var w=0,_=-1;for(p=0;p<d;p++){for(h=0;h<c;h++){var $=f*p+(h>>5),C=E[(a+p)*(Bl<<5)+(o+h)<<2]?1<<31-h%32:0;S[$]|=C,w|=C}w?_=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+_,t.sprite=S.slice(0,(t.y1-t.y0)*f)}}}function OV(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,u=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),c,f=0;f<u;f++){c=0;for(var d=0;d<=r;d++)if((c<<a|(d<r?(c=i[f*r+d])>>>o:0))&t[l+d])return!0;l+=n}return!1}function RV(e,t){var n=e[0],i=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function NV(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function oO(e){var t=e[0]/e[1];return function(n){return[t*(n*=.1)*Math.cos(n),n*Math.sin(n)]}}function LV(e){var t=4,n=t*e[0]/e[1],i=0,r=0;return function(s){var o=s<0?-1:1;switch(Math.sqrt(1+4*o*s)-o&3){case 0:i+=n;break;case 1:r+=t;break;case 2:i-=n;break;default:r-=t;break}return[i,r]}}function PV(e){for(var t=[],n=-1;++n<e;)t[n]=0;return t}function no(e){return typeof e=="function"?e:function(){return e}}var zV={archimedean:oO,rectangular:LV};const aO=["x","y","font","fontSize","fontStyle","fontWeight","angle"],IV=["text","font","rotate","fontSize","fontStyle","fontWeight"];function l2(e){D.call(this,MV(),e)}l2.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:aO}]};G(l2,D,{transform(e,t){e.size&&!(e.size[0]&&e.size[1])&&N("Wordcloud size dimensions must be non-zero.");function n(p){const g=e[p];return fe(g)&&t.modified(g.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||IV.some(n)))return;const r=t.materialize(t.SOURCE).source,s=this.value,o=e.as||aO;let a=e.fontSize||14,u;if(fe(a)?u=e.fontSizeRange:a=Ht(a),u){const p=a,g=ke("sqrt")().domain(Ji(r,p)).range(u);a=m=>g(p(m))}r.forEach(p=>{p[o[0]]=NaN,p[o[1]]=NaN,p[o[3]]=0});const l=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Jn).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,g,m;p<h;++p)g=l[p],m=g.datum,m[o[0]]=g.x+f,m[o[1]]=g.y+d,m[o[2]]=g.font,m[o[3]]=g.size,m[o[4]]=g.style,m[o[5]]=g.weight,m[o[6]]=g.rotate;return t.reflow(i).modifies(o)}});const BV=Object.freeze(Object.defineProperty({__proto__:null,wordcloud:l2},Symbol.toStringTag,{value:"Module"})),UV=e=>new Uint8Array(e),jV=e=>new Uint16Array(e),Zl=e=>new Uint32Array(e);function qV(){let e=8,t=[],n=Zl(0),i=Vf(0,e),r=Vf(0,e);return{data:()=>t,seen:()=>n=WV(n,t.length),add(s){for(let o=0,a=t.length,u=s.length,l;o<u;++o)l=s[o],l._index=a++,t.push(l)},remove(s,o){const a=t.length,u=Array(a-s),l=t;let c,f,d;for(f=0;!o[f]&&f<a;++f)u[f]=t[f],l[f]=f;for(d=f;f<a;++f)c=t[f],o[f]?l[f]=-1:(l[f]=d,i[d]=i[f],r[d]=r[f],u[d]=c,c._index=d++),i[f]=0;return t=u,l},size:()=>t.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=Vf(s,e,i),r=Vf(s,e))}}}function WV(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Vf(e,t,n){const i=(t<257?UV:t<65537?jV:Zl)(e);return n&&i.set(n),i}function i$(e,t,n){const i=1<<t;return{one:i,zero:~i,range:n.slice(),bisect:e.bisect,index:e.index,size:e.size,onAdd(r,s){const o=this,a=o.bisect(o.range,r.value),u=r.index,l=a[0],c=a[1],f=u.length;let d;for(d=0;d<l;++d)s[u[d]]|=i;for(d=c;d<f;++d)s[u[d]]|=i;return o}}}function r$(){let e=Zl(0),t=[],n=0;function i(a,u,l){if(!u.length)return[];const c=n,f=u.length,d=Zl(f);let h=Array(f),p,g,m;for(m=0;m<f;++m)h[m]=a(u[m]),d[m]=m;if(h=HV(h,d),c)p=t,g=e,t=Array(c+f),e=Zl(c+f),GV(l,p,g,c,h,d,f,t,e);else{if(l>0)for(m=0;m<f;++m)d[m]+=l;t=h,e=d}return n=c+f,{index:d,value:h}}function r(a,u){const l=n;let c,f,d;for(f=0;!u[e[f]]&&f<l;++f);for(d=f;f<l;++f)u[c=e[f]]||(e[d]=c,t[d]=t[f],++d);n=l-a}function s(a){for(let u=0,l=n;u<l;++u)e[u]=a[e[u]]}function o(a,u){let l;return u?l=u.length:(u=t,l=n),[DL(u,a[0],0,l),Va(u,a[1],0,l)]}return{insert:i,remove:r,bisect:o,reindex:s,index:()=>e,size:()=>n}}function HV(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return r<s?-1:r>s?1:0}),zP(e,t)}function GV(e,t,n,i,r,s,o,a,u){let l=0,c=0,f;for(f=0;l<i&&c<o;++f)t[l]<r[c]?(a[f]=t[l],u[f]=n[l++]):(a[f]=r[c],u[f]=s[c++]+e);for(;l<i;++l,++f)a[f]=t[l],u[f]=n[l];for(;c<o;++c,++f)a[f]=r[c],u[f]=s[c]+e}function c2(e){D.call(this,qV(),e),this._indices=null,this._dims=null}c2.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]};G(c2,D,{transform(e,t){if(this._dims){var n=e.modified("fields")||e.fields.some(i=>t.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,u,l;for(;a<o;++a)u=n[a].fname,l=r[u]||(r[u]=r$()),s.push(i$(l,a,i[a]));return this.eval(e,t)},reinit(e,t){const n=t.materialize().fork(),i=e.fields,r=e.query,s=this._indices,o=this._dims,a=this.value,u=a.curr(),l=a.prev(),c=a.all(),f=n.rem=n.add,d=n.mod,h=r.length,p={};let g,m,y,b,v,x,E,S,w;if(l.set(u),t.rem.length&&(v=this.remove(e,t,n)),t.add.length&&a.add(t.add),t.mod.length)for(x={},b=t.mod,E=0,S=b.length;E<S;++E)x[b[E]._index]=1;for(E=0;E<h;++E)w=i[E],(!o[E]||e.modified("fields",E)||t.modified(w.fields))&&(y=w.fname,(g=p[y])||(s[y]=m=r$(),p[y]=g=m.insert(w,t.source,0)),o[E]=i$(m,E,r[E]).onAdd(g,u));for(E=0,S=a.data().length;E<S;++E)v[E]||(l[E]!==u[E]?f.push(E):x[E]&&u[E]!==c&&d.push(E));return a.mask=(1<<h)-1,n},eval(e,t){const n=t.materialize().fork(),i=this._dims.length;let r=0;return t.rem.length&&(this.remove(e,t,n),r|=(1<<i)-1),e.modified("query")&&!e.modified("fields")&&(r|=this.update(e,t,n)),t.add.length&&(this.insert(e,t,n),r|=(1<<i)-1),t.mod.length&&(this.modify(t,n),r|=(1<<i)-1),this.value.mask=r,n},insert(e,t,n){const i=t.add,r=this.value,s=this._dims,o=this._indices,a=e.fields,u={},l=n.add,c=r.size()+i.length,f=s.length;let d=r.size(),h,p,g;r.resize(c,f),r.add(i);const m=r.curr(),y=r.prev(),b=r.all();for(h=0;h<f;++h)p=a[h].fname,g=u[p]||(u[p]=o[p].insert(a[h],i,d)),s[h].onAdd(g,m);for(;d<c;++d)y[d]=b,m[d]!==b&&l.push(d)},modify(e,t){const n=t.mod,i=this.value,r=i.curr(),s=i.all(),o=e.mod;let a,u,l;for(a=0,u=o.length;a<u;++a)l=o[a]._index,r[l]!==s&&n.push(l)},remove(e,t,n){const i=this._indices,r=this.value,s=r.curr(),o=r.prev(),a=r.all(),u={},l=n.rem,c=t.rem;let f,d,h,p;for(f=0,d=c.length;f<d;++f)h=c[f]._index,u[h]=1,o[h]=p=s[h],s[h]=a,p!==a&&l.push(h);for(h in i)i[h].remove(d,u);return this.reindex(t,d,u),u},reindex(e,t,n){const i=this._indices,r=this.value;e.runAfter(()=>{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,u,l;for(n.filters=0,l=0;l<o;++l)e.modified("query",l)&&(u=l,++a);if(a===1)a=i[u].one,this.incrementOne(i[u],r[u],n.add,n.rem);else for(l=0,a=0;l<o;++l)e.modified("query",l)&&(a|=i[l].one,this.incrementAll(i[l],r[l],s,n.add),n.rem=n.add);return a},incrementAll(e,t,n,i){const r=this.value,s=r.seen(),o=r.curr(),a=r.prev(),u=e.index(),l=e.bisect(e.range),c=e.bisect(t),f=c[0],d=c[1],h=l[0],p=l[1],g=e.one;let m,y,b;if(f<h)for(m=f,y=Math.min(h,d);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;else if(f>h)for(m=h,y=Math.min(f,p);m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;if(d>p)for(m=Math.max(f,p),y=d;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;else if(d<p)for(m=Math.max(h,d),y=p;m<y;++m)b=u[m],s[b]!==n&&(a[b]=o[b],s[b]=n,i.push(b)),o[b]^=g;e.range=t.slice()},incrementOne(e,t,n,i){const r=this.value,s=r.curr(),o=e.index(),a=e.bisect(e.range),u=e.bisect(t),l=u[0],c=u[1],f=a[0],d=a[1],h=e.one;let p,g,m;if(l<f)for(p=l,g=Math.min(f,c);p<g;++p)m=o[p],s[m]^=h,n.push(m);else if(l>f)for(p=f,g=Math.min(l,d);p<g;++p)m=o[p],s[m]^=h,i.push(m);if(c>d)for(p=Math.max(l,d),g=c;p<g;++p)m=o[p],s[m]^=h,n.push(m);else if(c<d)for(p=Math.max(f,c),g=d;p<g;++p)m=o[p],s[m]^=h,i.push(m);e.range=t.slice()}});function f2(e){D.call(this,null,e)}f2.Definition={type:"ResolveFilter",metadata:{},params:[{name:"ignore",type:"number",required:!0,description:"A bit mask indicating which filters to ignore."},{name:"filter",type:"object",required:!0,description:"Per-tuple filter bitmaps from a CrossFilter transform."}]};G(f2,D,{transform(e,t){const n=~(e.ignore||0),i=e.filter,r=i.mask;if(!(r&n))return t.StopPropagation;const s=t.fork(t.ALL),o=i.data(),a=i.curr(),u=i.prev(),l=c=>a[c]&n?null:o[c];return s.filter(s.MOD,l),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?o[c]:null})):(s.filter(s.ADD,l),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>l(c._index))}});const VV=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:c2,resolvefilter:f2},Symbol.toStringTag,{value:"Module"})),XV="RawCode",Io="Literal",YV="Property",KV="Identifier",JV="ArrayExpression",QV="BinaryExpression",uO="CallExpression",ZV="ConditionalExpression",eX="LogicalExpression",tX="MemberExpression",nX="ObjectExpression",iX="UnaryExpression";function _i(e){this.type=e}_i.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=rX(this),n=0,i=t.length;n<i;++n)if(t[n].visit(e))return 1};function rX(e){switch(e.type){case JV:return e.elements;case QV:case eX:return[e.left,e.right];case uO:return[e.callee].concat(e.arguments);case ZV:return[e.test,e.consequent,e.alternate];case tX:return[e.object,e.property];case nX:return e.properties;case YV:return[e.key,e.value];case iX:return[e.argument];case KV:case Io:case XV:default:return[]}}var cr,Z,R,jt,Me,cg=1,sf=2,Bo=3,Ws=4,fg=5,ia=6,fn=7,of=8,sX=9;cr={};cr[cg]="Boolean";cr[sf]="<end>";cr[Bo]="Identifier";cr[Ws]="Keyword";cr[fg]="Null";cr[ia]="Numeric";cr[fn]="Punctuator";cr[of]="String";cr[sX]="RegularExpression";var oX="ArrayExpression",aX="BinaryExpression",uX="CallExpression",lX="ConditionalExpression",lO="Identifier",cX="Literal",fX="LogicalExpression",dX="MemberExpression",hX="ObjectExpression",pX="Property",gX="UnaryExpression",dt="Unexpected token %0",mX="Unexpected number",yX="Unexpected string",bX="Unexpected identifier",vX="Unexpected reserved word",xX="Unexpected end of input",uy="Invalid regular expression",d0="Invalid regular expression: missing /",cO="Octal literals are not allowed in strict mode.",wX="Duplicate data property in object literal not allowed in strict mode",$t="ILLEGAL",wc="Disabled.",EX=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),SX=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function dg(e,t){if(!e)throw new Error("ASSERT: "+t)}function _r(e){return e>=48&&e<=57}function d2(e){return"0123456789abcdefABCDEF".includes(e)}function ec(e){return"01234567".includes(e)}function _X(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function Ec(e){return e===10||e===13||e===8232||e===8233}function af(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&EX.test(String.fromCharCode(e))}function qh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&SX.test(String.fromCharCode(e))}const $X={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function fO(){for(;R<jt;){const e=Z.charCodeAt(R);if(_X(e)||Ec(e))++R;else break}}function ly(e){var t,n,i,r=0;for(n=e==="u"?4:2,t=0;t<n;++t)R<jt&&d2(Z[R])?(i=Z[R++],r=r*16+"0123456789abcdef".indexOf(i.toLowerCase())):_e({},dt,$t);return String.fromCharCode(r)}function AX(){var e,t,n,i;for(e=Z[R],t=0,e==="}"&&_e({},dt,$t);R<jt&&(e=Z[R++],!!d2(e));)t=t*16+"0123456789abcdef".indexOf(e.toLowerCase());return(t>1114111||e!=="}")&&_e({},dt,$t),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function dO(){var e,t;for(e=Z.charCodeAt(R++),t=String.fromCharCode(e),e===92&&(Z.charCodeAt(R)!==117&&_e({},dt,$t),++R,e=ly("u"),(!e||e==="\\"||!af(e.charCodeAt(0)))&&_e({},dt,$t),t=e);R<jt&&(e=Z.charCodeAt(R),!!qh(e));)++R,t+=String.fromCharCode(e),e===92&&(t=t.substr(0,t.length-1),Z.charCodeAt(R)!==117&&_e({},dt,$t),++R,e=ly("u"),(!e||e==="\\"||!qh(e.charCodeAt(0)))&&_e({},dt,$t),t+=e);return t}function kX(){var e,t;for(e=R++;R<jt;){if(t=Z.charCodeAt(R),t===92)return R=e,dO();if(qh(t))++R;else break}return Z.slice(e,R)}function CX(){var e,t,n;return e=R,t=Z.charCodeAt(R)===92?dO():kX(),t.length===1?n=Bo:$X.hasOwnProperty(t)?n=Ws:t==="null"?n=fg:t==="true"||t==="false"?n=cg:n=Bo,{type:n,value:t,start:e,end:R}}function h0(){var e=R,t=Z.charCodeAt(R),n,i=Z[R],r,s,o;switch(t){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++R,{type:fn,value:String.fromCharCode(t),start:e,end:R};default:if(n=Z.charCodeAt(R+1),n===61)switch(t){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return R+=2,{type:fn,value:String.fromCharCode(t)+String.fromCharCode(n),start:e,end:R};case 33:case 61:return R+=2,Z.charCodeAt(R)===61&&++R,{type:fn,value:Z.slice(e,R),start:e,end:R}}}if(o=Z.substr(R,4),o===">>>=")return R+=4,{type:fn,value:o,start:e,end:R};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return R+=3,{type:fn,value:s,start:e,end:R};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return R+=2,{type:fn,value:r,start:e,end:R};if(r==="//"&&_e({},dt,$t),"<>=!+-*%&|^/".includes(i))return++R,{type:fn,value:i,start:e,end:R};_e({},dt,$t)}function FX(e){let t="";for(;R<jt&&d2(Z[R]);)t+=Z[R++];return t.length===0&&_e({},dt,$t),af(Z.charCodeAt(R))&&_e({},dt,$t),{type:ia,value:parseInt("0x"+t,16),start:e,end:R}}function TX(e){let t="0"+Z[R++];for(;R<jt&&ec(Z[R]);)t+=Z[R++];return(af(Z.charCodeAt(R))||_r(Z.charCodeAt(R)))&&_e({},dt,$t),{type:ia,value:parseInt(t,8),octal:!0,start:e,end:R}}function s$(){var e,t,n;if(n=Z[R],dg(_r(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point"),t=R,e="",n!=="."){if(e=Z[R++],n=Z[R],e==="0"){if(n==="x"||n==="X")return++R,FX(t);if(ec(n))return TX(t);n&&_r(n.charCodeAt(0))&&_e({},dt,$t)}for(;_r(Z.charCodeAt(R));)e+=Z[R++];n=Z[R]}if(n==="."){for(e+=Z[R++];_r(Z.charCodeAt(R));)e+=Z[R++];n=Z[R]}if(n==="e"||n==="E")if(e+=Z[R++],n=Z[R],(n==="+"||n==="-")&&(e+=Z[R++]),_r(Z.charCodeAt(R)))for(;_r(Z.charCodeAt(R));)e+=Z[R++];else _e({},dt,$t);return af(Z.charCodeAt(R))&&_e({},dt,$t),{type:ia,value:parseFloat(e),start:t,end:R}}function MX(){var e="",t,n,i,r,s=!1;for(t=Z[R],dg(t==="'"||t==='"',"String literal must starts with a quote"),n=R,++R;R<jt;)if(i=Z[R++],i===t){t="";break}else if(i==="\\")if(i=Z[R++],!i||!Ec(i.charCodeAt(0)))switch(i){case"u":case"x":Z[R]==="{"?(++R,e+=AX()):e+=ly(i);break;case"n":e+=`
19
- `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:ec(i)?(r="01234567".indexOf(i),r!==0&&(s=!0),R<jt&&ec(Z[R])&&(s=!0,r=r*8+"01234567".indexOf(Z[R++]),"0123".includes(i)&&R<jt&&ec(Z[R])&&(r=r*8+"01234567".indexOf(Z[R++]))),e+=String.fromCharCode(r)):e+=i;break}else i==="\r"&&Z[R]===`
20
- `&&++R;else{if(Ec(i.charCodeAt(0)))break;e+=i}return t!==""&&_e({},dt,$t),{type:of,value:e,octal:s,start:n,end:R}}function DX(e,t){let n=e;t.includes("u")&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,r)=>{if(parseInt(r,16)<=1114111)return"x";_e({},uy)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{_e({},uy)}try{return new RegExp(e,t)}catch{return null}}function OX(){var e,t,n,i,r;for(e=Z[R],dg(e==="/","Regular expression literal must start with a slash"),t=Z[R++],n=!1,i=!1;R<jt;)if(e=Z[R++],t+=e,e==="\\")e=Z[R++],Ec(e.charCodeAt(0))&&_e({},d0),t+=e;else if(Ec(e.charCodeAt(0)))_e({},d0);else if(n)e==="]"&&(n=!1);else if(e==="/"){i=!0;break}else e==="["&&(n=!0);return i||_e({},d0),r=t.substr(1,t.length-2),{value:r,literal:t}}function RX(){var e,t,n;for(t="",n="";R<jt&&(e=Z[R],!!qh(e.charCodeAt(0)));)++R,e==="\\"&&R<jt?_e({},dt,$t):(n+=e,t+=e);return n.search(/[^gimuy]/g)>=0&&_e({},uy,n),{value:n,literal:t}}function NX(){var e,t,n,i;return Me=null,fO(),e=R,t=OX(),n=RX(),i=DX(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:R}}function LX(e){return e.type===Bo||e.type===Ws||e.type===cg||e.type===fg}function hO(){if(fO(),R>=jt)return{type:sf,start:R,end:R};const e=Z.charCodeAt(R);return af(e)?CX():e===40||e===41||e===59?h0():e===39||e===34?MX():e===46?_r(Z.charCodeAt(R+1))?s$():h0():_r(e)?s$():h0()}function hn(){const e=Me;return R=e.end,Me=hO(),R=e.end,e}function pO(){const e=R;Me=hO(),R=e}function PX(e){const t=new _i(oX);return t.elements=e,t}function o$(e,t,n){const i=new _i(e==="||"||e==="&&"?fX:aX);return i.operator=e,i.left=t,i.right=n,i}function zX(e,t){const n=new _i(uX);return n.callee=e,n.arguments=t,n}function IX(e,t,n){const i=new _i(lX);return i.test=e,i.consequent=t,i.alternate=n,i}function h2(e){const t=new _i(lO);return t.name=e,t}function Ul(e){const t=new _i(cX);return t.value=e.value,t.raw=Z.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function a$(e,t,n){const i=new _i(dX);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function BX(e){const t=new _i(hX);return t.properties=e,t}function u$(e,t,n){const i=new _i(pX);return i.key=t,i.value=n,i.kind=e,i}function UX(e,t){const n=new _i(gX);return n.operator=e,n.argument=t,n.prefix=!0,n}function _e(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(dg(o<i.length,"Message reference must be in range"),i[o]));throw n=new Error(r),n.index=R,n.description=r,n}function hg(e){e.type===sf&&_e(e,xX),e.type===ia&&_e(e,mX),e.type===of&&_e(e,yX),e.type===Bo&&_e(e,bX),e.type===Ws&&_e(e,vX),_e(e,dt,e.value)}function qt(e){const t=hn();(t.type!==fn||t.value!==e)&&hg(t)}function Be(e){return Me.type===fn&&Me.value===e}function p0(e){return Me.type===Ws&&Me.value===e}function jX(){const e=[];for(R=Me.start,qt("[");!Be("]");)Be(",")?(hn(),e.push(null)):(e.push(Uo()),Be("]")||qt(","));return hn(),PX(e)}function l$(){R=Me.start;const e=hn();return e.type===of||e.type===ia?(e.octal&&_e(e,cO),Ul(e)):h2(e.value)}function qX(){var e,t,n,i;if(R=Me.start,e=Me,e.type===Bo)return n=l$(),qt(":"),i=Uo(),u$("init",n,i);if(e.type===sf||e.type===fn)hg(e);else return t=l$(),qt(":"),i=Uo(),u$("init",t,i)}function WX(){var e=[],t,n,i,r={},s=String;for(R=Me.start,qt("{");!Be("}");)t=qX(),t.key.type===lO?n=t.key.name:n=s(t.key.value),i="$"+n,Object.prototype.hasOwnProperty.call(r,i)?_e({},wX):r[i]=!0,e.push(t),Be("}")||qt(",");return qt("}"),BX(e)}function HX(){qt("(");const e=p2();return qt(")"),e}const GX={if:1};function VX(){var e,t,n;if(Be("("))return HX();if(Be("["))return jX();if(Be("{"))return WX();if(e=Me.type,R=Me.start,e===Bo||GX[Me.value])n=h2(hn().value);else if(e===of||e===ia)Me.octal&&_e(Me,cO),n=Ul(hn());else{if(e===Ws)throw new Error(wc);e===cg?(t=hn(),t.value=t.value==="true",n=Ul(t)):e===fg?(t=hn(),t.value=null,n=Ul(t)):Be("/")||Be("/=")?(n=Ul(NX()),pO()):hg(hn())}return n}function XX(){const e=[];if(qt("("),!Be(")"))for(;R<jt&&(e.push(Uo()),!Be(")"));)qt(",");return qt(")"),e}function YX(){R=Me.start;const e=hn();return LX(e)||hg(e),h2(e.value)}function KX(){return qt("."),YX()}function JX(){qt("[");const e=p2();return qt("]"),e}function QX(){var e,t,n;for(e=VX();;)if(Be("."))n=KX(),e=a$(".",e,n);else if(Be("("))t=XX(),e=zX(e,t);else if(Be("["))n=JX(),e=a$("[",e,n);else break;return e}function c$(){const e=QX();if(Me.type===fn&&(Be("++")||Be("--")))throw new Error(wc);return e}function Td(){var e,t;if(Me.type!==fn&&Me.type!==Ws)t=c$();else{if(Be("++")||Be("--"))throw new Error(wc);if(Be("+")||Be("-")||Be("~")||Be("!"))e=hn(),t=Td(),t=UX(e.value,t);else{if(p0("delete")||p0("void")||p0("typeof"))throw new Error(wc);t=c$()}}return t}function f$(e){let t=0;if(e.type!==fn&&e.type!==Ws)return 0;switch(e.value){case"||":t=1;break;case"&&":t=2;break;case"|":t=3;break;case"^":t=4;break;case"&":t=5;break;case"==":case"!=":case"===":case"!==":t=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function ZX(){var e,t,n,i,r,s,o,a,u,l;if(e=Me,u=Td(),i=Me,r=f$(i),r===0)return u;for(i.prec=r,hn(),t=[e,Me],o=Td(),s=[u,i,o];(r=f$(Me))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=o$(a,u,o),s.push(n);i=hn(),i.prec=r,s.push(i),t.push(Me),n=Td(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=o$(s[l-1].value,s[l-2],n),l-=2;return n}function Uo(){var e,t,n;return e=ZX(),Be("?")&&(hn(),t=Uo(),qt(":"),n=Uo(),e=IX(e,t,n)),e}function p2(){const e=Uo();if(Be(","))throw new Error(wc);return e}function g2(e){Z=e,R=0,jt=Z.length,Me=null,pO();const t=p2();if(Me.type!==sf)throw new Error("Unexpect token after expression.");return t}var gO={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function mO(e){function t(o,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,u){return l=>t(o,l,a,u)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&N("Missing arguments to clamp function."),o.length>3&&N("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),regexp:s,test:n("test",s),if:function(o){o.length<3&&N("Missing arguments to if function."),o.length>3&&N("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function eY(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function yO(e){e=e||{};const t=e.allowed?yi(e.allowed):{},n=e.forbidden?yi(e.forbidden):{},i=e.constants||gO,r=(e.functions||mO)(f),s=e.globalvar,o=e.fieldvar,a=fe(s)?s:p=>`${s}["${p}"]`;let u={},l={},c=0;function f(p){if(K(p))return p;const g=d[p.type];return g==null&&N("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:J(n,g)?N("Illegal identifier: "+g):J(i,g)?i[g]:J(t,g)?g:(u[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===o&&(l[eY(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&N("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=J(r,g)&&r[g];return y||N("Unrecognized function: "+g),fe(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return h.functions=r,h.constants=i,h}const d$=Symbol("vega_selection_getter");function bO(e){return(!e.getter||!e.getter[d$])&&(e.getter=Yn(e.field),e.getter[d$]=!0),e.getter}const m2="intersect",h$="union",tY="vlMulti",nY="vlPoint",p$="or",iY="and",Ui="_vgsid_",Sc=Yn(Ui),rY="E",sY="R",oY="R-E",aY="R-LE",uY="R-RE",Wh="index:unit";function g$(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;s<r;++s)if(a=n[s],o=bO(a)(e),ws(o)&&(o=zt(o)),ws(i[s])&&(i[s]=zt(i[s])),L(i[s])&&ws(i[s][0])&&(i[s]=i[s].map(zt)),a.type===rY){if(L(i[s])?i[s].indexOf(o)<0:o!==i[s])return!1}else if(a.type===sY){if(!Da(o,i[s]))return!1}else if(a.type===uY){if(!Da(o,i[s],!0,!1))return!1}else if(a.type===oY){if(!Da(o,i[s],!1,!1))return!1}else if(a.type===aY&&!Da(o,i[s],!1,!0))return!1;return!0}function lY(e,t,n){for(var i=this.context.data[e],r=i?i.values.value:[],s=i?i[Wh]&&i[Wh].value:void 0,o=n===m2,a=r.length,u=0,l,c,f,d,h;u<a;++u)if(l=r[u],s&&o){if(c=c||{},f=c[d=l.unit]||0,f===-1)continue;if(h=g$(t,l),c[d]=h?-1:++f,h&&s.size===1)return!0;if(!h&&f===s.get(d).count)return!1}else if(h=g$(t,l),o^h)return h;return a&&o}const vO=fp(Sc),cY=vO.left,fY=vO.right;function dY(e,t,n){const i=this.context.data[e],r=i?i.values.value:[],s=i?i[Wh]&&i[Wh].value:void 0,o=n===m2,a=Sc(t),u=cY(r,a);if(u===r.length||Sc(r[u])!==a)return!1;if(s&&o){if(s.size===1)return!0;if(fY(r,a)-u<s.size)return!1}return!0}function hY(e,t){return e.map(n=>ce(t.fields?{values:t.fields.map(i=>bO(i)(n.datum))}:{[Ui]:Sc(n.datum)},t))}function pY(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},u={},l,c,f,d,h,p,g,m,y,b,v=s.length,x=0,E,S;x<v;++x)if(l=s[x],d=l.unit,c=l.fields,f=l.values,c&&f){for(E=0,S=c.length;E<S;++E)h=c[E],g=o[h.field]||(o[h.field]={}),m=g[d]||(g[d]=[]),u[h.field]=y=h.type.charAt(0),b=g0[`${y}_union`],g[d]=b(m,Y(f[E]));n&&(m=a[d]||(a[d]=[]),m.push(Y(f).reduce((w,_,$)=>(w[c[$].field]=_,w),{})))}else h=Ui,p=Sc(l),g=o[h]||(o[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[Ui]:p}));if(t=t||h$,o[Ui]?o[Ui]=g0[`${Ui}_${t}`](...Object.values(o[Ui])):Object.keys(o).forEach(w=>{o[w]=Object.keys(o[w]).map(_=>o[w][_]).reduce((_,$)=>_===void 0?$:g0[`${u[w]}_${t}`](_,$))}),s=Object.keys(a),n&&s.length){const w=i?nY:tY;o[w]=t===h$?{[p$]:s.reduce((_,$)=>(_.push(...a[$]),_),[])}:{[iY]:s.map(_=>({[p$]:a[_]}))}}return o}var g0={[`${Ui}_union`]:WP,[`${Ui}_intersect`]:jP,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;n<i;++n)e.indexOf(t[n])<0&&e.push(t[n]);return e},E_intersect:function(e,t){return e.length?e.filter(n=>t.indexOf(n)>=0):t},R_union:function(e,t){var n=zt(t[0]),i=zt(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]<i&&(e[1]=i),e):[n,i]},R_intersect:function(e,t){var n=zt(t[0]),i=zt(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?i<e[0]||e[1]<n?[]:(e[0]<n&&(e[0]=n),e[1]>i&&(e[1]=i),e):[n,i]}};const gY=":",mY="@";function y2(e,t,n,i){t[0].type!==Io&&N("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&xe(t).value,o="unit",a=mY+o,u=gY+r;s===m2&&!J(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),J(i,u)||(i[u]=n.getData(r).tuplesRef())}function xO(e){const t=this.context.data[e];return t?t.values.value:[]}function yY(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function bY(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Rn).insert(t)),1}function vY(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const uf=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},xY=uf("format"),wO=uf("timeFormat"),wY=uf("utcFormat"),EY=uf("timeParse"),SY=uf("utcParse"),Xf=new Date(2e3,0,1);function pg(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Xf.setYear(2e3),Xf.setMonth(e),Xf.setDate(t),wO.call(this,Xf,n))}function _Y(e){return pg.call(this,e,1,"%B")}function $Y(e){return pg.call(this,e,1,"%b")}function AY(e){return pg.call(this,0,2+e,"%A")}function kY(e){return pg.call(this,0,2+e,"%a")}const CY=":",FY="@",cy="%",EO="$";function b2(e,t,n,i){t[0].type!==Io&&N("First argument to data functions must be a string literal.");const r=t[0].value,s=CY+r;if(!J(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function TY(e,t,n,i){t[0].type!==Io&&N("First argument to indata must be a string literal."),t[1].type!==Io&&N("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=FY+s;J(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function rn(e,t,n,i){if(t[0].type===Io)m$(n,i,t[0].value);else for(e in n.scales)m$(n,i,e)}function m$(e,t,n){const i=cy+n;if(!J(t,i))try{t[i]=e.scaleRef(n)}catch{}}function fr(e,t){if(fe(e))return e;if(K(e)){const n=t.scales[e];return n&&H7(n.value)?n.value:void 0}}function MY(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=rn,n._range=rn,n._scale=rn;const i=r=>"_["+(r.type===Io?H(cy+r.value):H(cy)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function v2(e,t){return function(n,i,r){if(n){const s=fr(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const DY=v2("area",oq),OY=v2("bounds",cq),RY=v2("centroid",mq);function NY(e,t){const n=fr(e,(t||this).context);return n&&n.scale()}function LY(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function x2(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function PY(){return x2(this.context.dataflow,"warn",arguments)}function zY(){return x2(this.context.dataflow,"info",arguments)}function IY(){return x2(this.context.dataflow,"debug",arguments)}function m0(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fy(e){const t=zd(e),n=m0(t.r),i=m0(t.g),r=m0(t.b);return .2126*n+.7152*i+.0722*r}function BY(e,t){const n=fy(e),i=fy(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function UY(){const e=[].slice.call(arguments);return e.unshift({}),ce(...e)}function SO(e,t){return e===t||e!==e&&t!==t?!0:L(e)?L(t)&&e.length===t.length?jY(e,t):!1:X(e)&&X(t)?_O(e,t):!1}function jY(e,t){for(let n=0,i=e.length;n<i;++n)if(!SO(e[n],t[n]))return!1;return!0}function _O(e,t){for(const n in e)if(!SO(e[n],t[n]))return!1;return!0}function y$(e){return t=>_O(e,t)}function qY(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],u=a.input,l=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp<l)&&(a.changes=c=o.changeset(),c.stamp=l,o.runAfter(()=>{a.modified=!0,o.pulse(u,c).run()},!0,1)),n&&(f=n===!0?Rn:L(n)||kp(n)?n:y$(n),c.remove(f)),t&&c.insert(t),i&&(f=y$(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in s)c.modify(r,d,s[d]);return 1}function WY(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function HY(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const b$={};function GY(e,t){const n=b$[t]||(b$[t]=Yn(t));return L(e)?e.map(n):n(e)}function w2(e){return L(e)||ArrayBuffer.isView(e)?e:null}function E2(e){return w2(e)||(K(e)?e:null)}function VY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return w2(e).join(...n)}function XY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return E2(e).indexOf(...n)}function YY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return E2(e).lastIndexOf(...n)}function KY(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return E2(e).slice(...n)}function JY(e,t,n){return fe(n)&&N("Function argument passed to replace."),String(e).replace(t,n)}function QY(e){return w2(e).slice().reverse()}function ZY(e,t,n){return Nv(e||0,t||0,n||0)}function eK(e,t){const n=fr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function tK(e,t){const n=fr(e,(t||this).context);return n?n.copy():void 0}function nK(e,t){const n=fr(e,(t||this).context);return n?n.domain():[]}function iK(e,t,n){const i=fr(e,(n||this).context);return i?L(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function rK(e,t){const n=fr(e,(t||this).context);return n&&n.range?n.range():[]}function sK(e,t,n){const i=fr(e,(n||this).context);return i?i(t):void 0}function oK(e,t,n,i,r){e=fr(e,(r||this).context);const s=yM(t,n);let o=e.domain(),a=o[0],u=xe(o),l=Wt;return u-a?l=sM(e,a,u):e=(e.interpolator?ke("sequential")().interpolator(e.interpolator()):ke("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,u=1]),e.ticks&&(o=e.ticks(+i||15),a!==o[0]&&o.unshift(a),u!==xe(o)&&o.push(u)),o.forEach(c=>s.stop(l(c),e(c))),s}function aK(e,t,n){const i=fr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function uK(e){let t=null;return function(n){return n?pc(n,t=t||iu(e)):e}}const $O=e=>e.data;function AO(e,t){const n=xO.call(t,e);return n.root&&n.root.lookup||{}}function lK(e,t,n){const i=AO(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map($O):void 0}function cK(e,t){const n=AO(e,this)[t];return n?n.ancestors().map($O):void 0}const kO=()=>typeof window<"u"&&window||null;function fK(){const e=kO();return e?e.screen:{}}function dK(){const e=kO();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function hK(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function CO(e,t,n){if(!e)return[];const[i,r]=e,s=new nt().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return pD(o,s,pK(t))}function pK(e){let t=null;if(e){const n=Y(e.marktype),i=Y(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function gK(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=Y(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function mK(e){return Y(e).reduce((t,n,i)=>{let[r,s]=n;return t+=i==0?`M ${r},${s} `:i===e.length-1?" Z":`L ${r},${s} `},"")}function yK(e,t,n){const{x:i,y:r,mark:s}=n,o=new nt().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)u<o.x1&&(o.x1=u),u>o.x2&&(o.x2=u),l<o.y1&&(o.y1=l),l>o.y2&&(o.y2=l);return o.translate(i,r),CO([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(u=>bK(u.x,u.y,t))}function bK(e,t,n){let i=0;for(let r=0,s=n.length-1;r<n.length;s=r++){const[o,a]=n[s],[u,l]=n[r];l>t!=a>t&&e<(o-u)*(t-l)/(a-l)+u&&i++}return i&1}const _c={random(){return Jn()},cumulativeNormal:Dp,cumulativeLogNormal:Pb,cumulativeUniform:Ub,densityNormal:Db,densityLogNormal:Lb,densityUniform:Bb,quantileNormal:Op,quantileLogNormal:zb,quantileUniform:jb,sampleNormal:Mp,sampleLogNormal:Nb,sampleUniform:Ib,isArray:L,isBoolean:js,isDate:ws,isDefined(e){return e!==void 0},isNumber:$e,isObject:X,isRegExp:uC,isString:K,isTuple:kp,isValid(e){return e!=null&&e===e},toBoolean:hb,toDate(e){return pb(e)},toNumber:zt,toString:gb,indexof:XY,join:VY,lastindexof:YY,replace:JY,reverse:QY,slice:KY,flush:oC,lerp:lC,merge:UY,pad:dC,peek:xe,pluck:GY,span:Pc,inrange:Da,truncate:hC,rgb:zd,lab:Zd,hcl:eh,hsl:q0,luminance:fy,contrast:BY,sequence:Fn,format:xY,utcFormat:wY,utcParse:SY,utcOffset:IC,utcSequence:jC,timeFormat:wO,timeParse:EY,timeOffset:zC,timeSequence:UC,timeUnitSpecifier:kC,monthFormat:_Y,monthAbbrevFormat:$Y,dayFormat:AY,dayAbbrevFormat:kY,quarter:nC,utcquarter:iC,week:FC,utcweek:DC,dayofyear:CC,utcdayofyear:MC,warn:PY,info:zY,debug:IY,extent(e){return Ji(e)},inScope:LY,intersect:CO,clampRange:rC,pinchDistance:WY,pinchAngle:HY,screen:fK,containerSize:hK,windowSize:dK,bandspace:ZY,setdata:bY,pathShape:uK,panLinear:Qk,panLog:Zk,panPow:eC,panSymlog:tC,zoomLinear:ab,zoomLog:ub,zoomPow:jd,zoomSymlog:lb,encode:vY,modify:qY,lassoAppend:gK,lassoPath:mK,intersectLasso:yK},vK=["view","item","group","xy","x","y"],xK="event.vega.",FO="this.",S2={},TO={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${H(EO+e)}]`,functions:wK,constants:gO,visitors:S2},dy=yO(TO);function wK(e){const t=mO(e);vK.forEach(n=>t[n]=xK+n);for(const n in _c)t[n]=FO+n;return ce(t,MY(e,_c,S2)),t}function tt(e,t,n){return arguments.length===1?_c[e]:(_c[e]=t,n&&(S2[e]=n),dy&&(dy.functions[e]=FO+e),this)}tt("bandwidth",eK,rn);tt("copy",tK,rn);tt("domain",nK,rn);tt("range",rK,rn);tt("invert",iK,rn);tt("scale",sK,rn);tt("gradient",oK,rn);tt("geoArea",DY,rn);tt("geoBounds",OY,rn);tt("geoCentroid",RY,rn);tt("geoShape",aK,rn);tt("geoScale",NY,rn);tt("indata",yY,TY);tt("data",xO,b2);tt("treePath",lK,b2);tt("treeAncestors",cK,b2);tt("vlSelectionTest",lY,y2);tt("vlSelectionIdTest",dY,y2);tt("vlSelectionResolve",pY,y2);tt("vlSelectionTuples",hY);function nr(e,t){const n={};let i;try{e=K(e)?e:H(e)+"",i=g2(e)}catch{N("Expression parse error: "+e)}i.visit(s=>{if(s.type!==uO)return;const o=s.callee.name,a=TO.visitors[o];a&&a(o,s.arguments,t,n)});const r=dy(i);return r.globals.forEach(s=>{const o=EO+s;!J(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:ce({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function EK(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const SK=yi(["rule"]),v$=yi(["group","image","rect"]);function _K(e,t){let n="";return SK[t]||(e.x2&&(e.x?(v$[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(v$[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function _2(e){return(e+"").toLowerCase()}function $K(e){return _2(e)==="operator"}function AK(e){return _2(e)==="collect"}function dl(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function kK(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n}
21
- : (u > v || v == null) && u != null ? ${i}
22
- : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}
23
- : v !== v && u === u ? ${i} : `}var CK={operator:(e,t)=>dl(e,["_"],t.code),parameter:(e,t)=>dl(e,["datum","_"],t.code),event:(e,t)=>dl(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return dl(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const o="o["+H(s)+"]";r+=`$=${i[s].code};if(${o}!==$)${o}=$,m=1;`}return r+=_K(i,n),r+="return m;",dl(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(H).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,o)=>{const a=t[o];let u,l;return s.path?(u=`a${s.path}`,l=`b${s.path}`):((n=n||{})["f"+o]=s,u=`this.f${o}(a)`,l=`this.f${o}(b)`),kK(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function FK(e){const t=this;$K(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function TK(e){const t=this;if(e.params){const n=t.get(e.id);n||N("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function MK(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=L(r)?r.map(s=>x$(s,n,t)):x$(r,n,t)}return t}function x$(e,t,n){if(!e||!X(e))return e;for(let i=0,r=w$.length,s;i<r;++i)if(s=w$[i],J(e,s.key))return s.parse(e,t,n);return e}var w$=[{key:"$ref",parse:DK},{key:"$key",parse:RK},{key:"$expr",parse:OK},{key:"$field",parse:NK},{key:"$encode",parse:PK},{key:"$compare",parse:LK},{key:"$context",parse:zK},{key:"$subflow",parse:IK},{key:"$tupleid",parse:BK}];function DK(e,t){return t.get(e.$ref)||N("Operator not defined: "+e.$ref)}function OK(e,t,n){e.$params&&t.parseParameters(e.$params,n);const i="e:"+e.$expr.code;return t.fn[i]||(t.fn[i]=En(t.parameterExpression(e.$expr),e.$fields))}function RK(e,t){const n="k:"+e.$key+"_"+!!e.$flat;return t.fn[n]||(t.fn[n]=db(e.$key,e.$flat,t.expr.codegen))}function NK(e,t){if(!e.$field)return null;const n="f:"+e.$field+"_"+e.$name;return t.fn[n]||(t.fn[n]=Yn(e.$field,e.$name,t.expr.codegen))}function LK(e,t){const n="c:"+e.$compare+"_"+e.$order,i=Y(e.$compare).map(r=>r&&r.$tupleid?re:r);return t.fn[n]||(t.fn[n]=cb(i,e.$order,t.expr.codegen))}function PK(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=En(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function zK(e,t){return t}function IK(e,t){const n=e.$subflow;return function(i,r,s){const o=t.fork().parse(n),a=o.get(n.operators[0].id),u=o.signals.parent;return u&&u.set(s),a.detachSubflow=()=>t.detach(o),a}}function BK(){return re}function UK(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&N("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function jK(e){var t=this,n=X(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,o=void 0;i||N("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(o=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,o)}const qK={skip:!0};function WK(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const o=t.signals[s];e.signals(s,o)&&(i[s]=o.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const o=t.data[s];e.data(s,o)&&(r[s]=o.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function HK(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],qK)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(Rn).insert(i[s]))}),(e.subcontext||[]).forEach((s,o)=>{const a=t.subcontext[o];a&&a.setState(s)})}function MO(e,t,n,i){return new DO(e,t,n,i)}function DO(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||CK,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function E$(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}DO.prototype=E$.prototype={fork(){const e=new E$(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),AK(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const o=n.data[s]||(n.data[s]={});e.data[s].forEach(a=>o[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[_2(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:EK,parseOperator:FK,parseOperatorParameters:TK,parseParameters:MK,parseStream:UK,parseUpdate:jK,getState:WK,setState:HK};function GK(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),OO(t,e.description()))}function OO(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function VK(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const y0="default";function XK(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:y0,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,s=r?K(r)?r:r.user:y0,o=i.item&&i.item.cursor||null;return r&&s===r.user&&o==r.item?r:{user:s,item:o}}),e.add(null,function(n){let i=n.cursor,r=this.value;return K(i)||(r=i.item,i=i.user),hy(e,i&&i!==y0?i:r||i),r},{cursor:t})}function hy(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function Hh(e,t){var n=e._runtime.data;return J(n,t)||N("Unrecognized data set: "+t),n[t]}function YK(e,t){return arguments.length<2?Hh(this,e).values.value:gg.call(this,e,ta().remove(Rn).insert(t))}function gg(e,t){gF(t)||N("Second argument to changes must be a changeset.");const n=Hh(this,e);return n.modified=!0,this.pulse(n.input,t)}function KK(e,t){return gg.call(this,e,ta().insert(t))}function JK(e,t){return gg.call(this,e,ta().remove(t))}function RO(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function NO(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function mg(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function QK(e){var t=mg(e),n=RO(e),i=NO(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(s){e.error(s)}})}function ZK(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,o,a;return r&&(a=mg(e),o=t.changedTouches?t.changedTouches[0]:t,s=ig(o,r),s[0]-=a[0],s[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=eJ(e,n,s),t}function eJ(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(o){var a=i,u;if(o){for(u=t;u;u=u.mark.group)if(u.mark.name===o){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function s(o){if(!o)return n;K(o)&&(o=r(o));const a=n.slice();for(;o;)a[0]-=o.x||0,a[1]-=o.y||0,o=o.mark&&o.mark.group;return a}return{view:Ht(e),item:Ht(t||{}),group:r,xy:s,x:o=>s(o)[0],y:o=>s(o)[1]}}const S$="view",tJ="timer",nJ="window",iJ={trap:!1};function rJ(e){const t=ce({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{L(i[s])&&(i[s]=yi(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function LO(e,t,n,i){e._eventListeners.push({type:n,sources:Y(t),handler:i})}function sJ(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function Yf(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||X(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function oJ(e,t,n){var i=this,r=new Tp(n),s=function(l,c){i.runAsync(null,()=>{e===S$&&sJ(i,t)&&l.preventDefault(),r.receive(ZK(i,l,c))})},o;if(e===tJ)Yf(i,"timer",t)&&i.timer(s,t);else if(e===S$)Yf(i,"view",t)&&i.addEventListener(t,s,iJ);else if(e===nJ?Yf(i,"window",t)&&typeof window<"u"&&(o=[window]):typeof document<"u"&&Yf(i,"selector",t)&&(o=Array.from(document.querySelectorAll(e))),!o)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=o.length;a<u;++a)o[a].addEventListener(t,s);LO(i,o,t,s)}return r}function _$(e){return e.item}function $$(e){return e.item.mark.source}function A$(e){return function(t,n){return n.vega.view().changeset().encode(n.item,e)}}function aJ(e,t){return e=[e||"hover"],t=[t||"update",e[0]],this.on(this.events("view","pointerover",_$),$$,A$(e)),this.on(this.events("view","pointerout",_$),$$,A$(t)),this}function uJ(){var e=this._tooltip,t=this._timers,n=this._handler.handlers(),i=this._eventListeners,r,s,o,a,u;for(r=t.length;--r>=0;)t[r].stop();for(r=i.length;--r>=0;)for(o=i[r],s=o.sources.length;--s>=0;)o.sources[s].removeEventListener(o.type,o.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,a=n[r].handler,this._handler.off(u,a);return this}function Dn(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const lJ="vega-bind",cJ="vega-bind-name",fJ="vega-bind-radio";function dJ(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:o=>{o!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,o)})}},i.debounce&&(r.update=fb(i.debounce,r.update))),(i.input==null&&i.element?hJ:gJ)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function hJ(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),LO(i,t,r,s),e.set=o=>{t.value=o,t.dispatchEvent(pJ(r))}}function pJ(e){return typeof Event<"u"?new Event(e):{type:e}}function gJ(e,t,n,i){const r=i.signal(n.signal),s=Dn("div",{class:lJ}),o=n.input==="radio"?s:s.appendChild(Dn("label"));o.appendChild(Dn("span",{class:cJ},n.name||n.signal)),t.appendChild(s);let a=mJ;switch(n.input){case"checkbox":a=yJ;break;case"select":a=bJ;break;case"radio":a=vJ;break;case"range":a=xJ;break}a(e,o,n,r)}function mJ(e,t,n,i){const r=Dn("input");for(const s in n)s!=="signal"&&s!=="element"&&r.setAttribute(s==="input"?"type":s,n[s]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=s=>r.value=s}function yJ(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=Dn("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=o=>s.checked=!!o||null}function bJ(e,t,n,i){const r=Dn("select",{name:n.signal}),s=n.labels||[];n.options.forEach((o,a)=>{const u={value:o};Gh(o,i)&&(u.selected=!0),r.appendChild(Dn("option",u,(s[a]||o)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=o=>{for(let a=0,u=n.options.length;a<u;++a)if(Gh(n.options[a],o)){r.selectedIndex=a;return}}}function vJ(e,t,n,i){const r=Dn("span",{class:fJ}),s=n.labels||[];t.appendChild(r),e.elements=n.options.map((o,a)=>{const u={type:"radio",name:n.signal,value:o};Gh(o,i)&&(u.checked=!0);const l=Dn("input",u);l.addEventListener("change",()=>e.update(o));const c=Dn("label",{},(s[a]||o)+"");return c.prepend(l),r.appendChild(c),l}),e.set=o=>{const a=e.elements,u=a.length;for(let l=0;l<u;++l)Gh(a[l].value,o)&&(a[l].checked=!0)}}function xJ(e,t,n,i){i=i!==void 0?i:(+n.max+ +n.min)/2;const r=n.max!=null?n.max:Math.max(100,+i)||100,s=n.min||Math.min(0,r,+i)||0,o=n.step||Oo(s,r,100),a=Dn("input",{type:"range",name:n.signal,min:s,max:r,step:o});a.value=i;const u=Dn("span",{},+i);t.appendChild(a),t.appendChild(u);const l=()=>{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function Gh(e,t){return e===t||e+""==t+""}function PO(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,RO(e),NO(e),mg(e),r,s).background(e.background())}function $2(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function wJ(e,t,n,i){const r=new i(e.loader(),$2(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,mg(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function EJ(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=rg(i);e=n._el=e?b0(n,e,!0):null,GK(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||Zc,a=e?s.renderer:s.headless;return n._renderer=a?PO(n,n._renderer,e,a):null,n._handler=wJ(n,n._handler,e,o),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=b0(n,t,!0):e.appendChild(Dn("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=b0(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{dJ(n,u.element||t,u)})),n}function b0(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const hl=e=>+e||0,SJ=e=>({top:e,bottom:e,left:e,right:e});function k$(e){return X(e)?{top:hl(e.top),bottom:hl(e.bottom),left:hl(e.left),right:hl(e.right)}:SJ(hl(e))}async function A2(e,t,n,i){const r=rg(t),s=r&&r.headless;return s||N("Unrecognized renderer type: "+t),await e.runAsync(),PO(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function _J(e,t){e!==gs.Canvas&&e!==gs.SVG&&e!==gs.PNG&&N("Unrecognized image type: "+e);const n=await A2(this,e,t);return e===gs.SVG?$J(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function $J(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function AJ(e,t){return(await A2(this,gs.Canvas,e,t)).canvas()}async function kJ(e){return(await A2(this,gs.SVG,e)).svg()}function CJ(e,t,n){return MO(e,Qa,_c,n).parse(t)}function FJ(e){var t=this._runtime.scales;return J(t,e)||N("Unrecognized scale or projection: "+e),t[e].value}var zO="width",IO="height",k2="padding",C$={skip:!0};function BO(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===k2?i.left+i.right:0)}function UO(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===k2?i.top+i.bottom:0)}function TJ(e){var t=e._signals,n=t[zO],i=t[IO],r=t[k2];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=BO(e,a.size),s()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=UO(e,a.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}function MJ(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(zO,n,C$),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(IO,i,C$),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==r[0]||o._origin[1]!==r[1])&&(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(u=>u.resize())},!1,1)}function DJ(e){return this._runtime.getState(e||{data:OJ,signals:RJ,recurse:!0})}function OJ(e,t){return t.modified&&L(t.input.value)&&!e.startsWith("_:vega:_")}function RJ(e,t){return!(e==="parent"||t instanceof Qa.proxy)}function NJ(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function LJ(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(hH(n,t))}function PJ(e,t,n,i){const r=e.element();r&&r.setAttribute("title",zJ(i))}function zJ(e){return e==null?"":L(e)?jO(e):X(e)&&!ws(e)?IJ(e):e+""}function IJ(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(L(n)?jO(n):qO(n))}).join(`
24
- `)}function jO(e){return"["+e.map(qO).join(", ")+"]"}function qO(e){return L(e)?"[…]":X(e)&&!ws(e)?"{…}":e}function BJ(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function WO(e,t){const n=this;if(t=t||{},za.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const s=ce({},e.locale,t.locale);n.locale(sF(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||gs.Canvas,n._scenegraph=new UM;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||PJ,n._redraw=!0,n._handler=new Zc().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=rJ(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=CJ(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:ce({},s)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=BO(n,n._width),n._viewHeight=UO(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,TJ(n),VK(n),XK(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function Kf(e,t){return J(e._signals,t)?e._signals[t]:N("Unrecognized signal name: "+H(t))}function HO(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function F$(e,t,n,i){let r=HO(n,i);return r||(r=$2(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function T$(e,t,n){const i=HO(t,n);return i&&t._targets.remove(i),e}G(WO,za,{async evaluate(e,t,n){if(await za.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,QK(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&hd(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&OO(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=Kf(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",k$(e)):k$(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(rg(e)||N("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(za.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(Kf(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:MJ,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=$2(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,s;--i>=0;)if(s=n[i].type,r=n[i].handler,e===s&&(t===r||t===r.raw)){this._handler.off(s,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return F$(this,e,Kf(this,e),t)},removeSignalListener(e,t){return T$(this,Kf(this,e),t)},addDataListener(e,t){return F$(this,e,Hh(this,e).values,t)},removeDataListener(e,t){return T$(this,Hh(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=hy(this,null);this._globalCursor=!!e,t&&hy(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:LJ,events:oJ,finalize:uJ,hover:aJ,data:YK,change:gg,insert:KK,remove:JK,scale:FJ,initialize:EJ,toImageURL:_J,toCanvas:AJ,toSVG:kJ,getState:DJ,setState:NJ,_watchPixelRatio:BJ});const UJ="view",Vh="[",Xh="]",GO="{",VO="}",jJ=":",XO=",",qJ="@",WJ=">",HJ=/[[\]{}]/,GJ={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let YO,KO;function Hs(e,t,n){return YO=t||UJ,KO=n||GJ,JO(e.trim()).map(py)}function VJ(e){return KO[e]}function tc(e,t,n,i,r){const s=e.length;let o=0,a;for(;t<s;++t){if(a=e[t],!o&&a===n)return t;r&&r.indexOf(a)>=0?--o:i&&i.indexOf(a)>=0&&++o}return t}function JO(e){const t=[],n=e.length;let i=0,r=0;for(;r<n;)r=tc(e,r,XO,Vh+GO,Xh+VO),t.push(e.substring(i,r).trim()),i=++r;if(t.length===0)throw"Empty event selector: "+e;return t}function py(e){return e[0]==="["?XJ(e):YJ(e)}function XJ(e){const t=e.length;let n=1,i;if(n=tc(e,n,Xh,Vh,Xh),n===t)throw"Empty between selector: "+e;if(i=JO(e.substring(1,n)),i.length!==2)throw"Between selector must have two elements: "+e;if(e=e.slice(n+1).trim(),e[0]!==WJ)throw"Expected '>' after between selector: "+e;i=i.map(py);const r=py(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function YJ(e){const t={source:YO},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,u,l;if(e[o-1]===VO){if(a=e.lastIndexOf(GO),a>=0){try{i=KJ(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===qJ&&(r=++a),u=tc(e,a,jJ),u<o&&(n.push(e.substring(s,u).trim()),s=a=++u),a=tc(e,a,Vh),a===o)n.push(e.substring(s,o).trim());else if(n.push(e.substring(s,a).trim()),l=[],s=++a,s===o)throw"Unmatched left bracket: "+e;for(;a<o;){if(a=tc(e,a,Xh),a===o)throw"Unmatched left bracket: "+e;if(l.push(e.substring(s,a).trim()),a<o-1&&e[++a]!==Vh)throw"Expected left bracket: "+e;s=++a}if(!(o=n.length)||HJ.test(n[o-1]))throw"Invalid event selector: "+e;return o>1?(t.type=n[1],r?t.markname=n[0].slice(1):VJ(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function KJ(e){const t=e.split(XO);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function JJ(e){return X(e)?e:{type:e||"pad"}}const pl=e=>+e||0,QJ=e=>({top:e,bottom:e,left:e,right:e});function ZJ(e){return X(e)?e.signal?e:{top:pl(e.top),bottom:pl(e.bottom),left:pl(e.left),right:pl(e.right)}:QJ(pl(e))}const ht=e=>X(e)&&!L(e)?ce({},e):{value:e};function M$(e,t,n,i){return n!=null?(X(n)&&!L(n)||L(n)&&n.length&&X(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function Ct(e,t,n){for(const i in t)M$(e,i,t[i]);for(const i in n)M$(e,i,n[i],"update")}function Bu(e,t,n){for(const i in t)n&&J(n,i)||(e[i]=ce(e[i]||{},t[i]));return e}function Ta(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const C2="mark",F2="frame",T2="scope",eQ="axis",tQ="axis-domain",nQ="axis-grid",iQ="axis-label",rQ="axis-tick",sQ="axis-title",oQ="legend",aQ="legend-band",uQ="legend-entry",lQ="legend-gradient",QO="legend-label",cQ="legend-symbol",fQ="legend-title",dQ="title",hQ="title-text",pQ="title-subtitle";function gQ(e,t,n,i,r){const s={},o={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!Ta(u,e)&&v0(s,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===F2?r.group:n===C2?ce({},r.mark,r[t]):null;for(u in c)l=Ta(u,e)||(u==="fill"||u==="stroke")&&(Ta("fill",e)||Ta("stroke",e)),l||v0(s,u,c[u]);Y(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)Ta(h,e)||v0(s,h,d[h])}),e=ce({},e);for(u in s)c=s[u],c.signal?(a=a||{})[u]=c:o[u]=c;return e.enter=ce(o,e.enter),a&&(e.update=ce(a,e.update)),e}function v0(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const ZO=e=>K(e)?H(e):e.signal?`(${e.signal})`:eR(e);function yg(e){if(e.gradient!=null)return yQ(e);let t=e.signal?`(${e.signal})`:e.color?mQ(e.color):e.field!=null?eR(e.field):e.value!==void 0?H(e.value):void 0;return e.scale!=null&&(t=bQ(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${Md(e.exponent)})`),e.mult!=null&&(t+=`*${Md(e.mult)}`),e.offset!=null&&(t+=`+${Md(e.offset)}`),e.round&&(t=`round(${t})`),t}const Jf=(e,t,n,i)=>`(${e}(${[t,n,i].map(yg).join(",")})+'')`;function mQ(e){return e.c?Jf("hcl",e.h,e.c,e.l):e.h||e.s?Jf("hsl",e.h,e.s,e.l):e.l||e.a?Jf("lab",e.l,e.a,e.b):e.r||e.g||e.b?Jf("rgb",e.r,e.g,e.b):null}function yQ(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:H(n));for(;t.length&&xe(t)==null;)t.pop();return t.unshift(ZO(e.gradient)),`gradient(${t.join(",")})`}function Md(e){return X(e)?"("+yg(e)+")":e}function eR(e){return tR(X(e)?e:{datum:e})}function tR(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):N("Invalid field reference: "+H(e));return e.signal||(i=K(i)?or(i).map(H).join("]["):tR(i)),t+"["+i+"]"}function bQ(e,t){const n=ZO(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+Md(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function vQ(e){let t="";return e.forEach(n=>{const i=yg(n);t+=n.test?`(${n.test})?${i}:`:i}),xe(t)===":"&&(t+="null"),t}function nR(e,t,n,i,r,s){const o={};s=s||{},s.encoders={$encode:o},e=gQ(e,t,n,i,r.config);for(const a in e)o[a]=xQ(e[a],t,s,r);return s}function xQ(e,t,n,i){const r={},s={};for(const o in e)e[o]!=null&&(r[o]=EQ(wQ(e[o]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function wQ(e){return L(e)?vQ(e):yg(e)}function EQ(e,t,n,i){const r=nr(e,t);return r.$fields.forEach(s=>i[s]=1),ce(n,r.$params),r.$expr}const SQ="outer",_Q=["value","update","init","react","bind"];function D$(e,t){N(e+' for "outer" push: '+H(t))}function iR(e,t){const n=e.name;if(e.push===SQ)t.signals[n]||D$("No prior signal definition",n),_Q.forEach(i=>{e[i]!==void 0&&D$("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function gy(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function bg(e,t,n,i){return new gy(e,t,n,i)}function Yh(e,t){return bg("operator",e,t)}function ie(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function $c(e,t){return t?{$field:e,$name:t}:{$field:e}}const my=$c("key");function O$(e,t){return{$compare:e,$order:t}}function $Q(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const AQ="ascending",kQ="descending";function CQ(e){return X(e)?(e.order===kQ?"-":"+")+vg(e.op,e.field):""}function vg(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const M2="scope",yy="view";function at(e){return e&&e.signal}function FQ(e){return e&&e.expr}function Dd(e){if(at(e))return!0;if(X(e)){for(const t in e)if(Dd(e[t]))return!0}return!1}function ui(e,t){return e??t}function Co(e){return e&&e.signal||e}const R$="timer";function Ac(e,t){return(e.merge?MQ:e.stream?DQ:e.type?OQ:N("Invalid stream specification: "+H(e)))(e,t)}function TQ(e){return e===M2?yy:e||yy}function MQ(e,t){const n=e.merge.map(r=>Ac(r,t)),i=D2({merge:n},e,t);return t.addStream(i).id}function DQ(e,t){const n=Ac(e.stream,t),i=D2({stream:n},e,t);return t.addStream(i).id}function OQ(e,t){let n;e.type===R$?(n=t.event(R$,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(TQ(e.source),e.type);const i=D2({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function D2(e,t,n){let i=t.between;return i&&(i.length!==2&&N('Stream "between" parameter must have 2 entries: '+H(t)),e.between=[Ac(i[0],n),Ac(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(RQ(t.marktype,t.markname,t.markrole)),t.source===M2&&i.push("inScope(event.item)"),i.length&&(e.filter=nr("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function RQ(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const NQ={code:"_.$value",ast:{type:"Identifier",value:"value"}};function LQ(e,t,n){const i=e.encode,r={target:n};let s=e.events,o=e.update,a=[];s||N("Signal update missing events specification."),K(s)&&(s=Hs(s,t.isSubscope()?M2:yy)),s=Y(s).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[zQ(a)]),s.length&&a.push(s.length>1?{merge:s}:s[0]),i!=null&&(o&&N("Signal encode and update are mutually exclusive."),o="encode(item(),"+H(i)+")"),r.update=K(o)?nr(o,t):o.expr!=null?nr(o.expr,t):o.value!=null?o.value:o.signal!=null?{$expr:NQ,$params:{$value:t.signalRef(o.signal)}}:N("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(ce(PQ(u,t),r)))}function PQ(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):Ac(e,t)}}function zQ(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function IQ(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?N("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=nr(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>LQ(r,t,n.id))}const Le=e=>(t,n,i)=>bg(e,n,t||void 0,i),rR=Le("aggregate"),BQ=Le("axisticks"),sR=Le("bound"),$i=Le("collect"),N$=Le("compare"),UQ=Le("datajoin"),oR=Le("encode"),jQ=Le("expression"),qQ=Le("facet"),WQ=Le("field"),HQ=Le("key"),GQ=Le("legendentries"),VQ=Le("load"),XQ=Le("mark"),YQ=Le("multiextent"),KQ=Le("multivalues"),JQ=Le("overlap"),QQ=Le("params"),aR=Le("prefacet"),ZQ=Le("projection"),eZ=Le("proxy"),tZ=Le("relay"),uR=Le("render"),nZ=Le("scale"),ra=Le("sieve"),iZ=Le("sortitems"),lR=Le("viewlayout"),rZ=Le("values");let sZ=0;const cR={min:"min",max:"max",count:"sum"};function oZ(e,t){const n=e.type||"linear";ZT(n)||N("Unrecognized scale type: "+H(n)),t.addScale(e.name,{type:n,domain:void 0})}function aZ(e,t){const n=t.getScale(e.name).params;let i;n.domain=fR(e.domain,e,t),e.range!=null&&(n.range=hR(e,t,n)),e.interpolate!=null&&yZ(e.interpolate,n),e.nice!=null&&(n.nice=mZ(e.nice,t)),e.bins!=null&&(n.bins=gZ(e.bins,t));for(i in e)J(n,i)||i==="name"||(n[i]=Hn(e[i],t))}function Hn(e,t){return X(e)?e.signal?t.signalRef(e.signal):N("Unsupported object: "+H(e)):e}function Od(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Hn(n,t))}function xg(e){N("Can not find data set: "+H(e))}function fR(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&N("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(L(e)?uZ:e.fields?cZ:lZ)(e,t,n)}function uZ(e,t,n){return e.map(i=>Hn(i,n))}function lZ(e,t,n){const i=n.getData(e.data);return i||xg(e.data),nu(t.type)?i.valuesRef(n,e.field,dR(e.sort,!1)):nM(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function cZ(e,t,n){const i=e.data,r=e.fields.reduce((s,o)=>(o=K(o)?{data:i,field:o}:L(o)||o.signal?fZ(o,n):o,s.push(o),s),[]);return(nu(t.type)?dZ:nM(t.type)?hZ:pZ)(e,n,r)}function fZ(e,t){const n="_:vega:_"+sZ++,i=$i({});if(L(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+H(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,ra({})]),{data:n,field:"data"}}function dZ(e,t,n){const i=dR(e.sort,!0);let r,s;const o=n.map(l=>{const c=t.getData(l.data);return c||xg(l.data),c.countsRef(t,l.field,i)}),a={groupby:my,pulse:o};i&&(r=i.op||"count",s=i.field?vg(r,i.field):"count",a.ops=[cR[r]],a.fields=[t.fieldRef(s)],a.as=[s]),r=t.add(rR(a));const u=t.add($i({pulse:ie(r)}));return s=t.add(rZ({field:my,sort:t.sortRef(i),pulse:ie(u)})),ie(s)}function dR(e,t){return e&&(!e.field&&!e.op?X(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?N("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!cR[e.op]&&N("Multiple domain scales can not be sorted using "+e.op)),e}function hZ(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||xg(r.data),s.domainRef(t,r.field)});return ie(t.add(KQ({values:i})))}function pZ(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||xg(r.data),s.extentRef(t,r.field)});return ie(t.add(YQ({extents:i})))}function gZ(e,t){return e.signal||L(e)?Od(e,t):t.objectProperty(e)}function mZ(e,t){return e.signal?t.signalRef(e.signal):X(e)?{interval:Hn(e.interval),step:Hn(e.step)}:Hn(e)}function yZ(e,t){t.interpolate=Hn(e.type||e),e.gamma!=null&&(t.interpolateGamma=Hn(e.gamma))}function hR(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(K(r)){if(i&&J(i,r))return e=ce({},e,{range:i[r]}),hR(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=nu(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:N("Unrecognized scale range value: "+H(r))}else if(r.scheme){n.scheme=L(r.scheme)?Od(r.scheme,t):Hn(r.scheme,t),r.extent&&(n.schemeExtent=Od(r.extent,t)),r.count&&(n.schemeCount=Hn(r.count,t));return}else if(r.step){n.rangeStep=Hn(r.step,t);return}else{if(nu(e.type)&&!L(r))return fR(r,e,t);L(r)||N("Unsupported range type: "+H(r))}return r.map(s=>(L(s)?Od:Hn)(s,t))}function bZ(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=by(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=by(n[r],r,t));t.addProjection(e.name,i)}function by(e,t,n){return L(e)?e.map(i=>by(i,t,n)):X(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:N("Unsupported parameter object: "+H(e)):e}const Ai="top",Uu="left",ju="right",Os="bottom",pR="center",vZ="vertical",xZ="start",wZ="middle",EZ="end",vy="index",O2="label",SZ="offset",cu="perc",_Z="perc2",Vn="value",lf="guide-label",R2="guide-title",$Z="group-title",AZ="group-subtitle",L$="symbol",Rd="gradient",xy="discrete",wy="size",kZ="shape",CZ="fill",FZ="stroke",TZ="strokeWidth",MZ="strokeDash",DZ="opacity",N2=[wy,kZ,CZ,FZ,TZ,MZ,DZ],cf={name:1,style:1,interactive:1},Ee={value:0},Xn={value:1},wg="group",gR="rect",L2="rule",OZ="symbol",sa="text";function kc(e){return e.type=wg,e.interactive=e.interactive||!1,e}function Sn(e,t){const n=(i,r)=>ui(e[i],ui(t[i],r));return n.isVertical=i=>vZ===ui(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>ui(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>ui(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>ui(e.columns,ui(t.columns,+n.isVertical(!0))),n}function mR(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function RZ(e,t,n){const i=t.config.style[n];return i&&i[e]}function Eg(e,t,n){return`item.anchor === '${xZ}' ? ${e} : item.anchor === '${EZ}' ? ${t} : ${n}`}const P2=Eg(H(Uu),H(ju),H(pR));function NZ(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},X(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function yR(e,t){return t?e?X(e)?Object.assign({},e,{offset:yR(e.offset,t)}):{value:e,offset:t}:t:e}function zn(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Bu(e.encode,t,cf)):e.interactive=!1,e}function LZ(e,t,n,i){const r=Sn(e,n),s=r.isVertical(),o=r.gradientThickness(),a=r.gradientLength();let u,l,c,f,d;s?(l=[0,1],c=[0,0],f=o,d=a):(l=[0,0],c=[1,0],f=a,d=o);const h={enter:u={opacity:Ee,x:Ee,y:Ee,width:ht(f),height:ht(d)},update:ce({},u,{opacity:Xn,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:Ee}};return Ct(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),zn({type:gR,role:lQ,encode:h},i)}function PZ(e,t,n,i,r){const s=Sn(e,n),o=s.isVertical(),a=s.gradientThickness(),u=s.gradientLength();let l,c,f,d,h="";o?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:Ee,fill:{scale:t,field:Vn}};p[l]={signal:h+"datum."+cu,mult:u},p[c]=Ee,p[f]={signal:h+"datum."+_Z,mult:u},p[d]=ht(a);const g={enter:p,update:ce({},p,{opacity:Xn}),exit:{opacity:Ee}};return Ct(g,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),zn({type:gR,role:aQ,key:Vn,from:r,encode:g},i)}const zZ=`datum.${cu}<=0?"${Uu}":datum.${cu}>=1?"${ju}":"${pR}"`,IZ=`datum.${cu}<=0?"${Os}":datum.${cu}>=1?"${Ai}":"${wZ}"`;function P$(e,t,n,i){const r=Sn(e,t),s=r.isVertical(),o=ht(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const p={enter:l={opacity:Ee},update:c={opacity:Xn,text:{field:O2}},exit:{opacity:Ee}};return Ct(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:ui(e.labelLimit,t.gradientLabelLimit)}),s?(l.align={value:"left"},l.baseline=c.baseline={signal:IZ},f="y",d="x",h="1-"):(l.align=c.align={signal:zZ},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+cu,mult:a},l[d]=c[d]=o,o.offset=ui(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+vy}:void 0,zn({type:sa,role:QO,style:lf,key:Vn,from:i,encode:p,overlap:u},n)}function BZ(e,t,n,i,r){const s=Sn(e,t),o=n.entries,a=!!(o&&o.interactive),u=o?o.name:void 0,l=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${SZ} : datum.${wy}`,h=l?ht(l):{field:wy},p=`datum.${vy}`,g=`max(1, ${r})`;let m,y,b,v,x;h.mult=.5,m={enter:y={opacity:Ee,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:Xn,x:y.x,y:y.y},exit:{opacity:Ee}};let E=null,S=null;e.fill||(E=t.symbolBaseFillColor,S=t.symbolBaseStrokeColor),Ct(m,{fill:s("symbolFillColor",E),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",S),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),N2.forEach(C=>{e[C]&&(b[C]=y[C]={scale:e[C],field:Vn})});const w=zn({type:OZ,role:cQ,key:Vn,from:f,clip:l?!0:void 0,encode:m},n.symbols),_=ht(c);_.offset=s("labelOffset"),m={enter:y={opacity:Ee,x:{signal:d,offset:_},y:h},update:b={opacity:Xn,text:{field:O2},x:y.x,y:y.y},exit:{opacity:Ee}},Ct(m,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const $=zn({type:sa,role:QO,style:lf,key:Vn,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:Ee,height:l?ht(l):Ee,opacity:Ee},exit:{opacity:Ee},update:b={opacity:Xn,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${p}%${v}`,b.column.signal=`floor(${p} / ${v})`,x={field:["row",p]}):(b.row.signal=`floor(${p} / ${g})`,b.column.signal=`${p} % ${g}`,x={field:p}),b.column.signal=`(${r})?${b.column.signal}:${p}`,i={facet:{data:i,name:"value",groupby:vy}},kc({role:T2,from:i,encode:Bu(m,o,cf),marks:[w,$],name:u,interactive:a,sort:x})}function UZ(e,t){const n=Sn(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const z2='item.orient === "left"',I2='item.orient === "right"',Sg=`(${z2} || ${I2})`,jZ=`datum.vgrad && ${Sg}`,qZ=Eg('"top"','"bottom"','"middle"'),WZ=Eg('"right"','"left"','"center"'),HZ=`datum.vgrad && ${I2} ? (${WZ}) : (${Sg} && !(datum.vgrad && ${z2})) ? "left" : ${P2}`,GZ=`item._anchor || (${Sg} ? "middle" : "start")`,VZ=`${jZ} ? (${z2} ? -90 : 90) : 0`,XZ=`${Sg} ? (datum.vgrad ? (${I2} ? "bottom" : "top") : ${qZ}) : "top"`;function YZ(e,t,n,i){const r=Sn(e,t),s={enter:{opacity:Ee},update:{opacity:Xn,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Ee}};return Ct(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:GZ},angle:{signal:VZ},align:{signal:HZ},baseline:{signal:XZ},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),zn({type:sa,role:fQ,style:R2,from:i,encode:s},n)}function KZ(e,t){let n;return X(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+z$(e.path)+")":e.sphere&&(n="geoShape("+z$(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function z$(e){return X(e)&&e.signal?e.signal:H(e)}function bR(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===wg?T2:t||C2}function JZ(e){return{marktype:e.type,name:e.name||void 0,role:e.role||bR(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function QZ(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function B2(e,t){const n=bF(e.type);n||N("Unrecognized transform type: "+H(e.type));const i=bg(n.type.toLowerCase(),null,vR(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function vR(e,t,n){const i={},r=e.params.length;for(let s=0;s<r;++s){const o=e.params[s];i[o.name]=ZZ(o,t,n)}return i}function ZZ(e,t,n){const i=e.type,r=t[e.name];if(i==="index")return eee(e,t,n);if(r===void 0){e.required&&N("Missing required "+H(t.type)+" parameter: "+H(e.name));return}else{if(i==="param")return tee(e,t,n);if(i==="projection")return n.projectionRef(t[e.name])}return e.array&&!at(r)?r.map(s=>I$(e,s,n)):I$(e,r,n)}function I$(e,t,n){const i=e.type;if(at(t))return U$(i)?N("Expression references can not be signals."):x0(i)?n.fieldRef(t):j$(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||x0(i);return r&&nee(t)?n.exprRef(t.expr,t.as):r&&iee(t)?$c(t.field,t.as):U$(i)?nr(t,n):ree(i)?ie(n.getData(t).values):x0(i)?$c(t):j$(i)?n.compareRef(t):t}}function eee(e,t,n){return K(t.from)||N('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function tee(e,t,n){const i=t[e.name];return e.array?(L(i)||N("Expected an array of sub-parameters. Instead: "+H(i)),i.map(r=>B$(e,r,n))):B$(e,i,n)}function B$(e,t,n){const i=e.params.length;let r;for(let o=0;o<i;++o){r=e.params[o];for(const a in r.key)if(r.key[a]!==t[a]){r=null;break}if(r)break}r||N("Unsupported parameter: "+H(t));const s=ce(vR(r,t,n),r.key);return ie(n.add(QQ(s)))}const nee=e=>e&&e.expr,iee=e=>e&&e.field,ree=e=>e==="data",U$=e=>e==="expr",x0=e=>e==="field",j$=e=>e==="compare";function see(e,t,n){let i,r,s,o,a;return e?(i=e.facet)&&(t||N("Only group marks can be faceted."),i.field!=null?o=a=Nd(i,n):(e.data?a=ie(n.getData(e.data).aggregate):(s=B2(ce({type:"aggregate",groupby:Y(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=Nd(i,n),o=a=ie(n.add(s))),r=n.keyRef(i.groupby,!0))):o=ie(n.add($i(null,[{}]))),o||(o=Nd(e,n)),{key:r,pulse:o,parent:a}}function Nd(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:ie(t.getData(e.data).output)}function jo(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}jo.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],o=null,a=1;for(s&&s.type==="load"&&(s=t[1]),e.add(t[0]);a<n;++a)t[a].params.pulse=ie(t[a-1]),e.add(t[a]),t[a].type==="aggregate"&&(o=t[a]);return new jo(e,s,r,i,o)};function xR(e){return K(e)?e:null}function q$(e,t,n){const i=vg(n.op,n.field);let r;if(t.ops){for(let s=0,o=t.as.length;s<o;++s)if(t.as[s]===i)return}else t.ops=["count"],t.fields=[null],t.as=["count"];n.op&&(t.ops.push((r=n.op.signal)?e.signalRef(r):n.op),t.fields.push(e.fieldRef(n.field)),t.as.push(i))}function gl(e,t,n,i,r,s,o){const a=t[n]||(t[n]={}),u=CQ(s);let l=xR(r),c,f;if(l!=null&&(e=t.scope,l=l+(u?"|"+u:""),c=a[l]),!c){const d=s?{field:my,pulse:t.countsRef(e,r,s)}:{field:e.fieldRef(r),pulse:ie(t.output)};u&&(d.sort=e.sortRef(s)),f=e.add(bg(i,void 0,d)),o&&(t.index[r]=f),c=ie(f),l!=null&&(a[l]=c)}return c}jo.prototype={countsRef(e,t,n){const i=this,r=i.counts||(i.counts={}),s=xR(t);let o,a,u;return s!=null&&(e=i.scope,o=r[s]),o?n&&n.field&&q$(e,o.agg.params,n):(u={groupby:e.fieldRef(t,"key"),pulse:ie(i.output)},n&&n.field&&q$(e,u,n),a=e.add(rR(u)),o=e.add($i({pulse:ie(a)})),o={agg:a,ref:ie(o)},s!=null&&(r[s]=o)),o.ref},tuplesRef(){return ie(this.values)},extentRef(e,t){return gl(e,this,"extent","extent",t,!1)},domainRef(e,t){return gl(e,this,"domain","values",t,!1)},valuesRef(e,t,n){return gl(e,this,"vals","values",t,n||!0)},lookupRef(e,t){return gl(e,this,"lookup","tupleindex",t,!1)},indataRef(e,t){return gl(e,this,"indata","tupleindex",t,!0,!0)}};function oee(e,t,n){const i=e.from.facet,r=i.name,s=Nd(i,t);let o;i.name||N("Facet must have a name: "+H(i)),i.data||N("Facet must reference a data set: "+H(i)),i.field?o=t.add(aR({field:t.fieldRef(i.field),pulse:s})):i.groupby?o=t.add(qQ({key:t.keyRef(i.groupby),group:ie(t.proxy(n.parent)),pulse:s})):N("Facet must specify groupby or field: "+H(i));const a=t.fork(),u=a.add($i()),l=a.add(ra({pulse:ie(u)}));a.addData(r,new jo(a,u,u,l)),a.addSignal("parent",null),o.params.subflow={$subflow:a.parse(e).toRuntime()}}function aee(e,t,n){const i=t.add(aR({pulse:n.pulse})),r=t.fork();r.add(ra()),r.addSignal("parent",null),i.params.subflow={$subflow:r.parse(e).toRuntime()}}function wR(e,t,n){const i=e.remove,r=e.insert,s=e.toggle,o=e.modify,a=e.values,u=t.add(Yh()),l="if("+e.trigger+',modify("'+n+'",'+[r,i,s,o,a].map(f=>f??"null").join(",")+"),0)",c=nr(l,t);u.update=c.$expr,u.params=c.$params}function _g(e,t){const n=bR(e),i=e.type===wg,r=e.from&&e.from.facet,s=e.overlap;let o=e.layout||n===T2||n===F2,a,u,l,c,f,d,h;const p=n===C2||o||r,g=see(e.from,i,t);u=t.add(UQ({key:g.key||(e.key?$c(e.key):void 0),pulse:g.pulse,clean:!i}));const m=ie(u);u=l=t.add($i({pulse:m})),u=t.add(XQ({markdef:JZ(e),interactive:QZ(e.interactive,t),clip:KZ(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:ie(u)}));const y=ie(u);u=c=t.add(oR(nR(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(S=>{const w=B2(S,t),_=w.metadata;(_.generates||_.changes)&&N("Mark transforms should not generate new data."),_.nomod||(c.params.mod=!0),w.params.pulse=ie(u),t.add(u=w)}),e.sort&&(u=t.add(iZ({sort:t.compareRef(e.sort),pulse:ie(u)})));const b=ie(u);(r||o)&&(o=t.add(lR({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=ie(o));const v=t.add(sR({mark:y,pulse:d||b}));h=ie(v),i&&(p&&(a=t.operators,a.pop(),o&&a.pop()),t.pushState(b,d||h,m),r?oee(e,t,g):p?aee(e,t,g):t.parse(e),t.popState(),p&&(o&&a.push(o),a.push(v))),s&&(h=uee(s,h,t));const x=t.add(uR({pulse:h})),E=t.add(ra({pulse:ie(x)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new jo(t,l,x,E)),e.on&&e.on.forEach(S=>{(S.insert||S.remove||S.toggle)&&N("Marks only support modify triggers."),wR(S,t,f)}))}function uee(e,t,n){const i=e.method,r=e.bound,s=e.separation,o={separation:at(s)?n.signalRef(s.signal):s,method:at(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;o.boundTolerance=at(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(r.scale),o.boundOrient=r.orient}return ie(n.add(JQ(o)))}function lee(e,t){const n=t.config.legend,i=e.encode||{},r=Sn(e,n),s=i.legend||{},o=s.name||void 0,a=s.interactive,u=s.style,l={};let c=0,f,d,h;N2.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||N("Missing valid scale for legend.");const p=cee(e,t.scaleType(c)),g={title:e.title!=null,scales:l,type:p,vgrad:p!=="symbol"&&r.isVertical()},m=ie(t.add($i(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=ie(t.add(GQ(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===Rd?(h=[LZ(e,c,n,i.gradient),P$(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${Co(r.gradientLength())})/100))`)):p===xy?h=[PZ(e,c,n,i.gradient,b),P$(e,n,i.labels,b)]:(f=UZ(e,n),h=[BZ(e,n,i,b,Co(f.columns))],d.size=hee(e,t,h[0].marks)),h=[kc({role:uQ,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(YZ(e,n,i.title,m)),_g(kc({role:oQ,from:m,encode:Bu(dee(r,e,n),s,cf),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:a,style:u}),t)}function cee(e,t){let n=e.type||L$;return!e.type&&fee(e)===1&&(e.fill||e.stroke)&&(n=Bv(t)?Rd:h1(t)?xy:L$),n!==Rd?n:h1(t)?xy:Rd}function fee(e){return N2.reduce((t,n)=>t+(e[n]?1:0),0)}function dee(e,t,n){const i={enter:{},update:{}};return Ct(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function hee(e,t,n){const i=Co(W$("size",e,n)),r=Co(W$("strokeWidth",e,n)),s=Co(pee(n[1].encode,t,lf));return nr(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function W$(e,t,n){return t[e]?`scale("${t[e]}",datum)`:mR(e,n[0].encode)}function pee(e,t,n){return mR("fontSize",e)||RZ("fontSize",t,n)}const gee=`item.orient==="${Uu}"?-90:item.orient==="${ju}"?90:0`;function mee(e,t){e=K(e)?{text:e}:e;const n=Sn(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,o=r.interactive,a=r.style,u=[],l={},c=ie(t.add($i(null,[l])));return u.push(vee(e,n,yee(e),c)),e.subtitle&&u.push(xee(e,n,i.subtitle,c)),_g(kc({role:dQ,from:c,encode:bee(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:o,style:a}),t)}function yee(e){const t=e.encode;return t&&t.title||ce({name:e.name,interactive:e.interactive,style:e.style},t)}function bee(e,t){const n={enter:{},update:{}};return Ct(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:P2},angle:{signal:gee},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Bu(n,t,cf)}function vee(e,t,n,i){const r={value:0},s=e.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Ct(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),zn({type:sa,role:hQ,style:$Z,from:i,encode:o},n)}function xee(e,t,n,i){const r={value:0},s=e.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return Ct(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),zn({type:sa,role:pQ,style:AZ,from:i,encode:o},n)}function wee(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(B2(i,t))}),e.on&&e.on.forEach(i=>{wR(i,t,e.name)}),t.addDataPipeline(e.name,Eee(e,t,n))}function Eee(e,t,n){const i=[];let r=null,s=!1,o=!1,a,u,l,c,f;for(e.values?at(e.values)||Dd(e.format)?(i.push(H$(t,e)),i.push(r=io())):i.push(r=io({$ingest:e.values,$format:e.format})):e.url?Dd(e.url)||Dd(e.format)?(i.push(H$(t,e)),i.push(r=io())):i.push(r=io({$request:e.url,$format:e.format})):e.source&&(r=a=Y(e.source).map(d=>ie(t.getData(d).output)),i.push(null)),u=0,l=n.length;u<l;++u)c=n[u],f=c.metadata,!r&&!f.source&&i.push(r=io()),i.push(c),f.generates&&(o=!0),f.modifies&&!o&&(s=!0),f.source?r=c:f.changes&&(r=null);return a&&(l=a.length-1,i[0]=tZ({derive:s,pulse:l?a:a[0]}),(s||l)&&i.splice(1,0,io())),r||i.push(io()),i.push(ra({})),i}function io(e){const t=$i({},e);return t.metadata={source:!0},t}function H$(e,t){return VQ({url:t.url?e.property(t.url):void 0,async:t.async?e.property(t.async):void 0,values:t.values?e.property(t.values):void 0,format:e.objectProperty(t.format)})}const ER=e=>e===Os||e===Ai,$g=(e,t,n)=>at(e)?Aee(e.signal,t,n):e===Uu||e===Ai?t:n,pt=(e,t,n)=>at(e)?_ee(e.signal,t,n):ER(e)?t:n,gi=(e,t,n)=>at(e)?$ee(e.signal,t,n):ER(e)?n:t,SR=(e,t,n)=>at(e)?kee(e.signal,t,n):e===Ai?{value:t}:{value:n},See=(e,t,n)=>at(e)?Cee(e.signal,t,n):e===ju?{value:t}:{value:n},_ee=(e,t,n)=>_R(`${e} === '${Ai}' || ${e} === '${Os}'`,t,n),$ee=(e,t,n)=>_R(`${e} !== '${Ai}' && ${e} !== '${Os}'`,t,n),Aee=(e,t,n)=>U2(`${e} === '${Uu}' || ${e} === '${Ai}'`,t,n),kee=(e,t,n)=>U2(`${e} === '${Ai}'`,t,n),Cee=(e,t,n)=>U2(`${e} === '${ju}'`,t,n),_R=(e,t,n)=>(t=t!=null?ht(t):t,n=n!=null?ht(n):n,G$(t)&&G$(n)?(t=t?t.signal||H(t.value):null,n=n?n.signal||H(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[ce({test:e},t)].concat(n||[])),G$=e=>e==null||Object.keys(e).length===1,U2=(e,t,n)=>({signal:`${e} ? (${Pa(t)}) : (${Pa(n)})`}),Fee=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${Uu}' ? (${Pa(i)}) : `:"")+(n!=null?`${e} === '${Os}' ? (${Pa(n)}) : `:"")+(r!=null?`${e} === '${ju}' ? (${Pa(r)}) : `:"")+(t!=null?`${e} === '${Ai}' ? (${Pa(t)}) : `:"")+"(null)"}),Pa=e=>at(e)?e.signal:e==null?null:H(e),Tee=(e,t)=>t===0?0:at(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Ua=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function _a(e,t,n,i){let r;if(t&&J(t,e))return t[e];if(J(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[R2][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[lf][r]}return null}function V$(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function Mee(e,t){var n=t.config,i=n.style,r=n.axis,s=t.scaleType(e.scale)==="band"&&n.axisBand,o=e.orient,a,u,l;if(at(o)){const f=V$([n.axisX,n.axisY]),d=V$([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=pt(o,_a(l,n.axisX,r,i),_a(l,n.axisY,r,i));u={};for(l of d)u[l]=Fee(o.signal,_a(l,n.axisTop,r,i),_a(l,n.axisBottom,r,i),_a(l,n.axisLeft,r,i),_a(l,n.axisRight,r,i))}else a=o===Ai||o===Os?n.axisX:n.axisY,u=n["axis"+o[0].toUpperCase()+o.slice(1)];return a||u||s?ce({},r,a,u,s):r}function Dee(e,t,n,i){const r=Sn(e,t),s=e.orient;let o,a;const u={enter:o={opacity:Ee},update:a={opacity:Xn},exit:{opacity:Ee}};Ct(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=X$(e,0),c=X$(e,1);return o.x=a.x=pt(s,l,Ee),o.x2=a.x2=pt(s,c),o.y=a.y=gi(s,l,Ee),o.y2=a.y2=gi(s,c),zn({type:L2,role:tQ,from:i,encode:u},n)}function X$(e,t){return{scale:e.scale,range:t}}function Oee(e,t,n,i,r){const s=Sn(e,t),o=e.orient,a=e.gridScale,u=$g(o,1,-1),l=Ree(e.offset,u);let c,f,d;const h={enter:c={opacity:Ee},update:d={opacity:Xn},exit:f={opacity:Ee}};Ct(h,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const p={scale:e.scale,field:Vn,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},g=pt(o,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:u,offset:l}:{value:0,offset:l},y=a?{scale:a,range:1,mult:u,offset:l}:ce(g,{mult:u,offset:l});return c.x=d.x=pt(o,p,m),c.y=d.y=gi(o,p,m),c.x2=d.x2=gi(o,y),c.y2=d.y2=pt(o,y),f.x=pt(o,p),f.y=gi(o,p),zn({type:L2,role:nQ,key:Vn,from:i,encode:h},n)}function Ree(e,t){if(t!==1)if(!X(e))e=at(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=ce({},e);for(;n.mult!=null;)if(X(n.mult))n=n.mult=ce({},n.mult);else return n.mult=at(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function Nee(e,t,n,i,r,s){const o=Sn(e,t),a=e.orient,u=$g(a,-1,1);let l,c,f;const d={enter:l={opacity:Ee},update:f={opacity:Xn},exit:c={opacity:Ee}};Ct(d,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const h=ht(r);h.mult=u;const p={scale:e.scale,field:Vn,band:s.band,extra:s.extra,offset:s.offset,round:o("tickRound")};return f.y=l.y=pt(a,Ee,p),f.y2=l.y2=pt(a,h),c.x=pt(a,p),f.x=l.x=gi(a,Ee,p),f.x2=l.x2=gi(a,h),c.y=gi(a,p),zn({type:L2,role:rQ,key:Vn,from:i,encode:d},n)}function w0(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function Lee(e,t,n,i,r,s){const o=Sn(e,t),a=e.orient,u=e.scale,l=$g(a,-1,1),c=Co(o("labelFlush")),f=Co(o("labelFlushOffset")),d=o("labelAlign"),h=o("labelBaseline");let p=c===0||!!c,g;const m=ht(r);m.mult=l,m.offset=ht(o("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:Vn,band:.5,offset:yR(s.offset,o("labelOffset"))},b=pt(a,p?w0(u,c,'"left"','"right"','"center"'):{value:"center"},See(a,"left","right")),v=pt(a,SR(a,"bottom","top"),p?w0(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=w0(u,c,`-(${f})`,f,0);p=p&&f;const E={opacity:Ee,x:pt(a,y,m),y:gi(a,y,m)},S={enter:E,update:g={opacity:Xn,text:{field:O2},x:E.x,y:E.y,align:b,baseline:v},exit:{opacity:Ee,x:E.x,y:E.y}};Ct(S,{dx:!d&&p?pt(a,x):null,dy:!h&&p?gi(a,x):null}),Ct(S,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:d,baseline:h});const w=o("labelBound");let _=o("labelOverlap");return _=_||w?{separation:o("labelSeparation"),method:_,order:"datum.index",bound:w?{scale:u,orient:a,tolerance:w}:null}:void 0,g.align!==b&&(g.align=Ua(g.align,b)),g.baseline!==v&&(g.baseline=Ua(g.baseline,v)),zn({type:sa,role:iQ,style:lf,key:Vn,from:i,encode:S,overlap:_},n)}function Pee(e,t,n,i){const r=Sn(e,t),s=e.orient,o=$g(s,-1,1);let a,u;const l={enter:a={opacity:Ee,anchor:ht(r("titleAnchor",null)),align:{signal:P2}},update:u=ce({},a,{opacity:Xn,text:ht(e.title)}),exit:{opacity:Ee}},c={signal:`lerp(range("${e.scale}"), ${Eg(0,1,.5)})`};return u.x=pt(s,c),u.y=gi(s,c),a.angle=pt(s,Ee,Tee(o,90)),a.baseline=pt(s,SR(s,Os,Ai),{value:Os}),u.angle=a.angle,u.baseline=a.baseline,Ct(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),zee(r,s,l,n),l.update.align=Ua(l.update.align,a.align),l.update.angle=Ua(l.update.angle,a.angle),l.update.baseline=Ua(l.update.baseline,a.baseline),zn({type:sa,role:sQ,style:R2,from:i,encode:l},n)}function zee(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=Ua(ht(a),n.update[u]),!1):!Ta(u,i),s=r(e("titleX"),"x"),o=r(e("titleY"),"y");n.enter.auto=o===s?ht(o):pt(t,ht(o),ht(s))}function Iee(e,t){const n=Mee(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,o=r.interactive,a=r.style,u=Sn(e,n),l=NZ(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=ie(t.add($i({},[c]))),d=ie(t.add(BQ({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(Oee(e,n,i.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(Nee(e,n,i.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(Lee(e,n,i.labels,d,p,l))),c.domain&&h.push(Dee(e,n,i.domain,f)),c.title&&h.push(Pee(e,n,i.title,f)),_g(kc({role:eQ,from:f,encode:Bu(Bee(u,e),r,cf),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:s,interactive:o,style:a}),t)}function Bee(e,t){const n={enter:{},update:{}};return Ct(n,{orient:e("orient"),offset:e("offset")||0,position:ui(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function $R(e,t,n){const i=Y(e.signals),r=Y(e.scales);return n||i.forEach(s=>iR(s,t)),Y(e.projections).forEach(s=>bZ(s,t)),r.forEach(s=>oZ(s,t)),Y(e.data).forEach(s=>wee(s,t)),r.forEach(s=>aZ(s,t)),(n||i).forEach(s=>IQ(s,t)),Y(e.axes).forEach(s=>Iee(s,t)),Y(e.marks).forEach(s=>_g(s,t)),Y(e.legends).forEach(s=>lee(s,t)),e.title&&mee(e.title,t),t.parseLambdas(),t}const Uee=e=>Bu({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function jee(e,t){const n=t.config,i=ie(t.root=t.add(Yh())),r=qee(e,n);r.forEach(l=>iR(l,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const s=t.add($i()),o=t.add(oR(nR(Uee(e.encode),wg,F2,e.style,t,{pulse:ie(s)}))),a=t.add(lR({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:ie(o)}));t.operators.pop(),t.pushState(ie(o),ie(a),null),$R(e,t,r),t.operators.push(a);let u=t.add(sR({mark:i,pulse:ie(a)}));return u=t.add(uR({pulse:ie(u)})),u=t.add(ra({pulse:ie(u)})),t.addData("root",new jo(t,s,s,u)),t}function ml(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function qee(e,t){const n=o=>ui(e[o],t[o]),i=[ml("background",n("background")),ml("autosize",JJ(n("autosize"))),ml("padding",ZJ(n("padding"))),ml("width",n("width")||0),ml("height",n("height")||0)],r=i.reduce((o,a)=>(o[a.name]=a,o),{}),s={};return Y(e.signals).forEach(o=>{J(r,o.name)?o=ce(r[o.name],o):i.push(o),s[o.name]=o}),Y(t.signals).forEach(o=>{!J(s,o.name)&&!J(r,o.name)&&i.push(o)}),i}function AR(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function Y$(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}AR.prototype=Y$.prototype={parse(e){return $R(e,this)},fork(){return new Y$(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof gy?ie(e):e;return this.add(eZ({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,s){let o,a;i&&(o=i.data||(i.data={}),a=o[r]||(o[r]=[]),a.push(s))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(ie(this.add(ra({pulse:e})))),this._parent.push(t),this._lookup.push(n?ie(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return xe(this._parent)},encode(){return xe(this._encode)},lookup(){return xe(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(K(e))return $c(e,t);e.signal||N("Unsupported field reference: "+H(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=ie(this.add(WQ(r)))}return i},compareRef(e){let t=!1;const n=s=>at(s)?(t=!0,this.signalRef(s.signal)):FQ(s)?(t=!0,this.exprRef(s.expr)):s,i=Y(e.field).map(n),r=Y(e.order).map(n);return t?ie(this.add(N$({fields:i,orders:r}))):O$(i,r)},keyRef(e,t){let n=!1;const i=s=>at(s)?(n=!0,ie(r[s.signal])):s,r=this.signals;return e=Y(e).map(i),n?ie(this.add(HQ({fields:e,flat:t}))):$Q(e,t)},sortRef(e){if(!e)return e;const t=vg(e.op,e.field),n=e.order||AQ;return n.signal?ie(this.add(N$({fields:t,orders:this.signalRef(n.signal)}))):O$(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return J(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&N("Duplicate signal name: "+H(e));const n=t instanceof gy?t:this.add(Yh(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||N("Unrecognized signal name: "+H(e)),this.signals[e]},signalRef(e){return this.signals[e]?ie(this.signals[e]):(J(this.lambdas,e)||(this.lambdas[e]=this.add(Yh(null))),ie(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t<n;++t){const i=e[t],r=nr(i,this),s=this.lambdas[i];s.params=r.$params,s.update=r.$expr}},property(e){return e&&e.signal?this.signalRef(e.signal):e},objectProperty(e){return!e||!X(e)?e:this.signalRef(e.signal||j2(e))},exprRef(e,t){const n={expr:nr(e,this)};return t&&(n.expr.$name=t),ie(this.add(jQ(n)))},addBinding(e,t){this.bindings||N("Nested signals do not support binding: "+H(e)),this.bindings.push(ce({signal:e},t))},addScaleProj(e,t){J(this.scales,e)&&N("Duplicate scale or projection name: "+H(e)),this.scales[e]=this.add(t)},addScale(e,t){this.addScaleProj(e,nZ(t))},addProjection(e,t){this.addScaleProj(e,ZQ(t))},getScale(e){return this.scales[e]||N("Unrecognized scale name: "+H(e)),this.scales[e]},scaleRef(e){return ie(this.getScale(e))},scaleType(e){return this.getScale(e).params.type},projectionRef(e){return this.scaleRef(e)},projectionType(e){return this.scaleType(e)},addData(e,t){return J(this.data,e)&&N("Duplicate data set name: "+H(e)),this.data[e]=t},getData(e){return this.data[e]||N("Undefined data set name: "+H(e)),this.data[e]},addDataPipeline(e,t){return J(this.data,e)&&N("Duplicate data set name: "+H(e)),this.addData(e,jo.fromEntries(this,t))}};function j2(e){return(L(e)?Wee:Hee)(e)}function Wee(e){const t=e.length;let n="[";for(let i=0;i<t;++i){const r=e[i];n+=(i>0?",":"")+(X(r)?r.signal||j2(r):H(r))}return n+"]"}function Hee(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+H(i)+":"+(X(r)?r.signal||j2(r):H(r));return t+"}"}function Gee(){const e="sans-serif",i="#4c78a8",r="#000",s="#888",o="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:o},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:s,grid:!1,gridWidth:1,gridColor:o,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:s,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:o,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:s,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function Vee(e,t,n){return X(e)||N("Input Vega specification must be an object."),t=Fu(Gee(),t,e.config),jee(e,new AR(t,n)).toRuntime()}var Xee="5.30.0";ce(Qa,b9,_j,nq,UW,MH,rV,PG,oV,TV,BV,VV);const Yee=Object.freeze(Object.defineProperty({__proto__:null,Bounds:nt,CanvasHandler:Zc,CanvasRenderer:dh,DATE:yn,DAY:Lt,DAYOFYEAR:er,Dataflow:za,Debug:Vk,Error:rb,EventStream:Tp,Gradient:yM,GroupItem:Kp,HOURS:Nn,Handler:fx,HybridHandler:uD,HybridRenderer:_1,Info:Gk,Item:Yp,MILLISECONDS:bi,MINUTES:Ln,MONTH:Ut,Marks:Pn,MultiPulse:kb,None:Hk,Operator:ze,Parameters:Fp,Pulse:Ss,QUARTER:mn,RenderType:gs,Renderer:Qc,ResourceLoader:_M,SECONDS:Kn,SVGHandler:YM,SVGRenderer:yx,SVGStringRenderer:aD,Scenegraph:UM,TIME_UNITS:yb,Transform:D,View:WO,WEEK:st,Warn:sb,YEAR:At,accessor:En,accessorFields:Bt,accessorName:Je,array:Y,ascending:vp,bandwidthNRD:Mb,bin:wF,bootstrapCI:EF,boundClip:bD,boundContext:Xc,boundItem:v1,boundMark:PM,boundStroke:Hr,changeset:ta,clampRange:rC,codegenExpression:yO,compare:cb,constant:Ht,cumulativeLogNormal:Pb,cumulativeNormal:Dp,cumulativeUniform:Ub,dayofyear:CC,debounce:fb,defaultLocale:Eb,definition:bF,densityLogNormal:Lb,densityNormal:Db,densityUniform:Bb,domChild:rt,domClear:Un,domCreate:hs,domFind:cx,dotbin:SF,error:N,expressionFunction:tt,extend:ce,extent:Ji,extentIndex:sC,falsy:ns,fastmap:Mu,field:Yn,flush:oC,font:tg,fontFamily:Jc,fontSize:ur,format:dd,formatLocale:Gd,formats:$b,hasOwnProperty:J,id:Lc,identity:Wt,inferType:aF,inferTypes:uF,ingest:Ce,inherits:G,inrange:Da,interpolate:Uv,interpolateColors:Vp,interpolateRange:iM,intersect:pD,intersectBoxLine:Oa,intersectPath:Yv,intersectPoint:Kv,intersectRule:AM,isArray:L,isBoolean:js,isDate:ws,isFunction:fe,isIterable:aC,isNumber:$e,isObject:X,isRegExp:uC,isString:K,isTuple:kp,key:db,lerp:lC,lineHeight:Ts,loader:$p,locale:sF,logger:ob,lruCache:cC,markup:mx,merge:fC,mergeConfig:Fu,multiLineOffset:ax,one:Cu,pad:dC,panLinear:Qk,panLog:Zk,panPow:eC,panSymlog:tC,parse:Vee,parseExpression:g2,parseSelector:Hs,path:Pp,pathCurves:Gv,pathEqual:vD,pathParse:iu,pathRectangle:xM,pathRender:pc,pathSymbols:vM,pathTrail:wM,peek:xe,point:ig,projection:Lx,quantileLogNormal:zb,quantileNormal:Op,quantileUniform:jb,quantiles:Fb,quantizeInterpolator:rM,quarter:nC,quartiles:Tb,get random(){return Jn},randomInteger:E4,randomKDE:Rb,randomLCG:w4,randomLogNormal:$F,randomMixture:AF,randomNormal:Ob,randomUniform:kF,read:fF,regressionConstant:qb,regressionExp:FF,regressionLinear:Wb,regressionLoess:DF,regressionLog:CF,regressionPoly:MF,regressionPow:TF,regressionQuad:Hb,renderModule:rg,repeat:Sl,resetDefaultLocale:bI,resetSVGClipId:SM,resetSVGDefIds:jU,responseType:cF,runtimeContext:MO,sampleCurve:Np,sampleLogNormal:Nb,sampleNormal:Mp,sampleUniform:Ib,scale:ke,sceneEqual:bx,sceneFromJSON:IM,scenePickVisit:rh,sceneToJSON:zM,sceneVisit:vi,sceneZOrder:Jv,scheme:jv,serializeXML:iD,setHybridRendererOptions:zU,setRandom:v4,span:Pc,splitAccessPath:or,stringValue:H,textMetrics:Mn,timeBin:HC,timeFloor:NC,timeFormatLocale:cc,timeInterval:Ru,timeOffset:zC,timeSequence:UC,timeUnitSpecifier:kC,timeUnits:bb,toBoolean:hb,toDate:pb,toNumber:zt,toSet:yi,toString:gb,transform:vF,transforms:Qa,truncate:hC,truthy:Rn,tupleid:re,typeParsers:o1,utcFloor:LC,utcInterval:Nu,utcOffset:IC,utcSequence:jC,utcdayofyear:MC,utcquarter:iC,utcweek:DC,version:Xee,visitArray:ss,week:FC,writeConfig:Tu,zero:cs,zoomLinear:ab,zoomLog:ub,zoomPow:jd,zoomSymlog:lb},Symbol.toStringTag,{value:"Module"}));function Kee(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var Jee={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},Qee={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<<t,">>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},Zee={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const ete=Array.prototype.slice,ro=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,ete.call(t,1))},tte=(e,t,n,i,r,s,o)=>new Date(e,t||0,n??1,i||0,r||0,s||0,o||0);var nte={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:tte,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return ro("join",arguments)},indexof:function(){return ro("indexOf",arguments)},lastindexof:function(){return ro("lastIndexOf",arguments)},slice:function(){return ro("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return ro("substring",arguments,String)},split:function(){return ro("split",arguments,String)},replace:function(){return ro("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const ite=["view","item","group","xy","x","y"],Ey=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&Ey.add(setImmediate);const rte={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:Jee[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),Ey.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||nte[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>Qee[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>Zee[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,Ey.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function yl(e,t,n,i,r,s){const o=a=>rte[a.type](o,a);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=i,o.event=r,o.item=s,ite.forEach(a=>o.fn[a]=function(){return r.vega[a](...arguments)}),o(e)}var kR={operator(e,t){const n=t.ast,i=e.functions;return r=>yl(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>yl(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>yl(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,s)=>{const o=s.item&&s.item.datum;return yl(n,i,r,o,s)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,s=n==="group"||n==="image"||n==="rect";return(o,a)=>{const u=o.datum;let l=0,c;for(const f in i)c=yl(i[f].ast,r,a,u,void 0,o),o[f]!==c&&(o[f]=c,l=1);return n!=="rule"&&Kee(o,i,s),l}}};const ste="vega-lite",ote='Dominik Moritz, Kanit "Ham" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer',ate="5.21.0",ute=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (https://www.domoritz.de)","Arvind Satyanarayan (https://arvindsatya.com)","Jeffrey Heer (https://jheer.org)"],lte="https://vega.github.io/vega-lite/",cte="Vega-Lite is a concise high-level language for interactive visualization.",fte=["vega","chart","visualization"],dte="build/vega-lite.js",hte="build/vega-lite.min.js",pte="build/vega-lite.min.js",gte="build/src/index",mte="build/src/index.d.ts",yte={vl2pdf:"./bin/vl2pdf",vl2png:"./bin/vl2png",vl2svg:"./bin/vl2svg",vl2vg:"./bin/vl2vg"},bte=["bin","build","src","vega-lite*","tsconfig.json"],vte={changelog:"conventional-changelog -p angular -r 2",prebuild:"yarn clean:build",build:"yarn build:only","build:only":"tsc -p tsconfig.build.json && rollup -c","prebuild:examples":"yarn build:only","build:examples":"yarn data && TZ=America/Los_Angeles scripts/build-examples.sh","prebuild:examples-full":"yarn build:only","build:examples-full":"TZ=America/Los_Angeles scripts/build-examples.sh 1","build:example":"TZ=America/Los_Angeles scripts/build-example.sh","build:toc":"yarn build:jekyll && scripts/generate-toc","build:site":"rollup -c site/rollup.config.mjs","build:jekyll":"pushd site && bundle exec jekyll build -q && popd","build:versions":"scripts/update-version.sh",clean:"yarn clean:build && del-cli 'site/data/*' 'examples/compiled/*.png' && find site/examples ! -name 'index.md' ! -name 'data' -type f -delete","clean:build":"del-cli 'build/*' !build/vega-lite-schema.json",data:"rsync -r node_modules/vega-datasets/data/* site/data","build-editor-preview":"scripts/build-editor-preview.sh",schema:"mkdir -p build && ts-json-schema-generator -f tsconfig.json -p src/index.ts -t TopLevelSpec --no-type-check --no-ref-encode > build/vega-lite-schema.json && yarn renameschema && cp build/vega-lite-schema.json site/_data/",renameschema:"scripts/rename-schema.sh",presite:"yarn data && yarn schema && yarn build:site && yarn build:versions && scripts/create-example-pages.sh",site:"yarn site:only","site:only":"pushd site && bundle exec jekyll serve -I -l && popd",prettierbase:"prettier '**/*.{md,css,yml}'",format:"eslint . --fix && yarn prettierbase --write",lint:"eslint . && yarn prettierbase --check",test:"yarn jest test/ && yarn lint && yarn schema && yarn jest examples/ && yarn test:runtime","test:cover":"yarn jest --collectCoverage test/","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand test","test:runtime":"TZ=America/Los_Angeles npx jest test-runtime/ --config test-runtime/jest-config.json","test:runtime:generate":"yarn build:only && del-cli test-runtime/resources && VL_GENERATE_TESTS=true yarn test:runtime",watch:"tsc -p tsconfig.build.json -w","watch:site":"yarn build:site -w","watch:test":"yarn jest --watch test/","watch:test:runtime":"TZ=America/Los_Angeles npx jest --watch test-runtime/ --config test-runtime/jest-config.json",release:"release-it"},xte={type:"git",url:"https://github.com/vega/vega-lite.git"},wte="BSD-3-Clause",Ete={url:"https://github.com/vega/vega-lite/issues"},Ste={"@babel/core":"^7.24.9","@babel/preset-env":"^7.25.0","@babel/preset-typescript":"^7.24.7","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-alias":"^5.1.0","@rollup/plugin-babel":"^6.0.4","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@types/d3":"^7.4.3","@types/jest":"^29.5.12","@types/pako":"^2.0.3","@typescript-eslint/eslint-plugin":"^7.17.0","@typescript-eslint/parser":"^7.17.0",ajv:"^8.17.1","ajv-formats":"^3.0.1",cheerio:"^1.0.0-rc.12","conventional-changelog-cli":"^5.0.0",d3:"^7.9.0","del-cli":"^5.1.0",eslint:"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-jest":"^27.9.0","eslint-plugin-prettier":"^5.2.1","fast-json-stable-stringify":"~2.1.0","highlight.js":"^11.10.0",jest:"^29.7.0","jest-dev-server":"^10.0.0",mkdirp:"^3.0.1",pako:"^2.1.0",prettier:"^3.3.3",puppeteer:"^15.0.0","release-it":"17.6.0",rollup:"^4.19.1","rollup-plugin-bundle-size":"^1.0.3",serve:"^14.2.3",terser:"^5.31.3","ts-jest":"^29.2.3","ts-json-schema-generator":"^2.3.0",typescript:"~5.5.4","vega-cli":"^5.28.0","vega-datasets":"^2.8.1","vega-embed":"^6.26.0","vega-tooltip":"^0.34.0","yaml-front-matter":"^4.1.1"},_te={"json-stringify-pretty-compact":"~3.0.0",tslib:"~2.6.3","vega-event-selector":"~3.0.1","vega-expression":"~5.1.1","vega-util":"~1.17.2",yargs:"~17.7.2"},$te={vega:"^5.24.0"},Ate={node:">=18"},kte="yarn@1.22.19",Cte={name:ste,author:ote,version:ate,collaborators:ute,homepage:lte,description:cte,keywords:fte,main:dte,unpkg:hte,jsdelivr:pte,module:gte,types:mte,bin:yte,files:bte,scripts:vte,repository:xte,license:wte,bugs:Ete,devDependencies:Ste,dependencies:_te,peerDependencies:$te,engines:Ate,packageManager:kte};function q2(e){return B(e,"or")}function W2(e){return B(e,"and")}function H2(e){return B(e,"not")}function Ld(e,t){if(H2(e))Ld(e.not,t);else if(W2(e))for(const n of e.and)Ld(n,t);else if(q2(e))for(const n of e.or)Ld(n,t);else t(e)}function ja(e,t){return H2(e)?{not:ja(e.not,t)}:W2(e)?{and:e.and.map(n=>ja(n,t))}:q2(e)?{or:e.or.map(n=>ja(n,t))}:t(e)}const ue=structuredClone;function CR(e){throw new Error(e)}function fu(e,t){const n={};for(const i of t)J(e,i)&&(n[i]=e[i]);return n}function pn(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>Ne(e)).join(",")})`};function be(e){if($e(e))return e;const t=K(e)?e:Ne(e);if(t.length<250)return t;let n=0;for(let i=0;i<t.length;i++){const r=t.charCodeAt(i);n=(n<<5)-n+r,n=n&n}return n}function Sy(e){return e===!1||e===null}function ye(e,t){return e.includes(t)}function du(e,t){let n=0;for(const[i,r]of e.entries())if(t(r,i,n++))return!0;return!1}function G2(e,t){let n=0;for(const[i,r]of e.entries())if(!t(r,i,n++))return!1;return!0}function FR(e,...t){for(const n of t)Fte(e,n??{});return e}function Fte(e,t){for(const n of I(t))Tu(e,n,t[n],!0)}function Hi(e,t){const n=[],i={};let r;for(const s of e)r=t(s),!(r in i)&&(i[r]=1,n.push(s));return n}function Tte(e,t){const n=I(e),i=I(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function TR(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function V2(e,t){for(const n of e)if(t.has(n))return!0;return!1}function _y(e){const t=new Set;for(const n of e){const r=or(n).map((o,a)=>a===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function X2(e,t){return e===void 0||t===void 0?!0:V2(_y(e),_y(t))}function Re(e){return I(e).length===0}const I=Object.keys,kt=Object.values,Rs=Object.entries;function Cc(e){return e===!0||e===!1}function qe(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function nc(e,t){return H2(e)?`!(${nc(e.not,t)})`:W2(e)?`(${e.and.map(n=>nc(n,t)).join(") && (")})`:q2(e)?`(${e.or.map(n=>nc(n,t)).join(") || (")})`:t(e)}function Kh(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&Kh(e[n],t)&&delete e[n],Re(e)}function ff(e){return e.charAt(0).toUpperCase()+e.substr(1)}function Y2(e,t="datum"){const n=or(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(H).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function MR(e,t="datum"){return`${t}[${H(or(e).join("."))}]`}function Mte(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function Zn(e){return`${or(e).map(Mte).join("\\.")}`}function qo(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function qu(e){return`${or(e).join(".")}`}function hu(e){return e?or(e).length:0}function Ze(...e){return e.find(t=>t!==void 0)}let DR=42;function OR(e){const t=++DR;return e?String(e)+t:t}function Dte(){DR=42}function RR(e){return NR(e)?e:`__${e}`}function NR(e){return e.startsWith("__")}function Fc(e){if(e!==void 0)return(e%360+360)%360}function Ag(e){return $e(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const K$=Object.getPrototypeOf(structuredClone({}));function Tn(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!Tn(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;for(const s of e.entries())if(!Tn(s[1],t.get(s[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==K$.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==K$.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!Tn(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ne(e){const t=[];return function n(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let r,s;if(Array.isArray(i)){for(s="[",r=0;r<i.length;r++)r&&(s+=","),s+=n(i[r])||"null";return s+"]"}if(i===null)return"null";if(t.includes(i))throw new TypeError("Converting circular structure to JSON");const o=t.push(i)-1,a=Object.keys(i).sort();for(s="",r=0;r<a.length;r++){const u=a[r],l=n(i[u]);l&&(s&&(s+=","),s+=JSON.stringify(u)+":"+l)}return t.splice(o,1),`{${s}}`}(e)}function B(e,t){return X(e)&&J(e,t)&&e[t]!==void 0}const Nr="row",Lr="column",kg="facet",We="x",bt="y",ki="x2",dr="y2",Gs="xOffset",Wu="yOffset",Ci="radius",Vr="radius2",ni="theta",Xr="theta2",Fi="latitude",Ti="longitude",Mi="latitude2",ei="longitude2",vn="color",hr="fill",pr="stroke",xn="shape",Yr="size",oa="angle",Kr="opacity",Vs="fillOpacity",Xs="strokeOpacity",Ys="strokeWidth",Ks="strokeDash",df="text",pu="order",hf="detail",Cg="key",Wo="tooltip",Fg="href",Tg="url",Mg="description",Ote={x:1,y:1,x2:1,y2:1},LR={theta:1,theta2:1,radius:1,radius2:1};function PR(e){return J(LR,e)}const K2={longitude:1,longitude2:1,latitude:1,latitude2:1};function zR(e){switch(e){case Fi:return"y";case Mi:return"y2";case Ti:return"x";case ei:return"x2"}}function IR(e){return J(K2,e)}const Rte=I(K2),J2={...Ote,...LR,...K2,xOffset:1,yOffset:1,color:1,fill:1,stroke:1,opacity:1,fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeDash:1,size:1,angle:1,shape:1,order:1,text:1,detail:1,key:1,tooltip:1,href:1,url:1,description:1};function qa(e){return e===vn||e===hr||e===pr}const BR={row:1,column:1,facet:1},Gn=I(BR),Q2={...J2,...BR},Nte=I(Q2),{order:Gde,detail:Vde,tooltip:Xde,...Lte}=Q2,{row:Yde,column:Kde,facet:Jde,...Pte}=Lte;function zte(e){return J(Pte,e)}function UR(e){return J(Q2,e)}const Ite=[ki,dr,Mi,ei,Xr,Vr];function jR(e){return aa(e)!==e}function aa(e){switch(e){case ki:return We;case dr:return bt;case Mi:return Fi;case ei:return Ti;case Xr:return ni;case Vr:return Ci}return e}function Ns(e){if(PR(e))switch(e){case ni:return"startAngle";case Xr:return"endAngle";case Ci:return"outerRadius";case Vr:return"innerRadius"}return e}function gr(e){switch(e){case We:return ki;case bt:return dr;case Fi:return Mi;case Ti:return ei;case ni:return Xr;case Ci:return Vr}}function wn(e){switch(e){case We:case ki:return"width";case bt:case dr:return"height"}}function qR(e){switch(e){case We:return"xOffset";case bt:return"yOffset";case ki:return"x2Offset";case dr:return"y2Offset";case ni:return"thetaOffset";case Ci:return"radiusOffset";case Xr:return"theta2Offset";case Vr:return"radius2Offset"}}function Z2(e){switch(e){case We:return"xOffset";case bt:return"yOffset"}}function Bte(e){switch(e){case"xOffset":return"x";case"yOffset":return"y"}}const Ute=I(J2),{x:Qde,y:Zde,x2:ehe,y2:the,xOffset:nhe,yOffset:ihe,latitude:rhe,longitude:she,latitude2:ohe,longitude2:ahe,theta:uhe,theta2:lhe,radius:che,radius2:fhe,...ew}=J2,jte=I(ew),tw={x:1,y:1},Jr=I(tw);function et(e){return J(tw,e)}const nw={theta:1,radius:1},qte=I(nw);function Dg(e){return e==="width"?We:bt}const WR={xOffset:1,yOffset:1};function pf(e){return J(WR,e)}const{text:dhe,tooltip:hhe,href:phe,url:ghe,description:mhe,detail:yhe,key:bhe,order:vhe,...HR}=ew,Wte=I(HR);function Hte(e){return J(ew,e)}function Gte(e){switch(e){case vn:case hr:case pr:case Yr:case xn:case Kr:case Ys:case Ks:return!0;case Vs:case Xs:case oa:return!1}}const GR={...tw,...nw,...WR,...HR},iw=I(GR);function mr(e){return J(GR,e)}function Vte(e,t){return Yte(e)[t]}const VR={arc:"always",area:"always",bar:"always",circle:"always",geoshape:"always",image:"always",line:"always",rule:"always",point:"always",rect:"always",square:"always",trail:"always",text:"always",tick:"always"},{geoshape:xhe,...Xte}=VR;function Yte(e){switch(e){case vn:case hr:case pr:case Mg:case hf:case Cg:case Wo:case Fg:case pu:case Kr:case Vs:case Xs:case Ys:case kg:case Nr:case Lr:return VR;case We:case bt:case Gs:case Wu:case Fi:case Ti:return Xte;case ki:case dr:case Mi:case ei:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case Yr:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Ks:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case xn:return{point:"always",geoshape:"always"};case df:return{text:"always"};case oa:return{point:"always",square:"always",text:"always"};case Tg:return{image:"always"};case ni:return{text:"always",arc:"always"};case Ci:return{text:"always",arc:"always"};case Xr:case Vr:return{arc:"always"}}}function E0(e){switch(e){case We:case bt:case ni:case Ci:case Gs:case Wu:case Yr:case oa:case Ys:case Kr:case Vs:case Xs:case ki:case dr:case Xr:case Vr:return;case kg:case Nr:case Lr:case xn:case Ks:case df:case Wo:case Fg:case Tg:case Mg:return"discrete";case vn:case hr:case pr:return"flexible";case Fi:case Ti:case Mi:case ei:case hf:case Cg:case pu:return}}const Kte={argmax:1,argmin:1,average:1,count:1,distinct:1,exponential:1,exponentialb:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},Jte={count:1,min:1,max:1};function qr(e){return B(e,"argmin")}function Js(e){return B(e,"argmax")}function rw(e){return K(e)&&J(Kte,e)}const Qte=new Set(["count","valid","missing","distinct"]);function Og(e){return K(e)&&Qte.has(e)}function Zte(e){return K(e)&&ye(["min","max"],e)}const ene=new Set(["count","sum","distinct","valid","missing"]),tne=new Set(["mean","average","median","q1","q3","min","max"]);function XR(e){return js(e)&&(e=Hg(e,void 0)),"bin"+I(e).map(t=>Rg(e[t])?qe(`_${t}_${Rs(e[t])}`):qe(`_${t}_${e[t]}`)).join("")}function Ie(e){return e===!0||ua(e)&&!e.binned}function xt(e){return e==="binned"||ua(e)&&e.binned===!0}function ua(e){return X(e)}function Rg(e){return B(e,"param")}function J$(e){switch(e){case Nr:case Lr:case Yr:case vn:case hr:case pr:case Ys:case Kr:case Vs:case Xs:case xn:return 6;case Ks:return 4;default:return 10}}function gf(e){return B(e,"expr")}function wt(e,{level:t}={level:0}){const n=I(e||{}),i={};for(const r of n)i[r]=t===0?kn(e[r]):wt(e[r],{level:t-1});return i}function YR(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:u,subtitleFont:l,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},v=fu(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function ls(e){return K(e)||L(e)&&K(e[0])}function ee(e){return B(e,"signal")}function la(e){return B(e,"step")}function nne(e){return L(e)?!1:B(e,"fields")&&!B(e,"data")}function ine(e){return L(e)?!1:B(e,"fields")&&B(e,"data")}function Dr(e){return L(e)?!1:B(e,"field")&&B(e,"data")}const rne={aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1},sne=I(rne),one={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},$y=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function KR(e){const t=L(e.condition)?e.condition.map(Q$):Q$(e.condition);return{...kn(e),condition:t}}function kn(e){if(gf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Q$(e){if(gf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Ue(e){if(gf(e)){const{expr:t,...n}=e;return{signal:t,...n}}return ee(e)?e:e!==void 0?{value:e}:void 0}function ane(e){return ee(e)?e.signal:H(e)}function Z$(e){return ee(e)?e.signal:H(e.value)}function hi(e){return ee(e)?e.signal:e==null?null:H(e)}function une(e,t,n){for(const i of n){const r=ir(i,t.markDef,t.config);r!==void 0&&(e[i]=Ue(r))}return e}function JR(e){return[].concat(e.type,e.style??[])}function Oe(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&B(t,r)?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:ir(e,t,n,i)}function ir(e,t,n,{vgChannel:i}={}){const r=Ay(e,t,n.style);return Ze(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Ay(e,t,n){return QR(e,JR(t),n)}function QR(e,t,n){t=Y(t);let i;for(const r of t){const s=n[r];B(s,e)&&(i=s[e])}return i}function ZR(e,t){return Y(e).reduce((n,i)=>(n.field.push(V(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function eN(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Tn(r,i))return;n.push(i)}),n}function tN(e,t){return Tn(e,t)||!t?e:e?[...Y(e),...Y(t)].join(", "):t}function nN(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((ls(n)||ee(n))&&(ls(i)||ee(i)))return{explicit:e.explicit,value:tN(n,i)};if(ls(n)||ee(n))return{explicit:e.explicit,value:n};if(ls(i)||ee(i))return{explicit:e.explicit,value:i};if(!ls(n)&&!ee(n)&&!ls(i)&&!ee(i))return{explicit:e.explicit,value:eN(n,i)};throw new Error("It should never reach here")}function sw(e){return`Invalid specification ${Ne(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const lne='Autosize "fit" only works for single views and layered views.';function eA(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function tA(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function nA(e){return e?`Dropping "fit-${e}" because spec has discrete ${wn(e)}.`:'Dropping "fit" because spec has discrete size.'}function ow(e){return`Unknown field for ${e}. Cannot calculate view size.`}function iA(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function cne(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function fne(e){return`The "nearest" transform is not supported for ${e} marks.`}function iN(e){return`Selection not supported for ${e} yet.`}function dne(e){return`Cannot find a selection named "${e}".`}const hne="Scale bindings are currently only supported for scales with unbinned, continuous domains.",pne="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",gne="Legend bindings are only supported for selections over an individual field or encoding channel.";function mne(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function yne(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const bne="The same selection must be used to override scale domains in a layered view.",vne='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function xne(e){return`Unknown repeated value "${e}".`}function rA(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const wne="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function Ene(e){return`Unrecognized parse "${e}".`}function sA(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Sne="Attempt to add the same child twice.";function _ne(e){return`Ignoring an invalid transform: ${Ne(e)}.`}const $ne='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function oA(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Ane(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${Ne(t)} is overridden by a child projection ${Ne(n)}.`}const kne="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Cne(e){return`${e}Offset dropped because ${e} is continuous`}function Fne(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${Ne(n)}}.`}function rN(e){return`Invalid field type "${e}".`}function Tne(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Mne(e){return`Invalid aggregation operator "${e}".`}function sN(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function Dne(e){return`Position range does not support relative band size for ${e}.`}function ky(e,t){return`Dropping ${Ne(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const One="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function Ng(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function Rne(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Nne(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Lne(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Pne(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function S0(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function zne(e){return`The ${e} for range marks cannot be an expression`}function Ine(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Bne(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Une(e){return`Cannot use the scale property "${e}" with non-color channel.`}function jne(e){return`Cannot use the relative band size with ${e} scale.`}function qne(e){return`Using unaggregated domain with raw field has no effect (${Ne(e)}).`}function Wne(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Hne(e){return`Unaggregated domain is currently unsupported for log scale (${Ne(e)}).`}function Gne(e){return`Cannot apply size to non-oriented mark "${e}".`}function Vne(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Xne(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function oN(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function aN(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Yne(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Ne(n)} and ${Ne(i)}). Using ${Ne(n)}.`}function Kne(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${Ne(n)} and ${Ne(i)}). Using the union of the two domains.`}function Jne(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function Qne(e){return`Dropping sort property ${Ne(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const aA="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Zne="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",eie="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",tie="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function nie(e){return`Cannot stack "${e}" if there is already "${e}2".`}function iie(e){return`Stack is applied to a non-linear scale (${e}).`}function rie(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function Jh(e,t){return`Invalid ${e}: ${Ne(t)}.`}function sie(e){return`Dropping day from datetime ${Ne(e)} as day cannot be combined with other units.`}function oie(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function aie(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function uie(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function uA(e){return`1D error band does not support ${e}.`}function uN(e){return`Channel ${e} is required for "binned" bin.`}function lie(e){return`Channel ${e} should not be used with "binned" bin.`}function cie(e){return`Domain for ${e} is required for threshold scale.`}const lN=ob(sb);let gu=lN;function fie(e){return gu=e,gu}function die(){return gu=lN,gu}function j(...e){gu.warn(...e)}function hie(...e){gu.debug(...e)}function ca(e){if(e&&X(e)){for(const t of uw)if(B(e,t))return!0}return!1}const cN=["january","february","march","april","may","june","july","august","september","october","november","december"],pie=cN.map(e=>e.substr(0,3)),fN=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],gie=fN.map(e=>e.substr(0,3));function mie(e){if(Ag(e)&&(e=+e),$e(e))return e>4&&j(Jh("quarter",e)),e-1;throw new Error(Jh("quarter",e))}function yie(e){if(Ag(e)&&(e=+e),$e(e))return e-1;{const t=e.toLowerCase(),n=cN.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=pie.indexOf(i);if(r!==-1)return r;throw new Error(Jh("month",e))}}function bie(e){if(Ag(e)&&(e=+e),$e(e))return e%7;{const t=e.toLowerCase(),n=fN.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=gie.indexOf(i);if(r!==-1)return r;throw new Error(Jh("day",e))}}function aw(e,t){const n=[];if(t&&e.day!==void 0&&I(e).length>1&&(j(sie(e)),e=ue(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?yie(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?mie(e.quarter):e.quarter;n.push($e(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?bie(e.day):e.day;n.push($e(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function Ho(e){const n=aw(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function vie(e){const n=aw(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function xie(e){const t=aw(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const dN={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},uw=I(dN);function wie(e){return J(dN,e)}function fa(e){return X(e)?e.binned:hN(e)}function hN(e){return e&&e.startsWith("binned")}function lw(e){return e.startsWith("utc")}function Eie(e){return e.substring(3)}const Sie={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function Lg(e){return uw.filter(t=>gN(e,t))}function pN(e){const t=Lg(e);return t[t.length-1]}function gN(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function _ie(e,t,{end:n}={end:!1}){const i=Y2(t),r=lw(e)?"utc":"";function s(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let o;const a={};for(const u of uw)gN(e,u)&&(a[u]=s(u),o=u);return n&&(a[o]+="+1"),vie(a)}function mN(e){if(!e)return;const t=Lg(e);return`timeUnitSpecifier(${Ne(t)}, ${Ne(Sie)})`}function $ie(e,t,n){if(!e)return;const i=mN(e);return`${n||lw(e)?"utc":"time"}Format(${t}, ${i})`}function gt(e){if(!e)return;let t;return K(e)?hN(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:X(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),lw(t.unit)&&(t.utc=!0,t.unit=Eie(t.unit)),t}function Aie(e){const{utc:t,...n}=gt(e);return n.unit?(t?"utc":"")+I(n).map(i=>qe(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+I(n).map(i=>qe(`_${i}_${n[i]}`)).join("")}function yN(e,t=n=>n){const n=gt(e),i=pN(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=bN(i,n.step),a={...r,[o]:+r[o]+s};return`${t(Ho(a))} - ${t(Ho(r))}`}}const kie={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function Cie(e){return J(kie,e)}function bN(e,t=1){if(Cie(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function Fie(e){return B(e,"param")}function cw(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function fw(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function dw(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function hw(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function pw(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function gw(e){if(e!=null&&e.field){if(L(e.range)&&e.range.length===2)return!0;if(ee(e.range))return!0}return!1}function mw(e){return!!(e!=null&&e.field)&&(L(e.oneOf)||L(e.in))}function Tie(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function vN(e){return mw(e)||cw(e)||gw(e)||fw(e)||hw(e)||dw(e)||pw(e)}function Li(e,t){return Gg(e,{timeUnit:t,wrapTime:!0})}function Mie(e,t){return e.map(n=>Li(n,t))}function xN(e,t=!0){const{field:n}=e,i=gt(e.timeUnit),{unit:r,binned:s}=i||{},o=V(e,{expr:"datum"}),a=r?`time(${s?o:_ie(r,n)})`:o;if(cw(e))return`${a}===${Li(e.equal,r)}`;if(fw(e)){const u=e.lt;return`${a}<${Li(u,r)}`}else if(hw(e)){const u=e.gt;return`${a}>${Li(u,r)}`}else if(dw(e)){const u=e.lte;return`${a}<=${Li(u,r)}`}else if(pw(e)){const u=e.gte;return`${a}>=${Li(u,r)}`}else{if(mw(e))return`indexof([${Mie(e.oneOf,r).join(",")}], ${a}) !== -1`;if(Tie(e))return Pg(a,e.valid);if(gw(e)){const{range:u}=wt(e),l=ee(u)?{signal:`${u.signal}[0]`}:u[0],c=ee(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return"inrange("+a+", ["+Li(l,r)+", "+Li(c,r)+"])";const f=[];return l!==null&&f.push(`${a} >= ${Li(l,r)}`),c!==null&&f.push(`${a} <= ${Li(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${Ne(e)}`)}function Pg(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function Die(e){return vN(e)&&e.timeUnit?{...e,timeUnit:gt(e.timeUnit)}:e}const mf={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Oie(e){return e==="quantitative"||e==="temporal"}function wN(e){return e==="ordinal"||e==="nominal"}const Go=mf.quantitative,yw=mf.ordinal,mu=mf.temporal,bw=mf.nominal,Hu=mf.geojson;function Rie(e){if(e)switch(e=e.toLowerCase(),e){case"q":case Go:return"quantitative";case"t":case mu:return"temporal";case"o":case yw:return"ordinal";case"n":case bw:return"nominal";case Hu:return"geojson"}}const Et={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",SYMLOG:"symlog",IDENTITY:"identity",SEQUENTIAL:"sequential",TIME:"time",UTC:"utc",QUANTILE:"quantile",QUANTIZE:"quantize",THRESHOLD:"threshold",BIN_ORDINAL:"bin-ordinal",ORDINAL:"ordinal",POINT:"point",BAND:"band"},Cy={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function Nie(e,t){const n=Cy[e],i=Cy[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const Lie={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function lA(e){return Lie[e]}const EN=new Set(["linear","log","pow","sqrt","symlog"]),SN=new Set([...EN,"time","utc"]);function _N(e){return EN.has(e)}const $N=new Set(["quantile","quantize","threshold"]),Pie=new Set([...SN,...$N,"sequential","identity"]),zie=new Set(["ordinal","bin-ordinal","point","band"]);function mt(e){return zie.has(e)}function xi(e){return Pie.has(e)}function Gi(e){return SN.has(e)}function yu(e){return $N.has(e)}const Iie={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0};function Bie(e){return!K(e)&&B(e,"name")}function AN(e){return B(e,"param")}function Uie(e){return B(e,"unionWith")}function jie(e){return X(e)&&"field"in e}const qie={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:whe,domain:Ehe,range:She,rangeMax:_he,rangeMin:$he,scheme:Ahe,...Wie}=qie,Hie=I(Wie);function Fy(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return Gi(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return Gi(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return Gi(e);case"nice":return Gi(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return xi(e)&&!ye(["log","time","utc","threshold","quantile"],e)}}function kN(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return qa(e)?void 0:Une(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function Gie(e,t){return ye([yw,bw],t)?e===void 0||mt(e):t===mu?ye([Et.TIME,Et.UTC,void 0],e):t===Go?_N(e)||yu(e)||e===void 0:!0}function Vie(e,t,n=!1){if(!mr(e))return!1;switch(e){case We:case bt:case Gs:case Wu:case ni:case Ci:return Gi(t)||t==="band"?!0:t==="point"?!n:!1;case Yr:case Ys:case Kr:case Vs:case Xs:case oa:return Gi(t)||yu(t)||ye(["band","point","ordinal"],t);case vn:case hr:case pr:return t!=="band";case Ks:case xn:return t==="ordinal"||yu(t)}}function Xie(e){return X(e)&&"value"in e}const ln={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},CN=ln.arc,zg=ln.area,Ig=ln.bar,Yie=ln.image,Bg=ln.line,Ug=ln.point,Kie=ln.rect,Qh=ln.rule,FN=ln.text,vw=ln.tick,Jie=ln.trail,xw=ln.circle,ww=ln.square,TN=ln.geoshape;function Qs(e){return["line","area","trail"].includes(e)}function Tc(e){return["rect","bar","image","arc","tick"].includes(e)}const Qie=new Set(I(ln));function rr(e){return B(e,"type")}const Zie=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],ere=["fill","fillOpacity"],tre=[...Zie,...ere],nre={color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1},cA=I(nre),_0=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],ire={area:["line","point"],bar:_0,rect:_0,line:["point"],tick:["bandSize","thickness",..._0]},rre={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},sre={mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1},MN=I(sre);function Vo(e){return B(e,"band")}const ore={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},are=5,Ew={binSpacing:0,continuousBandSize:are,minBandSize:.25,timeUnitBandPosition:.5},ure={...Ew,binSpacing:1},lre={...Ew,thickness:1};function cre(e){return rr(e)?e.type:e}function DN(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function Sw({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,u;if(!i||!xi(i)||r)return"always-valid";const s=DN(Oe("invalid",e,t),{isPath:Qs(e.type)});return((u=(a=t.scale)==null?void 0:a.invalid)==null?void 0:u[n])!==void 0?"show":s}function fre(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function ON({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,s=`peek(${i})`,o=t.domainHasZero();return o==="definitely"?{scale:e,value:0}:o==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:s})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:s})`}}function RN({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:s}){var c;const o=n==null?void 0:n.get("type"),a=Ei(t),u=Og(a==null?void 0:a.aggregate),l=Sw({scaleChannel:e,markDef:r,config:s,scaleType:o,isCountAggregate:u});if(a&&l==="show"){const f=((c=s.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:Pg(V(a,{expr:"datum"}),!1),...dre(f,n,i)}}}function dre(e,t,n){if(Xie(e)){const{value:i}=e;return ee(i)?{signal:i.signal}:{value:i}}return ON({scale:t,scaleName:n,mode:"zeroOrMin"})}function _w(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:s,config:o}=e,a=aa(t),u=$w(e),l=RN({scaleChannel:a,channelDef:n,scale:r,scaleName:s,markDef:i,config:o});return l!==void 0?[l,u]:u}function hre(e){const{datum:t}=e;return ca(t)?Ho(t):`${Ne(t)}`}function Fo(e,t,n,i){const r={};if(t&&(r.scale=t),yr(e)){const{datum:s}=e;ca(s)?r.signal=Ho(s):ee(s)?r.signal=s.signal:gf(s)?r.signal=s.expr:r.value=s}else r.field=V(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function Zh({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!ee(o)&&0<o&&o<1?"datum":void 0,u=V(t,{expr:a,suffix:r}),l=n!==void 0?V(n,{expr:a}):V(t,{suffix:s,expr:a}),c={};if(o===0||o===1){c.scale=e;const f=o===0?u:l;c.field=f}else{const f=ee(o)?`(1-${o.signal}) * ${u} + ${o.signal} * ${l}`:`${1-o} * ${u} + ${o} * ${l}`;c.signal=`scale("${e}", ${f})`}return i&&(c.offset=i),c}function pre({scaleName:e,fieldDef:t}){const n=V(t,{expr:"datum"}),i=V(t,{expr:"datum",suffix:"end"});return`abs(scale("${e}", ${i}) - scale("${e}", ${n}))`}function $w({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:u,defaultRef:l,bandPosition:c}){if(t){if(le(t)){const f=o==null?void 0:o.get("type");if(an(t)){c??(c=Ls({fieldDef:t,fieldDef2:n,markDef:i,config:r}));const{bin:d,timeUnit:h,type:p}=t;if(Ie(d)||c&&h&&p===mu)return a!=null&&a.impute?Fo(t,s,{binSuffix:"mid"},{offset:u}):c&&!mt(f)?Zh({scaleName:s,fieldOrDatumDef:t,bandPosition:c,offset:u}):Fo(t,s,wf(t,e)?{binSuffix:"range"}:{},{offset:u});if(xt(d)){if(q(n))return Zh({scaleName:s,fieldOrDatumDef:t,fieldOrDatumDef2:n,bandPosition:c,offset:u});j(uN(e===We?ki:dr))}}return Fo(t,s,mt(f)?{binSuffix:"range"}:{},{offset:u,band:f==="band"?c??t.bandPosition??.5:void 0})}else if(wi(t)){const f=t.value,d=u?{offset:u}:{};return{...ic(e,f),...d}}}return fe(l)&&(l=l()),l&&{...l,...u?{offset:u}:{}}}function ic(e,t){return ye(["x","x2"],e)&&t==="width"?{field:{group:"width"}}:ye(["y","y2"],e)&&t==="height"?{field:{group:"height"}}:Ue(t)}function Xo(e){return e&&e!=="number"&&e!=="time"}function NN(e,t,n){return`${e}(${t}${n?`, ${Ne(n)}`:""})`}const gre=" – ";function Aw({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s}){var u,l;if(Xo(n))return pi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,config:s});const o=LN(e,i,r),a=bu(e);if(t===void 0&&n===void 0&&s.customFormatTypes){if(a==="quantitative"){if(r&&s.normalizedNumberFormatType)return pi({fieldOrDatumDef:e,format:s.normalizedNumberFormat,formatType:s.normalizedNumberFormatType,expr:i,config:s});if(s.numberFormatType)return pi({fieldOrDatumDef:e,format:s.numberFormat,formatType:s.numberFormatType,expr:i,config:s})}if(a==="temporal"&&s.timeFormatType&&q(e)&&e.timeUnit===void 0)return pi({fieldOrDatumDef:e,format:s.timeFormat,formatType:s.timeFormatType,expr:i,config:s})}if(xu(e)){const c=yre({field:o,timeUnit:q(e)?(u=gt(e.timeUnit))==null?void 0:u.unit:void 0,format:t,formatType:s.timeFormatType,rawTimeFormat:s.timeFormat,isUTCScale:da(e)&&((l=e.scale)==null?void 0:l.type)===Et.UTC});return c?{signal:c}:void 0}if(t=Ty({type:a,specifiedFormat:t,config:s,normalizeStack:r}),q(e)&&Ie(e.bin)){const c=V(e,{expr:i,binSuffix:"end"});return{signal:yf(o,c,t,n,s)}}else return t||bu(e)==="quantitative"?{signal:`${IN(o,t)}`}:{signal:`isValid(${o}) ? ${o} : ""+${o}`}}function LN(e,t,n){return q(e)?n?`${V(e,{expr:t,suffix:"end"})}-${V(e,{expr:t,suffix:"start"})}`:V(e,{expr:t}):hre(e)}function pi({fieldOrDatumDef:e,format:t,formatType:n,expr:i,normalizeStack:r,config:s,field:o}){if(o??(o=LN(e,i,r)),o!=="datum.value"&&q(e)&&Ie(e.bin)){const a=V(e,{expr:i,binSuffix:"end"});return{signal:yf(o,a,t,n,s)}}return{signal:NN(n,o,t)}}function PN(e,t,n,i,r,s){var o;if(!(K(i)&&Xo(i))&&!(n===void 0&&i===void 0&&r.customFormatTypes&&bu(e)==="quantitative"&&(r.normalizedNumberFormatType&&vu(e)&&e.stack==="normalize"||r.numberFormatType))){if(vu(e)&&e.stack==="normalize"&&r.normalizedNumberFormat)return Ty({type:"quantitative",config:r,normalizeStack:!0});if(xu(e)){const a=q(e)?(o=gt(e.timeUnit))==null?void 0:o.unit:void 0;return a===void 0&&r.customFormatTypes&&r.timeFormatType?void 0:mre({specifiedFormat:n,timeUnit:a,config:r,omitTimeFormatConfig:s})}return Ty({type:t,specifiedFormat:n,config:r})}}function zN(e,t,n){var i;if(e&&(ee(e)||e==="number"||e==="time"))return e;if(xu(t)&&n!=="time"&&n!=="utc")return q(t)&&((i=gt(t==null?void 0:t.timeUnit))!=null&&i.utc)?"utc":"time"}function Ty({type:e,specifiedFormat:t,config:n,normalizeStack:i}){if(K(t))return t;if(e===Go)return i?n.normalizedNumberFormat:n.numberFormat}function mre({specifiedFormat:e,timeUnit:t,config:n,omitTimeFormatConfig:i}){return e||(t?{signal:mN(t)}:i?void 0:n.timeFormat)}function IN(e,t){return`format(${e}, "${t||""}")`}function fA(e,t,n,i){return Xo(n)?NN(n,e,t):IN(e,(K(t)?t:void 0)??i.numberFormat)}function yf(e,t,n,i,r){if(n===void 0&&i===void 0&&r.customFormatTypes&&r.numberFormatType)return yf(e,t,r.numberFormat,r.numberFormatType,r);const s=fA(e,n,i,r),o=fA(t,n,i,r);return`${Pg(e,!1)} ? "null" : ${s} + "${gre}" + ${o}`}function yre({field:e,timeUnit:t,format:n,formatType:i,rawTimeFormat:r,isUTCScale:s}){return!t||n?!t&&i?`${i}(${e}, '${n}')`:(n=K(n)?n:r,`${s?"utc":"time"}Format(${e}, '${n}')`):$ie(t,e,s)}const jg="min",bre={x:1,y:1,color:1,fill:1,stroke:1,strokeWidth:1,size:1,shape:1,fillOpacity:1,strokeOpacity:1,opacity:1,text:1};function dA(e){return J(bre,e)}function vre(e){return B(e,"encoding")}function Pr(e){return e&&(e.op==="count"||B(e,"field"))}function BN(e){return e&&L(e)}function bf(e){return B(e,"row")||B(e,"column")}function kw(e){return B(e,"header")}function qg(e){return B(e,"facet")}function xre(e){return B(e,"param")}function wre(e){return!K(e)&&B(e,"repeat")}function hA(e){const{field:t,timeUnit:n,bin:i,aggregate:r}=e;return{...n?{timeUnit:n}:{},...i?{bin:i}:{},...r?{aggregate:r}:{},field:t}}function Cw(e){return B(e,"sort")}function Ls({fieldDef:e,fieldDef2:t,markDef:n,config:i}){if(le(e)&&e.bandPosition!==void 0)return e.bandPosition;if(q(e)){const{timeUnit:r,bin:s}=e;if(r&&!t)return ir("timeUnitBandPosition",n,i);if(Ie(s))return .5}}function UN({channel:e,fieldDef:t,fieldDef2:n,markDef:i,config:r,scaleType:s,useVlSizeChannel:o}){var l,c,f;const a=wn(e),u=Oe(o?"size":a,i,r,{vgChannel:a});if(u!==void 0)return u;if(q(t)){const{timeUnit:d,bin:h}=t;if(d&&!n)return{band:ir("timeUnitBandSize",i,r)};if(Ie(h)&&!mt(s))return{band:1}}if(Tc(i.type))return s?mt(s)?((l=r[i.type])==null?void 0:l.discreteBandSize)||{band:1}:(c=r[i.type])==null?void 0:c.continuousBandSize:(f=r[i.type])==null?void 0:f.discreteBandSize}function jN(e,t,n,i){return Ie(e.bin)||e.timeUnit&&an(e)&&e.type==="temporal"?Ls({fieldDef:e,fieldDef2:t,markDef:n,config:i})!==void 0:!1}function qN(e){return B(e,"sort")&&!B(e,"field")}function vf(e){return B(e,"condition")}function Wg(e){const t=e==null?void 0:e.condition;return!!t&&!L(t)&&q(t)}function xf(e){const t=e==null?void 0:e.condition;return!!t&&!L(t)&&le(t)}function Ere(e){const t=e==null?void 0:e.condition;return!!t&&(L(t)||wi(t))}function q(e){return B(e,"field")||(e==null?void 0:e.aggregate)==="count"}function bu(e){return e==null?void 0:e.type}function yr(e){return B(e,"datum")}function xs(e){return an(e)&&!tp(e)||ep(e)}function pA(e){return an(e)&&e.type==="quantitative"&&!e.bin||ep(e)}function ep(e){return yr(e)&&$e(e.datum)}function le(e){return q(e)||yr(e)}function an(e){return e&&(B(e,"field")||e.aggregate==="count")&&B(e,"type")}function wi(e){return B(e,"value")}function da(e){return B(e,"scale")||B(e,"sort")}function vu(e){return B(e,"axis")||B(e,"stack")||B(e,"impute")}function WN(e){return B(e,"legend")}function HN(e){return B(e,"format")||B(e,"formatType")}function Sre(e){return pn(e,["legend","axis","header","scale"])}function _re(e){return B(e,"op")}function V(e,t={}){let n=e.field;const i=t.prefix;let r=t.suffix,s="";if(Are(e))n=RR("count");else{let o;if(!t.nofn)if(_re(e))o=e.op;else{const{bin:a,aggregate:u,timeUnit:l}=e;Ie(a)?(o=XR(a),r=(t.binSuffix??"")+(t.suffix??"")):u?Js(u)?(s=`["${n}"]`,n=`argmax_${u.argmax}`):qr(u)?(s=`["${n}"]`,n=`argmin_${u.argmin}`):o=String(u):l&&!fa(l)&&(o=Aie(l),r=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(t.suffix??""))}o&&(n=n?`${o}_${n}`:o)}return r&&(n=`${n}_${r}`),i&&(n=`${i}_${n}`),t.forAs?qu(n):t.expr?MR(n,t.expr)+s:Zn(n)+s}function tp(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return q(e)&&!!e.bin;case"temporal":return!1}throw new Error(rN(e.type))}function $re(e){var t;return da(e)&&yu((t=e.scale)==null?void 0:t.type)}function Are(e){return e.aggregate==="count"}function kre(e,t){var o;const{field:n,bin:i,timeUnit:r,aggregate:s}=e;if(s==="count")return t.countTitle;if(Ie(i))return`${n} (binned)`;if(r&&!fa(r)){const a=(o=gt(r))==null?void 0:o.unit;if(a)return`${n} (${Lg(a).join("-")})`}else if(s)return Js(s)?`${n} for max ${s.argmax}`:qr(s)?`${n} for min ${s.argmin}`:`${ff(s)} of ${n}`;return n}function Cre(e){const{aggregate:t,bin:n,timeUnit:i,field:r}=e;if(Js(t))return`${r} for argmax(${t.argmax})`;if(qr(t))return`${r} for argmin(${t.argmin})`;const s=i&&!fa(i)?gt(i):void 0,o=t||(s==null?void 0:s.unit)||(s==null?void 0:s.maxbins)&&"timeunit"||Ie(n)&&"bin";return o?`${o.toUpperCase()}(${r})`:r}const GN=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return Cre(e);default:return kre(e,t)}};let VN=GN;function XN(e){VN=e}function Fre(){XN(GN)}function Wa(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=Fw(e))==null?void 0:a.title;if(!q(e))return r??e.title;const s=e,o=i?Tw(s,t):void 0;return n?Ze(r,s.title,o):r??s.title??o}function Fw(e){if(vu(e)&&e.axis)return e.axis;if(WN(e)&&e.legend)return e.legend;if(kw(e)&&e.header)return e.header}function Tw(e,t){return VN(e,t)}function np(e){if(HN(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=Fw(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function Tre(e,t){var s;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Cw(e)&&L(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!Js(n)&&!qr(n))return"quantitative";if(da(e)&&((s=e.scale)!=null&&s.type))switch(Cy[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Ei(e){if(q(e))return e;if(Wg(e))return e.condition}function ot(e){if(le(e))return e;if(xf(e))return e.condition}function YN(e,t,n,i={}){if(K(e)||$e(e)||js(e)){const r=K(e)?"string":$e(e)?"number":"boolean";return j(Fne(t,r,e)),{value:e}}return le(e)?ip(e,t,n,i):xf(e)?{...e,condition:ip(e.condition,t,n,i)}:e}function ip(e,t,n,i){if(HN(e)){const{format:r,formatType:s,...o}=e;if(Xo(s)&&!n.customFormatTypes)return j(oA(t)),ip(o,t,n,i)}else{const r=vu(e)?"axis":WN(e)?"legend":kw(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(Xo(o)&&!n.customFormatTypes)return j(oA(t)),ip({...e,[r]:a},t,n,i)}}return q(e)?Mw(e,t,i):Mre(e)}function Mre(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=$e(n)?"quantitative":K(n)?"nominal":ca(n)?"temporal":void 0,{...e,type:t}}function Mw(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!rw(i)&&!Js(i)&&!qr(i)&&(j(Mne(i)),delete a.aggregate),r&&(a.timeUnit=gt(r)),o&&(a.field=`${o}`),Ie(s)&&(a.bin=Hg(s,t)),xt(s)&&!et(t)&&j(lie(t)),an(a)){const{type:u}=a,l=Rie(u);u!==l&&(a.type=l),u!=="quantitative"&&Og(i)&&(j(Tne(u,i)),a.type="quantitative")}else if(!jR(t)){const u=Tre(a,t);a.type=u}if(an(a)){const{compatible:u,warning:l}=Dre(a,t)||{};u===!1&&j(l)}if(Cw(a)&&K(a.sort)){const{sort:u}=a;if(dA(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&dA(l))return{...a,sort:{encoding:l,order:"descending"}}}if(kw(a)){const{header:u}=a;if(u){const{orient:l,...c}=u;if(l)return{...a,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return a}function Hg(e,t){return js(e)?{maxbins:J$(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:J$(t)}:e}const $a={compatible:!0};function Dre(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Nr:case Lr:case kg:return tp(e)?$a:{compatible:!1,warning:Nne(t)};case We:case bt:case Gs:case Wu:case vn:case hr:case pr:case df:case hf:case Cg:case Wo:case Fg:case Tg:case oa:case ni:case Ci:case Mg:return $a;case Ti:case ei:case Fi:case Mi:return n!==Go?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:$a;case Kr:case Vs:case Xs:case Ys:case Yr:case Xr:case Vr:case ki:case dr:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:$a;case xn:case Ks:return!tp(e)&&!$re(e)?{compatible:!1,warning:Lne(t)}:$a;case pu:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:$a}}function xu(e){const{formatType:t}=np(e);return t==="time"||!t&&Ore(e)}function Ore(e){return e&&(e.type==="temporal"||q(e)&&!!e.timeUnit)}function Gg(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const s=t&&((u=gt(t))==null?void 0:u.unit);let o=s||n==="temporal",a;return gf(e)?a=e.expr:ee(e)?a=e.signal:ca(e)?(o=!0,a=Ho(e)):(K(e)||$e(e))&&o&&(a=`datetime(${Ne(e)})`,wie(s)&&($e(e)&&e<1e4||K(e)&&isNaN(Date.parse(e)))&&(a=Ho({[s]:e}))),a?i&&o?`time(${a})`:a:r?void 0:Ne(e)}function KN(e,t){const{type:n}=e;return t.map(i=>{const r=q(e)&&!fa(e.timeUnit)?e.timeUnit:void 0,s=Gg(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function wf(e,t){return Ie(e.bin)?mr(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const gA={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function Ef(e){return e==null?void 0:e.condition}const JN=["domain","grid","labels","ticks","title"],Rre={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},QN={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Nre={...QN,style:1,labelExpr:1,encoding:1};function mA(e){return J(Nre,e)}const Lre={axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1},ZN=I(Lre);function Qr(e){return B(e,"mark")}class Vg{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return Qr(t)?cre(t.mark)===this.name:!1}}function To(e,t){const n=e&&e[t];return n?L(n)?du(n,i=>!!i.field):q(n)||Wg(n):!1}function e5(e,t){const n=e&&e[t];return n?L(n)?du(n,i=>!!i.field):q(n)||yr(n)||xf(n):!1}function t5(e,t){if(et(t)){const n=e[t];if((q(n)||yr(n))&&(wN(n.type)||q(n)&&n.timeUnit)){const i=Z2(t);return e5(e,i)}}return!1}function n5(e){return du(Nte,t=>{if(To(e,t)){const n=e[t];if(L(n))return du(n,i=>!!i.aggregate);{const i=Ei(n);return i&&!!i.aggregate}}return!1})}function i5(e,t){const n=[],i=[],r=[],s=[],o={};return Dw(e,(a,u)=>{if(q(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=Fw(a),g=p==null?void 0:p.title;let m=V(a,{forAs:!0});const y={...g?[]:{title:Wa(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(Js(c)?(b="argmax",m=V({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):qr(c)?(b="argmin",m=V({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};l&&(v.field=l),s.push(v)}}else if(n.push(m),an(a)&&Ie(f)){if(i.push({bin:f,field:l,as:m}),n.push(V(a,{binSuffix:"end"})),wf(a,u)&&n.push(V(a,{binSuffix:"range"})),et(u)){const b={field:`${m}_end`};o[`${u}2`]=b}y.bin="binned",jR(u)||(y.type=Go)}else if(d&&!fa(d)){r.push({timeUnit:d,field:l,as:m});const b=an(a)&&a.type!==mu&&"time";b&&(u===df||u===Wo?y.formatType=b:Hte(u)?y.legend={formatType:b,...y.legend}:et(u)&&(y.axis={formatType:b,...y.axis}))}o[u]=y}else n.push(l),o[u]=e[u]}else o[u]=e[u]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function Pre(e,t,n){const i=Vte(t,n);if(i){if(i==="binned"){const r=e[t===ki?We:bt];return!!(q(r)&&q(e[t])&&xt(r.bin))}}else return!1;return!0}function zre(e,t,n,i){const r={};for(const s of I(e))UR(s)||j(Rne(s));for(let s of Ute){if(!e[s])continue;const o=e[s];if(pf(s)){const a=Bte(s),u=r[a];if(q(u)&&Oie(u.type)&&q(o)&&!u.timeUnit){j(Cne(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(j(kne),s=ni),!Pre(e,s,t)){j(Ng(s,t));continue}if(s===Yr&&t==="line"){const a=Ei(e[s]);if(a!=null&&a.aggregate){j(One);continue}}if(s===vn&&(n?"fill"in e:"stroke"in e)){j(sN("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===hf||s===pu&&!L(o)&&!wi(o)||s===Wo&&L(o)){if(o){if(s===pu){const a=e[s];if(qN(a)){r[s]=a;continue}}r[s]=Y(o).reduce((a,u)=>(q(u)?a.push(Mw(u,s)):j(ky(u,s)),a),[])}}else{if(s===Wo&&o===null)r[s]=null;else if(!q(o)&&!yr(o)&&!wi(o)&&!vf(o)&&!ee(o)){j(ky(o,s));continue}r[s]=YN(o,s,i)}}return r}function Xg(e,t){const n={};for(const i of I(e)){const r=YN(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Ire(e){const t=[];for(const n of I(e))if(To(e,n)){const i=e[n],r=Y(i);for(const s of r)q(s)?t.push(s):Wg(s)&&t.push(s.condition)}return t}function Dw(e,t,n){if(e)for(const i of I(e)){const r=e[i];if(L(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function Bre(e,t,n,i){return e?I(e).reduce((r,s)=>{const o=e[s];return L(o)?o.reduce((a,u)=>t.call(i,a,u,s),r):t.call(i,r,o,s)},n):n}function r5(e,t){return I(t).reduce((n,i)=>{switch(i){case We:case bt:case Fg:case Mg:case Tg:case ki:case dr:case Gs:case Wu:case ni:case Xr:case Ci:case Vr:case Fi:case Ti:case Mi:case ei:case df:case xn:case oa:case Wo:return n;case pu:if(e==="line"||e==="trail")return n;case hf:case Cg:{const r=t[i];if(L(r)||q(r))for(const s of Y(r))s.aggregate||n.push(V(s,{}));return n}case Yr:if(e==="trail")return n;case vn:case hr:case pr:case Kr:case Vs:case Xs:case Ks:case Ys:{const r=Ei(t[i]);return r&&!r.aggregate&&n.push(V(r,{})),n}}},[])}function Ure(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(L(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return L(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function My(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const u=i?` of ${Ow(t)}`:"";return{field:o+t.field,type:t.type,title:ee(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),s=Ire(n).map(Sre);return{tooltip:[...r,...Hi(s,be)]}}function Ow(e){const{title:t,field:n}=e;return Ze(t,n)}function Rw(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=Ow(n);return s5(e,a,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...K(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function s5(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...rr(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...js(e[t])?{}:e[t]}}]:[]}function o5(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:Qf(s,n),continuousAxisChannelDef2:Qf(o,n),continuousAxisChannelDefError:Qf(a,n),continuousAxisChannelDefError2:Qf(u,n),continuousAxis:r}}function Qf(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&j(uie(n,t)),i}else return e}function a5(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(rr(n)&&n.orient)return n.orient;if(xs(r)){if(xs(s)){const o=q(r)&&r.aggregate,a=q(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return xu(s)&&!xu(r)?"horizontal":"vertical"}return"horizontal"}else{if(xs(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const rp="boxplot",jre=["box","median","outliers","rule","ticks"],qre=new Vg(rp,l5);function u5(e){return $e(e)?"tukey":e}function l5(e,{config:t}){e={...e,encoding:Xg(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=rr(n)?n:{type:n};r&&j(iN("boxplot"));const u=a.extent??t.boxplot.extent,l=Oe("size",a,t),c=a.invalid,f=u5(u),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:E,customTooltipWithoutAggregatedField:S}=Wre(e,u,t),w=qu(g.field),{color:_,size:$,...C}=v,T=Af=>Rw(a,m,g,Af,t.boxplot),O=T(C),k=T(v),F=(X(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",A=T({...C,...$?{size:$}:{},color:{condition:{test:`datum['lower_box_${g.field}'] >= datum['upper_box_${g.field}']`,..._||{value:F}}}}),M=My([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,v),P={type:"tick",color:"black",opacity:1,orient:x,invalid:c,aria:!1},z=f==="min-max"?M:My([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),U=[...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:z}),...O({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:z}),...O({partName:"ticks",mark:P,positionPrefix:"lower_whisker",extraEncoding:z}),...O({partName:"ticks",mark:P,positionPrefix:"upper_whisker",extraEncoding:z})],te=[...f!=="tukey"?U:[],...k({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:E,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:M}),...A({partName:"median",mark:{type:"tick",invalid:c,...X(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:x,aria:!1},positionPrefix:"mid_box",extraEncoding:M})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(p),layer:te};const ne=`datum["lower_box_${g.field}"]`,de=`datum["upper_box_${g.field}"]`,Se=`(${de} - ${ne})`,we=`${ne} - ${u} * ${Se}`,Pe=`${de} + ${u} * ${Se}`,Di=`datum["${g.field}"]`,Zs={joinaggregate:c5(g.field),groupby:y},es={transform:[{filter:`(${we} <= ${Di}) && (${Di} <= ${Pe})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${w}`},{op:"max",field:g.field,as:`upper_whisker_${w}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${w}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${w}`},...b],groupby:y}],layer:U},{tooltip:Q,...he}=C,{scale:ge,axis:W}=g,vt=Ow(g),Te=pn(W,["title"]),Tt=s5(a,"outliers",t.boxplot,{transform:[{filter:`(${Di} < ${we}) || (${Di} > ${Pe})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...vt!==void 0?{title:vt}:{},...ge!==void 0?{scale:ge}:{},...Re(Te)?{}:{axis:Te}},...he,..._?{color:_}:{},...S?{tooltip:S}:{}}})[0];let ct;const Oi=[...d,...h,Zs];return Tt?ct={transform:Oi,layer:[Tt,es]}:(ct=es,ct.transform.unshift(...Oi)),{...o,layer:[ct,{transform:p,layer:te}]}}function c5(e){const t=qu(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function Wre(e,t,n){const i=a5(e,rp),{continuousAxisChannelDef:r,continuousAxis:s}=o5(e,i,rp),o=r.field,a=qu(o),u=u5(t),l=[...c5(o),{op:"median",field:o,as:`mid_box_${a}`},{op:"min",field:o,as:(u==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:o,as:(u==="min-max"?"upper_whisker_":"max_")+a}],c=u==="min-max"||u==="tukey"?[]:[{calculate:`datum["upper_box_${a}"] - datum["lower_box_${a}"]`,as:`iqr_${a}`},{calculate:`min(datum["upper_box_${a}"] + datum["iqr_${a}"] * ${t}, datum["max_${a}"])`,as:`upper_whisker_${a}`},{calculate:`max(datum["lower_box_${a}"] - datum["iqr_${a}"] * ${t}, datum["min_${a}"])`,as:`lower_whisker_${a}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=Ure(d),{bins:g,timeUnits:m,aggregate:y,groupby:b,encoding:v}=i5(p,n),x=i==="vertical"?"horizontal":"vertical",E=i,S=[...g,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:g,timeUnits:m,transform:S,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:v,ticksOrient:x,boxOrient:E,customTooltipWithoutAggregatedField:h}}const Nw="errorbar",Hre=["ticks","rule"],Gre=new Vg(Nw,f5);function f5(e,{config:t}){e={...e,encoding:Xg(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:u,tooltipEncoding:l}=d5(e,Nw,t);delete s.size;const c=Rw(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function Vre(e,t){const{encoding:n}=e;if(Xre(n))return{orient:a5(e,t),inputType:"raw"};const i=Yre(n),r=Kre(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,u=n.y2;if(le(a)&&le(u))throw new Error(`${t} cannot have both x2 and y2`);if(le(a)){if(xs(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(le(u)){if(xs(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(le(u)&&!le(a))throw new Error(`${t} cannot have xError2 without xError`);if(le(c)&&!le(l))throw new Error(`${t} cannot have yError2 without yError`);if(le(a)&&le(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(le(a)){if(xs(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(le(l)){if(xs(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function Xre(e){return(le(e.x)||le(e.y))&&!le(e.x2)&&!le(e.y2)&&!le(e.xError)&&!le(e.xError2)&&!le(e.yError)&&!le(e.yError2)}function Yre(e){return le(e.x2)||le(e.y2)}function Kre(e){return le(e.xError)||le(e.xError2)||le(e.yError)||le(e.yError2)}function d5(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,u=rr(i)?i:{type:i};s&&j(iN(t));const{orient:l,inputType:c}=Vre(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=o5(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=Jre(u,f,d,h,p,c,t,n),{[g]:x,[g==="x"?"x2":"y2"]:E,[g==="x"?"xError":"yError"]:S,[g==="x"?"xError2":"yError2"]:w,..._}=r,{bins:$,timeUnits:C,aggregate:T,groupby:O,encoding:k}=i5(_,n),F=[...T,...m],A=c!=="raw"?[]:O,M=My(b,f,k,v);return{transform:[...a.transform??[],...$,...C,...F.length===0?[]:[{aggregate:F,groupby:A}],...y],groupby:A,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:k,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:M}}function Jre(e,t,n,i,r,s,o,a){let u=[],l=[];const c=t.field;let f,d=!1;if(s==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&j(aie(h,p,o)),p==="stderr"||p==="stdev")u=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`datum["center_${c}"] + datum["extent_${c}"]`,as:`upper_${c}`},{calculate:`datum["center_${c}"] - datum["extent_${c}"]`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:ff(h)},{fieldPrefix:"upper_",titlePrefix:yA(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:yA(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:Wa({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:Wa({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:Wa({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&j(oie(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],l=[{calculate:`datum["${n.field}"]`,as:`upper_${c}`},{calculate:`datum["${c}"]`,as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`datum["${c}"] + datum["${i.field}"]`,as:`upper_${c}`}],r?l.push({calculate:`datum["${c}"] + datum["${r.field}"]`,as:`lower_${c}`}):l.push({calculate:`datum["${c}"] - datum["${i.field}"]`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:qo(qo(h.calculate,'datum["',""),'"]',"")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function yA(e,t,n){return`${ff(e)} ${n} ${t}`}const Lw="errorband",Qre=["band","borders"],Zre=new Vg(Lw,h5);function h5(e,{config:t}){e={...e,encoding:Xg(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:u}=d5(e,Lw,t),l=o,c=Rw(l,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):l.interpolate?j(uA("interpolate")):l.tension&&j(uA("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}const p5={};function Pw(e,t,n){const i=new Vg(e,t);p5[e]={normalizer:i,parts:n}}function ese(){return I(p5)}Pw(rp,l5,jre);Pw(Nw,f5,Hre);Pw(Lw,h5,Qre);const tse=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],g5={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},m5={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},nse=I(g5),ise=I(m5),rse={header:1,headerRow:1,headerColumn:1,headerFacet:1},y5=I(rse),b5=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],sse={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},ose={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Si="_vgsid_",ase={point:{on:"click",fields:[Si],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function zw(e){return e==="legend"||!!(e!=null&&e.legend)}function $0(e){return zw(e)&&X(e)}function Iw(e){return!!(e!=null&&e.select)}function v5(e){const t=[];for(const n of e||[]){if(Iw(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function use(e){return Yg(e)||Uw(e)||Bw(e)}function Bw(e){return B(e,"concat")}function Yg(e){return B(e,"vconcat")}function Uw(e){return B(e,"hconcat")}function x5({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function sr(e){return B(e,"step")}function bA(e){return B(e,"view")||B(e,"width")||B(e,"height")}const vA=20,lse={align:1,bounds:1,center:1,columns:1,spacing:1},cse=I(lse);function fse(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&(qg(e)&&!bf(e.facet)||Bw(e))&&(r.columns=o),Yg(e)&&(r.columns=1);for(const a of cse)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=$e(u)?u:{row:u.row??s,column:u.column??s}}else r[a]=e[a];return r}function Dy(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function Oy(e,t){const n=sp(e,t);return sr(n)?n.step:w5}function sp(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return Ze(n,{step:e.step})}const w5=20,dse={continuousWidth:200,continuousHeight:200,step:w5},hse={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:dse,mark:rre,arc:{},area:{},bar:ure,circle:{},geoshape:{},image:{},line:{},point:{},rect:Ew,rule:{color:"black"},square:{},text:{color:"black"},tick:lre,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:Iie,projection:{},legend:sse,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:ase,style:{},title:{},facet:{spacing:vA},concat:{spacing:vA},normalizedNumberFormat:".0%"},wr=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],xA={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},wA={blue:wr[0],orange:wr[1],red:wr[2],teal:wr[3],green:wr[4],yellow:wr[5],purple:wr[6],pink:wr[7],brown:wr[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function pse(e={}){return{signals:[{name:"color",value:X(e)?{...wA,...e}:wA}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function gse(e){return{signals:[{name:"fontSize",value:X(e)?{...xA,...e}:xA}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function mse(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function E5(e){const t=I(e||{}),n={};for(const i of t){const r=e[i];n[i]=Ef(r)?KR(r):kn(r)}return n}function yse(e){const t=I(e),n={};for(const i of t)n[i]=E5(e[i]);return n}const bse=[...MN,...ZN,...y5,"background","padding","legend","lineBreak","scale","style","title","view"];function S5(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=Fu({},ue(hse),n?mse(n):{},t?pse(t):{},i?gse(i):{},s||{});r&&Tu(o,"selection",r,!0);const a=pn(o,bse);for(const u of["background","lineBreak","padding"])o[u]&&(a[u]=kn(o[u]));for(const u of MN)o[u]&&(a[u]=wt(o[u]));for(const u of ZN)o[u]&&(a[u]=E5(o[u]));for(const u of y5)o[u]&&(a[u]=wt(o[u]));if(o.legend&&(a.legend=wt(o.legend)),o.scale){const{invalid:u,...l}=o.scale,c=wt(u,{level:1});a.scale={...wt(l),...I(c).length>0?{invalid:c}:{}}}return o.style&&(a.style=yse(o.style)),o.title&&(a.title=wt(o.title)),o.view&&(a.view=wt(o.view)),a}const vse=new Set(["view",...Qie]),xse=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],wse={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...ire};function Ese(e){e=ue(e);for(const t of xse)delete e[t];if(e.axis)for(const t in e.axis)Ef(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of tse)delete e.legend[t];if(e.mark){for(const t of cA)delete e.mark[t];e.mark.tooltip&&X(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(v5(e.params)),delete e.params);for(const t of vse){for(const i of cA)delete e[t][i];const n=wse[t];if(n)for(const i of n)delete e[t][i];_se(e,t)}for(const t of ese())delete e[t];Sse(e);for(const t in e)X(e[t])&&Re(e[t])&&delete e[t];return Re(e)?void 0:e}function Sse(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=YR(e.title);Re(t)||(e.style["group-title"]={...e.style["group-title"],...t}),Re(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),Re(i)?delete e.title:e.title=i}function _se(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};Re(s)||(e.style[n??t]=s),delete e[t]}function Kg(e){return B(e,"layer")}function $se(e){return B(e,"repeat")}function Ase(e){return!L(e.repeat)&&B(e.repeat,"layer")}class jw{map(t,n){return qg(t)?this.mapFacet(t,n):$se(t)?this.mapRepeat(t,n):Uw(t)?this.mapHConcat(t,n):Yg(t)?this.mapVConcat(t,n):Bw(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(Kg(t))return this.mapLayer(t,n);if(Qr(t))return this.mapUnit(t,n);throw new Error(sw(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const kse={zero:1,center:1,normalize:1};function Cse(e){return J(kse,e)}const Fse=new Set([CN,Ig,zg,Qh,Ug,xw,ww,Bg,FN,vw]),Tse=new Set([Ig,zg,CN]);function Aa(e){return q(e)&&bu(e)==="quantitative"&&!e.bin}function EA(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(q(o)&&q(a))if(Aa(o)&&Aa(a)){if(o.stack)return t;if(a.stack)return r;const u=q(o)&&!!o.aggregate,l=q(a)&&!!a.aggregate;if(u!==l)return u?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(Aa(o))return t;if(Aa(a))return r}else{if(Aa(o))return s&&n==="vertical"?void 0:t;if(Aa(a))return s&&n==="horizontal"?void 0:r}}function Mse(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function _5(e,t){var g,m;const n=rr(e)?e:{type:e},i=n.type;if(!Fse.has(i))return null;const r=EA(t,"x",n)||EA(t,"theta",n);if(!r)return null;const s=t[r],o=q(s)?V(s,{}):void 0,a=Mse(r),u=[],l=new Set;if(t[a]){const y=t[a],b=q(y)?V(y,{}):void 0;b&&b!==o&&(u.push(a),l.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=q(f)?V(f,{}):void 0;d&&d!==o&&(u.push(c),l.add(d));const h=jte.reduce((y,b)=>{if(b!=="tooltip"&&To(t,b)){const v=t[b];for(const x of Y(v)){const E=Ei(x);if(E.aggregate)continue;const S=V(E,{});(!S||!l.has(S))&&y.push({channel:b,fieldDef:E})}}return y},[]);let p;return s.stack!==void 0?js(s.stack)?p=s.stack?"zero":null:p=s.stack:Tse.has(i)&&(p="zero"),!p||!Cse(p)||n5(t)&&h.length===0?null:((g=s==null?void 0:s.scale)!=null&&g.type&&((m=s==null?void 0:s.scale)==null?void 0:m.type)!==Et.LINEAR&&s!=null&&s.stack&&j(iie(s.scale.type)),le(t[gr(r)])?(s.stack!==void 0&&j(nie(r)),null):(q(s)&&s.aggregate&&!ene.has(s.aggregate)&&j(rie(s.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:s.impute===null?!1:Qs(i),stackBy:h,offset:p}))}function $5(e,t,n){const i=wt(e),r=Oe("orient",i,n);if(i.orient=Nse(i.type,t,r),r!==void 0&&r!==i.orient&&j(Bne(i.orient,r)),i.type==="bar"&&i.orient){const u=Oe("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:ore[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=Oe("opacity",i,n),o=Oe("fillOpacity",i,n);return s===void 0&&o===void 0&&(i.opacity=Ose(i.type,t)),Oe("cursor",i,n)===void 0&&(i.cursor=Dse(i,t,n)),i}function Dse(e,t,n){return t.href||e.href||Oe("href",e,n)?"pointer":e.cursor}function Ose(e,t){if(ye([Ug,vw,xw,ww],e)&&!n5(t))return .7}function Rse(e,t,{graticule:n}){if(n)return!1;const i=ir("filled",e,t),r=e.type;return Ze(i,r!==Ug&&r!==Bg&&r!==Qh)}function Nse(e,t,n){switch(e){case Ug:case xw:case ww:case FN:case Kie:case Yie:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case Ig:if(q(i)&&(xt(i.bin)||q(r)&&r.aggregate&&!i.aggregate))return"vertical";if(q(r)&&(xt(r.bin)||q(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(q(i)&&i.type===Go&&!Ie(i.bin)||ep(i))&&q(r)&&xt(r.bin)?"horizontal":"vertical";if(!o)return(q(r)&&r.type===Go&&!Ie(r.bin)||ep(r))&&q(i)&&xt(i.bin)?"vertical":"horizontal"}case Qh:if(s&&!(q(i)&&xt(i.bin))&&o&&!(q(r)&&xt(r.bin)))return;case zg:if(o)return q(r)&&xt(r.bin)?"horizontal":"vertical";if(s)return q(i)&&xt(i.bin)?"vertical":"horizontal";if(e===Qh){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case Bg:case vw:{const a=pA(i),u=pA(r);if(n)return n;if(a&&!u)return e!=="tick"?"horizontal":"vertical";if(!a&&u)return e!=="tick"?"vertical":"horizontal";if(a&&u)return"vertical";{const l=an(i)&&i.type===mu,c=an(r)&&r.type===mu;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function Lse(e){const{point:t,line:n,...i}=e;return I(i).length>1?i:i.type}function Pse(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:pn(e[t],["point","line"])});return e}function A0(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?X(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?X(t.point)?t.point:{}:void 0}function SA(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class zse{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(Qr(t)){const{mark:i,encoding:r}=t,s=rr(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!A0(s,n[s.type],r);case"area":return!!A0(s,n[s.type],r)||!!SA(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:u,encoding:l,...c}=t,f=Xg(l,r),d=rr(a)?a:{type:a},h=A0(d,r[d.type],f),p=d.type==="area"&&SA(d,r[d.type]),g=[{name:u,...s?{params:s}:{},mark:Lse({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:pn(f,["shape"])}],m=_5($5(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=pn(y,["y2","x2"]),p&&g.push({...o?{projection:o}:{},mark:{type:"line",...fu(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...fu(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:g},{...n,config:Pse(r)})}}function Ise(e,t){return t?bf(e)?k5(e,t):A5(e,t):e}function k0(e,t){return t?k5(e,t):e}function Ry(e,t,n){const i=t[e];if(wre(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};j(xne(i.repeat));return}return t}function A5(e,t){if(e=Ry("field",e,t),e!==void 0){if(e===null)return null;if(Cw(e)&&Pr(e.sort)){const n=Ry("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function _A(e,t){if(q(e))return A5(e,t);{const n=Ry("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function $A(e,t){if(le(e)){const n=_A(e,t);if(n)return n;if(vf(e))return{condition:e.condition}}else{if(xf(e)){const n=_A(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function k5(e,t){const n={};for(const i in e)if(B(e,i)){const r=e[i];if(L(r))n[i]=r.map(s=>$A(s,t)).filter(s=>s);else{const s=$A(r,t);s!==void 0&&(n[i]=s)}}return n}class Bse{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(Qr(t)){const{encoding:n,mark:i}=t;if(i==="line"||rr(i)&&i.type==="line")for(const r of Ite){const s=aa(r),o=n[s];if(n[r]&&(q(o)&&!xt(o.bin)||yr(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return j(Ine(!!r.x2,!!r.y2)),i({...t,mark:X(s)?{...s,type:"rule"}:"rule"},n)}}class Use extends jw{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[qre,Gre,Zre,new zse,new Bse]}map(t,n){if(Qr(t)){const i=To(t.encoding,Nr),r=To(t.encoding,Lr),s=To(t.encoding,kg);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=k0(t.encoding,n.repeater),o={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(u=>u).join("_")}:{},...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(o,n);const a=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(o,n.config))return u.run(o,n,a);return o}mapRepeat(t,n){return Ase(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:o,column:a,layer:u}=i,{repeater:l={},repeaterPrefix:c=""}=n;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:u},spec:r}},n):{...s,layer:u.map(f=>{const d={...l,layer:f},h=`${(r.name?`${r.name}_`:"")+c}child__layer_${qe(f)}`,p=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...o}=t;!L(i)&&t.columns&&(t=pn(t,["columns"]),j(rA("repeat")));const a=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!L(i)&&i.row||[u?u.row:null],f=!L(i)&&i.column||[u?u.column:null],d=L(i)&&i||[u?u.repeat:null];for(const p of d)for(const g of c)for(const m of f){const y={repeat:p,row:g,column:m,layer:u.layer},b=(r.name?`${r.name}_`:"")+l+"child__"+(L(i)?`${qe(p)}`:(i.row?`row_${qe(g)}`:"")+(i.column?`column_${qe(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,a.push(pn(v,["data"]))}const h=L(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...o,columns:h,concat:a}}mapFacet(t,n){const{facet:i}=t;return bf(i)&&t.columns&&(t=pn(t,["columns"]),j(rA("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:o,config:a}=n,u=kA({parentProjection:o,projection:r}),l=AA({parentEncoding:s,encoding:k0(i,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...o}=t.encoding,{mark:a,width:u,projection:l,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=k0(o,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&j(Pne([...i?[Nr]:[],...r?[Lr]:[]]));const o={},a={};for(const u of[Nr,Lr]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...p}=l;o[u]=p;for(const g of["align","center","spacing"])l[g]!==void 0&&(a[g]??(a[g]={}),a[g][u]=l[g])}}return{facetMapping:o,layout:a}}else{const{align:o,center:a,spacing:u,columns:l,...c}=s;return{facetMapping:Ise(c,n.repeater),layout:{...o?{align:o}:{},...a?{center:a}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:o,...a}=t,u={...r,parentEncoding:AA({parentEncoding:n,encoding:s,layer:!0}),parentProjection:kA({parentProjection:i,projection:o})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function AA({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...I(e),...I(t)]);for(const s of r){const o=t[s],a=e[s];if(le(o)){const u={...a,...o};i[s]=u}else xf(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||wi(a)||ee(a)||le(a)||L(a))&&(i[s]=a)}}else i=t;return!i||Re(i)?void 0:i}function kA(e){const{parentProjection:t,projection:n}=e;return t&&n&&j(Ane({parentProjection:t,projection:n})),n??t}function qw(e){return B(e,"filter")}function jse(e){return B(e,"stop")}function C5(e){return B(e,"lookup")}function qse(e){return B(e,"data")}function Wse(e){return B(e,"param")}function Hse(e){return B(e,"pivot")}function Gse(e){return B(e,"density")}function Vse(e){return B(e,"quantile")}function Xse(e){return B(e,"regression")}function Yse(e){return B(e,"loess")}function Kse(e){return B(e,"sample")}function Jse(e){return B(e,"window")}function Qse(e){return B(e,"joinaggregate")}function Zse(e){return B(e,"flatten")}function eoe(e){return B(e,"calculate")}function F5(e){return B(e,"bin")}function toe(e){return B(e,"impute")}function noe(e){return B(e,"timeUnit")}function ioe(e){return B(e,"aggregate")}function roe(e){return B(e,"stack")}function soe(e){return B(e,"fold")}function ooe(e){return B(e,"extent")&&!B(e,"density")&&!B(e,"regression")}function aoe(e){return e.map(t=>qw(t)?{filter:ja(t.filter,Die)}:t)}class uoe extends jw{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=CA(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=CA(t,n),t.encoding){const i={};for(const[r,s]of Rs(t.encoding))i[r]=T5(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:Rs(i).map(([s,o])=>{const{init:a,bind:u,empty:l,...c}=o;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[s]=l!=="none";for(const f of kt(n.selectionPredicates[s]??{}))f.empty=l!=="none";return{name:s,value:a,select:c,bind:u}})}:t}}function CA(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(qw(s))return{filter:Ny(s,t)};if(F5(s)&&ua(s.bin))return{...s,bin:M5(s.bin)};if(C5(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function T5(e,t){var i,r;const n=ue(e);if(q(n)&&ua(n.bin)&&(n.bin=M5(n.bin)),da(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:s,...o}=n.scale.domain;n.scale.domain={...o,...s?{param:s}:{}}}if(vf(n))if(L(n.condition))n.condition=n.condition.map(s=>{const{selection:o,param:a,test:u,...l}=s;return a?s:{...l,test:Ny(s,t)}});else{const{selection:s,param:o,test:a,...u}=T5(n.condition,t);n.condition=o?n.condition:{...u,test:Ny(n.condition,t)}}return n}function M5(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Ny(e,t){const n=i=>ja(i,r=>{var s;const o=t.emptySelections[r]??!0,a={param:r,empty:o};return(s=t.selectionPredicates)[r]??(s[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):ja(e.test||e.filter,i=>i.selection?n(i.selection):i)}class Ly extends jw{map(t,n){const i=n.selections??[];if(t.params&&!Qr(t)){const r=[];for(const s of t.params)Iw(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(K(a)&&(a===t.name||r.includes(a))||L(a)&&a.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Ly.prototype[e];Ly.prototype[e]=function(n,i){return t.call(this,n,loe(n,i))}}function loe(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function D5(e,t){t===void 0&&(t=S5(e.config));const n=hoe(e,t),{width:i,height:r}=e,s=poe(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const coe=new Use,foe=new uoe,doe=new Ly;function hoe(e,t={}){const n={config:t};return doe.map(coe.map(foe.map(e,n),n),n)}function FA(e){return K(e)?{type:e}:e??{}}function poe(e,t,n){let{width:i,height:r}=t;const s=Qr(e)||Kg(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(j(eA("width")),i=void 0),r=="container"&&(j(eA("height")),r=void 0));const a={type:"pad",...o,...n?FA(n.autosize):{},...FA(e.autosize)};if(a.type==="fit"&&!s&&(j(lne),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&j(tA("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&j(tA("height")),!Tn(a,{type:"pad"}))return a}function goe(e){return["fit","fit-x","fit-y"].includes(e)}function moe(e){return e?`fit-${Dg(e)}`:"fit"}const yoe=["background","padding"];function TA(e,t){const n={};for(const i of yoe)e&&e[i]!==void 0&&(n[i]=kn(e[i]));return t&&(n.params=e.params),n}class Zr{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new Zr(ue(this.explicit),ue(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return Ze(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of I(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function Bi(e){return{explicit:!0,value:e}}function _n(e){return{explicit:!1,value:e}}function O5(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:Jg(t,n,i,r)}}function Jg(e,t,n,i){return e.explicit&&t.explicit&&j(Yne(n,i,e.value,t.value)),e}function Ps(e,t,n,i,r=Jg){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Tn(e.value,t.value)?e:r(e,t,n,i)}class boe extends Zr{constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function wu(e){return B(e,"url")}function Mc(e){return B(e,"values")}function R5(e){return B(e,"name")&&!wu(e)&&!Mc(e)&&!As(e)}function As(e){return e&&(N5(e)||L5(e)||Ww(e))}function N5(e){return B(e,"sequence")}function L5(e){return B(e,"sphere")}function Ww(e){return B(e,"graticule")}var Ke;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Ke||(Ke={}));function P5({invalid:e,isPath:t}){switch(DN(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function voe(e){const{marks:t,scales:n}=P5(e);return t===n?Ke.Main:n==="include-invalid-values"?Ke.PreFilterInvalid:Ke.PostFilterInvalid}function z5(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=Zn(r.field),r}function Yo(e,t=!0,n=Wt){if(L(e)){const i=e.map(r=>Yo(r,t,n));return t?`[${i.join(", ")}]`:i}else if(ca(e))return n(t?Ho(e):xie(e));return t?n(Ne(e)):e}function xoe(e,t){for(const n of kt(e.component.selection??{})){const i=n.name;let r=`${i}${zs}, ${n.resolve==="global"?"true":`{unit: ${Mo(e)}}`}`;for(const s of tm)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+Koe,on:[{events:{signal:n.name+zs},update:`modify(${H(n.name+Ko)}, ${r})`}]})}return Hw(t)}function woe(e,t){if(e.component.selection&&I(e.component.selection).length){const n=H(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:Hs("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Hw(t)}function Eoe(e,t){let n=!1;for(const i of kt(e.component.selection??{})){const r=i.name,s=H(r+Ko);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${n6}(${s}, ${H(a)}${u}`})}n=!0;for(const a of tm)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),Hw(t)}function Soe(e,t){const n=[...t],i=Mo(e,{escape:!1});for(const r of kt(e.component.selection??{})){const s={name:r.name+Ko};if(r.project.hasSelectionId&&(s.transform=[{type:"collect",sort:{field:Si}}]),r.init){const a=r.project.items.map(z5);s.values=r.project.hasSelectionId?r.init.map(u=>({unit:i,[Si]:Yo(u,!1)[0]})):r.init.map(u=>({unit:i,fields:a,values:Yo(u,!1)}))}n.filter(a=>a.name===r.name+Ko).length||n.push(s)}return n}function I5(e,t){for(const n of kt(e.component.selection??{}))for(const i of tm)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function _oe(e,t){for(const n of e.children)Ge(n)&&(t=I5(n,t));return t}function $oe(e,t,n,i){const r=a6(e,t.param,t);return{signal:xi(n.get("type"))&&L(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function Hw(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}class De{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){j(Sne);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class gn extends De{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${OR()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function C0(e){return e.as!==void 0}function MA(e){return`${e}_end`}class Yi extends De{clone(){return new Yi(null,ue(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{const{field:a,timeUnit:u}=s;if(u){let l;if(fa(u)){if(Ge(n)){const{mark:c,markDef:f,config:d}=n,h=Ls({fieldDef:s,markDef:f,config:d});(Tc(c)||h)&&(l={timeUnit:gt(u),field:a})}}else l={as:V(s,{forAs:!0}),field:a,timeUnit:u};if(Ge(n)){const{mark:c,markDef:f,config:d}=n,h=Ls({fieldDef:s,markDef:f,config:d});Tc(c)&&et(o)&&h!==.5&&(l.rectBandPosition=h)}l&&(r[be(l)]=l)}return r},{});return Re(i)?null:new Yi(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=gt(i),o={...r,timeUnit:s};return new Yi(t,{[be(o)]:o})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of Rs(this.timeUnits)){const s=C0(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(kt(this.timeUnits).map(t=>C0(t)?t.as:MA(t.field)))}dependentFields(){return new Set(kt(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${be(this.timeUnits)}`}assemble(){const t=[];for(const n of kt(this.timeUnits)){const{rectBandPosition:i}=n,r=gt(n.timeUnit);if(C0(n)){const{field:s,as:o}=n,{unit:a,utc:u,...l}=r,c=[o,`${o}_end`];t.push({field:Zn(s),type:"timeunit",...a?{units:Lg(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...DA(c,i,r))}else if(n){const{field:s}=n,o=s.replaceAll("\\.","."),a=B5({timeUnit:r,field:o}),u=MA(o);t.push({type:"formula",expr:a,as:u}),t.push(...DA([o,u],i,r))}}return t}}const Qg="offsetted_rect_start",Zg="offsetted_rect_end";function B5({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=pN(i),{part:o,step:a}=bN(s,e.step);return`${r?"utcOffset":"timeOffset"}('${o}', datum['${t}'], ${n?-a:a})`}function DA([e,t],n,i){if(n!==void 0&&n!==.5){const r=`datum['${e}']`,s=`datum['${t}']`;return[{type:"formula",expr:OA([B5({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${Qg}`},{type:"formula",expr:OA([r,s],n+.5),as:`${e}_${Zg}`}]}return[]}function OA([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const Sf="_tuple_fields";class Aoe{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const koe={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new Aoe),s={},o={},a=new Set,u=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=qe(`${i}_${m}`);for(let b=1;a.has(y);b++)y=qe(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?Y(n.value):null;let{fields:d,encodings:h}=X(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(X(p))for(const g of I(p))zte(g)?(h||(h=[])).push(g):l==="interval"?(j(vne),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){j(cne(p,g.aggregate));continue}else if(!m){j(iA(p));continue}if(g.timeUnit&&!fa(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};o[be(y)]=y}if(!s[m]){const y=l==="interval"&&mr(p)&&xi(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:p,type:y,index:r.items.length};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(s[m]=b),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===Si,IR(p)?(b.geoChannel=p,b.channel=zR(p),r.hasChannel[b.channel]=s[m]):r.hasChannel[p]=s[m]}}else j(iA(p))}for(const p of d??[]){if(r.hasField[p])continue;const g={type:"E",field:p,index:r.items.length};g.signals={...u(g,"data")},r.items.push(g),r.hasField[p]=g,r.hasSelectionId=r.hasSelectionId||p===Si}f&&(t.init=f.map(p=>r.items.map(g=>X(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),Re(o)||(r.timeUnit=new Yi(null,o))},signals:(e,t,n)=>{const i=t.name+Sf;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(z5)})}},zr={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!mr(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(o=="sequential"&&j(pne),!s||!xi(o)){j(hne);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||RA(e)||i.length===0)return n;const r=n.find(o=>o.name===t.name);let s=r.update;if(s.includes(n6))r.update=`{${i.map(o=>`${H(Zn(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${H(Zn(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!RA(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function Py(e,t){return`domain(${H(e.scaleName(t))})`}function RA(e){return e.parent&&Ku(e.parent)&&!e.parent.parent}const Ha="_brush",U5="_scale_trigger",bl="geo_interval_init_tick",j5="_init",Coe="_center",Foe={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...X(n.select)?n.select:{}};r.fields=[Si],r.encodings||(r.encodings=n.value?I(n.value):[Ti,Fi]),n.select={type:"interval",...r}}if(t.translate&&!zr.defined(t)){const r=`!event.item || event.item.mark.name !== ${H(t.name+Ha)}`;for(const s of t.events){if(!s.between){j(`${s} is not an ordered event stream for interval selections.`);continue}const o=Y((i=s.between[0]).filter??(i.filter=[]));o.includes(r)||o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+zs,s=kt(t.project.hasChannel).filter(a=>a.channel===We||a.channel===bt),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,u)=>a.concat(Toe(e,t,u,o&&o[u.index])),[])),e.hasProjection){const a=H(e.projectionName()),u=e.projectionName()+Coe,{x:l,y:c}=t.project.hasChannel,f=l&&l.signals.visual,d=c&&c.signals.visual,h=l?o&&o[l.index]:`${u}[0]`,p=c?o&&o[c.index]:`${u}[1]`,g=E=>e.getSizeSignalRef(E).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;o&&(n.unshift({name:i+j5,init:`[scale(${a}, [${l?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${l?h[1]:h}, ${c?p[1]:p}])]`}),(!l||!c)&&(n.find(S=>S.name===u)||n.unshift({name:u,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${H(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${Mo(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,x=s.map(E=>E.signals.visual);return n.concat({name:r,on:[{events:[...x.length?[{signal:x.join(" || ")}]:[],...o?[{signal:bl}]:[]],update:v}]})}else{if(!zr.defined(t)){const l=i+U5,c=s.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=H(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=xi(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${l} : {}`}]})}const a=s.map(l=>l.signals.data),u=`unit: ${Mo(e)}, fields: ${i+Sf}, values`;return n.concat({name:r,...o?{init:`{${u}: ${Yo(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Ge(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===bl).length||n.unshift({name:bl,value:null,on:[{events:"timer{1}",update:`${bl} === null ? {} : ${bl}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r==null?void 0:r.signals.visual,a=s==null?void 0:s.signals.visual,u=`data(${H(t.name+Ko)})`;if(zr.defined(t)||!r&&!s)return n;const l={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of I(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${Mo(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=I(h).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(b=>b).join(" && "),value:h[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+Ha}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+Ha,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}};function Toe(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=H(r?e.scaleName(s):e.projectionName()),u=d=>`scale(${a}, ${d})`,l=e.getSizeSignalRef(s===We?"width":"height").signal,c=`${s}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${o}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,h=zr.defined(t),p=e.getScaleComponent(s),g=p?p.get("type"):void 0,m=i?{init:Yo(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+U5},update:xi(g)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:o,...m,on:f},{name:d,...i?{init:Yo(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===We?0:1,h=t.name+j5,p=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:o,...p,on:f}]}}const Moe={defined:e=>e.type==="point",signals:(e,t,n)=>{const i=t.name,r=i+Sf,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=kt(e.component.selection??{}).reduce((f,d)=>d.type==="interval"?f.concat(d.name+Ha):f,[]).map(f=>`indexof(item().mark.name, '${f}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let l=`unit: ${Mo(e)}, `;if(t.project.hasSelectionId)l+=`${Si}: ${o}[${H(Si)}]`;else{const f=s.items.map(d=>{const h=e.fieldDef(d.channel);return h!=null&&h.bin?`[${o}[${H(e.vgField(d.channel,{}))}], ${o}[${H(e.vgField(d.channel,{binSuffix:"end"}))}]]`:`${o}[${H(d.field)}]`}).join(", ");l+=`fields: ${r}, values: [${f}]`}const c=t.events;return n.concat([{name:i+zs,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}};function Gu({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const s=vf(t)&&t.condition;let o=[];s&&(o=Y(s).map(l=>{const c=r(l);if(xre(l)){const{param:f,empty:d}=l;return{test:o6(e,{param:f,empty:d}),...c}}else return{test:up(e,l.test),...c}})),i!==void 0&&o.push(i);const a=r(t);return a!==void 0&&o.push(a),o.length>1||o.length===1&&o[0].test?{[n]:o}:o.length===1?{[n]:o[0]}:{}}function Gw(e,t="text"){const n=e.encoding[t];return Gu({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>em(i,e.config),invalidValueRef:void 0})}function em(e,t,n="datum"){if(e){if(wi(e))return Ue(e.value);if(le(e)){const{format:i,formatType:r}=np(e);return Aw({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function q5(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(L(o))return{tooltip:NA({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return Gu({model:e,channelDef:o,vgChannel:"tooltip",mainRefFn:l=>{const c=em(l,r,a);if(c)return c;if(l===null)return;let f=Oe("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),K(f))return{value:f};if(X(f))return ee(f)?f:f.content==="encoding"?NA(n,s,r,t):{signal:a}},invalidValueRef:void 0})}}function W5(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s=new Set,o=i?"datum.datum":"datum",a=[];function u(c,f){const d=aa(f),h=an(c)?c:{...c,type:e[d].type},p=h.title||Tw(h,r),g=Y(p).join(", ").replaceAll(/"/g,'\\"');let m;if(et(f)){const y=f==="x"?"x2":"y2",b=Ei(e[y]);if(xt(h.bin)&&b){const v=V(h,{expr:o}),x=V(b,{expr:o}),{format:E,formatType:S}=np(h);m=yf(v,x,E,S,r),s.add(y)}}if((et(f)||f===ni||f===Ci)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=np(h);m=Aw({fieldOrDatumDef:h,format:y,formatType:b,expr:o,config:r,normalizeStack:!0}).signal}m??(m=em(h,r,o).signal),a.push({channel:f,key:g,value:m})}Dw(e,(c,f)=>{q(c)?u(c,f):Wg(c)&&u(c.condition,f)});const l={};for(const{channel:c,key:f,value:d}of a)!s.has(c)&&!l[f]&&(l[f]=d);return l}function NA(e,t,n,{reactiveGeom:i}={}){const r=W5(e,t,n,{reactiveGeom:i}),s=Rs(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function Doe(e){const{markDef:t,config:n}=e,i=Oe("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...Ooe(e),...Roe(e)}}function Ooe(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=Oe("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:J(one,t)?{}:{ariaRoleDescription:{value:t}}}function Roe(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return Gu({model:e,channelDef:s,vgChannel:"description",mainRefFn:u=>em(u,e.config),invalidValueRef:void 0});const o=Oe("description",n,i);if(o!=null)return{description:Ue(o)};if(i.aria===!1)return{};const a=W5(t,r,i);if(!Re(a))return{description:{signal:Rs(a).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function St(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:u}=n;const l=r[e];a===void 0&&(u??(u=Oe(e,i,s,{vgChannel:o,ignoreVgConfig:!vf(l)})),u!==void 0&&(a=Ue(u)));const c={markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=RN({...c,scaleChannel:e,channelDef:l});return Gu({model:t,channelDef:l,vgChannel:o??e,invalidValueRef:f,mainRefFn:h=>$w({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function H5(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??Oe("filled",n,r),a=ye(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,u=Oe(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,l=Oe(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],c=o?"fill":"stroke",f={...u?{fill:Ue(u)}:{},...l?{stroke:Ue(l)}:{}};return n.color&&(o?n.fill:n.stroke)&&j(sN("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...St("color",e,{vgChannel:c,defaultValue:o?u:l}),...St("fill",e,{defaultValue:i.fill?u:void 0}),...St("stroke",e,{defaultValue:i.stroke?l:void 0})}}function Noe(e){const{encoding:t,mark:n}=e,i=t.order;return!Qs(n)&&wi(i)?Gu({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Ue(r.value),invalidValueRef:void 0}):{}}function Eu({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a)return{offsetType:"encoding",offset:$w({channel:s,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:Ue(o),bandPosition:r})};const u=t[s];return u?{offsetType:"visual",offset:u}:{}}function tn(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,u=r[e],l=r[gr(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=Eu({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),p=Vw({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!u&&et(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:Loe({channel:e,channelDef:u,channel2Def:l,markDef:s,config:o,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function Loe(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(le(n)&&r&&t===r.fieldChannel){if(q(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return Zh({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return Fo(n,i,{suffix:"end"},{offset:s})}return _w(e)}function Vw({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=aa(n),u=Ns(n),l=Oe(n,s,o,{vgChannel:u});if(l!==void 0)return ic(n,l);switch(t){case"zeroOrMin":return LA({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:o});case"zeroOrMax":return LA({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:o});case"mid":return{...e[wn(n)],mult:.5}}}}function LA({mainChannel:e,config:t,...n}){const i=ON(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:s,heightSignal:o}=r.zeroOrMax;return{signal:`min(${s},${o})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const Poe={left:"x",center:"xc",right:"x2"},zoe={top:"y",middle:"yc",bottom:"y2"};function G5(e,t,n,i="middle"){if(e==="radius"||e==="theta")return Ns(e);const r=e==="x"?"align":"baseline",s=Oe(r,t,n);let o;return ee(s)?(j(zne(r)),o=void 0):o=s,e==="x"?Poe[o||(i==="top"?"left":"center")]:zoe[o||i]}function op(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?V5(e,t,{defaultPos:n,defaultPos2:i}):tn(e,t,{defaultPos:n})}function V5(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=gr(e),a=wn(e),u=Ioe(t,i,o),l=u[a]?G5(e,r,s):Ns(e);return{...tn(e,t,{defaultPos:n,vgChannel:l}),...u}}function Ioe(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,u=aa(n),l=wn(n),c=Ns(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:p}=n in i||n in s?Eu({channel:n,markDef:s,encoding:i,model:e}):Eu({channel:u,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=wn(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=Boe({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:h,stack:o,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:Zf(n,s)||Zf(n,{[n]:Ay(n,s,a.style),[l]:Ay(l,s,a.style)})||Zf(n,a[r])||Zf(n,a.mark)||{[c]:Vw({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function Boe({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:u,defaultRef:l}){return le(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Fo(t,s,{suffix:"start"},{offset:u}):_w({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function Zf(e,t){const n=wn(e),i=Ns(e);if(t[i]!==void 0)return{[i]:ic(e,t[i])};if(t[e]!==void 0)return{[i]:ic(e,t[e])};if(t[n]){const r=t[n];if(Vo(r))j(Dne(n));else return{[n]:ic(e,r)}}}function Wr(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=gr(t),a=wn(t),u=i[t],l=i[o],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??Oe("size",r,n,{vgChannel:a}),p=qR(t),g=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||s==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return q(u)&&(Ie(u.bin)||xt(u.bin)||u.timeUnit&&!l)&&!(h&&!Vo(h))&&!i[p]&&!mt(f)?qoe({fieldDef:u,fieldDef2:l,channel:t,model:e}):(le(u)&&mt(f)||g)&&!l?joe(u,t,e):V5(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function Uoe(e,t,n,i,r,s,o){if(Vo(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=ir("minBandSize",{type:o},i);return{signal:c?`max(${hi(c)}, ${l})`:l}}else r.band!==1&&(j(jne(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(ee(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(la(u)&&$e(u.step))return{value:u.step-2}}if(!s){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=Ze(u,o==="tick"?f:o==="bar"?l:c);if(ee(d))return{signal:`(1 - (${d.signal})) * ${e}`};if($e(d))return{signal:`${1-d} * ${e}`}}return{value:Oy(i.view,e)-2}}function joe(e,t,n){var $,C;const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=wn(t),f=gr(t),d=qR(t),h=n.scaleName(d),p=n.getScaleComponent(Z2(t)),g=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=St("size",n,{vgChannel:c,defaultRef:Ue(i.size)}):j(Gne(i.type)));const y=!!m,b=UN({channel:t,fieldDef:e,markDef:i,config:s,scaleType:($=l||p)==null?void 0:$.get("type"),useVlSizeChannel:g});m=m||{[c]:Uoe(c,h||u,p||l,s,b,!!e,i.type)};const v=((C=l||p)==null?void 0:C.get("type"))==="band"&&Vo(b)&&!y?"top":"middle",x=G5(t,i,s,v),E=x==="xc"||x==="yc",{offset:S,offsetType:w}=Eu({channel:t,markDef:i,encoding:r,model:n,bandPosition:E?.5:0}),_=_w({channel:t,channelDef:e,markDef:i,config:s,scaleName:u,scale:l,stack:o,offset:S,defaultRef:Vw({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:E?w==="encoding"?0:.5:ee(b)?{signal:`(1-${b})/2`}:Vo(b)?(1-b.band)/2:0});if(c)return{[x]:_,...m};{const T=Ns(f),O=m[c],k=S?{...O,offset:S}:O;return{[x]:_,[T]:L(_)?[_[0],{..._[1],offset:k}]:{..._,offset:k}}}}function PA(e,t,n,i,r,s,o){if(PR(e))return 0;const a=e==="x"||e==="y2",u=a?-t/2:t/2;if(ee(n)||ee(r)||ee(i)||s){const l=hi(n),c=hi(r),f=hi(i),d=hi(s),p=s?`(${o} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${o})) : ${u})`:u,g=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function qoe({fieldDef:e,fieldDef2:t,channel:n,model:i}){var C;const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),u=i.scaleName(n),l=a?a.get("type"):void 0,c=a.get("reverse"),f=UN({channel:n,fieldDef:e,markDef:s,config:r,scaleType:l}),d=(C=i.component.axes[n])==null?void 0:C[0],h=(d==null?void 0:d.get("translate"))??.5,p=et(n)?Oe("binSpacing",s,r)??0:0,g=gr(n),m=Ns(n),y=Ns(g),b=ir("minBandSize",s,r),{offset:v}=Eu({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:x}=Eu({channel:g,markDef:s,encoding:o,model:i,bandPosition:0}),E=pre({fieldDef:e,scaleName:u}),S=PA(n,p,c,h,v,b,E),w=PA(g,p,c,h,x??v,b,E),_=ee(f)?{signal:`(1-${f.signal})/2`}:Vo(f)?(1-f.band)/2:.5,$=Ls({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(Ie(e.bin)||e.timeUnit){const T=e.timeUnit&&$!==.5;return{[y]:zA({fieldDef:e,scaleName:u,bandPosition:_,offset:w,useRectOffsetField:T}),[m]:zA({fieldDef:e,scaleName:u,bandPosition:ee(_)?{signal:`1-${_.signal}`}:1-_,offset:S,useRectOffsetField:T})}}else if(xt(e.bin)){const T=Fo(e,u,{},{offset:w});if(q(t))return{[y]:T,[m]:Fo(t,u,{},{offset:S})};if(ua(e.bin)&&e.bin.step)return{[y]:T,[m]:{signal:`scale("${u}", ${V(e,{expr:"datum"})} + ${e.bin.step})`,offset:S}}}j(uN(g))}function zA({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return Zh({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:Qg,endSuffix:Zg}:{}})}const Woe=new Set(["aria","width","height"]);function ii(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?H5(e):{};return{...Hoe(e.markDef,t),...IA("fill",n),...IA("stroke",i),...St("opacity",e),...St("fillOpacity",e),...St("strokeOpacity",e),...St("strokeWidth",e),...St("strokeDash",e),...Noe(e),...q5(e),...Gw(e,"href"),...Doe(e)}}function IA(e,t){return t?{[e]:t}:{}}function Hoe(e,t){return sne.reduce((n,i)=>(!Woe.has(i)&&B(e,i)&&t[i]!=="ignore"&&(n[i]=Ue(e[i])),n),{})}function Xw(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,s)=>{var l;let o;if(!mr(s)||!(o=e.getScaleType(s)))return;const a=Og(r.aggregate),u=Sw({scaleChannel:s,markDef:n,config:t,scaleType:o,isCountAggregate:a});if(fre(u)){const c=e.vgField(s,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(s=>Pg(s,!0)).join(" && ")}}}function BA(e,t){if(t!==void 0)return{[e]:Ue(t)}}const F0="voronoi",X5={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(F0)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(Qs(s))return j(fne(s)),n;const o={name:e.getName(F0),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...q5(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,u=!1;return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?a=c:f.includes(F0)&&(u=!0)}),u||n.splice(a+1,0,o),n}},Y5={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!zw(e.bind),parse:(e,t,n)=>i6(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init&&t.init[0],a=X5.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=qe(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...o?{init:Yo(o[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${H(u.field)}] : null`}]:[],bind:s[u.field]??s[u.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(l=>l.name===i+zs),o=i+Sf,a=r.items.map(l=>qe(`${i}_${l.field}`)),u=a.map(l=>`${l} !== null`).join(" && ");return a.length&&(s.update=`${u} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},ap="_toggle",K5={defined:e=>e.type==="point"&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+ap,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+zs,i=t.name+ap;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Mo(e)}}, `)+`${i} ? ${n} : null`}},Goe={defined:e=>e.clear!==void 0&&e.clear!==!1,parse:(e,t)=>{t.clear&&(t.clear=K(t.clear)?Hs(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(Y5.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===qe(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+zs);i(r,"null"),K5.defined(t)&&(r=n.findIndex(s=>s.name===t.name+ap),i(r,"false"))}return n}},J5={defined:e=>{const t=e.resolve==="global"&&e.bind&&zw(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Si;return t&&!n&&j(gne),t&&n},parse:(e,t,n)=>{const i=ue(n);if(i.select=K(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},i6(t,i),X(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=Y(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=$0(t.bind)?t.bind.legend:"click",s=K(r)?Hs(r,"view"):Y(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=$0(t.bind)&&t.bind.legend,s=o=>a=>{const u=ue(a);return u.markname=o,u};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${qe(o.field)}_legend`,u=`${i}_${a}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+zs),o=i+Sf,a=r.items.filter(d=>d.hasLegend).map(d=>qe(`${i}_${qe(d.field)}_legend`)),l=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:l}):a.length>0&&(s.update=l,delete s.value,delete s.on);const c=n.find(d=>d.name===i+ap),f=$0(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function Voe(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const s of kt(e.component.selection??{})){const o=s.project.hasField[i]??s.project.hasChannel[t];if(o&&J5.defined(s)){const a=n.get("selections")??[];a.push(s.name),n.set("selections",a,!1),o.hasLegend=!0}}}const Q5="_translate_anchor",Z5="_translate_delta",Xoe={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=zr.defined(t),s=i+Q5,{x:o,y:a}=t.project.hasChannel;let u=Hs(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+Ha,l))),n.push({name:s,value:{},on:[{events:u.map(l=>l.between[0]),update:"{x: x(unit), y: y(unit)"+(o!==void 0?`, extent_x: ${r?Py(e,We):`slice(${o.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?Py(e,bt):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+Z5,value:{},on:[{events:u,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&UA(e,t,o,"width",n),a!==void 0&&UA(e,t,a,"height",n),n}};function UA(e,t,n,i,r){const s=t.name,o=s+Q5,a=s+Z5,u=n.channel,l=zr.defined(t),c=r.find(E=>E.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d&&d.get("type"),p=d&&d.get("reverse"),g=l?u===We?p?"":"-":p?"-":"":"",m=`${o}.extent_${u}`,y=`${g}${a}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",x=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:l?x:`clampRange(${x}, 0, ${f})`})}const e6="_zoom_anchor",t6="_zoom_delta",Yoe={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=zr.defined(t),s=i+t6,{x:o,y:a}=t.project.hasChannel,u=H(e.scaleName(We)),l=H(e.scaleName(bt));let c=Hs(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+Ha,f))),n.push({name:i+e6,on:[{events:c,update:r?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&jA(e,t,o,"width",n),a!==void 0&&jA(e,t,a,"height",n),n}};function jA(e,t,n,i,r){const s=t.name,o=n.channel,a=zr.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(o),f=c&&c.get("type"),d=a?Py(e,o):u.name,h=s+t6,p=`${s}${e6}.${o}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const Ko="_store",zs="_tuple",Koe="_modify",n6="vlSelectionResolve",tm=[Moe,Foe,koe,K5,Y5,zr,J5,Goe,Xoe,Yoe,X5];function Joe(e){let t=e.parent;for(;t&&!On(t);)t=t.parent;return t}function Mo(e,{escape:t}={escape:!0}){let n=t?H(e.name):e.name;const i=Joe(e);if(i){const{facet:r}=i;for(const s of Gn)r[s]&&(n+=` + '__facet_${s}_' + (facet[${H(i.vgField(s))}])`)}return n}function Yw(e){return kt(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function i6(e,t){(K(t.select)||!t.select.on)&&delete e.events,(K(t.select)||!t.select.clear)&&delete e.clear,(K(t.select)||!t.select.toggle)&&delete e.toggle}function zy(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...zy(e.object)),t.push(...zy(e.property))),t)}function r6(e){return e.object.type==="MemberExpression"?r6(e.object):e.object.name==="datum"}function s6(e){const t=g2(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&r6(i)&&n.add(zy(i).slice(1).join("."))}),n}class Vu extends De{clone(){return new Vu(null,this.model,ue(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=up(this.model,this.filter,this),this._dependentFields=s6(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Qoe(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;for(const r of t){const s=qe(r.name),o=r.select,a=K(o)?o:o.type,u=X(o)?ue(o):{type:a},l=i[a];for(const d in l)d==="fields"||d==="encodings"||(d==="mark"&&(u.mark={...l.mark,...u.mark}),(u[d]===void 0||u[d]===!0)&&(u[d]=ue(l[d]??u[d])));const c=n[s]={...u,name:s,type:a,init:r.value,bind:r.bind,events:K(u.on)?Hs(u.on,"scope"):Y(ue(u.on))},f=ue(r);for(const d of tm)d.defined(c)&&d.parse&&d.parse(e,c,f)}return n}function o6(e,t,n,i="datum"){const r=K(t)?t:t.param,s=qe(r),o=H(s+Ko);let a;try{a=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const u=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=a.resolve==="global"?")":`, ${H(a.resolve)})`,c=`${u}${o}, ${i}${l}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function a6(e,t,n){const i=qe(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&j(`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${H(s)}.`);else if(r&&!s){const a=o.project.items.filter(u=>u.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,j((a.length?"Multiple ":"No ")+`matching ${H(r)} encoding found for selection ${H(n.param)}. Using "field": ${H(s)}.`)):s=a[0].field}return`${o.name}[${H(Zn(s))}]`}function Zoe(e,t){for(const[n,i]of Rs(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new gn(new Vu(t,e,{param:n}),r,Ke.Lookup,e.component.data.outputNodeRefCounts)}}function up(e,t,n){return nc(t,i=>K(i)?i:Fie(i)?o6(e,i,n):xN(i))}function eae(e,t){if(e)return L(e)&&!ls(e)?e.map(n=>Tw(n,t)).join(", "):e}function T0(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function jl(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:s,scale:o,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const p=h,g=Rre[p],m=c[p];if(g&&g!==t&&g!=="both")delete c[p];else if(Ef(m)){const{condition:y,...b}=m,v=Y(y),x=gA[p];if(x){const{vgProp:E,part:S}=x,w=[...v.map(_=>{const{test:$,...C}=_;return{test:up(null,$),...C}}),b];T0(c,S,E,w),delete c[p]}else if(x===null){const E={signal:v.map(S=>{const{test:w,..._}=S;return`${up(null,w)} ? ${Z$(_)} : `}).join("")+Z$(b)};c[p]=E}}else if(ee(m)){const y=gA[p];if(y){const{vgProp:b,part:v}=y;T0(c,v,b,m),delete c[p]}}ye(["labelAlign","labelBaseline"],p)&&c[p]===null&&delete c[p]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},Re(c.encode)&&delete c.encode}return{scale:o,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Ze(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&ee(c.encode.labels.update.text)&&(p=qo(a,"datum.label",c.encode.labels.update.text.signal)),T0(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of JN)e.hasAxisPart(p)||delete c.encode[p];Re(c.encode)&&delete c.encode}const h=eae(u,n);return{scale:o,orient:s,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:Ze(l,0)}}}}function u6(e){const{axes:t}=e.component,n=[];for(const i of Jr)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function tae(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>jl(r,"grid",t)),...i.map(r=>jl(r,"grid",t)),...n.map(r=>jl(r,"main",t)),...i.map(r=>jl(r,"main",t))].filter(r=>r)}function qA(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...I(o),...I(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${s}" ? ${hi(o[c])} : ${hi(a[c])}`};return l}return t[r]})])}function nae(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:_N(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=ee(n)?"axisOrient":`axis${ff(n)}`,a=[...r,...r.map(l=>s+l.substr(4))],u=["axis",o,s];return{vlOnlyAxisConfig:qA(a,i,e,n),vgAxisConfig:qA(u,i,e,n),axisConfigStyle:iae([...u,...a],i)}}function iae(e,t){var i;const n=[{}];for(const r of e){let s=(i=t[r])==null?void 0:i.style;if(s){s=Y(s);for(const o of s)n.push(t.style[o])}}return Object.assign.apply(null,n)}function Iy(e,t,n,i={}){var s;const r=QR(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((s=i[o])==null?void 0:s[e])!==void 0)return{configFrom:o,configValue:i[o][e]};return{}}const WA={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??rae(n,e),gridScale:({model:e,channel:t})=>sae(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||c6(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||l6(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??aae(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??uae(t.type,n,q(t)&&!!t.timeUnit,q(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??cae({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:fae,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=f6(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return eN(r?[hA(r)]:[],q(o)?[hA(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>dae(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??hae(n,t)};function rae(e,t){return!mt(e)&&q(t)&&!Ie(t==null?void 0:t.bin)&&!xt(t==null?void 0:t.bin)}function sae(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function oae(e,t,n,i,r){const s=t==null?void 0:t.labelAngle;if(s!==void 0)return ee(s)?s:Fc(s);{const{configValue:o}=Iy("labelAngle",i,t==null?void 0:t.style,r);return o!==void 0?Fc(o):n===We&&ye([bw,yw],e.type)&&!(q(e)&&e.timeUnit)?270:void 0}}function By(e){return`(((${e.signal} % 360) + 360) % 360)`}function l6(e,t,n,i){if(e!==void 0)if(n==="x"){if(ee(e)){const r=By(e),s=ee(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45<e&&e<135||225<e&&e<315)return"middle";if(ee(t)){const r=e<=45||315<=e?"===":"!==";return{signal:`${t.signal} ${r} "top" ? "bottom" : "top"`}}return(e<=45||315<=e)==(t==="top")?"bottom":"top"}else{if(ee(e)){const r=By(e),s=ee(t)?`(${t.signal} === "left")`:t==="left";return{signal:`${r} <= 45 || 315 <= ${r} || (135 <= ${r} && ${r} <= 225) ? ${i?'"middle"':"null"} : (45 <= ${r} && ${r} <= 135) === ${s} ? "top" : "bottom"`}}if(e<=45||315<=e||135<=e&&e<=225)return i?"middle":null;if(ee(t)){const r=45<=e&&e<=135?"===":"!==";return{signal:`${t.signal} ${r} "left" ? "top" : "bottom"`}}return(45<=e&&e<=135)==(t==="left")?"top":"bottom"}}function c6(e,t,n){if(e===void 0)return;const i=n==="x",r=i?0:90,s=i?"bottom":"left";if(ee(e)){const o=By(e),a=ee(t)?`(${t.signal} === "${s}")`:t===s;return{signal:`(${r?`(${o} + 90)`:o} % 180 === 0) ? ${i?null:'"center"'} :(${r} < ${o} && ${o} < ${180+r}) === ${a} ? "left" : "right"`}}if((e+r)%180===0)return i?null:"center";if(ee(t)){const o=r<e&&e<180+r?"===":"!==";return{signal:`${`${t.signal} ${o} "${s}"`} ? "left" : "right"`}}return(r<e&&e<180+r)==(t===s)?"left":"right"}function aae(e,t){if(t==="x"&&ye(["quantitative","temporal"],e))return!0}function uae(e,t,n,i){if(n&&!X(i)||e!=="nominal"&&e!=="ordinal")return t==="log"||t==="symlog"?"greedy":!0}function lae(e){return e==="x"?"bottom":"left"}function cae({fieldOrDatumDef:e,scaleType:t,size:n,values:i}){var r;if(!i&&!mt(t)&&t!=="log"){if(q(e)){if(Ie(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&ye(["month","hours","day","quarter"],(r=gt(e.timeUnit))==null?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}function fae({format:e,fieldOrDatumDef:t}){if(e==="d")return 1;if(q(t)){const{timeUnit:n}=t;if(n){const i=yN(n);if(i)return{signal:i}}}}function f6(e,t){const n=t==="x"?"x2":"y2",i=e.fieldDef(t),r=e.fieldDef(n),s=i?i.title:void 0,o=r?r.title:void 0;if(s&&o)return tN(s,o);if(s)return s;if(o)return o;if(s!==void 0)return s;if(o!==void 0)return o}function dae(e,t){const n=e.values;if(L(n))return KN(t,n);if(ee(n))return n}function hae(e,t){return e==="rect"&&tp(t)?1:0}class Su extends De{clone(){return new Su(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this._dependentFields=s6(this.transform.calculate)}static parseAllForSortIndex(t,n){return n.forEachFieldDef((i,r)=>{if(da(i)&&BN(i.sort)){const{field:s,timeUnit:o}=i,a=i.sort,u=a.map((l,c)=>`${xN({field:s,timeUnit:o,equal:l})} ? ${c} : `).join("")+a.length;t=new Su(t,{calculate:u,as:_u(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${be(this.transform)}`}}function _u(e,t,n){return V(e,{prefix:t,suffix:"sort_index",...n})}function nm(e,t){return ye(["top","bottom"],t)?"column":ye(["left","right"],t)||e==="row"?"row":"column"}function $u(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return Ze((t||{})[e],r[e],n.header[e])}function im(e,t,n,i){const r={};for(const s of e){const o=$u(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const Kw=["row","column"],Jw=["header","footer"];function pae(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=im(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=nm(t,a),l=Fc(o);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...h6(l,u),...d6(u,l,s),...p6(i,r,t,nse,g5)}}}function d6(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=c6(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function h6(e,t){const n=l6(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function gae(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of Jw)if(n[r])for(const s of n[r]){const o=yae(e,t,r,n,s);o!=null&&i.push(o)}return i}function mae(e,t){const{sort:n}=e;return Pr(n)?{field:V(n,{expr:"datum"}),order:n.order??"ascending"}:L(n)?{field:_u(e,t,{expr:"datum"}),order:"ascending"}:{field:V(e,{expr:"datum"}),order:n??"ascending"}}function Uy(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:u}=im(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=Aw({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=nm(t,a);return{text:{signal:u?qo(qo(u,"datum.label",l),"datum.value",V(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...h6(s,c),...d6(c,s,o),...p6(n,e,t,ise,m5)}}function yae(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=im(["labelOrient"],o.header,a,t);(t==="row"&&!ye(["top","bottom"],f)||t==="column"&&!ye(["left","right"],f))&&(s=Uy(o,t,a))}const u=On(e)&&!bf(e.facet),l=r.axes,c=(l==null?void 0:l.length)>0;if(s||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:mae(o,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const bae={column:{start:0,end:1},row:{start:1,end:0}};function vae(e,t){return bae[t][e]}function xae(e,t){const n={};for(const i of Gn){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:s,titleOrient:o}=im(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=nm(i,o),u=vae(s,a);u!==void 0&&(n[a]=u)}}return Re(n)?void 0:n}function p6(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=$u(o,t==null?void 0:t.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function Qw(e){return[...ed(e,"width"),...ed(e,"height"),...ed(e,"childWidth"),...ed(e,"childHeight")]}function ed(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(mt(o)&&la(a)){const u=e.scaleName(n);return On(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[HA(u,a)]:[HA(u,a),{name:r,update:g6(u,s,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=Dy(e.config.view,s?"width":"height"),u=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function HA(e,t){const n=`${e}_step`;return ee(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function g6(e,t,n){const i=t.get("type"),r=t.get("padding"),s=Ze(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${hi(o)}, ${hi(s)}) * ${e}_step`}function m6(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function y6(e,t){return I(e).reduce((n,i)=>({...n,...Gu({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Ue(r.value),invalidValueRef:void 0})}),{})}function b6(e,t){if(On(t))return e==="theta"?"independent":"shared";if(Ku(t))return"shared";if(sE(t))return et(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function Zw(e,t){const n=e.scale[t],i=et(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&j(Jne(t)),"independent"):e[i][t]||"shared"}const wae={...ose,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},v6=I(wae);class Eae extends Zr{}const GA={symbols:Sae,gradient:_ae,labels:$ae,entries:Aae};function Sae(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:u,mark:l}=n,c=o.filled&&l!=="trail";let f={...une({},n,tre),...H5(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,p=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=d===void 0?x6(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===vn)delete f.fill;else if(B(f.fill,"field"))h?delete f.fill:(f.fill=Ue(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Ue(g??1));else if(L(f.fill)){const m=jy(a.fill??a.color)??o.fill??(c&&o.color);m&&(f.fill=Ue(m))}}if(f.stroke){if(i==="stroke"||!c&&i===vn)delete f.stroke;else if(B(f.stroke,"field")||p)delete f.stroke;else if(L(f.stroke)){const m=Ze(jy(a.stroke||a.color),o.stroke,c?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==Kr){const m=q(t)&&E6(n,r,t);m?f.opacity=[{test:m,...Ue(g??1)},Ue(u.legend.unselectedOpacity)]:g&&(f.opacity=Ue(g))}return f={...f,...e},Re(f)?void 0:f}function _ae(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?x6(o.opacity)||s.opacity:void 0;return l&&(a.opacity=Ue(l)),a={...a,...e},Re(a)?void 0:a}function $ae(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=q(t)?E6(n,r,t):void 0,u=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=s;let f;Xo(c)?f=pi({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:o}):l===void 0&&c===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=pi({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&q(t)&&t.timeUnit===void 0&&(f=pi({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return Re(d)?void 0:d}function Aae(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function x6(e){return w6(e,(t,n)=>Math.max(t,n.value))}function jy(e){return w6(e,(t,n)=>Ze(t,n.value))}function w6(e,t){if(Ere(e))return Y(e.condition).reduce(t,e.value);if(wi(e))return e.value}function E6(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=H(n.field);return i.map(s=>`(!length(data(${H(qe(s)+Ko)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const VA={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return PN(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return zN(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??Oae(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??Rae(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??Cae(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>Wa(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(qa(n)&&Gi(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>kae(t,e)};function kae(e,t){const n=e.values;if(L(n))return KN(t,n);if(ee(n))return n}function Cae(e,t,n,i){if(t!=="shape"){const r=jy(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function Fae(e){const{legend:t}=e;return Ze(t.type,Tae(e))}function Tae({channel:e,timeUnit:t,scaleType:n}){if(qa(e)){if(ye(["quarter","month","day"],t))return"symbol";if(Gi(n))return"gradient"}return"symbol"}function Mae({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??Dae(n,t)}function Dae(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function Oae({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(Gi(r))return n==="horizontal"?i==="top"||i==="bottom"?XA(t,"width",o,s):o:XA(t,"height",u,a)}function XA(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function Rae(e){if(ye(["quantile","threshold","log","symlog"],e))return"greedy"}function S6(e){const t=Ge(e)?Nae(e):Iae(e);return e.component.legends=t,t}function Nae(e){const{encoding:t}=e,n={};for(const i of[vn,...b5]){const r=ot(t[i]);!r||!e.getScaleComponent(i)||i===xn&&q(r)&&r.type===Hu||(n[i]=zae(e,i))}return n}function Lae(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function Pae(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function zae(e,t){var x;let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new Eae({},Lae(e,t));Voe(e,t,a);const u=n!==void 0?!n:o.disable;if(a.set("disable",u,n!==void 0),u)return a;n=n||{};const l=e.getScaleComponent(t).get("type"),c=ot(r[t]),f=q(c)?(x=gt(c.timeUnit))==null?void 0:x.unit:void 0,d=n.orient||s.legend.orient||"right",h=Fae({legend:n,channel:t,timeUnit:f,scaleType:l}),p=Mae({legend:n,legendType:h,orient:d,legendConfig:o}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:o,config:s,scaleType:l,orient:d,legendType:h,direction:p};for(const E of v6){if(h==="gradient"&&E.startsWith("symbol")||h==="symbol"&&E.startsWith("gradient"))continue;const S=E in VA?VA[E](g):n[E];if(S!==void 0){const w=Pae(S,E,n,e.fieldDef(t));(w||s.legend[E]===void 0)&&a.set(E,S,w)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const E of["labels","legend","title","symbols","gradient","entries"]){const S=y6(m[E]??{},e),w=E in GA?GA[E](S,v):S;w!==void 0&&!Re(w)&&(b[E]={...y!=null&&y.length&&q(c)?{name:`${qe(c.field)}_legend_${E}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:w})}return Re(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function Iae(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){S6(i);for(const r of I(i.component.legends))n.legend[r]=Zw(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=_6(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of I(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function _6(e,t){var s,o,a,u;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of v6){const c=Ps(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return Bae(f,d);case"title":return nN(f,d);case"type":return r=!0,_n("symbol")}return Jg(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((o=(s=e.implicit)==null?void 0:s.encode)!=null&&o.gradient&&Kh(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&Kh(e.explicit,["encode","gradient"])),e}function Bae(e,t){return t.value==="circle"?t:e}function Uae(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function $6(e){const t=e.component.legends,n={};for(const r of I(t)){const s=e.getScaleComponent(r),o=Ne(s.get("domains"));if(n[o])for(const a of n[o])_6(a,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}return kt(n).flat().map(r=>jae(r,e.config)).filter(r=>r!==void 0)}function jae(e,t){var o,a,u;const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),(o=s.encode)!=null&&o.symbols){const l=s.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!s.stroke&&(l.stroke={value:"transparent"});for(const c of b5)s[c]&&delete l[c]}if(s.title||delete s.title,i!==void 0){let l=i;(u=(a=s.encode)==null?void 0:a.labels)!=null&&u.update&&ee(s.encode.labels.update.text)&&(l=qo(i,"datum.label",s.encode.labels.update.text.signal)),Uae(s,"labels","text",{signal:l})}return s}}function qae(e){return Ku(e)||sE(e)?Wae(e):A6(e)}function Wae(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),A6(e))}function A6(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const u=ee(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return ye(o,u)||o.push(u),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const Hae=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class k6 extends Zr{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function C6(e){e.component.projection=Ge(e)?Gae(e):Yae(e)}function Gae(e){if(e.hasProjection){const t=wt(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?Vae(e):void 0,s=new k6(e.projectionName(!0),{...wt(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function Vae(e){const t=[],{encoding:n}=e;for(const i of[[Ti,Fi],[ei,Mi]])(ot(n[i[0]])||ot(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(xn)&&e.typedFieldDef(xn).type===Hu&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Ke.Main)),t}function Xae(e,t){const n=G2(Hae,r=>!!(!J(e.explicit,r)&&!J(t.explicit,r)||J(e.explicit,r)&&J(t.explicit,r)&&Tn(e.get(r),t.get(r))));if(Tn(e.size,t.size)){if(n)return e;if(Tn(e.explicit,{}))return t;if(Tn(t.explicit,{}))return e}return null}function Yae(e){if(e.children.length===0)return;let t;for(const i of e.children)C6(i);const n=G2(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=Xae(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new k6(i,t.specifiedProjection,t.size,ue(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}}function Kae(e,t,n,i){if(wf(t,n)){const r=Ge(e)?e.axis(n)??e.legend(n)??{}:{},s=V(t,{expr:"datum"}),o=V(t,{expr:"datum",binSuffix:"end"});return{formulaAs:V(t,{binSuffix:"range",forAs:!0}),formula:yf(s,o,r.format,r.formatType,i)}}return{}}function F6(e,t){return`${XR(e)}_${t}`}function Jae(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function eE(e,t,n){const i=Hg(n,void 0)??{},r=F6(i,t);return e.getName(`${r}_bins`)}function Qae(e){return"as"in e}function YA(e,t,n){let i,r;Qae(e)?i=K(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[V(e,{forAs:!0}),V(e,{binSuffix:"end",forAs:!0})];const s={...Hg(t,void 0)},o=F6(s,e.field),{signal:a,extentSignal:u}=Jae(n,o);if(Rg(s.extent)){const c=s.extent;r=a6(n,c.param,c),delete s.extent}const l={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:o,binComponent:l}}class Ki extends De{clone(){return new Ki(null,ue(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{if(an(s)&&Ie(s.bin)){const{key:a,binComponent:u}=YA(s,s.bin,n);r[a]={...u,...r[a],...Kae(n,s,o,n.config)}}return r},{});return Re(i)?null:new Ki(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=YA(n,n.bin,i);return new Ki(t,{[r]:s})}merge(t,n){for(const i of I(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=Hi([...this.bins[i].as,...t.bins[i].as],be)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(kt(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(kt(this.bins).map(t=>t.field))}hash(){return`Bin ${be(this.bins)}`}assemble(){return kt(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...o}=t.bin,a={type:"bin",field:Zn(t.field),as:i,signal:t.signal,...Rg(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!s&&t.extentSignal&&(n.push({type:"extent",field:Zn(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const u of r)for(let l=0;l<2;l++)n.push({type:"formula",expr:V({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function Zae(e,t,n,i){var s;const r=Ge(i)?i.encoding[gr(t)]:void 0;if(an(n)&&Ge(i)&&jN(n,r,i.markDef,i.config)){e.add(V(n,{})),e.add(V(n,{suffix:"end"}));const{mark:o,markDef:a,config:u}=i,l=Ls({fieldDef:n,markDef:a,config:u});Tc(o)&&l!==.5&&et(t)&&(e.add(V(n,{suffix:Qg})),e.add(V(n,{suffix:Zg}))),n.bin&&wf(n,t)&&e.add(V(n,{binSuffix:"range"}))}else if(IR(t)){const o=zR(t);e.add(i.getName(o))}else e.add(V(n));return da(n)&&jie((s=n.scale)==null?void 0:s.range)&&e.add(n.scale.range.field),e}function eue(e,t){for(const n of I(t)){const i=t[n];for(const r of I(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class mi extends De{clone(){return new mi(null,new Set(this.dimensions),ue(this.measures))}constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(o=>{o.aggregate&&(i=!0)});const r={},s=new Set;return!i||(n.forEachFieldDef((o,a)=>{const{aggregate:u,field:l}=o;if(u)if(u==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([V(o,{forAs:!0})]);else{if(qr(u)||Js(u)){const c=qr(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([V({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([V(o,{forAs:!0})]);mr(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([V({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([V({field:l,aggregate:"max"},{forAs:!0})]))}else Zae(s,a,o,n)}),s.size+I(r).length===0)?null:new mi(t,s,r)}static makeFromTransform(t,n){var i;const r=new Set,s={};for(const o of n.aggregate){const{op:a,field:u,as:l}=o;a&&(a==="count"?(s["*"]??(s["*"]={}),s["*"].count=new Set([l||V(o,{forAs:!0})])):(s[u]??(s[u]={}),(i=s[u])[a]??(i[a]=new Set),s[u][a].add(l||V(o,{forAs:!0}))))}for(const o of n.groupby??[])r.add(o);return r.size+I(s).length===0?null:new mi(t,r,s)}merge(t){return TR(this.dimensions,t.dimensions)?(eue(this.measures,t.measures),!0):(hie("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...I(this.measures)])}producedFields(){const t=new Set;for(const n of I(this.measures))for(const i of I(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${be({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of I(this.measures))for(const o of I(this.measures[s]))for(const a of this.measures[s][o])i.push(a),t.push(o),n.push(s==="*"?null:Zn(s));return{type:"aggregate",groupby:[...this.dimensions].map(Zn),ops:t,fields:n,as:i}}}class Xu extends De{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const s of Gn){const o=n.facet[s];if(o){const{bin:a,sort:u}=o;this[s]={name:n.getName(`${s}_domain`),fields:[V(o),...Ie(a)?[V(o,{binSuffix:"end"})]:[]],...Pr(u)?{sortField:u}:L(u)?{sortIndexField:_u(o,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of Gn)this[n]&&(t+=` ${n.charAt(0)}:${be(this[n])}`);return t}get fields(){var n;const t=[];for(const i of Gn)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of Gn)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of Jr){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(mt(r)&&la(s)){const o=rm(this.childModel,n),a=rE(o);a?t[n]=a:j(ow(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],o=[],a=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),o.push("max")):(s.push(i[r]),o.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:u,sortIndexField:l}=this[t];if(u){const{op:c=jg,field:f}=u;s.push(f),o.push(c),a.push(V(u,{forAs:!0}))}else l&&(s.push(l),o.push("max"),a.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){var u;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const l of Kw){for(const c of Jw){const f=(i[l]&&i[l][c])??[];for(const d of f)if(((u=d.axes)==null?void 0:u.length)>0){s[l]=!0;break}}if(s[l]){const c=`length(data("${this.facet.name}"))`,f=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:o,column:a}=s;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:o}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),u=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:u}]})}for(const a of[Lr,Nr])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(o){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function KA(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function tue(e,t){const n=Y2(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=KA(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=KA(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return j(Ene(t)),null}function nue(e){const t={};return Ld(e.filter,n=>{if(vN(n)){let i=null;cw(n)?i=kn(n.equal):dw(n)?i=kn(n.lte):fw(n)?i=kn(n.lt):hw(n)?i=kn(n.gt):pw(n)?i=kn(n.gte):gw(n)?i=n.range[0]:mw(n)&&(i=(n.oneOf??n.in)[0]),i&&(ca(i)?t[n.field]="date":$e(i)?t[n.field]="number":K(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function iue(e){const t={};function n(i){xu(i)?t[i.field]="date":i.type==="quantitative"&&Zte(i.aggregate)?t[i.field]="number":hu(i.field)>1?i.field in t||(t[i.field]="flatten"):da(i)&&Pr(i.sort)&&hu(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Ge(e)||On(e))&&e.forEachFieldDef((i,r)=>{if(an(i))n(i);else{const s=aa(r),o=e.fieldDef(s);n({...i,type:o.type})}}),Ge(e)){const{mark:i,markDef:r,encoding:s}=e;if(Qs(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];q(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function rue(e){const t={};if(Ge(e)&&e.component.selection)for(const n of I(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&hu(r.field)>1&&(t[r.field]="flatten")}return t}class It extends De{clone(){return new It(null,ue(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${be(this._parse)}`}static makeExplicit(t,n,i){var o;let r={};const s=n.data;return!As(s)&&((o=s==null?void 0:s.format)!=null&&o.parse)&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of I(i)){const u=r.getWithExplicit(a);u.value!==void 0&&(u.explicit||u.value===i[a]||u.value==="derived"||i[a]==="flatten"?delete i[a]:j(sA(a,i[a],u.value)))}for(const a of I(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:j(sA(a,n[a],u)))}const s=new Zr(n,i);r.copyAll(s);const o={};for(const a of I(s.combine())){const u=s.get(a);u!==null&&(o[a]=u)}return I(o).length===0||r.parseNothing?null:new It(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of I(this._parse)){const i=this._parse[n];hu(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(I(this._parse))}dependentFields(){return new Set(I(this._parse))}assembleTransforms(t=!1){return I(this._parse).filter(n=>t?hu(n)>1:!0).map(n=>{const i=tue(n,this._parse[n]);return i?{type:"formula",expr:i,as:qu(n)}:null}).filter(n=>n!==null)}}class Is extends De{clone(){return new Is(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Si])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Si}}}class _f extends De{clone(){return new _f(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${be(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class $f extends De{clone(){return new $f(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${be(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Jo extends De{constructor(t){super(null),t??(t={name:"source"});let n;if(As(t)||(n=t.format?{...pn(t.format,["parse"])}:{}),Mc(t))this._data={values:t.values};else if(wu(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];ye(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else L5(t)?this._data={values:[{type:"Sphere"}]}:(R5(t)||As(t))&&(this._data={});this._generator=As(t),t.name&&(this._name=t.name),n&&!Re(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var JA=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},sue=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},ql;function tE(e){return e instanceof Jo||e instanceof _f||e instanceof $f}class nE{constructor(){ql.set(this,void 0),JA(this,ql,!1,"f")}setModified(){JA(this,ql,!0,"f")}get modifiedFlag(){return sue(this,ql,"f")}}ql=new WeakMap;class ha extends nE{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class iE extends nE{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class oue extends iE{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r<n.length;r++)i[n[r]]===void 0?i[n[r]]=[t.children[r]]:i[n[r]].push(t.children[r]);for(const r of I(i))i[r].length>1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class aue extends iE{constructor(t){super(),this.requiresSelectionId=t&&Yw(t)}run(t){t instanceof Is&&(this.requiresSelectionId&&(tE(t.parent)||t.parent instanceof mi||t.parent instanceof It)||(this.setModified(),t.remove()))}}class uue extends nE{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Yi&&(i=t.producedFields(),V2(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class lue extends iE{constructor(){super()}run(t){t instanceof gn&&!t.isRequired()&&(this.setModified(),t.remove())}}class cue extends ha{run(t){if(!tE(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof It)if(t instanceof It)this.setModified(),t.merge(n);else{if(X2(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class fue extends ha{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof It);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const u of I(a))u in r?r[u]!==a[u]&&s.add(u):r[u]=a[u]}for(const o of s)delete r[o];if(!Re(r)){this.setModified();const o=new It(t,r);for(const a of n){if(a instanceof It)for(const u of I(r))delete a.parse[u];t.removeChild(a),a.parent=o,a instanceof It&&I(a.parse).length===0&&a.remove()}}}}}class due extends ha{run(t){t instanceof gn||t.numChildren()>0||t instanceof Xu||t instanceof Jo||(this.setModified(),t.remove())}}class hue extends ha{run(t){const n=t.children.filter(r=>r instanceof Yi),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class pue extends ha{run(t){const n=t.children.filter(r=>r instanceof mi),i={};for(const r of n){const s=be(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of I(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class gue extends ha{constructor(t){super(),this.model=t}run(t){const n=!(tE(t)||t instanceof Vu||t instanceof It||t instanceof Is),i=[],r=[];for(const s of t.children)s instanceof Ki&&(n&&!X2(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const o of i)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Ki?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const o of r)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified()}}}class mue extends ha{run(t){const n=[...t.children];if(!du(n,o=>o instanceof gn)||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof gn){let a=o;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof gn)a=u;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class pa extends De{clone(){return new pa(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Hi(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??V(t)}hash(){return`JoinAggregateTransform ${be(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}class Au extends De{clone(){return new Au(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,i){const{config:r,markDef:s}=n,{marks:o,scales:a}=i;if(o==="include-invalid-values"&&a==="include-invalid-values")return null;const u=n.reduceFieldDef((l,c,f)=>{const d=mr(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=c,g=Sw({scaleChannel:f,markDef:s,config:r,scaleType:h,isCountAggregate:Og(p)});g!=="show"&&g!=="always-valid"&&(l[c.field]=c)}return l},{});return I(u).length?new Au(t,u):null}dependentFields(){return new Set(I(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${be(this.filter)}`}assemble(){const t=I(this.filter).reduce((n,i)=>{const r=this.filter[i],s=V(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (${qy(s)}))`):r.type==="quantitative"&&n.push(qy(s))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function qy(e){return`isValid(${e}) && isFinite(+${e})`}function yue(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=V(i);return r&&t.push(r),t},[])}function bue(e){return L(e)&&e.every(t=>K(t))&&e.length>1}class Ir extends De{clone(){return new Ir(null,ue(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:o="zero"}=n,a=[],u=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),u.push(Ze(f.order,"ascending"));const l={field:a,order:u};let c;return bue(s)?c=s:K(s)?c=[s,`${s}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new Ir(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:o,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:s,fieldChannel:o,offset:a,impute:u}=i,l=s.map(h=>{const p=r[h];return Ei(p)}).filter(h=>!!h),c=yue(n),f=n.encoding.order;let d;if(L(f)||q(f))d=ZR(f);else{const h=qN(f)?f.sort:o==="y"?"descending":"ascending";d=c.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new Ir(t,{dimensionFieldDefs:l,stackField:n.vgField(o),facetby:[],stackby:c,sort:d,offset:a,impute:u,as:[n.vgField(o,{suffix:"start",forAs:!0}),n.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${be(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[V(r,{binSuffix:"mid"})]:[V(r,{}),V(r,{binSuffix:"end"})]:[V(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:s,sort:o,offset:a,impute:u,as:l}=this._stack;if(u)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const h=V(c,{expr:"datum"}),p=V(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${qy(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:V(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:V(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:o,as:l,offset:a}),t}}class Yu extends De{clone(){return new Yu(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Hi(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??V(t)}hash(){return`WindowTransform ${be(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>rw(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...o!==void 0?{groupby:o}:{}};const a=[],u=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),u.push(f.order??"ascending");const l={field:a,order:u},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...o!==void 0?{groupby:o}:{},...s!==void 0?{frame:s}:{}}}}function vue(e){function t(n){if(!(n instanceof Xu)){const i=n.clone();if(i instanceof gn){const r=Hy+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof mi||i instanceof Ir||i instanceof Yu||i instanceof pa)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function Wy(e){if(e instanceof Xu)if(e.numChildren()===1&&!(e.children[0]instanceof gn)){const t=e.children[0];(t instanceof mi||t instanceof Ir||t instanceof Yu||t instanceof pa)&&t.addDimensions(e.fields),t.swapWithParent(),Wy(e)}else{const t=e.model.component.data.main;T6(t);const n=vue(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(Wy)}function T6(e){if(e instanceof gn&&e.type===Ke.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Xu||(t.swapWithParent(),T6(e))}}const Hy="scale_",td=5;function Gy(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!Gy(t.children))return!1}return!0}function ri(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function QA(e,t,n){let i=e.sources,r=!1;return r=ri(new lue,i)||r,r=ri(new aue(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=ri(new due,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=ri(new cue,i)||r,r=ri(new gue(t),i)||r,r=ri(new uue,i)||r,r=ri(new fue,i)||r,r=ri(new pue,i)||r,r=ri(new hue,i)||r,r=ri(new oue,i)||r,r=ri(new mue,i)||r),e.sources=i,r}function xue(e,t){Gy(e.sources);let n=0,i=0;for(let r=0;r<td&&QA(e,t,!0);r++)n++;e.sources.map(Wy);for(let r=0;r<td&&QA(e,t,!1);r++)i++;Gy(e.sources),Math.max(n,i)===td&&j(`Maximum optimization runs(${td}) reached.`)}class ft{constructor(t){Object.defineProperty(this,"signal",{enumerable:!0,get:t})}static fromName(t,n){return new ft(()=>t(n))}}function M6(e){Ge(e)?wue(e):Eue(e)}function wue(e){const t=e.component.scales;for(const n of I(t)){const i=_ue(e,n);if(t[n].setWithExplicit("domains",i),Aue(e,n),e.component.data.isFaceted){let s=e;for(;!On(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const a of i.value)Dr(a)&&(a.data=Hy+a.data.replace(Hy,""))}}}function Eue(e){for(const n of e.children)M6(n);const t=e.component.scales;for(const n of I(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=Ps(i,o.getWithExplicit("domains"),"domains","scale",Vy);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&j(bne),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function Sue(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=ZA(t,n);if(!r){j(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=ZA(t,n);if(r)return"unaggregated"}return e}function _ue(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=Sue(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&ot(i.x2)?ot(i.x)?Ps(rs(n,r,e,"x"),rs(n,r,e,"x2"),"domain","scale",Vy):rs(n,r,e,"x2"):t==="y"&&ot(i.y2)?ot(i.y)?Ps(rs(n,r,e,"y"),rs(n,r,e,"y2"),"domain","scale",Vy):rs(n,r,e,"y2"):rs(n,r,e,t)}function $ue(e,t,n){return e.map(i=>({signal:`{data: ${Gg(i,{timeUnit:n,type:t})}}`}))}function M0(e,t,n){var r;const i=(r=gt(n))==null?void 0:r.unit;return t==="temporal"||i?$ue(e,t,i):[e]}function rs(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:u}=n,l=ot(r[i]),{type:c}=l,f=l.timeUnit,d=voe({invalid:ir("invalid",s,a),isPath:Qs(o)});if(Uie(t)){const g=rs(e,void 0,n,i),m=M0(t.unionWith,c,f);return Bi([...m,...g.value])}else{if(ee(t))return Bi([t]);if(t&&t!=="unaggregated"&&!AN(t))return Bi(M0(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return _n([[0,1]]);const g=n.requestDataName(d);return _n([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const h=mr(i)&&q(l)?kue(n,i,e):void 0;if(yr(l)){const g=M0([l.datum],c,f);return _n(g)}const p=l;if(t==="unaggregated"){const{field:g}=l;return _n([{data:n.requestDataName(d),field:V({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:V({field:g,aggregate:"max"})}])}else if(Ie(p.bin)){if(mt(e))return _n(e==="bin-ordinal"?[]:[{data:Cc(h)?n.requestDataName(d):n.requestDataName(Ke.Raw),field:n.vgField(i,wf(p,i)?{binSuffix:"range"}:{}),sort:h===!0||!X(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:g}=p;if(Ie(g)){const m=eE(n,p.field,g);return _n([new ft(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return _n([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(p.timeUnit&&ye(["time","utc"],e)){const g=r[gr(i)];if(jN(p,g,s,a)){const m=n.requestDataName(d),y=Ls({fieldDef:p,fieldDef2:g,markDef:s,config:a}),b=Tc(o)&&y!==.5&&et(i);return _n([{data:m,field:n.vgField(i,b?{suffix:Qg}:{})},{data:m,field:n.vgField(i,{suffix:b?Zg:"end"})}])}}return _n(h?[{data:Cc(h)?n.requestDataName(d):n.requestDataName(Ke.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function D0(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":jg),...i?{field:Zn(i)}:{},...r?{order:r}:{}}}function Aue(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,s=AN(i)?i:void 0,o=ua(r)&&Rg(r.extent)?r.extent:void 0;(s||o)&&n.set("selectionExtent",s??o,!0)}function kue(e,t,n){if(!mt(n))return;const i=e.fieldDef(t),r=i.sort;if(BN(r))return{op:"min",field:_u(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(Pr(r)){const a=s&&!o.has(r.field);return D0(r,a)}else if(vre(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=s&&!o.has(f);if(qr(c)||Js(c))return D0({field:V(l),order:u},d);if(rw(c)||!c)return D0({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(ye(["ascending",void 0],r))return!0}}function ZA(e,t){const{aggregate:n,type:i}=e;return n?K(n)&&!tne.has(n)?{valid:!1,reason:Wne(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:Hne(e)}:{valid:!0}:{valid:!1,reason:qne(e)}}function Vy(e,t,n,i){return e.explicit&&t.explicit&&j(Kne(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Cue(e){const t=Hi(e.map(o=>{if(Dr(o)){const{sort:a,...u}=o;return u}return o}),be),n=Hi(e.map(o=>{if(Dr(o)){const a=o.sort;return a!==void 0&&!Cc(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(o=>o!==void 0),be);if(t.length===0)return;if(t.length===1){const o=e[0];if(Dr(o)&&n.length>0){let a=n[0];if(n.length>1){j(aA);const u=n.filter(l=>X(l)&&"op"in l&&l.op!=="min");n.every(l=>X(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(X(a)&&"field"in a){const u=a.field;o.field===u&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=Hi(n.map(o=>Cc(o)||!("op"in o)||K(o.op)&&J(Jte,o.op)?o:(j(Qne(o)),!0)),be);let r;i.length===1?r=i[0]:i.length>1&&(j(aA),r=!0);const s=Hi(e.map(o=>Dr(o)?o.data:null),o=>o);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function rE(e){if(Dr(e)&&K(e.field))return e.field;if(nne(e)){let t;for(const n of e.fields)if(Dr(n)&&K(n.field)){if(!t)t=n.field;else if(t!==n.field)return j(Zne),t}return j(eie),t}else if(ine(e)){j(tie);const t=e.fields[0];return K(t)?t:void 0}}function rm(e,t){const i=e.component.scales[t].get("domains").map(r=>(Dr(r)&&(r.data=e.lookupDataSource(r.data)),r));return Cue(i)}function D6(e){return Ku(e)||sE(e)?e.children.reduce((t,n)=>t.concat(D6(n)),ek(e)):ek(e)}function ek(e){return I(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:u,range:l,reverse:c,...f}=r,d=Fue(r.range,s,n,e),h=rm(e,n),p=a?$oe(e,a,i,h):null;return t.push({name:s,type:o,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function Fue(e,t,n,i){if(et(n)){if(la(e))return{step:{signal:`${t}_step`}}}else if(X(e)&&Dr(e))return{...e,data:i.lookupDataSource(e.data)};return e}class O6 extends Zr{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(ye([Et.LOG,Et.TIME,Et.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&ye([Et.LINEAR,Et.SQRT,Et.POW],t))return"definitely";const i=this.get("domains");if(i.length>0){let r=!1,s=!1,o=!1;for(const a of i){if(L(a)){const u=a[0],l=a[a.length-1];if($e(u)&&$e(l))if(u<=0&&l>=0){r=!0;continue}else{s=!0;continue}}o=!0}if(r)return"definitely";if(s&&!o)return"definitely-not"}return"maybe"}}const Tue=["range","scheme"];function Mue(e){const t=e.component.scales;for(const n of iw){const i=t[n];if(!i)continue;const r=Due(n,e);i.setWithExplicit("range",r)}}function tk(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,s=wn(t),o=e.getName(s);if(X(i)&&i.binned&&i.step!==void 0)return new ft(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${u})`});if(Ie(i)){const a=eE(e,r,i);return new ft(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(o)} / (${l})`})}}}function Due(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of Tue)if(n[f]!==void 0){const d=Fy(s,f),h=kN(e,f);if(!d)j(oN(s,f,e));else if(h)j(h);else switch(f){case"range":{const p=n.range;if(L(p)){if(et(e))return Bi(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return ft.fromName(y,m)}return g}))}else if(X(p))return Bi({data:t.requestDataName(Ke.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return Bi(p)}case"scheme":return Bi(Oue(n[f]))}}const o=e===We||e==="xOffset"?"width":"height",a=i[o];if(sr(a)){if(et(e))if(mt(s)){const f=N6(a,t,e);if(f)return Bi({step:f})}else j(aN(o));else if(pf(e)){const f=e===Gs?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=L6(a,s);if(p)return Bi(p)}}}const{rangeMin:u,rangeMax:l}=n,c=Rue(e,t);return(u!==void 0||l!==void 0)&&Fy(s,"rangeMin")&&L(c)&&c.length===2?Bi([u??c[0],l??c[1]]):_n(c)}function Oue(e){return Bie(e)?{scheme:e.name,...pn(e,["name"])}:{scheme:e}}function R6(e,t,n,{center:i}={}){const r=wn(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===bt&&xi(n)?i?[ft.fromName(a=>`${o(a)}/2`,s),ft.fromName(a=>`-${o(a)}/2`,s)]:[ft.fromName(o,s),0]:i?[ft.fromName(a=>`-${o(a)}/2`,s),ft.fromName(a=>`${o(a)}/2`,s)]:[0,ft.fromName(o,s)]}function Rue(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=ot(s[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case We:case bt:{if(ye(["point","band"],u)){const f=P6(e,n,i.view);if(sr(f))return{step:N6(f,t,e)}}return R6(e,t,u)}case Gs:case Wu:return Nue(e,t,u);case Yr:{const f=zue(r,i),d=Iue(r,n,t,i);return yu(u)?Pue(f,d,Lue(u,i,l,e)):[f,d]}case ni:return[0,Math.PI*2];case oa:return[0,360];case Ci:return[0,new ft(()=>{const f=t.getSignalName(On(t.parent)?"child_width":"width"),d=t.getSignalName(On(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case Ys:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Ks:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case xn:return"symbol";case vn:case hr:case pr:return u==="ordinal"?o==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case Kr:case Vs:case Xs:return[i.scale.minOpacity,i.scale.maxOpacity]}}function N6(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=Z2(n),o=i[s];if(x5({step:e,offsetIsDiscrete:le(o)&&wN(o.type)})==="offset"&&e5(i,s)){const u=t.getScaleComponent(s);let c=`domain('${t.scaleName(s)}').length`;if(u.get("type")==="band"){const d=u.get("paddingInner")??u.get("padding")??0,h=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${ane(f)})`}}else return e.step}function L6(e,t){if(x5({step:e,offsetIsDiscrete:mt(t)})==="offset")return{step:e.step}}function Nue(e,t,n){const i=e===Gs?"x":"y",r=t.getScaleComponent(i);if(!r)return R6(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:u}=t;if(s==="band"){const l=P6(i,t.size,t.config.view);if(sr(l)){const c=L6(l,n);if(c)return c}return[0,{signal:`bandwidth('${o}')`}]}else{const l=t.encoding[i];if(q(l)&&l.timeUnit){const c=yN(l.timeUnit,p=>`scale('${o}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=Ls({fieldDef:l,markDef:a,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const p=ee(f)?`${f.signal}/2`+h:`${f/2+d}`,g=ee(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return CR(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function P6(e,t,n){const i=e===We?"width":"height",r=t[i];return r||sp(n,i)}function Lue(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&L(n)?n.length+1:(j(cie(i)),3)}}function Pue(e,t,n){const i=()=>{const r=hi(t),s=hi(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return ee(t)?new ft(i):{signal:i()}}function zue(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(Ng("size",e))}const nk=.95;function Iue(e,t,n,i){const r={x:tk(n,"x"),y:tk(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=ik(t,r,i.view);return $e(s)?s-1:new ft(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=ik(t,r,i.view);return $e(s)?Math.pow(nk*s,2):new ft(()=>`pow(${nk} * ${s.signal}, 2)`)}}throw new Error(Ng("size",e))}function ik(e,t,n){const i=sr(e.width)?e.width.step:Oy(n,"width"),r=sr(e.height)?e.height.step:Oy(n,"height");return t.x||t.y?new ft(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function z6(e,t){Ge(e)?Bue(e,t):B6(e,t)}function Bue(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of I(n)){const u=o[a],l=n[a],c=e.getScaleComponent(a),f=ot(r[a]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=Fy(h,t),y=kN(a,t);if(d!==void 0&&(m?y&&j(y):j(oN(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":ca(u[t])||v==="temporal"||b?l.set(t,{signal:Gg(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=B(rk,t)?rk[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:s,config:i,hasNestedOffsetScale:t5(r,a),hasSecondaryRangeChannel:!!r[gr(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const rk={bins:({model:e,fieldOrDatumDef:t})=>q(t)?Uue(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>jue(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>que(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>Wue(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>Hue(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>Gue(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=q(e)?e.sort:void 0;return Vue(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>Xue(e,t,n,i,r,s.scale,o)};function I6(e){Ge(e)?Mue(e):B6(e,"range")}function B6(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?I6(i):z6(i,t);for(const i of I(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=Ps(r,a,t,"scale",O5((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function Uue(e,t){const n=t.bin;if(Ie(n)){const i=eE(e,t.field,n);return new ft(()=>e.getSignalName(i))}else if(xt(n)&&ua(n)&&n.step!==void 0)return{step:n.step}}function jue(e,t){if(ye([vn,hr,pr],e)&&t!=="nominal")return"hcl"}function que(e,t,n,i,r,s){var o;if(!((o=Ei(s))!=null&&o.bin||L(n)||r!=null||i!=null||ye([Et.TIME,Et.UTC],e)))return et(t)?!0:void 0}function Wue(e,t,n,i,r,s){if(et(e)){if(Gi(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(q(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===Et.POINT)return n.pointPadding}}function Hue(e,t,n,i,r,s=!1){if(e===void 0){if(et(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return s?c:Ze(o,n==="bar"?a:n==="tick"?l:u)}else if(pf(t)&&i===Et.BAND)return r.offsetBandPaddingInner}}function Gue(e,t,n,i,r,s=!1){if(e===void 0){if(et(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===Et.BAND)return Ze(o,ee(i)?{signal:`${i.signal}/2`}:i/2)}else if(pf(t)){if(n===Et.POINT)return .5;if(n===Et.BAND)return r.offsetBandPaddingOuter}}}function Vue(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return xi(e)&&t==="descending"?ee(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(xi(e)&&t==="descending")return!0}function Xue(e,t,n,i,r,s,o){if(!!n&&n!=="unaggregated"&&xi(r)){if(L(n)){const u=n[0],l=n[n.length-1];if($e(u)&&u<=0&&$e(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!yu(r))return!0;if(!(q(t)&&t.bin)&&ye([...Jr,...qte],e)){const{orient:u,type:l}=i;return ye(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:ye(["bar","area"],l)&&!o?!0:s==null?void 0:s.zero}return!1}function Yue(e,t,n,i,r=!1){const s=Kue(t,n,i,r),{type:o}=e;return mr(t)?o!==void 0?Vie(t,o)?q(n)&&!Gie(o,n.type)?(j(Xne(o,s)),s):o:(j(Vne(t,o,s)),s):s:null}function Kue(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(qa(e)||E0(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&j(S0(e,"ordinal")),"ordinal";if(et(e)||pf(e)){if(ye(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in nw)return"band";const s=n[wn(e)];return Vo(s)||vu(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return qa(e)?"time":E0(e)==="discrete"?(j(S0(e,"temporal")),"ordinal"):q(t)&&t.timeUnit&&gt(t.timeUnit).utc?"utc":"time";case"quantitative":return qa(e)?q(t)&&Ie(t.bin)?"bin-ordinal":"linear":E0(e)==="discrete"?(j(S0(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(rN(t.type))}function Jue(e,{ignoreRange:t}={}){U6(e),M6(e);for(const n of Hie)z6(e,n);t||I6(e)}function U6(e){Ge(e)?e.component.scales=Que(e):e.component.scales=ele(e)}function Que(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of iw){const o=ot(t[s]);if(o&&n===TN&&s===xn&&o.type===Hu)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const u=t5(t,s),l=Yue(a,s,o,i,u);r[s]=new O6(e.scaleName(`${s}`,!0),{value:l,explicit:a.type===l})}}return r}const Zue=O5((e,t)=>lA(e)-lA(t));function ele(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){U6(s);for(const o of I(s.component.scales))if((t=r.scale)[o]??(t[o]=b6(o,e)),r.scale[o]==="shared"){const a=i[o],u=s.component.scales[o].getWithExplicit("type");a?Nie(a.value,u.value)?i[o]=Ps(a,u,"type","scale",Zue):(r.scale[o]="independent",delete i[o]):i[o]=u}}for(const s of I(i)){const o=e.scaleName(s,!0),a=i[s];n[s]=new O6(o,a);for(const u of e.children){const l=u.component.scales[s];l&&(u.renameScale(l.get("name"),o),l.merged=!0)}}return n}class O0{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function Ge(e){return(e==null?void 0:e.type)==="unit"}function On(e){return(e==null?void 0:e.type)==="facet"}function sE(e){return(e==null?void 0:e.type)==="concat"}function Ku(e){return(e==null?void 0:e.type)==="layer"}class oE{constructor(t,n,i,r,s,o,a){this.type=n,this.parent=i,this.config=s,this.correctDataNames=u=>{var l,c,f;return(l=u.from)!=null&&l.data&&(u.from.data=this.lookupDataSource(u.from.data)),(f=(c=u.from)==null?void 0:c.facet)!=null&&f.data&&(u.from.facet.data=this.lookupDataSource(u.from.facet.data)),u},this.parent=i,this.config=s,this.view=wt(a),this.name=t.name??r,this.title=ls(t.title)?{text:t.title}:t.title?wt(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new O0,this.projectionNameMap=i?i.projectionNameMap:new O0,this.signalNameMap=i?i.signalNameMap:new O0,this.data=t.data,this.description=t.description,this.transforms=aoe(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:fse(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:qg(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new Zr,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?ue(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){Jue(this)}parseProjection(){C6(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){S6(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of I(i)){const o=i[s];o!==void 0&&(r[s]=Ue(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Ue(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:Re(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=xae(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of Gn)t[i].title&&n.push(pae(this,i));for(const i of Kw)n=n.concat(gae(this,i));return n}assembleAxes(){return tae(this.component.axes,this.config)}assembleLegends(){return $6(this)}assembleProjections(){return qae(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...YR(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return ye(["unit","layer"],this.type)?ye(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),Re(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||On(this.parent)?D6(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return qe((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Ke[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(On(this.parent)){const n=m6(t),i=Dg(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(mt(s)&&la(o)){const a=r.get("name"),u=rm(this,i),l=rE(u);if(l){const c=V({aggregate:"distinct",field:l},{expr:"datum"});return{signal:g6(a,r,c)}}else return j(ow(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(UR(t)&&mr(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(dne(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class j6 extends oE{vgField(t,n={}){const i=this.fieldDef(t);if(i)return V(i,n)}reduceFieldDef(t,n){return Bre(this.getMapping(),(i,r,s)=>{const o=Ei(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){Dw(this.getMapping(),(i,r)=>{const s=Ei(i);s&&t(s,r)},n)}}class sm extends De{clone(){return new sm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"];const r=this.transform.resolve??"shared";this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${be(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class om extends De{clone(){return new om(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${be(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class am extends De{clone(){return new am(this.parent,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,o)=>r[o]??s)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${be(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class um extends De{clone(){return new um(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${be(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class Ga extends De{clone(){return new Ga(null,ue(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Ti,Fi],[ei,Mi]]){const s=r.map(o=>{const a=ot(n.encoding[o]);return q(a)?a.field:yr(a)?{expr:`${a.datum}`}:wi(a)?{expr:`${a.value}`}:void 0});(s[0]||s[1])&&(t=new Ga(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(xn)){const r=n.typedFieldDef(xn);r.type===Hu&&(t=new Ga(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(K);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${be(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class Dc extends De{clone(){return new Dc(null,this.projection,ue(this.fields),ue(this.as))}constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Ti,Fi],[ei,Mi]]){const r=i.map(o=>{const a=ot(n.encoding[o]);return q(a)?a.field:yr(a)?{expr:`${a.datum}`}:wi(a)?{expr:`${a.value}`}:void 0}),s=i[0]===ei?"2":"";(r[0]||r[1])&&(t=new Dc(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(K))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${be(this.fields)} ${be(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class Do extends De{clone(){return new Do(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new Do(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(q(r)&&q(s)){const o=r.impute?r:s.impute?s:void 0;if(o===void 0)return;const a=r.impute?s:s.impute?r:void 0,{method:u,value:l,frame:c,keyvals:f}=o.impute,d=r5(n.mark,i);return new Do(t,{impute:o.field,key:a.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${be(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:o,frame:a=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...i?{keyvals:jse(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?o:null};if(r&&r!=="value"){const l={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...s?{groupby:s}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}}class lm extends De{clone(){return new lm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${be(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class Oc extends De{clone(){return new Oc(null,ue(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const s=n.component.data.sources,{from:o}=i;let a=null;if(qse(o)){let u=H6(o.data,s);u||(u=new Jo(o.data),s.push(u));const l=n.getName(`lookup_${r}`);a=new gn(u,l,Ke.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(Wse(o)){const u=o.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(qe(u),u)}catch{throw new Error(mne(u))}if(a=l.materialized,!a)throw new Error(yne(u))}return new Oc(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?Y(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${be({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:Y(this.transform.as)}:{}};else{let n=this.transform.as;K(n)||(j($ne),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class cm extends De{clone(){return new cm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${be(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class fm extends De{clone(){return new fm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=ue(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${be(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class dm extends De{clone(){return new dm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=Hi((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${be(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class hm extends De{clone(){return new hm(null,ue(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${be(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function q6(e){let t=0;function n(i,r){if(i instanceof Jo&&!i.isGenerator&&!wu(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof It&&(i.parent instanceof Jo&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Xu){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof _f||i instanceof $f||i instanceof Au||i instanceof Vu||i instanceof Su||i instanceof Dc||i instanceof mi||i instanceof Oc||i instanceof Yu||i instanceof pa||i instanceof um||i instanceof am||i instanceof sm||i instanceof lm||i instanceof cm||i instanceof fm||i instanceof Is||i instanceof hm||i instanceof dm||i instanceof om)&&r.transform.push(i.assemble()),(i instanceof Ki||i instanceof Yi||i instanceof Do||i instanceof Ir||i instanceof Ga)&&r.transform.push(...i.assemble()),i instanceof gn&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof gn?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof gn&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children)n(o,{name:null,source:s,transform:[]});break}}}return n}function tle(e){const t=[],n=q6(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function nle(e,t){const n=[],i=q6(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function ile(e){return e==="top"||e==="left"||ee(e)?"header":"footer"}function rle(e){for(const t of Gn)sle(e,t);sk(e,"x"),sk(e,"y")}function sle(e,t){var o;const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const a=n[t],u=$u("title",null,i,t);let l=Wa(a,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=L(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=$u("labelOrient",a.header,i,t),f=a.header!==null?Ze((o=a.header)==null?void 0:o.labels,i.header.labels,!0):!1,d=ye(["bottom","right"],c)?"footer":"header";s.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[W6(e,t,f)]}}}function W6(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function sk(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=Zw(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const u=ile(a.get("orient"));o[u]??(o[u]=[W6(e,s,!1)]);const l=jl(a,"main",e.config,{header:!0});l&&o[u][0].axes.push(l),a.mainExtracted=!0}}}}function ole(e){aE(e),lp(e,"width"),lp(e,"height")}function ale(e){aE(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";lp(e,t),lp(e,n)}function aE(e){for(const t of e.children)t.parseLayoutSize()}function lp(e,t){const n=m6(t),i=Dg(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const u=a.component.layoutSize.getWithExplicit(n),l=r.scale[i]??b6(i,e);if(l==="independent"&&u.value==="step"){o=void 0;break}if(o){if(l==="independent"&&o.value!==u.value){o=void 0;break}o=Ps(o,u,n,"")}else o=u}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function ule(e){const{size:t,component:n}=e;for(const i of Jr){const r=wn(i);if(t[r]){const s=t[r];n.layoutSize.set(r,sr(s)?"step":s,!0)}else{const s=lle(e,r);n.layoutSize.set(r,s,!1)}}}function lle(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(mt(s)){const a=sp(i.view,t);return la(o)||sr(a)?"step":a}else return Dy(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Dy(i.view,t);{const s=sp(i.view,t);return sr(s)?s.step:s}}}function Xy(e,t,n){return V(t,{suffix:`by_${V(e)}`,...n})}class rc extends j6{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=dE(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!bf(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=I(t),i={};for(const r of n){if(![Nr,Lr].includes(r)){j(Ng(r,"facet"));break}const s=t[r];if(s.field===void 0){j(ky(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=Mw(t,n);return i.header?i.header=wt(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return B(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=pm(this),this.child.parseData()}parseLayoutSize(){aE(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),rle(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of Gn)for(const i of Jw){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:o}=r;if(o){const a=$u("titleOrient",o.header,this.config,n);if(["right","bottom"].includes(a)){const u=nm(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(s!=null&&s[0]){const a=n==="row"?"height":"width",u=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[u]??(t[u]={}),t[u][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof rc))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof rc?{...this.channelHasField("column")?{encode:{update:{columns:{field:V(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof rc){if(this.child.channelHasField("column")){const r=V(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of Jr){const s=this.child.component.scales[r];if(s&&!s.merged){const o=s.get("type"),a=s.get("range");if(mt(o)&&la(a)){const u=rm(this.child,r),l=rE(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):j(ow(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:s,ops:o,as:a}=this.getCardinalityAggregateForChild(),u=[];for(const c of Gn){const f=this.facet[c];if(f){u.push(V(f));const{bin:d,sort:h}=f;if(Ie(d)&&u.push(V(f,{binSuffix:"end"})),Pr(h)){const{field:p,op:g=jg}=h,m=Xy(f,h);i&&r?(s.push(m),o.push("max"),a.push(m)):(s.push(p),o.push(g),a.push(m))}else if(L(h)){const p=_u(f,c);s.push(p),o.push("max"),a.push(p)}}}const l=!!i&&!!r;return{name:t,data:n,groupby:u,...l||s.length>0?{aggregate:{...l?{cross:l}:{},...s.length?{fields:s,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?Pr(i.sort)?[Xy(i,i.sort,{expr:"datum"})]:L(i.sort)?[_u(i,t,{expr:"datum"})]:[V(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(Pr(r)?r.order:!L(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return Uy(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const s of Kw)if(t[s]){const o=$u("labelOrient",(r=t[s])==null?void 0:r.header,n,s);if(i[s].includes(o))return Uy(t[s],s,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=tle(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),o=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...s?{title:s}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:Gn.map(u=>this.facetSortFields(u)).flat(),order:Gn.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(woe(this,[]))}]}getMapping(){return this.facet}}function cle(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(Pr(s.sort)){const{field:o,op:a=jg}=s.sort;e=r=new pa(e,{joinaggregate:[{op:a,field:o,as:Xy(s,s.sort,{forAs:!0})}],groupby:[V(s)]})}return r}return null}function H6(e,t){var n,i,r,s;for(const o of t){const a=o.data;if(e.name&&o.hasName()&&e.name!==o.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=a.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(s=a.format)==null?void 0:s.mesh;if(!((u||f)&&u!==f)){if(Mc(e)&&Mc(a)){if(Tn(e.values,a.values))return o}else if(wu(e)&&wu(a)){if(e.url===a.url)return o}else if(R5(e)&&e.name===o.dataName)return o}}return null}function fle(e,t){if(e.data||!e.parent){if(e.data===null){const i=new Jo({values:[]});return t.push(i),i}const n=H6(e.data,t);if(n)return As(e.data)||(n.data.format=FR({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new Jo(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function dle(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(eoe(r))o=e=new Su(e,r),s="derived";else if(qw(r)){const a=nue(r);o=e=It.makeWithAncestors(e,{},a,n)??e,e=new Vu(e,t,r.filter)}else if(F5(r))o=e=Ki.makeFromTransform(e,r,t),s="number";else if(noe(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new It(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=Yi.makeFromTransform(e,r);else if(ioe(r))o=e=mi.makeFromTransform(e,r),s="number",Yw(t)&&(e=new Is(e));else if(C5(r))o=e=Oc.make(e,t,r,i++),s="derived";else if(Jse(r))o=e=new Yu(e,r),s="number";else if(Qse(r))o=e=new pa(e,r),s="number";else if(roe(r))o=e=Ir.makeFromTransform(e,r),s="derived";else if(soe(r))o=e=new um(e,r),s="derived";else if(ooe(r))o=e=new om(e,r),s="derived";else if(Zse(r))o=e=new am(e,r),s="derived";else if(Hse(r))o=e=new dm(e,r),s="derived";else if(Kse(r))e=new hm(e,r);else if(toe(r))o=e=Do.makeFromTransform(e,r),s="derived";else if(Gse(r))o=e=new sm(e,r),s="derived";else if(Vse(r))o=e=new cm(e,r),s="derived";else if(Xse(r))o=e=new fm(e,r),s="derived";else if(Yse(r))o=e=new lm(e,r),s="derived";else{j(_ne(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function pm(e){var m;let t=fle(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(As(r)||wu(r)||Mc(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new boe;As(r)?(N5(r)?t=new $f(t,r.sequence):Ww(r)&&(t=new _f(t,r.graticule)),o.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(o.parseNothing=!0),t=It.makeExplicit(t,e,o)??t,t=new Is(t);const a=e.parent&&Ku(e.parent);(Ge(e)||On(e))&&a&&(t=Ki.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=dle(t,e,o));const u=rue(e),l=iue(e);t=It.makeWithAncestors(t,{},{...u,...l},o)??t,Ge(e)&&(t=Ga.parseAll(t,e),t=Dc.parseAll(t,e)),(Ge(e)||On(e))&&(a||(t=Ki.makeFromEncoding(t,e)??t),t=Yi.makeFromEncoding(t,e)??t,t=Su.parseAllForSortIndex(t,e));const c=t=nd(Ke.Raw,e,t);if(Ge(e)){const y=mi.makeFromEncoding(t,e);y&&(t=y,Yw(e)&&(t=new Is(t))),t=Do.makeFromEncoding(t,e)??t,t=Ir.makeFromEncoding(t,e)??t}let f,d;if(Ge(e)){const{markDef:y,mark:b,config:v}=e,x=Oe("invalid",y,v),{marks:E,scales:S}=d=P5({invalid:x,isPath:Qs(b)});E!==S&&S==="include-invalid-values"&&(f=t=nd(Ke.PreFilterInvalid,e,t)),E==="exclude-invalid-values"&&(t=Au.make(t,e,d)??t)}const h=t=nd(Ke.Main,e,t);let p;if(Ge(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=Au.make(t,e,d)??t,p=t=nd(Ke.PostFilterInvalid,e,t))}Ge(e)&&Zoe(e,h);let g=null;if(On(e)){const y=e.getName("facet");t=cle(t,e.facet)??t,g=new Xu(t,e,y,h.getSource()),n[y]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:g,ancestorParse:o,preFilterInvalid:f,postFilterInvalid:p}}function nd(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,s=t.getDataName(e),o=new gn(n,s,e,r);return i[s]=o,o}class hle extends oE{constructor(t,n,i,r){var s,o,a,u;super(t,"concat",n,i,r,t.resolve),(((o=(s=t.resolve)==null?void 0:s.axis)==null?void 0:o.x)==="shared"||((u=(a=t.resolve)==null?void 0:a.axis)==null?void 0:u.y)==="shared")&&j(wne),this.children=this.getChildren(t).map((l,c)=>dE(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=pm(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of I(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return Yg(t)?t.vconcat:Uw(t)?t.hconcat:t.concat}parseLayoutSize(){ale(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=Qw(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function ple(e){return e===!1||e===null}const gle={disable:1,gridScale:1,scale:1,...QN,labelExpr:1,encode:1},G6=I(gle);class uE extends Zr{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new uE(ue(this.explicit),ue(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!ple(this.get(t))}hasOrientSignalRef(){return ee(this.explicit.orient)}}function mle(e,t,n){const{encoding:i,config:r}=e,s=ot(i[t])??ot(i[gr(t)]),o=e.axis(t)||{},{format:a,formatType:u}=o;if(Xo(u))return{text:pi({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(bu(s)==="quantitative"){if(vu(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:pi({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:pi({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(bu(s)==="temporal"&&r.timeFormatType&&q(s)&&!s.timeUnit)return{text:pi({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function yle(e){return Jr.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[_le(n,e)]),t),{})}const ble={bottom:"top",top:"bottom",left:"right",right:"left"};function vle(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of I(r.component.axes))n.axis[s]=Zw(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=xle(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of Jr){for(const s of e.children)if(s.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:u}=o.getWithExplicit("orient");if(!ee(a)){if(i[a]>0&&!u){const l=ble[a];i[a]>i[l]&&o.set("orient",l,!1)}i[a]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function xle(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;i<n;i++){const r=e[i],s=t[i];if(!!r!=!!s)return;if(r&&s){const o=r.getWithExplicit("orient"),a=s.getWithExplicit("orient");if(o.explicit&&a.explicit&&o.value!==a.value)return;e[i]=wle(r,s)}}}else return t.map(n=>n.clone());return e}function wle(e,t){for(const n of G6){const i=Ps(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return nN(r,s);case"gridScale":return{explicit:r.explicit,value:Ze(r.value,s.value)}}return Jg(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function Ele(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(ee(n.labelAngle)?n.labelAngle:Fc(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===f6(i,r))return!0}return e===n[t]}const Sle=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function _le(e,t){var y,b;let n=t.axis(e);const i=new uE,r=ot(t.encoding[e]),{mark:s,config:o}=t,a=(n==null?void 0:n.orient)||((y=o[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=o.axis)==null?void 0:b.orient)||lae(e),u=t.getScaleComponent(e).get("type"),l=nae(e,u,a,t.config),c=n!==void 0?!n:Iy("disable",o.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=oae(r,n,e,o.style,l),d=zN(n.formatType,r,u),h=PN(r,r.type,n.format,n.formatType,o,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:h,formatType:d,mark:s,config:o};for(const v of G6){const x=v in WA?WA[v](p):mA(v)?n[v]:void 0,E=x!==void 0,S=Ele(x,v,n,t,e);if(E&&S)i.set(v,x,S);else{const{configValue:w=void 0,configFrom:_=void 0}=mA(v)&&v!=="values"?Iy(v,o.style,n.style,l):{},$=w!==void 0;E&&!$?i.set(v,x,S):(_!=="vgAxisConfig"||Sle.has(v)&&$||Ef(w)||ee(w))&&i.set(v,w,!1)}}const g=n.encoding??{},m=JN.reduce((v,x)=>{if(!i.hasAxisPart(x))return v;const E=y6(g[x]??{},t),S=x==="labels"?mle(t,e,E):E;return S!==void 0&&!Re(S)&&(v[x]={update:S}),v},{});return Re(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function $le({encoding:e,size:t}){for(const n of Jr){const i=wn(n);sr(t[i])&&xs(e[n])&&(delete t[i],j(aN(i)))}return t}const Ale={vgMark:"arc",encodeEntry:e=>({...ii(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...tn("x",e,{defaultPos:"mid"}),...tn("y",e,{defaultPos:"mid"}),...Wr(e,"radius"),...Wr(e,"theta")})},kle={vgMark:"area",encodeEntry:e=>({...ii(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...op("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...op("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...Xw(e)})},Cle={vgMark:"rect",encodeEntry:e=>({...ii(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Wr(e,"x"),...Wr(e,"y")})},Fle={vgMark:"shape",encodeEntry:e=>({...ii(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&q(n)&&n.type===Hu?{field:V(n,{expr:"datum"})}:{}}]}},Tle={vgMark:"image",encodeEntry:e=>({...ii(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Wr(e,"x"),...Wr(e,"y"),...Gw(e,"url")})},Mle={vgMark:"line",encodeEntry:e=>({...ii(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...tn("x",e,{defaultPos:"mid"}),...tn("y",e,{defaultPos:"mid"}),...St("size",e,{vgChannel:"strokeWidth"}),...Xw(e)})},Dle={vgMark:"trail",encodeEntry:e=>({...ii(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...tn("x",e,{defaultPos:"mid"}),...tn("y",e,{defaultPos:"mid"}),...St("size",e),...Xw(e)})};function lE(e,t){const{config:n}=e;return{...ii(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...tn("x",e,{defaultPos:"mid"}),...tn("y",e,{defaultPos:"mid"}),...St("size",e),...St("angle",e),...Ole(e,n,t)}}function Ole(e,t,n){return n?{shape:{value:n}}:St("shape",e)}const Rle={vgMark:"symbol",encodeEntry:e=>lE(e)},Nle={vgMark:"symbol",encodeEntry:e=>lE(e,"circle")},Lle={vgMark:"symbol",encodeEntry:e=>lE(e,"square")},Ple={vgMark:"rect",encodeEntry:e=>({...ii(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Wr(e,"x"),...Wr(e,"y")})},zle={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...ii(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...op("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...op("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...St("size",e,{vgChannel:"strokeWidth"})}}},Ile={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...ii(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...tn("x",e,{defaultPos:"mid"}),...tn("y",e,{defaultPos:"mid"}),...Gw(e),...St("size",e,{vgChannel:"fontSize"}),...St("angle",e),...BA("align",Ble(e.markDef,n,t)),...BA("baseline",Ule(e.markDef,n,t)),...tn("radius",e,{defaultPos:null}),...tn("theta",e,{defaultPos:null})}}};function Ble(e,t,n){if(Oe("align",e,n)===void 0)return"center"}function Ule(e,t,n){if(Oe("baseline",e,n)===void 0)return"middle"}const jle={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",s=i==="horizontal"?"y":"x",o=i==="horizontal"?"height":"width";return{...ii(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Wr(e,r),...tn(s,e,{defaultPos:"mid",vgChannel:s==="y"?"yc":"xc"}),[o]:Ue(Oe("thickness",n,t))}}},id={arc:Ale,area:kle,bar:Cle,circle:Nle,geoshape:Fle,image:Tle,line:Mle,point:Rle,rect:Ple,rule:zle,square:Lle,text:Ile,tick:jle,trail:Dle};function qle(e){if(ye([Bg,zg,Jie],e.mark)){const t=r5(e.mark,e.encoding);if(t.length>0)return Wle(e,t)}else if(e.mark===Ig){const t=$y.some(n=>Oe(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return Hle(e)}return cE(e)}const ok="faceted_path_";function Wle(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:ok+e.requestDataName(Ke.Main),data:e.requestDataName(Ke.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:cE(e,{fromPrefix:ok})}]}const ak="stack_group_";function Hle(e){var l;const[t]=cE(e,{fromPrefix:ak}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...fu(t.encode.update,["y","yc","y2","height",...$y]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...pn(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...fu(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...pn(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of $y){const f=ir(c,e.markDef,e.config);t.encode.update[c]?(s[c]=t.encode.update[c],delete t.encode.update[c]):f&&(s[c]=Ue(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((l=e.stack.groupbyChannels)==null?void 0:l.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=V(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(V(f,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=ir(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Ue(d)}:c}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Ke.Main),name:ak+e.requestDataName(Ke.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function Gle(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!L(o)&&wi(o)&&Sy(o.value)||!o&&Sy(Oe("order",r,s)))){if((L(o)||q(o))&&!n)return ZR(o,{expr:"datum"});if(Qs(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(q(u))return{field:a}}}}function cE(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,o=Ze(i.clip,Vle(e),Xle(e)),a=JR(i),u=r.key,l=Gle(e),c=Yle(e),f=Oe("aria",i,s),d=id[n].postEncodingTransform?id[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:id[n].vgMark,...o?{clip:o}:{},...a?{style:a}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Ke.Main)},encode:{update:id[n].encodeEntry(e)},...d?{transform:d}:{}}]}function Vle(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function Xle(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function Yle(e){if(!e.component.selection)return null;const t=I(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=I(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class V6 extends j6{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,bA(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[];const o=rr(t.mark)?{...t.mark}:{type:t.mark},a=o.type;o.filled===void 0&&(o.filled=Rse(o,s,{graticule:t.data&&Ww(t.data)}));const u=this.encoding=zre(t.encoding||{},a,o.filled,s);this.markDef=$5(o,u,s),this.size=$le({encoding:u,size:bA(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=_5(this.markDef,u),this.specifiedScales=this.initScales(a,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>Iw(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===TN,i=t&&Rte.some(r=>le(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return iw.reduce((i,r)=>{const s=ot(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=wt(t);return L(n)&&(r.domain=n.map(kn)),L(i)&&(r.range=i.map(kn)),r}initAxes(t){return Jr.reduce((n,i)=>{const r=t[i];if(le(r)||i===We&&le(t.x2)||i===bt&&le(t.y2)){const s=le(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=I(t),i={};for(const r of n){const s=t[r];i[r]=Ef(s)?KR(s):kn(s)}return i}initLegends(t){return Wte.reduce((n,i)=>{const r=ot(t[i]);if(r&&Gte(i)){const s=r.legend;n[i]=s&&wt(s)}return n},{})}parseData(){this.component.data=pm(this)}parseLayoutSize(){ule(this)}parseSelections(){this.component.selection=Qoe(this,this.selection)}parseMarkGroup(){this.component.mark=qle(this)}parseAxesAndHeaders(){this.component.axes=yle(this)}assembleSelectionTopLevelSignals(t){return Eoe(this,t)}assembleSignals(){return[...u6(this),...xoe(this,[])]}assembleSelectionData(t){return Soe(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return Qw(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Ku(this.parent))&&(t=I5(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return To(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Ei(n)}typedFieldDef(t){const n=this.fieldDef(t);return an(n)?n:null}}class fE extends oE{constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,u)=>{if(Kg(a))return new fE(a,this,this.getName(`layer_${u}`),o,s);if(Qr(a))return new V6(a,this,this.getName(`layer_${u}`),o,s);throw new Error(sw(a))})}parseData(){this.component.data=pm(this);for(const t of this.children)t.parseData()}parseLayoutSize(){ole(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of I(t.component.selection))this.component.selection[n]=t.component.selection[n]}}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){vle(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),u6(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),Qw(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of Y(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return _oe(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),$6(this))}}function dE(e,t,n,i,r){if(qg(e))return new rc(e,t,n,r);if(Kg(e))return new fE(e,t,n,i,r);if(Qr(e))return new V6(e,t,n,i,r);if(use(e))return new hle(e,t,n,r);throw new Error(sw(e))}function Kle(e,t={}){t.logger&&fie(t.logger),t.fieldTitle&&XN(t.fieldTitle);try{const n=S5(Fu(t.config,e.config)),i=D5(e,n),r=dE(i,null,"",void 0,n);return r.parse(),xue(r.component.data,r),{spec:Qle(r,Jle(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&die(),t.fieldTitle&&Fre()}}function Jle(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):K(t)&&(t={type:t}),r&&s&&goe(t.type)){if(r==="step"&&s==="step")j(nA()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";j(nA(Dg(o)));const a=o==="width"?"height":"width";t.type=moe(a)}}return{...I(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...TA(n,!1),...TA(e,!0)}}function Qle(e,t,n={},i){const r=e.config?Ese(e.config):void 0,s=[].concat(e.assembleSelectionData([]),nle(e.component.data,n)),o=e.assembleProjections(),a=e.assembleTitle(),u=e.assembleGroupStyle(),l=e.assembleGroupEncodeEntry(!0);let c=e.assembleLayoutSignals();c=c.filter(h=>(h.name==="width"||h.name==="height")&&h.value!==void 0?(t[h.name]=+h.value,!1):!0);const{params:f,...d}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...d,...a?{title:a}:{},...u?{style:u}:{},...l?{encode:{update:l}}:{},data:s,...o.length>0?{projections:o}:{},...e.assembleGroup([...c,...e.assembleSelectionTopLevelSignals([]),...v5(f)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const Zle=Cte.version,ece=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:hu,accessPathWithDatum:Y2,compile:Kle,contains:ye,deepEqual:Tn,deleteNestedProperty:Kh,duplicate:ue,entries:Rs,every:G2,fieldIntersection:X2,flatAccessWithDatum:MR,getFirstDefined:Ze,hasIntersection:V2,hasProperty:B,hash:be,internalField:RR,isBoolean:Cc,isEmpty:Re,isEqual:Tte,isInternalField:NR,isNullOrFalse:Sy,isNumeric:Ag,keys:I,logicalExpr:nc,mergeDeep:FR,never:CR,normalize:D5,normalizeAngle:Fc,omit:pn,pick:fu,prefixGenerator:_y,removePathFromField:qu,replaceAll:qo,replacePathInField:Zn,resetIdCounter:Dte,setEqual:TR,some:du,stringify:Ne,titleCase:ff,unique:Hi,uniqueId:OR,vals:kt,varName:qe,version:Zle},Symbol.toStringTag,{value:"Module"}));function X6(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var tce="vega-themes",nce="2.15.0",ice="Themes for stylized Vega and Vega-Lite visualizations.",rce=["vega","vega-lite","themes","style"],sce="BSD-3-Clause",oce={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"},ace=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}],uce="build/vega-themes.js",lce="build/vega-themes.module.js",cce="build/vega-themes.min.js",fce="build/vega-themes.min.js",dce="build/vega-themes.module.d.ts",hce={type:"git",url:"https://github.com/vega/vega-themes.git"},pce=["src","build"],gce={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",format:"eslint . --fix",lint:"eslint .",release:"release-it"},mce={"@babel/core":"^7.24.6","@babel/plugin-transform-runtime":"^7.24.6","@babel/preset-env":"^7.24.6","@babel/preset-typescript":"^7.24.6","@release-it/conventional-changelog":"^8.0.1","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","@typescript-eslint/eslint-plugin":"^7.11.0","@typescript-eslint/parser":"^7.11.0","browser-sync":"^3.0.2",concurrently:"^8.2.2",eslint:"^8.45.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","gh-pages":"^6.1.1",prettier:"^3.2.5","release-it":"^17.3.0",rollup:"^4.18.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.4.5",typescript:"^5.4.5",vega:"^5.25.0","vega-lite":"^5.9.3"},yce={vega:"*","vega-lite":"*"},bce={},vce={name:tce,version:nce,description:ice,keywords:rce,license:sce,author:oce,contributors:ace,main:uce,module:lce,unpkg:cce,jsdelivr:fce,types:dce,repository:hce,files:pce,scripts:gce,devDependencies:mce,peerDependencies:yce,dependencies:bce};const ka="#fff",uk="#888",xce={background:"#333",view:{stroke:uk},title:{color:ka,subtitleColor:ka},style:{"guide-label":{fill:ka},"guide-title":{fill:ka}},axis:{domainColor:ka,gridColor:uk,tickColor:ka}},so="#4572a7",wce={background:"#fff",arc:{fill:so},area:{fill:so},line:{stroke:so,strokeWidth:2},path:{stroke:so},rect:{fill:so},shape:{stroke:so},symbol:{fill:so,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},oo="#30a2da",R0="#cbcbcb",Ece="#999",Sce="#333",lk="#f0f0f0",ck="#333",_ce={arc:{fill:oo},area:{fill:oo},axis:{domainColor:R0,grid:!0,gridColor:R0,gridWidth:1,labelColor:Ece,labelFontSize:10,titleColor:Sce,tickColor:R0,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:lk,group:{fill:lk},legend:{labelColor:ck,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:ck,titleFontSize:14,titlePadding:10},line:{stroke:oo,strokeWidth:2},path:{stroke:oo,strokeWidth:.5},rect:{fill:oo},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:oo},bar:{binSpacing:2,fill:oo,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},ao="#000",$ce={group:{fill:"#e5e5e5"},arc:{fill:ao},area:{fill:ao},line:{stroke:ao},path:{stroke:ao},rect:{fill:ao},shape:{stroke:ao},symbol:{fill:ao,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Ace=22,kce="normal",fk="Benton Gothic, sans-serif",dk=11.5,Cce="normal",uo="#82c6df",N0="Benton Gothic Bold, sans-serif",hk="normal",pk=13,vl={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]},Fce={background:"#ffffff",title:{anchor:"start",color:"#000000",font:N0,fontSize:Ace,fontWeight:kce},arc:{fill:uo},area:{fill:uo},line:{stroke:uo,strokeWidth:2},path:{stroke:uo},rect:{fill:uo},shape:{stroke:uo},symbol:{fill:uo,size:30},axis:{labelFont:fk,labelFontSize:dk,labelFontWeight:Cce,titleFont:N0,titleFontSize:pk,titleFontWeight:hk},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:fk,labelFontSize:dk,symbolType:"square",titleFont:N0,titleFontSize:pk,titleFontWeight:hk},range:{category:vl["category-6"],diverging:vl["fireandice-6"],heatmap:vl["fire-7"],ordinal:vl["fire-7"],ramp:vl["fire-7"]}},lo="#ab5787",rd="#979797",Tce={background:"#f9f9f9",arc:{fill:lo},area:{fill:lo},line:{stroke:lo},path:{stroke:lo},rect:{fill:lo},shape:{stroke:lo},symbol:{fill:lo,size:30},axis:{domainColor:rd,domainWidth:.5,gridWidth:.2,labelColor:rd,tickColor:rd,tickWidth:.2,titleColor:rd},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},co="#3e5c69",Mce={background:"#fff",arc:{fill:co},area:{fill:co},line:{stroke:co},path:{stroke:co},rect:{fill:co},shape:{stroke:co},symbol:{fill:co},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Bn="#1696d2",gk="#000000",Dce="#FFFFFF",sd="Lato",L0="Lato",Oce="Lato",Rce="#DEDDDD",Nce=18,xl={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},Lce={background:Dce,title:{anchor:"start",fontSize:Nce,font:sd},axisX:{domain:!0,domainColor:gk,domainWidth:1,grid:!1,labelFontSize:12,labelFont:L0,labelAngle:0,tickColor:gk,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:sd},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:Rce,gridWidth:1,labelFontSize:12,labelFont:L0,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:sd,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:L0,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:sd,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:xl["six-groups-cat-1"],diverging:xl["diverging-colors"],heatmap:xl["diverging-colors"],ordinal:xl["six-groups-seq"],ramp:xl["shades-blue"]},area:{fill:Bn},rect:{fill:Bn},line:{color:Bn,stroke:Bn,strokeWidth:5},trail:{color:Bn,stroke:Bn,strokeWidth:0,size:1},path:{stroke:Bn,strokeWidth:.5},point:{filled:!0},text:{font:Oce,color:Bn,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Bn,stroke:null}},arc:{fill:Bn},shape:{stroke:Bn},symbol:{fill:Bn,size:30}},fo="#3366CC",mk="#ccc",od="Arial, sans-serif",Pce={arc:{fill:fo},area:{fill:fo},path:{stroke:fo},rect:{fill:fo},shape:{stroke:fo},symbol:{stroke:fo},circle:{fill:fo},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:od,fontSize:12},"guide-title":{font:od,fontSize:12},"group-title":{font:od,fontSize:12}},title:{font:od,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:mk,tickColor:mk,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},hE=e=>e*(1/3+1),yk=hE(9),bk=hE(10),vk=hE(12),wl="Segoe UI",xk="wf_standard-font, helvetica, arial, sans-serif",wk="#252423",El="#605E5C",Ek="transparent",zce="#C8C6C4",oi="#118DFF",Ice="#12239E",Bce="#E66C37",Uce="#6B007B",jce="#E044A7",qce="#744EC2",Wce="#D9B300",Hce="#D64550",Y6=oi,K6="#DEEFFF",Sk=[K6,Y6],Gce=[K6,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",Y6],Vce={view:{stroke:Ek},background:Ek,font:wl,header:{titleFont:xk,titleFontSize:vk,titleColor:wk,labelFont:wl,labelFontSize:bk,labelColor:El},axis:{ticks:!1,grid:!1,domain:!1,labelColor:El,labelFontSize:yk,titleFont:xk,titleColor:wk,titleFontSize:vk,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:zce,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:oi},line:{stroke:oi,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:wl,fontSize:yk,fill:El},arc:{fill:oi},area:{fill:oi,line:!0,opacity:.6},path:{stroke:oi},rect:{fill:oi},point:{fill:oi,filled:!0,size:75},shape:{stroke:oi},symbol:{fill:oi,strokeWidth:1.5,size:50},legend:{titleFont:wl,titleFontWeight:"bold",titleColor:El,labelFont:wl,labelFontSize:bk,labelColor:El,symbolType:"circle",symbolSize:75},range:{category:[oi,Ice,Bce,Uce,jce,qce,Wce,Hce],diverging:Sk,heatmap:Sk,ordinal:Gce}},P0='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',Xce='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',z0=400,ad={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},Yce=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],Kce=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function gm({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=ad.gridBg[e],r=ad.textPrimary[e],s=ad.textSecondary[e],o=n==="dark"?Yce:Kce,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:P0,fontWeight:600},axis:{labelColor:s,labelFontSize:12,labelFont:Xce,labelFontWeight:z0,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:ad.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:P0,fill:s,fontWeight:z0},"guide-title":{font:P0,fill:s,fontWeight:z0}},range:{category:o,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const Jce=gm({theme:"white",background:"#ffffff"}),Qce=gm({theme:"g10",background:"#f4f4f4"}),Zce=gm({theme:"g90",background:"#262626"}),efe=gm({theme:"g100",background:"#161616"}),tfe=vce.version,nfe=Object.freeze(Object.defineProperty({__proto__:null,carbong10:Qce,carbong100:efe,carbong90:Zce,carbonwhite:Jce,dark:xce,excel:wce,fivethirtyeight:_ce,ggplot2:$ce,googlecharts:Pce,latimes:Fce,powerbi:Vce,quartz:Tce,urbaninstitute:Lce,version:tfe,vox:Mce},Symbol.toStringTag,{value:"Module"}));function ife(e,t,n,i){if(L(e))return`[${e.map(r=>t(K(r)?r:_k(r,n))).join(", ")}]`;if(X(e)){let r="";const{title:s,image:o,...a}=e;s&&(r+=`<h2>${t(s)}</h2>`),o&&(r+=`<img src="${new URL(t(o),i||location.href).href}">`);const u=Object.keys(a);if(u.length>0){r+="<table>";for(const l of u){let c=a[l];c!==void 0&&(X(c)&&(c=_k(c,n)),r+=`<tr><td class="key">${t(l)}</td><td class="value">${t(c)}</td></tr>`)}r+="</table>"}return r||"{}"}return t(e)}function rfe(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function _k(e,t){return JSON.stringify(e,rfe(t))}var sfe=`#vg-tooltip-element {
25
- visibility: hidden;
26
- padding: 8px;
27
- position: fixed;
28
- z-index: 1000;
29
- font-family: sans-serif;
30
- font-size: 11px;
31
- border-radius: 3px;
32
- box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
33
- /* The default theme is the light theme. */
34
- background-color: rgba(255, 255, 255, 0.95);
35
- border: 1px solid #d9d9d9;
36
- color: black;
37
- }
38
- #vg-tooltip-element.visible {
39
- visibility: visible;
40
- }
41
- #vg-tooltip-element h2 {
42
- margin-top: 0;
43
- margin-bottom: 10px;
44
- font-size: 13px;
45
- }
46
- #vg-tooltip-element table {
47
- border-spacing: 0;
48
- }
49
- #vg-tooltip-element table tr {
50
- border: none;
51
- }
52
- #vg-tooltip-element table tr td {
53
- overflow: hidden;
54
- text-overflow: ellipsis;
55
- padding-top: 2px;
56
- padding-bottom: 2px;
57
- }
58
- #vg-tooltip-element table tr td.key {
59
- color: #808080;
60
- max-width: 150px;
61
- text-align: right;
62
- padding-right: 4px;
63
- }
64
- #vg-tooltip-element table tr td.value {
65
- display: block;
66
- max-width: 300px;
67
- max-height: 7em;
68
- text-align: left;
69
- }
70
- #vg-tooltip-element.dark-theme {
71
- background-color: rgba(32, 32, 32, 0.9);
72
- border: 1px solid #f5f5f5;
73
- color: white;
74
- }
75
- #vg-tooltip-element.dark-theme td.key {
76
- color: #bfbfbf;
77
- }
78
- `;const J6="vg-tooltip-element",ofe={offsetX:10,offsetY:10,id:J6,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:afe,maxDepth:2,formatTooltip:ife,baseURL:""};function afe(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;")}function ufe(e){if(!/^[A-Za-z]+[-:.\w]*$/.test(e))throw new Error("Invalid HTML ID");return sfe.toString().replace(J6,e)}function lfe(e,t,n,i){let r=e.clientX+n;r+t.width>window.innerWidth&&(r=+e.clientX-n-t.width);let s=e.clientY+i;return s+t.height>window.innerHeight&&(s=+e.clientY-i-t.height),{x:r,y:s}}class cfe{constructor(t){this.options={...ofe,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=ufe(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:s,y:o}=lfe(n,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`,this.el.style.left=`${s}px`}}var I0={};function ffe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}class dfe{constructor(){this.max=1e3,this.map=new Map}get(t){const n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){const r=this.map.keys().next().value;this.delete(r)}this.map.set(t,n)}return this}}var hfe=dfe;const pfe=Object.freeze({loose:!0}),gfe=Object.freeze({}),mfe=e=>e?typeof e!="object"?pfe:e:gfe;var pE=mfe,Yy={exports:{}};const yfe="2.0.0",Q6=256,bfe=Number.MAX_SAFE_INTEGER||9007199254740991,vfe=16,xfe=Q6-6,wfe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var gE={MAX_LENGTH:Q6,MAX_SAFE_COMPONENT_LENGTH:vfe,MAX_SAFE_BUILD_LENGTH:xfe,MAX_SAFE_INTEGER:bfe,RELEASE_TYPES:wfe,SEMVER_SPEC_VERSION:yfe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const Efe=typeof process=="object"&&I0&&I0.NODE_DEBUG&&/\bsemver\b/i.test(I0.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var mm=Efe;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=gE,s=mm;t=e.exports={};const o=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=g=>{for(const[m,y]of d)g=g.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return g},p=(g,m,y)=>{const b=h(m),v=c++;s(g,v,m),l[g]=v,u[v]=m,o[v]=new RegExp(m,y?"g":void 0),a[v]=new RegExp(b,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),p("FULL",`^${u[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),p("LOOSE",`^${u[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),p("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",u[l.COERCE],!0),p("COERCERTLFULL",u[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Yy,Yy.exports);var mE=Yy.exports;const $k=/^[0-9]+$/,Z6=(e,t)=>{const n=$k.test(e),i=$k.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1},Sfe=(e,t)=>Z6(t,e);var _fe={compareIdentifiers:Z6,rcompareIdentifiers:Sfe};const ud=mm,{MAX_LENGTH:Ak,MAX_SAFE_INTEGER:ld}=gE,{safeRe:kk,t:Ck}=mE,$fe=pE,{compareIdentifiers:Ca}=_fe;let Afe=class Pi{constructor(t,n){if(n=$fe(n),t instanceof Pi){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ak)throw new TypeError(`version is longer than ${Ak} characters`);ud("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const i=t.trim().match(n.loose?kk[Ck.LOOSE]:kk[Ck.FULL]);if(!i)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>ld||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ld||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ld||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){const s=+r;if(s>=0&&s<ld)return s}return r}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(ud("SemVer.compare",this.version,this.options,t),!(t instanceof Pi)){if(typeof t=="string"&&t===this.version)return 0;t=new Pi(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Pi||(t=new Pi(t,this.options)),Ca(this.major,t.major)||Ca(this.minor,t.minor)||Ca(this.patch,t.patch)}comparePre(t){if(t instanceof Pi||(t=new Pi(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const i=this.prerelease[n],r=t.prerelease[n];if(ud("prerelease compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Ca(i,r)}while(++n)}compareBuild(t){t instanceof Pi||(t=new Pi(t,this.options));let n=0;do{const i=this.build[n],r=t.build[n];if(ud("build compare",n,i,r),i===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(i===void 0)return-1;if(i===r)continue;return Ca(i,r)}while(++n)}inc(t,n,i){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,i),this.inc("pre",n,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,i),this.inc("pre",n,i);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const r=Number(i)?1:0;if(!n&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[r];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(n){let s=[n,r];i===!1&&(s=[n]),Ca(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var yE=Afe;const Fk=yE,kfe=(e,t,n)=>new Fk(e,n).compare(new Fk(t,n));var Ju=kfe;const Cfe=Ju,Ffe=(e,t,n)=>Cfe(e,t,n)===0;var Tfe=Ffe;const Mfe=Ju,Dfe=(e,t,n)=>Mfe(e,t,n)!==0;var Ofe=Dfe;const Rfe=Ju,Nfe=(e,t,n)=>Rfe(e,t,n)>0;var Lfe=Nfe;const Pfe=Ju,zfe=(e,t,n)=>Pfe(e,t,n)>=0;var Ife=zfe;const Bfe=Ju,Ufe=(e,t,n)=>Bfe(e,t,n)<0;var jfe=Ufe;const qfe=Ju,Wfe=(e,t,n)=>qfe(e,t,n)<=0;var Hfe=Wfe;const Gfe=Tfe,Vfe=Ofe,Xfe=Lfe,Yfe=Ife,Kfe=jfe,Jfe=Hfe,Qfe=(e,t,n,i)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return Gfe(e,n,i);case"!=":return Vfe(e,n,i);case">":return Xfe(e,n,i);case">=":return Yfe(e,n,i);case"<":return Kfe(e,n,i);case"<=":return Jfe(e,n,i);default:throw new TypeError(`Invalid operator: ${t}`)}};var Zfe=Qfe,B0,Tk;function ede(){if(Tk)return B0;Tk=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}B0=t;const n=pE,{safeRe:i,t:r}=mE,s=Zfe,o=mm,a=yE,u=eL();return B0}var U0,Mk;function eL(){if(Mk)return U0;Mk=1;class e{constructor(F,A){if(A=i(A),F instanceof e)return F.loose===!!A.loose&&F.includePrerelease===!!A.includePrerelease?F:new e(F.raw,A);if(F instanceof r)return this.raw=F.value,this.set=[[F]],this.format(),this;if(this.options=A,this.loose=!!A.loose,this.includePrerelease=!!A.includePrerelease,this.raw=F.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(M=>this.parseRange(M.trim())).filter(M=>M.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const M=this.set[0];if(this.set=this.set.filter(P=>!p(P[0])),this.set.length===0)this.set=[M];else if(this.set.length>1){for(const P of this.set)if(P.length===1&&g(P[0])){this.set=[P];break}}}this.format()}format(){return this.range=this.set.map(F=>F.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(F){const M=((this.options.includePrerelease&&d)|(this.options.loose&&h))+":"+F,P=n.get(M);if(P)return P;const z=this.options.loose,U=z?a[u.HYPHENRANGELOOSE]:a[u.HYPHENRANGE];F=F.replace(U,T(this.options.includePrerelease)),s("hyphen replace",F),F=F.replace(a[u.COMPARATORTRIM],l),s("comparator trim",F),F=F.replace(a[u.TILDETRIM],c),s("tilde trim",F),F=F.replace(a[u.CARETTRIM],f),s("caret trim",F);let te=F.split(" ").map(we=>y(we,this.options)).join(" ").split(/\s+/).map(we=>C(we,this.options));z&&(te=te.filter(we=>(s("loose invalid filter",we,this.options),!!we.match(a[u.COMPARATORLOOSE])))),s("range list",te);const ne=new Map,de=te.map(we=>new r(we,this.options));for(const we of de){if(p(we))return[we];ne.set(we.value,we)}ne.size>1&&ne.has("")&&ne.delete("");const Se=[...ne.values()];return n.set(M,Se),Se}intersects(F,A){if(!(F instanceof e))throw new TypeError("a Range is required");return this.set.some(M=>m(M,A)&&F.set.some(P=>m(P,A)&&M.every(z=>P.every(U=>z.intersects(U,A)))))}test(F){if(!F)return!1;if(typeof F=="string")try{F=new o(F,this.options)}catch{return!1}for(let A=0;A<this.set.length;A++)if(O(this.set[A],F,this.options))return!0;return!1}}U0=e;const t=hfe,n=new t,i=pE,r=ede(),s=mm,o=yE,{safeRe:a,t:u,comparatorTrimReplace:l,tildeTrimReplace:c,caretTrimReplace:f}=mE,{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:h}=gE,p=k=>k.value==="<0.0.0-0",g=k=>k.value==="",m=(k,F)=>{let A=!0;const M=k.slice();let P=M.pop();for(;A&&M.length;)A=M.every(z=>P.intersects(z,F)),P=M.pop();return A},y=(k,F)=>(s("comp",k,F),k=E(k,F),s("caret",k),k=v(k,F),s("tildes",k),k=w(k,F),s("xrange",k),k=$(k,F),s("stars",k),k),b=k=>!k||k.toLowerCase()==="x"||k==="*",v=(k,F)=>k.trim().split(/\s+/).map(A=>x(A,F)).join(" "),x=(k,F)=>{const A=F.loose?a[u.TILDELOOSE]:a[u.TILDE];return k.replace(A,(M,P,z,U,te)=>{s("tilde",k,M,P,z,U,te);let ne;return b(P)?ne="":b(z)?ne=`>=${P}.0.0 <${+P+1}.0.0-0`:b(U)?ne=`>=${P}.${z}.0 <${P}.${+z+1}.0-0`:te?(s("replaceTilde pr",te),ne=`>=${P}.${z}.${U}-${te} <${P}.${+z+1}.0-0`):ne=`>=${P}.${z}.${U} <${P}.${+z+1}.0-0`,s("tilde return",ne),ne})},E=(k,F)=>k.trim().split(/\s+/).map(A=>S(A,F)).join(" "),S=(k,F)=>{s("caret",k,F);const A=F.loose?a[u.CARETLOOSE]:a[u.CARET],M=F.includePrerelease?"-0":"";return k.replace(A,(P,z,U,te,ne)=>{s("caret",k,P,z,U,te,ne);let de;return b(z)?de="":b(U)?de=`>=${z}.0.0${M} <${+z+1}.0.0-0`:b(te)?z==="0"?de=`>=${z}.${U}.0${M} <${z}.${+U+1}.0-0`:de=`>=${z}.${U}.0${M} <${+z+1}.0.0-0`:ne?(s("replaceCaret pr",ne),z==="0"?U==="0"?de=`>=${z}.${U}.${te}-${ne} <${z}.${U}.${+te+1}-0`:de=`>=${z}.${U}.${te}-${ne} <${z}.${+U+1}.0-0`:de=`>=${z}.${U}.${te}-${ne} <${+z+1}.0.0-0`):(s("no pr"),z==="0"?U==="0"?de=`>=${z}.${U}.${te}${M} <${z}.${U}.${+te+1}-0`:de=`>=${z}.${U}.${te}${M} <${z}.${+U+1}.0-0`:de=`>=${z}.${U}.${te} <${+z+1}.0.0-0`),s("caret return",de),de})},w=(k,F)=>(s("replaceXRanges",k,F),k.split(/\s+/).map(A=>_(A,F)).join(" ")),_=(k,F)=>{k=k.trim();const A=F.loose?a[u.XRANGELOOSE]:a[u.XRANGE];return k.replace(A,(M,P,z,U,te,ne)=>{s("xRange",k,M,P,z,U,te,ne);const de=b(z),Se=de||b(U),we=Se||b(te),Pe=we;return P==="="&&Pe&&(P=""),ne=F.includePrerelease?"-0":"",de?P===">"||P==="<"?M="<0.0.0-0":M="*":P&&Pe?(Se&&(U=0),te=0,P===">"?(P=">=",Se?(z=+z+1,U=0,te=0):(U=+U+1,te=0)):P==="<="&&(P="<",Se?z=+z+1:U=+U+1),P==="<"&&(ne="-0"),M=`${P+z}.${U}.${te}${ne}`):Se?M=`>=${z}.0.0${ne} <${+z+1}.0.0-0`:we&&(M=`>=${z}.${U}.0${ne} <${z}.${+U+1}.0-0`),s("xRange return",M),M})},$=(k,F)=>(s("replaceStars",k,F),k.trim().replace(a[u.STAR],"")),C=(k,F)=>(s("replaceGTE0",k,F),k.trim().replace(a[F.includePrerelease?u.GTE0PRE:u.GTE0],"")),T=k=>(F,A,M,P,z,U,te,ne,de,Se,we,Pe)=>(b(M)?A="":b(P)?A=`>=${M}.0.0${k?"-0":""}`:b(z)?A=`>=${M}.${P}.0${k?"-0":""}`:U?A=`>=${A}`:A=`>=${A}${k?"-0":""}`,b(de)?ne="":b(Se)?ne=`<${+de+1}.0.0-0`:b(we)?ne=`<${de}.${+Se+1}.0-0`:Pe?ne=`<=${de}.${Se}.${we}-${Pe}`:k?ne=`<${de}.${Se}.${+we+1}-0`:ne=`<=${ne}`,`${A} ${ne}`.trim()),O=(k,F,A)=>{for(let M=0;M<k.length;M++)if(!k[M].test(F))return!1;if(F.prerelease.length&&!A.includePrerelease){for(let M=0;M<k.length;M++)if(s(k[M].semver),k[M].semver!==r.ANY&&k[M].semver.prerelease.length>0){const P=k[M].semver;if(P.major===F.major&&P.minor===F.minor&&P.patch===F.patch)return!0}return!1}return!0};return U0}const tde=eL(),nde=(e,t,n)=>{try{t=new tde(t,n)}catch{return!1}return t.test(e)};var ide=nde,tL=ffe(ide);function rde(e,t,n){const i=e.open(t),r=1e4,s=250,{origin:o}=new URL(t);let a=~~(r/s);function u(c){c.source===i&&(a=0,e.removeEventListener("message",u,!1))}e.addEventListener("message",u,!1);function l(){a<=0||(i.postMessage(n,o),setTimeout(l,s),a-=1)}setTimeout(l,s)}var sde=`.vega-embed {
79
- position: relative;
80
- display: inline-block;
81
- box-sizing: border-box;
82
- }
83
- .vega-embed.has-actions {
84
- padding-right: 38px;
85
- }
86
- .vega-embed details:not([open]) > :not(summary) {
87
- display: none !important;
88
- }
89
- .vega-embed summary {
90
- list-style: none;
91
- position: absolute;
92
- top: 0;
93
- right: 0;
94
- padding: 6px;
95
- z-index: 1000;
96
- background: white;
97
- box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
98
- color: #1b1e23;
99
- border: 1px solid #aaa;
100
- border-radius: 999px;
101
- opacity: 0.2;
102
- transition: opacity 0.4s ease-in;
103
- cursor: pointer;
104
- line-height: 0px;
105
- }
106
- .vega-embed summary::-webkit-details-marker {
107
- display: none;
108
- }
109
- .vega-embed summary:active {
110
- box-shadow: #aaa 0px 0px 0px 1px inset;
111
- }
112
- .vega-embed summary svg {
113
- width: 14px;
114
- height: 14px;
115
- }
116
- .vega-embed details[open] summary {
117
- opacity: 0.7;
118
- }
119
- .vega-embed:hover summary, .vega-embed:focus-within summary {
120
- opacity: 1 !important;
121
- transition: opacity 0.2s ease;
122
- }
123
- .vega-embed .vega-actions {
124
- position: absolute;
125
- z-index: 1001;
126
- top: 35px;
127
- right: -9px;
128
- display: flex;
129
- flex-direction: column;
130
- padding-bottom: 8px;
131
- padding-top: 8px;
132
- border-radius: 4px;
133
- box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
134
- border: 1px solid #d9d9d9;
135
- background: white;
136
- animation-duration: 0.15s;
137
- animation-name: scale-in;
138
- animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
139
- text-align: left;
140
- }
141
- .vega-embed .vega-actions a {
142
- padding: 8px 16px;
143
- font-family: sans-serif;
144
- font-size: 14px;
145
- font-weight: 600;
146
- white-space: nowrap;
147
- color: #434a56;
148
- text-decoration: none;
149
- }
150
- .vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {
151
- background-color: #f7f7f9;
152
- color: black;
153
- }
154
- .vega-embed .vega-actions::before, .vega-embed .vega-actions::after {
155
- content: "";
156
- display: inline-block;
157
- position: absolute;
158
- }
159
- .vega-embed .vega-actions::before {
160
- left: auto;
161
- right: 14px;
162
- top: -16px;
163
- border: 8px solid rgba(0, 0, 0, 0);
164
- border-bottom-color: #d9d9d9;
165
- }
166
- .vega-embed .vega-actions::after {
167
- left: auto;
168
- right: 15px;
169
- top: -14px;
170
- border: 7px solid rgba(0, 0, 0, 0);
171
- border-bottom-color: #fff;
172
- }
173
- .vega-embed .chart-wrapper.fit-x {
174
- width: 100%;
175
- }
176
- .vega-embed .chart-wrapper.fit-y {
177
- height: 100%;
178
- }
179
-
180
- .vega-embed-wrapper {
181
- max-width: 100%;
182
- overflow: auto;
183
- padding-right: 14px;
184
- }
185
-
186
- @keyframes scale-in {
187
- from {
188
- opacity: 0;
189
- transform: scale(0.6);
190
- }
191
- to {
192
- opacity: 1;
193
- transform: scale(1);
194
- }
195
- }
196
- `;function nL(e,...t){for(const n of t)ode(e,n);return e}function ode(e,t){for(const n of Object.keys(t))Tu(e,n,t[n],!0)}const zi=Yee;let Rc=ece;const cd=typeof window<"u"?window:void 0;var Pk;Rc===void 0&&((Pk=cd==null?void 0:cd.vl)!=null&&Pk.compile)&&(Rc=cd.vl);const ade={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},ude={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Wl={vega:"Vega","vega-lite":"Vega-Lite"},cp={vega:zi.version,"vega-lite":Rc?Rc.version:"not available"},lde={vega:e=>e,"vega-lite":(e,t)=>Rc.compile(e,{config:t}).spec},cde=`
197
- <svg viewBox="0 0 16 16" fill="currentColor" stroke="none" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
198
- <circle r="2" cy="8" cx="2"></circle>
199
- <circle r="2" cy="8" cx="8"></circle>
200
- <circle r="2" cy="8" cx="14"></circle>
201
- </svg>`,fde="chart-wrapper";function dde(e){return typeof e=="function"}function Dk(e,t,n,i){const r=`<html><head>${t}</head><body><pre><code class="json">`,s=`</code></pre>${n}</body></html>`,o=window.open("");o.document.write(r+e+s),o.document.title=`${Wl[i]} JSON Source`}function hde(e,t){if(e.$schema){const n=X6(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${Wl[n.library]}, but mode argument sets ${Wl[t]??t}.`);const i=n.library;return tL(cp[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${Wl[i]} ${n.version}, but the current version of ${Wl[i]} is v${cp[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function iL(e){return!!(e&&"load"in e)}function Ok(e){return iL(e)?e:zi.loader(e)}function pde(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return K(t.defaultStyle)&&(t.defaultStyle=!1),t}async function gde(e,t,n={}){let i,r;K(t)?(r=Ok(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=pde(i),o=s.loader;(!r||o)&&(r=Ok(n.loader??o));const a=await Rk(s,r),u=await Rk(n,r),l={...nL(u,a),config:Fu(u.config??{},a.config??{})};return await yde(e,i,l,r)}async function Rk(e,t){const n=K(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=K(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function mde(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function yde(e,t,n={},i){const r=n.theme?Fu(nfe[n.theme],n.config??{}):n.config,s=js(n.actions)?n.actions:nL({},ade,n.actions??{}),o={...ude,...n.i18n},a=n.renderer??"canvas",u=n.logLevel??zi.Warn,l=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const E="vega-embed-style",{root:S,rootContainer:w}=mde(c);if(!S.getElementById(E)){const _=document.createElement("style");_.id=E,_.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?sde.toString():n.defaultStyle,w.appendChild(_)}}const f=hde(t,n.mode);let d=lde[f](t,r);if(f==="vega-lite"&&d.$schema){const E=X6(d.$schema);tL(cp.vega,`^${E.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${E.version}, but current version is v${cp.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(s){const E=document.createElement("div");E.classList.add(fde),c.appendChild(E),h=E}const p=n.patch;if(p&&(d=p instanceof Function?p(d):mp(d,p,!0,!1).newDocument),n.formatLocale&&zi.formatLocale(n.formatLocale),n.timeFormatLocale&&zi.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const E in n.expressionFunctions){const S=n.expressionFunctions[E];"fn"in S?zi.expressionFunction(E,S.fn,S.visitor):S instanceof Function&&zi.expressionFunction(E,S)}const{ast:g}=n,m=zi.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||zi.View)(m,{loader:i,logLevel:u,renderer:a,...g?{expr:zi.expressionInterpreter??n.expr??kR}:{}});if(y.addSignalListener("autosize",(E,S)=>{const{type:w}=S;w=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):w=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):w=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:E,tooltip:S}=n,w=E&&!iL(E)?E==null?void 0:E.baseURL:void 0,_=dde(S)?S:new cfe({baseURL:w,...S===!0?{}:S}).call;y.tooltip(_)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:E,updateSet:S}=typeof b=="boolean"?{}:b;y.hover(E,S)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(s!==!1){let E=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const w=document.createElement("details");w.title=o.CLICK_TO_VIEW_ACTIONS,c.append(w),E=w;const _=document.createElement("summary");_.innerHTML=cde,w.append(_),v=$=>{w.contains($.target)||w.removeAttribute("open")},document.addEventListener("click",v)}const S=document.createElement("div");if(E.append(S),S.classList.add("vega-actions"),s===!0||s.export!==!1){for(const w of["svg","png"])if(s===!0||s.export===!0||s.export[w]){const _=o[`${w.toUpperCase()}_ACTION`],$=document.createElement("a"),C=X(n.scaleFactor)?n.scaleFactor[w]:n.scaleFactor;$.text=_,$.href="#",$.target="_blank",$.download=`${l}.${w}`,$.addEventListener("mousedown",async function(T){T.preventDefault();const O=await y.toImageURL(w,C);this.href=O}),S.append($)}}if(s===!0||s.source!==!1){const w=document.createElement("a");w.text=o.SOURCE_ACTION,w.href="#",w.addEventListener("click",function(_){Dk(bm(t),n.sourceHeader??"",n.sourceFooter??"",f),_.preventDefault()}),S.append(w)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const w=document.createElement("a");w.text=o.COMPILED_ACTION,w.href="#",w.addEventListener("click",function(_){Dk(bm(d),n.sourceHeader??"",n.sourceFooter??"","vega"),_.preventDefault()}),S.append(w)}if(s===!0||s.editor!==!1){const w=n.editorUrl??"https://vega.github.io/editor/",_=document.createElement("a");_.text=o.EDITOR_ACTION,_.href="#",_.addEventListener("click",function($){rde(window,w,{config:r,mode:p?"vega":f,renderer:a,spec:bm(p?d:t)}),$.preventDefault()}),S.append(_)}}function x(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:x,embedOptions:n}}const bde={DATAFRAME_INDEX:"(index)"},vde=new Set([Qu.DatetimeIndex,Qu.Float64Index,Qu.Int64Index,Qu.RangeIndex,Qu.UInt64Index]);function xde(e){const t=e.data;return!t||t.data.numRows===0?null:sc(t)}function wde(e){const t=Ky(e);if(Jy(t))return null;const n={};for(const[i,r]of Object.entries(t))n[i]=sc(r);return n}function Ky(e){var n;if(((n=e.datasets)==null?void 0:n.length)===0)return null;const t={};return e.datasets.forEach(i=>{if(!i)return;const r=i.hasName?i.name:null;t[r]=i.data}),t}function sc(e,t=0){if(e.isEmpty())return[];const n=[],{dataRows:i,dataColumns:r}=e.dimensions,s=bE(e.types.index[0]),o=vde.has(s);for(let a=t;a<i;a++){const u={};if(o){const l=e.getIndexValue(a,0);u[bde.DATAFRAME_INDEX]=typeof l=="bigint"?Number(l):l}for(let l=0;l<r;l++){const c=e.getDataValue(a,l),f=e.types.data[l],d=bE(f);if(d!=="datetimetz"&&(c instanceof Date||Number.isFinite(c))&&(d.startsWith("datetime")||d==="date")){const h=new Date(c).getTimezoneOffset()*60*1e3;u[e.columns[0][l]]=c.valueOf()+h}else typeof c=="bigint"?u[e.columns[0][l]]=Number(c):u[e.columns[0][l]]=c}n.push(u)}return n}function Ede(e,t,n,i,r,s){if(n!==s||t>=r||t===0)return!1;const o=s-1,a=t-1;return!(e.getDataValue(0,o)!==i.getDataValue(0,o)||e.getDataValue(a,o)!==i.getDataValue(a,o))}var Sde=rL,_de=sL,$de=_de(function(e,t,n,i){Sde(e,t,n,i)}),Ade=$de;const kde=zk(Ade);function Nk(e,t){const n={font:t.genericFonts.bodyFont,background:t.colors.bgColor,fieldTitle:"verbal",autosize:{type:"fit",contains:"padding"},title:{align:"left",anchor:"start",color:t.colors.headingColor,titleFontStyle:"normal",fontWeight:t.fontWeights.bold,fontSize:t.fontSizes.mdPx,orient:"top",offset:26},header:{titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.mdPx,titleColor:ga(t),titleFontStyle:"normal",labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:ga(t),labelFontStyle:"normal"},axis:{labelFontSize:t.fontSizes.twoSmPx,labelFontWeight:t.fontWeights.normal,labelColor:ga(t),labelFontStyle:"normal",titleFontWeight:t.fontWeights.normal,titleFontSize:t.fontSizes.smPx,titleColor:ga(t),titleFontStyle:"normal",ticks:!1,gridColor:Pd(t),domain:!1,domainWidth:1,domainColor:Pd(t),labelFlush:!0,labelFlushOffset:1,labelBound:!1,labelLimit:100,titlePadding:eo(t.spacing.lg),labelPadding:eo(t.spacing.lg),labelSeparation:eo(t.spacing.twoXS),labelOverlap:!0},legend:{labelFontSize:t.fontSizes.smPx,labelFontWeight:t.fontWeights.normal,labelColor:ga(t),titleFontSize:t.fontSizes.smPx,titleFontWeight:t.fontWeights.normal,titleFontStyle:"normal",titleColor:ga(t),titlePadding:5,labelPadding:eo(t.spacing.lg),columnPadding:eo(t.spacing.sm),rowPadding:eo(t.spacing.twoXS),padding:7,symbolStrokeWidth:4},range:{category:oL(t),diverging:aL(t),ramp:vE(t),heatmap:vE(t)},view:{columns:1,strokeWidth:0,stroke:"transparent",continuousHeight:350,continuousWidth:400},concat:{columns:1},facet:{columns:1},mark:{tooltip:!0,color:uL(t)},bar:{binSpacing:eo(t.spacing.twoXS),discreteBandSize:{band:.85}},axisDiscrete:{grid:!1},axisXPoint:{grid:!1},axisTemporal:{grid:!1},axisXBand:{grid:!1}};return e?kde({},n,e,(i,r)=>Array.isArray(r)?r:void 0):n}function Cde(e,t){const{colors:n,fontSizes:i,genericFonts:r}=t,s={labelFont:r.bodyFont,titleFont:r.bodyFont,labelFontSize:i.twoSmPx,titleFontSize:i.twoSmPx},o={background:n.bgColor,axis:{labelColor:n.bodyText,titleColor:n.bodyText,gridColor:Pd(t),...s},legend:{labelColor:n.bodyText,titleColor:n.bodyText,...s},title:{color:n.bodyText,subtitleColor:n.bodyText,...s},header:{labelColor:n.bodyText,titleColor:n.bodyText,...s},view:{stroke:Pd(t),continuousHeight:350,continuousWidth:400},mark:{tooltip:!0}};return e?lL({},o,e):o}const Fde=e=>({"#vg-tooltip-element":{visibility:"hidden",position:"fixed",fontFamily:e.genericFonts.bodyFont,color:e.colors.bodyText,border:`${e.sizes.borderWidth} solid ${e.colors.borderColor}`,backgroundColor:cL(e.colors.bgColor,.05),fontSize:e.fontSizes.twoSm,boxShadow:"rgb(0 0 0 / 16%) 0px 1px 4px",maxWidth:e.sizes.maxChartTooltipWidth,padding:`${e.spacing.xs} ${e.spacing.md}`,borderRadius:e.radii.default,zIndex:e.zIndices.vegaTooltips,"&.visible":{visibility:"visible"},h2:{marginTop:e.spacing.none,marginBottom:e.spacing.sm,fontSize:e.fontSizes.sm},td:{border:"none"},table:{borderSpacing:0,tr:{border:"none",td:{overflow:"hidden",textOverflow:"ellipsis",paddingTop:e.spacing.threeXS,paddingBottom:e.spacing.threeXS},"td.key":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.4)`,textAlign:"right",color:e.colors.fadedText60,whiteSpace:"nowrap",paddingRight:e.spacing.twoXS},"td.value":{maxWidth:`calc((${e.sizes.maxChartTooltipWidth} - 2 * ${e.spacing.md}) * 0.6)`,textAlign:"left",display:"-webkit-box",WebkitLineClamp:"5",WebkitBoxOrient:"vertical",lineClamp:"5",wordWrap:"break-word"}}}}}),Tde=fL("div",{target:"e9hk5zh0"})(({theme:e,useContainerWidth:t,isFullScreen:n})=>({width:t||n?"100%":"auto",height:n?"100%":"auto","&.vega-embed":{position:"relative",display:"inline-block",boxSizing:"border-box","details:not([open]) > :not(summary)":{display:"none !important"},"details[open] summary":{opacity:.7},"&:hover summary, .vega-embed:focus summary":{background:"transparent"},"&:hover summary, &:focus-within summary":{opacity:"1 !important",transition:"opacity 0.2s ease"},"&.has-actions":{paddingRight:0},".vega-actions":{position:"absolute",display:"flex",flexDirection:"column",paddingBottom:e.spacing.sm,paddingTop:e.spacing.sm,zIndex:e.zIndices.popupMenu,top:`calc(${e.iconSizes.md} + 2 * ${e.spacing.xs} + ${e.spacing.xs})`,right:0,backgroundColor:e.colors.bgColor,boxShadow:"rgb(0 0 0 / 16%) 0px 4px 16px",border:`${e.sizes.borderWidth} solid ${e.colors.fadedText10}`,animationDuration:"0.15s",animationName:"scale-in",animationTimingFunction:"cubic-bezier(0.2, 0, 0.13, 1.5)",textAlign:"left",borderRadius:e.radii.default,a:{fontFamily:e.genericFonts.bodyFont,fontWeight:e.fontWeights.normal,fontSize:e.fontSizes.md,margin:0,padding:`${e.spacing.twoXS} ${e.spacing.twoXL}`,color:e.colors.bodyText,whiteSpace:"nowrap",textDecoration:"none"},"a:hover, a:focus":{backgroundColor:e.colors.secondaryBg,color:e.colors.bodyText},":before":{content:"none"},":after":{content:"none"}},"@keyframes scale-in":{from:{opacity:0,transform:"scale(0.6)"},to:{opacity:1,transform:"scale(1)"}},".chart-wrapper":{"&.fit-x":{width:"100%"},"&.fit-y":{height:"100%"}},summary:{position:"absolute",top:0,right:0,opacity:0,listStyle:"none",cursor:"pointer",display:"list-item",padding:e.spacing.xs,height:"auto",zIndex:e.zIndices.menuButton,border:"none",boxShadow:"none",borderRadius:e.radii.default,color:e.colors.fadedText10,backgroundColor:"transparent",transition:"opacity 300ms 150ms,transform 300ms 150ms",lineHeight:0,"&::-webkit-details-marker":{display:"none"},"&:active, &:focus-visible, &:hover":{border:"none",boxShadow:"none",color:e.colors.bodyText,opacity:"1 !important",background:e.colors.darkenedBgMix25},svg:{width:e.iconSizes.md,height:e.iconSizes.md}}}})),Lk="source",Mde=20,Dde=150;function Ode(e){"params"in e&&"encoding"in e&&e.params.forEach(t=>{"select"in t&&(["interval","point"].includes(t.select)&&(t.select={type:t.select}),"type"in t.select&&t.select.type==="point"&&!("encodings"in t.select)&&Jy(t.select.encodings)&&(t.select.encodings=Object.keys(e.encoding)))})}class Rde extends hL.PureComponent{constructor(){super(...arguments),this.defaultDataName=Lk,this.element=null,this.formClearHelper=new HL,this.state={error:void 0},this.finalizeView=()=>{this.vegaFinalizer&&this.vegaFinalizer(),this.vegaFinalizer=void 0,this.vegaView=void 0},this.generateSpec=()=>{var u,l;const{element:t,theme:n,isFullScreen:i,width:r,height:s}=this.props,o=JSON.parse(t.spec),{useContainerWidth:a}=t;if(t.vegaLiteTheme==="streamlit"?o.config=Nk(o.config,n):((l=(u=o.usermeta)==null?void 0:u.embedOptions)==null?void 0:l.theme)==="streamlit"?(o.config=Nk(o.config,n),o.usermeta.embedOptions.theme=void 0):o.config=Cde(o.config,n),i?(o.width=r,o.height=s,"vconcat"in o&&o.vconcat.forEach(c=>{c.width=r})):a&&(o.width=r,"vconcat"in o&&o.vconcat.forEach(c=>{c.width=r})),o.padding||(o.padding={}),Jy(o.padding.bottom)&&(o.padding.bottom=Mde),o.datasets)throw new Error("Datasets should not be passed as part of the spec");return t.selectionMode.length>0&&Ode(o),o},this.maybeConfigureSelections=()=>{if(this.vegaView===void 0)return;const{widgetMgr:t,element:n}=this.props;if(!(n!=null&&n.id)||n.selectionMode.length===0)return;const i=t.getElementState(this.props.element.id,"viewState");if(xE(i))try{this.vegaView=this.vegaView.setState(i)}catch{}n.selectionMode.forEach((s,o)=>{var a;(a=this.vegaView)==null||a.addSignalListener(s,pL(Dde,(u,l)=>{var p;const c=(p=this.vegaView)==null?void 0:p.getState({data:(g,m)=>n.selectionMode.some(y=>`${y}_store`===g),recurse:!1});xE(c)&&t.setElementState(n.id,"viewState",c);let f=l;"vlPoint"in l&&"or"in l.vlPoint&&(f=l.vlPoint.or);const d=JSON.parse(t.getStringValue(n)||"{}"),h={selection:{...(d==null?void 0:d.selection)||{},[u]:f||{}}};ym(d,h)||t.setStringValue(n,JSON.stringify(h),{fromUi:!0},this.props.fragmentId)}))});const r=()=>{var u;const s={selection:{}};this.props.element.selectionMode.forEach(l=>{s.selection[l]={}});const o=t.getStringValue(n),a=o?JSON.parse(o):s;ym(a,s)||(u=this.props.widgetMgr)==null||u.setStringValue(this.props.element,JSON.stringify(s),{fromUi:!0},this.props.fragmentId)};this.props.element.formId&&this.formClearHelper.manageFormClearListener(this.props.widgetMgr,this.props.element.formId,r)}}async componentDidMount(){try{await this.createView()}catch(t){const n=wE(t);this.setState({error:n})}}componentWillUnmount(){this.finalizeView()}async componentDidUpdate(t){const{element:n,theme:i}=t,{element:r,theme:s}=this.props,o=n.spec,{spec:a}=r;if(!this.vegaView||o!==a||i!==s||t.width!==this.props.width||t.height!==this.props.height||t.element.vegaLiteTheme!==this.props.element.vegaLiteTheme||!ym(t.element.selectionMode,this.props.element.selectionMode)){try{await this.createView()}catch(d){const h=wE(d);this.setState({error:h})}return}const u=n.data,{data:l}=r;(u||l)&&this.updateData(this.defaultDataName,u,l);const c=Ky(n)||{},f=Ky(r)||{};for(const[d,h]of Object.entries(f)){const p=d||this.defaultDataName,g=c[p];this.updateData(p,g,h)}for(const d of Object.keys(c))!f.hasOwnProperty(d)&&d!==this.defaultDataName&&this.updateData(d,null,null);this.vegaView.resize().runAsync()}updateData(t,n,i){if(!this.vegaView)throw new Error("Chart has not been drawn yet");if(!i||i.data.numRows===0)try{this.vegaView.remove(t,Rn)}finally{return}if(!n||n.data.numRows===0){this.vegaView.insert(t,sc(i));return}const{dataRows:r,dataColumns:s}=n.dimensions,{dataRows:o,dataColumns:a}=i.dimensions;Ede(n,r,s,i,o,a)?r<o&&this.vegaView.insert(t,sc(i,r)):this.vegaView.data(t,sc(i))}async createView(){if(!this.element)throw Error("Element missing.");this.finalizeView();const{element:t}=this.props,n=this.generateSpec(),i={ast:!0,expr:kR,tooltip:{disableDefaultStyle:!0},defaultStyle:!1,forceActionsMenu:!0},{vgSpec:r,view:s,finalize:o}=await gde(this.element,n,i);this.vegaView=s,this.maybeConfigureSelections(),this.vegaFinalizer=o;const a=wde(t),u=a?Object.keys(a):[];if(u.length===1){const[c]=u;this.defaultDataName=c}else u.length===0&&r.data&&(this.defaultDataName=Lk);const l=xde(t);if(l&&s.insert(this.defaultDataName,l),a)for(const[c,f]of Object.entries(a))s.insert(c,f);await s.runAsync(),this.vegaView.resize().runAsync()}render(){if(this.state.error)throw this.state.error;return gL(AE,{width:this.props.width,height:this.props.height,useContainerWidth:this.props.element.useContainerWidth,children:[fd(GL,{target:AE,isFullScreen:this.props.isFullScreen,onExpand:this.props.expand,onCollapse:this.props.collapse,disableFullscreenMode:this.props.disableFullscreenMode}),fd(mL,{styles:[Fde]}),fd(Tde,{"data-testid":"stVegaLiteChart",className:"stVegaLiteChart",useContainerWidth:this.props.element.useContainerWidth,isFullScreen:this.props.isFullScreen,ref:t=>{this.element=t}})]})}}const Nde=e=>{const t=dL(),{expanded:n,width:i,height:r,expand:s,collapse:o}=XL(YL);return fd(Rde,{theme:t,isFullScreen:n,...e,height:r,width:n?i:e.width,expand:s,collapse:o})},khe=VL(Nde);export{khe as default};