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,197 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./data-grid-overlay-editor.CXW3Vrt9.js","./index.CLHVvMN0.js","../css/index.ZIJkhegp.css","./FormClearHelper.DSgVZ-NK.js","./withFullScreenWrapper.BjS0eA06.js","./Toolbar.YZjXpW2P.js","./sprintf.C-r3gIuM.js","./createDownloadLinkElement.DZMwyjvU.js","./slicedToArray.DVgs1NsC.js","./getPrototypeOf.BZAK2f3t.js","./createSuper.Cj3WfXha.js","./FileDownload.esm.WslOojMp.js","./number-overlay-editor.D5dgP2YW.js","./es6.DoVDVSd_.js"])))=>i.map(i=>d[i]);
2
- var Pf=Object.defineProperty;var _f=(e,t,n)=>t in e?Pf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dt=(e,t,n)=>_f(e,typeof t!="symbol"?t+"":t,n);import{r as g,E as ic,_ as et,g as co,c as Lf,R as ae,i as Qa,p as Ff,d as Fs,e as Af,f as Hf,h as oc,t as ac,l as zf,m as sc,o as $f,q as Vf,s as Nf,u as Bf,v as Wf,a as cr,w as As,x as Pl,y as Uf,z as Yf,A as Ze,B as lc,C as uc,D as Ct,G as wr,H as Xf,I as _l,J as ti,j as xn,n as cc,K as Ll,L as Gf,M as Hs,N as Un,O as dc,Q as es,S as Pr,T as fc,U as qi,V as kr,k as jf,W as qf,X as Ne,b as Kf,Y as hc,Z as zs,$ as ts,a0 as Zf,a1 as Jf,a2 as Qf,a3 as eh,a4 as th,a5 as nh,a6 as rh,a7 as Fl,a8 as ih}from"./index.CLHVvMN0.js";import{u as oh}from"./FormClearHelper.DSgVZ-NK.js";import{w as ah,u as sh,E as lh}from"./withFullScreenWrapper.BjS0eA06.js";import{T as uh,a as Wi}from"./Toolbar.YZjXpW2P.js";import{s as ch}from"./sprintf.C-r3gIuM.js";import{c as dh}from"./createDownloadLinkElement.DZMwyjvU.js";import{_ as Cr,C as fh}from"./slicedToArray.DVgs1NsC.js";import{_ as hh,a as gh,b as mh}from"./getPrototypeOf.BZAK2f3t.js";import{_ as ph}from"./createSuper.Cj3WfXha.js";import{D as vh,F as bh}from"./FileDownload.esm.WslOojMp.js";var gc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(ic,et({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))});gc.displayName="Add";var mc=g.forwardRef(function(e,t){var n={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return g.createElement(ic,et({iconAttrs:n,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),g.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),g.createElement("path",{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}))});mc.displayName="Search";function pc(e="This should not happen"){throw new Error(e)}function _n(e,t="Assertion failed"){if(!e)return pc(t)}function ao(e,t){return pc(t??"Hell froze over")}function wh(e,t){try{return e()}catch{return t}}const Al=Object.prototype.hasOwnProperty;function ki(e,t){let n,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((i=e.length)===t.length)for(;i--&&ki(e[i],t[i]););return i===-1}if(!n||typeof e=="object"){i=0;for(n in e)if(Al.call(e,n)&&++i&&!Al.call(t,n)||!(n in t)||!ki(e[n],t[n]))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}var yh=Object.prototype,Ch=yh.hasOwnProperty;function Sh(e,t){return e!=null&&Ch.call(e,t)}var xh=Sh,kh=xh,Mh=Lf;function Rh(e,t){return e!=null&&Mh(e,t,kh)}var Eh=Rh;const Ih=co(Eh),aa=null,$s=void 0;var Z;(function(e){e.Uri="uri",e.Text="text",e.Image="image",e.RowID="row-id",e.Number="number",e.Bubble="bubble",e.Boolean="boolean",e.Loading="loading",e.Markdown="markdown",e.Drilldown="drilldown",e.Protected="protected",e.Custom="custom"})(Z||(Z={}));var Hl;(function(e){e.HeaderRowID="headerRowID",e.HeaderCode="headerCode",e.HeaderNumber="headerNumber",e.HeaderString="headerString",e.HeaderBoolean="headerBoolean",e.HeaderAudioUri="headerAudioUri",e.HeaderVideoUri="headerVideoUri",e.HeaderEmoji="headerEmoji",e.HeaderImage="headerImage",e.HeaderUri="headerUri",e.HeaderPhone="headerPhone",e.HeaderMarkdown="headerMarkdown",e.HeaderDate="headerDate",e.HeaderTime="headerTime",e.HeaderEmail="headerEmail",e.HeaderReference="headerReference",e.HeaderIfThenElse="headerIfThenElse",e.HeaderSingleValue="headerSingleValue",e.HeaderLookup="headerLookup",e.HeaderTextTemplate="headerTextTemplate",e.HeaderMath="headerMath",e.HeaderRollup="headerRollup",e.HeaderJoinStrings="headerJoinStrings",e.HeaderSplitString="headerSplitString",e.HeaderGeoDistance="headerGeoDistance",e.HeaderArray="headerArray",e.RowOwnerOverlay="rowOwnerOverlay",e.ProtectedColumnOverlay="protectedColumnOverlay"})(Hl||(Hl={}));var sa;(function(e){e.Triangle="triangle",e.Dots="dots"})(sa||(sa={}));function $o(e){return"width"in e&&typeof e.width=="number"}async function zl(e){return typeof e=="object"?e:await e()}function vi(e){return!(e.kind===Z.Loading||e.kind===Z.Bubble||e.kind===Z.RowID||e.kind===Z.Protected||e.kind===Z.Drilldown)}function wi(e){return e.kind===Xn.Marker||e.kind===Xn.NewRow}function Ki(e){if(!vi(e)||e.kind===Z.Image)return!1;if(e.kind===Z.Text||e.kind===Z.Number||e.kind===Z.Markdown||e.kind===Z.Uri||e.kind===Z.Custom||e.kind===Z.Boolean)return e.readonly!==!0;ao(e,"A cell was passed with an invalid kind")}function Th(e){return Ih(e,"editor")}function Vs(e){return!(e.readonly??!1)}var Xn;(function(e){e.NewRow="new-row",e.Marker="marker"})(Xn||(Xn={}));function Dh(e){if(e.length===0)return[];const t=[...e],n=[];t.sort(function(i,r){return i[0]-r[0]}),n.push([...t[0]]);for(const i of t.slice(1)){const r=n[n.length-1];r[1]<i[0]?n.push([...i]):r[1]<i[1]&&(r[1]=i[1])}return n}let $l;const br=class br{constructor(t){dt(this,"items");this.items=t}offset(t){if(t===0)return this;const n=this.items.map(i=>[i[0]+t,i[1]+t]);return new br(n)}add(t){const n=typeof t=="number"?[t,t+1]:t,i=Dh([...this.items,n]);return new br(i)}remove(t){const n=[...this.items],i=typeof t=="number"?t:t[0],r=typeof t=="number"?t+1:t[1];for(const[o,a]of n.entries()){const[s,l]=a;if(s<=r&&i<=l){const u=[];s<i&&u.push([s,i]),r<l&&u.push([r,l]),n.splice(o,1,...u)}}return new br(n)}first(){if(this.items.length!==0)return this.items[0][0]}last(){if(this.items.length!==0)return this.items.slice(-1)[0][1]-1}hasIndex(t){for(let n=0;n<this.items.length;n++){const[i,r]=this.items[n];if(t>=i&&t<r)return!0}return!1}hasAll(t){for(let n=t[0];n<t[1];n++)if(!this.hasIndex(n))return!1;return!0}some(t){for(const n of this)if(t(n))return!0;return!1}equals(t){if(t===this)return!0;if(t.items.length!==this.items.length)return!1;for(let n=0;n<this.items.length;n++){const i=t.items[n],r=this.items[n];if(i[0]!==r[0]||i[1]!==r[1])return!1}return!0}toArray(){const t=[];for(const[n,i]of this.items)for(let r=n;r<i;r++)t.push(r);return t}get length(){let t=0;for(const[n,i]of this.items)t+=i-n;return t}*[Symbol.iterator](){for(const[t,n]of this.items)for(let i=t;i<n;i++)yield i}};dt(br,"empty",()=>$l??($l=new br([]))),dt(br,"fromSingleSelection",t=>br.empty().add(t));let yt=br;var Oh=function(){const t=Array.prototype.slice.call(arguments).filter(Boolean),n={},i=[];t.forEach(o=>{(o?o.split(" "):[]).forEach(s=>{if(s.startsWith("atm_")){const[,l]=s.split("_");n[l]=s}else i.push(s)})});const r=[];for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&r.push(n[o]);return r.push(...i),r.join(" ")},Vl=Oh,Ph=e=>e.toUpperCase()===e,_h=e=>t=>e.indexOf(t)===-1,vc=(e,t)=>{const n={};return Object.keys(e).filter(_h(t)).forEach(i=>{n[i]=e[i]}),n};function Lh(e,t,n){const i=vc(t,n);if(!e){const r=typeof Qa=="function"?{default:Qa}:Qa;Object.keys(i).forEach(o=>{r.default(o)||delete i[o]})}return i}var Fh=(e,t)=>{};function Ah(e){let t="";return n=>{const i=(o,a)=>{const{as:s=e,class:l=t}=o,u=n.propsAsIs===void 0?!(typeof s=="string"&&s.indexOf("-")===-1&&!Ph(s[0])):n.propsAsIs,c=Lh(u,o,["as","class"]);c.ref=a,c.className=n.atomic?Vl(n.class,c.className||l):Vl(c.className||l,n.class);const{vars:d}=n;if(d){const f={};for(const p in d){const b=d[p],w=b[0],y=b[1]||"",S=typeof w=="function"?w(o):w;Fh(S,n.name),f[`--${p}`]=`${S}${y}`}const h=c.style||{},m=Object.keys(h);m.length>0&&m.forEach(p=>{f[p]=h[p]}),c.style=f}return e.__linaria&&e!==s?(c.as=s,ae.createElement(e,c)):ae.createElement(s,c)},r=ae.forwardRef?ae.forwardRef(i):o=>{const a=vc(o,["innerRef"]);return i(a,o.innerRef)};return r.displayName=n.name,r.__linaria={className:n.class||t,extends:e},r}}var hn=Ah;const Hh=hn("div")({name:"ImageOverlayEditorStyle",class:"gdg-i2iowwq",propsAsIs:!1});var bc={},Ra={},Ns={},ns={},Nl;function zh(){return Nl||(Nl=1,function(e){(function(t,n){n(e,g,Ff)})(Fs,function(t,n,i){Object.defineProperty(t,"__esModule",{value:!0}),t.setHasSupportToCaptureOption=m;var r=a(n),o=a(i);function a(y){return y&&y.__esModule?y:{default:y}}var s=Object.assign||function(y){for(var S=1;S<arguments.length;S++){var M=arguments[S];for(var C in M)Object.prototype.hasOwnProperty.call(M,C)&&(y[C]=M[C])}return y};function l(y,S){var M={};for(var C in y)S.indexOf(C)>=0||Object.prototype.hasOwnProperty.call(y,C)&&(M[C]=y[C]);return M}function u(y,S){if(!(y instanceof S))throw new TypeError("Cannot call a class as a function")}var c=function(){function y(S,M){for(var C=0;C<M.length;C++){var x=M[C];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(S,x.key,x)}}return function(S,M,C){return M&&y(S.prototype,M),C&&y(S,C),S}}();function d(y,S){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:y}function f(y,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);y.prototype=Object.create(S&&S.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(y,S):y.__proto__=S)}var h=!1;function m(y){h=y}try{addEventListener("test",null,Object.defineProperty({},"capture",{get:function(){m(!0)}}))}catch{}function p(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{capture:!0};return h?y:y.capture}function b(y){if("touches"in y){var S=y.touches[0],M=S.pageX,C=S.pageY;return{x:M,y:C}}var x=y.screenX,R=y.screenY;return{x,y:R}}var w=function(y){f(S,y);function S(){var M;u(this,S);for(var C=arguments.length,x=Array(C),R=0;R<C;R++)x[R]=arguments[R];var I=d(this,(M=S.__proto__||Object.getPrototypeOf(S)).call.apply(M,[this].concat(x)));return I._handleSwipeStart=I._handleSwipeStart.bind(I),I._handleSwipeMove=I._handleSwipeMove.bind(I),I._handleSwipeEnd=I._handleSwipeEnd.bind(I),I._onMouseDown=I._onMouseDown.bind(I),I._onMouseMove=I._onMouseMove.bind(I),I._onMouseUp=I._onMouseUp.bind(I),I._setSwiperRef=I._setSwiperRef.bind(I),I}return c(S,[{key:"componentDidMount",value:function(){this.swiper&&this.swiper.addEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"componentWillUnmount",value:function(){this.swiper&&this.swiper.removeEventListener("touchmove",this._handleSwipeMove,p({capture:!0,passive:!1}))}},{key:"_onMouseDown",value:function(C){this.props.allowMouseEvents&&(this.mouseDown=!0,document.addEventListener("mouseup",this._onMouseUp),document.addEventListener("mousemove",this._onMouseMove),this._handleSwipeStart(C))}},{key:"_onMouseMove",value:function(C){this.mouseDown&&this._handleSwipeMove(C)}},{key:"_onMouseUp",value:function(C){this.mouseDown=!1,document.removeEventListener("mouseup",this._onMouseUp),document.removeEventListener("mousemove",this._onMouseMove),this._handleSwipeEnd(C)}},{key:"_handleSwipeStart",value:function(C){var x=b(C),R=x.x,I=x.y;this.moveStart={x:R,y:I},this.props.onSwipeStart(C)}},{key:"_handleSwipeMove",value:function(C){if(this.moveStart){var x=b(C),R=x.x,I=x.y,E=R-this.moveStart.x,H=I-this.moveStart.y;this.moving=!0;var z=this.props.onSwipeMove({x:E,y:H},C);z&&C.cancelable&&C.preventDefault(),this.movePosition={deltaX:E,deltaY:H}}}},{key:"_handleSwipeEnd",value:function(C){this.props.onSwipeEnd(C);var x=this.props.tolerance;this.moving&&this.movePosition&&(this.movePosition.deltaX<-x?this.props.onSwipeLeft(1,C):this.movePosition.deltaX>x&&this.props.onSwipeRight(1,C),this.movePosition.deltaY<-x?this.props.onSwipeUp(1,C):this.movePosition.deltaY>x&&this.props.onSwipeDown(1,C)),this.moveStart=null,this.moving=!1,this.movePosition=null}},{key:"_setSwiperRef",value:function(C){this.swiper=C,this.props.innerRef(C)}},{key:"render",value:function(){var C=this.props;C.tagName;var x=C.className,R=C.style,I=C.children;C.allowMouseEvents,C.onSwipeUp,C.onSwipeDown,C.onSwipeLeft,C.onSwipeRight,C.onSwipeStart,C.onSwipeMove,C.onSwipeEnd,C.innerRef,C.tolerance;var E=l(C,["tagName","className","style","children","allowMouseEvents","onSwipeUp","onSwipeDown","onSwipeLeft","onSwipeRight","onSwipeStart","onSwipeMove","onSwipeEnd","innerRef","tolerance"]);return r.default.createElement(this.props.tagName,s({ref:this._setSwiperRef,onMouseDown:this._onMouseDown,onTouchStart:this._handleSwipeStart,onTouchEnd:this._handleSwipeEnd,className:x,style:R},E),I)}}]),S}(n.Component);w.displayName="ReactSwipe",w.propTypes={tagName:o.default.string,className:o.default.string,style:o.default.object,children:o.default.node,allowMouseEvents:o.default.bool,onSwipeUp:o.default.func,onSwipeDown:o.default.func,onSwipeLeft:o.default.func,onSwipeRight:o.default.func,onSwipeStart:o.default.func,onSwipeMove:o.default.func,onSwipeEnd:o.default.func,innerRef:o.default.func,tolerance:o.default.number.isRequired},w.defaultProps={tagName:"div",allowMouseEvents:!1,onSwipeUp:function(){},onSwipeDown:function(){},onSwipeLeft:function(){},onSwipeRight:function(){},onSwipeStart:function(){},onSwipeMove:function(){},onSwipeEnd:function(){},innerRef:function(){},tolerance:0},t.default=w})}(ns)),ns}(function(e){(function(t,n){n(e,zh())})(Fs,function(t,n){Object.defineProperty(t,"__esModule",{value:!0});var i=r(n);function r(o){return o&&o.__esModule?o:{default:o}}t.default=i.default})})(Ns);var fo={};Object.defineProperty(fo,"__esModule",{value:!0});fo.default=void 0;var _r=$h(Af);function $h(e){return e&&e.__esModule?e:{default:e}}function Vh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Nh={ROOT:function(t){return(0,_r.default)(Vh({"carousel-root":!0},t||"",!!t))},CAROUSEL:function(t){return(0,_r.default)({carousel:!0,"carousel-slider":t})},WRAPPER:function(t,n){return(0,_r.default)({"thumbs-wrapper":!t,"slider-wrapper":t,"axis-horizontal":n==="horizontal","axis-vertical":n!=="horizontal"})},SLIDER:function(t,n){return(0,_r.default)({thumbs:!t,slider:t,animated:!n})},ITEM:function(t,n,i){return(0,_r.default)({thumb:!t,slide:t,selected:n,previous:i})},ARROW_PREV:function(t){return(0,_r.default)({"control-arrow control-prev":!0,"control-disabled":t})},ARROW_NEXT:function(t){return(0,_r.default)({"control-arrow control-next":!0,"control-disabled":t})},DOT:function(t){return(0,_r.default)({dot:!0,selected:t})}};fo.default=Nh;var ho={},Ea={};Object.defineProperty(Ea,"__esModule",{value:!0});Ea.outerWidth=void 0;var Bh=function(t){var n=t.offsetWidth,i=getComputedStyle(t);return n+=parseInt(i.marginLeft)+parseInt(i.marginRight),n};Ea.outerWidth=Bh;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.default=void 0;var Wh=function(t,n,i){var r=t===0?t:t+n,o=i==="horizontal"?[r,0,0]:[0,r,0],a="translate3d",s="("+o.join(",")+")";return a+s};Ri.default=Wh;var go={};Object.defineProperty(go,"__esModule",{value:!0});go.default=void 0;var Uh=function(){return window};go.default=Uh;Object.defineProperty(ho,"__esModule",{value:!0});ho.default=void 0;var tr=Gh(g),jr=Ia(fo),Yh=Ea,Bl=Ia(Ri),Xh=Ia(Ns),Vo=Ia(go);function Ia(e){return e&&e.__esModule?e:{default:e}}function wc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return wc=function(){return e},e}function Gh(e){if(e&&e.__esModule)return e;if(e===null||Qi(e)!=="object"&&typeof e!="function")return{default:e};var t=wc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function Qi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qi=function(n){return typeof n}:Qi=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Qi(e)}function ys(){return ys=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ys.apply(this,arguments)}function jh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qh(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Kh(e,t,n){return t&&qh(e.prototype,t),e}function Zh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cs(e,t)}function Cs(e,t){return Cs=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Cs(e,t)}function Jh(e){var t=eg();return function(){var i=la(e),r;if(t){var o=la(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return Qh(this,r)}}function Qh(e,t){return t&&(Qi(t)==="object"||typeof t=="function")?t:Sn(e)}function Sn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function la(e){return la=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},la(e)}function pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tg=function(t){return t.hasOwnProperty("key")},Bs=function(e){Zh(n,e);var t=Jh(n);function n(i){var r;return jh(this,n),r=t.call(this,i),pn(Sn(r),"itemsWrapperRef",void 0),pn(Sn(r),"itemsListRef",void 0),pn(Sn(r),"thumbsRef",void 0),pn(Sn(r),"setItemsWrapperRef",function(o){r.itemsWrapperRef=o}),pn(Sn(r),"setItemsListRef",function(o){r.itemsListRef=o}),pn(Sn(r),"setThumbsRef",function(o,a){r.thumbsRef||(r.thumbsRef=[]),r.thumbsRef[a]=o}),pn(Sn(r),"updateSizes",function(){if(!(!r.props.children||!r.itemsWrapperRef||!r.thumbsRef)){var o=tr.Children.count(r.props.children),a=r.itemsWrapperRef.clientWidth,s=r.props.thumbWidth?r.props.thumbWidth:(0,Yh.outerWidth)(r.thumbsRef[0]),l=Math.floor(a/s),u=l<o,c=u?o-l:0;r.setState(function(d,f){return{itemSize:s,visibleItems:l,firstItem:u?r.getFirstItem(f.selectedItem):0,lastPosition:c,showArrows:u}})}}),pn(Sn(r),"handleClickItem",function(o,a,s){if(!tg(s)||s.key==="Enter"){var l=r.props.onSelectItem;typeof l=="function"&&l(o,a)}}),pn(Sn(r),"onSwipeStart",function(){r.setState({swiping:!0})}),pn(Sn(r),"onSwipeEnd",function(){r.setState({swiping:!1})}),pn(Sn(r),"onSwipeMove",function(o){var a=o.x;if(!r.state.itemSize||!r.itemsWrapperRef||!r.state.visibleItems)return!1;var s=0,l=tr.Children.count(r.props.children),u=-(r.state.firstItem*100)/r.state.visibleItems,c=Math.max(l-r.state.visibleItems,0),d=-c*100/r.state.visibleItems;u===s&&a>0&&(a=0),u===d&&a<0&&(a=0);var f=r.itemsWrapperRef.clientWidth,h=u+100/(f/a);return r.itemsListRef&&["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(m){r.itemsListRef.style[m]=(0,Bl.default)(h,"%",r.props.axis)}),!0}),pn(Sn(r),"slideRight",function(o){r.moveTo(r.state.firstItem-(typeof o=="number"?o:1))}),pn(Sn(r),"slideLeft",function(o){r.moveTo(r.state.firstItem+(typeof o=="number"?o:1))}),pn(Sn(r),"moveTo",function(o){o=o<0?0:o,o=o>=r.state.lastPosition?r.state.lastPosition:o,r.setState({firstItem:o})}),r.state={selectedItem:i.selectedItem,swiping:!1,showArrows:!1,firstItem:0,visibleItems:0,lastPosition:0},r}return Kh(n,[{key:"componentDidMount",value:function(){this.setupThumbs()}},{key:"componentDidUpdate",value:function(r){this.props.selectedItem!==this.state.selectedItem&&this.setState({selectedItem:this.props.selectedItem,firstItem:this.getFirstItem(this.props.selectedItem)}),this.props.children!==r.children&&this.updateSizes()}},{key:"componentWillUnmount",value:function(){this.destroyThumbs()}},{key:"setupThumbs",value:function(){(0,Vo.default)().addEventListener("resize",this.updateSizes),(0,Vo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.updateSizes()}},{key:"destroyThumbs",value:function(){(0,Vo.default)().removeEventListener("resize",this.updateSizes),(0,Vo.default)().removeEventListener("DOMContentLoaded",this.updateSizes)}},{key:"getFirstItem",value:function(r){var o=r;return r>=this.state.lastPosition&&(o=this.state.lastPosition),r<this.state.firstItem+this.state.visibleItems&&(o=this.state.firstItem),r<this.state.firstItem&&(o=r),o}},{key:"renderItems",value:function(){var r=this;return this.props.children.map(function(o,a){var s=jr.default.ITEM(!1,a===r.state.selectedItem),l={key:a,ref:function(c){return r.setThumbsRef(c,a)},className:s,onClick:r.handleClickItem.bind(r,a,r.props.children[a]),onKeyDown:r.handleClickItem.bind(r,a,r.props.children[a]),"aria-label":"".concat(r.props.labels.item," ").concat(a+1),style:{width:r.props.thumbWidth}};return tr.default.createElement("li",ys({},l,{role:"button",tabIndex:0}),o)})}},{key:"render",value:function(){var r=this;if(!this.props.children)return null;var o=tr.Children.count(this.props.children)>1,a=this.state.showArrows&&this.state.firstItem>0,s=this.state.showArrows&&this.state.firstItem<this.state.lastPosition,l={},u=-this.state.firstItem*(this.state.itemSize||0),c=(0,Bl.default)(u,"px",this.props.axis),d=this.props.transitionTime+"ms";return l={WebkitTransform:c,MozTransform:c,MsTransform:c,OTransform:c,transform:c,msTransform:c,WebkitTransitionDuration:d,MozTransitionDuration:d,MsTransitionDuration:d,OTransitionDuration:d,transitionDuration:d,msTransitionDuration:d},tr.default.createElement("div",{className:jr.default.CAROUSEL(!1)},tr.default.createElement("div",{className:jr.default.WRAPPER(!1),ref:this.setItemsWrapperRef},tr.default.createElement("button",{type:"button",className:jr.default.ARROW_PREV(!a),onClick:function(){return r.slideRight()},"aria-label":this.props.labels.leftArrow}),o?tr.default.createElement(Xh.default,{tagName:"ul",className:jr.default.SLIDER(!1,this.state.swiping),onSwipeLeft:this.slideLeft,onSwipeRight:this.slideRight,onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:l,innerRef:this.setItemsListRef,allowMouseEvents:this.props.emulateTouch},this.renderItems()):tr.default.createElement("ul",{className:jr.default.SLIDER(!1,this.state.swiping),ref:function(h){return r.setItemsListRef(h)},style:l},this.renderItems()),tr.default.createElement("button",{type:"button",className:jr.default.ARROW_NEXT(!s),onClick:function(){return r.slideLeft()},"aria-label":this.props.labels.rightArrow})))}}]),n}(tr.Component);ho.default=Bs;pn(Bs,"displayName","Thumbs");pn(Bs,"defaultProps",{axis:"horizontal",labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},selectedItem:0,thumbWidth:80,transitionTime:350});var Ta={};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.default=void 0;var ng=function(){return document};Ta.default=ng;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.setPosition=Fn.getPosition=Fn.isKeyboardEvent=Fn.defaultStatusFormatter=Fn.noop=void 0;var rg=g,ig=og(Ri);function og(e){return e&&e.__esModule?e:{default:e}}var ag=function(){};Fn.noop=ag;var sg=function(t,n){return"".concat(t," of ").concat(n)};Fn.defaultStatusFormatter=sg;var lg=function(t){return t?t.hasOwnProperty("key"):!1};Fn.isKeyboardEvent=lg;var ug=function(t,n){if(n.infiniteLoop&&++t,t===0)return 0;var i=rg.Children.count(n.children);if(n.centerMode&&n.axis==="horizontal"){var r=-t*n.centerSlidePercentage,o=i-1;return t&&(t!==o||n.infiniteLoop)?r+=(100-n.centerSlidePercentage)/2:t===o&&(r+=100-n.centerSlidePercentage),r}return-t*100};Fn.getPosition=ug;var cg=function(t,n){var i={};return["WebkitTransform","MozTransform","MsTransform","OTransform","transform","msTransform"].forEach(function(r){i[r]=(0,ig.default)(t,"%",n)}),i};Fn.setPosition=cg;var fr={};Object.defineProperty(fr,"__esModule",{value:!0});fr.fadeAnimationHandler=fr.slideStopSwipingHandler=fr.slideSwipeAnimationHandler=fr.slideAnimationHandler=void 0;var yc=g,dg=fg(Ri),hr=Fn;function fg(e){return e&&e.__esModule?e:{default:e}}function Wl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wl(Object(n),!0).forEach(function(i){hg(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wl(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function hg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gg=function(t,n){var i={},r=n.selectedItem,o=r,a=yc.Children.count(t.children)-1,s=t.infiniteLoop&&(r<0||r>a);if(s)return o<0?t.centerMode&&t.centerSlidePercentage&&t.axis==="horizontal"?i.itemListStyle=(0,hr.setPosition)(-(a+2)*t.centerSlidePercentage-(100-t.centerSlidePercentage)/2,t.axis):i.itemListStyle=(0,hr.setPosition)(-(a+2)*100,t.axis):o>a&&(i.itemListStyle=(0,hr.setPosition)(0,t.axis)),i;var l=(0,hr.getPosition)(r,t),u=(0,dg.default)(l,"%",t.axis),c=t.transitionTime+"ms";return i.itemListStyle={WebkitTransform:u,msTransform:u,OTransform:u,transform:u},n.swiping||(i.itemListStyle=Jr(Jr({},i.itemListStyle),{},{WebkitTransitionDuration:c,MozTransitionDuration:c,OTransitionDuration:c,transitionDuration:c,msTransitionDuration:c})),i};fr.slideAnimationHandler=gg;var mg=function(t,n,i,r){var o={},a=n.axis==="horizontal",s=yc.Children.count(n.children),l=0,u=(0,hr.getPosition)(i.selectedItem,n),c=n.infiniteLoop?(0,hr.getPosition)(s-1,n)-100:(0,hr.getPosition)(s-1,n),d=a?t.x:t.y,f=d;u===l&&d>0&&(f=0),u===c&&d<0&&(f=0);var h=u+100/(i.itemSize/f),m=Math.abs(d)>n.swipeScrollTolerance;return n.infiniteLoop&&m&&(i.selectedItem===0&&h>-100?h-=s*100:i.selectedItem===s-1&&h<-s*100&&(h+=s*100)),(!n.preventMovementUntilSwipeScrollTolerance||m||i.swipeMovementStarted)&&(i.swipeMovementStarted||r({swipeMovementStarted:!0}),o.itemListStyle=(0,hr.setPosition)(h,n.axis)),m&&!i.cancelClick&&r({cancelClick:!0}),o};fr.slideSwipeAnimationHandler=mg;var pg=function(t,n){var i=(0,hr.getPosition)(n.selectedItem,t),r=(0,hr.setPosition)(i,t.axis);return{itemListStyle:r}};fr.slideStopSwipingHandler=pg;var vg=function(t,n){var i=t.transitionTime+"ms",r="ease-in-out",o={position:"absolute",display:"block",zIndex:-2,minHeight:"100%",opacity:0,top:0,right:0,left:0,bottom:0,transitionTimingFunction:r,msTransitionTimingFunction:r,MozTransitionTimingFunction:r,WebkitTransitionTimingFunction:r,OTransitionTimingFunction:r};return n.swiping||(o=Jr(Jr({},o),{},{WebkitTransitionDuration:i,MozTransitionDuration:i,OTransitionDuration:i,transitionDuration:i,msTransitionDuration:i})),{slideStyle:o,selectedStyle:Jr(Jr({},o),{},{opacity:1,position:"relative"}),prevStyle:Jr({},o)}};fr.fadeAnimationHandler=vg;Object.defineProperty(Ra,"__esModule",{value:!0});Ra.default=void 0;var At=yg(g),bg=mo(Ns),yr=mo(fo),wg=mo(ho),No=mo(Ta),Bo=mo(go),Zi=Fn,ua=fr;function mo(e){return e&&e.__esModule?e:{default:e}}function Cc(){if(typeof WeakMap!="function")return null;var e=new WeakMap;return Cc=function(){return e},e}function yg(e){if(e&&e.__esModule)return e;if(e===null||eo(e)!=="object"&&typeof e!="function")return{default:e};var t=Cc();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=i?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}function eo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?eo=function(n){return typeof n}:eo=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},eo(e)}function Ss(){return Ss=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Ss.apply(this,arguments)}function Ul(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ul(Object(n),!0).forEach(function(i){ht(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ul(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Cg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sg(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function xg(e,t,n){return t&&Sg(e.prototype,t),e}function kg(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xs(e,t)}function xs(e,t){return xs=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},xs(e,t)}function Mg(e){var t=Eg();return function(){var i=ca(e),r;if(t){var o=ca(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return Rg(this,r)}}function Rg(e,t){return t&&(eo(t)==="object"||typeof t=="function")?t:pt(e)}function pt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eg(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ca(e){return ca=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},ca(e)}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ws=function(e){kg(n,e);var t=Mg(n);function n(i){var r;Cg(this,n),r=t.call(this,i),ht(pt(r),"thumbsRef",void 0),ht(pt(r),"carouselWrapperRef",void 0),ht(pt(r),"listRef",void 0),ht(pt(r),"itemsRef",void 0),ht(pt(r),"timer",void 0),ht(pt(r),"animationHandler",void 0),ht(pt(r),"setThumbsRef",function(a){r.thumbsRef=a}),ht(pt(r),"setCarouselWrapperRef",function(a){r.carouselWrapperRef=a}),ht(pt(r),"setListRef",function(a){r.listRef=a}),ht(pt(r),"setItemsRef",function(a,s){r.itemsRef||(r.itemsRef=[]),r.itemsRef[s]=a}),ht(pt(r),"autoPlay",function(){At.Children.count(r.props.children)<=1||(r.clearAutoPlay(),r.props.autoPlay&&(r.timer=setTimeout(function(){r.increment()},r.props.interval)))}),ht(pt(r),"clearAutoPlay",function(){r.timer&&clearTimeout(r.timer)}),ht(pt(r),"resetAutoPlay",function(){r.clearAutoPlay(),r.autoPlay()}),ht(pt(r),"stopOnHover",function(){r.setState({isMouseEntered:!0},r.clearAutoPlay)}),ht(pt(r),"startOnLeave",function(){r.setState({isMouseEntered:!1},r.autoPlay)}),ht(pt(r),"isFocusWithinTheCarousel",function(){return r.carouselWrapperRef?!!((0,No.default)().activeElement===r.carouselWrapperRef||r.carouselWrapperRef.contains((0,No.default)().activeElement)):!1}),ht(pt(r),"navigateWithKeyboard",function(a){if(r.isFocusWithinTheCarousel()){var s=r.props.axis,l=s==="horizontal",u={ArrowUp:38,ArrowRight:39,ArrowDown:40,ArrowLeft:37},c=l?u.ArrowRight:u.ArrowDown,d=l?u.ArrowLeft:u.ArrowUp;c===a.keyCode?r.increment():d===a.keyCode&&r.decrement()}}),ht(pt(r),"updateSizes",function(){if(!(!r.state.initialized||!r.itemsRef||r.itemsRef.length===0)){var a=r.props.axis==="horizontal",s=r.itemsRef[0];if(s){var l=a?s.clientWidth:s.clientHeight;r.setState({itemSize:l}),r.thumbsRef&&r.thumbsRef.updateSizes()}}}),ht(pt(r),"setMountState",function(){r.setState({hasMount:!0}),r.updateSizes()}),ht(pt(r),"handleClickItem",function(a,s){if(At.Children.count(r.props.children)!==0){if(r.state.cancelClick){r.setState({cancelClick:!1});return}r.props.onClickItem(a,s),a!==r.state.selectedItem&&r.setState({selectedItem:a})}}),ht(pt(r),"handleOnChange",function(a,s){At.Children.count(r.props.children)<=1||r.props.onChange(a,s)}),ht(pt(r),"handleClickThumb",function(a,s){r.props.onClickThumb(a,s),r.moveTo(a)}),ht(pt(r),"onSwipeStart",function(a){r.setState({swiping:!0}),r.props.onSwipeStart(a)}),ht(pt(r),"onSwipeEnd",function(a){r.setState({swiping:!1,cancelClick:!1,swipeMovementStarted:!1}),r.props.onSwipeEnd(a),r.clearAutoPlay(),r.state.autoPlay&&r.autoPlay()}),ht(pt(r),"onSwipeMove",function(a,s){r.props.onSwipeMove(s);var l=r.props.swipeAnimationHandler(a,r.props,r.state,r.setState.bind(pt(r)));return r.setState(nr({},l)),!!Object.keys(l).length}),ht(pt(r),"decrement",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem-(typeof a=="number"?a:1))}),ht(pt(r),"increment",function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;r.moveTo(r.state.selectedItem+(typeof a=="number"?a:1))}),ht(pt(r),"moveTo",function(a){if(typeof a=="number"){var s=At.Children.count(r.props.children)-1;a<0&&(a=r.props.infiniteLoop?s:0),a>s&&(a=r.props.infiniteLoop?0:s),r.selectItem({selectedItem:a}),r.state.autoPlay&&r.state.isMouseEntered===!1&&r.resetAutoPlay()}}),ht(pt(r),"onClickNext",function(){r.increment(1)}),ht(pt(r),"onClickPrev",function(){r.decrement(1)}),ht(pt(r),"onSwipeForward",function(){r.increment(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),ht(pt(r),"onSwipeBackwards",function(){r.decrement(1),r.props.emulateTouch&&r.setState({cancelClick:!0})}),ht(pt(r),"changeItem",function(a){return function(s){(!(0,Zi.isKeyboardEvent)(s)||s.key==="Enter")&&r.moveTo(a)}}),ht(pt(r),"selectItem",function(a){r.setState(nr({previousItem:r.state.selectedItem},a),function(){r.setState(r.animationHandler(r.props,r.state))}),r.handleOnChange(a.selectedItem,At.Children.toArray(r.props.children)[a.selectedItem])}),ht(pt(r),"getInitialImage",function(){var a=r.props.selectedItem,s=r.itemsRef&&r.itemsRef[a],l=s&&s.getElementsByTagName("img")||[];return l[0]}),ht(pt(r),"getVariableItemHeight",function(a){var s=r.itemsRef&&r.itemsRef[a];if(r.state.hasMount&&s&&s.children.length){var l=s.children[0].getElementsByTagName("img")||[];if(l.length>0){var u=l[0];if(!u.complete){var c=function h(){r.forceUpdate(),u.removeEventListener("load",h)};u.addEventListener("load",c)}}var d=l[0]||s.children[0],f=d.clientHeight;return f>0?f:null}return null});var o={initialized:!1,previousItem:i.selectedItem,selectedItem:i.selectedItem,hasMount:!1,isMouseEntered:!1,autoPlay:i.autoPlay,swiping:!1,swipeMovementStarted:!1,cancelClick:!1,itemSize:1,itemListStyle:{},slideStyle:{},selectedStyle:{},prevStyle:{}};return r.animationHandler=typeof i.animationHandler=="function"&&i.animationHandler||i.animationHandler==="fade"&&ua.fadeAnimationHandler||ua.slideAnimationHandler,r.state=nr(nr({},o),r.animationHandler(i,o)),r}return xg(n,[{key:"componentDidMount",value:function(){this.props.children&&this.setupCarousel()}},{key:"componentDidUpdate",value:function(r,o){!r.children&&this.props.children&&!this.state.initialized&&this.setupCarousel(),!r.autoFocus&&this.props.autoFocus&&this.forceFocus(),o.swiping&&!this.state.swiping&&this.setState(nr({},this.props.stopSwipingHandler(this.props,this.state))),(r.selectedItem!==this.props.selectedItem||r.centerMode!==this.props.centerMode)&&(this.updateSizes(),this.moveTo(this.props.selectedItem)),r.autoPlay!==this.props.autoPlay&&(this.props.autoPlay?this.setupAutoPlay():this.destroyAutoPlay(),this.setState({autoPlay:this.props.autoPlay}))}},{key:"componentWillUnmount",value:function(){this.destroyCarousel()}},{key:"setupCarousel",value:function(){var r=this;this.bindEvents(),this.state.autoPlay&&At.Children.count(this.props.children)>1&&this.setupAutoPlay(),this.props.autoFocus&&this.forceFocus(),this.setState({initialized:!0},function(){var o=r.getInitialImage();o&&!o.complete?o.addEventListener("load",r.setMountState):r.setMountState()})}},{key:"destroyCarousel",value:function(){this.state.initialized&&(this.unbindEvents(),this.destroyAutoPlay())}},{key:"setupAutoPlay",value:function(){this.autoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.addEventListener("mouseenter",this.stopOnHover),r.addEventListener("mouseleave",this.startOnLeave))}},{key:"destroyAutoPlay",value:function(){this.clearAutoPlay();var r=this.carouselWrapperRef;this.props.stopOnHover&&r&&(r.removeEventListener("mouseenter",this.stopOnHover),r.removeEventListener("mouseleave",this.startOnLeave))}},{key:"bindEvents",value:function(){(0,Bo.default)().addEventListener("resize",this.updateSizes),(0,Bo.default)().addEventListener("DOMContentLoaded",this.updateSizes),this.props.useKeyboardArrows&&(0,No.default)().addEventListener("keydown",this.navigateWithKeyboard)}},{key:"unbindEvents",value:function(){(0,Bo.default)().removeEventListener("resize",this.updateSizes),(0,Bo.default)().removeEventListener("DOMContentLoaded",this.updateSizes);var r=this.getInitialImage();r&&r.removeEventListener("load",this.setMountState),this.props.useKeyboardArrows&&(0,No.default)().removeEventListener("keydown",this.navigateWithKeyboard)}},{key:"forceFocus",value:function(){var r;(r=this.carouselWrapperRef)===null||r===void 0||r.focus()}},{key:"renderItems",value:function(r){var o=this;return this.props.children?At.Children.map(this.props.children,function(a,s){var l=s===o.state.selectedItem,u=s===o.state.previousItem,c=l&&o.state.selectedStyle||u&&o.state.prevStyle||o.state.slideStyle||{};o.props.centerMode&&o.props.axis==="horizontal"&&(c=nr(nr({},c),{},{minWidth:o.props.centerSlidePercentage+"%"})),o.state.swiping&&o.state.swipeMovementStarted&&(c=nr(nr({},c),{},{pointerEvents:"none"}));var d={ref:function(h){return o.setItemsRef(h,s)},key:"itemKey"+s+(r?"clone":""),className:yr.default.ITEM(!0,s===o.state.selectedItem,s===o.state.previousItem),onClick:o.handleClickItem.bind(o,s,a),style:c};return At.default.createElement("li",d,o.props.renderItem(a,{isSelected:s===o.state.selectedItem,isPrevious:s===o.state.previousItem}))}):[]}},{key:"renderControls",value:function(){var r=this,o=this.props,a=o.showIndicators,s=o.labels,l=o.renderIndicator,u=o.children;return a?At.default.createElement("ul",{className:"control-dots"},At.Children.map(u,function(c,d){return l&&l(r.changeItem(d),d===r.state.selectedItem,d,s.item)})):null}},{key:"renderStatus",value:function(){return this.props.showStatus?At.default.createElement("p",{className:"carousel-status"},this.props.statusFormatter(this.state.selectedItem+1,At.Children.count(this.props.children))):null}},{key:"renderThumbs",value:function(){return!this.props.showThumbs||!this.props.children||At.Children.count(this.props.children)===0?null:At.default.createElement(wg.default,{ref:this.setThumbsRef,onSelectItem:this.handleClickThumb,selectedItem:this.state.selectedItem,transitionTime:this.props.transitionTime,thumbWidth:this.props.thumbWidth,labels:this.props.labels,emulateTouch:this.props.emulateTouch},this.props.renderThumbs(this.props.children))}},{key:"render",value:function(){var r=this;if(!this.props.children||At.Children.count(this.props.children)===0)return null;var o=this.props.swipeable&&At.Children.count(this.props.children)>1,a=this.props.axis==="horizontal",s=this.props.showArrows&&At.Children.count(this.props.children)>1,l=s&&(this.state.selectedItem>0||this.props.infiniteLoop)||!1,u=s&&(this.state.selectedItem<At.Children.count(this.props.children)-1||this.props.infiniteLoop)||!1,c=this.renderItems(!0),d=c.shift(),f=c.pop(),h={className:yr.default.SLIDER(!0,this.state.swiping),onSwipeMove:this.onSwipeMove,onSwipeStart:this.onSwipeStart,onSwipeEnd:this.onSwipeEnd,style:this.state.itemListStyle,tolerance:this.props.swipeScrollTolerance},m={};if(a){if(h.onSwipeLeft=this.onSwipeForward,h.onSwipeRight=this.onSwipeBackwards,this.props.dynamicHeight){var p=this.getVariableItemHeight(this.state.selectedItem);m.height=p||"auto"}}else h.onSwipeUp=this.props.verticalSwipe==="natural"?this.onSwipeBackwards:this.onSwipeForward,h.onSwipeDown=this.props.verticalSwipe==="natural"?this.onSwipeForward:this.onSwipeBackwards,h.style=nr(nr({},h.style),{},{height:this.state.itemSize}),m.height=this.state.itemSize;return At.default.createElement("div",{"aria-label":this.props.ariaLabel,className:yr.default.ROOT(this.props.className),ref:this.setCarouselWrapperRef,tabIndex:this.props.useKeyboardArrows?0:void 0},At.default.createElement("div",{className:yr.default.CAROUSEL(!0),style:{width:this.props.width}},this.renderControls(),this.props.renderArrowPrev(this.onClickPrev,l,this.props.labels.leftArrow),At.default.createElement("div",{className:yr.default.WRAPPER(!0,this.props.axis),style:m},o?At.default.createElement(bg.default,Ss({tagName:"ul",innerRef:this.setListRef},h,{allowMouseEvents:this.props.emulateTouch}),this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d):At.default.createElement("ul",{className:yr.default.SLIDER(!0,this.state.swiping),ref:function(w){return r.setListRef(w)},style:this.state.itemListStyle||{}},this.props.infiniteLoop&&f,this.renderItems(),this.props.infiniteLoop&&d)),this.props.renderArrowNext(this.onClickNext,u,this.props.labels.rightArrow),this.renderStatus()),this.renderThumbs())}}]),n}(At.default.Component);Ra.default=Ws;ht(Ws,"displayName","Carousel");ht(Ws,"defaultProps",{ariaLabel:void 0,axis:"horizontal",centerSlidePercentage:80,interval:3e3,labels:{leftArrow:"previous slide / item",rightArrow:"next slide / item",item:"slide item"},onClickItem:Zi.noop,onClickThumb:Zi.noop,onChange:Zi.noop,onSwipeStart:function(){},onSwipeEnd:function(){},onSwipeMove:function(){return!1},preventMovementUntilSwipeScrollTolerance:!1,renderArrowPrev:function(t,n,i){return At.default.createElement("button",{type:"button","aria-label":i,className:yr.default.ARROW_PREV(!n),onClick:t})},renderArrowNext:function(t,n,i){return At.default.createElement("button",{type:"button","aria-label":i,className:yr.default.ARROW_NEXT(!n),onClick:t})},renderIndicator:function(t,n,i,r){return At.default.createElement("li",{className:yr.default.DOT(n),onClick:t,onKeyDown:t,value:i,key:i,role:"button",tabIndex:0,"aria-label":"".concat(r," ").concat(i+1)})},renderItem:function(t){return t},renderThumbs:function(t){var n=At.Children.map(t,function(i){var r=i;if(i.type!=="img"&&(r=At.Children.toArray(i.props.children).find(function(o){return o.type==="img"})),!!r)return r});return n.filter(function(i){return i}).length===0?(console.warn("No images found! Can't build the thumb list without images. If you don't need thumbs, set showThumbs={false} in the Carousel. Note that it's not possible to get images rendered inside custom components. More info at https://github.com/leandrowd/react-responsive-carousel/blob/master/TROUBLESHOOTING.md"),[]):n},statusFormatter:Zi.defaultStatusFormatter,selectedItem:0,showArrows:!0,showIndicators:!0,showStatus:!0,showThumbs:!0,stopOnHover:!0,swipeScrollTolerance:5,swipeable:!0,transitionTime:350,verticalSwipe:"standard",width:"100%",animationHandler:"slide",swipeAnimationHandler:ua.slideSwipeAnimationHandler,stopSwipingHandler:ua.slideStopSwipingHandler});var Ig={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Carousel",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"CarouselProps",{enumerable:!0,get:function(){return n.CarouselProps}}),Object.defineProperty(e,"Thumbs",{enumerable:!0,get:function(){return i.default}});var t=r(Ra),n=Ig,i=r(ho);function r(o){return o&&o.__esModule?o:{default:o}}})(bc);var Tg=Hf,Dg=function(){return Tg.Date.now()},Og=Dg,Pg=oc,rs=Og,Yl=ac,_g="Expected a function",Lg=Math.max,Fg=Math.min;function Ag(e,t,n){var i,r,o,a,s,l,u=0,c=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(_g);t=Yl(t)||0,Pg(n)&&(c=!!n.leading,d="maxWait"in n,o=d?Lg(Yl(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f);function h(x){var R=i,I=r;return i=r=void 0,u=x,a=e.apply(I,R),a}function m(x){return u=x,s=setTimeout(w,t),c?h(x):a}function p(x){var R=x-l,I=x-u,E=t-R;return d?Fg(E,o-I):E}function b(x){var R=x-l,I=x-u;return l===void 0||R>=t||R<0||d&&I>=o}function w(){var x=rs();if(b(x))return y(x);s=setTimeout(w,p(x))}function y(x){return s=void 0,f&&i?h(x):(i=r=void 0,a)}function S(){s!==void 0&&clearTimeout(s),u=0,i=l=r=s=void 0}function M(){return s===void 0?a:y(rs())}function C(){var x=rs(),R=b(x);if(i=arguments,r=this,l=x,R){if(s===void 0)return m(l);if(d)return clearTimeout(s),s=setTimeout(w,t),h(l)}return s===void 0&&(s=setTimeout(w,t)),a}return C.cancel=S,C.flush=M,C}var Sc=Ag;const xc=co(Sc);function fn(e,t,n,i,r=!1){const o=g.useRef();o.current=t,g.useEffect(()=>{if(n===null||n.addEventListener===void 0)return;const a=n,s=l=>{var u;(u=o.current)==null||u.call(a,l)};return a.addEventListener(e,s,{passive:i,capture:r}),()=>{a.removeEventListener(e,s,{capture:r})}},[e,n,i,r])}function Zr(e,t){return e===void 0?void 0:t}const Hg=Math.PI;function Xl(e){return e*Hg/180}const kc=(e,t,n)=>({x1:e-n/2,y1:t-n/2,x2:e+n/2,y2:t+n/2}),Mc=(e,t,n,i,r)=>{switch(e){case"left":return Math.floor(t)+i+r/2;case"center":return Math.floor(t+n/2);case"right":return Math.floor(t+n)-i-r/2}},Rc=(e,t,n)=>Math.min(e,t-n*2),Ec=(e,t,n)=>n.x1<=e&&e<=n.x2&&n.y1<=t&&t<=n.y2,Us=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M12.7073 7.05029C7.87391 11.8837 10.4544 9.30322 6.03024 13.7273C5.77392 13.9836 5.58981 14.3071 5.50189 14.6587L4.52521 18.5655C4.38789 19.1148 4.88543 19.6123 5.43472 19.475L9.34146 18.4983C9.69313 18.4104 10.0143 18.2286 10.2706 17.9722L16.9499 11.2929",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}),g.createElement("path",{d:"M20.4854 4.92901L19.0712 3.5148C18.2901 2.73375 17.0238 2.73375 16.2428 3.5148L14.475 5.28257C15.5326 7.71912 16.4736 8.6278 18.7176 9.52521L20.4854 7.75744C21.2665 6.97639 21.2665 5.71006 20.4854 4.92901Z",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",vectorEffect:"non-scaling-stroke"}))},zg=e=>{const t=e.fgColor??"currentColor";return g.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g.createElement("path",{d:"M19 6L10.3802 17L5.34071 11.8758",vectorEffect:"non-scaling-stroke",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))};function $g(e,t,n){const[i,r]=g.useState(e),o=g.useRef(!0);g.useEffect(()=>()=>{o.current=!1},[]);const a=g.useRef(xc(s=>{o.current&&r(s)},n));return g.useLayoutEffect(()=>{o.current&&a.current(()=>e())},t),i}const Vg="֑-߿יִ-﷽ﹰ-ﻼ",Ng="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Bg=new RegExp("^[^"+Ng+"]*["+Vg+"]");function Ys(e){return Bg.test(e)?"rtl":"not-rtl"}let Wo;function ks(){if(typeof document>"u")return 0;if(Wo!==void 0)return Wo;const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.id="testScrollbar",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.append(e),document.body.append(t);const n=e.offsetWidth;t.style.overflow="scroll";let i=e.offsetWidth;return n===i&&(i=t.clientWidth),t.remove(),Wo=n-i,Wo}const qr=Symbol();function Wg(e){const t=g.useRef([qr,e]);t.current[1]!==e&&(t.current[0]=e),t.current[1]=e;const[n,i]=g.useState(e),[,r]=g.useState(),o=g.useCallback(s=>{const l=t.current[0];l!==qr&&(s=typeof s=="function"?s(l):s,s===l)||(l!==qr&&r({}),i(u=>typeof s=="function"?s(l===qr?u:l):s),t.current[0]=qr)},[]),a=g.useCallback(()=>{t.current[0]=qr,r({})},[]);return[t.current[0]===qr?n:t.current[0],o,a]}function Ic(e){if(e.length===0)return"";let t=0,n=0;for(const i of e){if(n+=i.length,n>1e4)break;t++}return e.slice(0,t).join(", ")}function Ug(e){const t=g.useRef(e);return ki(e,t.current)||(t.current=e),t.current}const Yg=e=>{const{urls:t,canWrite:n,onEditClick:i,renderImage:r}=e,o=t.filter(s=>s!=="");if(o.length===0)return null;const a=o.length>1;return g.createElement(Hh,{"data-testid":"GDG-default-image-overlay-editor"},g.createElement(bc.Carousel,{showArrows:a,showThumbs:!1,swipeable:a,emulateTouch:a,infiniteLoop:a},o.map(s=>{const l=(r==null?void 0:r(s))??g.createElement("img",{draggable:!1,src:s});return g.createElement("div",{className:"gdg-centering-container",key:s},l)})),n&&i&&g.createElement("button",{className:"gdg-edit-icon",onClick:i},g.createElement(Us,null)))};function Tc(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let ni=Tc();function Xg(e){ni=e}const Dc=/[&<>"']/,Gg=new RegExp(Dc.source,"g"),Oc=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,jg=new RegExp(Oc.source,"g"),qg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Gl=e=>qg[e];function vn(e,t){if(t){if(Dc.test(e))return e.replace(Gg,Gl)}else if(Oc.test(e))return e.replace(jg,Gl);return e}const Kg=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Pc(e){return e.replace(Kg,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Zg=/(^|[^\[])\^/g;function Bt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(Zg,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const Jg=/[^\w:]/g,Qg=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function jl(e,t,n){if(e){let i;try{i=decodeURIComponent(Pc(n)).replace(Jg,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!Qg.test(n)&&(n=rm(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Uo={},em=/^[^:]+:\/*[^/]*$/,tm=/^([^:]+:)[\s\S]*$/,nm=/^([^:]+:\/*[^/]*)[\s\S]*$/;function rm(e,t){Uo[" "+e]||(em.test(e)?Uo[" "+e]=e+"/":Uo[" "+e]=na(e,"/",!0)),e=Uo[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(tm,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(nm,"$1")+t:e+t}const da={exec:function(){}};function ql(e,t){const n=e.replace(/\|/g,(o,a,s)=>{let l=!1,u=a;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(/\\\|/g,"|");return i}function na(e,t,n){const i=e.length;if(i===0)return"";let r=0;for(;r<i;){const o=e.charAt(i-r-1);if(o===t&&!n)r++;else if(o!==t&&n)r++;else break}return e.slice(0,i-r)}function im(e,t){if(e.indexOf(t[1])===-1)return-1;const n=e.length;let i=0,r=0;for(;r<n;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])i++;else if(e[r]===t[1]&&(i--,i<0))return r;return-1}function om(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Kl(e,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=e),t>>=1,e+=e;return n+e}function Zl(e,t,n,i){const r=t.href,o=t.title?vn(t.title):null,a=e[1].replace(/\\([\[\]])/g,"$1");if(e[0].charAt(0)!=="!"){i.state.inLink=!0;const s={type:"link",raw:n,href:r,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,s}return{type:"image",raw:n,href:r,title:o,text:vn(a)}}function am(e,t){const n=e.match(/^(\s+)(?:```)/);if(n===null)return t;const i=n[1];return t.split(`
3
- `).map(r=>{const o=r.match(/^\s+/);if(o===null)return r;const[a]=o;return a.length>=i.length?r.slice(i.length):r}).join(`
4
- `)}class Xs{constructor(t){this.options=t||ni}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const i=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:na(i,`
5
- `)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const i=n[0],r=am(i,n[3]||"");return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let i=n[2].trim();if(/#$/.test(i)){const r=na(i,"#");(this.options.pedantic||!r||/ $/.test(r))&&(i=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const i=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const o=this.lexer.blockTokens(i);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:o,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let i,r,o,a,s,l,u,c,d,f,h,m,p=n[1].trim();const b=p.length>1,w={type:"list",raw:"",ordered:b,start:b?+p.slice(0,-1):"",loose:!1,items:[]};p=b?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=b?p:"[*+-]");const y=new RegExp(`^( {0,3}${p})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(m=!1,!(!(n=y.exec(t))||this.rules.block.hr.test(t)));){if(i=n[0],t=t.substring(i.length),c=n[2].split(`
6
- `,1)[0].replace(/^\t+/,M=>" ".repeat(3*M.length)),d=t.split(`
7
- `,1)[0],this.options.pedantic?(a=2,h=c.trimLeft()):(a=n[2].search(/[^ ]/),a=a>4?1:a,h=c.slice(a),a+=n[1].length),l=!1,!c&&/^ *$/.test(d)&&(i+=d+`
8
- `,t=t.substring(d.length+1),m=!0),!m){const M=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),C=new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),x=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),R=new RegExp(`^ {0,${Math.min(3,a-1)}}#`);for(;t&&(f=t.split(`
9
- `,1)[0],d=f,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(x.test(d)||R.test(d)||M.test(d)||C.test(t)));){if(d.search(/[^ ]/)>=a||!d.trim())h+=`
10
- `+d.slice(a);else{if(l||c.search(/[^ ]/)>=4||x.test(c)||R.test(c)||C.test(c))break;h+=`
11
- `+d}!l&&!d.trim()&&(l=!0),i+=f+`
12
- `,t=t.substring(f.length+1),c=d.slice(a)}}w.loose||(u?w.loose=!0:/\n *\n *$/.test(i)&&(u=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(h),r&&(o=r[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),w.items.push({type:"list_item",raw:i,task:!!r,checked:o,loose:!1,text:h}),w.raw+=i}w.items[w.items.length-1].raw=i.trimRight(),w.items[w.items.length-1].text=h.trimRight(),w.raw=w.raw.trimRight();const S=w.items.length;for(s=0;s<S;s++)if(this.lexer.state.top=!1,w.items[s].tokens=this.lexer.blockTokens(w.items[s].text,[]),!w.loose){const M=w.items[s].tokens.filter(x=>x.type==="space"),C=M.length>0&&M.some(x=>/\n.*\n/.test(x.raw));w.loose=C}if(w.loose)for(s=0;s<S;s++)w.items[s].loose=!0;return w}}html(t){const n=this.rules.block.html.exec(t);if(n){const i={type:"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:n[0]};if(this.options.sanitize){const r=this.options.sanitizer?this.options.sanitizer(n[0]):vn(n[0]);i.type="paragraph",i.text=r,i.tokens=this.lexer.inline(r)}return i}}def(t){const n=this.rules.block.def.exec(t);if(n){const i=n[1].toLowerCase().replace(/\s+/g," "),r=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:i,raw:n[0],href:r,title:o}}}table(t){const n=this.rules.block.table.exec(t);if(n){const i={type:"table",header:ql(n[1]).map(r=>({text:r})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
13
- `):[]};if(i.header.length===i.align.length){i.raw=n[0];let r=i.align.length,o,a,s,l;for(o=0;o<r;o++)/^ *-+: *$/.test(i.align[o])?i.align[o]="right":/^ *:-+: *$/.test(i.align[o])?i.align[o]="center":/^ *:-+ *$/.test(i.align[o])?i.align[o]="left":i.align[o]=null;for(r=i.rows.length,o=0;o<r;o++)i.rows[o]=ql(i.rows[o],i.header.length).map(u=>({text:u}));for(r=i.header.length,a=0;a<r;a++)i.header[a].tokens=this.lexer.inline(i.header[a].text);for(r=i.rows.length,a=0;a<r;a++)for(l=i.rows[a],s=0;s<l.length;s++)l[s].tokens=this.lexer.inline(l[s].text);return i}}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const i=n[1].charAt(n[1].length-1)===`
14
- `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:i,tokens:this.lexer.inline(i)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:vn(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):vn(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const i=n[2].trim();if(!this.options.pedantic&&/^</.test(i)){if(!/>$/.test(i))return;const a=na(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{const a=im(n[2],"()");if(a>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+a;n[2]=n[2].substring(0,a),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let r=n[2],o="";if(this.options.pedantic){const a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);a&&(r=a[1],o=a[3])}else o=n[3]?n[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(this.options.pedantic&&!/>$/.test(i)?r=r.slice(1):r=r.slice(1,-1)),Zl(n,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let r=(i[2]||i[1]).replace(/\s+/g," ");if(r=n[r.toLowerCase()],!r){const o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return Zl(i,r,i[0],this.lexer)}}emStrong(t,n,i=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r||r[3]&&i.match(/[\p{L}\p{N}]/u))return;const o=r[1]||r[2]||"";if(!o||o&&(i===""||this.rules.inline.punctuation.exec(i))){const a=r[0].length-1;let s,l,u=a,c=0;const d=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,n=n.slice(-1*t.length+a);(r=d.exec(n))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(l=s.length,r[3]||r[4]){u+=l;continue}else if((r[5]||r[6])&&a%3&&!((a+l)%3)){c+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+c);const f=t.slice(0,a+r.index+(r[0].length-s.length)+l);if(Math.min(a,l)%2){const m=f.slice(1,-1);return{type:"em",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}const h=f.slice(2,-2);return{type:"strong",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let i=n[2].replace(/\n/g," ");const r=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return r&&o&&(i=i.substring(1,i.length-1)),i=vn(i,!0),{type:"codespan",raw:n[0],text:i}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const i=this.rules.inline.autolink.exec(t);if(i){let r,o;return i[2]==="@"?(r=vn(this.options.mangle?n(i[1]):i[1]),o="mailto:"+r):(r=vn(i[1]),o=r),{type:"link",raw:i[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t,n){let i;if(i=this.rules.inline.url.exec(t)){let r,o;if(i[2]==="@")r=vn(this.options.mangle?n(i[0]):i[0]),o="mailto:"+r;else{let a;do a=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(a!==i[0]);r=vn(i[0]),i[1]==="www."?o="http://"+i[0]:o=i[0]}return{type:"link",raw:i[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t,n){const i=this.rules.inline.text.exec(t);if(i){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):vn(i[0]):i[0]:r=vn(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}}const Xe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:da,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Xe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;Xe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;Xe.def=Bt(Xe.def).replace("label",Xe._label).replace("title",Xe._title).getRegex();Xe.bullet=/(?:[*+-]|\d{1,9}[.)])/;Xe.listItemStart=Bt(/^( *)(bull) */).replace("bull",Xe.bullet).getRegex();Xe.list=Bt(Xe.list).replace(/bull/g,Xe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Xe.def.source+")").getRegex();Xe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";Xe._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;Xe.html=Bt(Xe.html,"i").replace("comment",Xe._comment).replace("tag",Xe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();Xe.paragraph=Bt(Xe._paragraph).replace("hr",Xe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xe._tag).getRegex();Xe.blockquote=Bt(Xe.blockquote).replace("paragraph",Xe.paragraph).getRegex();Xe.normal={...Xe};Xe.gfm={...Xe.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};Xe.gfm.table=Bt(Xe.gfm.table).replace("hr",Xe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xe._tag).getRegex();Xe.gfm.paragraph=Bt(Xe._paragraph).replace("hr",Xe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Xe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Xe._tag).getRegex();Xe.pedantic={...Xe.normal,html:Bt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Xe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:da,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bt(Xe.normal._paragraph).replace("hr",Xe.hr).replace("heading",` *#{1,6} *[^
15
- ]`).replace("lheading",Xe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const Re={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:da,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:da,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Re._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";Re.punctuation=Bt(Re.punctuation).replace(/punctuation/g,Re._punctuation).getRegex();Re.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;Re.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;Re._comment=Bt(Xe._comment).replace("(?:-->|$)","-->").getRegex();Re.emStrong.lDelim=Bt(Re.emStrong.lDelim).replace(/punct/g,Re._punctuation).getRegex();Re.emStrong.rDelimAst=Bt(Re.emStrong.rDelimAst,"g").replace(/punct/g,Re._punctuation).getRegex();Re.emStrong.rDelimUnd=Bt(Re.emStrong.rDelimUnd,"g").replace(/punct/g,Re._punctuation).getRegex();Re._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;Re._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;Re._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;Re.autolink=Bt(Re.autolink).replace("scheme",Re._scheme).replace("email",Re._email).getRegex();Re._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;Re.tag=Bt(Re.tag).replace("comment",Re._comment).replace("attribute",Re._attribute).getRegex();Re._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;Re._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;Re._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;Re.link=Bt(Re.link).replace("label",Re._label).replace("href",Re._href).replace("title",Re._title).getRegex();Re.reflink=Bt(Re.reflink).replace("label",Re._label).replace("ref",Xe._label).getRegex();Re.nolink=Bt(Re.nolink).replace("ref",Xe._label).getRegex();Re.reflinkSearch=Bt(Re.reflinkSearch,"g").replace("reflink",Re.reflink).replace("nolink",Re.nolink).getRegex();Re.normal={...Re};Re.pedantic={...Re.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Bt(/^!?\[(label)\]\((.*?)\)/).replace("label",Re._label).getRegex(),reflink:Bt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Re._label).getRegex()};Re.gfm={...Re.normal,escape:Bt(Re.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};Re.gfm.url=Bt(Re.gfm.url,"i").replace("email",Re.gfm._extended_email).getRegex();Re.breaks={...Re.gfm,br:Bt(Re.br).replace("{2,}","*").getRegex(),text:Bt(Re.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function sm(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Jl(e){let t="",n,i;const r=e.length;for(n=0;n<r;n++)i=e.charCodeAt(n),Math.random()>.5&&(i="x"+i.toString(16)),t+="&#"+i+";";return t}class Hr{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ni,this.options.tokenizer=this.options.tokenizer||new Xs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:Xe.normal,inline:Re.normal};this.options.pedantic?(n.block=Xe.pedantic,n.inline=Re.pedantic):this.options.gfm&&(n.block=Xe.gfm,this.options.breaks?n.inline=Re.breaks:n.inline=Re.gfm),this.tokenizer.rules=n}static get rules(){return{block:Xe,inline:Re}}static lex(t,n){return new Hr(n).lex(t)}static lexInline(t,n){return new Hr(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
16
- `),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(s,l,u)=>l+" ".repeat(u.length));let i,r,o,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(i=s.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length),i.raw.length===1&&n.length>0?n[n.length-1].raw+=`
17
- `:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
18
- `+i.raw,r.text+=`
19
- `+i.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
20
- `+i.raw,r.text+=`
21
- `+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(o=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0;const l=t.slice(1);let u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},l),typeof u=="number"&&u>=0&&(s=Math.min(s,u))}),s<1/0&&s>=0&&(o=t.substring(0,s+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){r=n[n.length-1],a&&r.type==="paragraph"?(r.raw+=`
22
- `+i.raw,r.text+=`
23
- `+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i),a=o.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&r.type==="text"?(r.raw+=`
24
- `+i.raw,r.text+=`
25
- `+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i);continue}if(t){const s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let i,r,o,a=t,s,l,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)c.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+Kl("a",s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,s.index)+"["+Kl("a",s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.escapedEmSt.exec(a))!=null;)a=a.slice(0,s.index+s[0].length-2)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(i=c.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.escape(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.tag(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.link(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.emStrong(t,a,u)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.codespan(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.br(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.del(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.autolink(t,Jl)){t=t.substring(i.raw.length),n.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(t,Jl))){t=t.substring(i.raw.length),n.push(i);continue}if(o=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const d=t.slice(1);let f;this.options.extensions.startInline.forEach(function(h){f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(o=t.substring(0,c+1))}if(i=this.tokenizer.inlineText(o,sm)){t=t.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(u=i.raw.slice(-1)),l=!0,r=n[n.length-1],r&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}class Gs{constructor(t){this.options=t||ni}code(t,n,i){const r=(n||"").match(/\S*/)[0];if(this.options.highlight){const o=this.options.highlight(t,r);o!=null&&o!==t&&(i=!0,t=o)}return t=t.replace(/\n$/,"")+`
26
- `,r?'<pre><code class="'+this.options.langPrefix+vn(r)+'">'+(i?t:vn(t,!0))+`</code></pre>
27
- `:"<pre><code>"+(i?t:vn(t,!0))+`</code></pre>
28
- `}blockquote(t){return`<blockquote>
29
- ${t}</blockquote>
30
- `}html(t){return t}heading(t,n,i,r){if(this.options.headerIds){const o=this.options.headerPrefix+r.slug(i);return`<h${n} id="${o}">${t}</h${n}>
31
- `}return`<h${n}>${t}</h${n}>
32
- `}hr(){return this.options.xhtml?`<hr/>
33
- `:`<hr>
34
- `}list(t,n,i){const r=n?"ol":"ul",o=n&&i!==1?' start="'+i+'"':"";return"<"+r+o+`>
35
- `+t+"</"+r+`>
36
- `}listitem(t){return`<li>${t}</li>
37
- `}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(t){return`<p>${t}</p>
38
- `}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
39
- <thead>
40
- `+t+`</thead>
41
- `+n+`</table>
42
- `}tablerow(t){return`<tr>
43
- ${t}</tr>
44
- `}tablecell(t,n){const i=n.header?"th":"td";return(n.align?`<${i} align="${n.align}">`:`<${i}>`)+t+`</${i}>
45
- `}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,i){if(t=jl(this.options.sanitize,this.options.baseUrl,t),t===null)return i;let r='<a href="'+t+'"';return n&&(r+=' title="'+n+'"'),r+=">"+i+"</a>",r}image(t,n,i){if(t=jl(this.options.sanitize,this.options.baseUrl,t),t===null)return i;let r=`<img src="${t}" alt="${i}"`;return n&&(r+=` title="${n}"`),r+=this.options.xhtml?"/>":">",r}text(t){return t}}class _c{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,i){return""+i}image(t,n,i){return""+i}br(){return""}}class Lc{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let i=t,r=0;if(this.seen.hasOwnProperty(i)){r=this.seen[t];do r++,i=t+"-"+r;while(this.seen.hasOwnProperty(i))}return n||(this.seen[t]=r,this.seen[i]=0),i}slug(t,n={}){const i=this.serialize(t);return this.getNextSafeSlug(i,n.dryrun)}}class zr{constructor(t){this.options=t||ni,this.options.renderer=this.options.renderer||new Gs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new _c,this.slugger=new Lc}static parse(t,n){return new zr(n).parse(t)}static parseInline(t,n){return new zr(n).parseInline(t)}parse(t,n=!0){let i="",r,o,a,s,l,u,c,d,f,h,m,p,b,w,y,S,M,C,x;const R=t.length;for(r=0;r<R;r++){if(h=t[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(x=this.options.extensions.renderers[h.type].call({parser:this},h),x!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type))){i+=x||"";continue}switch(h.type){case"space":continue;case"hr":{i+=this.renderer.hr();continue}case"heading":{i+=this.renderer.heading(this.parseInline(h.tokens),h.depth,Pc(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue}case"code":{i+=this.renderer.code(h.text,h.lang,h.escaped);continue}case"table":{for(d="",c="",s=h.header.length,o=0;o<s;o++)c+=this.renderer.tablecell(this.parseInline(h.header[o].tokens),{header:!0,align:h.align[o]});for(d+=this.renderer.tablerow(c),f="",s=h.rows.length,o=0;o<s;o++){for(u=h.rows[o],c="",l=u.length,a=0;a<l;a++)c+=this.renderer.tablecell(this.parseInline(u[a].tokens),{header:!1,align:h.align[a]});f+=this.renderer.tablerow(c)}i+=this.renderer.table(d,f);continue}case"blockquote":{f=this.parse(h.tokens),i+=this.renderer.blockquote(f);continue}case"list":{for(m=h.ordered,p=h.start,b=h.loose,s=h.items.length,f="",o=0;o<s;o++)y=h.items[o],S=y.checked,M=y.task,w="",y.task&&(C=this.renderer.checkbox(S),b?y.tokens.length>0&&y.tokens[0].type==="paragraph"?(y.tokens[0].text=C+" "+y.tokens[0].text,y.tokens[0].tokens&&y.tokens[0].tokens.length>0&&y.tokens[0].tokens[0].type==="text"&&(y.tokens[0].tokens[0].text=C+" "+y.tokens[0].tokens[0].text)):y.tokens.unshift({type:"text",text:C}):w+=C),w+=this.parse(y.tokens,b),f+=this.renderer.listitem(w,M,S);i+=this.renderer.list(f,m,p);continue}case"html":{i+=this.renderer.html(h.text);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(f=h.tokens?this.parseInline(h.tokens):h.text;r+1<R&&t[r+1].type==="text";)h=t[++r],f+=`
46
- `+(h.tokens?this.parseInline(h.tokens):h.text);i+=n?this.renderer.paragraph(f):f;continue}default:{const I='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(I);return}else throw new Error(I)}}}return i}parseInline(t,n){n=n||this.renderer;let i="",r,o,a;const s=t.length;for(r=0;r<s;r++){if(o=t[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(a=this.options.extensions.renderers[o.type].call({parser:this},o),a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){i+=a||"";continue}switch(o.type){case"escape":{i+=n.text(o.text);break}case"html":{i+=n.html(o.text);break}case"link":{i+=n.link(o.href,o.title,this.parseInline(o.tokens,n));break}case"image":{i+=n.image(o.href,o.title,o.text);break}case"strong":{i+=n.strong(this.parseInline(o.tokens,n));break}case"em":{i+=n.em(this.parseInline(o.tokens,n));break}case"codespan":{i+=n.codespan(o.text);break}case"br":{i+=n.br();break}case"del":{i+=n.del(this.parseInline(o.tokens,n));break}case"text":{i+=n.text(o.text);break}default:{const l='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(l);return}else throw new Error(l)}}}return i}}class fa{constructor(t){this.options=t||ni}preprocess(t){return t}postprocess(t){return t}}dt(fa,"passThroughHooks",new Set(["preprocess","postprocess"]));function lm(e,t,n){return i=>{if(i.message+=`
47
- Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+vn(i.message+"",!0)+"</pre>";if(t)return Promise.resolve(r);if(n){n(null,r);return}return r}if(t)return Promise.reject(i);if(n){n(i);return}throw i}}function Fc(e,t){return(n,i,r)=>{typeof i=="function"&&(r=i,i=null);const o={...i};i={...Ke.defaults,...o};const a=lm(i.silent,i.async,r);if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(om(i),i.hooks&&(i.hooks.options=i),r){const s=i.highlight;let l;try{i.hooks&&(n=i.hooks.preprocess(n)),l=e(n,i)}catch(d){return a(d)}const u=function(d){let f;if(!d)try{i.walkTokens&&Ke.walkTokens(l,i.walkTokens),f=t(l,i),i.hooks&&(f=i.hooks.postprocess(f))}catch(h){d=h}return i.highlight=s,d?a(d):r(null,f)};if(!s||s.length<3||(delete i.highlight,!l.length))return u();let c=0;Ke.walkTokens(l,function(d){d.type==="code"&&(c++,setTimeout(()=>{s(d.text,d.lang,function(f,h){if(f)return u(f);h!=null&&h!==d.text&&(d.text=h,d.escaped=!0),c--,c===0&&u()})},0))}),c===0&&u();return}if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(s=>e(s,i)).then(s=>i.walkTokens?Promise.all(Ke.walkTokens(s,i.walkTokens)).then(()=>s):s).then(s=>t(s,i)).then(s=>i.hooks?i.hooks.postprocess(s):s).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));const s=e(n,i);i.walkTokens&&Ke.walkTokens(s,i.walkTokens);let l=t(s,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(s){return a(s)}}}function Ke(e,t,n){return Fc(Hr.lex,zr.parse)(e,t,n)}Ke.options=Ke.setOptions=function(e){return Ke.defaults={...Ke.defaults,...e},Xg(Ke.defaults),Ke};Ke.getDefaults=Tc;Ke.defaults=ni;Ke.use=function(...e){const t=Ke.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(n=>{const i={...n};if(i.async=Ke.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if(r.renderer){const o=t.renderers[r.name];o?t.renderers[r.name]=function(...a){let s=r.renderer.apply(this,a);return s===!1&&(s=o.apply(this,a)),s}:t.renderers[r.name]=r.renderer}if(r.tokenizer){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[r.level]?t[r.level].unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),i.extensions=t),n.renderer){const r=Ke.defaults.renderer||new Gs;for(const o in n.renderer){const a=r[o];r[o]=(...s)=>{let l=n.renderer[o].apply(r,s);return l===!1&&(l=a.apply(r,s)),l}}i.renderer=r}if(n.tokenizer){const r=Ke.defaults.tokenizer||new Xs;for(const o in n.tokenizer){const a=r[o];r[o]=(...s)=>{let l=n.tokenizer[o].apply(r,s);return l===!1&&(l=a.apply(r,s)),l}}i.tokenizer=r}if(n.hooks){const r=Ke.defaults.hooks||new fa;for(const o in n.hooks){const a=r[o];fa.passThroughHooks.has(o)?r[o]=s=>{if(Ke.defaults.async)return Promise.resolve(n.hooks[o].call(r,s)).then(u=>a.call(r,u));const l=n.hooks[o].call(r,s);return a.call(r,l)}:r[o]=(...s)=>{let l=n.hooks[o].apply(r,s);return l===!1&&(l=a.apply(r,s)),l}}i.hooks=r}if(n.walkTokens){const r=Ke.defaults.walkTokens;i.walkTokens=function(o){let a=[];return a.push(n.walkTokens.call(this,o)),r&&(a=a.concat(r.call(this,o))),a}}Ke.setOptions(i)})};Ke.walkTokens=function(e,t){let n=[];for(const i of e)switch(n=n.concat(t.call(Ke,i)),i.type){case"table":{for(const r of i.header)n=n.concat(Ke.walkTokens(r.tokens,t));for(const r of i.rows)for(const o of r)n=n.concat(Ke.walkTokens(o.tokens,t));break}case"list":{n=n.concat(Ke.walkTokens(i.items,t));break}default:Ke.defaults.extensions&&Ke.defaults.extensions.childTokens&&Ke.defaults.extensions.childTokens[i.type]?Ke.defaults.extensions.childTokens[i.type].forEach(function(r){n=n.concat(Ke.walkTokens(i[r],t))}):i.tokens&&(n=n.concat(Ke.walkTokens(i.tokens,t)))}return n};Ke.parseInline=Fc(Hr.lexInline,zr.parseInline);Ke.Parser=zr;Ke.parser=zr.parse;Ke.Renderer=Gs;Ke.TextRenderer=_c;Ke.Lexer=Hr;Ke.lexer=Hr.lex;Ke.Tokenizer=Xs;Ke.Slugger=Lc;Ke.Hooks=fa;Ke.parse=Ke;Ke.options;Ke.setOptions;Ke.use;Ke.walkTokens;Ke.parseInline;zr.parse;Hr.lex;const um=hn("div")({name:"MarkdownContainer",class:"gdg-mnuv029",propsAsIs:!1});class cm extends ae.PureComponent{constructor(){super(...arguments);dt(this,"targetElement",null);dt(this,"containerRefHook",n=>{this.targetElement=n,this.renderMarkdownIntoDiv()})}renderMarkdownIntoDiv(){const{targetElement:n,props:i}=this;if(n===null)return;const{contents:r,createNode:o}=i,a=Ke(r),s=document.createRange();s.selectNodeContents(n),s.deleteContents();let l=o==null?void 0:o(a);if(l===void 0){const c=document.createElement("template");c.innerHTML=a,l=c.content}n.append(l);const u=n.getElementsByTagName("a");for(const c of u)c.target="_blank",c.rel="noreferrer noopener"}render(){return this.renderMarkdownIntoDiv(),ae.createElement(um,{ref:this.containerRefHook})}}const dm=hn("textarea")({name:"InputBox",class:"gdg-izpuzkl",propsAsIs:!1}),fm=hn("div")({name:"ShadowBox",class:"gdg-s69h75o",propsAsIs:!1}),hm=hn("div")({name:"GrowingEntryStyle",class:"gdg-g1y0xocz",propsAsIs:!1});let Ql=0;const Ei=e=>{const{placeholder:t,value:n,onKeyDown:i,highlight:r,altNewline:o,validatedSelection:a,...s}=e,{onChange:l,className:u}=s,c=g.useRef(null),d=n??"";_n(l!==void 0,"GrowingEntry must be a controlled input area");const[f]=g.useState(()=>"input-box-"+(Ql=(Ql+1)%1e7));g.useEffect(()=>{const m=c.current;if(m===null||m.disabled)return;const p=d.toString().length;m.focus(),m.setSelectionRange(r?0:p,p)},[]),g.useLayoutEffect(()=>{var m;if(a!==void 0){const p=typeof a=="number"?[a,null]:a;(m=c.current)==null||m.setSelectionRange(p[0],p[1])}},[a]);const h=g.useCallback(m=>{m.key==="Enter"&&m.shiftKey&&o===!0||i==null||i(m)},[o,i]);return g.createElement(hm,{className:"gdg-growing-entry"},g.createElement(fm,{className:u},d+`
48
- `),g.createElement(dm,{...s,className:(u??"")+" gdg-input",id:f,ref:c,onKeyDown:h,value:d,placeholder:t,dir:"auto"}))},is={};let Lr=null;function gm(){const e=document.createElement("div");return e.style.opacity="0",e.style.pointerEvents="none",e.style.position="fixed",document.body.append(e),e}function ha(e){const t=e.toLowerCase().trim();if(is[t]!==void 0)return is[t];Lr=Lr||gm(),Lr.style.color="#000",Lr.style.color=t;const n=getComputedStyle(Lr).color;Lr.style.color="#fff",Lr.style.color=t;const i=getComputedStyle(Lr).color;if(i!==n)return[0,0,0,1];let r=i.replace(/[^\d.,]/g,"").split(",").map(Number.parseFloat);return r.length<4&&r.push(1),r=r.map(o=>Number.isNaN(o)?0:o),is[t]=r,r}function ei(e,t){const[n,i,r]=ha(e);return`rgba(${n}, ${i}, ${r}, ${t})`}const eu=new Map;function tu(e,t){const n=`${e}-${t}`,i=eu.get(n);if(i!==void 0)return i;const r=Ln(e,t);return eu.set(n,r),r}function Ln(e,t){if(t===void 0)return e;const[n,i,r,o]=ha(e);if(o===1)return e;const[a,s,l,u]=ha(t),c=o+u*(1-o),d=(o*n+u*a*(1-o))/c,f=(o*i+u*s*(1-o))/c,h=(o*r+u*l*(1-o))/c;return`rgba(${d}, ${f}, ${h}, ${c})`}var bi=new Map,yi=new Map,Ms=new Map;function mm(){bi.clear(),Ms.clear(),yi.clear()}function pm(e,t,n,i,r){var o,a,s;let l=0,u={};for(let d of e)l+=(o=n.get(d))!=null?o:r,u[d]=((a=u[d])!=null?a:0)+1;let c=t-l;for(let d of Object.keys(u)){let f=u[d],h=(s=n.get(d))!=null?s:r,m=h*f/l,p=c*m*i/f,b=h+p;n.set(d,b)}}function vm(e,t){var n;let i=new Map,r=0;for(let u of"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890,.-+=?"){let c=e.measureText(u).width;i.set(u,c),r+=c}let o=r/i.size,a=3,s=(t/o+a)/(a+1),l=i.keys();for(let u of l)i.set(u,((n=i.get(u))!=null?n:o)*s);return i}function to(e,t,n,i){var r,o;let a=yi.get(n);if(i&&a!==void 0&&a.count>2e4){let u=Ms.get(n);if(u===void 0&&(u=vm(e,a.size),Ms.set(n,u)),a.count>5e5){let d=0;for(let f of t)d+=(r=u.get(f))!=null?r:a.size;return d*1.01}let c=e.measureText(t);return pm(t,c.width,u,Math.max(.05,1-a.count/2e5),a.size),yi.set(n,{count:a.count+t.length,size:a.size}),c.width}let s=e.measureText(t),l=s.width/t.length;if(((o=a==null?void 0:a.count)!=null?o:0)>2e4)return s.width;if(a===void 0)yi.set(n,{count:t.length,size:l});else{let u=l-a.size,c=t.length/(a.count+t.length),d=a.size+u*c;yi.set(n,{count:a.count+t.length,size:d})}return s.width}function bm(e,t,n,i,r,o,a,s){if(t.length<=1)return t.length;if(r<n)return-1;let l=Math.floor(n/r*o),u=to(e,t.slice(0,Math.max(0,l)),i,a);if(u!==n)if(u<n){for(;u<n;)l++,u=to(e,t.slice(0,Math.max(0,l)),i,a);l--}else for(;u>n;){let c=t.lastIndexOf(" ",l-1);c>0?l=c:l--,u=to(e,t.slice(0,Math.max(0,l)),i,a)}if(t[l]!==" "){let c=0;c=t.lastIndexOf(" ",l),c>0&&(l=c)}return l}function wm(e,t,n,i,r,o){let a=`${t}_${n}_${i}px`,s=bi.get(a);if(s!==void 0)return s;if(i<=0)return[];let l=[],u=t.split(`
49
- `),c=yi.get(n),d=c===void 0?t.length:i/c.size*1.5,f=r&&c!==void 0&&c.count>2e4;for(let h of u){let m=to(e,h.slice(0,Math.max(0,d)),n,f),p=Math.min(h.length,d);if(m<=i)l.push(h);else{for(;m>i;){let b=bm(e,h,i,n,m,p,f),w=h.slice(0,Math.max(0,b));h=h.slice(w.length),l.push(w),m=to(e,h.slice(0,Math.max(0,d)),n,f),p=Math.min(h.length,d)}m>0&&l.push(h)}}return l=l.map((h,m)=>m===0?h.trimEnd():h.trim()),bi.set(a,l),bi.size>500&&bi.delete(bi.keys().next().value),l}function ym(e,t){return ae.useMemo(()=>e.map((n,i)=>({group:n.group,grow:n.grow,hasMenu:n.hasMenu,icon:n.icon,id:n.id,menuIcon:n.menuIcon,overlayIcon:n.overlayIcon,sourceIndex:i,sticky:i<t,indicatorIcon:n.indicatorIcon,style:n.style,themeOverride:n.themeOverride,title:n.title,trailingRowOptions:n.trailingRowOptions,width:n.width,growOffset:n.growOffset,rowMarker:n.rowMarker,rowMarkerChecked:n.rowMarkerChecked,headerRowMarkerTheme:n.headerRowMarkerTheme,headerRowMarkerAlwaysVisible:n.headerRowMarkerAlwaysVisible,headerRowMarkerDisabled:n.headerRowMarkerDisabled})),[e,t])}function Cm(e,t){const[n,i]=t;if(e.columns.hasIndex(n)||e.rows.hasIndex(i))return!0;if(e.current!==void 0){if(no(e.current.cell,t))return!0;const r=[e.current.range,...e.current.rangeStack];for(const o of r)if(n>=o.x&&n<o.x+o.width&&i>=o.y&&i<o.y+o.height)return!0}return!1}function so(e,t){return(e??"")===(t??"")}function Sm(e,t,n){return n.current===void 0||e[1]!==n.current.cell[1]?!1:t.span===void 0?n.current.cell[0]===e[0]:n.current.cell[0]>=t.span[0]&&n.current.cell[0]<=t.span[1]}function Ac(e,t){const[n,i]=e;return n>=t.x&&n<t.x+t.width&&i>=t.y&&i<t.y+t.height}function no(e,t){return(e==null?void 0:e[0])===(t==null?void 0:t[0])&&(e==null?void 0:e[1])===(t==null?void 0:t[1])}function Hc(e){return[e.x+e.width-1,e.y+e.height-1]}function nu(e,t,n){const i=n.x,r=n.x+n.width-1,o=n.y,a=n.y+n.height-1,[s,l]=e;if(l<o||l>a)return!1;if(t.span===void 0)return s>=i&&s<=r;const[u,c]=t.span;return u>=i&&u<=r||c>=i&&u<=r||u<i&&c>r}function xm(e,t,n,i){let r=0;if(n.current===void 0)return r;const o=n.current.range;(i||o.height*o.width>1)&&nu(e,t,o)&&r++;for(const a of n.current.rangeStack)nu(e,t,a)&&r++;return r}function zc(e,t){let n=e;if(t!==void 0){let i=[...e];const r=n[t.src];t.src>t.dest?(i.splice(t.src,1),i.splice(t.dest,0,r)):(i.splice(t.dest+1,0,r),i.splice(t.src,1)),i=i.map((o,a)=>({...o,sticky:e[a].sticky})),n=i}return n}function Mi(e,t){let n=0;const i=zc(e,t);for(let r=0;r<i.length;r++){const o=i[r];if(o.sticky)n+=o.width;else break}return n}function ri(e,t,n){if(typeof n=="number")return t*n;{let i=0;for(let r=e-t;r<e;r++)i+=n(r);return i}}function Rs(e,t,n,i,r){const o=zc(e,i),a=[];for(const u of o)if(u.sticky)a.push(u);else break;if(a.length>0)for(const u of a)n-=u.width;let s=t,l=r??0;for(;l<=n&&s<o.length;)l+=o[s].width,s++;for(let u=t;u<s;u++){const c=o[u];c.sticky||a.push(c)}return a}function km(e,t,n){let i=0;for(const r of t){const o=r.sticky?i:i+(n??0);if(e<=o+r.width)return r.sourceIndex;i+=r.width}return-1}function Mm(e,t,n,i,r,o,a,s,l,u){const c=i+r;if(n&&e<=r)return-2;if(e<=c)return-1;let d=t;for(let m=0;m<u;m++){const p=o-1-m,b=typeof a=="number"?a:a(p);if(d-=b,e>=d)return p}const f=o-u,h=e-(l??0);if(typeof a=="number"){const m=Math.floor((h-c)/a)+s;return m>=f?void 0:m}else{let m=c;for(let p=s;p<f;p++){const b=a(p);if(h<=m+b)return p;m+=b}return}}let ra=0,ro={};const Rm=typeof window>"u";async function Em(){var e;Rm||((e=document==null?void 0:document.fonts)==null?void 0:e.ready)===void 0||(await document.fonts.ready,ra=0,ro={},mm())}Em();function $c(e,t,n,i){return`${e}_${i??(t==null?void 0:t.font)}_${n}`}function ii(e,t,n,i="middle"){const r=$c(e,t,i,n);let o=ro[r];return o===void 0&&(o=t.measureText(e),ro[r]=o,ra++),ra>1e4&&(ro={},ra=0),o}function Vc(e,t){const n=$c(e,void 0,"middle",t);return ro[n]}function mr(e,t){return typeof t!="string"&&(t=t.baseFontFull),Im(e,t)}function ru(e,t){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";e.save(),e.textBaseline=t;const i=e.measureText(n);return e.restore(),i}const iu=[];function Im(e,t){for(const o of iu)if(o.key===t)return o.val;const n=ru(e,"alphabetic"),r=-(ru(e,"middle").actualBoundingBoxDescent-n.actualBoundingBoxDescent)+n.actualBoundingBoxAscent/2;return iu.push({key:t,val:r}),r}function Tm(e,t,n,i,r,o){const{ctx:a,rect:s,theme:l}=e;let u=Number.MAX_SAFE_INTEGER;const c=500;if(t!==void 0&&(u=n-t,u<c)){const d=1-u/c;a.globalAlpha=d,a.fillStyle=l.bgSearchResult,a.fillRect(s.x+1,s.y+1,s.width-(r?2:1),s.height-(o?2:1)),a.globalAlpha=1,i!==void 0&&(i.fillStyle=l.bgSearchResult)}return u<c}function po(e,t,n){const{ctx:i,theme:r}=e,o=t??{},a=n??r.textDark;return a!==o.fillStyle&&(i.fillStyle=a,o.fillStyle=a),o}function Nc(e,t,n){const{rect:i,ctx:r,theme:o}=e;r.fillStyle=o.textDark,dr({ctx:r,rect:i,theme:o},t,n)}function Bc(e,t,n,i,r,o,a,s,l){l==="right"?e.fillText(t,n+r-(s.cellHorizontalPadding+.5),i+o/2+a):l==="center"?e.fillText(t,n+r/2,i+o/2+a):e.fillText(t,n+s.cellHorizontalPadding+.5,i+o/2+a)}function Wc(e,t){const n=ii("ABCi09jgqpy",e,t);return n.actualBoundingBoxAscent+n.actualBoundingBoxDescent}function Dm(e,t){e.includes(`
50
- `)&&(e=e.split(/\r?\n/,1)[0]);const n=t/4;return e.length>n&&(e=e.slice(0,n)),e}function Om(e,t,n,i,r,o,a,s,l,u){const c=s.baseFontFull,d=wm(e,t,c,r-s.cellHorizontalPadding*2,u??!1),f=Wc(e,c),h=s.lineHeight*f,m=f+h*(d.length-1),p=m+s.cellVerticalPadding>o;p&&(e.save(),e.rect(n,i,r,o),e.clip());const b=i+o/2-m/2;let w=Math.max(i+s.cellVerticalPadding,b);for(const y of d)if(Bc(e,y,n,w,r,f,a,s,l),w+=h,w>i+o)break;p&&e.restore()}function dr(e,t,n,i,r){const{ctx:o,rect:a,theme:s}=e,{x:l,y:u,width:c,height:d}=a;i=i??!1,i||(t=Dm(t,c));const f=mr(o,s),h=Ys(t)==="rtl";if(n===void 0&&h&&(n="right"),h&&(o.direction="rtl"),t.length>0){let m=!1;n==="right"?(o.textAlign="right",m=!0):n!==void 0&&n!=="left"&&(o.textAlign=n,m=!0),i?Om(o,t,l,u,c,d,f,s,n,r):Bc(o,t,l,u,c,d,f,s,n),m&&(o.textAlign="start"),h&&(o.direction="inherit")}}function gr(e,t,n,i,r,o){typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.max(0,Math.min(o.tl,r/2,i/2)),tr:Math.max(0,Math.min(o.tr,r/2,i/2)),bl:Math.max(0,Math.min(o.bl,r/2,i/2)),br:Math.max(0,Math.min(o.br,r/2,i/2))},e.moveTo(t+o.tl,n),e.arcTo(t+i,n,t+i,n+o.tr,o.tr),e.arcTo(t+i,n+r,t+i-o.br,n+r,o.br),e.arcTo(t,n+r,t,n+r-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}function Pm(e,t,n){e.arc(t,n-1.25*3.5,1.25,0,2*Math.PI,!1),e.arc(t,n,1.25,0,2*Math.PI,!1),e.arc(t,n+1.25*3.5,1.25,0,2*Math.PI,!1)}function _m(e,t,n){const i=function(s,l){const u=l.x-s.x,c=l.y-s.y,d=Math.sqrt(u*u+c*c),f=u/d,h=c/d;return{x:u,y:l.y-s.y,len:d,nx:f,ny:h,ang:Math.atan2(h,f)}};let r;const o=t.length;let a=t[o-1];for(let s=0;s<o;s++){let l=t[s%o];const u=t[(s+1)%o],c=i(l,a),d=i(l,u),f=c.nx*d.ny-c.ny*d.nx,h=c.nx*d.nx-c.ny*-d.ny;let m=Math.asin(f<-1?-1:f>1?1:f),p=1,b=!1;h<0?m<0?m=Math.PI+m:(m=Math.PI-m,p=-1,b=!0):m>0&&(p=-1,b=!0),r=l.radius!==void 0?l.radius:n;const w=m/2;let y=Math.abs(Math.cos(w)*r/Math.sin(w)),S;y>Math.min(c.len/2,d.len/2)?(y=Math.min(c.len/2,d.len/2),S=Math.abs(y*Math.sin(w)/Math.cos(w))):S=r;let M=l.x+d.nx*y,C=l.y+d.ny*y;M+=-d.ny*S*p,C+=d.nx*S*p,e.arc(M,C,S,c.ang+Math.PI/2*p,d.ang-Math.PI/2*p,b),a=l,l=u}e.closePath()}function Es(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m){const p={x:0,y:o+u,width:0,height:0};if(e>=h.length||t>=c||t<-2||e<0)return p;const b=o-r;if(e>=d){const w=a>e?-1:1,y=Mi(h);p.x+=y+l;for(let S=a;S!==e;S+=w)p.x+=h[w===1?S:S-1].width*w}else for(let w=0;w<e;w++)p.x+=h[w].width;if(p.width=h[e].width+1,t===-1)p.y=r,p.height=b;else if(t===-2){p.y=0,p.height=r;let w=e;const y=h[e].group,S=h[e].sticky;for(;w>0&&so(h[w-1].group,y)&&h[w-1].sticky===S;){const C=h[w-1];p.x-=C.width,p.width+=C.width,w--}let M=e;for(;M+1<h.length&&so(h[M+1].group,y)&&h[M+1].sticky===S;){const C=h[M+1];p.width+=C.width,M++}if(!S){const C=Mi(h),x=p.x-C;x<0&&(p.x-=x,p.width+=x),p.x+p.width>n&&(p.width=n-p.x)}}else if(t>=c-f){let w=c-t;for(p.y=i;w>0;){const y=t+w-1;p.height=typeof m=="number"?m:m(y),p.y-=p.height,w--}p.height+=1}else{const w=s>t?-1:1;if(typeof m=="number"){const y=t-s;p.y+=y*m}else for(let y=s;y!==t;y+=w)p.y+=m(y)*w;p.height=(typeof m=="number"?m:m(t))+1}return p}const js=1<<21;function rr(e,t){return(t+2)*js+e}function Uc(e){return e%js}function qs(e){return Math.floor(e/js)-2}function Ks(e){const t=Uc(e),n=qs(e);return[t,n]}class Yc{constructor(){dt(this,"visibleWindow",{x:0,y:0,width:0,height:0});dt(this,"freezeCols",0);dt(this,"freezeRows",[]);dt(this,"isInWindow",t=>{const n=Uc(t),i=qs(t),r=this.visibleWindow,o=n>=r.x&&n<=r.x+r.width||n<this.freezeCols,a=i>=r.y&&i<=r.y+r.height||this.freezeRows.includes(i);return o&&a})}setWindow(t,n,i){this.visibleWindow.x===t.x&&this.visibleWindow.y===t.y&&this.visibleWindow.width===t.width&&this.visibleWindow.height===t.height&&this.freezeCols===n&&ki(this.freezeRows,i)||(this.visibleWindow=t,this.freezeCols=n,this.freezeRows=i,this.clearOutOfWindow())}}class Lm extends Yc{constructor(){super(...arguments);dt(this,"cache",new Map);dt(this,"setValue",(n,i)=>{this.cache.set(rr(n[0],n[1]),i)});dt(this,"getValue",n=>this.cache.get(rr(n[0],n[1])));dt(this,"clearOutOfWindow",()=>{for(const[n]of this.cache.entries())this.isInWindow(n)||this.cache.delete(n)})}}class io{constructor(t=[]){dt(this,"cells");this.cells=new Set(t.map(n=>rr(n[0],n[1])))}add(t){this.cells.add(rr(t[0],t[1]))}has(t){return t===void 0?!1:this.cells.has(rr(t[0],t[1]))}remove(t){this.cells.delete(rr(t[0],t[1]))}clear(){this.cells.clear()}get size(){return this.cells.size}hasHeader(){for(const t of this.cells)if(qs(t)<0)return!0;return!1}hasItemInRectangle(t){for(let n=t.y;n<t.y+t.height;n++)for(let i=t.x;i<t.x+t.width;i++)if(this.cells.has(rr(i,n)))return!0;return!1}hasItemInRegion(t){for(const n of t)if(this.hasItemInRectangle(n))return!0;return!1}*values(){for(const t of this.cells)yield Ks(t)}}function Fm(e){return{"--gdg-accent-color":e.accentColor,"--gdg-accent-fg":e.accentFg,"--gdg-accent-light":e.accentLight,"--gdg-text-dark":e.textDark,"--gdg-text-medium":e.textMedium,"--gdg-text-light":e.textLight,"--gdg-text-bubble":e.textBubble,"--gdg-bg-icon-header":e.bgIconHeader,"--gdg-fg-icon-header":e.fgIconHeader,"--gdg-text-header":e.textHeader,"--gdg-text-group-header":e.textGroupHeader??e.textHeader,"--gdg-text-header-selected":e.textHeaderSelected,"--gdg-bg-cell":e.bgCell,"--gdg-bg-cell-medium":e.bgCellMedium,"--gdg-bg-header":e.bgHeader,"--gdg-bg-header-has-focus":e.bgHeaderHasFocus,"--gdg-bg-header-hovered":e.bgHeaderHovered,"--gdg-bg-bubble":e.bgBubble,"--gdg-bg-bubble-selected":e.bgBubbleSelected,"--gdg-bg-search-result":e.bgSearchResult,"--gdg-border-color":e.borderColor,"--gdg-horizontal-border-color":e.horizontalBorderColor??e.borderColor,"--gdg-drilldown-border":e.drilldownBorder,"--gdg-link-color":e.linkColor,"--gdg-cell-horizontal-padding":`${e.cellHorizontalPadding}px`,"--gdg-cell-vertical-padding":`${e.cellVerticalPadding}px`,"--gdg-header-font-style":e.headerFontStyle,"--gdg-base-font-style":e.baseFontStyle,"--gdg-marker-font-style":e.markerFontStyle,"--gdg-font-family":e.fontFamily,"--gdg-editor-font-size":e.editorFontSize,...e.resizeIndicatorColor===void 0?{}:{"--gdg-resize-indicator-color":e.resizeIndicatorColor},...e.headerBottomBorderColor===void 0?{}:{"--gdg-header-bottom-border-color":e.headerBottomBorderColor},...e.roundingRadius===void 0?{}:{"--gdg-rounding-radius":`${e.roundingRadius}px`}}}const Xc={accentColor:"#4F5DFF",accentFg:"#FFFFFF",accentLight:"rgba(62, 116, 253, 0.1)",textDark:"#313139",textMedium:"#737383",textLight:"#B2B2C0",textBubble:"#313139",bgIconHeader:"#737383",fgIconHeader:"#FFFFFF",textHeader:"#313139",textGroupHeader:"#313139BB",textHeaderSelected:"#FFFFFF",bgCell:"#FFFFFF",bgCellMedium:"#FAFAFB",bgHeader:"#F7F7F8",bgHeaderHasFocus:"#E9E9EB",bgHeaderHovered:"#EFEFF1",bgBubble:"#EDEDF3",bgBubbleSelected:"#FFFFFF",bgSearchResult:"#fff9e3",borderColor:"rgba(115, 116, 131, 0.16)",drilldownBorder:"rgba(0, 0, 0, 0)",linkColor:"#353fb5",cellHorizontalPadding:8,cellVerticalPadding:3,headerIconSize:18,headerFontStyle:"600 13px",baseFontStyle:"13px",markerFontStyle:"9px",fontFamily:"Inter, Roboto, -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Ubuntu, noto, arial, sans-serif",editorFontSize:"13px",lineHeight:1.4};function Gc(){return Xc}const jc=ae.createContext(Xc);function Am(){return ae.useContext(jc)}function Sr(e,...t){const n={...e};for(const i of t)if(i!==void 0)for(const r in i)i.hasOwnProperty(r)&&(r==="bgCell"?n[r]=Ln(i[r],n[r]):n[r]=i[r]);return(n.headerFontFull===void 0||e.fontFamily!==n.fontFamily||e.headerFontStyle!==n.headerFontStyle)&&(n.headerFontFull=`${n.headerFontStyle} ${n.fontFamily}`),(n.baseFontFull===void 0||e.fontFamily!==n.fontFamily||e.baseFontStyle!==n.baseFontStyle)&&(n.baseFontFull=`${n.baseFontStyle} ${n.fontFamily}`),(n.markerFontFull===void 0||e.fontFamily!==n.fontFamily||e.markerFontStyle!==n.markerFontStyle)&&(n.markerFontFull=`${n.markerFontStyle} ${n.fontFamily}`),n}const Is=150;function Hm(e,t,n,i){var o;const r=i(t);return((o=r==null?void 0:r.measure)==null?void 0:o.call(r,e,t,n))??Is}function qc(e,t,n,i,r,o,a,s,l){let u=0;const c=r===void 0?[]:r.map(f=>{const h=Hm(e,f[i],t,l);return u=Math.max(u,h),h});if(c.length>5&&s){u=0;let f=0;for(const m of c)f+=m;const h=f/c.length;for(let m=0;m<c.length;m++)c[m]>=h*2?c[m]=0:u=Math.max(u,c[m])}u=Math.max(u,e.measureText(n.title).width+t.cellHorizontalPadding*2+(n.icon===void 0?0:28));const d=Math.max(Math.ceil(o),Math.min(Math.floor(a),Math.ceil(u)));return{...n,width:d}}function zm(e,t,n,i,r,o,a,s,l){const u=g.useRef(t),c=g.useRef(n),d=g.useRef(a);u.current=t,c.current=n,d.current=a;const[f,h]=g.useMemo(()=>{if(typeof window>"u")return[null,null];const y=document.createElement("canvas");return y.style.display="none",y.style.opacity="0",y.style.position="fixed",[y,y.getContext("2d",{alpha:!1})]},[]);g.useLayoutEffect(()=>(f&&document.documentElement.append(f),()=>{f==null||f.remove()}),[f]);const m=g.useRef({}),p=g.useRef(),[b,w]=g.useState();return g.useLayoutEffect(()=>{const y=c.current;if(y===void 0||e.every($o))return;let S=Math.max(1,10-Math.floor(e.length/1e4)),M=0;S<u.current&&S>1&&(S--,M=1);const C={x:0,y:0,width:e.length,height:Math.min(u.current,S)},x={x:0,y:u.current-1,width:e.length,height:1};(async()=>{const I=y(C,l.signal),E=M>0?y(x,l.signal):void 0;let H;typeof I=="object"?H=I:H=await zl(I),E!==void 0&&(typeof E=="object"?H=[...H,...E]:H=[...H,...await zl(E)]),p.current=e,w(H)})()},[l.signal,e]),g.useMemo(()=>{let S=e.every($o)?e:h===null?e.map(R=>$o(R)?R:{...R,width:Is}):(h.font=d.current.baseFontFull,e.map((R,I)=>{if($o(R))return R;if(m.current[R.id]!==void 0)return{...R,width:m.current[R.id]};if(b===void 0||p.current!==e||R.id===void 0)return{...R,width:Is};const E=qc(h,a,R,I,b,r,o,!0,s);return m.current[R.id]=E.width,E})),M=0,C=0;const x=[];for(const[R,I]of S.entries())M+=I.width,I.grow!==void 0&&I.grow>0&&(C+=I.grow,x.push(R));if(M<i&&x.length>0){const R=[...S],I=i-M;let E=I;for(let H=0;H<x.length;H++){const z=x[H],L=(S[z].grow??0)/C,_=H===x.length-1?E:Math.min(E,Math.floor(I*L));R[z]={...S[z],growOffset:_,width:S[z].width+_},E-=_}S=R}return{sizedColumns:S,nonGrowWidth:M}},[i,e,h,b,a,r,o,s])}function $m(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}var Vm=$m,Nm=Vm,os=ac;function Bm(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=os(n),n=n===n?n:0),t!==void 0&&(t=os(t),t=t===t?t:0),Nm(os(e),t,n)}var Wm=Bm;const Wn=co(Wm);function Um(){}var Ym=Um,as=zf,Xm=Ym,Gm=sc,jm=1/0,qm=as&&1/Gm(new as([,-0]))[1]==jm?function(e){return new as(e)}:Xm,Km=qm,Zm=$f,Jm=Vf,Qm=Nf,ep=Bf,tp=Km,np=sc,rp=200;function ip(e,t,n){var i=-1,r=Jm,o=e.length,a=!0,s=[],l=s;if(n)a=!1,r=Qm;else if(o>=rp){var u=t?null:tp(e);if(u)return np(u);a=!1,r=ep,l=new Zm}else l=t?[]:s;e:for(;++i<o;){var c=e[i],d=t?t(c):c;if(c=n||c!==0?c:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else r(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}var op=ip,ap=op;function sp(e){return e&&e.length?ap(e):[]}var lp=sp;const up=co(lp),Yt='<svg width="20" height="20" fill="none" xmlns="http://www.w3.org/2000/svg">',cp=e=>{const t=e.fgColor,n=e.bgColor;return`
51
- ${Yt}<rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/><path d="M15.75 4h-1.5a.25.25 0 0 0-.177.074L9.308 8.838a3.75 3.75 0 1 0 1.854 1.854l1.155-1.157.967.322a.5.5 0 0 0 .65-.55l-.18-1.208.363-.363.727.331a.5.5 0 0 0 .69-.59l-.254-.904.647-.647A.25.25 0 0 0 16 5.75v-1.5a.25.25 0 0 0-.25-.25zM7.5 13.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0z" fill="${t}"/></svg>`},dp=e=>{const t=e.fgColor,n=e.bgColor;return`
52
- ${Yt}<rect x="2" y="2" width="16" height="16" rx="4" fill="${n}"/><path d="m12.223 13.314 3.052-2.826a.65.65 0 0 0 0-.984l-3.052-2.822c-.27-.25-.634-.242-.865.022-.232.263-.206.636.056.882l2.601 2.41-2.601 2.41c-.262.245-.288.619-.056.882.231.263.595.277.865.026Zm-4.444.005c.266.25.634.241.866-.027.231-.263.206-.636-.06-.882L5.983 10l2.602-2.405c.266-.25.291-.62.06-.887-.232-.263-.596-.272-.866-.022L4.723 9.51a.653.653 0 0 0 0 .983l3.056 2.827Z" fill="${t}"/></svg>`},fp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
53
- <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
54
- <path d="M6.52 12.78H5.51V8.74l-1.33.47v-.87l2.29-.83h.05v5.27zm5.2 0H8.15v-.69l1.7-1.83a6.38 6.38 0 0 0 .34-.4c.09-.11.16-.22.22-.32s.1-.19.12-.27a.9.9 0 0 0 0-.56.63.63 0 0 0-.15-.23.58.58 0 0 0-.22-.15.75.75 0 0 0-.29-.05c-.27 0-.48.08-.62.23a.95.95 0 0 0-.2.65H8.03c0-.24.04-.46.13-.67a1.67 1.67 0 0 1 .97-.91c.23-.1.49-.14.77-.14.26 0 .5.04.7.11.21.08.38.18.52.32.14.13.25.3.32.48a1.74 1.74 0 0 1 .03 1.13 2.05 2.05 0 0 1-.24.47 4.16 4.16 0 0 1-.35.47l-.47.5-1 1.05h2.32v.8zm1.8-3.08h.55c.28 0 .48-.06.61-.2a.76.76 0 0 0 .2-.55.8.8 0 0 0-.05-.28.56.56 0 0 0-.13-.22.6.6 0 0 0-.23-.15.93.93 0 0 0-.32-.05.92.92 0 0 0-.29.05.72.72 0 0 0-.23.12.57.57 0 0 0-.21.46H12.4a1.3 1.3 0 0 1 .5-1.04c.15-.13.33-.23.54-.3a2.48 2.48 0 0 1 1.4 0c.2.06.4.15.55.28.15.13.27.28.36.47.08.19.13.4.13.65a1.15 1.15 0 0 1-.2.65 1.36 1.36 0 0 1-.58.49c.15.05.28.12.38.2a1.14 1.14 0 0 1 .43.62c.03.13.05.26.05.4 0 .25-.05.47-.14.66a1.42 1.42 0 0 1-.4.49c-.16.13-.35.23-.58.3a2.51 2.51 0 0 1-.73.1c-.22 0-.44-.03-.65-.09a1.8 1.8 0 0 1-.57-.28 1.43 1.43 0 0 1-.4-.47 1.41 1.41 0 0 1-.15-.66h1a.66.66 0 0 0 .22.5.87.87 0 0 0 .58.2c.25 0 .45-.07.6-.2a.71.71 0 0 0 .21-.56.97.97 0 0 0-.06-.36.61.61 0 0 0-.18-.25.74.74 0 0 0-.28-.15 1.33 1.33 0 0 0-.37-.04h-.55V9.7z" fill="${t}"/>
55
- </svg>`},hp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
56
- <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
57
- <path d="M8.182 12.4h3.636l.655 1.6H14l-3.454-8H9.455L6 14h1.527l.655-1.6zM10 7.44l1.36 3.651H8.64L10 7.441z" fill="${t}"/>
58
- </svg>`},gp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
59
- <path
60
- d="M16.2222 2H3.77778C2.8 2 2 2.8 2 3.77778V16.2222C2 17.2 2.8 18 3.77778 18H16.2222C17.2 18 17.9911 17.2 17.9911 16.2222L18 3.77778C18 2.8 17.2 2 16.2222 2Z"
61
- fill="${n}"
62
- />
63
- <path
64
- fill-rule="evenodd"
65
- clip-rule="evenodd"
66
- d="M7.66667 6.66669C5.73368 6.66669 4.16667 8.15907 4.16667 10C4.16667 11.841 5.73368 13.3334 7.66667 13.3334H12.3333C14.2663 13.3334 15.8333 11.841 15.8333 10C15.8333 8.15907 14.2663 6.66669 12.3333 6.66669H7.66667ZM12.5 12.5C13.8807 12.5 15 11.3807 15 10C15 8.61931 13.8807 7.50002 12.5 7.50002C11.1193 7.50002 10 8.61931 10 10C10 11.3807 11.1193 12.5 12.5 12.5Z"
67
- fill="${t}"
68
- />
69
- </svg>`},Kc=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
70
- <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
71
- <path fill-rule="evenodd" clip-rule="evenodd" d="M10.29 4.947a3.368 3.368 0 014.723.04 3.375 3.375 0 01.041 4.729l-.009.009-1.596 1.597a3.367 3.367 0 01-5.081-.364.71.71 0 011.136-.85 1.95 1.95 0 002.942.21l1.591-1.593a1.954 1.954 0 00-.027-2.733 1.95 1.95 0 00-2.732-.027l-.91.907a.709.709 0 11-1.001-1.007l.915-.911.007-.007z" fill="${t}"/>
72
- <path fill-rule="evenodd" clip-rule="evenodd" d="M6.55 8.678a3.368 3.368 0 015.082.364.71.71 0 01-1.136.85 1.95 1.95 0 00-2.942-.21l-1.591 1.593a1.954 1.954 0 00.027 2.733 1.95 1.95 0 002.73.028l.906-.906a.709.709 0 111.003 1.004l-.91.91-.008.01a3.368 3.368 0 01-4.724-.042 3.375 3.375 0 01-.041-4.728l.009-.009L6.55 8.678z" fill="${t}"/>
73
- </svg>
74
- `},mp=e=>{const t=e.bgColor;return`${Yt}
75
- <path stroke="${t}" stroke-width="2" d="M12 3v14"/>
76
- <path stroke="${t}" stroke-width="2" stroke-linecap="round" d="M10 4h4m-4 12h4"/>
77
- <path d="M11 14h4a3 3 0 0 0 3-3V9a3 3 0 0 0-3-3h-4v2h4a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-4v2ZM9.5 8H5a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h4.5v2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h4.5v2Z" fill="${t}"/>
78
- </svg>
79
- `},pp=Kc,vp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
80
- <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
81
- <path fill-rule="evenodd" clip-rule="evenodd" d="M7 13.138a.5.5 0 00.748.434l5.492-3.138a.5.5 0 000-.868L7.748 6.427A.5.5 0 007 6.862v6.276z" fill="${t}"/>
82
- </svg>`},bp=e=>{const t=e.fgColor,n=e.bgColor;return`
83
- ${Yt}
84
- <path d="M10 5a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0 9.17A4.17 4.17 0 0 1 5.83 10 4.17 4.17 0 0 1 10 5.83 4.17 4.17 0 0 1 14.17 10 4.17 4.17 0 0 1 10 14.17z" fill="${t}"/>
85
- <path d="M8.33 8.21a.83.83 0 1 0-.03 1.67.83.83 0 0 0 .03-1.67zm3.34 0a.83.83 0 1 0-.04 1.67.83.83 0 0 0 .04-1.67z" fill="${t}"/>
86
- <path fill-rule="evenodd" clip-rule="evenodd" d="M14.53 13.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
87
- <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
88
- <path d="M10 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 11a5 5 0 1 1 .01-10.01A5 5 0 0 1 10 15z" fill="${t}"/>
89
- <path d="M8 7.86a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2zm4 0a1 1 0 1 0-.04 2 1 1 0 0 0 .04-2z" fill="${t}"/>
90
- <path fill-rule="evenodd" clip-rule="evenodd" d="M12.53 11.9a2.82 2.82 0 0 1-5.06 0l.77-.38a1.97 1.97 0 0 0 3.52 0l.77.39z" fill="${t}"/>
91
- </svg>`},wp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
92
- <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
93
- <path opacity=".5" fill-rule="evenodd" clip-rule="evenodd" d="M12.499 10.801a.5.5 0 01.835 0l2.698 4.098a.5.5 0 01-.418.775H10.22a.5.5 0 01-.417-.775l2.697-4.098z" fill="${t}"/>
94
- <path fill-rule="evenodd" clip-rule="evenodd" d="M8.07 8.934a.5.5 0 01.824 0l4.08 5.958a.5.5 0 01-.412.782h-8.16a.5.5 0 01-.413-.782l4.08-5.958zM13.75 8.333a2.083 2.083 0 100-4.166 2.083 2.083 0 000 4.166z" fill="${t}"/>
95
- </svg>`},yp=e=>{const t=e.fgColor,n=e.bgColor;return`
96
- ${Yt}
97
- <path fill="${t}" d="M3 3h14v14H3z"/>
98
- <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2zm-7.24 9.78h1.23c.15 0 .27.06.36.18l.98 1.28a.43.43 0 0 1-.05.58l-1.2 1.21a.45.45 0 0 1-.6.04A6.72 6.72 0 0 1 7.33 10c0-.61.1-1.2.25-1.78a6.68 6.68 0 0 1 2.12-3.3.44.44 0 0 1 .6.04l1.2 1.2c.16.17.18.42.05.59l-.98 1.29a.43.43 0 0 1-.36.17H8.98A5.38 5.38 0 0 0 8.67 10c0 .62.11 1.23.3 1.79z" fill="${n}"/>
99
- </svg>`},Cp=e=>{const t=e.fgColor,n=e.bgColor;return`
100
- ${Yt}
101
- <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
102
- <path d="m13.49 13.15-2.32-3.27h1.4V7h1.86v2.88h1.4l-2.34 3.27zM11 13H9v-3l-1.5 1.92L6 10v3H4V7h2l1.5 2L9 7h2v6z" fill="${t}"/>
103
- </svg>`},Sp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
104
- <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
105
- <path d="M14.8 4.182h-.6V3H13v1.182H7V3H5.8v1.182h-.6c-.66 0-1.2.532-1.2 1.182v9.454C4 15.468 4.54 16 5.2 16h9.6c.66 0 1.2-.532 1.2-1.182V5.364c0-.65-.54-1.182-1.2-1.182zm0 10.636H5.2V7.136h9.6v7.682z" fill="${t}"/>
106
- </svg>`},xp=e=>{const t=e.fgColor,n=e.bgColor;return`
107
- ${Yt}
108
- <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
109
- <path d="M10 4a6 6 0 0 0-6 6 6 6 0 0 0 6 6 6 6 0 0 0 6-6 6 6 0 0 0-6-6zm0 10.8A4.8 4.8 0 0 1 5.2 10a4.8 4.8 0 1 1 4.8 4.8z" fill="${t}"/>
110
- <path d="M10 7H9v3.93L12.5 13l.5-.8-3-1.76V7z" fill="${t}"/>
111
- </svg>`},kp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
112
- <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
113
- <path fill-rule="evenodd" clip-rule="evenodd" d="M10 8.643a1.357 1.357 0 100 2.714 1.357 1.357 0 000-2.714zM7.357 10a2.643 2.643 0 115.286 0 2.643 2.643 0 01-5.286 0z" fill="${t}"/>
114
- <path fill-rule="evenodd" clip-rule="evenodd" d="M7.589 4.898A5.643 5.643 0 0115.643 10v.5a2.143 2.143 0 01-4.286 0V8a.643.643 0 011.286 0v2.5a.857.857 0 001.714 0V10a4.357 4.357 0 10-1.708 3.46.643.643 0 01.782 1.02 5.643 5.643 0 11-5.842-9.582z" fill="${t}"/>
115
- </svg>`},Mp=e=>{const t=e.fgColor,n=e.bgColor;return`
116
- ${Yt}
117
- <rect x="2" y="8" width="10" height="8" rx="2" fill="${n}"/>
118
- <rect x="8" y="4" width="10" height="8" rx="2" fill="${n}"/>
119
- <path d="M10.68 7.73V6l2.97 3.02-2.97 3.02v-1.77c-2.13 0-3.62.7-4.68 2.2.43-2.15 1.7-4.31 4.68-4.74z" fill="${t}"/>
120
- </svg>`},Rp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
121
- <path fill="${t}" d="M4 3h12v14H4z"/>
122
- <path fill-rule="evenodd" clip-rule="evenodd" d="M3.6 2A1.6 1.6 0 002 3.6v12.8A1.6 1.6 0 003.6 18h12.8a1.6 1.6 0 001.6-1.6V3.6A1.6 1.6 0 0016.4 2H3.6zm11.3 10.8a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7h-1.4a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.6-.693.117.117 0 00.1-.115V10.35a.117.117 0 00-.117-.116h-2.8a.117.117 0 00-.117.116v2.333c0 .064.053.117.117.117h.117a.7.7 0 01.7.7v1.4a.7.7 0 01-.7.7H9.3a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.117a.117.117 0 00.117-.117V10.35a.117.117 0 00-.117-.117h-2.8a.117.117 0 00-.117.117v2.342c0 .058.042.106.1.115a.7.7 0 01.6.693v1.4a.7.7 0 01-.7.7H5.1a.7.7 0 01-.7-.7v-1.4a.7.7 0 01.7-.7h.35a.116.116 0 00.116-.117v-2.45c0-.515.418-.933.934-.933h2.917a.117.117 0 00.117-.117V6.85a.117.117 0 00-.117-.116h-2.45a.7.7 0 01-.7-.7V5.1a.7.7 0 01.7-.7h6.067a.7.7 0 01.7.7v.934a.7.7 0 01-.7.7h-2.45a.117.117 0 00-.118.116v2.333c0 .064.053.117.117.117H13.5c.516 0 .934.418.934.934v2.45c0 .063.052.116.116.116h.35z" fill="${n}"/>
123
- </svg>`},Ep=e=>{const t=e.fgColor,n=e.bgColor;return`
124
- ${Yt}
125
- <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
126
- <path d="M9.98 13.33c.45 0 .74-.3.73-.75l-.01-.1-.16-1.67 1.45 1.05a.81.81 0 0 0 .5.18c.37 0 .72-.32.72-.76 0-.3-.17-.54-.49-.68l-1.63-.77 1.63-.77c.32-.14.49-.37.49-.67 0-.45-.34-.76-.71-.76a.81.81 0 0 0-.5.18l-1.47 1.03.16-1.74.01-.08c.01-.46-.27-.76-.72-.76-.46 0-.76.32-.75.76l.01.08.16 1.74-1.47-1.03a.77.77 0 0 0-.5-.18.74.74 0 0 0-.72.76c0 .3.17.53.49.67l1.63.77-1.62.77c-.32.14-.5.37-.5.68 0 .44.35.75.72.75a.78.78 0 0 0 .5-.17L9.4 10.8l-.16 1.68v.09c-.02.44.28.75.74.75z" fill="${t}"/>
127
- </svg>`},Ip=e=>{const t=e.fgColor,n=e.bgColor;return`
128
- ${Yt}
129
- <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
130
- <path d="M8 5.83H5.83a.83.83 0 0 0 0 1.67h1.69A4.55 4.55 0 0 1 8 5.83zm-.33 3.34H5.83a.83.83 0 0 0 0 1.66h2.72a4.57 4.57 0 0 1-.88-1.66zM5.83 12.5a.83.83 0 0 0 0 1.67h7.5a.83.83 0 1 0 0-1.67h-7.5zm8.8-2.9a3.02 3.02 0 0 0 .46-1.6c0-1.66-1.32-3-2.94-3C10.52 5 9.2 6.34 9.2 8s1.31 3 2.93 3c.58 0 1.11-.17 1.56-.47l2.04 2.08.93-.94-2.04-2.08zm-2.48.07c-.9 0-1.63-.75-1.63-1.67s.73-1.67 1.63-1.67c.9 0 1.63.75 1.63 1.67s-.73 1.67-1.63 1.67z" fill="${t}"/>
131
- </svg>`},Tp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
132
- <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
133
- <path d="M7.676 4.726V3l2.976 3.021-2.976 3.022v-1.77c-2.125 0-3.613.69-4.676 2.201.425-2.158 1.7-4.316 4.676-4.748zM10.182 14.4h3.636l.655 1.6H16l-3.454-8h-1.091L8 16h1.527l.655-1.6zM12 9.44l1.36 3.65h-2.72L12 9.44z" fill="${t}"/>
134
- </svg>`},Dp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
135
- <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
136
- <path fill-rule="evenodd" clip-rule="evenodd" d="M4.167 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666H4.167z" fill="${t}"/>
137
- <path fill-rule="evenodd" clip-rule="evenodd" d="M7.083 4.167a.833.833 0 10-1.666 0v4.166a.833.833 0 101.666 0V4.167zM11.667 5.417a.833.833 0 100 1.666h4.166a.833.833 0 100-1.666h-4.166zM5.367 11.688a.833.833 0 00-1.179 1.179l2.947 2.946a.833.833 0 001.178-1.178l-2.946-2.947z" fill="${t}"/>
138
- <path fill-rule="evenodd" clip-rule="evenodd" d="M8.313 12.867a.833.833 0 10-1.178-1.179l-2.947 2.947a.833.833 0 101.179 1.178l2.946-2.946z" fill="${t}"/>
139
- <path d="M10.833 12.5c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833zM10.833 15c0-.46.373-.833.834-.833h4.166a.833.833 0 110 1.666h-4.166a.833.833 0 01-.834-.833z" fill="${t}"/>
140
- </svg>`},Op=e=>{const t=e.fgColor,n=e.bgColor;return`
141
- ${Yt}
142
- <path d="M16.22 2H3.78C2.8 2 2 2.8 2 3.78v12.44C2 17.2 2.8 18 3.78 18h12.44c.98 0 1.77-.8 1.77-1.78L18 3.78C18 2.8 17.2 2 16.22 2z" fill="${n}"/>
143
- <path d="M10 8.84a1.16 1.16 0 1 0 0 2.32 1.16 1.16 0 0 0 0-2.32zm3.02 3.61a3.92 3.92 0 0 0 .78-3.28.49.49 0 1 0-.95.2c.19.87-.02 1.78-.58 2.47a2.92 2.92 0 1 1-4.13-4.08 2.94 2.94 0 0 1 2.43-.62.49.49 0 1 0 .17-.96 3.89 3.89 0 1 0 2.28 6.27zM10 4.17a5.84 5.84 0 0 0-5.44 7.93.49.49 0 1 0 .9-.35 4.86 4.86 0 1 1 2.5 2.67.49.49 0 1 0-.4.88c.76.35 1.6.54 2.44.53a5.83 5.83 0 0 0 0-11.66zm3.02 3.5a.7.7 0 1 0-1.4 0 .7.7 0 0 0 1.4 0zm-6.97 5.35a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4z" fill="${t}"/>
144
- </svg>`},Pp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
145
- <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
146
- <path d="M12.4 13.565c1.865-.545 3.645-2.083 3.645-4.396 0-1.514-.787-2.604-2.071-2.604C12.69 6.565 12 7.63 12 8.939c1.114.072 1.865.726 1.865 1.683 0 .933-.8 1.647-1.84 2.023l.375.92zM4 5h6v2H4zM4 9h5v2H4zM4 13h4v2H4z" fill="${t}"/>
147
- </svg>`},_p=e=>{const t=e.fgColor,n=e.bgColor;return`
148
- ${Yt}
149
- <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
150
- <path d="M12.4 13.56c1.86-.54 3.65-2.08 3.65-4.4 0-1.5-.8-2.6-2.08-2.6S12 7.64 12 8.95c1.11.07 1.86.73 1.86 1.68 0 .94-.8 1.65-1.83 2.03l.37.91zM4 5h6v2H4zm0 4h5v2H4zm0 4h4v2H4z" fill="${t}"/>
151
- </svg>`},Lp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
152
- <path d="M16.222 2H3.778C2.8 2 2 2.8 2 3.778v12.444C2 17.2 2.8 18 3.778 18h12.444c.978 0 1.77-.8 1.77-1.778L18 3.778C18 2.8 17.2 2 16.222 2z" fill="${n}"/>
153
- <path d="M10 7a1 1 0 100-2v2zm0 6a1 1 0 100 2v-2zm0-8H7v2h3V5zm-3 6h5V9H7v2zm5 2h-2v2h2v-2zm1-1a1 1 0 01-1 1v2a3 3 0 003-3h-2zm-1-1a1 1 0 011 1h2a3 3 0 00-3-3v2zM4 8a3 3 0 003 3V9a1 1 0 01-1-1H4zm3-3a3 3 0 00-3 3h2a1 1 0 011-1V5z" fill="${t}"/>
154
- <path fill-rule="evenodd" clip-rule="evenodd" d="M4.856 12.014a.5.5 0 00-.712.702L5.409 14l-1.265 1.284a.5.5 0 00.712.702l1.255-1.274 1.255 1.274a.5.5 0 00.712-.702L6.813 14l1.265-1.284a.5.5 0 00-.712-.702L6.11 13.288l-1.255-1.274zM12.856 4.014a.5.5 0 00-.712.702L13.409 6l-1.265 1.284a.5.5 0 10.712.702l1.255-1.274 1.255 1.274a.5.5 0 10.712-.702L14.813 6l1.265-1.284a.5.5 0 00-.712-.702L14.11 5.288l-1.255-1.274z" fill="${t}"/>
155
- </svg>`},Fp=e=>{const t=e.fgColor,n=e.bgColor;return`${Yt}
156
- <rect x="2" y="2" width="16" height="16" rx="2" fill="${n}"/>
157
- <path fill-rule="evenodd" clip-rule="evenodd" d="M14.25 7.25a.75.75 0 000-1.5h-6.5a.75.75 0 100 1.5h6.5zM15 10a.75.75 0 01-.75.75h-6.5a.75.75 0 010-1.5h6.5A.75.75 0 0115 10zm-.75 4.25a.75.75 0 000-1.5h-6.5a.75.75 0 000 1.5h6.5zm-8.987-7a.75.75 0 100-1.5.75.75 0 000 1.5zm.75 2.75a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm-.75 4.25a.75.75 0 100-1.5.75.75 0 000 1.5z" fill="${t}"/>
158
- </svg>`},Ap=e=>{const t=e.fgColor;return`
159
- <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
160
- <path d="M2 15v1h14v-2.5c0-.87-.44-1.55-.98-2.04a6.19 6.19 0 0 0-1.9-1.14 12.1 12.1 0 0 0-2.48-.67A4 4 0 1 0 5 6a4 4 0 0 0 2.36 3.65c-.82.13-1.7.36-2.48.67-.69.28-1.37.65-1.9 1.13A2.8 2.8 0 0 0 2 13.5V15z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
161
- </svg>`},Hp=e=>{const t=e.fgColor;return`
162
- <svg width="18" height="18" fill="none" xmlns="http://www.w3.org/2000/svg">
163
- <path d="M12.43 6.04v-.18a3.86 3.86 0 0 0-7.72 0v.18A2.15 2.15 0 0 0 3 8.14v5.72C3 15.04 3.96 16 5.14 16H12c1.18 0 2.14-.96 2.14-2.14V8.14c0-1.03-.73-1.9-1.71-2.1zM7.86 6v-.14a.71.71 0 1 1 1.43 0V6H7.86z" fill="${e.bgColor}" stroke="${t}" stroke-width="2"/>
164
- </svg>
165
- `},zp={headerRowID:cp,headerNumber:fp,headerCode:dp,headerString:hp,headerBoolean:gp,headerAudioUri:pp,headerVideoUri:vp,headerEmoji:bp,headerImage:wp,headerUri:Kc,headerPhone:yp,headerMarkdown:Cp,headerDate:Sp,headerTime:xp,headerEmail:kp,headerReference:Mp,headerIfThenElse:Rp,headerSingleValue:Ep,headerLookup:Ip,headerTextTemplate:Tp,headerMath:Dp,headerRollup:Op,headerJoinStrings:Pp,headerSplitString:_p,headerGeoDistance:Lp,headerArray:Fp,rowOwnerOverlay:Ap,protectedColumnOverlay:Hp,renameIcon:mp};function $p(e,t){return e==="normal"?[t.bgIconHeader,t.fgIconHeader]:e==="selected"?["white",t.accentColor]:[t.accentColor,t.bgHeader]}class Vp{constructor(t,n){dt(this,"onSettled");dt(this,"spriteMap",new Map);dt(this,"headerIcons");dt(this,"inFlight",0);this.onSettled=n,this.headerIcons=t??{}}drawSprite(t,n,i,r,o,a,s,l=1){const[u,c]=$p(n,s),d=a*Math.ceil(window.devicePixelRatio),f=`${u}_${c}_${d}_${t}`;let h=this.spriteMap.get(f);if(h===void 0){const m=this.headerIcons[t];if(m===void 0)return;h=document.createElement("canvas");const p=h.getContext("2d");if(p===null)return;const b=new Image;b.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m({fgColor:c,bgColor:u}))}`,this.spriteMap.set(f,h);const w=b.decode();if(w===void 0)return;this.inFlight++,w.then(()=>{p.drawImage(b,0,0,d,d)}).finally(()=>{this.inFlight--,this.inFlight===0&&this.onSettled()})}else l<1&&(i.globalAlpha=l),i.drawImage(h,0,0,d,d,r,o,a,a),l<1&&(i.globalAlpha=1)}}function Zc(e){if(e.length===0)return;let t;for(const n of e)t=Math.min(t??n.y,n.y)}function Da(e,t,n,i,r,o,a,s,l){s=s??t;let u=t,c=e;const d=i-o;let f=!1;for(;u<n&&c<d;){const h=r(c);if(u+h>s&&l(u,c,h,!1,a&&c===i-1)===!0){f=!0;break}u+=h,c++}if(!f){u=n;for(let h=0;h<o;h++){c=i-1-h;const m=r(c);u-=m,l(u,c,m,!0,a&&c===i-1)}}}function $r(e,t,n,i,r,o){let a=0,s=0;const l=r+i;for(const u of e){const c=u.sticky?s:a+n;if(o(u,c,l,u.sticky?0:s,t)===!0)break;a+=u.width,s+=u.sticky?u.width:0}}function Jc(e,t,n,i,r){let o=0,a=0;for(let s=0;s<e.length;s++){const l=e[s];let u=s+1,c=l.width;for(l.sticky&&(a+=c);u<e.length&&so(e[u].group,l.group)&&e[u].sticky===e[s].sticky;){const p=e[u];c+=p.width,u++,s++,p.sticky&&(a+=p.width)}const d=l.sticky?0:n,f=o+d,h=l.sticky?0:Math.max(0,a-f),m=Math.min(c-h,t-(f+h));r([l.sourceIndex,e[u-1].sourceIndex],l.group??"",f+h,0,m,i),o+=c}}function Qc(e,t,n,i,r,o,a){var f;const[s,l]=e;let u,c;const d=((f=a.find(h=>!h.sticky))==null?void 0:f.sourceIndex)??0;if(l>d){const h=Math.max(s,d);let m=t,p=i;for(let b=o.sourceIndex-1;b>=h;b--)m-=a[b].width,p+=a[b].width;for(let b=o.sourceIndex+1;b<=l;b++)p+=a[b].width;c={x:m,y:n,width:p,height:r}}if(d>s){const h=Math.min(l,d-1);let m=t,p=i;for(let b=o.sourceIndex-1;b>=s;b--)m-=a[b].width,p+=a[b].width;for(let b=o.sourceIndex+1;b<=h;b++)p+=a[b].width;u={x:m,y:n,width:p,height:r}}return[u,c]}function Np(e,t,n,i){if(i==="any")return ed(e,{x:t,y:n,width:1,height:1});if(i==="vertical"&&(t=e.x),i==="horizontal"&&(n=e.y),Ac([t,n],e))return;const r=t-e.x,o=e.x+e.width-t,a=n-e.y+1,s=e.y+e.height-n,l=Math.min(i==="vertical"?Number.MAX_SAFE_INTEGER:r,i==="vertical"?Number.MAX_SAFE_INTEGER:o,i==="horizontal"?Number.MAX_SAFE_INTEGER:a,i==="horizontal"?Number.MAX_SAFE_INTEGER:s);return l===s?{x:e.x,y:e.y+e.height,width:e.width,height:n-e.y-e.height+1}:l===a?{x:e.x,y:n,width:e.width,height:e.y-n}:l===o?{x:e.x+e.width,y:e.y,width:t-e.x-e.width+1,height:e.height}:{x:t,y:e.y,width:e.x-t,height:e.height}}function lo(e,t,n,i,r,o,a,s){return e<=r+a&&r<=e+n&&t<=o+s&&o<=t+i}function Qr(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height}function ed(e,t){const n=Math.min(e.x,t.x),i=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width)-n,o=Math.max(e.y+e.height,t.y+t.height)-i;return{x:n,y:i,width:r,height:o}}function Bp(e,t){return e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height}function Wp(e,t,n,i){if(e.x>t||e.y>n||e.x<0&&e.y<0&&e.x+e.width>t&&e.y+e.height>n)return;if(e.x>=0&&e.y>=0&&e.x+e.width<=t&&e.y+e.height<=n)return e;const r=-4,o=-4,a=t+4,s=n+4,l=r-e.x,u=e.x+e.width-a,c=o-e.y,d=e.y+e.height-s,f=l>0?e.x+Math.floor(l/i)*i:e.x,h=u>0?e.x+e.width-Math.floor(u/i)*i:e.x+e.width,m=c>0?e.y+Math.floor(c/i)*i:e.y,p=d>0?e.y+e.height-Math.floor(d/i)*i:e.y+e.height;return{x:f,y:m,width:h-f,height:p-m}}function Up(e,t,n,i,r){const[o,a,s,l]=t,[u,c,d,f]=r,{x:h,y:m,width:p,height:b}=e,w=[];if(p<=0||b<=0)return w;const y=h+p,S=m+b,M=h<o,C=m<a,x=h+p>s,R=m+b>l,I=h>=o&&h<s||y>o&&y<=s||h<o&&y>s,E=m>=a&&m<l||S>a&&S<=l||m<a&&S>l;if(I&&E){const z=Math.max(h,o),L=Math.max(m,a),_=Math.min(y,s),O=Math.min(S,l);w.push({rect:{x:z,y:L,width:_-z,height:O-L},clip:{x:u,y:c,width:d-u+1,height:f-c+1}})}if(M&&C){const z=h,L=m,_=Math.min(y,o),O=Math.min(S,a);w.push({rect:{x:z,y:L,width:_-z,height:O-L},clip:{x:0,y:0,width:u+1,height:c+1}})}if(C&&I){const z=Math.max(h,o),L=m,_=Math.min(y,s),O=Math.min(S,a);w.push({rect:{x:z,y:L,width:_-z,height:O-L},clip:{x:u,y:0,width:d-u+1,height:c+1}})}if(C&&x){const z=Math.max(h,s),L=m,_=y,O=Math.min(S,a);w.push({rect:{x:z,y:L,width:_-z,height:O-L},clip:{x:d,y:0,width:n-d+1,height:c+1}})}if(M&&E){const z=h,L=Math.max(m,a),_=Math.min(y,o),O=Math.min(S,l);w.push({rect:{x:z,y:L,width:_-z,height:O-L},clip:{x:0,y:c,width:u+1,height:f-c+1}})}if(x&&E){const z=Math.max(h,s),L=Math.max(m,a),_=y,O=Math.min(S,l);w.push({rect:{x:z,y:L,width:_-z,height:O-L},clip:{x:d,y:c,width:n-d+1,height:f-c+1}})}if(M&&R){const z=h,L=Math.max(m,l),_=Math.min(y,o),O=S;w.push({rect:{x:z,y:L,width:_-z,height:O-L},clip:{x:0,y:f,width:u+1,height:i-f+1}})}if(R&&I){const z=Math.max(h,o),L=Math.max(m,l),_=Math.min(y,s),O=S;w.push({rect:{x:z,y:L,width:_-z,height:O-L},clip:{x:u,y:f,width:d-u+1,height:i-f+1}})}if(x&&R){const z=Math.max(h,s),L=Math.max(m,l),_=y,O=S;w.push({rect:{x:z,y:L,width:_-z,height:O-L},clip:{x:d,y:f,width:n-d+1,height:i-f+1}})}return w}const Yp={kind:Z.Loading,allowOverlay:!1};function ou(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m,p,b,w,y,S,M,C,x,R,I,E,H,z,L,_,O,ne,q,oe,Se){let xe=(S==null?void 0:S.size)??Number.MAX_SAFE_INTEGER;const re=performance.now();let J=_.baseFontFull;e.font=J;const ee={ctx:e},ie=[0,0],ge=b>0?ri(l,b,u):0;let fe,G;const P=Zc(y);return $r(t,s,o,a,r,(k,$,le,Te,Be)=>{const ce=Math.max(0,Te-$),nt=$+ce,ke=r+1,bt=k.width-ce,Et=i-r-1;if(y.length>0){let $e=!1;for(let Le=0;Le<y.length;Le++){const Je=y[Le];if(lo(nt,ke,bt,Et,Je.x,Je.y,Je.width,Je.height)){$e=!0;break}}if(!$e)return}const at=()=>{e.save(),e.beginPath(),e.rect(nt,ke,bt,Et),e.clip()},te=M.columns.hasIndex(k.sourceIndex),it=d(k.group??"").overrideTheme,me=k.themeOverride===void 0&&it===void 0?_:Sr(_,it,k.themeOverride),se=me.baseFontFull;se!==J&&(J=se,e.font=se),at();let he;return Da(Be,le,i,l,u,b,w,P,($e,Le,Je,de,be)=>{var dn,De,lt;if(Le<0||(ie[0]=k.sourceIndex,ie[1]=Le,S!==void 0&&!S.has(ie)))return;if(y.length>0){let ze=!1;for(let Lt=0;Lt<y.length;Lt++){const vt=y[Lt];if(lo($,$e,k.width,Je,vt.x,vt.y,vt.width,vt.height)){ze=!0;break}}if(!ze)return}const Ge=M.rows.hasIndex(Le),Ae=h.hasIndex(Le),tt=Le<l?c(ie):Yp;let wt=$,gt=k.width,He=!1,_t=!1;if(tt.span!==void 0){const[ze,Lt]=tt.span,vt=`${Le},${ze},${Lt},${k.sticky}`;if(G===void 0&&(G=new Set),G.has(vt)){xe--;return}else{const on=Qc(tt.span,$,$e,k.width,Je,k,n),Tt=k.sticky?on[0]:on[1];if(!k.sticky&&on[0]!==void 0&&(_t=!0),Tt!==void 0){wt=Tt.x,gt=Tt.width,G.add(vt),e.restore(),he=void 0,e.save(),e.beginPath();const Ft=Math.max(0,Te-Tt.x);e.rect(Tt.x+Ft,$e,Tt.width-Ft,Je),fe===void 0&&(fe=[]),fe.push({x:Tt.x+Ft,y:$e,width:Tt.width-Ft,height:Je}),e.clip(),He=!0}}}const Xt=f==null?void 0:f(Le),Ot=be&&((dn=k.trailingRowOptions)==null?void 0:dn.themeOverride)!==void 0?(De=k.trailingRowOptions)==null?void 0:De.themeOverride:void 0,Ht=tt.themeOverride===void 0&&Xt===void 0&&Ot===void 0?me:Sr(me,Xt,Ot,tt.themeOverride);e.beginPath();const rn=Sm(ie,tt,M);let zt=xm(ie,tt,M,p);const gn=tt.span!==void 0&&M.columns.some(ze=>tt.span!==void 0&&ze>=tt.span[0]&&ze<=tt.span[1]);rn&&!m&&p?zt=0:rn&&p&&(zt=Math.max(zt,1)),gn&&zt++,rn||(Ge&&zt++,te&&!be&&zt++);const $t=tt.kind===Z.Protected?Ht.bgCellMedium:Ht.bgCell;let It;if((de||$t!==_.bgCell)&&(It=Ln($t,It)),zt>0||Ae){Ae&&(It=Ln(Ht.bgHeader,It));for(let ze=0;ze<zt;ze++)It=Ln(Ht.accentLight,It)}else if(C!==void 0){for(const ze of C)if(ze[0]===k.sourceIndex&&ze[1]===Le){It=Ln(Ht.bgSearchResult,It);break}}if(x!==void 0)for(let ze=0;ze<x.length;ze++){const Lt=x[ze],vt=Lt.range;Lt.style!=="solid-outline"&&vt.x<=k.sourceIndex&&k.sourceIndex<vt.x+vt.width&&vt.y<=Le&&Le<vt.y+vt.height&&(It=Ln(Lt.color,It))}let In=!1;if(S!==void 0){const ze=$e+1,vt=(de?ze+Je-1:Math.min(ze+Je-1,i-ge))-ze;(vt!==Je-1||wt+1<=Te)&&(In=!0,e.save(),e.beginPath(),e.rect(wt+1,ze,gt-1,vt),e.clip()),It=It===void 0?Ht.bgCell:Ln(It,Ht.bgCell)}const bn=k.sourceIndex===n.length-1,Oe=Le===l-1;It!==void 0&&(e.fillStyle=It,he!==void 0&&(he.fillStyle=It),S!==void 0?e.fillRect(wt+1,$e+1,gt-(bn?2:1),Je-(Oe?2:1)):e.fillRect(wt,$e,gt,Je)),tt.style==="faded"&&(e.globalAlpha=.6);let Vt;for(let ze=0;ze<E.length;ze++){const Lt=E[ze];if(Lt.item[0]===k.sourceIndex&&Lt.item[1]===Le){Vt=Lt;break}}if(gt>Se&&!_t){const ze=Ht.baseFontFull;ze!==J&&(e.font=ze,J=ze),he=td(e,tt,k.sourceIndex,Le,bn,Oe,wt,$e,gt,Je,zt>0,Ht,It??Ht.bgCell,R,I,(Vt==null?void 0:Vt.hoverAmount)??0,H,L,re,z,he,O,ne,q,oe)}return In&&e.restore(),tt.style==="faded"&&(e.globalAlpha=1),xe--,He&&(e.restore(),(lt=he==null?void 0:he.deprep)==null||lt.call(he,ee),he=void 0,at(),J=se,e.font=se),xe<=0}),e.restore(),xe<=0}),fe}const Ui=[0,0],Yi={x:0,y:0,width:0,height:0},ss=[void 0,()=>{}];let Ts=!1;function Xp(){Ts=!0}function td(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m,p,b,w,y,S,M,C,x,R,I){var ne,q;let E,H;b!==void 0&&b[0][0]===n&&b[0][1]===i&&(E=b[1][0],H=b[1][1]);let z;Ui[0]=n,Ui[1]=i,Yi.x=a,Yi.y=s,Yi.width=l,Yi.height=u,ss[0]=x.getValue(Ui),ss[1]=oe=>x.setValue(Ui,oe),Ts=!1;const L={ctx:e,theme:d,col:n,row:i,cell:t,rect:Yi,highlighted:c,cellFillColor:f,hoverAmount:p,frameTime:y,hoverX:E,drawState:ss,hoverY:H,imageLoader:h,spriteManager:m,hyperWrapping:w,overrideCursor:E!==void 0?I:void 0,requestAnimationFrame:Xp},_=Tm(L,t.lastUpdated,y,M,r,o),O=R(t);if(O!==void 0){(M==null?void 0:M.renderer)!==O&&((ne=M==null?void 0:M.deprep)==null||ne.call(M,L),M=void 0);const oe=(q=O.drawPrep)==null?void 0:q.call(O,L,M);S!==void 0&&!wi(L.cell)?S(L,()=>O.draw(L,t)):O.draw(L,t),z=oe===void 0?void 0:{deprep:oe==null?void 0:oe.deprep,fillStyle:oe==null?void 0:oe.fillStyle,font:oe==null?void 0:oe.font,renderer:O}}return(_||Ts)&&(C==null||C(Ui)),z}function Zs(e,t,n,i,r,o,a,s,l=-20,u=-20,c=32,d="center",f="square"){const h=Math.floor(r+a/2),m=f==="circle"?1e4:t.roundingRadius??4;let p=Rc(c,a,t.cellVerticalPadding),b=p/2;const w=Mc(d,i,o,t.cellHorizontalPadding,p),y=kc(w,h,p),S=Ec(i+l,r+u,y);switch(n){case!0:{e.beginPath(),gr(e,w-p/2,h-p/2,p,p,m),f==="circle"&&(b*=.8,p*=.8),e.fillStyle=s?t.accentColor:t.textMedium,e.fill(),e.beginPath(),e.moveTo(w-b+p/4.23,h-b+p/1.97),e.lineTo(w-b+p/2.42,h-b+p/1.44),e.lineTo(w-b+p/1.29,h-b+p/3.25),e.strokeStyle=t.bgCell,e.lineJoin="round",e.lineCap="round",e.lineWidth=1.9,e.stroke();break}case aa:case!1:{e.beginPath(),gr(e,w-p/2+.5,h-p/2+.5,p-1,p-1,m),e.lineWidth=1,e.strokeStyle=S?t.textDark:t.textMedium,e.stroke();break}case $s:{e.beginPath(),gr(e,w-p/2,h-p/2,p,p,m),e.fillStyle=S?t.textMedium:t.textLight,e.fill(),f==="circle"&&(b*=.8,p*=.8),e.beginPath(),e.moveTo(w-p/3,h),e.lineTo(w+p/3,h),e.strokeStyle=t.bgCell,e.lineCap="round",e.lineWidth=1.9,e.stroke();break}default:ao()}}function Gp(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m,p,b,w,y){var E,H,z,L;const S=a+s;if(S<=0)return;e.fillStyle=d.bgHeader,e.fillRect(0,0,r,S);const M=(E=i==null?void 0:i[0])==null?void 0:E[0],C=(H=i==null?void 0:i[0])==null?void 0:H[1],x=(z=i==null?void 0:i[1])==null?void 0:z[0],R=(L=i==null?void 0:i[1])==null?void 0:L[1],I=d.headerFontFull;e.font=I,$r(t,0,o,0,S,(_,O,ne,q)=>{var k;if(b!==void 0&&!b.has([_.sourceIndex,-1]))return;const oe=Math.max(0,q-O);e.save(),e.beginPath(),e.rect(O+oe,s,_.width-oe,a),e.clip();const Se=p(_.group??"").overrideTheme,xe=_.themeOverride===void 0&&Se===void 0?d:Sr(d,Se,_.themeOverride);xe.bgHeader!==d.bgHeader&&(e.fillStyle=xe.bgHeader,e.fill()),xe!==d&&(e.font=xe.baseFontFull);const re=c.columns.hasIndex(_.sourceIndex),J=l!==void 0||u,ee=!J&&C===-1&&M===_.sourceIndex,ie=J?0:((k=h.find($=>$.item[0]===_.sourceIndex&&$.item[1]===-1))==null?void 0:k.hoverAmount)??0,ge=(c==null?void 0:c.current)!==void 0&&c.current.cell[0]===_.sourceIndex,fe=re?xe.accentColor:ge?xe.bgHeaderHasFocus:xe.bgHeader,G=n?s:0,P=_.sourceIndex===0?0:1;re?(e.fillStyle=fe,e.fillRect(O+P,G,_.width-P,a)):(ge||ie>0)&&(e.beginPath(),e.rect(O+P,G,_.width-P,a),ge&&(e.fillStyle=xe.bgHeaderHasFocus,e.fill()),ie>0&&(e.globalAlpha=ie,e.fillStyle=xe.bgHeaderHovered,e.fill(),e.globalAlpha=1)),id(e,O,G,_.width,a,_,re,xe,ee,ee?x:void 0,ee?R:void 0,ge,ie,f,w,y),e.restore()}),n&&jp(e,t,r,o,s,i,d,f,h,m,p,b)}function jp(e,t,n,i,r,o,a,s,l,u,c,d){const[h,m]=(o==null?void 0:o[0])??[];let p=0;Jc(t,n,i,r,(b,w,y,S,M,C)=>{if(d!==void 0&&!d.hasItemInRectangle({x:b[0],y:-2,width:b[1]-b[0]+1,height:1}))return;e.save(),e.beginPath(),e.rect(y,S,M,C),e.clip();const x=c(w),R=(x==null?void 0:x.overrideTheme)===void 0?a:Sr(a,x.overrideTheme),I=m===-2&&h!==void 0&&h>=b[0]&&h<=b[1],E=I?R.bgHeaderHovered:R.bgHeader;if(E!==a.bgHeader&&(e.fillStyle=E,e.fill()),e.fillStyle=R.textGroupHeader??R.textHeader,x!==void 0){let H=y;if(x.icon!==void 0&&(s.drawSprite(x.icon,"normal",e,H+8,(r-20)/2,20,R),H+=26),e.fillText(x.name,H+8,r/2+mr(e,a.headerFontFull)),x.actions!==void 0&&I){const z=nd({x:y,y:S,width:M,height:C},x.actions);e.beginPath();const L=z[0].x-10,_=y+M-L;e.rect(L,0,_,r);const O=e.createLinearGradient(L,0,L+_,0),ne=ei(E,0);O.addColorStop(0,ne),O.addColorStop(10/_,E),O.addColorStop(1,E),e.fillStyle=O,e.fill(),e.globalAlpha=.6;const[q,oe]=(o==null?void 0:o[1])??[-1,-1];for(let Se=0;Se<x.actions.length;Se++){const xe=x.actions[Se],re=z[Se],J=Qr(re,q+y,oe);J&&(e.globalAlpha=1),s.drawSprite(xe.icon,"normal",e,re.x+re.width/2-10,re.y+re.height/2-10,20,R),J&&(e.globalAlpha=.6)}e.globalAlpha=1}}y!==0&&u(b[0])&&(e.beginPath(),e.moveTo(y+.5,0),e.lineTo(y+.5,r),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()),e.restore(),p=y+M}),e.beginPath(),e.moveTo(p+.5,0),e.lineTo(p+.5,r),e.moveTo(0,r+.5),e.lineTo(n,r+.5),e.strokeStyle=a.borderColor,e.lineWidth=1,e.stroke()}const Yo=30;function qp(e,t,n,i,r){return{x:e+n-Yo,y:Math.max(t,t+i/2-Yo/2),width:Yo,height:Math.min(Yo,i)}}function nd(e,t){const n=[];let i=e.x+e.width-26*t.length;const r=e.y+e.height/2-13,o=26,a=26;for(let s=0;s<t.length;s++)n.push({x:i,y:r,width:a,height:o}),i+=26;return n}function Xi(e,t,n){return!n||e===void 0||(e.x=t-(e.x-t)-e.width),e}function rd(e,t,n,i,r,o,a,s){var w;const l=a.cellHorizontalPadding,u=a.headerIconSize,c=qp(n,i,r,o);let d=n+l;const f=t.icon===void 0?void 0:{x:d,y:i+(o-u)/2,width:u,height:u},h=f===void 0||t.overlayIcon===void 0?void 0:{x:f.x+9,y:f.y+6,width:18,height:18};f!==void 0&&(d+=Math.ceil(u*1.3));const m={x:d,y:i,width:r-d,height:o};let p;if(t.indicatorIcon!==void 0){const y=e===void 0?((w=Vc(t.title,a.headerFontFull))==null?void 0:w.width)??0:ii(t.title,e,a.headerFontFull).width;m.width=y,d+=y+l,p={x:d,y:i+(o-u)/2,width:u,height:u}}const b=n+r/2;return{menuBounds:Xi(c,b,s),iconBounds:Xi(f,b,s),iconOverlayBounds:Xi(h,b,s),textBounds:Xi(m,b,s),indicatorIconBounds:Xi(p,b,s)}}function au(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m,p){if(o.rowMarker!==void 0&&o.headerRowMarkerDisabled!==!0){const y=o.rowMarkerChecked;y!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=d);const S=o.headerRowMarkerTheme!==void 0?Sr(s,o.headerRowMarkerTheme):s;Zs(e,S,y,t,n,i,r,!1,void 0,void 0,18,"center",o.rowMarker),y!==!0&&o.headerRowMarkerAlwaysVisible!==!0&&(e.globalAlpha=1);return}const b=a?s.textHeaderSelected:s.textHeader,w=o.hasMenu===!0&&(l||h&&a)&&p.menuBounds!==void 0;if(o.icon!==void 0&&p.iconBounds!==void 0){let y=a?"selected":"normal";o.style==="highlight"&&(y=a?"selected":"special"),f.drawSprite(o.icon,y,e,p.iconBounds.x,p.iconBounds.y,p.iconBounds.width,s),o.overlayIcon!==void 0&&p.iconOverlayBounds!==void 0&&f.drawSprite(o.overlayIcon,a?"selected":"special",e,p.iconOverlayBounds.x,p.iconOverlayBounds.y,p.iconOverlayBounds.width,s)}if(w&&i>35){const S=m?35:i-35,M=m?35*.7:i-35*.7,C=S/i,x=M/i,R=e.createLinearGradient(t,0,t+i,0),I=ei(b,0);R.addColorStop(m?1:0,b),R.addColorStop(C,b),R.addColorStop(x,I),R.addColorStop(m?0:1,I),e.fillStyle=R}else e.fillStyle=b;if(m&&(e.textAlign="right"),p.textBounds!==void 0&&e.fillText(o.title,m?p.textBounds.x+p.textBounds.width:p.textBounds.x,n+r/2+mr(e,s.headerFontFull)),m&&(e.textAlign="left"),o.indicatorIcon!==void 0&&p.indicatorIconBounds!==void 0&&(!w||!lo(p.menuBounds.x,p.menuBounds.y,p.menuBounds.width,p.menuBounds.height,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,p.indicatorIconBounds.height))){let y=a?"selected":"normal";o.style==="highlight"&&(y=a?"selected":"special"),f.drawSprite(o.indicatorIcon,y,e,p.indicatorIconBounds.x,p.indicatorIconBounds.y,p.indicatorIconBounds.width,s)}if(w&&p.menuBounds!==void 0){const y=p.menuBounds,S=u!==void 0&&c!==void 0&&Qr(y,u+t,c+n);if(S||(e.globalAlpha=.7),o.menuIcon===void 0||o.menuIcon===sa.Triangle){e.beginPath();const M=y.x+y.width/2-5.5,C=y.y+y.height/2-3;_m(e,[{x:M,y:C},{x:M+11,y:C},{x:M+5.5,y:C+6}],1),e.fillStyle=b,e.fill()}else if(o.menuIcon===sa.Dots){e.beginPath();const M=y.x+y.width/2,C=y.y+y.height/2;Pm(e,M,C),e.fillStyle=b,e.fill()}else{const M=y.x+(y.width-s.headerIconSize)/2,C=y.y+(y.height-s.headerIconSize)/2;f.drawSprite(o.menuIcon,"normal",e,M,C,s.headerIconSize,s)}S||(e.globalAlpha=1)}}function id(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m,p){const b=Ys(o.title)==="rtl",w=rd(e,o,t,n,i,r,s,b);m!==void 0?m({ctx:e,theme:s,rect:{x:t,y:n,width:i,height:r},column:o,columnIndex:o.sourceIndex,isSelected:a,hoverAmount:f,isHovered:l,hasSelectedCell:d,spriteManager:h,menuBounds:(w==null?void 0:w.menuBounds)??{x:0,y:0,height:0,width:0}},()=>au(e,t,n,i,r,o,a,s,l,u,c,f,h,p,b,w)):au(e,t,n,i,r,o,a,s,l,u,c,f,h,p,b,w)}function Kp(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m,p,b,w,y){if(w!==void 0||t[t.length-1]!==n[t.length-1])return;const S=Zc(b);$r(t,l,a,s,o,(M,C,x,R,I)=>{if(M!==t[t.length-1])return;C+=M.width;const E=Math.max(C,R);E>i||(e.save(),e.beginPath(),e.rect(E,o+1,1e4,r-o-1),e.clip(),Da(I,x,r,u,c,m,p,S,(H,z,L,_)=>{if(!_&&b.length>0&&!b.some(Se=>lo(C,H,1e4,L,Se.x,Se.y,Se.width,Se.height)))return;const O=f.hasIndex(z),ne=h.hasIndex(z);e.beginPath();const q=d==null?void 0:d(z),oe=q===void 0?y:Sr(y,q);oe.bgCell!==y.bgCell&&(e.fillStyle=oe.bgCell,e.fillRect(C,H,1e4,L)),ne&&(e.fillStyle=oe.bgHeader,e.fillRect(C,H,1e4,L)),O&&(e.fillStyle=oe.accentLight,e.fillRect(C,H,1e4,L))}),e.restore())})}function Zp(e,t,n,i,r,o,a,s,l){let u=!1;for(const m of t)if(!m.sticky){u=a(m.sourceIndex);break}const c=l.horizontalBorderColor??l.borderColor,d=l.borderColor,f=u?Mi(t):0;let h;if(f!==0&&(h=tu(d,l.bgCell),e.beginPath(),e.moveTo(f+.5,0),e.lineTo(f+.5,i),e.strokeStyle=h,e.stroke()),r>0){const m=d===c&&h!==void 0?h:tu(c,l.bgCell),p=ri(o,r,s);e.beginPath(),e.moveTo(0,i-p+.5),e.lineTo(n,i-p+.5),e.strokeStyle=m,e.stroke()}}const od=(e,t,n)=>{let i=0,r=t,o=0,a=n;if(e!==void 0&&e.length>0){i=Number.MAX_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER;for(const s of e)i=Math.min(i,s.x-1),r=Math.max(r,s.x+s.width+1),o=Math.min(o,s.y-1),a=Math.max(a,s.y+s.height+1)}return{minX:i,maxX:r,minY:o,maxY:a}};function Jp(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m){var L;const p=m.bgCell,{minX:b,maxX:w,minY:y,maxY:S}=od(s,o,a),M=[],C=a-ri(h,f,u);let x=l,R=n,I=0;for(;x+r<C;){const _=x+r,O=u(R);if(_>=y&&_<=S-1){const ne=c==null?void 0:c(R),q=ne==null?void 0:ne.bgCell;q!==void 0&&q!==p&&R>=h-f&&M.push({x:b,y:_,w:w-b,h:O,color:q})}x+=O,R<h-f&&(I=x),R++}let E=0;const H=Math.min(C,S)-I;if(H>0)for(let _=0;_<t.length;_++){const O=t[_];if(O.width===0)continue;const ne=O.sticky?E:E+i,q=(L=O.themeOverride)==null?void 0:L.bgCell;q!==void 0&&q!==p&&ne>=b&&ne<=w&&d(_+1)&&M.push({x:ne,y:I,w:O.width,h:H,color:q}),E+=O.width}if(M.length===0)return;let z;e.beginPath();for(let _=M.length-1;_>=0;_--){const O=M[_];z===void 0?z=O.color:O.color!==z&&(e.fillStyle=z,e.fill(),e.beginPath(),z=O.color),e.rect(O.x,O.y,O.w,O.h)}z!==void 0&&(e.fillStyle=z,e.fill()),e.beginPath()}function su(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m,p,b,w=!1){if(l!==void 0){e.beginPath(),e.save(),e.rect(0,0,o,a);for(const L of l)e.rect(L.x+1,L.y+1,L.width-1,L.height-1);e.clip("evenodd")}const y=b.horizontalBorderColor??b.borderColor,S=b.borderColor,{minX:M,maxX:C,minY:x,maxY:R}=od(s,o,a),I=[];e.beginPath();let E=.5;for(let L=0;L<t.length;L++){const _=t[L];if(_.width===0)continue;E+=_.width;const O=_.sticky?E:E+i;O>=M&&O<=C&&h(L+1)&&I.push({x1:O,y1:Math.max(u,x),x2:O,y2:Math.min(a,R),color:S})}let H=a+.5;for(let L=p-m;L<p;L++){const _=d(L);H-=_,I.push({x1:M,y1:H,x2:C,y2:H,color:y})}if(w!==!0){let L=c+.5,_=n;const O=H;for(;L+r<O;){const ne=L+r;if(ne>=x&&ne<=R-1){const q=f==null?void 0:f(_);I.push({x1:M,y1:ne,x2:C,y2:ne,color:(q==null?void 0:q.horizontalBorderColor)??(q==null?void 0:q.borderColor)??y})}L+=d(_),_++}}const z=Wf(I,L=>L.color);for(const L of Object.keys(z)){e.strokeStyle=L;for(const _ of z[L])e.moveTo(_.x1,_.y1),e.lineTo(_.x2,_.y2);e.stroke(),e.beginPath()}l!==void 0&&e.restore()}function Qp(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m,p,b,w,y){const S=[];e.imageSmoothingEnabled=!1;const M=Math.min(r.cellYOffset,a),C=Math.max(r.cellYOffset,a);let x=0;if(typeof w=="number")x+=(C-M)*w;else for(let O=M;O<C;O++)x+=w(O);a>r.cellYOffset&&(x=-x),x+=l-r.translateY;const R=Math.min(r.cellXOffset,o),I=Math.max(r.cellXOffset,o);let E=0;for(let O=R;O<I;O++)E+=p[O].width;o>r.cellXOffset&&(E=-E),E+=s-r.translateX;const H=Mi(b);if(E!==0&&x!==0)return{regions:[]};const z=u>0?ri(f,u,w):0,L=c-H-Math.abs(E),_=d-h-z-Math.abs(x)-1;if(L>150&&_>150){const O={sx:0,sy:0,sw:c*m,sh:d*m,dx:0,dy:0,dw:c*m,dh:d*m};if(x>0?(O.sy=(h+1)*m,O.sh=_*m,O.dy=(x+h+1)*m,O.dh=_*m,S.push({x:0,y:h,width:c,height:x+1})):x<0&&(O.sy=(-x+h+1)*m,O.sh=_*m,O.dy=(h+1)*m,O.dh=_*m,S.push({x:0,y:d+x-z,width:c,height:-x+z})),E>0?(O.sx=H*m,O.sw=L*m,O.dx=(E+H)*m,O.dw=L*m,S.push({x:H-1,y:0,width:E+2,height:d})):E<0&&(O.sx=(H-E)*m,O.sw=L*m,O.dx=H*m,O.dw=L*m,S.push({x:c+E,y:0,width:-E,height:d})),e.setTransform(1,0,0,1,0,0),y){if(H>0&&E!==0&&x===0&&(i===void 0||(n==null?void 0:n[1])!==!1)){const ne=H*m,q=d*m;e.drawImage(t,0,0,ne,q,0,0,ne,q)}if(z>0&&E===0&&x!==0&&(i===void 0||(n==null?void 0:n[0])!==!1)){const ne=(d-z)*m,q=c*m,oe=z*m;e.drawImage(t,0,ne,q,oe,0,ne,q,oe)}}e.drawImage(t,O.sx,O.sy,O.sw,O.sh,O.dx,O.dy,O.dw,O.dh),e.scale(m,m)}return e.imageSmoothingEnabled=!0,{regions:S}}function e0(e,t,n,i,r,o,a,s,l,u){const c=[];return t!==e.cellXOffset||n!==e.cellYOffset||i!==e.translateX||r!==e.translateY||$r(l,n,i,r,s,(d,f,h,m)=>{if(d.sourceIndex===u){const p=Math.max(f,m)+1;return c.push({x:p,y:0,width:o-p,height:a}),!0}}),c}function t0(e,t){if(t===void 0||e.width!==t.width||e.height!==t.height||e.theme!==t.theme||e.headerHeight!==t.headerHeight||e.rowHeight!==t.rowHeight||e.rows!==t.rows||e.freezeColumns!==t.freezeColumns||e.getRowThemeOverride!==t.getRowThemeOverride||e.isFocused!==t.isFocused||e.isResizing!==t.isResizing||e.verticalBorder!==t.verticalBorder||e.getCellContent!==t.getCellContent||e.highlightRegions!==t.highlightRegions||e.selection!==t.selection||e.dragAndDropState!==t.dragAndDropState||e.prelightCells!==t.prelightCells||e.touchMode!==t.touchMode||e.maxScaleFactor!==t.maxScaleFactor)return!1;if(e.mappedColumns!==t.mappedColumns){if(e.mappedColumns.length>100||e.mappedColumns.length!==t.mappedColumns.length)return!1;let n;for(let i=0;i<e.mappedColumns.length;i++){const r=e.mappedColumns[i],o=t.mappedColumns[i];if(ki(r,o))continue;if(n!==void 0||r.width===o.width)return!1;const{width:a,...s}=r,{width:l,...u}=o;if(!ki(s,u))return!1;n=i}return n===void 0?!0:n}return!0}function lu(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m,p){const b=m==null?void 0:m.filter(R=>R.style!=="no-outline");if(b===void 0||b.length===0)return;const w=Mi(s),y=ri(h,f,d),S=[l,0,s.length,h-f],M=[w,0,t,n-y],C=b.map(R=>{const I=R.range,E=R.style??"dashed";return Up(I,S,t,n,M).map(H=>{const z=H.rect,L=Es(z.x,z.y,t,n,c,u+c,i,r,o,a,h,l,f,s,d),_=z.width===1&&z.height===1?L:Es(z.x+z.width-1,z.y+z.height-1,t,n,c,u+c,i,r,o,a,h,l,f,s,d);return z.x+z.width>=s.length&&(_.width-=1),z.y+z.height>=h&&(_.height-=1),{color:R.color,style:E,clip:H.clip,rect:Wp({x:L.x,y:L.y,width:_.x+_.width-L.x,height:_.y+_.height-L.y},t,n,8)}})}),x=()=>{e.lineWidth=1;let R=!1;for(const I of C)for(const E of I)if((E==null?void 0:E.rect)!==void 0&&lo(0,0,t,n,E.rect.x,E.rect.y,E.rect.width,E.rect.height)){const H=R,z=!Bp(E.clip,E.rect);z&&(e.save(),e.rect(E.clip.x,E.clip.y,E.clip.width,E.clip.height),e.clip()),E.style==="dashed"&&!R?(e.setLineDash([5,3]),R=!0):(E.style==="solid"||E.style==="solid-outline")&&R&&(e.setLineDash([]),R=!1),e.strokeStyle=E.style==="solid-outline"?Ln(Ln(E.color,p.borderColor),p.bgCell):ei(E.color,1),e.strokeRect(E.rect.x+.5,E.rect.y+.5,E.rect.width-1,E.rect.height-1),z&&(e.restore(),R=H)}R&&e.setLineDash([])};return x(),x}function uu(e,t,n,i,r){e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=2,e.strokeStyle=r,e.stroke(),e.globalAlpha=1}function ls(e,t,n,i,r,o,a,s,l,u,c,d,f,h,m,p,b){if(c.current===void 0)return;const w=c.current.range,y=c.current.cell,S=[w.x+w.width-1,w.y+w.height-1];if(y[1]>=b&&S[1]>=b||!a.some(O=>O.sourceIndex===y[0]||O.sourceIndex===S[0]))return;const[C,x]=c.current.cell,R=f(c.current.cell),I=R.span??[C,C],E=x>=b-h,H=h>0&&!E?ri(b,h,d)-1:0,z=S[1];let L;if($r(a,i,r,o,u,(O,ne,q,oe,Se)=>{if(O.sticky&&C>O.sourceIndex)return;const xe=O.sourceIndex<I[0],re=O.sourceIndex>I[1],J=O.sourceIndex===S[0];if(!(!J&&(xe||re)))return Da(Se,q,n,b,d,h,m,void 0,(ee,ie,ge)=>{if(ie!==x&&ie!==z)return;let fe=ne,G=O.width;if(R.span!==void 0){const k=Qc(R.span,ne,ee,O.width,ge,O,s),$=O.sticky?k[0]:k[1];$!==void 0&&(fe=$.x,G=$.width)}return ie===z&&J&&p&&(L=()=>{var k;oe>fe&&!O.sticky&&(e.beginPath(),e.rect(oe,0,t-oe,n),e.clip()),e.beginPath(),e.rect(fe+G-4,ee+ge-4,4,4),e.fillStyle=((k=O.themeOverride)==null?void 0:k.accentColor)??l.accentColor,e.fill()}),L!==void 0}),L!==void 0}),L===void 0)return;const _=()=>{e.save(),e.beginPath(),e.rect(0,u,t,n-u-H),e.clip(),L==null||L(),e.restore()};return _(),_}function n0(e,t,n,i,r,o,a,s,l){l===void 0||l.size===0||(e.beginPath(),Jc(t,n,o,i,(u,c,d,f,h,m)=>{l.hasItemInRectangle({x:u[0],y:-2,width:u[1]-u[0]+1,height:1})&&e.rect(d,f,h,m)}),$r(t,s,o,a,r,(u,c,d,f)=>{const h=Math.max(0,f-c),m=c+h+1,p=u.width-h-1;l.has([u.sourceIndex,-1])&&e.rect(m,i,p,r-i)}),e.clip())}function r0(e,t,n,i,r,o,a,s,l,u){let c=0;return $r(e,o,i,r,n,(d,f,h,m,p)=>(Da(p,h,t,a,s,l,u,void 0,(b,w,y,S)=>{S||(c=Math.max(w,c))}),!0)),c}function cu(e,t){var bn;const{canvasCtx:n,headerCanvasCtx:i,width:r,height:o,cellXOffset:a,cellYOffset:s,translateX:l,translateY:u,mappedColumns:c,enableGroups:d,freezeColumns:f,dragAndDropState:h,theme:m,drawFocus:p,headerHeight:b,groupHeaderHeight:w,disabledRows:y,rowHeight:S,verticalBorder:M,overrideCursor:C,isResizing:x,selection:R,fillHandle:I,freezeTrailingRows:E,rows:H,getCellContent:z,getGroupDetails:L,getRowThemeOverride:_,isFocused:O,drawHeaderCallback:ne,prelightCells:q,drawCellCallback:oe,highlightRegions:Se,resizeCol:xe,imageLoader:re,lastBlitData:J,hoverValues:ee,hyperWrapping:ie,hoverInfo:ge,spriteManager:fe,maxScaleFactor:G,hasAppendRow:P,touchMode:k,enqueue:$,renderStateProvider:le,getCellRenderer:Te,renderStrategy:Be,bufferACtx:ce,bufferBCtx:nt,damage:ke,minimumCellWidth:bt,resizeIndicator:Et}=e;if(r===0||o===0)return;const at=Be==="double-buffer",te=Math.min(G,Math.ceil(window.devicePixelRatio??1)),it=Be!=="direct"&&t0(e,t),me=n.canvas;(me.width!==r*te||me.height!==o*te)&&(me.width=r*te,me.height=o*te,me.style.width=r+"px",me.style.height=o+"px");const se=i.canvas,he=d?w+b:b,$e=he+1;(se.width!==r*te||se.height!==$e*te)&&(se.width=r*te,se.height=$e*te,se.style.width=r+"px",se.style.height=$e+"px");const Le=ce.canvas,Je=nt.canvas;at&&(Le.width!==r*te||Le.height!==o*te)&&(Le.width=r*te,Le.height=o*te,J.current!==void 0&&(J.current.aBufferScroll=void 0)),at&&(Je.width!==r*te||Je.height!==o*te)&&(Je.width=r*te,Je.height=o*te,J.current!==void 0&&(J.current.bBufferScroll=void 0));const de=J.current;if(it===!0&&a===(de==null?void 0:de.cellXOffset)&&s===(de==null?void 0:de.cellYOffset)&&l===(de==null?void 0:de.translateX)&&u===(de==null?void 0:de.translateY))return;let be=null;at&&(be=n);const Ge=i;let Ae;at?ke!==void 0?Ae=(de==null?void 0:de.lastBuffer)==="b"?nt:ce:Ae=(de==null?void 0:de.lastBuffer)==="b"?ce:nt:Ae=n;const tt=Ae.canvas,wt=at?tt===Le?Je:Le:me,gt=typeof S=="number"?()=>S:S;Ge.save(),Ae.save(),Ge.beginPath(),Ae.beginPath(),Ge.textBaseline="middle",Ae.textBaseline="middle",te!==1&&(Ge.scale(te,te),Ae.scale(te,te));const He=Rs(c,a,r,h,l);let _t=[];const Xt=p&&((bn=R.current)==null?void 0:bn.cell[1])===s&&u===0;let Ot=!1;if(Se!==void 0){for(const Oe of Se)if(Oe.style!=="no-outline"&&Oe.range.y===s&&u===0){Ot=!0;break}}const Ht=()=>{Gp(Ge,He,d,ge,r,l,b,w,h,x,R,m,fe,ee,M,L,ke,ne,k),su(Ge,He,s,l,u,r,o,void 0,void 0,w,he,gt,_,M,E,H,m,!0),Ge.beginPath(),Ge.moveTo(0,$e-.5),Ge.lineTo(r,$e-.5),Ge.strokeStyle=Ln(m.headerBottomBorderColor??m.horizontalBorderColor??m.borderColor,m.bgHeader),Ge.stroke(),Ot&&lu(Ge,r,o,a,s,l,u,c,f,b,w,S,E,H,Se,m),Xt&&ls(Ge,r,o,s,l,u,He,c,m,he,R,gt,z,E,P,I,H)};if(ke!==void 0){const Oe=He[He.length-1].sourceIndex+1,Vt=ke.hasItemInRegion([{x:a,y:-2,width:Oe,height:2},{x:a,y:s,width:Oe,height:300},{x:0,y:s,width:f,height:300},{x:0,y:-2,width:f,height:2},{x:a,y:H-E,width:Oe,height:E,when:E>0}]),dn=De=>{ou(De,He,c,o,he,l,u,s,H,gt,z,L,_,y,O,p,E,P,_t,ke,R,q,Se,re,fe,ee,ge,oe,ie,m,$,le,Te,C,bt);const lt=R.current;I&&p&&lt!==void 0&&ke.has(Hc(lt.range))&&ls(De,r,o,s,l,u,He,c,m,he,R,gt,z,E,P,I,H)};Vt&&(dn(Ae),be!==null&&(be.save(),be.scale(te,te),be.textBaseline="middle",dn(be),be.restore()),ke.hasHeader()&&(n0(Ge,He,r,w,he,l,u,s,ke),Ht())),Ae.restore(),Ge.restore();return}if((it!==!0||a!==(de==null?void 0:de.cellXOffset)||l!==(de==null?void 0:de.translateX)||Xt!==(de==null?void 0:de.mustDrawFocusOnHeader)||Ot!==(de==null?void 0:de.mustDrawHighlightRingsOnHeader))&&Ht(),it===!0){_n(wt!==void 0&&de!==void 0);const{regions:Oe}=Qp(Ae,wt,wt===Le?de.aBufferScroll:de.bBufferScroll,wt===Le?de.bBufferScroll:de.aBufferScroll,de,a,s,l,u,E,r,o,H,he,te,c,He,S,at);_t=Oe}else it!==!1&&(_n(de!==void 0),_t=e0(de,a,s,l,u,r,o,he,He,it));Zp(Ae,He,r,o,E,H,M,gt,m);const rn=lu(Ae,r,o,a,s,l,u,c,f,b,w,S,E,H,Se,m),zt=p?ls(Ae,r,o,s,l,u,He,c,m,he,R,gt,z,E,P,I,H):void 0;if(Ae.fillStyle=m.bgCell,_t.length>0){Ae.beginPath();for(const Oe of _t)Ae.rect(Oe.x,Oe.y,Oe.width,Oe.height);Ae.clip(),Ae.fill(),Ae.beginPath()}else Ae.fillRect(0,0,r,o);const gn=ou(Ae,He,c,o,he,l,u,s,H,gt,z,L,_,y,O,p,E,P,_t,ke,R,q,Se,re,fe,ee,ge,oe,ie,m,$,le,Te,C,bt);Kp(Ae,He,c,r,o,he,l,u,s,H,gt,_,R.rows,y,E,P,_t,ke,m),Jp(Ae,He,s,l,u,r,o,_t,he,gt,_,M,E,H,m),su(Ae,He,s,l,u,r,o,_t,gn,w,he,gt,_,M,E,H,m),rn==null||rn(),zt==null||zt(),x&&Et!=="none"&&$r(He,0,l,0,he,(Oe,Vt)=>Oe.sourceIndex===xe?(uu(Ge,Vt+Oe.width,0,he+1,Ln(m.resizeIndicatorColor??m.accentLight,m.bgHeader)),Et==="full"&&uu(Ae,Vt+Oe.width,he,o,Ln(m.resizeIndicatorColor??m.accentLight,m.bgCell)),!0):!1),be!==null&&(be.fillStyle=m.bgCell,be.fillRect(0,0,r,o),be.drawImage(Ae.canvas,0,0));const $t=r0(He,o,he,l,u,s,H,gt,E,P);re==null||re.setWindow({x:a,y:s,width:He.length,height:$t-s},f,Array.from({length:E},(Oe,Vt)=>H-1-Vt));const It=de!==void 0&&(a!==de.cellXOffset||l!==de.translateX),In=de!==void 0&&(s!==de.cellYOffset||u!==de.translateY);J.current={cellXOffset:a,cellYOffset:s,translateX:l,translateY:u,mustDrawFocusOnHeader:Xt,mustDrawHighlightRingsOnHeader:Ot,lastBuffer:at?tt===Le?"a":"b":void 0,aBufferScroll:tt===Le?[It,In]:de==null?void 0:de.aBufferScroll,bBufferScroll:tt===Je?[It,In]:de==null?void 0:de.bBufferScroll},Ae.restore(),Ge.restore()}const i0=80;function o0(e){const t=e-1;return t*t*t+1}class a0{constructor(t){dt(this,"callback");dt(this,"currentHoveredItem");dt(this,"leavingItems",[]);dt(this,"lastAnimationTime");dt(this,"addToLeavingItems",t=>{this.leavingItems.some(i=>no(i.item,t.item))||this.leavingItems.push(t)});dt(this,"removeFromLeavingItems",t=>{const n=this.leavingItems.find(i=>no(i.item,t));return this.leavingItems=this.leavingItems.filter(i=>i!==n),(n==null?void 0:n.hoverAmount)??0});dt(this,"cleanUpLeavingElements",()=>{this.leavingItems=this.leavingItems.filter(t=>t.hoverAmount>0)});dt(this,"shouldStep",()=>{const t=this.leavingItems.length>0,n=this.currentHoveredItem!==void 0&&this.currentHoveredItem.hoverAmount<1;return t||n});dt(this,"getAnimatingItems",()=>this.currentHoveredItem!==void 0?[...this.leavingItems,this.currentHoveredItem]:this.leavingItems.map(t=>({...t,hoverAmount:o0(t.hoverAmount)})));dt(this,"step",t=>{if(this.lastAnimationTime===void 0)this.lastAnimationTime=t;else{const i=(t-this.lastAnimationTime)/i0;for(const o of this.leavingItems)o.hoverAmount=Wn(o.hoverAmount-i,0,1);this.currentHoveredItem!==void 0&&(this.currentHoveredItem.hoverAmount=Wn(this.currentHoveredItem.hoverAmount+i,0,1));const r=this.getAnimatingItems();this.callback(r),this.cleanUpLeavingElements()}this.shouldStep()?(this.lastAnimationTime=t,window.requestAnimationFrame(this.step)):this.lastAnimationTime=void 0});dt(this,"setHovered",t=>{var n;if(!no((n=this.currentHoveredItem)==null?void 0:n.item,t)){if(this.currentHoveredItem!==void 0&&this.addToLeavingItems(this.currentHoveredItem),t!==void 0){const i=this.removeFromLeavingItems(t);this.currentHoveredItem={item:t,hoverAmount:i}}else this.currentHoveredItem=void 0;this.lastAnimationTime===void 0&&window.requestAnimationFrame(this.step)}});this.callback=t}}class s0{constructor(t){dt(this,"fn");dt(this,"val");this.fn=t}get value(){return this.val??(this.val=this.fn())}}function Js(e){return new s0(e)}const l0=Js(()=>window.navigator.userAgent.includes("Firefox")),ga=Js(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome")),ma=Js(()=>window.navigator.platform.toLowerCase().startsWith("mac"));function u0(e){const t=g.useRef([]),n=g.useRef(0),i=g.useRef(e);i.current=e;const r=g.useCallback(()=>{const o=()=>window.requestAnimationFrame(a),a=()=>{const s=t.current.map(Ks);t.current=[],i.current(new io(s)),t.current.length>0?n.current++:n.current=0};window.requestAnimationFrame(n.current>600?o:a)},[]);return g.useCallback(o=>{t.current.length===0&&r();const a=rr(o[0],o[1]);t.current.includes(a)||t.current.push(a)},[r])}const Ar="header",Yn="group-header",pa="out-of-bounds";var Ci;(function(e){e[e.Start=-2]="Start",e[e.StartPadding=-1]="StartPadding",e[e.Center=0]="Center",e[e.EndPadding=1]="EndPadding",e[e.End=2]="End"})(Ci||(Ci={}));function ad(e,t){return e===t?!0:(e==null?void 0:e.kind)==="out-of-bounds"?(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])&&(e==null?void 0:e.region[0])===(t==null?void 0:t.region[0])&&(e==null?void 0:e.region[1])===(t==null?void 0:t.region[1]):(e==null?void 0:e.kind)===(t==null?void 0:t.kind)&&(e==null?void 0:e.location[0])===(t==null?void 0:t.location[0])&&(e==null?void 0:e.location[1])===(t==null?void 0:t.location[1])}const du=6,c0=(e,t)=>{if(e.kind===Z.Custom)return e.copyData;const n=t==null?void 0:t(e);return(n==null?void 0:n.getAccessibilityString(e))??""},d0=(e,t)=>{const{width:n,height:i,accessibilityHeight:r,columns:o,cellXOffset:a,cellYOffset:s,headerHeight:l,fillHandle:u=!1,groupHeaderHeight:c,rowHeight:d,rows:f,getCellContent:h,getRowThemeOverride:m,onHeaderMenuClick:p,onHeaderIndicatorClick:b,enableGroups:w,isFilling:y,onCanvasFocused:S,onCanvasBlur:M,isFocused:C,selection:x,freezeColumns:R,onContextMenu:I,freezeTrailingRows:E,fixedShadowX:H=!0,fixedShadowY:z=!0,drawFocusRing:L,onMouseDown:_,onMouseUp:O,onMouseMoveRaw:ne,onMouseMove:q,onItemHovered:oe,dragAndDropState:Se,firstColAccessible:xe,onKeyDown:re,onKeyUp:J,highlightRegions:ee,canvasRef:ie,onDragStart:ge,onDragEnd:fe,eventTargetRef:G,isResizing:P,resizeColumn:k,isDragging:$,isDraggable:le=!1,allowResize:Te,disabledRows:Be,hasAppendRow:ce,getGroupDetails:nt,theme:ke,prelightCells:bt,headerIcons:Et,verticalBorder:at,drawCell:te,drawHeader:it,onCellFocused:me,onDragOverCell:se,onDrop:he,onDragLeave:$e,imageWindowLoader:Le,smoothScrollX:Je=!1,smoothScrollY:de=!1,experimental:be,getCellRenderer:Ge,resizeIndicator:Ae="full"}=e,tt=e.translateX??0,wt=e.translateY??0,gt=Math.max(R,Math.min(o.length-1,a)),He=g.useRef(null),_t=g.useRef(window),Xt=_t.current,Ot=Le,Ht=g.useRef(),[rn,zt]=g.useState(!1),gn=g.useRef([]),$t=g.useRef(),[It,In]=g.useState(),[bn,Oe]=g.useState(),Vt=g.useRef(null),[dn,De]=g.useState(),[lt,ze]=g.useState(!1),Lt=g.useRef(lt);Lt.current=lt;const vt=g.useMemo(()=>new Vp(Et,()=>{wn.current=void 0,Hn.current()}),[Et]),on=w?c+l:l,Tt=g.useRef(-1),Ft=((be==null?void 0:be.enableFirefoxRescaling)??!1)&&l0.value,Ve=((be==null?void 0:be.enableSafariRescaling)??!1)&&ga.value;g.useLayoutEffect(()=>{window.devicePixelRatio===1||!Ft&&!Ve||(Tt.current!==-1&&zt(!0),window.clearTimeout(Tt.current),Tt.current=window.setTimeout(()=>{zt(!1),Tt.current=-1},200))},[s,gt,tt,wt,Ft,Ve]);const Pt=ym(o,R),Gt=H?Mi(Pt,Se):0,jt=g.useCallback((F,Q,we)=>{const ye=F.getBoundingClientRect();if(Q>=Pt.length||we>=f)return;const ue=ye.width/n,Me=Es(Q,we,n,i,c,on,gt,s,tt,wt,f,R,E,Pt,d);return ue!==1&&(Me.x*=ue,Me.y*=ue,Me.width*=ue,Me.height*=ue),Me.x+=ye.x,Me.y+=ye.y,Me},[n,i,c,on,gt,s,tt,wt,f,R,E,Pt,d]),Kt=g.useCallback((F,Q,we,ye)=>{const ue=F.getBoundingClientRect(),Me=ue.width/n,ot=(Q-ue.left)/Me,st=(we-ue.top)/Me,Ee=5,kt=Rs(Pt,gt,n,void 0,tt);let Ce=0,qe=0;ye instanceof MouseEvent&&(Ce=ye.button,qe=ye.buttons);const We=km(ot,kt,tt),ft=Mm(st,i,w,l,c,f,d,s,wt,E),ln=(ye==null?void 0:ye.shiftKey)===!0,Mn=(ye==null?void 0:ye.ctrlKey)===!0,St=(ye==null?void 0:ye.metaKey)===!0,Jt=ye!==void 0&&!(ye instanceof MouseEvent)||(ye==null?void 0:ye.pointerType)==="touch",Kn=[ot<0?-1:n<ot?1:0,st<on?-1:i<st?1:0];let yn;if(We===-1||st<0||ot<0||ft===void 0||ot>n||st>i){const Dt=ot>n?1:ot<0?-1:0,Rn=st>i?1:st<0?-1:0;let On=Dt*2,xt=Rn*2;Dt===0&&(On=We===-1?Ci.EndPadding:Ci.Center),Rn===0&&(xt=ft===void 0?Ci.EndPadding:Ci.Center);let tn=!1;if(We===-1&&ft===-1){const Tr=jt(F,Pt.length-1,-1);_n(Tr!==void 0),tn=Q<Tr.x+Tr.width+Ee}const Ir=ot>n&&ot<n+ks()||st>i&&st<i+ks();yn={kind:pa,location:[We!==-1?We:ot<0?0:Pt.length-1,ft??f-1],region:[On,xt],shiftKey:ln,ctrlKey:Mn,metaKey:St,isEdge:tn,isTouch:Jt,button:Ce,buttons:qe,scrollEdge:Kn,isMaybeScrollbar:Ir}}else if(ft<=-1){let Dt=jt(F,We,ft);_n(Dt!==void 0);let Rn=Dt!==void 0&&Dt.x+Dt.width-Q<=Ee;const On=We-1;Q-Dt.x<=Ee&&On>=0?(Rn=!0,Dt=jt(F,On,ft),_n(Dt!==void 0),yn={kind:w&&ft===-2?Yn:Ar,location:[On,ft],bounds:Dt,group:Pt[On].group??"",isEdge:Rn,shiftKey:ln,ctrlKey:Mn,metaKey:St,isTouch:Jt,localEventX:Q-Dt.x,localEventY:we-Dt.y,button:Ce,buttons:qe,scrollEdge:Kn}):yn={kind:w&&ft===-2?Yn:Ar,group:Pt[We].group??"",location:[We,ft],bounds:Dt,isEdge:Rn,shiftKey:ln,ctrlKey:Mn,metaKey:St,isTouch:Jt,localEventX:Q-Dt.x,localEventY:we-Dt.y,button:Ce,buttons:qe,scrollEdge:Kn}}else{const Dt=jt(F,We,ft);_n(Dt!==void 0);const Rn=Dt!==void 0&&Dt.x+Dt.width-Q<Ee;let On=!1;if(u&&x.current!==void 0){const xt=Hc(x.current.range),tn=jt(F,xt[0],xt[1]);if(tn!==void 0){const Ir=tn.x+tn.width-2,Tr=tn.y+tn.height-2;On=Math.abs(Ir-Q)<du&&Math.abs(Tr-we)<du}}yn={kind:"cell",location:[We,ft],bounds:Dt,isEdge:Rn,shiftKey:ln,ctrlKey:Mn,isFillHandle:On,metaKey:St,isTouch:Jt,localEventX:Q-Dt.x,localEventY:we-Dt.y,button:Ce,buttons:qe,scrollEdge:Kn}}return yn},[n,Pt,gt,tt,i,w,l,c,f,d,s,wt,E,jt,u,x,on]),[An]=It??[],Vr=g.useRef(()=>{}),ir=g.useRef(It);ir.current=It;const[A,rt]=g.useMemo(()=>{const F=document.createElement("canvas"),Q=document.createElement("canvas");return F.style.display="none",F.style.opacity="0",F.style.position="fixed",Q.style.display="none",Q.style.opacity="0",Q.style.position="fixed",[F.getContext("2d",{alpha:!1}),Q.getContext("2d",{alpha:!1})]},[]);g.useLayoutEffect(()=>{if(!(A===null||rt===null))return document.documentElement.append(A.canvas),document.documentElement.append(rt.canvas),()=>{A.canvas.remove(),rt.canvas.remove()}},[A,rt]);const Qe=g.useMemo(()=>new Lm,[]),Wt=Ft&&rn?1:Ve&&rn?2:5,Tn=(be==null?void 0:be.disableMinimumCellWidth)===!0?1:10,wn=g.useRef(),Gn=g.useRef(null),Dn=g.useRef(null),Qt=g.useCallback(()=>{var ot;const F=He.current,Q=Vt.current;if(F===null||Q===null||(Gn.current===null&&(Gn.current=F.getContext("2d",{alpha:!1}),F.width=0,F.height=0),Dn.current===null&&(Dn.current=Q.getContext("2d",{alpha:!1}),Q.width=0,Q.height=0),Gn.current===null||Dn.current===null||A===null||rt===null))return;let we=!1;const ye=st=>{we=!0,De(st)},ue=wn.current,Me={headerCanvasCtx:Dn.current,canvasCtx:Gn.current,bufferACtx:A,bufferBCtx:rt,width:n,height:i,cellXOffset:gt,cellYOffset:s,translateX:Math.round(tt),translateY:Math.round(wt),mappedColumns:Pt,enableGroups:w,freezeColumns:R,dragAndDropState:Se,theme:ke,headerHeight:l,groupHeaderHeight:c,disabledRows:Be??yt.empty(),rowHeight:d,verticalBorder:at,isResizing:P,resizeCol:k,isFocused:C,selection:x,fillHandle:u,drawCellCallback:te,hasAppendRow:ce,overrideCursor:ye,maxScaleFactor:Wt,freezeTrailingRows:E,rows:f,drawFocus:L,getCellContent:h,getGroupDetails:nt??(st=>({name:st})),getRowThemeOverride:m,drawHeaderCallback:it,prelightCells:bt,highlightRegions:ee,imageLoader:Ot,lastBlitData:$t,damage:Ht.current,hoverValues:gn.current,hoverInfo:ir.current,spriteManager:vt,scrolling:rn,hyperWrapping:(be==null?void 0:be.hyperWrapping)??!1,touchMode:lt,enqueue:Vr.current,renderStateProvider:Qe,renderStrategy:(be==null?void 0:be.renderStrategy)??(ga.value?"double-buffer":"single-buffer"),getCellRenderer:Ge,minimumCellWidth:Tn,resizeIndicator:Ae};Me.damage===void 0?(wn.current=Me,cu(Me,ue)):cu(Me,void 0),!we&&(Me.damage===void 0||Me.damage.has((ot=ir==null?void 0:ir.current)==null?void 0:ot[0]))&&De(void 0)},[A,rt,n,i,gt,s,tt,wt,Pt,w,R,Se,ke,l,c,Be,d,at,P,ce,k,C,x,u,E,f,L,Wt,h,nt,m,te,it,bt,ee,Ot,vt,rn,be==null?void 0:be.hyperWrapping,be==null?void 0:be.renderStrategy,lt,Qe,Ge,Tn,Ae]),Hn=g.useRef(Qt);g.useLayoutEffect(()=>{Qt(),Hn.current=Qt},[Qt]),g.useLayoutEffect(()=>{(async()=>{var Q;((Q=document==null?void 0:document.fonts)==null?void 0:Q.ready)!==void 0&&(await document.fonts.ready,wn.current=void 0,Hn.current())})()},[]);const jn=g.useCallback(F=>{Ht.current=F,Hn.current(),Ht.current=void 0},[]),La=u0(jn);Vr.current=La;const bo=g.useCallback(F=>{jn(new io(F.map(Q=>Q.cell)))},[jn]);Ot.setCallback(jn);const[wo,Fa]=g.useState(!1),[oi,Mr]=An??[],Ii=oi!==void 0&&Mr===-1,Aa=oi!==void 0&&Mr===-2;let Ti=!1,Di=!1,Nr=dn;if(Nr===void 0&&oi!==void 0&&Mr!==void 0&&Mr>-1&&Mr<f){const F=h([oi,Mr],!0);Ti=F.kind===Xn.NewRow||F.kind===Xn.Marker&&F.markerKind!=="number",Di=F.kind===Z.Boolean&&Vs(F),Nr=F.cursor}const kn=$?"grabbing":(bn??!1)||P?"col-resize":wo||y?"crosshair":Nr!==void 0?Nr:Ii||Ti||Di||Aa?"pointer":"default",Oi=g.useMemo(()=>({contain:"strict",display:"block",cursor:kn}),[kn]),Pi=g.useRef("default"),ai=G==null?void 0:G.current;ai!=null&&Pi.current!==Oi.cursor&&(ai.style.cursor=Pi.current=Oi.cursor);const pr=g.useCallback((F,Q,we,ye)=>{if(nt===void 0)return;const ue=nt(F);if(ue.actions!==void 0){const Me=nd(Q,ue.actions);for(const[ot,st]of Me.entries())if(Qr(st,we+Q.x,ye+st.y))return ue.actions[ot]}},[nt]),vr=g.useCallback((F,Q,we,ye)=>{const ue=Pt[Q];if(!$&&!P&&!(bn??!1)){const Me=jt(F,Q,-1);_n(Me!==void 0);const ot=rd(void 0,ue,Me.x,Me.y,Me.width,Me.height,ke,Ys(ue.title)==="rtl");if(ue.hasMenu===!0&&ot.menuBounds!==void 0&&Qr(ot.menuBounds,we,ye))return{area:"menu",bounds:ot.menuBounds};if(ue.indicatorIcon!==void 0&&ot.indicatorIconBounds!==void 0&&Qr(ot.indicatorIconBounds,we,ye))return{area:"indicator",bounds:ot.indicatorIconBounds}}},[Pt,jt,bn,$,P,ke]),si=g.useRef(0),or=g.useRef(),ar=g.useRef(!1),Br=g.useCallback(F=>{const Q=He.current,we=G==null?void 0:G.current;if(Q===null||F.target!==Q&&F.target!==we)return;ar.current=!0;let ye,ue;if(F instanceof MouseEvent?(ye=F.clientX,ue=F.clientY):(ye=F.touches[0].clientX,ue=F.touches[0].clientY),F.target===we&&we!==null){const ot=we.getBoundingClientRect();if(ye>ot.right||ue>ot.bottom)return}const Me=Kt(Q,ye,ue,F);or.current=Me.location,Me.isTouch&&(si.current=Date.now()),Lt.current!==Me.isTouch&&ze(Me.isTouch),!(Me.kind===Ar&&vr(Q,Me.location[0],ye,ue)!==void 0)&&(Me.kind===Yn&&pr(Me.group,Me.bounds,Me.localEventX,Me.localEventY)!==void 0||(_==null||_(Me),!Me.isTouch&&le!==!0&&le!==Me.kind&&Me.button<3&&Me.button!==1&&F.preventDefault()))},[G,le,Kt,pr,vr,_]);fn("touchstart",Br,Xt,!1),fn("mousedown",Br,Xt,!1);const yo=g.useRef(0),_i=g.useCallback(F=>{var qe,We;const Q=yo.current;yo.current=Date.now();const we=He.current;if(ar.current=!1,O===void 0||we===null)return;const ye=G==null?void 0:G.current,ue=F.target!==we&&F.target!==ye;let Me,ot,st=!0;if(F instanceof MouseEvent){if(Me=F.clientX,ot=F.clientY,st=F.button<3,F.pointerType==="touch")return}else Me=F.changedTouches[0].clientX,ot=F.changedTouches[0].clientY;let Ee=Kt(we,Me,ot,F);Ee.isTouch&&si.current!==0&&Date.now()-si.current>500&&(Ee={...Ee,isLongTouch:!0}),Q!==0&&Date.now()-Q<(Ee.isTouch?1e3:500)&&(Ee={...Ee,isDoubleClick:!0}),Lt.current!==Ee.isTouch&&ze(Ee.isTouch),!ue&&F.cancelable&&st&&F.preventDefault();const[kt]=Ee.location,Ce=vr(we,kt,Me,ot);if(Ee.kind===Ar&&Ce!==void 0){(Ee.button!==0||((qe=or.current)==null?void 0:qe[0])!==kt||((We=or.current)==null?void 0:We[1])!==-1)&&O(Ee,!0);return}else if(Ee.kind===Yn){const ft=pr(Ee.group,Ee.bounds,Ee.localEventX,Ee.localEventY);if(ft!==void 0){Ee.button===0&&ft.onClick(Ee);return}}O(Ee,ue)},[O,G,Kt,vr,pr]);fn("mouseup",_i,Xt,!1),fn("touchend",_i,Xt,!1);const je=g.useCallback(F=>{var kt,Ce;const Q=He.current;if(Q===null)return;const we=G==null?void 0:G.current,ye=F.target!==Q&&F.target!==we;let ue,Me,ot=!0;F instanceof MouseEvent?(ue=F.clientX,Me=F.clientY,ot=F.button<3):(ue=F.changedTouches[0].clientX,Me=F.changedTouches[0].clientY);const st=Kt(Q,ue,Me,F);Lt.current!==st.isTouch&&ze(st.isTouch),!ye&&F.cancelable&&ot&&F.preventDefault();const[Ee]=st.location;if(st.kind===Ar){const qe=vr(Q,Ee,ue,Me);qe!==void 0&&st.button===0&&((kt=or.current)==null?void 0:kt[0])===Ee&&((Ce=or.current)==null?void 0:Ce[1])===-1&&(qe.area==="menu"?p==null||p(Ee,qe.bounds):qe.area==="indicator"&&(b==null||b(Ee,qe.bounds)))}else if(st.kind===Yn){const qe=pr(st.group,st.bounds,st.localEventX,st.localEventY);qe!==void 0&&st.button===0&&qe.onClick(st)}},[G,Kt,vr,p,b,pr]);fn("click",je,Xt,!1);const Co=g.useCallback(F=>{const Q=He.current,we=G==null?void 0:G.current;if(Q===null||F.target!==Q&&F.target!==we||I===void 0)return;const ye=Kt(Q,F.clientX,F.clientY,F);I(ye,()=>{F.cancelable&&F.preventDefault()})},[G,Kt,I]);fn("contextmenu",Co,(G==null?void 0:G.current)??null,!1);const So=g.useCallback(F=>{Ht.current=new io(F.map(Q=>Q.item)),gn.current=F,Hn.current(),Ht.current=void 0},[]),zn=g.useMemo(()=>new a0(So),[So]),xo=g.useRef(zn);xo.current=zn,g.useLayoutEffect(()=>{const F=xo.current;if(An===void 0||An[1]<0){F.setHovered(An);return}const Q=h(An,!0),we=Ge(Q),ye=we===void 0&&Q.kind===Z.Custom||(we==null?void 0:we.needsHover)!==void 0&&(typeof we.needsHover=="boolean"?we.needsHover:we.needsHover(Q));F.setHovered(ye?An:void 0)},[h,Ge,An]);const qn=g.useRef(),Li=g.useCallback(F=>{var st;const Q=He.current;if(Q===null)return;const we=G==null?void 0:G.current,ye=F.target!==Q&&F.target!==we,ue=Kt(Q,F.clientX,F.clientY,F);if(ue.kind!=="out-of-bounds"&&ye&&!ar.current&&!ue.isTouch)return;const Me=(Ee,kt)=>{In(Ce=>Ce===Ee||(Ce==null?void 0:Ce[0][0])===(Ee==null?void 0:Ee[0][0])&&(Ce==null?void 0:Ce[0][1])===(Ee==null?void 0:Ee[0][1])&&((Ce==null?void 0:Ce[1][0])===(Ee==null?void 0:Ee[1][0])&&(Ce==null?void 0:Ce[1][1])===(Ee==null?void 0:Ee[1][1])||!kt)?Ce:Ee)};if(!ad(ue,qn.current))De(void 0),oe==null||oe(ue),Me(ue.kind===pa?void 0:[ue.location,[ue.localEventX,ue.localEventY]],!0),qn.current=ue;else if(ue.kind==="cell"||ue.kind===Ar||ue.kind===Yn){let Ee=!1,kt=!0;if(ue.kind==="cell"){const qe=h(ue.location);kt=((st=Ge(qe))==null?void 0:st.needsHoverPosition)??qe.kind===Z.Custom,Ee=kt}else Ee=!0;const Ce=[ue.location,[ue.localEventX,ue.localEventY]];Me(Ce,kt),ir.current=Ce,Ee&&jn(new io([ue.location]))}const ot=ue.location[0]>=(xe?0:1);Oe(ue.kind===Ar&&ue.isEdge&&ot&&Te===!0),Fa(ue.kind==="cell"&&ue.isFillHandle),ne==null||ne(F),q(ue)},[G,Kt,xe,Te,ne,q,oe,h,Ge,jn]);fn("mousemove",Li,Xt,!0);const ko=g.useCallback(F=>{const Q=He.current;if(Q===null)return;let we,ye;x.current!==void 0&&(we=jt(Q,x.current.cell[0],x.current.cell[1]),ye=x.current.cell),re==null||re({bounds:we,stopPropagation:()=>F.stopPropagation(),preventDefault:()=>F.preventDefault(),cancel:()=>{},ctrlKey:F.ctrlKey,metaKey:F.metaKey,shiftKey:F.shiftKey,altKey:F.altKey,key:F.key,keyCode:F.keyCode,rawEvent:F,location:ye})},[re,x,jt]),Mo=g.useCallback(F=>{const Q=He.current;if(Q===null)return;let we,ye;x.current!==void 0&&(we=jt(Q,x.current.cell[0],x.current.cell[1]),ye=x.current.cell),J==null||J({bounds:we,stopPropagation:()=>F.stopPropagation(),preventDefault:()=>F.preventDefault(),cancel:()=>{},ctrlKey:F.ctrlKey,metaKey:F.metaKey,shiftKey:F.shiftKey,altKey:F.altKey,key:F.key,keyCode:F.keyCode,rawEvent:F,location:ye})},[J,x,jt]),Ha=g.useCallback(F=>{if(He.current=F,ie!==void 0&&(ie.current=F),F===null)_t.current=window;else{const Q=F.getRootNode();Q===document&&(_t.current=window),_t.current=Q}},[ie]),za=g.useCallback(F=>{const Q=He.current;if(Q===null||le===!1||P){F.preventDefault();return}let we,ye;const ue=Kt(Q,F.clientX,F.clientY);if(le!==!0&&ue.kind!==le){F.preventDefault();return}const Me=(qe,We)=>{we=qe,ye=We};let ot,st,Ee;const kt=(qe,We,ft)=>{ot=qe,st=We,Ee=ft};let Ce=!1;if(ge==null||ge({...ue,setData:Me,setDragImage:kt,preventDefault:()=>Ce=!0,defaultPrevented:()=>Ce}),!Ce&&we!==void 0&&ye!==void 0&&F.dataTransfer!==null)if(F.dataTransfer.setData(we,ye),F.dataTransfer.effectAllowed="copyLink",ot!==void 0&&st!==void 0&&Ee!==void 0)F.dataTransfer.setDragImage(ot,st,Ee);else{const[qe,We]=ue.location;if(We!==void 0){const ft=document.createElement("canvas"),ln=jt(Q,qe,We);_n(ln!==void 0);const Mn=Math.ceil(window.devicePixelRatio??1);ft.width=ln.width*Mn,ft.height=ln.height*Mn;const St=ft.getContext("2d");St!==null&&(St.scale(Mn,Mn),St.textBaseline="middle",We===-1?(St.font=ke.headerFontFull,St.fillStyle=ke.bgHeader,St.fillRect(0,0,ft.width,ft.height),id(St,0,0,ln.width,ln.height,Pt[qe],!1,ke,!1,void 0,void 0,!1,0,vt,it,!1)):(St.font=ke.baseFontFull,St.fillStyle=ke.bgCell,St.fillRect(0,0,ft.width,ft.height),td(St,h([qe,We]),0,We,!1,!1,0,0,ln.width,ln.height,!1,ke,ke.bgCell,Ot,vt,1,void 0,!1,0,void 0,void 0,void 0,Qe,Ge,()=>{}))),ft.style.left="-100%",ft.style.position="absolute",ft.style.width=`${ln.width}px`,ft.style.height=`${ln.height}px`,document.body.append(ft),F.dataTransfer.setDragImage(ft,ln.width/2,ln.height/2),window.setTimeout(()=>{ft.remove()},0)}}else F.preventDefault()},[le,P,Kt,ge,jt,ke,Pt,vt,it,h,Ot,Qe,Ge]);fn("dragstart",za,(G==null?void 0:G.current)??null,!1,!1);const $n=g.useRef(),Rr=g.useCallback(F=>{const Q=He.current;if(he!==void 0&&F.preventDefault(),Q===null||se===void 0)return;const we=Kt(Q,F.clientX,F.clientY),[ye,ue]=we.location,Me=ye-(xe?0:1),[ot,st]=$n.current??[];(ot!==Me||st!==ue)&&($n.current=[Me,ue],se([Me,ue],F.dataTransfer))},[xe,Kt,se,he]);fn("dragover",Rr,(G==null?void 0:G.current)??null,!1,!1);const Vn=g.useCallback(()=>{$n.current=void 0,fe==null||fe()},[fe]);fn("dragend",Vn,(G==null?void 0:G.current)??null,!1,!1);const B=g.useCallback(F=>{const Q=He.current;if(Q===null||he===void 0)return;F.preventDefault();const we=Kt(Q,F.clientX,F.clientY),[ye,ue]=we.location,Me=ye-(xe?0:1);he([Me,ue],F.dataTransfer)},[xe,Kt,he]);fn("drop",B,(G==null?void 0:G.current)??null,!1,!1);const Zt=g.useCallback(()=>{$e==null||$e()},[$e]);fn("dragleave",Zt,(G==null?void 0:G.current)??null,!1,!1);const Er=g.useRef(x);Er.current=x;const li=g.useRef(null),ui=g.useCallback(F=>{var Q;He.current===null||!He.current.contains(document.activeElement)||(F===null&&Er.current.current!==void 0?(Q=ie==null?void 0:ie.current)==null||Q.focus({preventScroll:!0}):F!==null&&F.focus({preventScroll:!0}),li.current=F)},[ie]);g.useImperativeHandle(t,()=>({focus:()=>{var Q;const F=li.current;F===null||!document.contains(F)?(Q=ie==null?void 0:ie.current)==null||Q.focus({preventScroll:!0}):F.focus({preventScroll:!0})},getBounds:(F,Q)=>{if(!(ie===void 0||ie.current===null))return jt(ie.current,F??0,Q??-1)},damage:bo}),[ie,bo,jt]);const Fi=g.useRef(),$a=$g(()=>{var st,Ee,kt;if(n<50||(be==null?void 0:be.disableAccessibilityTree)===!0)return null;let F=Rs(Pt,gt,n,Se,tt);const Q=xe?0:-1;!xe&&((st=F[0])==null?void 0:st.sourceIndex)===0&&(F=F.slice(1));const[we,ye]=((Ee=x.current)==null?void 0:Ee.cell)??[],ue=(kt=x.current)==null?void 0:kt.range,Me=F.map(Ce=>Ce.sourceIndex),ot=cr(s,Math.min(f,s+r));return we!==void 0&&ye!==void 0&&!(Me.includes(we)&&ot.includes(ye))&&ui(null),g.createElement("table",{key:"access-tree",role:"grid","aria-rowcount":f+1,"aria-multiselectable":"true","aria-colcount":Pt.length+Q},g.createElement("thead",{role:"rowgroup"},g.createElement("tr",{role:"row","aria-rowindex":1},F.map(Ce=>g.createElement("th",{role:"columnheader","aria-selected":x.columns.hasIndex(Ce.sourceIndex),"aria-colindex":Ce.sourceIndex+1+Q,tabIndex:-1,onFocus:qe=>{if(qe.target!==li.current)return me==null?void 0:me([Ce.sourceIndex,-1])},key:Ce.sourceIndex},Ce.title)))),g.createElement("tbody",{role:"rowgroup"},ot.map(Ce=>g.createElement("tr",{role:"row","aria-selected":x.rows.hasIndex(Ce),key:Ce,"aria-rowindex":Ce+2},F.map(qe=>{const We=qe.sourceIndex,ft=rr(We,Ce),ln=we===We&&ye===Ce,Mn=ue!==void 0&&We>=ue.x&&We<ue.x+ue.width&&Ce>=ue.y&&Ce<ue.y+ue.height,St=`glide-cell-${We}-${Ce}`,Jt=[We,Ce],Kn=h(Jt,!0);return g.createElement("td",{key:ft,role:"gridcell","aria-colindex":We+1+Q,"aria-selected":Mn,"aria-readonly":wi(Kn)||!Ki(Kn),id:St,"data-testid":St,onClick:()=>{const yn=ie==null?void 0:ie.current;if(yn!=null)return re==null?void 0:re({bounds:jt(yn,We,Ce),cancel:()=>{},preventDefault:()=>{},stopPropagation:()=>{},ctrlKey:!1,key:"Enter",keyCode:13,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:Jt})},onFocusCapture:yn=>{var Dt,Rn;if(!(yn.target===li.current||((Dt=Fi.current)==null?void 0:Dt[0])===We&&((Rn=Fi.current)==null?void 0:Rn[1])===Ce))return Fi.current=Jt,me==null?void 0:me(Jt)},ref:ln?ui:void 0,tabIndex:-1},c0(Kn,Ge))})))))},[n,Pt,gt,Se,tt,f,s,r,x,ui,h,ie,re,jt,me],200),Ai=R===0||!H?0:gt>R?1:Wn(-tt/100,0,1),U=-s*32+wt,un=z?Wn(-U/100,0,1):0,cn=g.useMemo(()=>{if(!Ai&&!un)return null;const F={position:"absolute",top:0,left:Gt,width:n-Gt,height:i,opacity:Ai,pointerEvents:"none",transition:Je?void 0:"opacity 0.2s",boxShadow:"inset 13px 0 10px -13px rgba(0, 0, 0, 0.2)"},Q={position:"absolute",top:on,left:0,width:n,height:i,opacity:un,pointerEvents:"none",transition:de?void 0:"opacity 0.2s",boxShadow:"inset 0 13px 10px -13px rgba(0, 0, 0, 0.2)"};return g.createElement(g.Fragment,null,Ai>0&&g.createElement("div",{id:"shadow-x",style:F}),un>0&&g.createElement("div",{id:"shadow-y",style:Q}))},[Ai,un,Gt,n,Je,on,i,de]),Va=g.useMemo(()=>({position:"absolute",top:0,left:0}),[]);return g.createElement(g.Fragment,null,g.createElement("canvas",{"data-testid":"data-grid-canvas",tabIndex:0,onKeyDown:ko,onKeyUp:Mo,onFocus:S,onBlur:M,ref:Ha,style:Oi},$a),g.createElement("canvas",{ref:Vt,style:Va}),cn)},f0=g.memo(g.forwardRef(d0));function Gi(e,t,n,i){return Wn(Math.round(t-(e.growOffset??0)),Math.ceil(n),Math.floor(i))}const h0=e=>{const[t,n]=g.useState(),[i,r]=g.useState(),[o,a]=g.useState(),[s,l]=g.useState(),[u,c]=g.useState(!1),[d,f]=g.useState(),[h,m]=g.useState(),[p,b]=g.useState(),[w,y]=g.useState(!1),[S,M]=g.useState(),{onHeaderMenuClick:C,onHeaderIndicatorClick:x,getCellContent:R,onColumnMoved:I,onColumnResize:E,onColumnResizeStart:H,onColumnResizeEnd:z,gridRef:L,maxColumnWidth:_,minColumnWidth:O,onRowMoved:ne,lockColumns:q,onColumnProposeMove:oe,onMouseDown:Se,onMouseUp:xe,onItemHovered:re,onDragStart:J,canvasRef:ee}=e,ie=(E??z??H)!==void 0,{columns:ge,selection:fe}=e,G=fe.columns,P=g.useCallback(te=>{const[it,me]=te.location;o!==void 0&&s!==it&&it>=q?(c(!0),l(it)):h!==void 0&&me!==void 0?(y(!0),b(Math.max(0,me))):i===void 0&&!u&&!w&&(re==null||re(te))},[o,h,s,re,q,i,u,w]),k=I!==void 0,$=g.useCallback(te=>{var it;if(te.button===0){const[me,se]=te.location;if(te.kind==="out-of-bounds"&&te.isEdge&&ie){const he=(it=L==null?void 0:L.current)==null?void 0:it.getBounds(ge.length-1,-1);he!==void 0&&(n(he.x),r(ge.length-1))}else if(te.kind==="header"&&me>=q){const he=ee==null?void 0:ee.current;if(te.isEdge&&ie&&he){n(te.bounds.x),r(me);const Le=he.getBoundingClientRect().width/he.offsetWidth,Je=te.bounds.width/Le;H==null||H(ge[me],Je,me,Je+(ge[me].growOffset??0))}else te.kind==="header"&&k&&(f(te.bounds.x),a(me))}else te.kind==="cell"&&q>0&&me===0&&se!==void 0&&ne!==void 0&&(M(te.bounds.y),m(se))}Se==null||Se(te)},[Se,ie,q,ne,L,ge,k,H,ee]),le=g.useCallback((te,it)=>{u||w||C==null||C(te,it)},[u,w,C]),Te=g.useCallback((te,it)=>{u||w||x==null||x(te,it)},[u,w,x]),Be=g.useRef(-1),ce=g.useCallback(()=>{Be.current=-1,m(void 0),b(void 0),M(void 0),y(!1),a(void 0),l(void 0),f(void 0),c(!1),r(void 0),n(void 0)},[]),nt=g.useCallback((te,it)=>{if(te.button===0){if(i!==void 0){if((G==null?void 0:G.hasIndex(i))===!0)for(const se of G){if(se===i)continue;const he=ge[se],$e=Gi(he,Be.current,O,_);E==null||E(he,$e,se,$e+(he.growOffset??0))}const me=Gi(ge[i],Be.current,O,_);if(z==null||z(ge[i],me,i,me+(ge[i].growOffset??0)),G.hasIndex(i))for(const se of G){if(se===i)continue;const he=ge[se],$e=Gi(he,Be.current,O,_);z==null||z(he,$e,se,$e+(he.growOffset??0))}}ce(),o!==void 0&&s!==void 0&&(I==null||I(o,s)),h!==void 0&&p!==void 0&&(ne==null||ne(h,p))}xe==null||xe(te,it)},[xe,i,o,s,h,p,G,z,ge,O,_,E,I,ne,ce]),ke=g.useMemo(()=>{if(!(o===void 0||s===void 0)&&o!==s&&(oe==null?void 0:oe(o,s))!==!1)return{src:o,dest:s}},[o,s,oe]),bt=g.useCallback(te=>{const it=ee==null?void 0:ee.current;if(o!==void 0&&d!==void 0)Math.abs(te.clientX-d)>20&&c(!0);else if(h!==void 0&&S!==void 0)Math.abs(te.clientY-S)>20&&y(!0);else if(i!==void 0&&t!==void 0&&it){const se=it.getBoundingClientRect().width/it.offsetWidth,he=(te.clientX-t)/se,$e=ge[i],Le=Gi($e,he,O,_);if(E==null||E($e,Le,i,Le+($e.growOffset??0)),Be.current=he,(G==null?void 0:G.first())===i)for(const Je of G){if(Je===i)continue;const de=ge[Je],be=Gi(de,Be.current,O,_);E==null||E(de,be,Je,be+(de.growOffset??0))}}},[o,d,h,S,i,t,ge,O,_,E,G,ee]),Et=g.useCallback((te,it)=>{if(h===void 0||p===void 0)return R(te,it);let[me,se]=te;return se===p?se=h:(se>p&&(se-=1),se>=h&&(se+=1)),R([me,se],it)},[h,p,R]),at=g.useCallback(te=>{J==null||J(te),te.defaultPrevented()||ce()},[ce,J]);return g.createElement(f0,{accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,enableGroups:e.enableGroups,eventTargetRef:e.eventTargetRef,experimental:e.experimental,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,headerIcons:e.headerIcons,height:e.height,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,resizeColumn:i,isDraggable:e.isDraggable,isFilling:e.isFilling,isFocused:e.isFocused,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDrop:e.onDrop,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,resizeIndicator:e.resizeIndicator,verticalBorder:e.verticalBorder,width:e.width,getCellContent:Et,isResizing:i!==void 0,onHeaderMenuClick:le,onHeaderIndicatorClick:Te,isDragging:u,onItemHovered:P,onDragStart:at,onMouseDown:$,allowResize:ie,onMouseUp:nt,dragAndDropState:ke,onMouseMoveRaw:bt,ref:L})};function g0(e){const t=g.useRef(null),[n,i]=g.useState({width:e==null?void 0:e[0],height:e==null?void 0:e[1]});return g.useLayoutEffect(()=>{const r=a=>{for(const s of a){const{width:l,height:u}=s&&s.contentRect||{};i(c=>c.width===l&&c.height===u?c:{width:l,height:u})}},o=new window.ResizeObserver(r);return t.current&&o.observe(t.current,void 0),()=>{o.disconnect()}},[t.current]),{ref:t,...n}}const m0=(e,t,n)=>{const i=g.useRef(null),r=g.useRef(null),o=g.useRef(null),a=g.useRef(0),s=g.useRef(t);s.current=t;const l=n.current;g.useEffect(()=>{const u=()=>{var f,h;if(r.current===!1&&l!==null){const m=[l.scrollLeft,l.scrollTop];if(((f=o.current)==null?void 0:f[0])===m[0]&&((h=o.current)==null?void 0:h[1])===m[1])if(a.current>10){o.current=null,r.current=null;return}else a.current++;else a.current=0,s.current(m[0],m[1]),o.current=m;i.current=window.setTimeout(u,8.333333333333334)}},c=()=>{r.current=!0,o.current=null,i.current!==null&&(window.clearTimeout(i.current),i.current=null)},d=f=>{f.touches.length===0&&(r.current=!1,a.current=0,i.current=window.setTimeout(u,8.333333333333334))};if(e&&l!==null){const f=l;return f.addEventListener("touchstart",c),f.addEventListener("touchend",d),()=>{f.removeEventListener("touchstart",c),f.removeEventListener("touchend",d),i.current!==null&&window.clearTimeout(i.current)}}},[e,l])},p0=()=>e=>e.isSafari?"scroll":"auto",v0=hn("div")({name:"ScrollRegionStyle",class:"gdg-s1dgczr6",propsAsIs:!1,vars:{"s1dgczr6-0":[p0()]}});function b0(e){const[t,n]=g.useState(!1),i=typeof window>"u"?null:window,r=g.useRef(0);return fn("touchstart",g.useCallback(()=>{window.clearTimeout(r.current),n(!0)},[]),i,!0,!1),fn("touchend",g.useCallback(o=>{o.touches.length===0&&(r.current=window.setTimeout(()=>n(!1),e))},[e]),i,!0,!1),t}const w0=e=>{var ie,ge;const{children:t,clientHeight:n,scrollHeight:i,scrollWidth:r,update:o,draggable:a,className:s,preventDiagonalScrolling:l=!1,paddingBottom:u=0,paddingRight:c=0,rightElement:d,rightElementProps:f,kineticScrollPerfHack:h=!1,scrollRef:m,initialSize:p}=e,b=[],w=(f==null?void 0:f.sticky)??!1,y=(f==null?void 0:f.fill)??!1,S=g.useRef(0),M=g.useRef(0),C=g.useRef(null),x=typeof window>"u"?1:window.devicePixelRatio,R=g.useRef({scrollLeft:0,scrollTop:0,lockDirection:void 0}),I=g.useRef(null),E=b0(200),[H,z]=g.useState(!0),L=g.useRef(0);g.useLayoutEffect(()=>{if(!H||E||R.current.lockDirection===void 0)return;const fe=C.current;if(fe===null)return;const[G,P]=R.current.lockDirection;G!==void 0?fe.scrollLeft=G:P!==void 0&&(fe.scrollTop=P),R.current.lockDirection=void 0},[E,H]);const _=g.useCallback((fe,G)=>{var at;const P=C.current;if(P===null)return;G=G??P.scrollTop,fe=fe??P.scrollLeft;const k=R.current.scrollTop,$=R.current.scrollLeft,le=fe-$,Te=G-k;E&&le!==0&&Te!==0&&(Math.abs(le)>3||Math.abs(Te)>3)&&l&&R.current.lockDirection===void 0&&(R.current.lockDirection=Math.abs(le)<Math.abs(Te)?[$,void 0]:[void 0,k]);const Be=R.current.lockDirection;fe=(Be==null?void 0:Be[0])??fe,G=(Be==null?void 0:Be[1])??G,R.current.scrollLeft=fe,R.current.scrollTop=G;const ce=P.clientWidth,nt=P.clientHeight,ke=G,bt=M.current-ke,Et=P.scrollHeight-nt;if(M.current=ke,Et>0&&(Math.abs(bt)>2e3||ke===0||ke===Et)&&i>P.scrollHeight+5){const te=ke/Et,it=(i-nt)*te;S.current=it-ke}Be!==void 0&&(window.clearTimeout(L.current),z(!1),L.current=window.setTimeout(()=>z(!0),200)),o({x:fe,y:ke+S.current,width:ce-c,height:nt-u,paddingRight:((at=I.current)==null?void 0:at.clientWidth)??0})},[u,c,i,o,l,E]);m0(h&&ga.value,_,C);const O=g.useRef(_);O.current=_;const ne=g.useRef(),q=g.useRef(!1);g.useLayoutEffect(()=>{q.current?_():q.current=!0},[_,u,c]);const oe=g.useCallback(fe=>{C.current=fe,m!==void 0&&(m.current=fe)},[m]);let Se=0,xe=0;for(b.push(g.createElement("div",{key:Se++,style:{width:r,height:0}}));xe<i;){const fe=Math.min(5e6,i-xe);b.push(g.createElement("div",{key:Se++,style:{width:0,height:fe}})),xe+=fe}const{ref:re,width:J,height:ee}=g0(p);return typeof window<"u"&&(((ie=ne.current)==null?void 0:ie.height)!==ee||((ge=ne.current)==null?void 0:ge.width)!==J)&&(window.setTimeout(()=>O.current(),0),ne.current={width:J,height:ee}),(J??0)===0||(ee??0)===0?g.createElement("div",{ref:re}):g.createElement("div",{ref:re},g.createElement(v0,{isSafari:ga.value},g.createElement("div",{className:"dvn-underlay"},t),g.createElement("div",{ref:oe,style:ne.current,draggable:a,onDragStart:fe=>{a||(fe.stopPropagation(),fe.preventDefault())},className:"dvn-scroller "+(s??""),onScroll:()=>_()},g.createElement("div",{className:"dvn-scroll-inner"+(d===void 0?" dvn-hidden":"")},g.createElement("div",{className:"dvn-stack"},b),d!==void 0&&g.createElement(g.Fragment,null,!y&&g.createElement("div",{className:"dvn-spacer"}),g.createElement("div",{ref:I,style:{height:ee,maxHeight:n-Math.ceil(x%1),position:"sticky",top:0,paddingLeft:1,marginBottom:-40,marginRight:c,flexGrow:y?1:void 0,right:w?c??0:void 0,pointerEvents:"auto"}},d))))))},y0=e=>{const{columns:t,rows:n,rowHeight:i,headerHeight:r,groupHeaderHeight:o,enableGroups:a,freezeColumns:s,experimental:l,nonGrowWidth:u,clientSize:c,className:d,onVisibleRegionChanged:f,scrollRef:h,preventDiagonalScrolling:m,rightElement:p,rightElementProps:b,overscrollX:w,overscrollY:y,initialSize:S,smoothScrollX:M=!1,smoothScrollY:C=!1,isDraggable:x}=e,{paddingRight:R,paddingBottom:I}=l??{},[E,H]=c,z=g.useRef(),L=g.useRef(),_=g.useRef(),O=g.useRef(),ne=u+Math.max(0,w??0);let q=a?r+o:r;if(typeof i=="number")q+=n*i;else for(let re=0;re<n;re++)q+=i(re);y!==void 0&&(q+=y);const oe=g.useRef(),Se=g.useCallback(()=>{var Te,Be;if(oe.current===void 0)return;const re={...oe.current};let J=0,ee=re.x<0?-re.x:0,ie=0,ge=0;re.x=re.x<0?0:re.x;let fe=0;for(let ce=0;ce<s;ce++)fe+=t[ce].width;for(const ce of t){const nt=J-fe;if(re.x>=nt+ce.width)J+=ce.width,ge++,ie++;else if(re.x>nt)J+=ce.width,M?ee+=nt-re.x:ge++,ie++;else if(re.x+re.width>nt)J+=ce.width,ie++;else break}let G=0,P=0,k=0;if(typeof i=="number")C?(P=Math.floor(re.y/i),G=P*i-re.y):P=Math.ceil(re.y/i),k=Math.ceil(re.height/i)+P,G<0&&k++;else{let ce=0;for(let nt=0;nt<n;nt++){const ke=i(nt),bt=ce+(C?0:ke/2);if(re.y>=ce+ke)ce+=ke,P++,k++;else if(re.y>bt)ce+=ke,C?G+=bt-re.y:P++,k++;else if(re.y+re.height>ke/2+ce)ce+=ke,k++;else break}}const $={x:ge,y:P,width:ie-ge,height:k-P},le=z.current;(le===void 0||le.y!==$.y||le.x!==$.x||le.height!==$.height||le.width!==$.width||L.current!==ee||_.current!==G||re.width!==((Te=O.current)==null?void 0:Te[0])||re.height!==((Be=O.current)==null?void 0:Be[1]))&&(f==null||f({x:ge,y:P,width:ie-ge,height:k-P},re.width,re.height,re.paddingRight??0,ee,G),z.current=$,L.current=ee,_.current=G,O.current=[re.width,re.height])},[t,i,n,f,s,M,C]),xe=g.useCallback(re=>{oe.current=re,Se()},[Se]);return g.useEffect(()=>{Se()},[Se]),g.createElement(w0,{scrollRef:h,className:d,kineticScrollPerfHack:l==null?void 0:l.kineticScrollPerfHack,preventDiagonalScrolling:m,draggable:x===!0||typeof x=="string",scrollWidth:ne+(R??0),scrollHeight:q+(I??0),clientHeight:H,rightElement:p,paddingBottom:I,paddingRight:R,rightElementProps:b,update:xe,initialSize:S},g.createElement(h0,{eventTargetRef:h,width:E,height:H,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,prelightCells:e.prelightCells,rowHeight:e.rowHeight,rows:e.rows,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,onColumnProposeMove:e.onColumnProposeMove,verticalBorder:e.verticalBorder,drawFocusRing:e.drawFocusRing,drawHeader:e.drawHeader,drawCell:e.drawCell,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}))},C0=hn("div")({name:"SearchWrapper",class:"gdg-seveqep",propsAsIs:!1}),S0=g.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},g.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 244l144-144 144 144M256 120v292"})),x0=g.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},g.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M112 268l144 144 144-144M256 392V100"})),k0=g.createElement("svg",{className:"button-icon",viewBox:"0 0 512 512"},g.createElement("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M368 368L144 144M368 144L144 368"})),M0=10,R0=e=>{const{canvasRef:t,cellYOffset:n,rows:i,columns:r,searchInputRef:o,searchValue:a,searchResults:s,onSearchValueChange:l,getCellsForSelection:u,onSearchResultsChanged:c,showSearch:d=!1,onSearchClose:f}=e,[h]=g.useState(()=>"search-box-"+Math.round(Math.random()*1e3)),[m,p]=g.useState(""),b=a??m,w=g.useCallback(J=>{p(J),l==null||l(J)},[l]),[y,S]=g.useState(),M=g.useRef(y);M.current=y,g.useEffect(()=>{s!==void 0&&(s.length>0?S(J=>({rowsSearched:i,results:s.length,selectedIndex:(J==null?void 0:J.selectedIndex)??-1})):S(void 0))},[i,s]);const C=g.useRef();C.current===void 0&&(C.current=new AbortController);const x=g.useRef(),[R,I]=g.useState([]),E=s??R,H=g.useCallback(()=>{x.current!==void 0&&(window.cancelAnimationFrame(x.current),x.current=void 0,C.current.abort())},[]),z=g.useRef(n);z.current=n;const L=g.useCallback(J=>{const ee=new RegExp(J.replace(/([$()*+.?[\\\]^{|}-])/g,"\\$1"),"i");let ie=z.current,ge=Math.min(10,i),fe=0;S(void 0),I([]);const G=[],P=async()=>{var Et;if(u===void 0)return;const k=performance.now(),$=i-fe;let le=u({x:0,y:ie,width:r.length,height:Math.min(ge,$,i-ie)},C.current.signal);typeof le=="function"&&(le=await le());let Te=!1;for(const[at,te]of le.entries())for(const[it,me]of te.entries()){let se;switch(me.kind){case Z.Text:case Z.Number:se=me.displayData;break;case Z.Uri:case Z.Markdown:se=me.data;break;case Z.Boolean:se=typeof me.data=="boolean"?me.data.toString():void 0;break;case Z.Image:case Z.Bubble:se=me.data.join("🐳");break;case Z.Custom:se=me.copyData;break}se!==void 0&&ee.test(se)&&(G.push([it,at+ie]),Te=!0)}const Be=performance.now();Te&&I([...G]),fe+=le.length,_n(fe<=i);const ce=((Et=M.current)==null?void 0:Et.selectedIndex)??-1;S({results:G.length,rowsSearched:fe,selectedIndex:ce}),c==null||c(G,ce),ie+ge>=i?ie=0:ie+=ge;const nt=Be-k,ke=Math.max(nt,1),bt=M0/ke;ge=Math.ceil(ge*bt),fe<i&&G.length<1e3&&(x.current=window.requestAnimationFrame(P))};H(),x.current=window.requestAnimationFrame(P)},[H,r.length,u,c,i]),_=g.useCallback(()=>{var J;f==null||f(),S(void 0),I([]),c==null||c([],-1),H(),(J=t==null?void 0:t.current)==null||J.focus()},[H,t,f,c]),O=g.useCallback(J=>{w(J.target.value),s===void 0&&(J.target.value===""?(S(void 0),I([]),H()):L(J.target.value))},[L,H,w,s]);g.useEffect(()=>{d&&o.current!==null&&(w(""),o.current.focus({preventScroll:!0}))},[d,o,w]);const ne=g.useCallback(J=>{var ie;if((ie=J==null?void 0:J.stopPropagation)==null||ie.call(J),y===void 0)return;const ee=(y.selectedIndex+1)%y.results;S({...y,selectedIndex:ee}),c==null||c(E,ee)},[y,c,E]),q=g.useCallback(J=>{var ie;if((ie=J==null?void 0:J.stopPropagation)==null||ie.call(J),y===void 0)return;let ee=(y.selectedIndex-1)%y.results;ee<0&&(ee+=y.results),S({...y,selectedIndex:ee}),c==null||c(E,ee)},[c,E,y]),oe=g.useCallback(J=>{(J.ctrlKey||J.metaKey)&&J.nativeEvent.code==="KeyF"||J.key==="Escape"?(_(),J.stopPropagation(),J.preventDefault()):J.key==="Enter"&&(J.shiftKey?q():ne())},[_,ne,q]);g.useEffect(()=>()=>{H()},[H]);const[Se,xe]=g.useState(!1);g.useEffect(()=>{if(d)xe(!0);else{const J=setTimeout(()=>xe(!1),150);return()=>clearTimeout(J)}},[d]);const re=g.useMemo(()=>{if(!d&&!Se)return null;let J;y!==void 0&&(J=y.results>=1e3?"over 1000":`${y.results} result${y.results!==1?"s":""}`,y.selectedIndex>=0&&(J=`${y.selectedIndex+1} of ${J}`));const ee=fe=>{fe.stopPropagation()},ge={width:`${Math.floor(((y==null?void 0:y.rowsSearched)??0)/i*100)}%`};return g.createElement(C0,{className:d?"":"out",onMouseDown:ee,onMouseMove:ee,onMouseUp:ee,onClick:ee},g.createElement("div",{className:"gdg-search-bar-inner"},g.createElement("input",{id:h,"aria-hidden":!d,"data-testid":"search-input",ref:o,onChange:O,value:b,tabIndex:d?void 0:-1,onKeyDownCapture:oe}),g.createElement("button",{"aria-label":"Previous Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:q,disabled:((y==null?void 0:y.results)??0)===0},S0),g.createElement("button",{"aria-label":"Next Result","aria-hidden":!d,tabIndex:d?void 0:-1,onClick:ne,disabled:((y==null?void 0:y.results)??0)===0},x0),f!==void 0&&g.createElement("button",{"aria-label":"Close Search","aria-hidden":!d,"data-testid":"search-close-button",tabIndex:d?void 0:-1,onClick:_},k0)),y!==void 0?g.createElement(g.Fragment,null,g.createElement("div",{className:"gdg-search-status"},g.createElement("div",{"data-testid":"search-result-area"},J)),g.createElement("div",{className:"gdg-search-progress",style:ge})):g.createElement("div",{className:"gdg-search-status"},g.createElement("label",{htmlFor:h},"Type to search")))},[d,Se,y,i,h,o,O,b,oe,q,ne,f,_]);return g.createElement(g.Fragment,null,g.createElement(y0,{prelightCells:E,accessibilityHeight:e.accessibilityHeight,canvasRef:e.canvasRef,cellXOffset:e.cellXOffset,cellYOffset:e.cellYOffset,className:e.className,clientSize:e.clientSize,columns:e.columns,disabledRows:e.disabledRows,enableGroups:e.enableGroups,fillHandle:e.fillHandle,firstColAccessible:e.firstColAccessible,nonGrowWidth:e.nonGrowWidth,fixedShadowX:e.fixedShadowX,fixedShadowY:e.fixedShadowY,freezeColumns:e.freezeColumns,getCellContent:e.getCellContent,getCellRenderer:e.getCellRenderer,getGroupDetails:e.getGroupDetails,getRowThemeOverride:e.getRowThemeOverride,groupHeaderHeight:e.groupHeaderHeight,headerHeight:e.headerHeight,highlightRegions:e.highlightRegions,imageWindowLoader:e.imageWindowLoader,initialSize:e.initialSize,isFilling:e.isFilling,isFocused:e.isFocused,lockColumns:e.lockColumns,maxColumnWidth:e.maxColumnWidth,minColumnWidth:e.minColumnWidth,onHeaderMenuClick:e.onHeaderMenuClick,onHeaderIndicatorClick:e.onHeaderIndicatorClick,onMouseMove:e.onMouseMove,onVisibleRegionChanged:e.onVisibleRegionChanged,overscrollX:e.overscrollX,overscrollY:e.overscrollY,preventDiagonalScrolling:e.preventDiagonalScrolling,rightElement:e.rightElement,rightElementProps:e.rightElementProps,rowHeight:e.rowHeight,rows:e.rows,scrollRef:e.scrollRef,selection:e.selection,theme:e.theme,freezeTrailingRows:e.freezeTrailingRows,hasAppendRow:e.hasAppendRow,translateX:e.translateX,translateY:e.translateY,verticalBorder:e.verticalBorder,onColumnProposeMove:e.onColumnProposeMove,drawFocusRing:e.drawFocusRing,drawCell:e.drawCell,drawHeader:e.drawHeader,experimental:e.experimental,gridRef:e.gridRef,headerIcons:e.headerIcons,isDraggable:e.isDraggable,onCanvasBlur:e.onCanvasBlur,onCanvasFocused:e.onCanvasFocused,onCellFocused:e.onCellFocused,onColumnMoved:e.onColumnMoved,onColumnResize:e.onColumnResize,onColumnResizeEnd:e.onColumnResizeEnd,onColumnResizeStart:e.onColumnResizeStart,onContextMenu:e.onContextMenu,onDragEnd:e.onDragEnd,onDragLeave:e.onDragLeave,onDragOverCell:e.onDragOverCell,onDragStart:e.onDragStart,onDrop:e.onDrop,onItemHovered:e.onItemHovered,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onRowMoved:e.onRowMoved,smoothScrollX:e.smoothScrollX,smoothScrollY:e.smoothScrollY,resizeIndicator:e.resizeIndicator}),re)};class E0 extends g.PureComponent{constructor(){super(...arguments);dt(this,"wrapperRef",g.createRef());dt(this,"clickOutside",n=>{if(!(this.props.isOutsideClick&&!this.props.isOutsideClick(n))&&this.wrapperRef.current!==null&&!this.wrapperRef.current.contains(n.target)){let i=n.target;for(;i!==null;){if(i.classList.contains("click-outside-ignore"))return;i=i.parentElement}this.props.onClickOutside()}})}componentDidMount(){document.addEventListener("touchend",this.clickOutside,!0),document.addEventListener("mousedown",this.clickOutside,!0),document.addEventListener("contextmenu",this.clickOutside,!0)}componentWillUnmount(){document.removeEventListener("touchend",this.clickOutside,!0),document.removeEventListener("mousedown",this.clickOutside,!0),document.removeEventListener("contextmenu",this.clickOutside,!0)}render(){const{onClickOutside:n,isOutsideClick:i,...r}=this.props;return g.createElement("div",{...r,ref:this.wrapperRef},this.props.children)}}const I0=()=>e=>Math.max(16,e.targetHeight-10),T0=hn("input")({name:"RenameInput",class:"gdg-r17m35ur",propsAsIs:!1,vars:{"r17m35ur-0":[I0(),"px"]}}),D0=e=>{const{bounds:t,group:n,onClose:i,canvasBounds:r,onFinish:o}=e,[a,s]=ae.useState(n);return ae.createElement(E0,{style:{position:"absolute",left:t.x-r.left+1,top:t.y-r.top,width:t.width-2,height:t.height},className:"gdg-c1tqibwd",onClickOutside:i},ae.createElement(T0,{targetHeight:t.height,"data-testid":"group-rename-input",value:a,onBlur:i,onFocus:l=>l.target.setSelectionRange(0,a.length),onChange:l=>s(l.target.value),onKeyDown:l=>{l.key==="Enter"?o(a):l.key==="Escape"&&i()},autoFocus:!0}))};function O0(e,t){return e===void 0?!1:e.length>1&&e.startsWith("_")?Number.parseInt(e.slice(1))===t.keyCode:e.length===1&&e>="a"&&e<="z"?e.toUpperCase().codePointAt(0)===t.keyCode:e===t.key}function ut(e,t,n){const i=sd(e,t);return i&&(n.didMatch=!0),i}function sd(e,t){if(e.length===0)return!1;if(e.includes("|")){const l=e.split("|");for(const u of l)if(sd(u,t))return!0;return!1}let n=!1,i=!1,r=!1,o=!1;const a=e.split("+"),s=a.pop();if(!O0(s,t))return!1;if(a[0]==="any")return!0;for(const l of a)switch(l){case"ctrl":n=!0;break;case"shift":i=!0;break;case"alt":r=!0;break;case"meta":o=!0;break;case"primary":ma.value?o=!0:n=!0;break}return t.altKey===r&&t.ctrlKey===n&&t.shiftKey===i&&t.metaKey===o}function P0(e,t,n,i,r,o,a){const s=ae.useCallback((c,d,f,h)=>{var S;(o==="cell"||o==="multi-cell")&&c!==void 0&&(c={...c,range:{x:c.cell[0],y:c.cell[1],width:1,height:1}}),!a&&c!==void 0&&c.range.width>1&&(c={...c,range:{...c.range,width:1,x:c.cell[0]}});const m=n==="mixed"&&(f||h==="drag"),p=i==="mixed"&&m,b=r==="mixed"&&m;let w={current:c===void 0?void 0:{...c,rangeStack:h==="drag"?((S=e.current)==null?void 0:S.rangeStack)??[]:[]},columns:p?e.columns:yt.empty(),rows:b?e.rows:yt.empty()};f&&(o==="multi-rect"||o==="multi-cell")&&w.current!==void 0&&e.current!==void 0&&(w={...w,current:{...w.current,rangeStack:[...e.current.rangeStack,e.current.range]}}),t(w,d)},[i,e,n,o,a,r,t]),l=ae.useCallback((c,d,f)=>{c=c??e.rows,d!==void 0&&(c=c.add(d));let h;if(r==="exclusive"&&c.length>0)h={current:void 0,columns:yt.empty(),rows:c};else{const m=f&&n==="mixed",p=f&&i==="mixed";h={current:m?e.current:void 0,columns:p?e.columns:yt.empty(),rows:c}}t(h,!1)},[i,e,n,r,t]),u=ae.useCallback((c,d,f)=>{c=c??e.columns,d!==void 0&&(c=c.add(d));let h;if(i==="exclusive"&&c.length>0)h={current:void 0,rows:yt.empty(),columns:c};else{const m=f&&n==="mixed",p=f&&r==="mixed";h={current:m?e.current:void 0,rows:p?e.rows:yt.empty(),columns:c}}t(h,!1)},[i,e,n,r,t]);return[s,l,u]}function _0(e,t,n,i,r){const o=g.useCallback(u=>{if(e===!0){const c=[];for(let d=u.y;d<u.y+u.height;d++){const f=[];for(let h=u.x;h<u.x+u.width;h++)h<0||d>=r?f.push({kind:Z.Loading,allowOverlay:!1}):f.push(t([h,d]));c.push(f)}return c}return(e==null?void 0:e(u,i.signal))??[]},[i.signal,t,e,r]),a=e!==void 0?o:void 0,s=g.useCallback(u=>{if(a===void 0)return[];const c={...u,x:u.x-n};if(c.x<0){c.x=0,c.width--;const d=a(c,i.signal);return typeof d=="function"?async()=>(await d()).map(f=>[{kind:Z.Loading,allowOverlay:!1},...f]):d.map(f=>[{kind:Z.Loading,allowOverlay:!1},...f])}return a(c,i.signal)},[i.signal,a,n]);return[e!==void 0?s:void 0,a]}function L0(e){if(e.copyData!==void 0)return{formatted:e.copyData,rawValue:e.copyData,format:"string"};switch(e.kind){case Z.Boolean:return{formatted:e.data===!0?"TRUE":e.data===!1?"FALSE":e.data===$s?"INDETERMINATE":"",rawValue:e.data,format:"boolean"};case Z.Custom:return{formatted:e.copyData,rawValue:e.copyData,format:"string"};case Z.Image:case Z.Bubble:return{formatted:e.data,rawValue:e.data,format:"string-array"};case Z.Drilldown:return{formatted:e.data.map(t=>t.text),rawValue:e.data.map(t=>t.text),format:"string-array"};case Z.Text:return{formatted:e.displayData??e.data,rawValue:e.data,format:"string"};case Z.Uri:return{formatted:e.displayData??e.data,rawValue:e.data,format:"url"};case Z.Markdown:case Z.RowID:return{formatted:e.data,rawValue:e.data,format:"string"};case Z.Number:return{formatted:e.displayData,rawValue:e.data,format:"number"};case Z.Loading:return{formatted:"#LOADING",rawValue:"",format:"string"};case Z.Protected:return{formatted:"************",rawValue:"",format:"string"};default:ao()}}function F0(e,t){return e.map((i,r)=>{const o=t[r];return i.map(a=>a.span!==void 0&&a.span[0]!==o?{formatted:"",rawValue:"",format:"string"}:L0(a))})}function fu(e,t){return(t?/[\t\n",]/:/[\t\n"]/).test(e)&&(e=`"${e.replace(/"/g,'""')}"`),e}function A0(e){var n;const t=[];for(const i of e){const r=[];for(const o of i)o.format==="url"?r.push(((n=o.rawValue)==null?void 0:n.toString())??""):o.format==="string-array"?r.push(o.formatted.map(a=>fu(a,!0)).join(",")):r.push(fu(o.formatted,!1));t.push(r.join(" "))}return t.join(`
166
- `)}function us(e){return e.replace(/\t/g," ").replace(/ {2,}/g,t=>"<span> </span>".repeat(t.length))}function hu(e){return'"'+e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"'}function H0(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function z0(e){var n;const t=[];t.push('<style type="text/css"><!--br {mso-data-placement:same-cell;}--></style>',"<table><tbody>");for(const i of e){t.push("<tr>");for(const r of i){const o=`gdg-format="${r.format}"`;r.format==="url"?t.push(`<td ${o}><a href="${r.rawValue}">${us(r.formatted)}</a></td>`):r.format==="string-array"?t.push(`<td ${o}><ol>${r.formatted.map((a,s)=>`<li gdg-raw-value=${hu(r.rawValue[s])}>`+us(a)+"</li>").join("")}</ol></td>`):t.push(`<td gdg-raw-value=${hu(((n=r.rawValue)==null?void 0:n.toString())??"")} ${o}>${us(r.formatted)}</td>`)}t.push("</tr>")}return t.push("</tbody></table>"),t.join("")}function $0(e,t){const n=F0(e,t),i=A0(n),r=z0(n);return{textPlain:i,textHtml:r}}function gu(e){var a;const t=document.createElement("html");t.innerHTML=e.replace(/&nbsp;/g," ");const n=t.querySelector("table");if(n===null)return;const i=[n],r=[];let o;for(;i.length>0;){const s=i.pop();if(s===void 0)break;if(s instanceof HTMLTableElement||s.nodeName==="TBODY")i.push(...[...s.children].reverse());else if(s instanceof HTMLTableRowElement)o!==void 0&&r.push(o),o=[],i.push(...[...s.children].reverse());else if(s instanceof HTMLTableCellElement){const l=s.cloneNode(!0),c=l.children.length===1&&l.children[0].nodeName==="P"?l.children[0]:null,d=(c==null?void 0:c.children.length)===1&&c.children[0].nodeName==="FONT",f=l.querySelectorAll("br");for(const p of f)p.replaceWith(`
167
- `);const h=l.getAttribute("gdg-raw-value"),m=l.getAttribute("gdg-format")??"string";if(l.querySelector("a")!==null)o==null||o.push({rawValue:((a=l.querySelector("a"))==null?void 0:a.getAttribute("href"))??"",formatted:l.textContent??"",format:m});else if(l.querySelector("ol")!==null){const p=l.querySelectorAll("li");o==null||o.push({rawValue:[...p].map(b=>b.getAttribute("gdg-raw-value")??""),formatted:[...p].map(b=>b.textContent??""),format:"string-array"})}else if(h!==null)o==null||o.push({rawValue:H0(h),formatted:l.textContent??"",format:m});else{let p=l.textContent??"";d&&(p=p.replace(/\n(?!\n)/g,"")),o==null||o.push({rawValue:p??"",formatted:p??"",format:m})}}}return o!==void 0&&r.push(o),r}function V0(e,t,n,i,r){var s;const o=e;if(i==="allowPartial"||e.current===void 0||t===void 0)return e;let a=!1;do{if((e==null?void 0:e.current)===void 0)break;const l=(s=e.current)==null?void 0:s.range,u=[];if(l.width>2){const f=t({x:l.x,y:l.y,width:1,height:l.height},r.signal);if(typeof f=="function")return o;u.push(...f);const h=t({x:l.x+l.width-1,y:l.y,width:1,height:l.height},r.signal);if(typeof h=="function")return o;u.push(...h)}else{const f=t({x:l.x,y:l.y,width:l.width,height:l.height},r.signal);if(typeof f=="function")return o;u.push(...f)}let c=l.x-n,d=l.x+l.width-1-n;for(const f of u)for(const h of f)h.span!==void 0&&(c=Math.min(h.span[0],c),d=Math.max(h.span[1],d));c===l.x-n&&d===l.x+l.width-1-n?a=!0:e={current:{cell:e.current.cell??[0,0],range:{x:c+n,y:l.y,width:d-c+1,height:l.height},rangeStack:e.current.rangeStack},columns:e.columns,rows:e.rows}}while(!a);return e}function mu(e){return e.startsWith('"')&&e.endsWith('"')&&(e=e.slice(1,-1).replace(/""/g,'"')),e}function N0(e){let t;(function(s){s[s.None=0]="None",s[s.inString=1]="inString",s[s.inStringPostQuote=2]="inStringPostQuote"})(t||(t={}));const n=[];let i=[],r=0,o=t.None;e=e.replace(/\r\n/g,`
168
- `);let a=0;for(const s of e){switch(o){case t.None:s===" "||s===`
169
- `?(i.push(e.slice(r,a)),r=a+1,s===`
170
- `&&(n.push(i),i=[])):s==='"'&&(o=t.inString);break;case t.inString:s==='"'&&(o=t.inStringPostQuote);break;case t.inStringPostQuote:s==='"'?o=t.inString:((s===" "||s===`
171
- `)&&(i.push(mu(e.slice(r,a))),r=a+1,s===`
172
- `&&(n.push(i),i=[])),o=t.None);break}a++}return r<e.length&&i.push(mu(e.slice(r,e.length))),n.push(i),n.map(s=>s.map(l=>({rawValue:l,formatted:l,format:"string"})))}function pu(e,t,n){var s;const i=$0(e,t),r=l=>{var u;(u=window.navigator.clipboard)==null||u.writeText(l)},o=(l,u)=>{var c;return((c=window.navigator.clipboard)==null?void 0:c.write)===void 0?!1:(window.navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([l],{type:"text/plain"}),"text/html":new Blob([u],{type:"text/html"})})]),!0)},a=(l,u)=>{var c,d;try{if(n===void 0||n.clipboardData===null)throw new Error("No clipboard data");(c=n==null?void 0:n.clipboardData)==null||c.setData("text/plain",l),(d=n==null?void 0:n.clipboardData)==null||d.setData("text/html",u)}catch{o(l,u)||r(l)}};((s=window.navigator.clipboard)==null?void 0:s.write)!==void 0||(n==null?void 0:n.clipboardData)!==void 0?a(i.textPlain,i.textHtml):r(i.textPlain),n==null||n.preventDefault()}function ld(e){return e!==!0}function vu(e){return typeof e=="string"?e:`${e}px`}const B0=()=>e=>e.innerWidth,W0=()=>e=>e.innerHeight,U0=hn("div")({name:"Wrapper",class:"gdg-wmyidgi",propsAsIs:!1,vars:{"wmyidgi-0":[B0()],"wmyidgi-1":[W0()]}}),Y0=e=>{const{inWidth:t,inHeight:n,children:i,...r}=e;return g.createElement(U0,{innerHeight:vu(n),innerWidth:vu(t),...r},i)},X0=2,G0=1300;function j0(e,t,n){const i=ae.useRef(0),[r,o]=e??[0,0];ae.useEffect(()=>{if(r===0&&o===0){i.current=0;return}let a=!1,s=0;const l=u=>{var c;if(!a){if(s===0)s=u;else{const d=u-s;i.current=Math.min(1,i.current+d/G0);const f=i.current**1.618*d*X0;(c=t.current)==null||c.scrollBy(r*f,o*f),s=u,n==null||n()}window.requestAnimationFrame(l)}};return window.requestAnimationFrame(l),()=>{a=!0}},[t,r,o,n])}function q0({rowHeight:e,headerHeight:t,groupHeaderHeight:n,theme:i,overscrollX:r,overscrollY:o,scaleToRem:a,remSize:s}){const[l,u,c,d,f,h]=ae.useMemo(()=>{if(!a||s===16)return[e,t,n,i,r,o];const m=s/16,p=e,b=Gc();return[typeof p=="number"?p*m:w=>Math.ceil(p(w)*m),Math.ceil(t*m),Math.ceil(n*m),{...i,headerIconSize:((i==null?void 0:i.headerIconSize)??b.headerIconSize)*m,cellHorizontalPadding:((i==null?void 0:i.cellHorizontalPadding)??b.cellHorizontalPadding)*m,cellVerticalPadding:((i==null?void 0:i.cellVerticalPadding)??b.cellVerticalPadding)*m},Math.ceil((r??0)*m),Math.ceil((o??0)*m)]},[n,t,r,o,s,e,a,i]);return{rowHeight:l,headerHeight:u,groupHeaderHeight:c,theme:d,overscrollX:f,overscrollY:h}}const Fr={downFill:!1,rightFill:!1,clear:!0,closeOverlay:!0,acceptOverlayDown:!0,acceptOverlayUp:!0,acceptOverlayLeft:!0,acceptOverlayRight:!0,copy:!0,paste:!0,cut:!0,search:!1,delete:!0,activateCell:!0,scrollToSelectedCell:!0,goToFirstCell:!0,goToFirstColumn:!0,goToFirstRow:!0,goToLastCell:!0,goToLastColumn:!0,goToLastRow:!0,goToNextPage:!0,goToPreviousPage:!0,selectToFirstCell:!0,selectToFirstColumn:!0,selectToFirstRow:!0,selectToLastCell:!0,selectToLastColumn:!0,selectToLastRow:!0,selectAll:!0,selectRow:!0,selectColumn:!0,goUpCell:!0,goRightCell:!0,goDownCell:!0,goLeftCell:!0,goUpCellRetainSelection:!0,goRightCellRetainSelection:!0,goDownCellRetainSelection:!0,goLeftCellRetainSelection:!0,selectGrowUp:!0,selectGrowRight:!0,selectGrowDown:!0,selectGrowLeft:!0};function ct(e,t){return e===!0?t:e===!1?"":e}function bu(e){const t=ma.value;return{activateCell:ct(e.activateCell," |Enter|shift+Enter"),clear:ct(e.clear,"any+Escape"),closeOverlay:ct(e.closeOverlay,"any+Escape"),acceptOverlayDown:ct(e.acceptOverlayDown,"Enter"),acceptOverlayUp:ct(e.acceptOverlayUp,"shift+Enter"),acceptOverlayLeft:ct(e.acceptOverlayLeft,"shift+Tab"),acceptOverlayRight:ct(e.acceptOverlayRight,"Tab"),copy:e.copy,cut:e.cut,delete:ct(e.delete,t?"Backspace|Delete":"Delete"),downFill:ct(e.downFill,"primary+_68"),scrollToSelectedCell:ct(e.scrollToSelectedCell,"primary+Enter"),goDownCell:ct(e.goDownCell,"ArrowDown"),goDownCellRetainSelection:ct(e.goDownCellRetainSelection,"alt+ArrowDown"),goLeftCell:ct(e.goLeftCell,"ArrowLeft|shift+Tab"),goLeftCellRetainSelection:ct(e.goLeftCellRetainSelection,"alt+ArrowLeft"),goRightCell:ct(e.goRightCell,"ArrowRight|Tab"),goRightCellRetainSelection:ct(e.goRightCellRetainSelection,"alt+ArrowRight"),goUpCell:ct(e.goUpCell,"ArrowUp"),goUpCellRetainSelection:ct(e.goUpCellRetainSelection,"alt+ArrowUp"),goToFirstCell:ct(e.goToFirstCell,"primary+Home"),goToFirstColumn:ct(e.goToFirstColumn,"Home|primary+ArrowLeft"),goToFirstRow:ct(e.goToFirstRow,"primary+ArrowUp"),goToLastCell:ct(e.goToLastCell,"primary+End"),goToLastColumn:ct(e.goToLastColumn,"End|primary+ArrowRight"),goToLastRow:ct(e.goToLastRow,"primary+ArrowDown"),goToNextPage:ct(e.goToNextPage,"PageDown"),goToPreviousPage:ct(e.goToPreviousPage,"PageUp"),paste:e.paste,rightFill:ct(e.rightFill,"primary+_82"),search:ct(e.search,"primary+f"),selectAll:ct(e.selectAll,"primary+a"),selectColumn:ct(e.selectColumn,"ctrl+ "),selectGrowDown:ct(e.selectGrowDown,"shift+ArrowDown"),selectGrowLeft:ct(e.selectGrowLeft,"shift+ArrowLeft"),selectGrowRight:ct(e.selectGrowRight,"shift+ArrowRight"),selectGrowUp:ct(e.selectGrowUp,"shift+ArrowUp"),selectRow:ct(e.selectRow,"shift+ "),selectToFirstCell:ct(e.selectToFirstCell,"primary+shift+Home"),selectToFirstColumn:ct(e.selectToFirstColumn,"primary+shift+ArrowLeft"),selectToFirstRow:ct(e.selectToFirstRow,"primary+shift+ArrowUp"),selectToLastCell:ct(e.selectToLastCell,"primary+shift+End"),selectToLastColumn:ct(e.selectToLastColumn,"primary+shift+ArrowRight"),selectToLastRow:ct(e.selectToLastRow,"primary+shift+ArrowDown")}}function K0(e){const t=Ug(e);return ae.useMemo(()=>{if(t===void 0)return bu(Fr);const n={...t,goToNextPage:(t==null?void 0:t.goToNextPage)??(t==null?void 0:t.pageDown)??Fr.goToNextPage,goToPreviousPage:(t==null?void 0:t.goToPreviousPage)??(t==null?void 0:t.pageUp)??Fr.goToPreviousPage,goToFirstCell:(t==null?void 0:t.goToFirstCell)??(t==null?void 0:t.first)??Fr.goToFirstCell,goToLastCell:(t==null?void 0:t.goToLastCell)??(t==null?void 0:t.last)??Fr.goToLastCell,selectToFirstCell:(t==null?void 0:t.selectToFirstCell)??(t==null?void 0:t.first)??Fr.selectToFirstCell,selectToLastCell:(t==null?void 0:t.selectToLastCell)??(t==null?void 0:t.last)??Fr.selectToLastCell};return bu({...Fr,...n})},[t])}function Z0(e){function t(i,r,o){if(typeof i=="number")return{headerIndex:i,isCollapsed:!1,depth:r,path:o};const a={headerIndex:i.headerIndex,isCollapsed:i.isCollapsed,depth:r,path:o};return i.subGroups!==void 0&&(a.subGroups=i.subGroups.map((s,l)=>t(s,r+1,[...o,l])).sort((s,l)=>s.headerIndex-l.headerIndex)),a}return e.map((i,r)=>t(i,0,[r])).sort((i,r)=>i.headerIndex-r.headerIndex)}function Qs(e,t){const n=[];function i(a,s,l=!1){let u=s!==null?s-a.headerIndex:t-a.headerIndex;if(a.subGroups!==void 0&&(u=a.subGroups[0].headerIndex-a.headerIndex),u--,n.push({headerIndex:a.headerIndex,contentIndex:-1,skip:l,isCollapsed:a.isCollapsed,depth:a.depth,path:a.path,rows:u}),a.subGroups)for(let c=0;c<a.subGroups.length;c++){const d=c<a.subGroups.length-1?a.subGroups[c+1].headerIndex:s;i(a.subGroups[c],d,l||a.isCollapsed)}}const r=Z0(e.groups);for(let a=0;a<r.length;a++){const s=a<r.length-1?r[a+1].headerIndex:null;i(r[a],s)}let o=0;for(const a of n)a.contentIndex=o,o+=a.rows;return n.filter(a=>a.skip===!1).map(a=>{const{skip:s,...l}=a;return l})}function va(e,t){if(t===void 0||Qs.length===0)return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1};let n=e;for(const i of t){if(n===0)return{path:[...i.path,-1],originalIndex:i.headerIndex,isGroupHeader:!0,groupIndex:-1,contentIndex:-1,groupRows:i.rows};if(n--,!i.isCollapsed){if(n<i.rows)return{path:[...i.path,n],originalIndex:i.headerIndex+n,isGroupHeader:!1,groupIndex:n,contentIndex:i.contentIndex+n,groupRows:i.rows};n-=i.rows}}return{path:[e],originalIndex:e,isGroupHeader:!1,groupIndex:e,contentIndex:e,groupRows:-1}}function J0(e,t,n,i){const r=ae.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]),o=ae.useMemo(()=>r===void 0?t:r.reduce((u,c)=>u+(c.isCollapsed?1:c.rows+1),0),[r,t]),a=ae.useMemo(()=>e===void 0||typeof n=="number"&&e.height===n?n:u=>{const{isGroupHeader:c}=va(u,r);return c?e.height:typeof n=="number"?n:n(u)},[r,e,n]),s=ae.useCallback(u=>{if(r===void 0)return u;let c=u;for(const d of r){if(c===0)return;if(c--,!d.isCollapsed){if(c<d.rows)return d.contentIndex+c;c-=d.rows}}return u},[r]),l=Zr(i??(e==null?void 0:e.themeOverride),ae.useCallback(u=>{if(e===void 0)return i==null?void 0:i(u,u,u);if(i===void 0&&(e==null?void 0:e.themeOverride)===void 0)return;const{isGroupHeader:c,contentIndex:d,groupIndex:f}=va(u,r);return c?e.themeOverride:i==null?void 0:i(u,f,d)},[r,i,e]));return e===void 0?{rowHeight:a,rows:t,rowNumberMapper:s,getRowThemeOverride:l}:{rowHeight:a,rows:o,rowNumberMapper:s,getRowThemeOverride:l}}function Q0(e,t){const n=ae.useMemo(()=>e===void 0?void 0:Qs(e,t),[e,t]);return{getRowGroupingForPath:cd,updateRowGroupingByPath:ud,mapper:ae.useCallback(i=>{if(typeof i=="number")return va(i,n);const r=va(i[1],n);return{...r,originalIndex:[i[0],r.originalIndex]}},[n])}}function ud(e,t,n){const[i,...r]=t;return r[0]===-1?e.map((o,a)=>a===i?{...o,...n}:o):e.map((o,a)=>a===i?{...o,subGroups:ud(o.subGroups??[],r,n)}:o)}function cd(e,t){const[n,...i]=t;return i[0]===-1?e[n]:cd(e[n].subGroups??[],i)}function ev(e,t){const[n]=g.useState(()=>({value:e,callback:t,facade:{get current(){return n.value},set current(i){const r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}));return n.callback=t,n.facade}function tv(e,t,n,i,r){const[o,a]=g.useMemo(()=>[t!==void 0&&typeof n=="number"?Math.floor(t/n):0,t!==void 0&&typeof n=="number"?-(t%n):0],[t,n]),s=g.useMemo(()=>({x:i.current.x,y:o,width:i.current.width??1,height:i.current.height??1,ty:a}),[i,a,o]),[l,u,c]=Wg(s),d=g.useRef(r);d.current=r;const f=ev(null,p=>{p!==null&&t!==void 0?p.scrollTop=t:p!==null&&e!==void 0&&(p.scrollLeft=e)}),h=(l.height??1)>1;g.useLayoutEffect(()=>{if(t!==void 0&&f.current!==null&&h){if(f.current.scrollTop===t)return;f.current.scrollTop=t,f.current.scrollTop!==t&&c(),d.current()}},[t,h,c,f]);const m=(l.width??1)>1;return g.useLayoutEffect(()=>{if(e!==void 0&&f.current!==null&&m){if(f.current.scrollLeft===e)return;f.current.scrollLeft=e,f.current.scrollLeft!==e&&c(),d.current()}},[e,m,c,f]),{visibleRegion:l,setVisibleRegion:u,scrollRef:f}}const nv=g.lazy(async()=>await As(()=>import("./data-grid-overlay-editor.CXW3Vrt9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url));let rv=0;function iv(e){return up(Pl(Pl(e).filter(t=>t.span!==void 0).map(t=>{var n,i;return cr((((n=t.span)==null?void 0:n[0])??0)+1,(((i=t.span)==null?void 0:i[1])??0)+1)})))}function Xo(e,t){return e===void 0||t===0||e.columns.length===0&&e.current===void 0?e:{current:e.current===void 0?void 0:{cell:[e.current.cell[0]+t,e.current.cell[1]],range:{...e.current.range,x:e.current.range.x+t},rangeStack:e.current.rangeStack.map(n=>({...n,x:n.x+t}))},rows:e.rows,columns:e.columns.offset(t)}}const Go={kind:Z.Loading,allowOverlay:!1},jo={columns:yt.empty(),rows:yt.empty(),current:void 0},ov=(e,t)=>{var Tl,Dl,Ol;const[n,i]=g.useState(jo),[r,o]=g.useState(),a=g.useRef(null),s=g.useRef(null),[l,u]=g.useState(),c=g.useRef(),d=typeof window>"u"?null:window,{imageEditorOverride:f,getRowThemeOverride:h,markdownDivCreateNode:m,width:p,height:b,columns:w,rows:y,getCellContent:S,onCellClicked:M,onCellActivated:C,onFillPattern:x,onFinishedEditing:R,coercePasteValue:I,drawHeader:E,drawCell:H,editorBloom:z,onHeaderClicked:L,onColumnProposeMove:_,rangeSelectionColumnSpanning:O=!0,spanRangeBehavior:ne="default",onGroupHeaderClicked:q,onCellContextMenu:oe,className:Se,onHeaderContextMenu:xe,getCellsForSelection:re,onGroupHeaderContextMenu:J,onGroupHeaderRenamed:ee,onCellEdited:ie,onCellsEdited:ge,onSearchResultsChanged:fe,searchResults:G,onSearchValueChange:P,searchValue:k,onKeyDown:$,onKeyUp:le,keybindings:Te,editOnType:Be=!0,onRowAppended:ce,onColumnMoved:nt,validateCell:ke,highlightRegions:bt,rangeSelect:Et="rect",columnSelect:at="multi",rowSelect:te="multi",rangeSelectionBlending:it="exclusive",columnSelectionBlending:me="exclusive",rowSelectionBlending:se="exclusive",onDelete:he,onDragStart:$e,onMouseMove:Le,onPaste:Je,copyHeaders:de=!1,freezeColumns:be=0,cellActivationBehavior:Ge="second-click",rowSelectionMode:Ae="auto",onHeaderMenuClick:tt,onHeaderIndicatorClick:wt,getGroupDetails:gt,rowGrouping:He,onSearchClose:_t,onItemHovered:Xt,onSelectionCleared:Ot,showSearch:Ht,onVisibleRegionChanged:rn,gridSelection:zt,onGridSelectionChange:gn,minColumnWidth:$t=50,maxColumnWidth:It=500,maxColumnAutoWidth:In,provideEditor:bn,trailingRowOptions:Oe,freezeTrailingRows:Vt=0,allowedFillDirections:dn="orthogonal",scrollOffsetX:De,scrollOffsetY:lt,verticalBorder:ze,onDragOverCell:Lt,onDrop:vt,onColumnResize:on,onColumnResizeEnd:Tt,onColumnResizeStart:Ft,customRenderers:Ve,fillHandle:Pt,experimental:Gt,fixedShadowX:jt,fixedShadowY:Kt,headerIcons:An,imageWindowLoader:Vr,initialSize:ir,isDraggable:A,onDragLeave:rt,onRowMoved:Qe,overscrollX:Wt,overscrollY:Tn,preventDiagonalScrolling:wn,rightElement:Gn,rightElementProps:Dn,trapFocus:Qt=!1,smoothScrollX:Hn,smoothScrollY:jn,scaleToRem:La=!1,rowHeight:bo=34,headerHeight:wo=36,groupHeaderHeight:Fa=wo,theme:oi,isOutsideClick:Mr,renderers:Ii,resizeIndicator:Aa,scrollToActiveCell:Ti=!0,drawFocusRing:Di=!0}=e,Nr=Di==="no-editor"?r===void 0:Di,en=typeof e.rowMarkers=="string"?void 0:e.rowMarkers,kn=(en==null?void 0:en.kind)??e.rowMarkers??"none",Oi=(en==null?void 0:en.width)??e.rowMarkerWidth,Pi=(en==null?void 0:en.startIndex)??e.rowMarkerStartIndex??1,ai=(en==null?void 0:en.theme)??e.rowMarkerTheme,pr=en==null?void 0:en.headerTheme,vr=en==null?void 0:en.headerAlwaysVisible,si=te!=="multi",or=(en==null?void 0:en.checkboxStyle)??"square",ar=Math.max($t,20),Br=Math.max(It,ar),yo=Math.max(In??Br,ar),_i=g.useMemo(()=>typeof window>"u"?{fontSize:"16px"}:window.getComputedStyle(document.documentElement),[]),{rows:je,rowNumberMapper:Co,rowHeight:So,getRowThemeOverride:zn}=J0(He,y,bo,h),xo=g.useMemo(()=>Number.parseFloat(_i.fontSize),[_i]),{rowHeight:qn,headerHeight:Li,groupHeaderHeight:ko,theme:Mo,overscrollX:Ha,overscrollY:za}=q0({groupHeaderHeight:Fa,headerHeight:wo,overscrollX:Wt,overscrollY:Tn,remSize:xo,rowHeight:So,scaleToRem:La,theme:oi}),$n=K0(Te),Rr=Oi??(y>1e4?48:y>1e3?44:y>100?36:32),Vn=kn!=="none",B=Vn?1:0,Zt=ce!==void 0,Er=(Oe==null?void 0:Oe.sticky)===!0,[li,ui]=g.useState(!1),Fi=Ht??li,$a=g.useCallback(()=>{_t!==void 0?_t():ui(!1)},[_t]),U=g.useMemo(()=>zt===void 0?void 0:Xo(zt,B),[zt,B])??n,un=g.useRef();un.current===void 0&&(un.current=new AbortController),g.useEffect(()=>()=>un==null?void 0:un.current.abort(),[]);const[cn,Va]=_0(re,S,B,un.current,je),F=g.useCallback((v,D,T)=>{if(ke===void 0)return!0;const N=[v[0]-B,v[1]];return ke==null?void 0:ke(N,D,T)},[B,ke]),Q=g.useRef(zt),we=g.useCallback((v,D)=>{D&&(v=V0(v,cn,B,ne,un.current)),gn!==void 0?(Q.current=Xo(v,-B),gn(Q.current)):i(v)},[gn,cn,B,ne]),ye=Zr(on,g.useCallback((v,D,T,N)=>{on==null||on(w[T-B],D,T-B,N)},[on,B,w])),ue=Zr(Tt,g.useCallback((v,D,T,N)=>{Tt==null||Tt(w[T-B],D,T-B,N)},[Tt,B,w])),Me=Zr(Ft,g.useCallback((v,D,T,N)=>{Ft==null||Ft(w[T-B],D,T-B,N)},[Ft,B,w])),ot=Zr(E,g.useCallback((v,D)=>(E==null?void 0:E({...v,columnIndex:v.columnIndex-B},D))??!1,[E,B])),st=Zr(H,g.useCallback((v,D)=>(H==null?void 0:H({...v,col:v.col-B},D))??!1,[H,B])),Ee=g.useCallback(v=>{if(he!==void 0){const D=he(Xo(v,-B));return typeof D=="boolean"?D:Xo(D,B)}return!0},[he,B]),[kt,Ce,qe]=P0(U,we,it,me,se,Et,O),We=g.useMemo(()=>Sr(Gc(),Mo),[Mo]),[ft,ln]=g.useState([0,0,0]),Mn=g.useMemo(()=>{if(Ii===void 0)return{};const v={};for(const D of Ii)v[D.kind]=D;return v},[Ii]),St=g.useCallback(v=>v.kind!==Z.Custom?Mn[v.kind]:Ve==null?void 0:Ve.find(D=>D.isMatch(v)),[Ve,Mn]);let{sizedColumns:Jt,nonGrowWidth:Kn}=zm(w,je,Va,ft[0]-(B===0?0:Rr)-ft[2],ar,yo,We,St,un.current);kn!=="none"&&(Kn+=Rr);const yn=g.useMemo(()=>Jt.some(v=>v.group!==void 0),[Jt]),Dt=yn?Li+ko:Li,Rn=U.rows.length,On=kn==="none"?void 0:Rn===0?!1:Rn===je?!0:void 0,xt=g.useMemo(()=>kn==="none"?Jt:[{title:"",width:Rr,icon:void 0,hasMenu:!1,style:"normal",themeOverride:ai,rowMarker:or,rowMarkerChecked:On,headerRowMarkerTheme:pr,headerRowMarkerAlwaysVisible:vr,headerRowMarkerDisabled:si},...Jt],[kn,Jt,Rr,ai,or,On,pr,vr,si]),tn=g.useRef({height:1,width:1,x:0,y:0}),Ir=g.useRef(!1),{setVisibleRegion:Tr,visibleRegion:Wr,scrollRef:Ut}=tv(De,lt,qn,tn,()=>Ir.current=!0);tn.current=Wr;const tf=Wr.x+B,Ro=Wr.y,En=g.useRef(null),Cn=g.useCallback(v=>{var D;v===!0?(D=En.current)==null||D.focus():window.requestAnimationFrame(()=>{var T;(T=En.current)==null||T.focus()})},[]),mn=Zt?je+1:je,Nn=g.useCallback(v=>{const D=B===0?v:v.map(N=>({...N,location:[N.location[0]-B,N.location[1]]})),T=ge==null?void 0:ge(D);if(T!==!0)for(const N of D)ie==null||ie(N.location,N.value);return T},[ie,ge,B]),[Ur,Na]=g.useState(),Eo=U.current!==void 0&&U.current.range.width*U.current.range.height>1?U.current.range:void 0,ci=Nr?(Tl=U.current)==null?void 0:Tl.cell:void 0,Io=ci==null?void 0:ci[0],To=ci==null?void 0:ci[1],nf=g.useMemo(()=>{if((bt===void 0||bt.length===0)&&(Eo??Io??To??Ur)===void 0)return;const v=[];if(bt!==void 0)for(const D of bt){const T=xt.length-D.range.x-B;T>0&&v.push({color:D.color,range:{...D.range,x:D.range.x+B,width:Math.min(T,D.range.width)},style:D.style})}return Ur!==void 0&&v.push({color:ei(We.accentColor,0),range:Ur,style:"dashed"}),Eo!==void 0&&v.push({color:ei(We.accentColor,.5),range:Eo,style:"solid-outline"}),Io!==void 0&&To!==void 0&&v.push({color:We.accentColor,range:{x:Io,y:To,width:1,height:1},style:"solid-outline"}),v.length>0?v:void 0},[Ur,Eo,Io,To,bt,xt.length,We.accentColor,B]),ml=g.useRef(xt);ml.current=xt;const Pn=g.useCallback(([v,D],T=!1)=>{var X,W,Y,j,K,pe,Pe;const N=Zt&&D===mn-1;if(v===0&&Vn){if(N)return Go;const ve=Co(D);return ve===void 0?Go:{kind:Xn.Marker,allowOverlay:!1,checkboxStyle:or,checked:(U==null?void 0:U.rows.hasIndex(D))===!0,markerKind:kn==="clickable-number"?"number":kn,row:Pi+ve,drawHandle:Qe!==void 0,cursor:kn==="clickable-number"?"pointer":void 0}}else if(N){const Fe=v===B?(Oe==null?void 0:Oe.hint)??"":"",Ie=ml.current[v];if(((X=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:X.disabled)===!0)return Go;{const mt=((W=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:W.hint)??Fe,Ue=((Y=Ie==null?void 0:Ie.trailingRowOptions)==null?void 0:Y.addIcon)??(Oe==null?void 0:Oe.addIcon);return{kind:Xn.NewRow,hint:mt,allowOverlay:!1,icon:Ue}}}else{const ve=v-B;if(T||(Gt==null?void 0:Gt.strict)===!0){const Ie=tn.current,mt=Ie.x>ve||ve>Ie.x+Ie.width||Ie.y>D||D>Ie.y+Ie.height||D>=Wa.current,Ue=ve===((K=(j=Ie.extras)==null?void 0:j.selected)==null?void 0:K[0])&&D===((pe=Ie.extras)==null?void 0:pe.selected[1]);let _e=!1;if(((Pe=Ie.extras)==null?void 0:Pe.freezeRegions)!==void 0){for(const Mt of Ie.extras.freezeRegions)if(Qr(Mt,ve,D)){_e=!0;break}}if(mt&&!Ue&&!_e)return Go}let Fe=S([ve,D]);return B!==0&&Fe.span!==void 0&&(Fe={...Fe,span:[Fe.span[0]+B,Fe.span[1]+B]}),Fe}},[Zt,mn,Vn,Co,or,U==null?void 0:U.rows,kn,Pi,Qe,B,Oe==null?void 0:Oe.hint,Oe==null?void 0:Oe.addIcon,Gt==null?void 0:Gt.strict,S]),Ba=g.useCallback(v=>{let D=(gt==null?void 0:gt(v))??{name:v};return ee!==void 0&&v!==""&&(D={icon:D.icon,name:D.name,overrideTheme:D.overrideTheme,actions:[...D.actions??[],{title:"Rename",icon:"renameIcon",onClick:T=>Ya({group:D.name,bounds:T.bounds})}]}),D},[gt,ee]),Do=g.useCallback(v=>{var Y;const[D,T]=v.cell,N=xt[D],V=(N==null?void 0:N.group)!==void 0?(Y=Ba(N.group))==null?void 0:Y.overrideTheme:void 0,X=N==null?void 0:N.themeOverride,W=zn==null?void 0:zn(T);o({...v,theme:Sr(We,V,X,W,v.content.themeOverride)})},[zn,xt,Ba,We]),di=g.useCallback((v,D,T)=>{var W;if(U.current===void 0)return;const[N,V]=U.current.cell,X=Pn([N,V]);if(X.kind!==Z.Boolean&&X.allowOverlay){let Y=X;if(T!==void 0)switch(Y.kind){case Z.Number:{const j=wh(()=>T==="-"?-0:Number.parseFloat(T),0);Y={...Y,data:Number.isNaN(j)?0:j};break}case Z.Text:case Z.Markdown:case Z.Uri:Y={...Y,data:T};break}Do({target:v,content:Y,initialValue:T,cell:[N,V],highlight:T===void 0,forceEditMode:T!==void 0})}else X.kind===Z.Boolean&&D&&X.readonly!==!0&&(Nn([{location:U.current.cell,value:{...X,data:ld(X.data)}}]),(W=En.current)==null||W.damage([{cell:U.current.cell}]))},[Pn,U,Nn,Do]),pl=g.useCallback((v,D)=>{var V;const T=(V=En.current)==null?void 0:V.getBounds(v,D);if(T===void 0||Ut.current===null)return;const N=Pn([v,D]);N.allowOverlay&&Do({target:T,content:N,initialValue:void 0,highlight:!0,cell:[v,D],forceEditMode:!0})},[Pn,Ut,Do]),an=g.useCallback((v,D,T="both",N=0,V=0,X=void 0)=>{if(Ut.current!==null){const W=En.current,Y=s.current,j=typeof v!="number"?v.unit==="cell"?v.amount:void 0:v,K=typeof D!="number"?D.unit==="cell"?D.amount:void 0:D,pe=typeof v!="number"&&v.unit==="px"?v.amount:void 0,Pe=typeof D!="number"&&D.unit==="px"?D.amount:void 0;if(W!==null&&Y!==null){let ve={x:0,y:0,width:0,height:0},Fe=0,Ie=0;if((j!==void 0||K!==void 0)&&(ve=W.getBounds((j??0)+B,K??0)??ve,ve.width===0||ve.height===0))return;const mt=Y.getBoundingClientRect(),Ue=mt.width/Y.offsetWidth;if(pe!==void 0&&(ve={...ve,x:pe-mt.left-Ut.current.scrollLeft,width:1}),Pe!==void 0&&(ve={...ve,y:Pe+mt.top-Ut.current.scrollTop,height:1}),ve!==void 0){const _e={x:ve.x-N,y:ve.y-V,width:ve.width+2*N,height:ve.height+2*V};let Mt=0;for(let Ja=0;Ja<be;Ja++)Mt+=Jt[Ja].width;let qt=0;const sn=Vt+(Er?1:0);sn>0&&(qt=ri(mn,sn,qn));let Qn=Mt*Ue+mt.left+B*Rr*Ue,lr=mt.right,er=mt.top+Dt*Ue,ur=mt.bottom-qt*Ue;const Ho=ve.width+N*2;switch(X==null?void 0:X.hAlign){case"start":lr=Qn+Ho;break;case"end":Qn=lr-Ho;break;case"center":Qn=Math.floor((Qn+lr)/2)-Ho/2,lr=Qn+Ho;break}const zo=ve.height+V*2;switch(X==null?void 0:X.vAlign){case"start":ur=er+zo;break;case"end":er=ur-zo;break;case"center":er=Math.floor((er+ur)/2)-zo/2,ur=er+zo;break}Qn>_e.x?Fe=_e.x-Qn:lr<_e.x+_e.width&&(Fe=_e.x+_e.width-lr),er>_e.y?Ie=_e.y-er:ur<_e.y+_e.height&&(Ie=_e.y+_e.height-ur),T==="vertical"||typeof v=="number"&&v<be?Fe=0:(T==="horizontal"||typeof D=="number"&&D>=mn-sn)&&(Ie=0),(Fe!==0||Ie!==0)&&(Ue!==1&&(Fe/=Ue,Ie/=Ue),Ut.current.scrollTo(Fe+Ut.current.scrollLeft,Ie+Ut.current.scrollTop))}}}},[B,Vt,Rr,Ut,Dt,be,Jt,mn,Er,qn]),vl=g.useRef(pl),bl=g.useRef(S),Wa=g.useRef(je);vl.current=pl,bl.current=S,Wa.current=je;const fi=g.useCallback(async(v,D=!0)=>{var j;const T=xt[v];if(((j=T==null?void 0:T.trailingRowOptions)==null?void 0:j.disabled)===!0)return;const N=ce==null?void 0:ce();let V,X=!0;N!==void 0&&(V=await N,V==="top"&&(X=!1),typeof V=="number"&&(X=!1));let W=0;const Y=()=>{if(Wa.current<=je){W<500&&window.setTimeout(Y,W),W=50+W*2;return}const K=typeof V=="number"?V:X?je:0;Ao.current(v-B,K),kt({cell:[v,K],range:{x:v,y:K,width:1,height:1}},!1,!1,"edit");const pe=bl.current([v-B,K]);pe.allowOverlay&&Ki(pe)&&pe.readonly!==!0&&D&&window.setTimeout(()=>{vl.current(v,K)},0)};Y()},[xt,ce,B,je,kt]),Oo=g.useCallback(v=>{var T,N;const D=((N=(T=Jt[v])==null?void 0:T.trailingRowOptions)==null?void 0:N.targetColumn)??(Oe==null?void 0:Oe.targetColumn);if(typeof D=="number")return D+(Vn?1:0);if(typeof D=="object"){const V=w.indexOf(D);if(V>=0)return V+(Vn?1:0)}},[Jt,w,Vn,Oe==null?void 0:Oe.targetColumn]),Dr=g.useRef(),hi=g.useRef(),Hi=g.useCallback((v,D)=>{var V;const[T,N]=D;return Sr(We,(V=xt[T])==null?void 0:V.themeOverride,zn==null?void 0:zn(N),v.themeOverride)},[zn,xt,We]),{mapper:Yr}=Q0(He,y),Zn=He==null?void 0:He.navigationBehavior,zi=g.useCallback(v=>{var pe,Pe,ve;const D=ma.value?v.metaKey:v.ctrlKey,T=D&&te==="multi",N=D&&at==="multi",[V,X]=v.location,W=U.columns,Y=U.rows,[j,K]=((pe=U.current)==null?void 0:pe.cell)??[];if(v.kind==="cell"){if(hi.current=void 0,Xr.current=[V,X],V===0&&Vn){if(Zt===!0&&X===je||kn==="number"||te==="none")return;const Fe=Pn(v.location);if(Fe.kind!==Xn.Marker)return;if(Qe!==void 0){const Ue=St(Fe);_n((Ue==null?void 0:Ue.kind)===Xn.Marker);const _e=(Pe=Ue==null?void 0:Ue.onClick)==null?void 0:Pe.call(Ue,{...v,cell:Fe,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,theme:Hi(Fe,v.location),preventDefault:()=>{}});if(_e===void 0||_e.checked===Fe.checked)return}o(void 0),Cn();const Ie=Y.hasIndex(X),mt=Dr.current;if(te==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&mt!==void 0&&Y.hasIndex(mt)){const Ue=[Math.min(mt,X),Math.max(mt,X)+1];T||Ae==="multi"?Ce(void 0,Ue,!0):Ce(yt.fromSingleSelection(Ue),void 0,T)}else te==="multi"&&(T||v.isTouch||Ae==="multi")?Ie?Ce(Y.remove(X),void 0,!0):(Ce(void 0,X,!0),Dr.current=X):Ie&&Y.length===1?Ce(yt.empty(),void 0,D):(Ce(yt.fromSingleSelection(X),void 0,D),Dr.current=X)}else if(V>=B&&Zt&&X===je){const Fe=Oo(V);fi(Fe??V)}else if(j!==V||K!==X){const Fe=Pn(v.location),Ie=St(Fe);if((Ie==null?void 0:Ie.onSelect)!==void 0){let _e=!1;if(Ie.onSelect({...v,cell:Fe,posX:v.localEventX,posY:v.localEventY,bounds:v.bounds,preventDefault:()=>_e=!0,theme:Hi(Fe,v.location)}),_e)return}if(Zn==="block"&&Yr(X).isGroupHeader)return;const mt=Er&&X===je,Ue=Er&&U!==void 0&&((ve=U.current)==null?void 0:ve.cell[1])===je;if((v.shiftKey||v.isLongTouch===!0)&&j!==void 0&&K!==void 0&&U.current!==void 0&&!Ue){if(mt)return;const _e=Math.min(V,j),Mt=Math.max(V,j),qt=Math.min(X,K),sn=Math.max(X,K);kt({...U.current,range:{x:_e,y:qt,width:Mt-_e+1,height:sn-qt+1}},!0,D,"click"),Dr.current=void 0,Cn()}else kt({cell:[V,X],range:{x:V,y:X,width:1,height:1}},!0,D,"click"),Dr.current=void 0,o(void 0),Cn()}}else if(v.kind==="header")if(Xr.current=[V,X],o(void 0),Vn&&V===0)Dr.current=void 0,hi.current=void 0,te==="multi"&&(Y.length!==je?Ce(yt.fromSingleSelection([0,je]),void 0,D):Ce(yt.empty(),void 0,D),Cn());else{const Fe=hi.current;if(at==="multi"&&(v.shiftKey||v.isLongTouch===!0)&&Fe!==void 0&&W.hasIndex(Fe)){const Ie=[Math.min(Fe,V),Math.max(Fe,V)+1];N?qe(void 0,Ie,D):qe(yt.fromSingleSelection(Ie),void 0,D)}else N?(W.hasIndex(V)?qe(W.remove(V),void 0,D):qe(void 0,V,D),hi.current=V):at!=="none"&&(qe(yt.fromSingleSelection(V),void 0,D),hi.current=V);Dr.current=void 0,Cn()}else v.kind===Yn?Xr.current=[V,X]:v.kind===pa&&!v.isMaybeScrollbar&&(we(jo,!1),o(void 0),Cn(),Ot==null||Ot(),Dr.current=void 0,hi.current=void 0)},[te,at,U,Vn,B,Zt,je,kn,Pn,Qe,Cn,Ae,St,Hi,Ce,Oo,fi,Zn,Yr,Er,kt,qe,we,Ot]),$i=g.useRef(!1),Xr=g.useRef(),wl=g.useRef(Wr),Bn=g.useRef(),rf=g.useCallback(v=>{if(gi.current=!1,wl.current=tn.current,v.button!==0&&v.button!==1){Bn.current=void 0;return}const D=performance.now();Bn.current={button:v.button,time:D,location:v.location},(v==null?void 0:v.kind)==="header"&&($i.current=!0);const T=v.kind==="cell"&&v.isFillHandle;!T&&v.kind!=="cell"&&v.isEdge||(u({previousSelection:U,fillHandle:T}),Xr.current=void 0,!v.isTouch&&v.button===0&&!T?zi(v):!v.isTouch&&v.button===1&&(Xr.current=v.location))},[U,zi]),[Ua,Ya]=g.useState(),yl=g.useCallback(v=>{if(v.kind!==Yn||at!=="multi")return;const D=ma.value?v.metaKey:v.ctrlKey,[T]=v.location,N=U.columns;if(T<B)return;const V=xt[T];let X=T,W=T;for(let Y=T-1;Y>=B&&so(V.group,xt[Y].group);Y--)X--;for(let Y=T+1;Y<xt.length&&so(V.group,xt[Y].group);Y++)W++;if(Cn(),D)if(N.hasAll([X,W+1])){let Y=N;for(let j=X;j<=W;j++)Y=Y.remove(j);qe(Y,void 0,D)}else qe(void 0,[X,W+1],D);else qe(yt.fromSingleSelection([X,W+1]),void 0,D)},[at,Cn,U.columns,xt,B,qe]),gi=g.useRef(!1),Po=g.useCallback(async v=>{if(cn!==void 0&&ye!==void 0){const D=tn.current.y,T=tn.current.height;let N=cn({x:v,y:D,width:1,height:Math.min(T,je-D)},un.current.signal);typeof N!="object"&&(N=await N());const V=Jt[v-B],W=document.createElement("canvas").getContext("2d",{alpha:!1});if(W!==null){W.font=We.baseFontFull;const Y=qc(W,We,V,0,N,ar,Br,!1,St);ye==null||ye(V,Y.width,v,Y.width)}}},[Jt,cn,Br,We,ar,ye,B,je,St]),[of,Xa]=g.useState(),mi=g.useCallback(async(v,D)=>{var Y,j;const T=(Y=v.current)==null?void 0:Y.range;if(T===void 0||cn===void 0||D.current===void 0)return;const N=D.current.range;if(x!==void 0){let K=!1;if(x({fillDestination:{...N,x:N.x-B},patternSource:{...T,x:T.x-B},preventDefault:()=>K=!0}),K)return}let V=cn(T,un.current.signal);typeof V!="object"&&(V=await V());const X=V,W=[];for(let K=0;K<N.width;K++)for(let pe=0;pe<N.height;pe++){const Pe=[N.x+K,N.y+pe];if(Ac(Pe,T))continue;const ve=X[pe%T.height][K%T.width];wi(ve)||!Ki(ve)||W.push({location:Pe,value:{...ve}})}Nn(W),(j=En.current)==null||j.damage(W.map(K=>({cell:K.location})))},[cn,Nn,x,B]),Cl=g.useCallback(()=>{if(U.current===void 0||U.current.range.width<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,width:1}}};mi(v,U)},[mi,U]),Sl=g.useCallback(()=>{if(U.current===void 0||U.current.range.height<=1)return;const v={...U,current:{...U.current,range:{...U.current.range,height:1}}};mi(v,U)},[mi,U]),af=g.useCallback((v,D)=>{var pe,Pe;const T=l;if(u(void 0),Na(void 0),Xa(void 0),$i.current=!1,D)return;if((T==null?void 0:T.fillHandle)===!0&&U.current!==void 0&&((pe=T.previousSelection)==null?void 0:pe.current)!==void 0){if(Ur===void 0)return;const ve={...U,current:{...U.current,range:ed(T.previousSelection.current.range,Ur)}};mi(T.previousSelection,ve),we(ve,!0);return}const[N,V]=v.location,[X,W]=Xr.current??[],Y=()=>{gi.current=!0},j=ve=>{var Ie,mt,Ue;const Fe=ve.isTouch||X===N&&W===V;if(Fe&&(M==null||M([N-B,V],{...ve,preventDefault:Y})),ve.button===1)return!gi.current;if(!gi.current){const _e=Pn(v.location),Mt=St(_e);if(Mt!==void 0&&Mt.onClick!==void 0&&Fe){const sn=Mt.onClick({...ve,cell:_e,posX:ve.localEventX,posY:ve.localEventY,bounds:ve.bounds,theme:Hi(_e,v.location),preventDefault:Y});sn!==void 0&&!wi(sn)&&vi(sn)&&(Nn([{location:ve.location,value:sn}]),(Ie=En.current)==null||Ie.damage([{cell:ve.location}]))}if(gi.current||U.current===void 0)return!1;let qt=!1;switch(_e.activationBehaviorOverride??Ge){case"double-click":case"second-click":{if(((Ue=(mt=T==null?void 0:T.previousSelection)==null?void 0:mt.current)==null?void 0:Ue.cell)===void 0)break;const[sn,Qn]=U.current.cell,[lr,er]=T.previousSelection.current.cell;qt=N===sn&&N===lr&&V===Qn&&V===er&&(ve.isDoubleClick===!0||Ge==="second-click");break}case"single-click":{qt=!0;break}}if(qt)return C==null||C([N-B,V]),di(ve.bounds,!1),!0}return!1},K=v.location[0]-B;if(v.isTouch){const ve=tn.current,Fe=wl.current;if(ve.x!==Fe.x||ve.y!==Fe.y)return;if(v.isLongTouch===!0){if(v.kind==="cell"&&no((Pe=U.current)==null?void 0:Pe.cell,v.location)){oe==null||oe([K,v.location[1]],{...v,preventDefault:Y});return}else if(v.kind==="header"&&U.columns.hasIndex(N)){xe==null||xe(K,{...v,preventDefault:Y});return}else if(v.kind===Yn){if(K<0)return;J==null||J(K,{...v,preventDefault:Y});return}}v.kind==="cell"?j(v)||zi(v):v.kind===Yn?q==null||q(K,{...v,preventDefault:Y}):(v.kind===Ar&&(L==null||L(K,{...v,preventDefault:Y})),zi(v));return}if(v.kind==="header"){if(K<0)return;v.isEdge?v.isDoubleClick===!0&&Po(N):v.button===0&&N===X&&V===W&&(L==null||L(K,{...v,preventDefault:Y}))}if(v.kind===Yn){if(K<0)return;v.button===0&&N===X&&V===W&&(q==null||q(K,{...v,preventDefault:Y}),gi.current||yl(v))}v.kind==="cell"&&(v.button===0||v.button===1)&&j(v),Xr.current=void 0},[l,U,B,Ur,mi,we,M,Pn,St,Ge,Hi,Nn,C,di,oe,xe,J,zi,q,L,Po,yl]),sf=g.useCallback(v=>{const D={...v,location:[v.location[0]-B,v.location[1]]};Le==null||Le(D),l!==void 0&&v.buttons===0&&(u(void 0),Na(void 0),Xa(void 0),$i.current=!1),Xa(T=>{var N;return $i.current?[v.scrollEdge[0],0]:v.scrollEdge[0]===(T==null?void 0:T[0])&&v.scrollEdge[1]===T[1]?T:l===void 0||(((N=Bn.current)==null?void 0:N.location[0])??0)<B?void 0:v.scrollEdge})},[l,Le,B]),lf=g.useCallback((v,D)=>{tt==null||tt(v-B,D)},[tt,B]),uf=g.useCallback((v,D)=>{wt==null||wt(v-B,D)},[wt,B]),sr=(Dl=U==null?void 0:U.current)==null?void 0:Dl.cell,cf=g.useCallback((v,D,T,N,V,X)=>{Ir.current=!1;let W=sr;W!==void 0&&(W=[W[0]-B,W[1]]);const Y=be===0?void 0:{x:0,y:v.y,width:be,height:v.height},j=[];Y!==void 0&&j.push(Y),Vt>0&&(j.push({x:v.x-B,y:je-Vt,width:v.width,height:Vt}),be>0&&j.push({x:0,y:je-Vt,width:be,height:Vt}));const K={x:v.x-B,y:v.y,width:v.width,height:Zt&&v.y+v.height>=je?v.height-1:v.height,tx:V,ty:X,extras:{selected:W,freezeRegion:Y,freezeRegions:j}};tn.current=K,Tr(K),ln([D,T,N]),rn==null||rn(K,K.tx,K.ty,K.extras)},[sr,B,Zt,je,be,Vt,Tr,rn]),df=Zr(nt,g.useCallback((v,D)=>{nt==null||nt(v-B,D-B),at!=="none"&&qe(yt.fromSingleSelection(D),void 0,!0)},[at,nt,B,qe])),Ga=g.useRef(!1),ff=g.useCallback(v=>{if(v.location[0]===0&&B>0){v.preventDefault();return}$e==null||$e({...v,location:[v.location[0]-B,v.location[1]]}),v.defaultPrevented()||(Ga.current=!0),u(void 0)},[$e,B]),hf=g.useCallback(()=>{Ga.current=!1},[]),xl=He==null?void 0:He.selectionBehavior,_o=g.useCallback(v=>{if(xl!=="block-spanning")return;const{isGroupHeader:D,path:T,groupRows:N}=Yr(v);if(D)return[v,v];const V=T[T.length-1],X=v-V,W=v+N-V-1;return[X,W]},[Yr,xl]),ja=g.useRef(),qa=g.useCallback(v=>{var D,T,N;if(!ad(v,ja.current)&&(ja.current=v,!(((D=Bn==null?void 0:Bn.current)==null?void 0:D.button)!==void 0&&Bn.current.button>=1))){if(v.buttons!==0&&l!==void 0&&((T=Bn.current)==null?void 0:T.location[0])===0&&v.location[0]===0&&B===1&&te==="multi"&&l.previousSelection&&!l.previousSelection.rows.hasIndex(Bn.current.location[1])&&U.rows.hasIndex(Bn.current.location[1])){const V=Math.min(Bn.current.location[1],v.location[1]),X=Math.max(Bn.current.location[1],v.location[1])+1;Ce(yt.fromSingleSelection([V,X]),void 0,!1)}if(v.buttons!==0&&l!==void 0&&U.current!==void 0&&!Ga.current&&!$i.current&&(Et==="rect"||Et==="multi-rect")){const[V,X]=U.current.cell;let[W,Y]=v.location;if(Y<0&&(Y=tn.current.y),l.fillHandle===!0&&((N=l.previousSelection)==null?void 0:N.current)!==void 0){const j=l.previousSelection.current.range;Y=Math.min(Y,Zt?je-1:je);const K=Np(j,W,Y,dn);Na(K)}else{if(Zt&&X===je)return;if(Zt&&Y===je)if(v.kind===pa)Y--;else return;W=Math.max(W,B);const pe=_o(X);Y=pe===void 0?Y:Wn(Y,pe[0],pe[1]);const Pe=W-V,ve=Y-X,Fe={x:Pe>=0?V:W,y:ve>=0?X:Y,width:Math.abs(Pe)+1,height:Math.abs(ve)+1};kt({...U.current,range:Fe},!0,!1,"drag")}}Xt==null||Xt({...v,location:[v.location[0]-B,v.location[1]]})}},[l,B,te,U,Et,Xt,Ce,Zt,je,dn,_o,kt]),gf=g.useCallback(()=>{var W,Y;const v=ja.current;if(v===void 0)return;const[D,T]=v.scrollEdge;let[N,V]=v.location;const X=tn.current;D===-1?N=((Y=(W=X.extras)==null?void 0:W.freezeRegion)==null?void 0:Y.x)??X.x:D===1&&(N=X.x+X.width),T===-1?V=Math.max(0,X.y):T===1&&(V=Math.min(je-1,X.y+X.height)),N=Wn(N,0,xt.length-1),V=Wn(V,0,je-1),qa({...v,location:[N,V]})},[xt.length,qa,je]);j0(of,Ut,gf);const Jn=g.useCallback(v=>{if(U.current===void 0)return;const[D,T]=v,[N,V]=U.current.cell,X=U.current.range;let W=X.x,Y=X.x+X.width,j=X.y,K=X.y+X.height;const[pe,Pe]=_o(V)??[0,je-1],ve=Pe+1;if(T!==0)switch(T){case 2:{K=ve,j=V,an(0,K,"vertical");break}case-2:{j=pe,K=V+1,an(0,j,"vertical");break}case 1:{j<V?(j++,an(0,j,"vertical")):(K=Math.min(ve,K+1),an(0,K,"vertical"));break}case-1:{K>V+1?(K--,an(0,K,"vertical")):(j=Math.max(pe,j-1),an(0,j,"vertical"));break}default:ao()}if(D!==0)if(D===2)Y=xt.length,W=N,an(Y-1-B,0,"horizontal");else if(D===-2)W=B,Y=N+1,an(W-B,0,"horizontal");else{let Fe=[];if(cn!==void 0){const Ie=cn({x:W,y:j,width:Y-W-B,height:K-j},un.current.signal);typeof Ie=="object"&&(Fe=iv(Ie))}if(D===1){let Ie=!1;if(W<N){if(Fe.length>0){const mt=cr(W+1,N+1).find(Ue=>!Fe.includes(Ue-B));mt!==void 0&&(W=mt,Ie=!0)}else W++,Ie=!0;Ie&&an(W,0,"horizontal")}Ie||(Y=Math.min(xt.length,Y+1),an(Y-1-B,0,"horizontal"))}else if(D===-1){let Ie=!1;if(Y>N+1){if(Fe.length>0){const mt=cr(Y-1,N,-1).find(Ue=>!Fe.includes(Ue-B));mt!==void 0&&(Y=mt,Ie=!0)}else Y--,Ie=!0;Ie&&an(Y-B,0,"horizontal")}Ie||(W=Math.max(B,W-1),an(W-B,0,"horizontal"))}else ao()}kt({cell:U.current.cell,range:{x:W,y:j,width:Y-W,height:K-j}},!0,!1,"keyboard-select")},[cn,_o,U,xt.length,B,je,an,kt]),Ka=g.useRef(Ti);Ka.current=Ti;const Or=g.useCallback((v,D,T,N)=>{const V=mn-(T?0:1);v=Wn(v,B,Jt.length-1+B),D=Wn(D,0,V);const X=sr==null?void 0:sr[0],W=sr==null?void 0:sr[1];if(v===X&&D===W)return!1;if(N&&U.current!==void 0){const Y=[...U.current.rangeStack];(U.current.range.width>1||U.current.range.height>1)&&Y.push(U.current.range),we({...U,current:{cell:[v,D],range:{x:v,y:D,width:1,height:1},rangeStack:Y}},!0)}else kt({cell:[v,D],range:{x:v,y:D,width:1,height:1}},!0,!1,"keyboard-nav");return c.current!==void 0&&c.current[0]===v&&c.current[1]===D&&(c.current=void 0),Ka.current&&an(v-B,D),!0},[mn,B,Jt.length,sr,U,an,we,kt]),mf=g.useCallback((v,D)=>{(r==null?void 0:r.cell)!==void 0&&v!==void 0&&vi(v)&&(Nn([{location:r.cell,value:v}]),window.requestAnimationFrame(()=>{var V;(V=En.current)==null||V.damage([{cell:r.cell}])})),Cn(!0),o(void 0);const[T,N]=D;if(U.current!==void 0&&(T!==0||N!==0)){const V=U.current.cell[1]===mn-1&&v!==void 0;Or(Wn(U.current.cell[0]+T,0,xt.length-1),Wn(U.current.cell[1]+N,0,mn-1),V,!1)}R==null||R(v,D)},[r==null?void 0:r.cell,Cn,U,R,Nn,mn,Or,xt.length]),pf=g.useMemo(()=>`gdg-overlay-${rv++}`,[]),Gr=g.useCallback(v=>{var T,N,V,X;Cn();const D=[];for(let W=v.x;W<v.x+v.width;W++)for(let Y=v.y;Y<v.y+v.height;Y++){const j=S([W-B,Y]);if(!j.allowOverlay&&j.kind!==Z.Boolean)continue;let K;if(j.kind===Z.Custom){const pe=St(j),Pe=(T=pe==null?void 0:pe.provideEditor)==null?void 0:T.call(pe,j);(pe==null?void 0:pe.onDelete)!==void 0?K=pe.onDelete(j):Th(Pe)&&(K=(N=Pe==null?void 0:Pe.deletedValue)==null?void 0:N.call(Pe,j))}else if(vi(j)&&j.allowOverlay||j.kind===Z.Boolean){const pe=St(j);K=(V=pe==null?void 0:pe.onDelete)==null?void 0:V.call(pe,j)}K!==void 0&&!wi(K)&&vi(K)&&D.push({location:[W,Y],value:K})}Nn(D),(X=En.current)==null||X.damage(D.map(W=>({cell:W.location})))},[Cn,S,St,Nn,B]),Vi=r!==void 0,kl=g.useCallback(v=>{var mt,Ue;const D=()=>{v.stopPropagation(),v.preventDefault()},T={didMatch:!1},{bounds:N}=v,V=U.columns,X=U.rows,W=$n;if(!Vi&&ut(W.clear,v,T))we(jo,!1),Ot==null||Ot();else if(!Vi&&ut(W.selectAll,v,T))we({columns:yt.empty(),rows:yt.empty(),current:{cell:((mt=U.current)==null?void 0:mt.cell)??[B,0],range:{x:B,y:0,width:w.length,height:je},rangeStack:[]}},!1);else if(ut(W.search,v,T))(Ue=a==null?void 0:a.current)==null||Ue.focus({preventScroll:!0}),ui(!0);else if(ut(W.delete,v,T)){const _e=(Ee==null?void 0:Ee(U))??!0;if(_e!==!1){const Mt=_e===!0?U:_e;if(Mt.current!==void 0){Gr(Mt.current.range);for(const qt of Mt.current.rangeStack)Gr(qt)}for(const qt of Mt.rows)Gr({x:B,y:qt,width:w.length,height:1});for(const qt of Mt.columns)Gr({x:qt,y:0,width:1,height:je})}}if(T.didMatch)return D(),!0;if(U.current===void 0)return!1;let[Y,j]=U.current.cell;const[,K]=U.current.cell;let pe=!1,Pe=!1;if(ut(W.scrollToSelectedCell,v,T)?Ao.current(Y-B,j):at!=="none"&&ut(W.selectColumn,v,T)?V.hasIndex(Y)?qe(V.remove(Y),void 0,!0):at==="single"?qe(yt.fromSingleSelection(Y),void 0,!0):qe(void 0,Y,!0):te!=="none"&&ut(W.selectRow,v,T)?X.hasIndex(j)?Ce(X.remove(j),void 0,!0):te==="single"?Ce(yt.fromSingleSelection(j),void 0,!0):Ce(void 0,j,!0):!Vi&&N!==void 0&&ut(W.activateCell,v,T)?j===je&&Zt?window.setTimeout(()=>{const _e=Oo(Y);fi(_e??Y)},0):(C==null||C([Y-B,j]),di(N,!0)):U.current.range.height>1&&ut(W.downFill,v,T)?Sl():U.current.range.width>1&&ut(W.rightFill,v,T)?Cl():ut(W.goToNextPage,v,T)?j+=Math.max(1,tn.current.height-4):ut(W.goToPreviousPage,v,T)?j-=Math.max(1,tn.current.height-4):ut(W.goToFirstCell,v,T)?(o(void 0),j=0,Y=0):ut(W.goToLastCell,v,T)?(o(void 0),j=Number.MAX_SAFE_INTEGER,Y=Number.MAX_SAFE_INTEGER):ut(W.selectToFirstCell,v,T)?(o(void 0),Jn([-2,-2])):ut(W.selectToLastCell,v,T)?(o(void 0),Jn([2,2])):Vi?(ut(W.closeOverlay,v,T)&&o(void 0),ut(W.acceptOverlayDown,v,T)&&(o(void 0),j++),ut(W.acceptOverlayUp,v,T)&&(o(void 0),j--),ut(W.acceptOverlayLeft,v,T)&&(o(void 0),Y--),ut(W.acceptOverlayRight,v,T)&&(o(void 0),Y++)):(ut(W.goDownCell,v,T)?j+=1:ut(W.goUpCell,v,T)?j-=1:ut(W.goRightCell,v,T)?Y+=1:ut(W.goLeftCell,v,T)?Y-=1:ut(W.goDownCellRetainSelection,v,T)?(j+=1,pe=!0):ut(W.goUpCellRetainSelection,v,T)?(j-=1,pe=!0):ut(W.goRightCellRetainSelection,v,T)?(Y+=1,pe=!0):ut(W.goLeftCellRetainSelection,v,T)?(Y-=1,pe=!0):ut(W.goToLastRow,v,T)?j=je-1:ut(W.goToFirstRow,v,T)?j=Number.MIN_SAFE_INTEGER:ut(W.goToLastColumn,v,T)?Y=Number.MAX_SAFE_INTEGER:ut(W.goToFirstColumn,v,T)?Y=Number.MIN_SAFE_INTEGER:(Et==="rect"||Et==="multi-rect")&&(ut(W.selectGrowDown,v,T)?Jn([0,1]):ut(W.selectGrowUp,v,T)?Jn([0,-1]):ut(W.selectGrowRight,v,T)?Jn([1,0]):ut(W.selectGrowLeft,v,T)?Jn([-1,0]):ut(W.selectToLastRow,v,T)?Jn([0,2]):ut(W.selectToFirstRow,v,T)?Jn([0,-2]):ut(W.selectToLastColumn,v,T)?Jn([2,0]):ut(W.selectToFirstColumn,v,T)&&Jn([-2,0])),Pe=T.didMatch),Zn!==void 0&&Zn!=="normal"&&j!==K){const _e=Zn==="skip-up"||Zn==="skip"||Zn==="block",Mt=Zn==="skip-down"||Zn==="skip"||Zn==="block",qt=j<K;if(qt&&_e){for(;j>=0&&Yr(j).isGroupHeader;)j--;j<0&&(j=K)}else if(!qt&&Mt){for(;j<je&&Yr(j).isGroupHeader;)j++;j>=je&&(j=K)}}const Fe=Or(Y,j,!1,pe),Ie=T.didMatch;return Ie&&(Fe||!Pe||Qt)&&D(),Ie},[Zn,Vi,U,$n,at,te,Et,B,Yr,je,Or,we,Ot,w.length,Ee,Qt,Gr,qe,Ce,Zt,Oo,fi,C,di,Sl,Cl,Jn]),Ni=g.useCallback(v=>{let D=!1;if($!==void 0&&$({...v,cancel:()=>{D=!0}}),D||kl(v)||U.current===void 0)return;const[T,N]=U.current.cell,V=tn.current;if(Be&&!v.metaKey&&!v.ctrlKey&&U.current!==void 0&&v.key.length===1&&/[ -~]/g.test(v.key)&&v.bounds!==void 0&&Ki(S([T-B,Math.max(0,Math.min(N,je-1))]))){if((!Zt||N!==je)&&(V.y>N||N>V.y+V.height||V.x>T||T>V.x+V.width))return;di(v.bounds,!0,v.key),v.stopPropagation(),v.preventDefault()}},[Be,$,kl,U,S,B,je,Zt,di]),vf=g.useCallback((v,D)=>{const T=v.location[0]-B;if(v.kind==="header"&&(xe==null||xe(T,{...v,preventDefault:D})),v.kind===Yn){if(T<0)return;J==null||J(T,{...v,preventDefault:D})}if(v.kind==="cell"){const[N,V]=v.location;oe==null||oe([T,V],{...v,preventDefault:D}),Cm(U,v.location)||Or(N,V,!1,!1)}},[U,oe,J,xe,B,Or]),Za=g.useCallback(async v=>{var W,Y,j;if(!$n.paste)return;function D(K,pe,Pe,ve){var Ie,mt;const Fe=typeof Pe=="object"?(Pe==null?void 0:Pe.join(`
173
- `))??"":(Pe==null?void 0:Pe.toString())??"";if(!wi(K)&&Ki(K)&&K.readonly!==!0){const Ue=I==null?void 0:I(Fe,K);if(Ue!==void 0&&vi(Ue))return{location:pe,value:Ue};const _e=St(K);if(_e===void 0)return;if(_e.kind===Z.Custom){_n(K.kind===Z.Custom);const Mt=(Ie=_e.onPaste)==null?void 0:Ie.call(_e,Fe,K.data);return Mt===void 0?void 0:{location:pe,value:{...K,data:Mt}}}else{const Mt=(mt=_e.onPaste)==null?void 0:mt.call(_e,Fe,K,{formatted:ve,formattedString:typeof ve=="string"?ve:ve==null?void 0:ve.join(`
174
- `),rawValue:Pe});return Mt===void 0?void 0:(_n(Mt.kind===K.kind),{location:pe,value:Mt})}}}const T=U.columns,N=U.rows,V=((W=Ut.current)==null?void 0:W.contains(document.activeElement))===!0||((Y=s.current)==null?void 0:Y.contains(document.activeElement))===!0;let X;if(U.current!==void 0?X=[U.current.range.x,U.current.range.y]:T.length===1?X=[T.first()??0,0]:N.length===1&&(X=[B,N.first()??0]),V&&X!==void 0){let K,pe;const Pe="text/plain",ve="text/html";if(navigator.clipboard.read!==void 0){const Ue=await navigator.clipboard.read();for(const _e of Ue){if(_e.types.includes(ve)){const qt=await(await _e.getType(ve)).text(),sn=gu(qt);if(sn!==void 0){K=sn;break}}_e.types.includes(Pe)&&(pe=await(await _e.getType(Pe)).text())}}else if(navigator.clipboard.readText!==void 0)pe=await navigator.clipboard.readText();else if(v!==void 0&&(v==null?void 0:v.clipboardData)!==null){if(v.clipboardData.types.includes(ve)){const Ue=v.clipboardData.getData(ve);K=gu(Ue)}K===void 0&&v.clipboardData.types.includes(Pe)&&(pe=v.clipboardData.getData(Pe))}else return;const[Fe,Ie]=X,mt=[];do{if(Je===void 0){const Ue=Pn(X),_e=pe??(K==null?void 0:K.map(qt=>qt.map(sn=>sn.rawValue).join(" ")).join(" "))??"",Mt=D(Ue,X,_e,void 0);Mt!==void 0&&mt.push(Mt);break}if(K===void 0){if(pe===void 0)return;K=N0(pe)}if(Je===!1||typeof Je=="function"&&(Je==null?void 0:Je([X[0]-B,X[1]],K.map(Ue=>Ue.map(_e=>{var Mt;return((Mt=_e.rawValue)==null?void 0:Mt.toString())??""}))))!==!0)return;for(const[Ue,_e]of K.entries()){if(Ue+Ie>=je)break;for(const[Mt,qt]of _e.entries()){const sn=[Mt+Fe,Ue+Ie],[Qn,lr]=sn;if(Qn>=xt.length||lr>=mn)continue;const er=Pn(sn),ur=D(er,sn,qt.rawValue,qt.formatted);ur!==void 0&&mt.push(ur)}}}while(!1);Nn(mt),(j=En.current)==null||j.damage(mt.map(Ue=>({cell:Ue.location})))}},[I,St,Pn,U,$n.paste,Ut,xt.length,Nn,mn,Je,B,je]);fn("paste",Za,d,!1,!0);const Bi=g.useCallback(async(v,D)=>{var W,Y;if(!$n.copy)return;const T=D===!0||((W=Ut.current)==null?void 0:W.contains(document.activeElement))===!0||((Y=s.current)==null?void 0:Y.contains(document.activeElement))===!0,N=U.columns,V=U.rows,X=(j,K)=>{if(!de)pu(j,K,v);else{const pe=K.map(Pe=>({kind:Z.Text,data:w[Pe].title,displayData:w[Pe].title,allowOverlay:!1}));pu([pe,...j],K,v)}};if(T&&cn!==void 0){if(U.current!==void 0){let j=cn(U.current.range,un.current.signal);typeof j!="object"&&(j=await j()),X(j,cr(U.current.range.x-B,U.current.range.x+U.current.range.width-B))}else if(V!==void 0&&V.length>0){const K=[...V].map(pe=>{const Pe=cn({x:B,y:pe,width:w.length,height:1},un.current.signal);return typeof Pe=="object"?Pe[0]:Pe().then(ve=>ve[0])});if(K.some(pe=>pe instanceof Promise)){const pe=await Promise.all(K);X(pe,cr(w.length))}else X(K,cr(w.length))}else if(N.length>0){const j=[],K=[];for(const pe of N){let Pe=cn({x:pe,y:0,width:1,height:je},un.current.signal);typeof Pe!="object"&&(Pe=await Pe()),j.push(Pe),K.push(pe-B)}if(j.length===1)X(j[0],K);else{const pe=j.reduce((Pe,ve)=>Pe.map((Fe,Ie)=>[...Fe,...ve[Ie]]));X(pe,K)}}}},[w,cn,U,$n.copy,B,Ut,je,de]);fn("copy",Bi,d,!1,!1);const bf=g.useCallback(async v=>{var T,N;if(!(!$n.cut||!(((T=Ut.current)==null?void 0:T.contains(document.activeElement))===!0||((N=s.current)==null?void 0:N.contains(document.activeElement))===!0))&&(await Bi(v),U.current!==void 0)){let V={current:{cell:U.current.cell,range:U.current.range,rangeStack:[]},rows:yt.empty(),columns:yt.empty()};const X=Ee==null?void 0:Ee(V);if(X===!1||(V=X===!0?V:X,V.current===void 0))return;Gr(V.current.range)}},[Gr,U,$n.cut,Bi,Ut,Ee]);fn("cut",bf,d,!1,!1);const wf=g.useCallback((v,D)=>{if(fe!==void 0){B!==0&&(v=v.map(V=>[V[0]-B,V[1]])),fe(v,D);return}if(v.length===0||D===-1)return;const[T,N]=v[D];c.current!==void 0&&c.current[0]===T&&c.current[1]===N||(c.current=[T,N],Or(T,N,!1,!1))},[fe,B,Or]),[Lo,Fo]=((Ol=zt==null?void 0:zt.current)==null?void 0:Ol.cell)??[],Ao=g.useRef(an);Ao.current=an,g.useLayoutEffect(()=>{var v,D,T,N;Ka.current&&!Ir.current&&Lo!==void 0&&Fo!==void 0&&(Lo!==((D=(v=Q.current)==null?void 0:v.current)==null?void 0:D.cell[0])||Fo!==((N=(T=Q.current)==null?void 0:T.current)==null?void 0:N.cell[1]))&&Ao.current(Lo,Fo),Ir.current=!1},[Lo,Fo]);const Ml=U.current!==void 0&&(U.current.cell[0]>=xt.length||U.current.cell[1]>=mn);g.useLayoutEffect(()=>{Ml&&we(jo,!1)},[Ml,we]);const yf=g.useMemo(()=>Zt===!0&&(Oe==null?void 0:Oe.tint)===!0?yt.fromSingleSelection(mn-1):yt.empty(),[mn,Zt,Oe==null?void 0:Oe.tint]),Cf=g.useCallback(v=>typeof ze=="boolean"?ze:(ze==null?void 0:ze(v-B))??!0,[B,ze]),Sf=g.useMemo(()=>{if(Ua===void 0||s.current===null)return null;const{bounds:v,group:D}=Ua,T=s.current.getBoundingClientRect();return g.createElement(D0,{bounds:v,group:D,canvasBounds:T,onClose:()=>Ya(void 0),onFinish:N=>{Ya(void 0),ee==null||ee(D,N)}})},[ee,Ua]),xf=Math.min(xt.length,be+(Vn?1:0));g.useImperativeHandle(t,()=>({appendRow:(v,D)=>fi(v+B,D),updateCells:v=>{var D;return B!==0&&(v=v.map(T=>({cell:[T.cell[0]+B,T.cell[1]]}))),(D=En.current)==null?void 0:D.damage(v)},getBounds:(v,D)=>{var T;if(!((s==null?void 0:s.current)===null||(Ut==null?void 0:Ut.current)===null)){if(v===void 0&&D===void 0){const N=s.current.getBoundingClientRect(),V=N.width/Ut.current.clientWidth;return{x:N.x-Ut.current.scrollLeft*V,y:N.y-Ut.current.scrollTop*V,width:Ut.current.scrollWidth*V,height:Ut.current.scrollHeight*V}}return(T=En.current)==null?void 0:T.getBounds((v??0)+B,D)}},focus:()=>{var v;return(v=En.current)==null?void 0:v.focus()},emit:async v=>{switch(v){case"delete":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!1,key:"Delete",keyCode:46,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-right":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"r",keyCode:82,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"fill-down":Ni({bounds:void 0,cancel:()=>{},stopPropagation:()=>{},preventDefault:()=>{},ctrlKey:!0,key:"d",keyCode:68,metaKey:!1,shiftKey:!1,altKey:!1,rawEvent:void 0,location:void 0});break;case"copy":await Bi(void 0,!0);break;case"paste":await Za();break}},scrollTo:an,remeasureColumns:v=>{for(const D of v)Po(D+B)}}),[fi,Po,Ut,Bi,Ni,Za,B,an]);const[Rl,El]=sr??[],kf=g.useCallback(v=>{const[D,T]=v;if(T===-1){at!=="none"&&(qe(yt.fromSingleSelection(D),void 0,!1),Cn());return}Rl===D&&El===T||(kt({cell:v,range:{x:D,y:T,width:1,height:1}},!0,!1,"keyboard-nav"),an(D,T))},[at,Cn,an,Rl,El,kt,qe]),[Mf,Rf]=g.useState(!1),Il=g.useRef(xc(v=>{Rf(v)},5)),Ef=g.useCallback(()=>{Il.current(!0),U.current===void 0&&U.columns.length===0&&U.rows.length===0&&l===void 0&&kt({cell:[B,Ro],range:{x:B,y:Ro,width:1,height:1}},!0,!1,"keyboard-select")},[Ro,U,l,B,kt]),If=g.useCallback(()=>{Il.current(!1)},[]),[Tf,Df]=g.useMemo(()=>{let v;const D=(Gt==null?void 0:Gt.scrollbarWidthOverride)??ks(),T=je+(Zt?1:0);if(typeof qn=="number")v=Dt+T*qn;else{let V=0;const X=Math.min(T,10);for(let W=0;W<X;W++)V+=qn(W);V=Math.floor(V/X),v=Dt+T*V}v+=D;const N=xt.reduce((V,X)=>X.width+V,0)+D;return[`${Math.min(1e5,N)}px`,`${Math.min(1e5,v)}px`]},[xt,Gt==null?void 0:Gt.scrollbarWidthOverride,qn,je,Zt,Dt]),Of=g.useMemo(()=>Fm(We),[We]);return g.createElement(jc.Provider,{value:We},g.createElement(Y0,{style:Of,className:Se,inWidth:p??Tf,inHeight:b??Df},g.createElement(R0,{fillHandle:Pt,drawFocusRing:Nr,experimental:Gt,fixedShadowX:jt,fixedShadowY:Kt,getRowThemeOverride:zn,headerIcons:An,imageWindowLoader:Vr,initialSize:ir,isDraggable:A,onDragLeave:rt,onRowMoved:Qe,overscrollX:Ha,overscrollY:za,preventDiagonalScrolling:wn,rightElement:Gn,rightElementProps:Dn,smoothScrollX:Hn,smoothScrollY:jn,className:Se,enableGroups:yn,onCanvasFocused:Ef,onCanvasBlur:If,canvasRef:s,onContextMenu:vf,theme:We,cellXOffset:tf,cellYOffset:Ro,accessibilityHeight:Wr.height,onDragEnd:hf,columns:xt,nonGrowWidth:Kn,drawHeader:ot,onColumnProposeMove:_,drawCell:st,disabledRows:yf,freezeColumns:xf,lockColumns:B,firstColAccessible:B===0,getCellContent:Pn,minColumnWidth:ar,maxColumnWidth:Br,searchInputRef:a,showSearch:Fi,onSearchClose:$a,highlightRegions:nf,getCellsForSelection:cn,getGroupDetails:Ba,headerHeight:Li,isFocused:Mf,groupHeaderHeight:yn?ko:0,freezeTrailingRows:Vt+(Zt&&(Oe==null?void 0:Oe.sticky)===!0?1:0),hasAppendRow:Zt,onColumnResize:ye,onColumnResizeEnd:ue,onColumnResizeStart:Me,onCellFocused:kf,onColumnMoved:df,onDragStart:ff,onHeaderMenuClick:lf,onHeaderIndicatorClick:uf,onItemHovered:qa,isFilling:(l==null?void 0:l.fillHandle)===!0,onMouseMove:sf,onKeyDown:Ni,onKeyUp:le,onMouseDown:rf,onMouseUp:af,onDragOverCell:Lt,onDrop:vt,onSearchResultsChanged:wf,onVisibleRegionChanged:cf,clientSize:ft,rowHeight:qn,searchResults:G,searchValue:k,onSearchValueChange:P,rows:mn,scrollRef:Ut,selection:U,translateX:Wr.tx,translateY:Wr.ty,verticalBorder:Cf,gridRef:En,getCellRenderer:St,resizeIndicator:Aa}),Sf,r!==void 0&&g.createElement(g.Suspense,{fallback:null},g.createElement(nv,{...r,validateCell:F,bloom:z,id:pf,getCellRenderer:St,className:(Gt==null?void 0:Gt.isSubGrid)===!0?"click-outside-ignore":void 0,provideEditor:bn,imageEditorOverride:f,onFinishEditing:mf,markdownDivCreateNode:m,isOutsideClick:Mr}))))},av=g.forwardRef(ov),dd=20;function wu(e){const{cell:t,posX:n,posY:i,bounds:r,theme:o}=e,{width:a,height:s,x:l,y:u}=r,c=t.maxSize??dd,d=Math.floor(r.y+s/2),f=Rc(c,s,o.cellVerticalPadding),h=Mc(t.contentAlign??"center",l,a,o.cellHorizontalPadding,f),m=kc(h,d,f),p=Ec(l+n,u+i,m);return Vs(t)&&p}const sv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??"false"},kind:Z.Boolean,needsHover:!0,useLabel:!1,needsHoverPosition:!0,measure:()=>50,draw:e=>lv(e,e.cell.data,Vs(e.cell),e.cell.maxSize??dd,e.cell.hoverEffectIntensity??.35),onDelete:e=>({...e,data:!1}),onSelect:e=>{wu(e)&&e.preventDefault()},onClick:e=>{if(wu(e))return{...e.cell,data:ld(e.cell.data)}},onPaste:(e,t)=>{let n=aa;return e.toLowerCase()==="true"?n=!0:e.toLowerCase()==="false"?n=!1:e.toLowerCase()==="indeterminate"&&(n=$s),n===t.data?void 0:{...t,data:n}}};function lv(e,t,n,i,r){if(!n&&t===aa)return;const{ctx:o,hoverAmount:a,theme:s,rect:l,highlighted:u,hoverX:c,hoverY:d,cell:{contentAlign:f}}=e,{x:h,y:m,width:p,height:b}=l;let w=!1;if(r>0){let y=n?1-r+r*a:.4;if(t===aa&&(y*=a),y===0)return;y<1&&(w=!0,o.globalAlpha=y)}Zs(o,s,t,h,m,p,b,u,c,d,i,f),w&&(o.globalAlpha=1)}const uv=hn("div")({name:"BubblesOverlayEditorStyle",class:"gdg-b1ygi5by",propsAsIs:!1}),cv=e=>{const{bubbles:t}=e;return g.createElement(uv,null,t.map((n,i)=>g.createElement("div",{key:i,className:"boe-bubble"},n)),g.createElement("textarea",{className:"gdg-input",autoFocus:!0}))},dv={getAccessibilityString:e=>Ic(e.data),kind:Z.Bubble,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((i,r)=>e.measureText(r).width+i+20,0)+2*n.cellHorizontalPadding-4,draw:e=>hv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return g.createElement(cv,{bubbles:t.data})},onPaste:()=>{}},fv=4;function hv(e,t){const{rect:n,theme:i,ctx:r,highlighted:o}=e,{x:a,y:s,width:l,height:u}=n,c=20,d=8,f=fv;let h=a+i.cellHorizontalPadding;const m=[];for(const p of t){if(h>a+l)break;const b=ii(p,r,i.baseFontFull).width;m.push({x:h,width:b}),h+=b+d*2+f}r.beginPath();for(const p of m)gr(r,p.x,s+(u-c)/2,p.width+d*2,c,i.roundingRadius??c/2);r.fillStyle=o?i.bgBubbleSelected:i.bgBubble,r.fill();for(const[p,b]of m.entries())r.beginPath(),r.fillStyle=i.textBubble,r.fillText(t[p],b.x+d,s+u/2+mr(r,i))}const gv=hn("div")({name:"DrilldownOverlayEditorStyle",class:"gdg-d4zsq0x",propsAsIs:!1}),mv=e=>{const{drilldowns:t}=e;return g.createElement(gv,null,t.map((n,i)=>g.createElement("div",{key:i,className:"doe-bubble"},n.img!==void 0&&g.createElement("img",{src:n.img}),g.createElement("div",null,n.text))))},pv={getAccessibilityString:e=>Ic(e.data.map(t=>t.text)),kind:Z.Drilldown,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:(e,t,n)=>t.data.reduce((i,r)=>e.measureText(r.text).width+i+20+(r.img!==void 0?18:0),0)+2*n.cellHorizontalPadding-4,draw:e=>wv(e,e.cell.data),provideEditor:()=>e=>{const{value:t}=e;return g.createElement(mv,{drilldowns:t.data})},onPaste:()=>{}},vv=4,cs={};function bv(e,t,n,i){const r=Math.ceil(window.devicePixelRatio),o=5,a=n-o*2,s=4,l=n*r,u=i+o,c=i*3,d=(c+o*2)*r,f=`${e},${t},${r},${n}`;if(cs[f]!==void 0)return{el:cs[f],height:l,width:d,middleWidth:s*r,sideWidth:u*r,padding:o*r,dpr:r};const h=document.createElement("canvas"),m=h.getContext("2d");return m===null?null:(h.width=d,h.height=l,m.scale(r,r),cs[f]=h,m.beginPath(),gr(m,o,o,c,a,i),m.shadowColor="rgba(24, 25, 34, 0.4)",m.shadowBlur=1,m.fillStyle=e,m.fill(),m.shadowColor="rgba(24, 25, 34, 0.3)",m.shadowOffsetY=1,m.shadowBlur=5,m.fillStyle=e,m.fill(),m.shadowOffsetY=0,m.shadowBlur=0,m.shadowBlur=0,m.beginPath(),gr(m,o+.5,o+.5,c,a,i),m.strokeStyle=t,m.lineWidth=1,m.stroke(),{el:h,height:l,width:d,sideWidth:u*r,middleWidth:i*r,padding:o*r,dpr:r})}function wv(e,t){const{rect:n,theme:i,ctx:r,imageLoader:o,col:a,row:s}=e,{x:l,width:u}=n,c=i.baseFontFull,d=Wc(r,c),f=Math.min(n.height,Math.max(16,Math.ceil(d*i.lineHeight)*2)),h=Math.floor(n.y+(n.height-f)/2),m=f-10,p=8,b=vv;let w=l+i.cellHorizontalPadding;const y=i.roundingRadius??6,S=bv(i.bgCell,i.drilldownBorder,f,y),M=[];for(const C of t){if(w>l+u)break;const R=ii(C.text,r,c).width;let I=0;C.img!==void 0&&o.loadOrGetImage(C.img,a,s)!==void 0&&(I=m-8+4);const E=R+I+p*2;M.push({x:w,width:E}),w+=E+b}if(S!==null){const{el:C,height:x,middleWidth:R,sideWidth:I,width:E,dpr:H,padding:z}=S,L=I/H,_=z/H;for(const O of M){const ne=Math.floor(O.x),q=Math.floor(O.width),oe=q-(L-_)*2;r.imageSmoothingEnabled=!1,r.drawImage(C,0,0,I,x,ne-_,h,L,f),oe>0&&r.drawImage(C,I,0,R,x,ne+(L-_),h,oe,f),r.drawImage(C,E-I,0,I,x,ne+q-(L-_),h,L,f),r.imageSmoothingEnabled=!0}}r.beginPath();for(const[C,x]of M.entries()){const R=t[C];let I=x.x+p;if(R.img!==void 0){const E=o.loadOrGetImage(R.img,a,s);if(E!==void 0){const H=m-8;let z=0,L=0,_=E.width,O=E.height;_>O?(z+=(_-O)/2,_=O):O>_&&(L+=(O-_)/2,O=_),r.beginPath(),gr(r,I,h+f/2-H/2,H,H,i.roundingRadius??3),r.save(),r.clip(),r.drawImage(E,z,L,_,O,I,h+f/2-H/2,H,H),r.restore(),I+=H+4}}r.beginPath(),r.fillStyle=i.textBubble,r.fillText(R.text,I,h+f/2+mr(r,i))}}const yv={getAccessibilityString:e=>e.data.join(", "),kind:Z.Image,needsHover:!1,useLabel:!1,needsHoverPosition:!1,draw:e=>Cv(e,e.cell.displayData??e.cell.data,e.cell.rounding??e.theme.roundingRadius??4,e.cell.contentAlign),measure:(e,t)=>t.data.length*50,onDelete:e=>({...e,data:[]}),provideEditor:()=>e=>{const{value:t,onFinishedEditing:n,imageEditorOverride:i}=e,r=i??Yg;return g.createElement(r,{urls:t.data,canWrite:t.readonly!==!0,onCancel:n,onChange:o=>{n({...t,data:[o]})}})},onPaste:(e,t)=>{e=e.trim();const i=e.split(",").map(r=>{try{return new URL(r),r}catch{return}}).filter(r=>r!==void 0);if(!(i.length===t.data.length&&i.every((r,o)=>r===t.data[o])))return{...t,data:i}}},ds=4;function Cv(e,t,n,i){const{rect:r,col:o,row:a,theme:s,ctx:l,imageLoader:u}=e,{x:c,y:d,height:f,width:h}=r,m=f-s.cellVerticalPadding*2,p=[];let b=0;for(let y=0;y<t.length;y++){const S=t[y];if(S.length===0)continue;const M=u.loadOrGetImage(S,o,a);if(M!==void 0){p[y]=M;const C=M.width*(m/M.height);b+=C+ds}}if(b===0)return;b-=ds;let w=c+s.cellHorizontalPadding;i==="right"?w=Math.floor(c+h-s.cellHorizontalPadding-b):i==="center"&&(w=Math.floor(c+h/2-b/2));for(const y of p){if(y===void 0)continue;const S=y.width*(m/y.height);n>0&&(l.beginPath(),gr(l,w,d+s.cellVerticalPadding,S,m,n),l.save(),l.clip()),l.drawImage(y,w,d+s.cellVerticalPadding,S,m),n>0&&l.restore(),w+=S+ds}}function Sv(e,t){let n=e*49632+t*325176;return n^=n<<13,n^=n>>17,n^=n<<5,n/4294967295*2}const xv={getAccessibilityString:()=>"",kind:Z.Loading,needsHover:!1,useLabel:!1,needsHoverPosition:!1,measure:()=>120,draw:e=>{const{cell:t,col:n,row:i,ctx:r,rect:o,theme:a}=e;if(t.skeletonWidth===void 0||t.skeletonWidth===0)return;let s=t.skeletonWidth;t.skeletonWidthVariability!==void 0&&t.skeletonWidthVariability>0&&(s+=Math.round(Sv(n,i)*t.skeletonWidthVariability));const l=a.cellHorizontalPadding;s+l*2>=o.width&&(s=o.width-l*2-1);const u=t.skeletonHeight??Math.min(18,o.height-2*a.cellVerticalPadding);gr(r,o.x+l,o.y+(o.height-u)/2,s,u,a.roundingRadius??3),r.fillStyle=ei(a.textDark,.1),r.fill()},onPaste:()=>{}},kv=()=>e=>e.targetWidth,yu=hn("div")({name:"MarkdownOverlayEditorStyle",class:"gdg-m1pnx84e",propsAsIs:!1,vars:{"m1pnx84e-0":[kv(),"px"]}}),Mv=e=>{const{value:t,onChange:n,forceEditMode:i,createNode:r,targetRect:o,onFinish:a,validatedSelection:s}=e,l=t.data,u=t.readonly===!0,[c,d]=g.useState(l===""||i),f=g.useCallback(()=>{d(m=>!m)},[]),h=l?"gdg-ml-6":"";return c?g.createElement(yu,{targetWidth:o.width-20},g.createElement(Ei,{autoFocus:!0,highlight:!1,validatedSelection:s,value:l,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},onChange:n}),g.createElement("div",{className:`gdg-edit-icon gdg-checkmark-hover ${h}`,onClick:()=>a(t)},g.createElement(zg,null))):g.createElement(yu,{targetWidth:o.width},g.createElement(cm,{contents:l,createNode:r}),!u&&g.createElement(g.Fragment,null,g.createElement("div",{className:"spacer"}),g.createElement("div",{className:`gdg-edit-icon gdg-edit-hover ${h}`,onClick:f},g.createElement(Us,null))),g.createElement("textarea",{className:"gdg-md-edit-textarea gdg-input",autoFocus:!0}))},Rv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Markdown,needsHover:!1,needsHoverPosition:!1,drawPrep:po,measure:(e,t,n)=>{const i=t.data.split(`
175
- `)[0];return e.measureText(i).width+2*n.cellHorizontalPadding},draw:e=>dr(e,e.cell.data,e.cell.contentAlign),onDelete:e=>({...e,data:""}),provideEditor:()=>e=>{const{onChange:t,value:n,target:i,onFinishedEditing:r,markdownDivCreateNode:o,forceEditMode:a,validatedSelection:s}=e;return g.createElement(Mv,{onFinish:r,targetRect:i,value:n,validatedSelection:s,onChange:l=>t({...n,data:l.target.value}),forceEditMode:a,createNode:o})},onPaste:(e,t)=>e===t.data?void 0:{...t,data:e}},Ev={getAccessibilityString:e=>e.row.toString(),kind:Xn.Marker,needsHover:!0,needsHoverPosition:!1,drawPrep:Iv,measure:()=>44,draw:e=>Dv(e,e.cell.row,e.cell.checked,e.cell.markerKind,e.cell.drawHandle,e.cell.checkboxStyle),onClick:e=>{const{bounds:t,cell:n,posX:i,posY:r}=e,{width:o,height:a}=t,s=n.drawHandle?7+(o-7)/2:o/2,l=a/2;if(Math.abs(i-s)<=10&&Math.abs(r-l)<=10)return{...n,checked:!n.checked}},onPaste:()=>{}};function Iv(e,t){const{ctx:n,theme:i}=e,r=i.markerFontFull,o=t??{};return(o==null?void 0:o.font)!==r&&(n.font=r,o.font=r),o.deprep=Tv,n.textAlign="center",o}function Tv(e){const{ctx:t}=e;t.textAlign="start"}function Dv(e,t,n,i,r,o){const{ctx:a,rect:s,hoverAmount:l,theme:u}=e,{x:c,y:d,width:f,height:h}=s,m=n?1:i==="checkbox-visible"?.6+.4*l:l;if(i!=="number"&&m>0){a.globalAlpha=m;const p=7*(n?l:1);if(Zs(a,u,n,r?c+p:c,d,r?f-p:f,h,!0,void 0,void 0,18,"center",o),r){a.globalAlpha=l,a.beginPath();for(const b of[3,6])for(const w of[-5,-1,3])a.rect(c+b,d+h/2+w,2,2);a.fillStyle=u.textLight,a.fill(),a.beginPath()}a.globalAlpha=1}if(i==="number"||i==="both"&&!n){const p=t.toString(),b=u.markerFontFull,w=c+f/2;i==="both"&&l!==0&&(a.globalAlpha=1-l),a.fillStyle=u.textLight,a.font=b,a.fillText(p,w,d+h/2+mr(a,b)),l!==0&&(a.globalAlpha=1)}}const Ov={getAccessibilityString:()=>"",kind:Xn.NewRow,needsHover:!0,needsHoverPosition:!1,measure:()=>200,draw:e=>Pv(e,e.cell.hint,e.cell.icon),onPaste:()=>{}};function Pv(e,t,n){const{ctx:i,rect:r,hoverAmount:o,theme:a,spriteManager:s}=e,{x:l,y:u,width:c,height:d}=r;i.beginPath(),i.globalAlpha=o,i.rect(l+1,u+1,c,d-2),i.fillStyle=a.bgHeaderHovered,i.fill(),i.globalAlpha=1,i.beginPath();const f=t!=="";let h=0;if(n!==void 0){const p=d-8,b=l+8/2,w=u+8/2;s.drawSprite(n,"normal",i,b,w,p,a,f?1:o),h=p}else{h=24;const m=12,p=f?m:o*m,b=f?0:(1-o)*m*.5,w=a.cellHorizontalPadding+4;p>0&&(i.moveTo(l+w+b,u+d/2),i.lineTo(l+w+b+p,u+d/2),i.moveTo(l+w+b+p*.5,u+d/2-p*.5),i.lineTo(l+w+b+p*.5,u+d/2+p*.5),i.lineWidth=2,i.strokeStyle=a.bgIconHeader,i.lineCap="round",i.stroke())}i.fillStyle=a.textMedium,i.fillText(t,h+l+a.cellHorizontalPadding+.5,u+d/2+mr(i,a)),i.beginPath()}function fd(e,t,n,i,r,o,a){e.textBaseline="alphabetic";const s=_v(e,r,i,t,(n==null?void 0:n.fullSize)??!1);e.beginPath(),gr(e,s.x,s.y,s.width,s.height,t.roundingRadius??4),e.globalAlpha=o,e.fillStyle=(n==null?void 0:n.bgColor)??ei(t.textDark,.1),e.fill(),e.globalAlpha=1,e.fillStyle=t.textDark,e.textBaseline="middle",a==null||a("text")}function _v(e,t,n,i,r){const o=i.cellHorizontalPadding,a=i.cellVerticalPadding;if(r)return{x:t.x+o/2,y:t.y+a/2+1,width:t.width-o,height:t.height-a-1};const s=ii(n,e,i.baseFontFull,"alphabetic"),l=t.height-a,u=Math.min(l,s.actualBoundingBoxAscent*2.5);return{x:t.x+o/2,y:t.y+(t.height-u)/2+1,width:s.width+o*3,height:u-1}}const Lv=g.lazy(async()=>await As(()=>import("./number-overlay-editor.D5dgP2YW.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url)),Fv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Number,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,useLabel:!0,drawPrep:po,draw:e=>{const{hoverAmount:t,cell:n,ctx:i,theme:r,rect:o,overrideCursor:a}=e,{hoverEffect:s,displayData:l,hoverEffectTheme:u}=n;s===!0&&t>0&&fd(i,r,u,l,o,t,a),dr(e,e.cell.displayData,e.cell.contentAlign)},measure:(e,t,n)=>e.measureText(t.displayData).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:void 0}),provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:i,validatedSelection:r}=e;return g.createElement(g.Suspense,{fallback:null},g.createElement(Lv,{highlight:t,disabled:i.readonly===!0,value:i.data,fixedDecimals:i.fixedDecimals,allowNegative:i.allowNegative,thousandSeparator:i.thousandSeparator,decimalSeparator:i.decimalSeparator,validatedSelection:r,onChange:o=>n({...i,data:Number.isNaN(o.floatValue??0)?0:o.floatValue})}))},onPaste:(e,t,n)=>{const i=typeof n.rawValue=="number"?n.rawValue:Number.parseFloat(typeof n.rawValue=="string"?n.rawValue:e);if(!(Number.isNaN(i)||t.data===i))return{...t,data:i,displayData:n.formattedString??t.displayData}}},Av={getAccessibilityString:()=>"",measure:()=>108,kind:Z.Protected,needsHover:!1,needsHoverPosition:!1,draw:Hv,onPaste:()=>{}};function Hv(e){const{ctx:t,theme:n,rect:i}=e,{x:r,y:o,height:a}=i;t.beginPath();const s=2.5;let l=r+n.cellHorizontalPadding+s;const u=o+a/2,c=Math.cos(Xl(30))*s,d=Math.sin(Xl(30))*s;for(let f=0;f<12;f++)t.moveTo(l,u-s),t.lineTo(l,u+s),t.moveTo(l+c,u-d),t.lineTo(l-c,u+d),t.moveTo(l-c,u-d),t.lineTo(l+c,u+d),l+=8;t.lineWidth=1.1,t.lineCap="square",t.strokeStyle=n.textLight,t.stroke()}const zv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.RowID,needsHover:!1,needsHoverPosition:!1,drawPrep:(e,t)=>po(e,t,e.theme.textLight),draw:e=>dr(e,e.cell.data,e.cell.contentAlign),measure:(e,t,n)=>e.measureText(t.data).width+n.cellHorizontalPadding*2,provideEditor:()=>e=>{const{isHighlighted:t,onChange:n,value:i,validatedSelection:r}=e;return ae.createElement(Ei,{highlight:t,autoFocus:i.readonly!==!0,disabled:i.readonly!==!1,value:i.data,validatedSelection:r,onChange:o=>n({...i,data:o.target.value})})},onPaste:()=>{}},$v={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Text,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!1,drawPrep:po,useLabel:!0,draw:e=>{const{cell:t,hoverAmount:n,hyperWrapping:i,ctx:r,rect:o,theme:a,overrideCursor:s}=e,{displayData:l,contentAlign:u,hoverEffect:c,allowWrapping:d,hoverEffectTheme:f}=t;c===!0&&n>0&&fd(r,a,f,l,o,n,s),dr(e,l,u,d,i)},measure:(e,t,n)=>{const i=t.displayData.split(`
176
- `,t.allowWrapping===!0?void 0:1);let r=0;for(const o of i)r=Math.max(r,e.measureText(o).width);return r+2*n.cellHorizontalPadding},onDelete:e=>({...e,data:""}),provideEditor:e=>({disablePadding:e.allowWrapping===!0,editor:t=>{const{isHighlighted:n,onChange:i,value:r,validatedSelection:o}=t;return g.createElement(Ei,{style:e.allowWrapping===!0?{padding:"3px 8.5px"}:void 0,highlight:n,autoFocus:r.readonly!==!0,disabled:r.readonly===!0,altNewline:!0,value:r.data,validatedSelection:o,onChange:a=>i({...r,data:a.target.value})})}}),onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Vv=hn("div")({name:"UriOverlayEditorStyle",class:"gdg-u1rrojo",propsAsIs:!1}),Nv=e=>{const{uri:t,onChange:n,forceEditMode:i,readonly:r,validatedSelection:o,preview:a}=e,[s,l]=g.useState(!r&&(t===""||i)),u=g.useCallback(()=>{l(!0)},[]);return s?g.createElement(Ei,{validatedSelection:o,highlight:!0,autoFocus:!0,value:t,onChange:n}):g.createElement(Vv,null,g.createElement("a",{className:"gdg-link-area",href:t,target:"_blank",rel:"noopener noreferrer"},a),!r&&g.createElement("div",{className:"gdg-edit-icon",onClick:u},g.createElement(Us,null)),g.createElement("textarea",{className:"gdg-input",autoFocus:!0}))};function hd(e,t,n,i){let r=n.cellHorizontalPadding;const o=t.height/2-e.actualBoundingBoxAscent/2,a=e.width,s=e.actualBoundingBoxAscent;return i==="right"?r=t.width-a-n.cellHorizontalPadding:i==="center"&&(r=t.width/2-a/2),{x:r,y:o,width:a,height:s}}function Cu(e){const{cell:t,bounds:n,posX:i,posY:r,theme:o}=e,a=t.displayData??t.data;if(t.hoverEffect!==!0||t.onClickUri===void 0)return!1;const s=Vc(a,o.baseFontFull);if(s===void 0)return!1;const l=hd(s,n,o,t.contentAlign);return Qr({x:l.x-4,y:l.y-4,width:l.width+8,height:l.height+8},i,r)}const Bv={getAccessibilityString:e=>{var t;return((t=e.data)==null?void 0:t.toString())??""},kind:Z.Uri,needsHover:e=>e.hoverEffect===!0,needsHoverPosition:!0,useLabel:!0,drawPrep:po,draw:e=>{const{cell:t,theme:n,overrideCursor:i,hoverX:r,hoverY:o,rect:a,ctx:s}=e,l=t.displayData??t.data,u=t.hoverEffect===!0;if(i!==void 0&&u&&r!==void 0&&o!==void 0){const c=ii(l,s,n.baseFontFull),d=hd(c,a,n,t.contentAlign),{x:f,y:h,width:m,height:p}=d;if(r>=f-4&&r<=f-4+m+8&&o>=h-4&&o<=h-4+p+8){const b=mr(s,n.baseFontFull);i("pointer");const w=5,y=h-b;s.beginPath(),s.moveTo(a.x+f,Math.floor(a.y+y+p+w)+.5),s.lineTo(a.x+f+m,Math.floor(a.y+y+p+w)+.5),s.strokeStyle=n.linkColor,s.stroke(),s.save(),s.fillStyle=e.cellFillColor,dr({...e,rect:{...a,x:a.x-1}},l,t.contentAlign),dr({...e,rect:{...a,x:a.x-2}},l,t.contentAlign),dr({...e,rect:{...a,x:a.x+1}},l,t.contentAlign),dr({...e,rect:{...a,x:a.x+2}},l,t.contentAlign),s.restore()}}s.fillStyle=u?n.linkColor:n.textDark,dr(e,l,t.contentAlign)},onSelect:e=>{Cu(e)&&e.preventDefault()},onClick:e=>{var i;const{cell:t}=e;Cu(e)&&((i=t.onClickUri)==null||i.call(t,e))},measure:(e,t,n)=>e.measureText(t.displayData??t.data).width+n.cellHorizontalPadding*2,onDelete:e=>({...e,data:""}),provideEditor:e=>t=>{const{onChange:n,value:i,forceEditMode:r,validatedSelection:o}=t;return g.createElement(Nv,{forceEditMode:i.readonly!==!0&&(r||e.hoverEffect===!0&&e.onClickUri!==void 0),uri:i.data,preview:i.displayData??i.data,validatedSelection:o,readonly:i.readonly===!0,onChange:a=>n({...i,data:a.target.value})})},onPaste:(e,t,n)=>e===t.data?void 0:{...t,data:e,displayData:n.formattedString??t.displayData}},Wv=[Ev,Ov,sv,dv,pv,yv,xv,Rv,Fv,Av,zv,$v,Bv];var Uv=Sc,Yv=oc,Xv="Expected a function";function Gv(e,t,n){var i=!0,r=!0;if(typeof e!="function")throw new TypeError(Xv);return Yv(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Uv(e,t,{leading:i,maxWait:t,trailing:r})}var jv=Gv;const qv=co(jv),fs=[];class Kv extends Yc{constructor(){super(...arguments);dt(this,"imageLoaded",()=>{});dt(this,"loadedLocations",[]);dt(this,"cache",{});dt(this,"sendLoaded",qv(()=>{this.imageLoaded(new io(this.loadedLocations)),this.loadedLocations=[]},20));dt(this,"clearOutOfWindow",()=>{const n=Object.keys(this.cache);for(const i of n){const r=this.cache[i];let o=!1;for(let a=0;a<r.cells.length;a++){const s=r.cells[a];if(this.isInWindow(s)){o=!0;break}}o?r.cells=r.cells.filter(this.isInWindow):(r.cancel(),delete this.cache[i])}})}setCallback(n){this.imageLoaded=n}loadImage(n,i,r,o){let a=!1;const s=fs.pop()??new Image;let l=!1;const u={img:void 0,cells:[rr(i,r)],url:n,cancel:()=>{l||(l=!0,fs.length<12?fs.unshift(s):a||(s.src=""))}},c=new Promise(d=>s.addEventListener("load",()=>d(null)));requestAnimationFrame(async()=>{try{s.src=n,await c,await s.decode();const d=this.cache[o];if(d!==void 0&&!l){d.img=s;for(const f of d.cells)this.loadedLocations.push(Ks(f));a=!0,this.sendLoaded()}}catch{u.cancel()}}),this.cache[o]=u}loadOrGetImage(n,i,r){const o=n,a=this.cache[o];if(a!==void 0){const s=rr(i,r);return a.cells.includes(s)||a.cells.push(s),a.img}else this.loadImage(n,i,r,o)}}const Zv=(e,t)=>{const n=g.useMemo(()=>({...zp,...e.headerIcons}),[e.headerIcons]),i=g.useMemo(()=>e.imageWindowLoader??new Kv,[e.imageWindowLoader]);return g.createElement(av,{...e,renderers:Wv,headerIcons:n,ref:t,imageWindowLoader:i})},Jv=g.forwardRef(Zv);function Su(e,t){const n=g.useRef(null),i=g.useRef(),r=g.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null)},[]);return g.useEffect(()=>r,[r]),{debouncedCallback:g.useCallback((...a)=>{i.current=a,r(),n.current=setTimeout(()=>{i.current&&(e(...i.current),i.current=void 0)},t)},[e,t,r]),cancel:r}}var Qv={exports:{}};/*! Moment Duration Format v2.2.2
177
- * https://github.com/jsmreese/moment-duration-format
178
- * Date: 2018-02-16
179
- *
180
- * Duration format plugin function for the Moment.js library
181
- * http://momentjs.com/
182
- *
183
- * Copyright 2018 John Madhavan-Reese
184
- * Released under the MIT license
185
- */(function(e,t){(function(n,i){try{e.exports=i(Uf)}catch{e.exports=i}n&&(n.momentDurationFormatSetup=n.moment?i(n.moment):i)})(Fs,function(n){var i=!1,r=!1,o=!1,a=!1,s="escape years months weeks days hours minutes seconds milliseconds general".split(" "),l=[{type:"seconds",targets:[{type:"minutes",value:60},{type:"hours",value:3600},{type:"days",value:86400},{type:"weeks",value:604800},{type:"months",value:2678400},{type:"years",value:31536e3}]},{type:"minutes",targets:[{type:"hours",value:60},{type:"days",value:1440},{type:"weeks",value:10080},{type:"months",value:44640},{type:"years",value:525600}]},{type:"hours",targets:[{type:"days",value:24},{type:"weeks",value:168},{type:"months",value:744},{type:"years",value:8760}]},{type:"days",targets:[{type:"weeks",value:7},{type:"months",value:31},{type:"years",value:365}]},{type:"months",targets:[{type:"years",value:12}]}];function u(P,k){return k.length>P.length?!1:P.indexOf(k)!==-1}function c(P){for(var k="";P;)k+="0",P-=1;return k}function d(P){for(var k=P.split("").reverse(),$=0,le=!0;le&&$<k.length;)$?k[$]==="9"?k[$]="0":(k[$]=(parseInt(k[$],10)+1).toString(),le=!1):(parseInt(k[$],10)<5&&(le=!1),k[$]="0"),$+=1;return le&&k.push("1"),k.reverse().join("")}function f(P,k){var $=R(ne(k).sort(),function(Te){return Te+":"+k[Te]}).join(","),le=P+"+"+$;return f.cache[le]||(f.cache[le]=Intl.NumberFormat(P,k)),f.cache[le]}f.cache={};function h(P,k,$){var le=k.useToLocaleString,Te=k.useGrouping,Be=Te&&k.grouping.slice(),ce=k.maximumSignificantDigits,nt=k.minimumIntegerDigits||1,ke=k.fractionDigits||0,bt=k.groupingSeparator,Et=k.decimalSeparator;if(le&&$){var at={minimumIntegerDigits:nt,useGrouping:Te};if(ke&&(at.maximumFractionDigits=ke,at.minimumFractionDigits=ke),ce&&P>0&&(at.maximumSignificantDigits=ce),o){if(!a){var te=O({},k);te.useGrouping=!1,te.decimalSeparator=".",P=parseFloat(h(P,te),10)}return f($,at).format(P)}else{if(!r){var te=O({},k);te.useGrouping=!1,te.decimalSeparator=".",P=parseFloat(h(P,te),10)}return P.toLocaleString($,at)}}var it;ce?it=P.toPrecision(ce+1):it=P.toFixed(ke+1);var me,se,he,$e=it.split("e");he=$e[1]||"",$e=$e[0].split("."),se=$e[1]||"",me=$e[0]||"";var Le=me.length,Je=se.length,de=Le+Je,be=me+se;(ce&&de===ce+1||!ce&&Je===ke+1)&&(be=d(be),be.length===de+1&&(Le=Le+1),Je&&(be=be.slice(0,-1)),me=be.slice(0,Le),se=be.slice(Le)),ce&&(se=se.replace(/0*$/,""));var Ge=parseInt(he,10);Ge>0?se.length<=Ge?(se=se+c(Ge-se.length),me=me+se,se=""):(me=me+se.slice(0,Ge),se=se.slice(Ge)):Ge<0&&(se=c(Math.abs(Ge)-me.length)+me+se,me="0"),ce||(se=se.slice(0,ke),se.length<ke&&(se=se+c(ke-se.length)),me.length<nt&&(me=c(nt-me.length)+me));var Ae="";if(Te){$e=me;for(var tt;$e.length;)Be.length&&(tt=Be.shift()),Ae&&(Ae=bt+Ae),Ae=$e.slice(-tt)+Ae,$e=$e.slice(0,-tt)}else Ae=me;return se&&(Ae=Ae+Et+se),Ae}function m(P,k){return P.label.length>k.label.length?-1:P.label.length<k.label.length?1:0}function p(P,k){var $=[];return x(ne(k),function(le){if(le.slice(0,15)==="_durationLabels"){var Te=le.slice(15).toLowerCase();x(ne(k[le]),function(Be){Be.slice(0,1)===P&&$.push({type:Te,key:Be,label:k[le][Be]})})}}),$}function b(P,k,$){return k===1&&$===null?P:P+P}var w={durationLabelsStandard:{S:"millisecond",SS:"milliseconds",s:"second",ss:"seconds",m:"minute",mm:"minutes",h:"hour",hh:"hours",d:"day",dd:"days",w:"week",ww:"weeks",M:"month",MM:"months",y:"year",yy:"years"},durationLabelsShort:{S:"msec",SS:"msecs",s:"sec",ss:"secs",m:"min",mm:"mins",h:"hr",hh:"hrs",d:"dy",dd:"dys",w:"wk",ww:"wks",M:"mo",MM:"mos",y:"yr",yy:"yrs"},durationTimeTemplates:{HMS:"h:mm:ss",HM:"h:mm",MS:"m:ss"},durationLabelTypes:[{type:"standard",string:"__"},{type:"short",string:"_"}],durationPluralKey:b};function y(P){return Object.prototype.toString.call(P)==="[object Array]"}function S(P){return Object.prototype.toString.call(P)==="[object Object]"}function M(P,k){for(var $=P.length;$-=1;)if(k(P[$]))return P[$]}function C(P,k){var $=0,le=P&&P.length||0,Te;for(typeof k!="function"&&(Te=k,k=function(Be){return Be===Te});$<le;){if(k(P[$]))return P[$];$+=1}}function x(P,k){var $=0,le=P.length;if(!(!P||!le))for(;$<le;){if(k(P[$],$)===!1)return;$+=1}}function R(P,k){var $=0,le=P.length,Te=[];if(!P||!le)return Te;for(;$<le;)Te[$]=k(P[$],$),$+=1;return Te}function I(P,k){return R(P,function($){return $[k]})}function E(P){var k=[];return x(P,function($){$&&k.push($)}),k}function H(P){var k=[];return x(P,function($){C(k,$)||k.push($)}),k}function z(P,k){var $=[];return x(P,function(le){x(k,function(Te){le===Te&&$.push(le)})}),H($)}function L(P,k){var $=[];return x(P,function(le,Te){if(!k(le))return $=P.slice(Te),!1}),$}function _(P,k){var $=P.slice().reverse();return L($,k).reverse()}function O(P,k){for(var $ in k)k.hasOwnProperty($)&&(P[$]=k[$]);return P}function ne(P){var k=[];for(var $ in P)P.hasOwnProperty($)&&k.push($);return k}function q(P,k){var $=0,le=P.length;if(!P||!le)return!1;for(;$<le;){if(k(P[$],$)===!0)return!0;$+=1}return!1}function oe(P){var k=[];return x(P,function($){k=k.concat($)}),k}function Se(){var P=0;try{P.toLocaleString("i")}catch(k){return k.name==="RangeError"}return!1}function xe(P){return P(3.55,"en",{useGrouping:!1,minimumIntegerDigits:1,minimumFractionDigits:1,maximumFractionDigits:1})==="3.6"}function re(P){var k=!0;return k=k&&P(1,"en",{minimumIntegerDigits:1})==="1",k=k&&P(1,"en",{minimumIntegerDigits:2})==="01",k=k&&P(1,"en",{minimumIntegerDigits:3})==="001",!(!k||(k=k&&P(99.99,"en",{maximumFractionDigits:0,minimumFractionDigits:0})==="100",k=k&&P(99.99,"en",{maximumFractionDigits:1,minimumFractionDigits:1})==="100.0",k=k&&P(99.99,"en",{maximumFractionDigits:2,minimumFractionDigits:2})==="99.99",k=k&&P(99.99,"en",{maximumFractionDigits:3,minimumFractionDigits:3})==="99.990",!k)||(k=k&&P(99.99,"en",{maximumSignificantDigits:1})==="100",k=k&&P(99.99,"en",{maximumSignificantDigits:2})==="100",k=k&&P(99.99,"en",{maximumSignificantDigits:3})==="100",k=k&&P(99.99,"en",{maximumSignificantDigits:4})==="99.99",k=k&&P(99.99,"en",{maximumSignificantDigits:5})==="99.99",!k)||(k=k&&P(1e3,"en",{useGrouping:!0})==="1,000",k=k&&P(1e3,"en",{useGrouping:!1})==="1000",!k))}function J(){var P=[].slice.call(arguments),k={},$;if(x(P,function(ce,nt){if(!nt){if(!y(ce))throw"Expected array as the first argument to durationsFormat.";$=ce}if(typeof ce=="string"||typeof ce=="function"){k.template=ce;return}if(typeof ce=="number"){k.precision=ce;return}S(ce)&&O(k,ce)}),!$||!$.length)return[];k.returnMomentTypes=!0;var le=R($,function(ce){return ce.format(k)}),Te=z(s,H(I(oe(le),"type"))),Be=k.largest;return Be&&(Te=Te.slice(0,Be)),k.returnMomentTypes=!1,k.outputTypes=Te,R($,function(ce){return ce.format(k)})}function ee(){var P=[].slice.call(arguments),k=O({},this.format.defaults),$=this.asMilliseconds(),le=this.asMonths();typeof this.isValid=="function"&&this.isValid()===!1&&($=0,le=0);var Te=$<0,Be=n.duration(Math.abs($),"milliseconds"),ce=n.duration(Math.abs(le),"months");x(P,function(A){if(typeof A=="string"||typeof A=="function"){k.template=A;return}if(typeof A=="number"){k.precision=A;return}S(A)&&O(k,A)});var nt={years:"y",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m",seconds:"s",milliseconds:"S"},ke={escape:/\[(.+?)\]/,years:/\*?[Yy]+/,months:/\*?M+/,weeks:/\*?[Ww]+/,days:/\*?[Dd]+/,hours:/\*?[Hh]+/,minutes:/\*?m+/,seconds:/\*?s+/,milliseconds:/\*?S+/,general:/.+?/};k.types=s;var bt=function(A){return C(s,function(rt){return ke[rt].test(A)})},Et=new RegExp(R(s,function(A){return ke[A].source}).join("|"),"g");k.duration=this;var at=typeof k.template=="function"?k.template.apply(k):k.template,te=k.outputTypes,it=k.returnMomentTypes,me=k.largest,se=[];te||(y(k.stopTrim)&&(k.stopTrim=k.stopTrim.join("")),k.stopTrim&&x(k.stopTrim.match(Et),function(A){var rt=bt(A);rt==="escape"||rt==="general"||se.push(rt)}));var he=n.localeData();he||(he={}),x(ne(w),function(A){if(typeof w[A]=="function"){he[A]||(he[A]=w[A]);return}he["_"+A]||(he["_"+A]=w[A])}),x(ne(he._durationTimeTemplates),function(A){at=at.replace("_"+A+"_",he._durationTimeTemplates[A])});var $e=k.userLocale||n.locale(),Le=k.useLeftUnits,Je=k.usePlural,de=k.precision,be=k.forceLength,Ge=k.useGrouping,Ae=k.trunc,tt=k.useSignificantDigits&&de>0,wt=tt?k.precision:0,gt=wt,He=k.minValue,_t=!1,Xt=k.maxValue,Ot=!1,Ht=k.useToLocaleString,rn=k.groupingSeparator,zt=k.decimalSeparator,gn=k.grouping;Ht=Ht&&(i||o);var $t=k.trim;y($t)&&($t=$t.join(" ")),$t===null&&(me||Xt||tt)&&($t="all"),($t===null||$t===!0||$t==="left"||$t==="right")&&($t="large"),$t===!1&&($t="");var It=function(A){return A.test($t)},In=/large/,bn=/small/,Oe=/both/,Vt=/mid/,dn=/^all|[^sm]all/,De=/final/,lt=me>0||q([In,Oe,dn],It),ze=q([bn,Oe,dn],It),Lt=q([Vt,dn],It),vt=q([De,dn],It),on=R(at.match(Et),function(A,rt){var Qe=bt(A);return A.slice(0,1)==="*"&&(A=A.slice(1),Qe!=="escape"&&Qe!=="general"&&se.push(Qe)),{index:rt,length:A.length,text:"",token:Qe==="escape"?A.replace(ke.escape,"$1"):A,type:Qe==="escape"||Qe==="general"?null:Qe}}),Tt={index:0,length:0,token:"",text:"",type:null},Ft=[];Le&&on.reverse(),x(on,function(A){if(A.type){(Tt.type||Tt.text)&&Ft.push(Tt),Tt=A;return}Le?Tt.text=A.token+Tt.text:Tt.text+=A.token}),(Tt.type||Tt.text)&&Ft.push(Tt),Le&&Ft.reverse();var Ve=z(s,H(E(I(Ft,"type"))));if(!Ve.length)return I(Ft,"text").join("");Ve=R(Ve,function(A,rt){var Qe=rt+1===Ve.length,Wt=!rt,Tn;A==="years"||A==="months"?Tn=ce.as(A):Tn=Be.as(A);var wn=Math.floor(Tn),Gn=Tn-wn,Dn=C(Ft,function(Qt){return A===Qt.type});return Wt&&Xt&&Tn>Xt&&(Ot=!0),Qe&&He&&Math.abs(k.duration.as(A))<He&&(_t=!0),Wt&&be===null&&Dn.length>1&&(be=!0),Be.subtract(wn,A),ce.subtract(wn,A),{rawValue:Tn,wholeValue:wn,decimalValue:Qe?Gn:0,isSmallest:Qe,isLargest:Wt,type:A,tokenLength:Dn.length}});var Pt=Ae?Math.floor:Math.round,Gt=function(A,rt){var Qe=Math.pow(10,rt);return Pt(A*Qe)/Qe},jt=!1,Kt=!1,An=function(A,rt){var Qe={useGrouping:Ge,groupingSeparator:rn,decimalSeparator:zt,grouping:gn,useToLocaleString:Ht};return tt&&(wt<=0?(A.rawValue=0,A.wholeValue=0,A.decimalValue=0):(Qe.maximumSignificantDigits=wt,A.significantDigits=wt)),Ot&&!Kt&&(A.isLargest?(A.wholeValue=Xt,A.decimalValue=0):(A.wholeValue=0,A.decimalValue=0)),_t&&!Kt&&(A.isSmallest?(A.wholeValue=He,A.decimalValue=0):(A.wholeValue=0,A.decimalValue=0)),A.isSmallest||A.significantDigits&&A.significantDigits-A.wholeValue.toString().length<=0?de<0?A.value=Gt(A.wholeValue,de):de===0?A.value=Pt(A.wholeValue+A.decimalValue):tt?(Ae?A.value=Gt(A.rawValue,wt-A.wholeValue.toString().length):A.value=A.rawValue,A.wholeValue&&(wt-=A.wholeValue.toString().length)):(Qe.fractionDigits=de,Ae?A.value=A.wholeValue+Gt(A.decimalValue,de):A.value=A.wholeValue+A.decimalValue):tt&&A.wholeValue?(A.value=Math.round(Gt(A.wholeValue,A.significantDigits-A.wholeValue.toString().length)),wt-=A.wholeValue.toString().length):A.value=A.wholeValue,A.tokenLength>1&&(be||jt)&&(Qe.minimumIntegerDigits=A.tokenLength,Kt&&Qe.maximumSignificantDigits<A.tokenLength&&delete Qe.maximumSignificantDigits),!jt&&(A.value>0||$t===""||C(se,A.type)||C(te,A.type))&&(jt=!0),A.formattedValue=h(A.value,Qe,$e),Qe.useGrouping=!1,Qe.decimalSeparator=".",A.formattedValueEn=h(A.value,Qe,"en"),A.tokenLength===2&&A.type==="milliseconds"&&(A.formattedValueMS=h(A.value,{minimumIntegerDigits:3,useGrouping:!1},"en").slice(0,2)),A};if(Ve=R(Ve,An),Ve=E(Ve),Ve.length>1){var Vr=function(A){return C(Ve,function(rt){return rt.type===A})},ir=function(A){var rt=Vr(A.type);rt&&x(A.targets,function(Qe){var Wt=Vr(Qe.type);Wt&&parseInt(rt.formattedValueEn,10)===Qe.value&&(rt.rawValue=0,rt.wholeValue=0,rt.decimalValue=0,Wt.rawValue+=1,Wt.wholeValue+=1,Wt.decimalValue=0,Wt.formattedValueEn=Wt.wholeValue.toString(),Kt=!0)})};x(l,ir)}return Kt&&(jt=!1,wt=gt,Ve=R(Ve,An),Ve=E(Ve)),te&&!(Ot&&!k.trim)?(Ve=R(Ve,function(A){return C(te,function(rt){return A.type===rt})?A:null}),Ve=E(Ve)):(lt&&(Ve=L(Ve,function(A){return!A.isSmallest&&!A.wholeValue&&!C(se,A.type)})),me&&Ve.length&&(Ve=Ve.slice(0,me)),ze&&Ve.length>1&&(Ve=_(Ve,function(A){return!A.wholeValue&&!C(se,A.type)&&!A.isLargest})),Lt&&(Ve=R(Ve,function(A,rt){return rt>0&&rt<Ve.length-1&&!A.wholeValue?null:A}),Ve=E(Ve)),vt&&Ve.length===1&&!Ve[0].wholeValue&&!(!Ae&&Ve[0].isSmallest&&Ve[0].rawValue<He)&&(Ve=[])),it?Ve:(x(Ft,function(A){var rt=nt[A.type],Qe=C(Ve,function(Qt){return Qt.type===A.type});if(!(!rt||!Qe)){var Wt=Qe.formattedValueEn.split(".");Wt[0]=parseInt(Wt[0],10),Wt[1]?Wt[1]=parseFloat("0."+Wt[1],10):Wt[1]=null;var Tn=he.durationPluralKey(rt,Wt[0],Wt[1]),wn=p(rt,he),Gn=!1,Dn={};x(he._durationLabelTypes,function(Qt){var Hn=C(wn,function(jn){return jn.type===Qt.type&&jn.key===Tn});Hn&&(Dn[Hn.type]=Hn.label,u(A.text,Qt.string)&&(A.text=A.text.replace(Qt.string,Hn.label),Gn=!0))}),Je&&!Gn&&(wn.sort(m),x(wn,function(Qt){if(Dn[Qt.type]===Qt.label)return u(A.text,Qt.label)?!1:void 0;if(u(A.text,Qt.label))return A.text=A.text.replace(Qt.label,Dn[Qt.type]),!1}))}}),Ft=R(Ft,function(A){if(!A.type)return A.text;var rt=C(Ve,function(Wt){return Wt.type===A.type});if(!rt)return"";var Qe="";return Le&&(Qe+=A.text),(Te&&Ot||!Te&&_t)&&(Qe+="< ",Ot=!1,_t=!1),(Te&&_t||!Te&&Ot)&&(Qe+="> ",Ot=!1,_t=!1),Te&&(rt.value>0||$t===""||C(se,rt.type)||C(te,rt.type))&&(Qe+="-",Te=!1),A.type==="milliseconds"&&rt.formattedValueMS?Qe+=rt.formattedValueMS:Qe+=rt.formattedValue,Le||(Qe+=A.text),Qe}),Ft.join("").replace(/(,| |:|\.)*$/,"").replace(/^(,| |:|\.)*/,""))}function ie(){var P=this.duration,k=function(Be){return P._data[Be]},$=C(this.types,k),le=M(this.types,k);switch($){case"milliseconds":return"S __";case"seconds":case"minutes":return"*_MS_";case"hours":return"_HMS_";case"days":if($===le)return"d __";case"weeks":return $===le?"w __":(this.trim===null&&(this.trim="both"),"w __, d __, h __");case"months":if($===le)return"M __";case"years":return $===le?"y __":(this.trim===null&&(this.trim="both"),"y __, M __, d __");default:return this.trim===null&&(this.trim="both"),"y __, d __, h __, m __, s __"}}function ge(P){if(!P)throw"Moment Duration Format init cannot find moment instance.";P.duration.format=J,P.duration.fn.format=ee,P.duration.fn.format.defaults={trim:null,stopTrim:null,largest:null,maxValue:null,minValue:null,precision:0,trunc:!1,forceLength:null,userLocale:null,usePlural:!0,useLeftUnits:!1,useGrouping:!0,useSignificantDigits:!1,template:ie,useToLocaleString:!0,groupingSeparator:",",decimalSeparator:".",grouping:[3]},P.updateLocale("en",w)}var fe=function(P,k,$){return P.toLocaleString(k,$)};i=Se()&&re(fe),r=i&&xe(fe);var G=function(P,k,$){if(typeof window<"u"&&window&&window.Intl&&window.Intl.NumberFormat)return window.Intl.NumberFormat(k,$).format(P)};return o=re(G),a=o&&xe(G),ge(n),ge})})(Qv);const e1=["true","t","yes","y","on","1"],t1=["false","f","no","n","off","0"];function Nt(e,t=""){return{kind:Z.Text,readonly:!0,allowOverlay:!0,data:e,displayData:e,errorDetails:t,isError:!0,style:"faded"}}function Si(e){return e.hasOwnProperty("isError")&&e.isError}function n1(e){return e.hasOwnProperty("tooltip")&&e.tooltip!==""}function Oa(e){return e.hasOwnProperty("isMissingValue")&&e.isMissingValue}function Ds(e=!1){return e?{kind:Z.Loading,allowOverlay:!1,isMissingValue:!0}:{kind:Z.Loading,allowOverlay:!1}}function r1(e,t){const n=t?"faded":"normal";return{kind:Z.Text,data:"",displayData:"",allowOverlay:!0,readonly:e,style:n}}function Os(e){return{id:e.id,title:e.title,hasMenu:!1,themeOverride:e.themeOverride,icon:e.icon,group:e.group,...e.isStretched&&{grow:e.isIndex?1:3},...e.width&&{width:e.width}}}function vo(e,t){return Ze(e)?t||{}:Ze(t)?e||{}:lc(e,t)}function gd(e){if(Ze(e))return[];if(typeof e=="number"||typeof e=="boolean")return[e];if(typeof e=="string"){if(e==="")return[];if(e.trim().startsWith("[")&&e.trim().endsWith("]"))try{return JSON.parse(e)}catch{return[e]}else return e.split(",")}try{const t=JSON.parse(JSON.stringify(e,(n,i)=>typeof i=="bigint"?Number(i):i));return Array.isArray(t)?t.map(n=>["string","number","boolean","null"].includes(typeof n)?n:Rt(n)):[Rt(t)]}catch{return[Rt(e)]}}function Rt(e){try{try{return Yf(e)}catch{return JSON.stringify(e,(n,i)=>typeof i=="bigint"?Number(i):i)}}catch{return`[${typeof e}]`}}function md(e){if(Ze(e))return null;if(typeof e=="boolean")return e;const t=Rt(e).toLowerCase().trim();if(t==="")return null;if(e1.includes(t))return!0;if(t1.includes(t))return!1}function uo(e){if(Ze(e))return null;if(Array.isArray(e))return NaN;if(typeof e=="string"){if(e.trim().length===0)return null;try{const t=uc.unformat(e.trim());if(Ct(t))return t}catch{}}else if(e instanceof Int32Array)return Number(e[0]);return Number(e)}function ba(e,t,n){return Number.isNaN(e)||!Number.isFinite(e)?"":Ze(t)||t===""?(n===0&&(e=Math.round(e)),uc(e).format(Ct(n)?`0,0.${"0".repeat(n)}`:"0,0.[0000]")):t==="percent"?new Intl.NumberFormat(void 0,{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(e):["compact","scientific","engineering"].includes(t)?new Intl.NumberFormat(void 0,{notation:t}).format(e):t==="duration[ns]"?wr.duration(e/(1e3*1e3),"milliseconds").humanize():t.startsWith("period[")?Xf(BigInt(e),t):ch.sprintf(t,e)}function xu(e,t){return t==="locale"?new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format(e.toDate()):t==="distance"?e.fromNow():t==="relative"?e.calendar():e.format(t)}function qo(e){if(Ze(e))return null;if(e instanceof Date)return isNaN(e.getTime())?void 0:e;if(typeof e=="string"&&e.trim().length===0)return null;try{const t=Number(e);if(!isNaN(t)){let n=t;t>=10**18?n=t/1e3**3:t>=10**15?n=t/1e3**2:t>=10**12&&(n=t/1e3);const i=wr.unix(n).utc();if(i.isValid())return i.toDate()}if(typeof e=="string"){const n=wr.utc(e);if(n.isValid())return n.toDate();const i=wr.utc(e,[wr.HTML5_FMT.TIME_MS,wr.HTML5_FMT.TIME_SECONDS,wr.HTML5_FMT.TIME]);if(i.isValid())return i.toDate()}}catch{return}}function pd(e){if(e%1===0)return 0;let t=e.toString();return t.indexOf("e")!==-1&&(t=e.toLocaleString("fullwide",{useGrouping:!1,maximumFractionDigits:20})),t.indexOf(".")===-1?0:t.split(".")[1].length}function i1(e,t){return t===0?Math.trunc(e):Math.trunc(e*10**t)/10**t}const o1=new RegExp(/(\r\n|\n|\r)/gm);function wa(e){return e.indexOf(`
186
- `)!==-1?e.replace(o1," "):e}function a1(e,t){if(Ze(t))return"";try{const n=t.match(e);return n&&n[1]!==void 0?decodeURIComponent(n[1].replace(/\+/g,"%20")):t}catch{return t}}const s1="line_chart",l1="area_chart",u1="bar_chart";function el(e,t,n){const i=vo({y_min:0,y_max:1},t.columnTypeOptions),r={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:t.contentAlignment,data:{kind:"sparkline-cell",values:[],displayValues:[],graphKind:n,yAxis:[i.y_min,i.y_max]}};return{...t,kind:e,sortMode:"default",isEditable:!1,getCell(o){if(Ze(i.y_min)||Ze(i.y_max)||Number.isNaN(i.y_min)||Number.isNaN(i.y_max)||i.y_min>=i.y_max)return Nt("Invalid min/max y-axis configuration",`The y_min (${i.y_min}) and y_max (${i.y_max}) configuration options must be valid numbers.`);if(Ze(o))return Ds();const a=gd(o),s=[];let l=[];if(a.length===0)return Ds();let u=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER;for(let d=0;d<a.length;d++){const f=uo(a[d]);if(Number.isNaN(f)||Ze(f))return Nt(Rt(a),`The value cannot be interpreted as a numeric array. ${Rt(f)} is not a number.`);f>u&&(u=f),f<c&&(c=f),s.push(f)}return s.length>0&&(u>i.y_max||c<i.y_min)?l=s.map(d=>u-c===0?u>(i.y_max||1)?i.y_max||1:i.y_min||0:((i.y_max||1)-(i.y_min||0))*((d-c)/(u-c))+(i.y_min||0)):l=s,{...r,copyData:s.join(","),data:{...r.data,values:l,displayValues:s.map(d=>ba(d))},isMissingValue:Ze(o)}},getCellValue(o){var a,s;return o.kind===Z.Loading||((a=o.data)==null?void 0:a.values)===void 0?null:(s=o.data)==null?void 0:s.values}}}function vd(e){return el(s1,e,"line")}vd.isEditableType=!1;function bd(e){return el(u1,e,"bar")}bd.isEditableType=!1;function wd(e){return el(l1,e,"area")}wd.isEditableType=!1;function tl(e){const t={kind:Z.Boolean,data:!1,allowOverlay:!1,contentAlign:e.contentAlignment,readonly:!e.isEditable,style:"normal"};return{...e,kind:"checkbox",sortMode:"default",getCell(n){let i=null;return i=md(n),i===void 0?Nt(Rt(n),"The value cannot be interpreted as boolean."):{...t,data:i,isMissingValue:Ze(i)}},getCellValue(n){return n.data===void 0?null:n.data}}}tl.isEditableType=!0;function ku(e,t){return t.startsWith("+")||t.startsWith("-")?e=e.utcOffset(t,!1):e=e.tz(t),e}function nl(e,t,n,i,r,o,a){var h,m;const s=vo({format:n,step:i,timezone:a},t.columnTypeOptions);let l;if(Ct(s.timezone))try{l=((h=ku(_l(),s.timezone))==null?void 0:h.utcOffset())||void 0}catch{}let u;Ct(s.min_value)&&(u=qo(s.min_value)||void 0);let c;Ct(s.max_value)&&(c=qo(s.max_value)||void 0);const d={kind:Z.Custom,allowOverlay:!0,copyData:"",readonly:!t.isEditable,contentAlign:t.contentAlignment,style:t.isPinned?"faded":"normal",data:{kind:"date-picker-cell",date:void 0,displayDate:"",step:((m=s.step)==null?void 0:m.toString())||"1",format:r,min:u,max:c}},f=p=>{const b=qo(p);return b===null?!t.isRequired:!(b===void 0||Ct(u)&&o(b)<o(u)||Ct(c)&&o(b)>o(c))};return{...t,kind:e,sortMode:"default",validateInput:f,getCell(p,b){if(b===!0){const C=f(p);if(C===!1)return Nt(Rt(p),"Invalid input.");C instanceof Date&&(p=C)}const w=qo(p);let y="",S="",M=l;if(w===void 0)return Nt(Rt(p),"The value cannot be interpreted as a datetime object.");if(w!==null){let C=_l.utc(w);if(!C.isValid())return Nt(Rt(w),`Invalid moment date. This should never happen. Please report this bug.
187
- Error: ${C.toString()}`);if(s.timezone){try{C=ku(C,s.timezone)}catch(x){return Nt(C.toISOString(),`Failed to adjust to the provided timezone: ${s.timezone}.
188
- Error: ${x}`)}M=C.utcOffset()}try{S=xu(C,s.format||n)}catch(x){return Nt(C.toISOString(),`Failed to format the date for rendering with: ${s.format}.
189
- Error: ${x}`)}y=xu(C,n)}return{...d,copyData:y,isMissingValue:Ze(w),data:{...d.data,date:w,displayDate:S,timezoneOffset:M}}},getCellValue(p){var b;return Ze((b=p==null?void 0:p.data)==null?void 0:b.date)?null:o(p.data.date)}}}function rl(e){var r,o,a,s,l;let t="YYYY-MM-DD HH:mm:ss";((r=e.columnTypeOptions)==null?void 0:r.step)>=60?t="YYYY-MM-DD HH:mm":((o=e.columnTypeOptions)==null?void 0:o.step)<1&&(t="YYYY-MM-DD HH:mm:ss.SSS");const n=(s=(a=e.arrowType)==null?void 0:a.meta)==null?void 0:s.timezone,i=Ct(n)||Ct((l=e==null?void 0:e.columnTypeOptions)==null?void 0:l.timezone);return nl("datetime",e,i?t+"Z":t,1,"datetime-local",u=>i?u.toISOString():u.toISOString().replace("Z",""),n)}rl.isEditableType=!0;function il(e){var n,i;let t="HH:mm:ss";return((n=e.columnTypeOptions)==null?void 0:n.step)>=60?t="HH:mm":((i=e.columnTypeOptions)==null?void 0:i.step)<1&&(t="HH:mm:ss.SSS"),nl("time",e,t,1,"time",r=>r.toISOString().split("T")[1].replace("Z",""))}il.isEditableType=!0;function ol(e){return nl("date",e,"YYYY-MM-DD",1,"date",t=>t.toISOString().split("T")[0])}ol.isEditableType=!0;function yd(e){const t={kind:Z.Image,data:[],displayData:[],readonly:!0,allowOverlay:!0,contentAlign:e.contentAlignment||"center",style:"normal"};return{...e,kind:"image",sortMode:"default",isEditable:!1,getCell(n){const i=Ct(n)?[Rt(n)]:[];return{...t,data:i,isMissingValue:!Ct(n),displayData:i}},getCellValue(n){return n.data===void 0||n.data.length===0?null:n.data[0]}}}yd.isEditableType=!1;function Cd(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(a){n=`Invalid validate regex: ${t.validate}.
190
- Error: ${a}`}let i;if(!Ze(t.display_text)&&t.display_text.includes("(")&&t.display_text.includes(")"))try{i=new RegExp(t.display_text,"us")}catch{i=void 0}const r={kind:Z.Uri,readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal",hoverEffect:!0,data:"",displayData:"",copyData:""},o=a=>{if(Ze(a))return!e.isRequired;const s=Rt(a);return!(t.max_chars&&s.length>t.max_chars||n instanceof RegExp&&n.test(s)===!1)};return{...e,kind:"link",sortMode:"default",validateInput:o,getCell(a,s){if(Ze(a))return{...r,data:null,isMissingValue:!0,onClickUri:()=>{}};const l=a;if(typeof n=="string")return Nt(Rt(l),n);if(s&&o(l)===!1)return Nt(Rt(l),"Invalid input.");let u="";return l&&(i!==void 0?u=a1(i,l):u=t.display_text||l),{...r,data:l,displayData:u,isMissingValue:Ze(l),onClickUri:c=>{window.open(l.startsWith("www.")?`https://${l}`:l,"_blank","noopener,noreferrer"),c.preventDefault()},copyData:l}},getCellValue(a){return Ze(a.data)?null:a.data}}}Cd.isEditableType=!0;function al(e){const t={kind:Z.Bubble,data:[],allowOverlay:!0,contentAlign:e.contentAlignment,style:"normal"};return{...e,kind:"list",sortMode:"default",isEditable:!1,getCell(n){const i=Ze(n)?[]:gd(n);return{...t,data:i,isMissingValue:Ze(n),copyData:Ze(n)?"":Rt(i.map(r=>typeof r=="string"&&r.includes(",")?r.replace(/,/g," "):r))}},getCellValue(n){return Ze(n.data)||Oa(n)?null:n.data}}}al.isEditableType=!1;function Sd(e){return e.startsWith("int")&&!e.startsWith("interval")||e==="range"||e.startsWith("uint")}function sl(e){const t=ti(e.arrowType);let n;t==="timedelta64[ns]"?n="duration[ns]":t.startsWith("period[")&&(n=t);const i=vo({step:Sd(t)?1:void 0,min_value:t.startsWith("uint")?0:void 0,format:n},e.columnTypeOptions),r=Ze(i.min_value)||i.min_value<0,o=Ct(i.step)&&!Number.isNaN(i.step)?pd(i.step):void 0,a={kind:Z.Number,data:void 0,displayData:"",readonly:!e.isEditable,allowOverlay:!0,contentAlign:e.contentAlignment||"right",style:e.isPinned?"faded":"normal",allowNegative:r,fixedDecimals:o,thousandSeparator:""},s=l=>{let u=uo(l);if(Ze(u))return!e.isRequired;if(Number.isNaN(u))return!1;let c=!1;return Ct(i.max_value)&&u>i.max_value&&(u=i.max_value,c=!0),Ct(i.min_value)&&u<i.min_value?!1:c?u:!0};return{...e,kind:"number",sortMode:"smart",validateInput:s,getCell(l,u){if(u===!0){const f=s(l);if(f===!1)return Nt(Rt(l),"Invalid input.");typeof f=="number"&&(l=f)}let c=uo(l),d="";if(Ct(c)){if(Number.isNaN(c))return Nt(Rt(l),"The value cannot be interpreted as a number.");if(Ct(o)&&(c=i1(c,o)),Number.isInteger(c)&&!Number.isSafeInteger(c))return Nt(Rt(l),"The value is larger than the maximum supported integer values in number columns (2^53).");try{d=ba(c,i.format,o)}catch(f){return Nt(Rt(c),Ct(i.format)?`Failed to format the number based on the provided format configuration: (${i.format}). Error: ${f}`:`Failed to format the number. Error: ${f}`)}}return{...a,data:c,displayData:d,isMissingValue:Ze(c),copyData:Ze(c)?"":Rt(c)}},getCellValue(l){return l.data===void 0?null:l.data}}}sl.isEditableType=!0;function xi(e){const t={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!0,style:e.isPinned?"faded":"normal"};return{...e,kind:"object",sortMode:"default",isEditable:!1,getCell(n){try{const i=Ct(n)?Rt(n):null,r=Ct(i)?wa(i):"";return{...t,data:i,displayData:r,isMissingValue:Ze(n)}}catch(i){return Nt(Rt(n),`The value cannot be interpreted as a string. Error: ${i}`)}},getCellValue(n){return n.data===void 0?null:n.data}}}xi.isEditableType=!1;function xd(e){const t=ti(e.arrowType),n=Sd(t),i=vo({min_value:0,max_value:n?100:1,step:n?1:.01,format:n?"%3d%%":"percent"},e.columnTypeOptions);let r;try{r=ba(i.max_value,i.format)}catch{r=Rt(i.max_value)}const o=Ze(i.step)||Number.isNaN(i.step)?void 0:pd(i.step),a={kind:Z.Custom,allowOverlay:!1,copyData:"",contentAlign:e.contentAlignment,data:{kind:"range-cell",min:i.min_value,max:i.max_value,step:i.step,value:i.min_value,label:String(i.min_value),measureLabel:r,readonly:!0}};return{...e,kind:"progress",sortMode:"smart",isEditable:!1,getCell(s){if(Ze(s))return Ds();if(Ze(i.min_value)||Ze(i.max_value)||Number.isNaN(i.min_value)||Number.isNaN(i.max_value)||i.min_value>=i.max_value)return Nt("Invalid min/max parameters",`The min_value (${i.min_value}) and max_value (${i.max_value}) parameters must be valid numbers.`);if(Ze(i.step)||Number.isNaN(i.step))return Nt("Invalid step parameter",`The step parameter (${i.step}) must be a valid number.`);const l=uo(s);if(Number.isNaN(l)||Ze(l))return Nt(Rt(s),"The value cannot be interpreted as a number.");if(Number.isInteger(l)&&!Number.isSafeInteger(l))return Nt(Rt(s),"The value is larger than the maximum supported integer values in number columns (2^53).");let u="";try{u=ba(l,i.format,o)}catch(d){return Nt(Rt(l),Ct(i.format)?`Failed to format the number based on the provided format configuration: (${i.format}). Error: ${d}`:`Failed to format the number. Error: ${d}`)}const c=Math.min(i.max_value,Math.max(i.min_value,l));return{...a,isMissingValue:Ze(s),copyData:String(l),data:{...a.data,value:c,label:u}}},getCellValue(s){var l,u;return s.kind===Z.Loading||((l=s.data)==null?void 0:l.value)===void 0?null:(u=s.data)==null?void 0:u.value}}}xd.isEditableType=!1;function ll(e){let t="string";const n=vo({options:ti(e.arrowType)==="bool"?[!0,!1]:[]},e.columnTypeOptions),i=new Set(n.options.map(o=>typeof o));i.size===1&&(i.has("number")||i.has("bigint")?t="number":i.has("boolean")&&(t="boolean"));const r={kind:Z.Custom,allowOverlay:!0,copyData:"",contentAlign:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal",data:{kind:"dropdown-cell",allowedValues:[...e.isRequired!==!0?[null]:[],...n.options.filter(o=>o!==null&&o!=="").map(o=>Rt(o))],value:""}};return{...e,kind:"selectbox",sortMode:"default",getCell(o,a){let s=null;return Ct(o)&&o!==""&&(s=Rt(o)),a&&!r.data.allowedValues.includes(s)?Nt(Rt(s),"The value is not part of the allowed options."):{...r,isMissingValue:s===null,copyData:s||"",data:{...r.data,value:s}}},getCellValue(o){var a,s,l,u,c;return Ze((a=o.data)==null?void 0:a.value)||((s=o.data)==null?void 0:s.value)===""?null:t==="number"?uo((l=o.data)==null?void 0:l.value)??null:t==="boolean"?md((u=o.data)==null?void 0:u.value)??null:(c=o.data)==null?void 0:c.value}}}ll.isEditableType=!0;function ul(e){const t=e.columnTypeOptions||{};let n;if(t.validate)try{n=new RegExp(t.validate,"us")}catch(o){n=`Invalid validate regex: ${t.validate}.
191
- Error: ${o}`}const i={kind:Z.Text,data:"",displayData:"",allowOverlay:!0,contentAlignment:e.contentAlignment,readonly:!e.isEditable,style:e.isPinned?"faded":"normal"},r=o=>{if(Ze(o))return!e.isRequired;let a=Rt(o),s=!1;return t.max_chars&&a.length>t.max_chars&&(a=a.slice(0,t.max_chars),s=!0),n instanceof RegExp&&n.test(a)===!1?!1:s?a:!0};return{...e,kind:"text",sortMode:"default",validateInput:r,getCell(o,a){if(typeof n=="string")return Nt(Rt(o),n);if(a){const s=r(o);if(s===!1)return Nt(Rt(o),"Invalid input.");typeof s=="string"&&(o=s)}try{const s=Ct(o)?Rt(o):null,l=Ct(s)?wa(s):"";return{...i,isMissingValue:Ze(s),data:s,displayData:l}}catch(s){return Nt("Incompatible value",`The value cannot be interpreted as string. Error: ${s}`)}},getCellValue(o){return o.data===void 0?null:o.data}}}ul.isEditableType=!0;const Mu=cc("img",{target:"eeie4760"})({maxWidth:"100%",maxHeight:"37.5rem",objectFit:"scale-down"}),c1=({urls:e})=>{const t=e&&e.length>0?e[0]:"";return t.startsWith("http")?xn("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:xn(Mu,{src:t})}):xn(Mu,{src:t})},Ru=new Map(Object.entries({object:xi,text:ul,checkbox:tl,selectbox:ll,list:al,number:sl,link:Cd,datetime:rl,date:ol,time:il,line_chart:vd,bar_chart:bd,area_chart:wd,image:yd,progress:xd})),d1=[];function Eu(e,t,n){const i=new RegExp(`${e}[,\\s].*{(?:[^}]*[\\s;]{1})?${t}:\\s*([^;}]+)[;]?.*}`,"gm");n=n.replace(/{/g," {");const r=i.exec(n);if(r)return r[1].trim()}function f1(e,t,n){const i={},r=Eu(t,"color",n);r&&(i.textDark=r);const o=Eu(t,"background-color",n);return o&&(i.bgCell=o),o==="yellow"&&r===void 0&&(i.textDark="#31333F"),i?{...e,themeOverride:i}:e}function h1(e){let t=e?ti(e):null;return t?(t=t.toLowerCase().trim(),["unicode","empty","large_string[pyarrow]"].includes(t)?ul:["datetime","datetimetz"].includes(t)?rl:t==="time"?il:t==="date"?ol:["object","bytes"].includes(t)?xi:["bool"].includes(t)?tl:["int8","int16","int32","int64","uint8","uint16","uint32","uint64","float16","float32","float64","float96","float128","range","decimal"].includes(t)?sl:t==="categorical"?ll:t.startsWith("list")?al:xi):xi}function g1(e,t){const n=e.types.index[t],i=e.indexNames[t];let r=!0;return ti(n)==="range"&&(r=!1),{id:`index-${t}`,name:i,title:i,isEditable:r,arrowType:n,isIndex:!0,isPinned:!0,isHidden:!1}}function m1(e,t){const n=e.columns.map(s=>s[t]),i=n.length>0?n[n.length-1]:"",r=n.length>1?n.slice(0,-1).filter(s=>s!=="").join(" / "):void 0;let o=e.types.data[t];Ze(o)&&(o={meta:null,numpy_type:"object",pandas_type:"object"});let a;if(ti(o)==="categorical"){const s=e.getCategoricalOptions(t);Ct(s)&&(a={options:s})}return{id:`column-${i}-${t}`,name:i,title:i,isEditable:!0,arrowType:o,columnTypeOptions:a,isIndex:!1,isPinned:!1,isHidden:!1,group:r}}function kd(){return{id:"empty-index",title:"",indexNumber:0,isEditable:!1,isIndex:!0,isPinned:!0}}function p1(e){const t=[],{dimensions:n}=e,i=n.headerColumns,r=n.dataColumns;if(i===0&&r===0)return t.push(kd()),t;for(let o=0;o<i;o++){const a={...g1(e,o),indexNumber:o};t.push(a)}for(let o=0;o<r;o++){const a={...m1(e,o),indexNumber:o+i};t.push(a)}return t}function v1(e,t,n=void 0){var o,a,s,l,u,c,d,f;const i=e.arrowType?ti(e.arrowType):null;let r;if(e.kind==="object")r=e.getCell(Ct(t.content)?wa(Ll(t.content,t.contentType,t.field)):null);else if(["time","date","datetime"].includes(e.kind)&&Ct(t.content)&&(typeof t.content=="number"||typeof t.content=="bigint")){let h;i==="time"&&Ct((a=(o=t.field)==null?void 0:o.type)==null?void 0:a.unit)?h=wr.unix(Gf(t.content,((l=(s=t.field)==null?void 0:s.type)==null?void 0:l.unit)??0)).utc().toDate():h=wr.utc(Number(t.content)).toDate(),r=e.getCell(h)}else if(i==="decimal"){const h=Ze(t.content)?null:Ll(t.content,t.contentType,t.field);r=e.getCell(h)}else r=e.getCell(t.content);if(Si(r))return r;if(!e.isEditable){if(Ct(t.displayContent)){const h=wa(t.displayContent);r.kind===Z.Text?r={...r,displayData:h}:r.kind===Z.Number&&Ze((u=e.columnTypeOptions)==null?void 0:u.format)?r={...r,displayData:h}:r.kind===Z.Uri&&Ze((c=e.columnTypeOptions)==null?void 0:c.display_text)?r={...r,displayData:h}:r.kind===Z.Custom&&((d=r.data)==null?void 0:d.kind)==="date-picker-cell"&&Ze((f=e.columnTypeOptions)==null?void 0:f.format)&&(r={...r,data:{...r.data,displayDate:h}})}n&&t.cssId&&(r=f1(r,t.cssId,n))}return r}const ia="_index",Iu="_pos:",Tu={small:75,medium:200,large:400};function b1(e){if(!Ze(e)){if(typeof e=="number")return e;if(e in Tu)return Tu[e]}}function w1(e,t){if(!t)return e;let n;return t.has(e.name)&&e.name!==ia?n=t.get(e.name):t.has(`${Iu}${e.indexNumber}`)?n=t.get(`${Iu}${e.indexNumber}`):e.isIndex&&t.has(ia)&&(n=t.get(ia)),n?lc({...e},{title:n.label,width:b1(n.width),isEditable:Ct(n.disabled)?!n.disabled:void 0,isHidden:n.hidden,isPinned:n.pinned,isRequired:n.required,columnTypeOptions:n.type_config,contentAlignment:n.alignment,defaultValue:n.default,help:n.help}):e}function y1(e){if(!e)return new Map;try{return new Map(Object.entries(JSON.parse(e)))}catch(t){return dc(t),new Map}}function C1(e){var i;const t=(i=e.columnTypeOptions)==null?void 0:i.type;let n;return Ct(t)&&Ru.has(t)&&(n=Ru.get(t)),Ze(n)&&(n=h1(e.arrowType)),n}function S1(e,t,n){const i=Hs(),r=ae.useMemo(()=>y1(e.columns),[e.columns]),o=e.useContainerWidth||Ct(e.width)&&e.width>0;return{columns:ae.useMemo(()=>{var d;const s=p1(t).map(f=>{let h={...f,...w1(f,r),isStretched:o};const m=C1(h);return(e.editingMode===Un.EditingMode.READ_ONLY||n||m.isEditableType===!1)&&(h={...h,isEditable:!1}),e.editingMode!==Un.EditingMode.READ_ONLY&&h.isEditable==!0&&(h={...h,icon:"editable"},h.isRequired&&e.editingMode===Un.EditingMode.DYNAMIC&&(h={...h,isHidden:!1})),m(h,i)}).filter(f=>!f.isHidden),l=[],u=[];(d=e.columnOrder)!=null&&d.length?(s.forEach(f=>{f.isIndex&&!e.columnOrder.includes(f.name)&&f.isPinned!==!1&&l.push(f)}),e.columnOrder.forEach(f=>{const h=s.find(m=>m.name===f);h&&(h.isPinned?l.push(h):u.push(h))})):s.forEach(f=>{f.isPinned?l.push(f):u.push(f)});const c=[...l,...u];return c.length>0?c:[xi(kd())]},[t,r,o,n,e.editingMode,e.columnOrder,i])}}function oo(e){return e.isIndex?ia:Ze(e.name)?"":e.name}class Ko{constructor(t){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[],this.numRows=0,this.numRows=t}toJson(t){const n=new Map;t.forEach(o=>{n.set(o.indexNumber,o)});const i={edited_rows:{},added_rows:[],deleted_rows:[]};return this.editedCells.forEach((o,a,s)=>{const l={};o.forEach((u,c,d)=>{const f=n.get(c);f&&(l[oo(f)]=f.getCellValue(u))}),i.edited_rows[a]=l}),this.addedRows.forEach(o=>{const a={};let s=!1;o.forEach((l,u,c)=>{const d=n.get(u);if(d){const f=d.getCellValue(l);d.isRequired&&d.isEditable&&Oa(l)&&(s=!0),Ct(f)&&(a[oo(d)]=f)}}),s||i.added_rows.push(a)}),i.deleted_rows=this.deletedRows,JSON.stringify(i,(o,a)=>a===void 0?null:a)}fromJson(t,n){this.editedCells=new Map,this.addedRows=[],this.deletedRows=[];const i=JSON.parse(t),r=new Map;n.forEach(a=>{r.set(a.indexNumber,a)});const o=new Map;n.forEach(a=>{o.set(oo(a),a)}),Object.keys(i.edited_rows).forEach(a=>{const s=Number(a),l=i.edited_rows[a];Object.keys(l).forEach(u=>{var f;const c=l[u],d=o.get(u);if(d){const h=d.getCell(c);h&&(this.editedCells.has(s)||this.editedCells.set(s,new Map),(f=this.editedCells.get(s))==null||f.set(d.indexNumber,h))}})}),i.added_rows.forEach(a=>{const s=new Map;n.forEach(l=>{s.set(l.indexNumber,l.getCell(null))}),Object.keys(a).forEach(l=>{const u=a[l],c=o.get(l);if(c){const d=c.getCell(u);d&&s.set(c.indexNumber,d)}}),this.addedRows.push(s)}),this.deletedRows=i.deleted_rows}isAddedRow(t){return t>=this.numRows}getCell(t,n){if(this.isAddedRow(n))return this.addedRows[n-this.numRows].get(t);const i=this.editedCells.get(n);if(i!==void 0)return i.get(t)}setCell(t,n,i){if(this.isAddedRow(n)){if(n-this.numRows>=this.addedRows.length)return;this.addedRows[n-this.numRows].set(t,i)}else this.editedCells.get(n)===void 0&&this.editedCells.set(n,new Map),this.editedCells.get(n).set(t,i)}addRow(t){this.addedRows.push(t)}deleteRows(t){t.sort((n,i)=>i-n).forEach(n=>{this.deleteRow(n)})}deleteRow(t){if(!(Ze(t)||t<0)){if(this.isAddedRow(t)){this.addedRows.splice(t-this.numRows,1);return}this.deletedRows.includes(t)||(this.deletedRows.push(t),this.deletedRows=this.deletedRows.sort((n,i)=>n-i)),this.editedCells.delete(t)}}getOriginalRowIndex(t){let n=t;for(let i=0;i<this.deletedRows.length&&!(this.deletedRows[i]>n);i++)n+=1;return n}getNumRows(){return this.numRows+this.addedRows.length-this.deletedRows.length}}function x1(){const e=Hs();return ae.useMemo(()=>{const n={editable:r=>`<svg xmlns="http://www.w3.org/2000/svg" height="40" viewBox="0 96 960 960" width="40" fill="${r.bgColor}"><path d="m800.641 679.743-64.384-64.384 29-29q7.156-6.948 17.642-6.948 10.485 0 17.742 6.948l29 29q6.948 7.464 6.948 17.95 0 10.486-6.948 17.434l-29 29Zm-310.64 246.256v-64.383l210.82-210.821 64.384 64.384-210.821 210.82h-64.383Zm-360-204.872v-50.254h289.743v50.254H130.001Zm0-162.564v-50.255h454.615v50.255H130.001Zm0-162.307v-50.255h454.615v50.255H130.001Z"/></svg>`};return{glideTheme:{accentColor:e.colors.primary,accentFg:e.colors.white,accentLight:es(e.colors.primary,.9),borderColor:e.colors.borderColorLight,horizontalBorderColor:e.colors.borderColorLight,fontFamily:e.genericFonts.bodyFont,bgSearchResult:es(e.colors.primary,.9),resizeIndicatorColor:e.colors.primary,bgIconHeader:e.colors.fadedText60,fgIconHeader:e.colors.white,bgHeader:e.colors.bgMix,bgHeaderHasFocus:e.colors.secondaryBg,bgHeaderHovered:e.colors.secondaryBg,textHeader:e.colors.fadedText60,textHeaderSelected:e.colors.white,textGroupHeader:e.colors.fadedText60,headerFontStyle:`${e.fontSizes.sm}`,baseFontStyle:e.fontSizes.sm,editorFontSize:e.fontSizes.sm,textDark:e.colors.bodyText,textMedium:es(e.colors.bodyText,.2),textLight:e.colors.fadedText40,textBubble:e.colors.fadedText60,bgCell:e.colors.bgColor,bgCellMedium:e.colors.bgColor,cellHorizontalPadding:Math.round(Pr(e.spacing.sm)),cellVerticalPadding:Math.round(Pr("0.1875rem")),bgBubble:e.colors.secondaryBg,bgBubbleSelected:e.colors.secondaryBg,linkColor:e.colors.linkText,drilldownBorder:e.colors.darkenedBgMix25},tableBorderRadius:e.radii.default,tableBorderWidth:1,defaultTableHeight:Math.round(Pr("25rem")),minColumnWidth:Math.round(Pr("3.125rem")),maxColumnWidth:Math.round(Pr("62.5rem")),maxColumnAutoWidth:Math.round(Pr("31.25rem")),defaultRowHeight:Math.round(Pr("2.1875rem")),defaultHeaderHeight:Math.round(Pr("2.1875rem")),headerIcons:n}},[e])}function k1(e,t,n,i){const r=e.columns.length;return{getCellContent:ae.useCallback(([a,s])=>{if(a>t.length-1)return Nt("Column index out of bounds","This error should never happen. Please report this bug.");if(s>n-1)return Nt("Row index out of bounds","This error should never happen. Please report this bug.");const l=t[a],u=l.indexNumber,c=i.current.getOriginalRowIndex(s),d=i.current.isAddedRow(c);if(l.isEditable||d){const f=i.current.getCell(u,c);if(Ct(f))return f;if(d)return Nt("Error during cell creation",`This error should never happen. Please report this bug. No cell found for an added row: col=${u}; row=${c}`)}try{const f=e.getCell(c+r,u);return v1(l,f,e.cssStyles)}catch(f){return Nt("Error during cell creation",`This error should never happen. Please report this bug.
192
- Error: ${f}`)}},[t,n,e,i,r])}}function M1(e,t,n,i,r,o,a){const s=t.defaultRowHeight,l=t.defaultHeaderHeight+s+2*t.tableBorderWidth,u=i?2:1,c=e.editingMode===Un.EditingMode.DYNAMIC?1:0,d=n+c;let f=Math.max(d*s+u*t.defaultHeaderHeight+2*t.tableBorderWidth,l),h=Math.min(f,t.defaultTableHeight);e.height&&(h=Math.max(e.height,l),f=Math.max(e.height,f)),o&&(h=Math.min(h,o),f=Math.min(f,o),e.height||(h=f));const m=t.minColumnWidth+2*t.tableBorderWidth,p=Math.max(r,m);let b,w=p;e.useContainerWidth?b=p:e.width&&(b=Math.min(Math.max(e.width,m),p),w=Math.min(Math.max(e.width,w),p));const[y,S]=ae.useState({width:b||"100%",height:h});return ae.useLayoutEffect(()=>{e.useContainerWidth&&y.width==="100%"&&S(M=>({...M,width:p}))},[p]),ae.useLayoutEffect(()=>{S(M=>({...M,width:b||"100%"}))},[b]),ae.useLayoutEffect(()=>{S(M=>({...M,height:h}))},[h,n]),ae.useLayoutEffect(()=>{if(a){const M=e.useContainerWidth||Ct(e.width)&&e.width>0;S({width:M?w:"100%",height:f})}else S({width:b||"100%",height:h})},[a]),{minHeight:l,maxHeight:f,minWidth:m,maxWidth:w,rowHeight:s,resizableSize:y,setResizableSize:S}}function R1(e,t,n,i,r,o,a,s,l){const u=ae.useCallback(([p,b],w)=>{const y=e[p];if(!y.isEditable)return;const S=y.indexNumber,M=n.current.getOriginalRowIndex(r(b)),C=i([p,b]),x=y.getCellValue(C),R=y.getCellValue(w);if(!Si(C)&&R===x)return;const I=y.getCell(R,!0);Si(I)?fc(`Not applying the cell edit since it causes this error:
193
- ${I.data}`):(n.current.setCell(S,M,{...I,lastUpdated:performance.now()}),s())},[e,n,r,i,s]),c=ae.useCallback(()=>{if(t)return;const p=new Map;e.forEach(b=>{p.set(b.indexNumber,b.getCell(b.defaultValue))}),n.current.addRow(p),a()},[e,n,t,a]),d=ae.useCallback(()=>{t||(c(),s())},[c,s,t]),f=ae.useCallback(p=>{var b;if(p.rows.length>0){if(t)return!0;const w=p.rows.toArray().map(y=>n.current.getOriginalRowIndex(r(y)));return n.current.deleteRows(w),a(),l(),s(),!1}if((b=p.current)!=null&&b.range){const w=[],y=p.current.range;for(let S=y.y;S<y.y+y.height;S++)for(let M=y.x;M<y.x+y.width;M++){const C=e[M];C.isEditable&&!C.isRequired&&(w.push({cell:[M,S]}),u([M,S],C.getCell(null)))}return w.length>0&&(s(),o(w)),!1}return!0},[e,n,t,o,r,s,u,l,a]),h=ae.useCallback((p,b)=>{const[w,y]=p,S=[];for(let M=0;M<b.length;M++){const C=b[M];if(M+y>=n.current.getNumRows()){if(t)break;c()}for(let x=0;x<C.length;x++){const R=C[x],I=M+y,E=x+w;if(E>=e.length)break;const H=e[E];if(H.isEditable){const z=H.getCell(R,!0);if(Ct(z)&&!Si(z)){const L=H.indexNumber,_=n.current.getOriginalRowIndex(r(I)),O=H.getCellValue(i([E,I]));H.getCellValue(z)!==O&&(n.current.setCell(L,_,{...z,lastUpdated:performance.now()}),S.push({cell:[E,I]}))}}}S.length>0&&(s(),o(S))}return!1},[e,n,t,r,i,c,s,o]),m=ae.useCallback((p,b)=>{const w=p[0];if(w>=e.length)return!0;const y=e[w];if(y.validateInput){const S=y.validateInput(y.getCellValue(b));return S===!0||S===!1?S:y.getCell(S)}return!0},[e]);return{onCellEdited:u,onPaste:h,onRowAppended:d,onDelete:f,validateCell:m}}function E1(e){const[t,n]=g.useState(()=>new Map),i=ae.useCallback((o,a,s,l)=>{o.id&&n(new Map(t).set(o.id,l))},[t]);return{columns:ae.useMemo(()=>e.map(o=>o.id&&t.has(o.id)&&t.get(o.id)!==void 0?{...o,width:t.get(o.id),grow:0}:o),[e,t]),onColumnResize:i}}function I1(e){var t,n;switch(e.kind){case Z.Number:return((t=e.data)==null?void 0:t.toString())??"";case Z.Boolean:return((n=e.data)==null?void 0:n.toString())??"";case Z.Markdown:case Z.RowID:case Z.Text:case Z.Uri:return e.data??"";case Z.Bubble:case Z.Image:return e.data.join("");case Z.Drilldown:return e.data.map(i=>i.text).join("");case Z.Protected:case Z.Loading:return"";case Z.Custom:return e.copyData}}function Du(e){if(typeof e=="number")return e;if(e.length>0){const t=Number(e);isNaN(t)||(e=t)}return e}function T1(e,t){return e=Du(e),t=Du(t),typeof e=="string"&&typeof t=="string"?e.localeCompare(t):typeof e=="number"&&typeof t=="number"?e===t?0:e>t?1:-1:e==t?0:e>t?1:-1}function D1(e,t){return e>t?1:e===t?0:-1}function O1(e){const{sort:t,rows:n,getCellContent:i}=e;let r=t===void 0?void 0:e.columns.findIndex(u=>t.column===u||u.id!==void 0&&t.column.id===u.id);r===-1&&(r=void 0);const o=(t==null?void 0:t.direction)??"asc",a=g.useMemo(()=>{if(r===void 0)return;const u=new Array(n),c=[r,0];for(let f=0;f<n;f++)c[1]=f,u[f]=I1(i(c));let d;return(t==null?void 0:t.mode)==="raw"?d=cr(n).sort((f,h)=>D1(u[f],u[h])):(t==null?void 0:t.mode)==="smart"?d=cr(n).sort((f,h)=>T1(u[f],u[h])):d=cr(n).sort((f,h)=>u[f].localeCompare(u[h])),o==="desc"&&d.reverse(),d},[i,n,t==null?void 0:t.mode,o,r]),s=g.useCallback(u=>a===void 0?u:a[u],[a]),l=g.useCallback(([u,c])=>a===void 0?i([u,c]):(c=a[c],i([u,c])),[i,a]);return a===void 0?{getCellContent:e.getCellContent,getOriginalIndex:s}:{getOriginalIndex:s,getCellContent:l}}function P1(e,t){return t===void 0?e:e.map(n=>n.id===t.column.id?{...n,title:t.direction==="asc"?`↑ ${n.title}`:`↓ ${n.title}`}:n)}function _1(e,t,n){const[i,r]=ae.useState(),{getCellContent:o,getOriginalIndex:a}=O1({columns:t.map(u=>Os(u)),getCellContent:n,rows:e,sort:i}),s=ae.useMemo(()=>P1(t,i),[t,i]),l=ae.useCallback(u=>{let c="asc";const d=s[u];if(i&&i.column.id===d.id)if(i.direction==="asc")c="desc";else{r(void 0);return}r({column:Os(d),direction:c,mode:d.sortMode})},[i,s]);return{columns:s,sortColumn:l,getOriginalIndex:a,getCellContent:o}}const L1=600,F1="⚠️ Please fill out this cell.";function A1(e,t){const[n,i]=ae.useState(),r=ae.useRef(null),o=ae.useCallback(s=>{if(clearTimeout(r.current),r.current=0,i(void 0),(s.kind==="header"||s.kind==="cell")&&s.location){const l=s.location[0],u=s.location[1];let c;if(l<0||l>=e.length)return;const d=e[l];if(s.kind==="header"&&Ct(d))c=d.help;else if(s.kind==="cell"){const f=t([l,u]);Si(f)?c=f.errorDetails:d.isRequired&&d.isEditable&&Oa(f)?c=F1:n1(f)&&(c=f.tooltip)}c&&(r.current=setTimeout(()=>{c&&i({content:c,left:s.bounds.x+s.bounds.width/2,top:s.bounds.y})},L1))}},[e,t,i,r]),a=ae.useCallback(()=>{i(void 0)},[i]);return{tooltip:n,clearTooltip:a,onItemHovered:o}}const H1={kind:Z.Custom,isMatch:e=>e.data.kind==="sparkline-cell",needsHover:!0,needsHoverPosition:!0,draw:(e,t)=>{const{ctx:n,theme:i,rect:r,hoverAmount:o,hoverX:a}=e;let{values:s,yAxis:l,color:u,graphKind:c="area",displayValues:d,hideAxis:f}=t.data;const[h,m]=l;if(s.length===0)return!0;s=s.map(x=>Math.min(1,Math.max(0,(x-h)/(m-h))));const p=i.cellHorizontalPadding,b=p+r.x,w=r.y+3,y=r.height-6,S=r.width-p*2,M=m-h,C=m<=0?w:h>=0?w+y:w+y*(m/M);if(!f&&h<=0&&m>=0&&(n.beginPath(),n.moveTo(b,C),n.lineTo(b+S,C),n.globalAlpha=.4,n.lineWidth=1,n.strokeStyle=i.textLight,n.stroke(),n.globalAlpha=1),c==="bar"){n.beginPath();const x=2,R=(s.length-1)*x,I=(S-R)/s.length;let E=b;for(const H of s){const z=w+y-H*y;n.moveTo(E,C),n.lineTo(E+I,C),n.lineTo(E+I,z),n.lineTo(E,z),E+=I+x}n.fillStyle=t.data.color??i.accentColor,n.fill()}else{s.length===1&&(s=[s[0],s[0]],d&&(d=[d[0],d[0]])),n.beginPath();const x=(r.width-16)/(s.length-1),R=s.map((E,H)=>({x:b+x*H,y:w+y-E*y}));n.moveTo(R[0].x,R[0].y);let I=0;if(R.length>2)for(I=1;I<R.length-2;I++){const E=(R[I].x+R[I+1].x)/2,H=(R[I].y+R[I+1].y)/2;n.quadraticCurveTo(R[I].x,R[I].y,E,H)}if(n.quadraticCurveTo(R[I].x,R[I].y,R[I+1].x,R[I+1].y),n.strokeStyle=u??i.accentColor,n.lineWidth=1+o*.5,n.stroke(),n.lineTo(r.x+r.width-p,C),n.lineTo(r.x+p,C),n.closePath(),c==="area"){n.globalAlpha=.2+.2*o;const E=n.createLinearGradient(0,w,0,w+y*1.4);E.addColorStop(0,u??i.accentColor);const[H,z,L]=ha(u??i.accentColor);E.addColorStop(1,`rgba(${H}, ${z}, ${L}, 0)`),n.fillStyle=E,n.fill(),n.globalAlpha=1}if(a!==void 0&&(c==="line"||c==="area")&&d!==void 0){n.beginPath();const E=Math.min(s.length-1,Math.max(0,Math.round((a-p)/x)));n.moveTo(b+E*x,r.y+1),n.lineTo(b+E*x,r.y+r.height),n.lineWidth=1,n.strokeStyle=i.textLight,n.stroke(),n.save(),n.font=`8px ${i.fontFamily}`,n.fillStyle=i.textMedium,n.textBaseline="top",n.fillText(d[E],b,r.y+i.cellVerticalPadding),n.restore()}}return!0},provideEditor:()=>{},onPaste:(e,t)=>t};function Ou(e,t,n,i,r,o){if(!(i<=0||r<=0)){if(typeof o=="number"&&o<=0){e.rect(t,n,i,r);return}typeof o=="number"&&(o={tl:o,tr:o,br:o,bl:o}),o={tl:Math.min(o.tl,r/2,i/2),tr:Math.min(o.tr,r/2,i/2),bl:Math.min(o.bl,r/2,i/2),br:Math.min(o.br,r/2,i/2)},o.tl=Math.max(0,o.tl),o.tr=Math.max(0,o.tr),o.br=Math.max(0,o.br),o.bl=Math.max(0,o.bl),e.moveTo(t+o.tl,n),e.arcTo(t+i,n,t+i,n+o.tr,o.tr),e.arcTo(t+i,n+r,t+i-o.br,n+r,o.br),e.arcTo(t,n+r,t,n+r-o.bl,o.bl),e.arcTo(t,n,t+o.tl,n,o.tl)}}function Pu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function Ye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Pu(Object(n),!0).forEach(function(i){qi(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pu(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}var z1=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function $1(e){var t=e.defaultInputValue,n=t===void 0?"":t,i=e.defaultMenuIsOpen,r=i===void 0?!1:i,o=e.defaultValue,a=o===void 0?null:o,s=e.inputValue,l=e.menuIsOpen,u=e.onChange,c=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,h=e.value,m=kr(e,z1),p=g.useState(s!==void 0?s:n),b=Cr(p,2),w=b[0],y=b[1],S=g.useState(l!==void 0?l:r),M=Cr(S,2),C=M[0],x=M[1],R=g.useState(h!==void 0?h:a),I=Cr(R,2),E=I[0],H=I[1],z=g.useCallback(function(Se,xe){typeof u=="function"&&u(Se,xe),H(Se)},[u]),L=g.useCallback(function(Se,xe){var re;typeof c=="function"&&(re=c(Se,xe)),y(re!==void 0?re:Se)},[c]),_=g.useCallback(function(){typeof f=="function"&&f(),x(!0)},[f]),O=g.useCallback(function(){typeof d=="function"&&d(),x(!1)},[d]),ne=s!==void 0?s:w,q=l!==void 0?l:C,oe=h!==void 0?h:E;return Ye(Ye({},m),{},{inputValue:ne,menuIsOpen:q,onChange:z,onInputChange:L,onMenuClose:O,onMenuOpen:_,value:oe})}function V1(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}const N1=Math.min,B1=Math.max,ya=Math.round,Zo=Math.floor,Ca=e=>({x:e,y:e});function W1(e){const{x:t,y:n,width:i,height:r}=e;return{width:i,height:r,top:n,left:t,right:t+i,bottom:n+r,x:t,y:n}}function Pa(){return typeof window<"u"}function Md(e){return Ed(e)?(e.nodeName||"").toLowerCase():"#document"}function xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rd(e){var t;return(t=(Ed(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ed(e){return Pa()?e instanceof Node||e instanceof xr(e).Node:!1}function U1(e){return Pa()?e instanceof Element||e instanceof xr(e).Element:!1}function cl(e){return Pa()?e instanceof HTMLElement||e instanceof xr(e).HTMLElement:!1}function _u(e){return!Pa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xr(e).ShadowRoot}function Id(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=dl(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(r)}function Y1(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function X1(e){return["html","body","#document"].includes(Md(e))}function dl(e){return xr(e).getComputedStyle(e)}function G1(e){if(Md(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_u(e)&&e.host||Rd(e);return _u(t)?t.host:t}function Td(e){const t=G1(e);return X1(t)?e.ownerDocument?e.ownerDocument.body:e.body:cl(t)&&Id(t)?t:Td(t)}function Sa(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Td(e),o=r===((i=e.ownerDocument)==null?void 0:i.body),a=xr(r);if(o){const s=Ps(a);return t.concat(a,a.visualViewport||[],Id(r)?r:[],s&&n?Sa(s):[])}return t.concat(r,Sa(r,[],n))}function Ps(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function j1(e){const t=dl(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=cl(e),o=r?e.offsetWidth:n,a=r?e.offsetHeight:i,s=ya(n)!==o||ya(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function fl(e){return U1(e)?e:e.contextElement}function Lu(e){const t=fl(e);if(!cl(t))return Ca(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:o}=j1(t);let a=(o?ya(n.width):n.width)/i,s=(o?ya(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const q1=Ca(0);function K1(e){const t=xr(e);return!Y1()||!t.visualViewport?q1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Z1(e,t,n){return!1}function Fu(e,t,n,i){t===void 0&&(t=!1);const r=e.getBoundingClientRect(),o=fl(e);let a=Ca(1);t&&(a=Lu(e));const s=Z1()?K1(o):Ca(0);let l=(r.left+s.x)/a.x,u=(r.top+s.y)/a.y,c=r.width/a.x,d=r.height/a.y;if(o){const f=xr(o),h=i;let m=f,p=Ps(m);for(;p&&i&&h!==m;){const b=Lu(p),w=p.getBoundingClientRect(),y=dl(p),S=w.left+(p.clientLeft+parseFloat(y.paddingLeft))*b.x,M=w.top+(p.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,u*=b.y,c*=b.x,d*=b.y,l+=S,u+=M,m=xr(p),p=Ps(m)}}return W1({width:c,height:d,x:l,y:u})}function J1(e,t){let n=null,i;const r=Rd(e);function o(){var s;clearTimeout(i),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const h=Zo(c),m=Zo(r.clientWidth-(u+d)),p=Zo(r.clientHeight-(c+f)),b=Zo(u),y={rootMargin:-h+"px "+-m+"px "+-p+"px "+-b+"px",threshold:B1(0,N1(1,l))||1};let S=!0;function M(C){const x=C[0].intersectionRatio;if(x!==l){if(!S)return a();x?a(!1,x):i=setTimeout(()=>{a(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(M,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(M,y)}n.observe(e)}return a(!0),o}function Q1(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=fl(e),c=r||o?[...u?Sa(u):[],...Sa(t)]:[];c.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const d=u&&s?J1(u,n):null;let f=-1,h=null;a&&(h=new ResizeObserver(w=>{let[y]=w;y&&y.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let m,p=l?Fu(e):null;l&&b();function b(){const w=Fu(e);p&&(w.x!==p.x||w.y!==p.y||w.width!==p.width||w.height!==p.height)&&n(),p=w,m=requestAnimationFrame(b)}return n(),()=>{var w;c.forEach(y=>{r&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(m)}}var _s=g.useLayoutEffect,eb=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],xa=function(){};function tb(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function nb(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];var o=[].concat(i);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&o.push("".concat(tb(e,a)));return o.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var Au=function(t){return db(t)?t.filter(Boolean):qf(t)==="object"&&t!==null?[t]:[]},Dd=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=kr(t,eb);return Ye({},n)},nn=function(t,n,i){var r=t.cx,o=t.getStyles,a=t.getClassNames,s=t.className;return{css:o(n,t),className:r(i??{},a(n,t),s)}};function _a(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function rb(e){return _a(e)?window.innerHeight:e.clientHeight}function Od(e){return _a(e)?window.pageYOffset:e.scrollTop}function ka(e,t){if(_a(e)){window.scrollTo(0,t);return}e.scrollTop=t}function ib(e){var t=getComputedStyle(e),n=t.position==="absolute",i=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),!(n&&t.position==="static")&&i.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}function ob(e,t,n,i){return n*((e=e/i-1)*e*e+1)+t}function Jo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:xa,r=Od(e),o=t-r,a=10,s=0;function l(){s+=a;var u=ob(s,r,o,n);ka(e,u),s<n?window.requestAnimationFrame(l):i(e)}l()}function Hu(e,t){var n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),r=t.offsetHeight/3;i.bottom+r>n.bottom?ka(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):i.top-r<n.top&&ka(e,Math.max(t.offsetTop-r,0))}function ab(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function zu(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function sb(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Pd=!1,lb={get passive(){return Pd=!0}},Qo=typeof window<"u"?window:{};Qo.addEventListener&&Qo.removeEventListener&&(Qo.addEventListener("p",xa,lb),Qo.removeEventListener("p",xa,!1));var ub=Pd;function cb(e){return e!=null}function db(e){return Array.isArray(e)}function ea(e,t,n){return e?t:n}var fb=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=Object.entries(t).filter(function(a){var s=Cr(a,1),l=s[0];return!i.includes(l)});return o.reduce(function(a,s){var l=Cr(s,2),u=l[0],c=l[1];return a[u]=c,a},{})},hb=["children","innerProps"],gb=["children","innerProps"];function mb(e){var t=e.maxHeight,n=e.menuEl,i=e.minHeight,r=e.placement,o=e.shouldScroll,a=e.isFixedPosition,s=e.controlHeight,l=ib(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var c=l.getBoundingClientRect(),d=c.height,f=n.getBoundingClientRect(),h=f.bottom,m=f.height,p=f.top,b=n.offsetParent.getBoundingClientRect(),w=b.top,y=a?window.innerHeight:rb(l),S=Od(l),M=parseInt(getComputedStyle(n).marginBottom,10),C=parseInt(getComputedStyle(n).marginTop,10),x=w-C,R=y-p,I=x+S,E=d-S-p,H=h-y+S+M,z=S+p-C,L=160;switch(r){case"auto":case"bottom":if(R>=m)return{placement:"bottom",maxHeight:t};if(E>=m&&!a)return o&&Jo(l,H,L),{placement:"bottom",maxHeight:t};if(!a&&E>=i||a&&R>=i){o&&Jo(l,H,L);var _=a?R-M:E-M;return{placement:"bottom",maxHeight:_}}if(r==="auto"||a){var O=t,ne=a?x:I;return ne>=i&&(O=Math.min(ne-M-s,t)),{placement:"top",maxHeight:O}}if(r==="bottom")return o&&ka(l,H),{placement:"bottom",maxHeight:t};break;case"top":if(x>=m)return{placement:"top",maxHeight:t};if(I>=m&&!a)return o&&Jo(l,z,L),{placement:"top",maxHeight:t};if(!a&&I>=i||a&&x>=i){var q=t;return(!a&&I>=i||a&&x>=i)&&(q=a?x-C:I-C),o&&Jo(l,z,L),{placement:"top",maxHeight:q}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return u}function pb(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var _d=function(t){return t==="auto"?"bottom":t},vb=function(t,n){var i,r=t.placement,o=t.theme,a=o.borderRadius,s=o.spacing,l=o.colors;return Ye((i={label:"menu"},qi(i,pb(r),"100%"),qi(i,"position","absolute"),qi(i,"width","100%"),qi(i,"zIndex",1),i),n?{}:{backgroundColor:l.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},Ld=g.createContext(null),bb=function(t){var n=t.children,i=t.minMenuHeight,r=t.maxMenuHeight,o=t.menuPlacement,a=t.menuPosition,s=t.menuShouldScrollIntoView,l=t.theme,u=g.useContext(Ld)||{},c=u.setPortalPlacement,d=g.useRef(null),f=g.useState(r),h=Cr(f,2),m=h[0],p=h[1],b=g.useState(null),w=Cr(b,2),y=w[0],S=w[1],M=l.spacing.controlHeight;return _s(function(){var C=d.current;if(C){var x=a==="fixed",R=s&&!x,I=mb({maxHeight:r,menuEl:C,minHeight:i,placement:o,shouldScroll:R,isFixedPosition:x,controlHeight:M});p(I.maxHeight),S(I.placement),c==null||c(I.placement)}},[r,o,a,s,i,c,M]),n({ref:d,placerProps:Ye(Ye({},t),{},{placement:y||_d(o),maxHeight:m})})},wb=function(t){var n=t.children,i=t.innerRef,r=t.innerProps;return Ne("div",et({},nn(t,"menu",{menu:!0}),{ref:i},r),n)},yb=wb,Cb=function(t,n){var i=t.maxHeight,r=t.theme.spacing.baseUnit;return Ye({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:r,paddingTop:r})},Sb=function(t){var n=t.children,i=t.innerProps,r=t.innerRef,o=t.isMulti;return Ne("div",et({},nn(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},i),n)},Fd=function(t,n){var i=t.theme,r=i.spacing.baseUnit,o=i.colors;return Ye({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},xb=Fd,kb=Fd,Mb=function(t){var n=t.children,i=n===void 0?"No options":n,r=t.innerProps,o=kr(t,hb);return Ne("div",et({},nn(Ye(Ye({},o),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},Rb=function(t){var n=t.children,i=n===void 0?"Loading...":n,r=t.innerProps,o=kr(t,gb);return Ne("div",et({},nn(Ye(Ye({},o),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},Eb=function(t){var n=t.rect,i=t.offset,r=t.position;return{left:n.left,position:r,top:i,width:n.width,zIndex:1}},Ib=function(t){var n=t.appendTo,i=t.children,r=t.controlElement,o=t.innerProps,a=t.menuPlacement,s=t.menuPosition,l=g.useRef(null),u=g.useRef(null),c=g.useState(_d(a)),d=Cr(c,2),f=d[0],h=d[1],m=g.useMemo(function(){return{setPortalPlacement:h}},[]),p=g.useState(null),b=Cr(p,2),w=b[0],y=b[1],S=g.useCallback(function(){if(r){var R=ab(r),I=s==="fixed"?0:window.pageYOffset,E=R[f]+I;(E!==(w==null?void 0:w.offset)||R.left!==(w==null?void 0:w.rect.left)||R.width!==(w==null?void 0:w.rect.width))&&y({offset:E,rect:R})}},[r,s,f,w==null?void 0:w.offset,w==null?void 0:w.rect.left,w==null?void 0:w.rect.width]);_s(function(){S()},[S]);var M=g.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),r&&l.current&&(u.current=Q1(r,l.current,S,{elementResize:"ResizeObserver"in window}))},[r,S]);_s(function(){M()},[M]);var C=g.useCallback(function(R){l.current=R,M()},[M]);if(!n&&s!=="fixed"||!w)return null;var x=Ne("div",et({ref:C},nn(Ye(Ye({},t),{},{offset:w.offset,position:s,rect:w.rect}),"menuPortal",{"menu-portal":!0}),o),i);return Ne(Ld.Provider,{value:m},n?Kf.createPortal(x,n):x)},Tb=function(t){var n=t.isDisabled,i=t.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Db=function(t){var n=t.children,i=t.innerProps,r=t.isDisabled,o=t.isRtl;return Ne("div",et({},nn(t,"container",{"--is-disabled":r,"--is-rtl":o}),i),n)},Ob=function(t,n){var i=t.theme.spacing,r=t.isMulti,o=t.hasValue,a=t.selectProps.controlShouldRenderValue;return Ye({alignItems:"center",display:r&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},Pb=function(t){var n=t.children,i=t.innerProps,r=t.isMulti,o=t.hasValue;return Ne("div",et({},nn(t,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),i),n)},_b=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Lb=function(t){var n=t.children,i=t.innerProps;return Ne("div",et({},nn(t,"indicatorsContainer",{indicators:!0}),i),n)},$u,Fb=["size"],Ab=["innerProps","isRtl","size"],Hb={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Ad=function(t){var n=t.size,i=kr(t,Fb);return Ne("svg",et({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Hb},i))},hl=function(t){return Ne(Ad,et({size:20},t),Ne("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Hd=function(t){return Ne(Ad,et({size:20},t),Ne("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},zd=function(t,n){var i=t.isFocused,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return Ye({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:i?a.neutral60:a.neutral20,padding:o*2,":hover":{color:i?a.neutral80:a.neutral40}})},zb=zd,$b=function(t){var n=t.children,i=t.innerProps;return Ne("div",et({},nn(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),n||Ne(Hd,null))},Vb=zd,Nb=function(t){var n=t.children,i=t.innerProps;return Ne("div",et({},nn(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),n||Ne(hl,null))},Bb=function(t,n){var i=t.isDisabled,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return Ye({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:i?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},Wb=function(t){var n=t.innerProps;return Ne("span",et({},n,nn(t,"indicatorSeparator",{"indicator-separator":!0})))},Ub=jf($u||($u=V1([`
194
- 0%, 80%, 100% { opacity: 0; }
195
- 40% { opacity: 1; }
196
- `]))),Yb=function(t,n){var i=t.isFocused,r=t.size,o=t.theme,a=o.colors,s=o.spacing.baseUnit;return Ye({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},n?{}:{color:i?a.neutral60:a.neutral20,padding:s*2})},hs=function(t){var n=t.delay,i=t.offset;return Ne("span",{css:hc({animation:"".concat(Ub," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Xb=function(t){var n=t.innerProps,i=t.isRtl,r=t.size,o=r===void 0?4:r,a=kr(t,Ab);return Ne("div",et({},nn(Ye(Ye({},a),{},{innerProps:n,isRtl:i,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Ne(hs,{delay:0,offset:i}),Ne(hs,{delay:160,offset:!0}),Ne(hs,{delay:320,offset:!i}))},Gb=function(t,n){var i=t.isDisabled,r=t.isFocused,o=t.theme,a=o.colors,s=o.borderRadius,l=o.spacing;return Ye({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:i?a.neutral5:a.neutral0,borderColor:i?a.neutral10:r?a.primary:a.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},jb=function(t){var n=t.children,i=t.isDisabled,r=t.isFocused,o=t.innerRef,a=t.innerProps,s=t.menuIsOpen;return Ne("div",et({ref:o},nn(t,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":s}),a,{"aria-disabled":i||void 0}),n)},qb=jb,Kb=["data"],Zb=function(t,n){var i=t.theme.spacing;return n?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},Jb=function(t){var n=t.children,i=t.cx,r=t.getStyles,o=t.getClassNames,a=t.Heading,s=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,d=t.selectProps;return Ne("div",et({},nn(t,"group",{group:!0}),l),Ne(a,et({},s,{selectProps:d,theme:c,getStyles:r,getClassNames:o,cx:i}),u),Ne("div",null,n))},Qb=function(t,n){var i=t.theme,r=i.colors,o=i.spacing;return Ye({label:"group",cursor:"default",display:"block"},n?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},ew=function(t){var n=Dd(t);n.data;var i=kr(n,Kb);return Ne("div",et({},nn(t,"groupHeading",{"group-heading":!0}),i))},tw=Jb,nw=["innerRef","isDisabled","isHidden","inputClassName"],rw=function(t,n){var i=t.isDisabled,r=t.value,o=t.theme,a=o.spacing,s=o.colors;return Ye(Ye({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},iw),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:s.neutral80})},$d={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},iw={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ye({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},$d)},ow=function(t){return Ye({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},$d)},aw=function(t){var n=t.cx,i=t.value,r=Dd(t),o=r.innerRef,a=r.isDisabled,s=r.isHidden,l=r.inputClassName,u=kr(r,nw);return Ne("div",et({},nn(t,"input",{"input-container":!0}),{"data-value":i||""}),Ne("input",et({className:n({input:!0},l),ref:o,style:ow(s),disabled:a},u)))},sw=aw,lw=function(t,n){var i=t.theme,r=i.spacing,o=i.borderRadius,a=i.colors;return Ye({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},uw=function(t,n){var i=t.theme,r=i.borderRadius,o=i.colors,a=t.cropWithEllipsis;return Ye({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},cw=function(t,n){var i=t.theme,r=i.spacing,o=i.borderRadius,a=i.colors,s=t.isFocused;return Ye({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:s?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Vd=function(t){var n=t.children,i=t.innerProps;return Ne("div",i,n)},dw=Vd,fw=Vd;function hw(e){var t=e.children,n=e.innerProps;return Ne("div",et({role:"button"},n),t||Ne(hl,{size:14}))}var gw=function(t){var n=t.children,i=t.components,r=t.data,o=t.innerProps,a=t.isDisabled,s=t.removeProps,l=t.selectProps,u=i.Container,c=i.Label,d=i.Remove;return Ne(u,{data:r,innerProps:Ye(Ye({},nn(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:l},Ne(c,{data:r,innerProps:Ye({},nn(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Ne(d,{data:r,innerProps:Ye(Ye({},nn(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},s),selectProps:l}))},mw=gw,pw=function(t,n){var i=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.theme,s=a.spacing,l=a.colors;return Ye({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:i?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:o?l.primary:l.primary50}})},vw=function(t){var n=t.children,i=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.innerRef,s=t.innerProps;return Ne("div",et({},nn(t,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":o}),{ref:a,"aria-disabled":i},s),n)},bw=vw,ww=function(t,n){var i=t.theme,r=i.spacing,o=i.colors;return Ye({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},yw=function(t){var n=t.children,i=t.innerProps;return Ne("div",et({},nn(t,"placeholder",{placeholder:!0}),i),n)},Cw=yw,Sw=function(t,n){var i=t.isDisabled,r=t.theme,o=r.spacing,a=r.colors;return Ye({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:i?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},xw=function(t){var n=t.children,i=t.isDisabled,r=t.innerProps;return Ne("div",et({},nn(t,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),n)},kw=xw,Nd={ClearIndicator:Nb,Control:qb,DropdownIndicator:$b,DownChevron:Hd,CrossIcon:hl,Group:tw,GroupHeading:ew,IndicatorsContainer:Lb,IndicatorSeparator:Wb,Input:sw,LoadingIndicator:Xb,Menu:yb,MenuList:Sb,MenuPortal:Ib,LoadingMessage:Rb,NoOptionsMessage:Mb,MultiValue:mw,MultiValueContainer:dw,MultiValueLabel:fw,MultiValueRemove:hw,Option:bw,Placeholder:Cw,SelectContainer:Db,SingleValue:kw,ValueContainer:Pb},Mw=function(t){return Ye(Ye({},Nd),t.components)},Vu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Rw(e,t){return!!(e===t||Vu(e)&&Vu(t))}function Ew(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Rw(e[n],t[n]))return!1;return!0}function Iw(e,t){t===void 0&&(t=Ew);var n=null;function i(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var a=e.apply(this,r);return n={lastResult:a,lastArgs:r,lastThis:this},a}return i.clear=function(){n=null},i}var Tw={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},Dw=function(t){return Ne("span",et({css:Tw},t))},Nu=Dw,Ow={guidance:function(t){var n=t.isSearchable,i=t.isMulti,r=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(i?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,i=t.label,r=i===void 0?"":i,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(t){var n=t.context,i=t.focused,r=t.options,o=t.label,a=o===void 0?"":o,s=t.selectValue,l=t.isDisabled,u=t.isSelected,c=t.isAppleDevice,d=function(p,b){return p&&p.length?"".concat(p.indexOf(b)+1," of ").concat(p.length):""};if(n==="value"&&s)return"value ".concat(a," focused, ").concat(d(s,i),".");if(n==="menu"&&c){var f=l?" disabled":"",h="".concat(u?" selected":"").concat(f);return"".concat(a).concat(h,", ").concat(d(r,i),".")}return""},onFilter:function(t){var n=t.inputValue,i=t.resultsMessage;return"".concat(i).concat(n?" for search term "+n:"",".")}},Pw=function(t){var n=t.ariaSelection,i=t.focusedOption,r=t.focusedValue,o=t.focusableOptions,a=t.isFocused,s=t.selectValue,l=t.selectProps,u=t.id,c=t.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,h=l.inputValue,m=l.isMulti,p=l.isOptionDisabled,b=l.isSearchable,w=l.menuIsOpen,y=l.options,S=l.screenReaderStatus,M=l.tabSelectsValue,C=l.isLoading,x=l["aria-label"],R=l["aria-live"],I=g.useMemo(function(){return Ye(Ye({},Ow),d||{})},[d]),E=g.useMemo(function(){var ne="";if(n&&I.onChange){var q=n.option,oe=n.options,Se=n.removedValue,xe=n.removedValues,re=n.value,J=function(k){return Array.isArray(k)?null:k},ee=Se||q||J(re),ie=ee?f(ee):"",ge=oe||xe||void 0,fe=ge?ge.map(f):[],G=Ye({isDisabled:ee&&p(ee,s),label:ie,labels:fe},n);ne=I.onChange(G)}return ne},[n,I,p,s,f]),H=g.useMemo(function(){var ne="",q=i||r,oe=!!(i&&s&&s.includes(i));if(q&&I.onFocus){var Se={focused:q,label:f(q),isDisabled:p(q,s),isSelected:oe,options:o,context:q===i?"menu":"value",selectValue:s,isAppleDevice:c};ne=I.onFocus(Se)}return ne},[i,r,f,p,I,o,s,c]),z=g.useMemo(function(){var ne="";if(w&&y.length&&!C&&I.onFilter){var q=S({count:o.length});ne=I.onFilter({inputValue:h,resultsMessage:q})}return ne},[o,h,w,I,y,S,C]),L=(n==null?void 0:n.action)==="initial-input-focus",_=g.useMemo(function(){var ne="";if(I.guidance){var q=r?"value":w?"menu":"input";ne=I.guidance({"aria-label":x,context:q,isDisabled:i&&p(i,s),isMulti:m,isSearchable:b,tabSelectsValue:M,isInitialFocus:L})}return ne},[x,i,r,m,p,b,w,I,s,M,L]),O=Ne(g.Fragment,null,Ne("span",{id:"aria-selection"},E),Ne("span",{id:"aria-focused"},H),Ne("span",{id:"aria-results"},z),Ne("span",{id:"aria-guidance"},_));return Ne(g.Fragment,null,Ne(Nu,{id:u},L&&O),Ne(Nu,{"aria-live":R,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!L&&O))},_w=Pw,Ls=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Lw=new RegExp("["+Ls.map(function(e){return e.letters}).join("")+"]","g"),Bd={};for(var gs=0;gs<Ls.length;gs++)for(var ms=Ls[gs],ps=0;ps<ms.letters.length;ps++)Bd[ms.letters[ps]]=ms.base;var Wd=function(t){return t.replace(Lw,function(n){return Bd[n]})},Fw=Iw(Wd),Bu=function(t){return t.replace(/^\s+|\s+$/g,"")},Aw=function(t){return"".concat(t.label," ").concat(t.value)},Hw=function(t){return function(n,i){if(n.data.__isNew__)return!0;var r=Ye({ignoreCase:!0,ignoreAccents:!0,stringify:Aw,trim:!0,matchFrom:"any"},t),o=r.ignoreCase,a=r.ignoreAccents,s=r.stringify,l=r.trim,u=r.matchFrom,c=l?Bu(i):i,d=l?Bu(s(n)):s(n);return o&&(c=c.toLowerCase(),d=d.toLowerCase()),a&&(c=Fw(c),d=Wd(d)),u==="start"?d.substr(0,c.length)===c:d.indexOf(c)>-1}},zw=["innerRef"];function $w(e){var t=e.innerRef,n=kr(e,zw),i=fb(n,"onExited","in","enter","exit","appear");return Ne("input",et({ref:t},i,{css:hc({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Vw=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function Nw(e){var t=e.isEnabled,n=e.onBottomArrive,i=e.onBottomLeave,r=e.onTopArrive,o=e.onTopLeave,a=g.useRef(!1),s=g.useRef(!1),l=g.useRef(0),u=g.useRef(null),c=g.useCallback(function(b,w){if(u.current!==null){var y=u.current,S=y.scrollTop,M=y.scrollHeight,C=y.clientHeight,x=u.current,R=w>0,I=M-C-S,E=!1;I>w&&a.current&&(i&&i(b),a.current=!1),R&&s.current&&(o&&o(b),s.current=!1),R&&w>I?(n&&!a.current&&n(b),x.scrollTop=M,E=!0,a.current=!0):!R&&-w>S&&(r&&!s.current&&r(b),x.scrollTop=0,E=!0,s.current=!0),E&&Vw(b)}},[n,i,r,o]),d=g.useCallback(function(b){c(b,b.deltaY)},[c]),f=g.useCallback(function(b){l.current=b.changedTouches[0].clientY},[]),h=g.useCallback(function(b){var w=l.current-b.changedTouches[0].clientY;c(b,w)},[c]),m=g.useCallback(function(b){if(b){var w=ub?{passive:!1}:!1;b.addEventListener("wheel",d,w),b.addEventListener("touchstart",f,w),b.addEventListener("touchmove",h,w)}},[h,f,d]),p=g.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",f,!1),b.removeEventListener("touchmove",h,!1))},[h,f,d]);return g.useEffect(function(){if(t){var b=u.current;return m(b),function(){p(b)}}},[t,m,p]),function(b){u.current=b}}var Wu=["boxSizing","height","overflow","paddingRight","position"],Uu={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Yu(e){e.preventDefault()}function Xu(e){e.stopPropagation()}function Gu(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function ju(){return"ontouchstart"in window||navigator.maxTouchPoints}var qu=!!(typeof window<"u"&&window.document&&window.document.createElement),ji=0,pi={capture:!1,passive:!1};function Bw(e){var t=e.isEnabled,n=e.accountForScrollbars,i=n===void 0?!0:n,r=g.useRef({}),o=g.useRef(null),a=g.useCallback(function(l){if(qu){var u=document.body,c=u&&u.style;if(i&&Wu.forEach(function(m){var p=c&&c[m];r.current[m]=p}),i&&ji<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,h=window.innerWidth-f+d||0;Object.keys(Uu).forEach(function(m){var p=Uu[m];c&&(c[m]=p)}),c&&(c.paddingRight="".concat(h,"px"))}u&&ju()&&(u.addEventListener("touchmove",Yu,pi),l&&(l.addEventListener("touchstart",Gu,pi),l.addEventListener("touchmove",Xu,pi))),ji+=1}},[i]),s=g.useCallback(function(l){if(qu){var u=document.body,c=u&&u.style;ji=Math.max(ji-1,0),i&&ji<1&&Wu.forEach(function(d){var f=r.current[d];c&&(c[d]=f)}),u&&ju()&&(u.removeEventListener("touchmove",Yu,pi),l&&(l.removeEventListener("touchstart",Gu,pi),l.removeEventListener("touchmove",Xu,pi)))}},[i]);return g.useEffect(function(){if(t){var l=o.current;return a(l),function(){s(l)}}},[t,a,s]),function(l){o.current=l}}var Ww=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},Uw={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Yw(e){var t=e.children,n=e.lockEnabled,i=e.captureEnabled,r=i===void 0?!0:i,o=e.onBottomArrive,a=e.onBottomLeave,s=e.onTopArrive,l=e.onTopLeave,u=Nw({isEnabled:r,onBottomArrive:o,onBottomLeave:a,onTopArrive:s,onTopLeave:l}),c=Bw({isEnabled:n}),d=function(h){u(h),c(h)};return Ne(g.Fragment,null,n&&Ne("div",{onClick:Ww,css:Uw}),t(d))}var Xw={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Gw=function(t){var n=t.name,i=t.onFocus;return Ne("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:Xw,value:"",onChange:function(){}})},jw=Gw;function gl(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function qw(){return gl(/^iPhone/i)}function Ud(){return gl(/^Mac/i)}function Kw(){return gl(/^iPad/i)||Ud()&&navigator.maxTouchPoints>1}function Zw(){return qw()||Kw()}function Jw(){return Ud()||Zw()}var Qw=function(t){return t.label},ey=function(t){return t.label},ty=function(t){return t.value},ny=function(t){return!!t.isDisabled},ry={clearIndicator:Vb,container:Tb,control:Gb,dropdownIndicator:zb,group:Zb,groupHeading:Qb,indicatorsContainer:_b,indicatorSeparator:Bb,input:rw,loadingIndicator:Yb,loadingMessage:kb,menu:vb,menuList:Cb,menuPortal:Eb,multiValue:lw,multiValueLabel:uw,multiValueRemove:cw,noOptionsMessage:xb,option:pw,placeholder:ww,singleValue:Sw,valueContainer:Ob},iy={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},oy=4,Yd=4,ay=38,sy=Yd*2,ly={baseUnit:Yd,controlHeight:ay,menuGutter:sy},vs={borderRadius:oy,colors:iy,spacing:ly},uy={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:zu(),captureMenuScroll:!zu(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Hw(),formatGroupLabel:Qw,getOptionLabel:ey,getOptionValue:ty,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:ny,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!sb(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Ku(e,t,n,i){var r=jd(e,t,n),o=qd(e,t,n),a=Gd(e,t),s=Ma(e,t);return{type:"option",data:t,isDisabled:r,isSelected:o,label:a,value:s,index:i}}function oa(e,t){return e.options.map(function(n,i){if("options"in n){var r=n.options.map(function(a,s){return Ku(e,a,t,s)}).filter(function(a){return Ju(e,a)});return r.length>0?{type:"group",data:n,options:r,index:i}:void 0}var o=Ku(e,n,t,i);return Ju(e,o)?o:void 0}).filter(cb)}function Xd(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,zs(n.options.map(function(i){return i.data}))):t.push(n.data),t},[])}function Zu(e,t){return e.reduce(function(n,i){return i.type==="group"?n.push.apply(n,zs(i.options.map(function(r){return{data:r.data,id:"".concat(t,"-").concat(i.index,"-").concat(r.index)}}))):n.push({data:i.data,id:"".concat(t,"-").concat(i.index)}),n},[])}function cy(e,t){return Xd(oa(e,t))}function Ju(e,t){var n=e.inputValue,i=n===void 0?"":n,r=t.data,o=t.isSelected,a=t.label,s=t.value;return(!Zd(e)||!o)&&Kd(e,{label:a,value:s,data:r},i)}function dy(e,t){var n=e.focusedValue,i=e.selectValue,r=i.indexOf(n);if(r>-1){var o=t.indexOf(n);if(o>-1)return n;if(r<t.length)return t[r]}return null}function fy(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var bs=function(t,n){var i,r=(i=t.find(function(o){return o.data===n}))===null||i===void 0?void 0:i.id;return r||null},Gd=function(t,n){return t.getOptionLabel(n)},Ma=function(t,n){return t.getOptionValue(n)};function jd(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function qd(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var i=Ma(e,t);return n.some(function(r){return Ma(e,r)===i})}function Kd(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Zd=function(t){var n=t.hideSelectedOptions,i=t.isMulti;return n===void 0?i:n},hy=1,Jd=function(e){hh(n,e);var t=ph(n);function n(i){var r;if(gh(this,n),r=t.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=Jw(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,u){var c=r.props,d=c.onChange,f=c.name;u.name=f,r.ariaOnChange(l,u),d(l,u)},r.setValue=function(l,u,c){var d=r.props,f=d.closeMenuOnSelect,h=d.isMulti,m=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(r.setState({inputIsHiddenAfterUpdate:!h}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:u,option:c})},r.selectOption=function(l){var u=r.props,c=u.blurInputOnSelect,d=u.isMulti,f=u.name,h=r.state.selectValue,m=d&&r.isOptionSelected(l,h),p=r.isOptionDisabled(l,h);if(m){var b=r.getOptionValue(l);r.setValue(h.filter(function(w){return r.getOptionValue(w)!==b}),"deselect-option",l)}else if(!p)d?r.setValue([].concat(zs(h),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:f});return}c&&r.blurInput()},r.removeValue=function(l){var u=r.props.isMulti,c=r.state.selectValue,d=r.getOptionValue(l),f=c.filter(function(m){return r.getOptionValue(m)!==d}),h=ea(u,f,f[0]||null);r.onChange(h,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(ea(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,u=r.state.selectValue,c=u[u.length-1],d=u.slice(0,u.length-1),f=ea(l,d,d[0]||null);c&&r.onChange(f,{action:"pop-value",removedValue:c})},r.getFocusedOptionId=function(l){return bs(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return Zu(oa(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,u=new Array(l),c=0;c<l;c++)u[c]=arguments[c];return nb.apply(void 0,[r.props.classNamePrefix].concat(u))},r.getOptionLabel=function(l){return Gd(r.props,l)},r.getOptionValue=function(l){return Ma(r.props,l)},r.getStyles=function(l,u){var c=r.props.unstyled,d=ry[l](u,c);d.boxSizing="border-box";var f=r.props.styles[l];return f?f(d,u):d},r.getClassNames=function(l,u){var c,d;return(c=(d=r.props.classNames)[l])===null||c===void 0?void 0:c.call(d,u)},r.getElementId=function(l){return"".concat(r.state.instancePrefix,"-").concat(l)},r.getComponents=function(){return Mw(r.props)},r.buildCategorizedOptions=function(){return oa(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Xd(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(l,u){r.setState({ariaSelection:Ye({value:l},u)})},r.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(l){r.blockOptionHover=!1},r.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&r.onMenuClose():u&&r.openMenu("first"):(u&&(r.openAfterFocus=!0),r.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},r.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!r.props.isDisabled){var u=r.props,c=u.isMulti,d=u.menuIsOpen;r.focusInput(),d?(r.setState({inputIsHiddenAfterUpdate:!c}),r.onMenuClose()):r.openMenu("first"),l.preventDefault()}},r.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(r.clearValue(),l.preventDefault(),r.openAfterFocus=!1,l.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(l){typeof r.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&_a(l.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(l)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(l){var u=l.touches,c=u&&u.item(0);c&&(r.initialTouchX=c.clientX,r.initialTouchY=c.clientY,r.userIsDragging=!1)},r.onTouchMove=function(l){var u=l.touches,c=u&&u.item(0);if(c){var d=Math.abs(c.clientX-r.initialTouchX),f=Math.abs(c.clientY-r.initialTouchY),h=5;r.userIsDragging=d>h||f>h}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var u=r.props.inputValue,c=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(c,{action:"input-change",prevInputValue:u}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var u=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:u}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var u=r.getFocusableOptions(),c=u.indexOf(l);r.setState({focusedOption:l,focusedOptionId:c>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return Zd(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var u=r.props,c=u.isMulti,d=u.backspaceRemovesValue,f=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,p=u.isDisabled,b=u.menuIsOpen,w=u.onKeyDown,y=u.tabSelectsValue,S=u.openMenuOnFocus,M=r.state,C=M.focusedOption,x=M.focusedValue,R=M.selectValue;if(!p&&!(typeof w=="function"&&(w(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!c||h)return;r.focusValue("previous");break;case"ArrowRight":if(!c||h)return;r.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(x)r.removeValue(x);else{if(!d)return;c?r.popValue():m&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!b||!y||!C||S&&r.isOptionSelected(C,R))return;r.selectOption(C);break;case"Enter":if(l.keyCode===229)break;if(b){if(!C||r.isComposing)return;r.selectOption(C);break}return;case"Escape":b?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:h}),r.onMenuClose()):m&&f&&r.clearValue();break;case" ":if(h)return;if(!b){r.openMenu("first");break}if(!C)return;r.selectOption(C);break;case"ArrowUp":b?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":b?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!b)return;r.focusOption("pageup");break;case"PageDown":if(!b)return;r.focusOption("pagedown");break;case"Home":if(!b)return;r.focusOption("first");break;case"End":if(!b)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++hy),r.state.selectValue=Au(i.value),i.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),s=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=a[s],r.state.focusedOptionId=bs(o,a[s])}return r}return mh(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Hu(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var o=this.props,a=o.isDisabled,s=o.menuIsOpen,l=this.state.isFocused;(l&&!a&&r.isDisabled||l&&s&&!r.menuIsOpen)&&this.focusInput(),l&&a&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!a&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Hu(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,a=this.state,s=a.selectValue,l=a.isFocused,u=this.buildFocusableOptions(),c=r==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(s[0]);d>-1&&(c=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[c],focusedOptionId:this.getFocusedOptionId(u[c])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,a=o.selectValue,s=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=a.indexOf(s);s||(l=-1);var u=a.length-1,c=-1;if(a.length){switch(r){case"previous":l===0?c=0:l===-1?c=u:c=l-1;break;case"next":l>-1&&l<u&&(c=l+1);break}this.setState({inputIsHidden:c!==-1,focusedValue:a[c]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var l=0,u=s.indexOf(a);a||(u=-1),r==="up"?l=u>0?u-1:s.length-1:r==="down"?l=(u+1)%s.length:r==="pageup"?(l=u-o,l<0&&(l=0)):r==="pagedown"?(l=u+o,l>s.length-1&&(l=s.length-1)):r==="last"&&(l=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(vs):Ye(Ye({},vs),this.props.theme):vs}},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,a=this.getStyles,s=this.getClassNames,l=this.getValue,u=this.selectOption,c=this.setValue,d=this.props,f=d.isMulti,h=d.isRtl,m=d.options,p=this.hasValue();return{clearValue:r,cx:o,getStyles:a,getClassNames:s,getValue:l,hasValue:p,isMulti:f,isRtl:h,options:m,selectOption:u,selectProps:d,setValue:c,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,a=r.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(r,o){return jd(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return qd(this.props,r,o)}},{key:"filterOption",value:function(r,o){return Kd(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:a,selectValue:s})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,o=r.isDisabled,a=r.isSearchable,s=r.inputId,l=r.inputValue,u=r.tabIndex,c=r.form,d=r.menuIsOpen,f=r.required,h=this.getComponents(),m=h.Input,p=this.state,b=p.inputIsHidden,w=p.ariaSelection,y=this.commonProps,S=s||this.getElementId("input"),M=Ye(Ye(Ye({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(w==null?void 0:w.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?g.createElement(m,et({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:o,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:c,type:"text",value:l},M)):g.createElement($w,et({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:xa,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:c,value:""},M))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),a=o.MultiValue,s=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,c=o.SingleValue,d=o.Placeholder,f=this.commonProps,h=this.props,m=h.controlShouldRenderValue,p=h.isDisabled,b=h.isMulti,w=h.inputValue,y=h.placeholder,S=this.state,M=S.selectValue,C=S.focusedValue,x=S.isFocused;if(!this.hasValue()||!m)return w?null:g.createElement(d,et({},f,{key:"placeholder",isDisabled:p,isFocused:x,innerProps:{id:this.getElementId("placeholder")}}),y);if(b)return M.map(function(I,E){var H=I===C,z="".concat(r.getOptionLabel(I),"-").concat(r.getOptionValue(I));return g.createElement(a,et({},f,{components:{Container:s,Label:l,Remove:u},isFocused:H,isDisabled:p,key:z,index:E,removeProps:{onClick:function(){return r.removeValue(I)},onTouchEnd:function(){return r.removeValue(I)},onMouseDown:function(_){_.preventDefault()}},data:I}),r.formatOptionLabel(I,"value"))});if(w)return null;var R=M[0];return g.createElement(c,et({},f,{data:R,isDisabled:p}),this.formatOptionLabel(R,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(o,et({},a,{innerProps:d,isFocused:c}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,u=s.isLoading,c=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return g.createElement(o,et({},a,{innerProps:d,isDisabled:l,isFocused:c}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,a=r.IndicatorSeparator;if(!o||!a)return null;var s=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return g.createElement(a,et({},s,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var a=this.commonProps,s=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return g.createElement(o,et({},a,{innerProps:u,isDisabled:s,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),a=o.Group,s=o.GroupHeading,l=o.Menu,u=o.MenuList,c=o.MenuPortal,d=o.LoadingMessage,f=o.NoOptionsMessage,h=o.Option,m=this.commonProps,p=this.state.focusedOption,b=this.props,w=b.captureMenuScroll,y=b.inputValue,S=b.isLoading,M=b.loadingMessage,C=b.minMenuHeight,x=b.maxMenuHeight,R=b.menuIsOpen,I=b.menuPlacement,E=b.menuPosition,H=b.menuPortalTarget,z=b.menuShouldBlockScroll,L=b.menuShouldScrollIntoView,_=b.noOptionsMessage,O=b.onMenuScrollToTop,ne=b.onMenuScrollToBottom;if(!R)return null;var q=function(ie,ge){var fe=ie.type,G=ie.data,P=ie.isDisabled,k=ie.isSelected,$=ie.label,le=ie.value,Te=p===G,Be=P?void 0:function(){return r.onOptionHover(G)},ce=P?void 0:function(){return r.selectOption(G)},nt="".concat(r.getElementId("option"),"-").concat(ge),ke={id:nt,onClick:ce,onMouseMove:Be,onMouseOver:Be,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:k};return g.createElement(h,et({},m,{innerProps:ke,data:G,isDisabled:P,isSelected:k,key:nt,label:$,type:fe,value:le,isFocused:Te,innerRef:Te?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(ie.data,"menu"))},oe;if(this.hasOptions())oe=this.getCategorizedOptions().map(function(ee){if(ee.type==="group"){var ie=ee.data,ge=ee.options,fe=ee.index,G="".concat(r.getElementId("group"),"-").concat(fe),P="".concat(G,"-heading");return g.createElement(a,et({},m,{key:G,data:ie,options:ge,Heading:s,headingProps:{id:P,data:ee.data},label:r.formatGroupLabel(ee.data)}),ee.options.map(function(k){return q(k,"".concat(fe,"-").concat(k.index))}))}else if(ee.type==="option")return q(ee,"".concat(ee.index))});else if(S){var Se=M({inputValue:y});if(Se===null)return null;oe=g.createElement(d,m,Se)}else{var xe=_({inputValue:y});if(xe===null)return null;oe=g.createElement(f,m,xe)}var re={minMenuHeight:C,maxMenuHeight:x,menuPlacement:I,menuPosition:E,menuShouldScrollIntoView:L},J=g.createElement(bb,et({},m,re),function(ee){var ie=ee.ref,ge=ee.placerProps,fe=ge.placement,G=ge.maxHeight;return g.createElement(l,et({},m,re,{innerRef:ie,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:S,placement:fe}),g.createElement(Yw,{captureEnabled:w,onTopArrive:O,onBottomArrive:ne,lockEnabled:z},function(P){return g.createElement(u,et({},m,{innerRef:function($){r.getMenuListRef($),P($)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:r.getElementId("listbox")},isLoading:S,maxHeight:G,focusedOption:p}),oe)}))});return H||E==="fixed"?g.createElement(c,et({},m,{appendTo:H,controlElement:this.controlRef,menuPlacement:I,menuPosition:E}),J):J}},{key:"renderFormField",value:function(){var r=this,o=this.props,a=o.delimiter,s=o.isDisabled,l=o.isMulti,u=o.name,c=o.required,d=this.state.selectValue;if(c&&!this.hasValue()&&!s)return g.createElement(jw,{name:u,onFocus:this.onValueInputFocus});if(!(!u||s))if(l)if(a){var f=d.map(function(p){return r.getOptionValue(p)}).join(a);return g.createElement("input",{name:u,type:"hidden",value:f})}else{var h=d.length>0?d.map(function(p,b){return g.createElement("input",{key:"i-".concat(b),name:u,type:"hidden",value:r.getOptionValue(p)})}):g.createElement("input",{name:u,type:"hidden",value:""});return g.createElement("div",null,h)}else{var m=d[0]?this.getOptionValue(d[0]):"";return g.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,a=o.ariaSelection,s=o.focusedOption,l=o.focusedValue,u=o.isFocused,c=o.selectValue,d=this.getFocusableOptions();return g.createElement(_w,et({},r,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:s,focusedValue:l,isFocused:u,selectValue:c,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,a=r.IndicatorsContainer,s=r.SelectContainer,l=r.ValueContainer,u=this.props,c=u.className,d=u.id,f=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,p=this.commonProps=this.getCommonProps();return g.createElement(s,et({},p,{className:c,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),g.createElement(o,et({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:h}),g.createElement(l,et({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),g.createElement(a,et({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var a=o.prevProps,s=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,c=o.isFocused,d=o.prevWasFocused,f=o.instancePrefix,h=r.options,m=r.value,p=r.menuIsOpen,b=r.inputValue,w=r.isMulti,y=Au(m),S={};if(a&&(m!==a.value||h!==a.options||p!==a.menuIsOpen||b!==a.inputValue)){var M=p?cy(r,y):[],C=p?Zu(oa(r,y),"".concat(f,"-option")):[],x=s?dy(o,y):null,R=fy(o,M),I=bs(C,R);S={selectValue:y,focusedOption:R,focusedOptionId:I,focusableOptionsWithIds:C,focusedValue:x,clearFocusValueOnUpdate:!1}}var E=l!=null&&r!==a?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},H=u,z=c&&d;return c&&!z&&(H={value:ea(w,y,y[0]||null),options:y,action:"initial-input-focus"},z=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(H=null),Ye(Ye(Ye({},S),E),{},{prevProps:r,ariaSelection:H,prevWasFocused:z})}}]),n}(g.Component);Jd.defaultProps=uy;var gy=g.forwardRef(function(e,t){var n=$1(e);return g.createElement(Jd,et({ref:t},n))}),my=gy;const py=e=>{const{Menu:t}=Nd,{children:n,...i}=e;return g.createElement(t,{...i},n)},vy=hn("div")({name:"Wrap",class:"gdg-wghi2zc",propsAsIs:!1}),by=hn("div")({name:"PortalWrap",class:"gdg-p13nj8j0",propsAsIs:!1}),wy=hn("div")({name:"ReadOnlyWrap",class:"gdg-r6sia3g",propsAsIs:!1}),yy=e=>{const{value:t,onFinishedEditing:n,initialValue:i}=e,{allowedValues:r,value:o}=t.data,[a,s]=g.useState(o),[l,u]=g.useState(i??""),c=Am(),d=g.useMemo(()=>r.map(f=>typeof f=="string"||f===null||f===void 0?{value:f,label:(f==null?void 0:f.toString())??""}:f),[r]);return t.readonly?g.createElement(wy,null,g.createElement(Ei,{highlight:!0,autoFocus:!1,disabled:!0,value:a??"",onChange:()=>{}})):g.createElement(vy,null,g.createElement(my,{className:"glide-select",inputValue:l,onInputChange:u,menuPlacement:"auto",value:d.find(f=>f.value===a),styles:{control:f=>({...f,border:0,boxShadow:"none"}),option:(f,{isFocused:h})=>({...f,fontSize:c.editorFontSize,fontFamily:c.fontFamily,cursor:h?"pointer":void 0,paddingLeft:c.cellHorizontalPadding,paddingRight:c.cellHorizontalPadding,":active":{...f[":active"],color:c.accentFg},":empty::after":{content:'"&nbsp;"',visibility:"hidden"}})},theme:f=>({...f,colors:{...f.colors,neutral0:c.bgCell,neutral5:c.bgCell,neutral10:c.bgCell,neutral20:c.bgCellMedium,neutral30:c.bgCellMedium,neutral40:c.bgCellMedium,neutral50:c.textLight,neutral60:c.textMedium,neutral70:c.textMedium,neutral80:c.textDark,neutral90:c.textDark,neutral100:c.textDark,primary:c.accentColor,primary75:c.accentColor,primary50:c.accentColor,primary25:c.accentLight}}),menuPortalTarget:document.getElementById("portal"),autoFocus:!0,openMenuOnFocus:!0,components:{DropdownIndicator:()=>null,IndicatorSeparator:()=>null,Menu:f=>g.createElement(by,null,g.createElement(py,{className:"click-outside-ignore",...f}))},options:d,onChange:async f=>{f!==null&&(s(f.value),await new Promise(h=>window.requestAnimationFrame(h)),n({...t,data:{...t.data,value:f.value}}))}}))},Cy={kind:Z.Custom,isMatch:e=>e.data.kind==="dropdown-cell",draw:(e,t)=>{const{ctx:n,theme:i,rect:r}=e,{value:o}=t.data,a=t.data.allowedValues.find(l=>typeof l=="string"||l===null||l===void 0?l===o:l.value===o),s=typeof a=="string"?a:(a==null?void 0:a.label)??"";return s&&(n.fillStyle=i.textDark,n.fillText(s,r.x+i.cellHorizontalPadding,r.y+r.height/2+mr(n,i))),!0},measure:(e,t,n)=>{const{value:i}=t.data;return(i?e.measureText(i).width:0)+n.cellHorizontalPadding*2},provideEditor:()=>({editor:yy,disablePadding:!0,deletedValue:e=>({...e,copyData:"",data:{...e.data,value:""}})}),onPaste:(e,t)=>({...t,value:t.allowedValues.includes(e)?e:t.value})},Kr=6,Sy={marginRight:8},xy={display:"flex",alignItems:"center",flexGrow:1},ky={kind:Z.Custom,isMatch:e=>e.data.kind==="range-cell",draw:(e,t)=>{const{ctx:n,theme:i,rect:r}=e,{min:o,max:a,value:s,label:l,measureLabel:u}=t.data,c=r.x+i.cellHorizontalPadding,d=r.y+r.height/2,f=a-o,h=(s-o)/f;n.save();let m=0;l!==void 0&&(n.font=`12px ${i.fontFamily}`,m=ii(u??l,n,`12px ${i.fontFamily}`).width+i.cellHorizontalPadding);const p=r.width-i.cellHorizontalPadding*2-m;if(p>=Kr){const b=n.createLinearGradient(c,d,c+p,d);b.addColorStop(0,i.accentColor),b.addColorStop(h,i.accentColor),b.addColorStop(h,i.bgBubble),b.addColorStop(1,i.bgBubble),n.beginPath(),n.fillStyle=b,Ou(n,c,d-Kr/2,p,Kr,Kr/2),n.fill(),n.beginPath(),Ou(n,c+.5,d-Kr/2+.5,p-1,Kr-1,(Kr-1)/2),n.strokeStyle=i.accentLight,n.lineWidth=1,n.stroke()}return l!==void 0&&(n.textAlign="right",n.fillStyle=i.textDark,n.fillText(l,r.x+r.width-i.cellHorizontalPadding,d+mr(n,`12px ${i.fontFamily}`))),n.restore(),!0},provideEditor:()=>e=>{const{data:t,readonly:n}=e.value,i=t.value.toString(),r=t.min.toString(),o=t.max.toString(),a=t.step.toString(),s=l=>{e.onChange({...e.value,data:{...t,value:Number(l.target.value)}})};return g.createElement("label",{style:xy},g.createElement("input",{style:Sy,type:"range",value:i,min:r,max:o,step:a,onChange:s,disabled:n}),i)},onPaste:(e,t)=>{let n=Number.parseFloat(e);return n=Number.isNaN(n)?t.value:Math.max(t.min,Math.min(t.max,n)),{...t,value:n}}},My=hn("input")({name:"StyledInputBox",class:"gdg-s1wtovjx",propsAsIs:!1}),ws=(e,t)=>{if(t==null)return"";const n=t.toISOString();switch(e){case"date":return n.split("T")[0];case"datetime-local":return n.replace("Z","");case"time":return n.split("T")[1].replace("Z","");default:throw new Error(`Unknown date kind ${e}`)}},Ry=e=>{const t=e.value.data,{format:n,displayDate:i}=t,r=t.step!==void 0&&!Number.isNaN(Number(t.step))?Number(t.step):void 0,o=t.min instanceof Date?ws(n,t.min):t.min,a=t.max instanceof Date?ws(n,t.max):t.max;let s=t.date;const l=t.timezoneOffset?t.timezoneOffset*60*1e3:0;l&&s&&(s=new Date(s.getTime()+l));const u=ws(n,s);return e.value.readonly?ae.createElement(Ei,{highlight:!0,autoFocus:!1,disabled:!0,value:i??"",onChange:()=>{}}):ae.createElement(My,{"data-testid":"date-picker-cell",required:!0,type:n,defaultValue:u,min:o,max:a,step:r,autoFocus:!0,onChange:c=>{isNaN(c.target.valueAsNumber)?e.onChange({...e.value,data:{...e.value.data,date:void 0}}):e.onChange({...e.value,data:{...e.value.data,date:new Date(c.target.valueAsNumber-l)}})}})},Ey={kind:Z.Custom,isMatch:e=>e.data.kind==="date-picker-cell",draw:(e,t)=>{const{displayDate:n}=t.data;return Nc(e,n,t.contentAlign),!0},measure:(e,t,n)=>{const{displayDate:i}=t.data;return e.measureText(i).width+n.cellHorizontalPadding*2},provideEditor:()=>({editor:Ry}),onPaste:(e,t)=>{let n=NaN;return e&&(n=Number(e).valueOf(),Number.isNaN(n)&&(n=Date.parse(e),t.format==="time"&&Number.isNaN(n)&&(n=Date.parse(`1970-01-01T${e}Z`)))),{...t,date:Number.isNaN(n)?void 0:new Date(n)}}},Iy="None";function Qu(e,t,n){e.save(),e.beginPath(),e.moveTo(t.x+t.width-8,t.y+1),e.lineTo(t.x+t.width,t.y+1),e.lineTo(t.x+t.width,t.y+1+8),e.fillStyle=n.accentColor,e.fill(),e.restore()}const Ty=e=>{const{cell:t,theme:n,ctx:i}=e;Nc({...e,theme:{...n,textDark:n.textLight,headerFontFull:`${n.headerFontStyle} ${n.fontFamily}`,baseFontFull:`${n.baseFontStyle} ${n.fontFamily}`,markerFontFull:`${n.markerFontStyle} ${n.fontFamily}`},spriteManager:{},hyperWrapping:!1},Iy,t.contentAlign),i.fillStyle=n.textDark};function Dy(e){const t=ae.useCallback((i,r)=>{const{cell:o,theme:a,ctx:s,rect:l}=i,u=i.col;if(Si(o))Qu(s,l,a);else if(Oa(o)&&u<e.length){const c=e[u];["checkbox","line_chart","bar_chart","progress"].includes(c.kind)?r():Ty(i),c.isRequired&&c.isEditable&&Qu(s,l,a);return}r()},[e]),n=ae.useMemo(()=>[H1,Cy,ky,Ey,...d1],[]);return{drawCell:t,customRenderers:n}}const Qd=",",Ji='"',Oy='"',ef=`
197
- `,Py="\uFEFF",_y=new RegExp(`[${[Qd,Ji,ef].join("")}]`);function ec(e){return e.map(t=>Ly(t)).join(Qd)+ef}function Ly(e){if(Ze(e))return"";const t=Rt(e);return _y.test(t)?`${Ji}${t.replace(new RegExp(Ji,"g"),Oy+Ji)}${Ji}`:t}async function tc(e,t,n,i){const r=new TextEncoder;await e.write(r.encode(Py));const o=n.map(a=>a.name);await e.write(r.encode(ec(o)));for(let a=0;a<i;a++){const s=[];n.forEach((l,u,c)=>{s.push(l.getCellValue(t([u,a])))}),await e.write(r.encode(ec(s)))}await e.close()}function Fy(e,t,n,i){return{exportToCsv:ae.useCallback(async()=>{const a=`${new Date().toISOString().slice(0,16).replace(":","-")}_export.csv`;try{const u=await(await(await As(()=>import("./es6.DoVDVSd_.js").then(c=>c.a),__vite__mapDeps([13,1,2]),import.meta.url)).showSaveFilePicker({suggestedName:a,types:[{accept:{"text/csv":[".csv"]}}],excludeAcceptAllOption:!1})).createWritable();await tc(u,e,t,n)}catch(s){if(s instanceof Error&&s.name==="AbortError")return;try{fc("Failed to export data as CSV with FileSystem API, trying fallback method",s);let l="";const u=new WritableStream({write:async h=>{l+=new TextDecoder("utf-8").decode(h)},close:async()=>{}});await tc(u.getWriter(),e,t,n);const c=new Blob([l],{type:"text/csv;charset=utf-8;"}),d=URL.createObjectURL(c),f=dh({enforceDownloadInNewTab:i,url:d,filename:a});f.style.display="none",document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(d)}catch(l){dc("Failed to export data as CSV",l)}}},[t,n,e,i])}}function Ay(e,t,n,i,r){const[o,a]=ae.useState({columns:yt.empty(),rows:yt.empty(),current:void 0}),s=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.MULTI_ROW)||e.selectionMode.includes(Un.SelectionMode.SINGLE_ROW)),l=s&&e.selectionMode.includes(Un.SelectionMode.MULTI_ROW),u=!t&&!n&&(e.selectionMode.includes(Un.SelectionMode.SINGLE_COLUMN)||e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN)),c=u&&e.selectionMode.includes(Un.SelectionMode.MULTI_COLUMN),d=o.rows.length>0,f=o.columns.length>0,h=o.current!==void 0,m=ae.useCallback(b=>{const w=!ts(b.rows.toArray(),o.rows.toArray()),y=!ts(b.columns.toArray(),o.columns.toArray()),S=!ts(b.current,o.current);let M=s&&w||u&&y,C=b;if((s||u)&&b.current!==void 0&&S&&(C={...b,rows:o.rows,columns:o.columns},M=!1),w&&b.rows.length>0&&y&&b.columns.length===0&&(C={...C,columns:o.columns},M=!0),y&&b.columns.length>0&&w&&b.rows.length===0&&(C={...C,rows:o.rows},M=!0),y&&C.columns.length>=0){let x=C.columns;i.forEach((R,I)=>{R.isIndex&&(x=x.remove(I))}),x.length<C.columns.length&&(C={...C,columns:x})}a(C),M&&r(C)},[o,s,u,r,i]),p=ae.useCallback((b=!1,w=!1)=>{const y={columns:w?o.columns:yt.empty(),rows:b?o.rows:yt.empty(),current:void 0};a(y),(!b&&s||!w&&u)&&r(y)},[o,s,u,r]);return{gridSelection:o,isRowSelectionActivated:s,isMultiRowSelectionActivated:l,isColumnSelectionActivated:u,isMultiColumnSelectionActivated:c,isRowSelected:d,isColumnSelected:f,isCellSelected:h,clearSelection:p,processSelectionChange:m}}function Hy({top:e,left:t,content:n,clearTooltip:i}){const[r,o]=ae.useState(!0),a=Hs(),{colors:s,fontSizes:l,radii:u,fontWeights:c}=a,d=ae.useCallback(()=>{o(!1),i()},[i,o]);return xn(nh,{content:xn(Zf,{"data-testid":"stDataFrameTooltipContent",children:xn(Jf,{style:{fontSize:l.sm},source:n,allowHTML:!1})}),placement:Qf.top,accessibilityType:eh.tooltip,showArrow:!1,popoverMargin:5,onClickOutside:d,onEsc:d,overrides:{Body:{style:{borderTopLeftRadius:u.default,borderTopRightRadius:u.default,borderBottomLeftRadius:u.default,borderBottomRightRadius:u.default,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important",backgroundColor:"transparent"}},Inner:{style:{backgroundColor:th(a)?s.bgColor:s.secondaryBg,color:s.bodyText,fontSize:l.sm,fontWeight:c.normal,paddingTop:"0 !important",paddingBottom:"0 !important",paddingLeft:"0 !important",paddingRight:"0 !important"}}},isOpen:r,children:xn("div",{"data-testid":"stDataFrameTooltipTarget",style:{position:"fixed",top:e,left:t}})})}const nc=cc("div",{target:"egqaslz0"})(({hasCustomizedScrollbars:e,theme:t})=>({position:"relative",display:"inline-block","& .stDataFrameGlideDataEditor":{height:"100%",minWidth:"100%",borderRadius:t.radii.default},"& .dvn-scroller":{...!e&&{scrollbarWidth:"thin"},overflowX:"auto !important",overflowY:"auto !important"}})),rc=150,zy=15e4,ta=6;function $y({element:e,data:t,disabled:n,widgetMgr:i,disableFullscreenMode:r,fragmentId:o}){const{expanded:a,expand:s,collapse:l,width:u,height:c}=sh(lh),d=ae.useRef(null),f=ae.useRef(null),h=ae.useRef(null),m=x1(),{libConfig:{enforceDownloadInNewTab:p=!1}}=ae.useContext(rh),[b,w]=ae.useState(!0),[y,S]=ae.useState(!1),[M,C]=ae.useState(!1),[x,R]=ae.useState(!1),I=ae.useMemo(()=>window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,[]),E=ae.useMemo(()=>window.navigator.userAgent.includes("Mac OS")&&window.navigator.userAgent.includes("Safari")||window.navigator.userAgent.includes("Chrome"),[]);Ze(e.editingMode)&&(e.editingMode=Un.EditingMode.READ_ONLY);const{READ_ONLY:H,DYNAMIC:z}=Un.EditingMode,L=t.dimensions,_=Math.max(0,L.dataRows),O=_===0&&!(e.editingMode===z&&L.dataColumns>0),ne=_>zy,q=ae.useRef(new Ko(_)),[oe,Se]=ae.useState(q.current.getNumRows());ae.useEffect(()=>{q.current=new Ko(_),Se(q.current.getNumRows())},[_]);const xe=ae.useCallback(()=>{q.current=new Ko(_),Se(q.current.getNumRows())},[_]),{columns:re}=S1(e,t,n);ae.useEffect(()=>{if(e.editingMode===H)return;const De=i.getStringValue({id:e.id,formId:e.formId});De&&(q.current.fromJson(De,re),Se(q.current.getNumRows()))},[]);const{getCellContent:J}=k1(t,re,oe,q),{columns:ee,sortColumn:ie,getOriginalIndex:ge,getCellContent:fe}=_1(_,re,J),G=ae.useCallback(De=>{const lt={selection:{rows:[],columns:[]}};lt.selection.rows=De.rows.toArray().map(vt=>ge(vt)),lt.selection.columns=De.columns.toArray().map(vt=>oo(ee[vt]));const ze=JSON.stringify(lt),Lt=i.getStringValue({id:e.id,formId:e.formId});(Lt===void 0||Lt!==ze)&&i.setStringValue({id:e.id,formId:e.formId},ze,{fromUi:!0},o)},[ee,e.id,e.formId,i,o,ge]),{debouncedCallback:P}=Su(G,rc),{gridSelection:k,isRowSelectionActivated:$,isMultiRowSelectionActivated:le,isColumnSelectionActivated:Te,isMultiColumnSelectionActivated:Be,isRowSelected:ce,isColumnSelected:nt,isCellSelected:ke,clearSelection:bt,processSelectionChange:Et}=Ay(e,O,n,ee,P);ae.useEffect(()=>{bt(!0,!0)},[a]);const at=ae.useCallback(De=>{var lt;(lt=f.current)==null||lt.updateCells(De)},[]);ae.useEffect(()=>{var lt,ze,Lt,vt;if(!$&&!Te)return;const De=i.getStringValue({id:e.id,formId:e.formId});if(De){const on=ee.map(Pt=>oo(Pt)),Tt=JSON.parse(De);let Ft=yt.empty(),Ve=yt.empty();(ze=(lt=Tt.selection)==null?void 0:lt.rows)==null||ze.forEach(Pt=>{Ft=Ft.add(Pt)}),(vt=(Lt=Tt.selection)==null?void 0:Lt.columns)==null||vt.forEach(Pt=>{Ve=Ve.add(on.indexOf(Pt))}),(Ft.length>0||Ve.length>0)&&Et({rows:Ft,columns:Ve,current:void 0})}},[]);const te=ae.useCallback(()=>{oe!==q.current.getNumRows()&&Se(q.current.getNumRows())},[oe]),it=ae.useCallback(()=>{const De=q.current.toJson(ee);let lt=i.getStringValue({id:e.id,formId:e.formId});lt===void 0&&(lt=new Ko(0).toJson([])),De!==lt&&i.setStringValue({id:e.id,formId:e.formId},De,{fromUi:!0},o)},[ee,e.id,e.formId,i,o]),{debouncedCallback:me}=Su(it,rc),{exportToCsv:se}=Fy(fe,ee,oe,p),{onCellEdited:he,onPaste:$e,onRowAppended:Le,onDelete:Je,validateCell:de}=R1(ee,e.editingMode!==z,q,fe,ge,at,te,me,bt),{tooltip:be,clearTooltip:Ge,onItemHovered:Ae}=A1(ee,fe),{drawCell:tt,customRenderers:wt}=Dy(ee),gt=ae.useMemo(()=>ee.map(De=>Os(De)),[ee]),{columns:He,onColumnResize:_t}=E1(gt),Xt=t.columns.length>1,{minHeight:Ot,maxHeight:Ht,minWidth:rn,maxWidth:zt,rowHeight:gn,resizableSize:$t,setResizableSize:It}=M1(e,m,oe,Xt,u,c,a),In=ae.useCallback(([De,lt])=>({...r1(!0,!1),displayData:"empty",contentAlign:"center",allowOverlay:!1,themeOverride:{textDark:m.glideTheme.textLight},span:[0,Math.max(ee.length-1,0)]}),[ee,m.glideTheme.textLight]),bn=ae.useCallback(()=>{xe(),bt()},[xe,bt]);oh({element:e,widgetMgr:i,onFormCleared:bn});const Oe=!O&&e.editingMode===z&&!n,Vt=g.useMemo(()=>ee.filter(De=>De.isPinned).reduce((De,lt)=>De+(lt.width??m.minColumnWidth*2),0)>u*.6,[ee,u,m.minColumnWidth]),dn=O||Vt?0:ee.filter(De=>De.isPinned).length;return ae.useEffect(()=>{setTimeout(()=>{var De,lt;if(h.current&&f.current){const ze=(lt=(De=h.current)==null?void 0:De.querySelector(".dvn-stack"))==null?void 0:lt.getBoundingClientRect();ze&&(C(ze.height>h.current.clientHeight),R(ze.width>h.current.clientWidth))}},1)},[$t,oe,He]),Fl(nc,{className:"stDataFrame","data-testid":"stDataFrame",hasCustomizedScrollbars:E,ref:h,onMouseDown:De=>{if(h.current&&E){const lt=h.current.getBoundingClientRect();x&&lt.height-(ta+1)<De.clientY-lt.top&&De.stopPropagation(),M&&lt.width-(ta+1)<De.clientX-lt.left&&De.stopPropagation()}},onBlur:De=>{!b&&!I&&!De.currentTarget.contains(De.relatedTarget)&&bt(!0,!0)},children:[Fl(uh,{isFullScreen:a,disableFullscreenMode:r,locked:ce&&!$||ke||I&&b,onExpand:s,onCollapse:l,target:nc,children:[($&&ce||Te&&nt)&&xn(Wi,{label:"Clear selection",icon:fh,onClick:()=>{bt(),Ge()}}),Oe&&ce&&xn(Wi,{label:"Delete row(s)",icon:vh,onClick:()=>{Je&&(Je(k),Ge())}}),Oe&&!ce&&xn(Wi,{label:"Add row",icon:gc,onClick:()=>{Le&&(w(!0),Le(),Ge())}}),!ne&&!O&&xn(Wi,{label:"Download as CSV",icon:bh,onClick:()=>se()}),!O&&xn(Wi,{label:"Search",icon:mc,onClick:()=>{y?S(!1):(w(!0),S(!0)),Ge()}})]}),xn(ih,{"data-testid":"stDataFrameResizable",ref:d,defaultSize:$t,style:{border:`${m.tableBorderWidth}px solid ${m.glideTheme.borderColor}`,borderRadius:`${m.tableBorderRadius}`},minHeight:Ot,maxHeight:Ht,minWidth:rn,maxWidth:zt,size:$t,enable:{top:!1,right:!1,bottom:!1,left:!1,topRight:!1,bottomRight:!0,bottomLeft:!1,topLeft:!1},grid:[1,gn],snapGap:gn/3,onResizeStop:(De,lt,ze,Lt)=>{if(d.current){const vt=2*m.tableBorderWidth;It({width:d.current.size.width,height:Ht-d.current.size.height===vt?d.current.size.height+vt:d.current.size.height})}},children:xn(Jv,{className:"stDataFrameGlideDataEditor","data-testid":"stDataFrameGlideDataEditor",ref:f,columns:He,rows:O?1:oe,minColumnWidth:m.minColumnWidth,maxColumnWidth:m.maxColumnWidth,maxColumnAutoWidth:m.maxColumnAutoWidth,rowHeight:gn,headerHeight:m.defaultHeaderHeight,getCellContent:O?In:fe,onColumnResize:I?void 0:_t,resizeIndicator:"header",freezeColumns:dn,smoothScrollX:!0,smoothScrollY:!0,verticalBorder:!0,getCellsForSelection:!0,rowMarkers:"none",rangeSelect:I?"cell":"rect",columnSelect:"none",rowSelect:"none",onItemHovered:Ae,keybindings:{downFill:!0},onKeyDown:De=>{(De.ctrlKey||De.metaKey)&&De.key==="f"&&(S(lt=>!lt),De.stopPropagation(),De.preventDefault())},showSearch:y,onSearchClose:()=>{S(!1),Ge()},onHeaderClicked:(De,lt)=>{O||ne||Te||($&&ce&&bt(),ie(De))},gridSelection:k,onGridSelectionChange:De=>{(b||I)&&(Et(De),be!==void 0&&Ge())},theme:m.glideTheme,onMouseMove:De=>{De.kind==="out-of-bounds"&&b?w(!1):De.kind!=="out-of-bounds"&&!b&&w(!0)},fixedShadowX:!0,fixedShadowY:!0,experimental:{scrollbarWidthOverride:0,...E&&{paddingBottom:x?-ta:void 0,paddingRight:M?-ta:void 0}},drawCell:tt,customRenderers:wt,imageEditorOverride:c1,headerIcons:m.headerIcons,validateCell:de,onPaste:!1,...$&&{rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:le?"multi":"auto",rowSelect:n?"none":le?"multi":"single",rowSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...Te&&{columnSelect:n?"none":Be?"multi":"single",columnSelectionBlending:"mixed",rangeSelectionBlending:"exclusive"},...!O&&e.editingMode!==H&&!n&&{fillHandle:!I,onCellEdited:he,onPaste:$e,onDelete:Je},...!O&&e.editingMode===z&&{trailingRowOptions:{sticky:!1,tint:!0},rowMarkers:{kind:"checkbox",checkboxStyle:"square",theme:{bgCell:m.glideTheme.bgHeader,bgCellMedium:m.glideTheme.bgHeader}},rowSelectionMode:"multi",rowSelect:n?"none":"multi",onRowAppended:n?void 0:Le,onHeaderClicked:void 0}})}),be&&be.content&&xn(Hy,{top:be.top,left:be.left,content:be.content,clearTooltip:Ge})]})}const Vy=ah($y),Jy=Object.freeze(Object.defineProperty({__proto__:null,default:Vy},Symbol.toStringTag,{value:"Module"}));export{E0 as C,jc as T,wi as a,Th as b,Jy as c,vi as i,Fm as m,hn as s};