adminizer 4.2.0 → 4.3.0-build.100

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 (276) hide show
  1. package/assets/add-1E1UsMVZ.js +1 -0
  2. package/assets/add-form-CGa9QbwE.js +1 -0
  3. package/assets/add-group-7yAK6uFY.js +1 -0
  4. package/assets/add-group-form-BNmpvW8K.js +1 -0
  5. package/assets/add-user-NoYkTfZi.js +1 -0
  6. package/assets/add-user-form-DrclnTOd.js +1 -0
  7. package/assets/{app-CVnUv8s_.css → app-D8oqdt8J.css} +1 -1
  8. package/assets/app-layout-i2zN9Rn-.js +1 -0
  9. package/assets/app-shell-CHEYhVco.js +1 -0
  10. package/assets/app-sidebar-DeF8WNmW.js +1 -0
  11. package/assets/app-sidebar-header-DdM1EOrb.js +1 -0
  12. package/assets/app.js +1699 -1657
  13. package/assets/breadcrumbs-C439DWrC.js +1 -0
  14. package/assets/catalog-B9hdop59.js +6 -0
  15. package/assets/dashboard-Bi5KeZu2.js +3 -0
  16. package/assets/date-picker-DbJ8nHp5.js +1 -0
  17. package/assets/del-modal-_b3CSNHb.js +1 -0
  18. package/assets/dynamic-controls-BOYmRX_z.js +1 -0
  19. package/assets/field-renderer-4obZ_jUo.js +407 -0
  20. package/assets/{field-renderer-CsBa_tMB.css → field-renderer-CRNLShJD.css} +1 -1
  21. package/assets/form-Bte5kzjB.js +1 -0
  22. package/assets/form-oUlsuu7h.js +1 -0
  23. package/assets/geo-json-CadjdhwW.js +4 -0
  24. package/assets/handsontable-PVakPtJV.js +281 -0
  25. package/assets/home-CsUXA-O6.js +2 -0
  26. package/assets/icon-DM49pZW3.js +1 -0
  27. package/assets/init-user-DNrB8Xt5.js +1 -0
  28. package/assets/input-error--IOnWghB.js +1 -0
  29. package/assets/jsoneditor-D95dIAP2.js +3878 -0
  30. package/assets/list-CdfSnSN1.js +1 -0
  31. package/assets/list-table-Byzv346I.js +22 -0
  32. package/assets/login-6Xb8bcPq.js +1 -0
  33. package/assets/manifest.json +331 -221
  34. package/assets/material-icon-BedgD2NE.js +1 -0
  35. package/assets/media-manager-UQT6RhI8.js +14 -0
  36. package/assets/module-B4-7WkY5.js +1 -0
  37. package/assets/monaco-ICtx6xoc.js +11 -0
  38. package/assets/nav-footer-BwkQkwow.js +1 -0
  39. package/assets/nav-main-9Eb_A0rf.js +1 -0
  40. package/assets/nav-user-CRAfyE-x.js +1 -0
  41. package/assets/notification-ma2x7vka.js +27 -0
  42. package/assets/pagination-render-xsEktzA8.js +1 -0
  43. package/assets/register-BIyjCy8M.js +1 -0
  44. package/assets/tabs-BK_5wdPA.js +1 -0
  45. package/assets/theme-switcher-CKiJbMkh.js +1 -0
  46. package/assets/toast-editor-BZM5RHph.js +845 -0
  47. package/assets/user-info-CcYdmjMZ.js +1 -0
  48. package/assets/user-menu-content-DbUk8ZeY.js +1 -0
  49. package/assets/vanilla-picker-l5rcX3cq.js +8 -0
  50. package/assets/vendor-wzZzN_Jv.js +17 -0
  51. package/assets/welcome-cWh1qnl_.js +1 -0
  52. package/controllers/add.js +1 -1
  53. package/controllers/catalog/FrontentCatalogAdapter.d.ts +4 -4
  54. package/controllers/ckeditorUpload.d.ts +1 -1
  55. package/controllers/ckeditorUpload.js +50 -26
  56. package/controllers/edit.js +2 -2
  57. package/controllers/form.js +28 -13
  58. package/controllers/list.js +2 -2
  59. package/controllers/login.js +2 -2
  60. package/controllers/media-manager/mediaManagerAdapter.js +13 -2
  61. package/controllers/media-manager/mediaManagerApi.js +4 -3
  62. package/controllers/navigation/edit.js +1 -1
  63. package/controllers/notifications/NotificationController.d.ts +11 -0
  64. package/controllers/notifications/NotificationController.js +219 -0
  65. package/controllers/remove.js +2 -1
  66. package/controllers/view.js +1 -1
  67. package/files/favicon.png +0 -0
  68. package/helpers/configHelper.d.ts +1 -1
  69. package/helpers/controllerHelper.js +1 -1
  70. package/helpers/diffHelpers.d.ts +2 -0
  71. package/helpers/diffHelpers.js +69 -0
  72. package/helpers/fieldsHelper.d.ts +1 -1
  73. package/helpers/fieldsHelper.js +1 -1
  74. package/helpers/formHelper.js +3 -1
  75. package/helpers/inertiaAddHelper.d.ts +1 -1
  76. package/helpers/inertiaAutHelper.js +19 -0
  77. package/helpers/inertiaFromHelper.js +12 -0
  78. package/helpers/translationHelper.d.ts +1 -1
  79. package/helpers/translationHelper.js +1 -1
  80. package/index.d.ts +16 -14
  81. package/index.js +16 -14
  82. package/interfaces/adminpanelConfig.d.ts +18 -0
  83. package/interfaces/global.d.ts +3 -3
  84. package/interfaces/types.d.ts +44 -2
  85. package/lib/Adminizer.d.ts +16 -8
  86. package/lib/Adminizer.js +95 -12
  87. package/lib/{v4/DataAccessor.d.ts → DataAccessor.d.ts} +5 -5
  88. package/lib/{v4/DataAccessor.js → DataAccessor.js} +3 -3
  89. package/lib/{v4/I18n.js → I18n.js} +2 -2
  90. package/lib/{v4/PolicyManager.d.ts → PolicyManager.d.ts} +1 -1
  91. package/lib/{v4/PolicyManager.js → PolicyManager.js} +2 -2
  92. package/lib/{v4/catalog → catalog}/AbstractCatalog.d.ts +1 -1
  93. package/lib/{v4/catalog → catalog}/Navigation.d.ts +2 -2
  94. package/lib/{v4/catalog → catalog}/Navigation.js +1 -1
  95. package/lib/{v4/controls → controls}/AbstractControls.d.ts +1 -1
  96. package/lib/{v4/controls → controls}/codeEditor/MonacoEditor.d.ts +1 -1
  97. package/lib/{v4/controls → controls}/geojsoneditor/GeoEditor.d.ts +1 -1
  98. package/lib/{v4/controls → controls}/jsoneditor/JsonEditor.d.ts +1 -1
  99. package/lib/{v4/controls → controls}/markdown/ToastUiEditor.d.ts +1 -1
  100. package/lib/{v4/controls → controls}/table/Handsontable.d.ts +1 -1
  101. package/lib/{v4/controls → controls}/wysiwyg/CKeditor.d.ts +1 -1
  102. package/lib/{v4/controls → controls}/wysiwyg/CKeditor.js +1 -1
  103. package/lib/{v4/datatable → datatable}/NodeTable.d.ts +1 -1
  104. package/lib/media-manager/AbstractMediaManager.d.ts +3 -3
  105. package/lib/media-manager/AbstractMediaManager.js +2 -2
  106. package/lib/media-manager/DefaultMediaManager.d.ts +1 -1
  107. package/lib/media-manager/DefaultMediaManager.js +6 -8
  108. package/lib/media-manager/Items.d.ts +2 -1
  109. package/lib/media-manager/Items.js +7 -0
  110. package/lib/media-manager/helpers/MediaManagerHelper.d.ts +10 -0
  111. package/lib/media-manager/helpers/MediaManagerHelper.js +27 -10
  112. package/lib/{v4/model → model}/AbstractModel.d.ts +12 -0
  113. package/lib/model/AbstractModel.js +178 -0
  114. package/lib/{v4/model → model}/ModelHandler.js +1 -1
  115. package/lib/{v4/model → model}/adapter/sequelize.d.ts +3 -4
  116. package/lib/{v4/model → model}/adapter/sequelize.js +41 -14
  117. package/lib/notifications/AbstractNotificationService.d.ts +163 -0
  118. package/lib/notifications/AbstractNotificationService.js +353 -0
  119. package/lib/notifications/GeneralNotificationService.d.ts +8 -0
  120. package/lib/notifications/GeneralNotificationService.js +61 -0
  121. package/lib/notifications/NotificationHandler.d.ts +27 -0
  122. package/lib/notifications/NotificationHandler.js +41 -0
  123. package/lib/notifications/SystemNotificationService.d.ts +19 -0
  124. package/lib/notifications/SystemNotificationService.js +173 -0
  125. package/lib/{v4/widgets → widgets}/abstractCustom.d.ts +1 -1
  126. package/lib/{v4/widgets → widgets}/abstractLink.d.ts +1 -1
  127. package/lib/{v4/widgets → widgets}/abstractWidgetBase.d.ts +1 -1
  128. package/lib/{v4/widgets → widgets}/widgetHandler.d.ts +2 -2
  129. package/migrations/index.d.ts +3 -0
  130. package/migrations/index.js +4 -0
  131. package/migrations/umzug/0001.d.ts +7 -0
  132. package/migrations/umzug/0001.js +121 -0
  133. package/migrations/umzugExports.d.ts +2 -0
  134. package/migrations/umzugExports.js +9 -0
  135. package/models/MediaManagerAP.d.ts +9 -3
  136. package/models/MediaManagerAP.js +11 -5
  137. package/models/MediaManagerAssociationsAP.d.ts +9 -3
  138. package/models/MediaManagerAssociationsAP.js +11 -5
  139. package/models/MediaManagerMetaAP.d.ts +9 -3
  140. package/models/MediaManagerMetaAP.js +11 -5
  141. package/models/NotificationAP.d.ts +44 -0
  142. package/models/NotificationAP.js +30 -0
  143. package/models/UserAP.d.ts +1 -1
  144. package/models/UserNotificationAP.d.ts +26 -0
  145. package/models/UserNotificationAP.js +18 -0
  146. package/package.json +17 -8
  147. package/system/Router.js +21 -7
  148. package/system/bindAssets.js +1 -0
  149. package/system/bindControls.js +6 -6
  150. package/system/bindInertia.js +9 -3
  151. package/system/bindMediaManager.js +2 -1
  152. package/system/bindNavigation.js +3 -4
  153. package/system/bindNotifications.d.ts +2 -0
  154. package/system/bindNotifications.js +14 -0
  155. package/system/bindReqFunctions.js +8 -25
  156. package/system/defaults.js +6 -0
  157. package/translations/ar.json +5 -4
  158. package/translations/cn.json +5 -4
  159. package/translations/de.json +72 -71
  160. package/translations/en.json +5 -4
  161. package/translations/es.json +5 -4
  162. package/translations/fr.json +5 -4
  163. package/translations/hi.json +5 -4
  164. package/translations/jp.json +5 -4
  165. package/translations/ko.json +5 -4
  166. package/translations/pt.json +5 -4
  167. package/translations/ru.json +2 -1
  168. package/translations/ua.json +5 -4
  169. package/translations/uz.json +73 -72
  170. package/translations/vi.json +5 -4
  171. package/ui/components/VanillaJSONEditor.d.ts +2 -0
  172. package/ui/components/VanillaJSONEditor.js +101 -0
  173. package/ui/components/handsontable.d.ts +10 -0
  174. package/ui/components/handsontable.js +51 -0
  175. package/ui/components/monaco-editor.d.ts +11 -0
  176. package/ui/components/monaco-editor.js +57 -0
  177. package/ui/components/ui/table.d.ts +1 -1
  178. package/ui/components/ui/table.js +2 -2
  179. package/ui/hooks/form-state.d.ts +4 -0
  180. package/ui/hooks/form-state.js +45 -0
  181. package/ui/hooks/use-appearance.d.ts +7 -0
  182. package/ui/hooks/use-appearance.js +76 -0
  183. package/ui/hooks/use-window-size.d.ts +5 -0
  184. package/ui/hooks/use-window-size.js +21 -0
  185. package/assets/VanillaJSONEditor-x8tDbio1.js +0 -3833
  186. package/assets/add-DOaZgoTz.js +0 -1
  187. package/assets/add-form-BjackXJe.js +0 -1
  188. package/assets/add-group-Br44s2D6.js +0 -1
  189. package/assets/add-group-form-YI6KS37x.js +0 -1
  190. package/assets/add-user-DWcH0s9-.js +0 -1
  191. package/assets/add-user-form-bv5BNX5A.js +0 -1
  192. package/assets/app-layout-DecN527i.js +0 -1
  193. package/assets/app-shell-DHzMWA1L.js +0 -1
  194. package/assets/app-sidebar-4JFP8UdU.js +0 -1
  195. package/assets/app-sidebar-header-CIKLfLsF.js +0 -1
  196. package/assets/breadcrumbs-Bo2z-LNC.js +0 -1
  197. package/assets/catalog-DVyrGTNR.js +0 -6
  198. package/assets/dashboard-Dy3pk9t7.js +0 -3
  199. package/assets/date-picker-B2z-aeuv.js +0 -1
  200. package/assets/debounce-D6eaSoDg.js +0 -1
  201. package/assets/del-modal-l3LxJWCN.js +0 -1
  202. package/assets/dynamic-controls-CSVVCONh.js +0 -1
  203. package/assets/field-renderer-BHo944Cn.js +0 -407
  204. package/assets/form-BXfnz6h5.js +0 -1
  205. package/assets/form-hP8sjbND.js +0 -1
  206. package/assets/form-state-702tb_BV.js +0 -1
  207. package/assets/geo-json-CVaNUZbb.js +0 -4
  208. package/assets/handsontable-CZQ5Ietj.js +0 -347
  209. package/assets/home-BD4MWmm9.js +0 -2
  210. package/assets/icon-C_X2cQ6W.js +0 -1
  211. package/assets/index-C148XJoK.js +0 -1
  212. package/assets/index-Vcq4gwWv.js +0 -1
  213. package/assets/init-user-DgCD4ZN1.js +0 -1
  214. package/assets/input-error-Bab-HPbn.js +0 -1
  215. package/assets/list-C-27EH39.js +0 -1
  216. package/assets/list-table-_OiQmr2A.js +0 -22
  217. package/assets/login-jzvVXgAV.js +0 -1
  218. package/assets/material-icon-DsiW0iQG.js +0 -1
  219. package/assets/media-manager-CSB_XRcE.js +0 -14
  220. package/assets/module-Ceq6vuwa.js +0 -1
  221. package/assets/monaco-editor-XX8Hz76f.js +0 -11
  222. package/assets/multi-select-BbKSrMw2.js +0 -1
  223. package/assets/nav-footer-B8gMV6Wp.js +0 -1
  224. package/assets/nav-main-BUp9qA8R.js +0 -1
  225. package/assets/nav-user-DeF3SDRj.js +0 -1
  226. package/assets/pagination-render-B9U_hVbB.js +0 -1
  227. package/assets/register-C6acWsLe.js +0 -1
  228. package/assets/theme-switcher-D8T9NgWG.js +0 -1
  229. package/assets/toast-editor-C0550yms.js +0 -845
  230. package/assets/use-appearance-CXP5cHaQ.js +0 -1
  231. package/assets/use-window-size-DLSEoR6e.js +0 -1
  232. package/assets/user-info-CAgkqARx.js +0 -1
  233. package/assets/user-menu-content-BxL0QMC9.js +0 -1
  234. package/assets/vanilla-picker-B6E6ObS_.js +0 -8
  235. package/assets/welcome-Dk7GoS5R.js +0 -1
  236. package/lib/v4/model/AbstractModel.js +0 -67
  237. package/lib/v4/model/adapter/typeorm.d.ts +0 -23
  238. package/lib/v4/model/adapter/typeorm.js +0 -68
  239. package/migrations/20230303171134-adminpanel-init.js +0 -122
  240. package/migrations/20231223215835-add-widgets.js +0 -32
  241. package/migrations/20240804191001-added-navigationap.js +0 -53
  242. package/migrations/20241121184236-v4-init.js +0 -134
  243. /package/lib/{v4/I18n.d.ts → I18n.d.ts} +0 -0
  244. /package/lib/{v4/POWCaptcha.d.ts → POWCaptcha.d.ts} +0 -0
  245. /package/lib/{v4/POWCaptcha.js → POWCaptcha.js} +0 -0
  246. /package/lib/{v4/catalog → catalog}/AbstractCatalog.js +0 -0
  247. /package/lib/{v4/catalog → catalog}/CatalogHandler.d.ts +0 -0
  248. /package/lib/{v4/catalog → catalog}/CatalogHandler.js +0 -0
  249. /package/lib/{v4/controls → controls}/AbstractControls.js +0 -0
  250. /package/lib/{v4/controls → controls}/ControlsHandler.d.ts +0 -0
  251. /package/lib/{v4/controls → controls}/ControlsHandler.js +0 -0
  252. /package/lib/{v4/controls → controls}/codeEditor/MonacoEditor.js +0 -0
  253. /package/lib/{v4/controls → controls}/geojsoneditor/GeoEditor.js +0 -0
  254. /package/lib/{v4/controls → controls}/jsoneditor/JsonEditor.js +0 -0
  255. /package/lib/{v4/controls → controls}/markdown/ToastUiEditor.js +0 -0
  256. /package/lib/{v4/controls → controls}/table/Handsontable.js +0 -0
  257. /package/lib/{v4/datatable → datatable}/NodeTable.js +0 -0
  258. /package/lib/{v4/helper → helper}/jwt.d.ts +0 -0
  259. /package/lib/{v4/helper → helper}/jwt.js +0 -0
  260. /package/lib/{v4/inertia → inertia}/flash.d.ts +0 -0
  261. /package/lib/{v4/inertia → inertia}/flash.js +0 -0
  262. /package/lib/{v4/inertia → inertia}/inertiaAdapter.d.ts +0 -0
  263. /package/lib/{v4/inertia → inertia}/inertiaAdapter.js +0 -0
  264. /package/lib/{v4/model → model}/ModelHandler.d.ts +0 -0
  265. /package/lib/{v4/model → model}/adapter/waterline.d.ts +0 -0
  266. /package/lib/{v4/model → model}/adapter/waterline.js +0 -0
  267. /package/lib/{v4/widgets → widgets}/abstractAction.d.ts +0 -0
  268. /package/lib/{v4/widgets → widgets}/abstractAction.js +0 -0
  269. /package/lib/{v4/widgets → widgets}/abstractCustom.js +0 -0
  270. /package/lib/{v4/widgets → widgets}/abstractInfo.d.ts +0 -0
  271. /package/lib/{v4/widgets → widgets}/abstractInfo.js +0 -0
  272. /package/lib/{v4/widgets → widgets}/abstractLink.js +0 -0
  273. /package/lib/{v4/widgets → widgets}/abstractSwitch.d.ts +0 -0
  274. /package/lib/{v4/widgets → widgets}/abstractSwitch.js +0 -0
  275. /package/lib/{v4/widgets → widgets}/abstractWidgetBase.js +0 -0
  276. /package/lib/{v4/widgets → widgets}/widgetHandler.js +0 -0
@@ -0,0 +1,281 @@
1
+ import{e as Dt}from"./monaco-ICtx6xoc.js";import{a as j$,g as U$,c as GT}from"./vendor-wzZzN_Jv.js";var z$=j$();const t1=U$(z$);var qT={},oc,KT;function Kt(){if(KT)return oc;KT=1;var t=function(e){return e&&e.Math===Math&&e};return oc=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof GT=="object"&&GT)||t(typeof oc=="object"&&oc)||(function(){return this})()||Function("return this")(),oc}var Vp={},Wp,XT;function sn(){return XT||(XT=1,Wp=function(t){try{return!!t()}catch{return!0}}),Wp}var Bp,ZT;function Kr(){if(ZT)return Bp;ZT=1;var t=sn();return Bp=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Bp}var jp,QT;function Fm(){if(QT)return jp;QT=1;var t=sn();return jp=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),jp}var Up,JT;function an(){if(JT)return Up;JT=1;var t=Fm(),e=Function.prototype.call;return Up=t?e.bind(e):function(){return e.apply(e,arguments)},Up}var zp={},e_;function Y$(){if(e_)return zp;e_=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,n=e&&!t.call({1:2},1);return zp.f=n?function(i){var o=e(this,i);return!!o&&o.enumerable}:t,zp}var Yp,t_;function Vm(){return t_||(t_=1,Yp=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),Yp}var Gp,n_;function Xt(){if(n_)return Gp;n_=1;var t=Fm(),e=Function.prototype,n=e.call,r=t&&e.bind.bind(n,n);return Gp=t?r:function(i){return function(){return n.apply(i,arguments)}},Gp}var qp,r_;function fl(){if(r_)return qp;r_=1;var t=Xt(),e=t({}.toString),n=t("".slice);return qp=function(r){return n(e(r),8,-1)},qp}var Kp,i_;function G$(){if(i_)return Kp;i_=1;var t=Xt(),e=sn(),n=fl(),r=Object,i=t("".split);return Kp=e(function(){return!r("z").propertyIsEnumerable(0)})?function(o){return n(o)==="String"?i(o,""):r(o)}:r,Kp}var Xp,o_;function GS(){return o_||(o_=1,Xp=function(t){return t==null}),Xp}var Zp,s_;function ad(){if(s_)return Zp;s_=1;var t=GS(),e=TypeError;return Zp=function(n){if(t(n))throw new e("Can't call method on "+n);return n},Zp}var Qp,a_;function ld(){if(a_)return Qp;a_=1;var t=G$(),e=ad();return Qp=function(n){return t(e(n))},Qp}var Jp,l_;function ln(){if(l_)return Jp;l_=1;var t=typeof document=="object"&&document.all;return Jp=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},Jp}var ew,u_;function Xr(){if(u_)return ew;u_=1;var t=ln();return ew=function(e){return typeof e=="object"?e!==null:t(e)},ew}var tw,c_;function Wu(){if(c_)return tw;c_=1;var t=Kt(),e=ln(),n=function(r){return e(r)?r:void 0};return tw=function(r,i){return arguments.length<2?n(t[r]):t[r]&&t[r][i]},tw}var nw,h_;function ud(){if(h_)return nw;h_=1;var t=Xt();return nw=t({}.isPrototypeOf),nw}var rw,d_;function Wm(){if(d_)return rw;d_=1;var t=Kt(),e=t.navigator,n=e&&e.userAgent;return rw=n?String(n):"",rw}var iw,f_;function q$(){if(f_)return iw;f_=1;var t=Kt(),e=Wm(),n=t.process,r=t.Deno,i=n&&n.versions||r&&r.version,o=i&&i.v8,s,a;return o&&(s=o.split("."),a=s[0]>0&&s[0]<4?1:+(s[0]+s[1])),!a&&e&&(s=e.match(/Edge\/(\d+)/),(!s||s[1]>=74)&&(s=e.match(/Chrome\/(\d+)/),s&&(a=+s[1]))),iw=a,iw}var ow,g_;function qS(){if(g_)return ow;g_=1;var t=q$(),e=sn(),n=Kt(),r=n.String;return ow=!!Object.getOwnPropertySymbols&&!e(function(){var i=Symbol("symbol detection");return!r(i)||!(Object(i)instanceof Symbol)||!Symbol.sham&&t&&t<41}),ow}var sw,m_;function n1(){if(m_)return sw;m_=1;var t=qS();return sw=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",sw}var aw,p_;function KS(){if(p_)return aw;p_=1;var t=Wu(),e=ln(),n=ud(),r=n1(),i=Object;return aw=r?function(o){return typeof o=="symbol"}:function(o){var s=t("Symbol");return e(s)&&n(s.prototype,i(o))},aw}var lw,w_;function Bm(){if(w_)return lw;w_=1;var t=String;return lw=function(e){try{return t(e)}catch{return"Object"}},lw}var uw,v_;function dr(){if(v_)return uw;v_=1;var t=ln(),e=Bm(),n=TypeError;return uw=function(r){if(t(r))return r;throw new n(e(r)+" is not a function")},uw}var cw,C_;function cd(){if(C_)return cw;C_=1;var t=dr(),e=GS();return cw=function(n,r){var i=n[r];return e(i)?void 0:t(i)},cw}var hw,y_;function K$(){if(y_)return hw;y_=1;var t=an(),e=ln(),n=Xr(),r=TypeError;return hw=function(i,o){var s,a;if(o==="string"&&e(s=i.toString)&&!n(a=t(s,i))||e(s=i.valueOf)&&!n(a=t(s,i))||o!=="string"&&e(s=i.toString)&&!n(a=t(s,i)))return a;throw new r("Can't convert object to primitive value")},hw}var dw={exports:{}},fw,b_;function qs(){return b_||(b_=1,fw=!1),fw}var gw,S_;function XS(){if(S_)return gw;S_=1;var t=Kt(),e=Object.defineProperty;return gw=function(n,r){try{e(t,n,{value:r,configurable:!0,writable:!0})}catch{t[n]=r}return r},gw}var R_;function ZS(){if(R_)return dw.exports;R_=1;var t=qs(),e=Kt(),n=XS(),r="__core-js_shared__",i=dw.exports=e[r]||n(r,{});return(i.versions||(i.versions=[])).push({version:"3.45.1",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE",source:"https://github.com/zloirock/core-js"}),dw.exports}var mw,E_;function r1(){if(E_)return mw;E_=1;var t=ZS();return mw=function(e,n){return t[e]||(t[e]=n||{})},mw}var pw,T_;function Bu(){if(T_)return pw;T_=1;var t=ad(),e=Object;return pw=function(n){return e(t(n))},pw}var ww,__;function Zr(){if(__)return ww;__=1;var t=Xt(),e=Bu(),n=t({}.hasOwnProperty);return ww=Object.hasOwn||function(i,o){return n(e(i),o)},ww}var vw,M_;function i1(){if(M_)return vw;M_=1;var t=Xt(),e=0,n=Math.random(),r=t(1.1.toString);return vw=function(i){return"Symbol("+(i===void 0?"":i)+")_"+r(++e+n,36)},vw}var Cw,I_;function Mi(){if(I_)return Cw;I_=1;var t=Kt(),e=r1(),n=Zr(),r=i1(),i=qS(),o=n1(),s=t.Symbol,a=e("wks"),l=o?s.for||s:s&&s.withoutSetter||r;return Cw=function(u){return n(a,u)||(a[u]=i&&n(s,u)?s[u]:l("Symbol."+u)),a[u]},Cw}var yw,P_;function X$(){if(P_)return yw;P_=1;var t=an(),e=Xr(),n=KS(),r=cd(),i=K$(),o=Mi(),s=TypeError,a=o("toPrimitive");return yw=function(l,u){if(!e(l)||n(l))return l;var c=r(l,a),h;if(c){if(u===void 0&&(u="default"),h=t(c,l,u),!e(h)||n(h))return h;throw new s("Can't convert object to primitive value")}return u===void 0&&(u="number"),i(l,u)},yw}var bw,O_;function o1(){if(O_)return bw;O_=1;var t=X$(),e=KS();return bw=function(n){var r=t(n,"string");return e(r)?r:r+""},bw}var Sw,x_;function QS(){if(x_)return Sw;x_=1;var t=Kt(),e=Xr(),n=t.document,r=e(n)&&e(n.createElement);return Sw=function(i){return r?n.createElement(i):{}},Sw}var Rw,A_;function s1(){if(A_)return Rw;A_=1;var t=Kr(),e=sn(),n=QS();return Rw=!t&&!e(function(){return Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a!==7}),Rw}var H_;function a1(){if(H_)return Vp;H_=1;var t=Kr(),e=an(),n=Y$(),r=Vm(),i=ld(),o=o1(),s=Zr(),a=s1(),l=Object.getOwnPropertyDescriptor;return Vp.f=t?l:function(c,h){if(c=i(c),h=o(h),a)try{return l(c,h)}catch{}if(s(c,h))return r(!e(n.f,c,h),c[h])},Vp}var Ew={},Tw,N_;function l1(){if(N_)return Tw;N_=1;var t=Kr(),e=sn();return Tw=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Tw}var _w,D_;function un(){if(D_)return _w;D_=1;var t=Xr(),e=String,n=TypeError;return _w=function(r){if(t(r))return r;throw new n(e(r)+" is not an object")},_w}var k_;function Ks(){if(k_)return Ew;k_=1;var t=Kr(),e=s1(),n=l1(),r=un(),i=o1(),o=TypeError,s=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l="enumerable",u="configurable",c="writable";return Ew.f=t?n?function(d,f,m){if(r(d),f=i(f),r(m),typeof d=="function"&&f==="prototype"&&"value"in m&&c in m&&!m[c]){var C=a(d,f);C&&C[c]&&(d[f]=m.value,m={configurable:u in m?m[u]:C[u],enumerable:l in m?m[l]:C[l],writable:!1})}return s(d,f,m)}:s:function(d,f,m){if(r(d),f=i(f),r(m),e)try{return s(d,f,m)}catch{}if("get"in m||"set"in m)throw new o("Accessors not supported");return"value"in m&&(d[f]=m.value),d},Ew}var Mw,L_;function ju(){if(L_)return Mw;L_=1;var t=Kr(),e=Ks(),n=Vm();return Mw=t?function(r,i,o){return e.f(r,i,n(1,o))}:function(r,i,o){return r[i]=o,r},Mw}var Iw={exports:{}},Pw,$_;function Z$(){if($_)return Pw;$_=1;var t=Kr(),e=Zr(),n=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,i=e(n,"name"),o=i&&(function(){}).name==="something",s=i&&(!t||t&&r(n,"name").configurable);return Pw={EXISTS:i,PROPER:o,CONFIGURABLE:s},Pw}var Ow,F_;function Q$(){if(F_)return Ow;F_=1;var t=Xt(),e=ln(),n=ZS(),r=t(Function.toString);return e(n.inspectSource)||(n.inspectSource=function(i){return r(i)}),Ow=n.inspectSource,Ow}var xw,V_;function J$(){if(V_)return xw;V_=1;var t=Kt(),e=ln(),n=t.WeakMap;return xw=e(n)&&/native code/.test(String(n)),xw}var Aw,W_;function JS(){if(W_)return Aw;W_=1;var t=r1(),e=i1(),n=t("keys");return Aw=function(r){return n[r]||(n[r]=e(r))},Aw}var Hw,B_;function eR(){return B_||(B_=1,Hw={}),Hw}var Nw,j_;function u1(){if(j_)return Nw;j_=1;var t=J$(),e=Kt(),n=Xr(),r=ju(),i=Zr(),o=ZS(),s=JS(),a=eR(),l="Object already initialized",u=e.TypeError,c=e.WeakMap,h,d,f,m=function(v){return f(v)?d(v):h(v,{})},C=function(v){return function(_){var A;if(!n(_)||(A=d(_)).type!==v)throw new u("Incompatible receiver, "+v+" required");return A}};if(t||o.state){var y=o.state||(o.state=new c);y.get=y.get,y.has=y.has,y.set=y.set,h=function(v,_){if(y.has(v))throw new u(l);return _.facade=v,y.set(v,_),_},d=function(v){return y.get(v)||{}},f=function(v){return y.has(v)}}else{var E=s("state");a[E]=!0,h=function(v,_){if(i(v,E))throw new u(l);return _.facade=v,r(v,E,_),_},d=function(v){return i(v,E)?v[E]:{}},f=function(v){return i(v,E)}}return Nw={set:h,get:d,has:f,enforce:m,getterFor:C},Nw}var U_;function c1(){if(U_)return Iw.exports;U_=1;var t=Xt(),e=sn(),n=ln(),r=Zr(),i=Kr(),o=Z$().CONFIGURABLE,s=Q$(),a=u1(),l=a.enforce,u=a.get,c=String,h=Object.defineProperty,d=t("".slice),f=t("".replace),m=t([].join),C=i&&!e(function(){return h(function(){},"length",{value:8}).length!==8}),y=String(String).split("String"),E=Iw.exports=function(v,_,A){d(c(_),0,7)==="Symbol("&&(_="["+f(c(_),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),A&&A.getter&&(_="get "+_),A&&A.setter&&(_="set "+_),(!r(v,"name")||o&&v.name!==_)&&(i?h(v,"name",{value:_,configurable:!0}):v.name=_),C&&A&&r(A,"arity")&&v.length!==A.arity&&h(v,"length",{value:A.arity});try{A&&r(A,"constructor")&&A.constructor?i&&h(v,"prototype",{writable:!1}):v.prototype&&(v.prototype=void 0)}catch{}var L=l(v);return r(L,"source")||(L.source=m(y,typeof _=="string"?_:"")),v};return Function.prototype.toString=E(function(){return n(this)&&u(this).source||s(this)},"toString"),Iw.exports}var Dw,z_;function tR(){if(z_)return Dw;z_=1;var t=ln(),e=Ks(),n=c1(),r=XS();return Dw=function(i,o,s,a){a||(a={});var l=a.enumerable,u=a.name!==void 0?a.name:o;if(t(s)&&n(s,u,a),a.global)l?i[o]=s:r(o,s);else{try{a.unsafe?i[o]&&(l=!0):delete i[o]}catch{}l?i[o]=s:e.f(i,o,{value:s,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return i},Dw}var kw={},Lw,Y_;function eF(){if(Y_)return Lw;Y_=1;var t=Math.ceil,e=Math.floor;return Lw=Math.trunc||function(r){var i=+r;return(i>0?e:t)(i)},Lw}var $w,G_;function hd(){if(G_)return $w;G_=1;var t=eF();return $w=function(e){var n=+e;return n!==n||n===0?0:t(n)},$w}var Fw,q_;function tF(){if(q_)return Fw;q_=1;var t=hd(),e=Math.max,n=Math.min;return Fw=function(r,i){var o=t(r);return o<0?e(o+i,0):n(o,i)},Fw}var Vw,K_;function nF(){if(K_)return Vw;K_=1;var t=hd(),e=Math.min;return Vw=function(n){var r=t(n);return r>0?e(r,9007199254740991):0},Vw}var Ww,X_;function Uu(){if(X_)return Ww;X_=1;var t=nF();return Ww=function(e){return t(e.length)},Ww}var Bw,Z_;function rF(){if(Z_)return Bw;Z_=1;var t=ld(),e=tF(),n=Uu(),r=function(i){return function(o,s,a){var l=t(o),u=n(l);if(u===0)return!i&&-1;var c=e(a,u),h;if(i&&s!==s){for(;u>c;)if(h=l[c++],h!==h)return!0}else for(;u>c;c++)if((i||c in l)&&l[c]===s)return i||c||0;return!i&&-1}};return Bw={includes:r(!0),indexOf:r(!1)},Bw}var jw,Q_;function h1(){if(Q_)return jw;Q_=1;var t=Xt(),e=Zr(),n=ld(),r=rF().indexOf,i=eR(),o=t([].push);return jw=function(s,a){var l=n(s),u=0,c=[],h;for(h in l)!e(i,h)&&e(l,h)&&o(c,h);for(;a.length>u;)e(l,h=a[u++])&&(~r(c,h)||o(c,h));return c},jw}var Uw,J_;function nR(){return J_||(J_=1,Uw=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Uw}var eM;function iF(){if(eM)return kw;eM=1;var t=h1(),e=nR(),n=e.concat("length","prototype");return kw.f=Object.getOwnPropertyNames||function(i){return t(i,n)},kw}var zw={},tM;function oF(){return tM||(tM=1,zw.f=Object.getOwnPropertySymbols),zw}var Yw,nM;function sF(){if(nM)return Yw;nM=1;var t=Wu(),e=Xt(),n=iF(),r=oF(),i=un(),o=e([].concat);return Yw=t("Reflect","ownKeys")||function(a){var l=n.f(i(a)),u=r.f;return u?o(l,u(a)):l},Yw}var Gw,rM;function d1(){if(rM)return Gw;rM=1;var t=Zr(),e=sF(),n=a1(),r=Ks();return Gw=function(i,o,s){for(var a=e(o),l=r.f,u=n.f,c=0;c<a.length;c++){var h=a[c];!t(i,h)&&!(s&&t(s,h))&&l(i,h,u(o,h))}},Gw}var qw,iM;function aF(){if(iM)return qw;iM=1;var t=sn(),e=ln(),n=/#|\.prototype\./,r=function(l,u){var c=o[i(l)];return c===a?!0:c===s?!1:e(u)?t(u):!!u},i=r.normalize=function(l){return String(l).replace(n,".").toLowerCase()},o=r.data={},s=r.NATIVE="N",a=r.POLYFILL="P";return qw=r,qw}var Kw,oM;function dt(){if(oM)return Kw;oM=1;var t=Kt(),e=a1().f,n=ju(),r=tR(),i=XS(),o=d1(),s=aF();return Kw=function(a,l){var u=a.target,c=a.global,h=a.stat,d,f,m,C,y,E;if(c?f=t:h?f=t[u]||i(u,{}):f=t[u]&&t[u].prototype,f)for(m in l){if(y=l[m],a.dontCallGetSet?(E=e(f,m),C=E&&E.value):C=f[m],d=s(c?m:u+(h?".":"#")+m,a.forced),!d&&C!==void 0){if(typeof y==typeof C)continue;o(y,C)}(a.sham||C&&C.sham)&&n(y,"sham",!0),r(f,m,y,a)}},Kw}var Xw,sM;function dd(){if(sM)return Xw;sM=1;var t=Fm(),e=Function.prototype,n=e.apply,r=e.call;return Xw=typeof Reflect=="object"&&Reflect.apply||(t?r.bind(n):function(){return r.apply(n,arguments)}),Xw}var Zw,aM;function f1(){if(aM)return Zw;aM=1;var t=Xt(),e=dr();return Zw=function(n,r,i){try{return t(e(Object.getOwnPropertyDescriptor(n,r)[i]))}catch{}},Zw}var Qw,lM;function lF(){if(lM)return Qw;lM=1;var t=Xr();return Qw=function(e){return t(e)||e===null},Qw}var Jw,uM;function uF(){if(uM)return Jw;uM=1;var t=lF(),e=String,n=TypeError;return Jw=function(r){if(t(r))return r;throw new n("Can't set "+e(r)+" as a prototype")},Jw}var ev,cM;function g1(){if(cM)return ev;cM=1;var t=f1(),e=Xr(),n=ad(),r=uF();return ev=Object.setPrototypeOf||("__proto__"in{}?(function(){var i=!1,o={},s;try{s=t(Object.prototype,"__proto__","set"),s(o,[]),i=o instanceof Array}catch{}return function(l,u){return n(l),r(u),e(l)&&(i?s(l,u):l.__proto__=u),l}})():void 0),ev}var tv,hM;function cF(){if(hM)return tv;hM=1;var t=Ks().f;return tv=function(e,n,r){r in e||t(e,r,{configurable:!0,get:function(){return n[r]},set:function(i){n[r]=i}})},tv}var nv,dM;function hF(){if(dM)return nv;dM=1;var t=ln(),e=Xr(),n=g1();return nv=function(r,i,o){var s,a;return n&&t(s=i.constructor)&&s!==o&&e(a=s.prototype)&&a!==o.prototype&&n(r,a),r},nv}var rv,fM;function dF(){if(fM)return rv;fM=1;var t=Mi(),e=t("toStringTag"),n={};return n[e]="z",rv=String(n)==="[object z]",rv}var iv,gM;function m1(){if(gM)return iv;gM=1;var t=dF(),e=ln(),n=fl(),r=Mi(),i=r("toStringTag"),o=Object,s=n((function(){return arguments})())==="Arguments",a=function(l,u){try{return l[u]}catch{}};return iv=t?n:function(l){var u,c,h;return l===void 0?"Undefined":l===null?"Null":typeof(c=a(u=o(l),i))=="string"?c:s?n(u):(h=n(u))==="Object"&&e(u.callee)?"Arguments":h},iv}var ov,mM;function jm(){if(mM)return ov;mM=1;var t=m1(),e=String;return ov=function(n){if(t(n)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(n)},ov}var sv,pM;function fF(){if(pM)return sv;pM=1;var t=jm();return sv=function(e,n){return e===void 0?arguments.length<2?"":n:t(e)},sv}var av,wM;function gF(){if(wM)return av;wM=1;var t=Xr(),e=ju();return av=function(n,r){t(r)&&"cause"in r&&e(n,"cause",r.cause)},av}var lv,vM;function mF(){if(vM)return lv;vM=1;var t=Xt(),e=Error,n=t("".replace),r=(function(s){return String(new e(s).stack)})("zxcasd"),i=/\n\s*at [^:]*:[^\n]*/,o=i.test(r);return lv=function(s,a){if(o&&typeof s=="string"&&!e.prepareStackTrace)for(;a--;)s=n(s,i,"");return s},lv}var uv,CM;function pF(){if(CM)return uv;CM=1;var t=sn(),e=Vm();return uv=!t(function(){var n=new Error("a");return"stack"in n?(Object.defineProperty(n,"stack",e(1,7)),n.stack!==7):!0}),uv}var cv,yM;function wF(){if(yM)return cv;yM=1;var t=ju(),e=mF(),n=pF(),r=Error.captureStackTrace;return cv=function(i,o,s,a){n&&(r?r(i,o):t(i,"stack",e(s,a)))},cv}var hv,bM;function vF(){if(bM)return hv;bM=1;var t=Wu(),e=Zr(),n=ju(),r=ud(),i=g1(),o=d1(),s=cF(),a=hF(),l=fF(),u=gF(),c=wF(),h=Kr(),d=qs();return hv=function(f,m,C,y){var E="stackTraceLimit",v=y?2:1,_=f.split("."),A=_[_.length-1],L=t.apply(null,_);if(L){var T=L.prototype;if(!d&&e(T,"cause")&&delete T.cause,!C)return L;var P=t("Error"),Y=m(function(U,W){var Z=l(y?W:U,void 0),J=y?new L(U):new L;return Z!==void 0&&n(J,"message",Z),c(J,Y,J.stack,2),this&&r(T,this)&&a(J,this,Y),arguments.length>v&&u(J,arguments[v]),J});if(Y.prototype=T,A!=="Error"?i?i(Y,P):o(Y,P,{name:!0}):h&&E in L&&(s(Y,L,E),s(Y,L,"prepareStackTrace")),o(Y,L),!d)try{T.name!==A&&n(T,"name",A),T.constructor=Y}catch{}return Y}},hv}var SM;function CF(){if(SM)return qT;SM=1;var t=dt(),e=Kt(),n=dd(),r=vF(),i="WebAssembly",o=e[i],s=new Error("e",{cause:7}).cause!==7,a=function(u,c){var h={};h[u]=r(u,c,s),t({global:!0,constructor:!0,arity:1,forced:s},h)},l=function(u,c){if(o&&o[u]){var h={};h[u]=r(i+"."+u,c,s),t({target:i,stat:!0,constructor:!0,arity:1,forced:s},h)}};return a("Error",function(u){return function(h){return n(u,this,arguments)}}),a("EvalError",function(u){return function(h){return n(u,this,arguments)}}),a("RangeError",function(u){return function(h){return n(u,this,arguments)}}),a("ReferenceError",function(u){return function(h){return n(u,this,arguments)}}),a("SyntaxError",function(u){return function(h){return n(u,this,arguments)}}),a("TypeError",function(u){return function(h){return n(u,this,arguments)}}),a("URIError",function(u){return function(h){return n(u,this,arguments)}}),l("CompileError",function(u){return function(h){return n(u,this,arguments)}}),l("LinkError",function(u){return function(h){return n(u,this,arguments)}}),l("RuntimeError",function(u){return function(h){return n(u,this,arguments)}}),qT}CF();var RM={},dv,EM;function p1(){if(EM)return dv;EM=1;var t=fl();return dv=Array.isArray||function(n){return t(n)==="Array"},dv}var fv,TM;function w1(){if(TM)return fv;TM=1;var t=Kr(),e=p1(),n=TypeError,r=Object.getOwnPropertyDescriptor,i=t&&!(function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(o){return o instanceof TypeError}})();return fv=i?function(o,s){if(e(o)&&!r(o,"length").writable)throw new n("Cannot set read only .length");return o.length=s}:function(o,s){return o.length=s},fv}var gv,_M;function v1(){if(_M)return gv;_M=1;var t=TypeError,e=9007199254740991;return gv=function(n){if(n>e)throw t("Maximum allowed index exceeded");return n},gv}var MM;function yF(){if(MM)return RM;MM=1;var t=dt(),e=Bu(),n=Uu(),r=w1(),i=v1(),o=sn(),s=o(function(){return[].push.call({length:4294967296},1)!==4294967297}),a=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{push:function(c){var h=e(this),d=n(h),f=arguments.length;i(d+f);for(var m=0;m<f;m++)h[d]=arguments[m],d++;return r(h,d),d}}),RM}yF();var IM={},mv,PM;function bF(){if(PM)return mv;PM=1;var t=fl(),e=Xt();return mv=function(n){if(t(n)==="Function")return e(n)},mv}var pv,OM;function C1(){if(OM)return pv;OM=1;var t=bF(),e=dr(),n=Fm(),r=t(t.bind);return pv=function(i,o){return e(i),o===void 0?i:n?r(i,o):function(){return i.apply(o,arguments)}},pv}var wv,xM;function y1(){return xM||(xM=1,wv={}),wv}var vv,AM;function SF(){if(AM)return vv;AM=1;var t=Mi(),e=y1(),n=t("iterator"),r=Array.prototype;return vv=function(i){return i!==void 0&&(e.Array===i||r[n]===i)},vv}var Cv,HM;function rR(){if(HM)return Cv;HM=1;var t=m1(),e=cd(),n=GS(),r=y1(),i=Mi(),o=i("iterator");return Cv=function(s){if(!n(s))return e(s,o)||e(s,"@@iterator")||r[t(s)]},Cv}var yv,NM;function RF(){if(NM)return yv;NM=1;var t=an(),e=dr(),n=un(),r=Bm(),i=rR(),o=TypeError;return yv=function(s,a){var l=arguments.length<2?i(s):a;if(e(l))return n(t(l,s));throw new o(r(s)+" is not iterable")},yv}var bv,DM;function fr(){if(DM)return bv;DM=1;var t=an(),e=un(),n=cd();return bv=function(r,i,o){var s,a;e(r);try{if(s=n(r,"return"),!s){if(i==="throw")throw o;return o}s=t(s,r)}catch(l){a=!0,s=l}if(i==="throw")throw o;if(a)throw s;return e(s),o},bv}var Sv,kM;function zu(){if(kM)return Sv;kM=1;var t=C1(),e=an(),n=un(),r=Bm(),i=SF(),o=Uu(),s=ud(),a=RF(),l=rR(),u=fr(),c=TypeError,h=function(f,m){this.stopped=f,this.result=m},d=h.prototype;return Sv=function(f,m,C){var y=C&&C.that,E=!!(C&&C.AS_ENTRIES),v=!!(C&&C.IS_RECORD),_=!!(C&&C.IS_ITERATOR),A=!!(C&&C.INTERRUPTED),L=t(m,y),T,P,Y,U,W,Z,J,se=function(ue){return T&&u(T,"normal"),new h(!0,ue)},te=function(ue){return E?(n(ue),A?L(ue[0],ue[1],se):L(ue[0],ue[1])):A?L(ue,se):L(ue)};if(v)T=f.iterator;else if(_)T=f;else{if(P=l(f),!P)throw new c(r(f)+" is not iterable");if(i(P)){for(Y=0,U=o(f);U>Y;Y++)if(W=te(f[Y]),W&&s(d,W))return W;return new h(!1)}T=a(f,P)}for(Z=v?f.next:T.next;!(J=e(Z,T)).done;){try{W=te(J.value)}catch(ue){u(T,"throw",ue)}if(typeof W=="object"&&W&&s(d,W))return W}return new h(!1)},Sv}var Rv,LM;function b1(){if(LM)return Rv;LM=1;var t=Kr(),e=Ks(),n=Vm();return Rv=function(r,i,o){t?e.f(r,i,n(0,o)):r[i]=o},Rv}var $M;function EF(){if($M)return IM;$M=1;var t=dt(),e=zu(),n=b1();return t({target:"Object",stat:!0},{fromEntries:function(i){var o={};return e(i,function(s,a){n(o,s,a)},{AS_ENTRIES:!0}),o}}),IM}EF();var FM={},Ev,VM;function uo(){if(VM)return Ev;VM=1;var t=Xt(),e=Set.prototype;return Ev={Set,add:t(e.add),has:t(e.has),remove:t(e.delete),proto:e},Ev}var Tv,WM;function gl(){if(WM)return Tv;WM=1;var t=uo().has;return Tv=function(e){return t(e),e},Tv}var _v,BM;function ml(){if(BM)return _v;BM=1;var t=an();return _v=function(e,n,r){for(var i=r?e:e.iterator,o=e.next,s,a;!(s=t(o,i)).done;)if(a=n(s.value),a!==void 0)return a},_v}var Mv,jM;function fd(){if(jM)return Mv;jM=1;var t=Xt(),e=ml(),n=uo(),r=n.Set,i=n.proto,o=t(i.forEach),s=t(i.keys),a=s(new r).next;return Mv=function(l,u,c){return c?e({iterator:s(l),next:a},u):o(l,u)},Mv}var Iv,UM;function iR(){if(UM)return Iv;UM=1;var t=uo(),e=fd(),n=t.Set,r=t.add;return Iv=function(i){var o=new n;return e(i,function(s){r(o,s)}),o},Iv}var Pv,zM;function gd(){if(zM)return Pv;zM=1;var t=f1(),e=uo();return Pv=t(e.proto,"size","get")||function(n){return n.size},Pv}var Ov,YM;function co(){return YM||(YM=1,Ov=function(t){return{iterator:t,next:t.next,done:!1}}),Ov}var xv,GM;function pl(){if(GM)return xv;GM=1;var t=dr(),e=un(),n=an(),r=hd(),i=co(),o="Invalid size",s=RangeError,a=TypeError,l=Math.max,u=function(c,h){this.set=c,this.size=l(h,0),this.has=t(c.has),this.keys=t(c.keys)};return u.prototype={getIterator:function(){return i(e(n(this.keys,this.set)))},includes:function(c){return n(this.has,this.set,c)}},xv=function(c){e(c);var h=+c.size;if(h!==h)throw new a(o);var d=r(h);if(d<0)throw new s(o);return new u(c,d)},xv}var Av,qM;function TF(){if(qM)return Av;qM=1;var t=gl(),e=uo(),n=iR(),r=gd(),i=pl(),o=fd(),s=ml(),a=e.has,l=e.remove;return Av=function(c){var h=t(this),d=i(c),f=n(h);return r(h)<=d.size?o(h,function(m){d.includes(m)&&l(f,m)}):s(d.getIterator(),function(m){a(f,m)&&l(f,m)}),f},Av}var Hv,KM;function wl(){if(KM)return Hv;KM=1;var t=Wu(),e=function(r){return{size:r,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},n=function(r){return{size:r,has:function(){return!0},keys:function(){throw new Error("e")}}};return Hv=function(r,i){var o=t("Set");try{new o()[r](e(0));try{return new o()[r](e(-1)),!1}catch{if(!i)return!0;try{return new o()[r](n(-1/0)),!1}catch{var s=new o;return s.add(1),s.add(2),i(s[r](n(1/0)))}}}catch{return!1}},Hv}var XM;function _F(){if(XM)return FM;XM=1;var t=dt(),e=TF(),n=sn(),r=wl(),i=!r("difference",function(s){return s.size===0}),o=i||n(function(){var s={size:1,has:function(){return!0},keys:function(){var l=0;return{next:function(){var u=l++>1;return a.has(1)&&a.clear(),{done:u,value:2}}}}},a=new Set([1,2,3,4]);return a.difference(s).size!==3});return t({target:"Set",proto:!0,real:!0,forced:o},{difference:e}),FM}_F();var ZM={},Nv,QM;function MF(){if(QM)return Nv;QM=1;var t=gl(),e=uo(),n=gd(),r=pl(),i=fd(),o=ml(),s=e.Set,a=e.add,l=e.has;return Nv=function(c){var h=t(this),d=r(c),f=new s;return n(h)>d.size?o(d.getIterator(),function(m){l(h,m)&&a(f,m)}):i(h,function(m){d.includes(m)&&a(f,m)}),f},Nv}var JM;function IF(){if(JM)return ZM;JM=1;var t=dt(),e=sn(),n=MF(),r=wl(),i=!r("intersection",function(o){return o.size===2&&o.has(1)&&o.has(2)})||e(function(){return String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))!=="3,2"});return t({target:"Set",proto:!0,real:!0,forced:i},{intersection:n}),ZM}IF();var eI={},Dv,tI;function PF(){if(tI)return Dv;tI=1;var t=gl(),e=uo().has,n=gd(),r=pl(),i=fd(),o=ml(),s=fr();return Dv=function(l){var u=t(this),c=r(l);if(n(u)<=c.size)return i(u,function(d){if(c.includes(d))return!1},!0)!==!1;var h=c.getIterator();return o(h,function(d){if(e(u,d))return s(h,"normal",!1)})!==!1},Dv}var nI;function OF(){if(nI)return eI;nI=1;var t=dt(),e=PF(),n=wl(),r=!n("isDisjointFrom",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isDisjointFrom:e}),eI}OF();var rI={},kv,iI;function xF(){if(iI)return kv;iI=1;var t=gl(),e=gd(),n=fd(),r=pl();return kv=function(o){var s=t(this),a=r(o);return e(s)>a.size?!1:n(s,function(l){if(!a.includes(l))return!1},!0)!==!1},kv}var oI;function AF(){if(oI)return rI;oI=1;var t=dt(),e=xF(),n=wl(),r=!n("isSubsetOf",function(i){return i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSubsetOf:e}),rI}AF();var sI={},Lv,aI;function HF(){if(aI)return Lv;aI=1;var t=gl(),e=uo().has,n=gd(),r=pl(),i=ml(),o=fr();return Lv=function(a){var l=t(this),u=r(a);if(n(l)<u.size)return!1;var c=u.getIterator();return i(c,function(h){if(!e(l,h))return o(c,"normal",!1)})!==!1},Lv}var lI;function NF(){if(lI)return sI;lI=1;var t=dt(),e=HF(),n=wl(),r=!n("isSupersetOf",function(i){return!i});return t({target:"Set",proto:!0,real:!0,forced:r},{isSupersetOf:e}),sI}NF();var uI={},$v,cI;function DF(){if(cI)return $v;cI=1;var t=gl(),e=uo(),n=iR(),r=pl(),i=ml(),o=e.add,s=e.has,a=e.remove;return $v=function(u){var c=t(this),h=r(u).getIterator(),d=n(c);return i(h,function(f){s(c,f)?a(d,f):o(d,f)}),d},$v}var Fv,hI;function S1(){return hI||(hI=1,Fv=function(t){try{var e=new Set,n={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return e.clear(),e.add(4),function(){return{done:!0}}}})}},r=e[t](n);return r.size===1&&r.values().next().value===4}catch{return!1}}),Fv}var dI;function kF(){if(dI)return uI;dI=1;var t=dt(),e=DF(),n=S1(),r=wl(),i=!r("symmetricDifference")||!n("symmetricDifference");return t({target:"Set",proto:!0,real:!0,forced:i},{symmetricDifference:e}),uI}kF();var fI={},Vv,gI;function LF(){if(gI)return Vv;gI=1;var t=gl(),e=uo().add,n=iR(),r=pl(),i=ml();return Vv=function(s){var a=t(this),l=r(s).getIterator(),u=n(a);return i(l,function(c){e(u,c)}),u},Vv}var mI;function $F(){if(mI)return fI;mI=1;var t=dt(),e=LF(),n=S1(),r=wl(),i=!r("union")||!n("union");return t({target:"Set",proto:!0,real:!0,forced:i},{union:e}),fI}$F();var pI={},wI={},Wv,vI;function FF(){if(vI)return Wv;vI=1;var t=ud(),e=TypeError;return Wv=function(n,r){if(t(r,n))return n;throw new e("Incorrect invocation")},Wv}var Bv,CI;function VF(){if(CI)return Bv;CI=1;var t=sn();return Bv=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Bv}var jv,yI;function R1(){if(yI)return jv;yI=1;var t=Zr(),e=ln(),n=Bu(),r=JS(),i=VF(),o=r("IE_PROTO"),s=Object,a=s.prototype;return jv=i?s.getPrototypeOf:function(l){var u=n(l);if(t(u,o))return u[o];var c=u.constructor;return e(c)&&u instanceof c?c.prototype:u instanceof s?a:null},jv}var Uv,bI;function WF(){if(bI)return Uv;bI=1;var t=c1(),e=Ks();return Uv=function(n,r,i){return i.get&&t(i.get,r,{getter:!0}),i.set&&t(i.set,r,{setter:!0}),e.f(n,r,i)},Uv}var zv={},Yv,SI;function BF(){if(SI)return Yv;SI=1;var t=h1(),e=nR();return Yv=Object.keys||function(r){return t(r,e)},Yv}var RI;function jF(){if(RI)return zv;RI=1;var t=Kr(),e=l1(),n=Ks(),r=un(),i=ld(),o=BF();return zv.f=t&&!e?Object.defineProperties:function(a,l){r(a);for(var u=i(l),c=o(l),h=c.length,d=0,f;h>d;)n.f(a,f=c[d++],u[f]);return a},zv}var Gv,EI;function E1(){if(EI)return Gv;EI=1;var t=Wu();return Gv=t("document","documentElement"),Gv}var qv,TI;function oR(){if(TI)return qv;TI=1;var t=un(),e=jF(),n=nR(),r=eR(),i=E1(),o=QS(),s=JS(),a=">",l="<",u="prototype",c="script",h=s("IE_PROTO"),d=function(){},f=function(v){return l+c+a+v+l+"/"+c+a},m=function(v){v.write(f("")),v.close();var _=v.parentWindow.Object;return v=null,_},C=function(){var v=o("iframe"),_="java"+c+":",A;return v.style.display="none",i.appendChild(v),v.src=String(_),A=v.contentWindow.document,A.open(),A.write(f("document.F=Object")),A.close(),A.F},y,E=function(){try{y=new ActiveXObject("htmlfile")}catch{}E=typeof document<"u"?document.domain&&y?m(y):C():m(y);for(var v=n.length;v--;)delete E[u][n[v]];return E()};return r[h]=!0,qv=Object.create||function(_,A){var L;return _!==null?(d[u]=t(_),L=new d,d[u]=null,L[h]=_):L=E(),A===void 0?L:e.f(L,A)},qv}var Kv,_I;function T1(){if(_I)return Kv;_I=1;var t=sn(),e=ln(),n=Xr(),r=oR(),i=R1(),o=tR(),s=Mi(),a=qs(),l=s("iterator"),u=!1,c,h,d;[].keys&&(d=[].keys(),"next"in d?(h=i(i(d)),h!==Object.prototype&&(c=h)):u=!0);var f=!n(c)||t(function(){var m={};return c[l].call(m)!==m});return f?c={}:a&&(c=r(c)),e(c[l])||o(c,l,function(){return this}),Kv={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:u},Kv}var MI;function UF(){if(MI)return wI;MI=1;var t=dt(),e=Kt(),n=FF(),r=un(),i=ln(),o=R1(),s=WF(),a=b1(),l=sn(),u=Zr(),c=Mi(),h=T1().IteratorPrototype,d=Kr(),f=qs(),m="constructor",C="Iterator",y=c("toStringTag"),E=TypeError,v=e[C],_=f||!i(v)||v.prototype!==h||!l(function(){v({})}),A=function(){if(n(this,h),o(this)===h)throw new E("Abstract class Iterator not directly constructable")},L=function(T,P){d?s(h,T,{configurable:!0,get:function(){return P},set:function(Y){if(r(this),this===h)throw new E("You can't redefine this property");u(this,T)?this[T]=Y:a(this,T,Y)}}):h[T]=P};return u(h,y)||L(y,C),(_||!u(h,m)||h[m]===Object)&&L(m,A),A.prototype=h,t({global:!0,constructor:!0,forced:_},{Iterator:A}),wI}var II;function zF(){return II||(II=1,UF()),pI}zF();var PI={},OI={},Xv,xI;function YF(){if(xI)return Xv;xI=1;var t=tR();return Xv=function(e,n,r){for(var i in n)t(e,i,n[i],r);return e},Xv}var Zv,AI;function GF(){return AI||(AI=1,Zv=function(t,e){return{value:t,done:e}}),Zv}var Qv,HI;function qF(){if(HI)return Qv;HI=1;var t=fr();return Qv=function(e,n,r){for(var i=e.length-1;i>=0;i--)if(e[i]!==void 0)try{r=t(e[i].iterator,n,r)}catch(o){n="throw",r=o}if(n==="throw")throw r;return r},Qv}var Jv,NI;function sR(){if(NI)return Jv;NI=1;var t=an(),e=oR(),n=ju(),r=YF(),i=Mi(),o=u1(),s=cd(),a=T1().IteratorPrototype,l=GF(),u=fr(),c=qF(),h=i("toStringTag"),d="IteratorHelper",f="WrapForValidIterator",m="normal",C="throw",y=o.set,E=function(A){var L=o.getterFor(A?f:d);return r(e(a),{next:function(){var P=L(this);if(A)return P.nextHandler();if(P.done)return l(void 0,!0);try{var Y=P.nextHandler();return P.returnHandlerResult?Y:l(Y,P.done)}catch(U){throw P.done=!0,U}},return:function(){var T=L(this),P=T.iterator;if(T.done=!0,A){var Y=s(P,"return");return Y?t(Y,P):l(void 0,!0)}if(T.inner)try{u(T.inner.iterator,m)}catch(U){return u(P,C,U)}if(T.openIters)try{c(T.openIters,m)}catch(U){return u(P,C,U)}return P&&u(P,m),l(void 0,!0)}})},v=E(!0),_=E(!1);return n(_,h,"Iterator Helper"),Jv=function(A,L,T){var P=function(U,W){W?(W.iterator=U.iterator,W.next=U.next):W=U,W.type=L?f:d,W.returnHandlerResult=!!T,W.nextHandler=A,W.counter=0,W.done=!1,y(this,W)};return P.prototype=L?v:_,P},Jv}var eC,DI;function _1(){if(DI)return eC;DI=1;var t=un(),e=fr();return eC=function(n,r,i,o){try{return o?r(t(i)[0],i[1]):r(i)}catch(s){e(n,"throw",s)}},eC}var tC,kI;function aR(){return kI||(kI=1,tC=function(t,e){var n=typeof Iterator=="function"&&Iterator.prototype[t];if(n)try{n.call({next:null},e).next()}catch{return!0}}),tC}var nC,LI;function Xs(){if(LI)return nC;LI=1;var t=Kt();return nC=function(e,n){var r=t.Iterator,i=r&&r.prototype,o=i&&i[e],s=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){s=!0}},-1)}catch(a){a instanceof n||(s=!1)}if(!s)return o},nC}var $I;function KF(){if($I)return OI;$I=1;var t=dt(),e=an(),n=dr(),r=un(),i=co(),o=sR(),s=_1(),a=qs(),l=fr(),u=aR(),c=Xs(),h=!a&&!u("filter",function(){}),d=!a&&!h&&c("filter",TypeError),f=a||h||d,m=o(function(){for(var C=this.iterator,y=this.predicate,E=this.next,v,_,A;;){if(v=r(e(E,C)),_=this.done=!!v.done,_)return;if(A=v.value,s(C,y,[A,this.counter++],!0))return A}});return t({target:"Iterator",proto:!0,real:!0,forced:f},{filter:function(y){r(this);try{n(y)}catch(E){l(this,"throw",E)}return d?e(d,this,y):new m(i(this),{predicate:y})}}),OI}var FI;function XF(){return FI||(FI=1,KF()),PI}XF();var VI={},WI={},BI;function ZF(){if(BI)return WI;BI=1;var t=dt(),e=an(),n=zu(),r=dr(),i=un(),o=co(),s=fr(),a=Xs(),l=a("forEach",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{forEach:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;n(h,function(f){c(f,d++)},{IS_RECORD:!0})}}),WI}var jI;function QF(){return jI||(jI=1,ZF()),VI}QF();var UI={},zI={},YI;function JF(){if(YI)return zI;YI=1;var t=dt(),e=an(),n=dr(),r=un(),i=co(),o=sR(),s=_1(),a=fr(),l=aR(),u=Xs(),c=qs(),h=!c&&!l("map",function(){}),d=!c&&!h&&u("map",TypeError),f=c||h||d,m=o(function(){var C=this.iterator,y=r(e(this.next,C)),E=this.done=!!y.done;if(!E)return s(C,this.mapper,[y.value,this.counter++],!0)});return t({target:"Iterator",proto:!0,real:!0,forced:f},{map:function(y){r(this);try{n(y)}catch(E){a(this,"throw",E)}return d?e(d,this,y):new m(i(this),{mapper:y})}}),zI}var GI;function eV(){return GI||(GI=1,JF()),UI}eV();var qI={},KI={},rC,XI;function lR(){if(XI)return rC;XI=1;var t=Xt();return rC=t([].slice),rC}var iC,ZI;function M1(){if(ZI)return iC;ZI=1;var t=TypeError;return iC=function(e,n){if(e<n)throw new t("Not enough arguments");return e},iC}var oC,QI;function tV(){if(QI)return oC;QI=1;var t=Wm();return oC=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),oC}var sC,JI;function I1(){if(JI)return sC;JI=1;var t=Kt(),e=Wm(),n=fl(),r=function(i){return e.slice(0,i.length)===i};return sC=(function(){return r("Bun/")?"BUN":r("Cloudflare-Workers")?"CLOUDFLARE":r("Deno/")?"DENO":r("Node.js/")?"NODE":t.Bun&&typeof Bun.version=="string"?"BUN":t.Deno&&typeof Deno.version=="object"?"DENO":n(t.process)==="process"?"NODE":t.window&&t.document?"BROWSER":"REST"})(),sC}var aC,eP;function nV(){if(eP)return aC;eP=1;var t=I1();return aC=t==="NODE",aC}var lC,tP;function P1(){if(tP)return lC;tP=1;var t=Kt(),e=dd(),n=C1(),r=ln(),i=Zr(),o=sn(),s=E1(),a=lR(),l=QS(),u=M1(),c=tV(),h=nV(),d=t.setImmediate,f=t.clearImmediate,m=t.process,C=t.Dispatch,y=t.Function,E=t.MessageChannel,v=t.String,_=0,A={},L="onreadystatechange",T,P,Y,U;o(function(){T=t.location});var W=function(te){if(i(A,te)){var ue=A[te];delete A[te],ue()}},Z=function(te){return function(){W(te)}},J=function(te){W(te.data)},se=function(te){t.postMessage(v(te),T.protocol+"//"+T.host)};return(!d||!f)&&(d=function(ue){u(arguments.length,1);var pt=r(ue)?ue:y(ue),be=a(arguments,1);return A[++_]=function(){e(pt,void 0,be)},P(_),_},f=function(ue){delete A[ue]},h?P=function(te){m.nextTick(Z(te))}:C&&C.now?P=function(te){C.now(Z(te))}:E&&!c?(Y=new E,U=Y.port2,Y.port1.onmessage=J,P=n(U.postMessage,U)):t.addEventListener&&r(t.postMessage)&&!t.importScripts&&T&&T.protocol!=="file:"&&!o(se)?(P=se,t.addEventListener("message",J,!1)):L in l("script")?P=function(te){s.appendChild(l("script"))[L]=function(){s.removeChild(this),W(te)}}:P=function(te){setTimeout(Z(te),0)}),lC={set:d,clear:f},lC}var nP;function rV(){if(nP)return KI;nP=1;var t=dt(),e=Kt(),n=P1().clear;return t({global:!0,bind:!0,enumerable:!0,forced:e.clearImmediate!==n},{clearImmediate:n}),KI}var rP={},uC,iP;function iV(){if(iP)return uC;iP=1;var t=Kt(),e=dd(),n=ln(),r=I1(),i=Wm(),o=lR(),s=M1(),a=t.Function,l=/MSIE .\./.test(i)||r==="BUN"&&(function(){var u=t.Bun.version.split(".");return u.length<3||u[0]==="0"&&(u[1]<3||u[1]==="3"&&u[2]==="0")})();return uC=function(u,c){var h=c?2:1;return l?function(d,f){var m=s(arguments.length,1)>h,C=n(d)?d:a(d),y=m?o(arguments,h):[],E=m?function(){e(C,this,y)}:C;return c?u(E,f):u(E)}:u},uC}var oP;function oV(){if(oP)return rP;oP=1;var t=dt(),e=Kt(),n=P1().set,r=iV(),i=e.setImmediate?r(n,!1):n;return t({global:!0,bind:!0,enumerable:!0,forced:e.setImmediate!==i},{setImmediate:i}),rP}var sP;function sV(){return sP||(sP=1,rV(),oV()),qI}sV();/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:O1,setPrototypeOf:aP,isFrozen:aV,getPrototypeOf:lV,getOwnPropertyDescriptor:uV}=Object;let{freeze:zn,seal:qr,create:x1}=Object,{apply:zb,construct:Yb}=typeof Reflect<"u"&&Reflect;zn||(zn=function(e){return e});qr||(qr=function(e){return e});zb||(zb=function(e,n,r){return e.apply(n,r)});Yb||(Yb=function(e,n){return new e(...n)});const Dd=Yn(Array.prototype.forEach),cV=Yn(Array.prototype.lastIndexOf),lP=Yn(Array.prototype.pop),sc=Yn(Array.prototype.push),hV=Yn(Array.prototype.splice),Cg=Yn(String.prototype.toLowerCase),cC=Yn(String.prototype.toString),uP=Yn(String.prototype.match),ac=Yn(String.prototype.replace),dV=Yn(String.prototype.indexOf),fV=Yn(String.prototype.trim),di=Yn(Object.prototype.hasOwnProperty),Dn=Yn(RegExp.prototype.test),lc=gV(TypeError);function Yn(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return zb(t,e,r)}}function gV(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Yb(t,n)}}function Fe(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Cg;aP&&aP(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){const o=n(i);o!==i&&(aV(e)||(e[r]=o),i=o)}t[i]=!0}return t}function mV(t){for(let e=0;e<t.length;e++)di(t,e)||(t[e]=null);return t}function Ao(t){const e=x1(null);for(const[n,r]of O1(t))di(t,n)&&(Array.isArray(r)?e[n]=mV(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=Ao(r):e[n]=r);return e}function uc(t,e){for(;t!==null;){const r=uV(t,e);if(r){if(r.get)return Yn(r.get);if(typeof r.value=="function")return Yn(r.value)}t=lV(t)}function n(){return null}return n}const cP=zn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),hC=zn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),dC=zn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),pV=zn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fC=zn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),wV=zn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hP=zn(["#text"]),dP=zn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),gC=zn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),fP=zn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),kd=zn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),vV=qr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),CV=qr(/<%[\w\W]*|[\w\W]*%>/gm),yV=qr(/\$\{[\w\W]*/gm),bV=qr(/^data-[\-\w.\u00B7-\uFFFF]+$/),SV=qr(/^aria-[\-\w]+$/),A1=qr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),RV=qr(/^(?:\w+script|data):/i),EV=qr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),H1=qr(/^html$/i),TV=qr(/^[a-z][.\w]*(-[.\w]+)+$/i);var gP=Object.freeze({__proto__:null,ARIA_ATTR:SV,ATTR_WHITESPACE:EV,CUSTOM_ELEMENT:TV,DATA_ATTR:bV,DOCTYPE_NAME:H1,ERB_EXPR:CV,IS_ALLOWED_URI:A1,IS_SCRIPT_OR_DATA:RV,MUSTACHE_EXPR:vV,TMPLIT_EXPR:yV});const cc={element:1,text:3,progressingInstruction:7,comment:8,document:9},_V=function(){return typeof window>"u"?null:window},MV=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},mP=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function N1(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_V();const e=we=>N1(we);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==cc.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t;const r=n,i=r.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:f}=t,m=l.prototype,C=uc(m,"cloneNode"),y=uc(m,"remove"),E=uc(m,"nextSibling"),v=uc(m,"childNodes"),_=uc(m,"parentNode");if(typeof s=="function"){const we=n.createElement("template");we.content&&we.content.ownerDocument&&(n=we.content.ownerDocument)}let A,L="";const{implementation:T,createNodeIterator:P,createDocumentFragment:Y,getElementsByTagName:U}=n,{importNode:W}=r;let Z=mP();e.isSupported=typeof O1=="function"&&typeof _=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:J,ERB_EXPR:se,TMPLIT_EXPR:te,DATA_ATTR:ue,ARIA_ATTR:pt,IS_SCRIPT_OR_DATA:be,ATTR_WHITESPACE:ke,CUSTOM_ELEMENT:wt}=gP;let{IS_ALLOWED_URI:mn}=gP,et=null;const g=Fe({},[...cP,...hC,...dC,...fC,...hP]);let w=null;const p=Fe({},[...dP,...gC,...fP,...kd]);let O=Object.seal(x1(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,j=null,G=!0,K=!0,b=!1,R=!0,S=!1,k=!0,M=!1,N=!1,B=!1,x=!1,D=!1,V=!1,F=!0,z=!1;const oe="user-content-";let ce=!0,Re=!1,Ne={},We=null;const Se=Fe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Le=null;const vt=Fe({},["audio","video","img","source","image","track"]);let ti=null;const mo=Fe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Or="http://www.w3.org/1998/Math/MathML",Ct="http://www.w3.org/2000/svg",Qt="http://www.w3.org/1999/xhtml";let ft=Qt,yt=!1,$e=null;const xr=Fe({},[Or,Ct,Qt],cC);let ea=Fe({},["mi","mo","mn","ms","mtext"]),ta=Fe({},["annotation-xml"]);const L$=Fe({},["title","style","font","a","script"]);let rc=null;const $$=["application/xhtml+xml","text/html"],F$="text/html";let pn=null,Rl=null;const V$=n.createElement("form"),DT=function(H){return H instanceof RegExp||H instanceof Function},Lp=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Rl&&Rl===H)){if((!H||typeof H!="object")&&(H={}),H=Ao(H),rc=$$.indexOf(H.PARSER_MEDIA_TYPE)===-1?F$:H.PARSER_MEDIA_TYPE,pn=rc==="application/xhtml+xml"?cC:Cg,et=di(H,"ALLOWED_TAGS")?Fe({},H.ALLOWED_TAGS,pn):g,w=di(H,"ALLOWED_ATTR")?Fe({},H.ALLOWED_ATTR,pn):p,$e=di(H,"ALLOWED_NAMESPACES")?Fe({},H.ALLOWED_NAMESPACES,cC):xr,ti=di(H,"ADD_URI_SAFE_ATTR")?Fe(Ao(mo),H.ADD_URI_SAFE_ATTR,pn):mo,Le=di(H,"ADD_DATA_URI_TAGS")?Fe(Ao(vt),H.ADD_DATA_URI_TAGS,pn):vt,We=di(H,"FORBID_CONTENTS")?Fe({},H.FORBID_CONTENTS,pn):Se,$=di(H,"FORBID_TAGS")?Fe({},H.FORBID_TAGS,pn):Ao({}),j=di(H,"FORBID_ATTR")?Fe({},H.FORBID_ATTR,pn):Ao({}),Ne=di(H,"USE_PROFILES")?H.USE_PROFILES:!1,G=H.ALLOW_ARIA_ATTR!==!1,K=H.ALLOW_DATA_ATTR!==!1,b=H.ALLOW_UNKNOWN_PROTOCOLS||!1,R=H.ALLOW_SELF_CLOSE_IN_ATTR!==!1,S=H.SAFE_FOR_TEMPLATES||!1,k=H.SAFE_FOR_XML!==!1,M=H.WHOLE_DOCUMENT||!1,x=H.RETURN_DOM||!1,D=H.RETURN_DOM_FRAGMENT||!1,V=H.RETURN_TRUSTED_TYPE||!1,B=H.FORCE_BODY||!1,F=H.SANITIZE_DOM!==!1,z=H.SANITIZE_NAMED_PROPS||!1,ce=H.KEEP_CONTENT!==!1,Re=H.IN_PLACE||!1,mn=H.ALLOWED_URI_REGEXP||A1,ft=H.NAMESPACE||Qt,ea=H.MATHML_TEXT_INTEGRATION_POINTS||ea,ta=H.HTML_INTEGRATION_POINTS||ta,O=H.CUSTOM_ELEMENT_HANDLING||{},H.CUSTOM_ELEMENT_HANDLING&&DT(H.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(O.tagNameCheck=H.CUSTOM_ELEMENT_HANDLING.tagNameCheck),H.CUSTOM_ELEMENT_HANDLING&&DT(H.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(O.attributeNameCheck=H.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),H.CUSTOM_ELEMENT_HANDLING&&typeof H.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(O.allowCustomizedBuiltInElements=H.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),S&&(K=!1),D&&(x=!0),Ne&&(et=Fe({},hP),w=[],Ne.html===!0&&(Fe(et,cP),Fe(w,dP)),Ne.svg===!0&&(Fe(et,hC),Fe(w,gC),Fe(w,kd)),Ne.svgFilters===!0&&(Fe(et,dC),Fe(w,gC),Fe(w,kd)),Ne.mathMl===!0&&(Fe(et,fC),Fe(w,fP),Fe(w,kd))),H.ADD_TAGS&&(et===g&&(et=Ao(et)),Fe(et,H.ADD_TAGS,pn)),H.ADD_ATTR&&(w===p&&(w=Ao(w)),Fe(w,H.ADD_ATTR,pn)),H.ADD_URI_SAFE_ATTR&&Fe(ti,H.ADD_URI_SAFE_ATTR,pn),H.FORBID_CONTENTS&&(We===Se&&(We=Ao(We)),Fe(We,H.FORBID_CONTENTS,pn)),ce&&(et["#text"]=!0),M&&Fe(et,["html","head","body"]),et.table&&(Fe(et,["tbody"]),delete $.tbody),H.TRUSTED_TYPES_POLICY){if(typeof H.TRUSTED_TYPES_POLICY.createHTML!="function")throw lc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof H.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw lc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=H.TRUSTED_TYPES_POLICY,L=A.createHTML("")}else A===void 0&&(A=MV(f,i)),A!==null&&typeof L=="string"&&(L=A.createHTML(""));zn&&zn(H),Rl=H}},kT=Fe({},[...hC,...dC,...pV]),LT=Fe({},[...fC,...wV]),W$=function(H){let ee=_(H);(!ee||!ee.tagName)&&(ee={namespaceURI:ft,tagName:"template"});const ge=Cg(H.tagName),_t=Cg(ee.tagName);return $e[H.namespaceURI]?H.namespaceURI===Ct?ee.namespaceURI===Qt?ge==="svg":ee.namespaceURI===Or?ge==="svg"&&(_t==="annotation-xml"||ea[_t]):!!kT[ge]:H.namespaceURI===Or?ee.namespaceURI===Qt?ge==="math":ee.namespaceURI===Ct?ge==="math"&&ta[_t]:!!LT[ge]:H.namespaceURI===Qt?ee.namespaceURI===Ct&&!ta[_t]||ee.namespaceURI===Or&&!ea[_t]?!1:!LT[ge]&&(L$[ge]||!kT[ge]):!!(rc==="application/xhtml+xml"&&$e[H.namespaceURI]):!1},xi=function(H){sc(e.removed,{element:H});try{_(H).removeChild(H)}catch{y(H)}},El=function(H,ee){try{sc(e.removed,{attribute:ee.getAttributeNode(H),from:ee})}catch{sc(e.removed,{attribute:null,from:ee})}if(ee.removeAttribute(H),H==="is")if(x||D)try{xi(ee)}catch{}else try{ee.setAttribute(H,"")}catch{}},$T=function(H){let ee=null,ge=null;if(B)H="<remove></remove>"+H;else{const cn=uP(H,/^[\r\n\t ]+/);ge=cn&&cn[0]}rc==="application/xhtml+xml"&&ft===Qt&&(H='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+H+"</body></html>");const _t=A?A.createHTML(H):H;if(ft===Qt)try{ee=new d().parseFromString(_t,rc)}catch{}if(!ee||!ee.documentElement){ee=T.createDocument(ft,"template",null);try{ee.documentElement.innerHTML=yt?L:_t}catch{}}const En=ee.body||ee.documentElement;return H&&ge&&En.insertBefore(n.createTextNode(ge),En.childNodes[0]||null),ft===Qt?U.call(ee,M?"html":"body")[0]:M?ee.documentElement:En},FT=function(H){return P.call(H.ownerDocument||H,H,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},$p=function(H){return H instanceof h&&(typeof H.nodeName!="string"||typeof H.textContent!="string"||typeof H.removeChild!="function"||!(H.attributes instanceof c)||typeof H.removeAttribute!="function"||typeof H.setAttribute!="function"||typeof H.namespaceURI!="string"||typeof H.insertBefore!="function"||typeof H.hasChildNodes!="function")},VT=function(H){return typeof a=="function"&&H instanceof a};function po(we,H,ee){Dd(we,ge=>{ge.call(e,H,ee,Rl)})}const WT=function(H){let ee=null;if(po(Z.beforeSanitizeElements,H,null),$p(H))return xi(H),!0;const ge=pn(H.nodeName);if(po(Z.uponSanitizeElement,H,{tagName:ge,allowedTags:et}),k&&H.hasChildNodes()&&!VT(H.firstElementChild)&&Dn(/<[/\w!]/g,H.innerHTML)&&Dn(/<[/\w!]/g,H.textContent)||H.nodeType===cc.progressingInstruction||k&&H.nodeType===cc.comment&&Dn(/<[/\w]/g,H.data))return xi(H),!0;if(!et[ge]||$[ge]){if(!$[ge]&&jT(ge)&&(O.tagNameCheck instanceof RegExp&&Dn(O.tagNameCheck,ge)||O.tagNameCheck instanceof Function&&O.tagNameCheck(ge)))return!1;if(ce&&!We[ge]){const _t=_(H)||H.parentNode,En=v(H)||H.childNodes;if(En&&_t){const cn=En.length;for(let Kn=cn-1;Kn>=0;--Kn){const wo=C(En[Kn],!0);wo.__removalCount=(H.__removalCount||0)+1,_t.insertBefore(wo,E(H))}}}return xi(H),!0}return H instanceof l&&!W$(H)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Dn(/<\/no(script|embed|frames)/i,H.innerHTML)?(xi(H),!0):(S&&H.nodeType===cc.text&&(ee=H.textContent,Dd([J,se,te],_t=>{ee=ac(ee,_t," ")}),H.textContent!==ee&&(sc(e.removed,{element:H.cloneNode()}),H.textContent=ee)),po(Z.afterSanitizeElements,H,null),!1)},BT=function(H,ee,ge){if(F&&(ee==="id"||ee==="name")&&(ge in n||ge in V$))return!1;if(!(K&&!j[ee]&&Dn(ue,ee))){if(!(G&&Dn(pt,ee))){if(!w[ee]||j[ee]){if(!(jT(H)&&(O.tagNameCheck instanceof RegExp&&Dn(O.tagNameCheck,H)||O.tagNameCheck instanceof Function&&O.tagNameCheck(H))&&(O.attributeNameCheck instanceof RegExp&&Dn(O.attributeNameCheck,ee)||O.attributeNameCheck instanceof Function&&O.attributeNameCheck(ee))||ee==="is"&&O.allowCustomizedBuiltInElements&&(O.tagNameCheck instanceof RegExp&&Dn(O.tagNameCheck,ge)||O.tagNameCheck instanceof Function&&O.tagNameCheck(ge))))return!1}else if(!ti[ee]){if(!Dn(mn,ac(ge,ke,""))){if(!((ee==="src"||ee==="xlink:href"||ee==="href")&&H!=="script"&&dV(ge,"data:")===0&&Le[H])){if(!(b&&!Dn(be,ac(ge,ke,"")))){if(ge)return!1}}}}}}return!0},jT=function(H){return H!=="annotation-xml"&&uP(H,wt)},UT=function(H){po(Z.beforeSanitizeAttributes,H,null);const{attributes:ee}=H;if(!ee||$p(H))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0};let _t=ee.length;for(;_t--;){const En=ee[_t],{name:cn,namespaceURI:Kn,value:wo}=En,ic=pn(cn),Fp=wo;let Tn=cn==="value"?Fp:fV(Fp);if(ge.attrName=ic,ge.attrValue=Tn,ge.keepAttr=!0,ge.forceKeepAttr=void 0,po(Z.uponSanitizeAttribute,H,ge),Tn=ge.attrValue,z&&(ic==="id"||ic==="name")&&(El(cn,H),Tn=oe+Tn),k&&Dn(/((--!?|])>)|<\/(style|title)/i,Tn)){El(cn,H);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){El(cn,H);continue}if(!R&&Dn(/\/>/i,Tn)){El(cn,H);continue}S&&Dd([J,se,te],YT=>{Tn=ac(Tn,YT," ")});const zT=pn(H.nodeName);if(!BT(zT,ic,Tn)){El(cn,H);continue}if(A&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Kn)switch(f.getAttributeType(zT,ic)){case"TrustedHTML":{Tn=A.createHTML(Tn);break}case"TrustedScriptURL":{Tn=A.createScriptURL(Tn);break}}if(Tn!==Fp)try{Kn?H.setAttributeNS(Kn,cn,Tn):H.setAttribute(cn,Tn),$p(H)?xi(H):lP(e.removed)}catch{El(cn,H)}}po(Z.afterSanitizeAttributes,H,null)},B$=function we(H){let ee=null;const ge=FT(H);for(po(Z.beforeSanitizeShadowDOM,H,null);ee=ge.nextNode();)po(Z.uponSanitizeShadowNode,ee,null),WT(ee),UT(ee),ee.content instanceof o&&we(ee.content);po(Z.afterSanitizeShadowDOM,H,null)};return e.sanitize=function(we){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=null,ge=null,_t=null,En=null;if(yt=!we,yt&&(we="<!-->"),typeof we!="string"&&!VT(we))if(typeof we.toString=="function"){if(we=we.toString(),typeof we!="string")throw lc("dirty is not a string, aborting")}else throw lc("toString is not a function");if(!e.isSupported)return we;if(N||Lp(H),e.removed=[],typeof we=="string"&&(Re=!1),Re){if(we.nodeName){const wo=pn(we.nodeName);if(!et[wo]||$[wo])throw lc("root node is forbidden and cannot be sanitized in-place")}}else if(we instanceof a)ee=$T("<!---->"),ge=ee.ownerDocument.importNode(we,!0),ge.nodeType===cc.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?ee=ge:ee.appendChild(ge);else{if(!x&&!S&&!M&&we.indexOf("<")===-1)return A&&V?A.createHTML(we):we;if(ee=$T(we),!ee)return x?null:V?L:""}ee&&B&&xi(ee.firstChild);const cn=FT(Re?we:ee);for(;_t=cn.nextNode();)WT(_t),UT(_t),_t.content instanceof o&&B$(_t.content);if(Re)return we;if(x){if(D)for(En=Y.call(ee.ownerDocument);ee.firstChild;)En.appendChild(ee.firstChild);else En=ee;return(w.shadowroot||w.shadowrootmode)&&(En=W.call(r,En,!0)),En}let Kn=M?ee.outerHTML:ee.innerHTML;return M&&et["!doctype"]&&ee.ownerDocument&&ee.ownerDocument.doctype&&ee.ownerDocument.doctype.name&&Dn(H1,ee.ownerDocument.doctype.name)&&(Kn="<!DOCTYPE "+ee.ownerDocument.doctype.name+`>
2
+ `+Kn),S&&Dd([J,se,te],wo=>{Kn=ac(Kn,wo," ")}),A&&V?A.createHTML(Kn):Kn},e.setConfig=function(){let we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Lp(we),N=!0},e.clearConfig=function(){Rl=null,N=!1},e.isValidAttribute=function(we,H,ee){Rl||Lp({});const ge=pn(we),_t=pn(H);return BT(ge,_t,ee)},e.addHook=function(we,H){typeof H=="function"&&sc(Z[we],H)},e.removeHook=function(we,H){if(H!==void 0){const ee=cV(Z[we],H);return ee===-1?void 0:hV(Z[we],ee,1)[0]}return lP(Z[we])},e.removeHooks=function(we){Z[we]=[]},e.removeAllHooks=function(){Z=mP()},e}var IV=N1();//! moment.js
3
+ //! version : 2.30.1
4
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
5
+ //! license : MIT
6
+ //! momentjs.com
7
+ var D1;function X(){return D1.apply(null,arguments)}function PV(t){D1=t}function Ri(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function el(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function Qe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function uR(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(Qe(t,e))return!1;return!0}function or(t){return t===void 0}function es(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function md(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function k1(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function Ds(t,e){for(var n in e)Qe(e,n)&&(t[n]=e[n]);return Qe(e,"toString")&&(t.toString=e.toString),Qe(e,"valueOf")&&(t.valueOf=e.valueOf),t}function ho(t,e,n,r){return oN(t,e,n,r,!0).utc()}function OV(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Pe(t){return t._pf==null&&(t._pf=OV()),t._pf}var Gb;Array.prototype.some?Gb=Array.prototype.some:Gb=function(t){var e=Object(this),n=e.length>>>0,r;for(r=0;r<n;r++)if(r in e&&t.call(this,e[r],r,e))return!0;return!1};function cR(t){var e=null,n=!1,r=t._d&&!isNaN(t._d.getTime());if(r&&(e=Pe(t),n=Gb.call(e.parsedDateParts,function(i){return i!=null}),r=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n),t._strict&&(r=r&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=r;else return r;return t._isValid}function Um(t){var e=ho(NaN);return t!=null?Ds(Pe(e),t):Pe(e).userInvalidated=!0,e}var pP=X.momentProperties=[],mC=!1;function hR(t,e){var n,r,i,o=pP.length;if(or(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),or(e._i)||(t._i=e._i),or(e._f)||(t._f=e._f),or(e._l)||(t._l=e._l),or(e._strict)||(t._strict=e._strict),or(e._tzm)||(t._tzm=e._tzm),or(e._isUTC)||(t._isUTC=e._isUTC),or(e._offset)||(t._offset=e._offset),or(e._pf)||(t._pf=Pe(e)),or(e._locale)||(t._locale=e._locale),o>0)for(n=0;n<o;n++)r=pP[n],i=e[r],or(i)||(t[r]=i);return t}function pd(t){hR(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),mC===!1&&(mC=!0,X.updateOffset(this),mC=!1)}function Ei(t){return t instanceof pd||t!=null&&t._isAMomentObject!=null}function L1(t){X.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Qr(t,e){var n=!0;return Ds(function(){if(X.deprecationHandler!=null&&X.deprecationHandler(null,t),n){var r=[],i,o,s,a=arguments.length;for(o=0;o<a;o++){if(i="",typeof arguments[o]=="object"){i+=`
8
+ [`+o+"] ";for(s in arguments[0])Qe(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];r.push(i)}L1(t+`
9
+ Arguments: `+Array.prototype.slice.call(r).join("")+`
10
+ `+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var wP={};function $1(t,e){X.deprecationHandler!=null&&X.deprecationHandler(t,e),wP[t]||(L1(e),wP[t]=!0)}X.suppressDeprecationWarnings=!1;X.deprecationHandler=null;function fo(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function xV(t){var e,n;for(n in t)Qe(t,n)&&(e=t[n],fo(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function qb(t,e){var n=Ds({},t),r;for(r in e)Qe(e,r)&&(el(t[r])&&el(e[r])?(n[r]={},Ds(n[r],t[r]),Ds(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)Qe(t,r)&&!Qe(e,r)&&el(t[r])&&(n[r]=Ds({},n[r]));return n}function dR(t){t!=null&&this.set(t)}var Kb;Object.keys?Kb=Object.keys:Kb=function(t){var e,n=[];for(e in t)Qe(t,e)&&n.push(e);return n};var AV={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function HV(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return fo(r)?r.call(e,n):r}function ao(t,e,n){var r=""+Math.abs(t),i=e-r.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var fR=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ld=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,pC={},Eu={};function Ce(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(Eu[t]=i),e&&(Eu[e[0]]=function(){return ao(i.apply(this,arguments),e[1],e[2])}),n&&(Eu[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function NV(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function DV(t){var e=t.match(fR),n,r;for(n=0,r=e.length;n<r;n++)Eu[e[n]]?e[n]=Eu[e[n]]:e[n]=NV(e[n]);return function(i){var o="",s;for(s=0;s<r;s++)o+=fo(e[s])?e[s].call(i,t):e[s];return o}}function yg(t,e){return t.isValid()?(e=F1(e,t.localeData()),pC[e]=pC[e]||DV(e),pC[e](t)):t.localeData().invalidDate()}function F1(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(Ld.lastIndex=0;n>=0&&Ld.test(t);)t=t.replace(Ld,r),Ld.lastIndex=0,n-=1;return t}var kV={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function LV(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(fR).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var $V="Invalid date";function FV(){return this._invalidDate}var VV="%d",WV=/\d{1,2}/;function BV(t){return this._ordinal.replace("%d",t)}var jV={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function UV(t,e,n,r){var i=this._relativeTime[n];return fo(i)?i(t,e,n,r):i.replace(/%d/i,t)}function zV(t,e){var n=this._relativeTime[t>0?"future":"past"];return fo(n)?n(e):n.replace(/%s/i,e)}var vP={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Jr(t){return typeof t=="string"?vP[t]||vP[t.toLowerCase()]:void 0}function gR(t){var e={},n,r;for(r in t)Qe(t,r)&&(n=Jr(r),n&&(e[n]=t[r]));return e}var YV={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function GV(t){var e=[],n;for(n in t)Qe(t,n)&&e.push({unit:n,priority:YV[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var V1=/\d/,Pr=/\d\d/,W1=/\d{3}/,mR=/\d{4}/,zm=/[+-]?\d{6}/,Tt=/\d\d?/,B1=/\d\d\d\d?/,j1=/\d\d\d\d\d\d?/,Ym=/\d{1,3}/,pR=/\d{1,4}/,Gm=/[+-]?\d{1,6}/,Yu=/\d+/,qm=/[+-]?\d+/,qV=/Z|[+-]\d\d:?\d\d/gi,Km=/Z|[+-]\d\d(?::?\d\d)?/gi,KV=/[+-]?\d+(\.\d{1,3})?/,wd=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Gu=/^[1-9]\d?/,wR=/^([1-9]\d|\d)/,Bg;Bg={};function le(t,e,n){Bg[t]=fo(e)?e:function(r,i){return r&&n?n:e}}function XV(t,e){return Qe(Bg,t)?Bg[t](e._strict,e._locale):new RegExp(ZV(t))}function ZV(t){return Zo(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,o){return n||r||i||o}))}function Zo(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ur(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function je(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=Ur(e)),n}var Xb={};function ct(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),es(e)&&(r=function(o,s){s[e]=je(o)}),i=t.length,n=0;n<i;n++)Xb[t[n]]=r}function vd(t,e){ct(t,function(n,r,i,o){i._w=i._w||{},e(n,i._w,i,o)})}function QV(t,e,n){e!=null&&Qe(Xb,t)&&Xb[t](e,n._a,n,t)}function Xm(t){return t%4===0&&t%100!==0||t%400===0}var Nn=0,jo=1,no=2,gn=3,yi=4,Uo=5,qa=6,JV=7,eW=8;Ce("Y",0,0,function(){var t=this.year();return t<=9999?ao(t,4):"+"+t});Ce(0,["YY",2],0,function(){return this.year()%100});Ce(0,["YYYY",4],0,"year");Ce(0,["YYYYY",5],0,"year");Ce(0,["YYYYYY",6,!0],0,"year");le("Y",qm);le("YY",Tt,Pr);le("YYYY",pR,mR);le("YYYYY",Gm,zm);le("YYYYYY",Gm,zm);ct(["YYYYY","YYYYYY"],Nn);ct("YYYY",function(t,e){e[Nn]=t.length===2?X.parseTwoDigitYear(t):je(t)});ct("YY",function(t,e){e[Nn]=X.parseTwoDigitYear(t)});ct("Y",function(t,e){e[Nn]=parseInt(t,10)});function ph(t){return Xm(t)?366:365}X.parseTwoDigitYear=function(t){return je(t)+(je(t)>68?1900:2e3)};var U1=qu("FullYear",!0);function tW(){return Xm(this.year())}function qu(t,e){return function(n){return n!=null?(z1(this,t,n),X.updateOffset(this,e),this):Fh(this,t)}}function Fh(t,e){if(!t.isValid())return NaN;var n=t._d,r=t._isUTC;switch(e){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function z1(t,e,n){var r,i,o,s,a;if(!(!t.isValid()||isNaN(n))){switch(r=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,s=t.month(),a=t.date(),a=a===29&&s===1&&!Xm(o)?28:a,i?r.setUTCFullYear(o,s,a):r.setFullYear(o,s,a)}}function nW(t){return t=Jr(t),fo(this[t])?this[t]():this}function rW(t,e){if(typeof t=="object"){t=gR(t);var n=GV(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=Jr(t),fo(this[t]))return this[t](e);return this}function iW(t,e){return(t%e+e)%e}var Gt;Array.prototype.indexOf?Gt=Array.prototype.indexOf:Gt=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function vR(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=iW(e,12);return t+=(e-n)/12,n===1?Xm(t)?29:28:31-n%7%2}Ce("M",["MM",2],"Mo",function(){return this.month()+1});Ce("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)});Ce("MMMM",0,0,function(t){return this.localeData().months(this,t)});le("M",Tt,Gu);le("MM",Tt,Pr);le("MMM",function(t,e){return e.monthsShortRegex(t)});le("MMMM",function(t,e){return e.monthsRegex(t)});ct(["M","MM"],function(t,e){e[jo]=je(t)-1});ct(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[jo]=i:Pe(n).invalidMonth=t});var oW="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Y1="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),G1=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,sW=wd,aW=wd;function lW(t,e){return t?Ri(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||G1).test(e)?"format":"standalone"][t.month()]:Ri(this._months)?this._months:this._months.standalone}function uW(t,e){return t?Ri(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[G1.test(e)?"format":"standalone"][t.month()]:Ri(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function cW(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=ho([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?e==="MMM"?(i=Gt.call(this._shortMonthsParse,s),i!==-1?i:null):(i=Gt.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=Gt.call(this._shortMonthsParse,s),i!==-1?i:(i=Gt.call(this._longMonthsParse,s),i!==-1?i:null)):(i=Gt.call(this._longMonthsParse,s),i!==-1?i:(i=Gt.call(this._shortMonthsParse,s),i!==-1?i:null))}function hW(t,e,n){var r,i,o;if(this._monthsParseExact)return cW.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=ho([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[r].test(t))return r;if(n&&e==="MMM"&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function q1(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=je(e);else if(e=t.localeData().monthsParse(e),!es(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,vR(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function K1(t){return t!=null?(q1(this,t),X.updateOffset(this,!0),this):Fh(this,"Month")}function dW(){return vR(this.year(),this.month())}function fW(t){return this._monthsParseExact?(Qe(this,"_monthsRegex")||X1.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(Qe(this,"_monthsShortRegex")||(this._monthsShortRegex=sW),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function gW(t){return this._monthsParseExact?(Qe(this,"_monthsRegex")||X1.call(this),t?this._monthsStrictRegex:this._monthsRegex):(Qe(this,"_monthsRegex")||(this._monthsRegex=aW),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function X1(){function t(l,u){return u.length-l.length}var e=[],n=[],r=[],i,o,s,a;for(i=0;i<12;i++)o=ho([2e3,i]),s=Zo(this.monthsShort(o,"")),a=Zo(this.months(o,"")),e.push(s),n.push(a),r.push(a),r.push(s);e.sort(t),n.sort(t),r.sort(t),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function mW(t,e,n,r,i,o,s){var a;return t<100&&t>=0?(a=new Date(t+400,e,n,r,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,n,r,i,o,s),a}function Vh(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function jg(t,e,n){var r=7+e-n,i=(7+Vh(t,0,r).getUTCDay()-e)%7;return-i+r-1}function Z1(t,e,n,r,i){var o=(7+n-r)%7,s=jg(t,r,i),a=1+7*(e-1)+o+s,l,u;return a<=0?(l=t-1,u=ph(l)+a):a>ph(t)?(l=t+1,u=a-ph(t)):(l=t,u=a),{year:l,dayOfYear:u}}function Wh(t,e,n){var r=jg(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+Qo(s,e,n)):i>Qo(t.year(),e,n)?(o=i-Qo(t.year(),e,n),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function Qo(t,e,n){var r=jg(t,e,n),i=jg(t+1,e,n);return(ph(t)-r+i)/7}Ce("w",["ww",2],"wo","week");Ce("W",["WW",2],"Wo","isoWeek");le("w",Tt,Gu);le("ww",Tt,Pr);le("W",Tt,Gu);le("WW",Tt,Pr);vd(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=je(t)});function pW(t){return Wh(t,this._week.dow,this._week.doy).week}var wW={dow:0,doy:6};function vW(){return this._week.dow}function CW(){return this._week.doy}function yW(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function bW(t){var e=Wh(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}Ce("d",0,"do","day");Ce("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)});Ce("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)});Ce("dddd",0,0,function(t){return this.localeData().weekdays(this,t)});Ce("e",0,0,"weekday");Ce("E",0,0,"isoWeekday");le("d",Tt);le("e",Tt);le("E",Tt);le("dd",function(t,e){return e.weekdaysMinRegex(t)});le("ddd",function(t,e){return e.weekdaysShortRegex(t)});le("dddd",function(t,e){return e.weekdaysRegex(t)});vd(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:Pe(n).invalidWeekday=t});vd(["d","e","E"],function(t,e,n,r){e[r]=je(t)});function SW(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function RW(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function CR(t,e){return t.slice(e,7).concat(t.slice(0,e))}var EW="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Q1="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),TW="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),_W=wd,MW=wd,IW=wd;function PW(t,e){var n=Ri(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?CR(n,this._week.dow):t?n[t.day()]:n}function OW(t){return t===!0?CR(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function xW(t){return t===!0?CR(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function AW(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=ho([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?e==="dddd"?(i=Gt.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=Gt.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Gt.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=Gt.call(this._weekdaysParse,s),i!==-1||(i=Gt.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Gt.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=Gt.call(this._shortWeekdaysParse,s),i!==-1||(i=Gt.call(this._weekdaysParse,s),i!==-1)?i:(i=Gt.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Gt.call(this._minWeekdaysParse,s),i!==-1||(i=Gt.call(this._weekdaysParse,s),i!==-1)?i:(i=Gt.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function HW(t,e,n){var r,i,o;if(this._weekdaysParseExact)return AW.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=ho([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[r].test(t))return r;if(n&&e==="ddd"&&this._shortWeekdaysParse[r].test(t))return r;if(n&&e==="dd"&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function NW(t){if(!this.isValid())return t!=null?this:NaN;var e=Fh(this,"Day");return t!=null?(t=SW(t,this.localeData()),this.add(t-e,"d")):e}function DW(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function kW(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=RW(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function LW(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||yR.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(Qe(this,"_weekdaysRegex")||(this._weekdaysRegex=_W),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function $W(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||yR.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Qe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=MW),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function FW(t){return this._weekdaysParseExact?(Qe(this,"_weekdaysRegex")||yR.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Qe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=IW),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function yR(){function t(c,h){return h.length-c.length}var e=[],n=[],r=[],i=[],o,s,a,l,u;for(o=0;o<7;o++)s=ho([2e3,1]).day(o),a=Zo(this.weekdaysMin(s,"")),l=Zo(this.weekdaysShort(s,"")),u=Zo(this.weekdays(s,"")),e.push(a),n.push(l),r.push(u),i.push(a),i.push(l),i.push(u);e.sort(t),n.sort(t),r.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function bR(){return this.hours()%12||12}function VW(){return this.hours()||24}Ce("H",["HH",2],0,"hour");Ce("h",["hh",2],0,bR);Ce("k",["kk",2],0,VW);Ce("hmm",0,0,function(){return""+bR.apply(this)+ao(this.minutes(),2)});Ce("hmmss",0,0,function(){return""+bR.apply(this)+ao(this.minutes(),2)+ao(this.seconds(),2)});Ce("Hmm",0,0,function(){return""+this.hours()+ao(this.minutes(),2)});Ce("Hmmss",0,0,function(){return""+this.hours()+ao(this.minutes(),2)+ao(this.seconds(),2)});function J1(t,e){Ce(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}J1("a",!0);J1("A",!1);function eN(t,e){return e._meridiemParse}le("a",eN);le("A",eN);le("H",Tt,wR);le("h",Tt,Gu);le("k",Tt,Gu);le("HH",Tt,Pr);le("hh",Tt,Pr);le("kk",Tt,Pr);le("hmm",B1);le("hmmss",j1);le("Hmm",B1);le("Hmmss",j1);ct(["H","HH"],gn);ct(["k","kk"],function(t,e,n){var r=je(t);e[gn]=r===24?0:r});ct(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t});ct(["h","hh"],function(t,e,n){e[gn]=je(t),Pe(n).bigHour=!0});ct("hmm",function(t,e,n){var r=t.length-2;e[gn]=je(t.substr(0,r)),e[yi]=je(t.substr(r)),Pe(n).bigHour=!0});ct("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[gn]=je(t.substr(0,r)),e[yi]=je(t.substr(r,2)),e[Uo]=je(t.substr(i)),Pe(n).bigHour=!0});ct("Hmm",function(t,e,n){var r=t.length-2;e[gn]=je(t.substr(0,r)),e[yi]=je(t.substr(r))});ct("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[gn]=je(t.substr(0,r)),e[yi]=je(t.substr(r,2)),e[Uo]=je(t.substr(i))});function WW(t){return(t+"").toLowerCase().charAt(0)==="p"}var BW=/[ap]\.?m?\.?/i,jW=qu("Hours",!0);function UW(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var tN={calendar:AV,longDateFormat:kV,invalidDate:$V,ordinal:VV,dayOfMonthOrdinalParse:WV,relativeTime:jV,months:oW,monthsShort:Y1,week:wW,weekdays:EW,weekdaysMin:TW,weekdaysShort:Q1,meridiemParse:BW},Mt={},hc={},Bh;function zW(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n<r;n+=1)if(t[n]!==e[n])return n;return r}function CP(t){return t&&t.toLowerCase().replace("_","-")}function YW(t){for(var e=0,n,r,i,o;e<t.length;){for(o=CP(t[e]).split("-"),n=o.length,r=CP(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=Zm(o.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&zW(o,r)>=n-1)break;n--}e++}return Bh}function GW(t){return!!(t&&t.match("^[^/\\\\]*$"))}function Zm(t){var e=null,n;if(Mt[t]===void 0&&typeof module<"u"&&module&&module.exports&&GW(t))try{e=Bh._abbr,n=require,n("./locale/"+t),Bs(e)}catch{Mt[t]=null}return Mt[t]}function Bs(t,e){var n;return t&&(or(e)?n=os(t):n=SR(t,e),n?Bh=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Bh._abbr}function SR(t,e){if(e!==null){var n,r=tN;if(e.abbr=t,Mt[t]!=null)$1("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Mt[t]._config;else if(e.parentLocale!=null)if(Mt[e.parentLocale]!=null)r=Mt[e.parentLocale]._config;else if(n=Zm(e.parentLocale),n!=null)r=n._config;else return hc[e.parentLocale]||(hc[e.parentLocale]=[]),hc[e.parentLocale].push({name:t,config:e}),null;return Mt[t]=new dR(qb(r,e)),hc[t]&&hc[t].forEach(function(i){SR(i.name,i.config)}),Bs(t),Mt[t]}else return delete Mt[t],null}function qW(t,e){if(e!=null){var n,r,i=tN;Mt[t]!=null&&Mt[t].parentLocale!=null?Mt[t].set(qb(Mt[t]._config,e)):(r=Zm(t),r!=null&&(i=r._config),e=qb(i,e),r==null&&(e.abbr=t),n=new dR(e),n.parentLocale=Mt[t],Mt[t]=n),Bs(t)}else Mt[t]!=null&&(Mt[t].parentLocale!=null?(Mt[t]=Mt[t].parentLocale,t===Bs()&&Bs(t)):Mt[t]!=null&&delete Mt[t]);return Mt[t]}function os(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Bh;if(!Ri(t)){if(e=Zm(t),e)return e;t=[t]}return YW(t)}function KW(){return Kb(Mt)}function RR(t){var e,n=t._a;return n&&Pe(t).overflow===-2&&(e=n[jo]<0||n[jo]>11?jo:n[no]<1||n[no]>vR(n[Nn],n[jo])?no:n[gn]<0||n[gn]>24||n[gn]===24&&(n[yi]!==0||n[Uo]!==0||n[qa]!==0)?gn:n[yi]<0||n[yi]>59?yi:n[Uo]<0||n[Uo]>59?Uo:n[qa]<0||n[qa]>999?qa:-1,Pe(t)._overflowDayOfYear&&(e<Nn||e>no)&&(e=no),Pe(t)._overflowWeeks&&e===-1&&(e=JV),Pe(t)._overflowWeekday&&e===-1&&(e=eW),Pe(t).overflow=e),t}var XW=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ZW=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,QW=/Z|[+-]\d\d(?::?\d\d)?/,$d=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],wC=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],JW=/^\/?Date\((-?\d+)/i,eB=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,tB={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function nN(t){var e,n,r=t._i,i=XW.exec(r)||ZW.exec(r),o,s,a,l,u=$d.length,c=wC.length;if(i){for(Pe(t).iso=!0,e=0,n=u;e<n;e++)if($d[e][1].exec(i[1])){s=$d[e][0],o=$d[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,n=c;e<n;e++)if(wC[e][1].exec(i[3])){a=(i[2]||" ")+wC[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(QW.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),TR(t)}else t._isValid=!1}function nB(t,e,n,r,i,o){var s=[rB(t),Y1.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function rB(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function iB(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function oB(t,e,n){if(t){var r=Q1.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return Pe(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function sB(t,e,n){if(t)return tB[t];if(e)return 0;var r=parseInt(n,10),i=r%100,o=(r-i)/100;return o*60+i}function rN(t){var e=eB.exec(iB(t._i)),n;if(e){if(n=nB(e[4],e[3],e[2],e[5],e[6],e[7]),!oB(e[1],n,t))return;t._a=n,t._tzm=sB(e[8],e[9],e[10]),t._d=Vh.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),Pe(t).rfc2822=!0}else t._isValid=!1}function aB(t){var e=JW.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(nN(t),t._isValid===!1)delete t._isValid;else return;if(rN(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:X.createFromInputFallback(t)}X.createFromInputFallback=Qr("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function uu(t,e,n){return t??e??n}function lB(t){var e=new Date(X.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function ER(t){var e,n,r=[],i,o,s;if(!t._d){for(i=lB(t),t._w&&t._a[no]==null&&t._a[jo]==null&&uB(t),t._dayOfYear!=null&&(s=uu(t._a[Nn],i[Nn]),(t._dayOfYear>ph(s)||t._dayOfYear===0)&&(Pe(t)._overflowDayOfYear=!0),n=Vh(s,0,t._dayOfYear),t._a[jo]=n.getUTCMonth(),t._a[no]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[gn]===24&&t._a[yi]===0&&t._a[Uo]===0&&t._a[qa]===0&&(t._nextDay=!0,t._a[gn]=0),t._d=(t._useUTC?Vh:mW).apply(null,r),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[gn]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(Pe(t).weekdayMismatch=!0)}}function uB(t){var e,n,r,i,o,s,a,l,u;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(o=1,s=4,n=uu(e.GG,t._a[Nn],Wh(Et(),1,4).year),r=uu(e.W,1),i=uu(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,u=Wh(Et(),o,s),n=uu(e.gg,t._a[Nn],u.year),r=uu(e.w,u.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),r<1||r>Qo(n,o,s)?Pe(t)._overflowWeeks=!0:l!=null?Pe(t)._overflowWeekday=!0:(a=Z1(n,r,i,o,s),t._a[Nn]=a.year,t._dayOfYear=a.dayOfYear)}X.ISO_8601=function(){};X.RFC_2822=function(){};function TR(t){if(t._f===X.ISO_8601){nN(t);return}if(t._f===X.RFC_2822){rN(t);return}t._a=[],Pe(t).empty=!0;var e=""+t._i,n,r,i,o,s,a=e.length,l=0,u,c;for(i=F1(t._f,t._locale).match(fR)||[],c=i.length,n=0;n<c;n++)o=i[n],r=(e.match(XV(o,t))||[])[0],r&&(s=e.substr(0,e.indexOf(r)),s.length>0&&Pe(t).unusedInput.push(s),e=e.slice(e.indexOf(r)+r.length),l+=r.length),Eu[o]?(r?Pe(t).empty=!1:Pe(t).unusedTokens.push(o),QV(o,r,t)):t._strict&&!r&&Pe(t).unusedTokens.push(o);Pe(t).charsLeftOver=a-l,e.length>0&&Pe(t).unusedInput.push(e),t._a[gn]<=12&&Pe(t).bigHour===!0&&t._a[gn]>0&&(Pe(t).bigHour=void 0),Pe(t).parsedDateParts=t._a.slice(0),Pe(t).meridiem=t._meridiem,t._a[gn]=cB(t._locale,t._a[gn],t._meridiem),u=Pe(t).era,u!==null&&(t._a[Nn]=t._locale.erasConvertYear(u,t._a[Nn])),ER(t),RR(t)}function cB(t,e,n){var r;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(r=t.isPM(n),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function hB(t){var e,n,r,i,o,s,a=!1,l=t._f.length;if(l===0){Pe(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)o=0,s=!1,e=hR({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],TR(e),cR(e)&&(s=!0),o+=Pe(e).charsLeftOver,o+=Pe(e).unusedTokens.length*10,Pe(e).score=o,a?o<r&&(r=o,n=e):(r==null||o<r||s)&&(r=o,n=e,s&&(a=!0));Ds(t,n||e)}function dB(t){if(!t._d){var e=gR(t._i),n=e.day===void 0?e.date:e.day;t._a=k1([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),ER(t)}}function fB(t){var e=new pd(RR(iN(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function iN(t){var e=t._i,n=t._f;return t._locale=t._locale||os(t._l),e===null||n===void 0&&e===""?Um({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),Ei(e)?new pd(RR(e)):(md(e)?t._d=e:Ri(n)?hB(t):n?TR(t):gB(t),cR(t)||(t._d=null),t))}function gB(t){var e=t._i;or(e)?t._d=new Date(X.now()):md(e)?t._d=new Date(e.valueOf()):typeof e=="string"?aB(t):Ri(e)?(t._a=k1(e.slice(0),function(n){return parseInt(n,10)}),ER(t)):el(e)?dB(t):es(e)?t._d=new Date(e):X.createFromInputFallback(t)}function oN(t,e,n,r,i){var o={};return(e===!0||e===!1)&&(r=e,e=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(el(t)&&uR(t)||Ri(t)&&t.length===0)&&(t=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=t,o._f=e,o._strict=r,fB(o)}function Et(t,e,n,r){return oN(t,e,n,r,!1)}var mB=Qr("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Et.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Um()}),pB=Qr("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Et.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:Um()});function sN(t,e){var n,r;if(e.length===1&&Ri(e[0])&&(e=e[0]),!e.length)return Et();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function wB(){var t=[].slice.call(arguments,0);return sN("isBefore",t)}function vB(){var t=[].slice.call(arguments,0);return sN("isAfter",t)}var CB=function(){return Date.now?Date.now():+new Date},dc=["year","quarter","month","week","day","hour","minute","second","millisecond"];function yB(t){var e,n=!1,r,i=dc.length;for(e in t)if(Qe(t,e)&&!(Gt.call(dc,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[dc[r]]){if(n)return!1;parseFloat(t[dc[r]])!==je(t[dc[r]])&&(n=!0)}return!0}function bB(){return this._isValid}function SB(){return Ii(NaN)}function Qm(t){var e=gR(t),n=e.year||0,r=e.quarter||0,i=e.month||0,o=e.week||e.isoWeek||0,s=e.day||0,a=e.hour||0,l=e.minute||0,u=e.second||0,c=e.millisecond||0;this._isValid=yB(e),this._milliseconds=+c+u*1e3+l*6e4+a*1e3*60*60,this._days=+s+o*7,this._months=+i+r*3+n*12,this._data={},this._locale=os(),this._bubble()}function bg(t){return t instanceof Qm}function Zb(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function RB(t,e,n){var r=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),o=0,s;for(s=0;s<r;s++)je(t[s])!==je(e[s])&&o++;return o+i}function aN(t,e){Ce(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+ao(~~(n/60),2)+e+ao(~~n%60,2)})}aN("Z",":");aN("ZZ","");le("Z",Km);le("ZZ",Km);ct(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=_R(Km,t)});var EB=/([\+\-]|\d\d)/gi;function _R(t,e){var n=(e||"").match(t),r,i,o;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(EB)||["-",0,0],o=+(i[1]*60)+je(i[2]),o===0?0:i[0]==="+"?o:-o)}function MR(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(Ei(t)||md(t)?t.valueOf():Et(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),X.updateOffset(n,!1),n):Et(t).local()}function Qb(t){return-Math.round(t._d.getTimezoneOffset())}X.updateOffset=function(){};function TB(t,e,n){var r=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=_R(Km,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=Qb(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?cN(this,Ii(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,X.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Qb(this)}function _B(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function MB(t){return this.utcOffset(0,t)}function IB(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Qb(this),"m")),this}function PB(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=_R(qV,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function OB(t){return this.isValid()?(t=t?Et(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function xB(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function AB(){if(!or(this._isDSTShifted))return this._isDSTShifted;var t={},e;return hR(t,this),t=iN(t),t._a?(e=t._isUTC?ho(t._a):Et(t._a),this._isDSTShifted=this.isValid()&&RB(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function HB(){return this.isValid()?!this._isUTC:!1}function NB(){return this.isValid()?this._isUTC:!1}function lN(){return this.isValid()?this._isUTC&&this._offset===0:!1}var DB=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,kB=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ii(t,e){var n=t,r=null,i,o,s;return bg(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:es(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=DB.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:je(r[no])*i,h:je(r[gn])*i,m:je(r[yi])*i,s:je(r[Uo])*i,ms:je(Zb(r[qa]*1e3))*i}):(r=kB.exec(t))?(i=r[1]==="-"?-1:1,n={y:na(r[2],i),M:na(r[3],i),w:na(r[4],i),d:na(r[5],i),h:na(r[6],i),m:na(r[7],i),s:na(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(s=LB(Et(n.from),Et(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),o=new Qm(n),bg(t)&&Qe(t,"_locale")&&(o._locale=t._locale),bg(t)&&Qe(t,"_isValid")&&(o._isValid=t._isValid),o}Ii.fn=Qm.prototype;Ii.invalid=SB;function na(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function yP(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function LB(t,e){var n;return t.isValid()&&e.isValid()?(e=MR(e,t),t.isBefore(e)?n=yP(t,e):(n=yP(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function uN(t,e){return function(n,r){var i,o;return r!==null&&!isNaN(+r)&&($1(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),i=Ii(n,r),cN(this,i,t),this}}function cN(t,e,n,r){var i=e._milliseconds,o=Zb(e._days),s=Zb(e._months);t.isValid()&&(r=r??!0,s&&q1(t,Fh(t,"Month")+s*n),o&&z1(t,"Date",Fh(t,"Date")+o*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&X.updateOffset(t,o||s))}var $B=uN(1,"add"),FB=uN(-1,"subtract");function hN(t){return typeof t=="string"||t instanceof String}function VB(t){return Ei(t)||md(t)||hN(t)||es(t)||BB(t)||WB(t)||t===null||t===void 0}function WB(t){var e=el(t)&&!uR(t),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,o,s=r.length;for(i=0;i<s;i+=1)o=r[i],n=n||Qe(t,o);return e&&n}function BB(t){var e=Ri(t),n=!1;return e&&(n=t.filter(function(r){return!es(r)&&hN(t)}).length===0),e&&n}function jB(t){var e=el(t)&&!uR(t),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,o;for(i=0;i<r.length;i+=1)o=r[i],n=n||Qe(t,o);return e&&n}function UB(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function zB(t,e){arguments.length===1&&(arguments[0]?VB(arguments[0])?(t=arguments[0],e=void 0):jB(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||Et(),r=MR(n,this).startOf("day"),i=X.calendarFormat(this,r)||"sameElse",o=e&&(fo(e[i])?e[i].call(this,n):e[i]);return this.format(o||this.localeData().calendar(i,this,Et(n)))}function YB(){return new pd(this)}function GB(t,e){var n=Ei(t)?t:Et(t);return this.isValid()&&n.isValid()?(e=Jr(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function qB(t,e){var n=Ei(t)?t:Et(t);return this.isValid()&&n.isValid()?(e=Jr(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function KB(t,e,n,r){var i=Ei(t)?t:Et(t),o=Ei(e)?e:Et(e);return this.isValid()&&i.isValid()&&o.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function XB(t,e){var n=Ei(t)?t:Et(t),r;return this.isValid()&&n.isValid()?(e=Jr(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function ZB(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function QB(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function JB(t,e,n){var r,i,o;if(!this.isValid())return NaN;if(r=MR(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=Jr(e),e){case"year":o=Sg(this,r)/12;break;case"month":o=Sg(this,r);break;case"quarter":o=Sg(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-i)/864e5;break;case"week":o=(this-r-i)/6048e5;break;default:o=this-r}return n?o:Ur(o)}function Sg(t,e){if(t.date()<e.date())return-Sg(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),r=t.clone().add(n,"months"),i,o;return e-r<0?(i=t.clone().add(n-1,"months"),o=(e-r)/(r-i)):(i=t.clone().add(n+1,"months"),o=(e-r)/(i-r)),-(n+o)||0}X.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";X.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function ej(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function tj(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?yg(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):fo(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",yg(n,"Z")):yg(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function nj(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,r,i,o;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",o=e+'[")]',this.format(n+r+i+o)}function rj(t){t||(t=this.isUtc()?X.defaultFormatUtc:X.defaultFormat);var e=yg(this,t);return this.localeData().postformat(e)}function ij(t,e){return this.isValid()&&(Ei(t)&&t.isValid()||Et(t).isValid())?Ii({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function oj(t){return this.from(Et(),t)}function sj(t,e){return this.isValid()&&(Ei(t)&&t.isValid()||Et(t).isValid())?Ii({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function aj(t){return this.to(Et(),t)}function dN(t){var e;return t===void 0?this._locale._abbr:(e=os(t),e!=null&&(this._locale=e),this)}var fN=Qr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function gN(){return this._locale}var Ug=1e3,Tu=60*Ug,zg=60*Tu,mN=(365*400+97)*24*zg;function _u(t,e){return(t%e+e)%e}function pN(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-mN:new Date(t,e,n).valueOf()}function wN(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-mN:Date.UTC(t,e,n)}function lj(t){var e,n;if(t=Jr(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?wN:pN,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=_u(e+(this._isUTC?0:this.utcOffset()*Tu),zg);break;case"minute":e=this._d.valueOf(),e-=_u(e,Tu);break;case"second":e=this._d.valueOf(),e-=_u(e,Ug);break}return this._d.setTime(e),X.updateOffset(this,!0),this}function uj(t){var e,n;if(t=Jr(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?wN:pN,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=zg-_u(e+(this._isUTC?0:this.utcOffset()*Tu),zg)-1;break;case"minute":e=this._d.valueOf(),e+=Tu-_u(e,Tu)-1;break;case"second":e=this._d.valueOf(),e+=Ug-_u(e,Ug)-1;break}return this._d.setTime(e),X.updateOffset(this,!0),this}function cj(){return this._d.valueOf()-(this._offset||0)*6e4}function hj(){return Math.floor(this.valueOf()/1e3)}function dj(){return new Date(this.valueOf())}function fj(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function gj(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function mj(){return this.isValid()?this.toISOString():null}function pj(){return cR(this)}function wj(){return Ds({},Pe(this))}function vj(){return Pe(this).overflow}function Cj(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Ce("N",0,0,"eraAbbr");Ce("NN",0,0,"eraAbbr");Ce("NNN",0,0,"eraAbbr");Ce("NNNN",0,0,"eraName");Ce("NNNNN",0,0,"eraNarrow");Ce("y",["y",1],"yo","eraYear");Ce("y",["yy",2],0,"eraYear");Ce("y",["yyy",3],0,"eraYear");Ce("y",["yyyy",4],0,"eraYear");le("N",IR);le("NN",IR);le("NNN",IR);le("NNNN",Oj);le("NNNNN",xj);ct(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?Pe(n).era=i:Pe(n).invalidEra=t});le("y",Yu);le("yy",Yu);le("yyy",Yu);le("yyyy",Yu);le("yo",Aj);ct(["y","yy","yyy","yyyy"],Nn);ct(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Nn]=n._locale.eraYearOrdinalParse(t,i):e[Nn]=parseInt(t,10)});function yj(t,e){var n,r,i,o=this._eras||os("en")._eras;for(n=0,r=o.length;n<r;++n){switch(typeof o[n].since){case"string":i=X(o[n].since).startOf("day"),o[n].since=i.valueOf();break}switch(typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":i=X(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf();break}}return o}function bj(t,e,n){var r,i,o=this.eras(),s,a,l;for(t=t.toUpperCase(),r=0,i=o.length;r<i;++r)if(s=o[r].name.toUpperCase(),a=o[r].abbr.toUpperCase(),l=o[r].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(a===t)return o[r];break;case"NNNN":if(s===t)return o[r];break;case"NNNNN":if(l===t)return o[r];break}else if([s,a,l].indexOf(t)>=0)return o[r]}function Sj(t,e){var n=t.since<=t.until?1:-1;return e===void 0?X(t.since).year():X(t.since).year()+(e-t.offset)*n}function Rj(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].name;return""}function Ej(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].narrow;return""}function Tj(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].abbr;return""}function _j(){var t,e,n,r,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=i[t].since<=i[t].until?1:-1,r=this.clone().startOf("day").valueOf(),i[t].since<=r&&r<=i[t].until||i[t].until<=r&&r<=i[t].since)return(this.year()-X(i[t].since).year())*n+i[t].offset;return this.year()}function Mj(t){return Qe(this,"_erasNameRegex")||PR.call(this),t?this._erasNameRegex:this._erasRegex}function Ij(t){return Qe(this,"_erasAbbrRegex")||PR.call(this),t?this._erasAbbrRegex:this._erasRegex}function Pj(t){return Qe(this,"_erasNarrowRegex")||PR.call(this),t?this._erasNarrowRegex:this._erasRegex}function IR(t,e){return e.erasAbbrRegex(t)}function Oj(t,e){return e.erasNameRegex(t)}function xj(t,e){return e.erasNarrowRegex(t)}function Aj(t,e){return e._eraYearOrdinalRegex||Yu}function PR(){var t=[],e=[],n=[],r=[],i,o,s,a,l,u=this.eras();for(i=0,o=u.length;i<o;++i)s=Zo(u[i].name),a=Zo(u[i].abbr),l=Zo(u[i].narrow),e.push(s),t.push(a),n.push(l),r.push(s),r.push(a),r.push(l);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}Ce(0,["gg",2],0,function(){return this.weekYear()%100});Ce(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Jm(t,e){Ce(0,[t,t.length],0,e)}Jm("gggg","weekYear");Jm("ggggg","weekYear");Jm("GGGG","isoWeekYear");Jm("GGGGG","isoWeekYear");le("G",qm);le("g",qm);le("GG",Tt,Pr);le("gg",Tt,Pr);le("GGGG",pR,mR);le("gggg",pR,mR);le("GGGGG",Gm,zm);le("ggggg",Gm,zm);vd(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=je(t)});vd(["gg","GG"],function(t,e,n,r){e[r]=X.parseTwoDigitYear(t)});function Hj(t){return vN.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Nj(t){return vN.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function Dj(){return Qo(this.year(),1,4)}function kj(){return Qo(this.isoWeekYear(),1,4)}function Lj(){var t=this.localeData()._week;return Qo(this.year(),t.dow,t.doy)}function $j(){var t=this.localeData()._week;return Qo(this.weekYear(),t.dow,t.doy)}function vN(t,e,n,r,i){var o;return t==null?Wh(this,r,i).year:(o=Qo(t,r,i),e>o&&(e=o),Fj.call(this,t,e,n,r,i))}function Fj(t,e,n,r,i){var o=Z1(t,e,n,r,i),s=Vh(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}Ce("Q",0,"Qo","quarter");le("Q",V1);ct("Q",function(t,e){e[jo]=(je(t)-1)*3});function Vj(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}Ce("D",["DD",2],"Do","date");le("D",Tt,Gu);le("DD",Tt,Pr);le("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});ct(["D","DD"],no);ct("Do",function(t,e){e[no]=je(t.match(Tt)[0])});var CN=qu("Date",!0);Ce("DDD",["DDDD",3],"DDDo","dayOfYear");le("DDD",Ym);le("DDDD",W1);ct(["DDD","DDDD"],function(t,e,n){n._dayOfYear=je(t)});function Wj(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}Ce("m",["mm",2],0,"minute");le("m",Tt,wR);le("mm",Tt,Pr);ct(["m","mm"],yi);var Bj=qu("Minutes",!1);Ce("s",["ss",2],0,"second");le("s",Tt,wR);le("ss",Tt,Pr);ct(["s","ss"],Uo);var jj=qu("Seconds",!1);Ce("S",0,0,function(){return~~(this.millisecond()/100)});Ce(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Ce(0,["SSS",3],0,"millisecond");Ce(0,["SSSS",4],0,function(){return this.millisecond()*10});Ce(0,["SSSSS",5],0,function(){return this.millisecond()*100});Ce(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Ce(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Ce(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Ce(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});le("S",Ym,V1);le("SS",Ym,Pr);le("SSS",Ym,W1);var ks,yN;for(ks="SSSS";ks.length<=9;ks+="S")le(ks,Yu);function Uj(t,e){e[qa]=je(("0."+t)*1e3)}for(ks="S";ks.length<=9;ks+="S")ct(ks,Uj);yN=qu("Milliseconds",!1);Ce("z",0,0,"zoneAbbr");Ce("zz",0,0,"zoneName");function zj(){return this._isUTC?"UTC":""}function Yj(){return this._isUTC?"Coordinated Universal Time":""}var Q=pd.prototype;Q.add=$B;Q.calendar=zB;Q.clone=YB;Q.diff=JB;Q.endOf=uj;Q.format=rj;Q.from=ij;Q.fromNow=oj;Q.to=sj;Q.toNow=aj;Q.get=nW;Q.invalidAt=vj;Q.isAfter=GB;Q.isBefore=qB;Q.isBetween=KB;Q.isSame=XB;Q.isSameOrAfter=ZB;Q.isSameOrBefore=QB;Q.isValid=pj;Q.lang=fN;Q.locale=dN;Q.localeData=gN;Q.max=pB;Q.min=mB;Q.parsingFlags=wj;Q.set=rW;Q.startOf=lj;Q.subtract=FB;Q.toArray=fj;Q.toObject=gj;Q.toDate=dj;Q.toISOString=tj;Q.inspect=nj;typeof Symbol<"u"&&Symbol.for!=null&&(Q[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});Q.toJSON=mj;Q.toString=ej;Q.unix=hj;Q.valueOf=cj;Q.creationData=Cj;Q.eraName=Rj;Q.eraNarrow=Ej;Q.eraAbbr=Tj;Q.eraYear=_j;Q.year=U1;Q.isLeapYear=tW;Q.weekYear=Hj;Q.isoWeekYear=Nj;Q.quarter=Q.quarters=Vj;Q.month=K1;Q.daysInMonth=dW;Q.week=Q.weeks=yW;Q.isoWeek=Q.isoWeeks=bW;Q.weeksInYear=Lj;Q.weeksInWeekYear=$j;Q.isoWeeksInYear=Dj;Q.isoWeeksInISOWeekYear=kj;Q.date=CN;Q.day=Q.days=NW;Q.weekday=DW;Q.isoWeekday=kW;Q.dayOfYear=Wj;Q.hour=Q.hours=jW;Q.minute=Q.minutes=Bj;Q.second=Q.seconds=jj;Q.millisecond=Q.milliseconds=yN;Q.utcOffset=TB;Q.utc=MB;Q.local=IB;Q.parseZone=PB;Q.hasAlignedHourOffset=OB;Q.isDST=xB;Q.isLocal=HB;Q.isUtcOffset=NB;Q.isUtc=lN;Q.isUTC=lN;Q.zoneAbbr=zj;Q.zoneName=Yj;Q.dates=Qr("dates accessor is deprecated. Use date instead.",CN);Q.months=Qr("months accessor is deprecated. Use month instead",K1);Q.years=Qr("years accessor is deprecated. Use year instead",U1);Q.zone=Qr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",_B);Q.isDSTShifted=Qr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",AB);function Gj(t){return Et(t*1e3)}function qj(){return Et.apply(null,arguments).parseZone()}function bN(t){return t}var Je=dR.prototype;Je.calendar=HV;Je.longDateFormat=LV;Je.invalidDate=FV;Je.ordinal=BV;Je.preparse=bN;Je.postformat=bN;Je.relativeTime=UV;Je.pastFuture=zV;Je.set=xV;Je.eras=yj;Je.erasParse=bj;Je.erasConvertYear=Sj;Je.erasAbbrRegex=Ij;Je.erasNameRegex=Mj;Je.erasNarrowRegex=Pj;Je.months=lW;Je.monthsShort=uW;Je.monthsParse=hW;Je.monthsRegex=gW;Je.monthsShortRegex=fW;Je.week=pW;Je.firstDayOfYear=CW;Je.firstDayOfWeek=vW;Je.weekdays=PW;Je.weekdaysMin=xW;Je.weekdaysShort=OW;Je.weekdaysParse=HW;Je.weekdaysRegex=LW;Je.weekdaysShortRegex=$W;Je.weekdaysMinRegex=FW;Je.isPM=WW;Je.meridiem=UW;function Yg(t,e,n,r){var i=os(),o=ho().set(r,e);return i[n](o,t)}function SN(t,e,n){if(es(t)&&(e=t,t=void 0),t=t||"",e!=null)return Yg(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Yg(t,r,n,"month");return i}function OR(t,e,n,r){typeof t=="boolean"?(es(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,es(e)&&(n=e,e=void 0),e=e||"");var i=os(),o=t?i._week.dow:0,s,a=[];if(n!=null)return Yg(e,(n+o)%7,r,"day");for(s=0;s<7;s++)a[s]=Yg(e,(s+o)%7,r,"day");return a}function Kj(t,e){return SN(t,e,"months")}function Xj(t,e){return SN(t,e,"monthsShort")}function Zj(t,e,n){return OR(t,e,n,"weekdays")}function Qj(t,e,n){return OR(t,e,n,"weekdaysShort")}function Jj(t,e,n){return OR(t,e,n,"weekdaysMin")}Bs("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=je(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}});X.lang=Qr("moment.lang is deprecated. Use moment.locale instead.",Bs);X.langData=Qr("moment.langData is deprecated. Use moment.localeData instead.",os);var vo=Math.abs;function eU(){var t=this._data;return this._milliseconds=vo(this._milliseconds),this._days=vo(this._days),this._months=vo(this._months),t.milliseconds=vo(t.milliseconds),t.seconds=vo(t.seconds),t.minutes=vo(t.minutes),t.hours=vo(t.hours),t.months=vo(t.months),t.years=vo(t.years),this}function RN(t,e,n,r){var i=Ii(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function tU(t,e){return RN(this,t,e,1)}function nU(t,e){return RN(this,t,e,-1)}function bP(t){return t<0?Math.floor(t):Math.ceil(t)}function rU(){var t=this._milliseconds,e=this._days,n=this._months,r=this._data,i,o,s,a,l;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=bP(Jb(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=Ur(t/1e3),r.seconds=i%60,o=Ur(i/60),r.minutes=o%60,s=Ur(o/60),r.hours=s%24,e+=Ur(s/24),l=Ur(EN(e)),n+=l,e-=bP(Jb(l)),a=Ur(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function EN(t){return t*4800/146097}function Jb(t){return t*146097/4800}function iU(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=Jr(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+EN(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Jb(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+t)}}function ss(t){return function(){return this.as(t)}}var TN=ss("ms"),oU=ss("s"),sU=ss("m"),aU=ss("h"),lU=ss("d"),uU=ss("w"),cU=ss("M"),hU=ss("Q"),dU=ss("y"),fU=TN;function gU(){return Ii(this)}function mU(t){return t=Jr(t),this.isValid()?this[t+"s"]():NaN}function vl(t){return function(){return this.isValid()?this._data[t]:NaN}}var pU=vl("milliseconds"),wU=vl("seconds"),vU=vl("minutes"),CU=vl("hours"),yU=vl("days"),bU=vl("months"),SU=vl("years");function RU(){return Ur(this.days()/7)}var Lo=Math.round,vu={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function EU(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function TU(t,e,n,r){var i=Ii(t).abs(),o=Lo(i.as("s")),s=Lo(i.as("m")),a=Lo(i.as("h")),l=Lo(i.as("d")),u=Lo(i.as("M")),c=Lo(i.as("w")),h=Lo(i.as("y")),d=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||s<=1&&["m"]||s<n.m&&["mm",s]||a<=1&&["h"]||a<n.h&&["hh",a]||l<=1&&["d"]||l<n.d&&["dd",l];return n.w!=null&&(d=d||c<=1&&["w"]||c<n.w&&["ww",c]),d=d||u<=1&&["M"]||u<n.M&&["MM",u]||h<=1&&["y"]||["yy",h],d[2]=e,d[3]=+t>0,d[4]=r,EU.apply(null,d)}function _U(t){return t===void 0?Lo:typeof t=="function"?(Lo=t,!0):!1}function MU(t,e){return vu[t]===void 0?!1:e===void 0?vu[t]:(vu[t]=e,t==="s"&&(vu.ss=e-1),!0)}function IU(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=vu,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},vu,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),o=TU(this,!n,r,i),n&&(o=i.pastFuture(+this,o)),i.postformat(o)}var vC=Math.abs;function Tl(t){return(t>0)-(t<0)||+t}function ep(){if(!this.isValid())return this.localeData().invalidDate();var t=vC(this._milliseconds)/1e3,e=vC(this._days),n=vC(this._months),r,i,o,s,a=this.asSeconds(),l,u,c,h;return a?(r=Ur(t/60),i=Ur(r/60),t%=60,r%=60,o=Ur(n/12),n%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",u=Tl(this._months)!==Tl(a)?"-":"",c=Tl(this._days)!==Tl(a)?"-":"",h=Tl(this._milliseconds)!==Tl(a)?"-":"",l+"P"+(o?u+o+"Y":"")+(n?u+n+"M":"")+(e?c+e+"D":"")+(i||r||t?"T":"")+(i?h+i+"H":"")+(r?h+r+"M":"")+(t?h+s+"S":"")):"P0D"}var qe=Qm.prototype;qe.isValid=bB;qe.abs=eU;qe.add=tU;qe.subtract=nU;qe.as=iU;qe.asMilliseconds=TN;qe.asSeconds=oU;qe.asMinutes=sU;qe.asHours=aU;qe.asDays=lU;qe.asWeeks=uU;qe.asMonths=cU;qe.asQuarters=hU;qe.asYears=dU;qe.valueOf=fU;qe._bubble=rU;qe.clone=gU;qe.get=mU;qe.milliseconds=pU;qe.seconds=wU;qe.minutes=vU;qe.hours=CU;qe.days=yU;qe.weeks=RU;qe.months=bU;qe.years=SU;qe.humanize=IU;qe.toISOString=ep;qe.toString=ep;qe.toJSON=ep;qe.locale=dN;qe.localeData=gN;qe.toIsoString=Qr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ep);qe.lang=fN;Ce("X",0,0,"unix");Ce("x",0,0,"valueOf");le("x",qm);le("X",KV);ct("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)});ct("x",function(t,e,n){n._d=new Date(je(t))});//! moment.js
11
+ X.version="2.30.1";PV(Et);X.fn=Q;X.min=wB;X.max=vB;X.now=CB;X.utc=ho;X.unix=Gj;X.months=Kj;X.isDate=md;X.locale=Bs;X.invalid=Um;X.duration=Ii;X.isMoment=Ei;X.weekdays=Zj;X.parseZone=qj;X.localeData=os;X.isDuration=bg;X.monthsShort=Xj;X.weekdaysMin=Jj;X.defineLocale=SR;X.updateLocale=qW;X.locales=KW;X.weekdaysShort=Qj;X.normalizeUnits=Jr;X.relativeTimeRounding=_U;X.relativeTimeThreshold=MU;X.calendarFormat=UB;X.prototype=Q;X.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};function PU(t){const e=t.length;let n=0;for(;n<e;)t[n]=[t[n]],n+=1}function SP(t,e){const n=e.length;let r=0;for(;r<n;)t.push(e[r]),r+=1}function Rg(t){const e=[];if(!t||t.length===0||!t[0]||t[0].length===0)return e;const n=t.length,r=t[0].length;for(let i=0;i<n;i++)for(let o=0;o<r;o++)e[o]||(e[o]=[]),e[o][i]=t[i][o];return e}function gr(t,e,n,r){let i=-1,o=t,s=n;Array.isArray(t)||(o=Array.from(t));const a=o.length;for(i+=1;i<a;)s=e(s,o[i],i,o),i+=1;return s}function rl(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,o=[];let s=-1;for(;n<i;){const a=r[n];e(a,n,r)&&(s+=1,o[s]=a),n+=1}return o}function Be(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length,o=[];let s=-1;for(;n<i;){const a=r[n];s+=1,o[s]=e(a,n,r),n+=1}return o}function I(t,e){let n=0,r=t;Array.isArray(t)||(r=Array.from(t));const i=r.length;for(;n<i&&e(r[n],n,r)!==!1;)n+=1;return t}function OU(t){const e=[];return I(t,n=>{e.indexOf(n)===-1&&e.push(n)}),e}function RP(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const[r,...i]=[...e];let o=r;return I(i,s=>{o=o.filter(a=>!s.includes(a))}),o}function EP(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:" ";return t.split(e)}function nt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return gr(t,(o,s,a)=>{const l=s.replace(/\r?\n\s*/g,""),u=n[a]?n[a]:"";return o+l+u},"").trim()}function Pt(t){let e;switch(typeof t){case"string":case"number":e=`${t}`;break;case"object":e=t===null?"":t.toString();break;case"undefined":e="";break;default:e=t.toString();break}return e}function ae(t){return typeof t<"u"}function It(t){return typeof t>"u"}function Ut(t){return t===null||t===""||It(t)}function xU(t){return Object.prototype.toString.call(t)==="[object RegExp]"}const uh="length",wh=t=>parseInt(t,16),TP=t=>parseInt(t,10),Gg=(t,e,n)=>t.substr(e,n),vh=t=>t.codePointAt(0)-65,eS=t=>`${t}`.replace(/\-/g,""),AU=t=>wh(Gg(eS(t),wh("12"),vh("F")))/(wh(Gg(eS(t),vh("B"),~~![][uh]))||9),HU=()=>typeof location<"u"&&/^([a-z0-9\-]+\.)?\x68\x61\x6E\x64\x73\x6F\x6E\x74\x61\x62\x6C\x65\x2E\x63\x6F\x6D$/i.test(location.host);let _P=!1;const MP={invalid:()=>nt`
12
+ The license key for Handsontable is invalid.\x20
13
+ If you need any help, contact us at support@handsontable.com.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return nt`
14
+ The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
15
+ version ${n}. Renew your license key at handsontable.com or downgrade to a version released prior\x20
16
+ to ${e}. If you need any help, contact us at sales@handsontable.com.`},missing:()=>nt`
17
+ The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
18
+ Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
19
+ passing the key: 'non-commercial-and-evaluation'. If you need any help, contact\x20
20
+ us at support@handsontable.com.`,non_commercial:()=>""},IP={invalid:()=>nt`
21
+ The license key for Handsontable is invalid.\x20
22
+ <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> on how to\x20
23
+ install it properly or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,expired:t=>{let{keyValidityDate:e,hotVersion:n}=t;return nt`
24
+ The license key for Handsontable expired on ${e}, and is not valid for the installed\x20
25
+ version ${n}. <a href="https://handsontable.com/pricing" target="_blank">Renew</a> your\x20
26
+ license key or downgrade to a version released prior to ${e}. If you need any\x20
27
+ help, contact us at <a href="mailto:sales@handsontable.com">sales@handsontable.com</a>.`},missing:()=>nt`
28
+ The license key for Handsontable is missing. Use your purchased key to activate the product.\x20
29
+ Alternatively, you can activate Handsontable to use for non-commercial purposes by\x20
30
+ passing the key: 'non-commercial-and-evaluation'.\x20
31
+ <a href="https://handsontable.com/docs/tutorial-license-key.html" target="_blank">Read more</a> about it in\x20
32
+ the documentation or contact us at <a href="mailto:support@handsontable.com">support@handsontable.com</a>.`,non_commercial:()=>""};function NU(t,e){const n=!Ut(t),r=typeof t=="string"&&t.toLowerCase()==="non-commercial-and-evaluation",i="15.3.0";let o,s="invalid",a="invalid";t=eS(t||"");const l=DU(t);if(n||r||l)if(l){const u=X("29/04/2025","DD/MM/YYYY"),c=Math.floor(u.toDate().getTime()/864e5),h=AU(t);o=X((h+1)*864e5,"x").format("MMMM DD, YYYY"),c>h?(s="expired",a="expired"):(s="valid",a="valid")}else r?(s="non_commercial",a="valid"):(s="invalid",a="invalid");else s="missing",a="missing";if(HU()&&(s="valid",a="valid"),!_P&&s!=="valid"&&(MP[s]({keyValidityDate:o,hotVersion:i})&&console[s==="non_commercial"?"info":"warn"](MP[s]({keyValidityDate:o,hotVersion:i})),_P=!0),a!=="valid"&&e.parentNode&&IP[a]({keyValidityDate:o,hotVersion:i})){const c=document.createElement("div");c.className="handsontable hot-display-license-info",c.innerHTML=IP[a]({keyValidityDate:o,hotVersion:i}),e.parentNode.insertBefore(c,e.nextSibling)}}function DU(t){let e=[][uh],n=e;if(t[uh]!==vh("Z"))return!1;for(let r="",i="B<H4P+".split(""),o=vh(i.shift());o;o=vh(i.shift()||"A"))--o<""[uh]?n=n|(TP(`${TP(wh(r)+(wh(Gg(t,Math.abs(o),2))+[]).padStart(2,"0"))}`)%97||2)>>1:r=Gg(t,o,o?i[uh]===1?9:8:6);return n===e}function Ti(t){return t[0].toUpperCase()+t.substr(1)}function _N(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return t()+t()+t()+t()}function MN(t){return/^([0-9][0-9]?%$)|(^100%$)/.test(t)}function IN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return`${t}`.replace(/(?:\\)?\[([^[\]]+)]/g,(n,r)=>n.charAt(0)==="\\"?n.substr(1,n.length-1):e[r]===void 0?"":e[r])}function PP(t){return xR(`${t}`,{ALLOWED_TAGS:[]})}function xR(t,e){return IV.sanitize(t,e)}const Cl=t=>["tabindex",t],kU=()=>["role","treegrid"],zo=()=>["role","presentation"],LU=()=>["role","gridcell"],$U=()=>["role","rowheader"],PN=()=>["role","rowgroup"],FU=()=>["role","columnheader"],tS=()=>["role","row"],VU=()=>["role","menu"],WU=()=>["role","menuitem"],BU=()=>["role","menuitemcheckbox"],jU=()=>["role","combobox"],ON=()=>["role","listbox"],UU=()=>["role","option"],zU=()=>["role","checkbox"],YU=()=>["scope","col"],GU=()=>["scope","row"],qU=()=>["type","text"],jh=t=>["aria-label",t],yl=()=>["aria-hidden","true"],KU=()=>["aria-disabled","true"],XU=()=>["aria-multiselectable","true"],xN=t=>["aria-haspopup",t],AN=t=>["aria-rowcount",t],tp=t=>["aria-colcount",t],HN=t=>["aria-rowindex",t],AR=t=>["aria-colindex",t],Gr=t=>["aria-expanded",t],ZU=t=>["aria-sort",t],OP=()=>["aria-readonly","true"],xP=()=>["aria-invalid","true"],NN=t=>["aria-checked",t],HR=()=>["aria-selected","true"],QU=()=>["aria-autocomplete","list"],JU=t=>["aria-controls",t],ez=t=>["aria-activedescendant",t],tz=t=>["aria-live",t],nz=t=>["aria-relevant",t],rz=t=>["aria-setsize",t],iz=t=>["aria-posinset",t];function oz(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=null,i=t;for(;i!==null;){if(n===e){r=i;break}i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:(n+=1,i=i.parentNode)}return r}function Eg(t,e){const n=t.closest(".handsontable");return!!n&&(n.parentNode===e||n===e)}function sz(t){return Object.getPrototypeOf(t.parent)&&t.frameElement}function Au(t){return sz(t)&&t.parent}function il(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;const{ELEMENT_NODE:r,DOCUMENT_FRAGMENT_NODE:i}=Node;let o=t;for(;o!=null&&o!==n;){const{nodeType:s,nodeName:a}=o;if(s===r&&(e.includes(a)||e.includes(o)))return o;const{host:l}=o;l&&s===i?o=l:o=o.parentNode}return null}function Fd(t,e,n){const r=[];let i=t;for(;i&&(i=il(i,e,n),!(!i||n&&!n.contains(i)));)r.push(i),i.host&&i.nodeType===Node.DOCUMENT_FRAGMENT_NODE?i=i.host:i=i.parentNode;const o=r.length;return o?r[o-1]:null}function az(t,e){const n={element:void 0,classNames:[]};let r=t;for(;r!==null&&r!==t.ownerDocument.documentElement&&!n.element;){if(typeof e=="string"&&r.classList.contains(e))n.element=r,n.classNames.push(e);else if(e instanceof RegExp){const i=Array.from(r.classList).filter(o=>e.test(o));i.length&&(n.element=r,n.classNames.push(...i))}r=r.parentElement}return n}function tl(t,e){let n=t.parentNode,r=[];for(typeof e=="string"?t.defaultView?r=Array.prototype.slice.call(t.querySelectorAll(e),0):r=Array.prototype.slice.call(t.ownerDocument.querySelectorAll(e),0):r.push(e);n!==null;){if(r.indexOf(n)>-1)return!0;n=n.parentNode}return!1}function lz(t){let e=0,n=t;if(n.previousSibling)for(;n=n.previousSibling;)e+=1;return e}function ra(t,e,n){const r=n.parentElement.querySelector(`.ht_clone_${t}`);return r?r.contains(e):null}function DN(t){return!t||!t.length?[]:t.filter(e=>!!e)}function kN(t,e){if(!t||!t.length)return{regexFree:[],regexes:[]};const n=[],r=[];return r.push(...t.filter(i=>{const o=i instanceof RegExp;return o&&e&&n.push(i),!o})),{regexFree:r,regexes:n}}function ve(t,e){return t.classList===void 0||typeof e!="string"||e===""?!1:t.classList.contains(e)}function q(t,e){typeof e=="string"&&(e=e.split(" ")),e=DN(e),e.length>0&&t.classList.add(...e)}function pe(t,e){typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);let{regexFree:n,regexes:r}=kN(e,!0);n=DN(n),n.length>0&&t.classList.remove(...n),r.forEach(i=>{t.classList.forEach(o=>{i.test(o)&&t.classList.remove(o)})})}function ye(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;Array.isArray(e)||(e=[[e,n]]),e.forEach(r=>{Array.isArray(r)&&r[0]!==""&&t.setAttribute(...r)})}function Ku(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];typeof e=="string"?e=e.split(" "):e instanceof RegExp&&(e=[e]);const{regexFree:n,regexes:r}=kN(e,!0);n.forEach(i=>{i!==""&&t.removeAttribute(i)}),r.forEach(i=>{t.getAttributeNames().forEach(o=>{i.test(o)&&t.removeAttribute(o)})})}function LN(t){if(t.nodeType===3)t.parentNode.removeChild(t);else if(["TABLE","THEAD","TBODY","TFOOT","TR"].indexOf(t.nodeName)>-1){const e=t.childNodes;for(let n=e.length-1;n>=0;n--)LN(e[n])}}function ts(t){let e;for(;e=t.lastChild;)t.removeChild(e)}const uz=/(<(.*)>|&(.*);)/;function Xu(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;uz.test(e)?t.innerHTML=n?xR(e):e:ol(t,e)}function ol(t,e){const n=t.firstChild;n&&n.nodeType===3&&n.nextSibling===null?n.textContent=e:(ts(t),t.appendChild(t.ownerDocument.createTextNode(e)))}function Hu(t){const e=t.ownerDocument.documentElement,n=t.ownerDocument.defaultView;let r=t;for(;r!==e;){if(r===null)return!1;if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE)if(r.host){if(r.host.impl)return Hu(r.host.impl);if(r.host)return Hu(r.host);throw new Error("Lost in Web Components world")}else return!1;else if(n.getComputedStyle(r).display==="none")return!1;r=r.parentNode}return!0}function cz(t){const n=t.ownerDocument.defaultView;let r=t;for(;r.parentNode;){if(r.style.height==="0px"||r.style.height==="0")return n.getComputedStyle(r).overflow==="hidden";r=r.parentNode}return!1}function Hn(t){const e=t.ownerDocument,n=e.defaultView,r=e.documentElement;let i=t,o,s,a;for(o=i.offsetLeft,s=i.offsetTop,a=i;(i=i.offsetParent)&&!(i===e.body||!("offsetLeft"in i));)o+=i.offsetLeft,s+=i.offsetTop,a=i;return a&&a.style.position==="fixed"&&(o+=n.pageXOffset||r.scrollLeft,s+=n.pageYOffset||r.scrollTop),{left:o,top:s}}function $N(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollY}function NR(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window).scrollX}function DR(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?$N(e):t.scrollTop}function FN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return t===e?NR(e):t.scrollLeft}function qg(t){let e=t.ownerDocument,n=e?e.defaultView:void 0;e||(e=t.document?t.document:t,n=e.defaultView);const r=["auto","scroll"];let i=t.parentNode;for(;i&&i.style&&e.body!==i;){let{overflow:o,overflowX:s,overflowY:a}=i.style;if([o,s,a].includes("scroll"))return i;if({overflow:o,overflowX:s,overflowY:a}=n.getComputedStyle(i),r.includes(o)||r.includes(s)||r.includes(a)||i.clientHeight<=i.scrollHeight+1&&(r.includes(a)||r.includes(o))||i.clientWidth<=i.scrollWidth+1&&(r.includes(s)||r.includes(o)))return i;i=i.parentNode}return n}function hz(t){return t.scrollHeight-t.clientHeight}function dz(t){return t.scrollWidth-t.clientWidth}function Uh(t){const e=t.ownerDocument,n=e.defaultView;let r=t.parentNode;for(;r&&r.style&&e.body!==r;){if(r.style.overflow!=="visible"&&r.style.overflow!=="")return r;const i=n.getComputedStyle(r),o=["scroll","hidden","auto"],s=i.getPropertyValue("overflow"),a=i.getPropertyValue("overflow-y"),l=i.getPropertyValue("overflow-x");if(o.includes(s)||o.includes(a)||o.includes(l))return r;r=r.parentNode}return n}function Kg(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window;if(t){if(t===n)return e==="width"?`${n.innerWidth}px`:e==="height"?`${n.innerHeight}px`:void 0}else return;const r=t.style[e];if(r!==""&&r!==void 0)return r;const i=n.getComputedStyle(t);if(i[e]!==""&&i[e]!==void 0)return i[e]}function qt(t){return t.offsetWidth}function rn(t){return t.offsetHeight}function Ch(t){return t.clientHeight||t.innerHeight}function VN(t){return t.clientWidth||t.innerWidth}function WN(t){return t.selectionStart?t.selectionStart:0}function fz(t){return t.selectionEnd?t.selectionEnd:0}function AP(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;t.getSelection&&(t.getSelection().empty?t.getSelection().empty():t.getSelection().removeAllRanges&&t.getSelection().removeAllRanges())}function np(t,e,n){if(n===void 0&&(n=e),t.setSelectionRange){t.focus();try{t.setSelectionRange(e,n)}catch{const i=t.parentNode,o=i.style.display;i.style.display="block",t.setSelectionRange(e,n),i.style.display=o}}}let CC;function gz(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;const e=t.createElement("div");e.style.height="200px",e.style.width="100%";const n=t.createElement("div");n.style.boxSizing="content-box",n.style.height="150px",n.style.left="0px",n.style.overflow="hidden",n.style.position="absolute",n.style.top="0px",n.style.width="200px",n.style.visibility="hidden",n.appendChild(e),(t.body||t.documentElement).appendChild(n);const r=e.offsetWidth;n.style.overflow="scroll";let i=e.offsetWidth;return r===i&&(i=n.clientWidth),(t.body||t.documentElement).removeChild(n),r-i}function yn(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return CC===void 0&&(CC=gz(t)),CC}function BN(t){return t instanceof Window?t.document.body.scrollHeight>t.innerHeight:t.offsetWidth!==t.clientWidth}function jN(t){return t instanceof Window?t.document.body.scrollWidth>t.innerWidth:t.offsetHeight!==t.clientHeight}function kR(t,e,n){t.style.transform=`translate3d(${e},${n},0)`}function rp(t){t.style.transform&&t.style.transform!==""&&(t.style.transform="")}function Tg(t){return t&&(["INPUT","SELECT","TEXTAREA"].indexOf(t.nodeName)>-1||t.contentEditable==="true")}function UN(t){return Tg(t)&&t.hasAttribute("data-hot-input")===!1}function zN(t){return!t.parentNode}function mz(t,e){new IntersectionObserver((r,i)=>{r.forEach(o=>{o.isIntersecting&&t.offsetParent!==null&&(e(),i.unobserve(t))})},{root:t.ownerDocument.body}).observe(t)}function YN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const r=t.ownerDocument,i=r.createRange(),o=r.defaultView.getSelection();ye(t,"contenteditable",!0),n&&ye(t,...yl()),e&&q(t,"invisibleSelection"),i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i)}function GN(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const n=t.ownerDocument.defaultView.getSelection();t.hasAttribute("aria-hidden")&&t.removeAttribute("aria-hidden"),n.removeAllRanges(),e&&pe(t,"invisibleSelection"),t.removeAttribute("contenteditable")}function pz(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;YN(t,n),e(),GN(t,n)}function Jo(t){var e;const n=t==null||(e=t.ownerDocument)===null||e===void 0?void 0:e.defaultView.Element;return!!(n&&n!==null&&t instanceof n)}function ot(t){return typeof t=="function"}function ip(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200,n=null,r;function i(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return n&&clearTimeout(n),n=setTimeout(()=>{r=t.apply(this,s)},e),r}return i}function qN(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return t.apply(this,n.concat(s))}}function wz(t){const e=t.length;function n(r){return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];const l=r.concat(s);let u;return l.length>=e?u=t.apply(this,l):u=n(l),u}}return n([])}function nS(t,e,n,r,i,o,s,a){return ae(a)?t.call(e,n,r,i,o,s,a):ae(s)?t.call(e,n,r,i,o,s):ae(o)?t.call(e,n,r,i,o):ae(i)?t.call(e,n,r,i):ae(r)?t.call(e,n,r):ae(n)?t.call(e,n):t.call(e)}var HP={},yC,NP;function vz(){if(NP)return yC;NP=1;var t=Xt(),e=p1(),n=ln(),r=fl(),i=jm(),o=t([].push);return yC=function(s){if(n(s))return s;if(e(s)){for(var a=s.length,l=[],u=0;u<a;u++){var c=s[u];typeof c=="string"?o(l,c):(typeof c=="number"||r(c)==="Number"||r(c)==="String")&&o(l,i(c))}var h=l.length,d=!0;return function(f,m){if(d)return d=!1,m;if(e(this))return m;for(var C=0;C<h;C++)if(l[C]===f)return m}}},yC}var DP;function Cz(){if(DP)return HP;DP=1;var t=dt(),e=Wu(),n=dd(),r=an(),i=Xt(),o=sn(),s=ln(),a=KS(),l=lR(),u=vz(),c=qS(),h=String,d=e("JSON","stringify"),f=i(/./.exec),m=i("".charAt),C=i("".charCodeAt),y=i("".replace),E=i(1.1.toString),v=/[\uD800-\uDFFF]/g,_=/^[\uD800-\uDBFF]$/,A=/^[\uDC00-\uDFFF]$/,L=!c||o(function(){var U=e("Symbol")("stringify detection");return d([U])!=="[null]"||d({a:U})!=="{}"||d(Object(U))!=="{}"}),T=o(function(){return d("\uDF06\uD834")!=='"\\udf06\\ud834"'||d("\uDEAD")!=='"\\udead"'}),P=function(U,W){var Z=l(arguments),J=u(W);if(!(!s(J)&&(U===void 0||a(U))))return Z[1]=function(se,te){if(s(J)&&(te=r(J,this,h(se),te)),!a(te))return te},n(d,null,Z)},Y=function(U,W,Z){var J=m(Z,W-1),se=m(Z,W+1);return f(_,U)&&!f(A,se)||f(A,U)&&!f(_,J)?"\\u"+E(C(U,0),16):U};return d&&t({target:"JSON",stat:!0,arity:3,forced:L||T},{stringify:function(W,Z,J){var se=l(arguments),te=n(L?P:d,null,se);return T&&typeof te=="string"?y(te,v,Y):te}}),HP}Cz();function zh(t){let e;return Array.isArray(t)?e=t.length?new Array(t.length).fill(null):[]:(e={},He(t,(n,r)=>{r!=="__children"&&(n&&typeof n=="object"&&!Array.isArray(n)?e[r]=zh(n):Array.isArray(n)?n.length&&typeof n[0]=="object"&&!Array.isArray(n[0])?e[r]=[zh(n[0])]:e[r]=[]:e[r]=null)})),e}function yz(t,e){return e.prototype.constructor=e,t.prototype=new e,t.prototype.constructor=t,t}function on(t,e,n){const r=Array.isArray(n);return He(e,(i,o)=>{(r===!1||n.includes(o))&&(t[o]=i)}),t}function op(t,e){He(e,(n,r)=>{e[r]&&typeof e[r]=="object"?(t[r]||(Array.isArray(e[r])?t[r]=[]:Object.prototype.toString.call(e[r])==="[object Date]"?t[r]=e[r]:t[r]={}),op(t[r],e[r])):t[r]=e[r]})}function Gn(t){return typeof t=="object"?JSON.parse(JSON.stringify(t)):t}function lo(t){const e={};return He(t,(n,r)=>{e[r]=n}),e}function ut(t){t.MIXINS||(t.MIXINS=[]);for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return I(n,i=>{t.MIXINS.push(i.MIXIN_NAME),He(i,(o,s)=>{if(t.prototype[s]!==void 0)throw new Error(`Mixin conflict. Property '${s}' already exist and cannot be overwritten.`);if(typeof o=="function")t.prototype[s]=o;else{const a=function(c,h){const d=`_${c}`,f=m=>{let C=m;return(Array.isArray(C)||Ae(C))&&(C=Gn(C)),C};return function(){return this[d]===void 0&&(this[d]=f(h)),this[d]}},l=function(c){const h=`_${c}`;return function(d){this[h]=d}};Object.defineProperty(t.prototype,s,{get:a(s,o),set:l(s),configurable:!0})}})}),t}function LR(t,e){return JSON.stringify(t)===JSON.stringify(e)}function Ae(t){return Object.prototype.toString.call(t)==="[object Object]"}function as(t,e,n,r){r.value=n,r.writable=r.writable!==!1,r.enumerable=r.enumerable!==!1,r.configurable=r.configurable!==!1,Object.defineProperty(t,e,r)}function He(t,e){for(const n in t)if((!t.hasOwnProperty||t.hasOwnProperty&&Object.prototype.hasOwnProperty.call(t,n))&&e(t[n],n,t)===!1)break;return t}function bz(t,e){const n=e.split(".");let r=t;return He(n,i=>{if(r=r[i],r===void 0)return r=void 0,!1}),r}function bC(t,e,n){if(typeof e!="string")return;const r=e.split(".");let i=t;r.forEach((o,s)=>{o==="__proto__"||o==="constructor"||o==="prototype"||(s!==r.length-1?(nn(i,o)||(i[o]={}),i=i[o]):i[o]=n)})}function $R(t){if(!Ae(t))return 0;const e=function(n){let r=0;return Ae(n)?He(n,(i,o)=>{o!=="__children"&&(r+=e(i))}):r+=1,r};return e(t)}function Ir(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"value";const n=`_${e}`,r={_touched:!1,[n]:t,isTouched(){return this._touched}};return Object.defineProperty(r,e,{get(){return this[n]},set(i){this._touched=!0,this[n]=i},enumerable:!0,configurable:!0}),r}function nn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Xg(t){return window.requestAnimationFrame(t)}function Zg(t){window.cancelAnimationFrame(t)}function KN(){return"ontouchstart"in window}function Sz(){return typeof window<"u"}let _l;function Rz(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return _l||(typeof Intl=="object"?_l=new Intl.Collator(t,e).compare:typeof String.prototype.localeCompare=="function"?_l=(n,r)=>`${n}`.localeCompare(r):_l=(n,r)=>n===r?0:n>r?-1:1,_l)}const Fr=t=>{const e={value:!1};return e.test=(n,r)=>{e.value=t(n,r)},e},Zs={chrome:Fr((t,e)=>/Chrome/.test(t)&&/Google/.test(e)),chromeWebKit:Fr(t=>/CriOS/.test(t)),edge:Fr(t=>/Edge/.test(t)),edgeWebKit:Fr(t=>/EdgiOS/.test(t)),firefox:Fr(t=>/Firefox/.test(t)),firefoxWebKit:Fr(t=>/FxiOS/.test(t)),mobile:Fr(t=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t)),safari:Fr((t,e)=>/Safari/.test(t)&&/Apple Computer/.test(e))},Cd={mac:Fr(t=>/^Mac/.test(t)),win:Fr(t=>/^Win/.test(t)),linux:Fr(t=>/^Linux/.test(t)),ios:Fr(t=>/iPhone|iPad|iPod/i.test(t))};function Ez(){let{userAgent:t=navigator.userAgent,vendor:e=navigator.vendor}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};He(Zs,n=>{let{test:r}=n;return void r(t,e)})}function Tz(){let{platform:t=navigator.platform}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};He(Cd,e=>{let{test:n}=e;return void n(t)})}Sz()&&(Ez(),Tz());function XN(){return Zs.chrome.value}function _z(){return Zs.chromeWebKit.value}function SC(){return Zs.firefox.value}function Mz(){return Zs.firefoxWebKit.value}function Qg(){return Zs.safari.value}function Iz(){return Zs.edge.value}function Yo(){return Zs.mobile.value}function ZN(){return Cd.ios.value}function QN(){let{maxTouchPoints:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator;return t>2&&Cd.mac.value}function kP(){return Cd.win.value}function LP(){return Cd.mac.value}const me={ALT:18,ARROW_DOWN:40,ARROW_LEFT:37,ARROW_RIGHT:39,ARROW_UP:38,AUDIO_DOWN:SC()?182:174,AUDIO_MUTE:SC()?181:173,AUDIO_UP:SC()?183:175,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND_LEFT:91,COMMAND_RIGHT:93,COMMAND_FIREFOX:224,CONTROL:17,DELETE:46,END:35,ENTER:13,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,HOME:36,INSERT:45,MEDIA_NEXT:176,MEDIA_PLAY_PAUSE:179,MEDIA_PREV:177,MEDIA_STOP:178,NULL:0,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PERIOD:190,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,A:65,C:67,D:68,F:70,L:76,O:79,P:80,S:83,V:86,X:88,Y:89,Z:90},Pz=[me.ALT,me.ARROW_DOWN,me.ARROW_LEFT,me.ARROW_RIGHT,me.ARROW_UP,me.AUDIO_DOWN,me.AUDIO_MUTE,me.AUDIO_UP,me.BACKSPACE,me.CAPS_LOCK,me.DELETE,me.END,me.ENTER,me.ESCAPE,me.F1,me.F2,me.F3,me.F4,me.F5,me.F6,me.F7,me.F8,me.F9,me.F10,me.F11,me.F12,me.F13,me.F14,me.F15,me.F16,me.F17,me.F18,me.F19,me.HOME,me.INSERT,me.MEDIA_NEXT,me.MEDIA_PLAY_PAUSE,me.MEDIA_PREV,me.MEDIA_STOP,me.NULL,me.NUM_LOCK,me.PAGE_DOWN,me.PAGE_UP,me.PAUSE,me.SCROLL_LOCK,me.SHIFT,me.TAB];function Oz(t){return t===32||t>=48&&t<=57||t>=96&&t<=111||t>=186&&t<=192||t>=219&&t<=222||t>=226||t>=65&&t<=90}function JN(t){return Pz.includes(t)}function xz(t){return[me.CONTROL,me.COMMAND_LEFT,me.COMMAND_RIGHT,me.COMMAND_FIREFOX].includes(t)}function yd(t,e){const n=e.split("|");let r=!1;return I(n,i=>{if(t===me[i])return r=!0,!1}),r}function Pi(t){t.isImmediatePropagationEnabled=!1,t.cancelBubble=!0}function za(t){return t.isImmediatePropagationEnabled===!1}function sl(t){return t.button===2}function FR(t){return t.button===0}function Az(t){return t instanceof TouchEvent}function Hz(t,e){const n={x:t.offsetX,y:t.offsetY};let r=t.target;if(!Jo(e)||r!==e&&r.contains(e))return n;for(;r!==e;)n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;return n}function Ze(){ae(console)&&console.warn(...arguments)}function VR(){ae(console)&&console.error(...arguments)}const Ya=["afterCellMetaReset","afterChange","afterContextMenuDefaultOptions","beforeContextMenuSetItems","afterDropdownMenuDefaultOptions","beforeDropdownMenuSetItems","afterContextMenuHide","beforeContextMenuShow","afterContextMenuShow","afterCopyLimit","beforeCreateCol","afterColumnSequenceChange","afterCreateCol","beforeCreateRow","afterCreateRow","afterDeselect","afterDestroy","afterDocumentKeyDown","afterDrawSelection","beforeRemoveCellClassNames","beforeCompositionStart","afterGetCellMeta","afterGetColHeader","afterGetRowHeader","afterInit","afterLoadData","afterUpdateData","afterMomentumScroll","afterOnCellCornerMouseDown","afterOnCellCornerDblClick","afterOnCellMouseDown","afterOnCellMouseUp","afterOnCellContextMenu","afterOnCellMouseOver","afterOnCellMouseOut","afterRemoveCol","afterRemoveRow","beforeRenderer","afterRenderer","afterRowSequenceChange","beforeViewportScrollVertically","beforeViewportScrollHorizontally","beforeViewportScroll","afterScrollHorizontally","afterScrollVertically","afterScroll","afterSelection","afterSelectionByProp","afterSelectionEnd","afterSelectionEndByProp","afterSelectionFocusSet","beforeSelectColumns","afterSelectColumns","beforeSelectRows","afterSelectRows","afterSetCellMeta","afterRemoveCellMeta","afterSetDataAtCell","afterSetDataAtRowProp","afterSetSourceDataAtCell","afterSetTheme","afterUpdateSettings","afterValidate","beforeLanguageChange","afterLanguageChange","beforeAutofill","afterAutofill","beforeCellAlignment","beforeChange","beforeChangeRender","beforeDrawBorders","beforeGetCellMeta","beforeRemoveCellMeta","beforeInit","beforeInitWalkontable","beforeLoadData","beforeUpdateData","beforeKeyDown","beforeOnCellMouseDown","beforeOnCellMouseUp","beforeOnCellContextMenu","beforeOnCellMouseOver","beforeOnCellMouseOut","beforeRemoveCol","beforeRemoveRow","beforeViewRender","afterViewRender","beforeRender","afterRender","beforeRowWrap","beforeColumnWrap","beforeSetCellMeta","beforeSelectionFocusSet","beforeSetRangeStartOnly","beforeSetRangeStart","beforeSetRangeEnd","beforeSelectionHighlightSet","beforeTouchScroll","beforeValidate","beforeValueRender","construct","init","modifyColHeader","modifyColWidth","modifyFiltersMultiSelectValue","modifyFocusedElement","modifyRowHeader","modifyRowHeight","modifyRowHeightByOverlayName","modifyData","modifySourceData","modifyRowData","modifyGetCellCoords","modifyGetCoordsElement","modifyFocusOnTabNavigation","beforeHighlightingRowHeader","beforeHighlightingColumnHeader","persistentStateLoad","persistentStateReset","persistentStateSave","beforeColumnSort","afterColumnSort","modifyAutofillRange","modifyCopyableRange","beforeCut","afterCut","beforeCopy","afterCopy","beforePaste","afterPaste","beforeColumnFreeze","afterColumnFreeze","beforeColumnMove","afterColumnMove","beforeColumnUnfreeze","afterColumnUnfreeze","beforeRowMove","afterRowMove","beforeColumnResize","afterColumnResize","beforeRowResize","afterRowResize","afterGetColumnHeaderRenderers","afterGetRowHeaderRenderers","beforeStretchingColumnWidth","beforeFilter","afterFilter","afterFormulasValuesUpdate","afterNamedExpressionAdded","afterNamedExpressionRemoved","afterSheetAdded","afterSheetRenamed","afterSheetRemoved","modifyColumnHeaderHeight","modifyColumnHeaderValue","beforeUndo","beforeUndoStackChange","afterUndo","afterUndoStackChange","beforeRedo","beforeRedoStackChange","afterRedo","afterRedoStackChange","modifyRowHeaderWidth","modifyTransformFocus","modifyTransformStart","modifyTransformEnd","afterModifyTransformFocus","afterModifyTransformStart","afterModifyTransformEnd","afterViewportRowCalculatorOverride","afterViewportColumnCalculatorOverride","afterPluginsInitialized","beforeHideRows","afterHideRows","beforeUnhideRows","afterUnhideRows","beforeHideColumns","afterHideColumns","beforeUnhideColumns","afterUnhideColumns","beforeTrimRow","afterTrimRow","beforeUntrimRow","afterUntrimRow","beforeDropdownMenuShow","afterDropdownMenuShow","afterDropdownMenuHide","beforeAddChild","afterAddChild","beforeDetachChild","afterDetachChild","beforeBeginEditing","afterBeginEditing","beforeMergeCells","afterMergeCells","beforeUnmergeCells","afterUnmergeCells","afterListen","afterUnlisten","afterRefreshDimensions","beforeRefreshDimensions","beforeColumnCollapse","afterColumnCollapse","beforeColumnExpand","afterColumnExpand","modifyAutoColumnSizeSeed"],RC=new Map([["modifyRow","8.0.0"],["modifyCol","8.0.0"],["unmodifyRow","8.0.0"],["unmodifyCol","8.0.0"],["skipLengthCache","8.0.0"],["hiddenColumn","8.0.0"],["hiddenRow","8.0.0"]]),EC=new Map([[]]);var $P={},TC,FP;function Nz(){if(FP)return TC;FP=1;var t=Uu();return TC=function(e,n,r){for(var i=0,o=arguments.length>2?r:t(n),s=new e(o);o>i;)s[i]=n[i++];return s},TC}var _C,VP;function Dz(){if(VP)return _C;VP=1;var t=Kt();return _C=function(e,n){var r=t[e],i=r&&r.prototype;return i&&i[n]},_C}var MC,WP;function sp(){if(WP)return MC;WP=1;var t=Mi(),e=oR(),n=Ks().f,r=t("unscopables"),i=Array.prototype;return i[r]===void 0&&n(i,r,{configurable:!0,value:e(null)}),MC=function(o){i[r][o]=!0},MC}var BP;function kz(){if(BP)return $P;BP=1;var t=dt(),e=Xt(),n=dr(),r=ld(),i=Nz(),o=Dz(),s=sp(),a=Array,l=e(o("Array","sort"));return t({target:"Array",proto:!0},{toSorted:function(c){c!==void 0&&n(c);var h=r(this),d=i(a,h);return l(d,c)}}),s("toSorted"),$P}kz();var jP={},UP={},zP;function Lz(){if(zP)return UP;zP=1;var t=dt(),e=an(),n=zu(),r=dr(),i=un(),o=co(),s=fr(),a=Xs(),l=a("find",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{find:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return n(h,function(f,m){if(c(f,d++))return m(f)},{IS_RECORD:!0,INTERRUPTED:!0}).result}}),UP}var YP;function $z(){return YP||(YP=1,Lz()),jP}$z();function Fz(t,e){eD(t,e),e.add(t)}function IC(t,e,n){eD(t,e),e.set(t,n)}function eD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function GP(t,e,n){return t.set(Jg(t,e),n),n}function Sn(t,e){return t.get(Jg(t,e))}function Jg(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Vz=100;var Cr=new WeakMap,cu=new WeakMap,PC=new WeakMap,OC=new WeakSet;class qP{constructor(){Fz(this,OC),IC(this,Cr,new Map),IC(this,cu,new Map),IC(this,PC,new Set),Ya.forEach(e=>Jg(OC,this,KP).call(this,e))}getHooks(e){var n;return(n=Sn(Cr,this).get(e))!==null&&n!==void 0?n:[]}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Sn(Cr,this).has(e)||(Jg(OC,this,KP).call(this,e),Ya.push(e));const i=Sn(Cr,this).get(e);if(i.find(u=>u.callback===n))return;const o=Number.isInteger(r.orderIndex)?r.orderIndex:0,s=!!r.runOnce,a=!!r.initialHook;let l=!1;if(a){const u=i.find(c=>c.initialHook);u&&(u.callback=n,l=!0)}if(!l){i.push({callback:n,orderIndex:o,runOnce:s,initialHook:a,skip:!1});let u=Sn(PC,this).has(e);!u&&o!==0&&(u=!0,Sn(PC,this).add(e)),u&&i.length>1&&Sn(Cr,this).set(e,i.toSorted((c,h)=>c.orderIndex-h.orderIndex))}}has(e){return Sn(Cr,this).has(e)&&Sn(Cr,this).get(e).length>0}remove(e,n){if(!Sn(Cr,this).has(e))return!1;const r=Sn(Cr,this).get(e),i=r.find(o=>o.callback===n);if(i){let o=Sn(cu,this).get(e);return i.skip=!0,o+=1,o>Vz&&(Sn(Cr,this).set(e,r.filter(s=>!s.skip)),o=0),Sn(cu,this).set(e,o),!0}return!1}destroy(){Sn(Cr,this).clear(),Sn(cu,this).clear(),GP(Cr,this,null),GP(cu,this,null)}}function KP(t){Sn(Cr,this).set(t,[]),Sn(cu,this).set(t,0)}function Wz(t,e,n){return(e=Bz(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bz(t){var e=jz(t,"string");return typeof e=="symbol"?e:e+""}function jz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Uz=nt`The plugin hook "[hookName]" was removed in Handsontable [removedInVersion].\x20
33
+ Please consult release notes https://github.com/handsontable/handsontable/releases/tag/[removedInVersion] to\x20
34
+ learn about the migration path.`;class re{constructor(){Wz(this,"globalBucket",new qP)}static getSingleton(){return Yz()}getBucket(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return e?(e.pluginHookBucket||(e.pluginHookBucket=new qP),e.pluginHookBucket):this.globalBucket}add(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(n)?I(n,o=>this.add(e,o,r)):(RC.has(e)&&Ze(IN(Uz,{hookName:e,removedInVersion:RC.get(e)})),EC.has(e)&&Ze(EC.get(e)),this.getBucket(r).add(e,n,{orderIndex:i,runOnce:!1})),this}once(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;return Array.isArray(n)?I(n,o=>this.once(e,o,r)):this.getBucket(r).add(e,n,{orderIndex:i,runOnce:!0}),this}addAsFixed(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return Array.isArray(n)?I(n,i=>this.addAsFixed(e,i,r)):this.getBucket(r).add(e,n,{initialHook:!0}),this}remove(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return this.getBucket(r).remove(e,n)}has(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.getBucket(n).has(e)}run(e,n,r,i,o,s,a,l){{const u=this.getBucket().getHooks(n),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=nS(u[h].callback,e,r,i,o,s,a,l);d!==void 0&&(r=d),u[h]&&u[h].runOnce&&this.remove(n,u[h].callback),h+=1}}{const u=this.getBucket(e).getHooks(n),c=u?u.length:0;let h=0;if(c)for(;h<c;){if(!u[h]||u[h].skip){h+=1;continue}const d=nS(u[h].callback,e,r,i,o,s,a,l);d!==void 0&&(r=d),u[h]&&u[h].runOnce&&this.remove(n,u[h].callback,e),h+=1}}return r}destroy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.getBucket(e).destroy()}register(e){this.isRegistered(e)||Ya.push(e)}deregister(e){this.isRegistered(e)&&Ya.splice(Ya.indexOf(e),1)}isDeprecated(e){return EC.has(e)||RC.has(e)}isRegistered(e){return Ya.indexOf(e)>=0}getRegistered(){return Ya}}const zz=new re;function Yz(){return zz}const xC=new Map;function Oi(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"common";xC.has(t)||xC.set(t,new Map);const e=xC.get(t);function n(a,l){e.set(a,l)}function r(a){return e.get(a)}function i(a){return e.has(a)}function o(){return[...e.keys()]}function s(){return[...e.values()]}return{register:n,getItem:r,hasItem:i,getNames:o,getValues:s}}const rS=new WeakMap,{register:Gz,getItem:tD,hasItem:nD,getNames:xle,getValues:Ale}=Oi("editors");function qz(t){const e={},n=t;this.getConstructor=function(){return t},this.getInstance=function(r){return r.guid in e||(e[r.guid]=new n(r)),e[r.guid]},re.getSingleton().add("afterDestroy",function(){e[this.guid]=null})}function rD(t,e){let n;if(typeof t=="function")rS.get(t)||br(null,t),n=rS.get(t);else if(typeof t=="string")n=tD(t);else throw Error('Only strings and functions can be passed as "editor" parameter');if(!n)throw Error(`No editor registered under name "${t}"`);return n.getInstance(e)}function iS(t){if(typeof t=="function")return t;if(!nD(t))throw Error(`No registered editor found under "${t}" name`);return tD(t).getConstructor()}function br(t,e){t&&typeof t!="string"&&(e=t,t=e.EDITOR_TYPE);const n=new qz(e);typeof t=="string"&&Gz(t,n),rS.set(e,n)}function Kz(t,e,n){return(e=Xz(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xz(t){var e=Zz(t,"string");return typeof e=="symbol"?e:e+""}function Zz(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _i{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;Kz(this,"context",void 0),this.context=e||this,this.context.eventListeners||(this.context.eventListeners=[])}addEventListener(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;function o(s){r.call(this,Qz(s))}return this.context.eventListeners.push({element:e,event:n,callback:r,callbackProxy:o,options:i,eventManager:this}),e.addEventListener(n,o,i),()=>{this.removeEventListener(e,n,r)}}removeEventListener(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=this.context.eventListeners.length,s;for(;o;)if(o-=1,s=this.context.eventListeners[o],s.event===n&&s.element===e){if(r&&r!==s.callback||i&&s.eventManager!==this)continue;this.context.eventListeners.splice(o,1),s.element.removeEventListener(s.event,s.callbackProxy,s.options)}}clearEvents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.context)return;let n=this.context.eventListeners.length;for(;n;){n-=1;const r=this.context.eventListeners[n];e&&r.eventManager!==this||(this.context.eventListeners.splice(n,1),r.element.removeEventListener(r.event,r.callbackProxy,r.options))}}clear(){this.clearEvents()}destroy(){this.clearEvents(),this.context=null}destroyWithOwnEventsOnly(){this.clearEvents(!0),this.context=null}fireEvent(e,n){let r=e.document,i=e;r||(r=e.ownerDocument?e.ownerDocument:e,i=r.defaultView);const o={bubbles:!0,cancelable:n!=="mousemove",view:i,detail:0,screenX:0,screenY:0,clientX:1,clientY:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0};let s;r.createEvent?(s=r.createEvent("MouseEvents"),s.initMouseEvent(n,o.bubbles,o.cancelable,o.view,o.detail,o.screenX,o.screenY,o.clientX,o.clientY,o.ctrlKey,o.altKey,o.shiftKey,o.metaKey,o.button,r.body.parentNode)):s=r.createEventObject(),e.dispatchEvent?e.dispatchEvent(s):e.fireEvent(`on${n}`,s)}}function Qz(t){const e=t.stopImmediatePropagation;return t.stopImmediatePropagation=function(){e.apply(this),Pi(this)},t}function Jz(t,e){eY(t,e),e.add(t)}function eY(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ia(t,e,n){return(e=tY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tY(t){var e=nY(t,"string");return typeof e=="symbol"?e:e+""}function nY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AC(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Vd=new WeakSet;class oS{constructor(e,n,r){Jz(this,Vd),ia(this,"hot",void 0),ia(this,"tableMeta",void 0),ia(this,"selection",void 0),ia(this,"eventManager",void 0),ia(this,"destroyed",!1),ia(this,"activeEditor",void 0),ia(this,"cellProperties",void 0),this.hot=e,this.tableMeta=n,this.selection=r,this.eventManager=new _i(e),this.hot.addHook("afterDocumentKeyDown",i=>AC(Vd,this,XP).call(this,i)),this.hot.addHook("beforeCompositionStart",i=>AC(Vd,this,XP).call(this,i)),this.hot.view._wt.update("onCellDblClick",(i,o,s)=>AC(Vd,this,rY).call(this,i,o,s))}getActiveEditor(){return this.activeEditor}prepareEditor(){var e;if(this.activeEditor&&this.activeEditor.isWaiting()){this.closeEditor(!1,!1,u=>{u&&this.prepareEditor()});return}const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||n.isHeader())return;const{row:r,col:i}=n,o=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta");let s=r,a=i;if(Array.isArray(o)&&([s,a]=o),this.cellProperties=this.hot.getCellMeta(s,a),!this.isCellEditable()){this.clearActiveEditor();return}const l=this.hot.getCell(r,i,!0);if(l){const u=this.hot.getCellEditor(this.cellProperties),c=this.hot.colToProp(a),h=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s),a);this.activeEditor=rD(u,this.hot),this.activeEditor.prepare(r,i,c,l,h,this.cellProperties)}}isEditorOpened(){return this.activeEditor&&this.activeEditor.isOpened()}openEditor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(!this.isCellEditable()){this.clearActiveEditor();return}const i=this.hot.getSelectedRangeLast();let o=this.hot.runHooks("beforeBeginEditing",i.highlight.row,i.highlight.col,e,n,r);if(n instanceof MouseEvent&&typeof o!="boolean"&&(o=this.hot.selection.getLayerLevel()===0&&i.isSingle()),o===!1){this.clearActiveEditor();return}this.activeEditor||(this.hot.scrollToFocusedCell(),this.prepareEditor()),this.activeEditor&&(r&&this.activeEditor.enableFullEditMode(),this.activeEditor.beginEditing(e,n))}closeEditor(e,n,r){this.activeEditor?this.activeEditor.finishEditing(e,n,r):r&&r(!1)}closeEditorAndSaveChanges(e){this.closeEditor(!1,e)}closeEditorAndRestoreOriginalValue(e){this.closeEditor(!0,e)}clearActiveEditor(){this.activeEditor=void 0}isCellEditable(){const e=this.hot.getSelectedRangeLast();if(!e)return!1;const n=this.hot.getCellEditor(this.cellProperties),{row:r,col:i}=e.highlight,{rowIndexMapper:o,columnIndexMapper:s}=this.hot,a=o.isHidden(this.hot.toPhysicalRow(r))||s.isHidden(this.hot.toPhysicalColumn(i));return!(this.cellProperties.readOnly||!n||a)}moveSelectionAfterEnter(e){const n={...typeof this.tableMeta.enterMoves=="function"?this.tableMeta.enterMoves(e):this.tableMeta.enterMoves};e.shiftKey&&(n.row=-n.row,n.col=-n.col),this.hot.selection.isMultiple()?this.selection.transformFocus(n.row,n.col):this.selection.transformStart(n.row,n.col,!0)}destroy(){this.destroyed=!0,this.eventManager.destroy()}}function XP(t){const e=this.hot.getSelectedRangeLast();if(!this.hot.isListening()||!e||e.highlight.isHeader()||za(t))return;const{keyCode:n}=t,r=(t.ctrlKey||t.metaKey)&&!t.altKey;(!this.activeEditor||this.activeEditor&&!this.activeEditor.isWaiting())&&!JN(n)&&!xz(n)&&!r&&!this.isEditorOpened()&&this.openEditor("",t)}function rY(t,e){e.isCell()&&this.openEditor(null,t,!0)}const ZP=new WeakMap;oS.getInstance=function(t,e,n){let r=ZP.get(t);return r||(r=new oS(t,e,n),ZP.set(t,r)),r};function iY(t,e){iD(t,e),e.add(t)}function fc(t,e,n){iD(t,e),e.set(t,n)}function iD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(t,e){return t.get(Wo(t,e))}function gc(t,e,n){return t.set(Wo(t,e),n),n}function Wo(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Mu=Object.freeze({CELL:"cell",MIXED:"mixed"});var tn=new WeakMap,Wd=new WeakMap,Bd=new WeakMap,jd=new WeakMap,Ud=new WeakMap,Ms=new WeakSet;class oY{constructor(e){var n=this;iY(this,Ms),fc(this,tn,void 0),fc(this,Wd,void 0),fc(this,Bd,1),fc(this,jd,null),fc(this,Ud,new Map);const r=e.getSettings();gc(tn,this,e),gc(Wd,this,r.imeFastEdit?Mu.MIXED:Mu.CELL),gt(tn,this).addHook("afterUpdateSettings",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Wo(Ms,n,aY).call(n,...o)}),gt(tn,this).addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Wo(Ms,n,QP).call(n,...o)}),gt(tn,this).addHook("afterSelectionFocusSet",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Wo(Ms,n,QP).call(n,...o)}),gt(tn,this).addHook("afterSelectionEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Wo(Ms,n,sY).call(n,...o)})}getFocusMode(){return gt(Wd,this)}setFocusMode(e){Object.values(Mu).includes(e)?gc(Wd,this,e):Ze(`"${e}" is not a valid focus mode.`)}getRefocusDelay(){return gt(Bd,this)}setRefocusDelay(e){gc(Bd,this,e)}setRefocusElementGetter(e){gc(jd,this,e)}getRefocusElement(){var e;return typeof gt(jd,this)=="function"?gt(jd,this).call(this):(e=gt(tn,this).getActiveEditor())===null||e===void 0?void 0:e.TEXTAREA}focusOnHighlightedCell(e){const n=r=>{var i,o;const s=(i=gt(tn,this).getSelectedRangeLast())===null||i===void 0?void 0:i.highlight;if(!s)return;let a=gt(tn,this).runHooks("modifyFocusedElement",s.row,s.col,r);Jo(a)||(a=r),a&&!((o=gt(tn,this).getActiveEditor())!==null&&o!==void 0&&o.isOpened())&&a.focus({preventScroll:!0})};e?n(e):Wo(Ms,this,WR).call(this,r=>n(r))}refocusToEditorTextarea(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gt(Bd,this);if(gt(tn,this).getSettings().imeFastEdit&&!((e=gt(tn,this).getActiveEditor())!==null&&e!==void 0&&e.isOpened())){var r,i;(r=gt(tn,this).getActiveEditor())===null||r===void 0||(i=r.refreshValue)===null||i===void 0||i.call(r),gt(Ud,this).has(n)||gt(Ud,this).set(n,ip(()=>{if(!gt(tn,this).isDestroyed){var o;(o=this.getRefocusElement())===null||o===void 0||o.select()}},n)),gt(Ud,this).get(n)()}}}function WR(t){var e;const n=(e=gt(tn,this).getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;if(!n||!gt(tn,this).selection.isCellVisible(n)){t(null);return}const r=gt(tn,this).getCell(n.row,n.col,!0);r===null?gt(tn,this).addHookOnce("afterScroll",()=>{t(gt(tn,this).getCell(n.row,n.col,!0))}):t(r)}function QP(){Wo(Ms,this,WR).call(this,t=>{const{activeElement:e}=gt(tn,this).rootDocument;e&&UN(e)&&e.blur(),this.focusOnHighlightedCell(t)})}function sY(){Wo(Ms,this,WR).call(this,t=>{this.getFocusMode()===Mu.MIXED&&(t==null?void 0:t.nodeName)==="TD"&&this.refocusToEditorTextarea()})}function aY(t){typeof t.imeFastEdit=="boolean"&&this.setFocusMode(t.imeFastEdit?Mu.MIXED:Mu.CELL)}var JP={},HC,eO;function lY(){if(eO)return HC;eO=1;var t=Xr(),e=fl(),n=Mi(),r=n("match");return HC=function(i){var o;return t(i)&&((o=i[r])!==void 0?!!o:e(i)==="RegExp")},HC}var NC,tO;function uY(){if(tO)return NC;tO=1;var t=Kt(),e=sn(),n=t.RegExp,r=!e(function(){var i=!0;try{n(".","d")}catch{i=!1}var o={},s="",a=i?"dgimsy":"gimsy",l=function(d,f){Object.defineProperty(o,d,{get:function(){return s+=f,!0}})},u={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};i&&(u.hasIndices="d");for(var c in u)l(c,u[c]);var h=Object.getOwnPropertyDescriptor(n.prototype,"flags").get.call(o);return h!==a||s!==a});return NC={correct:r},NC}var DC,nO;function cY(){if(nO)return DC;nO=1;var t=un();return DC=function(){var e=t(this),n="";return e.hasIndices&&(n+="d"),e.global&&(n+="g"),e.ignoreCase&&(n+="i"),e.multiline&&(n+="m"),e.dotAll&&(n+="s"),e.unicode&&(n+="u"),e.unicodeSets&&(n+="v"),e.sticky&&(n+="y"),n},DC}var kC,rO;function hY(){if(rO)return kC;rO=1;var t=an(),e=Zr(),n=ud(),r=uY(),i=cY(),o=RegExp.prototype;return kC=r.correct?function(s){return s.flags}:function(s){return!r.correct&&n(o,s)&&!e(s,"flags")?t(i,s):s.flags},kC}var LC,iO;function dY(){if(iO)return LC;iO=1;var t=Xt(),e=Bu(),n=Math.floor,r=t("".charAt),i=t("".replace),o=t("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;return LC=function(l,u,c,h,d,f){var m=c+l.length,C=h.length,y=a;return d!==void 0&&(d=e(d),y=s),i(f,y,function(E,v){var _;switch(r(v,0)){case"$":return"$";case"&":return l;case"`":return o(u,0,c);case"'":return o(u,m);case"<":_=d[o(v,1,-1)];break;default:var A=+v;if(A===0)return E;if(A>C){var L=n(A/10);return L===0?E:L<=C?h[L-1]===void 0?r(v,1):h[L-1]+r(v,1):E}_=h[A-1]}return _===void 0?"":_})},LC}var oO;function fY(){if(oO)return JP;oO=1;var t=dt(),e=an(),n=Xt(),r=ad(),i=ln(),o=Xr(),s=lY(),a=jm(),l=cd(),u=hY(),c=dY(),h=Mi(),d=qs(),f=h("replace"),m=TypeError,C=n("".indexOf),y=n("".replace),E=n("".slice),v=Math.max;return t({target:"String",proto:!0},{replaceAll:function(A,L){var T=r(this),P,Y,U,W,Z,J,se,te,ue,pt,be=0,ke="";if(o(A)){if(P=s(A),P&&(Y=a(r(u(A))),!~C(Y,"g")))throw new m("`.replaceAll` does not allow non-global regexes");if(U=l(A,f),U)return e(U,A,T,L);if(d&&P)return y(a(T),A,L)}for(W=a(T),Z=a(A),J=i(L),J||(L=a(L)),se=Z.length,te=v(1,se),ue=C(W,Z);ue!==-1;)pt=J?a(L(Z,ue,W)):c(Z,W,ue,[],void 0,L),ke+=E(W,be,ue)+pt,be=ue+se,ue=ue+te>W.length?-1:C(W,Z,ue+te);return be<W.length&&(ke+=E(W,be)),ke}}),JP}fY();var sO={},aO={},lO;function gY(){if(lO)return aO;lO=1;var t=dt(),e=zu(),n=dr(),r=un(),i=co(),o=fr(),s=Xs(),a=dd(),l=sn(),u=TypeError,c=l(function(){[].keys().reduce(function(){},void 0)}),h=!c&&s("reduce",u);return t({target:"Iterator",proto:!0,real:!0,forced:c||h},{reduce:function(f){r(this);try{n(f)}catch(v){o(this,"throw",v)}var m=arguments.length<2,C=m?void 0:arguments[1];if(h)return a(h,this,m?[f]:[f,C]);var y=i(this),E=0;if(e(y,function(v){m?(m=!1,C=v):C=f(C,v,E),E++},{IS_RECORD:!0}),m)throw new u("Reduce of empty iterator with no initial value");return C}}),aO}var uO;function mY(){return uO||(uO=1,gY()),sO}mY();const oD={"&nbsp;":" ","&amp;":"&","&lt;":"<","&gt;":">"},pY=new RegExp(Object.keys(oD).map(t=>`(${t})`).join("|"),"gi");function wY(t){return(t&&t.nodeName||"")==="TABLE"}function cO(t){const e=t.hasColHeaders(),n=t.hasRowHeaders(),r=[e?-1:0,n?-1:0,t.countRows()-1,t.countCols()-1],i=t.getData(...r),o=i.length,s=o>0?i[0].length:0,a=["<table>","</table>"],l=e?["<thead>","</thead>"]:[],u=["<tbody>","</tbody>"],c=n?1:0,h=e?1:0;for(let d=0;d<o;d+=1){const f=e&&d===0,m=[];for(let y=0;y<s;y+=1){const E=!f&&n&&y===0;let v="";if(f)v=`<th>${t.getColHeader(y-c)}</th>`;else if(E)v=`<th>${t.getRowHeader(d-h)}</th>`;else{const _=i[d][y],{hidden:A,rowspan:L,colspan:T}=t.getCellMeta(d-h,y-c);if(!A){const P=[];if(L&&P.push(`rowspan="${L}"`),T&&P.push(`colspan="${T}"`),Ut(_))v=`<td ${P.join(" ")}></td>`;else{const Y=_.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
35
+ `).replace(/\x20/gi,"&nbsp;").replace(/\t/gi,"&#9;");v=`<td ${P.join(" ")}>${Y}</td>`}}}m.push(v)}const C=["<tr>",...m,"</tr>"].join("");f?l.splice(1,0,C):u.splice(-1,0,C)}return a.splice(1,0,l.join(""),u.join("")),a.join("")}function hO(t){const e=t.length,n=["<table>"];for(let r=0;r<e;r+=1){const i=t[r],o=i.length,s=[];r===0&&n.push("<tbody>");for(let a=0;a<o;a+=1){const l=i[a],u=Ut(l)?"":l.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,`<br>\r
36
+ `).replace(/\x20{2,}/gi,c=>`<span style="mso-spacerun: yes">${"&nbsp;".repeat(c.length-1)} </span>`).replace(/\t/gi,"&#9;");s.push(`<td>${u}</td>`)}n.push("<tr>",...s,"</tr>"),r+1===e&&n.push("</tbody>")}return n.push("</table>"),n.join("")}function vY(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;const n={},r=e.createDocumentFragment(),i=e.createElement("div");r.appendChild(i);let o=t;if(typeof o=="string"){const _=o.replace(/<td\b[^>]*?>([\s\S]*?)<\/\s*td>/g,A=>{const L=A.match(/<td\b[^>]*?>/g)[0],T=/<p.*?>/g,P=A.substring(L.length,A.lastIndexOf("<")).trim().replaceAll(/\n\s+/g," ").replaceAll(T,`
37
+ `).replace(`
38
+ `,"").replaceAll(/<\/(.*)>\s+$/mg,"</$1>").replace(/(<(?!br)([^>]+)>)/gi,"").replaceAll(/^&nbsp;$/mg,"");return`${L}${P}</td>`});i.insertAdjacentHTML("afterbegin",`${_}`),o=i.querySelector("table")}if(!o||!wY(o))return;const s=i.querySelector('meta[name$="enerator"]'),a=o.querySelector("tbody th")!==null,l=o.querySelector("tr"),u=l?Array.from(l.cells).reduce((_,A)=>_+A.colSpan,0)-(a?1:0):0,c=o.tFoot&&Array.from(o.tFoot.rows)||[],h=[];let d=!1,f=0,m=0;if(o.tHead){const _=Array.from(o.tHead.rows).filter(A=>{const L=A.querySelector("td")!==null;return L&&h.push(A),!L});f=_.length,d=f>0,f>1?n.nestedHeaders=Array.from(_).reduce((A,L)=>{const T=Array.from(L.cells).reduce((P,Y,U)=>{if(a&&U===0)return P;const{colSpan:W,innerHTML:Z}=Y,J=W>1?{label:Z,colspan:W}:Z;return P.push(J),P},[]);return A.push(T),A},[]):d&&(n.colHeaders=Array.from(_[0].children).reduce((A,L,T)=>(a&&T===0||A.push(L.innerHTML),A),[]))}h.length&&(n.fixedRowsTop=h.length),c.length&&(n.fixedRowsBottom=c.length);const C=[...h,...Array.from(o.tBodies).reduce((_,A)=>(_.push(...Array.from(A.rows)),_),[]),...c];m=C.length;const y=new Array(m);for(let _=0;_<m;_++)y[_]=new Array(u);const E=[],v=[];for(let _=0;_<m;_++){const A=C[_],L=Array.from(A.cells),T=L.length;for(let P=0;P<T;P++){const Y=L[P],{nodeName:U,innerHTML:W,rowSpan:Z,colSpan:J}=Y,se=y[_].findIndex(te=>te===void 0);if(U==="TD"){if(Z>1||J>1){for(let be=_;be<_+Z;be++)if(be<m)for(let ke=se;ke<se+J;ke++)y[be][ke]=null;const ue=Y.getAttribute("style");ue&&ue.includes("mso-ignore:colspan")||E.push({col:se,row:_,rowspan:Z,colspan:J})}let te="";s&&/excel/gi.test(s.content)?te=W.replace(/[\r\n][\x20]{0,2}/g," ").replace(/<br(\s*|\/)>[\r\n]?[\x20]{0,3}/gim,`\r
39
+ `):te=W.replace(/<br(\s*|\/)>[\r\n]?/gim,`\r
40
+ `),y[_][se]=te.replace(pY,ue=>oD[ue])}else v.push(W)}}return E.length&&(n.mergeCells=E),v.length&&(n.rowHeaders=v),y.length&&(n.data=y),n}function Un(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=typeof t;if(n==="number")return!isNaN(t)&&isFinite(t);if(n==="string"){if(t.length===0)return!1;if(t.length===1)return/\d/.test(t);const r=Array.from(new Set([".",...e])).map(i=>`\\${i}`).join("|");return new RegExp(`^[+-]?(((${r})?\\d+((${r})\\d+)?(e[+-]?\\d+)?)|(0x[a-f\\d]+))$`,"i").test(t.trim())}else if(n==="object")return!!t&&typeof t.valueOf()=="number"&&!(t instanceof Date);return!1}function CY(t){return Un(t,[","])}function de(t,e,n){let r=-1;for(typeof e=="function"?(n=e,e=t):r=t-1;++r<=e&&n(r)!==!1;);}function dO(t,e,n){let r=t+1;for(typeof e=="function"&&(n=e,e=0);--r>=e&&n(r)!==!1;);}function sD(t,e){return e=parseInt(e.toString().replace("%",""),10),e=isNaN(e)?0:e,parseInt(t*e/100,10)}function Ue(t,e,n){return Math.min(t,e)===t?e:Math.max(t,n)===t?n:t}const sS="asc",yY="desc",fO=new Map([[sS,[-1,1]],[yY,[1,-1]]]),bY=t=>`The priority '${t}' is already declared in a map.`,SY=t=>`The priority '${t}' is not a number.`;function RY(){let{errorPriorityExists:t,errorPriorityNaN:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=new Map;t=ot(t)?t:bY,e=ot(e)?e:SY;function r(o,s){if(!Un(o))throw new Error(e(o));if(n.has(o))throw new Error(t(o));n.set(o,s)}function i(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:sS;const[s,a]=fO.get(o)||fO.get(sS);return[...n].sort((l,u)=>l[0]<u[0]?s:a).map(l=>l[1])}return{addItem:r,getItems:i}}const EY=t=>`The id '${t}' is already declared in a map.`;function ap(){let{errorIdExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Map;t=ot(t)?t:EY;function n(u,c){if(l(u))throw new Error(t(u));e.set(u,c)}function r(u){return e.delete(u)}function i(){e.clear()}function o(u){const[c]=a().find(h=>{let[d,f]=h;return u===f?d:!1})||[null];return c}function s(u){return e.get(u)}function a(){return[...e]}function l(u){return e.has(u)}return{addItem:n,clear:i,getId:o,getItem:s,getItems:a,hasItem:l,removeItem:r}}const TY=t=>`'${t}' value is already declared in a unique set.`;function _Y(){let{errorItemExists:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=new Set;t=ot(t)?t:TY;function n(o){if(e.has(o))throw new Error(t(o));e.add(o)}function r(){return[...e]}function i(){e.clear()}return{addItem:n,clear:i,getItems:r}}const BR=t=>`There is already registered "${t}" plugin.`,MY=t=>`There is already registered plugin on priority "${t}".`,IY=t=>`The priority "${t}" is not a number.`,aD=RY({errorPriorityExists:MY,errorPriorityNaN:IY}),lD=_Y({errorItemExists:BR}),aS=ap({errorIdExists:BR});function uD(){return[...aD.getItems(),...lD.getItems()]}function jR(t){const e=Ti(t);return aS.getItem(e)}function PY(t){return!!jR(t)}function ze(t,e,n){[t,e,n]=xY(t,e,n),jR(t)===void 0&&OY(t,e,n)}function OY(t,e,n){const r=Ti(t);if(aS.hasItem(r))throw new Error(BR(r));n===void 0?lD.addItem(r):aD.addItem(n,r),aS.addItem(r,e)}function xY(t,e,n){return typeof t=="function"&&(e=t,t=e.PLUGIN_KEY,n=e.PLUGIN_PRIORITY),[t,e,n]}const{register:AY,getItem:HY,hasItem:cD,getNames:Hle,getValues:Nle}=Oi("renderers");function lS(t){if(typeof t=="function")return t;if(!cD(t))throw Error(`No registered renderer found under "${t}" name`);return HY(t)}function Lr(t,e){typeof t!="string"&&(e=t,t=e.RENDERER_TYPE),AY(t,e)}const{register:NY,getItem:DY,hasItem:hD,getNames:Dle,getValues:kle}=Oi("validators");function kY(t){if(typeof t=="function")return t;if(!hD(t))throw Error(`No registered validator found under "${t}" name`);return DY(t)}function hu(t,e){typeof t!="string"&&(e=t,t=e.VALIDATOR_TYPE),NY(t,e)}var gO={},mO;function LY(){if(mO)return gO;mO=1;var t=dt(),e=Bu(),n=Uu(),r=hd(),i=sp();return t({target:"Array",proto:!0},{at:function(s){var a=e(this),l=n(a),u=r(s),c=u>=0?u:l+u;return c<0||c>=l?void 0:a[c]}}),i("at"),gO}LY();var pO={},wO;function $Y(){if(wO)return pO;wO=1;var t=dt(),e=Xt(),n=ad(),r=hd(),i=jm(),o=sn(),s=e("".charAt),a=o(function(){return"𠮷".at(-2)!=="\uD842"});return t({target:"String",proto:!0,forced:a},{at:function(u){var c=i(n(this)),h=c.length,d=r(u),f=d>=0?d:h+d;return f<0||f>=h?void 0:s(c,f)}}),pO}$Y();function mc(t,e,n){return(e=FY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function FY(t){var e=VY(t,"string");return typeof e=="symbol"?e:e+""}function VY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class WY{constructor(){mc(this,"count",0),mc(this,"startColumn",null),mc(this,"endColumn",null),mc(this,"startPosition",null),mc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:o,columnWidth:s}=n,a=i>0?o+1:o;r>=i&&r+s<=i+a&&((this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e)}finalize(e){var n;const{scrollOffset:r,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const m=u[this.endColumn]+c-u[this.startColumn-1];if(m<=i&&(this.startColumn-=1),m>=i)break}this.startPosition=(n=u[this.startColumn])!==null&&n!==void 0?n:null;const h=s>0?i+1:i,d=r+i-h,f=this.startColumn===null?0:e.getColumnWidth(this.startColumn);d<-1*o||r>u.at(-1)||-1*r-i>-1*f?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function pc(t,e,n){return(e=BY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function BY(t){var e=jY(t,"string");return typeof e=="symbol"?e:e+""}function jY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class UY{constructor(){pc(this,"count",0),pc(this,"startRow",null),pc(this,"endRow",null),pc(this,"startPosition",null),pc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHeight:o,rowHeight:s}=n;r>=i&&r+s<=o&&(this.startRow===null&&(this.startRow=e),this.endRow=e)}finalize(e){var n;const{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const d=l[this.endRow]+u-l[this.startRow-1];if(d<=i-o&&(this.startRow-=1),d>=i-o)break}this.startPosition=(n=l[this.startRow])!==null&&n!==void 0?n:null;const c=r+i-o,h=this.startRow===null?0:e.getRowHeight(this.startRow);c<h||r>l.at(-1)?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function wc(t,e,n){return(e=zY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zY(t){var e=YY(t,"string");return typeof e=="symbol"?e:e+""}function YY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dD{constructor(){wc(this,"count",0),wc(this,"startColumn",null),wc(this,"endColumn",null),wc(this,"startPosition",null),wc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedWidth:r,zeroBasedScrollOffset:i,viewportWidth:o}=n;r<=i&&(this.startColumn=e);const s=i>0?o+1:o;r>=i&&r<=i+s&&(this.startColumn===null||this.startColumn===void 0)&&(this.startColumn=e),this.endColumn=e}finalize(e){var n;const{scrollOffset:r,viewportWidth:i,inlineStartOffset:o,zeroBasedScrollOffset:s,totalColumns:a,needReverse:l,startPositions:u,columnWidth:c}=e;if(this.endColumn===a-1&&l)for(this.startColumn=this.endColumn;this.startColumn>0;){const f=u[this.endColumn]+c-u[this.startColumn-1];if(this.startColumn-=1,f>i)break}this.startPosition=(n=u[this.startColumn])!==null&&n!==void 0?n:null;const h=s>0?i+1:i;r+i-h<-1*o||r>u.at(-1)+c||-1*r-i>0?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,a<this.endColumn&&(this.endColumn=a-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function vc(t,e,n){return(e=GY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GY(t){var e=qY(t,"string");return typeof e=="symbol"?e:e+""}function qY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class fD{constructor(){vc(this,"count",0),vc(this,"startRow",null),vc(this,"endRow",null),vc(this,"startPosition",null),vc(this,"isVisibleInTrimmingContainer",!1)}initialize(){}process(e,n){const{totalCalculatedHeight:r,zeroBasedScrollOffset:i,innerViewportHeight:o}=n;r<=i&&(this.startRow=e),r>=i&&r<=o&&this.startRow===null&&(this.startRow=e),this.endRow=e}finalize(e){var n;const{scrollOffset:r,viewportHeight:i,horizontalScrollbarHeight:o,totalRows:s,needReverse:a,startPositions:l,rowHeight:u}=e;if(this.endRow===s-1&&a)for(this.startRow=this.endRow;this.startRow>0;){const h=l[this.endRow]+u-l[this.startRow-1];if(this.startRow-=1,h>=i-o)break}this.startPosition=(n=l[this.startRow])!==null&&n!==void 0?n:null,r+i-o<0||r>l.at(-1)+u?this.isVisibleInTrimmingContainer=!1:this.isVisibleInTrimmingContainer=!0,s<this.endRow&&(this.endRow=s-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function Cc(t,e,n){return(e=KY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KY(t){var e=XY(t,"string");return typeof e=="symbol"?e:e+""}function XY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ZY{constructor(){Cc(this,"count",0),Cc(this,"startColumn",0),Cc(this,"endColumn",0),Cc(this,"startPosition",0),Cc(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalColumns:n}=e;this.count=n,this.endColumn=this.count-1}process(){}finalize(){}}function yc(t,e,n){return(e=QY(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function QY(t){var e=JY(t,"string");return typeof e=="symbol"?e:e+""}function JY(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class eG{constructor(){yc(this,"count",0),yc(this,"startRow",0),yc(this,"endRow",0),yc(this,"startPosition",0),yc(this,"isVisibleInTrimmingContainer",!0)}initialize(e){let{totalRows:n}=e;this.count=n,this.endRow=this.count-1}process(){}finalize(){}}function vO(t,e,n){return(e=tG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tG(t){var e=nG(t,"string");return typeof e=="symbol"?e:e+""}function nG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class rG extends dD{constructor(){super(...arguments),vO(this,"columnStartOffset",0),vO(this,"columnEndOffset",0)}finalize(e){var n;super.finalize(e);const{overrideFn:r,totalColumns:i,startPositions:o}=e;if(this.startColumn!==null&&typeof r=="function"){const s=this.startColumn,a=this.endColumn;r(this),this.columnStartOffset=s-this.startColumn,this.columnEndOffset=this.endColumn-a}this.startColumn<0&&(this.startColumn=0),this.startPosition=(n=o[this.startColumn])!==null&&n!==void 0?n:null,i<this.endColumn&&(this.endColumn=i-1),this.startColumn!==null&&(this.count=this.endColumn-this.startColumn+1)}}function CO(t,e,n){return(e=iG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iG(t){var e=oG(t,"string");return typeof e=="symbol"?e:e+""}function oG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sG extends fD{constructor(){super(...arguments),CO(this,"rowStartOffset",0),CO(this,"rowEndOffset",0)}finalize(e){var n;super.finalize(e);const{overrideFn:r,totalRows:i,startPositions:o}=e;if(this.startRow!==null&&typeof r=="function"){const s=this.startRow,a=this.endRow;r(this),this.rowStartOffset=s-this.startRow,this.rowEndOffset=this.endRow-a}this.startRow<0&&(this.startRow=0),this.startPosition=(n=o[this.startRow])!==null&&n!==void 0?n:null,i<this.endRow&&(this.endRow=i-1),this.startRow!==null&&(this.count=this.endRow-this.startRow+1)}}function yO(t,e,n){return(e=aG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aG(t){var e=lG(t,"string");return typeof e=="symbol"?e:e+""}function lG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gD{constructor(e){yO(this,"calculationTypes",[]),yO(this,"calculationResults",new Map),this.calculationTypes=e}_initialize(e){this.calculationTypes.forEach(n=>{let[r,i]=n;this.calculationResults.set(r,i),i.initialize(e)})}_process(e,n){this.calculationTypes.forEach(r=>{let[,i]=r;return i.process(e,n)})}_finalize(e){this.calculationTypes.forEach(n=>{let[,r]=n;return r.finalize(e)})}getResultsFor(e){return this.calculationResults.get(e)}}function ni(t,e,n){return(e=uG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function uG(t){var e=cG(t,"string");return typeof e=="symbol"?e:e+""}function cG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Nu=50;class hG extends gD{constructor(e){let{calculationTypes:n,viewportWidth:r,scrollOffset:i,totalColumns:o,columnWidthFn:s,overrideFn:a,inlineStartOffset:l}=e;super(n),ni(this,"viewportWidth",0),ni(this,"scrollOffset",0),ni(this,"zeroBasedScrollOffset",0),ni(this,"totalColumns",0),ni(this,"columnWidthFn",null),ni(this,"columnWidth",0),ni(this,"overrideFn",null),ni(this,"inlineStartOffset",0),ni(this,"totalCalculatedWidth",0),ni(this,"startPositions",[]),ni(this,"needReverse",!0),this.viewportWidth=r,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalColumns=o,this.columnWidthFn=s,this.overrideFn=a,this.inlineStartOffset=l,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalColumns;e++)if(this.columnWidth=this.getColumnWidth(e),this._process(e,this),this.startPositions.push(this.totalCalculatedWidth),this.totalCalculatedWidth+=this.columnWidth,this.totalCalculatedWidth>=this.zeroBasedScrollOffset+this.viewportWidth){this.needReverse=!1;break}this._finalize(this)}getColumnWidth(e){const n=this.columnWidthFn(e);return isNaN(n)?Nu:n}}function Ar(t,e,n){return(e=dG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dG(t){var e=fG(t,"string");return typeof e=="symbol"?e:e+""}function fG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gG extends gD{constructor(e){let{calculationTypes:n,viewportHeight:r,scrollOffset:i,totalRows:o,defaultRowHeight:s,rowHeightFn:a,overrideFn:l,horizontalScrollbarHeight:u}=e;super(n),Ar(this,"viewportHeight",0),Ar(this,"scrollOffset",0),Ar(this,"zeroBasedScrollOffset",0),Ar(this,"totalRows",0),Ar(this,"rowHeightFn",null),Ar(this,"rowHeight",0),Ar(this,"overrideFn",null),Ar(this,"horizontalScrollbarHeight",0),Ar(this,"innerViewportHeight",0),Ar(this,"totalCalculatedHeight",0),Ar(this,"startPositions",[]),Ar(this,"needReverse",!0),this.defaultHeight=s,this.viewportHeight=r,this.scrollOffset=i,this.zeroBasedScrollOffset=Math.max(i,0),this.totalRows=o,this.rowHeightFn=a,this.overrideFn=l,this.horizontalScrollbarHeight=u??0,this.innerViewportHeight=this.zeroBasedScrollOffset+this.viewportHeight-this.horizontalScrollbarHeight,this.calculate()}calculate(){this._initialize(this);for(let e=0;e<this.totalRows;e++)if(this.rowHeight=this.getRowHeight(e),this._process(e,this),this.startPositions.push(this.totalCalculatedHeight),this.totalCalculatedHeight+=this.rowHeight,this.totalCalculatedHeight>=this.innerViewportHeight){this.needReverse=!1;break}this._finalize(this)}getRowHeight(e){const n=this.rowHeightFn(e);return isNaN(n)?this.defaultHeight:n}}function mG(t,e,n){pG(t,e),e.set(t,n)}function pG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function bO(t,e,n){return(e=wG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wG(t){var e=vG(t,"string");return typeof e=="symbol"?e:e+""}function vG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ml(t,e){return t.get(mD(t,e))}function SO(t,e,n){return t.set(mD(t,e),n),n}function mD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Co=new WeakMap;class al{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;bO(this,"row",null),bO(this,"col",null),mG(this,Co,!1),SO(Co,this,r),typeof e<"u"&&typeof n<"u"&&(this.row=e,this.col=n)}isValid(e){const{countRows:n,countCols:r,countRowHeaders:i,countColHeaders:o}={countRows:0,countCols:0,countRowHeaders:0,countColHeaders:0,...e};return!(!Number.isInteger(this.row)||!Number.isInteger(this.col)||this.row<-o||this.col<-i||this.row>=n||this.col>=r)}isEqual(e){return e===this?!0:this.row===e.row&&this.col===e.col}isHeader(){return!this.isCell()}isCell(){return this.row>=0&&this.col>=0}isRtl(){return Ml(Co,this)}isSouthEastOf(e){return this.row>=e.row&&(Ml(Co,this)?this.col<=e.col:this.col>=e.col)}isNorthWestOf(e){return this.row<=e.row&&(Ml(Co,this)?this.col>=e.col:this.col<=e.col)}isSouthWestOf(e){return this.row>=e.row&&(Ml(Co,this)?this.col>=e.col:this.col<=e.col)}isNorthEastOf(e){return this.row<=e.row&&(Ml(Co,this)?this.col<=e.col:this.col>=e.col)}normalize(){return this.row=this.row===null?this.row:Math.max(this.row,0),this.col=this.col===null?this.col:Math.max(this.col,0),this}assign(e){return Number.isInteger(e==null?void 0:e.row)&&(this.row=e.row),Number.isInteger(e==null?void 0:e.col)&&(this.col=e.col),e instanceof al&&SO(Co,this,e.isRtl()),this}clone(){return new al(this.row,this.col,Ml(Co,this))}toObject(){return{row:this.row,col:this.col}}}function CG(t,e,n){yG(t,e),e.set(t,n)}function yG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $C(t,e,n){return(e=bG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bG(t){var e=SG(t,"string");return typeof e=="symbol"?e:e+""}function SG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hr(t,e){return t.get(pD(t,e))}function RG(t,e,n){return t.set(pD(t,e),n),n}function pD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Xn=new WeakMap;class bd{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;$C(this,"highlight",null),$C(this,"from",null),$C(this,"to",null),CG(this,Xn,!1),this.highlight=e.clone(),this.from=n.clone(),this.to=r.clone(),RG(Xn,this,i)}setHighlight(e){return this.highlight=e.clone(),this}setFrom(e){return this.from=e.clone(),this}setTo(e){return this.to=e.clone(),this}normalize(){return this.highlight.normalize(),this.from.normalize(),this.to.normalize(),this}isValid(e){return this.from.isValid(e)&&this.to.isValid(e)}isSingle(){return this.isSingleCell()||this.isSingleHeader()}isSingleCell(){return this.from.row>=0&&this.from.row===this.to.row&&this.from.col>=0&&this.from.col===this.to.col}isSingleHeader(){return(this.from.row<0||this.from.col<0)&&this.from.row===this.to.row&&this.from.col===this.to.col}isHeader(){return this.from.isHeader()&&this.to.isHeader()?!0:this.from.col<0&&this.to.col<0||this.from.row<0&&this.to.row<0}containsHeaders(){return this.from.isHeader()||this.to.isHeader()}getOuterHeight(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1}getOuterWidth(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1}getHeight(){if(this.from.row<0&&this.to.row<0)return 0;const e=Math.max(this.from.row,0),n=Math.max(this.to.row,0);return Math.max(e,n)-Math.min(e,n)+1}getWidth(){if(this.from.col<0&&this.to.col<0)return 0;const e=Math.max(this.from.col,0),n=Math.max(this.to.col,0);return Math.max(e,n)-Math.min(e,n)+1}getCellsCount(){return this.getWidth()*this.getHeight()}includes(e){const{row:n,col:r}=e,i=this.getOuterTopStartCorner(),o=this.getOuterBottomEndCorner();return i.row<=n&&o.row>=n&&i.col<=r&&o.col>=r}includesRange(e){return this.includes(e.getOuterTopStartCorner())&&this.includes(e.getOuterBottomEndCorner())}isEqual(e){return Math.min(this.from.row,this.to.row)===Math.min(e.from.row,e.to.row)&&Math.max(this.from.row,this.to.row)===Math.max(e.from.row,e.to.row)&&Math.min(this.from.col,this.to.col)===Math.min(e.from.col,e.to.col)&&Math.max(this.from.col,this.to.col)===Math.max(e.from.col,e.to.col)}overlaps(e){return e.isSouthEastOf(this.getOuterTopLeftCorner())&&e.isNorthWestOf(this.getOuterBottomRightCorner())}isSouthEastOf(e){return this.getOuterTopLeftCorner().isSouthEastOf(e)||this.getOuterBottomRightCorner().isSouthEastOf(e)}isNorthWestOf(e){return this.getOuterTopLeftCorner().isNorthWestOf(e)||this.getOuterBottomRightCorner().isNorthWestOf(e)}isOverlappingHorizontally(e){return this.getOuterTopEndCorner().col>=e.getOuterTopStartCorner().col&&this.getOuterTopEndCorner().col<=e.getOuterTopEndCorner().col||this.getOuterTopStartCorner().col<=e.getOuterTopEndCorner().col&&this.getOuterTopStartCorner().col>=e.getOuterTopStartCorner().col}isOverlappingVertically(e){return this.getOuterBottomStartCorner().row>=e.getOuterTopRightCorner().row&&this.getOuterBottomStartCorner().row<=e.getOuterBottomStartCorner().row||this.getOuterTopEndCorner().row<=e.getOuterBottomStartCorner().row&&this.getOuterTopEndCorner().row>=e.getOuterTopRightCorner().row}expand(e){const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();return e.row<n.row||e.col<n.col||e.row>r.row||e.col>r.col?(this.from=this._createCellCoords(Math.min(n.row,e.row),Math.min(n.col,e.col)),this.to=this._createCellCoords(Math.max(r.row,e.row),Math.max(r.col,e.col)),!0):!1}expandByRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(this.includesRange(e)||!this.overlaps(e))return!1;const r=this.getOuterTopStartCorner(),i=this.getOuterBottomEndCorner(),o=this.getDirection(),s=e.getOuterTopStartCorner(),a=e.getOuterBottomEndCorner(),l=Math.min(r.row,s.row),u=Math.min(r.col,s.col),c=Math.max(i.row,a.row),h=Math.max(i.col,a.col),d=this._createCellCoords(l,u),f=this._createCellCoords(c,h);return this.from=d,this.to=f,this.setDirection(o),n&&(this.highlight.row===this.getOuterBottomRightCorner().row&&this.getVerticalDirection()==="N-S"&&this.flipDirectionVertically(),this.highlight.col===this.getOuterTopRightCorner().col&&this.getHorizontalDirection()==="W-E"&&this.flipDirectionHorizontally()),!0}getDirection(){if(this.from.isNorthWestOf(this.to))return"NW-SE";if(this.from.isNorthEastOf(this.to))return"NE-SW";if(this.from.isSouthEastOf(this.to))return"SE-NW";if(this.from.isSouthWestOf(this.to))return"SW-NE"}setDirection(e){switch(e){case"NW-SE":[this.from,this.to]=[this.getOuterTopLeftCorner(),this.getOuterBottomRightCorner()];break;case"NE-SW":[this.from,this.to]=[this.getOuterTopRightCorner(),this.getOuterBottomLeftCorner()];break;case"SE-NW":[this.from,this.to]=[this.getOuterBottomRightCorner(),this.getOuterTopLeftCorner()];break;case"SW-NE":[this.from,this.to]=[this.getOuterBottomLeftCorner(),this.getOuterTopRightCorner()];break}}getVerticalDirection(){return["NE-SW","NW-SE"].indexOf(this.getDirection())>-1?"N-S":"S-N"}getHorizontalDirection(){return["NW-SE","SW-NE"].indexOf(this.getDirection())>-1?"W-E":"E-W"}flipDirectionVertically(){switch(this.getDirection()){case"NW-SE":this.setDirection("SW-NE");break;case"NE-SW":this.setDirection("SE-NW");break;case"SE-NW":this.setDirection("NE-SW");break;case"SW-NE":this.setDirection("NW-SE");break}}flipDirectionHorizontally(){switch(this.getDirection()){case"NW-SE":this.setDirection("NE-SW");break;case"NE-SW":this.setDirection("NW-SE");break;case"SE-NW":this.setDirection("SW-NE");break;case"SW-NE":this.setDirection("SE-NW");break}}getTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getTopLeftCorner(){return Hr(Xn,this)?this.getTopEndCorner():this.getTopStartCorner()}getBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getBottomRightCorner(){return Hr(Xn,this)?this.getBottomStartCorner():this.getBottomEndCorner()}getTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col)).normalize()}getTopRightCorner(){return Hr(Xn,this)?this.getTopStartCorner():this.getTopEndCorner()}getBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col)).normalize()}getBottomLeftCorner(){return Hr(Xn,this)?this.getBottomEndCorner():this.getBottomStartCorner()}getOuterTopStartCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterTopLeftCorner(){return Hr(Xn,this)?this.getOuterTopEndCorner():this.getOuterTopStartCorner()}getOuterBottomEndCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterBottomRightCorner(){return Hr(Xn,this)?this.getOuterBottomStartCorner():this.getOuterBottomEndCorner()}getOuterTopEndCorner(){return this._createCellCoords(Math.min(this.from.row,this.to.row),Math.max(this.from.col,this.to.col))}getOuterTopRightCorner(){return Hr(Xn,this)?this.getOuterTopStartCorner():this.getOuterTopEndCorner()}getOuterBottomStartCorner(){return this._createCellCoords(Math.max(this.from.row,this.to.row),Math.min(this.from.col,this.to.col))}getOuterBottomLeftCorner(){return Hr(Xn,this)?this.getOuterBottomEndCorner():this.getOuterBottomStartCorner()}isCorner(e){return e.isEqual(this.getOuterTopLeftCorner())||e.isEqual(this.getOuterTopRightCorner())||e.isEqual(this.getOuterBottomLeftCorner())||e.isEqual(this.getOuterBottomRightCorner())}getOppositeCorner(e){if(!(e instanceof al))return!1;if(e.isEqual(this.getOuterBottomEndCorner()))return this.getOuterTopStartCorner();if(e.isEqual(this.getOuterTopStartCorner()))return this.getOuterBottomEndCorner();if(e.isEqual(this.getOuterTopEndCorner()))return this.getOuterBottomStartCorner();if(e.isEqual(this.getOuterBottomStartCorner()))return this.getOuterTopEndCorner()}getBordersSharedWith(e){if(!this.includesRange(e))return[];const n={top:Math.min(this.from.row,this.to.row),bottom:Math.max(this.from.row,this.to.row),left:Math.min(this.from.col,this.to.col),right:Math.max(this.from.col,this.to.col)},r={top:Math.min(e.from.row,e.to.row),bottom:Math.max(e.from.row,e.to.row),left:Math.min(e.from.col,e.to.col),right:Math.max(e.from.col,e.to.col)},i=[];return n.top===r.top&&i.push("top"),n.right===r.right&&i.push(Hr(Xn,this)?"left":"right"),n.bottom===r.bottom&&i.push("bottom"),n.left===r.left&&i.push(Hr(Xn,this)?"right":"left"),i}getInner(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),r=[];for(let i=e.row;i<=n.row;i++)for(let o=e.col;o<=n.col;o++)!(this.from.row===i&&this.from.col===o)&&!(this.to.row===i&&this.to.col===o)&&r.push(this._createCellCoords(i,o));return r}getAll(){const e=this.getOuterTopStartCorner(),n=this.getOuterBottomEndCorner(),r=[];for(let i=e.row;i<=n.row;i++)for(let o=e.col;o<=n.col;o++)e.row===i&&e.col===o?r.push(e):n.row===i&&n.col===o?r.push(n):r.push(this._createCellCoords(i,o));return r}forAll(e){const n=this.getOuterTopStartCorner(),r=this.getOuterBottomEndCorner();for(let i=n.row;i<=r.row;i++)for(let o=n.col;o<=r.col;o++)if(e(i,o)===!1)return}clone(){return new bd(this.highlight,this.from,this.to,Hr(Xn,this))}toObject(){return{from:this.from.toObject(),to:this.to.toObject()}}_createCellCoords(e,n){return new al(e,n,Hr(Xn,this))}}function Ai(t,e,n){EG(t,e),e.set(t,n)}function EG(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function fe(t,e){return t.get(wD(t,e))}function cs(t,e,n){return t.set(wD(t,e),n),n}function wD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Nr=new WeakMap,FC=new WeakMap,wn=new WeakMap,Il=new WeakMap,zd=new WeakMap,ri=new WeakMap,VC=new WeakMap,bc=new WeakMap,oa=new WeakMap,Hi=new WeakMap;let vD=class{constructor(e,n,r,i,o,s){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:null;Ai(this,Nr,void 0),Ai(this,FC,void 0),Ai(this,wn,void 0),Ai(this,Il,void 0),Ai(this,zd,void 0),Ai(this,ri,void 0),Ai(this,VC,void 0),Ai(this,bc,void 0),Ai(this,oa,[null,null]),Ai(this,Hi,[null,null]),cs(Nr,this,r),cs(FC,this,n),cs(wn,this,o),cs(Il,this,s),cs(zd,this,a),cs(ri,this,i),cs(VC,this,e),this.registerEvents()}registerEvents(){fe(ri,this).addEventListener(fe(wn,this).holder,"contextmenu",r=>this.onContextMenu(r)),fe(ri,this).addEventListener(fe(wn,this).TABLE,"mouseover",r=>this.onMouseOver(r)),fe(ri,this).addEventListener(fe(wn,this).TABLE,"mouseout",r=>this.onMouseOut(r));const e=()=>{fe(ri,this).addEventListener(fe(wn,this).holder,"touchstart",r=>this.onTouchStart(r)),fe(ri,this).addEventListener(fe(wn,this).holder,"touchend",r=>this.onTouchEnd(r)),this.momentumScrolling||(this.momentumScrolling={}),fe(ri,this).addEventListener(fe(wn,this).holder,"scroll",()=>{clearTimeout(this.momentumScrolling._timeout),this.momentumScrolling.ongoing||fe(Nr,this).getSetting("onBeforeTouchScroll"),this.momentumScrolling.ongoing=!0,this.momentumScrolling._timeout=setTimeout(()=>{this.touchApplied||(this.momentumScrolling.ongoing=!1,fe(Nr,this).getSetting("onAfterMomentumScroll"))},200)})},n=()=>{fe(ri,this).addEventListener(fe(wn,this).holder,"mouseup",r=>this.onMouseUp(r)),fe(ri,this).addEventListener(fe(wn,this).holder,"mousedown",r=>this.onMouseDown(r))};Yo()?e():(KN()&&e(),n())}selectedCellWasTouched(e){const r=this.parentCell(e).coords;if(fe(bc,this)&&r){const[i,o]=[r.row,fe(bc,this).from.row],[s,a]=[r.col,fe(bc,this).from.col];return i===o&&s===a}return!1}parentCell(e){const n={},r=fe(wn,this).TABLE,i=Fd(e,["TD","TH"],r);return i?(n.coords=fe(wn,this).getCoords(i),n.TD=i):ve(e,"wtBorder")&&ve(e,"current")?(n.coords=fe(Il,this).getFocusSelection().cellRange.highlight,n.TD=fe(wn,this).getCell(n.coords)):ve(e,"wtBorder")&&ve(e,"area")&&fe(Il,this).getAreaSelection().cellRange&&(n.coords=fe(Il,this).getAreaSelection().cellRange.to,n.TD=fe(wn,this).getCell(n.coords)),n}onMouseDown(e){const n=fe(FC,this).rootDocument.activeElement,r=qN(oz,e.target),i=e.target;if(!["TD","TH"].includes(n.nodeName)&&(i===n||r(0)===n||r(1)===n))return;const o=this.parentCell(i);ve(i,"corner")?fe(Nr,this).getSetting("onCellCornerMouseDown",e,i):o.TD&&fe(Nr,this).has("onCellMouseDown")&&this.callListener("onCellMouseDown",e,o.coords,o.TD),(e.button===0||this.touchApplied)&&o.TD&&(fe(Hi,this)[0]=o.TD,clearTimeout(fe(oa,this)[0]),fe(oa,this)[0]=setTimeout(()=>{fe(Hi,this)[0]=null},1e3))}onContextMenu(e){if(fe(Nr,this).has("onCellContextMenu")){const n=this.parentCell(e.target);n.TD&&this.callListener("onCellContextMenu",e,n.coords,n.TD)}}onMouseOver(e){if(!fe(Nr,this).has("onCellMouseOver"))return;const n=fe(wn,this).TABLE,r=Fd(e.target,["TD","TH"],n),i=fe(zd,this)||this;r&&r!==i.lastMouseOver&&tl(r,n)&&(i.lastMouseOver=r,this.callListener("onCellMouseOver",e,fe(wn,this).getCoords(r),r))}onMouseOut(e){if(!fe(Nr,this).has("onCellMouseOut"))return;const n=fe(wn,this).TABLE,r=Fd(e.target,["TD","TH"],n),i=Fd(e.relatedTarget,["TD","TH"],n),o=fe(zd,this)||this;r&&r!==i&&tl(r,n)&&(this.callListener("onCellMouseOut",e,fe(wn,this).getCoords(r),r),i===null&&(o.lastMouseOver=null))}onMouseUp(e){const n=this.parentCell(e.target);n.TD&&fe(Nr,this).has("onCellMouseUp")&&this.callListener("onCellMouseUp",e,n.coords,n.TD),!(e.button!==0&&!this.touchApplied)&&(n.TD===fe(Hi,this)[0]&&n.TD===fe(Hi,this)[1]?(ve(e.target,"corner")?this.callListener("onCellCornerDblClick",e,n.coords,n.TD):this.callListener("onCellDblClick",e,n.coords,n.TD),fe(Hi,this)[0]=null,fe(Hi,this)[1]=null):n.TD===fe(Hi,this)[0]&&(fe(Hi,this)[1]=n.TD,clearTimeout(fe(oa,this)[1]),fe(oa,this)[1]=setTimeout(()=>{fe(Hi,this)[1]=null},500)))}onTouchStart(e){cs(bc,this,fe(Il,this).getFocusSelection().cellRange),this.touchApplied=!0,this.onMouseDown(e)}onTouchEnd(e){var n;const r=e.target,i=(n=this.parentCell(r))===null||n===void 0?void 0:n.coords,o=ae(i)&&i.row>=0&&i.col>=0;if(e.cancelable&&o&&fe(Nr,this).getSetting("isDataViewInstance")){const a=["A","BUTTON","INPUT"];ZN()&&(_z()||Mz())&&this.selectedCellWasTouched(r)&&!a.includes(r.tagName)?e.preventDefault():this.selectedCellWasTouched(r)||e.preventDefault()}this.onMouseUp(e),this.touchApplied=!1}callListener(e,n,r,i){const o=fe(Nr,this).getSettingPure(e);o&&o(n,r,i,fe(VC,this).call(this))}destroy(){clearTimeout(fe(oa,this)[0]),clearTimeout(fe(oa,this)[1]),fe(ri,this).destroy()}};function WC(t,e,n){return(e=TG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TG(t){var e=_G(t,"string");return typeof e=="symbol"?e:e+""}function _G(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class MG{constructor(e,n,r){WC(this,"offset",void 0),WC(this,"total",void 0),WC(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleRowHeadedColumnToSourceColumn(e){return this.renderedToSource(this.offsettedTH(e))}sourceColumnToVisibleRowHeadedColumn(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function BC(t,e,n){return(e=IG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function IG(t){var e=PG(t,"string");return typeof e=="symbol"?e:e+""}function PG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class OG{constructor(e,n,r){BC(this,"offset",void 0),BC(this,"total",void 0),BC(this,"countTH",void 0),this.offset=e,this.total=n,this.countTH=r}offsetted(e){return e+this.offset}unOffsetted(e){return e-this.offset}renderedToSource(e){return this.offsetted(e)}sourceToRendered(e){return this.unOffsetted(e)}offsettedTH(e){return e-this.countTH}unOffsettedTH(e){return e+this.countTH}visibleColHeadedRowToSourceRow(e){return this.renderedToSource(this.offsettedTH(e))}sourceRowToVisibleColHeadedRow(e){return this.unOffsettedTH(this.sourceToRendered(e))}}function Yd(t,e,n){return(e=xG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xG(t){var e=AG(t,"string");return typeof e=="symbol"?e:e+""}function AG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class HG{constructor(){Yd(this,"currentSize",0),Yd(this,"nextSize",0),Yd(this,"currentOffset",0),Yd(this,"nextOffset",0)}setSize(e){this.currentSize=this.nextSize,this.nextSize=e}setOffset(e){this.currentOffset=this.nextOffset,this.nextOffset=e}}const NG=0,RO=1,uS=2;function jC(t,e,n){return(e=DG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function DG(t){var e=kG(t,"string");return typeof e=="symbol"?e:e+""}function kG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class LG{constructor(){jC(this,"size",new HG),jC(this,"workingSpace",NG),jC(this,"sharedSize",null)}setSize(e){this.size.setSize(e)}setOffset(e){this.size.setOffset(e)}getViewSize(){return this.size}isShared(){return this.sharedSize!==null}isPlaceOn(e){return this.workingSpace===e}append(e){this.workingSpace=RO,e.workingSpace=uS,this.sharedSize=e.getViewSize()}prepend(e){this.workingSpace=uS,e.workingSpace=RO,this.sharedSize=e.getViewSize()}}var EO={},UC,TO;function $G(){if(TO)return UC;TO=1;var t=Bm(),e=TypeError;return UC=function(n,r){if(!delete n[r])throw new e("Cannot delete property "+t(r)+" of "+t(n))},UC}var _O;function FG(){if(_O)return EO;_O=1;var t=dt(),e=Bu(),n=Uu(),r=w1(),i=$G(),o=v1(),s=[].unshift(0)!==1,a=function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(u){return u instanceof TypeError}},l=s||!a();return t({target:"Array",proto:!0,arity:1,forced:l},{unshift:function(c){var h=e(this),d=n(h),f=arguments.length;if(f){o(d+f);for(var m=d;m--;){var C=m+f;m in h?h[C]=h[m]:i(h,C)}for(var y=0;y<f;y++)h[y]=arguments[y]}return r(h,d+f)}}),EO}FG();function VG(t,e,n){return(e=WG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function WG(t){var e=BG(t,"string");return typeof e=="symbol"?e:e+""}function BG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class MO{constructor(e,n){VG(this,"order",[]),this.order=[...Array(n).keys()].map(r=>e+r)}get length(){return this.order.length}has(e){return this.order.indexOf(e)>-1}get(e){return e<this.order.length?this.order[e]:-1}remove(e){this.order.splice(this.order.indexOf(e),1)}prepend(e){return this.order.unshift(e),this.order.pop()}}function jG(t,e,n){return(e=UG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function UG(t){var e=zG(t,"string");return typeof e=="symbol"?e:e+""}function zG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class YG{constructor(e){jG(this,"sizeSet",void 0),this.sizeSet=e}diff(){const{sizeSet:e}=this,{currentSize:n,nextSize:r}=e.getViewSize();let i=Math.max(r,n);if(i===0)return[];const{currentOffset:o,nextOffset:s}=e.getViewSize(),a=new MO(o,n),l=new MO(s,r),u=[];for(let c=0;c<i;c++){const h=a.get(c),d=l.get(c);if(d===-1)u.push(["remove",h]);else if(h===-1)!e.isShared()||e.isShared()&&e.isPlaceOn(uS)?u.push(["append",d]):u.push(["prepend",d]);else if(d>h)a.has(d)&&(a.remove(d),r<=a.length&&(i-=1)),u.push(["replace",d,h]);else if(d<h){const f=a.prepend(d);u.push(["insert_before",d,h,f])}else u.push(["none",d])}return u}}function Pl(t,e,n){return(e=GG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GG(t){var e=qG(t,"string");return typeof e=="symbol"?e:e+""}function qG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class CD{constructor(e,n){Pl(this,"rootNode",void 0),Pl(this,"nodesPool",void 0),Pl(this,"sizeSet",new LG),Pl(this,"collectedNodes",[]),Pl(this,"viewDiffer",new YG(this.sizeSet)),Pl(this,"leads",[]),this.rootNode=e,this.nodesPool=n}setSize(e){return this.sizeSet.setSize(e),this}setOffset(e){return this.sizeSet.setOffset(e),this}isSharedViewSet(){return this.sizeSet.isShared()}getNode(e){return e<this.collectedNodes.length?this.collectedNodes[e]:null}getCurrentNode(){const e=this.collectedNodes.length;return e>0?this.collectedNodes[e-1]:null}applyCommand(e){const{rootNode:n}=this,[r,i,o,s]=e,a=this.nodesPool(i);switch(this.collectedNodes.push(a),r){case"prepend":n.insertBefore(a,n.firstChild);break;case"append":n.appendChild(a);break;case"insert_before":n.insertBefore(a,this.nodesPool(o)),n.removeChild(this.nodesPool(s));break;case"replace":n.replaceChild(a,this.nodesPool(o));break;case"remove":n.removeChild(a);break}}start(){this.collectedNodes.length=0,this.leads=this.viewDiffer.diff()}render(){this.leads.length>0&&this.applyCommand(this.leads.shift())}end(){for(;this.leads.length>0;)this.applyCommand(this.leads.shift())}}class yD extends CD{prependView(e){return this.sizeSet.prepend(e.sizeSet),e.sizeSet.append(this.sizeSet),this}appendView(e){return this.sizeSet.append(e.sizeSet),e.sizeSet.prepend(this.sizeSet),this}}function IO(t,e,n){return(e=KG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KG(t){var e=XG(t,"string");return typeof e=="symbol"?e:e+""}function XG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ZG{constructor(e){IO(this,"nodeType",void 0),IO(this,"pool",new Map),this.nodeType=e.toUpperCase()}setRootDocument(e){this.rootDocument=e}obtain(e,n){const i=typeof n=="number"?`${e}x${n}`:e.toString();if(this.pool.has(i))return this.pool.get(i);const o=this.rootDocument.createElement(this.nodeType);return this.pool.set(i,o),o}}function Sc(t,e,n){return(e=QG(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function QG(t){var e=JG(t,"string");return typeof e=="symbol"?e:e+""}function JG(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Sd{constructor(e,n){Sc(this,"nodesPool",null),Sc(this,"nodeType",void 0),Sc(this,"rootNode",void 0),Sc(this,"table",null),Sc(this,"renderedNodes",0),this.nodesPool=typeof e=="string"?new ZG(e):null,this.nodeType=e,this.rootNode=n}setTable(e){this.nodesPool&&this.nodesPool.setRootDocument(e.rootDocument),this.table=e}adjust(){}render(){}}function PO(t,e,n){return(e=e2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e2(t){var e=t2(t,"string");return typeof e=="symbol"?e:e+""}function t2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class n2 extends Sd{constructor(){super("TH"),PO(this,"orderViews",new WeakMap),PO(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new yD(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r)),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,rowHeaderFunctions:n,rowHeadersCount:r,rows:i,cells:o}=this.table;for(let s=0;s<e;s++){const a=this.table.renderedRowToSource(s),l=i.getRenderedNode(s);this.sourceRowIndex=a;const u=this.obtainOrderView(l),c=o.obtainOrderView(l);u.appendView(c).setSize(r).setOffset(0).start();for(let h=r-1;h>=0;h--){u.render();const d=u.getCurrentNode();d.className="",d.removeAttribute("style"),Ku(d,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&ye(d,[$U(),GU(),AR(h+1),Cl(-1)]),n[h](a,d,h)}u.end()}}}class r2 extends Sd{constructor(e){super(null,e)}adjust(){const{columnHeadersCount:e,rowHeadersCount:n}=this.table;let r=this.rootNode.firstChild;if(e){const{columnsToRender:i}=this.table,o=i+n;for(let a=0,l=e;a<l;a++){for(r=this.rootNode.childNodes[a],r||(r=this.table.rootDocument.createElement("tr"),this.rootNode.appendChild(r)),this.renderedNodes=r.childNodes.length;this.renderedNodes<o;)r.appendChild(this.table.rootDocument.createElement("th")),this.renderedNodes+=1;for(;this.renderedNodes>o;)r.removeChild(r.lastChild),this.renderedNodes-=1}const s=this.rootNode.childNodes.length;if(s>e)for(let a=e;a<s;a++)this.rootNode.removeChild(this.rootNode.lastChild)}else r&&ts(r)}render(){const{columnHeadersCount:e}=this.table;this.table.isAriaEnabled()&&ye(this.rootNode,[PN()]);for(let n=0;n<e;n+=1){const{columnHeaderFunctions:r,columnsToRender:i,rowHeadersCount:o}=this.table,s=this.rootNode.childNodes[n];this.table.isAriaEnabled()&&ye(s,[tS(),HN(n+1)]);for(let a=-1*o;a<i;a+=1){const l=this.table.renderedColumnToSource(a),u=s.childNodes[a+o];u.className="",u.removeAttribute("style"),Ku(u,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.isAriaEnabled()&&ye(u,[AR(a+1+this.table.rowHeadersCount),Cl(-1),FU(),...a>=0?[YU()]:[tS()]]),r[n](l,u,n)}}}}let OO=!1;class i2 extends Sd{constructor(e){super(null,e)}adjust(){const{columnsToRender:e,rowHeadersCount:n}=this.table,r=e+n;for(;this.renderedNodes<r;)this.rootNode.appendChild(this.table.rootDocument.createElement("col")),this.renderedNodes+=1;for(;this.renderedNodes>r;)this.rootNode.removeChild(this.rootNode.lastChild),this.renderedNodes-=1}render(){this.adjust();const{columnsToRender:e,rowHeadersCount:n}=this.table;!OO&&e>1e3&&(OO=!0,Ze(nt`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
41
+ Consider limiting the number of rendered columns by specifying the table width and/or\x20
42
+ turning off the "renderAllColumns" option.`));for(let i=0;i<n;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getHeaderWidth(o);this.rootNode.childNodes[i].style.width=`${s}px`}for(let i=0;i<e;i++){const o=this.table.renderedColumnToSource(i),s=this.table.columnUtils.getWidth(o);this.rootNode.childNodes[i+n].style.width=`${s}px`}const r=this.rootNode.firstChild;r&&q(r,"rowHeader")}}function o2(t,e,n){return(e=s2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s2(t){var e=a2(t,"string");return typeof e=="symbol"?e:e+""}function a2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ol={rowEven:"ht__row_even",rowOdd:"ht__row_odd"};let xO=!1;class l2 extends Sd{constructor(e){super("TR",e),o2(this,"orderView",void 0),this.orderView=new CD(e,n=>this.nodesPool.obtain(n))}getRenderedNode(e){return this.orderView.getNode(e)}hasStaleContent(e){return this.orderView.hasStaleContent(e)}render(){const{rowsToRender:e}=this.table;!xO&&e>1e3&&(xO=!0,Ze(nt`Performance tip: Handsontable rendered more than 1000 visible rows.\x20
43
+ Consider limiting the number of rendered rows by specifying the table height and/or\x20
44
+ turning off the "renderAllRows" option.`)),this.table.isAriaEnabled()&&ye(this.rootNode,[PN()]),this.orderView.setSize(e).setOffset(this.table.renderedRowToSource(0)).start();for(let i=0;i<e;i++){this.orderView.render();const o=this.orderView.getCurrentNode(),s=this.table.renderedRowToSource(i);if(this.table.isAriaEnabled()){var n,r;ye(o,[tS(),HN(s+((n=(r=this.table.rowUtils)===null||r===void 0||(r=r.dataAccessObject)===null||r===void 0?void 0:r.columnHeaders.length)!==null&&n!==void 0?n:0)+1)])}(s+1)%2===0?ve(o,Ol.rowEven)||(pe(o,Ol.rowOdd),q(o,Ol.rowEven)):ve(o,Ol.rowOdd)||(pe(o,Ol.rowEven),q(o,Ol.rowOdd))}this.orderView.end()}}function AO(t,e,n){return(e=u2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u2(t){var e=c2(t,"string");return typeof e=="symbol"?e:e+""}function c2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class h2 extends Sd{constructor(){super("TD"),AO(this,"orderViews",new WeakMap),AO(this,"sourceRowIndex",0)}obtainOrderView(e){let n;return this.orderViews.has(e)?n=this.orderViews.get(e):(n=new yD(e,r=>this.nodesPool.obtain(this.sourceRowIndex,r),this.nodeType),this.orderViews.set(e,n)),n}render(){const{rowsToRender:e,columnsToRender:n,rows:r,rowHeaders:i}=this.table;for(let a=0;a<e;a++){const l=this.table.renderedRowToSource(a),u=r.getRenderedNode(a);this.sourceRowIndex=l;const c=this.obtainOrderView(u),h=i.obtainOrderView(u);c.prependView(h).setSize(n).setOffset(0).start();for(let d=0;d<n;d++){c.render();const f=this.table.renderedColumnToSource(d),m=c.getCurrentNode();if(ve(m,"hide")||(m.className=""),m.removeAttribute("style"),m.removeAttribute("dir"),Ku(m,[new RegExp("aria-(.*)"),new RegExp("role")]),this.table.cellRenderer(l,f,m),this.table.isAriaEnabled()){var o,s;ye(m,[...m.hasAttribute("role")?[]:[LU()],Cl(-1),AR(f+((o=(s=this.table.rowUtils)===null||s===void 0||(s=s.dataAccessObject)===null||s===void 0?void 0:s.rowHeaders.length)!==null&&o!==void 0?o:0)+1)])}}c.end()}}}function Jt(t,e,n){return(e=d2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d2(t){var e=f2(t,"string");return typeof e=="symbol"?e:e+""}function f2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class g2{constructor(e){let{cellRenderer:n,stylesHandler:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Jt(this,"rootNode",void 0),Jt(this,"rootDocument",void 0),Jt(this,"rowHeaders",null),Jt(this,"columnHeaders",null),Jt(this,"colGroup",null),Jt(this,"rows",null),Jt(this,"cells",null),Jt(this,"rowFilter",null),Jt(this,"columnFilter",null),Jt(this,"rowUtils",null),Jt(this,"columnUtils",null),Jt(this,"rowsToRender",0),Jt(this,"columnsToRender",0),Jt(this,"rowHeaderFunctions",[]),Jt(this,"rowHeadersCount",0),Jt(this,"columnHeaderFunctions",[]),Jt(this,"columnHeadersCount",0),Jt(this,"cellRenderer",void 0),Jt(this,"activeOverlayName",void 0),Jt(this,"stylesHandler",void 0),this.rootNode=e,this.rootDocument=this.rootNode.ownerDocument,this.cellRenderer=n,this.stylesHandler=r}setActiveOverlayName(e){this.activeOverlayName=e}setAxisUtils(e,n){this.rowUtils=e,this.columnUtils=n}setViewportSize(e,n){this.rowsToRender=e,this.columnsToRender=n}setFilters(e,n){this.rowFilter=e,this.columnFilter=n}setHeaderContentRenderers(e,n){this.rowHeaderFunctions=e,this.rowHeadersCount=e.length,this.columnHeaderFunctions=n,this.columnHeadersCount=n.length}setRenderers(){let{rowHeaders:e,columnHeaders:n,colGroup:r,rows:i,cells:o}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.setTable(this),n.setTable(this),r.setTable(this),i.setTable(this),o.setTable(this),this.rowHeaders=e,this.columnHeaders=n,this.colGroup=r,this.rows=i,this.cells=o}renderedRowToSource(e){return this.rowFilter.renderedToSource(e)}renderedColumnToSource(e){return this.columnFilter.renderedToSource(e)}isAriaEnabled(){return this.rowUtils.wtSettings.getSetting("ariaTags")}render(){this.colGroup.adjust(),this.columnHeaders.adjust(),this.rows.adjust(),this.rowHeaders.adjust(),this.columnHeaders.render(),this.rows.render(),this.rowHeaders.render(),this.cells.render(),this.columnUtils.calculateWidths(),this.colGroup.render();const{rowsToRender:e,rows:n}=this;for(let r=0;r<e;r++){const i=n.getRenderedNode(r),o=this.rowUtils;if(i.firstChild){const s=this.renderedRowToSource(r),a=o.getHeightByOverlayName(s,this.activeOverlayName),u=this.stylesHandler.areCellsBorderBox()?0:1;a?i.firstChild.style.height=`${a-u}px`:i.firstChild.style.height=""}}}}class m2{constructor(){let{TABLE:e,THEAD:n,COLGROUP:r,TBODY:i,rowUtils:o,columnUtils:s,cellRenderer:a,stylesHandler:l}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.renderer=new g2(e,{cellRenderer:a,stylesHandler:l}),this.renderer.setRenderers({rowHeaders:new n2,columnHeaders:new r2(n),colGroup:new i2(r),rows:new l2(i),cells:new h2}),this.renderer.setAxisUtils(o,s)}setActiveOverlayName(e){return this.renderer.setActiveOverlayName(e),this}setFilters(e,n){return this.renderer.setFilters(e,n),this}setViewportSize(e,n){return this.renderer.setViewportSize(e,n),this}setHeaderContentRenderers(e,n){return this.renderer.setHeaderContentRenderers(e,n),this}adjust(){this.renderer.adjust()}render(){this.renderer.render()}}function zC(t,e,n){return(e=p2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p2(t){var e=w2(t,"string");return typeof e=="symbol"?e:e+""}function w2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class v2{constructor(e,n){zC(this,"dataAccessObject",void 0),zC(this,"wtSettings",void 0),zC(this,"headerWidths",new Map),this.dataAccessObject=e,this.wtSettings=n}getWidth(e){return this.wtSettings.getSetting("columnWidth",e)||this.wtSettings.getSetting("defaultColumnWidth")}getHeaderHeight(e){let n=this.dataAccessObject.stylesHandler.getDefaultRowHeight();const r=this.dataAccessObject.wtViewport.oversizedColumnHeaders[e];return r!==void 0&&(n=n?Math.max(n,r):r),n}getHeaderWidth(e){return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(e))}calculateWidths(){const{wtSettings:e}=this;let n=e.getSetting("rowHeaderWidth");if(n=e.getSetting("onModifyRowHeaderWidth",n),n!=null){const r=e.getSetting("rowHeaders").length,i=e.getSetting("defaultColumnWidth");for(let o=0;o<r;o++){let s=Array.isArray(n)?n[o]:n;s=s??i,this.headerWidths.set(o,s)}}}}function HO(t,e,n){return(e=C2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C2(t){var e=y2(t,"string");return typeof e=="symbol"?e:e+""}function y2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class b2{constructor(e,n){HO(this,"dataAccessObject",void 0),HO(this,"wtSettings",void 0),this.dataAccessObject=e,this.wtSettings=n}getHeight(e){let n=this.wtSettings.getSetting("rowHeight",e);const r=this.dataAccessObject.wtViewport.oversizedRows[e];return r!==void 0&&(n=n===void 0?r:Math.max(n,r)),n}getHeightByOverlayName(e,n){let r=this.wtSettings.getSetting("rowHeightByOverlayName",e,n);const i=this.dataAccessObject.wtViewport.oversizedRows[e];return i!==void 0&&(r=r===void 0?i:Math.max(r,i)),r}}function Ni(t,e,n){return(e=S2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S2(t){var e=R2(t,"string");return typeof e=="symbol"?e:e+""}function R2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Zu{constructor(e,n,r,i,o){Ni(this,"wtSettings",null),Ni(this,"domBindings",void 0),Ni(this,"TBODY",null),Ni(this,"THEAD",null),Ni(this,"COLGROUP",null),Ni(this,"hasTableHeight",!0),Ni(this,"hasTableWidth",!0),Ni(this,"isTableVisible",!1),Ni(this,"tableOffset",0),Ni(this,"holderOffset",0),this.domBindings=r,this.isMaster=o==="master",this.name=o,this.dataAccessObject=e,this.facadeGetter=n,this.wtSettings=i,this.instance=this.dataAccessObject.wot,this.wot=this.dataAccessObject.wot,this.TABLE=r.rootTable,LN(this.TABLE),this.spreader=this.createSpreader(this.TABLE),this.hider=this.createHider(this.spreader),this.holder=this.createHolder(this.hider),this.wtRootElement=this.holder.parentNode,this.isMaster&&this.alignOverlaysWithTrimmingContainer(),this.fixTableDomTree(),this.rowFilter=null,this.columnFilter=null,this.correctHeaderWidth=!1;const s=this.wtSettings.getSettingPure("rowHeaderWidth");this.wtSettings.update("rowHeaderWidth",()=>this._modifyRowHeaderWidth(s)),this.rowUtils=new b2(this.dataAccessObject,this.wtSettings),this.columnUtils=new v2(this.dataAccessObject,this.wtSettings),this.tableRenderer=new m2({TABLE:this.TABLE,THEAD:this.THEAD,COLGROUP:this.COLGROUP,TBODY:this.TBODY,rowUtils:this.rowUtils,columnUtils:this.columnUtils,cellRenderer:this.wtSettings.getSettingPure("cellRenderer"),stylesHandler:this.dataAccessObject.stylesHandler})}is(e){return this.name===e}fixTableDomTree(){const e=this.domBindings.rootDocument;this.TBODY=this.TABLE.querySelector("tbody"),this.TBODY||(this.TBODY=e.createElement("tbody"),this.TABLE.appendChild(this.TBODY)),this.THEAD=this.TABLE.querySelector("thead"),this.THEAD||(this.THEAD=e.createElement("thead"),this.TABLE.insertBefore(this.THEAD,this.TBODY)),this.COLGROUP=this.TABLE.querySelector("colgroup"),this.COLGROUP||(this.COLGROUP=e.createElement("colgroup"),this.TABLE.insertBefore(this.COLGROUP,this.THEAD))}createSpreader(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ve(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtSpreader",n&&n.insertBefore(r,e),r.appendChild(e)),r.style.position="relative",this.wtSettings.getSetting("ariaTags")&&ye(r,[zo()]),r}createHider(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ve(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.className="wtHider",n&&n.insertBefore(r,e),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&ye(r,[zo()]),r}createHolder(e){const n=e.parentNode;let r;return(!n||n.nodeType!==Node.ELEMENT_NODE||!ve(n,"wtHolder"))&&(r=this.domBindings.rootDocument.createElement("div"),r.style.position="relative",r.className="wtHolder",ye(r,[Cl(-1)]),n&&n.insertBefore(r,e),this.isMaster&&(r.parentNode.className+="ht_master handsontable",r.parentNode.setAttribute("dir",this.wtSettings.getSettingPure("rtlMode")?"rtl":"ltr"),this.wtSettings.getSetting("ariaTags")&&ye(r.parentNode,[zo()])),r.appendChild(e)),this.wtSettings.getSetting("ariaTags")&&ye(r,[zo()]),r}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this,{wtOverlays:r,wtViewport:i}=this.dataAccessObject,o=n.getSetting("totalRows"),s=n.getSetting("totalColumns"),a=n.getSetting("rowHeaders"),l=a.length,u=n.getSetting("columnHeaders"),c=u.length;let h=e;if(this.isMaster&&(r.beforeDraw(),this.holderOffset=Hn(this.holder),h=i.createCalculators(h),l&&!n.getSetting("fixedColumnsStart"))){const f=r.inlineStartOverlay.getScrollPosition(),m=this.correctHeaderWidth;this.correctHeaderWidth=f!==0,m!==this.correctHeaderWidth&&(h=!1)}if(h)this.isMaster&&r.refresh(!0);else{this.isMaster?this.tableOffset=Hn(this.TABLE):this.tableOffset=this.dataAccessObject.parentTableOffset;const f=Math.max(this.getFirstRenderedRow(),0),m=Math.max(this.getFirstRenderedColumn(),0);this.rowFilter=new OG(f,o,c),this.columnFilter=new MG(m,s,l);let C=!0;if(this.isMaster){this.alignOverlaysWithTrimmingContainer();const y={};this.wtSettings.getSetting("beforeDraw",!0,y),C=y.skipRender!==!0}C&&(this.tableRenderer.setHeaderContentRenderers(a,u),(this.is(ro)||this.is(js))&&this.tableRenderer.setHeaderContentRenderers(a,[]),this.resetOversizedRows(),this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(),this.getRenderedColumnsCount()).setFilters(this.rowFilter,this.columnFilter).render(),this.isMaster&&this.markOversizedColumnHeaders(),this.adjustColumnHeaderHeights(),(this.isMaster||this.is(ro))&&this.markOversizedRows(),this.isMaster?(this.wtSettings.getSetting("externalRowCalculator")||i.createVisibleCalculators(),r.refresh(!1),r.applyToDOM(),this.wtSettings.getSetting("onDraw",!0)):this.is(ro)&&this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize())}let d=!1;return this.isMaster&&(d=r.topOverlay.resetFixedPosition(),r.bottomOverlay.clone&&(d=r.bottomOverlay.resetFixedPosition()||d),d=r.inlineStartOverlay.resetFixedPosition()||d,r.topInlineStartCornerOverlay&&r.topInlineStartCornerOverlay.resetFixedPosition(),r.bottomInlineStartCornerOverlay&&r.bottomInlineStartCornerOverlay.clone&&r.bottomInlineStartCornerOverlay.resetFixedPosition()),d?(r.refreshAll(),r.adjustElementsSize()):this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(h),this.isMaster&&r.afterDraw(),this.dataAccessObject.drawn=!0,this}markIfOversizedColumnHeader(e){const n=this.columnFilter.renderedToSource(e);let r=this.wtSettings.getSetting("columnHeaders").length;const i=this.dataAccessObject.stylesHandler.getDefaultRowHeight();let o,s,a;const l=this.wtSettings.getSetting("columnHeaderHeight")||[];for(;r;)r-=1,o=this.getColumnHeaderHeight(r),s=this.getColumnHeader(n,r),s&&(a=Ch(s),(!o&&i<a||o<a)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=a),Array.isArray(l)?l[r]!==null&&l[r]!==void 0&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l[r]):isNaN(l)||(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l),this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]<(l[r]||l)&&(this.dataAccessObject.wtViewport.oversizedColumnHeaders[r]=l[r]||l))}adjustColumnHeaderHeights(){const{wtSettings:e}=this,n=this.THEAD.childNodes,r=this.dataAccessObject.wtViewport.oversizedColumnHeaders,i=e.getSetting("columnHeaders");for(let o=0,s=i.length;o<s;o++)if(r[o]){if(!n[o]||n[o].childNodes.length===0)return;n[o].childNodes[0].style.height=`${r[o]}px`}}resetOversizedRows(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject;if(!(!this.isMaster&&!this.is(ro))&&!e.getSetting("externalRowCalculator")){const r=this.getRenderedRowsCount();for(let i=0;i<r;i++){const o=this.rowFilter.renderedToSource(i);n.oversizedRows&&n.oversizedRows[o]&&(n.oversizedRows[o]=void 0)}}}getCell(e){let n=e.row,r=e.col;const i=this.wtSettings.getSetting("onModifyGetCellCoords",n,r,!this.isMaster,"render");if(i&&Array.isArray(i)&&([n,r]=i),this.isRowBeforeRenderedRows(n))return-1;if(this.isRowAfterRenderedRows(n))return-2;if(this.isColumnBeforeRenderedColumns(r))return-3;if(this.isColumnAfterRenderedColumns(r))return-4;const o=this.getRow(n);if(!o&&n>=0)throw new Error("TR was expected to be rendered but is not");const s=o.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(r)];if(!s&&r>=0)throw new Error("TD or TH was expected to be rendered but is not");return s}getRow(e){let n=null,r=null;if(e<0){var i;n=(i=this.rowFilter)===null||i===void 0?void 0:i.sourceRowToVisibleColHeadedRow(e),r=this.THEAD}else{var o;n=(o=this.rowFilter)===null||o===void 0?void 0:o.sourceToRendered(e),r=this.TBODY}return n!==void 0&&r!==void 0?r.childNodes.length<n+1?!1:r.childNodes[n]:!1}getColumnHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.THEAD.childNodes[n];return r==null?void 0:r.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e)]}getColumnHeaders(e){const n=[],r=this.columnFilter.sourceColumnToVisibleRowHeadedColumn(e);return this.THEAD.childNodes.forEach(i=>{const o=i.childNodes[r];o&&n.push(o)}),n}getRowHeader(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.wtSettings.getSetting("rowHeaders").length;if(n>=r)return;const i=this.rowFilter.sourceToRendered(e),o=i<0?this.rowFilter.sourceRowToVisibleColHeadedRow(e):i,a=(i<0?this.THEAD:this.TBODY).childNodes[o];return a==null?void 0:a.childNodes[n]}getRowHeaders(e){const n=[],r=this.wtSettings.getSetting("rowHeaders").length;for(let i=0;i<r;i++){const o=this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)],s=o==null?void 0:o.childNodes[i];s&&n.push(s)}return n}getCoords(e){let n=e;if(n.nodeName!=="TD"&&n.nodeName!=="TH"&&(n=il(n,["TD","TH"])),n===null)return null;const r=n.parentNode;if(!r)return null;const i=r.parentNode;let o=lz(r),s=n.cellIndex;ra(cl,n,this.wtRootElement)||ra(ll,n,this.wtRootElement)?i.nodeName==="THEAD"&&(o-=i.childNodes.length):ra(js,n,this.wtRootElement)||ra(ro,n,this.wtRootElement)?o=this.wtSettings.getSetting("totalRows")-i.childNodes.length+o:i===this.THEAD?o=this.rowFilter.visibleColHeadedRowToSourceRow(o):this.rowFilter&&(o=this.rowFilter.renderedToSource(o)),ra(cl,n,this.wtRootElement)||ra(ul,n,this.wtRootElement)||ra(js,n,this.wtRootElement)?s=this.columnFilter.offsettedTH(s):this.columnFilter&&(s=this.columnFilter.visibleRowHeadedColumnToSourceColumn(s));const a=this.wtSettings.getSetting("onModifyGetCoordsElement",o,s);return a&&Array.isArray(a)&&([o,s]=a),this.wot.createCellCoords(o,s)}markOversizedRows(){if(this.wtSettings.getSetting("externalRowCalculator"))return;let e=this.TBODY.childNodes.length;const n=e*this.dataAccessObject.stylesHandler.getDefaultRowHeight(),r=Ch(this.TBODY)-1,i=this.wot.stylesHandler.areCellsBorderBox(),o=i?rn:Ch,s=i?0:1,a=i?1:0;let l,u,c,h,d;if(!(n===r&&!this.wtSettings.getSetting("fixedRowsBottom")))for(;e;){e-=1,c=this.rowFilter.renderedToSource(e),l=this.getRowHeight(c),h=this.getTrForRow(c),d=h.querySelector("th");const f=c===0?a:0;d?u=o(d):u=o(h)-s,(!l&&this.dataAccessObject.stylesHandler.getDefaultRowHeight()<u-f||l<u)&&(i||(u+=1),this.dataAccessObject.wtViewport.oversizedRows[c]=u)}}getTrForRow(e){return this.TBODY.childNodes[this.rowFilter.sourceToRendered(e)]}isColumnHeaderRendered(e){if(e>=0)return!1;const r=this.wtSettings.getSetting("rowHeaders").length;return Math.abs(e)<=r}isRowHeaderRendered(e){if(e>=0)return!1;const r=this.wtSettings.getSetting("columnHeaders").length;return Math.abs(e)<=r}isRowBeforeRenderedRows(e){const n=this.getFirstRenderedRow();return e<0&&n<=0?!this.isRowHeaderRendered(e):e<n}isRowAfterRenderedRows(e){return e>this.getLastRenderedRow()}isColumnBeforeRenderedColumns(e){const n=this.getFirstRenderedColumn();return e<0&&n<=0?!this.isColumnHeaderRendered(e):e<n}isColumnAfterRenderedColumns(e){return this.columnFilter&&e>this.getLastRenderedColumn()}isColumnAfterViewport(e){return this.columnFilter&&e>this.getLastVisibleColumn()}isRowAfterViewport(e){return this.rowFilter&&e>this.getLastVisibleRow()}isColumnBeforeViewport(e){return this.columnFilter&&this.columnFilter.sourceToRendered(e)<0&&e>=0}isLastRowFullyVisible(){return this.getLastVisibleRow()===this.getLastRenderedRow()}isLastColumnFullyVisible(){return this.getLastVisibleColumn()===this.getLastRenderedColumn()}allRowsInViewport(){return this.wtSettings.getSetting("totalRows")===this.getVisibleRowsCount()}allColumnsInViewport(){return this.wtSettings.getSetting("totalColumns")===this.getVisibleColumnsCount()}getRowHeight(e){return this.rowUtils.getHeight(e)}getColumnHeaderHeight(e){return this.columnUtils.getHeaderHeight(e)}getColumnWidth(e){return this.columnUtils.getWidth(e)}hasDefinedSize(){return this.hasTableHeight&&this.hasTableWidth}getWidth(){return qt(this.TABLE)}getHeight(){return rn(this.TABLE)}getTotalWidth(){const e=qt(this.hider);return e!==0?e:this.getWidth()}getTotalHeight(){const e=rn(this.hider);return e!==0?e:this.getHeight()}isVisible(){return Hu(this.TABLE)}_modifyRowHeaderWidth(e){let n=ot(e)?e():null;return Array.isArray(n)?(n=[...n],n[n.length-1]=this._correctRowHeaderWidth(n[n.length-1])):n=this._correctRowHeaderWidth(n),n}_correctRowHeaderWidth(e){let n=e;return typeof e!="number"&&(n=this.wtSettings.getSetting("defaultColumnWidth")),this.correctHeaderWidth&&(n+=1),n}}const E2="stickyRowsBottom",UR={getFirstRenderedRow(){const t=this.getRenderedRowsCount();return t===0?-1:this.wtSettings.getSetting("totalRows")-t},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()===0?-1:this.wtSettings.getSetting("totalRows")-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsBottom"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return 0}};as(UR,"MIXIN_NAME",E2,{writable:!1,enumerable:!1});const T2="stickyColumnsStart",lp={getFirstRenderedColumn(){return this.getRenderedColumnsCount()===0?-1:0},getFirstVisibleColumn(){return this.getFirstRenderedColumn()},getFirstPartiallyVisibleColumn(){return this.getFirstRenderedColumn()},getLastRenderedColumn(){return this.getRenderedColumnsCount()-1},getLastVisibleColumn(){return this.getLastRenderedColumn()},getLastPartiallyVisibleColumn(){return this.getLastRenderedColumn()},getRenderedColumnsCount(){return Math.min(this.wtSettings.getSetting("totalColumns"),this.wtSettings.getSetting("fixedColumnsStart"))},getVisibleColumnsCount(){return this.getRenderedColumnsCount()},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};as(lp,"MIXIN_NAME",T2,{writable:!1,enumerable:!1});class zR extends Zu{constructor(e,n,r,i){super(e,n,r,i,js)}}ut(zR,UR);ut(zR,lp);const ll="top",ro="bottom",ul="inline_start",cl="top_inline_start_corner",js="bottom_inline_start_corner",bD=[ll,ro,ul,cl,js],_2=new Map([[ll,`ht_clone_${ll}`],[ro,`ht_clone_${ro}`],[ul,`ht_clone_${ul} ht_clone_left`],[cl,`ht_clone_${cl} ht_clone_top_left_corner`],[js,`ht_clone_${js} ht_clone_bottom_left_corner`]]);function M2(t,e){I2(t,e),e.add(t)}function I2(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function P2(t,e,n){return(e=O2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O2(t){var e=x2(t,"string");return typeof e=="symbol"?e:e+""}function x2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gd(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Rc=new WeakSet;class A2{constructor(e){M2(this,Rc),P2(this,"dataAccessObject",void 0),this.dataAccessObject=e}scrollViewport(e,n,r){if(e.col<0||e.row<0)return!1;const i=this.scrollViewportHorizontally(e.col,n),o=this.scrollViewportVertically(e.row,r);return i||o}scrollViewportHorizontally(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:r,totalColumns:i}=this.dataAccessObject;if(!r)return!1;const o=Ir(n);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollHorizontally",e,o),!Number.isInteger(e)||e<0||e>i)return!1;n=o.value;const{fixedColumnsStart:s,inlineStartOverlay:a}=this.dataAccessObject,l=n==="auto";if(l&&e<s)return!1;const u=this.getFirstVisibleColumn(),c=this.getLastVisibleColumn();let h=!1;return(l&&(e<u||e>c)||!l)&&(h=a.scrollTo(e,l?e>=this.getLastPartiallyVisibleColumn():n==="end")),h}scrollViewportVertically(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"auto";const{drawn:r,totalRows:i}=this.dataAccessObject;if(!r)return!1;const o=Ir(n);if(e=this.dataAccessObject.wtSettings.getSetting("onBeforeViewportScrollVertically",e,o),!Number.isInteger(e)||e<0||e>i)return!1;n=o.value;const{fixedRowsBottom:s,fixedRowsTop:a,topOverlay:l}=this.dataAccessObject,u=n==="auto";if(u&&(e<a||e>i-s-1))return!1;const c=this.getFirstVisibleRow(),h=this.getLastVisibleRow();let d=!1;return(u&&(e<c||e>h)||!u)&&(d=l.scrollTo(e,u?e>=this.getLastPartiallyVisibleRow():n==="bottom")),d}getFirstVisibleRow(){return this.dataAccessObject.wtTable.getFirstVisibleRow()}getLastVisibleRow(){return Gd(Rc,this,DO).call(this,this.dataAccessObject.wtTable.getLastVisibleRow())}getFirstPartiallyVisibleRow(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow()}getLastPartiallyVisibleRow(){return Gd(Rc,this,DO).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleRow())}getFirstVisibleColumn(){return this.dataAccessObject.wtTable.getFirstVisibleColumn()}getLastVisibleColumn(){return Gd(Rc,this,NO).call(this,this.dataAccessObject.wtTable.getLastVisibleColumn())}getFirstPartiallyVisibleColumn(){return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn()}getLastPartiallyVisibleColumn(){return Gd(Rc,this,NO).call(this,this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn())}}function NO(t){const{wtSettings:e,inlineStartOverlay:n,wtTable:r,wtViewport:i,totalColumns:o,rootWindow:s}=this.dataAccessObject;if(n.mainTableScrollableElement===s){const a=e.getSetting("rtlMode");let l=null;if(a){const c=r.TABLE.getBoundingClientRect(),d=this.dataAccessObject.rootWindow.document.documentElement.offsetWidth;l=Math.abs(c.right-d)}else l=Hn(r.wtRootElement).left;const u=Math.abs(FN(s,s));if(l>u){const c=VN(s);let h=i.getRowHeaderWidth();for(let d=1;d<=o;d++)if(h+=n.sumCellSizes(d-1,d),l+h-u>=c){t=d-2;break}}}return t}function DO(t){const{topOverlay:e,wtTable:n,wtViewport:r,totalRows:i,rootWindow:o}=this.dataAccessObject;if(e.mainTableScrollableElement===o){const s=Hn(n.wtRootElement),a=DR(o,o);if(s.top>a){const l=Ch(o);let u=r.getColumnHeaderHeight();for(let c=1;c<=i;c++)if(u+=e.sumCellSizes(c-1,c),s.top+u-a>=l){t=c-2;break}}}return t}function Dr(t,e,n){return(e=H2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function H2(t){var e=N2(t,"string");return typeof e=="symbol"?e:e+""}function N2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class YR{get eventManager(){return new _i(this)}constructor(e,n){Dr(this,"wtTable",void 0),Dr(this,"wtScroll",void 0),Dr(this,"wtViewport",void 0),Dr(this,"wtOverlays",void 0),Dr(this,"selectionManager",void 0),Dr(this,"wtEvent",void 0),Dr(this,"guid",`wt_${_N()}`),Dr(this,"drawInterrupted",!1),Dr(this,"drawn",!1),Dr(this,"activeOverlayName","master"),Dr(this,"domBindings",void 0),Dr(this,"wtSettings",void 0),this.domBindings={rootTable:e,rootDocument:e.ownerDocument,rootWindow:e.ownerDocument.defaultView},this.wtSettings=n,this.wtScroll=new A2(this.createScrollDao())}findOriginalHeaders(){const e=[];if(this.wtTable.THEAD.childNodes.length&&this.wtTable.THEAD.childNodes[0].childNodes.length){for(let n=0,r=this.wtTable.THEAD.childNodes[0].childNodes.length;n<r;n++)e.push(this.wtTable.THEAD.childNodes[0].childNodes[n].innerHTML);this.wtSettings.getSetting("columnHeaders").length||this.wtSettings.update("columnHeaders",[function(n,r){ol(r,e[n])}])}}createCellCoords(e,n){return new al(e,n,this.wtSettings.getSetting("rtlMode"))}createCellRange(e,n,r){return new bd(e,n,r,this.wtSettings.getSetting("rtlMode"))}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this.drawInterrupted=!1,!this.wtTable.isVisible()||cz(this.wtTable.wtRootElement.parentNode)?this.drawInterrupted=!0:this.wtTable.draw(e),this}getCell(e){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1))return this.wtTable.getCell(e);const r=this.wtSettings.getSetting("totalRows"),i=this.wtSettings.getSetting("fixedRowsTop"),o=this.wtSettings.getSetting("fixedRowsBottom"),s=this.wtSettings.getSetting("fixedColumnsStart");if(e.row<i&&e.col<s)return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(e);if(e.row<i)return this.wtOverlays.topOverlay.clone.wtTable.getCell(e);if(e.col<s&&e.row>=r-o){if(this.wtOverlays.bottomInlineStartCornerOverlay&&this.wtOverlays.bottomInlineStartCornerOverlay.clone)return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(e)}else{if(e.col<s)return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(e);if(e.row<r&&e.row>=r-o&&this.wtOverlays.bottomOverlay&&this.wtOverlays.bottomOverlay.clone)return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(e)}return this.wtTable.getCell(e)}scrollViewport(e,n,r){return this.wtScroll.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this.wtScroll.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this.wtScroll.scrollViewportVertically(e,n)}getViewport(){return[this.wtTable.getFirstVisibleRow(),this.wtTable.getFirstVisibleColumn(),this.wtTable.getLastVisibleRow(),this.wtTable.getLastVisibleColumn()]}destroy(){this.wtOverlays.destroy(),this.wtEvent.destroy()}createScrollDao(){const e=this;return{get drawn(){return e.drawn},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get wtTable(){return e.wtTable},get wtViewport(){return e.wtViewport},get wtSettings(){return e.wtSettings},get rootWindow(){return e.domBindings.rootWindow},get totalRows(){return e.wtSettings.getSetting("totalRows")},get totalColumns(){return e.wtSettings.getSetting("totalColumns")},get fixedRowsTop(){return e.wtSettings.getSetting("fixedRowsTop")},get fixedRowsBottom(){return e.wtSettings.getSetting("fixedRowsBottom")},get fixedColumnsStart(){return e.wtSettings.getSetting("fixedColumnsStart")}}}getTableDao(){const e=this;return{get wot(){return e},get parentTableOffset(){return e.cloneSource.wtTable.tableOffset},get cloneSource(){return e.cloneSource},get workspaceWidth(){return e.wtViewport.getWorkspaceWidth()},get wtViewport(){return e.wtViewport},get wtOverlays(){return e.wtOverlays},get selectionManager(){return e.selectionManager},get stylesHandler(){return e.stylesHandler},get drawn(){return e.drawn},set drawn(n){e.drawn=n},get wtTable(){return e.wtTable},get startColumnRendered(){return e.wtViewport.columnsRenderCalculator.startColumn},get startColumnVisible(){return e.wtViewport.columnsVisibleCalculator.startColumn},get startColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.startColumn},get endColumnRendered(){return e.wtViewport.columnsRenderCalculator.endColumn},get endColumnVisible(){return e.wtViewport.columnsVisibleCalculator.endColumn},get endColumnPartiallyVisible(){return e.wtViewport.columnsPartiallyVisibleCalculator.endColumn},get countColumnsRendered(){return e.wtViewport.columnsRenderCalculator.count},get countColumnsVisible(){return e.wtViewport.columnsVisibleCalculator.count},get startRowRendered(){return e.wtViewport.rowsRenderCalculator.startRow},get startRowVisible(){return e.wtViewport.rowsVisibleCalculator.startRow},get startRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.startRow},get endRowRendered(){return e.wtViewport.rowsRenderCalculator.endRow},get endRowVisible(){return e.wtViewport.rowsVisibleCalculator.endRow},get endRowPartiallyVisible(){return e.wtViewport.rowsPartiallyVisibleCalculator.endRow},get countRowsRendered(){return e.wtViewport.rowsRenderCalculator.count},get countRowsVisible(){return e.wtViewport.rowsVisibleCalculator.count},get columnHeaders(){return e.wtSettings.getSetting("columnHeaders")},get rowHeaders(){return e.wtSettings.getSetting("rowHeaders")}}}}function kO(t,e,n){return(e=D2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D2(t){var e=k2(t,"string");return typeof e=="symbol"?e:e+""}function k2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class L2 extends YR{constructor(e,n,r){super(e,n),kO(this,"cloneSource",void 0),kO(this,"cloneOverlay",void 0);const i=this.wtSettings.getSetting("facade",this);this.cloneSource=r.source,this.cloneOverlay=r.overlay,this.stylesHandler=r.stylesHandler,this.wtTable=this.cloneOverlay.createTable(this.getTableDao(),i,this.domBindings,this.wtSettings),this.wtViewport=r.viewport,this.selectionManager=r.selectionManager,this.wtEvent=new vD(i,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager,r.event),this.findOriginalHeaders()}}function $2(t,e,n){return(e=F2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function F2(t){var e=V2(t,"string");return typeof e=="symbol"?e:e+""}function V2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Rd{constructor(e,n,r,i,o){$2(this,"wtSettings",null),as(this,"wot",e,{writable:!1}),this.domBindings=o,this.facadeGetter=n,this.wtSettings=i;const{TABLE:s,hider:a,spreader:l,holder:u,wtRootElement:c}=this.wot.wtTable;this.instance=this.wot,this.type=r,this.mainTableScrollableElement=null,this.TABLE=s,this.hider=a,this.spreader=l,this.holder=u,this.wtRootElement=c,this.trimmingContainer=Uh(this.hider.parentNode.parentNode),this.needFullRender=this.shouldBeRendered(),this.clone=this.makeClone()}hasRenderingStateChanged(){return this.needFullRender!==this.shouldBeRendered()}updateStateOfRendering(e){e==="before"&&this.shouldBeRendered()?this.needFullRender=!0:e==="after"&&!this.shouldBeRendered()&&(this.needFullRender=!1)}shouldBeRendered(){return!0}updateTrimmingContainer(){this.trimmingContainer=Uh(this.hider.parentNode.parentNode)}updateMainScrollableElement(){const{wtTable:e}=this.wot,{rootWindow:n}=this.domBindings;n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=this.wot.wtTable.holder:this.mainTableScrollableElement=qg(e.TABLE)}getRelativeCellPosition(e,n,r){if(this.clone.wtTable.holder.contains(e)===!1){Ze(`The provided element is not a child of the ${this.type} overlay`);return}const i=this.mainTableScrollableElement===this.domBindings.rootWindow,o=r<this.wtSettings.getSetting("fixedColumnsStart"),s=n<this.wtSettings.getSetting("fixedRowsTop"),a=n>=this.wtSettings.getSetting("totalRows")-this.wtSettings.getSetting("fixedRowsBottom"),l=this.clone.wtTable.spreader,u={start:this.getRelativeStartPosition(l),top:l.offsetTop},c={start:this.getRelativeStartPosition(e),top:e.offsetTop};let h=null;return i?h=this.getRelativeCellPositionWithinWindow(s,o,c,u):h=this.getRelativeCellPositionWithinHolder(s,a,o,c,u),h}getRelativeStartPosition(e){return this.isRtl()?e.offsetParent.offsetWidth-e.offsetLeft-e.offsetWidth:e.offsetLeft}getRelativeCellPositionWithinWindow(e,n,r,i){const o=this.wot.wtTable.wtRootElement.getBoundingClientRect();let s=0,a=0;if(!n)s=i.start;else{let l=o.left;this.isRtl()&&(l=this.domBindings.rootWindow.innerWidth-(o.left+o.width+yn())),s=l<=0?-1*l:0}return e?a=this.clone.wtTable.TABLE.getBoundingClientRect().top-o.top:a=i.top,{start:r.start+s,top:r.top+a}}getRelativeCellPositionWithinHolder(e,n,r,i,o){const s={horizontal:this.wot.wtOverlays.inlineStartOverlay.getScrollPosition(),vertical:this.wot.wtOverlays.topOverlay.getScrollPosition()};let a=0,l=0;if(r||(a=s.horizontal-o.start),n){const u=this.wot.wtTable.wtRootElement.getBoundingClientRect();l=this.clone.wtTable.TABLE.getBoundingClientRect().top*-1+u.top}else e||(l=s.vertical-o.top);return{start:i.start-a,top:i.top-l}}makeClone(){if(bD.indexOf(this.type)===-1)throw new Error(`Clone type "${this.type}" is not supported.`);const{wtTable:e,wtSettings:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,o=r.createElement("div"),s=r.createElement("table"),a=e.wtRootElement.parentNode;o.className=`${_2.get(this.type)} handsontable`,o.setAttribute("dir",this.isRtl()?"rtl":"ltr"),o.style.position="absolute",o.style.top=0,o.style.overflow="visible",this.isRtl()?o.style.right=0:o.style.left=0,n.getSetting("ariaTags")&&ye(o,[zo()]),s.className=e.TABLE.className,e.TABLE.getAttribute("role")&&s.setAttribute("role",e.TABLE.getAttribute("role")),o.appendChild(s),a.appendChild(o);const u=this.wtSettings.getSetting("preventOverflow");return u===!0||u==="horizontal"&&this.type===ll||u==="vertical"&&this.type===ul?this.mainTableScrollableElement=i:i.getComputedStyle(a).getPropertyValue("overflow")==="hidden"?this.mainTableScrollableElement=e.holder:this.mainTableScrollableElement=qg(e.TABLE),new L2(s,this.wtSettings,{source:this.wot,overlay:this,viewport:this.wot.wtViewport,event:this.wot.wtEvent,selectionManager:this.wot.selectionManager,stylesHandler:this.wot.stylesHandler})}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.needFullRender){const n=this.clone.cloneSource;n.activeOverlayName=this.clone.wtTable.name,this.clone.draw(e),n.activeOverlayName="master"}}reset(){const e=this.clone.wtTable.holder,n=this.clone.wtTable.hider,r=e.style,i=n.style,o=e.parentNode.style;[r,i,o].forEach(s=>{s.width="",s.height=""})}isRtl(){return this.wtSettings.getSetting("rtlMode")}destroy(){this.clone.eventManager.destroy()}}class W2 extends Rd{constructor(e,n,r,i,o,s){super(e,n,js,r,i),this.bottomOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new zR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wot:e}=this;if(this.updateTrimmingContainer(),!e.wtTable.holder.parentNode)return!1;const n=this.clone.wtTable.holder.parentNode;if(n.style.top="",this.trimmingContainer===this.domBindings.rootWindow){const o=this.inlineStartOverlay.getOverlayOffset(),s=this.bottomOverlay.getOverlayOffset();n.style[this.isRtl()?"right":"left"]=`${o}px`,n.style.bottom=`${s}px`}else rp(n),this.repositionOverlay();let r=rn(this.clone.wtTable.TABLE);const i=qt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(r=0),n.style.height=`${r}px`,n.style.width=`${i}px`,!1}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;n.hasVerticalScroll()||(o+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(o+=yn(r)),i.style.bottom=`${o}px`}}const B2="calculatedColumns",up={getFirstRenderedColumn(){const t=this.dataAccessObject.startColumnRendered;return t===null?-1:t},getFirstVisibleColumn(){const t=this.dataAccessObject.startColumnVisible;return t===null?-1:t},getFirstPartiallyVisibleColumn(){const t=this.dataAccessObject.startColumnPartiallyVisible;return t===null?-1:t},getLastRenderedColumn(){const t=this.dataAccessObject.endColumnRendered;return t===null?-1:t},getLastVisibleColumn(){const t=this.dataAccessObject.endColumnVisible;return t===null?-1:t},getLastPartiallyVisibleColumn(){const t=this.dataAccessObject.endColumnPartiallyVisible;return t===null?-1:t},getRenderedColumnsCount(){return this.dataAccessObject.countColumnsRendered},getVisibleColumnsCount(){return this.dataAccessObject.countColumnsVisible},getRowHeadersCount(){return this.dataAccessObject.rowHeaders.length}};as(up,"MIXIN_NAME",B2,{writable:!1,enumerable:!1});class GR extends Zu{constructor(e,n,r,i){super(e,n,r,i,ro)}}ut(GR,UR);ut(GR,up);function j2(t,e,n){return(e=U2(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function U2(t){var e=z2(t,"string");return typeof e=="symbol"?e:e+""}function z2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Y2 extends Rd{constructor(e,n,r,i){super(e,n,ro,r,i),j2(this,"cachedFixedRowsBottom",-1),this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom")}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new GR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderBottomOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const{rootWindow:e}=this.domBindings,n=this.clone.wtTable.holder.parentNode;n.style.top="";let r=0;const i=this.wtSettings.getSetting("preventOverflow");this.trimmingContainer===e&&(!i||i!=="vertical")?(r=this.getOverlayOffset(),n.style.bottom=`${r}px`):(r=this.getScrollPosition(),this.repositionOverlay());const o=this.adjustHeaderBordersPosition(r);return this.adjustElementsSize(),o}repositionOverlay(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r}=this.domBindings,i=this.clone.wtTable.holder.parentNode;let o=0;n.hasVerticalScroll()||(o+=n.getWorkspaceHeight()-e.getTotalHeight()),n.hasVerticalScroll()&&n.hasHorizontalScroll()&&(o+=yn(r)),i.style.bottom=`${o}px`}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const o=n.scrollY;n.scrollTo(NR(n),top),i=o!==n.scrollY}else if(e!==r.scrollTop){const o=r.scrollTop;r.scrollTop=e,i=o!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const{wtTable:r,stylesHandler:i}=this.wot,o=i.getDefaultRowHeight();let s=e,a=0;for(;s<n;){const l=r.getRowHeight(s);a+=l===void 0?o:l,s+=1}return a}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=yn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=rn(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=e.parentNode.style.height}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:n}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?n.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:n.style[e]=""}scrollTo(e,n){let r=this.getTableParentOffset();const o=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder;let s=0;n&&o.offsetHeight!==o.clientHeight&&(s=yn(this.domBindings.rootDocument)),n?(r+=this.sumCellSizes(0,e+1),r-=this.wot.wtViewport.getViewportHeight(),r+=1):r+=this.sumCellSizes(this.wtSettings.getSetting("fixedRowsBottom"),e),r+=s,this.setScrollPosition(r)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return DR(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o,a=this.domBindings.rootDocument.documentElement.clientHeight;r=Math.max(this.getTableParentOffset()-this.getScrollPosition()-a+i,0),r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){const n=this.wtSettings.getSetting("fixedRowsBottom"),r=this.cachedFixedRowsBottom!==n,i=this.wtSettings.getSetting("columnHeaders");let o=!1;if((r||n===0)&&i.length>0){const s=this.wot.wtTable.holder.parentNode,a=ve(s,"innerBorderBottom");this.cachedFixedRowsBottom=this.wtSettings.getSetting("fixedRowsBottom"),e||this.wtSettings.getSetting("totalRows")===0?(q(s,"innerBorderBottom"),o=!a):(pe(s,"innerBorderBottom"),o=a)}return o}}const G2="calculatedRows",qR={getFirstRenderedRow(){const t=this.dataAccessObject.startRowRendered;return t===null?-1:t},getFirstVisibleRow(){const t=this.dataAccessObject.startRowVisible;return t===null?-1:t},getFirstPartiallyVisibleRow(){const t=this.dataAccessObject.startRowPartiallyVisible;return t===null?-1:t},getLastRenderedRow(){const t=this.dataAccessObject.endRowRendered;return t===null?-1:t},getLastVisibleRow(){const t=this.dataAccessObject.endRowVisible;return t===null?-1:t},getLastPartiallyVisibleRow(){const t=this.dataAccessObject.endRowPartiallyVisible;return t===null?-1:t},getRenderedRowsCount(){return this.dataAccessObject.countRowsRendered},getVisibleRowsCount(){return this.dataAccessObject.countRowsVisible},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};as(qR,"MIXIN_NAME",G2,{writable:!1,enumerable:!1});class KR extends Zu{constructor(e,n,r,i){super(e,n,r,i,ul)}}ut(KR,qR);ut(KR,lp);const q2="localHooks",Rn={_localHooks:Object.create(null),addLocalHook(t,e){return this._localHooks[t]||(this._localHooks[t]=[]),this._localHooks[t].push(e),this},runLocalHooks(t,e,n,r,i,o,s){if(this._localHooks[t]){const a=this._localHooks[t].length;for(let l=0;l<a;l++)nS(this._localHooks[t][l],this,e,n,r,i,o,s)}},clearLocalHooks(){return this._localHooks={},this}};as(Rn,"MIXIN_NAME",q2,{writable:!1,enumerable:!1});let SD=class{constructor(e,n){this.settings=e,this.cellRange=n||null}isEmpty(){return this.cellRange===null}add(e){return this.isEmpty()?this.cellRange=this.settings.createCellRange(e):this.cellRange.expand(e),this}replace(e,n){if(!this.isEmpty()){if(this.cellRange.from.isEqual(e))return this.cellRange.from=n,!0;if(this.cellRange.to.isEqual(e))return this.cellRange.to=n,!0}return!1}clear(){return this.cellRange=null,this}getCorners(){const e=this.cellRange.getOuterTopStartCorner(),n=this.cellRange.getOuterBottomEndCorner();return[e.row,e.col,n.row,n.col]}destroy(){this.runLocalHooks("destroy")}};ut(SD,Rn);const RD="active-header",XR="header",ZR="area",yh="focus",K2="fill",X2="row",Z2="column",Q2="custom-selection",QR=t=>{const e=t.stylesHandler;if(e.isClassicTheme())return Object.freeze({width:6,height:6,borderWidth:1,borderStyle:"solid",borderColor:"#FFF"});const n=e.getCSSVariableValue("cell-autofill-size"),r=e.getCSSVariableValue("cell-autofill-border-width"),i=e.getCSSVariableValue("cell-autofill-border-color");return Object.freeze({width:n,height:n,borderWidth:r,borderStyle:"solid",borderColor:i})};var LO={},$O;function J2(){if($O)return LO;$O=1;var t=sp();return t("flat"),LO}J2();function eq(t,e){ED(t,e),e.add(t)}function FO(t,e,n){ED(t,e),e.set(t,n)}function ED(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ht(t,e){return t.get(bh(t,e))}function VO(t,e,n){return t.set(bh(t,e),n),n}function bh(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ui=new WeakMap,Pn=new WeakMap,qd=new WeakSet;class tq{constructor(){eq(this,qd),FO(this,ui,void 0),FO(this,Pn,void 0)}setActiveOverlay(e){return VO(Pn,this,e),this}setActiveSelection(e){return VO(ui,this,e),this}scan(){const e=Ht(ui,this).settings.selectionType,n=new Set;return e==="active-header"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r))):e==="area"?this.scanCellsRange(r=>n.add(r)):e==="focus"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r)),this.scanCellsRange(r=>n.add(r))):e==="fill"?this.scanCellsRange(r=>n.add(r)):e==="header"?(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanRowsInHeadersRange(r=>n.add(r))):e==="row"?(this.scanRowsInHeadersRange(r=>n.add(r)),this.scanRowsInCellsRange(r=>n.add(r))):e==="column"&&(this.scanColumnsInHeadersRange(r=>n.add(r)),this.scanColumnsInCellsRange(r=>n.add(r))),n}scanColumnsInHeadersRange(e){const[n,r,i,o]=Ht(ui,this).getCorners(),{wtTable:s}=Ht(Pn,this),a=s.getRenderedColumnsCount(),l=s.getColumnHeadersCount();let u=0;for(let c=-s.getRowHeadersCount();c<a;c++){const h=s.columnFilter.renderedToSource(c);if(!(h<r||h>o)){for(let d=-l;d<0;d++){if(d<n||d>i)continue;const f=d+l;let m=s.getColumnHeader(h,f);const C=Ht(Pn,this).getSetting("onBeforeHighlightingColumnHeader",h,f,{selectionType:Ht(ui,this).settings.selectionType,columnCursor:u,selectionWidth:o-r+1});C!==null&&(C!==h&&(m=s.getColumnHeader(C,f)),e(m))}u+=1}}}scanRowsInHeadersRange(e){const[n,r,i,o]=Ht(ui,this).getCorners(),{wtTable:s}=Ht(Pn,this),a=s.getRenderedRowsCount(),l=s.getRowHeadersCount();let u=0;for(let c=-s.getColumnHeadersCount();c<a;c++){const h=s.rowFilter.renderedToSource(c);if(!(h<n||h>i)){for(let d=-l;d<0;d++){if(d<r||d>o)continue;const f=d+l;let m=s.getRowHeader(h,f);const C=Ht(Pn,this).getSetting("onBeforeHighlightingRowHeader",h,f,{selectionType:Ht(ui,this).settings.selectionType,rowCursor:u,selectionHeight:i-n+1});C!==null&&(C!==h&&(m=s.getRowHeader(C,f)),e(m))}u+=1}}}scanCellsRange(e){const{wtTable:n}=Ht(Pn,this);bh(qd,this,nq).call(this,(r,i)=>{const o=n.getCell(Ht(Pn,this).createCellCoords(r,i)),s=Ht(Pn,this).getSetting("onAfterDrawSelection",r,i,Ht(ui,this).settings.layerLevel);typeof s=="string"&&q(o,s),e(o)})}scanRowsInCellsRange(e){const[n,,r]=Ht(ui,this).getCorners(),{wtTable:i}=Ht(Pn,this);bh(qd,this,WO).call(this,(o,s)=>{if(o>=n&&o<=r){const a=i.getCell(Ht(Pn,this).createCellCoords(o,s));e(a)}})}scanColumnsInCellsRange(e){const[,n,,r]=Ht(ui,this).getCorners(),{wtTable:i}=Ht(Pn,this);bh(qd,this,WO).call(this,(o,s)=>{if(s>=n&&s<=r){const a=i.getCell(Ht(Pn,this).createCellCoords(o,s));e(a)}})}}function nq(t){let[e,n,r,i]=Ht(ui,this).getCorners();if(e<0&&r<0||n<0&&i<0)return;const{wtTable:o}=Ht(Pn,this),s=e!==r||n!==i;if(n=Math.max(n,0),i=Math.max(i,0),e=Math.max(e,0),r=Math.max(r,0),s){if(n=Math.max(n,o.getFirstRenderedColumn()),i=Math.min(i,o.getLastRenderedColumn()),e=Math.max(e,o.getFirstRenderedRow()),r=Math.min(r,o.getLastRenderedRow()),i<n||r<e)return}else{const a=o.getCell(Ht(Pn,this).createCellCoords(e,n));if(!Jo(a))return}for(let a=e;a<=r;a+=1)for(let l=n;l<=i;l+=1)t(a,l)}function WO(t){const{wtTable:e}=Ht(Pn,this),n=e.getRenderedRowsCount(),r=e.getRenderedColumnsCount();for(let i=0;i<n;i+=1){const o=e.rowFilter.renderedToSource(i);for(let s=0;s<r;s+=1)t(o,e.columnFilter.renderedToSource(s))}}class BO{constructor(e,n){n&&(this.eventManager=e.eventManager,this.instance=e,this.wot=e,this.settings=n,this.mouseDown=!1,this.main=null,this.top=null,this.bottom=null,this.start=null,this.end=null,this.topStyle=null,this.bottomStyle=null,this.startStyle=null,this.endStyle=null,this.cornerDefaultStyle=QR(this.instance),this.cornerCenterPointOffset=-Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),this.corner=null,this.cornerStyle=null,this.createBorders(n),this.registerListeners())}registerListeners(){const e=this.wot.rootDocument.body;this.eventManager.addEventListener(e,"mousedown",()=>this.onMouseDown()),this.eventManager.addEventListener(e,"mouseup",()=>this.onMouseUp());for(let n=0,r=this.main.childNodes.length;n<r;n++){const i=this.main.childNodes[n];this.eventManager.addEventListener(i,"mouseenter",o=>this.onMouseEnter(o,this.main.childNodes[n]))}}onMouseDown(){this.mouseDown=!0}onMouseUp(){this.mouseDown=!1}onMouseEnter(e,n){if(!this.mouseDown||!this.wot.getSetting("hideBorderOnMouseDownOver"))return;e.preventDefault(),Pi(e);const r=this,i=this.wot.rootDocument.body,o=n.getBoundingClientRect();n.style.display="none";function s(l){if(l.clientY<Math.floor(o.top)||l.clientY>Math.ceil(o.top+o.height)||l.clientX<Math.floor(o.left)||l.clientX>Math.ceil(o.left+o.width))return!0}function a(l){s(l)&&(r.eventManager.removeEventListener(i,"mousemove",a),n.style.display="block")}this.eventManager.addEventListener(i,"mousemove",a)}createBorders(e){const{rootDocument:n}=this.wot;this.main=n.createElement("div");const r=["top","start","bottom","end","corner"];let i=this.main.style;i.position="absolute",i.top=0,i.left=0;for(let a=0;a<5;a++){const l=r[a],u=n.createElement("div");u.className=`wtBorder ${this.settings.className||""}`,this.settings[l]&&this.settings[l].hide&&(u.className+=" hidden"),i=u.style,i.backgroundColor=this.settings[l]&&this.settings[l].color?this.settings[l].color:e.border.color,i.height=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,i.width=this.settings[l]&&this.settings[l].width?`${this.settings[l].width}px`:`${e.border.width}px`,this.main.appendChild(u)}this.top=this.main.childNodes[0],this.start=this.main.childNodes[1],this.bottom=this.main.childNodes[2],this.end=this.main.childNodes[3],this.topStyle=this.top.style,this.startStyle=this.start.style,this.bottomStyle=this.bottom.style,this.endStyle=this.end.style,this.corner=this.main.childNodes[4],this.corner.className+=" corner",this.cornerStyle=this.corner.style,this.cornerStyle.width=`${this.cornerDefaultStyle.width}px`,this.cornerStyle.height=`${this.cornerDefaultStyle.height}px`,this.cornerStyle.border=[`${this.cornerDefaultStyle.borderWidth}px`,this.cornerDefaultStyle.borderStyle,this.cornerDefaultStyle.borderColor].join(" "),Yo()&&this.instance.getSetting("isDataViewInstance")&&this.createMultipleSelectorHandles(),this.disappear();const{wtTable:o}=this.wot;let s=o.bordersHolder;s||(s=n.createElement("div"),s.className="htBorders",o.bordersHolder=s,o.spreader.appendChild(s)),s.appendChild(this.main)}createMultipleSelectorHandles(){const{rootDocument:e,stylesHandler:n}=this.wot,r=n.getCSSVariableValue("cell-mobile-handle-size"),i=n.getCSSVariableValue("cell-mobile-handle-border-radius"),o=n.getCSSVariableValue("cell-mobile-handle-background-color"),s=n.getCSSVariableValue("cell-mobile-handle-border-width"),a=n.getCSSVariableValue("cell-mobile-handle-border-color");this.selectionHandles={top:e.createElement("DIV"),topHitArea:e.createElement("DIV"),bottom:e.createElement("DIV"),bottomHitArea:e.createElement("DIV")};const l=10,u=40;this.selectionHandles.top.className="topSelectionHandle topLeftSelectionHandle",this.selectionHandles.topHitArea.className="topSelectionHandle-HitArea topLeftSelectionHandle-HitArea",this.selectionHandles.bottom.className="bottomSelectionHandle bottomRightSelectionHandle",this.selectionHandles.bottomHitArea.className="bottomSelectionHandle-HitArea bottomRightSelectionHandle-HitArea",this.selectionHandles.styles={top:this.selectionHandles.top.style,topHitArea:this.selectionHandles.topHitArea.style,bottom:this.selectionHandles.bottom.style,bottomHitArea:this.selectionHandles.bottomHitArea.style};const c={position:"absolute",height:`${u}px`,width:`${u}px`,"border-radius":`${parseInt(u/1.5,10)}px`};He(c,(d,f)=>{this.selectionHandles.styles.bottomHitArea[f]=d,this.selectionHandles.styles.topHitArea[f]=d});const h=n.isClassicTheme()?{position:"absolute",height:`${l}px`,width:`${l}px`,"border-radius":`${parseInt(l/1.5,10)}px`,background:"#F5F5FF",border:"1px solid #4285c8"}:{position:"absolute",height:`${r}px`,width:`${r}px`,"border-radius":`${i}px`,background:`${o}`,border:`${s}px solid ${a}`};He(h,(d,f)=>{this.selectionHandles.styles.bottom[f]=d,this.selectionHandles.styles.top[f]=d}),this.main.appendChild(this.selectionHandles.top),this.main.appendChild(this.selectionHandles.bottom),this.main.appendChild(this.selectionHandles.topHitArea),this.main.appendChild(this.selectionHandles.bottomHitArea)}isPartRange(e,n){const r=this.wot.selectionManager.getAreaSelection();return!!(r.cellRange&&(e!==r.cellRange.to.row||n!==r.cellRange.to.col))}updateMultipleSelectionHandlesPosition(e,n,r,i,o,s){const l=this.wot.wtSettings.getSetting("rtlMode")?"right":"left",{top:u,topHitArea:c,bottom:h,bottomHitArea:d}=this.selectionHandles.styles,f=parseInt(u.borderWidth,10),m=parseInt(u.width,10),C=parseInt(c.width,10),y=this.wot.wtTable.getWidth(),E=this.wot.wtTable.getHeight();u.top=`${parseInt(r-m-1,10)}px`,u[l]=`${parseInt(i-m-1,10)}px`,c.top=`${parseInt(r-C/4*3,10)}px`,c[l]=`${parseInt(i-C/4*3,10)}px`;const v=Math.min(parseInt(i+o,10),y-m-f*2),_=Math.min(parseInt(i+o-C/4,10),y-C-f*2);h[l]=`${v}px`,d[l]=`${_}px`;const A=Math.min(parseInt(r+s,10),E-m-f*2),L=Math.min(parseInt(r+s-C/4,10),E-C-f*2);h.top=`${A}px`,d.top=`${L}px`,this.settings.border.cornerVisible&&this.settings.border.cornerVisible()?(u.display="block",c.display="block",this.isPartRange(e,n)?(h.display="none",d.display="none"):(h.display="block",d.display="block")):(u.display="none",h.display="none",c.display="none",d.display="none"),e===this.wot.wtSettings.getSetting("fixedRowsTop")||n===this.wot.wtSettings.getSetting("fixedColumnsStart")?(u.zIndex="9999",c.zIndex="9999"):(u.zIndex="",c.zIndex="")}appear(e){if(this.disabled)return;let[n,r,i,o]=e;if(n<0&&i<0||r<0&&o<0){this.disappear();return}const{wtTable:s,rootDocument:a,rootWindow:l}=this.wot,u=n!==i||r!==o,c=s.getFirstRenderedRow(),h=s.getLastRenderedRow(),d=s.getFirstRenderedColumn(),f=s.getLastRenderedColumn();if(d<0&&f<0||c<0&&h<0){this.disappear();return}let m;if(u){if(r=Math.max(r,d),o=Math.min(o,f),n=Math.max(n,c),i=Math.min(i,h),o<r||i<n){this.disappear();return}m=s.getCell(this.wot.createCellCoords(n,r))}else if(m=s.getCell(this.wot.createCellCoords(n,r)),!Jo(m)){this.disappear();return}const C=u?s.getCell(this.wot.createCellCoords(i,o)):m,y=Hn(m),E=u?Hn(C):y,v=Hn(s.TABLE),_=y.top,A=y.left,L=this.wot.wtSettings.getSetting("rtlMode");let T=0,P=0;if(L){const be=qt(s.TABLE),ke=qt(m),wt=l.innerWidth-v.left-be;P=A+ke-E.left,T=l.innerWidth-A-ke-wt-1}else P=E.left+qt(C)-A,T=A-v.left-1;if(this.isEntireColumnSelected(n,i)){const be=n,ke=this.getDimensionsFromHeader("columns",r,o,be,v);let wt=null;ke&&([wt,T,P]=ke),wt&&(m=wt)}let Y=_-v.top-1,U=E.top+rn(C)-_;if(this.isEntireRowSelected(r,o)){const be=r,ke=this.getDimensionsFromHeader("rows",n,i,be,v);let wt=null;ke&&([wt,Y,U]=ke),wt&&(m=wt)}const W=l.getComputedStyle(m);parseInt(W.borderTopWidth,10)>0&&(Y+=1,U=U>0?U-1:0),parseInt(W[L?"borderRightWidth":"borderLeftWidth"],10)>0&&(T+=1,P=P>0?P-1:0);const Z=L?"right":"left";this.topStyle.top=`${Y}px`,this.topStyle[Z]=`${T}px`,this.topStyle.width=`${P}px`,this.topStyle.display="block",this.startStyle.top=`${Y}px`,this.startStyle[Z]=`${T}px`,this.startStyle.height=`${U}px`,this.startStyle.display="block";const J=Math.floor(this.settings.border.width/2);this.bottomStyle.top=`${Y+U-J}px`,this.bottomStyle[Z]=`${T}px`,this.bottomStyle.width=`${P}px`,this.bottomStyle.display="block",this.endStyle.top=`${Y}px`,this.endStyle[Z]=`${T+P-J}px`,this.endStyle.height=`${U+1}px`,this.endStyle.display="block";let se=this.settings.border.cornerVisible;se=typeof se=="function"?se(this.settings.layerLevel):se;const te=this.wot.getSetting("onModifyGetCellCoords",i,o,!1,"render");let[ue,pt]=[i,o];if(te&&Array.isArray(te)&&([,,ue,pt]=te),Yo()||!se||this.isPartRange(ue,pt))this.cornerStyle.display="none";else{this.cornerStyle.top=`${Y+U+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle[Z]=`${T+P+this.cornerCenterPointOffset-this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderRightWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderLeftWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.borderBottomWidth=`${this.cornerDefaultStyle.borderWidth}px`,this.cornerStyle.width=this.cornerDefaultStyle.width,this.cornerStyle.display="none";let be=Uh(s.TABLE);const ke=be===l;ke&&(be=a.documentElement);const wt=parseInt(this.cornerDefaultStyle.borderWidth,10)-1,mn=Math.ceil(parseInt(this.cornerDefaultStyle.width,10)/2),et=Math.ceil(parseInt(this.cornerDefaultStyle.height,10)/2);if(o===this.wot.getSetting("totalColumns")-1){const g=ke?C.getBoundingClientRect().left:C.offsetLeft;let w=!1,p=0;L?(p=g-parseInt(this.cornerDefaultStyle.width,10)/2,w=p<0):(p=g+qt(C)+parseInt(this.cornerDefaultStyle.width,10)/2,w=p>=VN(be)),w&&(this.cornerStyle[Z]=`${Math.floor(T+P+this.cornerCenterPointOffset-mn-wt)}px`,this.cornerStyle[L?"borderLeftWidth":"borderRightWidth"]=0)}if(i===this.wot.getSetting("totalRows")-1){const p=(ke?C.getBoundingClientRect().top:C.offsetTop)+rn(C)+parseInt(this.cornerDefaultStyle.height,10)/2>=Ch(be),O=this.wot.stylesHandler.isClassicTheme();if(p){const $=Math.floor(Y+U+this.cornerCenterPointOffset-et-wt);O?(this.cornerStyle.top=`${$}px`,this.cornerStyle.borderBottomWidth=0):this.cornerStyle.top=`${$-1}px`}}this.cornerStyle.display="block"}Yo()&&this.instance.getSetting("isDataViewInstance")&&this.updateMultipleSelectionHandlesPosition(i,o,Y,T,P,U)}isEntireColumnSelected(e,n){return e===this.wot.wtTable.getFirstRenderedRow()&&n===this.wot.wtTable.getLastRenderedRow()}isEntireRowSelected(e,n){return e===this.wot.wtTable.getFirstRenderedColumn()&&n===this.wot.wtTable.getLastRenderedColumn()}getDimensionsFromHeader(e,n,r,i,o){const{wtTable:s}=this.wot,a=s.wtRootElement.parentNode;let l=null,u=null,c=null,h=null,d=null,f=null,m=null,C=null;switch(e){case"rows":l=function(){return s.getRowHeader(...arguments)},u=function(){return rn(...arguments)},c="ht__selection--rows",f="top";break;case"columns":l=function(){return s.getColumnHeader(...arguments)},u=function(){return qt(...arguments)},c="ht__selection--columns",f="left";break}if(a.classList.contains(c)){const y=this.wot.getSetting("columnHeaders").length;if(m=l(n,y-i),C=l(r,y-i),!m||!C)return!1;const E=Hn(m),v=Hn(C);return m&&C&&(h=E[f]-o[f]-1,d=v[f]+u(C)-E[f]),[m,h,d]}return!1}changeBorderStyle(e,n){const r=this[e].style,i=n[e];!i||i.hide?q(this[e],"hidden"):(ve(this[e],"hidden")&&pe(this[e],"hidden"),r.backgroundColor=i.color,(e==="top"||e==="bottom")&&(r.height=`${i.width}px`),(e==="start"||e==="end")&&(r.width=`${i.width}px`))}changeBorderToDefaultStyle(e){const n={width:1,color:"#000"},r=this[e].style;r.backgroundColor=n.color,r.width=`${n.width}px`,r.height=`${n.width}px`}toggleHiddenClass(e,n){this.changeBorderToDefaultStyle(e),n?q(this[e],"hidden"):pe(this[e],"hidden")}disappear(){this.topStyle.display="none",this.bottomStyle.display="none",this.startStyle.display="none",this.endStyle.display="none",this.cornerStyle.display="none",Yo()&&this.instance.getSetting("isDataViewInstance")&&(this.selectionHandles.styles.top.display="none",this.selectionHandles.styles.topHitArea.display="none",this.selectionHandles.styles.bottom.display="none",this.selectionHandles.styles.bottomHitArea.display="none")}destroy(){this.eventManager.destroyWithOwnEventsOnly(),this.main.parentNode.removeChild(this.main)}}function rq(t,e){TD(t,e),e.add(t)}function xl(t,e,n){TD(t,e),e.set(t,n)}function TD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Oe(t,e){return t.get(JR(t,e))}function jO(t,e,n){return t.set(JR(t,e),n),n}function JR(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var On=new WeakMap,sr=new WeakMap,YC=new WeakMap,ch=new WeakMap,GC=new WeakMap,sa=new WeakMap,UO=new WeakSet;class iq{constructor(e){rq(this,UO),xl(this,On,void 0),xl(this,sr,void 0),xl(this,YC,new tq),xl(this,ch,new WeakMap),xl(this,GC,new WeakSet),xl(this,sa,new Map),jO(sr,this,e)}setActiveOverlay(e){return jO(On,this,e),Oe(YC,this).setActiveOverlay(Oe(On,this)),Oe(ch,this).has(Oe(On,this))||Oe(ch,this).set(Oe(On,this),new Set),this}getFocusSelection(){return Oe(sr,this)!==null?Oe(sr,this).getFocus():null}getAreaSelection(){return Oe(sr,this)!==null?Oe(sr,this).createLayeredArea():null}getBorderInstance(e){if(!e.settings.border)return null;if(Oe(sa,this).has(e)){const r=Oe(sa,this).get(e);if(r.has(Oe(On,this)))return r.get(Oe(On,this));const i=new BO(Oe(On,this),e.settings);return r.set(Oe(On,this),i),i}const n=new BO(Oe(On,this),e.settings);return Oe(sa,this).set(e,new Map([[Oe(On,this),n]])),n}getBorderInstances(e){var n,r;return Array.from((n=(r=Oe(sa,this).get(e))===null||r===void 0?void 0:r.values())!==null&&n!==void 0?n:[])}destroyBorders(e){Oe(sa,this).get(e).forEach(n=>n.destroy()),Oe(sa,this).delete(e)}render(e){if(Oe(sr,this)===null)return;e&&JR(UO,this,oq).call(this);const n=Array.from(Oe(sr,this)),r=new Map,i=new Map;for(let o=0;o<n.length;o++){const s=n[o],{className:a,headerAttributes:l,createLayers:u,selectionType:c}=s.settings;Oe(GC,this).has(s)||(Oe(GC,this).add(s),s.addLocalHook("destroy",()=>this.destroyBorders(s)));const h=this.getBorderInstance(s);if(s.isEmpty()){h==null||h.disappear();continue}a&&Oe(YC,this).setActiveSelection(s).scan().forEach(m=>{if(r.has(m)){const C=r.get(m);C.has(a)&&u===!0?C.set(a,C.get(a)+1):C.set(a,1)}else r.set(m,new Map([[a,1]]));l&&(i.has(m)||i.set(m,[]),m.nodeName==="TH"&&i.get(m).push(...l))});const d=s.getCorners();Oe(On,this).getSetting("onBeforeDrawBorders",d,c),h==null||h.appear(d)}r.forEach((o,s)=>{var a;const l=Array.from(o).map(u=>{let[c,h]=u;return h===1?c:[c,...Array.from({length:h-1},(d,f)=>`${c}-${f+1}`)]}).flat();l.forEach(u=>Oe(ch,this).get(Oe(On,this)).add(u)),q(s,l),s.nodeName==="TD"&&Array.isArray((a=Oe(sr,this).options)===null||a===void 0?void 0:a.cellAttributes)&&ye(s,Oe(sr,this).options.cellAttributes)}),Array.from(i.keys()).forEach(o=>{ye(o,[...i.get(o)])})}}function oq(){const t=Oe(ch,this).get(Oe(On,this)),e=Oe(On,this).wtSettings.getSetting("onBeforeRemoveCellClassNames");if(Array.isArray(e))for(let n=0;n<e.length;n++)t.add(e[n]);t.forEach(n=>{var r,i;const o=Oe(On,this).wtTable.TABLE.querySelectorAll(`.${n}`);let s=[];Array.isArray((r=Oe(sr,this).options)===null||r===void 0?void 0:r.cellAttributes)&&(s=Oe(sr,this).options.cellAttributes.map(a=>a[0])),Array.isArray((i=Oe(sr,this).options)===null||i===void 0?void 0:i.headerAttributes)&&(s=[...s,...Oe(sr,this).options.headerAttributes.map(a=>a[0])]);for(let a=0,l=o.length;a<l;a++)pe(o[a],n),Ku(o[a],s)}),t.clear()}class sq extends Rd{constructor(e,n,r,i){super(e,n,ul,r,i)}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new KR(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){const{wtTable:e}=this.wot;if(!this.needFullRender||!this.shouldBeRendered()||!e.holder.parentNode)return!1;const{rootWindow:n}=this.domBindings,r=this.clone.wtTable.holder.parentNode,i=this.wtSettings.getSetting("preventOverflow");let o=0;this.trimmingContainer===n&&(!i||i!=="horizontal")?(o=this.getOverlayOffset()*(this.isRtl()?-1:1),kR(r,`${o}px`,"0px")):(o=this.getScrollPosition(),rp(r));const s=this.adjustHeaderBordersPosition(o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings;let r=!1;this.isRtl()&&(e=-e);const i=this.mainTableScrollableElement;if(i===n&&e!==n.scrollX){const o=n.scrollX;n.scrollTo(e,$N(n)),r=o!==n.scrollX}else if(e!==i.scrollLeft){const o=i.scrollLeft;i.scrollLeft=e,r=o!==i.scrollLeft}return r}onScroll(){this.wtSettings.getSetting("onScrollVertically")}sumCellSizes(e,n){const r=this.wtSettings.getSetting("defaultColumnWidth");let i=e,o=0;for(;i<n;)o+=this.wot.wtTable.getColumnWidth(i)||r,i+=1;return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="vertical"){let u=n.getWorkspaceHeight();n.hasHorizontalScroll()&&(u-=yn(r)),u=Math.min(u,e.wtRootElement.scrollHeight),s.height=`${u}px`}else s.height="";this.clone.wtTable.holder.style.height=s.height;const l=qt(this.clone.wtTable.TABLE);s.width=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=QR(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(n.width,10)/2:0;this.clone.wtTable.hider.style.height=this.hider.style.height,e.style.height=e.parentNode.style.height,e.style.width=`${parseInt(e.parentNode.style.width,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalColumns"),n=this.isRtl()?"right":"left";if(typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number")this.spreader.style[n]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style[n]="0";else throw new Error("Incorrect value of the columnsRenderCalculator");this.isRtl()?this.spreader.style.left="":this.spreader.style.right="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number"?this.clone.wtTable.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`:this.clone.wtTable.spreader.style.top=""}scrollTo(e,n){const{wtSettings:r}=this,i=r.getSetting("rowHeaders"),o=r.getSetting("fixedColumnsStart"),a=(this.wot.cloneSource?this.wot.cloneSource:this.wot).wtTable.holder,l=o===0&&i.length>0&&!ve(a.parentNode,"innerBorderInlineStart")?1:0;let u=this.getTableParentOffset(),c=0;if(n){const h=this.wot.wtTable.getColumnWidth(e),d=this.wot.wtViewport.getViewportWidth();h>d&&(n=!1)}return n&&a.offsetWidth!==a.clientWidth&&(c=yn(this.domBindings.rootDocument)),n?(u+=this.sumCellSizes(0,e+1),u-=this.wot.wtViewport.getViewportWidth(),u+=l):u+=this.sumCellSizes(this.wtSettings.getSetting("fixedColumnsStart"),e),u+=c,dz(this.mainTableScrollableElement)===u-l&&l>0&&this.wot.wtOverlays.expandHiderHorizontallyBy(l),this.setScrollPosition(u)}getTableParentOffset(){const e=this.wtSettings.getSetting("preventOverflow");let n=0;return!e&&this.trimmingContainer===this.domBindings.rootWindow&&(n=this.wot.wtTable.holderOffset.left),n}getScrollPosition(){return Math.abs(FN(this.mainTableScrollableElement,this.domBindings.rootWindow))}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="horizontal")){this.isRtl()?r=Math.abs(Math.min(this.getTableParentOffset()-this.getScrollPosition(),0)):r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0);const i=this.wot.wtTable.getTotalWidth(),o=this.clone.wtTable.getTotalWidth(),s=i-o;r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){const{wtSettings:n}=this,r=this.wot.wtTable.holder.parentNode,i=n.getSetting("rowHeaders"),o=n.getSetting("fixedColumnsStart"),s=n.getSetting("totalRows"),a=n.getSetting("preventOverflow")==="vertical";s?pe(r,"emptyRows"):q(r,"emptyRows");let l=!1;if(!a){if(o&&!i.length)q(r,"innerBorderLeft innerBorderInlineStart");else if(!o&&i.length){const u=ve(r,"innerBorderInlineStart");e?(q(r,"innerBorderLeft innerBorderInlineStart"),l=!u):(pe(r,"innerBorderLeft innerBorderInlineStart"),l=u)}}return l}}const aq="stickyRowsTop",eE={getFirstRenderedRow(){return this.getRenderedRowsCount()===0?-1:0},getFirstVisibleRow(){return this.getFirstRenderedRow()},getFirstPartiallyVisibleRow(){return this.getFirstRenderedRow()},getLastRenderedRow(){return this.getRenderedRowsCount()-1},getLastVisibleRow(){return this.getLastRenderedRow()},getLastPartiallyVisibleRow(){return this.getLastRenderedRow()},getRenderedRowsCount(){return Math.min(this.wtSettings.getSetting("totalRows"),this.wtSettings.getSetting("fixedRowsTop"))},getVisibleRowsCount(){return this.getRenderedRowsCount()},getColumnHeadersCount(){return this.dataAccessObject.columnHeaders.length}};as(eE,"MIXIN_NAME",aq,{writable:!1,enumerable:!1});class tE extends Zu{constructor(e,n,r,i){super(e,n,r,i,cl)}}ut(tE,eE);ut(tE,lp);function zO(t,e,n){return(e=lq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lq(t){var e=uq(t,"string");return typeof e=="symbol"?e:e+""}function uq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class cq extends Rd{constructor(e,n,r,i,o,s){super(e,n,cl,r,i),zO(this,"topOverlay",void 0),zO(this,"inlineStartOverlay",void 0),this.topOverlay=o,this.inlineStartOverlay=s}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new tE(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")&&this.wtSettings.getSetting("shouldRenderInlineStartOverlay")}resetFixedPosition(){if(this.updateTrimmingContainer(),!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode;if(this.trimmingContainer===this.domBindings.rootWindow){const i=this.inlineStartOverlay.getOverlayOffset()*(this.isRtl()?-1:1),o=this.topOverlay.getOverlayOffset();kR(e,`${i}px`,`${o}px`)}else rp(e);let n=rn(this.clone.wtTable.TABLE);const r=qt(this.clone.wtTable.TABLE);return this.wot.wtTable.hasDefinedSize()||(n=0),e.style.height=`${n}px`,e.style.width=`${r}px`,!1}}class nE extends Zu{constructor(e,n,r,i){super(e,n,r,i,ll)}}ut(nE,eE);ut(nE,up);function hq(t,e,n){return(e=dq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dq(t){var e=fq(t,"string");return typeof e=="symbol"?e:e+""}function fq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gq extends Rd{constructor(e,n,r,i){super(e,n,ll,r,i),hq(this,"cachedFixedRowsTop",-1),this.cachedFixedRowsTop=this.wtSettings.getSetting("fixedRowsTop")}createTable(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return new nE(...n)}shouldBeRendered(){return this.wtSettings.getSetting("shouldRenderTopOverlay")}resetFixedPosition(){if(!this.needFullRender||!this.shouldBeRendered()||!this.wot.wtTable.holder.parentNode)return!1;const e=this.clone.wtTable.holder.parentNode,{rootWindow:n}=this.domBindings,r=this.wtSettings.getSetting("preventOverflow");let i=0,o=!1;if(this.trimmingContainer===n&&(!r||r!=="vertical")){const{wtTable:a}=this.wot,l=a.hider.getBoundingClientRect(),u=Math.ceil(l.bottom),c=e.offsetHeight;o=u===c,i=this.getOverlayOffset(),kR(e,"0px",`${i}px`)}else i=this.getScrollPosition(),rp(e);const s=this.adjustHeaderBordersPosition(i,o);return this.adjustElementsSize(),s}setScrollPosition(e){const{rootWindow:n}=this.domBindings,r=this.mainTableScrollableElement;let i=!1;if(r===n&&e!==n.scrollY){const o=n.scrollY;n.scrollTo(NR(n),e),i=o!==n.scrollY}else if(e!==r.scrollTop){const o=r.scrollTop;r.scrollTop=e,i=o!==r.scrollTop}return i}onScroll(){this.wtSettings.getSetting("onScrollHorizontally")}sumCellSizes(e,n){const r=this.wot.stylesHandler.getDefaultRowHeight();let i=e,o=0;for(;i<n;){const s=this.wot.wtTable.getRowHeight(i);o+=s===void 0?r:s,i+=1}return o}adjustElementsSize(){this.updateTrimmingContainer(),this.needFullRender&&(this.adjustRootElementSize(),this.adjustRootChildrenSize())}adjustRootElementSize(){const{wtTable:e,wtViewport:n}=this.wot,{rootDocument:r,rootWindow:i}=this.domBindings,s=this.clone.wtTable.holder.parentNode.style,a=this.wtSettings.getSetting("preventOverflow");if(this.trimmingContainer!==i||a==="horizontal"){let u=n.getWorkspaceWidth();n.hasVerticalScroll()&&(u-=yn(r)),u=Math.min(u,e.wtRootElement.scrollWidth),s.width=`${u}px`}else s.width="";this.clone.wtTable.holder.style.width=s.width;let l=rn(this.clone.wtTable.TABLE);e.hasDefinedSize()||(l=0),s.height=`${l}px`}adjustRootChildrenSize(){const{holder:e}=this.clone.wtTable,n=QR(this.wot),r=this.wot.selectionManager.getFocusSelection()?parseInt(n.height,10)/2:0;this.clone.wtTable.hider.style.width=this.hider.style.width,e.style.width=e.parentNode.style.width,e.style.height=`${parseInt(e.parentNode.style.height,10)+r}px`}applyToDOM(){const e=this.wtSettings.getSetting("totalRows");if(typeof this.wot.wtViewport.rowsRenderCalculator.startPosition=="number")this.spreader.style.top=`${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;else if(e===0)this.spreader.style.top="0";else throw new Error("Incorrect value of the rowsRenderCalculator");this.spreader.style.bottom="",this.needFullRender&&this.syncOverlayOffset()}syncOverlayOffset(){const e=this.isRtl()?"right":"left",{spreader:n}=this.clone.wtTable;typeof this.wot.wtViewport.columnsRenderCalculator.startPosition=="number"?n.style[e]=`${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`:n.style[e]=""}scrollTo(e,n){const{wot:r,wtSettings:i}=this,s=(r.cloneSource?r.cloneSource:r).wtTable.holder,a=i.getSetting("columnHeaders"),u=i.getSetting("fixedRowsTop")===0&&a.length>0&&!ve(s.parentNode,"innerBorderTop")?1:0;let c=this.getTableParentOffset(),h=0;if(n){const d=this.wot.wtTable.getRowHeight(e),f=this.wot.wtViewport.getViewportHeight();d>f&&(n=!1)}if(n&&s.offsetHeight!==s.clientHeight&&(h=yn(this.domBindings.rootDocument)),n){const d=i.getSetting("fixedRowsBottom"),f=i.getSetting("totalRows");c+=this.sumCellSizes(0,e+1),c-=r.wtViewport.getViewportHeight()-this.sumCellSizes(f-d,f),c+=1,c+=u}else c+=this.sumCellSizes(i.getSetting("fixedRowsTop"),e);return c+=h,hz(this.mainTableScrollableElement)===c-u&&u>0&&this.wot.wtOverlays.expandHiderVerticallyBy(u),this.setScrollPosition(c)}getTableParentOffset(){return this.mainTableScrollableElement===this.domBindings.rootWindow?this.wot.wtTable.holderOffset.top:0}getScrollPosition(){return DR(this.mainTableScrollableElement,this.domBindings.rootWindow)}getOverlayOffset(){const{rootWindow:e}=this.domBindings,n=this.wtSettings.getSetting("preventOverflow");let r=0;if(this.trimmingContainer===e&&(!n||n!=="vertical")){const i=this.wot.wtTable.getTotalHeight(),o=this.clone.wtTable.getTotalHeight(),s=i-o;r=Math.max(this.getScrollPosition()-this.getTableParentOffset(),0),r>s&&(r=0)}return r}adjustHeaderBordersPosition(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{wtSettings:r}=this,i=this.wot.wtTable.holder.parentNode,o=r.getSetting("totalColumns"),s=r.getSetting("preventOverflow")==="horizontal";o?pe(i,"emptyColumns"):q(i,"emptyColumns");let a=!1;if(!n&&!s){const l=r.getSetting("fixedRowsTop"),u=this.cachedFixedRowsTop!==l,c=r.getSetting("columnHeaders");if((u||l===0)&&c.length>0){const h=ve(i,"innerBorderTop");this.cachedFixedRowsTop=r.getSetting("fixedRowsTop"),e||r.getSetting("totalRows")===0?(q(i,"innerBorderTop"),a=!h):(pe(i,"innerBorderTop"),a=h)}}return a}}function Kd(t,e,n){mq(t,e),e.set(t,n)}function mq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yo(t,e,n){return(e=pq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pq(t){var e=wq(t,"string");return typeof e=="symbol"?e:e+""}function wq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function aa(t,e,n){return t.set(_D(t,e),n),n}function bo(t,e){return t.get(_D(t,e))}function _D(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Al=new WeakMap,Xd=new WeakMap,Hl=new WeakMap,Zd=new WeakMap;class vq{constructor(e,n,r,i,o,s){yo(this,"wot",null),Kd(this,Al,[]),yo(this,"topOverlay",null),yo(this,"bottomOverlay",null),yo(this,"inlineStartOverlay",null),yo(this,"topInlineStartCornerOverlay",null),yo(this,"bottomInlineStartCornerOverlay",null),yo(this,"browserLineHeight",void 0),yo(this,"wtSettings",null),Kd(this,Xd,!1),Kd(this,Hl,0),Kd(this,Zd,null),yo(this,"resizeObserver",new ResizeObserver(c=>{Xg(()=>{!Array.isArray(c)||!c.length||(aa(Hl,this,bo(Hl,this)+1),bo(Hl,this)===100&&(Ze("The ResizeObserver callback was fired too many times in direct succession.\nThis may be due to an infinite loop caused by setting a dynamic height/width (for example, with the `dvh` units) to a Handsontable container's parent. \nThe observer will be disconnected."),this.resizeObserver.disconnect()),bo(Zd,this)!==null&&clearTimeout(bo(Zd,this)),aa(Zd,this,setTimeout(()=>{aa(Hl,this,0)},100)),this.wtSettings.getSetting("onContainerElementResize"))})})),this.wot=e,this.wtSettings=i,this.domBindings=r,this.facadeGetter=n,this.wtTable=s;const{rootDocument:a,rootWindow:l}=this.domBindings;this.instance=this.wot,this.eventManager=o,this.scrollbarSize=yn(a);const u=l.getComputedStyle(s.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden";this.scrollableElement=u?s.holder:qg(s.TABLE),this.initOverlays(),this.destroyed=!1,this.keyPressed=!1,this.spreaderLastSize={width:null,height:null},this.verticalScrolling=!1,this.horizontalScrolling=!1,this.initBrowserLineHeight(),this.registerListeners(),this.lastScrollX=l.scrollX,this.lastScrollY=l.scrollY}getOverlays(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=[...bo(Al,this)];return e&&n.push(this.wtTable),n}initBrowserLineHeight(){const{rootWindow:e,rootDocument:n}=this.domBindings,r=e.getComputedStyle(n.body),i=parseInt(r.lineHeight,10),o=parseInt(r.fontSize,10)*1.2;this.browserLineHeight=i||o}initOverlays(){const e=[this.wot,this.facadeGetter,this.wtSettings,this.domBindings];this.topOverlay=new gq(...e),this.bottomOverlay=new Y2(...e),this.inlineStartOverlay=new sq(...e),this.topInlineStartCornerOverlay=new cq(...e,this.topOverlay,this.inlineStartOverlay),this.bottomInlineStartCornerOverlay=new W2(...e,this.bottomOverlay,this.inlineStartOverlay),aa(Al,this,[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay])}beforeDraw(){aa(Xd,this,bo(Al,this).reduce((e,n)=>n.hasRenderingStateChanged()||e,!1)),bo(Al,this).forEach(e=>e.updateStateOfRendering("before"))}afterDraw(){this.syncScrollWithMaster(),bo(Al,this).forEach(e=>{const n=e.hasRenderingStateChanged();e.updateStateOfRendering("after"),n&&!e.needFullRender&&e.reset()})}refreshAll(){if(this.wot.drawn){if(!this.wtTable.holder.parentNode){this.destroy();return}this.wot.draw(!0),this.verticalScrolling&&this.inlineStartOverlay.onScroll(),this.horizontalScrolling&&this.topOverlay.onScroll(),this.verticalScrolling=!1,this.horizontalScrolling=!1}}registerListeners(){const{rootDocument:e,rootWindow:n}=this.domBindings,{mainTableScrollableElement:r}=this.topOverlay,{mainTableScrollableElement:i}=this.inlineStartOverlay;this.eventManager.addEventListener(e.documentElement,"keydown",h=>this.onKeyDown(h)),this.eventManager.addEventListener(e.documentElement,"keyup",()=>this.onKeyUp()),this.eventManager.addEventListener(e,"visibilitychange",()=>this.onKeyUp()),this.eventManager.addEventListener(r,"scroll",h=>this.onTableScroll(h),{passive:!0}),r!==i&&this.eventManager.addEventListener(i,"scroll",h=>this.onTableScroll(h),{passive:!0});const o=n.devicePixelRatio&&n.devicePixelRatio>1,s=this.scrollableElement===n,a=this.wtSettings.getSetting("preventWheel"),l={passive:s};(a||o||!XN())&&this.eventManager.addEventListener(this.wtTable.wtRootElement,"wheel",h=>this.onCloneWheel(h,a),l),[this.topOverlay,this.bottomOverlay,this.inlineStartOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay].forEach(h=>{this.eventManager.addEventListener(h.clone.wtTable.holder,"wheel",d=>this.onCloneWheel(d,a),l)});let c;this.eventManager.addEventListener(n,"resize",()=>{Xg(()=>{clearTimeout(c),this.wtSettings.getSetting("onWindowResize"),c=setTimeout(()=>{aa(Hl,this,0)},200)})}),s||this.resizeObserver.observe(this.wtTable.wtRootElement.parentElement)}onTableScroll(e){const n=this.domBindings.rootWindow,r=this.inlineStartOverlay.mainTableScrollableElement,i=this.topOverlay.mainTableScrollableElement,o=e.target;this.keyPressed&&(i!==n&&o!==n&&!e.target.contains(i)||r!==n&&o!==n&&!e.target.contains(r))||this.syncScrollPositions(e)}onCloneWheel(e,n){const{rootWindow:r}=this.domBindings,i=this.inlineStartOverlay.mainTableScrollableElement,o=this.topOverlay.mainTableScrollableElement,s=e.target,a=o!==r&&s!==r&&!s.contains(o),l=i!==r&&s!==r&&!s.contains(i);if(this.keyPressed&&(a||l)||this.scrollableElement===r)return;const u=this.translateMouseWheelToScroll(e);(n||this.scrollableElement!==r&&u)&&e.preventDefault()}onKeyDown(e){this.keyPressed=yd(e.keyCode,"ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT")}onKeyUp(){this.keyPressed=!1}translateMouseWheelToScroll(e){let n=isNaN(e.deltaY)?-1*e.wheelDeltaY:e.deltaY,r=isNaN(e.deltaX)?-1*e.wheelDeltaX:e.deltaX;e.deltaMode===1&&(r+=r*this.browserLineHeight,n+=n*this.browserLineHeight);const i=this.scrollVertically(n),o=this.scrollHorizontally(r);return i||o}scrollVertically(e){const n=this.scrollableElement.scrollTop;return this.scrollableElement.scrollTop+=e,n!==this.scrollableElement.scrollTop}scrollHorizontally(e){const n=this.scrollableElement.scrollLeft;return this.scrollableElement.scrollLeft+=e,n!==this.scrollableElement.scrollLeft}syncScrollPositions(){if(this.destroyed)return;const e=this.topOverlay.clone.wtTable.holder,n=this.inlineStartOverlay.clone.wtTable.holder;let r=this.scrollableElement.scrollLeft,i=this.scrollableElement.scrollTop;if(this.wot.wtViewport.isHorizontallyScrollableByWindow()&&(r=this.scrollableElement.scrollX),this.wot.wtViewport.isVerticallyScrollableByWindow()&&(i=this.scrollableElement.scrollY),this.horizontalScrolling=this.lastScrollX!==r,this.verticalScrolling=this.lastScrollY!==i,this.lastScrollX=r,this.lastScrollY=i,this.horizontalScrolling){e.scrollLeft=r;const o=this.bottomOverlay.needFullRender?this.bottomOverlay.clone.wtTable.holder:null;o&&(o.scrollLeft=r)}this.verticalScrolling&&(n.scrollTop=i),this.refreshAll()}syncScrollWithMaster(){if(!bo(Xd,this))return;const e=this.topOverlay.mainTableScrollableElement,{scrollLeft:n,scrollTop:r}=e;this.topOverlay.needFullRender&&(this.topOverlay.clone.wtTable.holder.scrollLeft=n),this.bottomOverlay.needFullRender&&(this.bottomOverlay.clone.wtTable.holder.scrollLeft=n),this.inlineStartOverlay.needFullRender&&(this.inlineStartOverlay.clone.wtTable.holder.scrollTop=r),aa(Xd,this,!1)}updateMainScrollableElements(){this.eventManager.clearEvents(!0),this.inlineStartOverlay.updateMainScrollableElement(),this.topOverlay.updateMainScrollableElement(),this.bottomOverlay.needFullRender&&this.bottomOverlay.updateMainScrollableElement();const{wtTable:e}=this,{rootWindow:n}=this.domBindings;n.getComputedStyle(e.wtRootElement.parentNode).getPropertyValue("overflow")==="hidden"?this.scrollableElement=e.holder:this.scrollableElement=qg(e.TABLE),this.registerListeners()}destroy(){this.resizeObserver.disconnect(),this.eventManager.destroy(),this.topOverlay.destroy(),this.bottomOverlay.clone&&this.bottomOverlay.destroy(),this.inlineStartOverlay.destroy(),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.destroy(),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.destroy(),this.destroyed=!0}refresh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.updateLastSpreaderSize()&&this.adjustElementsSize(),this.bottomOverlay.clone&&this.bottomOverlay.refresh(e),this.inlineStartOverlay.refresh(e),this.topOverlay.refresh(e),this.topInlineStartCornerOverlay&&this.topInlineStartCornerOverlay.refresh(e),this.bottomInlineStartCornerOverlay&&this.bottomInlineStartCornerOverlay.clone&&this.bottomInlineStartCornerOverlay.refresh(e)}updateLastSpreaderSize(){const e=this.wtTable.spreader,n=e.clientWidth,r=e.clientHeight,i=n!==this.spreaderLastSize.width||r!==this.spreaderLastSize.height;return i&&(this.spreaderLastSize.width=n,this.spreaderLastSize.height=r),i}adjustElementsSize(){const{wtViewport:e}=this.wot,{wtTable:n}=this,{rootWindow:r}=this.domBindings,i=this.scrollableElement===r,o=this.wtSettings.getSetting("totalColumns"),s=this.wtSettings.getSetting("totalRows"),a=e.getRowHeaderWidth(),u=e.getColumnHeaderHeight()+this.topOverlay.sumCellSizes(0,s)+1,c=a+this.inlineStartOverlay.sumCellSizes(0,o),d=n.hider.style,f=()=>i?!1:this.scrollableElement.scrollTop>Math.max(0,u-n.holder.clientHeight),m=()=>i?!1:this.scrollableElement.scrollLeft>Math.max(0,c-n.holder.clientWidth),C=f()?1:0,y=m()?1:0;d.width=`${c+y}px`,d.height=`${u+C}px`,this.topOverlay.adjustElementsSize(),this.inlineStartOverlay.adjustElementsSize(),this.bottomOverlay.adjustElementsSize()}expandHiderVerticallyBy(e){const{wtTable:n}=this;n.hider.style.height=`${parseInt(n.hider.style.height,10)+e}px`}expandHiderHorizontallyBy(e){const{wtTable:n}=this;n.hider.style.width=`${parseInt(n.hider.style.width,10)+e}px`}applyToDOM(){this.wtTable.isVisible()&&(this.topOverlay.applyToDOM(),this.bottomOverlay.clone&&this.bottomOverlay.applyToDOM(),this.inlineStartOverlay.applyToDOM())}getParentOverlay(e){if(!e)return null;const n=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];let r=null;return I(n,i=>{i&&i.clone&&i.clone.wtTable.TABLE.contains(e)&&(r=i.clone)}),r}syncOverlayTableClassNames(){const e=this.wtTable.TABLE,n=[this.topOverlay,this.inlineStartOverlay,this.bottomOverlay,this.topInlineStartCornerOverlay,this.bottomInlineStartCornerOverlay];I(n,r=>{r&&(r.clone.wtTable.TABLE.className=e.className)})}}function YO(t,e,n){return(e=Cq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cq(t){var e=yq(t,"string");return typeof e=="symbol"?e:e+""}function yq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bq{constructor(e){YO(this,"settings",{}),YO(this,"defaults",Object.freeze(this.getDefaults())),He(this.defaults,(n,r)=>{if(e[r]!==void 0)this.settings[r]=e[r];else{if(n===void 0)throw new Error(`A required setting "${r}" was not provided`);this.settings[r]=n}})}getDefaults(){return{facade:void 0,table:void 0,isDataViewInstance:!0,externalRowCalculator:!1,currentRowClassName:null,currentColumnClassName:null,preventOverflow(){return!1},preventWheel:!1,data:void 0,fixedColumnsStart:0,fixedRowsTop:0,fixedRowsBottom:0,shouldRenderInlineStartOverlay:()=>this.getSetting("fixedColumnsStart")>0||this.getSetting("rowHeaders").length>0,shouldRenderTopOverlay:()=>this.getSetting("fixedRowsTop")>0||this.getSetting("columnHeaders").length>0,shouldRenderBottomOverlay:()=>this.getSetting("fixedRowsBottom")>0,minSpareRows:0,rowHeaders(){return[]},columnHeaders(){return[]},totalRows:void 0,totalColumns:void 0,cellRenderer:(e,n,r)=>{const i=this.getSetting("data",e,n);ol(r,i??"")},columnWidth(){},rowHeight(){},rowHeightByOverlayName(){},defaultColumnWidth:50,selections:null,hideBorderOnMouseDownOver:!1,viewportRowCalculatorOverride:null,viewportColumnCalculatorOverride:null,viewportRowRenderingThreshold:null,viewportColumnRenderingThreshold:null,onCellMouseDown:null,onCellContextMenu:null,onCellMouseOver:null,onCellMouseOut:null,onCellMouseUp:null,onCellDblClick:null,onCellCornerMouseDown:null,onCellCornerDblClick:null,beforeDraw:null,onDraw:null,onBeforeRemoveCellClassNames:null,onAfterDrawSelection:null,onBeforeDrawBorders:null,onBeforeViewportScrollHorizontally:e=>e,onBeforeViewportScrollVertically:e=>e,onScrollHorizontally:null,onScrollVertically:null,onBeforeTouchScroll:null,onAfterMomentumScroll:null,onModifyRowHeaderWidth:null,onModifyGetCellCoords:null,onModifyGetCoordsElement:null,onModifyGetCoords:null,onBeforeHighlightingRowHeader:e=>e,onBeforeHighlightingColumnHeader:e=>e,onWindowResize:null,onContainerElementResize:null,renderAllColumns:!1,renderAllRows:!1,groups:!1,rowHeaderWidth:null,columnHeaderHeight:null,headerClassName:null,rtlMode:!1,ariaTags:!0}}update(e,n){return n===void 0?He(e,(r,i)=>{this.settings[i]=r}):this.settings[e]=n,this}getSetting(e,n,r,i,o){return typeof this.settings[e]=="function"?this.settings[e](n,r,i,o):n!==void 0&&Array.isArray(this.settings[e])?this.settings[e][n]:this.settings[e]}getSettingPure(e){return this.settings[e]}has(e){return!!this.settings[e]}}class rE extends Zu{constructor(e,n,r,i){super(e,n,r,i,"master")}alignOverlaysWithTrimmingContainer(){const e=Uh(this.wtRootElement),{rootWindow:n}=this.domBindings;if(e===n)this.wtSettings.getSetting("preventOverflow")||(this.holder.style.overflow="visible",this.wtRootElement.style.overflow="visible");else{const r=e.parentElement,i=Kg(e,"height",n),o=Kg(e,"overflow",n),s=this.holder.style,{scrollWidth:a,scrollHeight:l}=e;let u=e.offsetWidth,c=e.offsetHeight;if(r&&["auto","hidden","scroll"].includes(o)){const d=e.cloneNode(!1);d.style.overflow="auto",d.style.position="absolute",e.nextElementSibling?r.insertBefore(d,e.nextElementSibling):r.appendChild(d);const f=parseInt(n.getComputedStyle(d).height,10);r.removeChild(d),f===0&&(c=0)}c=Math.min(c,l),s.height=i==="auto"?"auto":`${c}px`,u=Math.min(u,a),s.width=`${u}px`,s.overflow="",this.hasTableHeight=s.height==="auto"?!0:c>0,this.hasTableWidth=u>0}this.isTableVisible=Hu(this.TABLE)}markOversizedColumnHeaders(){const{wtSettings:e}=this,{wtViewport:n}=this.dataAccessObject,r="master",o=e.getSetting("columnHeaders").length;if(o&&!n.hasOversizedColumnHeadersMarked[r]){const a=e.getSetting("rowHeaders").length,l=this.getRenderedColumnsCount();for(let u=0;u<o;u++)for(let c=-1*a;c<l;c++)this.markIfOversizedColumnHeader(c);n.hasOversizedColumnHeadersMarked[r]=!0}}}ut(rE,qR);ut(rE,up);class Sq{constructor(e,n,r,i,o){this.dataAccessObject=e,this.wot=e.wot,this.instance=this.wot,this.domBindings=n,this.wtSettings=r,this.wtTable=o,this.oversizedRows=[],this.oversizedColumnHeaders=[],this.hasOversizedColumnHeadersMarked={},this.clientHeight=0,this.rowHeaderWidth=NaN,this.rowsVisibleCalculator=null,this.columnsVisibleCalculator=null,this.rowsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllRows")?new eG:new sG],["fullyVisible",()=>new UY],["partiallyVisible",()=>new fD]]),this.columnsCalculatorTypes=new Map([["rendered",()=>this.wtSettings.getSetting("renderAllColumns")?new ZY:new rG],["fullyVisible",()=>new WY],["partiallyVisible",()=>new dD]]),this.eventManager=i,this.eventManager.addEventListener(this.domBindings.rootWindow,"resize",()=>{this.clientHeight=this.getWorkspaceHeight()})}getWorkspaceHeight(){const e=this.domBindings.rootDocument,n=this.dataAccessObject.topOverlayTrimmingContainer;let r=0;return n===this.domBindings.rootWindow?r=e.documentElement.clientHeight:r=rn(n)>0&&n.clientHeight>0?n.clientHeight:1/0,r}getViewportHeight(){let e=this.getWorkspaceHeight();if(e===1/0)return e;const n=this.getColumnHeaderHeight();return n>0&&(e-=n),e}getWorkspaceWidth(){const{rootDocument:e,rootWindow:n}=this.domBindings,r=this.dataAccessObject.inlineStartOverlayTrimmingContainer;let i;if(r===n){const o=this.wtSettings.getSetting("totalColumns");i=this.wtTable.holder.offsetWidth,this.getRowHeaderWidth()+this.sumColumnWidths(0,o)>i&&(i=e.documentElement.clientWidth)}else i=r.clientWidth;return i}getViewportWidth(){const e=this.getWorkspaceWidth();if(e===1/0)return e;const n=this.getRowHeaderWidth();return n>0?e-n:e}hasVerticalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollHeight>o.clientHeight}const{holder:e,hider:n}=this.wtTable,r=e.clientHeight,i=n.offsetHeight;return r<i?!0:i>this.getWorkspaceHeight()}hasHorizontalScroll(){if(this.isVerticallyScrollableByWindow()){const o=this.domBindings.rootDocument.documentElement;return o.scrollWidth>o.clientWidth}const{holder:e,hider:n}=this.wtTable,r=e.clientWidth,i=n.offsetWidth;return r<i?!0:i>this.getWorkspaceWidth()}isVerticallyScrollableByWindow(){return this.dataAccessObject.topOverlayTrimmingContainer===this.domBindings.rootWindow}isHorizontallyScrollableByWindow(){return this.dataAccessObject.inlineStartOverlayTrimmingContainer===this.domBindings.rootWindow}sumColumnWidths(e,n){let r=0,i=e;for(;i<n;)r+=this.wtTable.getColumnWidth(i),i+=1;return r}getWorkspaceOffset(){return Hn(this.wtTable.holder)}getColumnHeaderHeight(){return this.wtSettings.getSetting("columnHeaders").length?isNaN(this.columnHeaderHeight)&&(this.columnHeaderHeight=rn(this.wtTable.THEAD)):this.columnHeaderHeight=0,this.columnHeaderHeight}getRowHeaderWidth(){const e=this.wtSettings.getSetting("rowHeaderWidth"),n=this.wtSettings.getSetting("rowHeaders");if(e){this.rowHeaderWidth=0;for(let r=0,i=n.length;r<i;r++)this.rowHeaderWidth+=e[r]||e}if(isNaN(this.rowHeaderWidth))if(n.length){let r=this.wtTable.TABLE.querySelector("TH");this.rowHeaderWidth=0;for(let i=0,o=n.length;i<o;i++)r?(this.rowHeaderWidth+=qt(r),r=r.nextSibling):this.rowHeaderWidth+=50}else this.rowHeaderWidth=0;return this.rowHeaderWidth=this.wtSettings.getSetting("onModifyRowHeaderWidth",this.rowHeaderWidth)||this.rowHeaderWidth,this.rowHeaderWidth}createRowsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportHeight(),o,s;this.rowHeaderWidth=NaN;let a=this.dataAccessObject.topScrollPosition-this.dataAccessObject.topParentOffset;const l=n.getSetting("fixedRowsTop"),u=n.getSetting("fixedRowsBottom"),c=n.getSetting("totalRows");return l&&a>=0&&(s=this.dataAccessObject.topOverlay.sumCellSizes(0,l),a+=s,i-=s),u&&this.dataAccessObject.bottomOverlay.clone&&(s=this.dataAccessObject.bottomOverlay.sumCellSizes(c-u,c),i-=s),r.holder.clientHeight===r.holder.offsetHeight?o=0:o=yn(this.domBindings.rootDocument),new gG({calculationTypes:e.map(h=>[h,this.rowsCalculatorTypes.get(h)()]),viewportHeight:i,scrollOffset:a,totalRows:n.getSetting("totalRows"),defaultRowHeight:this.instance.stylesHandler.getDefaultRowHeight(),rowHeightFn:h=>r.getRowHeight(h),overrideFn:n.getSettingPure("viewportRowCalculatorOverride"),horizontalScrollbarHeight:o})}createColumnsCalculator(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["rendered","fullyVisible","partiallyVisible"];const{wtSettings:n,wtTable:r}=this;let i=this.getViewportWidth(),o=Math.abs(this.dataAccessObject.inlineStartScrollPosition)-this.dataAccessObject.inlineStartParentOffset;this.columnHeaderHeight=NaN;const s=n.getSetting("fixedColumnsStart");if(s&&o>=0){const a=this.dataAccessObject.inlineStartOverlay.sumCellSizes(0,s);o+=a,i-=a}return r.holder.clientWidth!==r.holder.offsetWidth&&(i-=yn(this.domBindings.rootDocument)),new hG({calculationTypes:e.map(a=>[a,this.columnsCalculatorTypes.get(a)()]),viewportWidth:i,scrollOffset:o,totalColumns:n.getSetting("totalColumns"),columnWidthFn:a=>r.getColumnWidth(a),overrideFn:n.getSettingPure("viewportColumnCalculatorOverride"),inlineStartOffset:this.dataAccessObject.inlineStartParentOffset})}createCalculators(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const{wtSettings:n}=this,r=this.createRowsCalculator(),i=this.createColumnsCalculator();if(e&&!n.getSetting("renderAllRows")){const o=r.getResultsFor("fullyVisible");e=this.areAllProposedVisibleRowsAlreadyRendered(o)}if(e&&!n.getSetting("renderAllColumns")){const o=i.getResultsFor("fullyVisible");e=this.areAllProposedVisibleColumnsAlreadyRendered(o)}return e||(this.rowsRenderCalculator=r.getResultsFor("rendered"),this.columnsRenderCalculator=i.getResultsFor("rendered")),this.rowsVisibleCalculator=r.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=i.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=r.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=i.getResultsFor("partiallyVisible"),e}createVisibleCalculators(){const e=this.createRowsCalculator(["fullyVisible","partiallyVisible"]),n=this.createColumnsCalculator(["fullyVisible","partiallyVisible"]);this.rowsVisibleCalculator=e.getResultsFor("fullyVisible"),this.columnsVisibleCalculator=n.getResultsFor("fullyVisible"),this.rowsPartiallyVisibleCalculator=e.getResultsFor("partiallyVisible"),this.columnsPartiallyVisibleCalculator=n.getResultsFor("partiallyVisible")}areAllProposedVisibleRowsAlreadyRendered(e){if(!this.rowsVisibleCalculator)return!1;let{startRow:n,endRow:r}=e;if(n===null&&r===null){if(!e.isVisibleInTrimmingContainer)return!0;n=this.rowsPartiallyVisibleCalculator.startRow,r=this.rowsPartiallyVisibleCalculator.endRow}const{startRow:i,endRow:o,rowStartOffset:s,rowEndOffset:a}=this.rowsRenderCalculator,l=this.wtSettings.getSetting("totalRows")-1,u=this.wtSettings.getSetting("viewportRowRenderingThreshold");return Number.isInteger(u)&&u>0?(n=Math.max(0,n-Math.min(s,u)),r=Math.min(l,r+Math.min(a,u))):u==="auto"&&(n=Math.max(0,n-Math.ceil(s/2)),r=Math.min(l,r+Math.ceil(a/2))),n<i||n===i&&n>0?!1:!(r>o||r===o&&r<l)}areAllProposedVisibleColumnsAlreadyRendered(e){if(!this.columnsVisibleCalculator)return!1;let{startColumn:n,endColumn:r}=e;if(n===null&&r===null){if(!e.isVisibleInTrimmingContainer)return!0;n=this.columnsPartiallyVisibleCalculator.startColumn,r=this.columnsPartiallyVisibleCalculator.endColumn}const{startColumn:i,endColumn:o,columnStartOffset:s,columnEndOffset:a}=this.columnsRenderCalculator,l=this.wtSettings.getSetting("totalColumns")-1,u=this.wtSettings.getSetting("viewportColumnRenderingThreshold");return Number.isInteger(u)&&u>0?(n=Math.max(0,n-Math.min(s,u)),r=Math.min(l,r+Math.min(a,u))):u==="auto"&&(n=Math.max(0,n-Math.ceil(s/2)),r=Math.min(l,r+Math.ceil(a/2))),n<i||n===i&&n>0?!1:!(r>o||r===o&&r<l)}resetHasOversizedColumnHeadersMarked(){He(this.hasOversizedColumnHeadersMarked,(e,n,r)=>{r[n]=void 0})}}function Rq(t,e){MD(t,e),e.add(t)}function la(t,e,n){MD(t,e),e.set(t,n)}function MD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Rt(t,e){return t.get(vi(t,e))}function wi(t,e,n){return t.set(vi(t,e),n),n}function vi(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const GO=23;var Gi=new WeakMap,Bo=new WeakMap,iE=new WeakMap,cS=new WeakMap,Ts=new WeakMap,hh=new WeakMap,Yh=new WeakMap,Xi=new WeakSet;class Eq{constructor(e){Rq(this,Xi),la(this,Gi,void 0),la(this,Bo,void 0),la(this,iE,void 0),la(this,cS,void 0),la(this,Ts,!0),la(this,hh,{}),la(this,Yh,{}),wi(Bo,this,e.rootTable.parentElement.parentElement),wi(cS,this,e.rootDocument)}isClassicTheme(){return Rt(Ts,this)}getCSSVariableValue(e){var n;if(Rt(Ts,this))return null;if(Rt(hh,this)[`--ht-${e}`])return Rt(hh,this)[`--ht-${e}`];const r=(n=vi(Xi,this,Iq).call(this,`--ht-${e}`))!==null&&n!==void 0?n:vi(Xi,this,ID).call(this,`--ht-${e}`);if(r!==null)return Rt(hh,this)[`--ht-${e}`]=r,r}getStyleForTD(e){var n;return(n=Rt(Yh,this))===null||n===void 0?void 0:n.td[e]}getDefaultRowHeight(){if(Rt(Ts,this))return GO;const e=vi(Xi,this,Tq).call(this);return!e&&ve(Rt(Bo,this),"ht-wrapper")?(Ze(`The "${Rt(Gi,this)}" theme is enabled, but its stylesheets are missing or not imported correctly. Import the correct CSS files in order to use that theme.`),wi(Ts,this,!0),this.useTheme(),GO):e}areCellsBorderBox(){return this.getStyleForTD("box-sizing")==="border-box"}useTheme(e){if(!e){vi(Xi,this,qO).call(this),wi(Ts,this,!0),wi(Gi,this,e||void 0);return}e&&e!==Rt(Gi,this)&&(Rt(Gi,this)&&vi(Xi,this,Pq).call(this),wi(Gi,this,e),wi(Ts,this,!1),vi(Xi,this,_q).call(this),vi(Xi,this,qO).call(this))}getThemeName(){return Rt(Gi,this)}removeClassNames(){ve(Rt(Bo,this),Rt(Gi,this))&&pe(Rt(Bo,this),Rt(Gi,this))}}function Tq(){const t=this.getCSSVariableValue("line-height"),e=this.getCSSVariableValue("cell-vertical-padding"),n=Math.ceil(parseFloat(this.getStyleForTD("border-bottom-width")));return t===null||e===null||isNaN(n)?null:t+2*e+n}function _q(){pe(Rt(Bo,this),/ht-theme-.*/g),q(Rt(Bo,this),Rt(Gi,this))}function qO(){this.isClassicTheme()||wi(iE,this,getComputedStyle(Rt(Bo,this)));const t=vi(Xi,this,Mq).call(this,["box-sizing","border-bottom-width"]);Rt(Yh,this).td={...Rt(Yh,this).td,"box-sizing":t["box-sizing"],"border-bottom-width":t["border-bottom-width"]}}function Mq(t){const e=Rt(cS,this),n=Rt(Bo,this),r=e.createElement("table"),i=e.createElement("tbody"),o=e.createElement("tr"),s=e.createElement("tr"),a=e.createElement("td");s.appendChild(a),i.appendChild(o),i.appendChild(s),r.appendChild(i),n.appendChild(r);const l=getComputedStyle(a),u={};return t.forEach(c=>{u[c]=l.getPropertyValue(c)}),n.removeChild(r),u}function Iq(t){const e=Math.ceil(parseFloat(vi(Xi,this,ID).call(this,t)));return Number.isNaN(e)?null:e}function ID(t){const e=Rt(iE,this).getPropertyValue(t);return e===""?null:e}function Pq(){wi(Yh,this,{}),wi(hh,this,{}),wi(Ts,this,!0)}class Oq extends YR{constructor(e,n){super(e,new bq(n)),this.stylesHandler=new Eq(this.domBindings);const r=this.wtSettings.getSetting("facade",this);this.wtTable=new rE(this.getTableDao(),r,this.domBindings,this.wtSettings),this.wtViewport=new Sq(this.getViewportDao(),this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.selectionManager=new iq(this.wtSettings.getSetting("selections")),this.wtEvent=new vD(r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable,this.selectionManager),this.wtOverlays=new vq(this,r,this.domBindings,this.wtSettings,this.eventManager,this.wtTable),this.exportSettingsAsClassNames(),this.findOriginalHeaders()}exportSettingsAsClassNames(){const e={rowHeaders:"htRowHeaders",columnHeaders:"htColumnHeaders"},n=[],r=[];He(e,(i,o)=>{this.wtSettings.getSetting(o).length&&r.push(i),n.push(i)}),pe(this.wtTable.wtRootElement.parentNode,n),q(this.wtTable.wtRootElement.parentNode,r)}getOverlayByName(e){var n;if(!bD.includes(e))return null;const r=e.replace(/_([a-z])/g,i=>i[1].toUpperCase());return(n=this.wtOverlays[`${r}Overlay`])!==null&&n!==void 0?n:null}getViewportDao(){const e=this;return{get wot(){return e},get topOverlayTrimmingContainer(){return e.wtOverlays.topOverlay.trimmingContainer},get inlineStartOverlayTrimmingContainer(){return e.wtOverlays.inlineStartOverlay.trimmingContainer},get topScrollPosition(){return e.wtOverlays.topOverlay.getScrollPosition()},get topParentOffset(){return e.wtOverlays.topOverlay.getTableParentOffset()},get inlineStartScrollPosition(){return e.wtOverlays.inlineStartOverlay.getScrollPosition()},get inlineStartParentOffset(){return e.wtOverlays.inlineStartOverlay.getTableParentOffset()},get topOverlay(){return e.wtOverlays.topOverlay},get inlineStartOverlay(){return e.wtOverlays.inlineStartOverlay},get bottomOverlay(){return e.wtOverlays.bottomOverlay}}}}class oE{constructor(e){e instanceof YR?this._wot=e:this._initFromSettings(e)}_initFromSettings(e){e.facade=n=>{const r=new oE(n);return()=>r},this._wot=new Oq(e.table,e)}get guid(){return this._wot.guid}get rootDocument(){return this._wot.domBindings.rootDocument}get rootWindow(){return this._wot.domBindings.rootWindow}get wtSettings(){return this._wot.wtSettings}get cloneSource(){return this._wot.cloneSource}get cloneOverlay(){return this._wot.cloneOverlay}get selectionManager(){return this._wot.selectionManager}get wtViewport(){return this._wot.wtViewport}get wtOverlays(){return this._wot.wtOverlays}get wtTable(){return this._wot.wtTable}get wtEvent(){return this._wot.wtEvent}get wtScroll(){return this._wot.wtScroll}get drawn(){return this._wot.drawn}set drawn(e){this._wot.drawn=e}get activeOverlayName(){return this._wot.activeOverlayName}get drawInterrupted(){return this._wot.drawInterrupted}set drawInterrupted(e){this._wot.drawInterrupted=e}get lastMouseOver(){return this._wot.lastMouseOver}set lastMouseOver(e){this._wot.lastMouseOver=e}get momentumScrolling(){return this._wot.momentumScrolling}set momentumScrolling(e){this._wot.momentumScrolling=e}get touchApplied(){return this._wot.touchApplied}set touchApplied(e){this._wot.touchApplied=e}get domBindings(){return this._wot.domBindings}get eventListeners(){return this._wot.eventListeners}set eventListeners(e){this._wot.eventListeners=e}get eventManager(){return this._wot.eventManager}get stylesHandler(){return this._wot.stylesHandler}createCellCoords(e,n){return this._wot.createCellCoords(e,n)}createCellRange(e,n,r){return this._wot.createCellRange(e,n,r)}draw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return this._wot.draw(e),this}getCell(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this._wot.getCell(e,n)}scrollViewport(e,n,r){return this._wot.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this._wot.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this._wot.scrollViewportVertically(e,n)}getViewport(){return this._wot.getViewport()}getOverlayName(){return this._wot.cloneOverlay?this._wot.cloneOverlay.type:"master"}getOverlayByName(e){return this._wot.getOverlayByName(e)}exportSettingsAsClassNames(){return this._wot.exportSettingsAsClassNames()}update(e,n){return this._wot.wtSettings.update(e,n),this}getSetting(e,n,r,i,o){return this._wot.wtSettings.getSetting(e,n,r,i,o)}hasSetting(e){return this._wot.wtSettings.hasSetting(e)}destroy(){this._wot.destroy()}}function KO(t){let{isShiftKey:e,isLeftClick:n,isRightClick:r,coords:i,selection:o,controller:s,cellCoordsFactory:a}=t;const l=o.isSelected()?o.getSelectedRange().current():null,u=o.isSelectedByCorner(),c=o.isSelectedByRowHeader();if(o.markSource("mouse"),e&&l)i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(i):(u||c)&&i.row>=0&&i.col>=0&&!s.cell?o.setRangeEnd(a(i.row,i.col)):u&&i.row<0&&!s.column?o.setRangeEnd(a(l.to.row,i.col)):c&&i.col<0&&!s.row?o.setRangeEnd(a(i.row,l.to.col)):(!u&&!c&&i.col<0||u&&i.col<0)&&!s.row?o.selectRows(Math.max(l.from.row,0),i.row,i.col):(!u&&!c&&i.row<0||c&&i.row<0)&&!s.column&&o.selectColumns(Math.max(l.from.col,0),i.col,i.row);else{const h=!o.inInSelection(i),d=n||r&&h;i.row<0&&i.col>=0&&!s.column?d&&o.selectColumns(i.col,i.col,i.row):i.col<0&&i.row>=0&&!s.row?d&&o.selectRows(i.row,i.row,i.col):i.col>=0&&i.row>=0&&!s.cell?d&&o.setRangeStart(i):i.col<0&&i.row<0&&o.selectAll(!0,!0,{disableHeadersHighlight:!0,focusPosition:{row:0,col:0}})}o.markEndSource()}function xq(t){let{isLeftClick:e,coords:n,selection:r,controller:i,cellCoordsFactory:o}=t;if(!e)return;const s=r.isSelectedByRowHeader(),a=r.isSelectedByColumnHeader(),l=r.tableProps.countCols(),u=r.tableProps.countRows();r.markSource("mouse"),a&&!i.column?r.setRangeEnd(o(u-1,n.col)):s&&!i.row?r.setRangeEnd(o(n.row,l-1)):i.cell||r.setRangeEnd(n),r.markEndSource()}const Aq=new Map([["mousedown",KO],["mouseover",xq],["touchstart",KO]]);function XO(t,e){let{coords:n,selection:r,controller:i,cellCoordsFactory:o}=e;Aq.get(t.type)({coords:n,selection:r,controller:i,cellCoordsFactory:o,isShiftKey:t.shiftKey,isLeftClick:FR(t)||t.type==="touchstart",isRightClick:sl(t)})}const PD=new WeakMap,sE=Symbol("rootInstance");function Hq(t){PD.set(t,!0)}function Nq(t){return t===sE}function _g(t){return PD.has(t)}function Dq(t,e){OD(t,e),e.add(t)}function hs(t,e,n){OD(t,e),e.set(t,n)}function OD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ds(t,e,n){return(e=kq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kq(t){var e=Lq(t,"string");return typeof e=="symbol"?e:e+""}function Lq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yt(t,e){return t.get(Iu(t,e))}function Zn(t,e,n){return t.set(Iu(t,e),n),n}function Iu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var qC=new WeakMap,Qd=new WeakMap,Jd=new WeakMap,So=new WeakMap,ii=new WeakMap,KC=new WeakMap,XC=new WeakMap,Nl=new WeakMap,dh=new WeakSet;class $q{constructor(e){Dq(this,dh),ds(this,"hot",void 0),ds(this,"eventManager",void 0),ds(this,"settings",void 0),ds(this,"THEAD",void 0),ds(this,"TBODY",void 0),ds(this,"_wt",void 0),ds(this,"activeWt",void 0),hs(this,qC,0),hs(this,Qd,0),ds(this,"postponedAdjustElementsSize",!1),hs(this,Jd,!1),hs(this,So,void 0),hs(this,ii,void 0),hs(this,KC,0),hs(this,XC,0),hs(this,Nl,null),this.hot=e,this.eventManager=new _i(this.hot),this.settings=this.hot.getSettings(),this.createElements(),this.registerEvents(),this.initializeWalkontable()}render(){if(!this.hot.isRenderSuspended()){const e=this.hot.forceFullRender;this.hot.runHooks("beforeRender",e),this.postponedAdjustElementsSize&&(this.postponedAdjustElementsSize=!1,this.adjustElementsSize()),this._wt.draw(!e),Iu(dh,this,Vq).call(this),this.hot.runHooks("afterRender",e),this.hot.forceFullRender=!1}}adjustElementsSize(){this.hot.isRenderSuspended()?this.postponedAdjustElementsSize=!0:this._wt.wtOverlays.adjustElementsSize()}getCellAtCoords(e,n){const r=this._wt.getCell(e,n);return r<0?null:r}scrollViewport(e,n,r){return this._wt.scrollViewport(e,n,r)}scrollViewportHorizontally(e,n){return this._wt.scrollViewportHorizontally(e,n)}scrollViewportVertically(e,n){return this._wt.scrollViewportVertically(e,n)}createElements(){const{rootElement:e,rootDocument:n}=this.hot,r=e.getAttribute("style");r&&e.setAttribute("data-originalstyle",r),q(e,"handsontable"),Zn(ii,this,n.createElement("TABLE")),q(Yt(ii,this),"htCore"),this.hot.getSettings().tableClassName&&q(Yt(ii,this),this.hot.getSettings().tableClassName),this.settings.ariaTags&&(ye(Yt(ii,this),[zo()]),ye(e,[kU(),AN(-1),tp(this.hot.countCols()),XU()])),this.THEAD=n.createElement("THEAD"),Yt(ii,this).appendChild(this.THEAD),this.TBODY=n.createElement("TBODY"),Yt(ii,this).appendChild(this.TBODY),this.hot.table=Yt(ii,this),this.hot.container.insertBefore(Yt(ii,this),this.hot.container.firstChild)}registerEvents(){const{rootElement:e,rootDocument:n,selection:r,rootWindow:i}=this.hot,o=n.documentElement;this.eventManager.addEventListener(e,"mousedown",a=>{Zn(Jd,this,!0),this.isTextSelectionAllowed(a.target)||(AP(i),a.preventDefault(),i.focus())}),this.eventManager.addEventListener(e,"mouseup",()=>{Zn(Jd,this,!1)}),this.eventManager.addEventListener(e,"mousemove",a=>{Yt(Jd,this)&&!this.isTextSelectionAllowed(a.target)&&(this.settings.fragmentSelection&&AP(i),a.preventDefault())}),this.eventManager.addEventListener(o,"keyup",a=>{r.isInProgress()&&!a.shiftKey&&r.finish()}),this.eventManager.addEventListener(o,"mouseup",a=>{r.isInProgress()&&FR(a)&&r.finish(),Zn(So,this,!1);const l=UN(n.activeElement);Tg(n.activeElement)&&!l||(l||!r.isSelected()&&!r.isSelectedByAnyHeader()&&!e.contains(a.target)&&!sl(a))&&this.hot.unlisten()}),this.eventManager.addEventListener(o,"contextmenu",a=>{r.isInProgress()&&sl(a)&&(r.finish(),Zn(So,this,!1))}),this.eventManager.addEventListener(o,"touchend",()=>{r.isInProgress()&&r.finish(),Zn(So,this,!1)}),this.eventManager.addEventListener(o,"mousedown",a=>{const l=a.target,u=a.x||a.clientX,c=a.y||a.clientY;let h=a.target;if(Yt(So,this)||!e||!this.hot.view)return;const{holder:d}=this._wt.wtTable;if(h===d){const m=yn(n);if(n.elementFromPoint(u+m,c)!==d||n.elementFromPoint(u,c+m)!==d)return}else for(;h!==o;){if(h===null){if(a.isTargetWebComponent)break;return}if(h===e)return;h=h.parentNode}(typeof this.settings.outsideClickDeselects=="function"?this.settings.outsideClickDeselects(l):this.settings.outsideClickDeselects)?this.hot.deselectCell():this.hot.destroyEditor(!1,!1)});let s=Au(i);for(;s!==null;)this.eventManager.addEventListener(s.document.documentElement,"click",()=>{this.hot.unlisten()}),s=Au(s);this.eventManager.addEventListener(Yt(ii,this),"selectstart",a=>{this.settings.fragmentSelection||Tg(a.target)||a.preventDefault()})}translateFromRenderableToVisualCoords(e){let{row:n,col:r}=e;return this.hot._createCellCoords(...this.translateFromRenderableToVisualIndex(n,r))}translateFromRenderableToVisualIndex(e,n){let r=e>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(e):e,i=n>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(n):n;return r===null&&(r=e),i===null&&(i=n),[r,i]}countRenderableIndexes(e,n){const r=Math.min(e.getNotTrimmedIndexesLength(),n),i=e.getNearestNotHiddenIndex(r-1,-1);return i===null?0:e.getRenderableFromVisualIndex(i)+1}countRenderableColumns(){return this.countRenderableIndexes(this.hot.columnIndexMapper,this.settings.maxCols)}countRenderableRows(){return this.countRenderableIndexes(this.hot.rowIndexMapper,this.settings.maxRows)}countNotHiddenRowIndexes(e,n){return this.countNotHiddenIndexes(e,n,this.hot.rowIndexMapper,this.countRenderableRows())}countNotHiddenColumnIndexes(e,n){return this.countNotHiddenIndexes(e,n,this.hot.columnIndexMapper,this.countRenderableColumns())}countNotHiddenIndexes(e,n,r,i){if(isNaN(e)||e<0)return 0;const o=r.getNearestNotHiddenIndex(e,n),s=r.getRenderableFromVisualIndex(o);if(!Number.isInteger(s))return 0;let a=0;return n<0?a=s+1:n>0&&(a=i-s),a}countNotHiddenFixedColumnsStart(){const e=this.hot.countCols(),n=Math.min(parseInt(this.settings.fixedColumnsStart,10),e)-1;return this.countNotHiddenColumnIndexes(n,-1)}countNotHiddenFixedRowsTop(){const e=this.hot.countRows(),n=Math.min(parseInt(this.settings.fixedRowsTop,10),e)-1;return this.countNotHiddenRowIndexes(n,-1)}countNotHiddenFixedRowsBottom(){const e=this.hot.countRows(),n=Math.max(e-parseInt(this.settings.fixedRowsBottom,10),0);return this.countNotHiddenRowIndexes(n,1)}countRenderableColumnsInRange(e,n){let r=0;for(let i=e;i<=n;i++)this.hot.columnIndexMapper.getRenderableFromVisualIndex(i)!==null&&(r+=1);return r}countRenderableRowsInRange(e,n){let r=0;for(let i=e;i<=n;i++)this.hot.rowIndexMapper.getRenderableFromVisualIndex(i)!==null&&(r+=1);return r}getStylesHandler(){return this._wt.stylesHandler}getDefaultRowHeight(){return this._wt.stylesHandler.getDefaultRowHeight()}addClassNameToLicenseElement(e){var n;const r=(n=this.hot.rootElement.parentNode)===null||n===void 0?void 0:n.querySelector(".hot-display-license-info");r&&q(r,e)}removeClassNameFromLicenseElement(e){var n;const r=(n=this.hot.rootElement.parentNode)===null||n===void 0?void 0:n.querySelector(".hot-display-license-info");r&&pe(r,e)}isMainTableNotFullyCoveredByOverlays(){const e=this.countNotHiddenFixedRowsTop()+this.countNotHiddenFixedRowsBottom(),n=this.countNotHiddenFixedColumnsStart();return this.hot.countRenderedRows()>e&&this.hot.countRenderedCols()>n}initializeWalkontable(){const e={ariaTags:this.settings.ariaTags,rtlMode:this.hot.isRtl(),externalRowCalculator:this.hot.getPlugin("autoRowSize")&&this.hot.getPlugin("autoRowSize").isEnabled(),table:Yt(ii,this),isDataViewInstance:()=>_g(this.hot),preventOverflow:()=>this.settings.preventOverflow,preventWheel:()=>this.settings.preventWheel,viewportColumnRenderingThreshold:()=>this.settings.viewportColumnRenderingThreshold,viewportRowRenderingThreshold:()=>this.settings.viewportRowRenderingThreshold,data:(o,s)=>this.hot.getDataAtCell(...this.translateFromRenderableToVisualIndex(o,s)),totalRows:()=>this.countRenderableRows(),totalColumns:()=>this.countRenderableColumns(),fixedColumnsStart:()=>this.countNotHiddenFixedColumnsStart(),fixedRowsTop:()=>this.countNotHiddenFixedRowsTop(),fixedRowsBottom:()=>this.countNotHiddenFixedRowsBottom(),shouldRenderInlineStartOverlay:()=>this.settings.fixedColumnsStart>0||e.rowHeaders().length>0,shouldRenderTopOverlay:()=>this.settings.fixedRowsTop>0||e.columnHeaders().length>0,shouldRenderBottomOverlay:()=>this.settings.fixedRowsBottom>0,minSpareRows:()=>this.settings.minSpareRows,renderAllRows:this.settings.renderAllRows,renderAllColumns:this.settings.renderAllColumns,rowHeaders:()=>{const o=[];return this.hot.hasRowHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.rowIndexMapper.getVisualFromRenderableIndex(s):s;this.appendRowHeader(l,a)}),this.hot.runHooks("afterGetRowHeaderRenderers",o),Zn(Qd,this,o.length),this.hot.getSettings().ariaTags&&Iu(dh,this,xD).call(this)===this.hot.countCols()&&Iu(dh,this,Fq).call(this,Yt(Qd,this)),o},columnHeaders:()=>{const o=[];return this.hot.hasColHeaders()&&o.push((s,a)=>{const l=s>=0?this.hot.columnIndexMapper.getVisualFromRenderableIndex(s):s;this.appendColHeader(l,a)}),this.hot.runHooks("afterGetColumnHeaderRenderers",o),Zn(qC,this,o.length),o},columnWidth:o=>{const s=this.hot.columnIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getColWidth(s===null?o:s)},rowHeight:o=>{const s=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o);return this.hot.getRowHeight(s===null?o:s)},rowHeightByOverlayName:(o,s)=>{const a=this.hot.rowIndexMapper.getVisualFromRenderableIndex(o),l=a===null?o:a;return this.hot.runHooks("modifyRowHeightByOverlayName",this.hot.getRowHeight(l),l,s)},cellRenderer:(o,s,a)=>{const[l,u]=this.translateFromRenderableToVisualIndex(o,s),c=this.hot.runHooks("modifyGetCellCoords",l,u,!1,"meta");let h=l,d=u;Array.isArray(c)&&([h,d]=c);const f=this.hot.getCellMeta(h,d),m=this.hot.colToProp(d);let C=this.hot.getDataAtRowProp(h,m);this.hot.hasHook("beforeValueRender")&&(C=this.hot.runHooks("beforeValueRender",C,f)),this.hot.runHooks("beforeRenderer",a,l,u,m,C,f),this.hot.getCellRenderer(f)(this.hot,a,l,u,m,C,f),this.hot.runHooks("afterRenderer",a,l,u,m,C,f)},selections:this.hot.selection.highlight,hideBorderOnMouseDownOver:()=>this.settings.fragmentSelection,onWindowResize:()=>{this.hot&&!this.hot.isDestroyed&&this.hot.refreshDimensions()},onContainerElementResize:()=>{this.hot&&!this.hot.isDestroyed&&Hu(this.hot.rootElement)&&this.hot.refreshDimensions()},onCellMouseDown:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.hot.listen(),this.activeWt=l,Zn(So,this,!0),Zn(Nl,this,{x:o.clientX,y:o.clientY}),this.hot.runHooks("beforeOnCellMouseDown",o,u,a,c),!za(o)&&(XO(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseDown",o,u,a),this.activeWt=this._wt)},onCellContextMenu:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,Zn(So,this,!1),this.hot.selection.isInProgress()&&this.hot.selection.finish(),this.hot.runHooks("beforeOnCellContextMenu",o,u,a),!za(o)&&(this.hot.runHooks("afterOnCellContextMenu",o,u,a),this.activeWt=this._wt)},onCellMouseOut:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOut",o,u,a),!za(o)&&(this.hot.runHooks("afterOnCellMouseOut",o,u,a),this.activeWt=this._wt)},onCellMouseOver:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s),c={row:!1,column:!1,cell:!1};this.activeWt=l,this.hot.runHooks("beforeOnCellMouseOver",o,u,a,c),!za(o)&&(Yt(So,this)&&(!Yt(Nl,this)||Yt(Nl,this).x!==o.clientX||Yt(Nl,this).y!==o.clientY)&&XO(o,{coords:u,selection:this.hot.selection,controller:c,cellCoordsFactory:(h,d)=>this.hot._createCellCoords(h,d)}),this.hot.runHooks("afterOnCellMouseOver",o,u,a),this.activeWt=this._wt,Zn(Nl,this,null))},onCellMouseUp:(o,s,a,l)=>{const u=this.translateFromRenderableToVisualCoords(s);this.activeWt=l,this.hot.runHooks("beforeOnCellMouseUp",o,u,a),!(za(o)||this.hot.isDestroyed)&&(this.hot.runHooks("afterOnCellMouseUp",o,u,a),this.activeWt=this._wt)},onCellCornerMouseDown:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerMouseDown",o)},onCellCornerDblClick:o=>{o.preventDefault(),this.hot.runHooks("afterOnCellCornerDblClick",o)},beforeDraw:(o,s)=>this.beforeRender(o,s),onDraw:o=>this.afterRender(o),onBeforeViewportScrollVertically:(o,s)=>{const a=this.hot.rowIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollVertically",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onBeforeViewportScrollHorizontally:(o,s)=>{const a=this.hot.columnIndexMapper,l=o<0;let u=o;return!l&&(u=a.getVisualFromRenderableIndex(o),u===null)?o:(u=this.hot.runHooks("beforeViewportScrollHorizontally",u,s),this.hot.runHooks("beforeViewportScroll"),l?u:a.getRenderableFromVisualIndex(u))},onScrollVertically:()=>{this.hot.runHooks("afterScrollVertically"),this.hot.runHooks("afterScroll")},onScrollHorizontally:()=>{this.hot.runHooks("afterScrollHorizontally"),this.hot.runHooks("afterScroll")},onBeforeRemoveCellClassNames:()=>this.hot.runHooks("beforeRemoveCellClassNames"),onBeforeHighlightingRowHeader:(o,s,a)=>{const l=this.hot.rowIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingRowHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onBeforeHighlightingColumnHeader:(o,s,a)=>{const l=this.hot.columnIndexMapper,u=o<0;let c=o;u||(c=l.getVisualFromRenderableIndex(o));const h=this.hot.runHooks("beforeHighlightingColumnHeader",c,s,a);return u?h:l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(h,1))},onAfterDrawSelection:(o,s,a)=>{let l;const[u,c]=this.translateFromRenderableToVisualIndex(o,s),h=this.hot.selection.getSelectedRange();if(h.size()>0){const f=h.peekByIndex(a??0);l=[f.from.row,f.from.col,f.to.row,f.to.col]}return this.hot.runHooks("afterDrawSelection",u,c,l,a)},onBeforeDrawBorders:(o,s)=>{const[a,l,u,c]=o,h=[this.hot.rowIndexMapper.getVisualFromRenderableIndex(a),this.hot.columnIndexMapper.getVisualFromRenderableIndex(l),this.hot.rowIndexMapper.getVisualFromRenderableIndex(u),this.hot.columnIndexMapper.getVisualFromRenderableIndex(c)];return this.hot.runHooks("beforeDrawBorders",h,s)},onBeforeTouchScroll:()=>this.hot.runHooks("beforeTouchScroll"),onAfterMomentumScroll:()=>this.hot.runHooks("afterMomentumScroll"),onModifyRowHeaderWidth:o=>this.hot.runHooks("modifyRowHeaderWidth",o),onModifyGetCellCoords:(o,s,a,l)=>{const u=this.hot.rowIndexMapper,c=this.hot.columnIndexMapper,h=s>=0?c.getVisualFromRenderableIndex(s):s,d=o>=0?u.getVisualFromRenderableIndex(o):o,f=this.hot.runHooks("modifyGetCellCoords",d,h,a,l);if(Array.isArray(f)){const[m,C,y,E]=f;return[m>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(m,1)):m,C>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(C,1)):C,y>=0?u.getRenderableFromVisualIndex(u.getNearestNotHiddenIndex(y,-1)):y,E>=0?c.getRenderableFromVisualIndex(c.getNearestNotHiddenIndex(E,-1)):E]}},onModifyGetCoordsElement:(o,s)=>{const a=this.hot.rowIndexMapper,l=this.hot.columnIndexMapper,u=s>=0?l.getVisualFromRenderableIndex(s):s,c=o>=0?a.getVisualFromRenderableIndex(o):o,h=this.hot.runHooks("modifyGetCoordsElement",c,u);if(Array.isArray(h)){const[d,f]=h;return[d>=0?a.getRenderableFromVisualIndex(a.getNearestNotHiddenIndex(d,1)):d,f>=0?l.getRenderableFromVisualIndex(l.getNearestNotHiddenIndex(f,1)):f]}},viewportRowCalculatorOverride:o=>{let s=this.settings.viewportRowRenderingOffset;if(s==="auto"&&this.settings.fixedRowsTop&&(s=10),s>0||s==="auto"){const a=this.countRenderableRows(),l=o.startRow,u=o.endRow;if(typeof s=="number")o.startRow=Math.max(l-s,0),o.endRow=Math.min(u+s,a-1);else if(s==="auto"){const c=Math.max(1,Math.ceil(u/a*12));o.startRow=Math.max(l-c,0),o.endRow=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportRowCalculatorOverride",o)},viewportColumnCalculatorOverride:o=>{let s=this.settings.viewportColumnRenderingOffset;if(s==="auto"&&this.settings.fixedColumnsStart&&(s=10),s>0||s==="auto"){const a=this.countRenderableColumns(),l=o.startColumn,u=o.endColumn;if(typeof s=="number"&&(o.startColumn=Math.max(l-s,0),o.endColumn=Math.min(u+s,a-1)),s==="auto"){const c=Math.max(1,Math.ceil(u/a*6));o.startColumn=Math.max(l-c,0),o.endColumn=Math.min(u+c,a-1)}}this.hot.runHooks("afterViewportColumnCalculatorOverride",o)},rowHeaderWidth:()=>this.settings.rowHeaderWidth,columnHeaderHeight:()=>{const o=this.hot.runHooks("modifyColumnHeaderHeight");return this.settings.columnHeaderHeight||o}};this.hot.runHooks("beforeInitWalkontable",e),this._wt=new oE(e),this.activeWt=this._wt;const n=this._wt.wtTable.spreader,{width:r,height:i}=this.hot.rootElement.getBoundingClientRect();this.setLastSize(r,i),this.eventManager.addEventListener(n,"mousedown",o=>{o.target===n&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(n,"contextmenu",o=>{o.target===n&&o.which===3&&o.stopPropagation()}),this.eventManager.addEventListener(this.hot.rootDocument.documentElement,"click",()=>{this.settings.observeDOMVisibility&&this._wt.drawInterrupted&&this.hot.render()})}isTextSelectionAllowed(e){if(Tg(e))return!0;const n=tl(e,this._wt.wtTable.spreader);return!!(this.settings.fragmentSelection===!0&&n||this.settings.fragmentSelection==="cell"&&this.isSelectedOnlyCell()&&n||!this.settings.fragmentSelection&&this.isCellEdited()&&this.isSelectedOnlyCell())}isMouseDown(){return Yt(So,this)}isSelectedOnlyCell(){var e,n;return(e=(n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingleCell())!==null&&e!==void 0?e:!1}isCellEdited(){const e=this.hot.getActiveEditor();return e&&e.isOpened()}beforeRender(e,n){e&&this.hot.runHooks("beforeViewRender",this.hot.forceFullRender,n)}afterRender(e){e&&this.hot.runHooks("afterViewRender",this.hot.forceFullRender)}appendRowHeader(e,n){if(n.firstChild){const r=n.firstChild;if(!ve(r,"relative")){ts(n),this.appendRowHeader(e,n);return}this.updateCellHeader(r.querySelector(".rowHeader"),e,this.hot.getRowHeader)}else{const{rootDocument:r,getRowHeader:i}=this.hot,o=r.createElement("div"),s=r.createElement("span");o.className="relative",s.className="rowHeader",this.updateCellHeader(s,e,i),o.appendChild(s),n.appendChild(o)}this.hot.runHooks("afterGetRowHeader",e,n)}appendColHeader(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.hot.getColHeader,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;const o=()=>{const s=e>=0?this.hot.getColumnMeta(e).headerClassName:null;return s?s.split(" "):[]};if(n.firstChild){const s=n.firstChild;ve(s,"relative")?(this.updateCellHeader(s.querySelector(".colHeader"),e,r,i),s.className="",q(s,["relative",...o()])):(ts(n),this.appendColHeader(e,n,r,i))}else{const{rootDocument:s}=this.hot,a=s.createElement("div"),l=s.createElement("span"),u=o();a.classList.add("relative",...u),l.className="colHeader",this.settings.ariaTags&&(ye(a,...zo()),ye(l,...zo())),this.updateCellHeader(l,e,r,i),a.appendChild(l),n.appendChild(a)}this.hot.runHooks("afterGetColHeader",e,n,i)}updateCellHeader(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=n;const s=this._wt.wtOverlays.getParentOverlay(e)||this._wt;e.parentNode&&(ve(e,"colHeader")?o=s.wtTable.columnFilter.sourceToRendered(n):ve(e,"rowHeader")&&(o=s.wtTable.rowFilter.sourceToRendered(n))),o>-1?Xu(e,r(n,i)):(ol(e," "),q(e,"cornerHeader"))}maximumVisibleElementWidth(e){const r=this._wt.wtViewport.getWorkspaceWidth()-e;return r>0?r:0}maximumVisibleElementHeight(e){const r=this._wt.wtViewport.getWorkspaceHeight()-e;return r>0?r:0}setLastSize(e,n){Zn(KC,this,e),Zn(XC,this,n)}getLastSize(){return{width:Yt(KC,this),height:Yt(XC,this)}}getFirstRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());return e.getNearestNotHiddenIndex(n??0,1)}getLastRenderedVisibleRow(){if(!this._wt.wtViewport.rowsRenderCalculator)return null;const e=this.hot.rowIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());return e.getNearestNotHiddenIndex(n??this.hot.countRows()-1,-1)}getFirstRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());return e.getNearestNotHiddenIndex(n??0,1)}getLastRenderedVisibleColumn(){if(!this._wt.wtViewport.columnsRenderCalculator)return null;const e=this.hot.columnIndexMapper,n=e.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());return e.getNearestNotHiddenIndex(n??this.hot.countCols()-1,-1)}getFirstFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow())}getLastFullyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow())}getFirstFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn())}getLastFullyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn())}getFirstPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow())}getLastPartiallyVisibleRow(){return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow())}getFirstPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn())}getLastPartiallyVisibleColumn(){return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn())}getColumnHeadersCount(){return Yt(qC,this)}getRowHeadersCount(){return Yt(Qd,this)}getViewportWidth(){return this._wt.wtViewport.getViewportWidth()}getWorkspaceWidth(){return this._wt.wtViewport.getWorkspaceWidth()}getViewportHeight(){return this._wt.wtViewport.getViewportHeight()}getWorkspaceHeight(){return this._wt.wtViewport.getWorkspaceHeight()}getElementOverlayName(e){var n;return((n=this._wt.wtOverlays.getParentOverlay(e))!==null&&n!==void 0?n:this._wt).wtTable.name}getOverlayByName(e){return this._wt.getOverlayByName(e)}getActiveOverlayName(){return this._wt.activeOverlayName}isVisible(){return this._wt.wtTable.isVisible()}hasVerticalScroll(){return this._wt.wtViewport.hasVerticalScroll()}hasHorizontalScroll(){return this._wt.wtViewport.hasHorizontalScroll()}getTableWidth(){return this._wt.wtTable.getWidth()}getTableHeight(){return this._wt.wtTable.getHeight()}getTableOffset(){return this._wt.wtViewport.getWorkspaceOffset()}getRowHeaderWidth(){return this._wt.wtViewport.getRowHeaderWidth()}getColumnHeaderHeight(){return this._wt.wtViewport.getColumnHeaderHeight()}isVerticallyScrollableByWindow(){return this._wt.wtViewport.isVerticallyScrollableByWindow()}isHorizontallyScrollableByWindow(){return this._wt.wtViewport.isHorizontallyScrollableByWindow()}destroy(){this._wt.destroy(),this.eventManager.destroy()}}function xD(){return parseInt(this.hot.rootElement.getAttribute(tp()[0]),10)}function Fq(t){const e=Iu(dh,this,xD).call(this)+t;ye(this.hot.rootElement,...tp(e))}function Vq(){const t=this.hot.rootElement;this.hasVerticalScroll()?q(t,"htHasScrollY"):pe(t,"htHasScrollY"),this.hasHorizontalScroll()?q(t,"htHasScrollX"):pe(t,"htHasScrollX")}var ZO={},QO={},JO;function Wq(){if(JO)return QO;JO=1;var t=dt(),e=an(),n=zu(),r=dr(),i=un(),o=co(),s=fr(),a=Xs(),l=a("every",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{every:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return!n(h,function(f,m){if(!c(f,d++))return m()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),QO}var ex;function Bq(){return ex||(ex=1,Wq()),ZO}Bq();const jq="ABCDEFGHIJKLMNOPQRSTUVWXYZ",tx=jq.length;function Uq(t){let e=t+1,n="",r;for(;e>0;)r=(e-1)%tx,n=String.fromCharCode(65+r)+n,e=parseInt((e-r)/tx,10);return n}function AD(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=t;const r=[];return(!Array.isArray(t)||!Array.isArray(t[0]))&&(n=[t]),n.forEach((i,o)=>{Array.isArray(i)?i.forEach((s,a)=>{r.push([o+e,a,s])}):Object.keys(i).forEach(s=>{r.push([o+e,s,i[s]])})}),r}function HD(t){let e=0;return Array.isArray(t)&&(t[0]&&Array.isArray(t[0])?e=t[0].length:t[0]&&Ae(t[0])&&(e=$R(t[0]))),e}function zq(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>Array.isArray(e)))}function Yq(t){return!!(Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object"&&!Array.isArray(e)&&e!==null))}function Ec(t,e,n){return(e=Gq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gq(t){var e=qq(t,"string");return typeof e=="symbol"?e:e+""}function qq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Kq{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];Ec(this,"hot",void 0),Ec(this,"data",void 0),Ec(this,"dataType","array"),Ec(this,"colToProp",()=>{}),Ec(this,"propToCol",()=>{}),this.hot=e,this.data=n}modifyRowData(e){let n;return this.hot.hasHook("modifyRowData")&&(n=this.hot.runHooks("modifyRowData",e)),n!==void 0&&!Number.isInteger(n)?n:this.data[e]}getData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return!this.data||this.data.length===0?this.data:this.getByRange(null,null,e)}setData(e){this.data=e}getAtColumn(e){const n=[];return I(this.data,(r,i)=>{const o=this.getAtCell(i,e);n.push(o)}),n}getAtRow(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const o=n===void 0&&r===void 0,{dataDotNotation:s}=this.hot.getSettings();let a=null,l=null;if(a=this.modifyRowData(e),Array.isArray(a))l=[],o?a.forEach((u,c)=>{l[c]=this.getAtPhysicalCell(e,c,a)}):de(n,r,u=>{l[u-n]=this.getAtPhysicalCell(e,u,a)});else if(Ae(a)||ot(a))if(i?l=[]:l={},!o||i){const c=this.countFirstRowKeys()-1;de(0,c,h=>{const d=this.colToProp(h);if(h>=(n||0)&&h<=(r||c)&&!Number.isInteger(d)){const f=this.getAtPhysicalCell(e,d,a);i?l.push(f):s?bC(l,d,f):l[d]=f}})}else He(a,(u,c)=>{const h=this.getAtPhysicalCell(e,c,a);s?bC(l,c,h):l[c]=h});return l}setAtCell(e,n,r){if(!(e>=this.countRows()||n>=this.countFirstRowKeys())){if(this.hot.hasHook("modifySourceData")){const i=Ir(r);this.hot.runHooks("modifySourceData",e,n,i,"set"),i.isTouched()&&(r=i.value)}["__proto__","constructor","prototype"].includes(e)||(Number.isInteger(n)?this.data[e][n]=r:bC(this.data[e],n,r))}}getAtPhysicalCell(e,n,r){let i=null;if(r)if(typeof n=="string"){const{dataDotNotation:o}=this.hot.getSettings();i=o?bz(r,n):r[n]}else typeof n=="function"?i=n(r):i=r[n];if(this.hot.hasHook("modifySourceData")){const o=Ir(i);this.hot.runHooks("modifySourceData",e,n,o,"get"),o.isTouched()&&(i=o.value)}return i}getAtCell(e,n){const r=this.modifyRowData(e);return this.getAtPhysicalCell(e,this.colToProp(n),r)}getByRange(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=!1,o=null,s=null,a=null,l=null;e===null||n===null?(i=!0,o=0,a=this.countRows()-1):(o=Math.min(e.row,n.row),s=Math.min(e.col,n.col),a=Math.max(e.row,n.row),l=Math.max(e.col,n.col));const u=[];return de(o,a,c=>{u.push(i?this.getAtRow(c,void 0,void 0,r):this.getAtRow(c,s,l,r))}),u}countRows(){if(this.hot.hasHook("modifySourceLength")){const e=this.hot.runHooks("modifySourceLength");if(Number.isInteger(e))return e}return this.data.length}countFirstRowKeys(){return HD(this.data)}destroy(){this.data=null,this.hot=null}}var nx={},rx={},ix;function Xq(){if(ix)return rx;ix=1;var t=dt(),e=an(),n=zu(),r=dr(),i=un(),o=co(),s=fr(),a=Xs(),l=a("some",TypeError);return t({target:"Iterator",proto:!0,real:!0,forced:l},{some:function(c){i(this);try{r(c)}catch(f){s(this,"throw",f)}if(l)return e(l,this,c);var h=o(this),d=0;return n(h,function(f,m){if(c(f,d++))return m()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}}),rx}var ox;function Zq(){return ox||(ox=1,Xq()),nx}Zq();function sx(t,e,n){return(e=Qq(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qq(t){var e=Jq(t,"string");return typeof e=="symbol"?e:e+""}function Jq(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class bl{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;sx(this,"indexedValues",[]),sx(this,"initValueOrFn",void 0),this.initValueOrFn=e}getValues(){return this.indexedValues}getValueAtIndex(e){const n=this.indexedValues;if(e<n.length)return n[e]}setValues(e){this.indexedValues=e.slice(),this.runLocalHooks("change")}setValueAtIndex(e,n){return e<this.indexedValues.length?(this.indexedValues[e]=n,this.runLocalHooks("change"),!0):!1}clear(){this.setDefaultValues()}getLength(){return this.getValues().length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.indexedValues.length=0,ot(this.initValueOrFn)?de(e-1,n=>this.indexedValues.push(this.initValueOrFn(n))):de(e-1,()=>this.indexedValues.push(this.initValueOrFn)),this.runLocalHooks("change")}init(e){return this.setDefaultValues(e),this.runLocalHooks("init"),this}insert(){this.runLocalHooks("change")}remove(){this.runLocalHooks("change")}destroy(){this.clearLocalHooks(),this.indexedValues=null,this.initValueOrFn=null}}ut(bl,Rn);function aE(t,e,n,r){const i=n.length?n[0]:void 0;return[...t.slice(0,i),...n.map((o,s)=>ot(r)?r(o,s):r),...i===void 0?[]:t.slice(i)]}function lE(t,e){return rl(t,(n,r)=>e.includes(r)===!1)}class Qs extends bl{insert(e,n){this.indexedValues=aE(this.indexedValues,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){this.indexedValues=lE(this.indexedValues,e),super.remove(e)}}class cp extends Qs{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getHiddenIndexes(){return gr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}function uE(t,e,n){return[...t.slice(0,e),...n,...t.slice(e)]}function Gh(t,e){return rl(t,n=>e.includes(n)===!1)}function cE(t,e){return Be(t,n=>n-e.filter(r=>r<n).length)}function hE(t,e){const n=e[0],r=e.length;return Be(t,i=>i>=n?i+r:i)}function eK(t,e,n){return(e=tK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tK(t){var e=nK(t,"string");return typeof e=="symbol"?e:e+""}function nK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class hp extends bl{constructor(){super(...arguments),eK(this,"orderOfIndexes",[])}getValues(){return this.orderOfIndexes.map(e=>this.indexedValues[e])}setValues(e){this.orderOfIndexes=[...Array(e.length).keys()],super.setValues(e)}setValueAtIndex(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.orderOfIndexes.length;return e<this.indexedValues.length?(this.indexedValues[e]=n,this.orderOfIndexes.includes(e)===!1&&this.orderOfIndexes.splice(r,0,e),this.runLocalHooks("change"),!0):!1}clearValue(e){this.orderOfIndexes=Gh(this.orderOfIndexes,[e]),ot(this.initValueOrFn)?super.setValueAtIndex(e,this.initValueOrFn(e)):super.setValueAtIndex(e,this.initValueOrFn)}getLength(){return this.orderOfIndexes.length}setDefaultValues(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.indexedValues.length;this.orderOfIndexes.length=0,super.setDefaultValues(e)}insert(e,n){this.indexedValues=aE(this.indexedValues,e,n,this.initValueOrFn),this.orderOfIndexes=hE(this.orderOfIndexes,n),super.insert(e,n)}remove(e){this.indexedValues=lE(this.indexedValues,e),this.orderOfIndexes=Gh(this.orderOfIndexes,e),this.orderOfIndexes=cE(this.orderOfIndexes,e),super.remove(e)}getEntries(){return this.orderOfIndexes.map(e=>[e,this.getValueAtIndex(e)])}}class Ed extends Qs{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;super(e)}getTrimmedIndexes(){return gr(this.getValues(),(e,n,r)=>(n&&e.push(r),e),[])}}const ax=new Map([["indexesSequence",{getListWithInsertedItems:uE,getListWithRemovedItems:Gh}],["physicallyIndexed",{getListWithInsertedItems:aE,getListWithRemovedItems:lE}]]),ND=t=>{if(ax.has(t)===!1)throw new Error(`Alter strategy with ID '${t}' does not exist.`);return ax.get(t)};class DD extends bl{constructor(){super(e=>e)}insert(e,n){const r=hE(this.indexedValues,n);this.indexedValues=uE(r,e,n),super.insert(e,n)}remove(e){const n=Gh(this.indexedValues,e);this.indexedValues=cE(n,e),super.remove(e)}}const lx=new Map([["hiding",cp],["index",bl],["linkedPhysicalIndexToValue",hp],["physicalIndexToValue",Qs],["trimming",Ed]]);function rK(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!lx.has(t))throw new Error(`The provided map type ("${t}") does not exist.`);return new(lx.get(t))(e)}function iK(t,e,n){return(e=oK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oK(t){var e=sK(t,"string");return typeof e=="symbol"?e:e+""}function sK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dE{constructor(){iK(this,"collection",new Map)}register(e,n){this.collection.has(e)===!1&&(this.collection.set(e,n),n.addLocalHook("change",()=>this.runLocalHooks("change",n)))}unregister(e){const n=this.collection.get(e);ae(n)&&(n.destroy(),this.collection.delete(e),this.runLocalHooks("change",n))}unregisterAll(){this.collection.forEach((e,n)=>this.unregister(n)),this.collection.clear()}get(e){return It(e)?Array.from(this.collection.values()):this.collection.get(e)}getLength(){return this.collection.size}removeFromEvery(e){this.collection.forEach(n=>{n.remove(e)})}insertToEvery(e,n){this.collection.forEach(r=>{r.insert(e,n)})}initEvery(e){this.collection.forEach(n=>{n.init(e)})}}ut(dE,Rn);function ZC(t,e,n){return(e=aK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aK(t){var e=lK(t,"string");return typeof e=="symbol"?e:e+""}function lK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ux extends dE{constructor(e,n){super(),ZC(this,"mergedValuesCache",[]),ZC(this,"aggregationFunction",void 0),ZC(this,"fallbackValue",void 0),this.aggregationFunction=e,this.fallbackValue=n}getMergedValues(){if((arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0)return this.mergedValuesCache;if(this.getLength()===0)return[];const n=Be(this.get(),o=>o.getValues()),r=[],i=ae(n[0])&&n[0].length||0;for(let o=0;o<i;o+=1){const s=[];for(let a=0;a<this.getLength();a+=1)s.push(n[a][o]);r.push(s)}return Be(r,this.aggregationFunction)}getMergedValueAtIndex(e,n){const r=this.getMergedValues(n)[e];return ae(r)?r:this.fallbackValue}updateCache(){this.mergedValuesCache=this.getMergedValues(!1)}}function uK(t,e,n){cK(t,e),e.set(t,n)}function cK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hK(t,e,n){return t.set(kD(t,e),n),n}function dK(t,e){return t.get(kD(t,e))}function kD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var QC=new WeakMap;class LD{constructor(){uK(this,QC,[])}subscribe(e){return this.addLocalHook("change",e),this._write(dK(QC,this)),this}unsubscribe(){return this.runLocalHooks("unsubscribe"),this.clearLocalHooks(),this}_write(e){return e.length>0&&this.runLocalHooks("change",e),this}_writeInitialChanges(e){hK(QC,this,e)}}ut(LD,Rn);function cx(t,e){const n=[];let r=0,i=0;for(;r<t.length&&i<e.length;r++,i++)t[r]!==e[i]&&n.push({op:"replace",index:i,oldValue:t[r],newValue:e[i]});for(;r<e.length;r++)n.push({op:"insert",index:r,oldValue:void 0,newValue:e[r]});for(;i<t.length;i++)n.push({op:"remove",index:i,oldValue:t[i],newValue:void 0});return n}function Tc(t,e,n){fK(t,e),e.set(t,n)}function fK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kr(t,e){return t.get($D(t,e))}function ef(t,e,n){return t.set($D(t,e),n),n}function $D(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var tf=new WeakMap,_c=new WeakMap,nf=new WeakMap,rf=new WeakMap,of=new WeakMap;class gK{constructor(){let{initialIndexValue:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tc(this,tf,new Set),Tc(this,_c,[]),Tc(this,nf,[]),Tc(this,rf,!1),Tc(this,of,!1),ef(of,this,e??!1)}createObserver(){const e=new LD;return kr(tf,this).add(e),e.addLocalHook("unsubscribe",()=>{kr(tf,this).delete(e)}),e._writeInitialChanges(cx(kr(_c,this),kr(nf,this))),e}emit(e){let n=kr(nf,this);(!kr(rf,this)||kr(_c,this).length!==e.length)&&(e.length===0?e=new Array(n.length).fill(kr(of,this)):ef(_c,this,new Array(e.length).fill(kr(of,this))),kr(rf,this)||(ef(rf,this,!0),n=kr(_c,this)));const r=cx(n,e);kr(tf,this).forEach(i=>i._write(r)),ef(nf,this,e)}}function kn(t,e,n){return(e=mK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mK(t){var e=pK(t,"string");return typeof e=="symbol"?e:e+""}function pK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class hS{constructor(){kn(this,"indexesSequence",new DD),kn(this,"trimmingMapsCollection",new ux(e=>e.some(n=>n===!0),!1)),kn(this,"hidingMapsCollection",new ux(e=>e.some(n=>n===!0),!1)),kn(this,"variousMapsCollection",new dE),kn(this,"hidingChangesObservable",new gK({initialIndexValue:!1})),kn(this,"notTrimmedIndexesCache",[]),kn(this,"notHiddenIndexesCache",[]),kn(this,"isBatched",!1),kn(this,"indexesSequenceChanged",!1),kn(this,"indexesChangeSource",void 0),kn(this,"trimmedIndexesChanged",!1),kn(this,"hiddenIndexesChanged",!1),kn(this,"renderablePhysicalIndexesCache",[]),kn(this,"fromPhysicalToVisualIndexesCache",new Map),kn(this,"fromVisualToRenderableIndexesCache",new Map),this.indexesSequence.addLocalHook("change",()=>{this.indexesSequenceChanged=!0,this.updateCache(),this.runLocalHooks("indexesSequenceChange",this.indexesChangeSource),this.runLocalHooks("change",this.indexesSequence,null)}),this.trimmingMapsCollection.addLocalHook("change",e=>{this.trimmedIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.trimmingMapsCollection)}),this.hidingMapsCollection.addLocalHook("change",e=>{this.hiddenIndexesChanged=!0,this.updateCache(),this.runLocalHooks("change",e,this.hidingMapsCollection)}),this.variousMapsCollection.addLocalHook("change",e=>{this.runLocalHooks("change",e,this.variousMapsCollection)})}suspendOperations(){this.isBatched=!0}resumeOperations(){this.isBatched=!1,this.updateCache()}createChangesObserver(e){if(e!=="hiding")throw new Error(`Unsupported index map type "${e}".`);return this.hidingChangesObservable.createObserver()}createAndRegisterIndexMap(e,n,r){return this.registerMap(e,rK(n,r))}registerMap(e,n){if(this.trimmingMapsCollection.get(e)||this.hidingMapsCollection.get(e)||this.variousMapsCollection.get(e))throw Error(`Map with name "${e}" has been already registered.`);n instanceof Ed?this.trimmingMapsCollection.register(e,n):n instanceof cp?this.hidingMapsCollection.register(e,n):this.variousMapsCollection.register(e,n);const r=this.getNumberOfIndexes();return r>0&&n.init(r),n}unregisterMap(e){this.trimmingMapsCollection.unregister(e),this.hidingMapsCollection.unregister(e),this.variousMapsCollection.unregister(e)}unregisterAll(){this.trimmingMapsCollection.unregisterAll(),this.hidingMapsCollection.unregisterAll(),this.variousMapsCollection.unregisterAll()}getPhysicalFromVisualIndex(e){const n=this.notTrimmedIndexesCache[e];return ae(n)?n:null}getPhysicalFromRenderableIndex(e){const n=this.renderablePhysicalIndexesCache[e];return ae(n)?n:null}getVisualFromPhysicalIndex(e){const n=this.fromPhysicalToVisualIndexesCache.get(e);return ae(n)?n:null}getVisualFromRenderableIndex(e){return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(e))}getRenderableFromVisualIndex(e){const n=this.fromVisualToRenderableIndexesCache.get(e);return ae(n)?n:null}getNearestNotHiddenIndex(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(this.getPhysicalFromVisualIndex(e)===null)return null;if(this.fromVisualToRenderableIndexesCache.has(e))return e;const o=Array.from(this.fromVisualToRenderableIndexesCache.keys());let s=-1;return n>0?s=o.findIndex(a=>a>e):s=o.reverse().findIndex(a=>a<e),s===-1?r?this.getNearestNotHiddenIndex(e,-n,!1):null:o[s]}initToLength(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNumberOfIndexes();this.notTrimmedIndexesCache=[...new Array(e).keys()],this.notHiddenIndexesCache=[...new Array(e).keys()],this.suspendOperations(),this.indexesChangeSource="init",this.indexesSequence.init(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.initEvery(e),this.resumeOperations(),this.suspendOperations(),this.hidingMapsCollection.initEvery(e),this.variousMapsCollection.initEvery(e),this.resumeOperations(),this.runLocalHooks("init")}fitToLength(e){const n=this.getNumberOfIndexes();if(e<n){const r=[...Array(this.getNumberOfIndexes()-e).keys()].map(i=>i+e);this.removeIndexes(r)}else this.insertIndexes(n,e-n)}getIndexesSequence(){return this.indexesSequence.getValues()}setIndexesSequence(e){this.indexesChangeSource===void 0&&(this.indexesChangeSource="update"),this.indexesSequence.setValues(e),this.indexesChangeSource==="update"&&(this.indexesChangeSource=void 0)}getNotTrimmedIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notTrimmedIndexesCache:this.getIndexesSequence().filter(r=>this.isTrimmed(r)===!1)}getNotTrimmedIndexesLength(){return this.getNotTrimmedIndexes().length}getNotHiddenIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.notHiddenIndexesCache:this.getIndexesSequence().filter(r=>this.isHidden(r)===!1)}getNotHiddenIndexesLength(){return this.getNotHiddenIndexes().length}getRenderableIndexes(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0)===!0?this.renderablePhysicalIndexesCache:this.getNotTrimmedIndexes().filter(r=>this.isHidden(r)===!1)}getRenderableIndexesLength(){return this.getRenderableIndexes().length}getNumberOfIndexes(){return this.getIndexesSequence().length}moveIndexes(e,n){typeof e=="number"&&(e=[e]);const r=Be(e,u=>this.getPhysicalFromVisualIndex(u)),i=this.getNotTrimmedIndexesLength(),o=e.length,s=Gh(this.getIndexesSequence(),r),a=s.filter(u=>this.isTrimmed(u)===!1);let l=s.indexOf(a[a.length-1])+1;if(n+o<i){const u=a[n];l=s.indexOf(u)}this.indexesChangeSource="move",this.setIndexesSequence(uE(s,l,r)),this.indexesChangeSource=void 0}isTrimmed(e){return this.trimmingMapsCollection.getMergedValueAtIndex(e)}isHidden(e){return this.hidingMapsCollection.getMergedValueAtIndex(e)}insertIndexes(e,n){const r=this.getNotTrimmedIndexes()[e],i=ae(r)?r:this.getNumberOfIndexes(),o=this.getIndexesSequence().includes(r)?this.getIndexesSequence().indexOf(r):this.getNumberOfIndexes(),s=Be(new Array(n).fill(i),(a,l)=>a+l);this.suspendOperations(),this.indexesChangeSource="insert",this.indexesSequence.insert(o,s),this.indexesChangeSource=void 0,this.trimmingMapsCollection.insertToEvery(o,s),this.hidingMapsCollection.insertToEvery(o,s),this.variousMapsCollection.insertToEvery(o,s),this.resumeOperations()}removeIndexes(e){this.suspendOperations(),this.indexesChangeSource="remove",this.indexesSequence.remove(e),this.indexesChangeSource=void 0,this.trimmingMapsCollection.removeFromEvery(e),this.hidingMapsCollection.removeFromEvery(e),this.variousMapsCollection.removeFromEvery(e),this.resumeOperations()}updateCache(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const n=this.indexesSequenceChanged||this.trimmedIndexesChanged||this.hiddenIndexesChanged;(e===!0||this.isBatched===!1&&n===!0)&&(this.trimmingMapsCollection.updateCache(),this.hidingMapsCollection.updateCache(),this.notTrimmedIndexesCache=this.getNotTrimmedIndexes(!1),this.notHiddenIndexesCache=this.getNotHiddenIndexes(!1),this.renderablePhysicalIndexesCache=this.getRenderableIndexes(!1),this.cacheFromPhysicalToVisualIndexes(),this.cacheFromVisualToRenderableIndexes(),this.hiddenIndexesChanged&&this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues()),this.runLocalHooks("cacheUpdated",{indexesSequenceChanged:this.indexesSequenceChanged,trimmedIndexesChanged:this.trimmedIndexesChanged,hiddenIndexesChanged:this.hiddenIndexesChanged}),this.indexesSequenceChanged=!1,this.trimmedIndexesChanged=!1,this.hiddenIndexesChanged=!1)}cacheFromPhysicalToVisualIndexes(){const e=this.getNotTrimmedIndexesLength();this.fromPhysicalToVisualIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromVisualIndex(n);this.fromPhysicalToVisualIndexesCache.set(r,n)}}cacheFromVisualToRenderableIndexes(){const e=this.getRenderableIndexesLength();this.fromVisualToRenderableIndexesCache.clear();for(let n=0;n<e;n+=1){const r=this.getPhysicalFromRenderableIndex(n),i=this.getVisualFromPhysicalIndex(r);this.fromVisualToRenderableIndexesCache.set(i,n)}}}ut(hS,Rn);function wK(t,e){return He(e,(n,r)=>{It(t[r])&&(t[r]=n)}),t}function FD(t){const n=/^([a-zA-Z]{2})-([a-zA-Z]{2})$/.exec(t);return n?`${n[1].toLowerCase()}-${n[2].toUpperCase()}`:t}function VD(t){ae(t)&&VR(nt`Language with code "${t}" was not found. You should register particular language\x20
45
+ before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.`)}function vK(t,e){return Array.isArray(t)&&Number.isInteger(e)?t[e]:t}const{register:CK,getValues:yK}=Oi("phraseFormatters");function bK(t,e){CK(t,e)}function SK(){return yK()}bK("pluralize",vK);const WD="ContextMenu:items",_e=WD,fE=`${_e}.noItems`,gE=`${_e}.insertRowAbove`,mE=`${_e}.insertRowBelow`,pE=`${_e}.insertColumnOnTheLeft`,wE=`${_e}.insertColumnOnTheRight`,vE=`${_e}.removeRow`,CE=`${_e}.removeColumn`,yE=`${_e}.undo`,bE=`${_e}.redo`,em=`${_e}.readOnly`,SE=`${_e}.clearColumn`,RE=`${_e}.copy`,EE=`${_e}.copyWithHeaders`,TE=`${_e}.copyWithGroupHeaders`,_E=`${_e}.copyHeadersOnly`,ME=`${_e}.cut`,IE=`${_e}.freezeColumn`,PE=`${_e}.unfreezeColumn`,OE=`${_e}.mergeCells`,xE=`${_e}.unmergeCells`,AE=`${_e}.addComment`,HE=`${_e}.editComment`,NE=`${_e}.removeComment`,DE=`${_e}.readOnlyComment`,kE=`${_e}.align`,LE=`${_e}.align.left`,$E=`${_e}.align.center`,FE=`${_e}.align.right`,VE=`${_e}.align.justify`,WE=`${_e}.align.top`,BE=`${_e}.align.middle`,jE=`${_e}.align.bottom`,UE=`${_e}.borders`,zE=`${_e}.borders.top`,YE=`${_e}.borders.right`,GE=`${_e}.borders.bottom`,qE=`${_e}.borders.left`,KE=`${_e}.borders.remove`,XE=`${_e}.nestedHeaders.insertChildRow`,ZE=`${_e}.nestedHeaders.detachFromParent`,QE=`${_e}.hideColumn`,JE=`${_e}.showColumn`,e0=`${_e}.hideRow`,t0=`${_e}.showRow`,qn="Filters:",$t=`${qn}conditions`,dp=`${$t}.none`,n0=`${$t}.isEmpty`,r0=`${$t}.isNotEmpty`,i0=`${$t}.isEqualTo`,o0=`${$t}.isNotEqualTo`,s0=`${$t}.beginsWith`,a0=`${$t}.endsWith`,l0=`${$t}.contains`,u0=`${$t}.doesNotContain`,RK=`${$t}.byValue`,c0=`${$t}.greaterThan`,h0=`${$t}.greaterThanOrEqualTo`,d0=`${$t}.lessThan`,f0=`${$t}.lessThanOrEqualTo`,g0=`${$t}.isBetween`,m0=`${$t}.isNotBetween`,p0=`${$t}.after`,w0=`${$t}.before`,v0=`${$t}.today`,C0=`${$t}.tomorrow`,y0=`${$t}.yesterday`,b0=`${qn}labels.filterByCondition`,S0=`${qn}labels.filterByValue`,R0=`${qn}labels.conjunction`,fp=`${qn}labels.disjunction`,tm=`${qn}values.blankCells`,E0=`${qn}buttons.selectAll`,T0=`${qn}buttons.clear`,_0=`${qn}buttons.ok`,M0=`${qn}buttons.cancel`,I0=`${qn}buttons.placeholder.search`,P0=`${qn}buttons.placeholder.value`,O0=`${qn}buttons.placeholder.secondValue`,x0="CheckboxRenderer:",A0=`${x0}checked`,H0=`${x0}unchecked`,EK=Object.freeze(Object.defineProperty({__proto__:null,CHECKBOX_CHECKED:A0,CHECKBOX_RENDERER_NAMESPACE:x0,CHECKBOX_UNCHECKED:H0,CONTEXTMENU_ITEMS_ADD_COMMENT:AE,CONTEXTMENU_ITEMS_ALIGNMENT:kE,CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM:jE,CONTEXTMENU_ITEMS_ALIGNMENT_CENTER:$E,CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY:VE,CONTEXTMENU_ITEMS_ALIGNMENT_LEFT:LE,CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE:BE,CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT:FE,CONTEXTMENU_ITEMS_ALIGNMENT_TOP:WE,CONTEXTMENU_ITEMS_BORDERS:UE,CONTEXTMENU_ITEMS_BORDERS_BOTTOM:GE,CONTEXTMENU_ITEMS_BORDERS_LEFT:qE,CONTEXTMENU_ITEMS_BORDERS_RIGHT:YE,CONTEXTMENU_ITEMS_BORDERS_TOP:zE,CONTEXTMENU_ITEMS_CLEAR_COLUMN:SE,CONTEXTMENU_ITEMS_COPY:RE,CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY:_E,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS:TE,CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS:EE,CONTEXTMENU_ITEMS_CUT:ME,CONTEXTMENU_ITEMS_EDIT_COMMENT:HE,CONTEXTMENU_ITEMS_FREEZE_COLUMN:IE,CONTEXTMENU_ITEMS_HIDE_COLUMN:QE,CONTEXTMENU_ITEMS_HIDE_ROW:e0,CONTEXTMENU_ITEMS_INSERT_LEFT:pE,CONTEXTMENU_ITEMS_INSERT_RIGHT:wE,CONTEXTMENU_ITEMS_MERGE_CELLS:OE,CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD:ZE,CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD:XE,CONTEXTMENU_ITEMS_NO_ITEMS:fE,CONTEXTMENU_ITEMS_READ_ONLY:em,CONTEXTMENU_ITEMS_READ_ONLY_COMMENT:DE,CONTEXTMENU_ITEMS_REDO:bE,CONTEXTMENU_ITEMS_REMOVE_BORDERS:KE,CONTEXTMENU_ITEMS_REMOVE_COLUMN:CE,CONTEXTMENU_ITEMS_REMOVE_COMMENT:NE,CONTEXTMENU_ITEMS_REMOVE_ROW:vE,CONTEXTMENU_ITEMS_ROW_ABOVE:gE,CONTEXTMENU_ITEMS_ROW_BELOW:mE,CONTEXTMENU_ITEMS_SHOW_COLUMN:JE,CONTEXTMENU_ITEMS_SHOW_ROW:t0,CONTEXTMENU_ITEMS_UNDO:yE,CONTEXTMENU_ITEMS_UNFREEZE_COLUMN:PE,CONTEXTMENU_ITEMS_UNMERGE_CELLS:xE,CONTEXT_MENU_ITEMS_NAMESPACE:WD,FILTERS_BUTTONS_CANCEL:M0,FILTERS_BUTTONS_CLEAR:T0,FILTERS_BUTTONS_OK:_0,FILTERS_BUTTONS_PLACEHOLDER_SEARCH:I0,FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE:O0,FILTERS_BUTTONS_PLACEHOLDER_VALUE:P0,FILTERS_BUTTONS_SELECT_ALL:E0,FILTERS_CONDITIONS_AFTER:p0,FILTERS_CONDITIONS_BEFORE:w0,FILTERS_CONDITIONS_BEGINS_WITH:s0,FILTERS_CONDITIONS_BETWEEN:g0,FILTERS_CONDITIONS_BY_VALUE:RK,FILTERS_CONDITIONS_CONTAINS:l0,FILTERS_CONDITIONS_EMPTY:n0,FILTERS_CONDITIONS_ENDS_WITH:a0,FILTERS_CONDITIONS_EQUAL:i0,FILTERS_CONDITIONS_GREATER_THAN:c0,FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL:h0,FILTERS_CONDITIONS_LESS_THAN:d0,FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL:f0,FILTERS_CONDITIONS_NAMESPACE:$t,FILTERS_CONDITIONS_NONE:dp,FILTERS_CONDITIONS_NOT_BETWEEN:m0,FILTERS_CONDITIONS_NOT_CONTAIN:u0,FILTERS_CONDITIONS_NOT_EMPTY:r0,FILTERS_CONDITIONS_NOT_EQUAL:o0,FILTERS_CONDITIONS_TODAY:v0,FILTERS_CONDITIONS_TOMORROW:C0,FILTERS_CONDITIONS_YESTERDAY:y0,FILTERS_DIVS_FILTER_BY_CONDITION:b0,FILTERS_DIVS_FILTER_BY_VALUE:S0,FILTERS_LABELS_CONJUNCTION:R0,FILTERS_LABELS_DISJUNCTION:fp,FILTERS_NAMESPACE:qn,FILTERS_VALUES_BLANK_CELLS:tm},Symbol.toStringTag,{value:"Module"}));/**
46
+ * @preserve
47
+ * Authors: Handsoncode
48
+ * Last updated: Nov 15, 2017
49
+ *
50
+ * Description: Definition file for English - United States language-country.
51
+ */const BD={languageCode:"en-US",[fE]:"No available options",[gE]:"Insert row above",[mE]:"Insert row below",[pE]:"Insert column left",[wE]:"Insert column right",[vE]:["Remove row","Remove rows"],[CE]:["Remove column","Remove columns"],[yE]:"Undo",[bE]:"Redo",[em]:"Read only",[SE]:"Clear column",[kE]:"Alignment",[LE]:"Left",[$E]:"Center",[FE]:"Right",[VE]:"Justify",[WE]:"Top",[BE]:"Middle",[jE]:"Bottom",[IE]:"Freeze column",[PE]:"Unfreeze column",[UE]:"Borders",[zE]:"Top",[YE]:"Right",[GE]:"Bottom",[qE]:"Left",[KE]:"Remove border(s)",[AE]:"Add comment",[HE]:"Edit comment",[NE]:"Delete comment",[DE]:"Read-only comment",[OE]:"Merge cells",[xE]:"Unmerge cells",[RE]:"Copy",[EE]:["Copy with header","Copy with headers"],[TE]:["Copy with group header","Copy with group headers"],[_E]:["Copy header only","Copy headers only"],[ME]:"Cut",[XE]:"Insert child row",[ZE]:"Detach from parent",[QE]:["Hide column","Hide columns"],[JE]:["Show column","Show columns"],[e0]:["Hide row","Hide rows"],[t0]:["Show row","Show rows"],[dp]:"None",[n0]:"Is empty",[r0]:"Is not empty",[i0]:"Is equal to",[o0]:"Is not equal to",[s0]:"Begins with",[a0]:"Ends with",[l0]:"Contains",[u0]:"Does not contain",[c0]:"Greater than",[h0]:"Greater than or equal to",[d0]:"Less than",[f0]:"Less than or equal to",[g0]:"Is between",[m0]:"Is not between",[p0]:"After",[w0]:"Before",[v0]:"Today",[C0]:"Tomorrow",[y0]:"Yesterday",[tm]:"Blank cells",[b0]:"Filter by condition",[S0]:"Filter by value",[R0]:"And",[fp]:"Or",[E0]:"Select all",[T0]:"Clear",[_0]:"OK",[M0]:"Cancel",[I0]:"Search",[P0]:"Value",[O0]:"Second value",[A0]:"Checked",[H0]:"Unchecked"},TK=EK,dS=BD.languageCode,{register:_K,getItem:jD,hasItem:MK,getValues:IK}=Oi("languagesDictionaries");UD(BD);function UD(t,e){let n=t,r=e;return Ae(t)&&(r=t,n=r.languageCode),PK(n,r),_K(n,Gn(r)),Gn(r)}function PK(t,e){t!==dS&&wK(e,jD(dS))}function zD(t){return N0(t)?Gn(jD(t)):null}function N0(t){return MK(t)}function OK(){return IK()}function YD(t,e,n){const r=zD(t);if(r===null)return null;const i=r[e];if(It(i))return null;const o=xK(i,n);return Array.isArray(o)?o[0]:o}function xK(t,e){let n=t;return I(SK(),r=>{n=r(t,e)}),n}function AK(t){let e=FD(t);return N0(e)||(e=dS,VD(t)),e}function HK(t,e,n){return(e=NK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function NK(t){var e=DK(t,"string");return typeof e=="symbol"?e:e+""}function DK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ls extends SD{constructor(e,n){super(e,null),HK(this,"visualCellRange",null),this.visualCellRange=n||null,this.commit()}add(e){return this.visualCellRange===null?this.visualCellRange=this.settings.createCellRange(e):this.visualCellRange.expand(e),this}clear(){return this.visualCellRange=null,super.clear()}trimToVisibleCellsRangeOnly(e){let{from:n,to:r}=e,i=this.getNearestNotHiddenCoords(n,1),o=this.getNearestNotHiddenCoords(r,-1);return i===null||o===null?null:((i.row>o.row||i.col>o.col)&&(i=n,o=r),this.settings.createCellRange(i,i,o))}getNearestNotHiddenCoords(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n;const i=this.getNearestNotHiddenIndex(this.settings.rowIndexMapper,e.row,n);if(i===null)return null;const o=this.getNearestNotHiddenIndex(this.settings.columnIndexMapper,e.col,r);return o===null?null:this.settings.createCellCoords(i,o)}getNearestNotHiddenIndex(e,n,r){return n<0?n:e.getNearestNotHiddenIndex(n,r)}commit(){if(this.visualCellRange===null)return this;const e=this.trimToVisibleCellsRangeOnly(this.visualCellRange);return e===null?this.cellRange=null:this.cellRange=this.createRenderableCellRange(e.from,e.to),this}syncWith(e){const n=e.from.clone().normalize(),r=e.getVerticalDirection()==="N-S"?1:-1,i=e.getHorizontalDirection()==="W-E"?1:-1,o=this.settings.visualToRenderableCoords(this.visualCellRange.highlight);let s=null;if((o===null||o.col===null||o.row===null)&&(s=this.getNearestNotHiddenCoords(n,r,i)),s!==null&&e.overlaps(s)){const a=e.highlight.clone();if(a.row>=0&&(a.row=s.row),a.col>=0&&(a.col=s.col),this.cellRange===null){const l=this.settings.visualToRenderableCoords(a);this.cellRange=this.settings.createCellRange(l)}e.setHighlight(a)}return this.settings.selectionType==="focus"&&o!==null&&s===null&&e.setHighlight(this.visualCellRange.highlight),this}getCorners(){const{from:e,to:n}=this.cellRange;return[Math.min(e.row,n.row),Math.min(e.col,n.col),Math.max(e.row,n.row),Math.max(e.col,n.col)]}getVisualCorners(){const e=this.settings.renderableToVisualCoords(this.cellRange.getTopStartCorner()),n=this.settings.renderableToVisualCoords(this.cellRange.getBottomEndCorner());return[e.row,e.col,n.row,n.col]}createRenderableCellRange(e,n){const r=this.settings.visualToRenderableCoords(e),i=this.settings.visualToRenderableCoords(n);return r.row===null||r.col===null||i.row===null||i.col===null?null:this.settings.createCellRange(r,r,i)}}function JC(t){let{activeHeaderClassName:e,...n}=t;return new ls({className:e,...n,selectionType:RD})}function kK(t){let{areaCornerVisible:e,...n}=t;return new ls({className:"area",createLayers:!0,border:{width:1,color:"#4b89ff",cornerVisible:e},...n,selectionType:ZR})}function LK(t){let{...e}=t;return new ls({className:"highlight",...e,selectionType:ZR})}function $K(t){let{columnClassName:e,...n}=t;return new ls({className:e,...n,selectionType:Z2})}function FK(t){let{cellCornerVisible:e,...n}=t;return new ls({className:"current",headerAttributes:[HR()],border:{width:2,color:"#4b89ff",cornerVisible:e},...n,selectionType:yh})}function VK(t){let{border:e,visualCellRange:n,...r}=t;return new ls({...e,...r,selectionType:Q2},n)}function WK(t){let{...e}=t;return new ls({className:"fill",border:{width:1,color:"#ff0000"},...e,selectionType:K2})}function hx(t){let{headerClassName:e,...n}=t;return new ls({className:e,...n,selectionType:XR})}function BK(t){let{rowClassName:e,...n}=t;return new ls({className:e,...n,selectionType:X2})}function jK(t,e){UK(t,e),e.add(t)}function UK(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qn(t,e,n){return(e=zK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zK(t){var e=YK(t,"string");return typeof e=="symbol"?e:e+""}function YK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ro(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Di=new WeakSet;class GK{constructor(e){jK(this,Di),Qn(this,"options",void 0),Qn(this,"layerLevel",0),Qn(this,"focus",void 0),Qn(this,"fill",void 0),Qn(this,"layeredAreas",new Map),Qn(this,"areas",new Map),Qn(this,"rowHeaders",new Map),Qn(this,"columnHeaders",new Map),Qn(this,"activeRowHeaders",new Map),Qn(this,"activeColumnHeaders",new Map),Qn(this,"activeCornerHeaders",new Map),Qn(this,"rowHighlights",new Map),Qn(this,"columnHighlights",new Map),Qn(this,"customSelections",[]),this.options=e,this.focus=FK(e),this.fill=WK(e)}isEnabledFor(e,n){let r=e;e===yh&&(r="current");let i=this.options.disabledCellSelection(n.row,n.col);return typeof i=="string"&&(i=[i]),i===!1||Array.isArray(i)&&!i.includes(r)}useLayerLevel(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.layerLevel=e,this}getFocus(){return this.focus}getFill(){return this.fill}createLayeredArea(){return Ro(Di,this,Eo).call(this,this.layeredAreas,kK)}getLayeredAreas(){return[...this.layeredAreas.values()]}createArea(){return Ro(Di,this,Eo).call(this,this.areas,LK)}getAreas(){return[...this.areas.values()]}createRowHeader(){return Ro(Di,this,Eo).call(this,this.rowHeaders,hx)}getRowHeaders(){return[...this.rowHeaders.values()]}createColumnHeader(){return Ro(Di,this,Eo).call(this,this.columnHeaders,hx)}getColumnHeaders(){return[...this.columnHeaders.values()]}createActiveRowHeader(){return Ro(Di,this,Eo).call(this,this.activeRowHeaders,JC)}getActiveRowHeaders(){return[...this.activeRowHeaders.values()]}createActiveColumnHeader(){return Ro(Di,this,Eo).call(this,this.activeColumnHeaders,JC)}getActiveColumnHeaders(){return[...this.activeColumnHeaders.values()]}createActiveCornerHeader(){return Ro(Di,this,Eo).call(this,this.activeCornerHeaders,JC)}getActiveCornerHeaders(){return[...this.activeCornerHeaders.values()]}createRowHighlight(){return Ro(Di,this,Eo).call(this,this.rowHighlights,BK)}getRowHighlights(){return[...this.rowHighlights.values()]}createColumnHighlight(){return Ro(Di,this,Eo).call(this,this.columnHighlights,$K)}getColumnHighlights(){return[...this.columnHighlights.values()]}getCustomSelections(){return[...this.customSelections.values()]}addCustomSelection(e){this.customSelections.push(VK({...this.options,...e}))}clear(){this.focus.clear(),this.fill.clear(),I(this.areas.values(),e=>void e.clear()),I(this.layeredAreas.values(),e=>void e.clear()),I(this.rowHeaders.values(),e=>void e.clear()),I(this.columnHeaders.values(),e=>void e.clear()),I(this.activeRowHeaders.values(),e=>void e.clear()),I(this.activeColumnHeaders.values(),e=>void e.clear()),I(this.activeCornerHeaders.values(),e=>void e.clear()),I(this.rowHighlights.values(),e=>void e.clear()),I(this.columnHighlights.values(),e=>void e.clear())}[Symbol.iterator](){return[this.focus,this.fill,...this.areas.values(),...this.layeredAreas.values(),...this.rowHeaders.values(),...this.columnHeaders.values(),...this.activeRowHeaders.values(),...this.activeColumnHeaders.values(),...this.activeCornerHeaders.values(),...this.rowHighlights.values(),...this.columnHighlights.values(),...this.customSelections][Symbol.iterator]()}}function Eo(t,e){const n=this.layerLevel;if(t.has(n))return t.get(n);const r=e({layerLevel:n,...this.options});return t.set(n,r),r}function dx(t,e,n){return(e=qK(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qK(t){var e=KK(t,"string");return typeof e=="symbol"?e:e+""}function KK(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class XK{constructor(e){dx(this,"ranges",[]),dx(this,"createCellRange",void 0),this.createCellRange=e}isEmpty(){return this.size()===0}set(e){return this.clear(),this.ranges.push(this.createCellRange(e)),this}add(e){return this.ranges.push(this.createCellRange(e)),this}pop(){return this.ranges.pop(),this}current(){return this.peekByIndex(this.size()-1)}previous(){return this.peekByIndex(this.size()-2)}includes(e){return this.ranges.some(n=>n.includes(e))}clear(){return this.ranges.length=0,this}size(){return this.ranges.length}peekByIndex(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n;return e>=0&&e<this.size()&&(n=this.ranges[e]),n}[Symbol.iterator](){return this.ranges[Symbol.iterator]()}}function ZK(t,e){GD(t,e),e.add(t)}function ey(t,e,n){GD(t,e),e.set(t,n)}function GD(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ge(t,e){return t.get(en(t,e))}function sf(t,e,n){return t.set(en(t,e),n),n}function en(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var af=new WeakMap,mt=new WeakMap,bi=new WeakMap,dn=new WeakSet;class fS{constructor(e,n){ZK(this,dn),ey(this,af,void 0),ey(this,mt,void 0),ey(this,bi,{x:0,y:0}),sf(af,this,e),sf(mt,this,n)}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=Ge(mt,this).createCellCoords(e,n);let o=Ge(af,this).current().highlight;const s=Ge(mt,this).visualToRenderableCoords(o);let a=0,l=0;if(this.runLocalHooks("beforeTransformStart",i),s.row!==null&&s.col!==null){const{width:u,height:c}=en(dn,this,qD).call(this),{row:h,col:d}=en(dn,this,gx).call(this,o),f=Ge(mt,this).fixedRowsBottom(),m=Ge(mt,this).minSpareRows(),C=Ge(mt,this).minSpareCols(),y=Ge(mt,this).autoWrapRow(),E=Ge(mt,this).autoWrapCol(),v=Ge(mt,this).createCellCoords(h+i.row,d+i.col);if(v.row>=c){const L=Ir(r&&m>0&&f===0),T=v.col+1,P=Ge(mt,this).createCellCoords(v.row-c,T>=u?T-u:T);this.runLocalHooks("beforeColumnWrap",L,en(dn,this,Dl).call(this,P),T>=u),L.value?this.runLocalHooks("insertRowRequire",Ge(mt,this).countRenderableRows()):E&&v.assign(P)}else if(v.row<0){const L=Ir(E),T=v.col-1,P=Ge(mt,this).createCellCoords(c+v.row,T<0?u+T:T);this.runLocalHooks("beforeColumnWrap",L,en(dn,this,Dl).call(this,P),T<0),E&&v.assign(P)}if(v.col>=u){const L=Ir(r&&C>0),T=v.row+1,P=Ge(mt,this).createCellCoords(T>=c?T-c:T,v.col-u);this.runLocalHooks("beforeRowWrap",L,en(dn,this,Dl).call(this,P),T>=c),L.value?this.runLocalHooks("insertColRequire",Ge(mt,this).countRenderableColumns()):y&&v.assign(P)}else if(v.col<0){const L=Ir(y),T=v.row-1,P=Ge(mt,this).createCellCoords(T<0?c+T:T,u+v.col);this.runLocalHooks("beforeRowWrap",L,en(dn,this,Dl).call(this,P),T<0),y&&v.assign(P)}const{rowDir:_,colDir:A}=en(dn,this,fx).call(this,v);a=_,l=A,o=en(dn,this,Dl).call(this,v)}return this.runLocalHooks("afterTransformStart",o,a,l),o}transformEnd(e,n){const r=Ge(mt,this).createCellCoords(e,n),i=Ge(af,this).current(),o=Ge(mt,this).visualToRenderableCoords(i.highlight),s=en(dn,this,ty).call(this,i.to.row,i.from.row),a=en(dn,this,ny).call(this,i.to.col,i.from.col),l=i.to.clone();let u=0,c=0;if(this.runLocalHooks("beforeTransformEnd",r),o.row!==null&&o.col!==null&&s!==null&&a!==null){const{row:h,col:d}=en(dn,this,gx).call(this,i.highlight),f=Ge(mt,this).createCellCoords(s+r.row,a+r.col),m=i.getTopStartCorner(),C=i.getTopEndCorner(),y=i.getBottomEndCorner();if(r.col<0&&a>=d&&f.col<d){const A=f.col-d;f.col=en(dn,this,ny).call(this,m.col,C.col)+A}else if(r.col>0&&a<=d&&f.col>d){const A=en(dn,this,ny).call(this,C.col,m.col),L=Math.max(f.col-A,1);f.col=A+L}if(r.row<0&&s>=h&&f.row<h){const A=f.row-h;f.row=en(dn,this,ty).call(this,m.row,y.row)+A}else if(r.row>0&&s<=h&&f.row>h){const A=en(dn,this,ty).call(this,y.row,m.row),L=Math.max(f.row-A,1);f.row=A+L}const{rowDir:E,colDir:v}=en(dn,this,fx).call(this,f);u=E,c=v;const _=en(dn,this,Dl).call(this,f);r.row===0&&r.col!==0?l.col=_.col:r.row!==0&&r.col===0?l.row=_.row:(l.row=_.row,l.col=_.col)}return this.runLocalHooks("afterTransformEnd",l,u,c),l}setOffsetSize(e){let{x:n,y:r}=e;sf(bi,this,{x:n,y:r})}resetOffsetSize(){sf(bi,this,{x:0,y:0})}}function fx(t){const{width:e,height:n}=en(dn,this,qD).call(this);let r=0,i=0;return t.row<0?(r=-1,t.row=0):t.row>0&&t.row>=n&&(r=1,t.row=n-1),t.col<0?(i=-1,t.col=0):t.col>0&&t.col>=e&&(i=1,t.col=e-1),{rowDir:r,colDir:i}}function qD(){return{width:Ge(bi,this).x+Ge(mt,this).countRenderableColumns(),height:Ge(bi,this).y+Ge(mt,this).countRenderableRows()}}function ty(t,e){const n=Ge(mt,this).findFirstNonHiddenRenderableRow(t,e);return n===null?null:Ge(bi,this).y+n}function ny(t,e){const n=Ge(mt,this).findFirstNonHiddenRenderableColumn(t,e);return n===null?null:Ge(bi,this).x+n}function gx(t){const{row:e,col:n}=Ge(mt,this).visualToRenderableCoords(t);if(e===null||n===null)throw new Error("Renderable coords are not visible.");return Ge(mt,this).createCellCoords(Ge(bi,this).y+e,Ge(bi,this).x+n)}function Dl(t){const e=t.clone();return e.col=t.col-Ge(bi,this).x,e.row=t.row-Ge(bi,this).y,Ge(mt,this).renderableToVisualCoords(e)}ut(fS,Rn);const gp=0,mp=1,KD=2,D0=3,QK=[D0,KD],JK=[["number"],["number","string"],["number","undefined"],["number","string","undefined"]],ry=Symbol("root"),mx=Symbol("child");function Du(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ry;if(e!==ry&&e!==mx)throw new Error("The second argument is used internally only and cannot be overwritten.");const n=Array.isArray(t),r=e===ry;let i=gp;if(n){const o=t[0];t.length===0?i=mp:r&&o instanceof bd?i=D0:r&&Array.isArray(o)?i=Du(o,mx):t.length>=2&&t.length<=4&&!t.some((a,l)=>!JK[l].includes(typeof a))&&(i=KD)}return i}function qh(t){let{createCellCoords:e,createCellRange:n,keepDirection:r=!1,propToCol:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!QK.includes(t))throw new Error("Unsupported selection ranges schema type was provided.");return function(o){const s=t===D0;let a=s?o.from.row:o[0],l=s?o.from.col:o[1],u=s?o.to.row:o[2],c=s?o.to.col:o[3];if(typeof i=="function"&&(typeof l=="string"&&(l=i(l)),typeof c=="string"&&(c=i(c))),It(u)&&(u=a),It(c)&&(c=l),!r){const f=a,m=l,C=u,y=c;a=Math.min(f,C),l=Math.min(m,y),u=Math.max(f,C),c=Math.max(m,y)}const h=e(a,l),d=e(u,c);return n(h,h,d)}}function e3(t){const e=Du(t.getSelected());if(e===gp||e===mp)return[];const n=qh(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;I(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.col,0),c=l.col-u+1;I(Array.from(new Array(c),(h,d)=>u+d),h=>{r.has(h)||r.add(h)})});const i=Array.from(r).sort((s,a)=>s-a);return gr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function t3(t){const e=Du(t.getSelected());if(e===gp||e===mp)return[];const n=qh(e,{createCellCoords:t._createCellCoords.bind(t),createCellRange:t._createCellRange.bind(t)}),r=new Set;I(t.getSelected(),s=>{const{from:a,to:l}=n(s),u=Math.max(a.row,0),c=l.row-u+1;I(Array.from(new Array(c),(h,d)=>u+d),h=>{r.has(h)||r.add(h)})});const i=Array.from(r).sort((s,a)=>s-a);return gr(i,(s,a,l,u)=>(l!==0&&a===u[l-1]+1?s[s.length-1][1]+=1:s.push([a,1]),s),[])}function kl(t,e,n){n3(t,e),e.set(t,n)}function n3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ua(t,e,n){return(e=r3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r3(t){var e=i3(t,"string");return typeof e=="symbol"?e:e+""}function i3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bt(t,e){return t.get(XD(t,e))}function ki(t,e,n){return t.set(XD(t,e),n),n}function XD(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var _n=new WeakMap,ca=new WeakMap,lf=new WeakMap,Mc=new WeakMap,uf=new WeakMap,Ic=new WeakMap;class ZD{constructor(e,n){var r=this;ua(this,"settings",void 0),ua(this,"tableProps",void 0),ua(this,"inProgress",!1),ua(this,"selectedRange",new XK((i,o,s)=>this.tableProps.createCellRange(i,o,s))),ua(this,"highlight",void 0),kl(this,_n,void 0),kl(this,ca,void 0),ua(this,"selectedByRowHeader",new Set),ua(this,"selectedByColumnHeader",new Set),kl(this,lf,!1),kl(this,Mc,!1),kl(this,uf,"unknown"),kl(this,Ic,-1),this.settings=e,this.tableProps=n,this.highlight=new GK({headerClassName:e.currentHeaderClassName,activeHeaderClassName:e.activeHeaderClassName,rowClassName:e.currentRowClassName,columnClassName:e.currentColClassName,cellAttributes:[HR()],rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,disabledCellSelection:(i,o)=>this.tableProps.isDisabledCellSelection(i,o),cellCornerVisible:function(){return r.isCellCornerVisible(...arguments)},areaCornerVisible:function(){return r.isAreaCornerVisible(...arguments)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),createCellRange:(i,o,s)=>this.tableProps.createCellRange(i,o,s)}),ki(_n,this,new fS(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>this.tableProps.countRenderableRows(),countRenderableColumns:()=>this.tableProps.countRenderableColumns(),visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return r.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return r.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>e.fixedRowsBottom,minSpareRows:()=>e.minSpareRows,minSpareCols:()=>e.minSpareCols,autoWrapRow:()=>e.autoWrapRow,autoWrapCol:()=>e.autoWrapCol})),ki(ca,this,new fS(this.selectedRange,{rowIndexMapper:this.tableProps.rowIndexMapper,columnIndexMapper:this.tableProps.columnIndexMapper,countRenderableRows:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableRowsInRange(0,i.getOuterBottomEndCorner().row)},countRenderableColumns:()=>{const i=this.selectedRange.current();return this.tableProps.countRenderableColumnsInRange(0,i.getOuterBottomEndCorner().col)},visualToRenderableCoords:i=>this.tableProps.visualToRenderableCoords(i),renderableToVisualCoords:i=>this.tableProps.renderableToVisualCoords(i),findFirstNonHiddenRenderableRow:function(){return r.tableProps.findFirstNonHiddenRenderableRow(...arguments)},findFirstNonHiddenRenderableColumn:function(){return r.tableProps.findFirstNonHiddenRenderableColumn(...arguments)},createCellCoords:(i,o)=>this.tableProps.createCellCoords(i,o),fixedRowsBottom:()=>0,minSpareRows:()=>0,minSpareCols:()=>0,autoWrapRow:()=>!0,autoWrapCol:()=>!0})),bt(_n,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformStart",...o)}),bt(_n,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformStart",...o)}),bt(_n,this).addLocalHook("beforeTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformEnd",...o)}),bt(_n,this).addLocalHook("afterTransformEnd",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformEnd",...o)}),bt(_n,this).addLocalHook("insertRowRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("insertRowRequire",...o)}),bt(_n,this).addLocalHook("insertColRequire",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("insertColRequire",...o)}),bt(_n,this).addLocalHook("beforeRowWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeRowWrap",...o)}),bt(_n,this).addLocalHook("beforeColumnWrap",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeColumnWrap",...o)}),bt(ca,this).addLocalHook("beforeTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("beforeModifyTransformFocus",...o)}),bt(ca,this).addLocalHook("afterTransformStart",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("afterModifyTransformFocus",...o)})}getSelectedRange(){return this.selectedRange}markSource(e){ki(uf,this,e)}markEndSource(){ki(uf,this,"unknown")}getSelectionSource(){return bt(uf,this)}setExpectedLayers(e){ki(Ic,this,e)}begin(){this.inProgress=!0}finish(){this.runLocalHooks("afterSelectionFinished",Array.from(this.selectedRange)),this.inProgress=!1,ki(Ic,this,-1)}isInProgress(){return this.inProgress}setRangeStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:e;const o=this.settings.selectionMode==="multiple",s=It(n)?this.tableProps.getShortcutManager().isCtrlPressed():n,a=e.clone();ki(lf,this,!1),this.runLocalHooks(`beforeSetRangeStart${r?"Only":""}`,a),(!o||o&&!s&&It(n))&&this.selectedRange.clear(),this.selectedRange.add(a).current().setHighlight(i.clone()),this.getLayerLevel()===0&&(this.selectedByRowHeader.clear(),this.selectedByColumnHeader.clear()),r||this.setRangeEnd(e)}setRangeStartOnly(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.setRangeStart(e,n,!0,r)}setRangeEnd(e){if(this.selectedRange.isEmpty())return;const n=e.clone(),r=this.tableProps.countRows(),i=this.tableProps.countCols(),o=this.selectedRange.current().clone().setTo(e).isSingleHeader();if((r>0||i>0)&&(r===0&&n.col<0&&!o||i===0&&n.row<0&&!o))return;this.runLocalHooks("beforeSetRangeEnd",n),this.begin();const s=this.selectedRange.current();if(this.settings.navigableHeaders||s.highlight.normalize(),this.settings.selectionMode==="single")s.setFrom(s.highlight),s.setTo(s.highlight);else{const l=s.getHorizontalDirection(),u=s.getVerticalDirection(),c=this.isMultiple();s.setTo(n),c&&(l!==s.getHorizontalDirection()||s.getWidth()===1&&!s.includes(s.highlight))&&s.from.assign({col:s.highlight.col}),c&&(u!==s.getVerticalDirection()||s.getHeight()===1&&!s.includes(s.highlight))&&s.from.assign({row:s.highlight.row})}r>0&&i>0&&(!this.settings.navigableHeaders||this.settings.navigableHeaders&&!s.isSingleHeader())&&s.to.normalize(),this.runLocalHooks("beforeHighlightSet"),this.setRangeFocus(this.selectedRange.current().highlight),this.applyAndCommit();const a=bt(Ic,this)===-1||this.selectedRange.size()===bt(Ic,this);this.runLocalHooks("afterSetRangeEnd",e,a)}applyAndCommit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.selectedRange.current(),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLayerLevel();const r=this.tableProps.countRows(),i=this.tableProps.countCols();n<this.highlight.layerLevel&&(I(this.highlight.getAreas(),m=>void m.clear()),I(this.highlight.getLayeredAreas(),m=>void m.clear()),I(this.highlight.getRowHeaders(),m=>void m.clear()),I(this.highlight.getColumnHeaders(),m=>void m.clear()),I(this.highlight.getActiveRowHeaders(),m=>void m.clear()),I(this.highlight.getActiveColumnHeaders(),m=>void m.clear()),I(this.highlight.getActiveCornerHeaders(),m=>void m.clear()),I(this.highlight.getRowHighlights(),m=>void m.clear()),I(this.highlight.getColumnHighlights(),m=>void m.clear())),this.highlight.useLayerLevel(n);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();if(o.clear(),s.clear(),a.clear(),l.clear(),u.clear(),c.clear(),h.clear(),d.clear(),f.clear(),this.highlight.isEnabledFor(ZR,e.highlight)&&(this.isMultiple()||n>=1)&&(o.add(e.from).add(e.to).commit(),s.add(e.from).add(e.to).commit(),n===1)){const m=this.selectedRange.previous();this.highlight.useLayerLevel(n-1),this.highlight.createArea().add(m.from).commit().syncWith(m),this.highlight.createLayeredArea().add(m.from).commit().syncWith(m),this.highlight.useLayerLevel(n)}if(this.highlight.isEnabledFor(XR,e.highlight)){if(!e.isSingleHeader()){const y=this.tableProps.createCellCoords(Math.max(e.from.row,0),-1),E=this.tableProps.createCellCoords(e.to.row,-1),v=this.tableProps.createCellCoords(-1,Math.max(e.from.col,0)),_=this.tableProps.createCellCoords(-1,e.to.col);this.settings.selectionMode==="single"?(a.add(y).commit(),l.add(v).commit(),d.add(y).commit(),f.add(v).commit()):(a.add(y).add(E).commit(),l.add(v).add(_).commit(),d.add(y).add(E).commit(),f.add(v).add(_).commit())}const m=!bt(Mc,this)&&this.isEntireRowSelected()&&(i>0&&i===e.getWidth()||i===0&&this.isSelectedByRowHeader()),C=!bt(Mc,this)&&this.isEntireColumnSelected()&&(r>0&&r===e.getHeight()||r===0&&this.isSelectedByColumnHeader());m&&u.add(this.tableProps.createCellCoords(Math.max(e.from.row,0),Math.min(-this.tableProps.countRowHeaders(),-1))).add(this.tableProps.createCellCoords(Math.max(e.to.row,0),-1)).commit(),C&&c.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(),-1),Math.max(e.from.col,0))).add(this.tableProps.createCellCoords(-1,Math.max(e.to.col,0))).commit(),m&&C&&h.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(),-this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1,-1)).commit()}}setRangeFocus(e){if(this.selectedRange.isEmpty())return;const n=this.selectedRange.current();this.inProgress||this.runLocalHooks("beforeSetFocus",e);const r=this.highlight.getFocus();r.clear(),n.setHighlight(e),this.inProgress||this.runLocalHooks("beforeHighlightSet"),this.highlight.isEnabledFor(yh,n.highlight)&&r.add(n.highlight).commit().syncWith(n),this.inProgress||(ki(lf,this,!0),this.runLocalHooks("afterSetFocus",n.highlight))}transformStart(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.settings.navigableHeaders?bt(_n,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):bt(_n,this).resetOffsetSize(),this.setRangeStart(bt(_n,this).transformStart(e,n,r))}transformEnd(e,n){this.settings.navigableHeaders?bt(_n,this).setOffsetSize({x:this.tableProps.countRowHeaders(),y:this.tableProps.countColHeaders()}):bt(_n,this).resetOffsetSize(),this.setRangeEnd(bt(_n,this).transformEnd(e,n))}transformFocus(e,n){const r=this.selectedRange.current(),{row:i,col:o}=r.getOuterTopStartCorner(),s=this.tableProps.countRenderableColumnsInRange(0,o-1),a=this.tableProps.countRenderableRowsInRange(0,i-1);r.highlight.isHeader()?bt(ca,this).setOffsetSize({x:o<0?Math.abs(o):-s,y:i<0?Math.abs(i):-a}):bt(ca,this).setOffsetSize({x:o<0?0:-s,y:i<0?0:-a});const l=bt(ca,this).transformStart(e,n);this.setRangeFocus(l.normalize())}shiftRows(e,n){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByColumnHeader()||r.getOuterTopStartCorner().row>=e){const{from:i,to:o,highlight:s}=r,a=this.tableProps.countRows(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=u?-1:0,h=u?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(Ue(i.row+h,c,a-1),i.col),f=this.tableProps.createCellCoords(Ue(o.row+n,c,a-1),o.col);this.markSource("shift"),s.row>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(Ue(s.row+n,0,a-1),s.col)):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}shiftColumns(e,n){if(!this.isSelected())return;const r=this.selectedRange.current();if(this.isSelectedByCorner())this.selectAll(!0,!0,{disableHeadersHighlight:!0});else if(this.isSelectedByRowHeader()||r.getOuterTopStartCorner().col>=e){const{from:i,to:o,highlight:s}=r,a=this.tableProps.countCols(),l=this.isSelectedByRowHeader(),u=this.isSelectedByColumnHeader(),c=l?-1:0,h=l?0:n;this.getSelectedRange().pop();const d=this.tableProps.createCellCoords(i.row,Ue(i.col+h,c,a-1)),f=this.tableProps.createCellCoords(o.row,Ue(o.col+n,c,a-1));this.markSource("shift"),s.col>=e?this.setRangeStartOnly(d,!0,this.tableProps.createCellCoords(s.row,Ue(s.col+n,0,a-1))):this.setRangeStartOnly(d,!0),l&&this.selectedByRowHeader.add(this.getLayerLevel()),u&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(f),this.markEndSource()}}getLayerLevel(){return this.selectedRange.size()-1}isSelected(){return!this.selectedRange.isEmpty()}isMultiple(){if(!this.isSelected())return!1;const e=Ir(!this.selectedRange.current().isSingle());return this.runLocalHooks("afterIsMultipleSelection",e),e.value}isFocusSelectionChanged(){return this.isSelected()&&bt(lf,this)}isSelectedByRowHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner(e)&&(e===-1?this.selectedByRowHeader.size>0:this.selectedByRowHeader.has(e))}isEntireRowSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const n=i=>{const{col:o}=i.getOuterTopStartCorner(),s=this.tableProps.countRowHeaders(),a=this.tableProps.countCols();return(s>0&&o<0||s===0)&&i.getWidth()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>n(i));const r=this.selectedRange.peekByIndex(e);return r?n(r):!1}isSelectedByColumnHeader(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();return!this.isSelectedByCorner()&&(e===-1?this.selectedByColumnHeader.size>0:this.selectedByColumnHeader.has(e))}isEntireColumnSelected(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getLayerLevel();const n=i=>{const{row:o}=i.getOuterTopStartCorner(),s=this.tableProps.countColHeaders(),a=this.tableProps.countRows();return(s>0&&o<0||s===0)&&i.getHeight()===a};if(e===-1)return Array.from(this.selectedRange).some(i=>n(i));const r=this.selectedRange.peekByIndex(e);return r?n(r):!1}isSelectedByAnyHeader(){return this.isSelectedByRowHeader(-1)||this.isSelectedByColumnHeader(-1)||this.isSelectedByCorner()}isSelectedByCorner(){return this.selectedByColumnHeader.has(this.getLayerLevel())&&this.selectedByRowHeader.has(this.getLayerLevel())}inInSelection(e){return this.selectedRange.includes(e)}isCellCornerVisible(){return this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&!this.isMultiple()}isCellVisible(e){const n=this.tableProps.visualToRenderableCoords(e);return n.row!==null&&n.col!==null}isAreaCornerVisible(e){return Number.isInteger(e)&&e!==this.getLayerLevel()?!1:this.settings.fillHandle&&!this.tableProps.isEditorOpened()&&this.isMultiple()}clear(){this.selectedRange.clear(),this.highlight.clear()}deselect(){this.isSelected()&&(this.inProgress=!1,this.clear(),this.runLocalHooks("afterDeselect"))}selectAll(){var e;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{focusPosition:!1,disableHeadersHighlight:!1};const o=this.tableProps.countRows(),s=this.tableProps.countCols(),a=this.tableProps.countRowHeaders(),l=this.tableProps.countColHeaders(),u=r?-l:0,c=n?-a:0;if(u===0&&c===0&&(o===0||s===0))return;let h=(e=this.getSelectedRange().current())===null||e===void 0?void 0:e.highlight;const{focusPosition:d,disableHeadersHighlight:f}=i;ki(Mc,this,f),d&&Number.isInteger(d==null?void 0:d.row)&&Number.isInteger(d==null?void 0:d.col)&&(h=this.tableProps.createCellCoords(Ue(d.row,u,o-1),Ue(d.col,c,s-1)));const m=this.tableProps.createCellCoords(u,c),C=this.tableProps.createCellCoords(o-1,s-1);this.clear(),this.setRangeStartOnly(m,void 0,h),c<0&&this.selectedByRowHeader.add(this.getLayerLevel()),u<0&&this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(C),this.finish(),ki(Mc,this,!1)}selectCells(e){var n=this;const r=Du(e);if(r===mp)return!1;if(r===gp)throw new Error(nt`Unsupported format of the selection ranges was passed. To select cells pass\x20
52
+ the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\x20
53
+ columnEnd/columnPropEnd]]) or as an array of CellRange objects.`);const i=qh(r,{createCellCoords:function(){return n.tableProps.createCellCoords(...arguments)},createCellRange:function(){return n.tableProps.createCellRange(...arguments)},propToCol:l=>this.tableProps.propToCol(l),keepDirection:!0}),o=this.settings.navigableHeaders,s={countRows:this.tableProps.countRows(),countCols:this.tableProps.countCols(),countRowHeaders:o?this.tableProps.countRowHeaders():0,countColHeaders:o?this.tableProps.countColHeaders():0},a=!e.some(l=>{const u=i(l),c=u.isValid(s);return!(c&&!u.containsHeaders()||c&&u.containsHeaders()&&u.isSingleHeader())});return a&&(this.clear(),this.setExpectedLayers(e.length),I(e,l=>{const{from:u,to:c}=i(l);this.setRangeStartOnly(u.clone(),!1),this.setRangeEnd(c.clone())}),this.finish()),a}selectColumns(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=typeof e=="string"?this.tableProps.propToCol(e):e,o=typeof n=="string"?this.tableProps.propToCol(n):n,s=this.tableProps.countRows(),a=this.tableProps.countCols(),l=this.tableProps.countColHeaders(),u=l===0?0:-l,c=this.tableProps.createCellCoords(u,i),h=this.tableProps.createCellCoords(s-1,o),d=this.tableProps.createCellRange(c,c,h).isValid({countRows:s,countCols:a,countRowHeaders:0,countColHeaders:l});if(d){let f=0,m=0;Number.isInteger(r==null?void 0:r.row)&&Number.isInteger(r==null?void 0:r.col)?(f=Ue(r.row,u,s-1),m=Ue(r.col,Math.min(i,o),Math.max(i,o))):(f=Ue(r,u,s-1),m=i);const C=this.tableProps.createCellCoords(f,m),y=l===0?0:Ue(C.row,u,-1),E=s-1,v=this.tableProps.createCellCoords(y,i),_=this.tableProps.createCellCoords(E,o);this.runLocalHooks("beforeSelectColumns",v,_,C),v.row=y,_.row=E,this.setRangeStartOnly(v,void 0,C),this.selectedByColumnHeader.add(this.getLayerLevel()),this.setRangeEnd(_),this.runLocalHooks("afterSelectColumns",v,_,C),this.finish()}return d}selectRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;const i=this.tableProps.countRows(),o=this.tableProps.countCols(),s=this.tableProps.countRowHeaders(),a=s===0?0:-s,l=this.tableProps.createCellCoords(e,a),u=this.tableProps.createCellCoords(n,o-1),c=this.tableProps.createCellRange(l,l,u).isValid({countRows:i,countCols:o,countRowHeaders:s,countColHeaders:0});if(c){let h=0,d=0;Number.isInteger(r==null?void 0:r.row)&&Number.isInteger(r==null?void 0:r.col)?(h=Ue(r.row,Math.min(e,n),Math.max(e,n)),d=Ue(r.col,a,o-1)):(h=e,d=Ue(r,a,o-1));const f=this.tableProps.createCellCoords(h,d),m=s===0?0:Ue(f.col,a,-1),C=o-1,y=this.tableProps.createCellCoords(e,m),E=this.tableProps.createCellCoords(n,C);this.runLocalHooks("beforeSelectRows",y,E,f),y.col=m,E.col=C,this.setRangeStartOnly(y,void 0,f),this.selectedByRowHeader.add(this.getLayerLevel()),this.setRangeEnd(E),this.runLocalHooks("afterSelectRows",y,E,f),this.finish()}return c}refresh(){if(!this.isSelected())return;const e=this.tableProps.countRows(),n=this.tableProps.countCols();if(e===0||n===0){this.deselect();return}const r=this.selectedRange.peekByIndex(this.selectedRange.size()-1),{from:i,to:o,highlight:s}=r;this.clear(),s.assign({row:Ue(s.row,-1/0,e-1),col:Ue(s.col,-1/0,n-1)}),i.assign({row:Ue(i.row,-1/0,e-1),col:Ue(i.col,-1/0,n-1)}),o.assign({row:Ue(o.row,0,e-1),col:Ue(o.col,0,n-1)}),this.selectedRange.ranges.push(r),this.highlight.isEnabledFor(yh,this.selectedRange.current().highlight)&&this.highlight.getFocus().add(s).commit().syncWith(r),this.applyAndCommit(r)}commit(){if(this.highlight.getCustomSelections().forEach(i=>{i.commit()}),!this.isSelected())return;const n=this.getLayerLevel(),r=this.selectedRange.current();this.highlight.isEnabledFor(yh,r.highlight)&&this.highlight.getFocus().commit().syncWith(r);for(let i=0;i<this.selectedRange.size();i+=1){this.highlight.useLayerLevel(i);const o=this.highlight.createArea(),s=this.highlight.createLayeredArea(),a=this.highlight.createRowHeader(),l=this.highlight.createColumnHeader(),u=this.highlight.createActiveRowHeader(),c=this.highlight.createActiveColumnHeader(),h=this.highlight.createActiveCornerHeader(),d=this.highlight.createRowHighlight(),f=this.highlight.createColumnHighlight();o.commit(),s.commit(),a.commit(),l.commit(),u.commit(),c.commit(),h.commit(),d.commit(),f.commit()}this.highlight.useLayerLevel(n)}}ut(ZD,Rn);const px=/^(\r\n|\n\r|\r|\n)/,o3=/^[^\t\r\n]+/,wx=/^\t/;function s3(t){const e=[[""]];if(t.length===0)return e;let n=0,r=0,i;for(;t.length>0&&i!==t.length;)if(i=t.length,t.match(wx))t=t.replace(wx,""),n+=1,e[r][n]="";else if(t.match(px))t=t.replace(px,""),n=0,r+=1,e[r]=[""];else{let o="";if(t.startsWith('"')){let s=0,a=!0;for(;a;){const l=t.slice(0,1);l==='"'&&(s+=1),o+=l,t=t.slice(1),(t.length===0||t.match(/^[\t\r\n]/)&&s%2===0)&&(a=!1)}o=o.replace(/^"/,"").replace(/"$/,"").replace(/["]*/g,l=>new Array(Math.floor(l.length/2)).fill('"').join(""))}else{const s=t.match(o3);o=s?s[0]:"",t=t.slice(o.length)}e[r][n]=o}return e}function Sh(t){let e,n,r,i,o="",s;for(e=0,n=t.length;e<n;e+=1){for(i=t[e].length,r=0;r<i;r+=1)r>0&&(o+=" "),s=t[e][r],typeof s=="string"?s.indexOf(`
54
+ `)>-1?o+=`"${s.replace(/"/g,'""')}"`:o+=s:s==null?o+="":o+=s;e!==n-1&&(o+=`
55
+ `)}return o}function ha(t,e,n){return(e=a3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a3(t){var e=l3(t,"string");return typeof e=="symbol"?e:e+""}function l3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Cu{static get DESTINATION_RENDERER(){return 1}static get DESTINATION_CLIPBOARD_GENERATOR(){return 2}constructor(e,n,r){ha(this,"hot",void 0),ha(this,"metaManager",void 0),ha(this,"tableMeta",void 0),ha(this,"dataSource",void 0),ha(this,"duckSchema",void 0),ha(this,"colToPropCache",void 0),ha(this,"propToColCache",void 0),this.hot=e,this.metaManager=r,this.tableMeta=r.getTableMeta(),this.dataSource=n,this.refreshDuckSchema(),this.createMap()}createMap(){const e=this.getSchema();if(typeof e>"u")throw new Error("trying to create `columns` definition but you didn't provide `schema` nor `data`");const n=this.tableMeta.columns;let r;if(this.colToPropCache=[],this.propToColCache=new Map,n){let i=0,o=0,s=!1;if(typeof n=="function"){const a=$R(e);i=a>0?a:this.countFirstRowKeys(),s=!0}else{const a=this.tableMeta.maxCols;i=Math.min(a,n.length)}for(r=0;r<i;r++){const a=s?n(r):n[r];if(Ae(a)){if(typeof a.data<"u"){const l=s?o:r;this.colToPropCache[l]=a.data,this.propToColCache.set(a.data,l)}o+=1}}}else this.recursiveDuckColumns(e)}countFirstRowKeys(){return HD(this.dataSource)}recursiveDuckColumns(e,n,r){let i=n,o=r,s;return typeof i>"u"&&(i=0,o=""),typeof e=="object"&&!Array.isArray(e)&&He(e,(a,l)=>{a===null?(s=o+l,this.colToPropCache.push(s),this.propToColCache.set(s,i),i+=1):i=this.recursiveDuckColumns(a,i,`${l}.`)}),i}colToProp(e){if(Number.isInteger(e)===!1)return e;const n=this.hot.toPhysicalColumn(e);return n===null?e:this.colToPropCache&&ae(this.colToPropCache[n])?this.colToPropCache[n]:n}propToCol(e){const n=this.propToColCache.get(e);if(ae(n))return this.hot.toVisualColumn(n);const r=this.hot.toVisualColumn(e);return r===null?e:r}getSchema(){const e=this.tableMeta.dataSchema;return e?typeof e=="function"?e():e:this.duckSchema}createDuckSchema(){return this.dataSource&&this.dataSource[0]?zh(this.dataSource[0]):{}}refreshDuckSchema(){this.duckSchema=this.createDuckSchema()}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:r,mode:i="above"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.hot.countSourceRows();let s=o,a=0,l=e;if((typeof l!="number"||l>=o)&&(l=o),l<this.hot.countRows()&&(s=this.hot.toPhysicalRow(l)),this.hot.runHooks("beforeCreateRow",l,n,r)===!1||s===null)return{delta:0};const c=this.tableMeta.maxRows,h=this.getSchema().length,d=[];for(;a<n&&o+a<c;){let m=null;this.hot.dataType==="array"?this.tableMeta.dataSchema?m=Gn(this.getSchema()):(m=[],de(h-1,()=>m.push(null))):this.hot.dataType==="function"?m=this.tableMeta.dataSchema(l+a):(m={},op(m,this.getSchema())),d.push(m),a+=1}this.hot.rowIndexMapper.insertIndexes(l,a),i==="below"&&(s=Math.min(s+1,o)),this.spliceData(s,0,d);const f=this.hot.toVisualRow(s);return this.hot.countSourceRows()===d.length&&this.hot.columnIndexMapper.initToLength(this.hot.getInitialColumnCount()),a>0&&(e==null?this.metaManager.createRow(null,a):r!=="auto"&&this.metaManager.createRow(s,n)),this.hot.runHooks("afterCreateRow",f,a,r),{delta:a,startPhysicalIndex:s}}createCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,{source:r,mode:i="start"}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!this.hot.isColumnModificationAllowed())throw new Error("Cannot create new column. When data source in an object, you can only have as much columns as defined in first data row, data schema or in the 'columns' setting.If you want to be able to add new columns, you have to use array datasource.");const o=this.dataSource,s=this.tableMeta.maxCols,a=this.hot.countSourceCols();let l=e;if((typeof l!="number"||l>=a)&&(l=a),this.hot.runHooks("beforeCreateCol",l,n,r)===!1)return{delta:0};let c=a;l<this.hot.countCols()&&(c=this.hot.toPhysicalColumn(l));const h=this.hot.countSourceRows();let d=this.hot.countCols(),f=0,m=c;i==="end"&&(m=Math.min(m+1,a));const C=m;for(;f<n&&d<s;){if(typeof l!="number"||l>=d)if(h>0)for(let E=0;E<h;E+=1)typeof o[E]>"u"&&(o[E]=[]),o[E].push(null);else o.push([null]);else for(let E=0;E<h;E++)o[E].splice(m,0,null);f+=1,m+=1,d+=1}this.hot.columnIndexMapper.insertIndexes(l,f),f>0&&(e==null?this.metaManager.createColumn(null,f):r!=="auto"&&this.metaManager.createColumn(C,n));const y=this.hot.toVisualColumn(C);return this.hot.runHooks("afterCreateCol",y,f,r),this.refreshDuckSchema(),{delta:f,startPhysicalIndex:C}}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0,i=Number.isInteger(e)?e:-n;const o=this.visualRowsToPhysical(i,n),s=this.hot.countSourceRows();if(i=(s+i)%s,this.hot.runHooks("beforeRemoveRow",i,o.length,o,r)===!1)return!1;const l=o.length;if(this.filterData(i,l,o),i<this.hot.countRows()){this.hot.rowIndexMapper.removeIndexes(o);const c=ae(this.tableMeta.columns)||ae(this.tableMeta.dataSchema)||this.tableMeta.colHeaders;this.hot.rowIndexMapper.getNotTrimmedIndexesLength()===0&&!c&&this.hot.columnIndexMapper.setIndexesSequence([])}return o.slice(0).sort((c,h)=>h-c).forEach(c=>{this.metaManager.removeRow(c,1)}),this.hot.runHooks("afterRemoveRow",i,l,o,r),!0}removeCol(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if(this.hot.dataType==="object"||this.tableMeta.columns)throw new Error("cannot remove column with object data source or columns option specified");let i=typeof e!="number"?-n:e;i=(this.hot.countCols()+i)%this.hot.countCols();const o=this.visualColumnsToPhysical(i,n),s=o.slice(0).sort((h,d)=>d-h);if(this.hot.runHooks("beforeRemoveCol",i,n,o,r)===!1)return!1;let l=!0;const u=s.length,c=this.dataSource;for(let h=0;h<u;h++)l&&o[0]!==o[h]-h&&(l=!1);if(l)for(let h=0,d=this.hot.countSourceRows();h<d;h++)c[h].splice(o[0],n),h===0&&this.metaManager.removeColumn(o[0],n);else for(let h=0,d=this.hot.countSourceRows();h<d;h++)for(let f=0;f<u;f++)c[h].splice(s[f],1),h===0&&this.metaManager.removeColumn(s[f],1);return i<this.hot.countCols()&&(this.hot.columnIndexMapper.removeIndexes(o),!this.tableMeta.rowHeaders&&this.hot.columnIndexMapper.getNotTrimmedIndexesLength()===0&&this.hot.rowIndexMapper.setIndexesSequence([])),this.hot.runHooks("afterRemoveCol",i,n,o,r),this.refreshDuckSchema(),!0}spliceCol(e,n,r){const i=this.hot.getDataAtCol(e),o=i.slice(n,n+r),s=i.slice(n+r);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];SP(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return PU(l),this.hot.populateFromArray(n,e,l,null,null,"spliceCol"),o}spliceRow(e,n,r){const i=this.hot.getSourceDataAtRow(e),o=i.slice(n,n+r),s=i.slice(n+r);for(var a=arguments.length,l=new Array(a>3?a-3:0),u=3;u<a;u++)l[u-3]=arguments[u];SP(l,s);let c=0;for(;c<r;)l.push(null),c+=1;return this.hot.populateFromArray(e,n,[l],null,null,"spliceRow"),o}spliceData(e,n,r){if(this.hot.runHooks("beforeDataSplice",e,n,r)!==!1){const o=[...this.dataSource.slice(0,e),...r,...this.dataSource.slice(e)];this.dataSource.length=0,o.forEach(s=>this.dataSource.push(s))}}filterData(e,n,r){let i=this.hot.runHooks("filterData",e,n,r);Array.isArray(i)===!1&&(i=this.dataSource.filter((o,s)=>r.indexOf(s)===-1)),this.dataSource.length=0,Array.prototype.push.apply(this.dataSource,i)}get(e,n){const r=this.hot.toPhysicalRow(e);let i=this.dataSource[r];const o=this.hot.runHooks("modifyRowData",r);i=isNaN(o)?o:i;const{dataDotNotation:s}=this.hot.getSettings();let a=null;if(i&&i.hasOwnProperty&&nn(i,n))a=i[n];else if(s&&typeof n=="string"&&n.indexOf(".")>-1){let l=i;if(!l)return null;const u=n.split(".");for(let c=0,h=u.length;c<h;c++)if(l=l[u[c]],typeof l>"u")return null;a=l}else typeof n=="function"&&(a=n(this.dataSource.slice(r,r+1)[0]));if(this.hot.hasHook("modifyData")){const l=Ir(a);this.hot.runHooks("modifyData",r,this.propToCol(n),l,"get"),l.isTouched()&&(a=l.value)}return a}getCopyable(e,n){return this.hot.getCellMeta(e,this.propToCol(n)).copyable?this.get(e,n):""}set(e,n,r){const i=this.hot.toPhysicalRow(e);let o=r,s=this.dataSource[i];const a=this.hot.runHooks("modifyRowData",i);if(s=isNaN(a)?a:s,this.hot.hasHook("modifyData")){const u=Ir(o);this.hot.runHooks("modifyData",i,this.propToCol(n),u,"set"),u.isTouched()&&(o=u.value)}const{dataDotNotation:l}=this.hot.getSettings();if(s&&s.hasOwnProperty&&nn(s,n))s[n]=o;else if(l&&typeof n=="string"&&n.indexOf(".")>-1){let u=s,c=0,h;const d=n.split(".");for(c=0,h=d.length-1;c<h;c++){if(d[c]==="__proto__"||d[c]==="constructor"||d[c]==="prototype")return;typeof u[d[c]]>"u"&&(u[d[c]]={}),u=u[d[c]]}u[d[c]]=o}else if(typeof n=="function")n(this.dataSource.slice(i,i+1)[0],o);else{if(n==="__proto__"||n==="constructor"||n==="prototype")return;s[n]=o}}visualRowsToPhysical(e,n){const r=this.hot.countSourceRows(),i=[];let o=(r+e)%r,s=n,a;for(;o<r&&s;)a=this.hot.toPhysicalRow(o),i.push(a),s-=1,o+=1;return i}visualColumnsToPhysical(e,n){const r=this.hot.countCols(),i=[];let o=(r+e)%r,s=n;for(;o<r&&s;){const a=this.hot.toPhysicalColumn(o);i.push(a),s-=1,o+=1}return i}clear(){for(let e=0;e<this.hot.countSourceRows();e++)for(let n=0;n<this.hot.countCols();n++)this.set(e,this.colToProp(n),"")}getLength(){const e=this.tableMeta.maxRows;let n;e<0||e===0?n=0:n=e||1/0;const r=this.hot.rowIndexMapper.getNotTrimmedIndexesLength();return Math.min(r,n)}getAll(){const e={row:0,col:0},n={row:Math.max(this.hot.countRows()-1,0),col:Math.max(this.hot.countCols()-1,0)};return e.row-n.row===0&&!this.hot.countSourceRows()?[]:this.getRange(e,n,Cu.DESTINATION_RENDERER)}countCachedColumns(){return this.colToPropCache.length}getRange(e,n,r){const i=[];let o,s,a;const l=this.tableMeta.maxRows,u=this.tableMeta.maxCols;if(l===0||u===0)return[];const c=r===Cu.DESTINATION_CLIPBOARD_GENERATOR?this.getCopyable:this.get,h=Math.min(Math.max(l-1,0),Math.max(e.row,n.row)),d=Math.min(Math.max(u-1,0),Math.max(e.col,n.col));for(o=Math.min(e.row,n.row);o<=h;o++){a=[];const f=o>=0?this.hot.toPhysicalRow(o):o;for(s=Math.min(e.col,n.col);s<=d&&f!==null;s++)a.push(c.call(this,o,this.colToProp(s)));f!==null&&i.push(a)}return i}getText(e,n){return Sh(this.getRange(e,n,Cu.DESTINATION_RENDERER))}getCopyableText(e,n){return Sh(this.getRange(e,n,Cu.DESTINATION_CLIPBOARD_GENERATOR))}destroy(){this.hot=null,this.metaManager=null,this.dataSource=null,this.duckSchema=null,this.colToPropCache.length=0,this.propToColCache.clear(),this.propToColCache=void 0}}const{register:u3,getItem:c3,hasItem:QD,getNames:Fle,getValues:Vle}=Oi("cellTypes");function h3(t){if(!QD(t))throw Error(`You declared cell type "${t}" as a string that is not mapped to a known object.
56
+ Cell type must be an object or a string mapped to an object registered by
57
+ "Handsontable.cellTypes.registerCellType" method`);return c3(t)}function ci(t,e){typeof t!="string"&&(e=t,t=e.CELL_TYPE);const{editor:n,renderer:r,validator:i}=e;n&&br(t,n),r&&Lr(t,r),i&&hu(t,i),u3(t,e)}function d3(t,e){var n;return t==="CELL_TYPE"?!1:((n=e._automaticallyAssignedMetaProps)===null||n===void 0?void 0:n.has(t))||!nn(e,t)}function pp(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;const r=typeof e.type=="string"?h3(e.type):e.type;if(t._automaticallyAssignedMetaProps&&He(e,(o,s)=>void t._automaticallyAssignedMetaProps.delete(s)),!Ae(r))return;n===t&&!t._automaticallyAssignedMetaProps&&(t._automaticallyAssignedMetaProps=new Set);const i={};He(r,(o,s)=>{if(d3(s,n)){var a;i[s]=o,(a=t._automaticallyAssignedMetaProps)===null||a===void 0||a.add(s)}}),on(t,i)}function f3(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];function n(){}yz(n,t);for(let r=0;r<e.length;r++)n.prototype[e[r]]=void 0;return n}function Mg(t){return Number.isInteger(t)&&t>=0}function Ig(t,e){if(!t())throw new Error(`Assertion failed: ${e}`)}function cf(t){return t==null}const JD=()=>({_automaticallyAssignedMetaProps:void 0,activeHeaderClassName:"ht__active_highlight",allowEmpty:!0,allowHtml:!1,allowInsertColumn:!0,allowInsertRow:!0,allowInvalid:!0,allowRemoveColumn:!0,allowRemoveRow:!0,ariaTags:!0,autoColumnSize:void 0,autoRowSize:void 0,autoWrapCol:!1,autoWrapRow:!1,bindRowsWithHeaders:void 0,cell:[],cells:void 0,checkedTemplate:void 0,className:void 0,colHeaders:null,collapsibleColumns:void 0,columnHeaderHeight:void 0,columns:void 0,columnSorting:void 0,columnSummary:void 0,colWidths:void 0,commentedCellClassName:"htCommentCell",comments:!1,contextMenu:void 0,copyable:!0,copyPaste:!0,correctFormat:!1,currentColClassName:void 0,currentHeaderClassName:"ht__highlight",currentRowClassName:void 0,customBorders:!1,data:void 0,dataDotNotation:!0,dataSchema:void 0,dateFormat:"DD/MM/YYYY",timeFormat:"h:mm:ss a",datePickerConfig:void 0,defaultDate:void 0,disableVisualSelection:!1,dragToScroll:!0,dropdownMenu:void 0,editor:void 0,enterBeginsEditing:!0,enterMoves:{col:0,row:1},fillHandle:{autoInsertRow:!1},filter:!0,filteringCaseSensitive:!1,filters:void 0,fixedColumnsLeft:0,fixedColumnsStart:0,fixedRowsBottom:0,fixedRowsTop:0,formulas:void 0,fragmentSelection:!1,headerClassName:void 0,height:void 0,hiddenColumns:void 0,hiddenRows:void 0,invalidCellClassName:"htInvalid",imeFastEdit:!1,isEmptyCol(t){let e,n,r;for(e=0,n=this.countRows();e<n;e++)if(r=this.getDataAtCell(e,t),Ut(r)===!1)return!1;return!0},isEmptyRow(t){let e,n,r,i;for(e=0,n=this.countCols();e<n;e++)if(r=this.getDataAtCell(t,e),Ut(r)===!1)return typeof r=="object"?(i=this.getCellMeta(t,e),LR(this.getSchema()[i.prop],r)):!1;return!0},label:void 0,language:"en-US",layoutDirection:"inherit",licenseKey:void 0,locale:"en-US",manualColumnFreeze:void 0,manualColumnMove:void 0,manualColumnResize:void 0,manualRowMove:void 0,manualRowResize:void 0,maxCols:1/0,maxRows:1/0,mergeCells:!1,minCols:0,minRows:0,minSpareCols:0,minSpareRows:0,multiColumnSorting:void 0,navigableHeaders:!1,tabNavigation:!0,nestedHeaders:void 0,nestedRows:void 0,noWordWrapClassName:"htNoWrap",numericFormat:void 0,observeDOMVisibility:!0,outsideClickDeselects:!0,persistentState:void 0,placeholder:void 0,placeholderCellClassName:"htPlaceholder",preventOverflow:!1,preventWheel:!1,readOnly:!1,readOnlyCellClassName:"htDimmed",renderAllRows:!1,renderAllColumns:!1,renderer:void 0,rowHeaders:void 0,rowHeaderWidth:void 0,rowHeights:void 0,search:!1,selectionMode:"multiple",selectOptions:void 0,skipColumnOnPaste:!1,skipRowOnPaste:!1,sortByRelevance:!0,source:void 0,startCols:5,startRows:5,stretchH:"none",strict:void 0,tableClassName:void 0,themeName:void 0,tabMoves:{row:0,col:1},title:void 0,trimDropdown:!0,trimRows:void 0,trimWhitespace:!0,type:"text",uncheckedTemplate:void 0,undo:!0,validator:void 0,viewportColumnRenderingOffset:"auto",viewportRowRenderingOffset:"auto",viewportColumnRenderingThreshold:0,viewportRowRenderingThreshold:0,visibleRows:10,width:void 0,wordWrap:!0});function vx(t,e,n){return(e=g3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g3(t){var e=m3(t,"string");return typeof e=="symbol"?e:e+""}function m3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function p3(){return class{}}class w3{constructor(e){vx(this,"metaCtor",p3()),vx(this,"meta",void 0),this.meta=this.metaCtor.prototype,on(this.meta,JD()),this.meta.instance=e}getMetaConstructor(){return this.metaCtor}getMeta(){return this.meta}updateMeta(e){var n;on(this.meta,e),pp(this.meta,{...e,type:(n=e.type)!==null&&n!==void 0?n:this.meta.type},e)}}function v3(t,e,n){return(e=C3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C3(t){var e=y3(t,"string");return typeof e=="symbol"?e:e+""}function y3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class b3{constructor(e){v3(this,"meta",void 0);const n=e.getMetaConstructor();this.meta=new n}getMeta(){return this.meta}updateMeta(e){on(this.meta,e),pp(this.meta,e,e)}}function hf(t,e,n){return(e=S3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S3(t){var e=R3(t,"string");return typeof e=="symbol"?e:e+""}function R3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class nm{constructor(e){hf(this,"valueFactory",void 0),hf(this,"data",[]),hf(this,"index",[]),hf(this,"holes",new Set),this.valueFactory=e}obtain(e){Ig(()=>Mg(e),"Expecting an unsigned number.");const n=this._getStorageIndexByKey(e);let r;if(n>=0)r=this.data[n],r===void 0&&(r=this.valueFactory(e),this.data[n]=r);else if(r=this.valueFactory(e),this.holes.size>0){const i=this.holes.values().next().value;this.holes.delete(i),this.data[i]=r,this.index[e]=i}else this.data.push(r),this.index[e]=this.data.length-1;return r}insert(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ig(()=>Mg(e)||cf(e),"Expecting an unsigned number or null/undefined argument.");const r=[],i=this.data.length;for(let s=0;s<n;s++)r.push(i+s),this.data.push(void 0);const o=cf(e)?this.index.length:e;this.index=[...this.index.slice(0,o),...r,...this.index.slice(o)]}remove(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ig(()=>Mg(e)||cf(e),"Expecting an unsigned number or null/undefined argument.");const r=this.index.splice(cf(e)?this.index.length-n:e,n);for(let i=0;i<r.length;i++){const o=r[i];typeof o=="number"&&this.holes.add(o)}}size(){return this.data.length-this.holes.size}values(){return this.data.filter((e,n)=>e!==void 0&&!this.holes.has(n))[Symbol.iterator]()}entries(){const e=[];for(let r=0;r<this.data.length;r++){const i=this._getKeyByStorageIndex(r);i!==-1&&this.data[r]!==void 0&&e.push([i,this.data[r]])}let n=0;return{next:()=>{if(n<e.length){const r=e[n];return n+=1,{value:r,done:!1}}return{done:!0}}}}clear(){this.data=[],this.index=[],this.holes.clear()}_getStorageIndexByKey(e){return this.index.length>e?this.index[e]:-1}_getKeyByStorageIndex(e){return this.index.indexOf(e)}[Symbol.iterator](){return this.entries()}}function Cx(t,e,n){return(e=E3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function E3(t){var e=T3(t,"string");return typeof e=="symbol"?e:e+""}function T3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const _3=["data","width"];class M3{constructor(e){Cx(this,"globalMeta",void 0),Cx(this,"metas",new nm(()=>this._createMeta())),this.globalMeta=e,this.metas=new nm(()=>this._createMeta())}updateMeta(e,n){const r=this.getMeta(e);on(r,n),pp(r,n)}createColumn(e,n){this.metas.insert(e,n)}removeColumn(e,n){this.metas.remove(e,n)}getMeta(e){return this.metas.obtain(e)}getMetaConstructor(e){return this.metas.obtain(e).constructor}clearCache(){this.metas.clear()}_createMeta(){return f3(this.globalMeta.getMetaConstructor(),_3).prototype}}function yx(t,e,n){return(e=I3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function I3(t){var e=P3(t,"string");return typeof e=="symbol"?e:e+""}function P3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class O3{constructor(e){yx(this,"columnMeta",void 0),yx(this,"metas",new nm(()=>this._createRow())),this.columnMeta=e}updateMeta(e,n,r){const i=this.getMeta(e,n);on(i,r),pp(i,r)}createRow(e,n){this.metas.insert(e,n)}createColumn(e,n){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).insert(e,n)}removeRow(e,n){this.metas.remove(e,n)}removeColumn(e,n){for(let r=0;r<this.metas.size();r++)this.metas.obtain(r).remove(e,n)}getMeta(e,n,r){const i=this.metas.obtain(e).obtain(n);return r===void 0?i:i[r]}setMeta(e,n,r,i){var o;const s=this.metas.obtain(e).obtain(n);(o=s._automaticallyAssignedMetaProps)===null||o===void 0||o.delete(r),s[r]=i}removeMeta(e,n,r){const i=this.metas.obtain(e).obtain(n);delete i[r]}getMetas(){const e=[],n=Array.from(this.metas.values());for(let r=0;r<n.length;r++)ae(n[r])&&e.push(...n[r].values());return e}getMetasAtRow(e){Ig(()=>Mg(e),"Expecting an unsigned number.");const n=new Map(this.metas);return n.has(e)?Array.from(n.get(e).values()):[]}clearCache(){this.metas.clear()}_createRow(){return new nm(e=>this._createMeta(e))}_createMeta(e){const n=this.columnMeta.getMetaConstructor(e);return new n}}class ek{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];this.hot=e,this.globalMeta=new w3(e),this.tableMeta=new b3(this.globalMeta),this.columnMeta=new M3(this.globalMeta),this.cellMeta=new O3(this.columnMeta),r.forEach(i=>new i(this)),this.globalMeta.updateMeta(n)}getGlobalMeta(){return this.globalMeta.getMeta()}updateGlobalMeta(e){this.globalMeta.updateMeta(e)}getTableMeta(){return this.tableMeta.getMeta()}updateTableMeta(e){this.tableMeta.updateMeta(e)}getColumnMeta(e){return this.columnMeta.getMeta(e)}updateColumnMeta(e,n){this.columnMeta.updateMeta(e,n)}getCellMeta(e,n,r){const i=this.cellMeta.getMeta(e,n);return i.visualRow=r.visualRow,i.visualCol=r.visualColumn,i.row=e,i.col=n,r.skipMetaExtension||this.runLocalHooks("afterGetCellMeta",i),i}getCellMetaKeyValue(e,n,r){if(typeof r!="string")throw new Error("The passed cell meta object key is not a string");return this.cellMeta.getMeta(e,n,r)}setCellMeta(e,n,r,i){this.cellMeta.setMeta(e,n,r,i)}updateCellMeta(e,n,r){this.cellMeta.updateMeta(e,n,r)}removeCellMeta(e,n,r){this.cellMeta.removeMeta(e,n,r)}getCellsMeta(){return this.cellMeta.getMetas()}getCellsMetaAtRow(e){return this.cellMeta.getMetasAtRow(e)}createRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createRow(e,n)}removeRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeRow(e,n)}createColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.createColumn(e,n),this.columnMeta.createColumn(e,n)}removeColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.cellMeta.removeColumn(e,n),this.columnMeta.removeColumn(e,n)}clearCellsCache(){this.cellMeta.clearCache()}clearCache(){this.cellMeta.clearCache(),this.columnMeta.clearCache()}}ut(ek,Rn);function bx(t,e,n,r){const{hotInstance:i,dataMap:o,dataSource:s,internalSource:a,source:l,metaManager:u,firstRun:c}=r,h=Ti(a),d=i.getSettings();Array.isArray(d.dataSchema)?i.dataType="array":ot(d.dataSchema)?i.dataType="function":i.dataType="object",o&&o.destroy(),t=i.runHooks(`before${h}`,t,c,l);const f=new Cu(i,t,u);if(e(f),typeof t=="object"&&t!==null)t.push&&t.splice||(t=[t]);else if(t===null){const m=f.getSchema();t=[];let C,y=0,E=0;for(y=0,E=d.startRows;y<E;y++)if((i.dataType==="object"||i.dataType==="function")&&d.dataSchema)C=Gn(m),t.push(C);else if(i.dataType==="array")C=Gn(m[0]),t.push(C);else{C=[];for(let v=0,_=d.startCols;v<_;v++)C.push(null);t.push(C)}}else throw new Error(`${a} only accepts array of objects or array of arrays (${typeof t} given)`);Array.isArray(t[0])&&(i.dataType="array"),d.data=t,f.dataSource=t,s.data=t,s.dataType=i.dataType,s.colToProp=f.colToProp.bind(f),s.propToCol=f.propToCol.bind(f),s.countCachedColumns=f.countCachedColumns.bind(f),n(f),i.runHooks(`after${h}`,t,c,l),c||(i.runHooks("afterChange",null,a),i.render()),i.getSettings().ariaTags&&ye(i.rootElement,[AN(-1),tp(i.countCols()+(i.view?i.countRowHeaders():0))])}function Sx(t,e,n){return(e=x3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function x3(t){var e=A3(t,"string");return typeof e=="symbol"?e:e+""}function A3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class H3{constructor(e){var n=this;Sx(this,"metaManager",void 0),Sx(this,"metaSyncMemo",new Map),this.metaManager=e,e.addLocalHook("afterGetCellMeta",function(){return n.extendCellMeta(...arguments)}),re.getSingleton().add("beforeRender",r=>{r&&this.metaSyncMemo.clear()},this.metaManager.hot)}extendCellMeta(e){var n;const{row:r,col:i}=e;if((n=this.metaSyncMemo.get(r))!==null&&n!==void 0&&n.has(i))return;const{visualRow:o,visualCol:s}=e,a=this.metaManager.hot,l=a.colToProp(s);e.prop=l,a.runHooks("beforeGetCellMeta",o,s,e);const u=nn(e,"type")?e.type:null;let c=ot(e.cells)?e.cells(r,i,l):null;if(u)if(c){var h;c.type=(h=c.type)!==null&&h!==void 0?h:u}else c={type:u};c&&this.metaManager.updateCellMeta(r,i,c),a.runHooks("afterGetCellMeta",o,s,e),this.metaSyncMemo.has(r)||this.metaSyncMemo.set(r,new Set),this.metaSyncMemo.get(r).add(i)}}function N3(t,e,n){D3(t,e),e.set(t,n)}function D3(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function iy(t,e,n){return(e=k3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k3(t){var e=L3(t,"string");return typeof e=="symbol"?e:e+""}function L3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $3(t,e){return t.get(F3(t,e))}function F3(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Rx=new WeakMap;class V3{constructor(e){iy(this,"metaManager",void 0),iy(this,"usageTracker",new Set),iy(this,"propDescriptors",new Map([["ariaTags",{initOnly:!0}],["fixedColumnsLeft",{target:"fixedColumnsStart",onChange(n){if(this.metaManager.hot.isRtl()&&n==="fixedColumnsLeft")throw new Error("The `fixedColumnsLeft` is not supported for RTL. Please use option `fixedColumnsStart`.");if(this.usageTracker.has("fixedColumnsLeft")&&this.usageTracker.has("fixedColumnsStart"))throw new Error("The `fixedColumnsLeft` and `fixedColumnsStart` should not be used together. Please use only the option `fixedColumnsStart`.")}}],["layoutDirection",{initOnly:!0}],["renderAllColumns",{initOnly:!0}],["renderAllRows",{initOnly:!0}]])),N3(this,Rx,(n,r,i)=>{if(!i)throw new Error(`The \`${n}\` option can not be updated after the Handsontable is initialized.`)}),this.metaManager=e,this.extendMetaProps()}extendMetaProps(){this.propDescriptors.forEach((e,n)=>{const{initOnly:r,target:i,onChange:o}=e,s=typeof i=="string",a=s?i:n,l=`_${a}`;this.metaManager.globalMeta.meta[l]=this.metaManager.globalMeta.meta[a],o?(this.installPropWatcher(n,l,o),s&&this.installPropWatcher(i,l,o)):r&&(this.installPropWatcher(n,l,$3(Rx,this)),this.metaManager.globalMeta.meta._initOnlySettings||(this.metaManager.globalMeta.meta._initOnlySettings=[]),this.metaManager.globalMeta.meta._initOnlySettings.push(n))})}installPropWatcher(e,n,r){const i=this;Object.defineProperty(this.metaManager.globalMeta.meta,e,{get(){return this[n]},set(o){const s=!i.usageTracker.has(e);i.usageTracker.add(e),r.call(i,e,o,s),this[n]=o},enumerable:!0,configurable:!0})}}const tk="gridDefault",Js="editorManager.handlingEditor",W3={name:"editorCloseAndSave",callback(t){t._getEditorManager().closeEditorAndSaveChanges()}},B3="hooksRefRegisterer",nk={_hooksStorage:Object.create(null),addHook(t,e){return this._hooksStorage[t]||(this._hooksStorage[t]=[]),this.hot.addHook(t,e),this._hooksStorage[t].push(e),this},removeHooksByKey(t){I(this._hooksStorage[t]||[],e=>{this.hot.removeHook(t,e)})},clearHooks(){He(this._hooksStorage,(t,e)=>this.removeHooksByKey(e)),this._hooksStorage={}}};as(nk,"MIXIN_NAME",B3,{writable:!1,enumerable:!1});function oi(t,e,n){return(e=j3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function j3(t){var e=U3(t,"string");return typeof e=="symbol"?e:e+""}function U3(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const z3="base",Bt=Object.freeze({VIRGIN:"STATE_VIRGIN",EDITING:"STATE_EDITING",WAITING:"STATE_WAITING",FINISHED:"STATE_FINISHED"});class Qu{static get EDITOR_TYPE(){return z3}constructor(e){oi(this,"hot",void 0),oi(this,"state",Bt.VIRGIN),oi(this,"_opened",!1),oi(this,"_fullEditMode",!1),oi(this,"_closeCallback",null),oi(this,"TD",null),oi(this,"row",null),oi(this,"col",null),oi(this,"prop",null),oi(this,"originalValue",null),oi(this,"cellProperties",null),this.hot=e,this.init()}_fireCallbacks(e){this._closeCallback&&(this._closeCallback(e),this._closeCallback=null)}init(){}getValue(){throw Error("Editor getValue() method unimplemented")}setValue(){throw Error("Editor setValue() method unimplemented")}open(){throw Error("Editor open() method unimplemented")}close(){throw Error("Editor close() method unimplemented")}prepare(e,n,r,i,o,s){this.TD=i,this.row=e,this.col=n,this.prop=r,this.originalValue=o,this.cellProperties=s,this.state=this.isOpened()?this.state:Bt.VIRGIN}extend(){return class extends this.constructor{}}saveValue(e,n){let r,i,o,s;if(n){const l=this.hot.getSelectedLast();r=Math.max(Math.min(l[0],l[2]),0),i=Math.max(Math.min(l[1],l[3]),0),o=Math.max(l[0],l[2]),s=Math.max(l[1],l[3])}else[r,i,o,s]=[this.row,this.col,null,null];const a=this.hot.runHooks("modifyGetCellCoords",r,i,!1,"meta");Array.isArray(a)&&([r,i]=a),this.hot.populateFromArray(r,i,e,o,s,"edit")}beginEditing(e,n){if(this.state!==Bt.VIRGIN)return;const r=this.hot,i=r.rowIndexMapper.getRenderableFromVisualIndex(this.row),o=r.columnIndexMapper.getRenderableFromVisualIndex(this.col),s=()=>{if(this.state=Bt.EDITING,this.isInFullEditMode()){const l=typeof e=="string"?e:Pt(this.originalValue);this.setValue(l)}this.open(n),this._opened=!0,this.focus(),r.view.render(),r.runHooks("afterBeginEditing",this.row,this.col)};this.hot.addHookOnce("afterScroll",s),r.view.scrollViewport(r._createCellCoords(i,o))||(this.hot.removeHook("afterScroll",s),s())}finishEditing(e,n,r){let i;if(r){const o=this._closeCallback;this._closeCallback=s=>{o&&o(s),r(s),this.hot.view.render()}}if(!this.isWaiting()){if(this.state===Bt.VIRGIN){this.hot._registerTimeout(()=>{this._fireCallbacks(!0)});return}if(this.state===Bt.EDITING){if(e){this.cancelChanges(),this.hot.view.render();return}const o=this.getValue();this.cellProperties.trimWhitespace?i=[[typeof o=="string"?String.prototype.trim.call(o||""):o]]:i=[[o]],this.state=Bt.WAITING,this.saveValue(i,n),this.hot.getCellValidator(this.cellProperties)?this.hot.addHookOnce("postAfterValidate",s=>{this.state=Bt.FINISHED,this.discardEditor(s)}):(this.state=Bt.FINISHED,this.discardEditor(!0))}}}cancelChanges(){this.state=Bt.FINISHED,this.discardEditor()}discardEditor(e){this.state===Bt.FINISHED&&(e===!1&&this.cellProperties.allowInvalid!==!0?(this.hot.selectCell(this.row,this.col),this.focus(),this.state=Bt.EDITING,this._fireCallbacks(!1)):(this.close(),this._opened=!1,this._fullEditMode=!1,this.state=Bt.VIRGIN,this._fireCallbacks(!0),this.hot.getShortcutManager().setActiveContextName("grid")))}enableFullEditMode(){this._fullEditMode=!0}isInFullEditMode(){return this._fullEditMode}isOpened(){return this._opened}isWaiting(){return this.state===Bt.WAITING}getEditedCellRect(){var e;const n=this.getEditedCell();if(!n)return;const{wtOverlays:r,wtViewport:i}=this.hot.view._wt,o=this.hot.rootWindow,s=Hn(n),a=qt(n),l=Hn(this.hot.rootElement),u=qt(this.hot.rootElement),c=r.topOverlay.holder,h=r.inlineStartOverlay.holder,d=c!==o?c.scrollTop:0,f=h!==o?h.scrollLeft:0,m=o.innerWidth-l.left-u,{wtTable:C}=(e=r.getParentOverlay(n))!==null&&e!==void 0?e:this.hot.view._wt,y=C.name,E=["master","inline_start"].includes(y)?d:0,v=["master","top","bottom"].includes(y)?f:0,_=s.top===l.top?0:1;let A=s.top-l.top-_-E,L=0;this.hot.isRtl()?L=o.innerWidth-s.left-a-m-1+v:L=s.left-l.left-1-v,["top","top_inline_start_corner"].includes(y)&&(A+=r.topOverlay.getOverlayOffset()),["inline_start","top_inline_start_corner"].includes(y)&&(L+=Math.abs(r.inlineStartOverlay.getOverlayOffset()));const T=this.hot.hasColHeaders(),P=this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row),Y=this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col),W=this.hot.rowIndexMapper.getRenderableIndexesLength()-this.hot.view._wt.getSetting("fixedRowsBottom");(T&&P<=0||P===W)&&(A+=1),Y<=0&&(L+=1);const Z=i.rowsRenderCalculator.startPosition,J=i.columnsRenderCalculator.startPosition,se=Math.abs(r.inlineStartOverlay.getScrollPosition()),te=r.topOverlay.getScrollPosition(),ue=yn(this.hot.rootDocument);let pt=n.offsetTop;if(["inline_start","master"].includes(y)&&(pt+=Z-te),["bottom","bottom_inline_start_corner"].includes(y)){const{wtViewport:G,wtTable:K}=r.bottomOverlay.clone;pt+=G.getWorkspaceHeight()-K.getHeight()-ue}let be=n.offsetLeft;this.hot.isRtl()?(be>=0?be=C.getWidth()-n.offsetLeft:be=Math.abs(be),be+=J-se-a):["top","master","bottom"].includes(y)&&(be+=J-se);const ke=o.getComputedStyle(this.TD),wt=this.hot.isRtl()?"borderRightWidth":"borderLeftWidth",mn=parseInt(ke[wt],10)>0?0:1,et=parseInt(ke.borderTopWidth,10)>0?0:1,g=qt(n)+mn,w=rn(n)+et,p=BN(c)?ue:0,O=jN(h)?ue:0,$=this.hot.view.maximumVisibleElementWidth(be)-p+mn,j=Math.max(this.hot.view.maximumVisibleElementHeight(pt)-O+et,this.hot.view.getDefaultRowHeight());return{top:A,start:L,height:w,maxHeight:j,width:g,maxWidth:$}}getEditedCellsLayerClass(){switch(this.checkEditorSection()){case"inline-start":return"ht_clone_left ht_clone_inline_start";case"bottom":return"ht_clone_bottom";case"bottom-inline-start-corner":return"ht_clone_bottom_left_corner ht_clone_bottom_inline_start_corner";case"top":return"ht_clone_top";case"top-inline-start-corner":return"ht_clone_top_left_corner ht_clone_top_inline_start_corner";default:return"ht_clone_master"}}getEditedCell(){return this.hot.getCell(this.row,this.col,!0)}checkEditorSection(){const e=this.hot.countRows();let n="";return this.row<this.hot.getSettings().fixedRowsTop?this.col<this.hot.getSettings().fixedColumnsStart?n="top-inline-start-corner":n="top":this.hot.getSettings().fixedRowsBottom&&this.row>=e-this.hot.getSettings().fixedRowsBottom?this.col<this.hot.getSettings().fixedColumnsStart?n="bottom-inline-start-corner":n="bottom":this.col<this.hot.getSettings().fixedColumnsStart&&(n="inline-start"),n}}ut(Qu,nk);const Y3={name:"editorCloseAndSaveByArrowKeys",callback(t,e,n){const r=t._getEditorManager(),i=r.getActiveEditor();i.isInFullEditMode()&&i.state===Bt.EDITING||(r.closeEditorAndSaveChanges(),t.getSelected()&&(n.includes("arrowdown")?t.selection.transformStart(1,0):n.includes("arrowup")?t.selection.transformStart(-1,0):n.includes("arrowleft")?t.selection.transformStart(0,-1*t.getDirectionFactor()):n.includes("arrowright")&&t.selection.transformStart(0,t.getDirectionFactor())),e.preventDefault())}},G3={name:"editorCloseAndSaveByEnter",callback(t,e){const n=t._getEditorManager();n.closeEditorAndSaveChanges(e.ctrlKey||e.metaKey),n.moveSelectionAfterEnter(e)}},q3={name:"editorCloseWithoutSaving",callback(t){const e=t._getEditorManager();e.closeEditorAndRestoreOriginalValue(t.getShortcutManager().isCtrlPressed()),e.activeEditor.focus()}},K3={name:"editorFastOpen",callback(t,e){const{highlight:n}=t.getSelectedRangeLast();n.isHeader()||t._getEditorManager().openEditor(null,e,!0)}},X3={name:"editorOpen",callback(t,e,n){const r=t._getEditorManager(),i=t.getSelectedRangeLast(),{highlight:o}=i;if(t.selection.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0){const s=t.getSettings(),a=typeof s.enterMoves=="function"?s.enterMoves(e):s.enterMoves;n.includes("shift")?t.selection.transformFocus(-a.row,-a.col):t.selection.transformFocus(a.row,a.col);return}o.isHeader()||(t.getSettings().enterBeginsEditing?r.cellProperties.readOnly?r.moveSelectionAfterEnter(e):r.openEditor(null,e,!0):r.moveSelectionAfterEnter(e),Pi(e))}};function Z3(){return[W3,Y3,G3,q3,K3,X3]}const Q3={name:"extendCellsSelectionDown",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(1,0),e.markEndSource())}},J3={name:"extendCellsSelectionDownByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeLast(),i=Math.min(r.row+t.countVisibleRows(),t.countRows()-1),o=n.getNearestNotHiddenIndex(i,-1);if(o!==null){const s=t._createCellCoords(o,r.col),a=r.row-t.getFirstFullyVisibleRow(),l=Math.min(s.row-a,t.countRows()-1);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}},eX={name:"extendCellsSelectionLeft",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,-1*t.getDirectionFactor()),e.markEndSource())}},tX={name:"extendCellsSelectionRight",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByColumnHeader())&&(e.markSource("keyboard"),e.transformEnd(0,t.getDirectionFactor()),e.markEndSource())}},nX={name:"extendCellsSelectionToColumns",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByRowHeader()?e.selectAll(!0,!0):t.selectColumns(r.col,i.col,n),e.markEndSource()}},rX={name:"extendCellsSelectionToMostBottom",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(t.countRows()-1,-1),l=i.clone();l.row=r.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},iX={name:"extendCellsSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const s=n.getNearestNotHiddenIndex(t.countCols()-1,-1),a=i.clone();a.col=r.col,e.markSource("keyboard"),e.setRangeStart(a,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,s)),e.markEndSource()}}},oX={name:"extendCellsSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast();if(!e.isSelectedByRowHeader()&&!e.isSelectedByCorner()&&r.isCell()){const s=parseInt(t.getSettings().fixedColumnsStart,10),a=n.getNearestNotHiddenIndex(s,1),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},sX={name:"extendCellsSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},aX={name:"extendCellsSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByColumnHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]),l=i.clone();l.col=r.col,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByColumnHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(o.row,a)),e.markEndSource()}}},lX={name:"extendCellsSelectionToMostTop",callback(t){const{selection:e,rowIndexMapper:n}=t,{highlight:r,from:i,to:o}=t.getSelectedRangeLast(),s=r.isHeader()&&e.isSelectedByRowHeader();if(r.isCell()||s){const a=n.getNearestNotHiddenIndex(0,1),l=i.clone();l.row=r.row,e.markSource("keyboard"),e.setRangeStart(l,void 0,!1,r.clone()),s&&e.selectedByRowHeader.add(e.getLayerLevel()),e.setRangeEnd(t._createCellCoords(a,o.col)),e.markEndSource()}}},uX={name:"extendCellsSelectionToRows",callback(t){const{selection:e}=t,{highlight:n,from:r,to:i}=t.getSelectedRangeLast();e.markSource("keyboard"),e.isSelectedByColumnHeader()?e.selectAll(!0,!0):t.selectRows(r.row,i.row,n),e.markEndSource()}},cX={name:"extendCellsSelectionUp",callback(t){const{selection:e}=t,{highlight:n}=t.getSelectedRangeLast();!e.isSelectedByColumnHeader()&&!e.isSelectedByCorner()&&(n.isCell()||n.isHeader()&&e.isSelectedByRowHeader())&&(e.markSource("keyboard"),e.transformEnd(-1,0),e.markEndSource())}},hX={name:"extendCellsSelectionUpByViewportHeight",callback(t){const{selection:e,rowIndexMapper:n}=t,{to:r}=t.getSelectedRangeLast(),i=Math.max(r.row-t.countVisibleRows(),0),o=n.getNearestNotHiddenIndex(i,1);if(o!==null){const s=t._createCellCoords(o,r.col),a=r.row-t.getFirstFullyVisibleRow(),l=Math.max(s.row-a,0);e.markSource("keyboard"),e.setRangeEnd(s),e.markEndSource(),t.scrollViewportTo({row:l,verticalSnap:"top",horizontalSnap:"start"})}}};function dX(){return[Q3,J3,eX,tX,nX,rX,iX,oX,sX,aX,lX,uX,cX,hX]}const fX={name:"moveCellSelectionDown",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(1,0),e.markEndSource()}},gX={name:"moveCellSelectionDownByViewportHeight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+r;o=o===0?1:o,i===t.countRows()-1?o=1:i+o>t.countRows()&&(o=t.countRows()-i-1),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}},mX={name:"moveCellSelectionInlineEnd",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),n.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(-o.row,-o.col):n.transformStart(-o.row,-o.col),n.markEndSource()}},pX={name:"moveCellSelectionInlineStart",callback(t,e){const{selection:n}=t,r=t.getSettings(),i=t.getSelectedRangeLast(),o=typeof r.tabMoves=="function"?r.tabMoves(e):r.tabMoves;n.markSource("keyboard"),n.isMultiple()&&!i.isHeader()&&t.countRenderedCols()>0&&t.countRenderedRows()>0?n.transformFocus(o.row,o.col):n.transformStart(o.row,o.col),n.markEndSource()}},wX={name:"moveCellSelectionLeft",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,-1*t.getDirectionFactor()),e.markEndSource()}},vX={name:"moveCellSelectionRight",callback(t){const{selection:e}=t;e.markSource("keyboard"),e.transformStart(0,t.getDirectionFactor()),e.markEndSource()}},CX={name:"moveCellSelectionToMostBottom",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(t.countRows()-1,-1);r===null&&(r=-1),e.setRangeStart(t._createCellCoords(r,n))}},yX={name:"moveCellSelectionToMostBottomInlineEnd",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsBottom,10),o=n.getNearestNotHiddenIndex(t.countRows()-i-1,-1),s=r.getNearestNotHiddenIndex(t.countCols()-1,-1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(o,s)),e.markEndSource()}},bX={name:"moveCellSelectionToMostInlineEnd",callback(t){const{selection:e,columnIndexMapper:n}=t;e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(t.getSelectedRangeLast().highlight.row,n.getNearestNotHiddenIndex(t.countCols()-1,-1))),e.markEndSource()}},SX={name:"moveCellSelectionToMostInlineStart",callback(t){const{selection:e,columnIndexMapper:n}=t,r=parseInt(t.getSettings().fixedColumnsStart,10),i=t.getSelectedRangeLast().highlight.row,o=n.getNearestNotHiddenIndex(r,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(i,o)),e.markEndSource()}},RX={name:"moveCellSelectionToMostLeft",callback(t){const{selection:e,columnIndexMapper:n}=t,r=t.getSelectedRangeLast().highlight.row;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[t.countCols()-1,-1]:[0,1]);i===null&&(i=t.isRtl()?-1:-t.countRowHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},EX={name:"moveCellSelectionToMostRight",callback(t){const{selection:e,columnIndexMapper:n}=t,{row:r}=t.getSelectedRangeLast().highlight;let i=n.getNearestNotHiddenIndex(...t.isRtl()?[0,1]:[t.countCols()-1,-1]);i===null&&(i=t.isRtl()?-t.countRowHeaders():-1),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,i)),e.markEndSource()}},TX={name:"moveCellSelectionToMostTop",callback(t){const{selection:e}=t,{col:n}=t.getSelectedRangeLast().highlight;let r=t.rowIndexMapper.getNearestNotHiddenIndex(0,1);r===null&&(r=-t.countColHeaders()),e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(r,n)),e.markEndSource()}},_X={name:"moveCellSelectionToMostTopInlineStart",callback(t){const{selection:e,rowIndexMapper:n,columnIndexMapper:r}=t,i=parseInt(t.getSettings().fixedRowsTop,10),o=parseInt(t.getSettings().fixedColumnsStart,10),s=n.getNearestNotHiddenIndex(i,1),a=r.getNearestNotHiddenIndex(o,1);e.markSource("keyboard"),e.setRangeStart(t._createCellCoords(s,a)),e.markEndSource()}},MX={name:"moveCellSelectionUp",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.transformStart(-1,0),e.markEndSource()}},IX={name:"moveCellSelectionUpByViewportHight",callback(t){const{selection:e}=t,{navigableHeaders:n}=t.getSettings(),r=n?t.countColHeaders():0,{row:i}=t.getSelectedRangeLast().highlight;let o=t.countVisibleRows()+r;o=o===0?-1:-o,i===-r?o=-1:i+o<r&&(o=-(i+r)),e.markSource("keyboard"),e.transformStart(o,0),e.markEndSource(),t.getSelectedRangeLast().highlight.row<0&&t.scrollViewportTo({row:0})}};function PX(){return[fX,gX,mX,pX,wX,vX,CX,yX,bX,SX,RX,EX,TX,_X,MX,IX]}const OX={name:"emptySelectedCells",callback(t){t.emptySelectedCells(),t._getEditorManager().prepareEditor()}},xX={name:"scrollToFocusedCell",callback(t){const{highlight:e}=t.getSelectedRangeLast(),n=t.getFirstFullyVisibleRow()-1,r=t.getFirstFullyVisibleColumn()-1,i=t.getLastFullyVisibleRow()+1,o=t.getLastFullyVisibleColumn()+1,s=t._createCellCoords(n,r),a=t._createCellCoords(i,o);if(!t._createCellRange(s,s,a).includes(e)&&(e.row>=0||e.col>=0)){const u={};if(e.col>=0){const c=Math.floor(t.countVisibleCols()/2);u.col=Math.max(e.col-c,0)}if(e.row>=0){const c=Math.floor(t.countVisibleRows()/2);u.row=Math.max(e.row-c,0)}t.scrollViewportTo({...u,verticalSnap:"top",horizontalSnap:"start"})}}},AX={name:"selectAllCells",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!0}),e.markEndSource()}},HX={name:"selectAllCellsAndHeaders",callback(t){let{selection:e}=t;e.markSource("keyboard"),e.selectAll(!0,!0,{disableHeadersHighlight:!1}),e.markEndSource()}},NX={name:"populateSelectedCellsData",callback(t){const e=t.getSelectedRange(),{row:n,col:r}=e[e.length-1].highlight.normalize(),i=t.getDataAtCell(n,r),o=new Map;for(let s=0;s<e.length;s++)e[s].forAll((a,l)=>{if(a>=0&&l>=0&&(a!==n||l!==r)){const{readOnly:u}=t.getCellMeta(a,l);u||o.set(`${a}x${l}`,[a,l,i])}});t.setDataAtCell(Array.from(o.values()))}},DX=[...Z3(),...dX(),...PX(),OX,xX,AX,HX,NX];function rk(t){const e={};return DX.forEach(n=>{let{name:r,callback:i}=n;e[r]=function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i(t,...s)}}),e}function kX(t){const e=t.getShortcutManager().addContext("editor"),n=rk(t),r={group:Js};e.addShortcuts([{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>n.editorCloseAndSaveByEnter(i,o)},{keys:[["Enter","Control/Meta"],["Enter","Control/Meta","Shift"]],captureCtrl:!0,callback:(i,o)=>n.editorCloseAndSaveByEnter(i,o)},{keys:[["Tab"],["Tab","Shift"],["PageDown"],["PageUp"]],forwardToContext:t.getShortcutManager().getContext("grid"),callback:(i,o)=>n.editorCloseAndSave(i,o)},{keys:[["ArrowDown"],["ArrowUp"],["ArrowLeft"],["ArrowRight"]],preventDefault:!1,callback:(i,o)=>n.editorCloseAndSaveByArrowKeys(i,o)},{keys:[["Escape"],["Escape","Control/Meta"]],callback:()=>n.editorCloseWithoutSaving()}],r)}function LX(t){const e=t.getShortcutManager().addContext("grid"),n=rk(t),r={runOnlyIf:()=>{const{navigableHeaders:i}=t.getSettings();return ae(t.getSelected())&&(i||!i&&t.countRenderedRows()>0&&t.countRenderedCols()>0)},group:tk};e.addShortcuts([{keys:[["F2"]],callback:i=>n.editorFastOpen(i)},{keys:[["Enter"],["Enter","Shift"]],callback:(i,o)=>n.editorOpen(i,o)},{keys:[["Backspace"],["Delete"]],callback:()=>n.emptySelectedCells()}],{group:Js,runOnlyIf:()=>ae(t.getSelected())}),e.addShortcuts([{keys:[["Control/Meta","A"]],callback:()=>n.selectAllCells(),runOnlyIf:()=>{var i;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())}},{keys:[["Control/Meta","A"]],callback:()=>{},runOnlyIf:()=>{var i;return(i=t.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isHeader()},preventDefault:!0},{keys:[["Control/Meta","Shift","Space"]],callback:()=>n.selectAllCellsAndHeaders()},{keys:[["Control/Meta","Enter"]],callback:()=>n.populateSelectedCellsData(),runOnlyIf:()=>{var i,o;return!((i=t.getSelectedRangeLast())!==null&&i!==void 0&&i.highlight.isHeader())&&((o=t.getSelectedRangeLast())===null||o===void 0?void 0:o.getCellsCount())>1}},{keys:[["Control","Space"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToColumns()},{keys:[["Shift","Space"]],stopPropagation:!0,callback:()=>n.extendCellsSelectionToRows()},{keys:[["ArrowUp"]],callback:()=>n.moveCellSelectionUp()},{keys:[["ArrowUp","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTop()},{keys:[["ArrowUp","Shift"]],callback:()=>n.extendCellsSelectionUp()},{keys:[["ArrowUp","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostTop(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowDown"]],callback:()=>n.moveCellSelectionDown()},{keys:[["ArrowDown","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottom()},{keys:[["ArrowDown","Shift"]],callback:()=>n.extendCellsSelectionDown()},{keys:[["ArrowDown","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostBottom(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByColumnHeader())},{keys:[["ArrowLeft"]],callback:()=>n.moveCellSelectionLeft()},{keys:[["ArrowLeft","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostLeft()},{keys:[["ArrowLeft","Shift"]],callback:()=>n.extendCellsSelectionLeft()},{keys:[["ArrowLeft","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostLeft(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["ArrowRight"]],callback:()=>n.moveCellSelectionRight()},{keys:[["ArrowRight","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostRight()},{keys:[["ArrowRight","Shift"]],callback:()=>n.extendCellsSelectionRight()},{keys:[["ArrowRight","Shift","Control/Meta"]],captureCtrl:!0,callback:()=>n.extendCellsSelectionToMostRight(),runOnlyIf:()=>!(t.selection.isSelectedByCorner()||t.selection.isSelectedByRowHeader())},{keys:[["Home"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["Home","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineStart()},{keys:[["Home","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostTopInlineStart(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["End","Shift"]],callback:()=>n.extendCellsSelectionToMostInlineEnd()},{keys:[["End","Control/Meta"]],captureCtrl:!0,callback:()=>n.moveCellSelectionToMostBottomInlineEnd(),runOnlyIf:()=>t.view.isMainTableNotFullyCoveredByOverlays()},{keys:[["PageUp"]],callback:()=>n.moveCellSelectionUpByViewportHight()},{keys:[["PageUp","Shift"]],callback:()=>n.extendCellsSelectionUpByViewportHeight()},{keys:[["PageDown"]],callback:()=>n.moveCellSelectionDownByViewportHeight()},{keys:[["PageDown","Shift"]],callback:()=>n.extendCellsSelectionDownByViewportHeight()},{keys:[["Tab"]],preventDefault:!1,callback:i=>n.moveCellSelectionInlineStart(i)},{keys:[["Shift","Tab"]],preventDefault:!1,callback:i=>n.moveCellSelectionInlineEnd(i)},{keys:[["Control/Meta","Backspace"]],callback:()=>n.scrollToFocusedCell()}],r)}function $X(t){[LX,kX].forEach(e=>e(t))}function FX(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=t.rootElement,r=Ex(t),i=Ex(t);return r.addEventListener("focus",()=>e==null?void 0:e.onFocusFromTop()),i.addEventListener("focus",()=>e==null?void 0:e.onFocusFromBottom()),n.firstChild.before(r),n.lastChild.after(i),{activate(){t._registerTimeout(()=>{r.tabIndex=0,i.tabIndex=0},10)},deactivate(){t._registerTimeout(()=>{r.tabIndex=-1,i.tabIndex=-1},10)}}}function Ex(t){const n=t.rootDocument.createElement("input");return n.type="text",n.name="__htFocusCatcher",n.classList.add("htFocusCatcher"),t.getSettings().ariaTags&&ye(n,[jh("Focus catcher")]),n}function VX(t){const e=WX(t);let n;const{activate:r,deactivate:i}=FX(t,{onFocusFromTop(){var h;const d=(h=e(n))!==null&&h!==void 0?h:gS(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_above",d),t.selectCell(d.row,d.col)),t.listen()},onFocusFromBottom(){var h;const d=(h=e(n))!==null&&h!==void 0?h:mS(t);d&&(t.runHooks("modifyFocusOnTabNavigation","from_below",d),t.selectCell(d.row,d.col)),t.listen()}}),o={wrapped:!1,flipped:!1};let s=!0,a=!1,l=!1;t.addHook("afterListen",()=>i()),t.addHook("afterUnlisten",()=>r()),t.addHook("afterSelection",(h,d,f,m,C)=>{if(a&&(o.wrapped&&o.flipped||l)&&(l=!1,C.value=!0),s){var y;n=(y=t.getSelectedRangeLast())===null||y===void 0?void 0:y.highlight}}),t.addHook("beforeRowWrap",(h,d,f)=>{o.wrapped=!0,o.flipped=f});function u(){o.wrapped=!1,o.flipped=!1,t.deselectCell(),t.unlisten()}const c={keys:[["Tab"],["Shift","Tab"]],preventDefault:!1,stopPropagation:!1,relativeToGroup:tk,group:"focusCatcher"};t.getShortcutManager().getContext("grid").addShortcuts([{...c,callback:()=>{const{tabNavigation:h}=t.getSettings();a=!0,t.getSelectedRangeLast()&&!h&&(s=!1),h||(l=!0)},position:"before"},{...c,callback:h=>{const{tabNavigation:d,autoWrapRow:f}=t.getSettings();if(a=!1,s=!0,!d||!t.selection.isSelected()||f&&o.wrapped&&o.flipped||!f&&o.wrapped)return f&&o.wrapped&&o.flipped&&(n=h.shiftKey?gS(t):mS(t)),u(),!1;h.preventDefault()},position:"after"}])}function gS(t){const{rowIndexMapper:e,columnIndexMapper:n}=t,{navigableHeaders:r}=t.getSettings();let i=r&&t.countColHeaders()>0?-t.countColHeaders():0,o=r&&t.countRowHeaders()>0?-t.countRowHeaders():0;return i===0&&(i=e.getVisualFromRenderableIndex(i)),o===0&&(o=n.getVisualFromRenderableIndex(o)),i===null||o===null?null:t._createCellCoords(i,o)}function mS(t){var e,n;const{rowIndexMapper:r,columnIndexMapper:i}=t,{navigableHeaders:o}=t.getSettings();let s=r.getRenderableIndexesLength()-1,a=i.getRenderableIndexesLength()-1;if(s<0){if(!o||t.countColHeaders()===0)return null;s=-1}if(a<0){if(!o||t.countColHeaders()===0)return null;a=-1}return t._createCellCoords((e=r.getVisualFromRenderableIndex(s))!==null&&e!==void 0?e:s,(n=i.getVisualFromRenderableIndex(a))!==null&&n!==void 0?n:a)}function WX(t){return e=>{if(!e)return null;const n=gS(t),r=mS(t);return e.col<n.col&&(e.col=n.col),e.col>r.col&&(e.col=r.col),e.row<n.row&&(e.row=n.row),e.row>r.row&&(e.row=r.row),e}}function Ju(t){Jo(t)&&t.scrollIntoView({block:"nearest",inline:"nearest"})}function wp(t){const{selection:e,view:n}=t,r=t.getSelectedRangeLast(),i=e.getSelectionSource(),o=n.getFirstFullyVisibleColumn(),s=n.getLastFullyVisibleColumn(),a=r.getTopStartCorner().col,l=r.getBottomEndCorner().col,u=a<=o,c=l>=s,h=n.getFirstFullyVisibleRow(),d=n.getLastFullyVisibleRow(),f=r.getTopStartCorner().row,m=r.getBottomEndCorner().row,C=f<=h,y=m>=d;return{getComputedColumnTarget(E){return i==="mouse"||i==="keyboard"?E.col:u&&c?r.highlight.col:u?a:c?l:E.col},getComputedRowTarget(E){return i==="mouse"||i==="keyboard"?E.row:C&&y?r.highlight.row:C?f:y?m:E.row}}}function BX(t){return e=>{const n=wp(t).getComputedColumnTarget(e);t.scrollViewportTo({col:n},()=>{const r=!!t.getSettings().colHeaders;Ju(t.getCell(r?-1:0,n,!0))})}}function jX(){return()=>{}}function UX(t){return e=>{t.scrollViewportTo(e.toObject(),()=>{const{row:n,col:r}=t.getSelectedRangeLast().highlight;Ju(t.getCell(n,r,!0))})}}function zX(t){return e=>{const n=wp(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;Ju(t.getCell(i,o,!0))})}}function YX(t){return e=>{const n=wp(t),r={row:n.getComputedRowTarget(e),col:n.getComputedColumnTarget(e)};t.scrollViewportTo(r,()=>{const{row:i,col:o}=r;Ju(t.getCell(i,o,!0))})}}function GX(t){return e=>{const n=wp(t).getComputedRowTarget(e);t.scrollViewportTo({row:n},()=>{const r=!!t.getSettings().rowHeaders;Ju(t.getCell(n,r?-1:0,!0))})}}function qX(t){return e=>{const n=t.selection.getSelectionSource(),{row:r,col:i}=e,o=()=>{Ju(t.getCell(r,i,!0))};if(r<0&&i>=0)t.scrollViewportTo({col:i},o);else if(i<0&&r>=0)t.scrollViewportTo({row:r},o);else{if(n==="mouse"&&(i===t.view.getLastPartiallyVisibleColumn()||r===t.view.getLastPartiallyVisibleRow()))return;t.scrollViewportTo({row:r,col:i},o)}}}function KX(t){const{selection:e}=t;let n=!1,r=!1;return{resume(){r=!1},suspend(){r=!0},skipNextScrollCycle(){n=!0},scrollTo(i){var o;if(n||r){n=!1;return}let s;e.isFocusSelectionChanged()?s=UX(t):e.isSelectedByCorner()?s=jX():e.isSelectedByRowHeader()?s=GX(t):e.isSelectedByColumnHeader()?s=BX(t):e.getSelectedRange().size()===1&&e.isMultiple()?s=zX(t):e.getSelectedRange().size()===1&&!e.isMultiple()?s=qX(t):e.getSelectedRange().size()>1&&(s=YX(t)),(o=s)===null||o===void 0||o(i)}}}const Tx=new Map([[" ","space"],["spacebar","space"],["scroll","scrolllock"],["del","delete"],["esc","escape"],["medianexttrack","mediatracknext"],["mediaprevioustrack","mediatrackprevious"],["volumeup","audiovolumeup"],["volumedown","audiovolumedown"],["volumemute","audiovolumemute"],["multiply","*"],["add","+"],["divide","/"],["subtract","-"],["left","arrowleft"],["right","arrowright"],["up","arrowup"],["down","arrowdown"]]),df=t=>t.map(e=>{const n=e.toLowerCase();return Tx.has(n)?Tx.get(n):n}).sort().join("+"),XX=t=>t.split("+"),_x=new Map([[96,"numpad0"],[97,"numpad1"],[98,"numpad2"],[99,"numpad3"],[100,"numpad4"],[101,"numpad5"],[102,"numpad6"],[103,"numpad7"],[104,"numpad8"],[105,"numpad9"],[106,"multiply"],[107,"add"],[108,"decimal"],[109,"subtract"],[110,"decimal"],[111,"divide"],[112,"f1"],[113,"f2"],[114,"f3"],[115,"f4"],[116,"f5"],[117,"f6"],[118,"f7"],[119,"f8"],[120,"f9"],[121,"f10"],[122,"f11"],[123,"f12"],[186,"semicolon"],[187,"equal"],[188,"comma"],[189,"minus"],[190,"period"],[191,"slash"],[192,"backquote"],[219,"bracketleft"],[220,"backslash"],[221,"bracketright"],[222,"quote"]]),oy=t=>{let{which:e,key:n}=t;if(_x.has(e))return _x.get(e);const r=String.fromCharCode(e).toLowerCase();return/^[a-z0-9]$/.test(r)?r:n.toLowerCase()},ik=Symbol("shortcut-context");function ok(t){return Ae(t)&&t.__kindOf===ik}const ZX=t=>{const e=ap({errorIdExists:l=>`The "${l}" shortcut is already registered in the "${t}" context.`}),n=function(){let{keys:l,callback:u,group:c,runOnlyIf:h=()=>!0,captureCtrl:d=!1,preventDefault:f=!0,stopPropagation:m=!1,relativeToGroup:C,position:y,forwardToContext:E}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(It(c))throw new Error("You need to define the shortcut's group.");if(ot(u)===!1)throw new Error("The shortcut's callback needs to be a function.");if(Array.isArray(l)===!1)throw new Error(nt`Pass the shortcut\'s keys as an array of arrays,\x20
58
+ using the KeyboardEvent.key properties:\x20
59
+ https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values.`);const v={callback:u,group:c,runOnlyIf:h,captureCtrl:d,preventDefault:f,stopPropagation:m};ae(C)&&(v.relativeToGroup=C,v.position=y),ok(E)&&(v.forwardToContext=E),l.forEach(_=>{const A=df(_);if(e.hasItem(A)){const T=e.getItem(A);let P=T.findIndex(Y=>Y.group===C);P!==-1?y==="before"?P-=1:P+=1:P=T.length,T.splice(P,0,v)}else e.addItem(A,[v])})},r=function(l){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};l.forEach(c=>{He(u,(h,d)=>{Object.prototype.hasOwnProperty.call(c,d)===!1&&(c[d]=u[d])}),n(c)})},i=l=>{const u=df(l);e.removeItem(u)};return{__kindOf:ik,addShortcut:n,addShortcuts:r,getShortcuts:l=>{const u=df(l),c=e.getItem(u);return ae(c)?c.slice():[]},hasShortcut:l=>{const u=df(l);return e.hasItem(u)},removeShortcutsByKeys:i,removeShortcutsByGroup:l=>{e.getItems().forEach(c=>{let[h,d]=c;const f=d.filter(m=>m.group!==l);f.length===0?i(XX(h)):(d.length=0,d.push(...f))})}}};function QX(){const t=new Set;return{press(e){t.add(e)},release(e){t.delete(e)},releaseAll(){t.clear()},isPressed(e){return t.has(e)}}}const JX=["meta","alt","shift","control"],Pc=QX(),Oc=[];let ff=0;function e4(t,e,n,r,i){const o=f=>JX.includes(f),s=function(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const C=[];return f.altKey&&C.push("alt"),m&&(f.ctrlKey||f.metaKey)?C.push("control/meta"):(f.ctrlKey&&C.push("control"),f.metaKey&&C.push("meta")),f.shiftKey&&C.push("shift"),C},a=f=>{if(e(f)===!1||n(f)===!1||f.keyCode===229||typeof f.key!="string"||za(f))return;const C=oy(f);let y=[];o(C)||(y=s(f));const E=[C].concat(y);!i(f,E)&&(LP()&&y.includes("meta")||!LP()&&y.includes("control"))&&i(f,[C].concat(s(f,!0))),r(f)},l=f=>{if(typeof f.key=="string"){const m=oy(f);o(m)&&Pc.press(m)}},u=f=>{if(typeof f.key=="string"){const m=oy(f);o(m)&&Pc.release(m)}},c=()=>{Pc.releaseAll()};return{mount:()=>{let f=t;for(ff+=1;f;)ff===1&&(f.document.documentElement.addEventListener("keydown",l),Oc.push({event:"keydown",listener:l}),f.document.documentElement.addEventListener("keyup",u),Oc.push({event:"keyup",listener:u})),f.document.documentElement.addEventListener("keydown",a),f.document.documentElement.addEventListener("blur",c),f=Au(f)},unmount:()=>{let f=t;for(ff-=1;f;){if(ff===0){for(let m=0;m<Oc.length;m++){const{event:C,listener:y}=Oc[m];f.document.documentElement.removeEventListener(C,y)}Oc.length=0}f.document.documentElement.removeEventListener("keydown",a),f.document.documentElement.removeEventListener("blur",c),f=Au(f)}},isPressed:f=>Pc.isPressed(f),releasePressedKeys:()=>Pc.releaseAll()}}const t4=t=>{let{ownerWindow:e,handleEvent:n,beforeKeyDown:r,afterKeyDown:i}=t;const o=ap({errorIdExists:m=>`The "${m}" context name is already registered.`});let s="grid";const a=m=>{const C=ZX(m);return o.addItem(m,C),C},l=()=>s,u=m=>o.getItem(m),c=m=>{if(!o.hasItem(m))throw new Error(nt`You've tried to activate the "${m}" shortcut context\x20
60
+ that does not exist. Before activation, register the context using the "addContext" method.`);s=m};let h=!1;const d=function(m,C){let y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l();const E=ok(y)?y:u(y);let v=!1;if(!E.hasShortcut(C))return v;const _=E.getShortcuts(C);for(let A=0;A<_.length;A++){const{callback:L,runOnlyIf:T,preventDefault:P,stopPropagation:Y,captureCtrl:U,forwardToContext:W}=_[A];if(T(m)===!0){if(h=U,v=L(m,C)===!1,h=!1,P&&m.preventDefault(),Y&&(Pi(m),m.stopPropagation()),v)break;W&&d(m,C,W)}}return v},f=e4(e,n,r,i,d);return f.mount(),{addContext:a,getActiveContextName:l,getContext:u,setActiveContextName:c,isCtrlPressed:()=>!h&&(f.isPressed("control")||f.isPressed("meta")),releasePressedKeys:()=>f.releasePressedKeys(),destroy:()=>f.unmount()}};function Mx(t){const{classNames:e}=az(t,/ht-theme-[a-zA-Z0-9_-]+/);return e.pop()}let sy=null;const ay=new Map;function sk(t,e){var n,r=this;let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=this;const s=new _i(o);let a,l,u,c,h,d,f=!0;Nq(i)&&Hq(this),this.rootElement=t,this.rootDocument=t.ownerDocument,this.rootWindow=this.rootDocument.defaultView,this.isDestroyed=!1,this.renderSuspendedCounter=0,this.executionSuspendedCounter=0;const m=(n=e==null?void 0:e.layoutDirection)!==null&&n!==void 0?n:"inherit",C=["rtl","ltr"].includes(m)?m:this.rootWindow.getComputedStyle(this.rootElement).direction;this.rootElement.setAttribute("dir",C),this.isRtl=function(){return C==="rtl"},this.isLtr=function(){return!o.isRtl()},this.getDirectionFactor=function(){return o.isLtr()?1:-1},e.language=AK(e.language);const y=Object.fromEntries(Object.entries(e).filter(g=>{let[w]=g;return!(re.getSingleton().isRegistered(w)||re.getSingleton().isDeprecated(w))})),E=new ek(o,y,[H3,V3]),v=E.getTableMeta(),_=E.getGlobalMeta(),A=ap();this.container=this.rootDocument.createElement("div"),t.insertBefore(this.container,t.firstChild),_g(this)&&(NU(e.licenseKey,t),q(t,"ht-wrapper")),this.guid=`ht_${_N()}`,ay.set(this.guid,this),this.columnIndexMapper=new hS,this.rowIndexMapper=new hS,this.columnIndexMapper.addLocalHook("indexesSequenceChange",g=>{o.runHooks("afterColumnSequenceChange",g)}),this.rowIndexMapper.addLocalHook("indexesSequenceChange",g=>{o.runHooks("afterRowSequenceChange",g)}),s.addEventListener(this.rootDocument.documentElement,"compositionstart",g=>{o.runHooks("beforeCompositionStart",g)}),l=new Kq(o),(!this.rootElement.id||this.rootElement.id.substring(0,3)==="ht_")&&(this.rootElement.id=this.guid);const L=g=>{const{row:w,col:p}=g;return o._createCellCoords(w>=0?o.rowIndexMapper.getRenderableFromVisualIndex(w):w,p>=0?o.columnIndexMapper.getRenderableFromVisualIndex(p):p)},T=g=>{const{row:w,col:p}=g;return o._createCellCoords(w>=0?o.rowIndexMapper.getVisualFromRenderableIndex(w):w,p>=0?o.columnIndexMapper.getVisualFromRenderableIndex(p):p)},P=(g,w)=>{const p=w>g?1:-1,O=Math.min(g,w),$=Math.max(g,w),j=o.rowIndexMapper.getNearestNotHiddenIndex(g,p);return j===null||p===1&&j>$||p===-1&&j<O?null:j>=0?o.rowIndexMapper.getRenderableFromVisualIndex(j):j},Y=(g,w)=>{const p=w>g?1:-1,O=Math.min(g,w),$=Math.max(g,w),j=o.columnIndexMapper.getNearestNotHiddenIndex(g,p);return j===null||p===1&&j>$||p===-1&&j<O?null:j>=0?o.columnIndexMapper.getRenderableFromVisualIndex(j):j};let U=new ZD(v,{rowIndexMapper:o.rowIndexMapper,columnIndexMapper:o.columnIndexMapper,countCols:()=>o.countCols(),countRows:()=>o.countRows(),propToCol:g=>a.propToCol(g),isEditorOpened:()=>o.getActiveEditor()?o.getActiveEditor().isOpened():!1,countRenderableColumns:()=>this.view.countRenderableColumns(),countRenderableRows:()=>this.view.countRenderableRows(),countRowHeaders:()=>this.countRowHeaders(),countColHeaders:()=>this.countColHeaders(),countRenderableRowsInRange:function(){return r.view.countRenderableRowsInRange(...arguments)},countRenderableColumnsInRange:function(){return r.view.countRenderableColumnsInRange(...arguments)},getShortcutManager:()=>o.getShortcutManager(),createCellCoords:(g,w)=>o._createCellCoords(g,w),createCellRange:(g,w,p)=>o._createCellRange(g,w,p),visualToRenderableCoords:L,renderableToVisualCoords:T,findFirstNonHiddenRenderableRow:P,findFirstNonHiddenRenderableColumn:Y,isDisabledCellSelection:(g,w)=>g<0||w<0?o.getSettings().disableVisualSelection:o.getCellMeta(g,w).disableVisualSelection});this.selection=U;const W=g=>{let{hiddenIndexesChanged:w}=g;this.forceFullRender=!0,w&&this.selection.commit()};this.columnIndexMapper.addLocalHook("cacheUpdated",W),this.rowIndexMapper.addLocalHook("cacheUpdated",W),this.selection.addLocalHook("afterSetRangeEnd",(g,w)=>{const p=Ir(!1),O=this.selection.getSelectedRange(),{from:$,to:j}=O.current(),G=O.size()-1;this.runHooks("afterSelection",$.row,$.col,j.row,j.col,p,G),this.runHooks("afterSelectionByProp",$.row,o.colToProp($.col),j.row,o.colToProp(j.col),p,G),w&&(!p.isTouched()||p.isTouched()&&!p.value)&&d.scrollTo(g);const K=U.isSelectedByRowHeader(),b=U.isSelectedByColumnHeader();K&&b?q(this.rootElement,["ht__selection--rows","ht__selection--columns"]):K?(pe(this.rootElement,"ht__selection--columns"),q(this.rootElement,"ht__selection--rows")):b?(pe(this.rootElement,"ht__selection--rows"),q(this.rootElement,"ht__selection--columns")):pe(this.rootElement,["ht__selection--rows","ht__selection--columns"]),U.getSelectionSource()!=="shift"&&c.closeEditor(null),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("beforeSetFocus",g=>{this.runHooks("beforeSelectionFocusSet",g.row,g.col)}),this.selection.addLocalHook("afterSetFocus",g=>{const w=Ir(!1);this.runHooks("afterSelectionFocusSet",g.row,g.col,w),(!w.isTouched()||w.isTouched()&&!w.value)&&d.scrollTo(g),c.closeEditor(),o.view.render(),c.prepareEditor()}),this.selection.addLocalHook("afterSelectionFinished",g=>{const w=g.length-1,{from:p,to:O}=g[w];this.runHooks("afterSelectionEnd",p.row,p.col,O.row,O.col,w),this.runHooks("afterSelectionEndByProp",p.row,o.colToProp(p.col),O.row,o.colToProp(O.col),w)}),this.selection.addLocalHook("afterIsMultipleSelection",g=>{const w=this.runHooks("afterIsMultipleSelection",g.value);g.value&&(g.value=w)}),this.selection.addLocalHook("afterDeselect",()=>{c.closeEditor(),o.view.render(),pe(this.rootElement,["ht__selection--rows","ht__selection--columns"]),this.runHooks("afterDeselect")}),this.selection.addLocalHook("beforeHighlightSet",()=>this.runHooks("beforeSelectionHighlightSet")).addLocalHook("beforeSetRangeStart",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeStart",...w)}).addLocalHook("beforeSetRangeStartOnly",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeStartOnly",...w)}).addLocalHook("beforeSetRangeEnd",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSetRangeEnd",...w)}).addLocalHook("beforeSelectColumns",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSelectColumns",...w)}).addLocalHook("afterSelectColumns",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterSelectColumns",...w)}).addLocalHook("beforeSelectRows",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeSelectRows",...w)}).addLocalHook("afterSelectRows",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterSelectRows",...w)}).addLocalHook("beforeModifyTransformStart",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("modifyTransformStart",...w)}).addLocalHook("afterModifyTransformStart",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformStart",...w)}).addLocalHook("beforeModifyTransformFocus",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("modifyTransformFocus",...w)}).addLocalHook("afterModifyTransformFocus",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformFocus",...w)}).addLocalHook("beforeModifyTransformEnd",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("modifyTransformEnd",...w)}).addLocalHook("afterModifyTransformEnd",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("afterModifyTransformEnd",...w)}).addLocalHook("beforeRowWrap",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeRowWrap",...w)}).addLocalHook("beforeColumnWrap",function(){for(var g=arguments.length,w=new Array(g),p=0;p<g;p++)w[p]=arguments[p];return r.runHooks("beforeColumnWrap",...w)}).addLocalHook("insertRowRequire",g=>this.alter("insert_row_above",g,1,"auto")).addLocalHook("insertColRequire",g=>this.alter("insert_col_start",g,1,"auto")),u={alter(g,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=arguments.length>3?arguments[3]:void 0,$=arguments.length>4?arguments[4]:void 0;const j=G=>{if(G.length===0)return[];const K=[...G];return K.sort((R,S)=>{let[k]=R,[M]=S;return k===M?0:k>M?1:-1}),gr(K,(R,S)=>{let[k,M]=S;const N=R[R.length-1],[B,x]=N,D=B+x;if(k<=D){const V=Math.max(M-(D-k),0);N[1]+=V}else R.push([k,M]);return R},[K[0]])};switch(g){case"insert_row_below":case"insert_row_above":const G=o.countSourceRows();if(v.maxRows===G)return;const K=g==="insert_row_below"?"below":"above";w=w??(K==="below"?G:0);const{delta:b,startPhysicalIndex:R}=a.createRow(w,p,{source:O,mode:K});U.shiftRows(o.toVisualRow(R),b);break;case"insert_col_start":case"insert_col_end":const S=g==="insert_col_end"?"end":"start";w=w??(S==="end"?o.countSourceCols():0);const{delta:k,startPhysicalIndex:M}=a.createCol(w,p,{source:O,mode:S});if(k){if(Array.isArray(v.colHeaders)){const x=[o.toVisualColumn(M),0];x.length+=k,Array.prototype.splice.apply(v.colHeaders,x)}U.shiftColumns(o.toVisualColumn(M),k)}break;case"remove_row":const N=x=>{let D=0;I(x,V=>{let[F,z]=V;const oe=Ut(F)?o.countRows()-1:Math.max(F-D,0);if(Number.isInteger(F)&&(F=Math.max(F-D,0)),!a.removeRow(F,z,O))return;if(U.isSelected()){const{row:Se}=o.getSelectedRangeLast().highlight;Se>=F&&Se<=F+z-1&&c.closeEditor(!0)}const Re=o.countRows(),Ne=v.fixedRowsTop;Ne>=oe+1&&(v.fixedRowsTop-=Math.min(z,Ne-oe));const We=v.fixedRowsBottom;We&&oe>=Re-We&&(v.fixedRowsBottom-=Math.min(z,We)),Re===0?U.deselect():O==="ContextMenu.removeRow"?U.refresh():U.shiftRows(F,-z),D+=z})};Array.isArray(w)?N(j(w)):N([[w,p]]);break;case"remove_col":const B=x=>{let D=0;I(x,V=>{let[F,z]=V;const oe=Ut(F)?o.countCols()-1:Math.max(F-D,0);let ce=o.toPhysicalColumn(oe);if(Number.isInteger(F)&&(F=Math.max(F-D,0)),!a.removeCol(F,z,O))return;if(U.isSelected()){const{col:Se}=o.getSelectedRangeLast().highlight;Se>=F&&Se<=F+z-1&&c.closeEditor(!0)}o.countCols()===0?U.deselect():O==="ContextMenu.removeColumn"?U.refresh():U.shiftColumns(F,-z);const We=v.fixedColumnsStart;We>=oe+1&&(v.fixedColumnsStart-=Math.min(z,We-oe)),Array.isArray(v.colHeaders)&&(typeof ce>"u"&&(ce=-1),v.colHeaders.splice(ce,z)),D+=z})};Array.isArray(w)?B(j(w)):B([[w,p]]);break;default:throw new Error(`There is no such action "${g}"`)}$||u.adjustRowsAndCols(),o.view.render(),o.view.adjustElementsSize()},adjustRowsAndCols(){const g=v.minRows,w=v.minSpareRows,p=v.minCols,O=v.minSpareCols;if(g){const $=o.countRows();$<g&&a.createRow($,g-$,{source:"auto"})}if(w){const $=o.countEmptyRows(!0);if($<w){const j=w-$,G=Math.min(j,v.maxRows-o.countSourceRows());a.createRow(o.countRows(),G,{source:"auto"})}}{let $;(p||O)&&($=o.countEmptyCols(!0));let j=o.countCols();if(p&&!v.columns&&j<p){const G=p-j;$+=G,a.createCol(j,G,{source:"auto"})}if(O&&!v.columns&&o.dataType==="array"&&$<O){j=o.countCols();const G=O-$,K=Math.min(G,v.maxCols-j);a.createCol(j,K,{source:"auto"})}}},populateFromArray(g,w,p,O,$){let j,G,K,b;const R=[],S={},k=[],M=g.row,N=g.col;if(G=w.length,G===0)return!1;let B=0,x=0;switch(Ae(p)&&(B=p.col-N+1,x=p.row-M+1),$){case"shift_down":const D=Rg(w),V=D.length,F=Math.max(V,B),z=o.getData().slice(M),oe=Rg(z).slice(N,N+F);for(K=0;K<F;K+=1)if(K<V){for(j=0,G=D[K].length;j<x-G;j+=1)D[K].push(D[K][j%G]);K<oe.length?k.push(D[K].concat(oe[K])):k.push(D[K].concat(new Array(z.length).fill(null)))}else k.push(D[K%V].concat(oe[K]));o.populateFromArray(M,N,Rg(k));break;case"shift_right":const ce=w.length,Re=Math.max(ce,x),Ne=o.getData().slice(M).map(Ct=>Ct.slice(N));for(j=0;j<Re;j+=1)if(j<ce){for(K=0,b=w[j].length;K<B-b;K+=1)w[j].push(w[j][K%b]);if(j<Ne.length)for(let Ct=0;Ct<Ne[j].length;Ct+=1)w[j].push(Ne[j][Ct]);else w[j].push(...new Array(Ne[0].length).fill(null))}else w.push(w[j%G].slice(0,Re).concat(Ne[j]));o.populateFromArray(M,N,w);break;case"overwrite":default:S.row=g.row,S.col=g.col;let We=0,Se=0,Le=!0,vt;const ti=function(Qt){let ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;const yt=w[Qt%w.length];return ft!==null?yt[ft%yt.length]:yt},mo=w.length,Or=p?p.row-g.row+1:0;for(p?G=Or:G=Math.max(mo,Or),j=0;j<G&&!(p&&S.row>p.row&&Or>mo||!v.allowInsertRow&&S.row>o.countRows()-1||S.row>=v.maxRows);j++){const Ct=j-We,Qt=ti(Ct).length,ft=p?p.col-g.col+1:0;if(p?b=ft:b=Math.max(Qt,ft),S.col=g.col,vt=o.getCellMeta(S.row,S.col),(O==="CopyPaste.paste"||O==="Autofill.fill")&&vt.skipRowOnPaste){We+=1,S.row+=1,G+=1;continue}for(Se=0,K=0;K<b&&!(p&&S.col>p.col&&ft>Qt||!v.allowInsertColumn&&S.col>o.countCols()-1||S.col>=v.maxCols);K++){if(vt=o.getCellMeta(S.row,S.col),(O==="CopyPaste.paste"||O==="Autofill.fill")&&vt.skipColumnOnPaste){Se+=1,S.col+=1,b+=1;continue}if(vt.readOnly&&O!=="UndoRedo.undo"){S.col+=1;continue}const yt=K-Se;let $e=ti(Ct,yt),xr=o.getDataAtCell(S.row,S.col);if($e!==null&&typeof $e=="object")if(Array.isArray($e)&&xr===null&&(xr=[]),xr===null||typeof xr!="object")Le=!1;else{const ea=zh(Array.isArray(xr)?xr:xr[0]||xr),ta=zh(Array.isArray($e)?$e:$e[0]||$e);LR(ea,ta)||Array.isArray(ea)&&Array.isArray(ta)?$e=Gn($e):Le=!1}else xr!==null&&typeof xr=="object"&&(Le=!1);Le&&R.push([S.row,S.col,$e]),Le=!0,S.col+=1}S.row+=1}o.setDataAtCell(R,null,null,O||"populateFromArray");break}}};function Z(g){const w=FD(g);N0(w)?(o.runHooks("beforeLanguageChange",w),_.language=w,o.runHooks("afterLanguageChange",w)):VD(g)}function J(g,w){const p=g==="className"?o.rootElement:o.table;if(f)q(p,w);else{let O=[],$=[];_[g]&&(O=Array.isArray(_[g])?_[g]:EP(_[g])),w&&($=Array.isArray(w)?w:EP(w));const j=RP(O,$),G=RP($,O);j.length&&pe(p,j),G.length&&q(p,G)}_[g]=w}this.init=function(){l.setData(v.data),o.runHooks("beforeInit"),(Yo()||QN())&&q(o.rootElement,"mobile"),this.updateSettings(e,!0),this.view=new $q(this);const g=v.themeName||Mx(o.rootElement);o.useTheme(g),o.view.addClassNameToLicenseElement(o.getCurrentThemeName()),c=oS.getInstance(o,v,U),d=KX(o),h=new oY(o),_g(this)&&VX(o),o.runHooks("init"),this.render(),f&&o.rootElement.offsetParent===null&&mz(o.rootElement,()=>{o.view._wt.wtOverlays.updateLastSpreaderSize(),o.render(),o.view.adjustElementsSize()}),typeof f=="object"&&(o.runHooks("afterChange",f[0],f[1]),f=!1),o.runHooks("afterInit")};function se(){let g=!1;return{validatorsInQueue:0,valid:!0,addValidatorToQueue(){this.validatorsInQueue+=1,g=!1},removeValidatorFormQueue(){this.validatorsInQueue=this.validatorsInQueue-1<0?0:this.validatorsInQueue-1,this.checkIfQueueIsEmpty()},onQueueEmpty(){},checkIfQueueIsEmpty(){this.validatorsInQueue===0&&g===!1&&(g=!0,this.onQueueEmpty(this.valid))}}}function te(g){const w=g.replace(",",".");return isNaN(parseFloat(w))===!1?parseFloat(w):g}function ue(g,w,p){if(!g.length){p();return}const O=o.getActiveEditor(),$=new se;let j=!0;$.onQueueEmpty=()=>{O&&j&&O.cancelChanges(),p()};for(let G=g.length-1;G>=0;G--){const[K,b]=g[G],R=a.propToCol(b);let S;Number.isInteger(R)?S=o.getCellMeta(K,R):S={...Object.getPrototypeOf(v),...v},o.getCellValidator(S)&&($.addValidatorToQueue(),o.validateCell(g[G][3],S,(function(k,M){return function(N){if(typeof N!="boolean")throw new Error("Validation error: result is not boolean");N===!1&&M.allowInvalid===!1&&(j=!1,g.splice(k,1),M.valid=!0),$.removeValidatorFormQueue()}})(G,S),w))}$.checkIfQueueIsEmpty()}function pt(g,w){for(let O=g.length-1;O>=0;O--){let $=!1;if(g[O]===null){g.splice(O,1);continue}if(!((g[O][2]===null||g[O][2]===void 0)&&(g[O][3]===null||g[O][3]===void 0))){if(v.allowInsertRow)for(;g[O][0]>o.countRows()-1;){const{delta:j}=a.createRow(void 0,void 0,{source:"auto"});if(j===0){$=!0;break}}if(o.dataType==="array"&&(!v.columns||v.columns.length===0)&&v.allowInsertColumn)for(;a.propToCol(g[O][1])>o.countCols()-1;){const{delta:j}=a.createCol(void 0,void 0,{source:"auto"});if(j===0){$=!0;break}}$||a.set(g[O][0],g[O][1],g[O][3])}}if(g.length>0){u.adjustRowsAndCols(),o.runHooks("beforeChangeRender",g,w),c.closeEditor(),o.render(),c.prepareEditor(),o.view.adjustElementsSize(),o.runHooks("afterChange",g,w||"edit");const O=o.getActiveEditor();O&&ae(O.refreshValue)&&O.refreshValue()}else o.render()}this._createCellCoords=function(g,w){return o.view._wt.createCellCoords(g,w)},this._createCellRange=function(g,w,p){return o.view._wt.createCellRange(g,w,p)},this.validateCell=function(g,w,p,O){let $=o.getCellValidator(w);function j(G){if(!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0)||w.hidden===!0){p(G);return}const b=w.visualCol,R=w.visualRow,S=o.getCell(R,b,!0);if(S&&S.nodeName!=="TH"){const k=o.rowIndexMapper.getRenderableFromVisualIndex(R),M=o.columnIndexMapper.getRenderableFromVisualIndex(b);o.view._wt.getSetting("cellRenderer",k,M,S)}p(G)}xU($)&&($=(function(G){return function(K,b){b(G.test(K))}})($)),ot($)?(g=o.runHooks("beforeValidate",g,w.visualRow,w.prop,O),o._registerImmediate(()=>{$.call(w,g,G=>{o&&(G=o.runHooks("afterValidate",G,g,w.visualRow,w.prop,O),w.valid=G,j(G),o.runHooks("postAfterValidate",G,g,w.visualRow,w.prop,O))})})):o._registerImmediate(()=>{w.valid=!0,j(w.valid,!1)})};function be(g,w,p){return Array.isArray(g)?g:[[g,w,p]]}function ke(g,w){const p=o.runHooks("beforeChange",g,w||"edit"),O=g.filter(j=>j!==null);if(p===!1||O.length===0){var $;return($=o.getActiveEditor())===null||$===void 0||$.cancelChanges(),[]}for(let j=O.length-1;j>=0;j--){const[G,K,,b]=O[j],R=a.propToCol(K);let S;Number.isInteger(R)?S=o.getCellMeta(G,R):S={...Object.getPrototypeOf(v),...v};const{type:k,checkedTemplate:M,uncheckedTemplate:N}=S;if(k==="numeric"&&typeof b=="string"&&CY(b)&&(O[j][3]=te(b)),k==="checkbox"){const B=Pt(b),x=B===Pt(M),D=B===Pt(N);(x||D)&&(O[j][3]=x?M:N)}}return O}this.setDataAtCell=function(g,w,p,O){const $=be(g,w,p),j=[];let G=O,K,b,R;for(K=0,b=$.length;K<b;K++){if(typeof $[K]!="object")throw new Error("Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter");if(typeof $[K][1]!="number")throw new Error("Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`");$[K][1]>=this.countCols()?R=$[K][1]:R=a.colToProp($[K][1]),j.push([$[K][0],R,l.getAtCell(this.toPhysicalRow($[K][0]),$[K][1]),$[K][2]])}!G&&typeof g=="object"&&(G=w);const S=ke(j,G);o.runHooks("afterSetDataAtCell",S,G),ue(S,G,()=>{pt(S,G)})},this.setDataAtRowProp=function(g,w,p,O){const $=be(g,w,p),j=[];let G=O,K,b;for(K=0,b=$.length;K<b;K++)j.push([$[K][0],$[K][1],l.getAtCell(this.toPhysicalRow($[K][0]),$[K][1]),$[K][2]]);!G&&typeof g=="object"&&(G=w);const R=ke(j,O);o.runHooks("afterSetDataAtRowProp",R,G),ue(R,G,()=>{pt(R,G)})},this.listen=function(){o&&!o.isListening()&&(ay.forEach(g=>{o!==g&&g.unlisten()}),sy=o.guid,o.runHooks("afterListen"))},this.unlisten=function(){this.isListening()&&(sy=null,o.runHooks("afterUnlisten"))},this.isListening=function(){return sy===o.guid},this.destroyEditor=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;c.closeEditor(g),o.view.render(),w&&U.isSelected()&&c.prepareEditor()},this.populateFromArray=function(g,w,p,O,$,j,G){if(!(typeof p=="object"&&typeof p[0]=="object"))throw new Error("populateFromArray parameter `input` must be an array of arrays");const K=typeof O=="number"?o._createCellCoords(O,$):null;return u.populateFromArray(o._createCellCoords(g,w),p,K,j,G)},this.spliceCol=function(g,w,p){for(var O=arguments.length,$=new Array(O>3?O-3:0),j=3;j<O;j++)$[j-3]=arguments[j];return a.spliceCol(g,w,p,...$)},this.spliceRow=function(g,w,p){for(var O=arguments.length,$=new Array(O>3?O-3:0),j=3;j<O;j++)$[j-3]=arguments[j];return a.spliceRow(g,w,p,...$)},this.getSelected=function(){if(U.isSelected())return Be(U.getSelectedRange(),g=>{let{from:w,to:p}=g;return[w.row,w.col,p.row,p.col]})},this.getSelectedLast=function(){const g=this.getSelected();let w;return g&&g.length>0&&(w=g[g.length-1]),w},this.getSelectedRange=function(){if(U.isSelected())return Array.from(U.getSelectedRange())},this.getSelectedRangeLast=function(){const g=this.getSelectedRange();let w;return g&&g.length>0&&(w=g[g.length-1]),w},this.emptySelectedCells=function(g){if(!U.isSelected()||this.countRows()===0||this.countCols()===0)return;const w=[];I(U.getSelectedRange(),p=>{if(p.isSingleHeader())return;const O=p.getTopStartCorner(),$=p.getBottomEndCorner();de(O.row,$.row,j=>{de(O.col,$.col,G=>{this.getCellMeta(j,G).readOnly||w.push([j,G,null])})})}),w.length>0&&this.setDataAtCell(w,g)},this.isRenderSuspended=function(){return this.renderSuspendedCounter>0},this.suspendRender=function(){this.renderSuspendedCounter+=1},this.resumeRender=function(){const g=this.renderSuspendedCounter-1;this.renderSuspendedCounter=Math.max(g,0),!this.isRenderSuspended()&&g===this.renderSuspendedCounter&&o.view.render()},this.render=function(){this.view&&(this.forceFullRender=!0,this.isRenderSuspended()||o.view.render())},this.batchRender=function(g){this.suspendRender();const w=g();return this.resumeRender(),w},this.isExecutionSuspended=function(){return this.executionSuspendedCounter>0},this.suspendExecution=function(){this.executionSuspendedCounter+=1,this.columnIndexMapper.suspendOperations(),this.rowIndexMapper.suspendOperations()},this.resumeExecution=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const w=this.executionSuspendedCounter-1;this.executionSuspendedCounter=Math.max(w,0),(!this.isExecutionSuspended()&&w===this.executionSuspendedCounter||g)&&(this.columnIndexMapper.resumeOperations(),this.rowIndexMapper.resumeOperations())},this.batchExecution=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.suspendExecution();const p=g();return this.resumeExecution(w),p},this.batch=function(g){this.suspendRender(),this.suspendExecution();const w=g();return this.resumeExecution(),this.resumeRender(),w},this.refreshDimensions=function(){if(!o.view)return;const g=o.view,{width:w,height:p}=g.getLastSize(),{width:O,height:$}=o.rootElement.getBoundingClientRect(),j=O!==w||$!==p;o.runHooks("beforeRefreshDimensions",{width:w,height:p},{width:O,height:$},j)!==!1&&((j||g._wt.wtOverlays.scrollableElement===o.rootWindow)&&(g.setLastSize(O,$),o.render(),g.adjustElementsSize()),o.runHooks("afterRefreshDimensions",{width:w,height:p},{width:O,height:$},j))},this.updateData=function(g,w){bx(g,p=>{a=p},p=>{a=p,o.columnIndexMapper.fitToLength(this.getInitialColumnCount()),o.rowIndexMapper.fitToLength(this.countSourceRows()),u.adjustRowsAndCols(),U.refresh()},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"updateData",source:w,metaManager:E,firstRun:f})},this.loadData=function(g,w){bx(g,p=>{a=p},()=>{E.clearCellsCache(),o.initIndexMappers(),u.adjustRowsAndCols(),U.refresh(),f&&(f=[null,"loadData"])},{hotInstance:o,dataMap:a,dataSource:l,internalSource:"loadData",source:w,metaManager:E,firstRun:f})},this.getInitialColumnCount=function(){const g=v.columns;let w=0;if(Array.isArray(g))w=g.length;else if(ot(g))if(o.dataType==="array"){const p=this.countSourceCols();for(let O=0;O<p;O+=1)g(O)&&(w+=1)}else(o.dataType==="object"||o.dataType==="function")&&(w=a.colToPropCache.length);else if(ae(v.dataSchema)){const p=a.getSchema();w=Array.isArray(p)?p.length:$R(p)}else w=this.countSourceCols();return w},this.initIndexMappers=function(){this.columnIndexMapper.initToLength(this.getInitialColumnCount()),this.rowIndexMapper.initToLength(this.countSourceRows())},this.getData=function(g,w,p,O){return It(g)?a.getAll():a.getRange(o._createCellCoords(g,w),o._createCellCoords(p,O),a.DESTINATION_RENDERER)},this.getCopyableText=function(g,w,p,O){return a.getCopyableText(o._createCellCoords(g,w),o._createCellCoords(p,O))},this.getCopyableData=function(g,w){return a.getCopyable(g,a.colToProp(w))},this.getSchema=function(){return a.getSchema()},this.updateSettings=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const p=(f?o.loadData:o.updateData).bind(this);let O=!1,$,j;if(ae(g.rows))throw new Error('The "rows" setting is no longer supported. Do you mean startRows, minRows or maxRows?');if(ae(g.cols))throw new Error('The "cols" setting is no longer supported. Do you mean startCols, minCols or maxCols?');if(ae(g.ganttChart))throw new Error('Since 8.0.0 the "ganttChart" setting is no longer supported.');g.language&&Z(g.language);for($ in g)if(!($==="data"||$==="language"))if($==="className")J("className",g.className);else if($==="tableClassName"&&o.table)J("tableClassName",g.tableClassName),o.view._wt.wtOverlays.syncOverlayTableClassNames();else if(re.getSingleton().isRegistered($)||re.getSingleton().isDeprecated($)){const S=g[$];ot(S)?(re.getSingleton().addAsFixed($,S,o),v[$]=S):Array.isArray(S)&&(re.getSingleton().add($,S,o),v[$]=S)}else!w&&nn(g,$)&&(_[$]=g[$]);g.data===void 0&&v.data===void 0?p(null,"updateSettings"):g.data!==void 0?p(g.data,"updateSettings"):g.columns!==void 0&&(a.createMap(),o.initIndexMappers());const G=o.countCols(),K=v.columns;if(K&&ot(K)&&(O=!0),(g.cell!==void 0||g.cells!==void 0||g.columns!==void 0)&&E.clearCache(),G>0)for($=0,j=0;$<G;$++){if(K){const S=O?K($):K[j];S&&E.updateColumnMeta(j,S)}j+=1}ae(g.cell)&&He(g.cell,S=>{o.setCellMetaObject(S.row,S.col,S)}),o.runHooks("afterCellMetaReset");let b=o.rootElement.style.height;b!==""&&(b=parseInt(o.rootElement.style.height,10));let R=g.height;if(ot(R)&&(R=R()),w&&o.rootElement.getAttribute("style")&&o.rootElement.setAttribute("data-initialstyle",o.rootElement.getAttribute("style")),R===null){const S=o.rootElement.getAttribute("data-initialstyle");S&&(S.indexOf("height")>-1||S.indexOf("overflow")>-1)?o.rootElement.setAttribute("style",S):(o.rootElement.style.height="",o.rootElement.style.overflow="")}else R!==void 0&&(o.rootElement.style.height=isNaN(R)?`${R}`:`${R}px`,o.rootElement.style.overflow="hidden");if(typeof g.width<"u"){let S=g.width;ot(S)&&(S=S()),o.rootElement.style.width=isNaN(S)?`${S}`:`${S}px`}if(!w){if(o.view){o.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked(),o.view._wt.exportSettingsAsClassNames();const S=o.getCurrentThemeName(),k=nn(g,"themeName");S&&k&&S!==g.themeName&&(o.view.getStylesHandler().removeClassNames(),o.view.removeClassNameFromLicenseElement(S));const M=k&&g.themeName||Mx(o.rootElement);o.useTheme(M),o.view.addClassNameToLicenseElement(o.getCurrentThemeName())}o.runHooks("afterUpdateSettings",g)}u.adjustRowsAndCols(),o.view&&!f&&(o.render(),o.view._wt.wtOverlays.adjustElementsSize()),!w&&o.view&&(b===""||R===""||R===void 0)&&b!==R&&o.view._wt.wtOverlays.updateMainScrollableElements()},this.getValue=function(){const g=o.getSelectedLast();if(v.getValue){if(ot(v.getValue))return v.getValue.call(o);if(g)return o.getData()[g[0][0]][v.getValue]}else if(g)return o.getDataAtCell(g[0],g[1])},this.getSettings=function(){return v},this.clear=function(){this.selectAll(),this.emptySelectedCells()},this.alter=function(g,w,p,O,$){u.alter(g,w,p,O,$)},this.getCell=function(g,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,O=w,$=g;if(w>=0){if(this.columnIndexMapper.isHidden(this.toPhysicalColumn(w)))return null;O=this.columnIndexMapper.getRenderableFromVisualIndex(w)}if(g>=0){if(this.rowIndexMapper.isHidden(this.toPhysicalRow(g)))return null;$=this.rowIndexMapper.getRenderableFromVisualIndex(g)}return $===null||O===null||$===void 0||O===void 0?null:o.view.getCellAtCoords(o._createCellCoords($,O),p)},this.getCoords=function(g){const w=this.view._wt.wtTable.getCoords(g);if(w===null)return null;const{row:p,col:O}=w;let $=p,j=O;return p>=0&&($=this.rowIndexMapper.getVisualFromRenderableIndex(p)),O>=0&&(j=this.columnIndexMapper.getVisualFromRenderableIndex(O)),o._createCellCoords($,j)},this.colToProp=function(g){return a.colToProp(g)},this.propToCol=function(g){return a.propToCol(g)},this.toVisualRow=g=>this.rowIndexMapper.getVisualFromPhysicalIndex(g),this.toVisualColumn=g=>this.columnIndexMapper.getVisualFromPhysicalIndex(g),this.toPhysicalRow=g=>this.rowIndexMapper.getPhysicalFromVisualIndex(g),this.toPhysicalColumn=g=>this.columnIndexMapper.getPhysicalFromVisualIndex(g),this.getDataAtCell=function(g,w){return a.get(g,a.colToProp(w))},this.getDataAtRowProp=function(g,w){return a.get(g,w)},this.getDataAtCol=function(g){const w=[],p=a.getRange(o._createCellCoords(0,g),o._createCellCoords(v.data.length-1,g),a.DESTINATION_RENDERER);for(let O=0;O<p.length;O+=1)for(let $=0;$<p[O].length;$+=1)w.push(p[O][$]);return w},this.getDataAtProp=function(g){const w=[],p=a.getRange(o._createCellCoords(0,a.propToCol(g)),o._createCellCoords(v.data.length-1,a.propToCol(g)),a.DESTINATION_RENDERER);for(let O=0;O<p.length;O+=1)for(let $=0;$<p[O].length;$+=1)w.push(p[O][$]);return w},this.getSourceData=function(g,w,p,O){let $;return g===void 0?$=l.getData():$=l.getByRange(o._createCellCoords(g,w),o._createCellCoords(p,O)),$},this.getSourceDataArray=function(g,w,p,O){let $;return g===void 0?$=l.getData(!0):$=l.getByRange(o._createCellCoords(g,w),o._createCellCoords(p,O),!0),$},this.getSourceDataAtCol=function(g){return l.getAtColumn(g)},this.setSourceDataAtCell=function(g,w,p,O){const $=be(g,w,p),j=this.hasHook("afterSetSourceDataAtCell"),G=[];j&&I($,b=>{let[R,S,k]=b;G.push([R,S,l.getAtCell(R,S),k])}),I($,b=>{let[R,S,k]=b;l.setAtCell(R,S,k)}),j&&this.runHooks("afterSetSourceDataAtCell",G,O),this.render();const K=o.getActiveEditor();K&&ae(K.refreshValue)&&K.refreshValue()},this.getSourceDataAtRow=function(g){return l.getAtRow(g)},this.getSourceDataAtCell=function(g,w){return l.getAtCell(g,w)},this.getDataAtRow=function(g){return a.getRange(o._createCellCoords(g,0),o._createCellCoords(g,this.countCols()-1),a.DESTINATION_RENDERER)[0]||[]},this.getDataType=function(g,w,p,O){const $=g===void 0?[0,0,this.countRows(),this.countCols()]:[g,w,p,O],[j,G]=$;let[,,K,b]=$,R=null,S=null;K===void 0&&(K=j),b===void 0&&(b=G);let k="mixed";return de(Math.max(Math.min(j,K),0),Math.max(j,K),M=>{let N=!0;return de(Math.max(Math.min(G,b),0),Math.max(G,b),B=>(S=this.getCellMeta(M,B).type,R?N=R===S:R=S,N)),k=N?S:"mixed",N}),k},this.removeCellMeta=function(g,w,p){const[O,$]=[this.toPhysicalRow(g),this.toPhysicalColumn(w)];let j=E.getCellMetaKeyValue(O,$,p);o.runHooks("beforeRemoveCellMeta",g,w,p,j)!==!1&&(E.removeCellMeta(O,$,p),o.runHooks("afterRemoveCellMeta",g,w,p,j)),j=null},this.spliceCellsMeta=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;for(var p=arguments.length,O=new Array(p>2?p-2:0),$=2;$<p;$++)O[$-2]=arguments[$];if(O.length>0&&!Array.isArray(O[0]))throw new Error("The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.");w>0&&E.removeRow(this.toPhysicalRow(g),w),O.length>0&&I(O.reverse(),j=>{E.createRow(this.toPhysicalRow(g)),I(j,(G,K)=>this.setCellMetaObject(g,K,G))}),o.render()},this.setCellMetaObject=function(g,w,p){typeof p=="object"&&He(p,(O,$)=>{this.setCellMeta(g,w,$,O)})},this.setCellMeta=function(g,w,p,O){if(o.runHooks("beforeSetCellMeta",g,w,p,O)===!1)return;let j=g,G=w;g<this.countRows()&&(j=this.toPhysicalRow(g)),w<this.countCols()&&(G=this.toPhysicalColumn(w)),E.setCellMeta(j,G,p,O),o.runHooks("afterSetCellMeta",g,w,p,O)},this.getCellsMeta=function(){return E.getCellsMeta()},this.getCellMeta=function(g,w){let p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipMetaExtension:!1},O=this.toPhysicalRow(g),$=this.toPhysicalColumn(w);return O===null&&(O=g),$===null&&($=w),E.getCellMeta(O,$,{visualRow:g,visualColumn:w,...p})},this.getColumnMeta=function(g){return E.getColumnMeta(this.toPhysicalColumn(g))},this.getCellMetaAtRow=function(g){return E.getCellsMetaAtRow(g)},this.isColumnModificationAllowed=function(){return!(o.dataType==="object"||v.columns)},this.getCellRenderer=function(g,w){const p=typeof g=="number"?o.getCellMeta(g,w).renderer:g.renderer;return typeof p=="string"?lS(p):It(p)?lS("text"):p},this.getCellEditor=function(g,w){const p=typeof g=="number"?o.getCellMeta(g,w).editor:g.editor;return typeof p=="string"?iS(p):It(p)?iS("text"):p},this.getCellValidator=function(g,w){const p=typeof g=="number"?o.getCellMeta(g,w).validator:g.validator;return typeof p=="string"?kY(p):p},this.validateCells=function(g){this._validateCells(g)},this.validateRows=function(g,w){if(!Array.isArray(g))throw new Error("validateRows parameter `rows` must be an array");this._validateCells(w,g)},this.validateColumns=function(g,w){if(!Array.isArray(g))throw new Error("validateColumns parameter `columns` must be an array");this._validateCells(w,void 0,g)},this._validateCells=function(g,w,p){const O=new se;g&&(O.onQueueEmpty=g);let $=o.countRows()-1;for(;$>=0;){if(w!==void 0&&w.indexOf($)===-1){$-=1;continue}let j=o.countCols()-1;for(;j>=0;){if(p!==void 0&&p.indexOf(j)===-1){j-=1;continue}O.addValidatorToQueue(),o.validateCell(o.getDataAtCell($,j),o.getCellMeta($,j),G=>{if(typeof G!="boolean")throw new Error("Validation error: result is not boolean");G===!1&&(O.valid=!1),O.removeValidatorFormQueue()},"validateCells"),j-=1}$-=1}O.checkIfQueueIsEmpty()},this.getRowHeader=function(g){let w=v.rowHeaders,p=g;return p!==void 0&&(p=o.runHooks("modifyRowHeader",p)),p===void 0?(w=[],de(o.countRows()-1,O=>{w.push(o.getRowHeader(O))})):Array.isArray(w)&&w[p]!==void 0?w=w[p]:ot(w)?w=w(p):w&&typeof w!="string"&&typeof w!="number"&&(w=p+1),w},this.hasRowHeaders=function(){return!!v.rowHeaders},this.hasColHeaders=function(){if(v.colHeaders!==void 0&&v.colHeaders!==null)return!!v.colHeaders;for(let g=0,w=o.countCols();g<w;g++)if(o.getColHeader(g))return!0;return!1},this.getColHeader=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;const p=o.runHooks("modifyColHeader",g);if(p===void 0){const K=[],b=o.countCols();for(let R=0;R<b;R++)K.push(o.getColHeader(R));return K}let O=v.colHeaders;const $=function(K){const b=[],R=o.countCols();let S=0;for(;S<R;S++)ot(v.columns)&&v.columns(S)&&b.push(S);return b[K]},j=o.toPhysicalColumn(p),G=$(j);return v.colHeaders===!1?O=null:v.columns&&ot(v.columns)&&v.columns(G)&&v.columns(G).title?O=v.columns(G).title:v.columns&&v.columns[j]&&v.columns[j].title?O=v.columns[j].title:Array.isArray(v.colHeaders)&&v.colHeaders[j]!==void 0?O=v.colHeaders[j]:ot(v.colHeaders)?O=v.colHeaders(j):v.colHeaders&&typeof v.colHeaders!="string"&&typeof v.colHeaders!="number"&&(O=Uq(p)),O=o.runHooks("modifyColumnHeaderValue",O,g,w),O},this._getColWidthFromSettings=function(g){let w;if(g>=0&&(w=o.getCellMeta(0,g).width),(w===void 0||w===v.width)&&(w=v.colWidths),w!=null){switch(typeof w){case"object":w=w[g];break;case"function":w=w(g);break}typeof w=="string"&&(w=parseInt(w,10))}return w},this.getColWidth=function(g,w){let p=o._getColWidthFromSettings(g);return p=o.runHooks("modifyColWidth",p,g,w),p===void 0&&(p=Nu),p},this._getRowHeightFromSettings=function(g){const w=this.view.getDefaultRowHeight();let p=v.rowHeights;if(p!=null){switch(typeof p){case"object":p=p[g];break;case"function":p=p(g);break}typeof p=="string"&&(p=parseInt(p,10))}return p!=null&&p<w?w:p},this.getRowHeight=function(g,w){let p=o._getRowHeightFromSettings(g);return p=o.runHooks("modifyRowHeight",p,g,w),p},this.countSourceRows=function(){return l.countRows()},this.countSourceCols=function(){return l.countFirstRowKeys()},this.countRows=function(){return a.getLength()},this.countCols=function(){const g=v.maxCols,w=this.columnIndexMapper.getNotTrimmedIndexesLength();return Math.min(g,w)},this.countRenderedRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedRowsCount():-1},this.countVisibleRows=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleRowsCount():-1},this.countRenderedCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getRenderedColumnsCount():-1},this.countVisibleCols=function(){return o.view._wt.drawn?o.view._wt.wtTable.getVisibleColumnsCount():-1},this.countRowHeaders=function(){return this.view.getRowHeadersCount()},this.countColHeaders=function(){return this.view.getColumnHeadersCount()},this.countEmptyRows=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return dO(o.countRows()-1,p=>{if(o.isEmptyRow(p))w+=1;else if(g===!0)return!1}),w},this.countEmptyCols=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=0;return dO(o.countCols()-1,p=>{if(o.isEmptyCol(p))w+=1;else if(g===!0)return!1}),w},this.isEmptyRow=function(g){return v.isEmptyRow.call(o,g)},this.isEmptyCol=function(g){return v.isEmptyCol.call(o,g)},this.selectCell=function(g,w,p,O){let $=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,j=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;return It(g)||It(w)?!1:this.selectCells([[g,w,p,O]],$,j)},this.selectCells=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[[]],w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;w===!1&&d.suspend();const O=U.selectCells(g);return O&&p&&o.listen(),d.resume(),O},this.selectColumns=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,p=arguments.length>2?arguments[2]:void 0;return U.selectColumns(g,w,p)},this.selectRows=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,p=arguments.length>2?arguments[2]:void 0;return U.selectRows(g,w,p)},this.deselectCell=function(){U.deselect()},this.selectAll=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g,p=arguments.length>2?arguments[2]:void 0;d.skipNextScrollCycle(),U.selectAll(g,w,p)};const wt=(g,w)=>g.getNearestNotHiddenIndex(w,1,!0);this.scrollViewportTo=function(g,w){if(typeof g=="number"){var p;g={row:arguments[0],col:arguments[1],verticalSnap:arguments[2]?"bottom":"top",horizontalSnap:arguments[3]?"end":"start",considerHiddenIndexes:(p=arguments[4])!==null&&p!==void 0?p:!0}}const{row:O,col:$,considerHiddenIndexes:j}=g??{};let G=O,K=$;if(ot(w)&&this.addHookOnce("afterScroll",w),j===void 0||j){const k=Number.isInteger(O)&&O>=0,M=Number.isInteger($)&&$>=0,N=k?wt(this.rowIndexMapper,O):void 0,B=M?wt(this.columnIndexMapper,$):void 0;if(N===null||B===null)return!1;G=k?o.rowIndexMapper.getRenderableFromVisualIndex(N):O,K=M?o.columnIndexMapper.getRenderableFromVisualIndex(B):$}const b=Number.isInteger(G),R=Number.isInteger(K);let S=!1;return b&&G>=0&&R&&K>=0?S=o.view.scrollViewport(o._createCellCoords(G,K),g.horizontalSnap,g.verticalSnap):b&&G>=0&&(R&&K<0||!R)?S=o.view.scrollViewportVertically(G,g.verticalSnap):R&&K>=0&&(b&&G<0||!b)&&(S=o.view.scrollViewportHorizontally(K,g.horizontalSnap)),ot(w)&&(S?this.view.render():(this.removeHook("afterScroll",w),this._registerMicrotask(()=>w()))),S},this.scrollToFocusedCell=function(g){if(!this.selection.isSelected())return!1;ot(g)&&this.addHookOnce("afterScroll",g);const{highlight:w}=this.getSelectedRangeLast(),p=this.scrollViewportTo(w.toObject());return p?this.view.render():ot(g)&&(this.removeHook("afterScroll",g),this._registerMicrotask(()=>g())),p},this.destroy=function(){if(o._clearTimeouts(),o._clearImmediates(),o.view&&o.view.destroy(),l&&l.destroy(),l=null,this.getShortcutManager().destroy(),E.clearCache(),ay.delete(this.guid),_g(o)){const g=this.rootDocument.querySelector(".hot-display-license-info");g&&g.parentNode.removeChild(g)}ts(o.rootElement),s.destroy(),c&&c.destroy(),o.batchExecution(()=>{o.rowIndexMapper.unregisterAll(),o.columnIndexMapper.unregisterAll(),A.getItems().forEach(g=>{let[,w]=g;w.destroy()}),A.clear(),o.runHooks("afterDestroy")},!0),re.getSingleton().destroy(o),He(o,(g,w,p)=>{ot(g)?p[w]=mn(w):w!=="guid"&&(p[w]=null)}),o.isDestroyed=!0,a&&a.destroy(),a=null,u=null,U=null,c=null,o=null};function mn(g){return()=>{throw new Error(`The "${g}" method cannot be called because this Handsontable instance has been destroyed`)}}this.getActiveEditor=function(){return c.getActiveEditor()},this.getFirstRenderedVisibleRow=function(){return o.view.getFirstRenderedVisibleRow()},this.getLastRenderedVisibleRow=function(){return o.view.getLastRenderedVisibleRow()},this.getFirstRenderedVisibleColumn=function(){return o.view.getFirstRenderedVisibleColumn()},this.getLastRenderedVisibleColumn=function(){return o.view.getLastRenderedVisibleColumn()},this.getFirstFullyVisibleRow=function(){return o.view.getFirstFullyVisibleRow()},this.getLastFullyVisibleRow=function(){return o.view.getLastFullyVisibleRow()},this.getFirstFullyVisibleColumn=function(){return o.view.getFirstFullyVisibleColumn()},this.getLastFullyVisibleColumn=function(){return o.view.getLastFullyVisibleColumn()},this.getFirstPartiallyVisibleRow=function(){return o.view.getFirstPartiallyVisibleRow()},this.getLastPartiallyVisibleRow=function(){return o.view.getLastPartiallyVisibleRow()},this.getFirstPartiallyVisibleColumn=function(){return o.view.getFirstPartiallyVisibleColumn()},this.getLastPartiallyVisibleColumn=function(){return o.view.getLastPartiallyVisibleColumn()},this.getPlugin=function(g){return A.getItem(Ti(g))},this.getPluginName=function(g){return g===this.undoRedo?this.undoRedo.constructor.PLUGIN_KEY:A.getId(g)},this.getInstance=function(){return o},this.addHook=function(g,w,p){re.getSingleton().add(g,w,o,p)},this.hasHook=function(g){return re.getSingleton().has(g,o)||re.getSingleton().has(g)},this.addHookOnce=function(g,w,p){re.getSingleton().once(g,w,o,p)},this.removeHook=function(g,w){re.getSingleton().remove(g,w,o)},this.runHooks=function(g,w,p,O,$,j,G){return re.getSingleton().run(o,g,w,p,O,$,j,G)},this.getTranslatedPhrase=function(g,w){return YD(v.language,g,w)},this.toHTML=()=>cO(this),this.toTableElement=()=>{const g=this.rootDocument.createElement("div");return g.insertAdjacentHTML("afterbegin",cO(this)),g.firstElementChild},this.timeouts=[],this.useTheme=g=>{this.view.getStylesHandler().useTheme(g),this.runHooks("afterSetTheme",g,!!f)},this.getCurrentThemeName=()=>this.view.getStylesHandler().getThemeName(),this._registerTimeout=function(g){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=g;typeof p=="function"&&(p=setTimeout(p,w)),this.timeouts.push(p)},this._clearTimeouts=function(){I(this.timeouts,g=>{clearTimeout(g)})},this.immediates=[],this._registerImmediate=function(g){this.immediates.push(setImmediate(g))},this._clearImmediates=function(){I(this.immediates,g=>{clearImmediate(g)})},this._registerMicrotask=function(g){this.rootWindow.queueMicrotask(()=>{this.isDestroyed||g()})},this._getEditorManager=function(){return c};const et=t4({handleEvent(){return o.isListening()},beforeKeyDown:g=>this.runHooks("beforeKeyDown",g),afterKeyDown:g=>{this.isDestroyed||o.runHooks("afterDocumentKeyDown",g)},ownerWindow:this.rootWindow});this.addHook("beforeOnCellMouseDown",g=>{g.ctrlKey===!1&&g.metaKey===!1&&et.releasePressedKeys()}),this.getShortcutManager=function(){return et},this.getFocusManager=function(){return h},uD().forEach(g=>{const w=jR(g);A.addItem(g,new w(this))}),$X(o),et.setActiveContextName("grid"),re.getSingleton().run(o,"construct")}function Ix(t,e,n){t.addEventListener(e,n,!1)}function Px(t,e,n){t.removeEventListener(e,n,!1)}function gf(t){return t.ownerDocument.defaultView.getComputedStyle(t)}function ak(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n={minHeight:200,maxHeight:300,minWidth:100,maxWidth:300,textContent:h=>h.value,...e},r=t.body,i=t.createTextNode(""),o=t.createElement("span");let s;function a(){var h,d;i.textContent=n.textContent(s),o.style.position="absolute",o.style.fontSize=gf(s).fontSize,o.style.fontFamily=gf(s).fontFamily,o.style.whiteSpace="pre",r.appendChild(o);const f=parseInt(((h=gf(s))===null||h===void 0?void 0:h.paddingInlineStart)||0,10),m=parseInt(((d=gf(s))===null||d===void 0?void 0:d.paddingInlineEnd)||0,10),C=o.clientWidth+f+m+1;r.removeChild(o);const y=s.style;y.height=`${n.minHeight}px`,n.minWidth>C?y.width=`${n.minWidth}px`:C>n.maxWidth?y.width=`${n.maxWidth}px`:y.width=`${C}px`;const E=s.scrollHeight?s.scrollHeight-1:0;n.minHeight>E?y.height=`${n.minHeight}px`:n.maxHeight<E?(y.height=`${n.maxHeight}px`,y.overflowY="visible"):y.height=`${E}px`}function l(){t.defaultView.setTimeout(a,0)}function u(h){if(h&&h.minHeight)if(h.minHeight==="inherit")n.minHeight=s.clientHeight;else{const d=parseInt(h.minHeight,10);isNaN(d)||(n.minHeight=d)}if(h&&h.maxHeight)if(h.maxHeight==="inherit")n.maxHeight=s.clientHeight;else{const d=parseInt(h.maxHeight,10);isNaN(d)||(n.maxHeight=d)}if(h&&h.minWidth)if(h.minWidth==="inherit")n.minWidth=s.clientWidth;else{const d=parseInt(h.minWidth,10);isNaN(d)||(n.minWidth=d)}if(h&&h.maxWidth)if(h.maxWidth==="inherit")n.maxWidth=s.clientWidth;else{const d=parseInt(h.maxWidth,10);isNaN(d)||(n.maxWidth=d)}o.firstChild||(o.className="autoResize",o.style.display="inline-block",o.appendChild(i))}function c(h,d){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s=h,u(d),s.nodeName==="TEXTAREA"&&(s.style.resize="none",s.style.height=`${n.minHeight}px`,s.style.minWidth=`${n.minWidth}px`,s.style.maxWidth=`${n.maxWidth}px`,s.style.overflowY="hidden"),f&&(Ix(s,"input",a),Ix(s,"keydown",l)),a()}return{init:c,resize:a,unObserve(){Px(s,"input",a),Px(s,"keydown",l)}}}function Ox(t,e){const n=WN(e),r=e.value.split(`
61
+ `);let i=n,o=0;for(let s=0;s<r.length;s++){const a=r[s];s!==0&&(o+=r[s-1].length+1);const l=o+a.length;if(t==="home"?i=o:t==="end"&&(i=l),n<=l)break}np(e,i)}function da(t,e,n){return(e=n4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function n4(t){var e=r4(t,"string");return typeof e=="symbol"?e:e+""}function r4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const i4="ht_editor_visible",mf="ht_editor_hidden",xx="textEditor",o4="text";class Sl extends Qu{static get EDITOR_TYPE(){return o4}constructor(e){super(e),da(this,"eventManager",new _i(this)),da(this,"autoResize",ak(this.hot.rootDocument)),da(this,"TEXTAREA",void 0),da(this,"textareaStyle",void 0),da(this,"TEXTAREA_PARENT",void 0),da(this,"textareaParentStyle",void 0),da(this,"layerClass",void 0),this.eventManager=new _i(this),this.createElements(),this.bindEvents(),this.hot.addHookOnce("afterDestroy",()=>this.destroy())}getValue(){return this.TEXTAREA.value}setValue(e){this.TEXTAREA.value=e}open(){this.refreshDimensions(),this.showEditableElement(),this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this.autoResize.unObserve(),Eg(this.hot.rootDocument.activeElement,this.hot.rootElement)&&this.hot.listen(),this.hideEditableElement(),this.unregisterShortcuts()}prepare(e,n,r,i,o,s){const a=this.state;if(super.prepare(e,n,r,i,o,s),!s.readOnly){this.refreshDimensions(!0);const{allowInvalid:l}=s;l&&!this.isOpened()&&(this.TEXTAREA.value=""),a!==Bt.FINISHED&&!this.isOpened()&&this.hideEditableElement()}}beginEditing(e,n){this.state===Bt.VIRGIN&&(this.TEXTAREA.value="",super.beginEditing(e,n))}focus(){this.TEXTAREA.select(),np(this.TEXTAREA,this.TEXTAREA.value.length)}createElements(){const{rootDocument:e}=this.hot;this.TEXTAREA=e.createElement("TEXTAREA"),ye(this.TEXTAREA,[["data-hot-input",""],Cl(-1)]),q(this.TEXTAREA,"handsontableInput"),this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,this.textareaStyle.overflowY="visible",this.TEXTAREA_PARENT=e.createElement("DIV"),q(this.TEXTAREA_PARENT,"handsontableInputHolder"),ve(this.TEXTAREA_PARENT,this.layerClass)&&pe(this.TEXTAREA_PARENT,this.layerClass),q(this.TEXTAREA_PARENT,mf),this.textareaParentStyle=this.TEXTAREA_PARENT.style,this.TEXTAREA_PARENT.appendChild(this.TEXTAREA),this.hot.rootElement.appendChild(this.TEXTAREA_PARENT)}hideEditableElement(){Iz()&&(this.textareaStyle.textIndent="-99999px"),this.textareaStyle.overflowY="visible",this.textareaParentStyle.opacity="0",this.textareaParentStyle.height="1px",pe(this.TEXTAREA_PARENT,this.layerClass),q(this.TEXTAREA_PARENT,mf)}showEditableElement(){this.textareaParentStyle.height="",this.textareaParentStyle.overflow="",this.textareaParentStyle.position="",this.textareaParentStyle[this.hot.isRtl()?"left":"right"]="auto",this.textareaParentStyle.opacity="1",this.textareaStyle.textIndent="";const e=this.TEXTAREA_PARENT.childNodes;let n=!1;de(e.length-1,r=>{const i=e[r];if(ve(i,"handsontableEditor"))return n=!0,!1}),ve(this.TEXTAREA_PARENT,mf)&&pe(this.TEXTAREA_PARENT,mf),n?(this.layerClass=i4,q(this.TEXTAREA_PARENT,this.layerClass)):(this.layerClass=this.getEditedCellsLayerClass(),q(this.TEXTAREA_PARENT,this.layerClass))}refreshValue(){const e=this.hot.toPhysicalRow(this.row),n=this.hot.getSourceDataAtCell(e,this.col);this.originalValue=n,this.setValue(n),this.refreshDimensions()}refreshDimensions(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.state!==Bt.EDITING&&!e)return;if(this.TD=this.getEditedCell(),!this.TD){e||this.close();return}const{top:n,start:r,width:i,maxWidth:o,height:s,maxHeight:a}=this.getEditedCellRect();this.textareaParentStyle.top=`${n}px`,this.textareaParentStyle[this.hot.isRtl()?"right":"left"]=`${r}px`,this.showEditableElement();const l=this.hot.rootWindow.getComputedStyle(this.TD);this.TEXTAREA.style.fontSize=l.fontSize,this.TEXTAREA.style.fontFamily=l.fontFamily,this.TEXTAREA.style.backgroundColor=this.TD.style.backgroundColor,this.autoResize.init(this.TEXTAREA,{minWidth:Math.min(i,o),minHeight:Math.min(s,a),maxWidth:o,maxHeight:a},!0)}bindEvents(){ZN()&&this.eventManager.addEventListener(this.TEXTAREA,"focusout",()=>this.finishEditing(!1)),this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>{this.refreshDimensions(),this.state===Bt.EDITING&&this.focus()}),this.addHook("afterRowResize",()=>{this.refreshDimensions(),this.state===Bt.EDITING&&this.focus()})}allowKeyEventPropagation(){}destroy(){this.eventManager.destroy(),this.clearHooks()}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={runOnlyIf:()=>ae(this.hot.getSelected()),group:xx},i=()=>{this.hot.rootDocument.execCommand("insertText",!1,`
62
+ `)};n.addShortcuts([{keys:[["Control","Enter"]],callback:()=>(i(),!1),runOnlyIf:o=>!this.hot.selection.isMultiple()&&!o.altKey},{keys:[["Meta","Enter"]],callback:()=>(i(),!1),runOnlyIf:()=>!this.hot.selection.isMultiple()},{keys:[["Alt","Enter"]],callback:()=>(i(),!1)},{keys:[["Home"]],callback:(o,s)=>{let[a]=s;Ox(a,this.TEXTAREA)}},{keys:[["End"]],callback:(o,s)=>{let[a]=s;Ox(a,this.TEXTAREA)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(xx)}}const s4="base";function Td(t,e,n,r,i,o,s){const a=s.ariaTags,l=[],u=[],c=[],h=[];s.className&&q(e,s.className),s.readOnly?(l.push(s.readOnlyCellClassName),a&&h.push(OP())):a&&c.push(OP()[0]),s.valid===!1&&s.invalidCellClassName?(l.push(s.invalidCellClassName),a&&h.push(xP())):(u.push(s.invalidCellClassName),a&&c.push(xP()[0])),s.wordWrap===!1&&s.noWordWrapClassName&&l.push(s.noWordWrapClassName),!o&&s.placeholder&&l.push(s.placeholderCellClassName),pe(e,u),q(e,l),Ku(e,c),ye(e,h)}Td.RENDERER_TYPE=s4;const a4="text";function us(t,e,n,r,i,o,s){Td.apply(this,[t,e,n,r,i,o,s]);let a=o;!a&&s.placeholder&&(a=s.placeholder),a=Pt(a),s.trimWhitespace&&(a=a.trim()),ol(e,a)}us.RENDERER_TYPE=a4;const l4="text",lk={CELL_TYPE:l4,editor:Sl,renderer:us};ci(lk);De.editors={BaseEditor:Qu};function De(t,e){const n=new sk(t,e||{},sE);return n.init(),n}De.Core=function(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new sk(t,e,sE)};De.DefaultSettings=JD();De.hooks=re.getSingleton();De.CellCoords=al;De.CellRange=bd;De.packageName="handsontable";De.buildDate="24/04/2025 10:59:00";De.version="15.3.0";De.languages={dictionaryKeys:TK,getLanguageDictionary:zD,getLanguagesDictionaries:OK,registerLanguageDictionary:UD,getTranslatedPhrase:YD};function pS(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function u4(t){if(Array.isArray(t))return pS(t)}function c4(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Kh(t,e,n){return e=rm(e),w4(t,uk()?Reflect.construct(e,n||[],rm(t).constructor):e.apply(t,n))}function ku(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ax(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ck(r.key),r)}}function Lu(t,e,n){return e&&Ax(t.prototype,e),n&&Ax(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function h4(t,e,n){return(e=ck(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rm(t){return rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rm(t)}function Xh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wS(t,e)}function uk(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uk=function(){return!!t})()}function d4(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function f4(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
63
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hx(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function g4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Hx(Object(n),!0).forEach(function(r){h4(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hx(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function m4(t,e){if(t==null)return{};var n,r,i=p4(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function p4(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function w4(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return c4(t)}function wS(t,e){return wS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},wS(t,e)}function v4(t){return u4(t)||d4(t)||y4(t)||f4()}function C4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function ck(t){var e=C4(t,"string");return typeof e=="symbol"?e:e+""}function y4(t,e){if(t){if(typeof t=="string")return pS(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pS(t,e):void 0}}var ly=null,b4="Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.",S4="The Handsontable instance bound to this component was destroyed and cannot be used properly.",im="global",R4="hot-wrapper-editor-container";function E4(){if(typeof console<"u"){var t;(t=console).warn.apply(t,arguments)}}function vS(t,e){var n=Dt.Children.toArray(t),r=Dt.Children.count(t),i=null;return r!==0&&(r===1&&n[0].props[e]?i=n[0]:i=n.find(function(o){return o.props[e]!==void 0})),i||null}function hk(t){return t?t.type.WrappedComponent?t.type.WrappedComponent:t.type:null}function dk(t,e){if(typeof t>"u"||e===null)return null;var n=gk(e.props,!1);return n.className="".concat(R4," ").concat(n.className),t1.createPortal(Dt.createElement("div",Object.assign({},n),e),t.body)}function fk(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:im,r=vS(t,"hot-editor"),i=hk(r);return r?Dt.cloneElement(r,{emitEditorInstance:function(s,a){e.get(i)||e.set(i,new Map);var l=e.get(i);l.set(a??im,s)},editorColumnScope:n,isEditor:!0}):null}function T4(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;n||(n=document),ly||(ly=n.createDocumentFragment());var o=i??n.createElement("DIV");ly.appendChild(o);var s=Dt.cloneElement(t,g4({key:"".concat(e.row,"-").concat(e.col)},e));return{portal:t1.createPortal(s,o,r),portalContainer:o}}function gk(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return{id:t.id||(e?"hot-"+Math.random().toString(36).substring(5):void 0),className:t.className||"",style:t.style||{}}}function _4(){return typeof window<"u"}var mk=(function(){function t(){ku(this,t)}return Lu(t,null,[{key:"getSettings",value:(function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.prevProps,o=i===void 0?{}:i,s=r.isInit,a=s===void 0?!1:s,l=r.initOnlySettingKeys,u=l===void 0?[]:l,c=function(y){return!a&&u.includes(y)?o[y]===n[y]:!1},h={};if(n.settings){var d=n.settings;for(var f in d)d.hasOwnProperty(f)&&!c(f)&&(h[f]=d[f])}for(var m in n)m!=="settings"&&m!=="children"&&!c(m)&&n.hasOwnProperty(m)&&(h[m]=n[m]);return h})}])})(),M4=(function(t){function e(){return ku(this,e),Kh(this,e,arguments)}return Xh(e,t),Lu(e,[{key:"getSettingsProps",value:(function(){var r=this;return this.internalProps=["_componentRendererColumns","_emitColumnSettings","_columnIndex","_getChildElementByType","_getRendererWrapper","_getEditorClass","_getEditorCache","_getOwnerDocument","hot-renderer","hot-editor","children"],Object.keys(this.props).filter(function(i){return!r.internalProps.includes(i)}).reduce(function(i,o){return i[o]=r.props[o],i},{})})},{key:"getLocalEditorElement",value:function(){return fk(this.props.children,this.props._getEditorCache(),this.props._columnIndex)}},{key:"createColumnSettings",value:function(){var r=this.props._getChildElementByType(this.props.children,"hot-renderer"),i=this.getLocalEditorElement();this.columnSettings=mk.getSettings(this.getSettingsProps()),r!==null&&(this.columnSettings.renderer=this.props._getRendererWrapper(r),this.props._componentRendererColumns.set(this.props._columnIndex,!0)),i!==null&&(this.columnSettings.editor=this.props._getEditorClass(i,this.props._columnIndex))}},{key:"emitColumnSettings",value:function(){this.props._emitColumnSettings(this.columnSettings,this.props._columnIndex)}},{key:"componentDidMount",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"componentDidUpdate",value:function(){this.createColumnSettings(),this.emitColumnSettings()}},{key:"render",value:function(){var r=this.props._getOwnerDocument(),i=dk(r,this.getLocalEditorElement());return Dt.createElement(Dt.Fragment,null,i)}}])})(Dt.Component),I4=(function(t){function e(){var n;return ku(this,e),n=Kh(this,e,arguments),n.state={portals:[]},n}return Xh(e,t),Lu(e,[{key:"render",value:function(){return Dt.createElement(Dt.Fragment,null,this.state.portals)}}])})(Dt.Component),P4="15.3.0";function O4(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var pk={exports:{}},uy,Nx;function x4(){if(Nx)return uy;Nx=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return uy=t,uy}var cy,Dx;function A4(){if(Dx)return cy;Dx=1;var t=x4();function e(){}function n(){}return n.resetWarningCache=e,cy=function(){function i(a,l,u,c,h,d){if(d!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}i.isRequired=i;function o(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},cy}pk.exports=A4()();var H4=pk.exports,hy=O4(H4),k0=(function(t){function e(){var n;return ku(this,e),n=Kh(this,e,arguments),n.id=null,n.__hotInstance=null,n.hotElementRef=null,n.columnSettings=[],n.renderersPortalManager=null,n.portalCache=new Map,n.portalContainerCache=new Map,n.renderedCellCache=new Map,n.editorCache=new Map,n.componentRendererColumns=new Map,n}return Xh(e,t),Lu(e,[{key:"hotInstance",get:(function(){return!this.__hotInstance||this.__hotInstance&&!this.__hotInstance.isDestroyed?this.__hotInstance:(console.warn(S4),null)}),set:(function(r){this.__hotInstance=r})},{key:"_isHotInstanceDestroyed",value:function(){return this.__hotInstance&&this.__hotInstance.isDestroyed}},{key:"getPortalContainerCache",value:function(){return this.portalContainerCache}},{key:"getRenderedCellCache",value:function(){return this.renderedCellCache}},{key:"getEditorCache",value:function(){return this.editorCache}},{key:"clearCache",value:function(){this.getRenderedCellCache().clear(),this.componentRendererColumns.clear()}},{key:"getOwnerDocument",value:function(){return _4()?this.hotElementRef?this.hotElementRef.ownerDocument:document:null}},{key:"setHotElementRef",value:function(r){this.hotElementRef=r}},{key:"getRendererWrapper",value:function(r){var i=this;return function(s,a,l,u,c,h,d){var f=i.getRenderedCellCache(),m=i.getPortalContainerCache(),C="".concat(l,"-").concat(u),y=s.guid,E="".concat(y,"-").concat(C),v="".concat(C,"-").concat(y);if(f.has(C)&&(a.innerHTML=f.get(C).innerHTML),a&&!a.getAttribute("ghost-table")){for(var _=i.portalCache.get(v),A=m.get(E);a.firstChild;)a.removeChild(a.firstChild);if(_&&A)a.appendChild(A);else{var L=T4(r,{TD:a,row:l,col:u,prop:c,value:h,cellProperties:d,isRenderer:!0},a.ownerDocument,v,A),T=L.portal,P=L.portalContainer;m.set(E,P),a.appendChild(P),i.portalCache.set(v,T)}}return f.set(C,a),a}}},{key:"getEditorClass",value:function(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:im,s=hk(r),a=(i=this.getEditorCache().get(s))===null||i===void 0?void 0:i.get(o);return this.makeEditorClass(a)}},{key:"makeEditorClass",value:function(r){var i=(function(o){function s(a){var l;return ku(this,s),l=Kh(this,s,[a]),r.hotCustomEditorInstance=l,l.editorComponent=r,l}return Xh(s,o),Lu(s,[{key:"focus",value:function(){}},{key:"getValue",value:function(){}},{key:"setValue",value:function(){}},{key:"open",value:function(){}},{key:"close",value:function(){}}])})(De.editors.BaseEditor);return Object.getOwnPropertyNames(De.editors.BaseEditor.prototype).forEach(function(o){o!=="constructor"&&(i.prototype[o]=function(){for(var s,a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return(s=r[o]).call.apply(s,[r].concat(l))})}),i}},{key:"getGlobalRendererElement",value:function(){return vS(this.props.children,"hot-renderer")}},{key:"getGlobalEditorElement",value:function(){return fk(this.props.children,this.getEditorCache())}},{key:"createNewGlobalSettings",value:function(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this._isHotInstanceDestroyed()?[]:((r=this.hotInstance)===null||r===void 0||(r=r.getSettings())===null||r===void 0?void 0:r._initOnlySettings)||[],a=mk.getSettings(this.props,{prevProps:o,isInit:i,initOnlySettingKeys:s}),l=this.getGlobalRendererElement(),u=this.getGlobalEditorElement();if(a.columns=this.columnSettings.length?this.columnSettings:a.columns,u)a.editor=this.getEditorClass(u,im);else{var c;this.props.editor||(c=this.props.settings)!==null&&c!==void 0&&c.editor?a.editor=this.props.editor||this.props.settings.editor:a.editor=iS("text")}if(l)a.renderer=this.getRendererWrapper(l),this.componentRendererColumns.set("global",!0);else{var h;this.props.renderer||(h=this.props.settings)!==null&&h!==void 0&&h.renderer?a.renderer=this.props.renderer||this.props.settings.renderer:a.renderer=lS("text")}return a}},{key:"displayAutoSizeWarning",value:function(r){var i,o;this.hotInstance&&((i=this.hotInstance.getPlugin("autoRowSize"))!==null&&i!==void 0&&i.enabled||(o=this.hotInstance.getPlugin("autoColumnSize"))!==null&&o!==void 0&&o.enabled)&&this.componentRendererColumns.size>0&&E4(b4)}},{key:"setHotColumnSettings",value:function(r,i){this.columnSettings[i]=r}},{key:"handsontableBeforeViewRender",value:function(){this.portalCache.clear(),this.getRenderedCellCache().clear()}},{key:"handsontableAfterViewRender",value:function(){this.renderersPortalManager.setState({portals:v4(this.portalCache.values())})}},{key:"updateHot",value:function(r){this.hotInstance&&this.hotInstance.updateSettings(r,!1)}},{key:"setRenderersPortalManagerRef",value:function(r){this.renderersPortalManager=r}},{key:"componentDidMount",value:function(){var r=this,i=this.createNewGlobalSettings(!0);this.hotInstance=new De.Core(this.hotElementRef,i),this.hotInstance.addHook("beforeViewRender",function(){return r.handsontableBeforeViewRender()}),this.hotInstance.addHook("afterViewRender",function(){return r.handsontableAfterViewRender()}),this.hotInstance.init(),this.displayAutoSizeWarning(i)}},{key:"componentDidUpdate",value:function(r){this.clearCache();var i=this.createNewGlobalSettings(!1,r);this.updateHot(i),this.displayAutoSizeWarning(i)}},{key:"componentWillUnmount",value:function(){this.clearCache(),this.hotInstance&&this.hotInstance.destroy()}},{key:"render",value:function(){var r=this,i=function(c){return c.type===M4},o=Dt.Children.toArray(this.props.children),s=o.filter(function(u){return i(u)}).map(function(u,c){return Dt.cloneElement(u,{_componentRendererColumns:r.componentRendererColumns,_emitColumnSettings:r.setHotColumnSettings.bind(r),_columnIndex:c,_getChildElementByType:vS.bind(r),_getRendererWrapper:r.getRendererWrapper.bind(r),_getEditorClass:r.getEditorClass.bind(r),_getOwnerDocument:r.getOwnerDocument.bind(r),_getEditorCache:r.getEditorCache.bind(r),children:u.props.children})}),a=gk(this.props),l=dk(this.getOwnerDocument(),this.getGlobalEditorElement());return Dt.createElement(Dt.Fragment,null,Dt.createElement("div",Object.assign({ref:this.setHotElementRef.bind(this)},a),s),Dt.createElement(I4,{ref:this.setRenderersPortalManagerRef.bind(this)}),l)}}],[{key:"version",get:function(){return P4}}])})(Dt.Component);k0.propTypes={style:hy.object,id:hy.string,className:hy.string};var N4=["children"],D4=Dt.forwardRef(function(t,e){var n,r=t.children,i=m4(t,N4),o=typeof Dt.useId=="function"?Dt.useId():void 0,s=(n=i.id)!==null&&n!==void 0?n:o;return Dt.createElement(k0,Object.assign({id:s},i,{ref:e}),r)});D4.version=k0.version;Dt.Component;const kx="handsontableEditor",k4="handsontable";class L0 extends Sl{static get EDITOR_TYPE(){return k4}open(){super.open();const e=this.htContainer.style;this.htEditor&&(this.htEditor.destroy(),e.width="",e.height="",e.overflow=""),e.display==="none"&&(e.display=""),this.htEditor=new this.hot.constructor(this.htContainer,this.htOptions),this.htEditor.init(),this.htEditor.rootElement.style.display="",this.cellProperties.strict?this.htEditor.selectCell(0,0):this.htEditor.deselectCell(),np(this.TEXTAREA,0,this.TEXTAREA.value.length),this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),this.refreshDimensions()}close(){this.htEditor&&(this.htEditor.rootElement.style.display="none"),this.removeHooksByKey("beforeKeyDown"),super.close()}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s);const a=this,l={startRows:0,startCols:0,minRows:0,minCols:0,className:"listbox",copyPaste:!1,autoColumnSize:!1,autoRowSize:!1,readOnly:!0,fillHandle:!1,autoWrapCol:!1,autoWrapRow:!1,ariaTags:!1,themeName:this.hot.getCurrentThemeName(),afterOnCellMouseDown(u,c){const h=this.getSourceData(c.row,c.col);h!==void 0&&a.setValue(h),a.hot.destroyEditor()},preventWheel:!0,layoutDirection:this.hot.isRtl()?"rtl":"ltr"};this.cellProperties.handsontable&&on(l,s.handsontable),this.htOptions=l}beginEditing(e,n){const r=this.hot.getSettings().onBeginEditing;r&&r()===!1||super.beginEditing(e,n)}createElements(){super.createElements();const e=this.hot.rootDocument.createElement("DIV");e.className="handsontableEditor",this.TEXTAREA_PARENT.appendChild(e),this.htContainer=e,this.assignHooks()}finishEditing(e,n,r){if(this.htEditor&&this.htEditor.isListening()&&this.hot.listen(),this.htEditor&&this.htEditor.getSelectedLast()){const i=this.htEditor.getValue();i!==void 0&&this.setValue(i)}super.finishEditing(e,n,r)}getHeight(){return this.htEditor.view.getTableHeight()+1}getWidth(){return this.htEditor.view.getTableWidth()}assignHooks(){this.hot.addHook("afterDestroy",()=>{var e;(e=this.htEditor)===null||e===void 0||e.destroy()}),this.hot.addHook("afterSetTheme",(e,n)=>{if(!n){var r;(r=this.htEditor)===null||r===void 0||r.useTheme(e)}})}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor");super.registerShortcuts();const r={group:kx,relativeToGroup:Js,position:"before"},i=(o,s)=>{const a=this.htEditor;if(o!==void 0&&(o<0||a.flipped&&o>a.countRows()-1?a.deselectCell():a.selectCell(o,0),a.getData().length))return s.preventDefault(),Pi(s),this.hot.listen(),this.TEXTAREA.focus(),!1};n.addShortcuts([{keys:[["ArrowUp"]],callback:o=>{const s=this.htEditor;let a,l;return!s.getSelectedLast()&&s.flipped?a=s.countRows()-1:s.getSelectedLast()&&(s.flipped?(l=s.getSelectedLast()[0],a=Math.max(0,l-1)):(l=s.getSelectedLast()[0],a=l-1)),i(a,o)},preventDefault:!1},{keys:[["ArrowDown"]],callback:o=>{const s=this.htEditor;let a,l;if(!s.getSelectedLast()&&!s.flipped)a=0;else if(s.getSelectedLast()){if(s.flipped)a=s.getSelectedLast()[0]+1;else if(!s.flipped){const u=s.countRows()-1;l=s.getSelectedLast()[0],a=Math.min(u,l+1)}}return i(a,o)},preventDefault:!1}],r)}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(kx)}}function L4(t,e){wk(t,e),e.add(t)}function Lx(t,e,n){wk(t,e),e.set(t,n)}function wk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function pf(t,e,n){return(e=$4(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $4(t){var e=F4(t,"string");return typeof e=="symbol"?e:e+""}function F4(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dy(t,e){return t.get(CS(t,e))}function CS(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const V4="autocomplete";var fy=new WeakMap,$x=new WeakMap,gy=new WeakSet;class $0 extends L0{constructor(){super(...arguments),L4(this,gy),pf(this,"query",null),pf(this,"strippedChoices",[]),pf(this,"rawChoices",[]),Lx(this,fy,this.hot.guid.slice(0,9)),Lx(this,$x,ip(()=>{this.focus()},100)),pf(this,"sortByRelevance",function(e,n,r){const i=[],o=[],s=e.length;let a=n.length,l,u,c,h;if(s===0){for(c=0;c<a;c++)o.push(c);return o}for(c=0;c<a;c++){if(u=PP(Pt(n[c])),r)h=u.indexOf(e);else{const d=this.cellProperties.locale;h=u.toLocaleLowerCase(d).indexOf(e.toLocaleLowerCase(d))}h!==-1&&(l=u.length-h-s,i.push({baseIndex:c,index:h,charsLeft:l,value:u}))}for(i.sort((d,f)=>{if(f.index===-1)return-1;if(d.index===-1)return 1;if(d.index<f.index)return-1;if(f.index<d.index)return 1;if(d.index===f.index){if(d.charsLeft<f.charsLeft)return-1;if(d.charsLeft>f.charsLeft)return 1}return 0}),c=0,a=i.length;c<a;c++)o.push(i[c].baseIndex);return o})}static get EDITOR_TYPE(){return V4}getValue(){const e=this.rawChoices.find(n=>this.stripValueIfNeeded(n)===this.TEXTAREA.value);return ae(e)?e:this.TEXTAREA.value}createElements(){super.createElements(),q(this.htContainer,"autocompleteEditor"),q(this.htContainer,this.hot.rootWindow.navigator.platform.indexOf("Mac")===-1?"":"htMacScroll"),this.hot.getSettings().ariaTags&&ye(this.TEXTAREA,[qU(),jU(),xN("listbox"),QU()])}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.hot.getSettings().ariaTags&&ye(this.TEXTAREA,[Gr("false"),JU(`${dy(fy,this)}-listbox-${e}-${n}`)])}open(){super.open();const e=this.cellProperties.trimDropdown===void 0?!0:this.cellProperties.trimDropdown,n=this.hot.getSettings().ariaTags,r=Array.isArray(this.cellProperties.source)?this.cellProperties.source:null,i=r==null?void 0:r.length,{row:o,col:s}=this;this.showEditableElement(),this.focus(),this.addHook("beforeKeyDown",a=>this.onBeforeKeyDown(a)),this.htEditor.addHook("afterScroll",dy($x,this)),this.htEditor.updateSettings({colWidths:e?[qt(this.TEXTAREA)-2]:void 0,autoColumnSize:!0,renderer:(a,l,u,c,h,d,f)=>{us(a,l,u,c,h,d,f);const{filteringCaseSensitive:m,allowHtml:C,locale:y}=this.cellProperties,E=this.query;let v=Pt(d),_,A;v&&!C&&(_=m===!0?v.indexOf(E):v.toLocaleLowerCase(y).indexOf(E.toLocaleLowerCase(y)),_!==-1&&(A=v.substr(_,E.length),v=v.replace(A,`<strong>${A}</strong>`))),n&&ye(l,[UU(),...r?[rz(i)]:[],...r?[iz(r.indexOf(d)+1)]:[],["id",`${this.htEditor.rootElement.id}_${u}-${c}`]]),l.innerHTML=v},afterSelectionEnd:(a,l)=>{if(n){const u=h=>{ye(h,[HR()]),ye(this.TEXTAREA,...ez(h.id))},c=this.htEditor.getCell(a,l,!0);c!==null?u(c):this.htEditor.addHookOnce("afterScrollVertically",()=>{const h=this.htEditor.getCell(a,l,!0);u(h)})}}}),n&&(ye(this.htEditor.view._wt.wtOverlays.wtTable.TABLE,...zo()),ye(this.htEditor.rootElement,[ON(),tz("polite"),nz("text"),["id",`${dy(fy,this)}-listbox-${o}-${s}`]]),ye(this.TEXTAREA,...Gr("true"))),this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)})}close(){this.removeHooksByKey("beforeKeyDown"),super.close(),this.hot.getSettings().ariaTags&&ye(this.TEXTAREA,[Gr("false")])}discardEditor(e){super.discardEditor(e),this.hot.view.render()}queryChoices(e){const n=this.cellProperties.source;this.query=e,typeof n=="function"?n.call(this.cellProperties,e,r=>{this.rawChoices=r,this.updateChoicesList(this.stripValuesIfNeeded(r))}):Array.isArray(n)?(this.rawChoices=n,this.updateChoicesList(this.stripValuesIfNeeded(n))):this.updateChoicesList([])}updateChoicesList(e){const n=WN(this.TEXTAREA),r=fz(this.TEXTAREA),i=this.cellProperties.sortByRelevance,o=this.cellProperties.filter;let s=null,a=null,l=e;i&&(s=this.sortByRelevance(this.stripValueIfNeeded(this.getValue()),l,this.cellProperties.filteringCaseSensitive));const u=Array.isArray(s)?s.length:0;if(o===!1)u&&(a=s[0]);else{const c=[];for(let h=0,d=l.length;h<d&&!(i&&u<=h);h++)u?c.push(l[s[h]]):c.push(l[h]);a=0,l=c}this.strippedChoices=l,l.length===0?this.htEditor.rootElement.style.display="none":this.htEditor.rootElement.style.display="",this.htEditor.loadData(Rg([l])),l.length>0&&(this.updateDropdownDimensions(),this.flipDropdownIfNeeded(),this.cellProperties.strict===!0&&this.highlightBestMatchingChoice(a)),this.hot.listen(),np(this.TEXTAREA,n,n===r?void 0:r)}flipDropdownIfNeeded(){const e=this.getEditedCellRect(),n=e.height;let r=e.top;if(this.hot.view.isVerticallyScrollableByWindow()){const a=this.hot.view.getTableOffset().top-this.hot.rootWindow.scrollY;r=Math.max(r+a,0)}const i=this.getHeight(),o=this.hot.view.getWorkspaceHeight()-r-n,s=i>o&&r>o+n;return s?this.flipDropdown(i):this.unflipDropdown(),this.limitDropdownIfNeeded(s?r:o,i),s}limitDropdownIfNeeded(e,n){if(n>e){let r=0,i=0,o=0,s=null;do o=this.htEditor.getRowHeight(i)||this.htEditor.view.getDefaultRowHeight(),r+=o,i+=1;while(r<e);s=r-o,this.htEditor.flipped&&(this.htEditor.rootElement.style.top=`${parseInt(this.htEditor.rootElement.style.top,10)+n-s}px`),this.setDropdownHeight(r-o)}}flipDropdown(e){const n=this.htEditor.rootElement.style;n.position="absolute",n.top=`${-e}px`,this.htEditor.flipped=!0}unflipDropdown(){const e=this.htEditor.rootElement.style;e.position="absolute",e.top="",this.htEditor.flipped=void 0}updateDropdownDimensions(){this.htEditor.updateSettings({width:this.getWidth(),height:this.getHeight()}),CS(gy,this,Fx).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}setDropdownHeight(e){this.htEditor.updateSettings({height:e}),CS(gy,this,Fx).call(this),this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer()}highlightBestMatchingChoice(e){typeof e=="number"?this.htEditor.selectCell(e,0,void 0,void 0,void 0,!1):this.htEditor.deselectCell()}getHeight(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),n=parseInt(e.borderTopWidth,10)+parseInt(e.borderBottomWidth,10),r=Math.min(this.cellProperties.visibleRows,this.strippedChoices.length);return Array.from({length:r},(o,s)=>s).reduce((o,s)=>{const a=this.htEditor.getRowHeight(s)||this.htEditor.view.getDefaultRowHeight();return o+a},0)+n+1}getWidth(){const e=this.hot.rootWindow.getComputedStyle(this.htContainer.querySelector(".htCore")),n=parseInt(e.borderInlineStartWidth,10)+parseInt(e.borderInlineEndWidth,10);return this.htEditor.getColWidth(0)+n}stripValueIfNeeded(e){return this.stripValuesIfNeeded([e])[0]}stripValuesIfNeeded(e){const{allowHtml:n}=this.cellProperties,r=Be(e,o=>Pt(o));return Be(r,o=>n?o:PP(o))}allowKeyEventPropagation(e){const n=this.htEditor.getSelectedRangeLast(),r={row:n?n.from.row:-1};let i=!1;return e===me.ARROW_DOWN&&r.row>0&&r.row<this.htEditor.countRows()-1&&(i=!0),e===me.ARROW_UP&&r.row>-1&&(i=!0),i}onBeforeKeyDown(e){if(Oz(e.keyCode)||e.keyCode===me.BACKSPACE||e.keyCode===me.DELETE||e.keyCode===me.INSERT){let n=10;if(e.keyCode===me.C&&(e.ctrlKey||e.metaKey))return;this.isOpened()||(n+=10),this.htEditor&&this.hot._registerTimeout(()=>{this.queryChoices(this.TEXTAREA.value)},n)}}}function Fx(){this.htEditor.view.hasVerticalScroll()&&this.htEditor.updateSettings({width:this.getWidth()+yn(this.hot.rootDocument)})}const W4="checkbox";class vk extends Qu{static get EDITOR_TYPE(){return W4}beginEditing(e,n){if(n&&n.type==="mouseup"&&n.target.nodeName==="TD"){const r=this.TD.querySelector('input[type="checkbox"]');ve(r,"htBadValue")||r.click()}}finishEditing(){}init(){}open(){}close(){}getValue(){}setValue(){}focus(){}}/*!
64
+ * Pikaday
65
+ *
66
+ * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/Pikaday/Pikaday
67
+ */const Ls=()=>window,jr=()=>window.document,yS=(t,e)=>window.setTimeout(t,e),qi=function(t,e,n,r){t.addEventListener(e,n,!!r)},To=function(t,e,n,r){t.removeEventListener(e,n,!!r)},B4=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},yr=function(t,e){return(" "+t.className+" ").indexOf(" "+e+" ")!==-1},my=function(t,e){yr(t,e)||(t.className=t.className===""?e:t.className+" "+e)},py=function(t,e){t.className=B4((" "+t.className+" ").replace(" "+e+" "," "))},F0=function(t){return/Array/.test(Object.prototype.toString.call(t))},Er=function(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())},j4=function(t){let e=t.getDay();return e===0||e===6},U4=function(t){return t%4===0&&t%100!==0||t%400===0},Vx=function(t,e){return[31,U4(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},wf=function(t){Er(t)&&t.setHours(0,0,0,0)},vf=function(t,e){return t.getTime()===e.getTime()},om=function(t,e,n){let r,i;for(r in e)i=t[r]!==void 0,i&&typeof e[r]=="object"&&e[r]!==null&&e[r].nodeName===void 0?Er(e[r])?n&&(t[r]=new Date(e[r].getTime())):F0(e[r])?n&&(t[r]=e[r].slice(0)):t[r]=om({},e[r],n):(n||!i)&&(t[r]=e[r]);return t},Wx=function(t,e,n){let r=jr().createEvent("HTMLEvents");r.initEvent(e,!0,!1),r=om(r,n),t.dispatchEvent(r)},Bx=function(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},Li={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,firstWeekOfYearMinDays:4,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},jx=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},z4=function(t){let e=[],n="false";if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)e.push("is-outside-current-month"),t.enableSelectionDaysInNextAndPreviousMonths||e.push("is-selection-disabled");else return'<td class="is-empty"></td>';return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&(e.push("is-selected"),n="true"),t.hasEvent&&e.push("has-event"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+t.year+'" data-pika-month="'+t.month+'" data-pika-day="'+t.day+'">'+t.day+"</button></td>"},Y4=function(t,e){t.setHours(0,0,0,0);let n=t.getDate(),r=t.getDay(),i=e,o=i-1,s=7,a=function(d){return(d+s-1)%s};t.setDate(n+o-a(r));let l=new Date(t.getFullYear(),0,i),u=1440*60*1e3,c=(t.getTime()-l.getTime())/u;return 1+Math.round((c-o+a(l.getDay()))/s)},G4=function(t,e,n,r,i){let o=new Date(r,n,e);return'<td class="pika-week">'+(t.hasMoment?t.moment(o).isoWeek():Y4(o,i))+"</td>"},q4=function(t,e,n,r){return'<tr class="pika-row'+(n?" pick-whole-week":"")+(r?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"},K4=function(t){return"<tbody>"+t.join("")+"</tbody>"},X4=function(t){let e,n=[];for(t.showWeekNumber&&n.push("<th></th>"),e=0;e<7;e++)n.push('<th scope="col"><abbr title="'+jx(t,e)+'">'+jx(t,e,!0)+"</abbr></th>");return"<thead><tr>"+(t.isRTL?n.reverse():n).join("")+"</tr></thead>"},Z4=function(t,e,n,r,i,o){let s,a,l,u=t._o,c=n===u.minYear,h=n===u.maxYear,d='<div id="'+o+'" class="pika-title" role="heading" aria-live="polite">',f,m,C=!0,y=!0;for(l=[],s=0;s<12;s++)l.push('<option value="'+(n===i?s-e:12+s-e)+'"'+(s===r?' selected="selected"':"")+(c&&s<u.minMonth||h&&s>u.maxMonth?' disabled="disabled"':"")+">"+u.i18n.months[s]+"</option>");for(f='<div class="pika-label">'+u.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",F0(u.yearRange)?(s=u.yearRange[0],a=u.yearRange[1]+1):(s=n-u.yearRange,a=1+n+u.yearRange),l=[];s<a&&s<=u.maxYear;s++)s>=u.minYear&&l.push('<option value="'+s+'"'+(s===n?' selected="selected"':"")+">"+s+"</option>");return m='<div class="pika-label">'+n+u.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",u.showMonthAfterYear?d+=m+f:d+=f+m,c&&(r===0||u.minMonth>=r)&&(C=!1),h&&(r===11||u.maxMonth<=r)&&(y=!1),e===0&&(d+='<button class="pika-prev'+(C?"":" is-disabled")+'" type="button">'+u.i18n.previousMonth+"</button>"),e===t._o.numberOfMonths-1&&(d+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+u.i18n.nextMonth+"</button>"),d+="</div>"},Q4=function(t,e,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+X4(t)+K4(e)+"</table>"};function bS(t){let e=this,n=e.config(t);e._onMouseDown=function(i){if(!e._v)return;i=i||Ls().event;let o=i.target||i.srcElement;if(o)if(yr(o,"is-disabled")||(yr(o,"pika-button")&&!yr(o,"is-empty")&&!yr(o.parentNode,"is-disabled")?(e.setDate(new Date(o.getAttribute("data-pika-year"),o.getAttribute("data-pika-month"),o.getAttribute("data-pika-day"))),n.bound&&yS(function(){e.hide(),n.blurFieldOnSelect&&n.field&&n.field.blur()},100)):yr(o,"pika-prev")?e.prevMonth():yr(o,"pika-next")&&e.nextMonth()),yr(o,"pika-select"))e._c=!0;else if(i.preventDefault)i.preventDefault();else return i.returnValue=!1,!1},e._onChange=function(i){i=i||Ls().event;let o=i.target||i.srcElement;o&&(yr(o,"pika-select-month")?e.gotoMonth(o.value):yr(o,"pika-select-year")&&e.gotoYear(o.value))},e._onKeyChange=function(i){if(i=i||Ls().event,e.isVisible())switch(i.keyCode){case 13:case 27:n.field&&n.field.blur();break;case 37:e.adjustDate("subtract",1);break;case 38:e.adjustDate("subtract",7);break;case 39:e.adjustDate("add",1);break;case 40:e.adjustDate("add",7);break;case 8:case 46:e.setDate(null);break}},e._parseFieldValue=function(){if(n.parse)return n.parse(n.field.value,n.format);if(this.hasMoment){let i=this.moment(n.field.value,n.format,n.formatStrict);return i&&i.isValid()?i.toDate():null}else return new Date(Date.parse(n.field.value))},e._onInputChange=function(i){let o;i.firedBy!==e&&(o=e._parseFieldValue(),Er(o)&&e.setDate(o),e._v||e.show())},e._onInputFocus=function(){e.show()},e._onInputClick=function(){e.show()},e._onInputBlur=function(){let i=jr().activeElement;do if(yr(i,"pika-single"))return;while(i=i.parentNode);e._c||(e._b=yS(function(){e.hide()},50)),e._c=!1},e._onClick=function(i){i=i||Ls().event;let o=i.target||i.srcElement,s=o;if(o){!hasEventListeners&&yr(o,"pika-select")&&(o.onchange||(o.setAttribute("onchange","return;"),qi(o,"change",e._onChange)));do if(yr(s,"pika-single")||s===n.trigger)return;while(s=s.parentNode);e._v&&o!==n.trigger&&s!==n.trigger&&e.hide()}},e.el=jr().createElement("div"),e.el.className="pika-single"+(n.isRTL?" is-rtl":"")+(n.theme?" "+n.theme:""),qi(e.el,"mousedown",e._onMouseDown,!0),qi(e.el,"touchend",e._onMouseDown,!0),qi(e.el,"change",e._onChange),n.keyboardInput&&qi(jr(),"keydown",e._onKeyChange),n.field&&(n.container?n.container.appendChild(e.el):n.bound?jr().body.appendChild(e.el):n.field.parentNode.insertBefore(e.el,n.field.nextSibling),qi(n.field,"change",e._onInputChange),n.defaultDate||(n.defaultDate=e._parseFieldValue(),n.setDefaultDate=!0));let r=n.defaultDate;Er(r)?n.setDefaultDate?e.setDate(r,!0):e.gotoDate(r):e.gotoDate(new Date),n.bound?(this.hide(),e.el.className+=" is-bound",qi(n.trigger,"click",e._onInputClick),qi(n.trigger,"focus",e._onInputFocus),qi(n.trigger,"blur",e._onInputBlur)):this.show()}bS.prototype={config:function(t){this._o||(this._o=om({},Li,!0));let e=om(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme=typeof e.theme=="string"&&e.theme?e.theme:null,e.bound=!!(e.bound!==void 0?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn=typeof e.disableDayFn=="function"?e.disableDayFn:null;let n=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=n>4?4:n,Er(e.minDate)||(e.minDate=!1),Er(e.maxDate)||(e.maxDate=!1),e.minDate&&e.maxDate&&e.maxDate<e.minDate&&(e.maxDate=e.minDate=!1),e.minDate&&this.setMinDate(e.minDate),e.maxDate&&this.setMaxDate(e.maxDate),F0(e.yearRange)){let r=new Date().getFullYear()-10;e.yearRange[0]=parseInt(e.yearRange[0],10)||r,e.yearRange[1]=parseInt(e.yearRange[1],10)||r}else e.yearRange=Math.abs(parseInt(e.yearRange,10))||Li.yearRange,e.yearRange>100&&(e.yearRange=100);return e},toString:function(t){return t=t||this._o.format,Er(this._d)?this._o.toString?this._o.toString(this._d,t):this.hasMoment?this.moment(this._d).format(t):this._d.toDateString():""},getMoment:function(){return this.hasMoment?this.moment(this._d):null},setMoment:function(t,e){this.hasMoment&&this.moment.isMoment(t)&&this.setDate(t.toDate(),e)},useMoment:function(t){this.hasMoment=!0,this.moment=t},getDate:function(){return Er(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value="",Wx(this._o.field,"change",{firedBy:this})),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!Er(t))return;let n=this._o.minDate,r=this._o.maxDate;Er(n)&&t<n?t=n:Er(r)&&t>r&&(t=r),this._d=new Date(t.getTime()),wf(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),Wx(this._o.field,"change",{firedBy:this})),!e&&typeof this._o.onSelect=="function"&&this._o.onSelect.call(this,this.getDate())},clear:function(){this.setDate(null)},gotoDate:function(t){let e=!0;if(Er(t)){if(this.calendars){let n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),i=t.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),e=i<n.getTime()||r.getTime()<i}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}],this._o.mainCalendar==="right"&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(t,e){let n=this.getDate()||new Date,r=parseInt(e)*24*60*60*1e3,i;t==="add"?i=new Date(n.valueOf()+r):t==="subtract"&&(i=new Date(n.valueOf()-r)),this.setDate(i)},adjustCalendars:function(){this.calendars[0]=Bx(this.calendars[0]);for(let t=1;t<this._o.numberOfMonths;t++)this.calendars[t]=Bx({month:this.calendars[0].month+t,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())},setMinDate:function(t){t instanceof Date?(wf(t),this._o.minDate=t,this._o.minYear=t.getFullYear(),this._o.minMonth=t.getMonth()):(this._o.minDate=Li.minDate,this._o.minYear=Li.minYear,this._o.minMonth=Li.minMonth,this._o.startRange=Li.startRange),this.draw()},setMaxDate:function(t){t instanceof Date?(wf(t),this._o.maxDate=t,this._o.maxYear=t.getFullYear(),this._o.maxMonth=t.getMonth()):(this._o.maxDate=Li.maxDate,this._o.maxYear=Li.maxYear,this._o.maxMonth=Li.maxMonth,this._o.endRange=Li.endRange),this.draw()},setStartRange:function(t){this._o.startRange=t},setEndRange:function(t){this._o.endRange=t},draw:function(t){if(!this._v&&!t)return;let e=this._o,n=e.minYear,r=e.maxYear,i=e.minMonth,o=e.maxMonth,s="",a;this._y<=n&&(this._y=n,!isNaN(i)&&this._m<i&&(this._m=i)),this._y>=r&&(this._y=r,!isNaN(o)&&this._m>o&&(this._m=o));for(let l=0;l<e.numberOfMonths;l++)a="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2),s+='<div class="pika-lendar">'+Z4(this,l,this.calendars[l].year,this.calendars[l].month,this.calendars[0].year,a)+this.render(this.calendars[l].year,this.calendars[l].month,a)+"</div>";this.el.innerHTML=s,e.bound&&e.field.type!=="hidden"&&yS(function(){e.trigger.focus()},1),typeof this._o.onDraw=="function"&&this._o.onDraw(this),e.bound&&e.field.setAttribute("aria-label",e.ariaLabel)},adjustPosition:function(){let t,e,n,r,i,o,s,a,l,u,c;this._o.container||(this.el.style.position="absolute",t=this._o.trigger,e=this.el.offsetWidth,n=this.el.offsetHeight,r=Ls().innerWidth||jr().documentElement.clientWidth,i=Ls().innerHeight||jr().documentElement.clientHeight,o=jr().body.scrollTop||jr().documentElement.scrollTop,u=!0,c=!0,l=t.getBoundingClientRect(),s=l.left+Ls().pageXOffset,a=l.bottom+Ls().pageYOffset,(this._o.reposition&&s+e>r||this._o.position.indexOf("right")>-1&&s-e+t.offsetWidth>0)&&(s=s-e+t.offsetWidth,u=!1),(this._o.reposition&&a+n>i+o||this._o.position.indexOf("top")>-1&&a-n-t.offsetHeight>0)&&(a=a-n-t.offsetHeight,c=!1),s<0&&(s=0),a<0&&(a=0),this.el.style.left=s+"px",this.el.style.top=a+"px",my(this.el,u?"left-aligned":"right-aligned"),my(this.el,c?"bottom-aligned":"top-aligned"),py(this.el,u?"right-aligned":"left-aligned"),py(this.el,c?"top-aligned":"bottom-aligned"))},render:function(t,e,n){let r=this._o,i=new Date,o=Vx(t,e),s=new Date(t,e,1).getDay(),a=[],l=[];wf(i),r.firstDay>0&&(s-=r.firstDay,s<0&&(s+=7));let u=e===0?11:e-1,c=e===11?0:e+1,h=e===0?t-1:t,d=e===11?t+1:t,f=Vx(h,u),m=o+s,C=m;for(;C>7;)C-=7;m+=7-C;let y=!1;for(let E=0,v=0;E<m;E++){let _=new Date(t,e,1+(E-s)),A=Er(this._d)?vf(_,this._d):!1,L=vf(_,i),T=r.events.indexOf(_.toDateString())!==-1,P=E<s||E>=o+s,Y=1+(E-s),U=e,W=t,Z=r.startRange&&vf(r.startRange,_),J=r.endRange&&vf(r.endRange,_),se=r.startRange&&r.endRange&&r.startRange<_&&_<r.endRange,te=r.minDate&&_<r.minDate||r.maxDate&&_>r.maxDate||r.disableWeekends&&j4(_)||r.disableDayFn&&r.disableDayFn(_);P&&(E<s?(Y=f+Y,U=u,W=h):(Y=Y-o,U=c,W=d));let ue={day:Y,month:U,year:W,hasEvent:T,isSelected:A,isToday:L,isDisabled:te,isEmpty:P,isStartRange:Z,isEndRange:J,isInRange:se,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:r.enableSelectionDaysInNextAndPreviousMonths};r.pickWholeWeek&&A&&(y=!0),l.push(z4(ue)),++v===7&&(r.showWeekNumber&&l.unshift(G4(this,E-s,e,t,r.firstWeekOfYearMinDays)),a.push(q4(l,r.isRTL,r.pickWholeWeek,y)),l=[],v=0,y=!1)}return Q4(r,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),py(this.el,"is-hidden"),this._o.bound&&(qi(jr(),"click",this._onClick),this.adjustPosition()),typeof this._o.onOpen=="function"&&this._o.onOpen.call(this))},hide:function(){let t=this._v;t!==!1&&(this._o.bound&&To(jr(),"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),my(this.el,"is-hidden"),this._v=!1,t!==void 0&&typeof this._o.onClose=="function"&&this._o.onClose.call(this))},destroy:function(){let t=this._o;this.hide(),To(this.el,"mousedown",this._onMouseDown,!0),To(this.el,"touchend",this._onMouseDown,!0),To(this.el,"change",this._onChange),t.keyboardInput&&To(jr(),"keydown",this._onKeyChange),t.field&&(To(t.field,"change",this._onInputChange),t.bound&&(To(t.trigger,"click",this._onInputClick),To(t.trigger,"focus",this._onInputFocus),To(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}};function J4(t,e){e9(t,e),e.add(t)}function e9(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ux(t,e,n){return(e=t9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function t9(t){var e=n9(t,"string");return typeof e=="symbol"?e:e+""}function n9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wy(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Ck="date",zx="dateEditor",r9="DD/MM/YYYY";var Cf=new WeakSet;class yk extends Sl{constructor(){super(...arguments),J4(this,Cf),Ux(this,"parentDestroyed",!1),Ux(this,"$datePicker",null)}static get EDITOR_TYPE(){return Ck}init(){if(typeof X!="function")throw new Error("You need to include moment.js to your project.");if(typeof bS!="function")throw new Error("You need to include Pikaday to your project.");super.init(),this.hot.addHook("afterDestroy",()=>{this.parentDestroyed=!0,this.destroyElements()}),this.hot.addHook("afterSetTheme",(e,n)=>{n||(pe(this.datePicker,/ht-theme-.*/g),q(this.datePicker,e))})}createElements(){super.createElements(),this.datePicker=this.hot.rootDocument.createElement("DIV"),this.datePickerStyle=this.datePicker.style,this.datePickerStyle.position="absolute",this.datePickerStyle.top=0,this.datePickerStyle.left=0,this.datePickerStyle.zIndex=9999,this.datePicker.setAttribute("dir",this.hot.isRtl()?"rtl":"ltr"),q(this.datePicker,"htDatepickerHolder");const e=this.hot.getCurrentThemeName();pe(this.datePicker,/ht-theme-.*/g),q(this.datePicker,e),this.hot.rootDocument.body.appendChild(this.datePicker),this.eventManager.addEventListener(this.datePicker,"mousedown",n=>{ve(n.target,"pika-day")&&this.hideDatepicker(),n.stopPropagation()})}destroyElements(){const e=this.datePicker.parentNode;this.$datePicker&&this.$datePicker.destroy(),e&&e.removeChild(this.datePicker)}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s)}open(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const r=this.hot.getShortcutManager().getContext("editor");this.showDatepicker(e),super.open(),r.addShortcuts([{keys:[["ArrowLeft"]],callback:()=>{this.$datePicker.adjustDate("subtract",1)}},{keys:[["ArrowRight"]],callback:()=>{this.$datePicker.adjustDate("add",1)}},{keys:[["ArrowUp"]],callback:()=>{this.$datePicker.adjustDate("subtract",7)}},{keys:[["ArrowDown"]],callback:()=>{this.$datePicker.adjustDate("add",7)}}],{group:zx})}close(){var e;this._opened=!1,(e=this.$datePicker)!==null&&e!==void 0&&e.destroy&&this.$datePicker.destroy(),this.hot._registerTimeout(()=>{const i=this.hot._getEditorManager();i.closeEditor(),this.hot.view.render(),i.prepareEditor()}),this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(zx),super.close()}finishEditing(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;super.finishEditing(e,n)}showDatepicker(e){const n=wy(Cf,this,vy).call(this),r=this.hot.view.isMouseDown(),i=e?JN(e.keyCode):!1;let o;this.datePicker.style.display="block",this.$datePicker=new bS(this.getDatePickerConfig()),typeof this.$datePicker.useMoment=="function"&&this.$datePicker.useMoment(X),this.$datePicker._onInputFocus=function(){},this.originalValue?(o=this.originalValue,X(o,n,!0).isValid()&&this.$datePicker.setMoment(X(o,n),!0),this.getValue()!==this.originalValue&&this.setValue(this.originalValue),!i&&!r&&this.setValue("")):this.cellProperties.defaultDate?(o=this.cellProperties.defaultDate,X(o,n,!0).isValid()&&this.$datePicker.setMoment(X(o,n),!0),!i&&!r&&this.setValue("")):this.$datePicker.gotoToday()}hideDatepicker(){this.datePickerStyle.display="none",this.$datePicker.hide()}getDatePickerConfig(){var e;const n=this.TEXTAREA,r={};this.cellProperties&&this.cellProperties.datePickerConfig&&op(r,this.cellProperties.datePickerConfig);const i=r.onSelect,o=r.onClose;return r.field=n,r.trigger=n,r.container=this.datePicker,r.bound=!1,r.keyboardInput=!1,r.format=(e=r.format)!==null&&e!==void 0?e:wy(Cf,this,vy).call(this),r.reposition=r.reposition||!1,r.isRTL=!1,r.onSelect=s=>{let a=s;isNaN(a.getTime())||(a=X(a).format(wy(Cf,this,vy).call(this))),this.setValue(a),i&&i(),Yo()&&this.hideDatepicker()},r.onClose=()=>{this.parentDestroyed||this.finishEditing(!1),o&&o()},r}refreshDimensions(e){var n;if(super.refreshDimensions(e),this.state!==Bt.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.hideDatepicker();return}const{rowIndexMapper:r,columnIndexMapper:i}=this.hot,{wtOverlays:o}=this.hot.view._wt,{wtTable:s}=(n=o.getParentOverlay(this.TD))!==null&&n!==void 0?n:this.hot.view._wt,a=r.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleRow()),l=r.getVisualFromRenderableIndex(s.getLastPartiallyVisibleRow()),u=i.getVisualFromRenderableIndex(s.getFirstPartiallyVisibleColumn()),c=i.getVisualFromRenderableIndex(s.getLastPartiallyVisibleColumn());if(this.row>=a&&this.row<=l&&this.col>=u&&this.col<=c){const h=this.TD.getBoundingClientRect();this.datePickerStyle.top=`${this.hot.rootWindow.pageYOffset+h.top+rn(this.TD)}px`;let d=this.hot.rootWindow.pageXOffset;this.hot.isRtl()?d+=h.right-qt(this.datePicker):d+=h.left,this.datePickerStyle.left=`${d}px`}else this.hideDatepicker()}}function vy(){var t;return(t=this.cellProperties.dateFormat)!==null&&t!==void 0?t:r9}const i9="dropdown";class bk extends $0{static get EDITOR_TYPE(){return i9}prepare(e,n,r,i,o,s){s.filter=!1,s.strict=!0,super.prepare(e,n,r,i,o,s)}}const o9="numeric";class Sk extends Sl{static get EDITOR_TYPE(){return o9}}function s9(t,e,n){return(e=a9(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a9(t){var e=l9(t,"string");return typeof e=="symbol"?e:e+""}function l9(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const u9="password";class Rk extends Sl{constructor(){super(...arguments),s9(this,"autoResize",ak(this.hot.rootDocument,{textContent:e=>"•".repeat(e.value.length)}))}static get EDITOR_TYPE(){return u9}createElements(){super.createElements(),this.TEXTAREA=this.hot.rootDocument.createElement("input"),this.TEXTAREA.setAttribute("type","password"),this.TEXTAREA.setAttribute("data-hot-input",""),this.TEXTAREA.className="handsontableInput",this.textareaStyle=this.TEXTAREA.style,this.textareaStyle.width=0,this.textareaStyle.height=0,ts(this.TEXTAREA_PARENT),this.TEXTAREA_PARENT.appendChild(this.TEXTAREA)}}const Cy="ht_editor_visible",Yx="selectEditor",c9="select";class Ek extends Qu{static get EDITOR_TYPE(){return c9}init(){this.selectWrapper=this.hot.rootDocument.createElement("div"),this.select=this.hot.rootDocument.createElement("select"),this.select.setAttribute("data-hot-input","true"),this.selectWrapper.style.display="none";const e=this.hot.rootDocument.createElement("DIV"),n=this.hot.getSettings().ariaTags;e.className="htAutocompleteArrow",n&&e.setAttribute(...yl()),e.appendChild(this.hot.rootDocument.createTextNode("▼")),q(this.selectWrapper,"htSelectEditor"),this.selectWrapper.appendChild(this.select),this.selectWrapper.insertBefore(e,this.selectWrapper.firstChild),this.hot.rootElement.appendChild(this.selectWrapper),this.registerHooks()}getValue(){return this.select.value}setValue(e){this.select.value=e}open(){this._opened=!0,this.refreshDimensions(),this.selectWrapper.style.display="",this.hot.getShortcutManager().setActiveContextName("editor"),this.registerShortcuts()}close(){this._opened=!1,this.selectWrapper.style.display="none",ve(this.selectWrapper,Cy)&&pe(this.selectWrapper,Cy),this.unregisterShortcuts(),this.clearHooks()}focus(){this.select.focus()}registerHooks(){this.addHook("afterScrollHorizontally",()=>this.refreshDimensions()),this.addHook("afterScrollVertically",()=>this.refreshDimensions()),this.addHook("afterColumnResize",()=>this.refreshDimensions()),this.addHook("afterRowResize",()=>this.refreshDimensions())}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s);const a=this.cellProperties.selectOptions;let l;typeof a=="function"?l=this.prepareOptions(a(this.row,this.col,this.prop)):l=this.prepareOptions(a),ts(this.select),He(l,(u,c)=>{const h=this.hot.rootDocument.createElement("OPTION");h.value=c,Xu(h,u),this.select.appendChild(h)})}prepareOptions(e){let n={};if(Array.isArray(e))for(let r=0,i=e.length;r<i;r++)n[e[r]]=e[r];else typeof e=="object"&&(n=e);return n}refreshValue(){const e=this.hot.getSourceDataAtCell(this.row,this.prop);this.originalValue=e,this.setValue(e),this.refreshDimensions()}refreshDimensions(){if(this.state!==Bt.EDITING)return;if(this.TD=this.getEditedCell(),!this.TD){this.close();return}const{top:e,start:n,width:r,height:i}=this.getEditedCellRect(),o=this.selectWrapper.style;o.height=`${i}px`,o.width=`${r}px`,o.top=`${e}px`,o[this.hot.isRtl()?"right":"left"]=`${n}px`,o.margin="0px",q(this.selectWrapper,Cy)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("editor"),r={group:Yx};this.isInFullEditMode()&&n.addShortcuts([{keys:[["ArrowUp"]],callback:()=>{const i=this.select.selectedIndex-1;i>=0&&(this.select[i].selected=!0)}},{keys:[["ArrowDown"]],callback:()=>{const i=this.select.selectedIndex+1;i<=this.select.length-1&&(this.select[i].selected=!0)}}],r)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("editor").removeShortcutsByGroup(Yx)}}const h9="time";class Tk extends Sl{static get EDITOR_TYPE(){return h9}prepare(e,n,r,i,o,s){super.prepare(e,n,r,i,o,s),this.TEXTAREA.dir="ltr"}}function d9(){br(Qu),br($0),br(vk),br(yk),br(bk),br(L0),br(Sk),br(Rk),br(Ek),br(Sl),br(Tk)}const f9="html";function V0(t,e,n,r,i,o,s){Td.apply(this,[t,e,n,r,i,o,s]),Xu(e,o??"",!1)}V0.RENDERER_TYPE=f9;const g9="autocomplete";function ec(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=s.allowHtml?V0:us,u=a.createElement("DIV"),c=t.getSettings().ariaTags;if(u.className="htAutocompleteArrow",c&&u.setAttribute(...yl()),u.appendChild(a.createTextNode("▼")),l.apply(this,[t,e,n,r,i,o,s]),e.firstChild||e.appendChild(a.createTextNode(" ")),e.insertBefore(u,e.firstChild),q(e,"htAutocomplete"),!t.acArrowListener){const h=new _i(t);t.acArrowListener=function(d){ve(d.target,"htAutocompleteArrow")&&t.view._wt.getSetting("onCellDblClick",null,t._createCellCoords(n,r),e)},h.addEventListener(t.rootElement,"mousedown",t.acArrowListener),t.addHookOnce("afterDestroy",()=>{h.destroy()})}}ec.RENDERER_TYPE=g9;const m9="dropdown";function W0(t,e,n,r,i,o,s){ec.apply(this,[t,e,n,r,i,o,s])}W0.RENDERER_TYPE=m9;const Gx=new WeakMap,qx=new WeakMap,p9="htBadValue",$u="data-row",Fu="data-col",w9="checkboxRenderer",_k="checkbox";re.getSingleton().add("modifyAutoColumnSizeSeed",function(t,e,n){const{label:r,type:i,row:o,column:s,prop:a}=e;if(i===_k){if(r){const{value:l,property:u}=r;let c=n;if(l)c=typeof l=="function"?l(o,s,a,n):l;else if(u){const h=this.getDataAtRowProp(o,u);c=h!==null?h:n}t=c}return t}});function B0(t,e,n,r,i,o,s){const{rootDocument:a}=t,l=t.getSettings().ariaTags;Td.apply(this,[t,e,n,r,i,o,s]),v9(t);let u=C9(a);const c=s.label;let h=!1;if(typeof s.checkedTemplate>"u"&&(s.checkedTemplate=!0),typeof s.uncheckedTemplate>"u"&&(s.uncheckedTemplate=!1),ts(e),o===s.checkedTemplate||Pt(o).toLocaleLowerCase(s.locale)===Pt(s.checkedTemplate).toLocaleLowerCase(s.locale)?u.checked=!0:o===s.uncheckedTemplate||Pt(o).toLocaleLowerCase(s.locale)===Pt(s.uncheckedTemplate).toLocaleLowerCase(s.locale)?u.checked=!1:Ut(o)?q(u,"noValue"):(u.style.display="none",q(u,p9),h=!0),ye(u,[[$u,n],[Fu,r]]),l&&ye(u,[jh(u.checked?t.getTranslatedPhrase(A0):t.getTranslatedPhrase(H0)),NN(u.checked),zU()]),!h&&c){let C="";if(c.value)C=typeof c.value=="function"?c.value.call(this,n,r,i,o):c.value;else if(c.property){const E=t.getDataAtRowProp(n,c.property);C=E!==null?E:""}const y=y9(a,C,c.separated!==!0);c.position==="before"?c.separated?(e.appendChild(y),e.appendChild(u)):(y.appendChild(u),u=y):(!c.position||c.position==="after")&&(c.separated?(e.appendChild(u),e.appendChild(y)):(y.insertBefore(u,y.firstChild),u=y))}(!c||c&&!c.separated)&&e.appendChild(u),h&&e.appendChild(a.createTextNode("#bad-value#")),Gx.has(t)||(Gx.set(t,!0),d());function d(){const y=t.getShortcutManager().getContext("grid"),E={group:w9,relativeToGroup:Js,position:"before"};y.addShortcuts([{keys:[["space"]],callback:()=>(f(),!m()),runOnlyIf:()=>{var v;return(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight.isCell()}},{keys:[["enter"]],callback:()=>(f(),!m()),runOnlyIf:()=>{const v=t.getSelectedRangeLast();return t.getSettings().enterBeginsEditing&&(v==null?void 0:v.highlight.isCell())&&!t.selection.isMultiple()}},{keys:[["delete"],["backspace"]],callback:()=>(f(!0),!m()),runOnlyIf:()=>{var v;return(v=t.getSelectedRangeLast())===null||v===void 0?void 0:v.highlight.isCell()}}],E)}function f(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const y=t.getSelectedRange(),E=[],v=new Map;let _=[],A=0;if(y){for(let L=0;L<y.length;L++){const{row:T,col:P}=y[L].getTopStartCorner(),{row:Y,col:U}=y[L].getBottomEndCorner();for(let W=T;W<=Y;W+=1)for(let Z=P;Z<=U;Z+=1){const J=t.getCellMeta(W,Z);if(J.hidden)continue;const se={checkedTemplate:J.checkedTemplate,uncheckedTemplate:J.uncheckedTemplate};if(J.type!=="checkbox"){C===!0&&!J.readOnly&&(v.has(E.length)?v.set(E.length,[...v.get(E.length),[W,Z,null]]):v.set(E.length,[[W,Z,null]]));continue}if(J.readOnly===!0)continue;typeof J.checkedTemplate>"u"&&(J.checkedTemplate=!0),typeof J.uncheckedTemplate>"u"&&(J.uncheckedTemplate=!1);const te=t.getDataAtCell(W,Z);C===!1?[J.checkedTemplate,J.checkedTemplate.toString()].includes(te)?_.push([W,Z,J.uncheckedTemplate,se]):[J.uncheckedTemplate,J.uncheckedTemplate.toString(),null,void 0].includes(te)&&_.push([W,Z,J.checkedTemplate,se]):_.push([W,Z,J.uncheckedTemplate,se]),A+=1}E.push(A),A=0}_.every(L=>{let[,,T]=L;return T===_[0][2]})?_=_.map(L=>{let[T,P,Y]=L;return[T,P,Y]}):_=_.map(L=>{let[T,P,,Y]=L;return[T,P,Y.checkedTemplate]}),_.length>0&&E.forEach((L,T)=>{let P=_.splice(0,L);v.size&&v.has(T)&&(P=[...P,...v.get(T)]),t.setDataAtCell(P)})}}function m(){const C=t.getSelectedRange();if(C){for(let y=0;y<C.length;y++){const E=C[y].getTopStartCorner(),v=C[y].getBottomEndCorner();for(let _=E.row;_<=v.row;_++)for(let A=E.col;A<=v.col;A++){if(t.getCellMeta(_,A).readOnly)continue;const T=t.getCell(_,A);if(Jo(T)&&T.querySelectorAll("input[type=checkbox]").length>0)return!0}}return!1}}}B0.RENDERER_TYPE=_k;function v9(t){let e=qx.get(t);if(!e){const{rootElement:n}=t;e=new _i(t),e.addEventListener(n,"click",r=>S9(r,t)),e.addEventListener(n,"mouseup",r=>b9(r,t)),e.addEventListener(n,"change",r=>R9(r,t)),qx.set(t,e)}return e}function C9(t){const e=t.createElement("input");return e.className="htCheckboxRendererInput",e.type="checkbox",e.setAttribute("tabindex","-1"),e.cloneNode(!1)}function y9(t,e,n){const r=t.createElement("label");r.className=`htCheckboxRendererLabel ${n?"fullWidth":""}`;const i=t.createTextNode(e);if(n){const o=t.createElement("span");o.appendChild(i),r.appendChild(o)}else r.appendChild(i);return r.cloneNode(!0)}function b9(t,e){const{target:n}=t;j0(n)&&(!n.hasAttribute($u)||!n.hasAttribute(Fu)||setTimeout(e.listen,10))}function S9(t,e){const{target:n}=t;if(!j0(n)||!n.hasAttribute($u)||!n.hasAttribute(Fu))return;const r=parseInt(n.getAttribute($u),10),i=parseInt(n.getAttribute(Fu),10);e.getCellMeta(r,i).readOnly&&t.preventDefault()}function R9(t,e){const{target:n}=t;if(!j0(n)||!n.hasAttribute($u)||!n.hasAttribute(Fu))return;const r=parseInt(n.getAttribute($u),10),i=parseInt(n.getAttribute(Fu),10),o=e.getCellMeta(r,i);if(!o.readOnly){let s=null;t.target.checked?s=o.uncheckedTemplate===void 0?!0:o.checkedTemplate:s=o.uncheckedTemplate===void 0?!1:o.uncheckedTemplate,e.setDataAtCell(r,i,s)}}function j0(t){return t.tagName==="INPUT"&&t.getAttribute("type")==="checkbox"}const E9="handsontable";function U0(t,e,n,r,i,o,s){ec.apply(this,[t,e,n,r,i,o,s])}U0.RENDERER_TYPE=E9;var T9=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _9(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}/*!
68
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
69
+ *
70
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
71
+ * of this software and associated documentation files (the "Software"), to deal
72
+ * in the Software without restriction, including without limitation the rights
73
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
74
+ * copies of the Software, and to permit persons to whom the Software is
75
+ * furnished to do so, subject to the following conditions:
76
+ *
77
+ * The above copyright notice and this permission notice shall be included in
78
+ * all copies or substantial portions of the Software.
79
+ *
80
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
83
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
84
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
85
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
86
+ * SOFTWARE.
87
+ */var yy,Kx;function M9(){return Kx||(Kx=1,yy={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(t){let e=t%10;return~~(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),yy}/*!
88
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
89
+ *
90
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
91
+ * of this software and associated documentation files (the "Software"), to deal
92
+ * in the Software without restriction, including without limitation the rights
93
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
94
+ * copies of the Software, and to permit persons to whom the Software is
95
+ * furnished to do so, subject to the following conditions:
96
+ *
97
+ * The above copyright notice and this permission notice shall be included in
98
+ * all copies or substantial portions of the Software.
99
+ *
100
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
101
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
102
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
103
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
104
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
105
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
106
+ * SOFTWARE.
107
+ */var by,Xx;function Mk(){if(Xx)return by;Xx=1;const t=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function e(l){return l.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function n(l,u,c,h,d,f,m){if(!isNaN(+l))return+l;let C="",y=l.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(y!==l)return-1*n(y,u,c,h,d,f);for(let T=0;T<t.length;T++){let P=t[T];if(C=l.replace(RegExp(`([0-9 ])(${P.key})$`),"$1"),C!==l)return n(C,u,c,h,d,f)*P.factor}if(C=l.replace("%",""),C!==l)return n(C,u,c,h,d,f)/100;let E=parseFloat(l);if(isNaN(E))return;let v=h(E);if(v&&v!=="."&&(C=l.replace(new RegExp(`${e(v)}$`),""),C!==l))return n(C,u,c,h,d,f);let _={};Object.keys(f).forEach(T=>{_[f[T]]=T});let A=Object.keys(_).sort().reverse(),L=A.length;for(let T=0;T<L;T++){let P=A[T],Y=_[P];if(C=l.replace(P,""),C!==l){let U;switch(Y){case"thousand":U=Math.pow(10,3);break;case"million":U=Math.pow(10,6);break;case"billion":U=Math.pow(10,9);break;case"trillion":U=Math.pow(10,12);break}return n(C,u,c,h,d,f)*U}}}function r(l,u,c){let h=l.replace(c,"");return h=h.replace(new RegExp(`([0-9])${e(u.thousands)}([0-9])`,"g"),"$1$2"),h=h.replace(u.decimal,"."),h}function i(l,u,c="",h,d,f,m){if(l==="")return;if(l===d)return 0;let C=r(l,u,c);return n(C,u,c,h,d,f)}function o(l,u){if(!(l.indexOf(":")&&u.thousands!==":"))return!1;let h=l.split(":");if(h.length!==3)return!1;let d=+h[0],f=+h[1],m=+h[2];return!isNaN(d)&&!isNaN(f)&&!isNaN(m)}function s(l){let u=l.split(":"),c=+u[0],h=+u[1];return+u[2]+60*h+3600*c}function a(l,u){const c=G0();let h=c.currentDelimiters(),d=c.currentCurrency().symbol,f=c.currentOrdinal(),m=c.getZeroFormat(),C=c.currentAbbreviations(),y;if(typeof l=="string")o(l,h)?y=s(l):y=i(l,h,d,f,m,C);else if(typeof l=="number")y=l;else return;if(y!==void 0)return y}return by={unformat:a},by}/*!
108
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
109
+ *
110
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
111
+ * of this software and associated documentation files (the "Software"), to deal
112
+ * in the Software without restriction, including without limitation the rights
113
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
114
+ * copies of the Software, and to permit persons to whom the Software is
115
+ * furnished to do so, subject to the following conditions:
116
+ *
117
+ * The above copyright notice and this permission notice shall be included in
118
+ * all copies or substantial portions of the Software.
119
+ *
120
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
121
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
122
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
123
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
124
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
125
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
126
+ * SOFTWARE.
127
+ */var Sy,Zx;function z0(){if(Zx)return Sy;Zx=1;let t=Mk();const e=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,n=["currency","percent","byte","time","ordinal","number"],r=["trillion","billion","million","thousand"],i=["prefix","infix","postfix"],o=["sign","parenthesis"],s={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},u={output:{type:"string",validValues:n},base:{type:"string",validValues:["decimal","binary","general"],restriction:(y,E)=>E.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:y=>y.output==="byte"},characteristic:{type:"number",restriction:y=>y>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:r},average:"boolean",lowPrecision:{type:"boolean",restriction:(y,E)=>E.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:i},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:y=>y>=0,message:"value must be positive"},{restriction:(y,E)=>!E.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:y=>y>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:o},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(y,E)=>E.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},c={languageTag:{type:"string",mandatory:!0,restriction:y=>y.match(e),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:s,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function h(y,E){let v=d(y),_=m(E);return v&&_}function d(y){return t.unformat(y)!==void 0}function f(y,E,v,_=!1){let A=Object.keys(y).map(L=>{if(!E[L])return console.error(`${v} Invalid key: ${L}`),!1;let T=y[L],P=E[L];if(typeof P=="string"&&(P={type:P}),P.type==="format"){if(!f(T,u,`[Validate ${L}]`,!0))return!1}else if(typeof T!==P.type)return console.error(`${v} ${L} type mismatched: "${P.type}" expected, "${typeof T}" provided`),!1;if(P.restrictions&&P.restrictions.length){let Y=P.restrictions.length;for(let U=0;U<Y;U++){let{restriction:W,message:Z}=P.restrictions[U];if(!W(T,y))return console.error(`${v} ${L} invalid value: ${Z}`),!1}}return P.restriction&&!P.restriction(T,y)?(console.error(`${v} ${L} invalid value: ${P.message}`),!1):P.validValues&&P.validValues.indexOf(T)===-1?(console.error(`${v} ${L} invalid value: must be among ${JSON.stringify(P.validValues)}, "${T}" provided`),!1):!(P.children&&!f(T,P.children,`[Validate ${L}]`))});return _||A.push(...Object.keys(E).map(L=>{let T=E[L];if(typeof T=="string"&&(T={type:T}),T.mandatory){let P=T.mandatory;if(typeof P=="function"&&(P=P(y)),P&&y[L]===void 0)return console.error(`${v} Missing mandatory key "${L}"`),!1}return!0})),A.reduce((L,T)=>L&&T,!0)}function m(y){return f(y,u,"[Validate format]")}function C(y){return f(y,c,"[Validate language]")}return Sy={validate:h,validateFormat:m,validateInput:d,validateLanguage:C},Sy}/*!
128
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
129
+ *
130
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
131
+ * of this software and associated documentation files (the "Software"), to deal
132
+ * in the Software without restriction, including without limitation the rights
133
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
134
+ * copies of the Software, and to permit persons to whom the Software is
135
+ * furnished to do so, subject to the following conditions:
136
+ *
137
+ * The above copyright notice and this permission notice shall be included in
138
+ * all copies or substantial portions of the Software.
139
+ *
140
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
141
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
142
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
143
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
144
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
145
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
146
+ * SOFTWARE.
147
+ */function I9(t,e){let n=t.match(/^{([^}]*)}/);return n?(e.prefix=n[1],t.slice(n[0].length)):t}function P9(t,e){let n=t.match(/{([^}]*)}$/);return n?(e.postfix=n[1],t.slice(0,-n[0].length)):t}function O9(t,e){if(t.indexOf("$")!==-1){e.output="currency";return}if(t.indexOf("%")!==-1){e.output="percent";return}if(t.indexOf("bd")!==-1){e.output="byte",e.base="general";return}if(t.indexOf("b")!==-1){e.output="byte",e.base="binary";return}if(t.indexOf("d")!==-1){e.output="byte",e.base="decimal";return}if(t.indexOf(":")!==-1){e.output="time";return}t.indexOf("o")!==-1&&(e.output="ordinal")}function x9(t,e){t.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function A9(t,e){t.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function H9(t,e){let n=t.match(/[1-9]+[0-9]*/);n&&(e.totalLength=+n[0])}function N9(t,e){let r=t.split(".")[0].match(/0+/);r&&(e.characteristic=r[0].length)}function D9(t,e){let n=t.split(".")[1];if(n){let r=n.match(/0+/);r&&(e.mantissa=r[0].length)}}function k9(t,e){const n=t.split(".")[1];n&&(e.trimMantissa=n.indexOf("[")!==-1)}function L9(t,e){t.indexOf("a")!==-1&&(e.average=!0)}function $9(t,e){t.indexOf("K")!==-1?e.forceAverage="thousand":t.indexOf("M")!==-1?e.forceAverage="million":t.indexOf("B")!==-1?e.forceAverage="billion":t.indexOf("T")!==-1&&(e.forceAverage="trillion")}function F9(t,e){t.match(/\[\.]/)?e.optionalMantissa=!0:t.match(/\./)&&(e.optionalMantissa=!1)}function V9(t,e){if(t.indexOf(".")!==-1){let n=t.split(".")[0];e.optionalCharacteristic=n.indexOf("0")===-1}}function W9(t,e){t.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),t.match(/^\+?-/)&&(e.negative="sign")}function B9(t,e){t.match(/^\+/)&&(e.forceSign=!0)}function j9(t,e={}){return typeof t!="string"?t:(t=I9(t,e),t=P9(t,e),O9(t,e),H9(t,e),N9(t,e),V9(t,e),L9(t,e),$9(t,e),D9(t,e),F9(t,e),k9(t,e),x9(t,e),A9(t,e),W9(t,e),B9(t,e),e)}var Y0={parseFormat:j9};/*!
148
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
149
+ *
150
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
151
+ * of this software and associated documentation files (the "Software"), to deal
152
+ * in the Software without restriction, including without limitation the rights
153
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
154
+ * copies of the Software, and to permit persons to whom the Software is
155
+ * furnished to do so, subject to the following conditions:
156
+ *
157
+ * The above copyright notice and this permission notice shall be included in
158
+ * all copies or substantial portions of the Software.
159
+ *
160
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
161
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
162
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
163
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
164
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
165
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
166
+ * SOFTWARE.
167
+ */var Ry,Qx;function G0(){if(Qx)return Ry;Qx=1;const t=M9(),e=z0(),n=Y0;let r={},i,o={},s=null,a={};function l(c){i=c}function u(){return o[i]}return r.languages=()=>Object.assign({},o),r.currentLanguage=()=>i,r.currentBytes=()=>u().bytes||{},r.currentCurrency=()=>u().currency,r.currentAbbreviations=()=>u().abbreviations,r.currentDelimiters=()=>u().delimiters,r.currentOrdinal=()=>u().ordinal,r.currentDefaults=()=>Object.assign({},u().defaults,a),r.currentOrdinalDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().ordinalFormat),r.currentByteDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().byteFormat),r.currentPercentageDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().percentageFormat),r.currentCurrencyDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().currencyFormat),r.currentTimeDefaultFormat=()=>Object.assign({},r.currentDefaults(),u().timeFormat),r.setDefaults=c=>{c=n.parseFormat(c),e.validateFormat(c)&&(a=c)},r.getZeroFormat=()=>s,r.setZeroFormat=c=>s=typeof c=="string"?c:null,r.hasZeroFormat=()=>s!==null,r.languageData=c=>{if(c){if(o[c])return o[c];throw new Error(`Unknown tag "${c}"`)}return u()},r.registerLanguage=(c,h=!1)=>{if(!e.validateLanguage(c))throw new Error("Invalid language data");o[c.languageTag]=c,h&&l(c.languageTag)},r.setLanguage=(c,h=t.languageTag)=>{if(!o[c]){let d=c.split("-")[0],f=Object.keys(o).find(m=>m.split("-")[0]===d);if(!o[f]){l(h);return}l(f);return}l(c)},r.registerLanguage(t),i=t.languageTag,Ry=r,Ry}function U9(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}/*!
168
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
169
+ *
170
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
171
+ * of this software and associated documentation files (the "Software"), to deal
172
+ * in the Software without restriction, including without limitation the rights
173
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
174
+ * copies of the Software, and to permit persons to whom the Software is
175
+ * furnished to do so, subject to the following conditions:
176
+ *
177
+ * The above copyright notice and this permission notice shall be included in
178
+ * all copies or substantial portions of the Software.
179
+ *
180
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
181
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
182
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
183
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
184
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
185
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
186
+ * SOFTWARE.
187
+ */function z9(t,e){t.forEach(n=>{let r;try{r=U9(`../languages/${n}`)}catch{console.error(`Unable to load "${n}". No matching language file found.`)}r&&e.registerLanguage(r)})}var Y9=t=>({loadLanguagesInNode:e=>z9(e,t)}),Ik={exports:{}};(function(t){(function(e){var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,o=Math.floor,s="[BigNumber Error] ",a=s+"Number primitive has more than 15 significant digits: ",l=1e14,u=14,c=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e7,f=1e9;function m(T){var P,Y,U,W=p.prototype={constructor:p,toString:null,valueOf:null},Z=new p(1),J=20,se=4,te=-7,ue=21,pt=-1e7,be=1e7,ke=!1,wt=1,mn=0,et={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},g="0123456789abcdefghijklmnopqrstuvwxyz",w=!0;function p(b,R){var S,k,M,N,B,x,D,V,F=this;if(!(F instanceof p))return new p(b,R);if(R==null){if(b&&b._isBigNumber===!0){F.s=b.s,!b.c||b.e>be?F.c=F.e=null:b.e<pt?F.c=[F.e=0]:(F.e=b.e,F.c=b.c.slice());return}if((x=typeof b=="number")&&b*0==0){if(F.s=1/b<0?(b=-b,-1):1,b===~~b){for(N=0,B=b;B>=10;B/=10,N++);N>be?F.c=F.e=null:(F.e=N,F.c=[b]);return}V=String(b)}else{if(!r.test(V=String(b)))return U(F,V,x);F.s=V.charCodeAt(0)==45?(V=V.slice(1),-1):1}(N=V.indexOf("."))>-1&&(V=V.replace(".","")),(B=V.search(/e/i))>0?(N<0&&(N=B),N+=+V.slice(B+1),V=V.substring(0,B)):N<0&&(N=V.length)}else{if(v(R,2,g.length,"Base"),R==10&&w)return F=new p(b),G(F,J+F.e+1,se);if(V=String(b),x=typeof b=="number"){if(b*0!=0)return U(F,V,x,R);if(F.s=1/b<0?(V=V.slice(1),-1):1,p.DEBUG&&V.replace(/^0\.0*|\./,"").length>15)throw Error(a+b)}else F.s=V.charCodeAt(0)===45?(V=V.slice(1),-1):1;for(S=g.slice(0,R),N=B=0,D=V.length;B<D;B++)if(S.indexOf(k=V.charAt(B))<0){if(k=="."){if(B>N){N=D;continue}}else if(!M&&(V==V.toUpperCase()&&(V=V.toLowerCase())||V==V.toLowerCase()&&(V=V.toUpperCase()))){M=!0,B=-1,N=0;continue}return U(F,String(b),x,R)}x=!1,V=Y(V,R,10,F.s),(N=V.indexOf("."))>-1?V=V.replace(".",""):N=V.length}for(B=0;V.charCodeAt(B)===48;B++);for(D=V.length;V.charCodeAt(--D)===48;);if(V=V.slice(B,++D)){if(D-=B,x&&p.DEBUG&&D>15&&(b>c||b!==o(b)))throw Error(a+F.s*b);if((N=N-B-1)>be)F.c=F.e=null;else if(N<pt)F.c=[F.e=0];else{if(F.e=N,F.c=[],B=(N+1)%u,N<0&&(B+=u),B<D){for(B&&F.c.push(+V.slice(0,B)),D-=u;B<D;)F.c.push(+V.slice(B,B+=u));B=u-(V=V.slice(B)).length}else B-=D;for(;B--;V+="0");F.c.push(+V)}}else F.c=[F.e=0]}p.clone=m,p.ROUND_UP=0,p.ROUND_DOWN=1,p.ROUND_CEIL=2,p.ROUND_FLOOR=3,p.ROUND_HALF_UP=4,p.ROUND_HALF_DOWN=5,p.ROUND_HALF_EVEN=6,p.ROUND_HALF_CEIL=7,p.ROUND_HALF_FLOOR=8,p.EUCLID=9,p.config=p.set=function(b){var R,S;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(R="DECIMAL_PLACES")&&(S=b[R],v(S,0,f,R),J=S),b.hasOwnProperty(R="ROUNDING_MODE")&&(S=b[R],v(S,0,8,R),se=S),b.hasOwnProperty(R="EXPONENTIAL_AT")&&(S=b[R],S&&S.pop?(v(S[0],-f,0,R),v(S[1],0,f,R),te=S[0],ue=S[1]):(v(S,-f,f,R),te=-(ue=S<0?-S:S))),b.hasOwnProperty(R="RANGE"))if(S=b[R],S&&S.pop)v(S[0],-f,-1,R),v(S[1],1,f,R),pt=S[0],be=S[1];else if(v(S,-f,f,R),S)pt=-(be=S<0?-S:S);else throw Error(s+R+" cannot be zero: "+S);if(b.hasOwnProperty(R="CRYPTO"))if(S=b[R],S===!!S)if(S)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ke=S;else throw ke=!S,Error(s+"crypto unavailable");else ke=S;else throw Error(s+R+" not true or false: "+S);if(b.hasOwnProperty(R="MODULO_MODE")&&(S=b[R],v(S,0,9,R),wt=S),b.hasOwnProperty(R="POW_PRECISION")&&(S=b[R],v(S,0,f,R),mn=S),b.hasOwnProperty(R="FORMAT"))if(S=b[R],typeof S=="object")et=S;else throw Error(s+R+" not an object: "+S);if(b.hasOwnProperty(R="ALPHABET"))if(S=b[R],typeof S=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(S))w=S.slice(0,10)=="0123456789",g=S;else throw Error(s+R+" invalid: "+S)}else throw Error(s+"Object expected: "+b);return{DECIMAL_PLACES:J,ROUNDING_MODE:se,EXPONENTIAL_AT:[te,ue],RANGE:[pt,be],CRYPTO:ke,MODULO_MODE:wt,POW_PRECISION:mn,FORMAT:et,ALPHABET:g}},p.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!p.DEBUG)return!0;var R,S,k=b.c,M=b.e,N=b.s;e:if({}.toString.call(k)=="[object Array]"){if((N===1||N===-1)&&M>=-f&&M<=f&&M===o(M)){if(k[0]===0){if(M===0&&k.length===1)return!0;break e}if(R=(M+1)%u,R<1&&(R+=u),String(k[0]).length==R){for(R=0;R<k.length;R++)if(S=k[R],S<0||S>=l||S!==o(S))break e;if(S!==0)return!0}}}else if(k===null&&M===null&&(N===null||N===1||N===-1))return!0;throw Error(s+"Invalid BigNumber: "+b)},p.maximum=p.max=function(){return $(arguments,-1)},p.minimum=p.min=function(){return $(arguments,1)},p.random=(function(){var b=9007199254740992,R=Math.random()*b&2097151?function(){return o(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(S){var k,M,N,B,x,D=0,V=[],F=new p(Z);if(S==null?S=J:v(S,0,f),B=i(S/u),ke)if(crypto.getRandomValues){for(k=crypto.getRandomValues(new Uint32Array(B*=2));D<B;)x=k[D]*131072+(k[D+1]>>>11),x>=9e15?(M=crypto.getRandomValues(new Uint32Array(2)),k[D]=M[0],k[D+1]=M[1]):(V.push(x%1e14),D+=2);D=B/2}else if(crypto.randomBytes){for(k=crypto.randomBytes(B*=7);D<B;)x=(k[D]&31)*281474976710656+k[D+1]*1099511627776+k[D+2]*4294967296+k[D+3]*16777216+(k[D+4]<<16)+(k[D+5]<<8)+k[D+6],x>=9e15?crypto.randomBytes(7).copy(k,D):(V.push(x%1e14),D+=7);D=B/7}else throw ke=!1,Error(s+"crypto unavailable");if(!ke)for(;D<B;)x=R(),x<9e15&&(V[D++]=x%1e14);for(B=V[--D],S%=u,B&&S&&(x=h[u-S],V[D]=o(B/x)*x);V[D]===0;V.pop(),D--);if(D<0)V=[N=0];else{for(N=-1;V[0]===0;V.splice(0,1),N-=u);for(D=1,x=V[0];x>=10;x/=10,D++);D<u&&(N-=u-D)}return F.e=N,F.c=V,F}})(),p.sum=function(){for(var b=1,R=arguments,S=new p(R[0]);b<R.length;)S=S.plus(R[b++]);return S},Y=(function(){var b="0123456789";function R(S,k,M,N){for(var B,x=[0],D,V=0,F=S.length;V<F;){for(D=x.length;D--;x[D]*=k);for(x[0]+=N.indexOf(S.charAt(V++)),B=0;B<x.length;B++)x[B]>M-1&&(x[B+1]==null&&(x[B+1]=0),x[B+1]+=x[B]/M|0,x[B]%=M)}return x.reverse()}return function(S,k,M,N,B){var x,D,V,F,z,oe,ce,Re,Ne=S.indexOf("."),We=J,Se=se;for(Ne>=0&&(F=mn,mn=0,S=S.replace(".",""),Re=new p(k),oe=Re.pow(S.length-Ne),mn=F,Re.c=R(L(y(oe.c),oe.e,"0"),10,M,b),Re.e=Re.c.length),ce=R(S,k,M,B?(x=g,b):(x=b,g)),V=F=ce.length;ce[--F]==0;ce.pop());if(!ce[0])return x.charAt(0);if(Ne<0?--V:(oe.c=ce,oe.e=V,oe.s=N,oe=P(oe,Re,We,Se,M),ce=oe.c,z=oe.r,V=oe.e),D=V+We+1,Ne=ce[D],F=M/2,z=z||D<0||ce[D+1]!=null,z=Se<4?(Ne!=null||z)&&(Se==0||Se==(oe.s<0?3:2)):Ne>F||Ne==F&&(Se==4||z||Se==6&&ce[D-1]&1||Se==(oe.s<0?8:7)),D<1||!ce[0])S=z?L(x.charAt(1),-We,x.charAt(0)):x.charAt(0);else{if(ce.length=D,z)for(--M;++ce[--D]>M;)ce[D]=0,D||(++V,ce=[1].concat(ce));for(F=ce.length;!ce[--F];);for(Ne=0,S="";Ne<=F;S+=x.charAt(ce[Ne++]));S=L(S,V,x.charAt(0))}return S}})(),P=(function(){function b(k,M,N){var B,x,D,V,F=0,z=k.length,oe=M%d,ce=M/d|0;for(k=k.slice();z--;)D=k[z]%d,V=k[z]/d|0,B=ce*D+V*oe,x=oe*D+B%d*d+F,F=(x/N|0)+(B/d|0)+ce*V,k[z]=x%N;return F&&(k=[F].concat(k)),k}function R(k,M,N,B){var x,D;if(N!=B)D=N>B?1:-1;else for(x=D=0;x<N;x++)if(k[x]!=M[x]){D=k[x]>M[x]?1:-1;break}return D}function S(k,M,N,B){for(var x=0;N--;)k[N]-=x,x=k[N]<M[N]?1:0,k[N]=x*B+k[N]-M[N];for(;!k[0]&&k.length>1;k.splice(0,1));}return function(k,M,N,B,x){var D,V,F,z,oe,ce,Re,Ne,We,Se,Le,vt,ti,mo,Or,Ct,Qt,ft=k.s==M.s?1:-1,yt=k.c,$e=M.c;if(!yt||!yt[0]||!$e||!$e[0])return new p(!k.s||!M.s||(yt?$e&&yt[0]==$e[0]:!$e)?NaN:yt&&yt[0]==0||!$e?ft*0:ft/0);for(Ne=new p(ft),We=Ne.c=[],V=k.e-M.e,ft=N+V+1,x||(x=l,V=C(k.e/u)-C(M.e/u),ft=ft/u|0),F=0;$e[F]==(yt[F]||0);F++);if($e[F]>(yt[F]||0)&&V--,ft<0)We.push(1),z=!0;else{for(mo=yt.length,Ct=$e.length,F=0,ft+=2,oe=o(x/($e[0]+1)),oe>1&&($e=b($e,oe,x),yt=b(yt,oe,x),Ct=$e.length,mo=yt.length),ti=Ct,Se=yt.slice(0,Ct),Le=Se.length;Le<Ct;Se[Le++]=0);Qt=$e.slice(),Qt=[0].concat(Qt),Or=$e[0],$e[1]>=x/2&&Or++;do{if(oe=0,D=R($e,Se,Ct,Le),D<0){if(vt=Se[0],Ct!=Le&&(vt=vt*x+(Se[1]||0)),oe=o(vt/Or),oe>1)for(oe>=x&&(oe=x-1),ce=b($e,oe,x),Re=ce.length,Le=Se.length;R(ce,Se,Re,Le)==1;)oe--,S(ce,Ct<Re?Qt:$e,Re,x),Re=ce.length,D=1;else oe==0&&(D=oe=1),ce=$e.slice(),Re=ce.length;if(Re<Le&&(ce=[0].concat(ce)),S(Se,ce,Le,x),Le=Se.length,D==-1)for(;R($e,Se,Ct,Le)<1;)oe++,S(Se,Ct<Le?Qt:$e,Le,x),Le=Se.length}else D===0&&(oe++,Se=[0]);We[F++]=oe,Se[0]?Se[Le++]=yt[ti]||0:(Se=[yt[ti]],Le=1)}while((ti++<mo||Se[0]!=null)&&ft--);z=Se[0]!=null,We[0]||We.splice(0,1)}if(x==l){for(F=1,ft=We[0];ft>=10;ft/=10,F++);G(Ne,N+(Ne.e=F+V*u-1)+1,B,z)}else Ne.e=V,Ne.r=+z;return Ne}})();function O(b,R,S,k){var M,N,B,x,D;if(S==null?S=se:v(S,0,8),!b.c)return b.toString();if(M=b.c[0],B=b.e,R==null)D=y(b.c),D=k==1||k==2&&(B<=te||B>=ue)?A(D,B):L(D,B,"0");else if(b=G(new p(b),R,S),N=b.e,D=y(b.c),x=D.length,k==1||k==2&&(R<=N||N<=te)){for(;x<R;D+="0",x++);D=A(D,N)}else if(R-=B,D=L(D,N,"0"),N+1>x){if(--R>0)for(D+=".";R--;D+="0");}else if(R+=N-x,R>0)for(N+1==x&&(D+=".");R--;D+="0");return b.s<0&&M?"-"+D:D}function $(b,R){for(var S,k,M=1,N=new p(b[0]);M<b.length;M++)k=new p(b[M]),(!k.s||(S=E(N,k))===R||S===0&&N.s===R)&&(N=k);return N}function j(b,R,S){for(var k=1,M=R.length;!R[--M];R.pop());for(M=R[0];M>=10;M/=10,k++);return(S=k+S*u-1)>be?b.c=b.e=null:S<pt?b.c=[b.e=0]:(b.e=S,b.c=R),b}U=(function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,R=/^([^.]+)\.$/,S=/^\.([^.]+)$/,k=/^-?(Infinity|NaN)$/,M=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(N,B,x,D){var V,F=x?B:B.replace(M,"");if(k.test(F))N.s=isNaN(F)?null:F<0?-1:1;else{if(!x&&(F=F.replace(b,function(z,oe,ce){return V=(ce=ce.toLowerCase())=="x"?16:ce=="b"?2:8,!D||D==V?oe:z}),D&&(V=D,F=F.replace(R,"$1").replace(S,"0.$1")),B!=F))return new p(F,V);if(p.DEBUG)throw Error(s+"Not a"+(D?" base "+D:"")+" number: "+B);N.s=null}N.c=N.e=null}})();function G(b,R,S,k){var M,N,B,x,D,V,F,z=b.c,oe=h;if(z){e:{for(M=1,x=z[0];x>=10;x/=10,M++);if(N=R-M,N<0)N+=u,B=R,D=z[V=0],F=o(D/oe[M-B-1]%10);else if(V=i((N+1)/u),V>=z.length)if(k){for(;z.length<=V;z.push(0));D=F=0,M=1,N%=u,B=N-u+1}else break e;else{for(D=x=z[V],M=1;x>=10;x/=10,M++);N%=u,B=N-u+M,F=B<0?0:o(D/oe[M-B-1]%10)}if(k=k||R<0||z[V+1]!=null||(B<0?D:D%oe[M-B-1]),k=S<4?(F||k)&&(S==0||S==(b.s<0?3:2)):F>5||F==5&&(S==4||k||S==6&&(N>0?B>0?D/oe[M-B]:0:z[V-1])%10&1||S==(b.s<0?8:7)),R<1||!z[0])return z.length=0,k?(R-=b.e+1,z[0]=oe[(u-R%u)%u],b.e=-R||0):z[0]=b.e=0,b;if(N==0?(z.length=V,x=1,V--):(z.length=V+1,x=oe[u-N],z[V]=B>0?o(D/oe[M-B]%oe[B])*x:0),k)for(;;)if(V==0){for(N=1,B=z[0];B>=10;B/=10,N++);for(B=z[0]+=x,x=1;B>=10;B/=10,x++);N!=x&&(b.e++,z[0]==l&&(z[0]=1));break}else{if(z[V]+=x,z[V]!=l)break;z[V--]=0,x=1}for(N=z.length;z[--N]===0;z.pop());}b.e>be?b.c=b.e=null:b.e<pt&&(b.c=[b.e=0])}return b}function K(b){var R,S=b.e;return S===null?b.toString():(R=y(b.c),R=S<=te||S>=ue?A(R,S):L(R,S,"0"),b.s<0?"-"+R:R)}return W.absoluteValue=W.abs=function(){var b=new p(this);return b.s<0&&(b.s=1),b},W.comparedTo=function(b,R){return E(this,new p(b,R))},W.decimalPlaces=W.dp=function(b,R){var S,k,M,N=this;if(b!=null)return v(b,0,f),R==null?R=se:v(R,0,8),G(new p(N),b+N.e+1,R);if(!(S=N.c))return null;if(k=((M=S.length-1)-C(this.e/u))*u,M=S[M])for(;M%10==0;M/=10,k--);return k<0&&(k=0),k},W.dividedBy=W.div=function(b,R){return P(this,new p(b,R),J,se)},W.dividedToIntegerBy=W.idiv=function(b,R){return P(this,new p(b,R),0,1)},W.exponentiatedBy=W.pow=function(b,R){var S,k,M,N,B,x,D,V,F,z=this;if(b=new p(b),b.c&&!b.isInteger())throw Error(s+"Exponent not an integer: "+K(b));if(R!=null&&(R=new p(R)),x=b.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!b.c||!b.c[0])return F=new p(Math.pow(+K(z),x?b.s*(2-_(b)):+K(b))),R?F.mod(R):F;if(D=b.s<0,R){if(R.c?!R.c[0]:!R.s)return new p(NaN);k=!D&&z.isInteger()&&R.isInteger(),k&&(z=z.mod(R))}else{if(b.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||x&&z.c[1]>=24e7:z.c[0]<8e13||x&&z.c[0]<=9999975e7)))return N=z.s<0&&_(b)?-0:0,z.e>-1&&(N=1/N),new p(D?1/N:N);mn&&(N=i(mn/u+2))}for(x?(S=new p(.5),D&&(b.s=1),V=_(b)):(M=Math.abs(+K(b)),V=M%2),F=new p(Z);;){if(V){if(F=F.times(z),!F.c)break;N?F.c.length>N&&(F.c.length=N):k&&(F=F.mod(R))}if(M){if(M=o(M/2),M===0)break;V=M%2}else if(b=b.times(S),G(b,b.e+1,1),b.e>14)V=_(b);else{if(M=+K(b),M===0)break;V=M%2}z=z.times(z),N?z.c&&z.c.length>N&&(z.c.length=N):k&&(z=z.mod(R))}return k?F:(D&&(F=Z.div(F)),R?F.mod(R):N?G(F,mn,se,B):F)},W.integerValue=function(b){var R=new p(this);return b==null?b=se:v(b,0,8),G(R,R.e+1,b)},W.isEqualTo=W.eq=function(b,R){return E(this,new p(b,R))===0},W.isFinite=function(){return!!this.c},W.isGreaterThan=W.gt=function(b,R){return E(this,new p(b,R))>0},W.isGreaterThanOrEqualTo=W.gte=function(b,R){return(R=E(this,new p(b,R)))===1||R===0},W.isInteger=function(){return!!this.c&&C(this.e/u)>this.c.length-2},W.isLessThan=W.lt=function(b,R){return E(this,new p(b,R))<0},W.isLessThanOrEqualTo=W.lte=function(b,R){return(R=E(this,new p(b,R)))===-1||R===0},W.isNaN=function(){return!this.s},W.isNegative=function(){return this.s<0},W.isPositive=function(){return this.s>0},W.isZero=function(){return!!this.c&&this.c[0]==0},W.minus=function(b,R){var S,k,M,N,B=this,x=B.s;if(b=new p(b,R),R=b.s,!x||!R)return new p(NaN);if(x!=R)return b.s=-R,B.plus(b);var D=B.e/u,V=b.e/u,F=B.c,z=b.c;if(!D||!V){if(!F||!z)return F?(b.s=-R,b):new p(z?B:NaN);if(!F[0]||!z[0])return z[0]?(b.s=-R,b):new p(F[0]?B:se==3?-0:0)}if(D=C(D),V=C(V),F=F.slice(),x=D-V){for((N=x<0)?(x=-x,M=F):(V=D,M=z),M.reverse(),R=x;R--;M.push(0));M.reverse()}else for(k=(N=(x=F.length)<(R=z.length))?x:R,x=R=0;R<k;R++)if(F[R]!=z[R]){N=F[R]<z[R];break}if(N&&(M=F,F=z,z=M,b.s=-b.s),R=(k=z.length)-(S=F.length),R>0)for(;R--;F[S++]=0);for(R=l-1;k>x;){if(F[--k]<z[k]){for(S=k;S&&!F[--S];F[S]=R);--F[S],F[k]+=l}F[k]-=z[k]}for(;F[0]==0;F.splice(0,1),--V);return F[0]?j(b,F,V):(b.s=se==3?-1:1,b.c=[b.e=0],b)},W.modulo=W.mod=function(b,R){var S,k,M=this;return b=new p(b,R),!M.c||!b.s||b.c&&!b.c[0]?new p(NaN):!b.c||M.c&&!M.c[0]?new p(M):(wt==9?(k=b.s,b.s=1,S=P(M,b,0,3),b.s=k,S.s*=k):S=P(M,b,0,wt),b=M.minus(S.times(b)),!b.c[0]&&wt==1&&(b.s=M.s),b)},W.multipliedBy=W.times=function(b,R){var S,k,M,N,B,x,D,V,F,z,oe,ce,Re,Ne,We,Se=this,Le=Se.c,vt=(b=new p(b,R)).c;if(!Le||!vt||!Le[0]||!vt[0])return!Se.s||!b.s||Le&&!Le[0]&&!vt||vt&&!vt[0]&&!Le?b.c=b.e=b.s=null:(b.s*=Se.s,!Le||!vt?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(k=C(Se.e/u)+C(b.e/u),b.s*=Se.s,D=Le.length,z=vt.length,D<z&&(Re=Le,Le=vt,vt=Re,M=D,D=z,z=M),M=D+z,Re=[];M--;Re.push(0));for(Ne=l,We=d,M=z;--M>=0;){for(S=0,oe=vt[M]%We,ce=vt[M]/We|0,B=D,N=M+B;N>M;)V=Le[--B]%We,F=Le[B]/We|0,x=ce*V+F*oe,V=oe*V+x%We*We+Re[N]+S,S=(V/Ne|0)+(x/We|0)+ce*F,Re[N--]=V%Ne;Re[N]=S}return S?++k:Re.splice(0,1),j(b,Re,k)},W.negated=function(){var b=new p(this);return b.s=-b.s||null,b},W.plus=function(b,R){var S,k=this,M=k.s;if(b=new p(b,R),R=b.s,!M||!R)return new p(NaN);if(M!=R)return b.s=-R,k.minus(b);var N=k.e/u,B=b.e/u,x=k.c,D=b.c;if(!N||!B){if(!x||!D)return new p(M/0);if(!x[0]||!D[0])return D[0]?b:new p(x[0]?k:M*0)}if(N=C(N),B=C(B),x=x.slice(),M=N-B){for(M>0?(B=N,S=D):(M=-M,S=x),S.reverse();M--;S.push(0));S.reverse()}for(M=x.length,R=D.length,M-R<0&&(S=D,D=x,x=S,R=M),M=0;R;)M=(x[--R]=x[R]+D[R]+M)/l|0,x[R]=l===x[R]?0:x[R]%l;return M&&(x=[M].concat(x),++B),j(b,x,B)},W.precision=W.sd=function(b,R){var S,k,M,N=this;if(b!=null&&b!==!!b)return v(b,1,f),R==null?R=se:v(R,0,8),G(new p(N),b,R);if(!(S=N.c))return null;if(M=S.length-1,k=M*u+1,M=S[M]){for(;M%10==0;M/=10,k--);for(M=S[0];M>=10;M/=10,k++);}return b&&N.e+1>k&&(k=N.e+1),k},W.shiftedBy=function(b){return v(b,-c,c),this.times("1e"+b)},W.squareRoot=W.sqrt=function(){var b,R,S,k,M,N=this,B=N.c,x=N.s,D=N.e,V=J+4,F=new p("0.5");if(x!==1||!B||!B[0])return new p(!x||x<0&&(!B||B[0])?NaN:B?N:1/0);if(x=Math.sqrt(+K(N)),x==0||x==1/0?(R=y(B),(R.length+D)%2==0&&(R+="0"),x=Math.sqrt(+R),D=C((D+1)/2)-(D<0||D%2),x==1/0?R="5e"+D:(R=x.toExponential(),R=R.slice(0,R.indexOf("e")+1)+D),S=new p(R)):S=new p(x+""),S.c[0]){for(D=S.e,x=D+V,x<3&&(x=0);;)if(M=S,S=F.times(M.plus(P(N,M,V,1))),y(M.c).slice(0,x)===(R=y(S.c)).slice(0,x))if(S.e<D&&--x,R=R.slice(x-3,x+1),R=="9999"||!k&&R=="4999"){if(!k&&(G(M,M.e+J+2,0),M.times(M).eq(N))){S=M;break}V+=4,x+=4,k=1}else{(!+R||!+R.slice(1)&&R.charAt(0)=="5")&&(G(S,S.e+J+2,1),b=!S.times(S).eq(N));break}}return G(S,S.e+J+1,se,b)},W.toExponential=function(b,R){return b!=null&&(v(b,0,f),b++),O(this,b,R,1)},W.toFixed=function(b,R){return b!=null&&(v(b,0,f),b=b+this.e+1),O(this,b,R)},W.toFormat=function(b,R,S){var k,M=this;if(S==null)b!=null&&R&&typeof R=="object"?(S=R,R=null):b&&typeof b=="object"?(S=b,b=R=null):S=et;else if(typeof S!="object")throw Error(s+"Argument not an object: "+S);if(k=M.toFixed(b,R),M.c){var N,B=k.split("."),x=+S.groupSize,D=+S.secondaryGroupSize,V=S.groupSeparator||"",F=B[0],z=B[1],oe=M.s<0,ce=oe?F.slice(1):F,Re=ce.length;if(D&&(N=x,x=D,D=N,Re-=N),x>0&&Re>0){for(N=Re%x||x,F=ce.substr(0,N);N<Re;N+=x)F+=V+ce.substr(N,x);D>0&&(F+=V+ce.slice(N)),oe&&(F="-"+F)}k=z?F+(S.decimalSeparator||"")+((D=+S.fractionGroupSize)?z.replace(new RegExp("\\d{"+D+"}\\B","g"),"$&"+(S.fractionGroupSeparator||"")):z):F}return(S.prefix||"")+k+(S.suffix||"")},W.toFraction=function(b){var R,S,k,M,N,B,x,D,V,F,z,oe,ce=this,Re=ce.c;if(b!=null&&(x=new p(b),!x.isInteger()&&(x.c||x.s!==1)||x.lt(Z)))throw Error(s+"Argument "+(x.isInteger()?"out of range: ":"not an integer: ")+K(x));if(!Re)return new p(ce);for(R=new p(Z),V=S=new p(Z),k=D=new p(Z),oe=y(Re),N=R.e=oe.length-ce.e-1,R.c[0]=h[(B=N%u)<0?u+B:B],b=!b||x.comparedTo(R)>0?N>0?R:V:x,B=be,be=1/0,x=new p(oe),D.c[0]=0;F=P(x,R,0,1),M=S.plus(F.times(k)),M.comparedTo(b)!=1;)S=k,k=M,V=D.plus(F.times(M=V)),D=M,R=x.minus(F.times(M=R)),x=M;return M=P(b.minus(S),k,0,1),D=D.plus(M.times(V)),S=S.plus(M.times(k)),D.s=V.s=ce.s,N=N*2,z=P(V,k,N,se).minus(ce).abs().comparedTo(P(D,S,N,se).minus(ce).abs())<1?[V,k]:[D,S],be=B,z},W.toNumber=function(){return+K(this)},W.toPrecision=function(b,R){return b!=null&&v(b,1,f),O(this,b,R,2)},W.toString=function(b){var R,S=this,k=S.s,M=S.e;return M===null?k?(R="Infinity",k<0&&(R="-"+R)):R="NaN":(b==null?R=M<=te||M>=ue?A(y(S.c),M):L(y(S.c),M,"0"):b===10&&w?(S=G(new p(S),J+M+1,se),R=L(y(S.c),S.e,"0")):(v(b,2,g.length,"Base"),R=Y(L(y(S.c),M,"0"),10,b,k,!0)),k<0&&S.c[0]&&(R="-"+R)),R},W.valueOf=W.toJSON=function(){return K(this)},W._isBigNumber=!0,T!=null&&p.set(T),p}function C(T){var P=T|0;return T>0||T===P?P:P-1}function y(T){for(var P,Y,U=1,W=T.length,Z=T[0]+"";U<W;){for(P=T[U++]+"",Y=u-P.length;Y--;P="0"+P);Z+=P}for(W=Z.length;Z.charCodeAt(--W)===48;);return Z.slice(0,W+1||1)}function E(T,P){var Y,U,W=T.c,Z=P.c,J=T.s,se=P.s,te=T.e,ue=P.e;if(!J||!se)return null;if(Y=W&&!W[0],U=Z&&!Z[0],Y||U)return Y?U?0:-se:J;if(J!=se)return J;if(Y=J<0,U=te==ue,!W||!Z)return U?0:!W^Y?1:-1;if(!U)return te>ue^Y?1:-1;for(se=(te=W.length)<(ue=Z.length)?te:ue,J=0;J<se;J++)if(W[J]!=Z[J])return W[J]>Z[J]^Y?1:-1;return te==ue?0:te>ue^Y?1:-1}function v(T,P,Y,U){if(T<P||T>Y||T!==o(T))throw Error(s+(U||"Argument")+(typeof T=="number"?T<P||T>Y?" out of range: ":" not an integer: ":" not a primitive number: ")+String(T))}function _(T){var P=T.c.length-1;return C(T.e/u)==P&&T.c[P]%2!=0}function A(T,P){return(T.length>1?T.charAt(0)+"."+T.slice(1):T)+(P<0?"e":"e+")+P}function L(T,P,Y){var U,W;if(P<0){for(W=Y+".";++P;W+=Y);T=W+T}else if(U=T.length,++P>U){for(W=Y,P-=U;--P;W+=Y);T+=W}else P<U&&(T=T.slice(0,P)+"."+T.slice(P));return T}n=m(),n.default=n.BigNumber=n,t.exports?t.exports=n:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=n)})(T9)})(Ik);var Pk=Ik.exports;/*!
188
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
189
+ *
190
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
191
+ * of this software and associated documentation files (the "Software"), to deal
192
+ * in the Software without restriction, including without limitation the rights
193
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
194
+ * copies of the Software, and to permit persons to whom the Software is
195
+ * furnished to do so, subject to the following conditions:
196
+ *
197
+ * The above copyright notice and this permission notice shall be included in
198
+ * all copies or substantial portions of the Software.
199
+ *
200
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
201
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
202
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
203
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
204
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
205
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
206
+ * SOFTWARE.
207
+ */const fi=G0(),G9=z0(),q9=Y0,K9=Pk,bn={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},_d={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:Ok,decimalSuffixes:sm}=fi.currentBytes(),q0={general:{scale:1024,suffixes:sm},binary:{scale:1024,suffixes:Ok},decimal:{scale:1e3,suffixes:sm}};function X9(t,e={},n){if(typeof e=="string"&&(e=q9.parseFormat(e)),!G9.validateFormat(e))return"ERROR: invalid format";let i=e.prefix||"",o=e.postfix||"",s=Z9(t,e,n);return s=p6(s,i),s=w6(s,o),s}function Z9(t,e,n){switch(e.output){case"currency":return e=du(e,fi.currentCurrencyDefaultFormat()),o6(t,e,fi);case"percent":return e=du(e,fi.currentPercentageDefaultFormat()),i6(t,e,fi,n);case"byte":return e=du(e,fi.currentByteDefaultFormat()),t6(t,e,fi,n);case"time":return e=du(e,fi.currentTimeDefaultFormat()),r6(t);case"ordinal":return e=du(e,fi.currentOrdinalDefaultFormat()),n6(t,e,fi);case"number":default:return Md({instance:t,providedFormat:e})}}function Q9(t){let e=q0.decimal;return vp(t._value,e.suffixes,e.scale).suffix}function J9(t){let e=q0.binary;return vp(t._value,e.suffixes,e.scale).suffix}function e6(t){let e=q0.general;return vp(t._value,e.suffixes,e.scale).suffix}function vp(t,e,n){let r=e[0],i=Math.abs(t);if(i>=n){for(let o=1;o<e.length;++o){let s=Math.pow(n,o),a=Math.pow(n,o+1);if(i>=s&&i<a){r=e[o],t=t/s;break}}r===e[0]&&(t=t/Math.pow(n,e.length-1),r=e[e.length-1])}return{value:t,suffix:r}}function t6(t,e,n,r){let i=e.base||"binary",o=Object.assign({},_d,e);const{binarySuffixes:s,decimalSuffixes:a}=n.currentBytes();let u={general:{scale:1024,suffixes:a||sm,marker:"bd"},binary:{scale:1024,suffixes:s||Ok,marker:"b"},decimal:{scale:1e3,suffixes:a||sm,marker:"d"}}[i],{value:c,suffix:h}=vp(t._value,u.suffixes,u.scale);return`${Md({instance:r(c),providedFormat:e,state:n,defaults:n.currentByteDefaultFormat()})}${o.spaceSeparated?" ":""}${h}`}function n6(t,e,n){let r=n.currentOrdinal(),i=Object.assign({},_d,e),o=Md({instance:t,providedFormat:e,state:n}),s=r(t._value);return`${o}${i.spaceSeparated?" ":""}${s}`}function r6(t){let e=Math.floor(t._value/60/60),n=Math.floor((t._value-e*60*60)/60),r=Math.round(t._value-e*60*60-n*60);return`${e}:${n<10?"0":""}${n}:${r<10?"0":""}${r}`}function i6(t,e,n,r){let i=e.prefixSymbol,o=Md({instance:r(t._value*100),providedFormat:e,state:n}),s=Object.assign({},_d,e);return i?`%${s.spaceSeparated?" ":""}${o}`:`${o}${s.spaceSeparated?" ":""}%`}function o6(t,e,n){const r=n.currentCurrency();let i=Object.assign({},e),o=Object.assign({},_d,i),s,a="",l=!!o.totalLength||!!o.forceAverage||o.average,u=i.currencyPosition||r.position,c=i.currencySymbol||r.symbol;const h=o.spaceSeparatedCurrency!==void 0?o.spaceSeparatedCurrency:o.spaceSeparated;i.lowPrecision===void 0&&(i.lowPrecision=!1),h&&(a=" "),u==="infix"&&(s=a+c+a);let d=Md({instance:t,providedFormat:i,state:n,decimalSeparator:s});return u==="prefix"&&(t._value<0&&o.negative==="sign"?d=`-${a}${c}${d.slice(1)}`:t._value>0&&o.forceSign?d=`+${a}${c}${d.slice(1)}`:d=c+a+d),(!u||u==="postfix")&&(a=!o.spaceSeparatedAbbreviation&&l?"":a,d=d+a+c),d}function s6({value:t,forceAverage:e,lowPrecision:n=!0,abbreviations:r,spaceSeparated:i=!1,totalLength:o=0,roundingFunction:s=Math.round}){let a="",l=Math.abs(t),u=-1;if(e&&r[e]&&bn[e]?(a=r[e],t=t/bn[e]):l>=bn.trillion||n&&s(l/bn.trillion)===1?(a=r.trillion,t=t/bn.trillion):l<bn.trillion&&l>=bn.billion||n&&s(l/bn.billion)===1?(a=r.billion,t=t/bn.billion):l<bn.billion&&l>=bn.million||n&&s(l/bn.million)===1?(a=r.million,t=t/bn.million):(l<bn.million&&l>=bn.thousand||n&&s(l/bn.thousand)===1)&&(a=r.thousand,t=t/bn.thousand),a&&(a=(i?" ":"")+a),o){let h=t<0,d=t.toString().split(".")[0],f=h?d.length-1:d.length;u=Math.max(o-f,0)}return{value:t,abbreviation:a,mantissaPrecision:u}}function a6({value:t,characteristicPrecision:e}){let[n,r]=t.toExponential().split("e"),i=+n;if(!e)return{value:i,abbreviation:`e${r}`};let o=1;return o<e&&(i=i*Math.pow(10,e-o),r=+r-(e-o),r=r>=0?`+${r}`:r),{value:i,abbreviation:`e${r}`}}function yf(t){let e="";for(let n=0;n<t;n++)e+="0";return e}function l6(t,e){let n=t.toString(),[r,i]=n.split("e"),[o,s=""]=r.split(".");if(+i>0)n=o+s+yf(i-s.length);else{let a=".";+o<0?a=`-0${a}`:a=`0${a}`;let l=(yf(-i-1)+Math.abs(o)+s).substr(0,e);l.length<e&&(l+=yf(e-l.length)),n=a+l}return+i>0&&e>0&&(n+=`.${yf(e)}`),n}function u6(t,e,n=Math.round){return t.toString().indexOf("e")!==-1?l6(t,e):new K9(n(+`${t}e+${e}`)/Math.pow(10,e)).toFixed(e)}function c6(t,e,n,r,i,o){if(r===-1)return t;let s=u6(e,r,o),[a,l=""]=s.toString().split(".");if(l.match(/^0+$/)&&(n||i))return a;let u=l.match(/0+$/);return i&&u?`${a}.${l.toString().slice(0,u.index)}`:s.toString()}function h6(t,e,n,r){let i=t,[o,s]=i.toString().split(".");if(o.match(/^-?0$/)&&n)return s?`${o.replace("0","")}.${s}`:o.replace("0","");const a=e<0&&o.indexOf("-")===0;if(a&&(o=o.slice(1),i=i.slice(1)),o.length<r){let l=r-o.length;for(let u=0;u<l;u++)i=`0${i}`}return a&&(i=`-${i}`),i.toString()}function d6(t,e){let n=[],r=0;for(let i=t;i>0;i--)r===e&&(n.unshift(i),r=0),r++;return n}function f6(t,e,n,r,i){let o=r.currentDelimiters(),s=o.thousands;i=i||o.decimal;let a=o.thousandsSize||3,l=t.toString(),u=l.split(".")[0],c=l.split(".")[1];const h=e<0&&u.indexOf("-")===0;return n&&(h&&(u=u.slice(1)),d6(u.length,a).forEach((f,m)=>{u=u.slice(0,f+m)+s+u.slice(f+m)}),h&&(u=`-${u}`)),c?l=u+i+c:l=u,l}function g6(t,e){return t+e}function m6(t,e,n){return e===0?t:+t==0?t.replace("-",""):e>0?`+${t}`:n==="sign"?t:`(${t.replace("-","")})`}function p6(t,e){return e+t}function w6(t,e){return t+e}function Md({instance:t,providedFormat:e,state:n=fi,decimalSeparator:r,defaults:i=n.currentDefaults()}){let o=t._value;if(o===0&&n.hasZeroFormat())return n.getZeroFormat();if(!isFinite(o))return o.toString();let s=Object.assign({},_d,i,e),a=s.totalLength,l=a?0:s.characteristic,u=s.optionalCharacteristic,c=s.forceAverage,h=s.lowPrecision,d=!!a||!!c||s.average,f=a?-1:d&&e.mantissa===void 0?0:s.mantissa,m=a?!1:e.optionalMantissa===void 0?f===-1:s.optionalMantissa,C=s.trimMantissa,y=s.thousandSeparated,E=s.spaceSeparated,v=s.negative,_=s.forceSign,A=s.exponential,L=s.roundingFunction,T="";if(d){let Y=s6({value:o,forceAverage:c,lowPrecision:h,abbreviations:n.currentAbbreviations(),spaceSeparated:E,roundingFunction:L,totalLength:a});o=Y.value,T+=Y.abbreviation,a&&(f=Y.mantissaPrecision)}if(A){let Y=a6({value:o,characteristicPrecision:l});o=Y.value,T=Y.abbreviation+T}let P=c6(o.toString(),o,m,f,C,L);return P=h6(P,o,u,l),P=f6(P,o,y,n,r),(d||A)&&(P=g6(P,T)),(_||o<0)&&(P=m6(P,o,v)),P}function du(t,e){if(!t)return e;let n=Object.keys(t);return n.length===1&&n[0]==="output"?e:t}var v6=t=>({format:(...e)=>X9(...e,t),getByteUnit:(...e)=>e6(...e,t),getBinaryByteUnit:(...e)=>J9(...e,t),getDecimalByteUnit:(...e)=>Q9(...e,t),formatOrDefault:du});/*!
208
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
209
+ *
210
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
211
+ * of this software and associated documentation files (the "Software"), to deal
212
+ * in the Software without restriction, including without limitation the rights
213
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
214
+ * copies of the Software, and to permit persons to whom the Software is
215
+ * furnished to do so, subject to the following conditions:
216
+ *
217
+ * The above copyright notice and this permission notice shall be included in
218
+ * all copies or substantial portions of the Software.
219
+ *
220
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
221
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
222
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
223
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
224
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
225
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
226
+ * SOFTWARE.
227
+ */const ns=Pk;function C6(t,e,n){let r=new ns(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new ns(i),t._value=r.plus(i).toNumber(),t}function xk(t,e,n){let r=new ns(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new ns(i),t._value=r.minus(i).toNumber(),t}function y6(t,e,n){let r=new ns(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new ns(i),t._value=r.times(i).toNumber(),t}function b6(t,e,n){let r=new ns(t._value),i=e;return n.isNumbro(e)&&(i=e._value),i=new ns(i),t._value=r.dividedBy(i).toNumber(),t}function S6(t,e,n){let r=e;return n.isNumbro(e)&&(r=e._value),t._value=r,t}function R6(t,e,n){let r=n(t._value);return xk(r,e,n),Math.abs(r._value)}var E6=t=>({add:(e,n)=>C6(e,n,t),subtract:(e,n)=>xk(e,n,t),multiply:(e,n)=>y6(e,n,t),divide:(e,n)=>b6(e,n,t),set:(e,n)=>S6(e,n,t),difference:(e,n)=>R6(e,n,t),BigNumber:ns});/*!
228
+ * Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
229
+ *
230
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
231
+ * of this software and associated documentation files (the "Software"), to deal
232
+ * in the Software without restriction, including without limitation the rights
233
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
234
+ * copies of the Software, and to permit persons to whom the Software is
235
+ * furnished to do so, subject to the following conditions:
236
+ *
237
+ * The above copyright notice and this permission notice shall be included in
238
+ * all copies or substantial portions of the Software.
239
+ *
240
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
241
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
242
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
243
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
244
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
245
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
246
+ * SOFTWARE.
247
+ */const T6="2.5.0",go=G0(),_6=z0(),M6=Y9(zt),I6=Mk();let fa=v6(zt),Ba=E6(zt);const P6=Y0;class Ak{constructor(e){this._value=e}clone(){return zt(this._value)}format(e={}){return fa.format(this,e)}formatCurrency(e){return typeof e=="string"&&(e=P6.parseFormat(e)),e=fa.formatOrDefault(e,go.currentCurrencyDefaultFormat()),e.output="currency",fa.format(this,e)}formatTime(e={}){return e.output="time",fa.format(this,e)}binaryByteUnits(){return fa.getBinaryByteUnit(this)}decimalByteUnits(){return fa.getDecimalByteUnit(this)}byteUnits(){return fa.getByteUnit(this)}difference(e){return Ba.difference(this,e)}add(e){return Ba.add(this,e)}subtract(e){return Ba.subtract(this,e)}multiply(e){return Ba.multiply(this,e)}divide(e){return Ba.divide(this,e)}set(e){return Ba.set(this,Hk(e))}value(){return this._value}valueOf(){return this._value}}function Hk(t){let e=t;return zt.isNumbro(t)?e=t._value:typeof t=="string"?e=zt.unformat(t):isNaN(t)&&(e=NaN),e}function zt(t){return new Ak(Hk(t))}zt.version=T6;zt.isNumbro=function(t){return t instanceof Ak};zt.language=go.currentLanguage;zt.registerLanguage=go.registerLanguage;zt.setLanguage=go.setLanguage;zt.languages=go.languages;zt.languageData=go.languageData;zt.zeroFormat=go.setZeroFormat;zt.defaultFormat=go.currentDefaults;zt.setDefaults=go.setDefaults;zt.defaultCurrencyFormat=go.currentCurrencyDefaultFormat;zt.validate=_6.validate;zt.loadLanguagesInNode=M6.loadLanguagesInNode;zt.unformat=I6.unformat;zt.BigNumber=Ba.BigNumber;var O6=zt,ga=_9(O6);const x6="numeric";function Nk(t,e){if(Un(t)){const n=e.numericFormat,r=n&&n.culture||"-",i=n&&n.pattern;if(typeof r<"u"&&!ga.languages()[r]){const o=r.replace("-",""),s=ga.allLanguages?ga.allLanguages[r]:ga[o];s&&ga.registerLanguage(s)}ga.setLanguage(r),t=ga(t).format(i||"0")}return t}function K0(t,e,n,r,i,o,s){let a=o;if(Un(a)){let u=[];if(Array.isArray(s.className))u=s.className;else{var l;const c=(l=s.className)!==null&&l!==void 0?l:"";c.length&&(u=c.split(" "))}a=Nk(a,s),u.indexOf("htLeft")<0&&u.indexOf("htCenter")<0&&u.indexOf("htRight")<0&&u.indexOf("htJustify")<0&&u.push("htRight"),u.indexOf("htNumeric")<0&&u.push("htNumeric"),s.className=u.join(" "),e.dir="ltr"}us(t,e,n,r,i,a,s)}K0.RENDERER_TYPE=x6;const A6="password";function X0(t,e,n,r,i,o,s){us.apply(this,[t,e,n,r,i,o,s]);const a=s.hashLength||e.innerHTML.length,l=s.hashSymbol||"*";let u="";de(a-1,()=>{u+=l}),Xu(e,u)}X0.RENDERER_TYPE=A6;const H6="select";function Z0(t,e,n,r,i,o,s){us.apply(this,[t,e,n,r,i,o,s])}Z0.RENDERER_TYPE=H6;const N6="time";function Q0(t,e,n,r,i,o,s){us.apply(this,[t,e,n,r,i,o,s]),e.dir="ltr"}Q0.RENDERER_TYPE=N6;function D6(){Lr(ec),Lr(Td),Lr(B0),Lr(W0),Lr(U0),Lr(V0),Lr(K0),Lr(X0),Lr(Z0),Lr(us),Lr(Q0)}const k6="autocomplete";function Cp(t,e){let n=t;if(n==null&&(n=""),this.allowEmpty&&n===""){e(!0);return}this.strict&&this.source?typeof this.source=="function"?this.source(n,Jx(n,e)):Jx(n,e)(this.source):e(!0)}Cp.VALIDATOR_TYPE=k6;function Jx(t,e){const n=t;return function(r){let i=!1;for(let o=0,s=r.length;o<s;o++)if(n===r[o]){i=!0;break}e(i)}}function L6(t){const e=new Date(t);return isNaN(new Date(`${t}T00:00`).getDate())?e:new Date(e.getTime()+e.getTimezoneOffset()*6e4)}const $6="date";function J0(t,e){const n=rD(Ck,this.instance);let r=t,i=!0;r==null&&(r="");let o=X(r,this.dateFormat||n.defaultDateFormat,!0).isValid(),s=X(new Date(r)).isValid()||o;if(this.allowEmpty&&r===""&&(s=!0,o=!0),s||(i=!1),!s&&o&&(i=!0),s&&!o)if(this.correctFormat===!0){const a=F6(r,this.dateFormat);this.instance.setDataAtCell(this.visualRow,this.visualCol,a,"dateValidator"),i=!0}else i=!1;e(i)}J0.VALIDATOR_TYPE=$6;function F6(t,e){const n=X(L6(t)),r=X(t,e),i=t.search(/[A-Za-z]/g)>-1;let o;return n.isValid()&&n.format("x")===r.format("x")||!r.isValid()||i?o=n:o=r,o.format(e)}const V6="dropdown";function eT(t,e){Cp.apply(this,[t,e])}eT.VALIDATOR_TYPE=V6;const W6="numeric";function tT(t,e){let n=t;n==null&&(n=""),this.allowEmpty&&n===""?e(!0):e(n===""?!1:Un(t))}tT.VALIDATOR_TYPE=W6;const B6=["YYYY-MM-DDTHH:mm:ss.SSSZ","X","x"],j6="time";function nT(t,e){const n=this.timeFormat||"h:mm:ss a";let r=!0,i=t;i===null&&(i=""),i=/^\d{3,}$/.test(i)?parseInt(i,10):i;const o=/^\d{1,2}$/.test(i);o&&(i+=":00");const s=X(i,B6,!0).isValid()?X(i):X(i,n);let a=s.isValid(),l=X(i,n,!0).isValid()&&!o;if(this.allowEmpty&&i===""&&(a=!0,l=!0),a||(r=!1),!a&&l&&(r=!0),a&&!l)if(this.correctFormat===!0){const u=s.format(n);this.instance.setDataAtCell(this.visualRow,this.visualCol,u,"timeValidator"),r=!0}else r=!1;e(r)}nT.VALIDATOR_TYPE=j6;function U6(){hu(Cp),hu(eT),hu(J0),hu(tT),hu(nT)}const z6="autocomplete",Y6={CELL_TYPE:z6,editor:$0,renderer:ec,validator:Cp},G6="checkbox",q6={CELL_TYPE:G6,editor:vk,renderer:B0},K6="date";function Dk(t,e,n,r,i,o,s){ec.apply(this,[t,e,n,r,i,o,s])}Dk.RENDERER_TYPE=K6;const X6="date",Z6={CELL_TYPE:X6,editor:yk,renderer:Dk,validator:J0},Q6="dropdown",J6={CELL_TYPE:Q6,editor:bk,renderer:W0,validator:eT,filter:!1,strict:!0},e8="handsontable",t8={CELL_TYPE:e8,editor:L0,renderer:U0},n8="numeric",r8={CELL_TYPE:n8,editor:Sk,renderer:K0,validator:tT,dataType:"number"},i8="password",o8={CELL_TYPE:i8,editor:Rk,renderer:X0,copyable:!1},s8="select",a8={CELL_TYPE:s8,editor:Ek,renderer:Z0},l8="time",u8={CELL_TYPE:l8,editor:Tk,renderer:Q0,validator:nT};function c8(){ci(Y6),ci(q6),ci(Z6),ci(J6),ci(t8),ci(r8),ci(o8),ci(a8),ci(lk),ci(u8)}function h8(t,e){kk(t,e),e.add(t)}function d8(t,e,n){kk(t,e),e.set(t,n)}function kk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ll(t,e,n){return(e=f8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f8(t){var e=g8(t,"string");return typeof e=="symbol"?e:e+""}function g8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $l(t,e){return t.get(Lk(t,e))}function Lk(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const eA=new Map([["plugin",PY],["cell-type",QD],["editor",nD],["renderer",cD],["validator",hD]]),$k=Symbol("mainSetting"),m8="base",bf=[];let ma=null;var pa=new WeakMap,tA=new WeakSet;class Xe{static get PLUGIN_KEY(){return m8}static get SETTING_KEYS(){return[this.PLUGIN_KEY]}static get DEFAULT_SETTINGS(){return{}}constructor(e){h8(this,tA),Ll(this,"eventManager",new _i(this)),Ll(this,"pluginName",null),Ll(this,"pluginsInitializedCallbacks",[]),Ll(this,"isPluginsReady",!1),Ll(this,"enabled",!1),Ll(this,"initialized",!1),d8(this,pa,{}),as(this,"hot",e,{writable:!1}),ma=null,this.hot.addHook("afterPluginsInitialized",()=>this.onAfterPluginsInitialized()),this.hot.addHook("afterUpdateSettings",n=>this.onUpdateSettings(n)),this.hot.addHook("beforeInit",()=>this.init())}init(){this.pluginName=this.hot.getPluginName(this);const e=this.constructor.PLUGIN_DEPS,n=Array.isArray(e)?e:[];if(n.length>0){const i=[];if(n.forEach(o=>{const[s,a]=o.split(":");if(!eA.has(s))throw new Error(`Unknown plugin dependency type "${s}" was found.`);eA.get(s)(a)||i.push(` - ${a} (${s})`)}),i.length>0){const o=[`The ${this.pluginName} plugin requires the following modules:
248
+ `,`${i.join(`
249
+ `)}
250
+ `].join("");bf.push(o)}}if(ma||(ma=uD()),ma.indexOf(this.pluginName)>=0&&ma.splice(ma.indexOf(this.pluginName),1),this.hot.addHookOnce("afterPluginsInitialized",()=>{this.isEnabled&&this.isEnabled()&&this.enablePlugin()}),ma.length===0){if(bf.length>0){const i=[`${bf.join(`
251
+ `)}
252
+ `,"You have to import and register them manually."].join("");throw bf.length=0,new Error(i)}this.hot.runHooks("afterPluginsInitialized")}this.initialized=!0}enablePlugin(){this.enabled=!0}disablePlugin(){var e;(e=this.eventManager)===null||e===void 0||e.clear(),this.clearHooks(),this.enabled=!1}getSetting(e){const n=this.hot.getSettings()[this.constructor.PLUGIN_KEY];if(e===void 0)return n;const r=this.constructor.DEFAULT_SETTINGS;if((Array.isArray(n)||Ae(n))&&r[$k]===e){var i;return Array.isArray(n)?n:(i=n[e])!==null&&i!==void 0?i:r[e]}if(Ae(n)){var o;return(o=n[e])!==null&&o!==void 0?o:r[e]}return r[e]}addHook(e,n,r){$l(pa,this)[e]=$l(pa,this)[e]||[];const i=$l(pa,this)[e];this.hot.addHook(e,n,r),i.push(n),$l(pa,this)[e]=i}removeHooks(e){I($l(pa,this)[e]||[],n=>{this.hot.removeHook(e,n)})}clearHooks(){const e=$l(pa,this);He(e,(n,r)=>this.removeHooks(r)),e.length=0}callOnPluginsReady(e){this.isPluginsReady?e():this.pluginsInitializedCallbacks.push(e)}onAfterPluginsInitialized(){I(this.pluginsInitializedCallbacks,e=>e()),this.pluginsInitializedCallbacks.length=0,this.isPluginsReady=!0}onUpdateSettings(e){const n=Lk(tA,this,p8).call(this,e);this.isEnabled&&(this.enabled&&!this.isEnabled()&&this.disablePlugin(),!this.enabled&&this.isEnabled()&&this.enablePlugin(),this.enabled&&this.isEnabled()&&n&&this.updatePlugin(e))}updatePlugin(){}destroy(){var e;(e=this.eventManager)===null||e===void 0||e.destroy(),this.clearHooks(),He(this,(n,r)=>{r!=="hot"&&(this[r]=null)}),delete this.t,delete this.hot}}function p8(t){if(!t)return!1;const e=this.constructor.SETTING_KEYS;if(typeof e=="boolean")return e;for(let n=0;n<e.length;n++)if(t[e[n]]!==void 0)return!0;return!1}function wa(t,e,n){return(e=w8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function w8(t){var e=v8(t,"string");return typeof e=="symbol"?e:e+""}function v8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}let Fk=class{constructor(e){wa(this,"hot",null),wa(this,"container",null),wa(this,"injected",!1),wa(this,"rows",[]),wa(this,"columns",[]),wa(this,"samples",null),wa(this,"settings",{useHeaders:!0}),this.hot=e}addRow(e,n){if(this.columns.length)throw new Error("Doesn't support multi-dimensional table");this.rows.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={row:e};this.rows.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol(e)),this.table.tr.appendChild(this.createRow(e)),e===0&&q(this.table.table,"htGhostTableFirstRow"),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}addColumnHeadersRow(e){const n=this.hot.getColHeader(0);if(n!=null){const r={row:-1};this.rows.push(r),this.container=this.createContainer(this.hot.rootElement.className),this.samples=e,this.table=this.createTable(this.hot.table.className),this.table.colGroup.appendChild(this.createColGroupsCol()),this.appendColumnHeadersRow(),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}}addColumn(e,n){if(this.rows.length)throw new Error("Doesn't support multi-dimensional table");this.columns.length||(this.container=this.createContainer(this.hot.rootElement.className));const r={col:e};this.columns.push(r),this.samples=n,this.table=this.createTable(this.hot.table.className),this.getSetting("useHeaders")&&this.hot.getColHeader(e)!==null&&this.hot.view.appendColHeader(e,this.table.th,void 0,-1),this.table.tBody.appendChild(this.createCol(e)),this.container.container.appendChild(this.table.fragment),r.table=this.table.table}getHeights(e){this.injected||this.injectTable(),I(this.rows,n=>{const{height:r}=n.table.getBoundingClientRect();e(n.row,Math.ceil(r))})}getWidths(e){this.injected||this.injectTable(),I(this.columns,n=>{const{width:r}=n.table.getBoundingClientRect();e(n.col,Math.ceil(r))})}setSettings(e){this.settings=e}setSetting(e,n){this.settings||(this.settings={}),this.settings[e]=n}getSettings(){return this.settings}getSetting(e){return this.settings?this.settings[e]:null}createColGroupsCol(e){const n=this.hot.rootDocument.createDocumentFragment();return this.hot.hasRowHeaders()&&n.appendChild(this.createColElement(-1,-1)),this.samples.forEach(r=>{I(r.strings,i=>{n.appendChild(this.createColElement(i.col,e))})}),n}createRow(e){const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("th");return this.hot.hasRowHeaders()&&(this.hot.view.appendRowHeader(e,i),r.appendChild(i)),this.samples.forEach(o=>{I(o.strings,s=>{const a=s.col,l=this.hot.getCellMeta(e,a),u=this.hot.getCellRenderer(l),c=n.createElement("td");c.setAttribute("ghost-table",1),u(this.hot,c,e,a,this.hot.colToProp(a),s.value,l),r.appendChild(c)})}),r}appendColumnHeadersRow(){const{rootDocument:e}=this.hot,n=e.createDocumentFragment(),r=[];if(this.hot.hasRowHeaders()){const i=e.createElement("th");r.push([-1,i]),n.appendChild(i)}this.samples.forEach(i=>{I(i.strings,o=>{const s=o.col,a=e.createElement("th");r.push([s,a]),n.appendChild(a)})}),this.table.tHead.appendChild(n),I(r,i=>{const[o,s]=i;this.hot.view.appendColHeader(o,s)})}createCol(e){const{rootDocument:n}=this.hot,r=n.createDocumentFragment();return this.samples.forEach(i=>{I(i.strings,o=>{const s=o.row,a=this.hot.getCellMeta(s,e),l=this.hot.getCellRenderer(a),u=n.createElement("td"),c=n.createElement("tr");u.setAttribute("ghost-table",1),l(this.hot,u,s,e,this.hot.colToProp(e),o.value,a),c.appendChild(u),r.appendChild(c)})}),r}clean(){this.rows.length=0,this.rows[-1]=void 0,this.columns.length=0,this.samples&&this.samples.clear(),this.samples=null,this.removeTable()}injectTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.injected||((e||this.hot.rootElement).appendChild(this.container.fragment),this.injected=!0)}removeTable(){this.injected&&this.container.container.parentNode&&(this.container.container.parentNode.removeChild(this.container.container),this.container=null,this.injected=!1)}createColElement(e,n){const r=this.hot.rootDocument.createElement("col");let i=0;n>=0&&e>=0&&(i=this.hot.getCellMeta(n,e).colspan);let o=this.hot.getColWidth(e);if(i>1)for(let s=e+1;s<e+i;s++)o+=this.hot.getColWidth(s);return r.style.width=`${o}px`,r}createTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("table"),o=n.createElement("thead"),s=n.createElement("tbody"),a=n.createElement("colgroup"),l=n.createElement("tr"),u=n.createElement("th");return this.isVertical()&&i.appendChild(a),this.isHorizontal()&&(l.appendChild(u),o.appendChild(l),i.style.tableLayout="auto",i.style.width="auto"),i.appendChild(o),this.isVertical()&&s.appendChild(l),i.appendChild(s),q(i,e),r.appendChild(i),{fragment:r,table:i,tHead:o,tBody:s,colGroup:a,tr:l,th:u}}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{rootDocument:n}=this.hot,r=n.createDocumentFragment(),i=n.createElement("div"),o=`htGhostTable htAutoSize ${e.trim()}`;return q(i,o),r.appendChild(i),{fragment:r,container:i}}isVertical(){return!!(this.rows.length&&!this.columns.length)}isHorizontal(){return!!(this.columns.length&&!this.rows.length)}};function Sf(t,e,n){return(e=C8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C8(t){var e=y8(t,"string");return typeof e=="symbol"?e:e+""}function y8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class yp{static get SAMPLE_COUNT(){return 3}constructor(e){Sf(this,"samples",null),Sf(this,"dataFactory",null),Sf(this,"customSampleCount",null),Sf(this,"allowDuplicates",!1),this.dataFactory=e}getSampleCount(){return this.customSampleCount?this.customSampleCount:yp.SAMPLE_COUNT}setSampleCount(e){this.customSampleCount=e}setAllowDuplicates(e){this.allowDuplicates=e}generateRowSamples(e,n){return this.generateSamples("row",n,e)}generateColumnSamples(e,n){return this.generateSamples("col",n,e)}generateSamples(e,n,r){const i=new Map,{from:o,to:s}=typeof r=="number"?{from:r,to:r}:r;return de(o,s,a=>{const l=this.generateSample(e,n,a);i.set(a,l)}),i}generateSample(e,n,r){if(e!=="row"&&e!=="col")throw new Error("Unsupported sample type");const i=new Map,o=e==="row"?"col":"row",s=[];return de(n.from,n.to,a=>{const l=e==="row"?this.dataFactory(r,a):this.dataFactory(a,r);if(l===!1)return;const{value:u,bundleSeed:c}=l,h=typeof c=="string"&&c.length>0;let d;h?d=c:Ae(u)?d=`${Object.keys(u).length}`:Array.isArray(u)?d=`${u.length}`:d=`${Pt(u).length}`,i.has(d)||i.set(d,{needed:this.getSampleCount(),strings:[]});const f=i.get(d);f.needed&&(!(s.indexOf(u)>-1)||this.allowDuplicates||h)&&(f.strings.push({value:u,[o]:a}),s.push(u),f.needed-=1)}),i}}function b8(t,e){Vk(t,e),e.add(t)}function Ey(t,e,n){Vk(t,e),e.set(t,n)}function Vk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xc(t,e,n){return(e=S8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function S8(t){var e=R8(t,"string");return typeof e=="symbol"?e:e+""}function R8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $s(t,e){return t.get(lr(t,e))}function am(t,e,n){return t.set(lr(t,e),n),n}function lr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("modifyAutoColumnSizeSeed");const Ty="autoColumnSize",E8=10,T8="autoColumnSize";var rT=new WeakMap,fu=new WeakMap,Vu=new WeakMap,Sr=new WeakSet;class Rh extends Xe{static get PLUGIN_KEY(){return Ty}static get PLUGIN_PRIORITY(){return E8}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 50}constructor(e){super(e),b8(this,Sr),xc(this,"ghostTable",new Fk(this.hot)),xc(this,"samplesGenerator",new yp((n,r)=>{const i=this.hot.toPhysicalRow(n),o=this.hot.toPhysicalColumn(r);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o))return!1;const s=this.hot.getCellMeta(n,r);let a="";s.spanned||(a=this.hot.getDataAtCell(n,r));let l="";return this.hot.hasHook("modifyAutoColumnSizeSeed")&&(l=this.hot.runHooks("modifyAutoColumnSizeSeed",l,s,a)),{value:a,bundleSeed:l}})),xc(this,"inProgress",!1),xc(this,"measuredColumns",0),xc(this,"columnWidthsMap",new Qs),Ey(this,rT,!1),Ey(this,fu,[]),Ey(this,Vu,[]),this.hot.columnIndexMapper.registerMap(T8,this.columnWidthsMap),this.addHook("beforeColumnResize",(n,r,i)=>lr(Sr,this,nA).call(this,n,r,i))}isEnabled(){return this.hot.getSettings()[Ty]!==!1&&!this.hot.getSettings().colWidths}enablePlugin(){var e=this;if(this.enabled)return;this.ghostTable.setSetting("useHeaders",this.getSetting("useHeaders")),this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const n=this.getSetting("samplingRatio");n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return lr(Sr,e,I8).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return lr(Sr,e,P8).call(e,...i)}),this.addHook("afterFormulasValuesUpdate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return lr(Sr,e,x8).call(e,...i)}),this.addHook("beforeRender",()=>lr(Sr,this,M8).call(this)),this.addHook("modifyColWidth",(r,i)=>this.getColumnWidth(i,r)),this.addHook("init",()=>lr(Sr,this,O8).call(this)),super.enablePlugin()}updatePlugin(){am(Vu,this,this.findColumnsWhereHeaderWasChanged()),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.addHook("beforeColumnResize",(e,n,r)=>lr(Sr,this,nA).call(this,e,n,r))}calculateVisibleColumnsWidth(){if(!this.hot.countRows())return;const e=this.getFirstVisibleColumn(),n=this.getLastVisibleColumn();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateColumnsWidth({from:e,to:n},void 0,r)}calculateColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countRows()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;de(i.from,i.to,s=>{let a=this.hot.toPhysicalColumn(s);a===null&&(a=s),(r||this.columnWidthsMap.getValueAtIndex(a)===null&&!this.hot._getColWidthFromSettings(a))&&lr(Sr,this,Wk).call(this,s,o)}),this.ghostTable.columns.length&&(lr(Sr,this,Bk).call(this),this.measuredColumns=i.to+1,this.ghostTable.clean())}calculateAllColumnsWidth(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countCols()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){Zg(o),this.inProgress=!1;return}this.calculateColumnsWidth({from:r,to:Math.min(r+Rh.CALCULATION_STEP,i)},e,n),r=r+Rh.CALCULATION_STEP+1,r<i?o=Xg(s):(Zg(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateColumnsWidth({from:0,to:a},e,n),r=a+1),r<i?s():this.inProgress=!1}recalculateAllColumnsWidth(){this.hot.view.isVisible()&&this.calculateAllColumnsWidth({from:0,to:this.hot.countRows()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[Ty];let n=Rh.SYNC_CALCULATION_LIMIT;const r=this.hot.countCols()-1;return Ae(e)&&(n=e.syncLimit,MN(n)?n=sD(r,n):n>>=0),Math.min(n,r)}getColumnWidth(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=n;return i===void 0&&(i=this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e)),r&&typeof i=="number"&&(i=Math.max(i,Nu))),i}getFirstVisibleColumn(){var e;return(e=this.hot.getFirstRenderedVisibleColumn())!==null&&e!==void 0?e:-1}getLastVisibleColumn(){var e;return(e=this.hot.getLastRenderedVisibleColumn())!==null&&e!==void 0?e:-1}findColumnsWhereHeaderWasChanged(){return this.hot.getColHeader().reduce((r,i,o)=>{const s=$s(fu,this).length;return(s-1<o||$s(fu,this)[o]!==i)&&r.push(this.hot.toVisualColumn(o)),s-1<o?$s(fu,this).push(i):$s(fu,this)[o]=i,r},[])}clearCache(e){Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(n=>{this.columnWidthsMap.setValueAtIndex(n,null)})},!0):this.columnWidthsMap.clear()}isNeedRecalculate(){return!!this.columnWidthsMap.getValues().slice(0,this.measuredColumns).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function _8(t){const e={from:0,to:this.hot.countRows()-1};t.forEach(n=>{const r=this.hot.toPhysicalColumn(n);r!==null&&(this.hot._getColWidthFromSettings(r)||lr(Sr,this,Wk).call(this,n,e))}),this.ghostTable.columns.length&&(lr(Sr,this,Bk).call(this),this.ghostTable.clean())}function Wk(t,e){this.samplesGenerator.generateColumnSamples(t,e).forEach((r,i)=>this.ghostTable.addColumn(i,r))}function Bk(){this.hot.batchExecution(()=>{this.ghostTable.getWidths((t,e)=>{const n=this.hot.toPhysicalColumn(t);this.columnWidthsMap.setValueAtIndex(n,e)})},!0)}function M8(){this.calculateVisibleColumnsWidth(),this.inProgress||(lr(Sr,this,_8).call(this,$s(Vu,this)),am(Vu,this,[]))}function I8(t,e){e||this.recalculateAllColumnsWidth()}function P8(t){const e=t.reduce((n,r)=>{let[,i]=r;const o=this.hot.propToCol(i);return Number.isInteger(o)&&n.indexOf(o)===-1&&n.push(o),n},[]);$s(Vu,this).push(...e)}function nA(t,e,n){let r=t;return n&&(this.calculateColumnsWidth(e,void 0,!0),r=this.getColumnWidth(e,void 0,!1)),r}function O8(){am(fu,this,this.hot.getColHeader()),this.recalculateAllColumnsWidth(),am(rT,this,!0)}function x8(t){if(!$s(rT,this))return;const e=t.reduce((n,r)=>{var i;const o=(i=r.address)===null||i===void 0?void 0:i.col;if(Number.isInteger(o)){const s=this.hot.toVisualColumn(o);n.indexOf(s)===-1&&n.push(s)}return n},[]);$s(Vu,this).push(...e)}const Ka={horizontal:"horizontal",vertical:"vertical"};function A8(t,e,n){let r,i,o;return e[0]===t[0]&&e[1]<t[1]?(o="left",r=n(e[0],e[1]),i=n(e[2],t[1]-1)):e[2]===t[2]&&e[0]===t[0]&&e[3]>t[3]?(o="right",r=n(e[0],t[3]+1),i=n(e[2],e[3])):e[0]<t[0]&&e[1]===t[1]?(o="up",r=n(e[0],e[1]),i=n(t[0]-1,e[3])):e[2]>t[2]&&e[1]===t[1]&&(o="down",r=n(t[2]+1,e[1]),i=n(e[2],e[3])),r&&r.normalize(),i&&i.normalize(),{directionOfDrag:o,startOfDragCoords:r,endOfDragCoords:i}}function H8(t){const e={};return t===!0?(e.directions=Object.keys(Ka),e.autoInsertRow=!0):Ae(t)?(ae(t.autoInsertRow)?t.direction===Ka.horizontal?e.autoInsertRow=!1:e.autoInsertRow=t.autoInsertRow:e.autoInsertRow=!1,ae(t.direction)?e.directions=[t.direction]:e.directions=Object.keys(Ka)):typeof t=="string"?(e.directions=[t],e.autoInsertRow=!0):(e.directions=[],e.autoInsertRow=!1),e}function N8(t,e){D8(t,e),e.add(t)}function D8(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Fl(t,e,n){return(e=k8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k8(t){var e=L8(t,"string");return typeof e=="symbol"?e:e+""}function L8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ac(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("modifyAutofillRange");re.getSingleton().register("beforeAutofill");re.getSingleton().register("afterAutofill");const rA="autofill",$8=20,F8=["fillHandle"],V8="insert_row_below",W8=200;var Vl=new WeakSet;class B8 extends Xe{constructor(){super(...arguments),N8(this,Vl),Fl(this,"addingStarted",!1),Fl(this,"mouseDownOnCellCorner",!1),Fl(this,"mouseDragOutside",!1),Fl(this,"handleDraggedCells",0),Fl(this,"directions",[]),Fl(this,"autoInsertRow",!1)}static get PLUGIN_KEY(){return rA}static get PLUGIN_PRIORITY(){return $8}static get SETTING_KEYS(){return[rA,...F8]}isEnabled(){return this.hot.getSettings().fillHandle}enablePlugin(){this.enabled||(this.mapSettings(),this.registerEvents(),this.addHook("afterOnCellCornerMouseDown",e=>Ac(Vl,this,U8).call(this,e)),this.addHook("afterOnCellCornerDblClick",e=>Ac(Vl,this,j8).call(this,e)),this.addHook("beforeOnCellMouseOver",(e,n)=>Ac(Vl,this,z8).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.clearMappedSettings(),super.disablePlugin()}getSelectionData(){const e=this.hot.getSelectedRangeLast(),{row:n,col:r}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.hot.runHooks("modifyCopyableRange",[{startRow:n,startCol:r,endRow:i,endCol:o}]),a=[],l=[],u=[];return I(s,c=>{for(let h=c.startRow;h<=c.endRow;h+=1)a.indexOf(h)===-1&&a.push(h);for(let h=c.startCol;h<=c.endCol;h+=1)l.indexOf(h)===-1&&l.push(h)}),I(a,c=>{const h=[];I(l,d=>{h.push(this.hot.getCopyableData(c,d))}),u.push(h)}),u}fillIn(){if(this.hot.selection.highlight.getFill().isEmpty())return!1;const[e,n,r,i]=this.hot.selection.highlight.getFill().getVisualCorners(),o=this.hot.getSelectedRangeLast(),s=o.getTopStartCorner(),a=o.getBottomEndCorner();this.resetSelectionOfDraggedArea();const l=[s.row,s.col,a.row,a.col],u=this.hot.runHooks("modifyAutofillRange",[Math.min(s.row,e),Math.min(s.col,n),Math.max(a.row,r),Math.max(a.col,i)],l),{directionOfDrag:c,startOfDragCoords:h,endOfDragCoords:d}=A8(l,u,(f,m)=>this.hot._createCellCoords(f,m));if(h&&h.row>-1&&h.col>-1){const f=this.getSelectionData(),m=o.clone(),C=this.hot._createCellRange(h,h,d),y=this.hot.runHooks("beforeAutofill",f,m,C,c);if(y===!1)return this.hot.selection.highlight.getFill().clear(),this.hot.render(),!1;let E=y;const v=y;if(["up","left"].indexOf(c)>-1&&!(v.length===1&&v[0].length===0))if(E=[],c==="up"){const _=d.row-h.row+1,A=_%v.length;for(let L=0;L<_;L++)E.push(v[(L+(v.length-A))%v.length])}else{const _=d.col-h.col+1,A=_%v[0].length;for(let L=0;L<v.length;L++){E.push([]);for(let T=0;T<_;T++)E[L].push(v[L][(T+(v[L].length-A))%v[L].length])}}this.hot.populateFromArray(h.row,h.col,E,d.row,d.col,`${this.pluginName}.fill`,null),this.setSelection(u),this.hot.runHooks("afterAutofill",E,m,C,c),this.hot.render()}else this.hot.view.render();return!0}reduceSelectionAreaIfNeeded(e){return e.row<0&&(e.row=0),e.col<0&&(e.col=0),e}getCoordsOfDragAndDropBorders(e){const n=this.hot.getSelectedRangeLast(),r=n.getBottomEndCorner();let i=e;if(this.directions.includes(Ka.vertical)&&this.directions.includes(Ka.horizontal)){const o=n.getTopStartCorner();(r.col<=e.col||o.col>=e.col)&&(i=this.hot._createCellCoords(r.row,e.col)),(r.row<e.row||o.row>e.row)&&(i=this.hot._createCellCoords(e.row,r.col))}else if(this.directions.includes(Ka.vertical))i=this.hot._createCellCoords(e.row,r.col);else if(this.directions.includes(Ka.horizontal))i=this.hot._createCellCoords(r.row,e.col);else return;return this.reduceSelectionAreaIfNeeded(i)}showBorder(e){const n=this.getCoordsOfDragAndDropBorders(e);n&&this.redrawBorders(n)}addRow(){this.hot._registerTimeout(()=>{this.hot.alter(V8,void 0,1,`${this.pluginName}.fill`),this.addingStarted=!1},W8)}addNewRowIfNeeded(){if(!this.hot.selection.highlight.getFill().isEmpty()&&this.addingStarted===!1&&this.autoInsertRow){const e=this.hot.getSelectedLast(),n=this.hot.selection.highlight.getFill().getVisualCorners(),r=this.hot.countRows();e[2]<r-1&&n[2]===r-1&&(this.addingStarted=!0,this.addRow())}}getIndexOfLastAdjacentFilledInRow(e){const n=this.hot.getData(),r=this.hot.countRows();let i;for(let o=e[2]+1;o<r;o++){for(let l=e[1];l<=e[3];l++){const u=n[o][l];if(!Ut(u))return-1}const s=n[o][e[1]-1],a=n[o][e[3]+1];(!Ut(s)||!Ut(a))&&(i=o)}return i}addSelectionFromStartAreaToSpecificRowIndex(e,n){this.hot.selection.highlight.getFill().clear().add(this.hot._createCellCoords(e[0],e[1])).add(this.hot._createCellCoords(n,e[3])).commit()}setSelection(e){this.hot.selectCell(...Be(e,n=>Math.max(n,0)),!1,!1)}selectAdjacent(){const e=this.hot.getSelectedLast(),n=this.getIndexOfLastAdjacentFilledInRow(e);return n===-1||n===void 0?!1:(this.addSelectionFromStartAreaToSpecificRowIndex(e,n),!0)}resetSelectionOfDraggedArea(){this.handleDraggedCells=0,this.hot.selection.highlight.getFill().clear()}redrawBorders(e){this.hot.selection.highlight.getFill().clear().add(this.hot.getSelectedRangeLast().from).add(this.hot.getSelectedRangeLast().to).add(e).commit(),this.hot.view.render()}getIfMouseWasDraggedOutside(e){const{documentElement:n}=this.hot.rootDocument,r=Hn(this.hot.table).top-(this.hot.rootWindow.pageYOffset||n.scrollTop)+rn(this.hot.table),i=Hn(this.hot.table).left-(this.hot.rootWindow.pageXOffset||n.scrollLeft)+qt(this.hot.table);return e.clientY>r&&e.clientX<=i}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mouseup",()=>Ac(Vl,this,Y8).call(this)),this.eventManager.addEventListener(e,"mousemove",n=>Ac(Vl,this,G8).call(this,n))}clearMappedSettings(){this.directions.length=0,this.autoInsertRow=!1}mapSettings(){const e=H8(this.hot.getSettings().fillHandle);this.directions=e.directions,this.autoInsertRow=e.autoInsertRow}destroy(){super.destroy()}}function j8(){this.selectAdjacent()&&this.fillIn()}function U8(){this.handleDraggedCells=1,this.mouseDownOnCellCorner=!0}function z8(t){this.mouseDownOnCellCorner&&!this.hot.view.isMouseDown()&&this.handleDraggedCells&&(this.handleDraggedCells+=1,this.showBorder(t),this.addNewRowIfNeeded())}function Y8(){this.handleDraggedCells&&(this.handleDraggedCells>1&&this.fillIn(),this.handleDraggedCells=0,this.mouseDownOnCellCorner=!1)}function G8(t){const e=this.getIfMouseWasDraggedOutside(t);this.addingStarted===!1&&this.handleDraggedCells>0&&e?(this.mouseDragOutside=!0,this.addingStarted=!0):this.mouseDragOutside=!1,this.mouseDragOutside&&this.autoInsertRow&&this.addRow()}function q8(t,e){jk(t,e),e.add(t)}function iA(t,e,n){jk(t,e),e.set(t,n)}function jk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wl(t,e,n){return(e=K8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K8(t){var e=X8(t,"string");return typeof e=="symbol"?e:e+""}function X8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Uk(t,e,n){return t.set(eo(t,e),n),n}function lm(t,e){return t.get(eo(t,e))}function eo(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const _y="autoRowSize",Z8=40,Q8="autoRowSize";var Zh=new WeakMap,iT=new WeakMap,Ho=new WeakSet;class Eh extends Xe{static get PLUGIN_KEY(){return _y}static get PLUGIN_PRIORITY(){return Z8}static get SETTING_KEYS(){return!0}static get DEFAULT_SETTINGS(){return{useHeaders:!0,samplingRatio:null,allowSampleDuplicates:!1}}static get CALCULATION_STEP(){return 50}static get SYNC_CALCULATION_LIMIT(){return 500}constructor(e){super(e),q8(this,Ho),Wl(this,"headerHeight",null),Wl(this,"ghostTable",new Fk(this.hot)),Wl(this,"samplesGenerator",new yp((n,r)=>{const i=this.hot.toPhysicalRow(n),o=this.hot.toPhysicalColumn(r);if(this.hot.rowIndexMapper.isHidden(i)||this.hot.columnIndexMapper.isHidden(o)||n>=0&&r>=0&&this.hot.getCellMeta(n,r).hidden)return!1;let s;return n>=0?s=this.hot.getDataAtCell(n,r):n===-1&&(s=this.hot.getColHeader(r)),{value:s}})),Wl(this,"inProgress",!1),Wl(this,"measuredRows",0),Wl(this,"rowHeightsMap",new Qs),iA(this,Zh,[]),iA(this,iT,!1),this.hot.rowIndexMapper.registerMap(Q8,this.rowHeightsMap),this.addHook("beforeRowResize",(n,r,i)=>eo(Ho,this,oA).call(this,n,r,i))}isEnabled(){const e=this.hot.getSettings()[_y];return e===!0||Ae(e)}enablePlugin(){var e=this;if(this.enabled)return;this.samplesGenerator.setAllowDuplicates(this.getSetting("allowSampleDuplicates"));const n=this.getSetting("samplingRatio");n&&!isNaN(n)&&this.samplesGenerator.setSampleCount(parseInt(n,10)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return eo(Ho,e,t7).call(e,...i)}),this.addHook("beforeChangeRender",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return eo(Ho,e,n7).call(e,...i)}),this.addHook("beforeColumnResize",()=>this.recalculateAllRowsHeight()),this.addHook("afterFormulasValuesUpdate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return eo(Ho,e,i7).call(e,...i)}),this.addHook("beforeRender",()=>eo(Ho,this,e7).call(this)),this.addHook("modifyRowHeight",(r,i)=>this.getRowHeight(i,r)),this.addHook("init",()=>eo(Ho,this,r7).call(this)),this.addHook("modifyColumnHeaderHeight",()=>this.getColumnHeaderHeight()),super.enablePlugin()}disablePlugin(){this.headerHeight=null,super.disablePlugin(),this.addHook("beforeRowResize",(e,n,r)=>eo(Ho,this,oA).call(this,e,n,r))}calculateVisibleRowsHeight(){if(!this.hot.countCols())return;const e=this.getFirstVisibleRow(),n=this.getLastVisibleRow();if(e===-1||n===-1)return;const r=this.hot.forceFullRender;this.calculateRowsHeight({from:e,to:n},void 0,r)}calculateRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countRows()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{from:0,to:this.hot.countCols()-1},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=typeof e=="number"?{from:e,to:e}:e,o=typeof n=="number"?{from:n,to:n}:n;if(this.hot.getColHeader(0)!==null){const s=this.samplesGenerator.generateRowSamples(-1,o);this.ghostTable.addColumnHeadersRow(s.get(-1))}de(i.from,i.to,s=>{let a=this.hot.toPhysicalRow(s);a===null&&(a=s),(r||this.rowHeightsMap.getValueAtIndex(a)===null)&&this.samplesGenerator.generateRowSamples(s,o).forEach((u,c)=>this.ghostTable.addRow(c,u))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((s,a)=>{s<0?this.headerHeight=a:this.rowHeightsMap.setValueAtIndex(this.hot.toPhysicalRow(s),a)})},!0),this.measuredRows=i.to+1,this.ghostTable.clean())}calculateAllRowsHeight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{from:0,to:this.hot.countCols()-1},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=0;const i=this.hot.countRows()-1;let o=null;this.inProgress=!0;const s=()=>{if(!this.hot){Zg(o),this.inProgress=!1;return}this.calculateRowsHeight({from:r,to:Math.min(r+Eh.CALCULATION_STEP,i)},e,n),r=r+Eh.CALCULATION_STEP+1,r<i?o=Xg(s):(Zg(o),this.inProgress=!1,this.hot.view.adjustElementsSize())},a=this.getSyncCalculationLimit();a>=0&&(this.calculateRowsHeight({from:0,to:a},e,n),r=a+1),r<i?s():(this.inProgress=!1,this.hot.view.adjustElementsSize())}recalculateAllRowsHeight(){this.hot.view.isVisible()&&this.calculateAllRowsHeight({from:0,to:this.hot.countCols()-1},!0)}getSyncCalculationLimit(){const e=this.hot.getSettings()[_y];let n=Eh.SYNC_CALCULATION_LIMIT;const r=this.hot.countRows()-1;return Ae(e)&&(n=e.syncLimit,MN(n)?n=sD(r,n):n>>=0),Math.min(n,r)}getRowHeight(e,n){const r=e<0?this.headerHeight:this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(e));let i=n;return r!==null&&r>(n||0)&&(i=r),i}getColumnHeaderHeight(){return this.headerHeight}getFirstVisibleRow(){var e;return(e=this.hot.getFirstRenderedVisibleRow())!==null&&e!==void 0?e:-1}getLastVisibleRow(){var e;return(e=this.hot.getLastRenderedVisibleRow())!==null&&e!==void 0?e:-1}clearCache(e){this.headerHeight=null,Array.isArray(e)?this.hot.batchExecution(()=>{e.forEach(n=>{this.rowHeightsMap.setValueAtIndex(n,null)})},!0):this.rowHeightsMap.clear()}clearCacheByRange(e){const{from:n,to:r}=typeof e=="number"?{from:e,to:e}:e;this.hot.batchExecution(()=>{de(Math.min(n,r),Math.max(n,r),i=>{this.rowHeightsMap.setValueAtIndex(i,null)})},!0)}isNeedRecalculate(){return!!this.rowHeightsMap.getValues().slice(0,this.measuredRows).filter(e=>e===null).length}destroy(){this.ghostTable.clean(),super.destroy()}}function J8(t){const e={from:0,to:this.hot.countCols()-1};t.forEach(n=>{this.samplesGenerator.generateRowSamples(n,e).forEach((i,o)=>this.ghostTable.addRow(o,i))}),this.ghostTable.rows.length&&(this.hot.batchExecution(()=>{this.ghostTable.getHeights((n,r)=>{const i=this.hot.toPhysicalRow(n);this.rowHeightsMap.setValueAtIndex(i,r)})},!0),this.ghostTable.clean())}function e7(){this.calculateVisibleRowsHeight(),this.inProgress||(eo(Ho,this,J8).call(this,lm(Zh,this)),Uk(Zh,this,[]))}function oA(t,e,n){let r=t;return n&&(this.calculateRowsHeight(e,void 0,!0),r=this.getRowHeight(e)),r}function t7(t,e){e||this.recalculateAllRowsHeight()}function n7(t){const e=t.reduce((n,r)=>{let[i]=r;return n.indexOf(i)===-1&&n.push(i),n},[]);lm(Zh,this).push(...e)}function r7(){this.recalculateAllRowsHeight(),Uk(iT,this,!0)}function i7(t){if(!lm(iT,this))return;const e=t.reduce((n,r)=>{var i;const o=(i=r.address)===null||i===void 0?void 0:i.row;if(Number.isInteger(o)){const s=this.hot.toVisualRow(o);n.indexOf(s)===-1&&n.push(s)}return n},[]);lm(Zh,this).push(...e)}const{getListWithInsertedItems:o7,getListWithRemovedItems:s7}=ND("physicallyIndexed");class a7 extends bl{constructor(){super(e=>e)}insert(e,n){const r=hE(this.indexedValues,n);this.indexedValues=o7(r,e,n,this.initValueOrFn),super.insert(e,n)}remove(e){const n=s7(this.indexedValues,e);this.indexedValues=cE(n,e),super.remove(e)}}const{getListWithInsertedItems:l7,getListWithRemovedItems:u7}=ND("physicallyIndexed");class c7 extends bl{constructor(){super(e=>e)}insert(e,n){this.indexedValues=l7(this.indexedValues,e,n,(r,i)=>this.getNextValue(i)),super.insert(e,n)}remove(e){this.indexedValues=u7(this.indexedValues,e),super.remove(e)}getNextValue(e){return Math.max(...this.getValues())+1+e}}function h7(t,e){d7(t,e),e.add(t)}function d7(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function f7(t,e,n){return(e=g7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function g7(t){var e=m7(t,"string");return typeof e=="symbol"?e:e+""}function m7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function p7(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const sA="bindRowsWithHeaders",w7=210,v7="loose",aA=new Map([["loose",a7],["strict",c7]]);var lA=new WeakSet;class C7 extends Xe{constructor(){super(...arguments),h7(this,lA),f7(this,"headerIndexes",null)}static get PLUGIN_KEY(){return sA}static get PLUGIN_PRIORITY(){return w7}isEnabled(){return!!this.hot.getSettings()[sA]}enablePlugin(){var e;if(this.enabled)return;const n=(e=aA.get(this.getSetting()))!==null&&e!==void 0?e:aA.get(v7);this.headerIndexes=this.hot.rowIndexMapper.registerMap("bindRowsWithHeaders",new n),this.addHook("modifyRowHeader",r=>p7(lA,this,y7).call(this,r)),super.enablePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("bindRowsWithHeaders"),super.disablePlugin()}destroy(){super.destroy()}}function y7(t){return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(t))}function b7(t,e){zk(t,e),e.add(t)}function S7(t,e,n){zk(t,e),e.set(t,n)}function zk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function uA(t,e,n){return(e=R7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R7(t){var e=E7(t,"string");return typeof e=="symbol"?e:e+""}function E7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cA(t,e){return t.get(yu(t,e))}function My(t,e,n){return t.set(yu(t,e),n),n}function yu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Pg="collapsibleColumns",T7=290,_7=["nestedHeaders"],Pu="collapsibleIndicator",hA=Pg,dA=new Map([["collapse",{hideColumn:!0,beforeHook:"beforeColumnCollapse",afterHook:"afterColumnCollapse"}],["expand",{hideColumn:!1,beforeHook:"beforeColumnExpand",afterHook:"afterColumnExpand"}]]);var Bl=new WeakMap,Hc=new WeakSet;class M7 extends Xe{constructor(){super(...arguments),b7(this,Hc),uA(this,"nestedHeadersPlugin",null),uA(this,"headerStateManager",null),S7(this,Bl,null)}static get PLUGIN_KEY(){return Pg}static get PLUGIN_PRIORITY(){return T7}static get PLUGIN_DEPS(){return["plugin:NestedHeaders"]}static get SETTING_KEYS(){return[Pg,..._7]}isEnabled(){return!!this.hot.getSettings()[Pg]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();n||Ze("You need to configure the Nested Headers plugin in order to use collapsible headers."),My(Bl,this,this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName,"hiding")),this.nestedHeadersPlugin=this.hot.getPlugin("nestedHeaders"),this.headerStateManager=this.nestedHeadersPlugin.getStateManager(),this.addHook("init",()=>yu(Hc,this,O7).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return yu(Hc,e,x7).call(e,...i)}),this.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return yu(Hc,e,I7).call(e,...i)}),this.addHook("beforeOnCellMouseDown",(r,i,o)=>yu(Hc,this,P7).call(this,r,i,o)),this.registerShortcuts(),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(this.hot.view){if(!this.nestedHeadersPlugin.detectedOverlappedHeaders){const{collapsibleColumns:e}=this.hot.getSettings();typeof e=="boolean"?this.headerStateManager.mapState(n=>({collapsible:n.origColspan>1})):Array.isArray(e)&&(this.headerStateManager.mapState(()=>({collapsible:!1})),this.headerStateManager.mergeStateWith(e))}super.updatePlugin()}}disablePlugin(){this.hot.columnIndexMapper.unregisterMap(this.pluginName),My(Bl,this,null),this.nestedHeadersPlugin=null,this.unregisterShortcuts(),this.clearButtons(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{var e;const{row:n,col:r}=this.hot.getSelectedRangeLast().highlight,{collapsible:i,isCollapsed:o,columnIndex:s}=(e=this.headerStateManager.getHeaderTreeNodeData(n,r))!==null&&e!==void 0?e:{};if(i)return o?this.expandSection({row:n,col:s}):this.collapseSection({row:n,col:s}),!1},runOnlyIf:()=>{var e,n;return((e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.isSingle())&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.highlight.isHeader())},group:hA,relativeToGroup:Js,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(hA)}clearButtons(){if(!this.hot.view)return;const e=this.hot.view._wt.getSetting("columnHeaders").length,n=this.hot.view._wt.wtTable.THEAD,r=this.hot.view._wt.wtOverlays.topOverlay.clone.wtTable.THEAD,i=this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay?this.hot.view._wt.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null,o=function(s){s&&s.parentNode.removeChild(s)};de(0,e-1,s=>{const a=n.childNodes[s],l=r.childNodes[s],u=i?i.childNodes[s]:null;de(0,a.childNodes.length-1,c=>{let h=a.childNodes[c].querySelector(`.${Pu}`);o(h),l&&l.childNodes[c]&&(h=l.childNodes[c].querySelector(`.${Pu}`),o(h)),i&&u&&u.childNodes[c]&&(h=u.childNodes[c].querySelector(`.${Pu}`),o(h))})})}expandSection(e){this.toggleCollapsibleSection([e],"expand")}collapseSection(e){this.toggleCollapsibleSection([e],"collapse")}toggleAllCollapsibleSections(e){const n=this.headerStateManager.mapNodes(r=>{const{collapsible:i,origColspan:o,headerLevel:s,columnIndex:a,isCollapsed:l}=r;if(i===!0&&o>1&&(l&&e==="expand"||!l&&e==="collapse"))return{row:this.headerStateManager.levelToRowCoords(s),col:a}});this.toggleCollapsibleSection(n,e)}collapseAll(){this.toggleAllCollapsibleSections("collapse")}expandAll(){this.toggleAllCollapsibleSections("expand")}toggleCollapsibleSection(e,n){if(!dA.has(n))throw new Error(`Unsupported action is passed (${n}).`);if(!Array.isArray(e))return;const r=rl(e,f=>{let{row:m}=f;return m<0});let i=r.length>0;I(r,f=>{var m;let{row:C,col:y}=f;const{collapsible:E,isCollapsed:v}=(m=this.headerStateManager.getHeaderSettings(C,y))!==null&&m!==void 0?m:{};if(!E||v&&n==="collapse"||!v&&n==="expand")return i=!1,!1});const o=[],s=[];i&&I(r,f=>{let{row:m,col:C}=f;const{colspanCompensation:y,affectedColumns:E,rollbackModification:v}=this.headerStateManager.triggerNodeModification(n,m,C);y>0&&(s.push(...E),o.push(v))});const a=this.getCollapsedColumns();let l=[];n==="collapse"?l=OU([...a,...s]):n==="expand"&&(l=rl(a,f=>!s.includes(f)));const u=dA.get(n);if(this.hot.runHooks(u.beforeHook,a,l,i)===!1){I(o,f=>{f()});return}this.hot.batchExecution(()=>{I(s,f=>{cA(Bl,this).setValueAtIndex(this.hot.toPhysicalColumn(f),u.hideColumn)})},!0);const h=this.getCollapsedColumns().length!==a.length,d=this.hot.getSelectedRangeLast();if(n==="collapse"&&h&&d){const{row:f,col:m}=d.highlight;if((this.hot.rowIndexMapper.isHidden(f)||this.hot.columnIndexMapper.isHidden(m))&&s.includes(m)){const y=f>=0?this.hot.rowIndexMapper.getNearestNotHiddenIndex(f,1,!0):f,E=m>=0?this.hot.columnIndexMapper.getNearestNotHiddenIndex(m,1,!0):m;y!==null&&E!==null&&this.hot.selectCell(y,E)}}this.hot.runHooks(u.afterHook,a,l,i,h),this.hot.render(),this.hot.view.adjustElementsSize()}getCollapsedColumns(){return cA(Bl,this).getHiddenIndexes()}destroy(){My(Bl,this,null),super.destroy()}}function I7(t,e,n){var r;const{collapsible:i,origColspan:o,isCollapsed:s}=(r=this.headerStateManager.getHeaderSettings(n,t))!==null&&r!==void 0?r:{},a=i&&o>1&&t>=this.hot.getSettings().fixedColumnsStart,l=this.hot.getSettings().ariaTags;let u=e.querySelector(`.${Pu}`);if(Ku(e,[Gr("")[0]]),a)u||(u=this.hot.rootDocument.createElement("div"),q(u,Pu),e.querySelector("div:first-child").appendChild(u)),pe(u,["collapsed","expanded"]),s?(q(u,"collapsed"),ol(u,"+"),l&&ye(e,...Gr(!1))):(q(u,"expanded"),ol(u,"-"),l&&ye(e,...Gr(!0))),l&&ye(u,...yl());else{var c;(c=u)===null||c===void 0||c.remove()}}function P7(t,e){ve(t.target,Pu)&&(ve(t.target,"expanded")?(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"collapse")):ve(t.target,"collapsed")&&(this.eventManager.fireEvent(t.target,"mouseup"),this.toggleCollapsibleSection([e],"expand")),Pi(t))}function O7(){this.updatePlugin()}function x7(t,e){e||this.updatePlugin()}function va(t,e,n){return(e=A7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A7(t){var e=H7(t,"string");return typeof e=="symbol"?e:e+""}function H7(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const N7=["sortEmptyCells","indicator","headerAction","compareFunctionFactory"],D7=!1,k7=!0,L7=!0;class $7{constructor(e,n){va(this,"hot",void 0),va(this,"sortingStates",new hp),va(this,"sortEmptyCells",D7),va(this,"indicator",k7),va(this,"headerAction",L7),va(this,"compareFunctionFactory",void 0),va(this,"mapName",void 0),this.hot=e,this.mapName=n,this.hot.columnIndexMapper.registerMap(n,this.sortingStates)}updateAllColumnsProperties(e){Ae(e)&&He(e,(n,r)=>{N7.includes(r)&&(this[r]=n)})}getAllColumnsProperties(){const e={sortEmptyCells:this.sortEmptyCells,indicator:this.indicator,headerAction:this.headerAction};return typeof this.compareFunctionFactory=="function"&&(e.compareFunctionFactory=this.compareFunctionFactory),e}getSortOrderOfColumn(e){var n;return(n=this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))===null||n===void 0?void 0:n.sortOrder}getIndexOfColumnInSortQueue(e){return e=this.hot.toPhysicalColumn(e),this.sortingStates.getEntries().findIndex(n=>{let[r]=n;return r===e})}getNumberOfSortedColumns(){return this.sortingStates.getLength()}isListOfSortedColumnsEmpty(){return this.getNumberOfSortedColumns()===0}isColumnSorted(e){return Ae(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(e)))}getSortStates(){return this.sortingStates===null?[]:this.sortingStates.getEntries().map(n=>{let[r,i]=n;return{column:this.hot.toVisualColumn(r),...i}})}getColumnSortState(e){const n=this.getSortOrderOfColumn(e);if(ae(n))return{column:e,sortOrder:n}}setSortStates(e){this.sortingStates.clear();for(let n=0;n<e.length;n+=1)this.sortingStates.setValueAtIndex(this.hot.toPhysicalColumn(e[n].column),{sortOrder:e[n].sortOrder})}destroy(){this.hot.columnIndexMapper.unregisterMap(this.mapName),this.sortingStates=null}}function Yk(t,e,n){const r=e.locale;return function(i,o){const{sortEmptyCells:s}=n;return typeof i=="string"&&(i=i.toLocaleLowerCase(r)),typeof o=="string"&&(o=o.toLocaleLowerCase(r)),i===o?so:Ut(i)?Ut(o)?so:s&&t==="asc"?kt:Lt:Ut(o)?s&&t==="asc"?Lt:kt:isNaN(i)&&!isNaN(o)?t==="asc"?Lt:kt:!isNaN(i)&&isNaN(o)||(isNaN(i)||isNaN(o)||(i=parseFloat(i),o=parseFloat(o)),i<o)?t==="asc"?kt:Lt:i>o?t==="asc"?Lt:kt:so}}const Gk="default";function F7(t,e,n){return function(r,i){const o=parseFloat(r),s=parseFloat(i),{sortEmptyCells:a}=n;if(o===s||isNaN(o)&&isNaN(s))return so;if(a){if(Ut(r))return t==="asc"?kt:Lt;if(Ut(i))return t==="asc"?Lt:kt}return isNaN(o)?Lt:isNaN(s)?kt:o<s?t==="asc"?kt:Lt:o>s?t==="asc"?Lt:kt:so}}const V7="numeric";function W7(t,e,n){const r=e.checkedTemplate,i=e.uncheckedTemplate,{sortEmptyCells:o}=n;return function(s,a){const l=Ut(s),u=Ut(a),c=l?i:s,h=u?i:a,d=c===i||c===r,f=h===i||h===r;if(o===!1){if(l&&u===!1)return Lt;if(l===!1&&u)return kt}return d===!1&&f?t==="asc"?kt:Lt:d&&f===!1?t==="asc"?Lt:kt:d===!1&&f===!1?Yk(t,e,n)(s,a):c===i&&h===r?t==="asc"?kt:Lt:c===r&&h===i?t==="asc"?Lt:kt:so}}const B7="checkbox";function j7(t,e,n){return Jk(t,e.dateFormat,n)}const U7="date";function z7(t,e,n){return Jk(t,e.timeFormat,n)}const Y7="time",{register:Id,getItem:fA,hasItem:G7}=Oi("sorting.compareFunctionFactory"),{register:qk,getItem:q7}=Oi("sorting.mainSortComparator");function Kk(t){return G7(t)?fA(t):fA(Gk)}Id(B7,W7);Id(U7,j7);Id(Gk,Yk);Id(V7,F7);Id(Y7,z7);const so=0,kt=-1,Lt=1;function K7(t,e){const n=q7(e);for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];t.sort(n(...i))}const um="asc",cm="desc",Xk="colHeader";function X7(t){if(Ae(t)===!1)return!1;const{column:e,sortOrder:n}=t;return Number.isInteger(e)&&[um,cm].includes(n)}function Z7(t){if(t.some(n=>X7(n)===!1))return!1;const e=t.map(n=>{let{column:r}=n;return r});return new Set(e).size===e.length}function gA(t){if(t!==cm)return t===um?cm:um}function Zk(t){return t.querySelector(`.${Xk}`)}function Qk(t,e){if(t<0||!e.parentNode)return!1;const n=e.parentNode.parentNode.childNodes;return Array.from(n).indexOf(e.parentNode)-n.length===-1}function oT(t,e,n){return t===-1&&e>=0&&sl(n)===!1}function Jk(t,e,n){return function(r,i){const{sortEmptyCells:o}=n;if(r===i)return so;if(Ut(r))return Ut(i)?so:o&&t==="asc"?kt:Lt;if(Ut(i))return o&&t==="asc"?Lt:kt;const s=X(r,e),a=X(i,e);return s.isValid()?a.isValid()?a.isAfter(s)?t==="asc"?kt:Lt:a.isBefore(s)?t==="asc"?Lt:kt:so:kt:Lt}}function Q7(t,e){Ze(nt`Plugins \`columnSorting\` and \`multiColumnSorting\` should not be enabled simultaneously.\x20
253
+ Only \`${t}\` will work. The \`${e}\` plugin will remain disabled.`)}const J7="ascending",e5="descending",eL="indicatorDisabled",tL="columnSorting",nL="sortAction",rL=new Map([[um,J7],[cm,e5]]);function t5(t,e,n,r){const i=[tL];if(r&&i.push(nL),n===!1)return i.push(eL),i;const o=t.getSortOrderOfColumn(e);return ae(o)&&i.push(rL.get(o)),i}function n5(){return Array.from(rL.values()).concat(nL,eL,tL)}function r5(t,e){return function(n,r){const[,...i]=n,[,...o]=r;return(function(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.columnSorting;return(d.compareFunctionFactory?d.compareFunctionFactory:Kk(u.type))(l,u,d)(c,h)})(0)}}function i5(t,e){o5(t,e),e.add(t)}function o5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Rf(t,e,n){return(e=s5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s5(t){var e=a5(t,"string");return typeof e=="symbol"?e:e+""}function a5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const hm="columnSorting",l5=50,dm="append",u5="replace",mA=hm;qk(hm,r5);re.getSingleton().register("beforeColumnSort");re.getSingleton().register("afterColumnSort");const Nc=new WeakMap;var ja=new WeakSet;class iL extends Xe{constructor(){super(...arguments),i5(this,ja),Rf(this,"columnStatesManager",null),Rf(this,"columnMetaCache",null),Rf(this,"pluginKey",hm),Rf(this,"indexesSequenceCache",null)}static get PLUGIN_KEY(){return hm}static get PLUGIN_PRIORITY(){return l5}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){var e=this;if(Nc.has(this.hot)&&Nc.get(this.hot)!==this.pluginKey){this.hot.updateSettings({[this.pluginKey]:!1}),Q7(Nc.get(this.hot),this.pluginKey);return}this.enabled||(Nc.set(this.hot,this.pluginKey),this.columnStatesManager=new $7(this.hot,`${this.pluginKey}.sortingStates`),this.columnMetaCache=new Qs(n=>{let r=this.hot.toVisualColumn(n);return r===null&&(r=n),this.getMergedPluginSettings(r)}),this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`,this.columnMetaCache),this.addHook("afterGetColHeader",(n,r)=>gu(ja,this,c5).call(this,n,r)),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gu(ja,e,d5).call(e,...r)}),this.addHook("afterOnCellMouseDown",(n,r)=>this.onAfterOnCellMouseDown(n,r)),this.addHook("afterInit",()=>gu(ja,this,SS).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return gu(ja,e,h5).call(e,...r)}),this.hot.view&&gu(ja,this,SS).call(this),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){const e=(n,r)=>{const i=Zk(r);Qk(n,r)===!1||i===null||this.updateHeaderClasses(i)};Nc.delete(this.hot),this.hot.addHook("afterGetColHeader",e),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("afterGetColHeader",e)}),this.hot.batchExecution(()=>{this.indexesSequenceCache!==null&&(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginKey),this.indexesSequenceCache=null)},!0),this.hot.columnIndexMapper.unregisterMap(`${this.pluginKey}.columnMeta`),this.columnStatesManager.destroy(),this.columnMetaCache=null,this.columnStatesManager=null,this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return this.sort(this.getColumnNextConfig(e.col)),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.row===-1&&r.col>=0},relativeToGroup:Js,position:"before",group:mA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(mA)}sort(e){const n=this.getSortConfig(),r=this.getNormalizedSortConfigs(e),i=this.areValidSortConfigs(r);this.hot.runHooks("beforeColumnSort",n,r,i)!==!1&&(n.length===0&&this.indexesSequenceCache===null&&(this.indexesSequenceCache=this.hot.rowIndexMapper.registerMap(this.pluginKey,new DD),this.indexesSequenceCache.setValues(this.hot.rowIndexMapper.getIndexesSequence())),i&&(this.columnStatesManager.setSortStates(r),this.sortByPresetSortStates(r),this.saveAllSortSettings(r)),this.hot.runHooks("afterColumnSort",n,i?r:n,i),i&&this.hot.render())}clearSort(){this.sort([])}isSorted(){return this.enabled&&!this.columnStatesManager.isListOfSortedColumnsEmpty()}getSortConfig(e){return ae(e)?this.columnStatesManager.getColumnSortState(e):this.columnStatesManager.getSortStates()}setSortConfig(e){const n=this.getNormalizedSortConfigs(e);this.areValidSortConfigs(n)&&this.columnStatesManager.setSortStates(n)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e.slice(0,1):[e]}areValidSortConfigs(e){const n=this.hot.countCols();return Z7(e)&&e.every(r=>{let{column:i}=r;return i<=n&&i>=0})}saveAllSortSettings(e){const n=this.columnStatesManager.getAllColumnsProperties(),r=i=>{let{column:o,...s}=i;return{column:this.hot.toPhysicalColumn(o),...s}};n.initialConfig=Be(e,r),this.hot.runHooks("persistentStateSave","columnSorting",n)}getAllSavedSortSettings(){const e={};this.hot.runHooks("persistentStateLoad","columnSorting",e);const n=e.value,r=i=>{let{column:o,...s}=i;return{column:this.hot.toVisualColumn(o),...s}};return ae(n)&&Array.isArray(n.initialConfig)&&(n.initialConfig=Be(n.initialConfig,r)),n}getColumnNextConfig(e){const n=this.columnStatesManager.getSortOrderOfColumn(e);if(ae(n)){const i=gA(n);return ae(i)?{column:e,sortOrder:i}:void 0}const r=this.hot.countCols();if(Number.isInteger(e)&&e>=0&&e<r)return{column:e,sortOrder:gA()}}getNextSortConfig(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dm;const r=this.columnStatesManager.getIndexOfColumnInSortQueue(e),i=r!==-1,o=this.getSortConfig(),s=this.getColumnNextConfig(e);if(i){if(It(s))return[...o.slice(0,r),...o.slice(r+1)];if(n===dm)return[...o.slice(0,r),...o.slice(r+1),s];if(n===u5)return[...o.slice(0,r),s,...o.slice(r+1)]}return ae(s)?o.concat(s):o}getPluginColumnConfig(e){if(Ae(e)){const n=e[this.pluginKey];if(Ae(n))return n}return{}}getMergedPluginSettings(e){const n=this.hot.getSettings()[this.pluginKey],r=this.columnStatesManager.getAllColumnsProperties(),i=this.hot.getCellMeta(0,e),o=Object.getPrototypeOf(i);return Array.isArray(o.columns)?Object.assign(r,n,this.getPluginColumnConfig(o.columns[e])):ot(o.columns)?Object.assign(r,n,this.getPluginColumnConfig(o.columns(e))):Object.assign(r,n)}getFirstCellSettings(e){const n=this.hot.getCellMeta(0,e),r=Object.create(n);return r[this.pluginKey]=this.columnMetaCache.getValueAtIndex(this.hot.toPhysicalColumn(e)),r}getNumberOfRowsToSort(e){const n=this.hot.getSettings();return n.maxRows<=e?n.maxRows:e-n.minSpareRows}sortByPresetSortStates(e){if(this.hot.rowIndexMapper.setIndexesSequence(this.indexesSequenceCache.getValues()),e.length===0)return;const n=[],r=this.hot.countRows(),i=u=>Be(e,c=>this.hot.getDataAtCell(u,c.column));for(let u=0;u<this.getNumberOfRowsToSort(r);u+=1)n.push([this.hot.toPhysicalRow(u)].concat(i(u)));const o=Be(n,u=>u[0]);K7(n,this.pluginKey,Be(e,u=>u.sortOrder),Be(e,u=>this.getFirstCellSettings(u.column)));for(let u=n.length;u<r;u+=1)n.push([u].concat(i(u)));const s=Be(n,u=>u[0]),a=new Map(Be(o,(u,c)=>[u,s[c]])),l=Be(this.hot.rowIndexMapper.getIndexesSequence(),u=>a.has(u)?a.get(u):u);this.hot.rowIndexMapper.setIndexesSequence(l)}sortBySettings(e){if(Ae(e)){this.columnStatesManager.updateAllColumnsProperties(e);const n=e.initialConfig;(Array.isArray(n)||Ae(n))&&this.sort(n)}else this.hot.render()}updateHeaderClasses(e){if(pe(e,n5()),this.enabled!==!1){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];q(e,t5(...r))}}onUpdateSettings(e){super.onUpdateSettings(e),this.columnMetaCache!==null&&this.columnMetaCache.init(this.hot.columnIndexMapper.getNumberOfIndexes()),ae(e[this.pluginKey])&&this.sortBySettings(e[this.pluginKey])}wasClickableHeaderClicked(e,n){return this.getFirstCellSettings(n)[this.pluginKey].headerAction&&ve(e.target,Xk)}onAfterOnCellMouseDown(e,n){if(oT(n.row,n.col,e)!==!1&&this.wasClickableHeaderClicked(e,n.col)){this.hot.getShortcutManager().isCtrlPressed()&&(this.hot.deselectCell(),this.hot.selectColumns(n.col));const r=this.hot.getActiveEditor(),i=this.getColumnNextConfig(n.col);r!=null&&r.isOpened()&&this.hot.getCellValidator(r.row,r.col)?this.hot.addHookOnce("postAfterValidate",()=>{this.sort(i)}):this.sort(i)}}destroy(){var e;(e=this.columnStatesManager)===null||e===void 0||e.destroy(),super.destroy()}}function SS(){const t=this.getAllSavedSortSettings();if(Ae(t))this.sortBySettings(t);else{const e=this.hot.getSettings()[this.pluginKey];this.sortBySettings(e)}}function c5(t,e){const n=Zk(e);if(Qk(t,e)===!1||n===null)return;const r=this.getFirstCellSettings(t)[this.pluginKey],i=r.indicator,o=r.headerAction;if(this.updateHeaderClasses(n,this.columnStatesManager,t,i,o),this.hot.getSettings().ariaTags){const s=this.columnStatesManager.getSortOrderOfColumn(t);ye(e,...ZU(s?`${s}ending`:"none"))}}function h5(t){t===!0&&this.hot.view&&gu(ja,this,SS).call(this)}function d5(t,e,n,r){oT(e.row,e.col,t)!==!1&&this.wasClickableHeaderClicked(t,e.col)&&this.hot.getShortcutManager().isCtrlPressed()&&(r.column=!0)}function Ca(t,e,n){return(e=f5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f5(t){var e=g5(t,"string");return typeof e=="symbol"?e:e+""}function g5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class m5{constructor(e,n){Ca(this,"plugin",void 0),Ca(this,"hot",void 0),Ca(this,"endpoints",[]),Ca(this,"settings",void 0),Ca(this,"settingsType","array"),Ca(this,"currentEndpoint",null),Ca(this,"cellsToSetCache",[]),this.plugin=e,this.hot=this.plugin.hot,this.settings=n}initEndpoints(){this.endpoints=this.parseSettings(),this.refreshAllEndpoints()}getEndpoint(e){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings)[e]:this.endpoints[e]}getAllEndpoints(){return this.settingsType==="function"?this.fillMissingEndpointData(this.settings):this.endpoints}fillMissingEndpointData(e){return this.parseSettings(e.call(this))}parseSettings(e){const n=[];let r=e;if(!r&&typeof this.settings=="function"){this.settingsType="function";return}return r||(r=this.settings),I(r,i=>{const o={};this.assignSetting(i,o,"ranges",[[0,this.hot.countRows()-1]]),this.assignSetting(i,o,"reversedRowCoords",!1),this.assignSetting(i,o,"destinationRow",new Error(`
254
+ You must provide a destination row for the Column Summary plugin in order to work properly!
255
+ `)),this.assignSetting(i,o,"destinationColumn",new Error(`
256
+ You must provide a destination column for the Column Summary plugin in order to work properly!
257
+ `)),this.assignSetting(i,o,"sourceColumn",i.destinationColumn),this.assignSetting(i,o,"type","sum"),this.assignSetting(i,o,"forceNumeric",!1),this.assignSetting(i,o,"suppressDataTypeErrors",!0),this.assignSetting(i,o,"customFunction",null),this.assignSetting(i,o,"readOnly",!0),this.assignSetting(i,o,"roundFloat",!1),n.push(o)}),n}assignSetting(e,n,r,i){if(r==="ranges"&&e[r]===void 0){n[r]=i;return}else if(r==="ranges"&&e[r].length===0)return;if(e[r]===void 0){if(i instanceof Error)throw i;n[r]=i}else r==="destinationRow"&&n.reversedRowCoords?n[r]=this.hot.countRows()-e[r]-1:n[r]=e[r]}resetSetupBeforeStructureAlteration(e,n,r){if(this.settingsType!=="function")return;const i=e.indexOf("row")>-1?"row":"col",o=this.getAllEndpoints();I(o,s=>{i==="row"&&s.destinationRow>=n&&(e==="insert_row"?s.alterRowOffset=r:e==="remove_row"&&(s.alterRowOffset=-1*r)),i==="col"&&s.destinationColumn>=n&&(e==="insert_col"?s.alterColumnOffset=r:e==="remove_col"&&(s.alterColumnOffset=-1*r))}),this.resetAllEndpoints(o,!1)}resetSetupAfterStructureAlteration(e,n,r,i,o){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(this.settingsType==="function"){const d=()=>(this.hot.removeHook("beforeViewRender",d),this.refreshAllEndpoints());this.hot.addHookOnce("beforeViewRender",d);return}const a=e.indexOf("row")>-1?"row":"col",l=e.indexOf("remove")>-1?-1:1,u=this.getAllEndpoints(),c=e.indexOf("move_row")===0,h=n;I(u,d=>{a==="row"&&d.destinationRow>=h&&(d.alterRowOffset=l*r),a==="col"&&d.destinationColumn>=h&&(d.alterColumnOffset=l*r)}),this.resetAllEndpoints(u,!c),c?I(u,d=>{this.extendEndpointRanges(d,h,i[0],i.length),this.recreatePhysicalRanges(d),this.clearOffsetInformation(d)}):I(u,d=>{this.shiftEndpointCoordinates(d,h)}),s&&this.refreshAllEndpoints()}clearOffsetInformation(e){e.alterRowOffset=void 0,e.alterColumnOffset=void 0}extendEndpointRanges(e,n,r,i){I(e.ranges,o=>{o[1]&&(n>=o[0]&&n<=o[1]?r>o[1]?o[1]+=i:r<o[0]&&(o[0]-=i):r>=o[0]&&r<=o[1]&&(o[1]-=i,n<=o[0]&&(o[0]+=1,o[1]+=1)))})}recreatePhysicalRanges(e){const n=e.ranges,r=[],i=[];I(n,o=>{const s=[];if(o[1])for(let a=o[0];a<=o[1];a++)s.push(this.hot.toPhysicalRow(a));else s.push(this.hot.toPhysicalRow(o[0]));i.push(s)}),I(i,o=>{let s=[];I(o,(a,l)=>{l===0?s.push(a):o[l]!==o[l-1]+1&&(s.push(o[l-1]),r.push(s),s=[],s.push(a)),l===o.length-1&&(s.push(a),r.push(s))})}),e.ranges=r}shiftEndpointCoordinates(e,n){e.alterRowOffset&&e.alterRowOffset!==0?(e.destinationRow+=e.alterRowOffset||0,I(e.ranges,r=>{I(r,(i,o)=>{i>=n&&(r[o]+=e.alterRowOffset||0)})})):e.alterColumnOffset&&e.alterColumnOffset!==0&&(e.destinationColumn+=e.alterColumnOffset||0,e.sourceColumn+=e.alterColumnOffset||0)}resetAllEndpoints(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getAllEndpoints(),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;e.some(i=>{const o=i.alterRowOffset||0,s=i.alterColumnOffset||0;return i.destinationRow+o>=this.hot.countRows()||i.destinationColumn+s>=this.hot.countCols()})||(this.cellsToSetCache=[],I(e,i=>{this.resetEndpointValue(i,n)}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[])}refreshAllEndpoints(){this.cellsToSetCache=[],I(this.getAllEndpoints(),e=>{this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e,"init")}),this.currentEndpoint=null,this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshChangedEndpoints(e){const n=[];this.cellsToSetCache=[],I(e,(r,i,o)=>{`${r[2]||""}`!=`${r[3]}`&&I(this.getAllEndpoints(),(s,a)=>{this.hot.propToCol(o[i][1])===s.sourceColumn&&n.indexOf(a)===-1&&n.push(a)})}),I(n,r=>{this.refreshEndpoint(this.getEndpoint(r))}),this.hot.setDataAtCell(this.cellsToSetCache,"ColumnSummary.reset"),this.cellsToSetCache=[]}refreshCellMetas(){this.endpoints.forEach(e=>{const n=this.hot.toVisualRow(e.destinationRow);if(n!==null){const r=this.hot.getCellMeta(n,e.destinationColumn);r.readOnly=e.readOnly,r.className="columnSummaryResult"}})}refreshEndpoint(e){this.currentEndpoint=e,this.plugin.calculate(e),this.setEndpointValue(e),this.currentEndpoint=null}resetEndpointValue(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;const r=e.alterRowOffset||0,i=e.alterColumnOffset||0;this.cellsToSetCache.push([this.hot.toVisualRow(e.destinationRow+(n?r:0)),this.hot.toVisualColumn(e.destinationColumn+(n?i:0)),""])}setEndpointValue(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=this.hot.toVisualRow(e.destinationRow);if(e.destinationRow>=this.hot.countRows()||e.destinationColumn>=this.hot.countCols()){this.throwOutOfBoundsWarning();return}const o=this.hot.toVisualRow(e.destinationRow);if(o!==null){const s=this.hot.getCellMeta(o,e.destinationColumn);(n==="init"||s.readOnly!==e.readOnly)&&(s.readOnly=e.readOnly,s.className="columnSummaryResult")}if((e.roundFloat===!0||Number.isInteger(e.roundFloat))&&!isNaN(e.result)){const s=e.roundFloat;let a=0;Number.isInteger(s)&&(a=Math.min(Math.max(0,s),100)),e.result=e.result.toFixed(a)}r?this.hot.setDataAtCell(i,e.destinationColumn,e.result,"ColumnSummary.set"):this.cellsToSetCache.push([i,e.destinationColumn,e.result]),e.alterRowOffset=void 0,e.alterColumnOffset=void 0}throwOutOfBoundsWarning(){Ze("One of the Column Summary plugins' destination points you provided is beyond the table boundaries!")}}function Iy(t){return t==null||isNaN(t)}function p5(t,e){w5(t,e),e.add(t)}function w5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function v5(t,e,n){return(e=C5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C5(t){var e=y5(t,"string");return typeof e=="symbol"?e:e+""}function y5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ef(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Py="columnSummary",b5=220;var Dc=new WeakSet;class S5 extends Xe{constructor(){super(...arguments),p5(this,Dc),v5(this,"endpoints",null)}static get PLUGIN_KEY(){return Py}static get PLUGIN_PRIORITY(){return b5}isEnabled(){return!!this.hot.getSettings()[Py]}enablePlugin(){var e=this;this.enabled||(this.settings=this.hot.getSettings()[Py],this.endpoints=new m5(this,this.settings),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ef(Dc,e,R5).call(e,...r)}),this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ef(Dc,e,T5).call(e,...r)}),this.addHook("afterUpdateSettings",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ef(Dc,e,E5).call(e,...r)}),this.addHook("beforeCreateRow",(n,r,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_row",n,r,null,i)),this.addHook("beforeCreateCol",(n,r,i)=>this.endpoints.resetSetupBeforeStructureAlteration("insert_col",n,r,null,i)),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_row",...r)}),this.addHook("beforeRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupBeforeStructureAlteration("remove_col",...r)}),this.addHook("afterCreateRow",(n,r,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_row",n,r,null,i)),this.addHook("afterCreateCol",(n,r,i)=>this.endpoints.resetSetupAfterStructureAlteration("insert_col",n,r,null,i)),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_row",...r)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.endpoints.resetSetupAfterStructureAlteration("remove_col",...r)}),this.addHook("afterRowMove",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ef(Dc,e,_5).call(e,...r)}),super.enablePlugin())}disablePlugin(){this.endpoints=null,this.settings=null,this.currentEndpoint=null,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.endpoints.initEndpoints(),super.updatePlugin()}calculate(e){switch(e.type.toLowerCase()){case"sum":e.result=this.calculateSum(e);break;case"min":e.result=this.calculateMinMax(e,e.type);break;case"max":e.result=this.calculateMinMax(e,e.type);break;case"count":e.result=this.countEntries(e);break;case"average":e.result=this.calculateAverage(e);break;case"custom":e.result=e.customFunction.call(this,e);break}}calculateSum(e){let n=0;return He(e.ranges,r=>{n+=this.getPartialSum(r,e.sourceColumn)}),n}getPartialSum(e,n){let r=0,i=e[1]||e[0],o=null,s=0;do{if(o=this.getCellValue(i,n),o=Iy(o)?null:o,o!==null){const a=(`${o}`.split(".")[1]||[]).length||1;a>s&&(s=a)}r+=o||0,i-=1}while(i>=e[0]);return Math.round(r*10**s)/10**s}calculateMinMax(e,n){let r=null;return He(e.ranges,i=>{const o=this.getPartialMinMax(i,e.sourceColumn,n);if(r===null&&o!==null&&(r=o),o!==null)switch(n){case"min":r=Math.min(r,o);break;case"max":r=Math.max(r,o);break}}),r===null?"Not enough data":r}getPartialMinMax(e,n,r){let i=null,o=e[1]||e[0],s;do{if(s=this.getCellValue(o,n),s=Iy(s)?null:s,i===null)i=s;else if(s!==null)switch(r){case"min":i=Math.min(i,s);break;case"max":i=Math.max(i,s);break}o-=1}while(o>=e[0]);return i}countEmpty(e,n){let r,i=0,o=e[1]||e[0];do r=this.getCellValue(o,n),r=Iy(r)?null:r,r===null&&(i+=1),o-=1;while(o>=e[0]);return i}countEntries(e){let n=0;const r=e.ranges;return He(r,i=>{const o=i[1]===void 0?1:i[1]-i[0]+1,s=this.countEmpty(i,e.sourceColumn);n+=o,n-=s}),n}calculateAverage(e){const n=this.calculateSum(e),r=this.countEntries(e);return n/r}getCellValue(e,n){const r=this.hot.toVisualRow(e),i=this.hot.toVisualColumn(n);let o=this.hot.getSourceDataAtCell(e,n),s="";if(r!==null&&i!==null&&(s=this.hot.getCellMeta(r,i).className||""),s.indexOf("columnSummaryResult")>-1)return null;if(this.endpoints.currentEndpoint.forceNumeric&&(typeof o=="string"&&(o=o.replace(/,/,".")),o=parseFloat(o)),isNaN(o)&&!this.endpoints.currentEndpoint.suppressDataTypeErrors)throw new Error(nt`ColumnSummary plugin: cell at (${e}, ${n}) is not in a\x20
258
+ numeric format. Cannot do the calculation.`);return o}}function R5(){this.endpoints.initEndpoints()}function E5(t){t.columns!==void 0&&this.endpoints.refreshCellMetas()}function T5(t,e){t&&e!=="ColumnSummary.reset"&&e!=="ColumnSummary.set"&&e!=="loadData"&&this.endpoints.refreshChangedEndpoints(t)}function _5(t,e){this.endpoints.resetSetupBeforeStructureAlteration("move_row",t[0],t.length,t,this.pluginName),this.endpoints.resetSetupAfterStructureAlteration("move_row",e,t.length,t,this.pluginName)}function M5(t,e){oL(t,e),e.add(t)}function Oy(t,e,n){oL(t,e),e.set(t,n)}function oL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function mu(t,e){return t.get(sT(t,e))}function RS(t,e,n){return t.set(sT(t,e),n),n}function sT(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var fm=new WeakMap,Tf=new WeakMap,_f=new WeakMap,pA=new WeakSet;class sL{constructor(){M5(this,pA),Oy(this,fm,!0),Oy(this,Tf,null),Oy(this,_f,new ResizeObserver(e=>sT(pA,this,I5).call(this,e)))}setObservedElement(e){RS(Tf,this,e)}unobserve(){mu(_f,this).unobserve(mu(Tf,this))}observe(){RS(fm,this,!0),mu(_f,this).observe(mu(Tf,this))}destroy(){mu(_f,this).disconnect()}}function I5(t){if(mu(fm,this)||!Array.isArray(t)||!t.length){RS(fm,this,!1);return}t.forEach(e=>{let{borderBoxSize:n}=e;const{inlineSize:r,blockSize:i}=n[0];this.runLocalHooks("resize",r,i)})}ut(sL,Rn);function ya(t,e,n){P5(t,e),e.set(t,n)}function P5(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function at(t,e){return t.get(aL(t,e))}function _o(t,e,n){return t.set(aL(t,e),n),n}function aL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ba=new WeakMap,xy=new WeakMap,Mo=new WeakMap,fs=new WeakMap,gs=new WeakMap,Mf=new WeakMap,jl=new WeakMap;class Xa{static get CLASS_EDITOR_CONTAINER(){return"htCommentsContainer"}static get CLASS_EDITOR(){return"htComments"}static get CLASS_INPUT(){return"htCommentTextArea"}static get CLASS_CELL(){return"htCommentCell"}constructor(e,n){var r=this;ya(this,ba,void 0),ya(this,xy,!1),ya(this,Mo,null),ya(this,fs,void 0),ya(this,gs,void 0),ya(this,Mf,!0),ya(this,jl,new sL),_o(ba,this,e),_o(xy,this,n),_o(fs,this,this.createEditor()),_o(gs,this,at(fs,this).style),at(jl,this).setObservedElement(this.getInputElement()),at(jl,this).addLocalHook("resize",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.runLocalHooks("resize",...o)}),this.hide()}setPosition(e,n){at(gs,this).left=`${e}px`,at(gs,this).top=`${n}px`}setSize(e,n){if(e&&n){const r=this.getInputElement();r.style.width=`${e}px`,r.style.height=`${n}px`}}getSize(){return{width:qt(this.getInputElement()),height:rn(this.getInputElement())}}observeSize(){at(jl,this).observe()}resetSize(){const e=this.getInputElement();e.style.width="",e.style.height=""}setReadOnlyState(e){const n=this.getInputElement();n.readOnly=e}show(){at(gs,this).display="block",_o(Mf,this,!1)}hide(){at(jl,this).unobserve(),at(Mf,this)||(at(gs,this).display="none"),_o(Mf,this,!0)}isVisible(){return at(gs,this).display==="block"}setValue(){const n=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"")||"";this.getInputElement().value=n}getValue(){return this.getInputElement().value}isFocused(){return at(ba,this).activeElement===this.getInputElement()}focus(){this.getInputElement().focus()}createEditor(){const e=at(ba,this).createElement("div"),n=at(ba,this).createElement("textarea");return e.style.display="none",_o(Mo,this,at(ba,this).createElement("div")),at(Mo,this).setAttribute("dir",at(xy,this)?"rtl":"ltr"),q(at(Mo,this),Xa.CLASS_EDITOR_CONTAINER),at(ba,this).body.appendChild(at(Mo,this)),q(e,Xa.CLASS_EDITOR),q(n,Xa.CLASS_INPUT),n.setAttribute("data-hot-input",!0),e.appendChild(n),at(Mo,this).appendChild(e),e}getInputElement(){return at(fs,this).querySelector(`.${Xa.CLASS_INPUT}`)}getEditorElement(){return at(fs,this)}destroy(){const e=at(Mo,this)?at(Mo,this).parentNode:null;at(fs,this).parentNode.removeChild(at(fs,this)),_o(fs,this,null),_o(gs,this,null),at(jl,this).destroy(),e&&e.removeChild(at(Mo,this))}}ut(Xa,Rn);function Ay(t,e,n){return(e=O5(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O5(t){var e=x5(t,"string");return typeof e=="symbol"?e:e+""}function x5(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const A5=250,H5=250;class lL{constructor(e){Ay(this,"wasLastActionShow",!0),Ay(this,"showDebounced",null),Ay(this,"hidingTimer",null),this.updateDelay(e)}hide(){this.wasLastActionShow=!1,this.hidingTimer=setTimeout(()=>{this.wasLastActionShow===!1&&this.runLocalHooks("hide")},H5)}show(e){this.wasLastActionShow=!0,this.showDebounced(e)}cancelHiding(){this.wasLastActionShow=!0,clearTimeout(this.hidingTimer),this.hidingTimer=null}updateDelay(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:A5;this.showDebounced=ip(n=>{this.wasLastActionShow&&this.runLocalHooks("show",n.from.row,n.from.col)},e)}destroy(){this.clearLocalHooks()}}ut(lL,Rn);function N5(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htTop","").replace("htMiddle","").replace("htBottom","").replace(" ","")} ${e}`}function D5(t,e){return t.indexOf(e)!==-1?t:`${t.replace("htLeft","").replace("htCenter","").replace("htRight","").replace("htJustify","").replace(" ","")} ${e}`}function Sa(t,e){const n={};return I(t,r=>{r.forAll((i,o)=>{i>=0&&o>=0&&(n[i]||(n[i]=[]),n[i][o]=e(i,o))})}),n}function _s(t,e,n,r,i){I(t,o=>{o.forAll((s,a)=>{s>=0&&a>=0&&k5(s,a,e,n,r,i)})})}function k5(t,e,n,r,i,o){const s=i(t,e);let a=r;s.className&&(n==="vertical"?a=N5(s.className,r):a=D5(s.className,r)),o(t,e,"className",a)}function uL(t){return`<span class="selected">✓</span>${t}`}function Og(t,e){let n=!1;return Array.isArray(t)&&I(t,r=>(r.forAll((i,o)=>{if(i>=0&&o>=0&&e(i,o))return n=!0,!1}),n)),n}function bp(t,e){const n={top:0,left:0};if(e!==t.ownerDocument){const{frameElement:r}=e.defaultView,{top:i,left:o}=r.getBoundingClientRect();n.top=i,n.left=o}return n}const xe="---------";function L5(){return{name:xe}}const Vr="alignment";function $5(){return{key:Vr,name(){return this.getTranslatedPhrase(kE)},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const t=this.getSelectedRangeLast();return!t||t.isSingleHeader()?!0:!(this.getSelectedRange()&&!this.selection.isSelectedByCorner())},submenu:{items:[{key:`${Vr}:left`,name(){return this.getTranslatedPhrase(LE)},callback(){const t=this.getSelectedRange(),e=Sa(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htLeft";this.runHooks("beforeCellAlignment",e,t,n,r),_s(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Vr}:center`,name(){return this.getTranslatedPhrase($E)},callback(){const t=this.getSelectedRange(),e=Sa(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htCenter";this.runHooks("beforeCellAlignment",e,t,n,r),_s(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Vr}:right`,name(){return this.getTranslatedPhrase(FE)},callback(){const t=this.getSelectedRange(),e=Sa(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htRight";this.runHooks("beforeCellAlignment",e,t,n,r),_s(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Vr}:justify`,name(){return this.getTranslatedPhrase(VE)},callback(){const t=this.getSelectedRange(),e=Sa(t,(i,o)=>this.getCellMeta(i,o).className),n="horizontal",r="htJustify";this.runHooks("beforeCellAlignment",e,t,n,r),_s(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{name:xe},{key:`${Vr}:top`,name(){return this.getTranslatedPhrase(WE)},callback(){const t=this.getSelectedRange(),e=Sa(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htTop";this.runHooks("beforeCellAlignment",e,t,n,r),_s(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Vr}:middle`,name(){return this.getTranslatedPhrase(BE)},callback(){const t=this.getSelectedRange(),e=Sa(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htMiddle";this.runHooks("beforeCellAlignment",e,t,n,r),_s(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1},{key:`${Vr}:bottom`,name(){return this.getTranslatedPhrase(jE)},callback(){const t=this.getSelectedRange(),e=Sa(t,(i,o)=>this.getCellMeta(i,o).className),n="vertical",r="htBottom";this.runHooks("beforeCellAlignment",e,t,n,r),_s(t,n,r,(i,o)=>this.getCellMeta(i,o),(i,o,s,a)=>this.setCellMeta(i,o,s,a)),this.render()},disabled:!1}]}}}const Sp="clear_column";function F5(){return{key:Sp,name(){return this.getTranslatedPhrase(SE)},callback(t,e){const n=e[0].start.col,r=e[0].end.col;this.countRows()&&this.populateFromArray(0,n,[[null]],Math.max(e[0].start.row,e[0].end.row),r,"ContextMenu.clearColumn")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0||!this.selection.isSelectedByColumnHeader())return!0;let e=!1;return t.forAll((n,r)=>{if(n<0||r<0)return!0;const{readOnly:i}=this.getCellMeta(n,r);return i?!0:(e=!0,!1)}),!e}}}const Pd="col_left";function V5(){return{key:Pd,name(){return this.getTranslatedPhrase(pE)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner(),e=this.isRtl()?"insert_col_end":"insert_col_start";this.alter(e,t.col,1,"ContextMenu.columnLeft")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols?!0:this.selection.isSelectedByCorner()?this.countCols()===0:!1},hidden(){return!this.getSettings().allowInsertColumn}}}const Od="col_right";function W5(){return{key:Od,name(){return this.getTranslatedPhrase(wE)},callback(){const t=this.getSelectedRangeLast().getTopRightCorner(),e=this.isRtl()?"insert_col_start":"insert_col_end";this.alter(e,t.col,1,"ContextMenu.columnRight")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByRowHeader()||t.isSingleHeader()&&t.highlight.col<0||this.countSourceCols()>=this.getSettings().maxCols)},hidden(){return!this.getSettings().allowInsertColumn}}}const xd="make_read_only";function B5(){return{key:xd,checkable:!0,ariaChecked(){return Og(this.getSelectedRange(),(e,n)=>this.getCellMeta(e,n).readOnly)},ariaLabel(){return this.getTranslatedPhrase(em)},name(){let t=this.getTranslatedPhrase(em);return Og(this.getSelectedRange(),(n,r)=>this.getCellMeta(n,r).readOnly)&&(t=uL(t)),t},callback(){const t=this.getSelectedRange(),e=Og(t,(n,r)=>this.getCellMeta(n,r).readOnly);I(t,n=>{n.forAll((r,i)=>{r>=0&&i>=0&&this.setCellMeta(r,i,"readOnly",!e)})}),this.render()},disabled(){const t=this.getSelectedRangeLast();return!!(!t||t.isSingleHeader()||this.selection.isSelectedByCorner()||this.countRows()===0||this.countCols()===0||!this.getSelectedRange()||this.getSelectedRange().length===0)}}}const Rp="redo";function j5(){return{key:Rp,name(){return this.getTranslatedPhrase(bE)},callback(){this.getPlugin("undoRedo").redo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isRedoAvailable()}}}const Ad="remove_col";function U5(){return{key:Ad,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[,n,,r]=t[0];n-r!==0&&(e=1)}return this.getTranslatedPhrase(CE,e)},callback(){this.alter("remove_col",e3(this),null,"ContextMenu.removeColumn")},disabled(){if(!this.isColumnModificationAllowed())return!0;const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.col<0)return!0;const e=this.countCols();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByRowHeader()||e===0},hidden(){return!this.getSettings().allowRemoveColumn}}}const Ep="remove_row";function z5(){return{key:Ep,name(){const t=this.getSelected();let e=0;if(t)if(t.length>1)e=1;else{const[n,,r]=t[0];n-r!==0&&(e=1)}return this.getTranslatedPhrase(vE,e)},callback(){this.alter("remove_row",t3(this),1,"ContextMenu.removeRow")},disabled(){const t=this.getSelectedRangeLast();if(!t||t.isSingleHeader()&&t.highlight.row<0)return!0;const e=this.countRows();return this.selection.isSelectedByCorner()?e===0:this.selection.isSelectedByColumnHeader()||e===0},hidden(){return!this.getSettings().allowRemoveRow}}}const Tp="row_above";function Y5(){return{key:Tp,name(){return this.getTranslatedPhrase(gE)},callback(){const t=this.getSelectedRangeLast().getTopLeftCorner();this.alter("insert_row_above",t.row,1,"ContextMenu.rowAbove")},disabled(){const t=this.getSelectedRangeLast();return!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows?!0:this.selection.isSelectedByCorner()?this.countRows()===0:!1},hidden(){return!this.getSettings().allowInsertRow}}}const _p="row_below";function G5(){return{key:_p,name(){return this.getTranslatedPhrase(mE)},callback(){const t=this.getSelectedRangeLast().getBottomRightCorner();this.alter("insert_row_below",t.row,1,"ContextMenu.rowBelow")},disabled(){const t=this.getSelectedRangeLast();return!!(!t||this.selection.isSelectedByColumnHeader()||t.isSingleHeader()&&t.highlight.row<0||this.countSourceRows()>=this.getSettings().maxRows)},hidden(){return!this.getSettings().allowInsertRow}}}const Qh="no_items";function q5(){return{key:Qh,name(){return this.getTranslatedPhrase(fE)},disabled:!0,isCommand:!1}}const Mp="undo";function K5(){return{key:Mp,name(){return this.getTranslatedPhrase(yE)},callback(){this.getPlugin("undoRedo").undo()},hidden(){const t=this.getPlugin("undoRedo");return!t||!t.isEnabled()},disabled(){return!this.getPlugin("undoRedo").isUndoAvailable()}}}const X5=[Tp,_p,Pd,Od,Sp,Ep,Ad,Mp,Rp,xd,Vr,xe,Qh],Z5={[xe]:L5,[Qh]:q5,[Tp]:Y5,[_p]:G5,[Pd]:V5,[Od]:W5,[Sp]:F5,[Ep]:z5,[Ad]:U5,[Mp]:K5,[Rp]:j5,[xd]:B5,[Vr]:$5};function cL(){const t={};return He(Z5,(e,n)=>{t[n]=e()}),t}function Q5(t){return{key:"commentsAddEdit",name(){var e;const n=(e=this.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n!=null&&n.isCell()&&t.getCommentAtCell(n.row,n.col)?this.getTranslatedPhrase(HE):this.getTranslatedPhrase(AE)},callback(){const e=this.getSelectedRangeLast();t.setRange(e),t.show(),t.focusEditor()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function J5(t){return{key:"commentsRemove",name(){return this.getTranslatedPhrase(NE)},callback(){this.getSelectedRangeLast().forAll((n,r)=>{n>=0&&r>=0&&t.removeCommentAtCell(n,r,!1)}),this.render()},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function eZ(t){return{key:"commentsReadOnly",name(){const e=this.getTranslatedPhrase(DE);return Og(this.getSelectedRange(),(r,i)=>t.getCommentMeta(r,i,xg))?uL(e):e},callback(){this.getSelectedRangeLast().forAll((n,r)=>{if(n>=0&&r>=0){const i=!!t.getCommentMeta(n,r,xg);t.updateCommentMeta(n,r,{[xg]:!i})}})},disabled(){const e=this.getSelectedRangeLast();return!!(!e||e.highlight.isHeader()||!t.getCommentAtCell(e.highlight.row,e.highlight.col)||this.selection.isEntireRowSelected()&&this.selection.isEntireColumnSelected()||this.countRenderedRows()===0||this.countRenderedCols()===0)}}}function tZ(t,e){hL(t,e),e.add(t)}function Ul(t,e,n){hL(t,e),e.set(t,n)}function hL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nZ(t,e,n){return(e=rZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rZ(t){var e=iZ(t,"string");return typeof e=="symbol"?e:e+""}function iZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fs(t,e,n){return t.set(rr(t,e),n),n}function Ie(t,e){return t.get(rr(t,e))}function rr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const gm="comments",oZ=60,$o="comment",fh="value",dL="style",xg="readOnly",kc=gm,ES=`plugin:${gm}`;var it=new WeakMap,Zi=new WeakMap,Ip=new WeakMap,Ag=new WeakMap,TS=new WeakMap,mm=new WeakMap,mr=new WeakSet;class sZ extends Xe{constructor(){super(...arguments),tZ(this,mr),nZ(this,"range",{}),Ul(this,it,null),Ul(this,Zi,null),Ul(this,Ip,!1),Ul(this,Ag,!1),Ul(this,TS,null),Ul(this,mm,"")}static get PLUGIN_KEY(){return gm}static get PLUGIN_PRIORITY(){return oZ}static get DEFAULT_SETTINGS(){return{displayDelay:250}}isEnabled(){return!!this.hot.getSettings()[gm]}enablePlugin(){var e=this;this.enabled||(Ie(it,this)||(Fs(it,this,new Xa(this.hot.rootDocument,this.hot.isRtl())),Ie(it,this).addLocalHook("resize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rr(mr,e,gZ).call(e,...r)})),Ie(Zi,this)||Fs(Zi,this,new lL(this.getSetting("displayDelay"))),this.addHook("afterContextMenuDefaultOptions",n=>this.addToContextMenu(n)),this.addHook("afterRenderer",(n,r,i,o,s,a)=>rr(mr,this,hZ).call(this,n,a)),this.addHook("afterScroll",()=>rr(mr,this,mZ).call(this)),this.addHook("afterBeginEditing",()=>this.hide()),this.addHook("afterDocumentKeyDown",n=>rr(mr,this,wA).call(this,n)),this.addHook("beforeCompositionStart",n=>rr(mr,this,wA).call(this,n)),this.addHook("afterSetTheme",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rr(mr,e,pZ).call(e,...r)}),Ie(Zi,this).addLocalHook("hide",()=>this.hide()),Ie(Zi,this).addLocalHook("show",(n,r)=>this.showAtCell(n,r)),this.registerShortcuts(),this.registerListeners(),super.enablePlugin())}updatePlugin(){Ie(Zi,this).updateDelay(this.getSetting("displayDelay")),super.updatePlugin()}disablePlugin(){this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager(),n=e.getContext("grid"),r=e.addContext(ES);n.addShortcut({keys:[["Control","Alt","M"]],callback:()=>{const i=this.hot.getSelectedRangeLast();Fs(Ag,this,!0),this.hot.scrollToFocusedCell(()=>{this.setRange(i),this.show(),this.focusEditor(),e.setActiveContextName(ES),this.hot._registerTimeout(()=>{Fs(Ag,this,!1)})})},stopPropagation:!0,runOnlyIf:()=>{var i;return(i=this.hot.getSelectedRangeLast())===null||i===void 0?void 0:i.highlight.isCell()},group:kc}),r.addShortcut({keys:[["Escape"]],callback:()=>{Ie(it,this).setValue(Ie(mm,this)),this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ie(it,this).isVisible()&&Ie(it,this).isFocused(),group:kc}),r.addShortcut({keys:[["Control/Meta","Enter"]],callback:()=>{this.hide(),e.setActiveContextName("grid")},runOnlyIf:()=>Ie(it,this).isVisible()&&Ie(it,this).isFocused(),group:kc}),r.addShortcut({keys:[["Shift","Tab"],["Tab"]],forwardToContext:e.getContext("grid"),callback:()=>{Ie(it,this).setValue(Ie(it,this).getValue()),this.hide(),e.setActiveContextName("grid")},group:kc})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(kc)}registerListeners(){const{rootDocument:e}=this.hot,n=this.getEditorInputElement();this.eventManager.addEventListener(e,"mouseover",r=>rr(mr,this,uZ).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>rr(mr,this,aZ).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>rr(mr,this,cZ).call(this)),this.eventManager.addEventListener(n,"focus",()=>rr(mr,this,fZ).call(this)),this.eventManager.addEventListener(n,"blur",()=>rr(mr,this,dZ).call(this)),this.eventManager.addEventListener(this.getEditorInputElement(),"mousedown",r=>rr(mr,this,lZ).call(this,r))}setRange(e){this.range=e}clearRange(){this.range={}}targetIsCellWithComment(e){const n=il(e.target,"TD","TBODY");return!!(n&&ve(n,"htCommentCell")&&il(n,[this.hot.rootElement]))}targetIsCommentTextArea(e){return this.getEditorInputElement()===e.target}setComment(e){if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const n=Ie(it,this).getValue();let r="";e!=null?r=e:n!=null&&(r=n);const i=this.range.from.row,o=this.range.from.col;this.updateCommentMeta(i,o,{[fh]:r}),this.hot.render()}setCommentAtCell(e,n,r){this.setRange({from:this.hot._createCellCoords(e,n)}),this.setComment(r)}removeComment(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');this.hot.setCellMeta(this.range.from.row,this.range.from.col,$o),e&&this.hot.render(),this.hide()}removeCommentAtCell(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this.setRange({from:this.hot._createCellCoords(e,n)}),this.removeComment(r)}getComment(){const e=this.range.from.row,n=this.range.from.col;return this.getCommentMeta(e,n,fh)}getCommentAtCell(e,n){return this.getCommentMeta(e,n,fh)}show(){var e;if(!this.range.from)throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');const{from:{row:n,col:r}}=this.range;if(n<0||n>this.hot.countSourceRows()-1||r<0||r>this.hot.countSourceCols()-1)return!1;const i=this.hot.getCellMeta(this.range.from.row,this.range.from.col);return Ie(Zi,this).cancelHiding(),Ie(it,this).setValue((e=i[$o]?i[$o][fh]:null)!==null&&e!==void 0?e:""),Ie(it,this).show(),this.refreshEditor(!0),!0}showAtCell(e,n){return this.setRange({from:this.hot._createCellCoords(e,n)}),this.show()}hide(){Ie(it,this).hide()}refreshEditor(){if(!(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&(!this.range.from||!Ie(it,this).isVisible()))return;const{rowIndexMapper:n,columnIndexMapper:r}=this.hot,{row:i,col:o}=this.range.from;let s=n.getRenderableFromVisualIndex(i),a=r.getRenderableFromVisualIndex(o);const l=s===null;Ie(it,this).setPosition(0,0),s===null&&(s=n.getRenderableFromVisualIndex(n.getNearestNotHiddenIndex(i,-1))),a===null&&(a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(o,-1)));const u=s===null,c=a===null;s=s??0,a=a??0;const{rootWindow:h,view:{_wt:d}}=this.hot,{wtTable:f}=d,m=d.getCell({row:s,col:a},!0),C=this.getCommentMeta(i,o,dL);C?Ie(it,this).setSize(C.width,C.height):Ie(it,this).resetSize();const y=c?0:f.getColumnWidth(a),E=l&&!u?rn(m):0,{left:v,top:_,width:A,height:L}=m.getBoundingClientRect(),{width:T,height:P}=Ie(it,this).getSize(),{innerWidth:Y,innerHeight:U}=this.hot.rootWindow,W=this.hot.rootDocument.documentElement,Z=yn(this.hot.rootDocument),J=BN(this.hot.rootWindow)?Z:0,se=jN(this.hot.rootWindow)?Z:0;let te=v+h.scrollX+y,ue=_+h.scrollY+E;this.hot.isRtl()&&(te-=T+y),this.hot.isLtr()&&v+A+T>Y-J?te=v+h.scrollX-T-1:this.hot.isRtl()&&te<-(W.scrollWidth-W.clientWidth)&&(te=v+h.scrollX+y+1),_+P>U-se&&(ue-=P-L+1),Ie(it,this).setPosition(te,ue),Ie(it,this).setReadOnlyState(this.getCommentMeta(i,o,xg)),Ie(it,this).observeSize()}focusEditor(){Ie(it,this).focus()}updateCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n)[$o];let o;i?(o=Gn(i),op(o,r)):o=r,this.hot.setCellMeta(e,n,$o,o)}getCommentMeta(e,n,r){const i=this.hot.getCellMeta(e,n);if(i[$o])return i[$o][r]}addToContextMenu(e){e.items.push({name:xe},Q5(this),J5(this),eZ(this))}getEditorInputElement(){return Ie(it,this).getInputElement()}destroy(){var e,n;(e=Ie(it,this))===null||e===void 0||e.destroy(),(n=Ie(Zi,this))===null||n===void 0||n.destroy(),super.destroy()}}function aZ(t){if(!(!this.hot.view||!this.hot.view._wt)&&!Ie(Ip,this)&&!this.targetIsCommentTextArea(t)){const e=il(t.target,"TD","TBODY");let n=null;e&&(n=this.hot.getCoords(e)),(!e||this.range.from&&n&&(this.range.from.row!==n.row||this.range.from.col!==n.col))&&this.hide()}}function lZ(t){t.stopPropagation()}function uZ(t){const{rootDocument:e}=this.hot;if(!(Ie(Ip,this)||Ie(it,this).isFocused()||ve(t.target,"wtBorder")||Ie(TS,this)===t.target||!Ie(it,this)))if(Fs(TS,this,e.elementFromPoint(t.clientX,t.clientY)),this.targetIsCellWithComment(t)){const n=this.hot._createCellRange(this.hot.getCoords(t.target));Ie(Zi,this).show(n)}else tl(t.target,e)&&!this.targetIsCommentTextArea(t)&&Ie(Zi,this).hide()}function cZ(){Fs(Ip,this,!1)}function hZ(t,e){e[$o]&&e[$o][fh]&&q(t,e.commentedCellClassName)}function dZ(){Fs(mm,this,""),this.hot.getShortcutManager().setActiveContextName("grid"),this.setComment()}function fZ(){Fs(mm,this,this.getComment()),this.hot.listen(),this.hot.getShortcutManager().setActiveContextName(ES)}function gZ(t,e){this.updateCommentMeta(this.range.from.row,this.range.from.col,{[dL]:{width:t,height:e}})}function wA(t){Ie(it,this).isFocused()&&Pi(t)}function mZ(){Ie(Ag,this)||this.hide()}function pZ(){const t=Ie(it,this).getEditorElement();pe(t,/ht-theme-.*/g),q(t,this.hot.getCurrentThemeName())}function Hy(t,e,n){return(e=wZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wZ(t){var e=vZ(t,"string");return typeof e=="symbol"?e:e+""}function vZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class fL{constructor(e){Hy(this,"hot",void 0),Hy(this,"commands",{}),Hy(this,"commonCallback",null),this.hot=e}registerCommand(e,n){this.commands[e]=n}setCommonCallback(e){this.commonCallback=e}execute(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];const o=e.split(":"),s=o[0],a=o.length===2?o[1]:null;let l=this.commands[s];if(!l)throw new Error(`Menu command '${s}' not exists.`);if(a&&l.submenu&&(l=CZ(a,l.submenu.items)),l.disabled===!0||typeof l.disabled=="function"&&l.disabled.call(this.hot)===!0||nn(l,"submenu"))return;const u=[];typeof l.callback=="function"&&u.push(l.callback),typeof this.commonCallback=="function"&&u.push(this.commonCallback),r.unshift(o.join(":")),I(u,c=>c.apply(this.hot,r))}}function CZ(t,e){let n;return I(e,r=>{const i=r.key?r.key.split(":"):null;if(Array.isArray(i)&&i[1]===t)return n=r,!1}),n}function Ny(t,e,n){return(e=yZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yZ(t){var e=bZ(t,"string");return typeof e=="symbol"?e:e+""}function bZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class gL{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Ny(this,"hot",void 0),Ny(this,"predefinedItems",cL()),Ny(this,"defaultOrderPattern",void 0),this.hot=e,this.defaultOrderPattern=n}setPredefinedItems(e){const n={};this.defaultOrderPattern.length=0,He(e,(r,i)=>{let o="";r.name===xe?(n[xe]=r,o=xe):isNaN(parseInt(i,10))?(r.key=r.key===void 0?i:r.key,n[i]=r,o=r.key):(n[r.key]=r,o=r.key),this.defaultOrderPattern.push(o)}),this.predefinedItems=n}getItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return SZ(e,this.defaultOrderPattern,this.predefinedItems)}}function SZ(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=[];let i=t;return i&&i.items?i=i.items:Array.isArray(i)||(i=e),Ae(i)?He(i,(o,s)=>{let a=n[typeof o=="string"?o:s];a||(a=o),Ae(o)?on(a,o):typeof a=="string"&&(a={name:a}),a.key===void 0&&(a.key=s),r.push(a)}):I(i,(o,s)=>{let a=n[o];!a&&X5.indexOf(o)>=0||(a||(a={name:o,key:`${s}`}),Ae(o)&&on(a,o),a.key===void 0&&(a.key=s),r.push(a))}),r}function ms(t,e,n){return(e=RZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function RZ(t){var e=EZ(t,"string");return typeof e=="symbol"?e:e+""}function EZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class TZ{constructor(e,n){ms(this,"top",void 0),ms(this,"topRelative",void 0),ms(this,"left",void 0),ms(this,"leftRelative",void 0),ms(this,"scrollTop",void 0),ms(this,"scrollLeft",void 0),ms(this,"cellHeight",void 0),ms(this,"cellWidth",void 0);const r=n.scrollY,i=n.scrollX;let o,s,a,l,u,c;this.rootWindow=n,this.type=this.getSourceType(e),this.type==="literal"?(o=parseInt(e.top,10),a=parseInt(e.left,10),u=e.height||0,c=e.width||0,s=o,l=a,o+=r,a+=i):this.type==="event"&&(o=parseInt(e.pageY,10),a=parseInt(e.pageX,10),u=e.target.clientHeight,c=e.target.clientWidth,s=o-r,l=a-i),this.top=o,this.topRelative=s,this.left=a,this.leftRelative=l,this.scrollTop=r,this.scrollLeft=i,this.cellHeight=u,this.cellWidth=c}getSourceType(e){let n="literal";return e instanceof Event&&(n="event"),n}fitsAbove(e){return this.topRelative>=e.offsetHeight}fitsBelow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerHeight;return this.topRelative+e.offsetHeight<=n}fitsOnRight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rootWindow.innerWidth;return this.leftRelative+this.cellWidth+e.offsetWidth<=n}fitsOnLeft(e){return this.leftRelative>=e.offsetWidth}}function Lc(t,e,n){_Z(t,e),e.set(t,n)}function _Z(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Me(t,e){return t.get(mL(t,e))}function If(t,e,n){return t.set(mL(t,e),n),n}function mL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Ln=new WeakMap,Jn=new WeakMap,er=new WeakMap,Dy=new WeakMap,zl=new WeakMap;class MZ{constructor(e){Lc(this,Ln,void 0),Lc(this,Jn,void 0),Lc(this,er,void 0),Lc(this,Dy,!1),Lc(this,zl,{above:0,below:0,left:0,right:0}),If(Dy,this,e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Me(zl,this)[e]=n,this}setElement(e){return If(Ln,this,e),this}setParentElement(e){return If(Jn,this,e),this}updatePosition(e){If(er,this,new TZ(e,Me(Ln,this).ownerDocument.defaultView)),Me(Dy,this)?(Me(er,this).fitsBelow(Me(Ln,this))?this.setPositionBelowCursor():Me(er,this).fitsAbove(Me(Ln,this))?this.setPositionAboveCursor():this.setPositionBelowCursor(),this.updateHorizontalPosition()):(this.setPositionBelowCursor(),this.setPositionOnRightOfCursor())}updateHorizontalPosition(){Me(Ln,this).dir==="rtl"?Me(er,this).fitsOnLeft(Me(Ln,this))?this.setPositionOnLeftOfCursor():this.setPositionOnRightOfCursor():Me(er,this).fitsOnRight(Me(Ln,this))?this.setPositionOnRightOfCursor():this.setPositionOnLeftOfCursor()}setPositionAboveCursor(){let e=Me(zl,this).above+Me(er,this).top-Me(Ln,this).offsetHeight;if(Me(Jn,this)){const r=Me(Jn,this).ownerDocument.defaultView.getComputedStyle(Me(Jn,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Me(er,this).top+Me(er,this).cellHeight-Me(Ln,this).scrollHeight+i+o}Me(Ln,this).style.top=`${e}px`}setPositionBelowCursor(){let e=Me(zl,this).below+Me(er,this).top+1;if(Me(Jn,this)){const r=Me(Jn,this).ownerDocument.defaultView.getComputedStyle(Me(Jn,this).querySelector(".ht_master")),i=Number.parseInt(r.paddingTop,10),o=Number.parseInt(r.borderTop,10);e=Me(er,this).top-i-o-1}Me(Ln,this).style.top=`${e}px`}setPositionOnRightOfCursor(){let e=Me(er,this).left;if(Me(Jn,this)){const n=Me(Jn,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Me(Jn,this).querySelector(".htCore")).borderRightWidth,10);e+=Me(er,this).cellWidth+r}else e+=Me(zl,this).right;Me(Ln,this).style.left=`${e}px`}setPositionOnLeftOfCursor(){let e=Me(zl,this).left+Me(er,this).left-Me(Ln,this).offsetWidth;if(Me(Jn,this)){const n=Me(Jn,this).ownerDocument.defaultView,r=Number.parseInt(n.getComputedStyle(Me(Jn,this).querySelector(".htCore")).borderLeftWidth,10);e-=r}Me(Ln,this).style.left=`${e}px`}}function pL(t){let{initialPage:e=-1,size:n=()=>0,onItemSelect:r=()=>{},onClear:i=()=>{}}=t;const o=new Set;let s=Ue(e,-1,m()-1);function a(y,E){const v=m()-1;return y<0&&(y=v),y>v&&(y=0),o.has(y)?-1:(o.add(y),r(y,!1)===!1&&(y=a(E===1?++y:--y,E)),y)}function l(y){y>-1&&y<m()&&r(y,!0)!==!1&&(s=y)}function u(){return s}function c(){m()>0&&(o.clear(),s=a(0,1))}function h(){m()>0&&(o.clear(),s=a(m()-1,-1))}function d(){m()>0&&(o.clear(),s=a(++s,1))}function f(){m()>0&&(o.clear(),s=a(--s,-1))}function m(){return Math.max(n(),0)}function C(){o.clear(),s=e,i()}return{setCurrentPage:l,getCurrentPage:u,toFirstItem:c,toLastItem:h,toNextItem:d,toPreviousItem:f,getSize:m,clear:C}}function IZ(t){return Be(t,e=>({start:e.getTopStartCorner(),end:e.getBottomEndCorner()}))}function _S(t){return nn(t,"submenu")}function MS(t){return new RegExp(xe,"i").test(t.name)}function Hg(t,e){return t.disabled===!0||typeof t.disabled=="function"&&t.disabled.call(e)===!0}function vA(t){return nn(t,"disableSelection")}function PZ(t){return ve(t,"htSeparator")}function OZ(t){return ve(t,"htSubmenu")}function xZ(t){return ve(t,"htDisabled")}function AZ(t){return ve(t,"htSelectionDisabled")}function HZ(t,e){return!t.hidden||!(typeof t.hidden=="function"&&t.hidden.call(e))}function wL(t,e){const n=t.slice(0);for(let r=0;r<n.length&&n[r].name===e;)n.shift();return n}function NZ(t,e){let n=t.slice(0);return n.reverse(),n=wL(n,e),n.reverse(),n}function DZ(t){const e=[];return I(t,(n,r)=>{r>0?e[e.length-1].name!==n.name&&e.push(n):e.push(n)}),e}function kZ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xe,n=t.slice(0);return n=wL(n,e),n=NZ(n,e),n=DZ(n),n}function LZ(t){return t.checkable===!0}function $Z(t){return pL({size:()=>t.countRows(),onItemSelect(e,n){const r=t.getCell(e,0);if(!r||PZ(r)||xZ(r)||AZ(r))return!1;t.selectCell(e,0,...n?[e,0,!1,!1]:[])},onClear(){t.deselectCell()}})}function FZ(t){const{hot:e,hotMenu:n}=t;return[{keys:[["Control/Meta","A"]],forwardToContext:e.getShortcutManager().getContext("grid"),callback:()=>t.close(!0)},{keys:[["Tab"],["Shift","Tab"]],callback:(r,i)=>{const o=e.getSettings(),s=typeof o.tabMoves=="function"?o.tabMoves(r):o.tabMoves;i.includes("shift")?e.selection.transformStart(-s.row,-s.col):e.selection.transformStart(s.row,s.col),t.close(!0)}},{keys:[["Escape"]],callback:()=>t.close()},{keys:[["ArrowDown"]],callback:()=>t.getNavigator().toNextItem()},{keys:[["ArrowUp"]],callback:()=>t.getNavigator().toPreviousItem()},{keys:[[e.isRtl()?"ArrowLeft":"ArrowRight"]],callback:()=>{const r=n.getSelectedLast();if(r){const i=t.openSubMenu(r[0]);i&&i.getNavigator().toFirstItem()}}},{keys:[[e.isRtl()?"ArrowRight":"ArrowLeft"]],callback:()=>{n.getSelectedLast()&&t.isSubMenu()&&(t.close(),t.isSubMenu()&&t.parentMenu.hotMenu.listen())}},{keys:[["Control/Meta","ArrowUp"],["Home"]],callback:()=>t.getNavigator().toFirstItem()},{keys:[["Control/Meta","ArrowDown"],["End"]],callback:()=>t.getNavigator().toLastItem()},{keys:[["Enter"],["Space"]],callback:r=>{const i=n.getSelectedLast();i&&(n.getSourceDataAtRow(i[0]).submenu?t.openSubMenu(i[0]).getNavigator().toFirstItem():(t.executeCommand(r),t.close(!0)))}},{keys:[["PageUp"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(-n.countVisibleRows(),0):t.getNavigator().toFirstItem()}},{keys:[["PageDown"]],callback:()=>{n.getSelectedLast()?n.selection.transformStart(n.countVisibleRows(),0):t.getNavigator().toLastItem()}}]}const vL="menu",CA=vL;function VZ(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const n=[];r(FZ(t)),e.forEach(u=>{let{shortcuts:c,contextName:h}=u;i(c,h)});function r(u,c){a(c).addShortcuts(u,{group:vL})}function i(u,c){const h=a(c);u.forEach(d=>{let{keys:f}=d;f.forEach(m=>h.removeShortcutsByKeys(m))}),n.push({shortcuts:u,contextName:c}),r(u,c)}function o(){return[...n]}function s(u){return u?`${CA}:${u}`:CA}function a(u){var c;const h=t.hotMenu.getShortcutManager(),d=s(u);return(c=h.getContext(d))!==null&&c!==void 0?c:h.addContext(d)}function l(u){t.hotMenu.getShortcutManager().setActiveContextName(s(u))}return{addCustomShortcuts:i,getCustomShortcuts:o,getContext:a,listen:l}}function WZ(t){return(e,n,r,i,o,s)=>{const a=e.getSourceDataAtRow(r),l=t.rootDocument.createElement("div"),u=typeof s=="function"?s.call(t):s,c=typeof a.ariaLabel=="function"?a.ariaLabel.call(t):a.ariaLabel,h=typeof a.ariaChecked=="function"?a.ariaChecked.call(t):a.ariaChecked;if(ts(n),q(l,"htItemWrapper"),t.getSettings().ariaTags){const d=!Hg(a,t)&&!vA(a)&&!MS(a);ye(n,[...LZ(a)?[BU(),jh(c),NN(h)]:[WU(),jh(u)],...d?[Cl(-1)]:[],...Hg(a,t)?[KU()]:[],..._S(a)?[Gr(!1)]:[]])}n.className="",n.appendChild(l),MS(a)?q(n,"htSeparator"):typeof a.renderer=="function"?(q(n,"htCustomMenuRenderer"),n.appendChild(a.renderer(e,l,r,i,o,u))):Xu(l,u),Hg(a,t)?q(n,"htDisabled"):vA(a)?q(n,"htSelectionDisabled"):_S(a)&&q(n,"htSubmenu")}}function ky(t,e,n){BZ(t,e),e.set(t,n)}function BZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $i(t,e,n){return(e=jZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jZ(t){var e=UZ(t,"string");return typeof e=="symbol"?e:e+""}function UZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ly(t,e,n){return t.set(CL(t,e),n),n}function Ra(t,e){return t.get(CL(t,e))}function CL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const yA=215;var $c=new WeakMap,Pf=new WeakMap,Of=new WeakMap;class tc{get tableBorderWidth(){return Ra(Of,this)===void 0&&this.hotMenu&&Ly(Of,this,parseInt(this.hotMenu.rootWindow.getComputedStyle(this.hotMenu.view._wt.wtTable.TABLE).borderWidth,10)),Ra(Of,this)}constructor(e,n){var r=this;$i(this,"hot",void 0),$i(this,"options",void 0),$i(this,"eventManager",new _i(this)),$i(this,"container",void 0),$i(this,"positioner",void 0),$i(this,"hotMenu",null),$i(this,"hotSubMenus",{}),$i(this,"parentMenu",void 0),$i(this,"menuItems",null),$i(this,"origOutsideClickDeselects",null),ky(this,$c,void 0),ky(this,Pf,void 0),ky(this,Of,void 0),this.hot=e,this.options=n||{parent:null,name:null,className:"",keepInViewport:!0,standalone:!1,minWidth:yA,container:this.hot.rootDocument.documentElement},this.container=this.createContainer(this.options.name),this.positioner=new MZ(this.options.keepInViewport),this.parentMenu=this.options.parent||null,this.registerEvents(),this.isSubMenu()&&this.addLocalHook("afterSelectionChange",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return r.parentMenu.runLocalHooks("afterSelectionChange",...o)}),this.hot.addHook("afterSetTheme",(i,o)=>{if(!o){var s;(s=this.hotMenu)===null||s===void 0||s.useTheme(i)}})}registerEvents(){let e=this.hot.rootWindow;for(;e;)this.eventManager.addEventListener(e.document,"mousedown",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"touchstart",n=>this.onDocumentMouseDown(n)),this.eventManager.addEventListener(e.document,"contextmenu",n=>this.onDocumentContextMenu(n)),e=Au(e)}setMenuItems(e){this.menuItems=e}getNavigator(){return Ra($c,this)}getKeyboardShortcutsCtrl(){return Ra(Pf,this)}getSelectedItem(){return this.hasSelectedItem()?this.hotMenu.getSourceDataAtRow(this.hotMenu.getSelectedLast()[0]):null}hasSelectedItem(){return Array.isArray(this.hotMenu.getSelectedLast())}isSubMenu(){return this.parentMenu!==null}open(){this.runLocalHooks("beforeOpen"),this.container.removeAttribute("style"),this.container.style.display="block";const e=ip(a=>this.openSubMenu(a),300),n=this.options.minWidth||yA;let r=!1,i=rl(this.menuItems,a=>(a.key===Qh&&(r=!0),HZ(a,this.hot)));if(i.length<1&&!r)i.push(cL()[Qh]);else if(i.length===0)return;i=kZ(i,xe);let o=!1;const s={data:i,colHeaders:!1,autoColumnSize:!0,autoWrapRow:!1,modifyColWidth(a){return ae(a)&&a<n?n:a},autoRowSize:!1,readOnly:!0,editor:!1,copyPaste:!1,hiddenRows:!0,maxCols:1,columns:[{data:"name",renderer:WZ(this.hot)}],renderAllRows:!0,fragmentSelection:!1,outsideClickDeselects:!1,disableVisualSelection:"area",layoutDirection:this.hot.isRtl()?"rtl":"ltr",ariaTags:!1,themeName:this.hot.getCurrentThemeName(),beforeRefreshDimensions:()=>!1,beforeOnCellMouseOver:(a,l)=>{Ra($c,this).setCurrentPage(l.row)},afterOnCellMouseOver:(a,l)=>{this.isAllSubMenusClosed()?e(l.row):this.openSubMenu(l.row)},afterOnCellContextMenu:a=>{a.preventDefault(),kP()&&o&&this.hasSelectedItem()&&this.close(!0)},afterSelection:(a,l,u,c,h)=>{this.hotMenu.view.isMouseDown()&&(h.value=!0),this.runLocalHooks("afterSelectionChange",this.getSelectedItem())},beforeOnCellMouseUp:a=>{this.hasSelectedItem()&&(o=!this.isCommandPassive(this.getSelectedItem()),this.executeCommand(a))},afterOnCellMouseUp:a=>{(!kP()||!sl(a))&&o&&this.hasSelectedItem()&&(Yo()||QN()?this.hot._registerTimeout(()=>this.close(!0),325):this.close(!0))},afterUnlisten:()=>{!this.hasSelectedItem()&&this.isOpened()&&this.hotMenu.listen()}};this.origOutsideClickDeselects=this.hot.getSettings().outsideClickDeselects,this.hot.getSettings().outsideClickDeselects=!1,this.hotMenu=new this.hot.constructor(this.container,s),this.hotMenu.addHook("afterInit",()=>this.onAfterInit()),this.hotMenu.init(),Ly($c,this,$Z(this.hotMenu)),Ly(Pf,this,VZ(this)),Ra(Pf,this).listen(),this.focus(),this.isSubMenu()&&this.addLocalHook("afterOpen",()=>this.parentMenu.runLocalHooks("afterSubmenuOpen",this)),this.runLocalHooks("afterOpen",this)}close(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(this.isOpened()){if(e&&this.isSubMenu())this.parentMenu.close();else if(Ra($c,this).clear(),this.closeAllSubMenus(),this.container.style.display="none",this.hotMenu.destroy(),this.hotMenu=null,this.hot.getSettings().outsideClickDeselects=this.origOutsideClickDeselects,this.runLocalHooks("afterClose"),this.isSubMenu()){if(this.hot.getSettings().ariaTags){const n=this.parentMenu.hotMenu.getSelectedLast();if(n){const r=this.parentMenu.hotMenu.getCell(n[0],0);ye(r,[Gr(!1)])}}this.parentMenu.hotMenu.listen()}}}openSubMenu(e){if(!this.hotMenu)return!1;const n=this.hotMenu.getCell(e,0);if(this.closeAllSubMenus(),!n||!OZ(n))return!1;const r=this.hotMenu.getSourceDataAtRow(e),i=new tc(this.hot,{parent:this,name:r.name,className:this.options.className,keepInViewport:!0,container:this.options.container});return i.setMenuItems(r.submenu.items),i.open(),i.setPosition(n.getBoundingClientRect()),this.hotSubMenus[r.key]=i,this.hot.getSettings().ariaTags&&ye(n,[Gr(!0)]),i}closeSubMenu(e){const n=this.hotMenu.getSourceDataAtRow(e),r=this.hotSubMenus[n.key];if(r){r.destroy(),delete this.hotSubMenus[n.key];const i=this.hotMenu.getCell(e,0);this.hot.getSettings().ariaTags&&ye(i,[Gr(!1)])}}closeAllSubMenus(){I(this.hotMenu.getData(),(e,n)=>this.closeSubMenu(n))}isAllSubMenusClosed(){return Object.keys(this.hotSubMenus).length===0}focus(){this.isOpened()&&(this.hotMenu.rootElement.focus({preventScroll:!0}),this.getKeyboardShortcutsCtrl().listen(),this.hotMenu.listen())}destroy(){const e=this.container.parentNode;this.clearLocalHooks(),this.close(),this.parentMenu=null,this.eventManager.destroy(),e&&e.removeChild(this.container)}isOpened(){return this.hotMenu!==null}executeCommand(e){if(!this.isOpened()||!this.hasSelectedItem())return;const n=this.getSelectedItem();if(this.runLocalHooks("select",n,e),this.isCommandPassive(n))return;const r=this.hot.getSelectedRange(),i=r?IZ(r):[];this.runLocalHooks("executeCommand",n.key,i,e),this.isSubMenu()&&this.parentMenu.runLocalHooks("executeCommand",n.key,i,e)}isCommandPassive(e){return e.isCommand===!1||MS(e)||Hg(e,this.hot)||_S(e)}setOffset(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.positioner.setOffset(e,n)}setPosition(e){this.isSubMenu()&&this.positioner.setParentElement(this.parentMenu.container),this.positioner.setElement(this.container).updatePosition(e)}updateMenuDimensions(){const e=this.hotMenu.view.getStylesHandler(),{wtTable:n}=this.hotMenu.view._wt,r=this.hotMenu.getSettings().data,i=n.hider.style,o=n.holder.style,s=parseInt(i.width,10),a=gr(r,(l,u,c)=>{const d=this.hotMenu.getCell(c,0)?rn(this.hotMenu.getCell(c,0)):0;return l+(u.name===xe?1:d)},0);e.isClassicTheme()?(o.width=`${s+3}px`,o.height=`${a+3}px`):(o.width=`${s}px`,o.height=`${a}px`),i.height=o.height}createContainer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;const n=this.options.container.ownerDocument;let r=e,i;return r&&(ot(r)&&(r=r.call(this.hot),r===null||It(r)?r="":r=r.toString()),r=r.replace(/[^A-Za-z0-9]/g,"_"),r=`${this.options.className}Sub_${r}`,i=n.querySelector(`.${this.options.className}.${r}`)),i||(i=n.createElement("div"),q(i,`htMenu handsontable ${this.options.className}`),r&&q(i,r),this.options.container.appendChild(i)),i}onAfterInit(){this.updateMenuDimensions(),this.hot.getSettings().ariaTags&&ye(this.hotMenu.rootElement,[VU(),Cl(-1)])}onDocumentMouseDown(e){this.isOpened()&&(this.options.standalone&&this.hotMenu&&!tl(e.target,this.hotMenu.rootElement)?this.close(!0):(this.isAllSubMenusClosed()||this.isSubMenu())&&!tl(e.target,".htMenu")&&this.close(!0))}onDocumentContextMenu(e){this.isOpened()&&ve(e.target,"htCore")&&tl(e.target,this.hotMenu.rootElement)&&e.preventDefault()}}ut(tc,Rn);function zZ(t,e){YZ(t,e),e.add(t)}function YZ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $y(t,e,n){return(e=GZ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GZ(t){var e=qZ(t,"string");return typeof e=="symbol"?e:e+""}function qZ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xf(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const gh="contextMenu",KZ=70,bA=gh;re.getSingleton().register("afterContextMenuDefaultOptions");re.getSingleton().register("beforeContextMenuShow");re.getSingleton().register("afterContextMenuShow");re.getSingleton().register("afterContextMenuHide");re.getSingleton().register("afterContextMenuExecute");var Fc=new WeakSet;class Pp extends Xe{constructor(){super(...arguments),zZ(this,Fc),$y(this,"commandExecutor",new fL(this.hot)),$y(this,"itemsFactory",null),$y(this,"menu",null)}static get PLUGIN_KEY(){return gh}static get PLUGIN_PRIORITY(){return KZ}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Tp,_p,xe,Pd,Od,xe,Ep,Ad,xe,Mp,Rp,xe,xd,xe,Vr]}isEnabled(){return!!this.hot.getSettings()[gh]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[gh];typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.menu=new tc(this.hot,{className:"htContextMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.menu.addLocalHook("beforeOpen",()=>xf(Fc,this,ZZ).call(this)),this.menu.addLocalHook("afterOpen",()=>xf(Fc,this,QZ).call(this)),this.menu.addLocalHook("afterClose",()=>xf(Fc,this,JZ).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return e.executeCommand.call(e,...i)}),this.addHook("afterOnCellContextMenu",r=>xf(Fc,this,XZ).call(this,r)),this.registerShortcuts(),super.enablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&(this.menu.destroy(),this.menu=null),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control/Meta","Shift","Backslash"],["Shift","F10"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();this.hot.scrollToFocusedCell();const n=this.hot.getCell(e.row,e.col,!0).getBoundingClientRect(),r=bp(this.menu.container,this.hot.rootDocument);this.open({left:n.left+r.left,top:n.top+r.top-1+n.height},{left:n.width,above:-n.height}),this.menu.getNavigator().toFirstItem()},runOnlyIf:()=>{var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n&&this.hot.selection.isCellVisible(n)&&!this.menu.isOpened()},group:bA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(bA)}open(e){var n;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};if((n=this.menu)!==null&&n!==void 0&&n.isOpened())return;this.prepareMenuItems(),this.menu.open();const i=this.menu.tableBorderWidth>0;He(r,(o,s)=>{const a=["below","right"].includes(s)?o+1:o-1;this.menu.setOffset(s,i?o:a)}),this.menu.setPosition(e)}close(){var e;(e=this.menu)===null||e===void 0||e.close(),this.itemsFactory=null}executeCommand(e){this.itemsFactory===null&&this.prepareMenuItems();for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}prepareMenuItems(){this.itemsFactory=new gL(this.hot,Pp.DEFAULT_ITEMS);const e=this.hot.getSettings()[gh],n={items:this.itemsFactory.getItems(e)};this.hot.runHooks("afterContextMenuDefaultOptions",n),this.itemsFactory.setPredefinedItems(n.items);const r=this.itemsFactory.getItems(e);this.hot.runHooks("beforeContextMenuSetItems",r),this.menu.setMenuItems(r),I(r,i=>this.commandExecutor.registerCommand(i.key,i))}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function XZ(t){const e=this.hot.getSettings(),n=e.rowHeaders,r=e.colHeaders;function i(a){return a.nodeName==="TD"||a.parentNode.nodeName==="TD"}const o=t.target;if(this.close(),ve(o,"handsontableInput")||(t.preventDefault(),t.stopPropagation(),!(n||r)&&!i(o)&&!(ve(o,"current")&&ve(o,"wtBorder"))))return;const s=bp(this.menu.container,this.hot.rootDocument);this.open({top:t.clientY+s.top,left:t.clientX+s.left})}function ZZ(){this.hot.runHooks("beforeContextMenuShow",this)}function QZ(){this.hot.runHooks("afterContextMenuShow",this)}function JZ(){this.hot.listen(),this.hot.runHooks("afterContextMenuHide",this)}Pp.SEPARATOR={name:xe};function eQ(t){return{key:"copy",name(){return this.getTranslatedPhrase(RE)},callback(){t.copyCellsOnly()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function tQ(t){return{key:"copy_column_headers_only",name(){const e=this.getSelectedRangeLast(),n=e?Ue(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(_E,n)},callback(){t.copyColumnHeadersOnly()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function nQ(t){return{key:"copy_with_column_group_headers",name(){const e=this.getSelectedRangeLast(),n=e?Ue(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(TE,n)},callback(){t.copyWithAllColumnHeaders()},disabled(){if(!this.hasColHeaders()||!this.getSettings().nestedHeaders)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function rQ(t){return{key:"copy_with_column_headers",name(){const e=this.getSelectedRangeLast(),n=e?Ue(e.getWidth()-1,0,1):0;return this.getTranslatedPhrase(EE,n)},callback(){t.copyWithColumnHeaders()},disabled(){if(!this.hasColHeaders())return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}function iQ(t){return{key:"cut",name(){return this.getTranslatedPhrase(ME)},callback(){t.cut()},disabled(){if(this.countRows()===0||this.countCols()===0)return!0;const e=this.getSelectedRangeLast();if(!e||e.isSingleHeader())return!0;const n=this.getSelected();return!n||n.length>1},hidden:!1}}class oQ{constructor(){this.data={}}setData(e,n){this.data[e]=n}getData(e){return this.data[e]||void 0}}class sQ{constructor(){this.clipboardData=new oQ}preventDefault(){}composedPath(){return[]}}function aQ(t,e){yL(t,e),e.add(t)}function Yl(t,e,n){yL(t,e),e.set(t,n)}function yL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vn(t,e){return t.get(bu(t,e))}function Gl(t,e,n){return t.set(bu(t,e),n),n}function bu(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ps=new WeakMap,Fy=new WeakMap,Vc=new WeakMap,IS=new WeakMap,PS=new WeakMap,Wc=new WeakMap,Bc=new WeakSet;class lQ{constructor(e){let{countRows:n,countColumns:r,rowsLimit:i,columnsLimit:o,countColumnHeaders:s}=e;aQ(this,Bc),Yl(this,ps,void 0),Yl(this,Fy,void 0),Yl(this,Vc,void 0),Yl(this,IS,void 0),Yl(this,PS,void 0),Yl(this,Wc,void 0),Gl(Fy,this,n),Gl(Vc,this,r),Gl(IS,this,i),Gl(PS,this,o),Gl(Wc,this,s)}setSelectedRange(e){Gl(ps,this,e)}getCellsRange(){if(Vn(Fy,this).call(this)===0||Vn(Vc,this).call(this)===0)return null;const{row:e,col:n}=Vn(ps,this).getTopStartCorner(),{row:r,col:i}=Vn(ps,this).getBottomEndCorner(),o=bu(Bc,this,uQ).call(this,e,r),s=bu(Bc,this,Vy).call(this,n,i);return{isRangeTrimmed:r!==o||i!==s,startRow:e,startCol:n,endRow:o,endCol:s}}getMostBottomColumnHeadersRange(){if(Vn(Vc,this).call(this)===0||Vn(Wc,this).call(this)===0)return null;const{col:e}=Vn(ps,this).getTopStartCorner(),{col:n}=Vn(ps,this).getBottomEndCorner(),r=bu(Bc,this,Vy).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-1,startCol:e,endRow:-1,endCol:r}}getAllColumnHeadersRange(){if(Vn(Vc,this).call(this)===0||Vn(Wc,this).call(this)===0)return null;const{col:e}=Vn(ps,this).getTopStartCorner(),{col:n}=Vn(ps,this).getBottomEndCorner(),r=bu(Bc,this,Vy).call(this,e,n);return{isRangeTrimmed:n!==r,startRow:-Vn(Wc,this).call(this),startCol:e,endRow:-1,endCol:r}}}function Vy(t,e){return Math.min(e,Math.max(t+Vn(PS,this).call(this)-1,t))}function uQ(t,e){return Math.min(e,Math.max(t+Vn(IS,this).call(this)-1,t))}function bL(t){const e=[],n=[];return I(t,r=>{const i=Math.min(r.startRow,r.endRow),o=Math.max(r.startRow,r.endRow);de(i,o,l=>{e.indexOf(l)===-1&&e.push(l)});const s=Math.min(r.startCol,r.endCol),a=Math.max(r.startCol,r.endCol);de(s,a,l=>{n.indexOf(l)===-1&&n.push(l)})}),{rows:e,columns:n}}function cQ(t,e){SL(t,e),e.add(t)}function ws(t,e,n){SL(t,e),e.set(t,n)}function SL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jc(t,e,n){return(e=hQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hQ(t){var e=dQ(t,"string");return typeof e=="symbol"?e:e+""}function dQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ar(t,e){return t.get(ur(t,e))}function hi(t,e,n){return t.set(ur(t,e),n),n}function ur(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("afterCopyLimit");re.getSingleton().register("modifyCopyableRange");re.getSingleton().register("beforeCut");re.getSingleton().register("afterCut");re.getSingleton().register("beforePaste");re.getSingleton().register("afterPaste");re.getSingleton().register("beforeCopy");re.getSingleton().register("afterCopy");const Wy="copyPaste",fQ=80,gQ=["fragmentSelection"],SA=['<meta name="generator" content="Handsontable"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join("");var OS=new WeakMap,xS=new WeakMap,AS=new WeakMap,ql=new WeakMap,Af=new WeakMap,Hf=new WeakMap,Kl=new WeakMap,pm=new WeakMap,Rr=new WeakSet;class mQ extends Xe{constructor(){super(...arguments),cQ(this,Rr),jc(this,"columnsLimit",1/0),jc(this,"rowsLimit",1/0),jc(this,"pasteMode","overwrite"),jc(this,"uiContainer",this.hot.rootDocument.body),ws(this,OS,!1),ws(this,xS,!1),ws(this,AS,!1),ws(this,ql,"cells-only"),ws(this,Af,!1),ws(this,Hf,!1),ws(this,Kl,new lQ({countRows:()=>this.hot.countRows(),countColumns:()=>this.hot.countCols(),rowsLimit:()=>this.rowsLimit,columnsLimit:()=>this.columnsLimit,countColumnHeaders:()=>this.hot.view.getColumnHeadersCount()})),ws(this,pm,!1),jc(this,"copyableRanges",[])}static get PLUGIN_KEY(){return Wy}static get SETTING_KEYS(){return[Wy,...gQ]}static get PLUGIN_PRIORITY(){return fQ}static get DEFAULT_SETTINGS(){return{pasteMode:"overwrite",rowsLimit:1/0,columnsLimit:1/0,copyColumnHeaders:!1,copyColumnGroupHeaders:!1,copyColumnHeadersOnly:!1}}isEnabled(){return!!this.hot.getSettings()[Wy]}enablePlugin(){var e,n,r=this;this.enabled||(this.pasteMode=(e=this.getSetting("pasteMode"))!==null&&e!==void 0?e:this.pasteMode,this.rowsLimit=isNaN(this.getSetting("rowsLimit"))?this.rowsLimit:this.getSetting("rowsLimit"),this.columnsLimit=isNaN(this.getSetting("columnsLimit"))?this.columnsLimit:this.getSetting("columnsLimit"),hi(OS,this,this.getSetting("copyColumnHeaders")),hi(xS,this,this.getSetting("copyColumnGroupHeaders")),hi(AS,this,this.getSetting("copyColumnHeadersOnly")),this.uiContainer=(n=this.getSetting("uiContainer"))!==null&&n!==void 0?n:this.uiContainer,this.addHook("afterContextMenuDefaultOptions",i=>ur(Rr,this,vQ).call(this,i)),this.addHook("afterSelection",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ur(Rr,r,CQ).call(r,...o)}),this.addHook("afterSelectionEnd",()=>ur(Rr,this,yQ).call(this)),this.eventManager.addEventListener(this.hot.rootDocument,"copy",function(){return r.onCopy(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"cut",function(){return r.onCut(...arguments)}),this.eventManager.addEventListener(this.hot.rootDocument,"paste",function(){return r.onPaste(...arguments)}),Qg()&&(this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseenter",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ur(Rr,r,bQ).call(r,...o)}),this.eventManager.addEventListener(this.hot.rootDocument.body,"mouseleave",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return ur(Rr,r,SQ).call(r,...o)}),this.addHook("afterSelection",()=>ur(Rr,this,RQ).call(this))),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin()}copy(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"cells-only";hi(ql,this,e),hi(Af,this,!0),ur(Rr,this,RA).call(this,"copy")}copyCellsOnly(){this.copy("cells-only")}copyColumnHeadersOnly(){this.copy("column-headers-only")}copyWithAllColumnHeaders(){this.copy("with-column-group-headers")}copyWithColumnHeaders(){this.copy("with-column-headers")}cut(){hi(Hf,this,!0),ur(Rr,this,RA).call(this,"cut")}getRangedCopyableData(e){return Sh(this.getRangedData(e))}getRangedData(e){const n=[],{rows:r,columns:i}=bL(e);return I(r,o=>{const s=[];I(i,a=>{o<0?s.push(this.hot.getColHeader(a,o)):s.push(this.hot.getCopyableData(o,a))}),n.push(s)}),n}paste(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;if(!e&&!n)return;const r=new sQ;e&&r.clipboardData.setData("text/plain",e),n&&r.clipboardData.setData("text/html",n),this.onPaste(r)}setCopyableText(){const e=this.hot.getSelectedRangeLast();if(!e)return;if(e.isSingleHeader()){this.copyableRanges=[];return}ar(Kl,this).setSelectedRange(e);const n=new Map([["headers",null],["cells",null]]);ar(ql,this)==="column-headers-only"?n.set("headers",ar(Kl,this).getMostBottomColumnHeadersRange()):(ar(ql,this)==="with-column-headers"?n.set("headers",ar(Kl,this).getMostBottomColumnHeadersRange()):ar(ql,this)==="with-column-group-headers"&&n.set("headers",ar(Kl,this).getAllColumnHeadersRange()),n.set("cells",ar(Kl,this).getCellsRange())),this.copyableRanges=Array.from(n.values()).filter(i=>i!==null).map(i=>{let{startRow:o,startCol:s,endRow:a,endCol:l}=i;return{startRow:o,startCol:s,endRow:a,endCol:l}}),this.copyableRanges=this.hot.runHooks("modifyCopyableRange",this.copyableRanges);const r=n.get("cells");if(r!==null&&r.isRangeTrimmed){const{startRow:i,startCol:o,endRow:s,endCol:a}=r;this.hot.runHooks("afterCopyLimit",s-i+1,a-o+1,this.rowsLimit,this.columnsLimit)}}isEditorOpened(){var e;return(e=this.hot.getActiveEditor())===null||e===void 0?void 0:e.isOpened()}populateValues(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.hot.getSelectedRangeLast();if(!e.length)return;const r=e.length,i=e[0].length,o=[],{row:s,col:a}=n.getTopStartCorner(),{row:l,col:u}=n.getBottomEndCorner();let c=s,h=a,d=s,f=a;for(;o.length<r||c<=l;){const{skipRowOnPaste:m,visualRow:C}=this.hot.getCellMeta(c,a);if(c=C+1,m===!0)continue;d=C,h=a;const y=[],E=o.length%r;for(;y.length<i||h<=u;){const{skipColumnOnPaste:v,visualCol:_}=this.hot.getCellMeta(s,h);if(h=_+1,v===!0)continue;f=_;const A=y.length%i;y.push(e[E][A])}o.push(y)}return hi(pm,this,!0),this.hot.populateFromArray(s,a,o,void 0,void 0,"CopyPaste.paste",this.pasteMode),[s,a,d,f]}onCopy(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!ar(Af,this)||this.isEditorOpened()||Jo(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Eg(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),hi(Af,this,!1);const o=this.getRangedData(this.copyableRanges),s=ur(Rr,this,pQ).call(this,this.copyableRanges);if(!!this.hot.runHooks("beforeCopy",o,this.copyableRanges,s)){const l=Sh(o);if(e&&e.clipboardData){const u=hO(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",l),e.clipboardData.setData("text/html",[SA,u].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",l);this.hot.runHooks("afterCopy",o,this.copyableRanges,s)}hi(ql,this,"cells-only")}onCut(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()&&!ar(Hf,this)||this.isEditorOpened()||Jo(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Eg(n,this.hot.rootElement)))return;e.preventDefault(),this.setCopyableText(),hi(Hf,this,!1);const o=this.getRangedData(this.copyableRanges);if(!!this.hot.runHooks("beforeCut",o,this.copyableRanges)){const a=Sh(o);if(e&&e.clipboardData){const l=hO(o,this.hot.rootDocument);e.clipboardData.setData("text/plain",a),e.clipboardData.setData("text/html",[SA,l].join(""))}else typeof ClipboardEvent>"u"&&this.hot.rootWindow.clipboardData.setData("Text",a);this.hot.emptySelectedCells("CopyPaste.cut"),this.hot.runHooks("afterCut",o,this.copyableRanges)}}onPaste(e){const n=e.composedPath()[0],r=this.hot.getFocusManager().getRefocusElement(),i=n==null?void 0:n.hasAttribute("data-hot-input");if(!this.hot.isListening()||this.isEditorOpened()||!this.hot.getSelected()||Jo(n)&&(i&&n!==r||!i&&n!==this.hot.rootDocument.body&&!Eg(n,this.hot.rootElement)))return;e.preventDefault();let o;if(e&&typeof e.clipboardData<"u"){const c=xR(e.clipboardData.getData("text/html"),{ADD_TAGS:["meta"],ADD_ATTR:["content"],FORCE_BODY:!0});c&&/(<table)|(<TABLE)/g.test(c)?o=vY(c,this.hot.rootDocument).data:o=e.clipboardData.getData("text/plain")}else typeof ClipboardEvent>"u"&&typeof this.hot.rootWindow.clipboardData<"u"&&(o=this.hot.rootWindow.clipboardData.getData("Text"));if(typeof o=="string"&&(o=s3(o)),o===void 0||o&&o.length===0||this.hot.runHooks("beforePaste",o,this.copyableRanges)===!1)return;const[s,a,l,u]=this.populateValues(o);this.hot.selectCell(s,a,Math.min(this.hot.countRows()-1,l),Math.min(this.hot.countCols()-1,u)),this.hot.runHooks("afterPaste",o,this.copyableRanges)}destroy(){super.destroy()}}function RA(t){if(Qg()){const e=this.hot.getSelectedRangeLast();if(e){const{row:n,col:r}=e.highlight,i=this.hot.getCell(n,r,!0);i&&pz(i,()=>{this.hot.rootDocument.execCommand(t)})}}else this.hot.rootDocument.execCommand(t)}function pQ(t){const{rows:e}=bL(t);let n=0;for(let r=0;r<e.length&&!(e[r]>=0);r++)n+=1;return{columnHeadersCount:n}}function wQ(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,r=this.hot.getCell(e,n,!0);r&&YN(r)}}}function RL(){if(this.hot.isListening()){const t=this.hot.getSelectedRangeLast();if(t){const{row:e,col:n}=t.highlight,r=this.hot.getCell(e,n,!0);r!=null&&r.hasAttribute("contenteditable")&&GN(r)}}}function vQ(t){t.items.push({name:"---------"},eQ(this)),ar(OS,this)&&t.items.push(rQ(this)),ar(xS,this)&&t.items.push(nQ(this)),ar(AS,this)&&t.items.push(tQ(this)),t.items.push(iQ(this))}function CQ(t,e,n,r,i){ar(pm,this)&&(i.value=!0),hi(pm,this,!1)}function yQ(){this.isEditorOpened()||this.hot.getSettings().fragmentSelection||this.setCopyableText()}function bQ(){ur(Rr,this,RL).call(this)}function SQ(){ur(Rr,this,wQ).call(this)}function RQ(){ur(Rr,this,RL).call(this)}function EL(t,e){return`border_row${t}col${e}`}function mh(){return{width:1,color:"#000"}}function Go(){return{hide:!0}}function EQ(){return{width:1,color:"#000",cornerVisible:!1}}function By(t){if(ae(t.start)||ae(t.left)){var e;t.start=(e=t.start)!==null&&e!==void 0?e:t.left}if(ae(t.end)||ae(t.right)){var n;t.end=(n=t.end)!==null&&n!==void 0?n:t.right}return delete t.left,delete t.right,t}function Uc(t){return ae(t.start)&&(t.left=t.start),ae(t.end)&&(t.right=t.end),t}function jy(t,e){return{id:EL(t,e),border:EQ(),row:t,col:e,top:Go(),bottom:Go(),start:Go(),end:Go()}}function TQ(t,e){return nn(e,"border")&&e.border&&(t.border=e.border),nn(e,"top")&&ae(e.top)&&(e.top?(Ae(e.top)||(e.top=mh()),t.top=e.top):(e.top=Go(),t.top=e.top)),nn(e,"bottom")&&ae(e.bottom)&&(e.bottom?(Ae(e.bottom)||(e.bottom=mh()),t.bottom=e.bottom):(e.bottom=Go(),t.bottom=e.bottom)),nn(e,"start")&&ae(e.start)&&(e.start?(Ae(e.start)||(e.start=mh()),t.start=e.start):(e.start=Go(),t.start=e.start)),nn(e,"end")&&ae(e.end)&&(e.end?(Ae(e.end)||(e.end=mh()),t.end=e.end):(e.end=Go(),t.end=e.end)),t}function rs(t,e){let n=!1;return I(t.getSelectedRange(),r=>{r.forAll((i,o)=>{if(i<0||o<0)return;const s=t.getCellMeta(i,o).borders;if(s)if(e){if(!nn(s[e],"hide")||s[e].hide===!1)return n=!0,!1}else return n=!0,!1})}),n}function Op(t){return`<span class="selected">✓</span>${t}`}function _Q(t){return t.some(e=>ae(e.left)||ae(e.right))}function MQ(t){return t.some(e=>ae(e.start)||ae(e.end))}const IQ=new Map([["left","start"],["right","end"]]);function PQ(t){var e;return(e=IQ.get(t))!==null&&e!==void 0?e:t}function OQ(t){return{key:"borders:bottom",name(){let e=this.getTranslatedPhrase(GE);return rs(this,"bottom")&&(e=Op(e)),e},callback(e,n){const r=rs(this,"bottom");t.prepareBorder(n,"bottom",r)}}}function xQ(t){const e=t.hot.isRtl()?"end":"start";return{key:"borders:left",name(){let n=this.getTranslatedPhrase(qE);return rs(this,e)&&(n=Op(n)),n},callback(n,r){const i=rs(this,e);t.prepareBorder(r,e,i)}}}function AQ(t){return{key:"borders:no_borders",name(){return this.getTranslatedPhrase(KE)},callback(e,n){t.prepareBorder(n,"noBorders")},disabled(){return!rs(this)}}}function HQ(t){const e=t.hot.isRtl()?"start":"end";return{key:"borders:right",name(){let n=this.getTranslatedPhrase(YE);return rs(this,e)&&(n=Op(n)),n},callback(n,r){const i=rs(this,e);t.prepareBorder(r,e,i)}}}function NQ(t){return{key:"borders:top",name(){let e=this.getTranslatedPhrase(zE);return rs(this,"top")&&(e=Op(e)),e},callback(e,n){const r=rs(this,"top");t.prepareBorder(n,"top",r)}}}function DQ(t,e){kQ(t,e),e.add(t)}function kQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function LQ(t,e,n){return(e=$Q(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $Q(t){var e=FQ(t,"string");return typeof e=="symbol"?e:e+""}function FQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function EA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Ng="customBorders",VQ=90;var Uy=new WeakSet;class WQ extends Xe{constructor(){super(...arguments),DQ(this,Uy),LQ(this,"savedBorders",[])}static get PLUGIN_KEY(){return Ng}static get PLUGIN_PRIORITY(){return VQ}isEnabled(){return!!this.hot.getSettings()[Ng]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>EA(Uy,this,BQ).call(this,e)),this.addHook("init",()=>EA(Uy,this,jQ).call(this)),super.enablePlugin())}disablePlugin(){this.hideBorders(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.changeBorderSettings(),super.updatePlugin()}setBorders(e,n){let r=["top","bottom","start","end"],i=null;n&&(this.checkSettingsCohesion([n]),r=Object.keys(n),i=By(n));const o=Du(e),s=qh(o,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)});I(e,a=>{s(a).forAll((l,u)=>{I(r,c=>{this.prepareBorderFromCustomAdded(l,u,i,PQ(c))})})}),this.hot.view.render()}getBorders(e){if(!Array.isArray(e))return this.savedBorders;const n=Du(e),r=qh(n,{createCellCoords:this.hot._createCellCoords.bind(this.hot),createCellRange:this.hot._createCellRange.bind(this.hot)}),i=[];return I(e,o=>{r(o).forAll((s,a)=>{I(this.savedBorders,l=>{l.row===s&&l.col===a&&i.push(Uc(l))})})}),i}clearBorders(e){e?this.setBorders(e):(I(this.savedBorders,n=>{this.clearBordersFromSelectionSettings(n.id),this.clearNullCellRange(),this.hot.removeCellMeta(n.row,n.col,"borders")}),this.savedBorders.length=0)}insertBorderIntoSettings(e,n){this.checkSavedBorders(e)||this.savedBorders.push(e);const i=this.hot._createCellRange(this.hot._createCellCoords(e.row,e.col));this.checkCustomSelections(e,i,n)||this.hot.selection.highlight.addCustomSelection({border:e,visualCellRange:i})}prepareBorderFromCustomAdded(e,n,r,i){const o=this.hot.countRows(),s=this.hot.countCols();if(e>=o||n>=s)return;let a=jy(e,n);r&&(a=TQ(a,r),I(this.hot.selection.highlight.customSelections,l=>{if(a.id===l.settings.id)return Object.assign(l.settings,r),a.id=l.settings.id,a.top=l.settings.top,a.bottom=l.settings.bottom,a.start=l.settings.start,a.end=l.settings.end,!1})),this.hot.setCellMeta(e,n,"borders",Uc(a)),this.insertBorderIntoSettings(a,i)}prepareBorderFromCustomAddedRange(e,n){const r=Math.min(e.to.row,this.hot.countRows()-1),i=Math.min(e.to.col,this.hot.countCols()-1);de(e.from.row,r,o=>{de(e.from.col,i,s=>{const a=jy(o,s);let l=0;o===e.from.row&&nn(n,"top")&&(l+=1,a.top=n.top),o===e.to.row&&nn(n,"bottom")&&(l+=1,a.bottom=n.bottom),s===e.from.col&&nn(n,"start")&&(l+=1,a.start=n.start),s===e.to.col&&nn(n,"end")&&(l+=1,a.end=n.end),l>0&&(this.hot.setCellMeta(o,s,"borders",Uc(a)),this.insertBorderIntoSettings(a))})})}removeAllBorders(e,n){const r=EL(e,n);this.spliceBorder(r),this.clearBordersFromSelectionSettings(r),this.clearNullCellRange(),this.hot.removeCellMeta(e,n,"borders")}setBorder(e,n,r,i){let o=this.hot.getCellMeta(e,n).borders;!o||o.border===void 0?o=jy(e,n):o=By(o),i?(o[r]=Go(),this.countHide(o)===4?this.removeAllBorders(e,n):(this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",Uc(o)))):(o[r]=mh(),this.checkCustomSelectionsFromContextMenu(o,r,i)||this.insertBorderIntoSettings(o),this.hot.setCellMeta(e,n,"borders",Uc(o)))}prepareBorder(e,n,r){I(e,i=>{let{start:o,end:s}=i;if(o.row===s.row&&o.col===s.col)n==="noBorders"?this.removeAllBorders(o.row,o.col):this.setBorder(o.row,o.col,n,r);else switch(n){case"noBorders":de(o.col,s.col,a=>{de(o.row,s.row,l=>{this.removeAllBorders(l,a)})});break;case"top":de(o.col,s.col,a=>{this.setBorder(o.row,a,n,r)});break;case"bottom":de(o.col,s.col,a=>{this.setBorder(s.row,a,n,r)});break;case"start":de(o.row,s.row,a=>{this.setBorder(a,o.col,n,r)});break;case"end":de(o.row,s.row,a=>{this.setBorder(a,s.col,n,r)});break}})}createCustomBorders(e){I(e,n=>{const r=By(n);n.range?this.prepareBorderFromCustomAddedRange(n.range,r):this.prepareBorderFromCustomAdded(n.row,n.col,r)})}countHide(e){const{top:n,bottom:r,start:i,end:o}=e;return gr([n,r,i,o],(a,l)=>{let u=a;return l&&l.hide&&(u+=1),u},0)}clearBordersFromSelectionSettings(e){const n=Be(this.hot.selection.highlight.customSelections,r=>r.settings.id).indexOf(e);n>-1&&this.hot.selection.highlight.customSelections[n].clear()}clearNullCellRange(){I(this.hot.selection.highlight.customSelections,(e,n)=>{if(e.cellRange===null)return this.hot.selection.highlight.customSelections[n].destroy(),this.hot.selection.highlight.customSelections.splice(n,1),!1})}hideBorders(){I(this.savedBorders,e=>{this.clearBordersFromSelectionSettings(e.id),this.clearNullCellRange()})}spliceBorder(e){const n=Be(this.savedBorders,r=>r.id).indexOf(e);n>-1&&this.savedBorders.splice(n,1)}checkSavedBorders(e){let n=!1;return this.countHide(e)===4?(this.spliceBorder(e.id),n=!0):I(this.savedBorders,(i,o)=>{if(e.id===i.id)return this.savedBorders[o]=e,n=!0,!1}),n}checkCustomSelectionsFromContextMenu(e,n,r){let i=!1;return I(this.hot.selection.highlight.customSelections,o=>{if(e.id===o.settings.id){const s=this.hot.view._wt.selectionManager.getBorderInstances(o);return I(s,a=>{a.toggleHiddenClass(n,r)}),i=!0,!1}}),i}checkCustomSelections(e,n,r){const i=this.countHide(e);let o=!1;return i===4?(this.removeAllBorders(e.row,e.col),o=!0):I(this.hot.selection.highlight.customSelections,s=>{if(e.id===s.settings.id){if(s.visualCellRange=n,s.commit(),r){const a=this.hot.view._wt.selectionManager.getBorderInstances(s);I(a,l=>{l.changeBorderStyle(r,e)})}return o=!0,!1}}),o}changeBorderSettings(){const e=this.hot.getSettings()[Ng];if(Array.isArray(e)){const n=Gn(e);this.checkSettingsCohesion(n),n.length||(this.savedBorders=n),this.createCustomBorders(n)}else e!==void 0&&this.createCustomBorders(this.savedBorders)}checkSettingsCohesion(e){const n=_Q(e),r=MQ(e);if(n&&r)throw new Error('The "left"/"right" and "start"/"end" options should not be used together. Please use only the option "start"/"end".');if(this.hot.isRtl()&&n)throw new Error('The "left"/"right" properties are not supported for RTL. Please use option "start"/"end".')}destroy(){super.destroy()}}function BQ(t){this.hot.getSettings()[Ng]&&t.items.push({name:"---------"},{key:"borders",name(){return this.getTranslatedPhrase(UE)},disabled(){const e=this.getSelectedRangeLast();return!e||e.isSingleHeader()?!0:this.selection.isSelectedByCorner()},submenu:{items:[NQ(this),HQ(this),OQ(this),xQ(this),AQ(this)]}})}function jQ(){this.changeBorderSettings()}function UQ(t,e){zQ(t,e),e.add(t)}function zQ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function zy(t,e,n){return(e=YQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function YQ(t){var e=GQ(t,"string");return typeof e=="symbol"?e:e+""}function GQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function TA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const _A="dragToScroll",qQ=100;var Yy=new WeakSet;class KQ extends Xe{constructor(){super(...arguments),UQ(this,Yy),zy(this,"boundaries",null),zy(this,"callback",null),zy(this,"listening",!1)}static get PLUGIN_KEY(){return _A}static get PLUGIN_PRIORITY(){return qQ}isEnabled(){return!!this.hot.getSettings()[_A]}enablePlugin(){this.enabled||(this.addHook("afterOnCellMouseDown",e=>TA(Yy,this,MA).call(this,e)),this.addHook("afterOnCellCornerMouseDown",e=>TA(Yy,this,MA).call(this,e)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.unregisterEvents(),super.disablePlugin()}setBoundaries(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{left:0,right:this.hot.rootWindow.innerWidth,top:0,bottom:this.hot.rootWindow.innerHeight};this.boundaries=e}setCallback(e){this.callback=e}check(e,n){let r=0,i=0;n<this.boundaries.top?i=n-this.boundaries.top:n>this.boundaries.bottom&&(i=n-this.boundaries.bottom),e<this.boundaries.left?r=e-this.boundaries.left:e>this.boundaries.right&&(r=e-this.boundaries.right),this.callback(r,i)}listen(){this.listening=!0}unlisten(){this.listening=!1}isListening(){return this.listening}registerEvents(){const{rootWindow:e}=this.hot;let n=e;for(;n;)this.eventManager.addEventListener(n.document,"contextmenu",()=>this.unlisten()),this.eventManager.addEventListener(n.document,"mouseup",()=>this.unlisten()),this.eventManager.addEventListener(n.document,"mousemove",r=>this.onMouseMove(r)),n=Au(n)}unregisterEvents(){this.eventManager.clear()}onMouseMove(e){this.isListening()&&this.check(e.clientX,e.clientY)}destroy(){super.destroy()}}function MA(t){if(sl(t))return;const e=this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;this.setBoundaries(e!==this.hot.rootWindow?e.getBoundingClientRect():void 0),this.setCallback((n,r)=>{var i,o;const s=(i=e.scrollLeft)!==null&&i!==void 0?i:e.scrollX,a=(o=e.scrollTop)!==null&&o!==void 0?o:e.scrollY;e.scroll(s+Math.sign(n)*50,a+Math.sign(r)*20)}),this.listen()}function XQ(t,e){TL(t,e),e.add(t)}function ZQ(t,e,n){TL(t,e),e.set(t,n)}function TL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gy(t,e,n){return(e=QQ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function QQ(t){var e=JQ(t,"string");return typeof e=="symbol"?e:e+""}function JQ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function eJ(t,e){return t.get(Wr(t,e))}function _L(t,e,n){return t.set(Wr(t,e),n),n}function Wr(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("afterDropdownMenuDefaultOptions");re.getSingleton().register("beforeDropdownMenuShow");re.getSingleton().register("afterDropdownMenuShow");re.getSingleton().register("afterDropdownMenuHide");re.getSingleton().register("afterDropdownMenuExecute");const Dg="dropdownMenu",tJ=230,Jh="changeType",qy=Dg;var xp=new WeakMap,gi=new WeakSet;class Ap extends Xe{static get PLUGIN_KEY(){return Dg}static get PLUGIN_PRIORITY(){return tJ}static get PLUGIN_DEPS(){return["plugin:AutoColumnSize"]}static get DEFAULT_ITEMS(){return[Pd,Od,xe,Ad,xe,Sp,xe,xd,xe,Vr]}constructor(e){super(e),XQ(this,gi),Gy(this,"commandExecutor",new fL(this.hot)),Gy(this,"itemsFactory",null),Gy(this,"menu",null),ZQ(this,xp,!1),this.hot.addHook("afterGetColHeader",(n,r)=>Wr(gi,this,rJ).call(this,n,r))}isEnabled(){return this.hot.getSettings()[Dg]}enablePlugin(){var e=this;if(this.enabled)return;this.itemsFactory=new gL(this.hot,Ap.DEFAULT_ITEMS),this.addHook("beforeOnCellMouseDown",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Wr(gi,e,uJ).call(e,...o)}),this.addHook("beforeViewportScrollHorizontally",function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return Wr(gi,e,lJ).call(e,...o)});const n=this.hot.getSettings()[Dg],r={items:this.itemsFactory.getItems(n)};this.registerEvents(),typeof n.callback=="function"&&this.commandExecutor.setCommonCallback(n.callback),this.registerShortcuts(),super.enablePlugin(),this.callOnPluginsReady(()=>{this.hot.runHooks("afterDropdownMenuDefaultOptions",r),this.itemsFactory.setPredefinedItems(r.items);const i=this.itemsFactory.getItems(n);this.menu&&this.menu.destroy(),this.menu=new tc(this.hot,{className:"htDropdownMenu",keepInViewport:!0,container:n.uiContainer||this.hot.rootDocument.body}),this.hot.runHooks("beforeDropdownMenuSetItems",i),this.menu.setMenuItems(i),this.menu.addLocalHook("beforeOpen",()=>Wr(gi,this,iJ).call(this)),this.menu.addLocalHook("afterOpen",()=>Wr(gi,this,oJ).call(this)),this.menu.addLocalHook("afterSubmenuOpen",o=>Wr(gi,this,sJ).call(this,o)),this.menu.addLocalHook("afterClose",()=>Wr(gi,this,aJ).call(this)),this.menu.addLocalHook("executeCommand",function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return e.executeCommand.call(e,...s)}),I(i,o=>this.commandExecutor.registerCommand(o.key,o))})}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){this.close(),this.menu&&this.menu.destroy(),this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){const e=this.hot.getShortcutManager().getContext("grid"),n=()=>{const{highlight:r}=this.hot.getSelectedRangeLast();if((r.isHeader()&&r.row===-1||r.isCell())&&r.col>=0){this.hot.selectColumns(r.col,r.col,-1);const{from:i}=this.hot.getSelectedRangeLast(),o=bp(this.menu.container,this.hot.rootDocument),s=this.hot.getCell(-1,i.col,!0).querySelector(`.${Jh}`),a=s.getBoundingClientRect();this.open({left:a.left+o.left,top:a.top+s.offsetHeight+o.top},{left:a.width,right:0,above:0,below:3}),this.menu.getNavigator().toFirstItem()}};e.addShortcuts([{keys:[["Shift","Alt","ArrowDown"],["Control/Meta","Enter"]],callback:n,runOnlyIf:()=>{var r;const i=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isHeader()&&!this.menu.isOpened()},captureCtrl:!0,group:qy},{keys:[["Shift","Alt","ArrowDown"]],callback:n,runOnlyIf:()=>{var r;const i=(r=this.hot.getSelectedRangeLast())===null||r===void 0?void 0:r.highlight;return i&&this.hot.selection.isCellVisible(i)&&i.isCell()&&!this.menu.isOpened()},group:qy}])}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(qy)}registerEvents(){this.eventManager.addEventListener(this.hot.rootElement,"click",e=>Wr(gi,this,nJ).call(this,e))}open(e){var n;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{above:0,below:0,left:0,right:0};(n=this.menu)!==null&&n!==void 0&&n.isOpened()||(this.menu.open(),He(r,(i,o)=>{this.menu.setOffset(o,i)}),this.menu.setPosition(e))}close(){var e;(e=this.menu)===null||e===void 0||e.close()}executeCommand(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.commandExecutor.execute(e,...r)}setListening(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.menu.isOpened()&&(e?this.menu.hotMenu.listen():this.menu.hotMenu.unlisten())}destroy(){this.close(),this.menu&&this.menu.destroy(),super.destroy()}}function ML(t){t.getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Control/Meta","A"]],callback:()=>!1}])}function nJ(t){if(ve(t.target,Jh)){const e=bp(this.menu.container,this.hot.rootDocument),n=t.target.getBoundingClientRect();t.stopPropagation(),_L(xp,this,!1),this.open({left:n.left+e.left,top:n.top+t.target.offsetHeight+e.top},{left:n.width,right:0,above:0,below:3})}}function rJ(t,e){const n=e.parentNode;if(!n)return;const r=n.parentNode.childNodes,i=Array.prototype.indexOf.call(r,n);if(t<0||i!==r.length-1)return;const o=e.querySelector(`.${Jh}`);if(this.enabled&&o)return;if(!this.enabled){o&&o.parentNode.removeChild(o);return}const s=this.hot.rootDocument.createElement("button");s.className=Jh,s.type="button",s.tabIndex=-1,this.hot.getSettings().ariaTags&&(ye(s,[yl(),jh(" ")]),ye(e,[xN("menu")])),s.onclick=function(){return!1},e.firstChild.insertBefore(s,e.firstChild.firstChild)}function iJ(){this.hot.runHooks("beforeDropdownMenuShow",this)}function oJ(){this.hot.runHooks("afterDropdownMenuShow",this),Wr(gi,this,ML).call(this,this.menu)}function sJ(t){Wr(gi,this,ML).call(this,t)}function aJ(){this.hot.listen(),this.hot.runHooks("afterDropdownMenuHide",this)}function lJ(t){return eJ(xp,this)?null:t}function uJ(t){ve(t.target,Jh)&&_L(xp,this,!0)}Ap.SEPARATOR={name:xe};function IA(t,e,n){return(e=cJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cJ(t){var e=hJ(t,"string");return typeof e=="symbol"?e:e+""}function hJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class dJ{constructor(e){IA(this,"hot",void 0),IA(this,"options",{}),this.hot=e}setOptions(e){this.options=e}getData(){const{startRow:e,startCol:n,endRow:r,endCol:i}=this._getDataRange(),o=this.options,s=[];return de(e,r,a=>{const l=[];!o.exportHiddenRows&&this._isHiddenRow(a)||(de(n,i,u=>{!o.exportHiddenColumns&&this._isHiddenColumn(u)||l.push(this.hot.getDataAtCell(a,u))}),s.push(l))}),s}getRowHeaders(){const e=[];if(this.options.rowHeaders){const{startRow:n,endRow:r}=this._getDataRange(),i=this.hot.getRowHeader();de(n,r,o=>{!this.options.exportHiddenRows&&this._isHiddenRow(o)||e.push(i[o])})}return e}getColumnHeaders(){const e=[];if(this.options.columnHeaders){const{startCol:n,endCol:r}=this._getDataRange(),i=this.hot.getColHeader();de(n,r,o=>{!this.options.exportHiddenColumns&&this._isHiddenColumn(o)||e.push(i[o])})}return e}_getDataRange(){const e=this.hot.countCols()-1,n=this.hot.countRows()-1;let[r=0,i=0,o=n,s=e]=this.options.range;return r=Math.max(r,0),i=Math.max(i,0),o=Math.min(o,n),s=Math.min(s,e),{startRow:r,startCol:i,endRow:o,endCol:s}}_isHiddenRow(e){return this.hot.rowIndexMapper.isHidden(this.hot.toPhysicalRow(e))}_isHiddenColumn(e){return this.hot.columnIndexMapper.isHidden(this.hot.toPhysicalColumn(e))}}function PA(t,e,n){return(e=fJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fJ(t){var e=gJ(t,"string");return typeof e=="symbol"?e:e+""}function gJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class aT{static get DEFAULT_OPTIONS(){return{mimeType:"text/plain",fileExtension:"txt",filename:"Handsontable [YYYY]-[MM]-[DD]",encoding:"utf-8",bom:!1,columnHeaders:!1,rowHeaders:!1,exportHiddenColumns:!1,exportHiddenRows:!1,range:[]}}constructor(e,n){PA(this,"dataProvider",void 0),PA(this,"options",void 0),this.dataProvider=e,this.options=this._mergeOptions(n),this.dataProvider.setOptions(this.options)}_mergeOptions(e){let n=lo(this.constructor.DEFAULT_OPTIONS);const r=new Date;return n=on(lo(aT.DEFAULT_OPTIONS),n),n=on(n,e),n.filename=IN(n.filename,{YYYY:r.getFullYear(),MM:`${r.getMonth()+1}`.padStart(2,"0"),DD:`${r.getDate()}`.padStart(2,"0")}),n}}function mJ(t,e){pJ(t,e),e.add(t)}function pJ(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function OA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const IL="\r",wJ='"',vJ=`
259
+ `,CJ="=",yJ="+",bJ="-",SJ="@",RJ=" ";var Ky=new WeakSet;class EJ extends aT{constructor(){super(...arguments),mJ(this,Ky)}static get DEFAULT_OPTIONS(){return{mimeType:"text/csv",fileExtension:"csv",bom:!0,columnDelimiter:",",rowDelimiter:`\r
260
+ `,sanitizeValues:!1}}export(){const e=this.options,n=this.dataProvider.getData();let r=this.dataProvider.getColumnHeaders();const i=r.length>0,o=this.dataProvider.getRowHeaders(),s=o.length>0;let a=e.bom?"\uFEFF":"";return i&&(r=Be(r,l=>this._escapeCell(l,{force:!0,sanitizeValue:e.sanitizeValues})),s&&(a+=e.columnDelimiter),a+=r.join(e.columnDelimiter),a+=e.rowDelimiter),I(n,(l,u)=>{u>0&&(a+=e.rowDelimiter),s&&(a+=this._escapeCell(o[u],{sanitizeValue:e.sanitizeValues}),a+=e.columnDelimiter);const c=l.map(h=>this._escapeCell(h,{sanitizeValue:e.sanitizeValues})).join(e.columnDelimiter);a+=c}),a}_escapeCell(e){let{force:n=!1,sanitizeValue:r=!1}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=Pt(e);return i===""||(r&&(n=!0),r instanceof RegExp?i=OA(Ky,this,_J).call(this,i,r):typeof r=="function"?i=r(i):r&&(i=OA(Ky,this,TJ).call(this,i)),(n||i.indexOf(IL)>=0||i.indexOf(wJ)>=0||i.indexOf(vJ)>=0||i.indexOf(this.options.columnDelimiter)>=0)&&(i=i.replace(new RegExp('"',"g"),'""'),i=`"${i}"`)),i}}function TJ(t){return t.startsWith(CJ)||t.startsWith(yJ)||t.startsWith(bJ)||t.startsWith(SJ)||t.startsWith(RJ)||t.startsWith(IL)?`'${t}`:t}function _J(t,e){return e.test(t)?`'${t}`:t}const MJ="csv",HS={[MJ]:EJ};function IJ(t,e,n){return typeof HS[t]=="function"?new HS[t](e,n):null}const PJ="exportFile",OJ=240;class xJ extends Xe{static get PLUGIN_KEY(){return PJ}static get PLUGIN_PRIORITY(){return OJ}isEnabled(){return!0}exportAsString(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createTypeFormatter(e,n).export()}exportAsBlob(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this._createBlob(this._createTypeFormatter(e,n))}downloadFile(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{rootDocument:r,rootWindow:i}=this.hot,o=this._createTypeFormatter(e,n),s=this._createBlob(o),a=i.URL||i.webkitURL,l=r.createElement("a"),u=`${o.options.filename}.${o.options.fileExtension}`;if(l.download!==void 0){const c=a.createObjectURL(s);l.style.display="none",l.setAttribute("href",c),l.setAttribute("download",u),r.body.appendChild(l),l.dispatchEvent(new MouseEvent("click")),r.body.removeChild(l),setTimeout(()=>{a.revokeObjectURL(c)},100)}else navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob(s,u)}_createTypeFormatter(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!HS[e])throw new Error(`Export format type "${e}" is not supported.`);return IJ(e,new dJ(this.hot),n)}_createBlob(e){let n=null;return typeof Blob<"u"&&(n=new Blob([e.export()],{type:`${e.options.mimeType};charset=${e.options.encoding}`})),n}}function Xl(t,e,n){return(e=AJ(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function AJ(t){var e=HJ(t,"string");return typeof e=="symbol"?e:e+""}function HJ(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Hd{constructor(e,n){let{id:r,stateless:i=!0}=n;Xl(this,"hot",void 0),Xl(this,"id",void 0),Xl(this,"elements",[]),Xl(this,"hidden",!1),Xl(this,"stateId",""),Xl(this,"state",void 0),this.hot=e,this.id=r,this.stateId=`Filters.component.${this.id}`,this.state=i?null:this.hot.columnIndexMapper.registerMap(this.stateId,new hp)}getElements(){return this.elements}reset(){I(this.elements,e=>e.reset())}hide(){this.hidden=!0}show(){this.hidden=!1}isHidden(){return this.hot===null||this.hidden}restoreState(e){this.state&&this.setState(this.state.getValueAtIndex(e))}setState(){throw new Error("The state setting logic is not implemented")}saveState(e){this.state&&this.state.setValueAtIndex(e,this.getState())}getState(){throw new Error("The state gathering logic is not implemented")}destroy(){this.hot.columnIndexMapper.unregisterMap(this.stateId),this.clearLocalHooks(),I(this.elements,e=>e.destroy()),this.state=null,this.elements=null,this.hot=null}}ut(Hd,Rn);const ed={};function Ys(t,e){if(!ed[t])throw Error(`Filter condition "${t}" does not exist.`);const{condition:n,descriptor:r}=ed[t];let i=e;return r.inputValuesDecorator&&(i=r.inputValuesDecorator(i)),function(o){return n.apply(o.meta.instance,[].concat([o],[i]))}}function Za(t){if(!ed[t])throw Error(`Filter condition "${t}" does not exist.`);return ed[t].descriptor}function Zt(t,e,n){n.key=t,ed[t]={condition:e,descriptor:n}}const Cn="none";function NJ(){return!0}Zt(Cn,NJ,{name:dp,inputsCount:0,showOperators:!1});const Th="empty";function DJ(t){return Ut(t.value)}Zt(Th,DJ,{name:n0,inputsCount:0,showOperators:!0});const kg="not_empty";function kJ(t,e){return!Ys(Th,e)(t)}Zt(kg,kJ,{name:r0,inputsCount:0,showOperators:!0});const _h="eq";function LJ(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale)===Pt(n)}Zt(_h,LJ,{name:i0,inputsCount:1,showOperators:!0});const Lg="neq";function $J(t,e){return!Ys(_h,e)(t)}Zt(Lg,$J,{name:o0,inputsCount:1,showOperators:!0});const PL="gt";function FJ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>r}Zt(PL,FJ,{name:c0,inputsCount:1,showOperators:!0});const OL="gte";function VJ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value>=r}Zt(OL,VJ,{name:h0,inputsCount:1,showOperators:!0});const xL="lt";function WJ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<r}Zt(xL,WJ,{name:d0,inputsCount:1,showOperators:!0});const AL="lte";function BJ(t,e){let[n]=e,r=n;return t.meta.type==="numeric"&&(r=parseFloat(r,10)),t.value<=r}Zt(AL,BJ,{name:f0,inputsCount:1,showOperators:!0});const lT="date_after";function jJ(t,e){let[n]=e;const r=X(t.value,t.meta.dateFormat),i=X(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)>=0}Zt(lT,jJ,{name:p0,inputsCount:1,showOperators:!0});const uT="date_before";function UJ(t,e){let[n]=e;const r=X(t.value,t.meta.dateFormat),i=X(n,t.meta.dateFormat);return!r.isValid()||!i.isValid()?!1:r.diff(i)<=0}Zt(uT,UJ,{name:w0,inputsCount:1,showOperators:!0});const wm="between";function zJ(t,e){let[n,r]=e,i=n,o=r;if(t.meta.type==="numeric"){const s=parseFloat(i,10),a=parseFloat(o,10);i=Math.min(s,a),o=Math.max(s,a)}else if(t.meta.type==="date"){const s=Ys(uT,[o]),a=Ys(lT,[i]);return s(t)&&a(t)}return t.value>=i&&t.value<=o}Zt(wm,zJ,{name:g0,inputsCount:2,showOperators:!0});const HL="not_between";function YJ(t,e){return!Ys(wm,e)(t)}Zt(HL,YJ,{name:m0,inputsCount:2,showOperators:!0});const NL="begins_with";function GJ(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale).startsWith(Pt(n))}Zt(NL,GJ,{name:s0,inputsCount:1,showOperators:!0});const DL="ends_with";function qJ(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale).endsWith(Pt(n))}Zt(DL,qJ,{name:a0,inputsCount:1,showOperators:!0});const cT="contains";function KJ(t,e){let[n]=e;return Pt(t.value).toLocaleLowerCase(t.meta.locale).indexOf(Pt(n))>=0}Zt(cT,KJ,{name:l0,inputsCount:1,showOperators:!0});const kL="not_contains";function XJ(t,e){return!Ys(cT,e)(t)}Zt(kL,XJ,{name:u0,inputsCount:1,showOperators:!0});const LL="date_tomorrow";function ZJ(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().subtract(-1,"days").startOf("day"),"d"):!1}Zt(LL,ZJ,{name:C0,inputsCount:0});const $L="date_today";function QJ(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().startOf("day"),"d"):!1}Zt($L,QJ,{name:v0,inputsCount:0});const FL="date_yesterday";function JJ(t){const e=X(t.value,t.meta.dateFormat);return e.isValid()?e.isSame(X().subtract(1,"days").startOf("day"),"d"):!1}Zt(FL,JJ,{name:y0,inputsCount:0});Rz();function eee(t,e){let n=t;return n===""&&(n=`(${e})`),n}function Nd(t){const e=new Set(t);return function(n){return e.has(n)}}function hT(t){return t??""}function NS(t){return Array.from(new Set(t)).map(e=>hT(e)).sort((e,n)=>typeof e=="number"&&typeof n=="number"?e-n:e===n?0:e>n?1:-1)}function xA(t,e,n,r){const i=[],o=t===e;let s;return o||(s=Nd(e)),t.forEach(a=>{let l=!1;(o||s(a))&&(l=!0);const u={checked:l,value:a,visualValue:eee(a,n)};r&&r(u),i.push(u)}),i}const Qa="by_value";function tee(t,e){let[n]=e;return n(t.value)}Zt(Qa,tee,{name:"By value",inputsCount:0,inputValuesDecorator(t){let[e]=t;return[Nd(e)]},showOperators:!1});const td={};function nee(t){if(!td[t])throw Error(`Operation with id "${t}" does not exist.`);const e=td[t].func;return function(n,r){return e(n,r)}}function ree(t){return td[t].name}function dT(t,e,n){td[t]={name:e,func:n}}const Us="conjunction",iee=R0;function oee(t,e){return t.every(n=>n.func(e))}dT(Us,iee,oee);const vm="disjunction",see=fp;function aee(t,e){return t.some(n=>n.func(e))}dT(vm,see,aee);const fT="disjunctionWithExtraCondition",lee=fp;function uee(t,e){if(t.length<3)throw Error("Operation doesn't work on less then three conditions.");return t.slice(0,t.length-1).some(n=>n.func(e))&&t[t.length-1].func(e)}dT(fT,lee,uee);const cee="numeric",VL="text",hee="date",AA={[cee]:[Cn,xe,Th,kg,xe,_h,Lg,xe,PL,OL,xL,AL,wm,HL],[VL]:[Cn,xe,Th,kg,xe,_h,Lg,xe,NL,DL,xe,cT,kL],[hee]:[Cn,xe,Th,kg,xe,_h,Lg,xe,uT,lT,wm,xe,LL,$L,FL]};function dee(t){const e=[];let n=t;return AA[n]||(n=VL),I(AA[n],r=>{let i;r===xe?i={name:xe}:i=lo(Za(r)),e.push(i)}),e}function zc(t,e,n){return(e=fee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fee(t){var e=gee(t,"string");return typeof e=="symbol"?e:e+""}function gee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Xy="built",Zy="building",HA=["click","input","keydown","keypress","keyup","focus","blur","change"];let Si=class WL{static get DEFAULTS(){return lo({className:"",value:"",tagName:"div",children:[],wrapIt:!0})}constructor(e,n){zc(this,"hot",void 0),zc(this,"eventManager",new _i(this)),zc(this,"options",void 0),zc(this,"_element",void 0),zc(this,"buildState",void 0),this.hot=e,this.options=on(WL.DEFAULTS,n),this._element=this.hot.rootDocument.createElement(this.options.wrapIt?"div":this.options.tagName)}setValue(e){this.options.value=e,this.update()}getValue(){return this.options.value}get element(){return this.buildState===Zy?this._element:this.buildState===Xy?(this.update(),this._element):(this.buildState=Zy,this.build(),this.buildState=Xy,this._element)}isBuilt(){return this.buildState===Xy}translateIfPossible(e){return typeof e=="string"&&e.startsWith(qn)?this.hot.getTranslatedPhrase(e):e}build(){const e=(n,r)=>{this.eventManager.addEventListener(n,r,i=>this.runLocalHooks(r,i,this))};if(this.buildState||(this.buildState=Zy),this._element.setAttribute("data-hot-input",!0),this.options.tabIndex!==void 0&&this._element.setAttribute("tabindex",this.options.tabIndex),this.options.role!==void 0&&this._element.setAttribute("role",this.options.role),this.options.className&&q(this._element,this.options.className),this.options.children.length)I(this.options.children,n=>this._element.appendChild(n.element));else if(this.options.wrapIt){const n=this.hot.rootDocument.createElement(this.options.tagName);n.setAttribute("data-hot-input",!0),He(this.options,(r,i)=>{n[i]!==void 0&&i!=="className"&&i!=="tagName"&&i!=="children"&&(n[i]=this.translateIfPossible(r))}),this._element.appendChild(n),I(HA,r=>e(n,r))}else I(HA,n=>e(this._element,n))}update(){}reset(){this.options.value="",this.update()}show(){this.element.style.display=""}hide(){this.element.style.display="none"}focus(){}destroy(){this.eventManager.destroy(),this.eventManager=null,this.hot=null,this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._element=null}};ut(Si,Rn);function mee(t,e){BL(t,e),e.add(t)}function pee(t,e,n){BL(t,e),e.set(t,n)}function BL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nf(t,e){return t.get(gT(t,e))}function wee(t,e,n){return t.set(gT(t,e),n),n}function gT(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Zl=new WeakMap,NA=new WeakSet;class zs extends Si{static get DEFAULTS(){return lo({placeholder:"",type:"text",tagName:"input",tabIndex:-1})}constructor(e,n){super(e,on(zs.DEFAULTS,n)),mee(this,NA),pee(this,Zl,void 0),this.registerHooks()}registerHooks(){this.addLocalHook("keyup",e=>gT(NA,this,vee).call(this,e))}build(){super.build();const e=this.hot.rootDocument.createElement("div");wee(Zl,this,this._element.firstChild),q(this._element,"htUIInput"),q(e,"htUIInputIcon"),this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Nf(Zl,this).type=this.options.type,Nf(Zl,this).placeholder=this.translateIfPossible(this.options.placeholder),Nf(Zl,this).value=this.translateIfPossible(this.options.value))}focus(){this.isBuilt()&&Nf(Zl,this).focus()}}function vee(t){this.options.value=t.target.value}function Cee(t,e){jL(t,e),e.add(t)}function Yc(t,e,n){jL(t,e),e.set(t,n)}function jL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ql(t,e,n){return t.set(Mh(t,e),n),n}function Ot(t,e){return t.get(Mh(t,e))}function Mh(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var hn=new WeakMap,Df=new WeakMap,kf=new WeakMap,Qy=new WeakMap,Lf=new WeakMap,$f=new WeakSet;class nd extends Si{static get DEFAULTS(){return lo({className:"htUISelect",wrapIt:!1,tabIndex:-1})}constructor(e,n){super(e,on(nd.DEFAULTS,n)),Cee(this,$f),Yc(this,hn,null),Yc(this,Df,[]),Yc(this,kf,void 0),Yc(this,Qy,void 0),Yc(this,Lf,void 0),this.registerHooks()}getMenu(){return Ot(hn,this)}registerHooks(){this.addLocalHook("click",()=>Mh($f,this,See).call(this))}setItems(e){Ql(Df,this,this.translateNames(e)),Ot(hn,this)&&Ot(hn,this).setMenuItems(Ot(Df,this))}translateNames(e){return I(e,n=>{n.name=this.translateIfPossible(n.name)}),e}build(){super.build(),Ql(hn,this,new tc(this.hot,{className:"htSelectUI htFiltersConditionsMenu",keepInViewport:!1,standalone:!0,container:this.options.menuContainer})),Ot(hn,this).setMenuItems(Ot(Df,this));const e=new Si(this.hot,{className:"htUISelectCaption"}),n=new Si(this.hot,{className:"htUISelectDropdown"});Ql(kf,this,e),Ql(Qy,this,e.element),Ql(Lf,this,n),this.hot.getSettings().ariaTags&&(ye(n.element,[yl()]),ye(this._element,[ON()])),I([e,n],r=>this._element.appendChild(r.element)),Ot(hn,this).addLocalHook("select",r=>Mh($f,this,yee).call(this,r)),Ot(hn,this).addLocalHook("afterClose",()=>Mh($f,this,bee).call(this)),this.update()}update(){if(!this.isBuilt())return;let e;this.options.value?e=this.options.value.name:e=Ot(hn,this).hot.getTranslatedPhrase(dp),Ot(Qy,this).textContent=e,super.update()}openOptions(){const e=this.element.getBoundingClientRect();Ot(hn,this)&&(Ot(hn,this).open(),Ot(hn,this).setPosition({left:this.hot.isLtr()?e.left-5:e.left-31,top:e.top-1,width:e.width,height:e.height}),Ot(hn,this).getNavigator().toFirstItem(),Ot(hn,this).getKeyboardShortcutsCtrl().addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:n=>{this.closeOptions(),this.runLocalHooks("tabKeydown",n)}},{keys:[["Control/Meta","A"]],callback:()=>!1}]))}closeOptions(){Ot(hn,this)&&Ot(hn,this).close()}focus(){this.isBuilt()&&this.element.focus()}destroy(){Ot(hn,this)&&(Ot(hn,this).destroy(),Ql(hn,this,null)),Ot(kf,this)&&Ot(kf,this).destroy(),Ot(Lf,this)&&Ot(Lf,this).destroy(),super.destroy()}}function yee(t){t.name!==xe&&(this.options.value=t,this.update(),this.runLocalHooks("select",this.options.value))}function bee(){this.runLocalHooks("afterClose")}function See(){this.openOptions()}function Ree(t,e){Eee(t,e),e.add(t)}function Eee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function DA(t,e,n){return(e=Tee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tee(t){var e=_ee(t,"string");return typeof e=="symbol"?e:e+""}function _ee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function kA(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Jy=new WeakSet;class DS extends Hd{constructor(e,n){super(e,{id:n.id,stateless:!1}),Ree(this,Jy),DA(this,"name",""),DA(this,"addSeparator",!1),this.name=n.name,this.addSeparator=n.addSeparator,this.elements.push(new nd(this.hot,{menuContainer:n.menuContainer})),this.elements.push(new zs(this.hot,{placeholder:P0})),this.elements.push(new zs(this.hot,{placeholder:O0})),this.registerHooks()}registerHooks(){this.getSelectElement().addLocalHook("select",e=>kA(Jy,this,Mee).call(this,e)).addLocalHook("afterClose",()=>this.runLocalHooks("afterClose")).addLocalHook("tabKeydown",e=>this.runLocalHooks("selectTabKeydown",e)),I(this.getInputElements(),e=>{e.addLocalHook("keydown",n=>kA(Jy,this,Iee).call(this,n))})}setState(e){if(this.reset(),!e)return;const n=lo(e.command);n.name.startsWith($t)&&(n.name=this.hot.getTranslatedPhrase(n.name)),this.getSelectElement().setValue(n),I(e.args,(r,i)=>{if(i>n.inputsCount-1)return!1;const o=this.getInputElement(i);o.setValue(r),o[n.inputsCount>i?"show":"hide"](),i||this.hot._registerTimeout(()=>o.focus(),10)})}getState(){const e=this.getSelectElement().getValue()||Za(Cn),n=[];return I(this.getInputElements(),(r,i)=>{e.inputsCount>i&&n.push(r.getValue())}),{command:e,args:n}}updateState(e,n){const r=Za(e?e.name:Cn);this.state.setValueAtIndex(n,{command:r,args:e?e.args:[]}),e||I(this.getInputElements(),i=>i.setValue(null))}getSelectElement(){return this.elements.filter(e=>e instanceof nd)[0]}getInputElement(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.getInputElements()[e]}getInputElements(){return this.elements.filter(e=>e instanceof zs)}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{q(n.parentNode,"htFiltersMenuCondition"),this.addSeparator&&q(n.parentNode,"border");const a=this.hot.rootDocument.createElement("div");return q(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||I(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getPlugin("filters").getSelectedColumn();let n=[Za(Cn)];if(e!==null){const{visualIndex:r}=e;n=dee(this.hot.getDataType(0,r,this.hot.countRows(),r))}I(this.getInputElements(),r=>r.hide()),this.getSelectElement().setItems(n),super.reset(),this.getSelectElement().setValue(n[0])}}function Mee(t){I(this.getInputElements(),(e,n)=>{e[t.inputsCount>n?"show":"hide"](),n===0&&this.hot._registerTimeout(()=>e.focus(),10)}),this.runLocalHooks("change",t)}function Iee(t){yd(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Pi(t))}function LA(t,e,n){Pee(t,e),e.set(t,n)}function Pee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gc(t,e){return t.get(UL(t,e))}function $A(t,e,n){return t.set(UL(t,e),n),n}function UL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Jl=new WeakMap,eb=new WeakMap;class Cm extends Si{static get DEFAULTS(){return lo({type:"radio",tagName:"input",className:"htUIRadio",label:{}})}constructor(e,n){super(e,on(Cm.DEFAULTS,n)),LA(this,Jl,void 0),LA(this,eb,void 0)}build(){super.build();const e=this.hot.rootDocument.createElement("label");e.textContent=this.translateIfPossible(this.options.label.textContent),e.htmlFor=this.translateIfPossible(this.options.label.htmlFor),$A(eb,this,e),$A(Jl,this,this._element.firstChild),Gc(Jl,this).checked=this.options.checked,this._element.appendChild(e),this.update()}update(){this.isBuilt()&&(Gc(eb,this).textContent=this.translateIfPossible(this.options.label.textContent))}isChecked(){return this.isBuilt()?Gc(Jl,this).checked:!1}setChecked(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isBuilt()&&(Gc(Jl,this).checked=e)}focus(){this.isBuilt()&&Gc(Jl,this).focus()}}function Oee(t,e){xee(t,e),e.add(t)}function xee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Aee(t,e,n){return(e=Hee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hee(t){var e=Nee(t,"string");return typeof e=="symbol"?e:e+""}function Nee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dee(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const FA=0;var VA=new WeakSet;class kee extends Hd{constructor(e,n){super(e,{id:n.id,stateless:!1}),Oee(this,VA),Aee(this,"name",""),this.name=n.name,this.buildOperatorsElement()}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(q(n.parentNode,"htFiltersMenuOperators"),I(this.elements,r=>n.appendChild(r.element)),n)}}buildOperatorsElement(){const e=[Us,vm];I(e,n=>{const r=new Cm(this.hot,{name:"operator",label:{htmlFor:n,textContent:ree(n)},value:n,checked:n===e[FA],id:n});r.addLocalHook("change",i=>Dee(VA,this,Lee).call(this,i)),this.elements.push(r)})}setChecked(e){if(this.elements.length<e)throw Error(nt`Radio button with index ${e} doesn't exist.`);I(this.elements,(n,r)=>{n.setChecked(r===e)})}getActiveOperationId(){const e=this.elements.find(n=>n instanceof Cm&&n.isChecked());return e?e.getValue():Us}getState(){return this.getActiveOperationId()}setState(e){this.reset(),e&&this.getActiveOperationId()!==e&&I(this.elements,n=>{n.setChecked(n.getValue()===e)})}updateState(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Us,n=arguments.length>1?arguments[1]:void 0,r=e;r===fT&&(r=vm),this.state.setValueAtIndex(n,r)}reset(){this.setChecked(FA)}}function Lee(t){this.setState(t.target.value)}function $ee(t,e,n){Fee(t,e),e.set(t,n)}function Fee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tb(t,e){return t.get(zL(t,e))}function Vee(t,e,n){return t.set(zL(t,e),n),n}function zL(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var qc=new WeakMap;class rd extends Si{static get DEFAULTS(){return lo({href:"#",tagName:"a",tabIndex:-1,role:"button"})}constructor(e,n){super(e,on(rd.DEFAULTS,n)),$ee(this,qc,void 0)}build(){super.build(),Vee(qc,this,this._element.firstChild)}update(){this.isBuilt()&&(tb(qc,this).textContent=this.translateIfPossible(this.options.textContent))}focus(){this.isBuilt()&&tb(qc,this).focus()}activate(){tb(qc,this).click()}}function Wee(t,e){YL(t,e),e.add(t)}function eu(t,e,n){YL(t,e),e.set(t,n)}function YL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Te(t,e){return t.get(Su(t,e))}function si(t,e,n){return t.set(Su(t,e),n),n}function Su(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const WA="multipleSelect.itemBox";var mi=new WeakMap,Wt=new WeakMap,nb=new WeakMap,Io=new WeakMap,vs=new WeakMap,Cs=new WeakMap,Kc=new WeakSet;class id extends Si{static get DEFAULTS(){return lo({className:"htUIMultipleSelect",value:[]})}constructor(e,n){super(e,on(id.DEFAULTS,n)),Wee(this,Kc),eu(this,mi,[]),eu(this,Wt,void 0),eu(this,nb,void 0),eu(this,Io,void 0),eu(this,vs,void 0),eu(this,Cs,void 0),si(Io,this,new zs(this.hot,{placeholder:I0,className:"htUIMultipleSelectSearch"})),si(vs,this,new rd(this.hot,{textContent:E0,className:"htUISelectAll"})),si(Cs,this,new rd(this.hot,{textContent:T0,className:"htUIClearAll"})),this.registerHooks()}getItemsBox(){return Te(Wt,this)}registerHooks(){Te(Io,this).addLocalHook("keydown",e=>Su(Kc,this,jee).call(this,e)),Te(Io,this).addLocalHook("input",e=>Su(Kc,this,Bee).call(this,e)),Te(vs,this).addLocalHook("click",e=>Su(Kc,this,Uee).call(this,e)),Te(Cs,this).addLocalHook("click",e=>Su(Kc,this,zee).call(this,e))}setItems(e){var n;si(mi,this,e),(n=Te(Wt,this))===null||n===void 0||n.loadData(Te(mi,this))}setLocale(e){si(nb,this,e)}getLocale(){return Te(nb,this)}getItems(){return[...Te(mi,this)]}getValue(){return Gee(Te(mi,this))}getSearchInputElement(){return Te(Io,this)}getSelectAllElement(){return Te(vs,this)}getClearAllElement(){return Te(Cs,this)}isSelectedAllValues(){return Te(mi,this).length===this.getValue().length}build(){super.build();const{rootDocument:e}=this.hot,n=e.createElement("div"),r=new Si(this.hot,{className:"htUISelectionControls",children:[Te(vs,this),Te(Cs,this)]});this._element.appendChild(Te(Io,this).element),this._element.appendChild(r.element),this._element.appendChild(n);const i=o=>{var s;if(!this._element)return;(s=Te(Wt,this))===null||s===void 0||s.destroy(),q(o,"htUIMultipleSelectHot"),si(Wt,this,new this.hot.constructor(o,{data:Te(mi,this),columns:[{data:"checked",type:"checkbox",label:{property:"visualValue",position:"after"}}],beforeRenderer:(u,c,h,d,f,m)=>{u.title=m.instance.getDataAtRowProp(c,m.label.property)},afterListen:()=>{this.runLocalHooks("focus",this)},beforeOnCellMouseUp:()=>{Te(Wt,this).listen()},modifyColWidth:u=>{const c=Te(Wt,this).container.scrollWidth-yn(e);return u!==void 0&&u<c?c:u},maxCols:1,autoWrapCol:!0,height:110,copyPaste:!1,disableVisualSelection:"area",fillHandle:!1,fragmentSelection:"cell",tabMoves:{row:1,col:0},themeName:this.hot.getCurrentThemeName(),layoutDirection:this.hot.isRtl()?"rtl":"ltr"})),Te(Wt,this).init(),this.hot.addHook("afterSetTheme",(u,c)=>{c||Te(Wt,this).useTheme(u)});const l=Te(Wt,this).getShortcutManager().getContext("grid");l.removeShortcutsByKeys(["Tab"]),l.removeShortcutsByKeys(["Shift","Tab"]),l.addShortcut({keys:[["Escape"]],callback:u=>{this.runLocalHooks("keydown",u,this)},group:WA}),l.addShortcut({keys:[["Tab"],["Shift","Tab"]],callback:u=>{Te(Wt,this).deselectCell(),this.runLocalHooks("keydown",u,this),this.runLocalHooks("listTabKeydown",u,this)},group:WA})};i(n),this.hot._registerTimeout(()=>i(n),100)}focus(){this.isBuilt()&&Te(Wt,this).listen()}reset(){Te(Io,this).reset(),Te(vs,this).reset(),Te(Cs,this).reset()}update(){this.isBuilt()&&(Te(Wt,this).loadData(Yee(Te(mi,this),this.options.value)),super.update())}destroy(){var e;(e=Te(Wt,this))===null||e===void 0||e.destroy(),Te(Io,this).destroy(),Te(Cs,this).destroy(),Te(vs,this).destroy(),si(Io,this,null),si(Cs,this,null),si(vs,this,null),si(Wt,this,null),si(mi,this,null),super.destroy()}}function Bee(t){const e=t.target.value.toLocaleLowerCase(this.getLocale());let n;e===""?n=[...Te(mi,this)]:n=Te(mi,this).filter(r=>`${r.value}`.toLocaleLowerCase(this.getLocale()).indexOf(e)>=0),Te(Wt,this).loadData(n)}function jee(t){this.runLocalHooks("keydown",t,this),qN(yd,t.keyCode)("ARROW_DOWN")&&(t.preventDefault(),Pi(t),Te(Wt,this).listen(),Te(Wt,this).selectCell(0,0))}function Uee(t){const e=[];t.preventDefault(),Te(Wt,this).getSourceData().forEach((n,r)=>{n.checked=!0,e.push(AD(n,r)[0])}),Te(Wt,this).setSourceDataAtCell(e)}function zee(t){const e=[];t.preventDefault(),Te(Wt,this).getSourceData().forEach((n,r)=>{n.checked=!1,e.push(AD(n,r)[0])}),Te(Wt,this).setSourceDataAtCell(e)}function Yee(t,e){const n=Nd(e);return t.map(r=>(r.checked=n(r.value),r))}function Gee(t){const e=[];return t.forEach(n=>{n.checked&&e.push(n.value)}),e}function qee(t,e){Kee(t,e),e.add(t)}function Kee(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xee(t,e,n){return(e=Zee(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zee(t){var e=Qee(t,"string");return typeof e=="symbol"?e:e+""}function Qee(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ff(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Xc=new WeakSet;class Jee extends Hd{constructor(e,n){super(e,{id:n.id,stateless:!1}),qee(this,Xc),Xee(this,"name",""),this.name=n.name,this.elements.push(new id(this.hot)),this.registerHooks()}registerHooks(){this.getMultipleSelectElement().addLocalHook("keydown",e=>Ff(Xc,this,ete).call(this,e)).addLocalHook("listTabKeydown",e=>this.runLocalHooks("listTabKeydown",e)),this.hot.addHook("modifyFiltersMultiSelectValue",(e,n)=>Ff(Xc,this,tte).call(this,e,n))}getElements(){const e=this.getMultipleSelectElement();return[e.getSearchInputElement(),e.getSelectAllElement(),e.getClearAllElement(),this.getMultipleSelectElement()]}setState(e){if(this.reset(),e&&e.command.key===Qa){const n=this.getMultipleSelectElement();n.setItems(e.itemsSnapshot),n.setValue(e.args[0]),n.setLocale(e.locale)}}getState(){const e=this.getMultipleSelectElement(),n=e.getItems();return{command:{key:e.isSelectedAllValues()||!n.length?Cn:Qa},args:[e.getValue()],itemsSnapshot:n}}updateState(e){const n=(r,i,o,s,a)=>{const[l]=rl(i,h=>h.name===Qa),u={},c=this.hot.getTranslatedPhrase(tm);if(l){const h=s(r,a),d=Be(h,v=>v.value),f=new Map(h.map(v=>[v.value,this.hot.getCellMeta(v.meta.visualRow,v.meta.visualCol)])),m=NS(d);o&&(l.args[0]=o);const C=[],y=xA(m,l.args[0],c,v=>{v.checked&&C.push(v.value),Ff(Xc,this,BA).call(this,v,f)}),E=e.editedConditionStack.column;u.locale=this.hot.getCellMeta(0,E).locale,u.args=[C],u.command=Za(Qa),u.itemsSnapshot=y}else u.args=[],u.command=Za(Cn);this.state.setValueAtIndex(r,u)};n(e.editedConditionStack.column,e.editedConditionStack.conditions,e.conditionArgsChange,e.filteredRowsFactory),e.dependentConditionStacks.length&&n(e.dependentConditionStacks[0].column,e.dependentConditionStacks[0].conditions,e.conditionArgsChange,e.filteredRowsFactory,e.editedConditionStack)}getMultipleSelectElement(){return this.elements.filter(e=>e instanceof id)[0]}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n,r,i,o,s)=>{q(n.parentNode,"htFiltersMenuValue");const a=this.hot.rootDocument.createElement("div");return q(a,"htFiltersMenuLabel"),a.textContent=s,n.appendChild(a),n.parentElement.hasAttribute("ghost-table")||I(this.elements,l=>n.appendChild(l.element)),n}}}reset(){const e=this.hot.getTranslatedPhrase(tm),n=this._getColumnVisibleValues(),r=n.map(l=>l.value),i=new Map(n.map(l=>[l.value,l.meta])),o=NS(r),s=xA(o,o,e,l=>{Ff(Xc,this,BA).call(this,l,i)});this.getMultipleSelectElement().setItems(s),super.reset(),this.getMultipleSelectElement().setValue(o);const a=this.hot.getPlugin("filters").getSelectedColumn();a!==null&&this.getMultipleSelectElement().setLocale(this.hot.getCellMeta(0,a.visualIndex).locale)}_getColumnVisibleValues(){const e=this.hot.getPlugin("filters").getSelectedColumn();return e===null?[]:Be(this.hot.getDataAtCol(e.visualIndex),(n,r)=>({value:hT(n),meta:this.hot.getCellMeta(r,e.visualIndex)}))}}function ete(t){yd(t.keyCode,"ESCAPE")&&(this.runLocalHooks("cancel"),Pi(t))}function BA(t,e){this.hot.hasHook("modifyFiltersMultiSelectValue")&&(t.visualValue=this.hot.runHooks("modifyFiltersMultiSelectValue",t.visualValue,e.get(t.value)))}function tte(t,e){switch(e.type){case"numeric":return Nk(t,e);default:return t}}var GL;function nte(t,e){rte(t,e),e.add(t)}function rte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ite(t,e,n){return(e=ote(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ote(t){var e=ste(t,"string");return typeof e=="symbol"?e:e+""}function ste(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ate(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var jA=new WeakSet;class od extends Hd{static get BUTTON_OK(){return"ok"}static get BUTTON_CANCEL(){return"cancel"}constructor(e,n){super(e,{id:n.id,stateless:!0}),nte(this,jA),ite(this,"name",""),this.name=n.name,this.elements.push(new zs(this.hot,{type:"button",value:_0,className:"htUIButton htUIButtonOK",identifier:od.BUTTON_OK})),this.elements.push(new zs(this.hot,{type:"button",value:M0,className:"htUIButton htUIButtonCancel",identifier:od.BUTTON_CANCEL})),this.registerHooks()}registerHooks(){I(this.elements,e=>{e.addLocalHook("click",(n,r)=>ate(jA,this,lte).call(this,n,r))})}getMenuItemDescriptor(){return{key:this.id,name:this.name,isCommand:!1,disableSelection:!0,hidden:()=>this.isHidden(),renderer:(e,n)=>(q(n.parentNode,"htFiltersMenuActionBar"),I(this.elements,r=>n.appendChild(r.element)),n)}}accept(){this.runLocalHooks("accept")}cancel(){this.runLocalHooks("cancel")}}GL=od;function lte(t,e){e.options.identifier===GL.BUTTON_OK?this.accept():this.cancel()}function rb(t,e,n){return(e=ute(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ute(t){var e=cte(t,"string");return typeof e=="symbol"?e:e+""}function cte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const UA="ConditionCollection.filteringStates";class mT{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;rb(this,"hot",void 0),rb(this,"isMapRegistrable",void 0),rb(this,"filteringStates",new hp),this.hot=e,this.isMapRegistrable=n,this.isMapRegistrable===!0?this.hot.columnIndexMapper.registerMap(UA,this.filteringStates):this.filteringStates.init(this.hot.columnIndexMapper.getNumberOfIndexes())}isEmpty(){return this.getFilteredColumns().length===0}isMatch(e,n){var r;const i=this.filteringStates.getValueAtIndex(n),o=(r=i==null?void 0:i.conditions)!==null&&r!==void 0?r:[],s=i==null?void 0:i.operation;return this.isMatchInConditions(o,e,s)}isMatchInConditions(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Us;return e.length?nee(r)(e,n):!0}addCondition(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Us,i=arguments.length>3?arguments[3]:void 0;const o=this.hot.getCellMeta(0,e).locale,s=n.args.map(c=>typeof c=="string"?c.toLocaleLowerCase(o):c),a=n.name||n.command.key;this.runLocalHooks("beforeAdd",e);const l=this.getOperation(e);if(l){if(l!==r)throw Error(nt`The column of index ${e} has been already applied with a \`${l}\`\x20
261
+ filter operation. Use \`removeConditions\` to clear the current conditions and then add new ones.\x20
262
+ Mind that you cannot mix different types of operations (for instance, if you use \`conjunction\`,\x20
263
+ use it consequently for a particular column).`)}else if(It(td[r]))throw new Error(nt`Unexpected operation named \`${r}\`. Possible ones are\x20
264
+ \`disjunction\` and \`conjunction\`.`);const u=this.getConditions(e);u.length===0?this.filteringStates.setValueAtIndex(e,{operation:r,conditions:[{name:a,args:s,func:Ys(a,s)}]},i):u.push({name:a,args:s,func:Ys(a,s)}),this.runLocalHooks("afterAdd",e)}getConditions(e){var n,r;return(n=(r=this.filteringStates.getValueAtIndex(e))===null||r===void 0?void 0:r.conditions)!==null&&n!==void 0?n:[]}getOperation(e){var n;return(n=this.filteringStates.getValueAtIndex(e))===null||n===void 0?void 0:n.operation}getFilteredColumns(){return this.filteringStates.getEntries().map(e=>{let[n]=e;return n})}getColumnStackPosition(e){return this.getFilteredColumns().indexOf(e)}exportAllConditions(){return this.filteringStates.getEntries().reduce((e,n)=>{let[r,{operation:i,conditions:o}]=n;return e.push({column:r,operation:i,conditions:o.map(s=>{let{name:a,args:l}=s;return{name:a,args:[...l]}})}),e},[])}importAllConditions(e){this.clean(),e.forEach(n=>{n.conditions.forEach(r=>this.addCondition(n.column,r))})}removeConditions(e){this.runLocalHooks("beforeRemove",e),this.filteringStates.clearValue(e),this.runLocalHooks("afterRemove",e)}clean(){this.runLocalHooks("beforeClean"),this.filteringStates.clear(),this.runLocalHooks("afterClean")}hasConditions(e,n){const r=this.getConditions(e);return n?r.some(i=>i.name===n):r.length>0}destroy(){this.isMapRegistrable&&this.hot.columnIndexMapper.unregisterMap(UA),this.filteringStates=null,this.clearLocalHooks()}}ut(mT,Rn);function zA(t,e,n){return(e=hte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hte(t){var e=dte(t,"string");return typeof e=="symbol"?e:e+""}function dte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class qL{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:()=>[];zA(this,"conditionCollection",void 0),zA(this,"columnDataFactory",void 0),this.conditionCollection=e,this.columnDataFactory=n}filter(){let e=[];return I(this.conditionCollection.getFilteredColumns(),(n,r)=>{let i=this.columnDataFactory(n);r&&(i=this._getIntersectData(i,e)),e=this.filterByColumn(n,i)}),e}filterByColumn(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=[];return I(n,i=>{i!==void 0&&this.conditionCollection.isMatch(i,e)&&r.push(i)}),r}_getIntersectData(e,n){const r=[];return I(n,i=>{const o=i.meta.visualRow;e[o]!==void 0&&(r[o]=e[o])}),r}}function fte(t,e){gte(t,e),e.add(t)}function gte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ea(t,e,n){return(e=mte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mte(t){var e=pte(t,"string");return typeof e=="symbol"?e:e+""}function pte(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ib(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Vf=new WeakSet;class KL{constructor(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:()=>[];fte(this,Vf),Ea(this,"hot",void 0),Ea(this,"conditionCollection",void 0),Ea(this,"columnDataFactory",void 0),Ea(this,"changes",[]),Ea(this,"grouping",!1),Ea(this,"latestEditedColumnPosition",-1),Ea(this,"latestOrderStack",[]),this.hot=e,this.conditionCollection=n,this.columnDataFactory=r,this.conditionCollection.addLocalHook("beforeRemove",i=>ib(Vf,this,wte).call(this,i)),this.conditionCollection.addLocalHook("afterRemove",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("afterAdd",i=>this.updateStatesAtColumn(i)),this.conditionCollection.addLocalHook("beforeClean",()=>ib(Vf,this,vte).call(this)),this.conditionCollection.addLocalHook("afterClean",()=>ib(Vf,this,Cte).call(this))}groupChanges(){this.grouping=!0}flush(){this.grouping=!1,I(this.changes,e=>{this.updateStatesAtColumn(e)}),this.changes.length=0}updateStatesAtColumn(e,n){var r=this;if(this.grouping){this.changes.indexOf(e)===-1&&this.changes.push(e);return}const i=this.conditionCollection.exportAllConditions();let o=this.conditionCollection.getColumnStackPosition(e);o===-1&&(o=this.latestEditedColumnPosition);const s=i.slice(0,o),a=i.slice(o);a.length&&a[0].column===e&&a.shift();const l=wz(function(c,h){let d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];const f=new mT(r.hot,!1),m=[].concat(c,d);f.importAllConditions(m);const C=r.columnDataFactory(h);let y;f.isEmpty()?y=C:y=new qL(f,v=>r.columnDataFactory(v)).filter(),y=Be(y,v=>v.meta.visualRow);const E=Nd(y);return f.destroy(),rl(C,v=>E(v.meta.visualRow))})(s),u=[].concat(this.conditionCollection.getConditions(e));this.runLocalHooks("update",{editedConditionStack:{column:e,conditions:u},dependentConditionStacks:a,filteredRowsFactory:l,conditionArgsChange:n})}destroy(){this.clearLocalHooks(),He(this,(e,n)=>{this[n]=null})}}function wte(t){this.latestEditedColumnPosition=this.conditionCollection.getColumnStackPosition(t)}function vte(){this.latestOrderStack=this.conditionCollection.getFilteredColumns()}function Cte(){I(this.latestOrderStack,t=>{this.updateStatesAtColumn(t)})}ut(KL,Rn);function yte(t){return pL({initialPage:0,size:()=>t.length,onItemSelect:(n,r)=>{const i=t[n];if(i instanceof id)return r;if(i.element&&!Hu(i.element))return!1;i.focus()}})}const Zc="filters";function bte(t,e){let n=-1,r;const i=yte(e),o=h=>()=>{r.isOpened()&&r.getKeyboardShortcutsCtrl().listen(Zc),i.setCurrentPage(e.indexOf(h))};e.forEach(h=>{h instanceof Si&&(h.addLocalHook("click",o(h)),h.addLocalHook("focus",o(h)),h.addLocalHook("afterClose",o(h)))}),l(t);function s(h){const d=r.getKeyboardShortcutsCtrl(),f=h.getKeyboardShortcutsCtrl();i.clear(),f.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],forwardToContext:d.getContext(Zc),callback:()=>{h.isSubMenu()&&h.close(),d.listen(Zc)}}]),!h.isSubMenu()&&d.addCustomShortcuts([{keys:[["Tab"],["Shift","Tab"]],callback:m=>{const C=r.getNavigator();C.getCurrentPage()>-1&&(n=C.getCurrentPage()),C.clear(),m.shiftKey?i.toPreviousItem():i.toNextItem()}},{keys:[["Escape"]],callback:()=>{r.close()}},{keys:[["Enter"],["Space"]],preventDefault:!1,callback:m=>{const C=e[i.getCurrentPage()];C instanceof nd&&(C.openOptions(),m.preventDefault()),C instanceof rd&&(C.activate(),m.preventDefault()),C instanceof Si||m.preventDefault()}}],Zc)}function a(){r.focus(),r.getKeyboardShortcutsCtrl().listen(Zc)}function l(h){h.addLocalHook("afterSelectionChange",d=>{d.key.startsWith("filter_")||i.clear()}),h.addLocalHook("afterSubmenuOpen",s),h.addLocalHook("afterOpen",s),r=h}function u(){return r}function c(){return n}return{...i,listen:a,setMenu:l,getMenu:u,getLastMenuPage:c}}function Ste(t,e){XL(t,e),e.add(t)}function ob(t,e,n){XL(t,e),e.set(t,n)}function XL(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qc(t,e,n){return(e=Rte(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rte(t){var e=Ete(t,"string");return typeof e=="symbol"?e:e+""}function Ete(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $g(t,e,n){return t.set(ir(t,e),n),n}function Br(t,e){return t.get(ir(t,e))}function ir(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const kS="filters",Tte=250,YA=kS;var No=new WeakMap,LS=new WeakMap,Ga=new WeakMap,pr=new WeakSet;class _te extends Xe{static get PLUGIN_KEY(){return kS}static get PLUGIN_PRIORITY(){return Tte}static get PLUGIN_DEPS(){return["plugin:DropdownMenu","plugin:HiddenRows","cell-type:checkbox"]}constructor(e){var n;super(e),n=this,Ste(this,pr),Qc(this,"dropdownMenuPlugin",null),Qc(this,"conditionCollection",null),Qc(this,"conditionUpdateObserver",null),Qc(this,"components",new Map([["filter_by_condition",null],["filter_operators",null],["filter_by_condition2",null],["filter_by_value",null],["filter_action_bar",null]])),Qc(this,"filtersRowsMap",null),ob(this,No,void 0),ob(this,LS,new WeakSet),ob(this,Ga,[]),this.hot.addHook("afterGetColHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return ir(pr,n,Hte).call(n,...i)})}isEnabled(){return!!this.hot.getSettings()[kS]}enablePlugin(){var e=this;if(this.enabled)return;this.filtersRowsMap=this.hot.rowIndexMapper.registerMap(this.pluginName,new Ed),this.dropdownMenuPlugin=this.hot.getPlugin("dropdownMenu");const n=this.hot.getSettings().dropdownMenu,r=n&&n.uiContainer||this.hot.rootDocument.body,i=a=>(a.addLocalHook("accept",()=>ir(pr,this,GA).call(this,"accept")),a.addLocalHook("cancel",()=>ir(pr,this,GA).call(this,"cancel")),a.addLocalHook("change",l=>ir(pr,this,Ate).call(this,a,l)),a),o=()=>`${this.hot.getTranslatedPhrase(b0)}:`,s=()=>`${this.hot.getTranslatedPhrase(S0)}:`;if(!this.components.get("filter_by_condition")){const a=new DS(this.hot,{id:"filter_by_condition",name:o,addSeparator:!1,menuContainer:r});a.addLocalHook("afterClose",()=>ir(pr,this,qA).call(this)),this.components.set("filter_by_condition",i(a))}if(this.components.get("filter_operators")||this.components.set("filter_operators",new kee(this.hot,{id:"filter_operators",name:"Operators"})),!this.components.get("filter_by_condition2")){const a=new DS(this.hot,{id:"filter_by_condition2",name:"",addSeparator:!0,menuContainer:r});a.addLocalHook("afterClose",()=>ir(pr,this,qA).call(this)),this.components.set("filter_by_condition2",i(a))}if(this.components.get("filter_by_value")||this.components.set("filter_by_value",i(new Jee(this.hot,{id:"filter_by_value",name:s}))),this.components.get("filter_action_bar")||this.components.set("filter_action_bar",i(new od(this.hot,{id:"filter_action_bar",name:"Action bar"}))),this.conditionCollection||(this.conditionCollection=new mT(this.hot)),this.conditionUpdateObserver||(this.conditionUpdateObserver=new KL(this.hot,this.conditionCollection,a=>this.getDataMapAtColumn(a)),this.conditionUpdateObserver.addLocalHook("update",a=>ir(pr,this,Nte).call(this,a))),this.components.forEach(a=>a.show()),this.addHook("afterDropdownMenuDefaultOptions",function(){for(var a=arguments.length,l=new Array(a),u=0;u<a;u++)l[u]=arguments[u];return ir(pr,e,xte).call(e,...l)}),this.addHook("beforeDropdownMenuShow",()=>ir(pr,this,Ote).call(this)),this.addHook("afterDropdownMenuShow",()=>ir(pr,this,Ite).call(this)),this.addHook("afterDropdownMenuHide",()=>ir(pr,this,Pte).call(this)),this.addHook("afterChange",a=>ir(pr,this,Mte).call(this,a)),this.hot.getSettings().dropdownMenu&&this.dropdownMenuPlugin&&(this.dropdownMenuPlugin.disablePlugin(),this.dropdownMenuPlugin.enablePlugin()),!Br(No,this)&&this.dropdownMenuPlugin.enabled){const a=[{focus:()=>{const u=Br(No,this).getMenu(),c=u.getNavigator(),h=Br(No,this).getLastMenuPage();u.focus(),h>0?c.setCurrentPage(h):c.toFirstItem()}},...Array.from(this.components).map(u=>{let[,c]=u;return c.getElements()}).flat()];$g(No,this,bte(this.dropdownMenuPlugin.menu,a));const l=u=>{Br(No,this).listen(),u.preventDefault(),yd(u.keyCode,"TAB")&&(u.shiftKey?Br(No,this).toPreviousItem():Br(No,this).toNextItem())};this.components.get("filter_by_value").addLocalHook("listTabKeydown",l),this.components.get("filter_by_condition").addLocalHook("selectTabKeydown",l)}this.registerShortcuts(),super.enablePlugin()}disablePlugin(){if(this.enabled){var e;(e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled&&this.dropdownMenuPlugin.menu.clearLocalHooks(),this.components.forEach((n,r)=>{n.destroy(),this.components.set(r,null)}),this.conditionCollection.destroy(),this.conditionCollection=null,this.hot.rowIndexMapper.unregisterMap(this.pluginName)}this.unregisterShortcuts(),super.disablePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Alt","A"]],stopPropagation:!0,callback:()=>{const e=this.hot.getSelected();this.clearConditions(),this.filter(),e&&this.hot.selectCells(e)},group:YA})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(YA)}addCondition(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Us;const o=this.hot.toPhysicalColumn(e);this.conditionCollection.addCondition(o,{command:{key:n},args:r},i)}removeConditions(e){const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}clearConditions(e){if(e===void 0)this.conditionCollection.clean();else{const n=this.hot.toPhysicalColumn(e);this.conditionCollection.removeConditions(n)}}importConditions(e){this.conditionCollection.importAllConditions(e)}exportConditions(){return this.conditionCollection.exportAllConditions()}filter(){const{navigableHeaders:e}=this.hot.getSettings(),n=this._createDataFilter(),r=!this.conditionCollection.isEmpty();let i=[];const o=this.exportConditions(),s=this.hot.runHooks("beforeFilter",o,Br(Ga,this));if(s!==!1&&r){const a=[];this.hot.batchExecution(()=>{this.filtersRowsMap.clear(),i=Be(n.filter(),u=>u.meta.visualRow);const l=Nd(i);de(this.hot.countSourceRows()-1,u=>{l(u)||a.push(u)}),I(a,u=>{this.filtersRowsMap.setValueAtIndex(u,!0)})},!0),!e&&!i.length&&this.hot.deselectCell(),$g(Ga,this,this.exportConditions())}else s!==!1&&!r?($g(Ga,this,this.exportConditions()),this.filtersRowsMap.clear()):this.importConditions(Br(Ga,this));this.hot.selection.isSelected()&&this.hot.selectCell(e?-1:0,this.hot.getSelectedRangeLast().highlight.col),s!==!1&&(this.hot.runHooks("afterFilter",o),this.hot.view.adjustElementsSize(),this.hot.render())}getSelectedColumn(){var e;const n=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return n?{visualIndex:n.col,physicalIndex:this.hot.toPhysicalColumn(n.col)}:null}getDataMapAtColumn(e){const n=this.hot.toVisualColumn(e),r=[];return I(this.hot.getSourceDataAtCol(n),(i,o)=>{var s;const{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:m}=this.hot.getCellMeta(o,n),C=(s=this.hot.getDataAtCell(this.hot.toVisualRow(o),n))!==null&&s!==void 0?s:i;r.push({meta:{row:a,col:l,visualCol:u,visualRow:c,type:h,instance:d,dateFormat:f,locale:m},value:hT(C)})}),r}updateValueComponentCondition(e){const n=this.hot.getDataAtCol(e),r=NS(n);this.conditionUpdateObserver.updateStatesAtColumn(e,r)}restoreComponents(e){var n;const r=(n=this.getSelectedColumn())===null||n===void 0?void 0:n.physicalIndex;e.forEach(i=>{i.isHidden()||i.restoreState(r)}),this.updateDependentComponentsVisibility()}getOperationBasedOnArguments(e,n,r,i){let o=e;return o===vm&&n.command.key!==Cn&&r.command.key!==Cn&&i.command.key!==Cn?o=fT:i.command.key!==Cn&&(n.command.key===Cn||r.command.key===Cn)&&(o=Us),o}setListeningDropdownMenu(){this.dropdownMenuPlugin&&this.dropdownMenuPlugin.setListening()}updateDependentComponentsVisibility(){const e=this.components.get("filter_by_condition"),{command:n}=e.getState(),r=[this.components.get("filter_by_condition2"),this.components.get("filter_operators")];n.showOperators?this.showComponents(...r):this.hideComponents(...r)}_createDataFilter(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.conditionCollection;return new qL(e,n=>this.getDataMapAtColumn(n))}getIndexesOfComponents(){const e=[];if(!this.dropdownMenuPlugin)return e;const n=this.dropdownMenuPlugin.menu;for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return I(i,s=>{I(n.menuItems,(a,l)=>{a.key===s.getMenuItemDescriptor().key&&e.push(l)})}),e}changeComponentsVisibility(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(!this.dropdownMenuPlugin)return;const r=this.dropdownMenuPlugin.menu.hotMenu,i=r.getPlugin("hiddenRows");for(var o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];const l=this.getIndexesOfComponents(...s);e?i.showRows(l):i.hideRows(l),r.render()}hideComponents(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.changeComponentsVisibility(!1,...n)}showComponents(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.changeComponentsVisibility(!0,...n)}destroy(){this.enabled&&(this.components.forEach((e,n)=>{e!==null&&(e.destroy(),this.components.set(n,null))}),this.conditionCollection.destroy(),this.conditionUpdateObserver.destroy(),this.hot.rowIndexMapper.unregisterMap(this.pluginName)),super.destroy()}}function Mte(t){t&&I(t,e=>{const[,n]=e,r=this.hot.propToCol(n);this.conditionCollection.hasConditions(r)&&this.updateValueComponentCondition(r)})}function Ite(){const t=this.dropdownMenuPlugin.menu;this.restoreComponents(Array.from(this.components.values())),t.updateMenuDimensions()}function Pte(){this.components.get("filter_by_condition").getSelectElement().closeOptions(),this.components.get("filter_by_condition2").getSelectElement().closeOptions()}function Ote(){const t=this.dropdownMenuPlugin.menu;Br(LS,this).has(t)||Br(No,this).setMenu(t),Br(LS,this).add(t)}function xte(t){t.items.push({name:xe}),this.components.forEach(e=>{t.items.push(e.getMenuItemDescriptor())})}function GA(t){var e;if(t==="accept"){const r=this.getSelectedColumn();if(r===null){var n;(n=this.dropdownMenuPlugin)===null||n===void 0||n.close();return}const{physicalIndex:i}=r,o=this.components.get("filter_by_condition").getState(),s=this.components.get("filter_by_condition2").getState(),a=this.components.get("filter_by_value").getState(),l=this.getOperationBasedOnArguments(this.components.get("filter_operators").getActiveOperationId(),o,s,a);this.conditionUpdateObserver.groupChanges();let u=this.conditionCollection.getColumnStackPosition(i);u===-1&&(u=void 0),this.conditionCollection.removeConditions(i),o.command.key!==Cn&&(this.conditionCollection.addCondition(i,o,l,u),s.command.key!==Cn&&this.conditionCollection.addCondition(i,s,l,u)),a.command.key!==Cn&&this.conditionCollection.addCondition(i,a,l,u),this.conditionUpdateObserver.flush(),this.components.forEach(c=>c.saveState(i)),this.filter()}(e=this.dropdownMenuPlugin)===null||e===void 0||e.close()}function Ate(t,e){const n=this.dropdownMenuPlugin.menu;this.updateDependentComponentsVisibility(),t.constructor===DS&&!e.inputsCount&&this.setListeningDropdownMenu(),n.updateMenuDimensions()}function qA(){this.setListeningDropdownMenu()}function Hte(t,e,n){const r=this.hot.toPhysicalColumn(t);this.enabled&&this.conditionCollection.hasConditions(r)&&n===this.hot.view.getColumnHeadersCount()-1?q(e,"htFiltersActive"):pe(e,"htFiltersActive")}function Nte(t){var e;if(!((e=this.dropdownMenuPlugin)!==null&&e!==void 0&&e.enabled))return;const{editedConditionStack:{conditions:n,column:r},conditionArgsChange:i}=t;Array.isArray(i)&&$g(Ga,this,Br(Ga,this).map(a=>(a.column===r&&n.length>0&&a.conditions.forEach(l=>{l.name==="by_value"&&(l.args=[[...i]])}),a)));const o=n.filter(a=>a.name===Qa),s=n.filter(a=>a.name!==Qa);if(o.length>=2||s.length>=3)Ze(nt`The filter conditions have been applied properly, but couldn’t be displayed visually.\x20
265
+ The overall amount of conditions exceed the capability of the dropdown menu.\x20
266
+ For more details see the documentation.`);else{const a=this.conditionCollection.getOperation(r);this.components.get("filter_by_condition").updateState(s[0],r),this.components.get("filter_by_condition2").updateState(s[1],r),this.components.get("filter_operators").updateState(a,r),this.components.get("filter_by_value").updateState(t)}}const ZL="internal-use-in-handsontable",$S={licenseKey:ZL,useArrayArithmetic:!0,useColumnIndex:!1,useStats:!1,evaluateNullToZero:!0,precisionEpsilon:1e-13,precisionRounding:14,smartRounding:!0,leapYear1900:!1,nullDate:{year:1899,month:12,day:30},nullYear:30,dateFormats:["DD/MM/YYYY","DD/MM/YY"],timeFormats:["hh:mm","hh:mm:ss.sss"],matchWholeCell:!0,useRegularExpressions:!1,useWildcards:!0,functionArgSeparator:",",thousandSeparator:"",decimalSeparator:".",language:"enGB"};function QL(t){var e;return{maxColumns:t.maxColumns,maxRows:t.maxRows,language:(e=t[An])===null||e===void 0||(e=e.language)===null||e===void 0?void 0:e.langCode}}function JL(t){return Object.keys(t).reduce((e,n)=>(n!=="hyperformula"&&(e[n]=t[n]),e),{})}function Dte(t){var e;const n=t[An],r=JL(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=QL(t);return{...$S,...r,...i}}function kte(t){var e;const n=t[An],r=JL(n!=null&&(e=n.engine)!==null&&e!==void 0&&e.hyperformula?n.engine:{}),i=QL(t);return{...r,...i}}function Lte(t,e){return Object.keys(e).some(n=>e[n]!==void 0&&e[n]!==t[n])}function Hp(){const t="engine_relationship",e=Oi(An);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function pT(){const t="shared_engine_usage",e=Oi(An);return e.hasItem(t)||e.register(t,new Map),e.getItem(t)}function $te(t){const e=t.getSettings(),n=e[An],r=n==null?void 0:n.engine;if(n===!0||It(r))return null;if(typeof r.hyperformula=="function"||typeof r=="function"){var i;return Fte((i=r.hyperformula)!==null&&i!==void 0?i:r,e,t)}else if(typeof r=="object"&&It(r.hyperformula)){const o=Hp(),s=pT().get(r);return o.has(r)||o.set(r,[]),o.get(r).push(t),s&&s.push(t.guid),r.getConfig().licenseKey||r.updateConfig({licenseKey:ZL}),(r.getConfig().leapYear1900!==$S.leapYear1900||LR(r.getConfig().nullDate,$S.nullDate)===!1)&&Ze(nt`If you use HyperFormula with Handsontable, keep the default \`leapYear1900\` and \`nullDate\`
267
+ settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates.`),r}return null}function Fte(t,e,n){const r=e[An],i=Dte(e),o=Hp(),s=pT();Vte(t,r.functions),Wte(t,r.language);const a=t.buildEmpty(i);return o.set(a,[n]),s.set(a,[n.guid]),Bte(a,r.namedExpressions),a.on("sheetAdded",()=>{a.rebuildAndRecalculate()}),a.on("sheetRemoved",()=>{a.rebuildAndRecalculate()}),a}function KA(t){var e;const n=Hp(),r=n.size===0?[]:Array.from((e=n.get(t))!==null&&e!==void 0?e:[]);return new Map(r.map(i=>[i.getPlugin("formulas").sheetId,i]))}function XA(t,e){if(t){const n=Hp(),r=n.get(t),i=pT(),o=i.get(t);r&&r.includes(e)&&(r.splice(r.indexOf(e),1),r.length===0&&n.delete(t)),o&&o.includes(e.guid)&&(o.splice(o.indexOf(e.guid),1),o.length===0&&(i.delete(t),t.destroy()))}}function Vte(t,e){e&&e.forEach(n=>{const{name:r,plugin:i,translations:o}=n;try{t.registerFunction(r,i,o)}catch(s){Ze(s.message)}})}function Wte(t,e){if(e){const{langCode:n}=e;try{t.registerLanguage(n,e)}catch(r){Ze(r.message)}}}function Bte(t,e){e&&(t.suspendEvaluation(),e.forEach(n=>{const{name:r,expression:i,scope:o,options:s}=n;try{t.addNamedExpression(r,i,o,s)}catch(a){Ze(a.message)}}),t.resumeEvaluation())}function jte(t,e){return(It(e)||!t.doesSheetExist(e))&&(e=t.addSheet(e)),e}const e$="DD/MM/YYYY";function Ute(t){return typeof t=="string"&&t.charAt(0)==="'"&&t.charAt(1)==="="}function zte(t){return Ute(t)?t.substr(1):t}function Yte(t){return typeof t=="string"&&t.startsWith("=")}function wT(t,e){return typeof t=="string"&&e==="date"}function t$(t,e){return X(t,e,!0).isValid()}function n$(t,e){return X(t,e,!0).format(e$)}function Gte(t,e){return X(t,e$,!0).format(e)}function r$(t,e){const r=new Date(Date.UTC(0,0,t+-1));return X(r).format(e)}function qte(t,e,n){const r=Array.from(Array(n).keys()).filter(o=>t.includes(o)===!1);if(e===0){var i;return(i=r[e])!==null&&i!==void 0?i:0}return r[e-1]+1}function Kte(t,e){const n=[];return t.forEach(r=>{const i={from:r,to:e};n.forEach(o=>{const s=o.from>o.to,a=o.to<=i.from;o.from>i.from&&a&&s&&(i.from+=1)}),i.from>=e&&(e+=1),n.push(i)}),n}function Xte(t){return t.forEach((e,n)=>{t.slice(n+1).forEach(i=>{const o=i.from<i.to;i.from>e.from&&o&&(i.from-=1)})}),t}function vT(t,e,n){const r=Kte(t,qte(t,e,n));return Xte(r)}function Ta(t,e,n){Zte(t,e),e.set(t,n)}function Zte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function St(t,e){return t.get(i$(t,e))}function ys(t,e,n){return t.set(i$(t,e),n),n}function i$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Jc=new WeakMap,bs=new WeakMap,wr=new WeakMap,Wf=new WeakMap,sb=new WeakMap,ab=new WeakMap,Bf=new WeakMap;class ZA{constructor(e,n,r){Ta(this,Jc,void 0),Ta(this,bs,void 0),Ta(this,wr,void 0),Ta(this,Wf,[]),Ta(this,sb,[]),Ta(this,ab,void 0),Ta(this,Bf,[]),ys(Jc,this,e),ys(bs,this,n),ys(wr,this,r)}setRemovedHfIndexes(e){return ys(Bf,this,e.map(n=>{const r=St(bs,this).getVisualFromPhysicalIndex(n);return this.getHfIndexFromVisualIndex(r)})),St(Bf,this)}getRemovedHfIndexes(){return St(Bf,this)}getHfIndexFromVisualIndex(e){const n=St(bs,this).getIndexesSequence(),r=St(bs,this).getNotTrimmedIndexes();return n.indexOf(r[e],e)}syncMoves(e){const r=`move${Ti(St(Jc,this))}s`;St(wr,this).getEngine().batch(()=>{e.forEach(i=>{const o=i.from!==i.to,s=i.from+1!==i.to;o&&s&&St(wr,this).getEngine()[r](St(wr,this).getSheetId(),i.from,1,i.to)})})}storeMovesInformation(e,n,r){r!==!1&&(ys(sb,this,e.map(i=>this.getHfIndexFromVisualIndex(i))),ys(ab,this,this.getHfIndexFromVisualIndex(n)))}calculateAndSyncMoves(e,n){if(St(wr,this).isPerformingUndoRedo()||e===!1||n===!1)return;const r=vT(St(sb,this),St(ab,this),St(bs,this).getNumberOfIndexes());St(wr,this).getSheetId()===null?St(wr,this).getPostponeAction(()=>this.syncMoves(r)):this.syncMoves(r)}getIndexesChangeSyncMethod(){const e=`set${Ti(St(Jc,this))}Order`;return n=>{if(St(wr,this).isPerformingUndoRedo())return;const r=St(bs,this).getIndexesSequence();if(n==="update"&&r.length>0){const i=St(Wf,this).map(l=>r.indexOf(l)),o=St(wr,this).getEngine().getSheetDimensions(St(wr,this).getSheetId());let s;St(Jc,this)==="row"?s=o.height:s=o.width;const a=i.length;for(let l=a;l<s;l+=1)i.push(l);St(wr,this).getEngine()[e](St(wr,this).getSheetId(),i)}ys(Wf,this,r)}}init(){ys(Wf,this,St(bs,this).getIndexesSequence())}}function _a(t,e,n){Qte(t,e),e.set(t,n)}function Qte(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Po(t,e){return t.get(o$(t,e))}function Ma(t,e,n){return t.set(o$(t,e),n),n}function o$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var jf=new WeakMap,Uf=new WeakMap,lb=new WeakMap,ub=new WeakMap,cb=new WeakMap,hb=new WeakMap,db=new WeakMap;class Jte{constructor(e,n,r){_a(this,jf,void 0),_a(this,Uf,void 0),_a(this,lb,void 0),_a(this,ub,!1),_a(this,cb,!1),_a(this,hb,null),_a(this,db,null),Ma(jf,this,new ZA("row",e,this)),Ma(Uf,this,new ZA("column",n,this)),Ma(lb,this,r)}getForAxis(e){return e==="row"?Po(jf,this):Po(Uf,this)}setPerformUndo(e){Ma(ub,this,e)}setPerformRedo(e){Ma(cb,this,e)}isPerformingUndoRedo(){return Po(ub,this)||Po(cb,this)}getSheetId(){return Po(db,this)}getEngine(){return Po(hb,this)}getPostponeAction(){return Po(lb,this)}setupSyncEndpoint(e,n){Ma(hb,this,e),Ma(db,this,n),Po(jf,this).init(),Po(Uf,this).init()}}function ene(t,e){s$(t,e),e.add(t)}function Ia(t,e,n){return(e=tne(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tne(t){var e=nne(t,"string");return typeof e=="symbol"?e:e+""}function nne(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fb(t,e,n){s$(t,e),e.set(t,n)}function s$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gs(t,e,n){return t.set(Ye(t,e),n),n}function nl(t,e){return t.get(Ye(t,e))}function Ye(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const An="formulas",rne=["maxRows","maxColumns","language"],ine=260;re.getSingleton().register("afterNamedExpressionAdded");re.getSingleton().register("afterNamedExpressionRemoved");re.getSingleton().register("afterSheetAdded");re.getSingleton().register("afterSheetRemoved");re.getSingleton().register("afterSheetRenamed");re.getSingleton().register("afterFormulasValuesUpdate");const nc=t=>t==="UndoRedo.undo"||t==="UndoRedo.redo"||t==="auto";var is=new WeakMap,Np=new WeakMap,eh=new WeakMap,Ke=new WeakSet;class one extends Xe{constructor(){var e;super(...arguments),e=this,ene(this,Ke),fb(this,is,!1),fb(this,Np,!1),fb(this,eh,[["valuesUpdated",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,bne).call(e,...r)}],["namedExpressionAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,Sne).call(e,...r)}],["namedExpressionRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,Rne).call(e,...r)}],["sheetAdded",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,Ene).call(e,...r)}],["sheetRenamed",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,Tne).call(e,...r)}],["sheetRemoved",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ye(Ke,e,_ne).call(e,...r)}]]),Ia(this,"staticRegister",Oi("formulas")),Ia(this,"engine",null),Ia(this,"sheetId",null),Ia(this,"sheetName",null),Ia(this,"indexSyncer",null),Ia(this,"rowAxisSyncer",null),Ia(this,"columnAxisSyncer",null)}static get PLUGIN_KEY(){return An}static get PLUGIN_PRIORITY(){return ine}static get SETTING_KEYS(){return[An,...rne]}isEnabled(){return!!this.hot.getSettings()[An]}enablePlugin(){var e,n=this;if(!this.enabled){if(this.engine=(e=$te(this.hot))!==null&&e!==void 0?e:this.engine,!this.engine){Ze("Missing the required `engine` key in the Formulas settings. Please fill it with either an engine class or an engine instance.");return}if(this.sheetName!==null&&!this.engine.doesSheetExist(this.sheetName)){const r=this.addSheet(this.sheetName,this.hot.getSourceDataArray());r!==!1&&Ye(Ke,this,Ih).call(this,r)}this.addHook("beforeLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,QA).call(n,...i)}),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,JA).call(n,...i)}),this.addHook("beforeUpdateData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,QA).call(n,...i)}),this.addHook("afterUpdateData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,JA).call(n,...i)}),this.addHook("modifyData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,une).call(n,...i)}),this.addHook("modifySourceData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,cne).call(n,...i)}),this.addHook("beforeValidate",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,sne).call(n,...i)}),this.addHook("afterSetSourceDataAtCell",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,hne).call(n,...i)}),this.addHook("afterSetDataAtCell",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,eH).call(n,...i)}),this.addHook("afterSetDataAtRowProp",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,eH).call(n,...i)}),this.addHook("beforeCreateRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,dne).call(n,...i)}),this.addHook("beforeCreateCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,fne).call(n,...i)}),this.addHook("afterCreateRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,pne).call(n,...i)}),this.addHook("afterCreateCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,wne).call(n,...i)}),this.addHook("beforeRemoveRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,gne).call(n,...i)}),this.addHook("beforeRemoveCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,mne).call(n,...i)}),this.addHook("afterRemoveRow",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,vne).call(n,...i)}),this.addHook("afterRemoveCol",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,Cne).call(n,...i)}),this.indexSyncer=new Jte(this.hot.rowIndexMapper,this.hot.columnIndexMapper,r=>{this.hot.addHookOnce("init",()=>{r()})}),this.rowAxisSyncer=this.indexSyncer.getForAxis("row"),this.columnAxisSyncer=this.indexSyncer.getForAxis("column"),this.hot.addHook("afterRowSequenceChange",this.rowAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("afterColumnSequenceChange",this.columnAxisSyncer.getIndexesChangeSyncMethod()),this.hot.addHook("beforeRowMove",(r,i,o,s)=>{this.rowAxisSyncer.storeMovesInformation(r,i,s)}),this.hot.addHook("beforeColumnMove",(r,i,o,s)=>{this.columnAxisSyncer.storeMovesInformation(r,i,s)}),this.hot.addHook("afterRowMove",(r,i,o,s,a)=>{this.rowAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("afterColumnMove",(r,i,o,s,a)=>{this.columnAxisSyncer.calculateAndSyncMoves(s,a)}),this.hot.addHook("beforeColumnFreeze",(r,i)=>{this.columnAxisSyncer.storeMovesInformation([r],this.hot.getSettings().fixedColumnsStart,i)}),this.hot.addHook("afterColumnFreeze",(r,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.hot.addHook("beforeColumnUnfreeze",(r,i)=>{this.columnAxisSyncer.storeMovesInformation([r],this.hot.getSettings().fixedColumnsStart-1,i)}),this.hot.addHook("afterColumnUnfreeze",(r,i)=>{this.columnAxisSyncer.calculateAndSyncMoves(i,i)}),this.addHook("afterCellMetaReset",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,lne).call(n,...i)}),this.addHook("beforeUndo",()=>{this.indexSyncer.setPerformUndo(!0),this.engine.undo()}),this.addHook("beforeRedo",()=>{this.indexSyncer.setPerformRedo(!0),this.engine.redo()}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformUndo(!1)}),this.addHook("afterUndo",()=>{this.indexSyncer.setPerformRedo(!1)}),this.addHook("afterDetachChild",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,yne).call(n,...i)}),this.addHook("beforeAutofill",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return Ye(Ke,n,ane).call(n,...i)}),nl(eh,this).forEach(r=>{let[i,o]=r;return this.engine.on(i,o)}),super.enablePlugin()}}disablePlugin(){nl(eh,this).forEach(e=>{let[n,r]=e;return this.engine.off(n,r)}),XA(this.engine,this.hot),this.engine=null,super.disablePlugin()}updatePlugin(e){const n=kte(this.hot.getSettings());Lte(this.engine.getConfig(),n)&&this.engine.updateConfig(n);const r=this.hot.getSettings()[An];if(ae(r)&&ae(r.sheetName)&&r.sheetName!==this.sheetName&&this.switchSheet(r.sheetName),!e.data&&this.sheetName===null){const i=this.hot.getSettings()[An].sheetName;if(i&&this.engine.doesSheetExist(i))this.switchSheet(this.sheetName);else{const o=this.addSheet(i??void 0,this.hot.getSourceDataArray());Ye(Ke,this,Ih).call(this,o)}}super.updatePlugin(e)}destroy(){nl(eh,this).forEach(e=>{var n;let[r,i]=e;return(n=this.engine)===null||n===void 0?void 0:n.off(r,i)}),Gs(eh,this,null),XA(this.engine,this.hot),this.engine=null,super.destroy()}addSheet(e,n){if(ae(n)&&!zq(n))return Ze("The provided data should be an array of arrays."),!1;if(e!=null&&this.engine.doesSheetExist(e))return Ze("Sheet with the provided name already exists."),!1;try{const r=this.engine.addSheet(e??void 0);return n&&this.engine.setSheetContent(this.engine.getSheetId(r),n),r}catch(r){return Ze(r.message),!1}}switchSheet(e){if(!this.engine.doesSheetExist(e)){VR(`The sheet named \`${e}\` does not exist, switch aborted.`);return}Ye(Ke,this,Ih).call(this,e);const n=this.engine.getSheetSerialized(this.sheetId);n.length>0&&this.hot.loadData(n,`${Ti(An)}.switchSheet`)}getCellType(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;const i=this.hot.toPhysicalRow(e),o=this.hot.toPhysicalColumn(n);return i!==null&&o!==null?this.engine.getCellType({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n)}):"EMPTY"}isFormulaCellType(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.sheetId;return this.engine.doesCellHaveFormula({sheet:r,row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n)})}renderDependentSheets(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=new Set;e.forEach(i=>{var o;const s=i==null||(o=i.address)===null||o===void 0?void 0:o.sheet;s!==void 0&&(r.has(s)||r.add(s))}),KA(this.engine).forEach((i,o)=>{if((n||o!==this.sheetId)&&r.has(o)){var s;i.render(),(s=i.view)===null||s===void 0||s.adjustElementsSize()}})}validateDependentCells(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=o=>{var s;const{row:a,col:l,sheet:u}=(s=o==null?void 0:o.address)!==null&&s!==void 0?s:{};return ae(u)?`${u}:${a}x${l}`:""},i=new Set(n.map(o=>r(o)));e.forEach(o=>{var s,a;const{row:l,col:u}=(s=o.address)!==null&&s!==void 0?s:{};if(ae(l)===!1||ae(u)===!1||l>=this.hot.countRows()||u>=this.hot.countCols())return;const c=o==null||(a=o.address)===null||a===void 0?void 0:a.sheet,h=r(o);if(c!==void 0&&!i.has(h)){const d=KA(this.engine).get(c);if(!d)return;d.validateCell(d.getDataAtCell(l,u),d.getCellMeta(l,u),()=>{})}})}syncChangeWithEngine(e,n,r){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(n),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(i)){Ze(`Not possible to set cell data at ${JSON.stringify(i)}`);return}const o=this.hot.getCellMeta(e,n);return wT(r,o.type)&&(t$(r,o.dateFormat)?r=n$(r,o.dateFormat):Yte(r)===!1&&(r=`'${r}`)),this.engine.setCellContents(i,r)}}function Ih(t){this.sheetName=t,this.sheetId=this.engine.getSheetId(this.sheetName)}function sne(t,e,n){const r=this.hot.propToCol(n);if(this.isFormulaCellType(e,r)){const i={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(e),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(r),sheet:this.sheetId},o=this.hot.getCellMeta(e,r);let s=this.engine.getCellValue(i);return o.type==="date"&&Un(s)&&(s=r$(s,o.dateFormat)),typeof s=="object"&&s!==null?s.value:s}return t}function ane(t,e,n){const{row:r,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),{row:a,col:l}=n.getTopStartCorner(),{row:u,col:c}=n.getBottomEndCorner(),h={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(r),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(i),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(s),sheet:this.sheetId}},d={start:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(a),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId},end:{row:this.rowAxisSyncer.getHfIndexFromVisualIndex(u),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(c),sheet:this.sheetId}};if(this.engine.isItPossibleToSetCellContents(d)===!1)return!1;const f=this.engine.getFillRangeData(h,d),{row:m,col:C}=h.start,{row:y,col:E}=h.end,v=y-m+1,_=E-C+1;for(let A=0;A<f.length;A+=1)for(let L=0;L<f[A].length;L+=1){const T=f[A][L],P=m+A%v,Y=C+L%_,U=this.hot.getCellMeta(P,Y);wT(T,U.type)&&(T.startsWith("'")?f[A][L]=T.slice(1):this.isFormulaCellType(P,Y,this.sheetId)===!1&&(f[A][L]=Gte(T,U.dateFormat)))}return f}function QA(t,e){(arguments.length>2&&arguments[2]!==void 0?arguments[2]:"").includes(Ti(An))||Gs(Np,this,It(this.hot.getSettings().data))}function lne(){if(nl(Np,this)){this.switchSheet(this.sheetName);return}const t=this.hot.getSourceDataArray();t.forEach((n,r)=>{n.forEach((i,o)=>{const s=this.hot.getCellMeta(r,o,{skipMetaExtension:!0}),a=s.dateFormat;wT(i,s.type)&&(t$(i,a)?t[r][o]=n$(i,a):i.startsWith("=")||(t[r][o]=`'${i}`))})}),Gs(is,this,!0);const e=this.engine.setSheetContent(this.sheetId,t);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(e),Gs(is,this,!1)}function JA(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(n.includes(Ti(An)))return;const r=jte(this.engine,this.hot.getSettings()[An].sheetName);if(Ye(Ke,this,Ih).call(this,r),n!=="updateSettings")if(nl(Np,this))this.switchSheet(this.sheetName);else{const i=this.hot.getSourceDataArray();if(this.engine.isItPossibleToReplaceSheetContent(this.sheetId,i)){Gs(is,this,!0);const o=this.engine.setSheetContent(this.sheetId,i);this.indexSyncer.setupSyncEndpoint(this.engine,this.sheetId),this.renderDependentSheets(o),Gs(is,this,!1)}}}function une(t,e,n,r){if(r!=="get"||nl(is,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t);if(i===null||e===null)return;const o=this.getCellType(i,e);if(o==="VALUE"||o==="EMPTY"){n.value=zte(n.value);return}const s={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(e),sheet:this.sheetId};let a=this.engine.getCellValue(s);const l=this.hot.getCellMeta(i,e,{skipMetaExtension:!0});l.type==="date"&&Un(a)&&(a=r$(a,l.dateFormat)),n.value=typeof a=="object"&&a!==null?a.value:a}function cne(t,e,n,r){if(r!=="get"||nl(is,this)||this.sheetName===null||!this.engine.doesSheetExist(this.sheetName))return;const i=this.hot.toVisualRow(t),o=this.hot.propToCol(e);if(i===null||o===null)return;const s=this.getCellType(i,o);if(s==="VALUE"||s==="EMPTY")return;const a=this.engine.getSheetDimensions(this.engine.getSheetId(this.sheetName));if(a.width===0&&a.height===0)return;const l={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(i),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(o),sheet:this.sheetId};n.value=this.engine.getCellSerialized(l)}function eH(t,e){if(nc(e))return;const n=[],r=[],i=this.engine.batch(()=>{t.forEach(o=>{let[s,a,,l]=o;const u=this.hot.propToCol(a),c=this.hot.toPhysicalRow(s),h=this.hot.toPhysicalColumn(u),d={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(s),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(u),sheet:this.sheetId};c!==null&&h!==null?this.syncChangeWithEngine(s,u,l):n.push([s,u,l]),r.push({address:d})})});n.length&&this.hot.addHookOnce("afterChange",()=>{const o=this.engine.batch(()=>{n.forEach(s=>{let[a,l,u]=s;this.syncChangeWithEngine(a,l,u)})});this.renderDependentSheets(o,!0)}),this.renderDependentSheets(i),this.validateDependentCells(i,r)}function hne(t,e){if(nc(e))return;const n=[],r=[];t.forEach(i=>{let[o,s,,a]=i;const l=this.hot.propToCol(s);if(!Un(l))return;const u={row:this.rowAxisSyncer.getHfIndexFromVisualIndex(o),col:this.columnAxisSyncer.getHfIndexFromVisualIndex(l),sheet:this.sheetId};if(!this.engine.isItPossibleToSetCellContents(u)){Ze(`Not possible to set source cell data at ${JSON.stringify(u)}`);return}r.push({address:u}),n.push(...this.engine.setCellContents(u,a))}),this.renderDependentSheets(n),this.validateDependentCells(n,r)}function dne(t,e){let n=this.rowAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countRows()&&(n=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddRows(this.sheetId,[n,e]))return!1}function fne(t,e){let n=this.columnAxisSyncer.getHfIndexFromVisualIndex(t);if(t>=this.hot.countCols()&&(n=t),this.sheetId===null||!this.engine.doesSheetExist(this.sheetName)||!this.engine.isItPossibleToAddColumns(this.sheetId,[n,e]))return!1}function gne(t,e,n){return this.rowAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveRows(this.sheetId,[o,1]))===!1?!1:void 0}function mne(t,e,n){return this.columnAxisSyncer.setRemovedHfIndexes(n).every(o=>this.engine.isItPossibleToRemoveColumns(this.sheetId,[o,1]))===!1?!1:void 0}function pne(t,e,n){if(nc(n))return;const r=this.engine.addRows(this.sheetId,[this.rowAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function wne(t,e,n){if(nc(n))return;const r=this.engine.addColumns(this.sheetId,[this.columnAxisSyncer.getHfIndexFromVisualIndex(t),e]);this.renderDependentSheets(r)}function vne(t,e,n,r){if(nc(r))return;const i=this.rowAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeRows(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function Cne(t,e,n,r){if(nc(r))return;const i=this.columnAxisSyncer.getRemovedHfIndexes().sort((s,a)=>a-s),o=this.engine.batch(()=>{i.forEach(s=>{this.engine.removeColumns(this.sheetId,[s,1])})});this.renderDependentSheets(o)}function yne(t,e,n){var r;Gs(is,this,!0);const i=this.hot.getSourceDataArray(n,0,n+(((r=e.__children)===null||r===void 0?void 0:r.length)||0),this.hot.countSourceCols());Gs(is,this,!1),i.forEach((o,s)=>{o.forEach((a,l)=>{this.engine.setCellContents({col:l,row:n+s,sheet:this.sheetId},[[a]])})})}function bne(t){this.hot.runHooks("afterFormulasValuesUpdate",t)}function Sne(t,e){this.hot.runHooks("afterNamedExpressionAdded",t,e)}function Rne(t,e){this.hot.runHooks("afterNamedExpressionRemoved",t,e)}function Ene(t){this.hot.runHooks("afterSheetAdded",t)}function Tne(t,e){Ye(Ke,this,Ih).call(this,e),this.hot.runHooks("afterSheetRenamed",t,e)}function _ne(t,e){this.hot.runHooks("afterSheetRemoved",t,e)}function Mne(t){return{key:"hidden_columns_hide",name(){const e=this.getSelectedLast();let n=0;if(Array.isArray(e)){const[,r,,i]=e;r-i!==0&&(n=1)}return this.getTranslatedPhrase(QE,n)},callback(){const{from:e,to:n}=this.getSelectedRangeLast(),r=Math.max(Math.min(e.col,n.col),0),i=Math.max(e.col,n.col),o=[];for(let l=r;l<=i;l+=1)o.push(l);t.hideColumns(o);const s=o[o.length-1],a=this.columnIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectColumns(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())}}}function Ine(t){const e=[];return{key:"hidden_columns_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(JE,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(n=this.columnIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,o=(r=this.columnIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&r!==void 0?r:this.countCols()-1,t.showColumns(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countCols()||this.selectColumns(i,o)},disabled:!1,hidden(){const n=Be(t.getHiddenColumns(),h=>this.toPhysicalColumn(h));if(!(this.selection.isSelectedByColumnHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().col,o=r.getBottomEndCorner().col,s=this.columnIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(m=>n.includes(m)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countCols()));else{const h=this.countCols()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return I(c,h=>{e.push(this.toVisualColumn(h))}),e.length===0}}}function Pne(t,e){a$(t,e),e.add(t)}function One(t,e,n){a$(t,e),e.set(t,n)}function a$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pa(t,e){return t.get(Is(t,e))}function tH(t,e,n){return t.set(Is(t,e),n),n}function Is(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeHideColumns");re.getSingleton().register("afterHideColumns");re.getSingleton().register("beforeUnhideColumns");re.getSingleton().register("afterUnhideColumns");const nH="hiddenColumns",xne=310;var Fi=new WeakMap,Oa=new WeakSet;class Ane extends Xe{constructor(){super(...arguments),Pne(this,Oa),One(this,Fi,null)}static get PLUGIN_KEY(){return nH}static get PLUGIN_PRIORITY(){return xne}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,columns:[]}}isEnabled(){return!!this.hot.getSettings()[nH]}enablePlugin(){var e=this;this.enabled||(tH(Fi,this,new cp),Pa(Fi,this).addLocalHook("init",()=>Is(Oa,this,$ne).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,Pa(Fi,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Is(Oa,e,Lne).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>Is(Oa,this,Nne).call(this,n,r,i)),this.addHook("modifyColWidth",(n,r)=>Is(Oa,this,Hne).call(this,n,r),2),this.addHook("afterGetColHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Is(Oa,e,kne).call(e,...r)}),this.addHook("modifyCopyableRange",n=>Is(Oa,this,Dne).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.columnIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;const o=Pa(Fi,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalColumn(u));I(l,u=>{o[u]=!1}),i=gr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualColumn(h)),u),[])}this.hot.runHooks("beforeUnhideColumns",n,i,r&&s)!==!1&&(r&&s&&Pa(Fi,this).setValues(o),this.hot.view.adjustElementsSize(),this.hot.runHooks("afterUnhideColumns",n,i,r&&s,r&&i.length<n.length))}showColumn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.showColumns(n)}hideColumns(e){const n=this.getHiddenColumns(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideColumns",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{I(e,s=>{Pa(Fi,this).setValueAtIndex(this.hot.toPhysicalColumn(s),!0)})},!0),this.hot.runHooks("afterHideColumns",n,i,r,r&&i.length>n.length))}hideColumn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideColumns(n)}getHiddenColumns(){return Be(Pa(Fi,this).getHiddenIndexes(),e=>this.hot.toVisualColumn(e))}isHidden(e){return Pa(Fi,this).getValueAtIndex(this.hot.toPhysicalColumn(e))||!1}isValidConfig(e){const n=this.hot.countCols();return Array.isArray(e)&&e.length>0?e.every(r=>Number.isInteger(r)&&r>=0&&r<n):!1}resetCellsMeta(){I(this.hot.getCellsMeta(),e=>{e.skipColumnOnPaste=!1})}destroy(){tH(Fi,this,null),super.destroy()}}function Hne(t,e){if(this.isHidden(e))return 0;if(this.getSetting("indicators")&&(this.isHidden(e+1)||this.isHidden(e-1))&&typeof t=="number"&&this.hot.hasColHeaders())return t+15}function Nne(t,e,n){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(e)&&(n.skipColumnOnPaste=!0),this.isHidden(e-1))n.className=n.className||"",n.className.indexOf("afterHiddenColumn")===-1&&(n.className+=" afterHiddenColumn");else if(n.className){const r=n.className.split(" ");if(r.length>0){const i=r.indexOf("afterHiddenColumn");i>-1&&r.splice(i,1),n.className=r.join(" ")}}}function Dne(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],n=(r,i,o,s)=>{e.push({startRow:r,endRow:i,startCol:o,endCol:s})};return I(t,r=>{let i=!0,o=0;de(r.startCol,r.endCol,s=>{this.isHidden(s)?(i||n(r.startRow,r.endRow,o,s-1),i=!0):(i&&(o=s),s===r.endCol&&n(r.startRow,r.endRow,o,s),i=!1)})}),e}function kne(t,e){if(!this.getSetting("indicators")||t<0)return;const n=[];t>=1&&this.isHidden(t-1)&&n.push("afterHiddenColumn"),t<this.hot.countCols()-1&&this.isHidden(t+1)&&n.push("beforeHiddenColumn"),q(e,n)}function Lne(t){t.items.push({name:xe},Mne(this),Ine(this))}function $ne(){const t=this.getSetting("columns");Array.isArray(t)&&this.hideColumns(t)}function Fne(t){return{key:"hidden_rows_hide",name(){const e=this.getSelectedLast();let n=0;if(Array.isArray(e)){const[r,,i]=e;r-i!==0&&(n=1)}return this.getTranslatedPhrase(e0,n)},callback(){const{from:e,to:n}=this.getSelectedRangeLast(),r=Math.max(Math.min(e.row,n.row),0),i=Math.max(e.row,n.row),o=[];for(let l=r;l<=i;l+=1)o.push(l);t.hideRows(o);const s=o[o.length-1],a=this.rowIndexMapper.getNearestNotHiddenIndex(s,1,!0);Number.isInteger(a)&&a>=0?this.selectRows(a):this.deselectCell(),this.render(),this.view.adjustElementsSize()},disabled:!1,hidden(){return!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())}}}function Vne(t){const e=[];return{key:"hidden_rows_show",name(){const n=e.length>1?1:0;return this.getTranslatedPhrase(t0,n)},callback(){var n,r;if(e.length===0)return;let i=e[0],o=e[e.length-1];i=(n=this.rowIndexMapper.getNearestNotHiddenIndex(i-1,-1))!==null&&n!==void 0?n:0,o=(r=this.rowIndexMapper.getNearestNotHiddenIndex(o+1,1))!==null&&r!==void 0?r:this.countRows()-1,t.showRows(e),this.render(),this.view.adjustElementsSize(),o-i+1===this.countRows()||this.selectRows(i,o)},disabled:!1,hidden(){const n=Be(t.getHiddenRows(),h=>this.toPhysicalRow(h));if(!(this.selection.isSelectedByRowHeader()||this.selection.isSelectedByCorner())||n.length<1)return!0;e.length=0;const r=this.getSelectedRangeLast(),i=r.getTopStartCorner().row,o=r.getBottomEndCorner().row,s=this.rowIndexMapper,a=s.getRenderableFromVisualIndex(i),l=s.getRenderableFromVisualIndex(o),u=s.getNotTrimmedIndexes(),c=[];if(i!==o){const h=o-i+1,d=l-a+1;if(h>d){const f=u.slice(i,o+1);c.push(...f.filter(m=>n.includes(m)))}}else if(a===0&&a<i)c.push(...u.slice(0,i));else if(a===null)c.push(...u.slice(0,this.countRows()));else{const h=this.countRows()-1,d=s.getRenderableFromVisualIndex(s.getNearestNotHiddenIndex(h,-1));l===d&&h>o&&c.push(...u.slice(o+1))}return I(c,h=>{e.push(this.toVisualRow(h))}),e.length===0}}}function Wne(t,e){l$(t,e),e.add(t)}function Bne(t,e,n){l$(t,e),e.set(t,n)}function l$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xa(t,e){return t.get(Ps(t,e))}function rH(t,e,n){return t.set(Ps(t,e),n),n}function Ps(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeHideRows");re.getSingleton().register("afterHideRows");re.getSingleton().register("beforeUnhideRows");re.getSingleton().register("afterUnhideRows");const iH="hiddenRows",jne=320;var Vi=new WeakMap,Aa=new WeakSet;class Une extends Xe{constructor(){super(...arguments),Wne(this,Aa),Bne(this,Vi,null)}static get PLUGIN_KEY(){return iH}static get PLUGIN_PRIORITY(){return jne}static get DEFAULT_SETTINGS(){return{copyPasteEnabled:!0,indicators:!1,rows:[]}}isEnabled(){return!!this.hot.getSettings()[iH]}enablePlugin(){var e=this;this.enabled||(rH(Vi,this,new cp),xa(Vi,this).addLocalHook("init",()=>Ps(Aa,this,Xne).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,xa(Vi,this)),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ps(Aa,e,Kne).call(e,...r)}),this.addHook("afterGetCellMeta",(n,r,i)=>Ps(Aa,this,Yne).call(this,n,r,i)),this.addHook("modifyRowHeight",(n,r)=>Ps(Aa,this,zne).call(this,n,r)),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ps(Aa,e,qne).call(e,...r)}),this.addHook("modifyCopyableRange",n=>Ps(Aa,this,Gne).call(this,n)),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){super.disablePlugin(),this.hot.rowIndexMapper.unregisterMap(this.pluginName),this.resetCellsMeta()}showRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;const o=xa(Vi,this).getValues().slice(),s=e.length>0;if(r&&s){const l=e.map(u=>this.hot.toPhysicalRow(u));I(l,u=>{o[u]=!1}),i=gr(o,(u,c,h)=>(c&&u.push(this.hot.toVisualRow(h)),u),[])}this.hot.runHooks("beforeUnhideRows",n,i,r&&s)!==!1&&(r&&s&&xa(Vi,this).setValues(o),this.hot.runHooks("afterUnhideRows",n,i,r&&s,r&&i.length<n.length))}showRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.showRows(n)}hideRows(e){const n=this.getHiddenRows(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeHideRows",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{I(e,s=>{xa(Vi,this).setValueAtIndex(this.hot.toPhysicalRow(s),!0)})},!0),this.hot.runHooks("afterHideRows",n,i,r,r&&i.length>n.length))}hideRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.hideRows(n)}getHiddenRows(){return Be(xa(Vi,this).getHiddenIndexes(),e=>this.hot.toVisualRow(e))}isHidden(e){return xa(Vi,this).getValueAtIndex(this.hot.toPhysicalRow(e))||!1}isValidConfig(e){const n=this.hot.countRows();return Array.isArray(e)&&e.length>0?e.every(r=>Number.isInteger(r)&&r>=0&&r<n):!1}resetCellsMeta(){I(this.hot.getCellsMeta(),e=>{e.skipRowOnPaste=!1})}destroy(){rH(Vi,this,null),super.destroy()}}function zne(t,e){return this.isHidden(e)?0:t}function Yne(t,e,n){if(this.getSetting("copyPasteEnabled")===!1&&this.isHidden(t)&&(n.skipRowOnPaste=!0),this.isHidden(t-1))n.className=n.className||"",n.className.indexOf("afterHiddenRow")===-1&&(n.className+=" afterHiddenRow");else if(n.className){const r=n.className.split(" ");if(r.length>0){const i=r.indexOf("afterHiddenRow");i>-1&&r.splice(i,1),n.className=r.join(" ")}}}function Gne(t){if(this.getSetting("copyPasteEnabled"))return t;const e=[],n=(r,i,o,s)=>{e.push({startRow:r,endRow:i,startCol:o,endCol:s})};return I(t,r=>{let i=!0,o=0;de(r.startRow,r.endRow,s=>{this.isHidden(s)?(i||n(o,s-1,r.startCol,r.endCol),i=!0):(i&&(o=s),s===r.endRow&&n(o,s,r.startCol,r.endCol),i=!1)})}),e}function qne(t,e){if(!this.getSetting("indicators")||t<0)return;const n=[];t>=1&&this.isHidden(t-1)&&n.push("afterHiddenRow"),t<this.hot.countRows()-1&&this.isHidden(t+1)&&n.push("beforeHiddenRow"),q(e,n)}function Kne(t){t.items.push({name:xe},Fne(this),Vne(this))}function Xne(){const t=this.getSetting("rows");Array.isArray(t)&&this.hideRows(t)}function Zne(t){return{key:"freeze_column",name(){return this.getTranslatedPhrase(IE)},callback(e,n){const[{start:{col:r}}]=n;t.freezeColumn(r),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let n=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col<=this.getSettings().fixedColumnsStart-1)&&(n=!0),n}}}function Qne(t){return{key:"unfreeze_column",name(){return this.getTranslatedPhrase(PE)},callback(e,n){const[{start:{col:r}}]=n;t.unfreezeColumn(r),this.render(),this.view.adjustElementsSize()},hidden(){const e=this.getSelectedRange();let n=!1;return(e===void 0||e.length>1||e[0].from.col!==e[0].to.col||e[0].from.col>=this.getSettings().fixedColumnsStart)&&(n=!0),n}}}function Jne(t,e){u$(t,e),e.add(t)}function ere(t,e,n){u$(t,e),e.set(t,n)}function u$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function FS(t,e){return t.get(ym(t,e))}function gb(t,e,n){return t.set(ym(t,e),n),n}function ym(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeColumnFreeze");re.getSingleton().register("afterColumnFreeze");re.getSingleton().register("beforeColumnUnfreeze");re.getSingleton().register("afterColumnUnfreeze");const oH="manualColumnFreeze",tre=110;var Ua=new WeakMap,mb=new WeakSet;class nre extends Xe{constructor(){super(...arguments),Jne(this,mb),ere(this,Ua,!1)}static get PLUGIN_KEY(){return oH}static get PLUGIN_PRIORITY(){return tre}isEnabled(){return!!this.hot.getSettings()[oH]}enablePlugin(){this.enabled||(this.addHook("afterContextMenuDefaultOptions",e=>ym(mb,this,rre).call(this,e)),this.addHook("beforeColumnMove",(e,n)=>ym(mb,this,ire).call(this,e,n)),super.enablePlugin())}disablePlugin(){gb(Ua,this,!1),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}freezeColumn(e){const n=this.hot.getSettings(),r=n.fixedColumnsStart<this.hot.countCols()&&e>n.fixedColumnsStart-1;FS(Ua,this)||gb(Ua,this,!0),this.hot.runHooks("beforeColumnFreeze",e,r)!==!1&&(r&&(this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart),n._fixedColumnsStart+=1),this.hot.runHooks("afterColumnFreeze",e,r))}unfreezeColumn(e){const n=this.hot.getSettings(),r=n.fixedColumnsStart>0&&e<=n.fixedColumnsStart-1;FS(Ua,this)||gb(Ua,this,!0),this.hot.runHooks("beforeColumnUnfreeze",e,r)!==!1&&(r&&(n._fixedColumnsStart-=1,this.hot.columnIndexMapper.moveIndexes(e,n.fixedColumnsStart)),this.hot.runHooks("afterColumnUnfreeze",e,r))}}function rre(t){t.items.push({name:"---------"},Zne(this),Qne(this))}function ire(t,e){if(FS(Ua,this)){const n=this.hot.getSettings().fixedColumnsStart;if(e<n||t.some(r=>r<n))return!1}}function zf(t,e,n){return(e=ore(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ore(t){var e=sre(t,"string");return typeof e=="symbol"?e:e+""}function sre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const pb=0,sH=1,aH=2,tu="px";let c$=class{constructor(e){zf(this,"hot",void 0),zf(this,"_element",null),zf(this,"state",pb),zf(this,"inlineProperty",void 0),this.hot=e,this.inlineProperty=e.isRtl()?"right":"left"}appendTo(e){e.appendChild(this._element),this.state=aH}build(){this.state===pb&&(this._element=this.hot.rootDocument.createElement("div"),this.state=sH)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=pb}isAppended(){return this.state===aH}isBuilt(){return this.state>=sH}setPosition(e,n){Un(e)&&(this._element.style.top=e+tu),Un(n)&&(this._element.style[this.inlineProperty]=n+tu)}getPosition(){const e=this._element.style;return{top:e.top?parseInt(e.top,10):0,start:e[this.inlineProperty]?parseInt(e[this.inlineProperty],10):0}}setSize(e,n){Un(e)&&(this._element.style.width=e+tu),Un(n)&&(this._element.style.height=n+tu)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,n){Un(e)&&(this._element.style.marginTop=e+tu),Un(n)&&(this._element.style[`margin${Ti(this.inlineProperty)}`]=n+tu)}getOffset(){const e=this._element.style,n=`margin${Ti(this.inlineProperty)}`;return{top:e.marginTop?parseInt(e.marginTop,10):0,start:e[n]?parseInt(e[n],10):0}}};const are="ht__manualColumnMove--backlight";let lre=class extends c${build(){super.build(),q(this._element,are)}};const ure="ht__manualColumnMove--guideline";let cre=class extends c${build(){super.build(),q(this._element,ure)}};function hre(t,e){h$(t,e),e.add(t)}function ai(t,e,n){h$(t,e),e.set(t,n)}function h$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function cr(t,e,n){return t.set(Os(t,e),n),n}function he(t,e){return t.get(Os(t,e))}function Os(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeColumnMove");re.getSingleton().register("afterColumnMove");const wb="manualColumnMove",dre=120,lH="ht__manualColumnMove",bm="show-ui",VS="on-moving--columns",WS="after-selection--columns";var Bn=new WeakMap,As=new WeakMap,qo=new WeakMap,Fg=new WeakMap,Vs=new WeakMap,Wn=new WeakMap,Yf=new WeakMap,$r=new WeakMap,pu=new WeakMap,Sm=new WeakMap,Ph=new WeakMap,Ha=new WeakSet;class fre extends Xe{constructor(){super(...arguments),hre(this,Ha),ai(this,Bn,new lre(this.hot)),ai(this,As,new cre(this.hot)),ai(this,qo,[]),ai(this,Fg,0),ai(this,Vs,!1),ai(this,Wn,{}),ai(this,Yf,void 0),ai(this,$r,void 0),ai(this,pu,void 0),ai(this,Sm,void 0),ai(this,Ph,void 0)}static get PLUGIN_KEY(){return wb}static get PLUGIN_PRIORITY(){return dre}isEnabled(){return!!this.hot.getSettings()[wb]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Os(Ha,e,gre).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Os(Ha,e,pre).call(e,...r)}),this.addHook("afterScrollVertically",()=>Os(Ha,this,vre).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Os(Ha,e,Cre).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),q(this.hot.rootElement,lH),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){pe(this.hot.rootElement,lH),this.unregisterEvents(),he(Bn,this).destroy(),he(As,this).destroy(),super.disablePlugin()}moveColumn(e,n){return this.moveColumns([e],n)}moveColumns(e,n){const r=he(Yf,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeColumnMove",e,n,r,i);if(cr(Yf,this,void 0),o===!1)return;i&&this.hot.columnIndexMapper.moveIndexes(e,n);const s=i&&this.isColumnOrderChanged(e,n);return this.hot.runHooks("afterColumnMove",e,n,r,i,s),s}dragColumn(e,n){return this.dragColumns([e],n)}dragColumns(e,n){const r=this.countFinalIndex(e,n);return cr(Yf,this,n),this.moveColumns(e,r)}isMovePossible(e,n){const r=this.hot.columnIndexMapper.getNotTrimmedIndexesLength(),i=e.length+n>r,o=n<0,s=e.some(l=>l<0),a=e.some(l=>l>=r);return!(i||o||s||a)}isColumnOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}countFinalIndex(e,n){const r=gr(e,(i,o)=>(o<n&&(i+=1),i),0);return n-r}getColumnsWidth(e,n){const r=this.hot.columnIndexMapper;let i=0;for(let o=e;o<=n;o+=1){const s=r.getRenderableFromVisualIndex(o);o<0?i+=this.hot.view._wt.wtViewport.getRowHeaderWidth()||0:s!==null&&(i+=this.hot.view._wt.wtTable.getColumnWidth(s)||0)}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[wb];if(Array.isArray(e))this.moveColumns(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveColumns(n,0)}}isFixedColumnsStart(e){return e<this.hot.getSettings().fixedColumnsStart}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualColumnMove",this.hot.columnIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualColumnMove",e),e.value?e.value:[]}prepareColumnsToMoving(e,n){const r=[];return de(e,n,i=>{r.push(i)}),r}refreshPositions(){const e=this.hot.view.getFirstFullyVisibleColumn();this.isFixedColumnsStart(he($r,this))&&e>0&&this.hot.scrollViewportTo({col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(e-1,-1)});const n=this.hot.view._wt.wtTable,r=this.hot.view._wt.wtOverlays.scrollableElement,i=typeof r.scrollX=="number"?r.scrollX:r.scrollLeft;let o=this.hot.view.THEAD.offsetLeft+this.getColumnsWidth(0,he($r,this)-1);const s=n.hider.offsetWidth,a=n.TBODY.offsetLeft,l=he(Bn,this).getOffset().start,u=he(Bn,this).getSize().width;let c=0,h=0;if(this.hot.isRtl()){const m=this.hot.rootWindow,C=qt(this.hot.rootElement),y=m.innerWidth-he(pu,this)-C;h=m.innerWidth-he(Wn,this).eventPageX-y-(r.scrollX===void 0?i:0)}else h=he(Wn,this).eventPageX-(he(pu,this)-(r.scrollX===void 0?i:0));if(he(Sm,this)&&(c=this.hot.view._wt.wtOverlays.inlineStartOverlay.clone.wtTable.getColumnHeader(-1).offsetWidth),this.isFixedColumnsStart(he($r,this))&&(o+=i),o+=c,he($r,this)<0)he(Ph,this)>0?he(Wn,this).col=0:he(Wn,this).col=e>0?e-1:e;else if(he(Wn,this).TD.offsetWidth/2+o<=h){const m=he($r,this)>=he(Fg,this)?he(Fg,this)-1:he($r,this);he(Wn,this).col=m+1,o+=he(Wn,this).TD.offsetWidth}else he(Wn,this).col=he($r,this);let d=h,f=o;h+u+l>=s?d=s-u-l:h+l<a+c&&(d=a+c+Math.abs(l)),o>=s-1?f=s-1:f===0?f=1:r.scrollX!==void 0&&he($r,this)<he(Ph,this)&&(f-=he(pu,this)<=r.scrollX?he(pu,this):0),he(Bn,this).setPosition(null,d),he(As,this).setPosition(null,f)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>Os(Ha,this,mre).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>Os(Ha,this,wre).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){he(Bn,this).build(),he(As,this).build()}destroy(){he(Bn,this).destroy(),he(As,this).destroy(),super.destroy()}}function gre(t,e,n,r){const i=this.hot.view._wt.wtTable,o=this.hot.selection.isSelectedByColumnHeader(),s=this.hot.getSelectedRangeLast(),a=ve(t.target,"sortAction");if(!s||!o||he(Vs,this)||t.button!==0||a){cr(Vs,this,!1),he(qo,this).length=0,pe(this.hot.rootElement,[VS,bm]);return}const l=he(As,this).isBuilt()&&!he(As,this).isAppended(),u=he(Bn,this).isBuilt()&&!he(Bn,this).isAppended();l&&u&&(he(As,this).appendTo(i.hider),he(Bn,this).appendTo(i.hider));const{from:c,to:h}=s,d=Math.min(c.col,h.col),f=Math.max(c.col,h.col);if(e.row<0&&e.col>=d&&e.col<=f){r.column=!0,cr(Vs,this,!0);const m=n.firstChild?Hz(t,n.firstChild).x:t.offsetX;he(Wn,this).eventPageX=t.pageX,cr($r,this,e.col),he(Wn,this).TD=n,he(Wn,this).col=e.col,cr(qo,this,this.prepareColumnsToMoving(d,f)),cr(Sm,this,!!this.hot.getSettings().rowHeaders),cr(Fg,this,this.hot.countCols()),cr(Ph,this,this.hot.getSettings().fixedColumnsStart),cr(pu,this,Hn(this.hot.rootElement).left);const C=he(Sm,this)?-1:0,y=i.holder.scrollTop+i.getColumnHeaderHeight(0)+1,E=e.col<he(Ph,this),v=this.hot.view._wt.wtOverlays.inlineStartOverlay.getOverlayOffset(),_=Math.abs(m-(this.hot.isRtl()?n.offsetWidth:0)),A=this.getColumnsWidth(d,e.col-1)+_,L=this.getColumnsWidth(C,d-1)+(E?v:0)+A;he(Bn,this).setPosition(y,L),he(Bn,this).setSize(this.getColumnsWidth(d,f),i.hider.offsetHeight-y),he(Bn,this).setOffset(null,-A),q(this.hot.rootElement,VS)}else pe(this.hot.rootElement,WS),cr(Vs,this,!1),he(qo,this).length=0}function mre(t){he(Vs,this)&&(he(Wn,this).eventPageX=t.pageX,this.refreshPositions())}function pre(t,e,n,r){!this.hot.getSelectedRangeLast()||!he(Vs,this)||(he(qo,this).indexOf(e.col)>-1?pe(this.hot.rootElement,bm):q(this.hot.rootElement,bm),r.row=!0,r.column=!0,r.cell=!0,cr($r,this,e.col),he(Wn,this).TD=n)}function wre(){const t=he(Wn,this).col,e=he(qo,this).length;if(cr($r,this,void 0),cr(Vs,this,!1),pe(this.hot.rootElement,[VS,bm,WS]),this.hot.selection.isSelectedByColumnHeader()&&q(this.hot.rootElement,WS),e<1||t===void 0)return;const n=he(qo,this)[0],r=this.hot.toPhysicalColumn(n),i=this.dragColumns(he(qo,this),t);if(he(qo,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualColumn(r),s=o+e-1;this.hot.selectColumns(o,s)}}function vre(){const t=this.hot.view._wt.wtTable,e=t.getColumnHeaderHeight(0)+1,n=t.holder.scrollTop,r=e+n;he(Bn,this).setPosition(r),he(Bn,this).setSize(null,t.hider.offsetHeight-r)}function Cre(){this.moveBySettingsOrLoad()}function yre(t,e){d$(t,e),e.add(t)}function Mn(t,e,n){d$(t,e),e.set(t,n)}function d$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jt(t,e,n){return t.set(pi(t,e),n),n}function ie(t,e){return t.get(pi(t,e))}function pi(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Rm="manualColumnResize",bre=130,uH="manualColumnWidths";var Fo=new WeakMap,Gf=new WeakMap,Tr=new WeakMap,Em=new WeakMap,io=new WeakMap,Sre=new WeakMap,Ou=new WeakMap,qf=new WeakMap,nr=new WeakMap,Do=new WeakMap,hl=new WeakMap,Tm=new WeakMap,Oh=new WeakMap,xh=new WeakMap,Mr=new WeakMap,Ah=new WeakMap,Wi=new WeakSet;class Rre extends Xe{static get PLUGIN_KEY(){return Rm}static get PLUGIN_PRIORITY(){return bre}constructor(e){super(e),yre(this,Wi),Mn(this,Fo,null),Mn(this,Gf,null),Mn(this,Tr,[]),Mn(this,Em,null),Mn(this,io,null),Mn(this,Sre,null),Mn(this,Ou,null),Mn(this,qf,null),Mn(this,nr,this.hot.rootDocument.createElement("DIV")),Mn(this,Do,this.hot.rootDocument.createElement("DIV")),Mn(this,hl,null),Mn(this,Tm,!1),Mn(this,Oh,0),Mn(this,xh,null),Mn(this,Mr,void 0),Mn(this,Ah,void 0),q(ie(nr,this),"manualColumnResizer"),q(ie(Do,this),"manualColumnResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Rm]}enablePlugin(){var e=this;this.enabled||(jt(Mr,this,new Qs),ie(Mr,this).addLocalHook("init",()=>pi(Wi,this,Ere).call(this)),this.hot.columnIndexMapper.registerMap(this.pluginName,ie(Mr,this)),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pi(Wi,e,Ore).call(e,...r)},1),this.addHook("beforeStretchingColumnWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pi(Wi,e,xre).call(e,...r)},1),this.addHook("beforeColumnResize",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return pi(Wi,e,Are).call(e,...r)}),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){jt(Ah,this,ie(Mr,this).getValues()),this.hot.columnIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualColumnWidths(){this.hot.runHooks("persistentStateSave",uH,ie(Mr,this).getValues())}loadManualColumnWidths(){const e={};return this.hot.runHooks("persistentStateLoad",uH,e),e.value}setManualSize(e,n){const r=Math.max(n,20),i=this.hot.toPhysicalColumn(e);return ie(Mr,this).setValueAtIndex(i,r),r}clearManualSize(e){const n=this.hot.toPhysicalColumn(e);ie(Mr,this).setValueAtIndex(n,null)}setupHandlePosition(e){if(!e.parentNode)return;jt(Fo,this,e);const{_wt:n}=this.hot.view,r=n.wtTable.getCoords(ie(Fo,this)),i=r.col;if(i<0)return;const o=rn(ie(Fo,this)),s=ie(Fo,this).getBoundingClientRect(),a=i<n.getSetting("fixedColumnsStart");let l;a&&(l=n.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ie(Fo,this),r.row,r.col)),l||(l=n.wtOverlays.topOverlay.getRelativeCellPosition(ie(Fo,this),r.row,r.col)),jt(Gf,this,this.hot.columnIndexMapper.getVisualFromRenderableIndex(i)),jt(Tr,this,[]);const u=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByColumnHeader();if(this.hot.selection.isSelected()&&u){const c=this.hot.getSelectedRange();I(c,h=>{const d=h.getTopStartCorner().col,f=h.getBottomEndCorner().col;de(d,f,m=>{ie(Tr,this).includes(m)||ie(Tr,this).push(m)})})}ie(Tr,this).includes(ie(Gf,this))||jt(Tr,this,[ie(Gf,this)]),jt(qf,this,l.start-6),jt(Ou,this,parseInt(s.width,10)),ie(nr,this).style.top=`${l.top}px`,ie(nr,this).style[this.inlineDir]=`${ie(qf,this)+ie(Ou,this)}px`,ie(nr,this).style.height=`${o}px`,this.hot.rootElement.appendChild(ie(nr,this))}refreshHandlePosition(){ie(nr,this).style[this.inlineDir]=`${ie(qf,this)+ie(Em,this)}px`}setupGuidePosition(){const e=parseInt(rn(ie(nr,this)),10),n=parseInt(ie(nr,this).style.top,10)+e,r=this.hot.view.getTableHeight();q(ie(nr,this),"active"),q(ie(Do,this),"active"),ie(Do,this).style.top=`${n}px`,this.refreshGuidePosition(),ie(Do,this).style.height=`${r-e}px`,this.hot.rootElement.appendChild(ie(Do,this))}refreshGuidePosition(){ie(Do,this).style[this.inlineDir]=ie(nr,this).style[this.inlineDir]}hideHandleAndGuide(){pe(ie(nr,this),"active"),pe(ie(Do,this),"active")}checkIfColumnHeader(e){const n=il(e,["THEAD"],this.hot.rootElement),{topOverlay:r,topInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.THEAD,i.clone.wtTable.THEAD].includes(n)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeColumnResize",ie(io,this),r,!0);o!==void 0&&jt(io,this,o),this.setManualSize(r,ie(io,this)),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ie(io,this),r,!0),i&&e()};ie(Oh,this)>=2&&(ie(Tr,this).length>1?(I(ie(Tr,this),i=>{n(i)}),e()):I(ie(Tr,this),i=>{n(i,!0)})),jt(Oh,this,0),jt(xh,this,null)}bindEvents(){const{rootWindow:e,rootElement:n}=this.hot;this.eventManager.addEventListener(n,"mouseover",r=>pi(Wi,this,Tre).call(this,r)),this.eventManager.addEventListener(n,"mousedown",r=>pi(Wi,this,_re).call(this,r)),this.eventManager.addEventListener(e,"mousemove",r=>pi(Wi,this,Mre).call(this,r)),this.eventManager.addEventListener(e,"mouseup",()=>pi(Wi,this,Ire).call(this)),this.eventManager.addEventListener(ie(nr,this),"contextmenu",()=>pi(Wi,this,Pre).call(this))}destroy(){super.destroy()}}function Ere(){const t=this.hot.getSettings()[Rm],e=this.loadManualColumnWidths();typeof e<"u"?this.hot.batchExecution(()=>{e.forEach((n,r)=>{ie(Mr,this).setValueAtIndex(r,n)})},!0):Array.isArray(t)?(this.hot.batchExecution(()=>{t.forEach((n,r)=>{ie(Mr,this).setValueAtIndex(r,n)})},!0),jt(Ah,this,t)):t===!0&&Array.isArray(ie(Ah,this))&&this.hot.batchExecution(()=>{ie(Ah,this).forEach((n,r)=>{ie(Mr,this).setValueAtIndex(r,n)})},!0)}function Tre(t){if(!zN(t.target)&&ie(Tm,this)!==!0&&this.checkIfColumnHeader(t.target)){const e=this.getClosestTHParent(t.target);if(!e)return;const n=e.getAttribute("colspan");e&&(n===null||n==="1")&&(ie(hl,this)||this.setupHandlePosition(e))}}function _re(t){t.target.parentNode===this.hot.rootElement&&ve(t.target,"manualColumnResizer")&&(this.setupHandlePosition(ie(Fo,this)),this.setupGuidePosition(),jt(hl,this,!0),ie(xh,this)===null&&(jt(xh,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ie(xh,this))),jt(Oh,this,ie(Oh,this)+1),this.startX=t.pageX,jt(io,this,ie(Ou,this)))}function Mre(t){if(ie(hl,this)){const e=(t.pageX-this.startX)*this.hot.getDirectionFactor();jt(Em,this,ie(Ou,this)+e),I(ie(Tr,this),n=>{jt(io,this,this.setManualSize(n,ie(Em,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition()}}function Ire(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeColumnResize",ie(io,this),n,!1),r&&t(),this.saveManualColumnWidths(),this.hot.runHooks("afterColumnResize",ie(io,this),n,!1)};ie(hl,this)&&(this.hideHandleAndGuide(),jt(hl,this,!1),ie(io,this)!==ie(Ou,this)&&(ie(Tr,this).length>1?(I(ie(Tr,this),r=>{e(r)}),t()):I(ie(Tr,this),r=>{e(r,!0)})),this.setupHandlePosition(ie(Fo,this)))}function Pre(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ie(nr,this)),this.hot.rootElement.removeChild(ie(Do,this)),jt(hl,this,!1),jt(Tm,this,!0),this.hot._registerImmediate(()=>{jt(Tm,this,!1)})}function Ore(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalColumn(e),i=ie(Mr,this).getValueAtIndex(r);this.hot.getSettings()[Rm]&&i&&(n=i)}return n}function xre(t,e){const n=ie(Mr,this).getValueAtIndex(this.hot.toPhysicalColumn(e));return typeof n=="number"?n:t}function Are(){this.hot.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked()}function vb(t,e,n){return(e=Hre(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Hre(t){var e=Nre(t,"string");return typeof e=="symbol"?e:e+""}function Nre(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Cb=0,cH=1,hH=2,nu="px";let f$=class{constructor(e){vb(this,"hot",void 0),vb(this,"_element",null),vb(this,"state",Cb),this.hot=e}appendTo(e){e.appendChild(this._element),this.state=hH}build(){this.state===Cb&&(this._element=this.hot.rootDocument.createElement("div"),this.state=cH)}destroy(){this.isAppended()&&this._element.parentElement.removeChild(this._element),this._element=null,this.state=Cb}isAppended(){return this.state===hH}isBuilt(){return this.state>=cH}setPosition(e,n){e!==void 0&&(this._element.style.top=e+nu),n!==void 0&&(this._element.style.left=n+nu)}getPosition(){return{top:this._element.style.top?parseInt(this._element.style.top,10):0,left:this._element.style.left?parseInt(this._element.style.left,10):0}}setSize(e,n){e&&(this._element.style.width=e+nu),n&&(this._element.style.height=n+nu)}getSize(){return{width:this._element.style.width?parseInt(this._element.style.width,10):0,height:this._element.style.height?parseInt(this._element.style.height,10):0}}setOffset(e,n){e&&(this._element.style.marginTop=e+nu),n&&(this._element.style.marginLeft=n+nu)}getOffset(){return{top:this._element.style.marginTop?parseInt(this._element.style.marginTop,10):0,left:this._element.style.marginLeft?parseInt(this._element.style.marginLeft,10):0}}};const Dre="ht__manualRowMove--backlight";class kre extends f${build(){super.build(),q(this._element,Dre)}}const Lre="ht__manualRowMove--guideline";class $re extends f${build(){super.build(),q(this._element,Lre)}}function Fre(t,e){g$(t,e),e.add(t)}function ru(t,e,n){g$(t,e),e.set(t,n)}function g$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ja(t,e,n){return t.set(xs(t,e),n),n}function Ee(t,e){return t.get(xs(t,e))}function xs(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeRowMove");re.getSingleton().register("afterRowMove");const yb="manualRowMove",Vre=140,dH="ht__manualRowMove",_m="show-ui",BS="on-moving--rows",jS="after-selection--rows";var jn=new WeakMap,Hs=new WeakMap,Ko=new WeakMap,Ws=new WeakMap,hr=new WeakMap,Kf=new WeakMap,Na=new WeakSet;class Wre extends Xe{constructor(){super(...arguments),Fre(this,Na),ru(this,jn,new kre(this.hot)),ru(this,Hs,new $re(this.hot)),ru(this,Ko,[]),ru(this,Ws,void 0),ru(this,hr,{}),ru(this,Kf,void 0)}static get PLUGIN_KEY(){return yb}static get PLUGIN_PRIORITY(){return Vre}isEnabled(){return!!this.hot.getSettings()[yb]}enablePlugin(){var e=this;this.enabled||(this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return xs(Na,e,Bre).call(e,...r)}),this.addHook("beforeOnCellMouseOver",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return xs(Na,e,Ure).call(e,...r)}),this.addHook("afterScrollHorizontally",()=>xs(Na,this,Yre).call(this)),this.addHook("afterLoadData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return xs(Na,e,Gre).call(e,...r)}),this.buildPluginUI(),this.registerEvents(),q(this.hot.rootElement,dH),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.moveBySettingsOrLoad(),super.updatePlugin()}disablePlugin(){pe(this.hot.rootElement,dH),this.unregisterEvents(),Ee(jn,this).destroy(),Ee(Hs,this).destroy(),super.disablePlugin()}moveRow(e,n){return this.moveRows([e],n)}moveRows(e,n){const r=Ee(Kf,this),i=this.isMovePossible(e,n),o=this.hot.runHooks("beforeRowMove",e,n,r,i);if(Ja(Kf,this,void 0),o===!1)return;i&&this.hot.rowIndexMapper.moveIndexes(e,n);const s=i&&this.isRowOrderChanged(e,n);return this.hot.runHooks("afterRowMove",e,n,r,i,s),s}dragRow(e,n){return this.dragRows([e],n)}dragRows(e,n){const r=this.countFinalIndex(e,n);return Ja(Kf,this,n),this.moveRows(e,r)}isMovePossible(e,n){const r=this.hot.rowIndexMapper.getNotTrimmedIndexesLength(),i=e.length+n>r,o=n<0,s=e.some(l=>l<0),a=e.some(l=>l>=r);return!(i||o||s||a)}isRowOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}countFinalIndex(e,n){const r=gr(e,(i,o)=>(o<n&&(i+=1),i),0);return n-r}getRowsHeight(e,n){const r=this.hot.rowIndexMapper;let i=0;for(let o=e;o<=n;o++){const s=r.getRenderableFromVisualIndex(o);s!==null&&(i+=this.hot.view._wt.wtTable.getRowHeight(s)||this.hot.view.getDefaultRowHeight())}return i}moveBySettingsOrLoad(){const e=this.hot.getSettings()[yb];if(Array.isArray(e))this.moveRows(e,0);else if(e!==void 0){const n=this.persistentStateLoad();n.length&&this.moveRows(n,0)}}isFixedRowTop(e){return e<this.hot.getSettings().fixedRowsTop}isFixedRowBottom(e){return e>this.hot.countRows()-1-this.hot.getSettings().fixedRowsBottom}persistentStateSave(){this.hot.runHooks("persistentStateSave","manualRowMove",this.hot.rowIndexMapper.getIndexesSequence())}persistentStateLoad(){const e={};return this.hot.runHooks("persistentStateLoad","manualRowMove",e),e.value?e.value:[]}prepareRowsToMoving(){const e=this.hot.getSelectedRangeLast(),n=[];if(!e)return n;const{from:r,to:i}=e,o=Math.min(r.row,i.row),s=Math.max(r.row,i.row);return de(o,s,a=>{n.push(a)}),n}refreshPositions(){const e=Ee(hr,this).coords,n=this.hot.getFirstFullyVisibleRow(),r=this.hot.getLastFullyVisibleRow(),i=this.hot.countRows();this.isFixedRowTop(e.row)&&n>0&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(n-1,-1)),this.isFixedRowBottom(e.row)&&r<i&&this.hot.scrollViewportTo(this.hot.rowIndexMapper.getNearestNotHiddenIndex(r+1,1),void 0,!0);const o=this.hot.view._wt.wtTable,s=Ee(hr,this).TD,a=this.hot.rootElement,l=Hn(a),u=Uh(a),c=o.holder.scrollTop,h=this.hot.rootWindow!==u?u.scrollTop:0,d=l.top-h,f=Ee(hr,this).eventPageY-d+c,m=o.hider.offsetHeight,C=o.TBODY.offsetTop,y=Ee(jn,this).getOffset().top,E=Ee(jn,this).getSize().height,v=s.offsetHeight/2,_=s.offsetHeight;let A=this.hot.view.THEAD.offsetHeight+this.getRowsHeight(0,e.row-1);const L=f>=A+v;this.isFixedRowTop(e.row)&&(A+=this.hot.view._wt.wtOverlays.topOverlay.getOverlayOffset()),e.row<0?Ee(hr,this).row=n>0?n-1:n:L?(Ee(hr,this).row=e.row+1,A+=e.row===0?_-1:_):Ee(hr,this).row=e.row;let T=f,P=A;f+E+y>=m?T=m-E-y:f+y<C&&(T=C+Math.abs(y)),A>=m-1&&(P=m-1),Ee(jn,this).setPosition(T),Ee(Hs,this).setPosition(P)}registerEvents(){const{documentElement:e}=this.hot.rootDocument;this.eventManager.addEventListener(e,"mousemove",n=>xs(Na,this,jre).call(this,n)),this.eventManager.addEventListener(e,"mouseup",()=>xs(Na,this,zre).call(this))}unregisterEvents(){this.eventManager.clear()}buildPluginUI(){Ee(jn,this).build(),Ee(Hs,this).build()}destroy(){Ee(jn,this).destroy(),Ee(Hs,this).destroy(),super.destroy()}}function Bre(t,e,n,r){const{wtTable:i,wtViewport:o}=this.hot.view._wt,s=this.hot.selection.isSelectedByRowHeader(),a=this.hot.getSelectedRangeLast();if(!a||!s||Ee(Ws,this)||t.button!==0){Ja(Ws,this,!1),Ee(Ko,this).length=0,pe(this.hot.rootElement,[BS,_m]);return}const l=Ee(Hs,this).isBuilt()&&!Ee(Hs,this).isAppended(),u=Ee(jn,this).isBuilt()&&!Ee(jn,this).isAppended();l&&u&&(Ee(Hs,this).appendTo(i.hider),Ee(jn,this).appendTo(i.hider));const{from:c,to:h}=a,d=Math.min(c.row,h.row),f=Math.max(c.row,h.row);if(e.col<0&&e.row>=d&&e.row<=f){r.row=!0,Ja(Ws,this,!0),Ee(hr,this).eventPageY=t.pageY,Ee(hr,this).coords=e,Ee(hr,this).TD=n,Ja(Ko,this,this.prepareRowsToMoving());const m=i.holder.scrollLeft+o.getRowHeaderWidth(),C=this.getRowsHeight(d,e.row-1)+(t.clientY-n.getBoundingClientRect().top);Ee(jn,this).setPosition(null,m),Ee(jn,this).setSize(i.hider.offsetWidth-m,this.getRowsHeight(d,f)),Ee(jn,this).setOffset(-C,null),q(this.hot.rootElement,BS),this.refreshPositions()}else pe(this.hot.rootElement,jS),Ja(Ws,this,!1),Ee(Ko,this).length=0}function jre(t){Ee(Ws,this)&&(Ee(hr,this).eventPageY=t.pageY,this.refreshPositions())}function Ure(t,e,n,r){!this.hot.getSelectedRangeLast()||!Ee(Ws,this)||(Ee(Ko,this).indexOf(e.row)>-1?pe(this.hot.rootElement,_m):q(this.hot.rootElement,_m),r.row=!0,r.column=!0,r.cell=!0,Ee(hr,this).coords=e,Ee(hr,this).TD=n)}function zre(){const t=Ee(hr,this).row,e=Ee(Ko,this).length;if(Ja(Ws,this,!1),pe(this.hot.rootElement,[BS,_m,jS]),this.hot.selection.isSelectedByRowHeader()&&q(this.hot.rootElement,jS),e<1||t===void 0)return;const n=Ee(Ko,this)[0],r=this.hot.toPhysicalRow(n),i=this.dragRows(Ee(Ko,this),t);if(Ee(Ko,this).length=0,i===!0){this.persistentStateSave(),this.hot.render(),this.hot.view.adjustElementsSize();const o=this.hot.toVisualRow(r),s=o+e-1;this.hot.selectRows(o,s)}}function Yre(){const t=this.hot.view._wt.wtTable,e=this.hot.view._wt.wtViewport.getRowHeaderWidth(),n=t.holder.scrollLeft,r=e+n;Ee(jn,this).setPosition(null,r),Ee(jn,this).setSize(t.hider.offsetWidth-r)}function Gre(){this.moveBySettingsOrLoad()}function qre(t,e){m$(t,e),e.add(t)}function In(t,e,n){m$(t,e),e.set(t,n)}function m$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Nt(t,e,n){return t.set(Vo(t,e),n),n}function ne(t,e){return t.get(Vo(t,e))}function Vo(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Mm="manualRowResize",Kre=30,fH="manualRowHeights";var Qi=new WeakMap,Xf=new WeakMap,_r=new WeakMap,Hh=new WeakMap,Ns=new WeakMap,CT=new WeakMap,xu=new WeakMap,Zf=new WeakMap,Fn=new WeakMap,Ki=new WeakMap,dl=new WeakMap,Im=new WeakMap,Nh=new WeakMap,Dh=new WeakMap,Ci=new WeakMap,kh=new WeakMap,Ss=new WeakSet;class Xre extends Xe{static get PLUGIN_KEY(){return Mm}static get PLUGIN_PRIORITY(){return Kre}constructor(e){super(e),qre(this,Ss),In(this,Qi,null),In(this,Xf,null),In(this,_r,[]),In(this,Hh,null),In(this,Ns,null),In(this,CT,null),In(this,xu,null),In(this,Zf,null),In(this,Fn,this.hot.rootDocument.createElement("DIV")),In(this,Ki,this.hot.rootDocument.createElement("DIV")),In(this,dl,!1),In(this,Im,!1),In(this,Nh,0),In(this,Dh,null),In(this,Ci,void 0),In(this,kh,void 0),q(ne(Fn,this),"manualRowResizer"),q(ne(Ki,this),"manualRowResizerGuide")}get inlineDir(){return this.hot.isRtl()?"right":"left"}isEnabled(){return this.hot.getSettings()[Mm]}enablePlugin(){this.enabled||(Nt(Ci,this,new Qs),ne(Ci,this).addLocalHook("init",()=>Vo(Ss,this,rie).call(this)),this.hot.rowIndexMapper.registerMap(this.pluginName,ne(Ci,this)),this.addHook("modifyRowHeight",(e,n)=>Vo(Ss,this,nie).call(this,e,n)),this.bindEvents(),super.enablePlugin())}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}disablePlugin(){Nt(kh,this,ne(Ci,this).getValues()),this.hot.rowIndexMapper.unregisterMap(this.pluginName),super.disablePlugin()}saveManualRowHeights(){this.hot.runHooks("persistentStateSave",fH,ne(Ci,this).getValues())}loadManualRowHeights(){const e={};return this.hot.runHooks("persistentStateLoad",fH,e),e.value}setManualSize(e,n){const r=this.hot.toPhysicalRow(e),i=Math.max(n,this.hot.view.getDefaultRowHeight());return ne(Ci,this).setValueAtIndex(r,i),i}getLastDesiredRowHeight(){return ne(Hh,this)}setupHandlePosition(e){Nt(Qi,this,e);const{view:n}=this.hot,{_wt:r}=n,i=r.wtTable.getCoords(ne(Qi,this)),o=i.row;if(o<0)return;const s=qt(ne(Qi,this)),a=ne(Qi,this).getBoundingClientRect(),l=o<r.getSetting("fixedRowsTop"),u=o>=n.countNotHiddenRowIndexes(0,1)-r.getSetting("fixedRowsBottom");let c;l?c=r.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(ne(Qi,this),i.row,i.col):u&&(c=r.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(ne(Qi,this),i.row,i.col)),c||(c=r.wtOverlays.inlineStartOverlay.getRelativeCellPosition(ne(Qi,this),i.row,i.col)),Nt(Xf,this,this.hot.rowIndexMapper.getVisualFromRenderableIndex(o)),Nt(_r,this,[]);const h=this.hot.selection.isSelectedByCorner()||this.hot.selection.isSelectedByRowHeader();if(this.hot.selection.isSelected()&&h){const d=this.hot.getSelectedRange();I(d,f=>{const m=f.getTopStartCorner().row,C=f.getBottomStartCorner().row;de(m,C,y=>{ne(_r,this).includes(y)||ne(_r,this).push(y)})})}ne(_r,this).includes(ne(Xf,this))||Nt(_r,this,[ne(Xf,this)]),Nt(Zf,this,c.top-6),Nt(xu,this,parseInt(a.height,10)),ne(Fn,this).style.top=`${ne(Zf,this)+ne(xu,this)}px`,ne(Fn,this).style[this.inlineDir]=`${c.start}px`,ne(Fn,this).style.width=`${s}px`,this.hot.rootElement.appendChild(ne(Fn,this))}refreshHandlePosition(){ne(Fn,this).style.top=`${ne(Zf,this)+ne(Hh,this)}px`}setupGuidePosition(){const e=parseInt(qt(ne(Fn,this)),10),n=parseInt(ne(Fn,this).style[this.inlineDir],10)+e,r=this.hot.view.getTableWidth();q(ne(Fn,this),"active"),q(ne(Ki,this),"active"),ne(Ki,this).style.top=ne(Fn,this).style.top,ne(Ki,this).style[this.inlineDir]=`${n}px`,ne(Ki,this).style.width=`${r-e}px`,this.hot.rootElement.appendChild(ne(Ki,this))}refreshGuidePosition(){ne(Ki,this).style.top=ne(Fn,this).style.top}hideHandleAndGuide(){pe(ne(Fn,this),"active"),pe(ne(Ki,this),"active")}checkIfRowHeader(e){const n=il(e,["TBODY"],this.hot.rootElement),{inlineStartOverlay:r,topInlineStartCornerOverlay:i,bottomInlineStartCornerOverlay:o}=this.hot.view._wt.wtOverlays;return[r.clone.wtTable.TBODY,i.clone.wtTable.TBODY,o.clone.wtTable.TBODY].includes(n)}getClosestTHParent(e){return e.tagName!=="TABLE"?e.tagName==="TH"?e:this.getClosestTHParent(e.parentNode):null}getActualRowHeight(e){const n=this.hot.view._wt.wtTable.getRowHeight(e);return n!==void 0&&ne(Ns,this)<n?n:ne(Ns,this)}afterMouseDownTimeout(){const e=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},n=(r,i)=>{const o=this.hot.runHooks("beforeRowResize",this.getActualRowHeight(r),r,!0);o!==void 0&&Nt(Ns,this,o),this.setManualSize(r,ne(Ns,this)),this.hot.runHooks("afterRowResize",this.getActualRowHeight(r),r,!0),i&&e()};ne(Nh,this)>=2&&(ne(_r,this).length>1?(I(ne(_r,this),i=>{n(i)}),e()):I(ne(_r,this),i=>{n(i,!0)})),Nt(Nh,this,0),Nt(Dh,this,null)}bindEvents(){const{rootElement:e,rootWindow:n}=this.hot;this.eventManager.addEventListener(e,"mouseover",r=>Vo(Ss,this,Zre).call(this,r)),this.eventManager.addEventListener(e,"mousedown",r=>Vo(Ss,this,Qre).call(this,r)),this.eventManager.addEventListener(n,"mousemove",r=>Vo(Ss,this,Jre).call(this,r)),this.eventManager.addEventListener(n,"mouseup",()=>Vo(Ss,this,eie).call(this)),this.eventManager.addEventListener(ne(Fn,this),"contextmenu",()=>Vo(Ss,this,tie).call(this))}destroy(){super.destroy()}}function Zre(t){if(!zN(t.target)&&ne(Im,this)!==!0&&this.checkIfRowHeader(t.target)){const e=this.getClosestTHParent(t.target);e&&(ne(dl,this)||this.setupHandlePosition(e))}}function Qre(t){ve(t.target,"manualRowResizer")&&(this.setupHandlePosition(ne(Qi,this)),this.setupGuidePosition(),Nt(dl,this,!0),ne(Dh,this)===null&&(Nt(Dh,this,setTimeout(()=>this.afterMouseDownTimeout(),500)),this.hot._registerTimeout(ne(Dh,this))),Nt(Nh,this,ne(Nh,this)+1),Nt(CT,this,t.pageY),Nt(Ns,this,ne(xu,this)))}function Jre(t){ne(dl,this)&&(Nt(Hh,this,ne(xu,this)+(t.pageY-ne(CT,this))),I(ne(_r,this),e=>{Nt(Ns,this,this.setManualSize(e,ne(Hh,this)))}),this.refreshHandlePosition(),this.refreshGuidePosition())}function eie(){const t=()=>{this.hot.render(),this.hot.view.adjustElementsSize()},e=(n,r)=>{this.hot.runHooks("beforeRowResize",this.getActualRowHeight(n),n,!1),r&&t(),this.saveManualRowHeights(),this.hot.runHooks("afterRowResize",this.getActualRowHeight(n),n,!1)};ne(dl,this)&&(this.hideHandleAndGuide(),Nt(dl,this,!1),ne(Ns,this)!==ne(xu,this)&&(ne(_r,this).length>1?(I(ne(_r,this),r=>{e(r)}),t()):I(ne(_r,this),r=>{e(r,!0)})),this.setupHandlePosition(ne(Qi,this)))}function tie(){this.hideHandleAndGuide(),this.hot.rootElement.removeChild(ne(Fn,this)),this.hot.rootElement.removeChild(ne(Ki,this)),Nt(dl,this,!1),Nt(Im,this,!0),this.hot._registerImmediate(()=>{Nt(Im,this,!1)})}function nie(t,e){let n=t;if(this.enabled){const r=this.hot.toPhysicalRow(e),i=ne(Ci,this).getValueAtIndex(r);this.hot.getSettings()[Mm]&&i&&(n=i)}return n}function rie(){const t=this.hot.getSettings()[Mm],e=this.loadManualRowHeights();this.hot.batchExecution(()=>{typeof e<"u"?e.forEach((n,r)=>{ne(Ci,this).setValueAtIndex(r,n)}):Array.isArray(t)?(t.forEach((n,r)=>{ne(Ci,this).setValueAtIndex(r,n)}),Nt(kh,this,t)):t===!0&&Array.isArray(ne(kh,this))&&ne(kh,this).forEach((n,r)=>{ne(Ci,this).setValueAtIndex(r,n)})},!0)}var gH={},mH;function iie(){if(mH)return gH;mH=1;var t=sp();return t("flatMap"),gH}iie();var pH={},wH={},bb,vH;function oie(){if(vH)return bb;vH=1;var t=an(),e=un(),n=co(),r=rR();return bb=function(i,o){(!o||typeof i!="string")&&e(i);var s=r(i);return n(e(s!==void 0?t(s,i):i))},bb}var CH;function sie(){if(CH)return wH;CH=1;var t=dt(),e=an(),n=dr(),r=un(),i=co(),o=oie(),s=sR(),a=fr(),l=qs(),u=aR(),c=Xs(),h=!l&&!u("flatMap",function(){}),d=!l&&!h&&c("flatMap",TypeError),f=l||h||d,m=s(function(){for(var C=this.iterator,y=this.mapper,E,v;;){if(v=this.inner)try{if(E=r(e(v.next,v.iterator)),!E.done)return E.value;this.inner=null}catch(_){a(C,"throw",_)}if(E=r(e(this.next,C)),this.done=!!E.done)return;try{this.inner=o(y(E.value,this.counter++),!1)}catch(_){a(C,"throw",_)}}});return t({target:"Iterator",proto:!0,real:!0,forced:f},{flatMap:function(y){r(this);try{n(y)}catch(E){a(this,"throw",E)}return d?e(d,this,y):new m(i(this),{mapper:y,inner:null})}}),wH}var yH;function aie(){return yH||(yH=1,sie()),pH}aie();function lie(t,e,n){uie(t,e),e.set(t,n)}function uie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Da(t,e,n){return(e=cie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cie(t){var e=hie(t,"string");return typeof e=="symbol"?e:e+""}function hie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bH(t,e){return t.get(p$(t,e))}function Qf(t,e,n){return t.set(p$(t,e),n),n}function p$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var ka=new WeakMap;class Ji{constructor(e,n,r,i,o,s){Da(this,"row",void 0),Da(this,"col",void 0),Da(this,"rowspan",void 0),Da(this,"colspan",void 0),Da(this,"removed",!1),Da(this,"cellCoordsFactory",void 0),Da(this,"cellRangeFactory",void 0),lie(this,ka,null),this.row=e,this.col=n,this.rowspan=r,this.colspan=i,this.cellCoordsFactory=o,this.cellRangeFactory=s}static NEGATIVE_VALUES_WARNING(e){let{row:n,col:r,rowspan:i,colspan:o}=e;return nt`The merged cell declared with {row: ${n}, col: ${r},\x20
268
+ rowspan: ${i}, colspan: ${o}} contains negative values, which is\x20
269
+ not supported. It will not be added to the collection.`}static IS_OUT_OF_BOUNDS_WARNING(e){let{row:n,col:r}=e;return nt`The merged cell declared at [${n}, ${r}] is positioned\x20
270
+ (or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`}static IS_SINGLE_CELL(e){let{row:n,col:r}=e;return nt`The merged cell declared at [${n}, ${r}] has both "rowspan"\x20
271
+ and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`}static ZERO_SPAN_WARNING(e){let{row:n,col:r}=e;return nt`The merged cell declared at [${n}, ${r}] has "rowspan"\x20
272
+ or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`}static containsNegativeValues(e){let{row:n,col:r,rowspan:i,colspan:o}=e;return n<0||r<0||i<0||o<0}static isSingleCell(e){let{rowspan:n,colspan:r}=e;return r===1&&n===1}static containsZeroSpan(e){let{rowspan:n,colspan:r}=e;return r===0||n===0}static isOutOfBounds(e,n,r){return e.row<0||e.col<0||e.row>=n||e.row+e.rowspan-1>=n||e.col>=r||e.col+e.colspan-1>=r}normalize(e){const n=e.countRows(),r=e.countCols();this.row<0?this.row=0:this.row>n-1&&(this.row=n-1),this.col<0?this.col=0:this.col>r-1&&(this.col=r-1),this.row+this.rowspan>n-1&&(this.rowspan=n-this.row),this.col+this.colspan>r-1&&(this.colspan=r-this.col),Qf(ka,this,null)}includes(e,n){return this.row<=e&&this.col<=n&&this.row+this.rowspan-1>=e&&this.col+this.colspan-1>=n}includesHorizontally(e){return this.col<=e&&this.col+this.colspan-1>=e}includesVertically(e){return this.row<=e&&this.row+this.rowspan-1>=e}shift(e,n){const r=e[0]||e[1],i=n+Math.abs(e[0]||e[1])-1,o=e[0]?"colspan":"rowspan",s=e[0]?"col":"row",a=Math.min(n,i),l=Math.max(n,i),u=this[s],c=this[s]+this[o]-1;if(u>=n&&(this[s]+=r),r>0)n<=c&&n>u&&(this[o]+=r);else if(r<0){if(a<=u&&l>=c)return this.removed=!0,Qf(ka,this,null),!1;if(u>=a&&u<=l){const h=l-u+1,d=Math.abs(r)-h;this[s]-=d+r,this[o]-=h}else if(u<=a&&c>=l)this[o]+=r;else if(u<=a&&c>=a&&c<l){const h=c-a+1;this[o]-=h}}return Qf(ka,this,null),!0}isFarther(e,n){return e?n==="down"?e.row+e.rowspan-1<this.row+this.rowspan-1:n==="up"?e.row>this.row:n==="right"?e.col+e.colspan-1<this.col+this.colspan-1:n==="left"?e.col>this.col:null:!0}getLastRow(){return this.row+this.rowspan-1}getLastColumn(){return this.col+this.colspan-1}getRange(){return bH(ka,this)||Qf(ka,this,this.cellRangeFactory(this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.row,this.col),this.cellCoordsFactory(this.getLastRow(),this.getLastColumn()))),bH(ka,this)}}function die(t,e){fie(t,e),e.add(t)}function fie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Jf(t,e,n){return(e=gie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gie(t){var e=mie(t,"string");return typeof e=="symbol"?e:e+""}function mie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function La(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Rs=new WeakSet;class Pm{constructor(e){die(this,Rs),Jf(this,"plugin",void 0),Jf(this,"mergedCells",[]),Jf(this,"mergedCellsMatrix",new Map),Jf(this,"hot",void 0),this.plugin=e,this.hot=e.hot}static IS_OVERLAPPING_WARNING(e){let{row:n,col:r}=e;return nt`The merged cell declared at [${n}, ${r}], overlaps\x20
273
+ with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
274
+ fix your setup.`}get(e,n){var r;return this.mergedCellsMatrix.has(e)&&(r=this.mergedCellsMatrix.get(e).get(n))!==null&&r!==void 0?r:!1}getByRange(e){const{row:n,col:r}=e.getTopStartCorner(),{row:i,col:o}=e.getBottomEndCorner(),s=this.mergedCells.length;let a=!1;for(let l=0;l<s;l++){const u=this.mergedCells[l],{row:c,col:h,rowspan:d,colspan:f}=u;if(c>=n&&c+d-1<=i&&h>=r&&h+f-1<=o){a=u;break}}return a}filterOverlappingMergeCells(e){const n=new Set;return this.mergedCells.forEach(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i;for(let u=o;u<o+l;u++)for(let c=s;c<s+a;c++)n.add(`r${u},c${c}`)}),e.filter(i=>{const{row:o,col:s,colspan:a,rowspan:l}=i,u=new Set;let c=!1;for(let h=o;h<o+l;h++){for(let d=s;d<s+a;d++){const f=`r${h},c${d}`;if(n.has(f)){Ze(Pm.IS_OVERLAPPING_WARNING(i)),c=!0;break}u.add(f)}if(c)break}return c||n.add(...u),!c})}getWithinRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const{row:r,col:i}=e.getTopStartCorner(),{row:o,col:s}=e.getBottomEndCorner(),a=[];for(let l=r;l<=o;l++)for(let u=i;u<=s;u++){const c=this.get(l,u);c&&(n||!n&&c.row===l&&c.col===u)&&a.push(c)}return a}add(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=e.row,i=e.col,o=e.rowspan,s=e.colspan,a=new Ji(r,i,o,s,this.hot._createCellCoords,this.hot._createCellRange),l=this.get(r,i),u=n?!1:this.isOverlapping(a);return!l&&!u?(this.hot&&a.normalize(this.hot),this.mergedCells.push(a),La(Rs,this,SH).call(this,a),a):(u&&Ze(Pm.IS_OVERLAPPING_WARNING(a)),!1)}remove(e,n){const r=this.get(e,n),i=r?this.mergedCells.indexOf(r):-1;return r&&i!==-1?(this.mergedCells.splice(i,1),La(Rs,this,pie).call(this,r),r):!1}clear(){I(this.mergedCells,e=>{let{row:n,col:r,rowspan:i,colspan:o}=e;de(n,n+i,s=>{de(r,r+o,a=>{const l=this.hot.getCell(s,a);l&&(l.removeAttribute("rowspan"),l.removeAttribute("colspan"),l.style.display="")})})}),this.mergedCells.length=0,this.mergedCellsMatrix=new Map}isOverlapping(e){const n=e.getRange();for(let r=0;r<this.mergedCells.length;r++)if(this.mergedCells[r].getRange().overlaps(n))return!0;return!1}isFirstRenderableMergedCell(e,n){const r=this.get(e,n);if(!r)return!1;const{row:i,col:o,rowspan:s,colspan:a}=r,l=this.hot.view.getActiveOverlayName(),u=["top","top_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleRow(),c=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(l)?0:this.hot.getFirstRenderedVisibleColumn(),h=Ue(u,i,i+s-1),d=Ue(c,o,o+a-1);return this.hot.rowIndexMapper.getNearestNotHiddenIndex(h,1)===e&&this.hot.columnIndexMapper.getNearestNotHiddenIndex(d,1)===n}getFirstRenderableCoords(e,n){const r=this.get(e,n);if(!r||this.isFirstRenderableMergedCell(e,n))return this.hot._createCellCoords(e,n);const i=this.hot.rowIndexMapper.getNearestNotHiddenIndex(r.row,1),o=this.hot.columnIndexMapper.getNearestNotHiddenIndex(r.col,1);return this.hot._createCellCoords(i,o)}getStartMostColumnIndex(e,n){const r=La(Rs,this,eg).call(this,e,"col",-1);let i=n;for(let o=0;o<r.length;o++)if(r[o]<=n){i=r[o];break}return i}getEndMostColumnIndex(e,n){const r=La(Rs,this,eg).call(this,e,"col",1);let i=n;for(let o=0;o<r.length;o++)if(r[o]>=n){i=r[o];break}return i}getTopMostRowIndex(e,n){const r=La(Rs,this,eg).call(this,e,"row",-1);let i=n;for(let o=0;o<r.length;o++)if(r[o]<=n){i=r[o];break}return i}getBottomMostRowIndex(e,n){const r=La(Rs,this,eg).call(this,e,"row",1);let i=n;for(let o=0;o<r.length;o++)if(r[o]>=n){i=r[o];break}return i}shiftCollections(e,n,r){const i=[0,0];switch(e){case"right":i[0]+=r;break;case"left":i[0]-=r;break;case"down":i[1]+=r;break;case"up":i[1]-=r;break}const o=[];this.mergedCells.forEach(s=>{s.shift(i,n),s.removed&&o.push(s)}),o.forEach(s=>{this.mergedCells.splice(this.mergedCells.indexOf(s),1)}),this.mergedCellsMatrix.clear(),this.mergedCells.forEach(s=>{La(Rs,this,SH).call(this,s)})}}function eg(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const r=new Map,i=n===1?t.getTopStartCorner():t.getBottomEndCorner(),o=n===1?t.getBottomEndCorner():t.getTopStartCorner();for(let s=i.row;n===1?s<=o.row:s>=o.row;s+=n)for(let a=i.col;n===1?a<=o.col:a>=o.col;a+=n){const l=e==="row"?s:a,u=this.get(s,a);let c=l;u&&(c=n===1?u[e]+u[`${e}span`]-1:u[e]),r.has(l)||r.set(l,new Set),r.get(l).add(c)}return Array.from(new Set(Array.from(r.entries()).filter(s=>{let[,a]=s;return a.size===1}).flatMap(s=>{let[,a]=s;return Array.from(a)})))}function SH(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let n=t.col;n<t.col+t.colspan;n++)this.mergedCellsMatrix.has(e)||this.mergedCellsMatrix.set(e,new Map),this.mergedCellsMatrix.get(e).set(n,t)}function pie(t){for(let e=t.row;e<t.row+t.rowspan;e++)for(let n=t.col;n<t.col+t.colspan;n++)this.mergedCellsMatrix.get(e).delete(n)}function Sb(t,e,n){return(e=wie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wie(t){var e=vie(t,"string");return typeof e=="symbol"?e:e+""}function vie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Cie{constructor(e){Sb(this,"plugin",void 0),Sb(this,"mergedCellsCollection",void 0),Sb(this,"currentFillData",null),this.plugin=e,this.mergedCellsCollection=this.plugin.mergedCellsCollection}getDirection(e,n){let r=null;return n[0]===e[0]&&n[1]===e[1]&&n[3]===e[3]?r="down":n[2]===e[2]&&n[1]===e[1]&&n[3]===e[3]?r="up":n[1]===e[1]&&n[2]===e[2]?r="right":r="left",r}snapDragArea(e,n,r,i){const o=n.slice(0),s=this.getAutofillSize(e,n,r),[a,l,u,c]=e,d=["up","down"].indexOf(r)>-1?u-a+1:c-l+1,f=Math.floor(s/d)*d,m=s-f,C=this.getFarthestCollection(e,n,r,i);if(C){if(r==="down"){const y=C.row+C.rowspan-a-m;o[2]+y>=this.plugin.hot.countRows()?o[2]-=m:o[2]+=m?y:0}else if(r==="right"){const y=C.col+C.colspan-l-m;o[3]+y>=this.plugin.hot.countCols()?o[3]-=m:o[3]+=m?y:0}else if(r==="up"){const y=u-m-C.row+1;o[0]+y<0?o[0]+=m:o[0]-=m?y:0}else if(r==="left"){const y=c-m-C.col+1;o[1]+y<0?o[1]+=m:o[1]-=m?y:0}}return this.updateCurrentFillCache({baseArea:e,dragDirection:r,foundMergedCells:i,fillSize:s,dragArea:o,cycleLength:d}),o}updateCurrentFillCache(e){this.currentFillData||(this.currentFillData={}),on(this.currentFillData,e)}getAutofillSize(e,n,r){const[i,o,s,a]=e,[l,u,c,h]=n;switch(r){case"up":return i-l;case"down":return c-s;case"left":return o-u;case"right":return h-a;default:return null}}getDragArea(e,n,r){const[i,o,s,a]=e,[l,u,c,h]=n;switch(r){case"up":return[l,u,i-1,a];case"down":{const d=this.mergedCellsCollection.get(c,a),f=d?d.rowspan-1:0;return[s+1,o,c+f,a]}case"left":return[l,u,s,o-1];case"right":{const d=this.mergedCellsCollection.get(c,a),f=d?d.colspan-1:0;return[i,a+f,c,h]}default:return null}}getFarthestCollection(e,n,r,i){const[o,s,a,l]=e,u=["up","down"].indexOf(r)>-1,c=u?a:l,h=u?o:s,d=this.getAutofillSize(e,n,r),f=u?a-o+1:l-s+1,m=Math.floor(d/f)*f,C=d-m;let y=null,E=null,v=null;switch(r){case"up":y="includesVertically",v=c-C+1;break;case"left":y="includesHorizontally",v=c-C+1;break;case"down":y="includesVertically",v=h+C-1;break;case"right":y="includesHorizontally",v=h+C-1;break}return I(i,_=>{_[y](v)&&_.isFarther(E,r)&&(E=_)}),E}recreateAfterDataPopulation(e){if(!this.currentFillData)return;const n=this.getRangeFromChanges(e),r=this.currentFillData.foundMergedCells,i=this.currentFillData.dragDirection,o=(u,c)=>{switch(i){case"up":return u.row-c>=n.from.row;case"down":return u.row+u.rowspan-1+c<=n.to.row;case"left":return u.col-c>=n.from.column;case"right":return u.col+u.colspan-1+c<=n.to.column;default:return null}};let s=0,a=null,l=1;do for(let u=0;u<r.length;u+=1){if(a=r[u],s=l*this.currentFillData.cycleLength,o(a,s))switch(i){case"up":this.plugin.mergedCellsCollection.add({row:a.row-s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"down":this.plugin.mergedCellsCollection.add({row:a.row+s,rowspan:a.rowspan,col:a.col,colspan:a.colspan},!0);break;case"left":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col-s,colspan:a.colspan},!0);break;case"right":this.plugin.mergedCellsCollection.add({row:a.row,rowspan:a.rowspan,col:a.col+s,colspan:a.colspan},!0);break}u===r.length-1&&(l+=1)}while(o(a,s));this.currentFillData=null,this.plugin.hot.render(),r.length>0&&this.plugin.ifChromeForceRepaint()}getRangeFromChanges(e){const n={min:null,max:null},r={min:null,max:null};return I(e,i=>{const o=i[0],s=this.plugin.hot.propToCol(i[1]);(n.min===null||o<n.min)&&(n.min=o),(n.max===null||o>n.max)&&(n.max=o),(r.min===null||s<r.min)&&(r.min=s),(r.max===null||s>r.max)&&(r.max=s)}),{from:{row:n.min,column:r.min},to:{row:n.max,column:r.max}}}dragAreaOverlapsCollections(e,n,r){const i=this.getDragArea(e,n,r),[o,s,a,l]=i,u=this.plugin.hot._createCellCoords(o,s),c=this.plugin.hot._createCellCoords(a,l),h=this.plugin.hot._createCellRange(u,u,c);if(this.mergedCellsCollection.getWithinRange(h,!0).length===0)return!1;const f=this.mergedCellsCollection.getWithinRange(h,!1);return f.length===0?!0:r==="up"||r==="down"?!f.every(m=>{let{colspan:C}=m;return C===h.getWidth()}):!f.every(m=>{let{rowspan:C}=m;return C===h.getHeight()})}}function Rb(t,e,n){return(e=yie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yie(t){var e=bie(t,"string");return typeof e=="symbol"?e:e+""}function bie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Sie{constructor(e){Rb(this,"plugin",void 0),Rb(this,"hot",void 0),Rb(this,"fullySelectedMergedCellClassName","fullySelectedMergedCell"),this.plugin=e,this.hot=e.hot}getSelectedMergedCellClassName(e,n,r,i){const o=Math.min(r[0],r[2]),s=Math.min(r[1],r[3]),a=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]);if(i===void 0||!this.plugin.mergedCellsCollection.isFirstRenderableMergedCell(e,n))return;const c=this.plugin.mergedCellsCollection.get(e,n);if(!c)return;const h=c.getLastRow(),d=c.getLastColumn();if(o<=c.row&&s<=c.col&&a>=h&&l>=d)return`${this.fullySelectedMergedCellClassName}-${i}`;if(this.isMergeCellFullySelected(c,this.plugin.hot.getSelectedRange()))return`${this.fullySelectedMergedCellClassName}-multiple`}isMergeCellFullySelected(e,n){const r=[];if(!n||!e)return!1;for(let i=0;i<e.rowspan;i+=1)for(let o=0;o<e.colspan;o+=1)r.push(this.hot._createCellCoords(e.row+i,e.col+o));for(let i=0;i<r.length;i+=1){const o=[];for(let s=0;s<n.length;s+=1)o[s]=n[s].includes(r[i]);if(!o.includes(!0))return!1}return!0}getSelectedMergedCellClassNameToRemove(){const e=[];for(let n=0;n<=7;n+=1)e.push(`${this.fullySelectedMergedCellClassName}-${n}`);return e.push(`${this.fullySelectedMergedCellClassName}-multiple`),e}}function Rie(t){return{key:"mergeCells",name(){const e=this.getSelectedLast();if(e){const n=t.mergedCellsCollection.get(e[0],e[1]);if(n.row===e[0]&&n.col===e[1]&&n.row+n.rowspan-1===e[2]&&n.col+n.colspan-1===e[3])return this.getTranslatedPhrase(xE)}return this.getTranslatedPhrase(OE)},callback(){const e=this.getSelectedRangeLast();if(!e)return;e.setDirection(this.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;t.toggleMerge(e),this.selectCell(n.row,n.col,r.row,r.col,!1)},disabled(){const e=this.getSelectedLast();return e?Ji.isSingleCell({row:e[0],col:e[1],rowspan:e[2]-e[0]+1,colspan:e[3]-e[1]+1})||this.selection.isSelectedByCorner():!0},hidden:!1}}function Lh(t,e,n){return(e=Eie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Eie(t){var e=Tie(t,"string");return typeof e=="symbol"?e:e+""}function Tie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class RH{constructor(e){Lh(this,"data",void 0),Lh(this,"next",null),Lh(this,"prev",null),this.data=e}}class tg{constructor(){Lh(this,"first",null),Lh(this,"last",null)}push(e){const n=new RH(e);if(this.first===null)this.first=n,this.last=n;else{const r=this.last;this.last=n,n.prev=r,r.next=n}return n}unshift(e){const n=new RH(e);if(this.first===null)this.first=n,this.last=n;else{const r=this.first;this.first=n,n.next=r,r.prev=n}}inorder(e){let n=this.first;for(;n;){const r=e(n);if(n===this.last||r===!0)break;n=n.next}}remove(e){if(this.first===null)return!1;let n=this.first,r,i;for(;n;){if(n.data===e)return r=n.next,i=n.prev,r&&(r.prev=i),i&&(i.next=r),n===this.first&&(this.first=r),n===this.last&&(this.last=i),!0;n=n.next}return!1}hasCycle(){let e=this.first,n=this.first;for(;;){if(e===null||(e=e.next,e===null))return!1;if(e=e.next,n=n.next,e===n)return!0}}pop(){if(this.last===null)return null;const e=this.last;return this.last=this.last.prev,e}shift(){if(this.first===null)return null;const e=this.first;return this.first=this.first.next,e}recursiveReverse(){function e(r,i){i&&(e(i,i.next),i.next=r)}if(!this.first)return;e(this.first,this.first.next),this.first.next=null;const n=this.first;this.first=this.last,this.last=n}reverse(){if(!this.first||!this.first.next)return;let e=this.first.next,n=this.first,r;for(;e;)r=e.next,e.next=n,n.prev=e,n=e,e=r;this.first.next=null,this.last.prev=null,r=this.first,this.first=n,this.last=r}}function _ie(t,e){w$(t,e),e.add(t)}function $a(t,e,n){w$(t,e),e.set(t,n)}function w$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function tt(t,e){return t.get(Om(t,e))}function vr(t,e,n){return t.set(Om(t,e),n),n}function Om(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Bi=new WeakMap,ji=new WeakMap,Ui=new WeakMap,zi=new WeakMap,US=new WeakMap,ng=new WeakMap,rg=new WeakMap,Eb=new WeakSet;class Mie{constructor(e){let{mergedCellsGetter:n,rowIndexMapper:r,columnIndexMapper:i}=e;_ie(this,Eb),$a(this,Bi,new tg),$a(this,ji,new tg),$a(this,Ui,null),$a(this,zi,null),$a(this,US,null),$a(this,ng,null),$a(this,rg,null),vr(US,this,n),vr(ng,this,r),vr(rg,this,i)}getCurrentVerticalNode(){return tt(zi,this).data}getFirstVerticalNode(){return tt(ji,this).first.data}getNextVerticalNode(){return tt(zi,this).next.data}getPrevVerticalNode(){return tt(zi,this).prev.data}getCurrentHorizontalNode(){return tt(Ui,this).data}getFirstHorizontalNode(){return tt(Bi,this).first.data}getNextHorizontalNode(){return tt(Ui,this).next.data}getPrevHorizontalNode(){return tt(Ui,this).prev.data}setPrevNodeAsActive(){vr(zi,this,tt(zi,this).prev),vr(Ui,this,tt(Ui,this).prev)}setNextNodeAsActive(){vr(zi,this,tt(zi,this).next),vr(Ui,this,tt(Ui,this).next)}buildFocusOrder(e){const n=e.getTopStartCorner(),r=e.getBottomEndCorner(),i=new WeakSet;vr(Bi,this,new tg);for(let s=n.row;s<=r.row;s++)if(!tt(ng,this).isHidden(s))for(let a=n.col;a<=r.col;a++){if(tt(rg,this).isHidden(a))continue;const l=Om(Eb,this,EH).call(this,e,tt(Bi,this),i,s,a);l&&vr(Ui,this,l)}tt(Bi,this).first&&(tt(Bi,this).first.prev=tt(Bi,this).last,tt(Bi,this).last.next=tt(Bi,this).first);const o=new WeakSet;vr(ji,this,new tg);for(let s=n.col;s<=r.col;s++)if(!tt(rg,this).isHidden(s))for(let a=n.row;a<=r.row;a++){if(tt(ng,this).isHidden(a))continue;const l=Om(Eb,this,EH).call(this,e,tt(ji,this),o,a,s);l&&vr(zi,this,l)}tt(ji,this).first&&(tt(ji,this).first.prev=tt(ji,this).last,tt(ji,this).last.next=tt(ji,this).first)}setActiveNode(e,n){return tt(Bi,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return vr(Ui,this,r),!1}),tt(ji,this).inorder(r=>{const{rowStart:i,rowEnd:o,colStart:s,colEnd:a}=r.data;if(e>=i&&e<=o&&n>=s&&n<=a)return vr(zi,this,r),!1}),this}}function EH(t,e,n,r,i){const o=t.getTopStartCorner(),s=t.getBottomEndCorner(),a=t.highlight.clone().normalize(),l=tt(US,this).call(this,r,i);if(l&&n.has(l))return null;const u={colStart:i,colEnd:i,rowStart:r,rowEnd:r};if(l){if(n.add(l),l.row<o.row||l.row+l.rowspan-1>s.row||l.col<o.col||l.col+l.colspan-1>s.col)return null;u.colStart=l.col,u.colEnd=l.col+l.colspan-1,u.rowStart=l.row,u.rowEnd=l.row+l.rowspan-1}const c=e.push(u);return r===a.row&&i===a.col||l&&a.row>=l.row&&a.row<=l.row+l.rowspan-1&&a.col>=l.col&&a.col<=l.col+l.colspan-1?c:null}function v$(t,e,n){const{view:r,rowIndexMapper:i}=t,o=r.getStylesHandler(),s=r.getDefaultRowHeight();let a=0;for(let u=e;u<e+n;u++)if(!i.isHidden(u)){var l;a+=(l=t.getRowHeight(u))!==null&&l!==void 0?l:s,u===0&&!o.isClassicTheme()&&(a+=1)}return a}function Iie(t){const{hot:e}=t,{rowIndexMapper:n,columnIndexMapper:r}=e,i=new Map;function o(){}function s(a,l,u){const c=t.mergedCellsCollection.get(l,u);if(!Ae(c)){a.removeAttribute("rowspan"),a.removeAttribute("colspan"),Qg()&&i.has(l)&&!e.getSettings().rowHeaders&&(a.style.height=`${i.get(l)}px`,i.delete(l)),a.style.display="";return}const{row:h,col:d,colspan:f,rowspan:m}=c,[C,y]=t.translateMergedCellToRenderable(h,m,d,f),E=t.getSetting("virtualized");if(Qg()&&d===0&&!e.getSettings().rowHeaders){const W=v$(e,h,m);i.set(l,W/m)}const v=n.getRenderableFromVisualIndex(l),_=r.getRenderableFromVisualIndex(u),A=C-v+1,L=y-_+1;let T=n.getNearestNotHiddenIndex(h,1),P=r.getNearestNotHiddenIndex(d,1);if(E){const W=e.view.getActiveOverlayName();["top","top_inline_start_corner"].includes(W)||(T=Math.max(T,e.getFirstRenderedVisibleRow())),["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(W)||(P=Math.max(P,e.getFirstRenderedVisibleColumn()))}const Y=Math.min(m,A),U=Math.min(f,L);T===l&&P===u?(a.setAttribute("rowspan",Y),a.setAttribute("colspan",U)):(a.removeAttribute("rowspan"),a.removeAttribute("colspan"),a.style.display="none")}return{before:o,after:s}}function Pie(t,e){C$(t,e),e.add(t)}function ig(t,e,n){C$(t,e),e.set(t,n)}function C$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tb(t,e,n){return(e=Oie(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oie(t){var e=xie(t,"string");return typeof e=="symbol"?e:e+""}function xie(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sd(t,e,n){return t.set(rt(t,e),n),n}function ht(t,e){return t.get(rt(t,e))}function rt(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}re.getSingleton().register("beforeMergeCells");re.getSingleton().register("afterMergeCells");re.getSingleton().register("beforeUnmergeCells");re.getSingleton().register("afterUnmergeCells");const zS="mergeCells",Aie=150,TH=zS;var zr=new WeakMap,Yr=new WeakMap,oo=new WeakMap,_H=new WeakMap,lt=new WeakSet;class Hie extends Xe{constructor(){super(...arguments),Pie(this,lt),Tb(this,"mergedCellsCollection",null),Tb(this,"autofillCalculations",null),Tb(this,"selectionCalculations",null),ig(this,zr,null),ig(this,Yr,{row:0,col:0}),ig(this,oo,new Mie({mergedCellsGetter:(e,n)=>this.mergedCellsCollection.get(e,n),rowIndexMapper:this.hot.rowIndexMapper,columnIndexMapper:this.hot.columnIndexMapper})),ig(this,_H,Iie(this))}static get PLUGIN_KEY(){return zS}static get PLUGIN_PRIORITY(){return Aie}static get DEFAULT_SETTINGS(){return{[$k]:"cells",virtualized:!1,cells:[]}}isEnabled(){return!!this.hot.getSettings()[zS]}enablePlugin(){var e=this;this.enabled||(this.mergedCellsCollection=new Pm(this),this.autofillCalculations=new Cie(this),this.selectionCalculations=new Sie(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Nie).call(e,...r)}),this.addHook("modifyTransformFocus",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,kie).call(e,...r)}),this.addHook("modifyTransformStart",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Lie).call(e,...r)}),this.addHook("modifyTransformEnd",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,$ie).call(e,...r)}),this.addHook("beforeSelectionHighlightSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Fie).call(e,...r)}),this.addHook("beforeSetRangeStart",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,IH).call(e,...r)}),this.addHook("beforeSetRangeStartOnly",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,IH).call(e,...r)}),this.addHook("beforeSelectionFocusSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Wie).call(e,...r)}),this.addHook("afterSelectionFocusSet",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Bie).call(e,...r)}),this.addHook("afterSelectionEnd",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,jie).call(e,...r)}),this.addHook("modifyGetCellCoords",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,MH).call(e,...r)}),this.addHook("modifyGetCoordsElement",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,MH).call(e,...r)}),this.addHook("afterIsMultipleSelection",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Die).call(e,...r)}),this.addHook("afterRenderer",function(){return ht(_H,e).after(...arguments)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Vie).call(e,...r)}),this.addHook("afterGetCellMeta",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Uie).call(e,...r)}),this.addHook("afterViewportRowCalculatorOverride",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,zie).call(e,...r)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Yie).call(e,...r)}),this.addHook("modifyAutofillRange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Gie).call(e,...r)}),this.addHook("afterCreateCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,qie).call(e,...r)}),this.addHook("afterRemoveCol",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Kie).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Xie).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Zie).call(e,...r)}),this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Qie).call(e,...r)}),this.addHook("beforeDrawBorders",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,Jie).call(e,...r)}),this.addHook("afterDrawSelection",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,eoe).call(e,...r)}),this.addHook("beforeRemoveCellClassNames",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,toe).call(e,...r)}),this.addHook("beforeBeginEditing",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,noe).call(e,...r)}),this.addHook("modifyRowHeightByOverlayName",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return rt(lt,e,roe).call(e,...r)}),this.addHook("beforeUndoStackChange",(n,r)=>{if(r==="MergeCells")return!1}),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.clearCollections(),this.unregisterShortcuts(),this.hot.render(),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),this.generateFromSettings(),super.updatePlugin()}ifChromeForceRepaint(){if(!XN())return;const e=[];let n=[];this.mergedCellsCollection.mergedCells.forEach(r=>{const{row:i,rowspan:o}=r;for(let s=i+1;s<i+o;s++)n.push(s)}),n=[...new Set(n)],n.forEach(r=>{const i=this.hot.rowIndexMapper.getRenderableFromVisualIndex(r);this.hot.view._wt.wtOverlays.getOverlays(!0).map(o=>(o==null?void 0:o.name)==="master"?o:o.clone.wtTable).forEach(o=>{const s=o.getRow(i);s&&(s.style.background=Kg(s,"backgroundColor").replace(")",", 0.99)"),e.push(s))})}),this.hot._registerTimeout(()=>{e.forEach(r=>{var i;r.style.background=(i=Kg(r,"backgroundColor"))===null||i===void 0?void 0:i.replace(", 0.99)",")")})},1)}validateSetting(e){return e?Ji.containsNegativeValues(e)?(Ze(Ji.NEGATIVE_VALUES_WARNING(e)),!1):Ji.isOutOfBounds(e,this.hot.countRows(),this.hot.countCols())?(Ze(Ji.IS_OUT_OF_BOUNDS_WARNING(e)),!1):Ji.isSingleCell(e)?(Ze(Ji.IS_SINGLE_CELL(e)),!1):Ji.containsZeroSpan(e)?(Ze(Ji.ZERO_SPAN_WARNING(e)),!1):!0:!1}generateFromSettings(){const e=this.getSetting("cells").filter(i=>this.validateSetting(i)),n=this.mergedCellsCollection.filterOverlappingMergeCells(e),r=[];n.forEach(i=>{const{row:o,col:s,rowspan:a,colspan:l}=i,u=this.hot._createCellCoords(o,s),c=this.hot._createCellCoords(o+a-1,s+l-1),h=this.hot._createCellRange(u,u,c);this.mergeRange(h,!0,!0);for(let d=o;d<o+a;d++)for(let f=s;f<s+l;f++)(d!==o||f!==s)&&r.push([d,f,null])}),r.length!==0&&this.hot.setDataAtCell(r,void 0,void 0,this.pluginName)}clearCollections(){this.mergedCellsCollection.clear()}canMergeRange(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)?!0:this.validateSetting(e)}mergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;e.setDirection(this.hot.isRtl()?"NE-SW":"NW-SE");const{from:n,to:r}=e;this.unmergeRange(e,!0),this.mergeRange(e),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}unmergeSelection(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.hot.getSelectedRangeLast();if(!e)return;const{from:n,to:r}=e;this.unmergeRange(e,!0),this.hot.selectCell(n.row,n.col,r.row,r.col,!1)}mergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=e.getTopStartCorner(),o=e.getBottomEndCorner(),s={row:i.row,col:i.col,rowspan:o.row-i.row+1,colspan:o.col-i.col+1},a=[];let l=null;return this.canMergeRange(s,n)?(this.hot.runHooks("beforeMergeCells",e,n),de(0,s.rowspan-1,c=>{de(0,s.colspan-1,h=>{let d=null;a[c]||(a[c]=[]),c===0&&h===0?d=this.hot.getSourceDataAtCell(this.hot.toPhysicalRow(s.row),this.hot.toPhysicalColumn(s.col)):this.hot.setCellMeta(s.row+c,s.col+h,"hidden",!0),a[c][h]=d})}),this.hot.setCellMeta(s.row,s.col,"spanned",!0),this.mergedCellsCollection.add(s,n)?(r?l=[s.row,s.col,a]:this.hot.populateFromArray(s.row,s.col,a,void 0,void 0,this.pluginName),n||this.ifChromeForceRepaint(),this.hot.runHooks("afterMergeCells",e,s,n),l):!0):!1}unmergeRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.mergedCellsCollection.getWithinRange(e);r.length!==0&&(this.hot.runHooks("beforeUnmergeCells",e,n),I(r,i=>{this.mergedCellsCollection.remove(i.row,i.col),de(0,i.rowspan-1,o=>{de(0,i.colspan-1,s=>{this.hot.removeCellMeta(i.row+o,i.col+s,"hidden"),this.hot.removeCellMeta(i.row+o,i.col+s,"copyable")})}),this.hot.removeCellMeta(i.row,i.col,"spanned")}),this.hot.runHooks("afterUnmergeCells",e,n),this.hot.render())}toggleMerge(e){const{from:n,to:r}=e.clone().normalize(),i=this.mergedCellsCollection.get(n.row,n.col);i.row===n.row&&i.col===n.col&&i.row+i.rowspan-1===r.row&&i.col+i.colspan-1===r.col?this.unmergeRange(e):this.mergeSelection(e)}merge(e,n,r,i){const o=this.hot._createCellCoords(e,n),s=this.hot._createCellCoords(r,i);this.mergeRange(this.hot._createCellRange(o,o,s))}unmerge(e,n,r,i){const o=this.hot._createCellCoords(e,n),s=this.hot._createCellCoords(r,i);this.unmergeRange(this.hot._createCellRange(o,o,s))}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Control","m"]],callback:()=>{const r=this.hot.getSelectedRangeLast();r&&!r.isSingleHeader()&&(this.toggleMerge(r),this.hot.render())},runOnlyIf:r=>!r.altKey,group:TH})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(TH)}modifyViewportRowStart(e,n){const r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.startRow);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(i,o);if(Ae(s)){const a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s.row,1));if(a<e.startRow){e.startRow=a,this.modifyViewportRowStart(e,n);return}}}}modifyViewportRowEnd(e,n){const r=this.hot.rowIndexMapper,i=r.getVisualFromRenderableIndex(e.endRow);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(i,o);if(Ae(s)){const a=s.row+s.rowspan-1,l=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(a,-1));if(l>e.endRow){e.endRow=l,this.modifyViewportRowEnd(e,n);return}}}}modifyViewportColumnStart(e,n){const r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.startColumn);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(o,i);if(Ae(s)){const a=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(s.col,1));if(a<e.startColumn){e.startColumn=a,this.modifyViewportColumnStart(e,n);return}}}}modifyViewportColumnEnd(e,n){const r=this.hot.columnIndexMapper,i=r.getVisualFromRenderableIndex(e.endColumn);for(let o=0;o<n;o+=1){const s=this.mergedCellsCollection.get(o,i);if(Ae(s)){const a=s.col+s.colspan-1,l=r.getRenderableFromVisualIndex(r.getNearestNotHiddenIndex(a,-1));if(l>e.endColumn){e.endColumn=l,this.modifyViewportColumnEnd(e,n);return}}}}translateMergedCellToRenderable(e,n,r,i){const{rowIndexMapper:o,columnIndexMapper:s}=this.hot;let a,l;n===0?a=o.getNearestNotHiddenIndex(e,1):a=o.getNearestNotHiddenIndex(e+n-1,-1),i===0?l=s.getNearestNotHiddenIndex(r,1):l=s.getNearestNotHiddenIndex(r+i-1,-1);const u=e>=0?o.getRenderableFromVisualIndex(a):e,c=r>=0?s.getRenderableFromVisualIndex(l):r;return[u,c]}}function Nie(){this.generateFromSettings(),this.hot.render()}function Die(t){if(t){const e=this.mergedCellsCollection.mergedCells,n=this.hot.getSelectedRangeLast(),r=n.getTopStartCorner(),i=n.getBottomEndCorner();for(let o=0;o<e.length;o+=1)if(r.row===e[o].row&&r.col===e[o].col&&i.row===e[o].row+e[o].rowspan-1&&i.col===e[o].col+e[o].colspan-1)return!1}return t}function kie(t){ht(Yr,this).row=t.row,ht(Yr,this).col=t.col}function Lie(t){const e=this.hot.getSelectedRangeLast(),{highlight:n}=e,{columnIndexMapper:r,rowIndexMapper:i}=this.hot;ht(zr,this)&&(i.getRenderableFromVisualIndex(ht(zr,this).row)!==null&&(n.row=ht(zr,this).row),r.getRenderableFromVisualIndex(ht(zr,this).col)!==null&&(n.col=ht(zr,this).col),sd(zr,this,null));const o=this.mergedCellsCollection.get(n.row,n.col);if(!o)return;const s=o.col,a=o.col+o.colspan-1;if(t.col<0){const c=n.col>=s&&n.col<=a?s-1:a,h=r.getNearestNotHiddenIndex(c,-1);h===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,n.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(h,n.col)-1,1)}else if(t.col>0){const c=n.col>=s&&n.col<=a?a+1:s,h=r.getNearestNotHiddenIndex(c,1);h===null?t.col=this.hot.view.countRenderableColumnsInRange(n.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(n.col,h)-1,1)}const l=o.row,u=o.row+o.rowspan-1;if(t.row<0){const c=n.row>=l&&n.row<=u?l-1:u,h=i.getNearestNotHiddenIndex(c,-1);h===null?t.row=-this.hot.view.countRenderableRowsInRange(0,n.row):t.row=-Math.max(this.hot.view.countRenderableRowsInRange(h,n.row)-1,1)}else if(t.row>0){const c=n.row>=l&&n.row<=u?u+1:l,h=i.getNearestNotHiddenIndex(c,1);h===null?t.row=this.hot.view.countRenderableRowsInRange(n.row,this.hot.countRows()):t.row=Math.max(this.hot.view.countRenderableRowsInRange(n.row,h)-1,1)}}function $ie(t){const e=this.hot.getSelectedRangeLast(),n=e.clone(),{to:r}=e,{columnIndexMapper:i,rowIndexMapper:o}=this.hot,s=(a,l)=>{n.expand(this.hot._createCellCoords(a,l));for(let u=0;u<this.mergedCellsCollection.mergedCells.length;u+=1)n.expandByRange(this.mergedCellsCollection.mergedCells[u].getRange())};if(t.col<0){let a=this.mergedCellsCollection.getStartMostColumnIndex(e,r.col)+t.col;s(r.row,a),e.getHorizontalDirection()==="E-W"&&n.getHorizontalDirection()==="E-W"&&(a=n.getTopStartCorner().col);const l=i.getNearestNotHiddenIndex(a,1);l!==null&&(t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(l,r.col)-1,1))}else if(t.col>0){let a=this.mergedCellsCollection.getEndMostColumnIndex(e,r.col)+t.col;s(r.row,a),e.getHorizontalDirection()==="W-E"&&n.getHorizontalDirection()==="W-E"&&(a=n.getBottomEndCorner().col);const l=i.getNearestNotHiddenIndex(a,-1);l!==null&&(t.col=Math.max(this.hot.view.countRenderableColumnsInRange(r.col,l)-1,1))}if(t.row<0){let a=this.mergedCellsCollection.getTopMostRowIndex(e,r.row)+t.row;s(a,r.col),e.getVerticalDirection()==="S-N"&&n.getVerticalDirection()==="S-N"&&(a=n.getTopStartCorner().row);const l=o.getNearestNotHiddenIndex(a,1);l!==null&&(t.row=-Math.max(this.hot.view.countRenderableRowsInRange(l,r.row)-1,1))}else if(t.row>0){let a=this.mergedCellsCollection.getBottomMostRowIndex(e,r.row)+t.row;s(a,r.col),e.getVerticalDirection()==="N-S"&&n.getVerticalDirection()==="N-S"&&(a=n.getBottomStartCorner().row);const l=o.getNearestNotHiddenIndex(a,-1);l!==null&&(t.row=Math.max(this.hot.view.countRenderableRowsInRange(r.row,l)-1,1))}}function Fie(){const t=this.hot.getSelectedRangeLast(),{highlight:e}=t;if(this.hot.selection.isSelectedByColumnHeader()||this.hot.selection.isSelectedByRowHeader()){sd(zr,this,e.clone());return}for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);for(let r=0;r<this.mergedCellsCollection.mergedCells.length;r+=1)t.expandByRange(this.mergedCellsCollection.mergedCells[r].getRange(),!1);const n=this.mergedCellsCollection.get(e.row,e.col);sd(zr,this,e.clone()),n&&e.assign(n)}function MH(t,e,n,r){if(t<0||e<0)return;const i=this.mergedCellsCollection.get(t,e);if(!i)return;const{row:o,col:s,colspan:a,rowspan:l}=i,u=o,c=s,h=o+l-1,d=s+a-1;if(r==="render"&&this.getSetting("virtualized")){const f=this.hot.view.getActiveOverlayName(),m=["top","top_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleRow(),C=["inline_start","top_inline_start_corner","bottom_inline_start_corner"].includes(f)?0:this.hot.getFirstRenderedVisibleColumn();return[Ue(m,u,h),Ue(C,c,d),Ue(this.hot.getLastRenderedVisibleRow(),u,h),Ue(this.hot.getLastRenderedVisibleColumn(),c,d)]}return[u,c,h,d]}function Vie(t){t.items.push({name:"---------"},Rie(this))}function IH(){sd(zr,this,null)}function Wie(){if(ht(zr,this).isCell())return;const t=this.hot.getSelectedRangeLast(),e=t.getVerticalDirection(),n=t.getHorizontalDirection(),r=ht(zr,this).clone().normalize();ht(oo,this).setActiveNode(r.row,r.col),ht(Yr,this).row>0||ht(Yr,this).col>0?ht(oo,this).setPrevNodeAsActive():(n==="E-W"&&ht(Yr,this).col<0||e==="S-N"&&ht(Yr,this).row<0)&&ht(oo,this).setNextNodeAsActive()}function Bie(t,e){const n=this.hot.getSelectedRangeLast(),{columnIndexMapper:r,rowIndexMapper:i}=this.hot;let o=null,s=null;if(ht(Yr,this).col<0){const{rowEnd:a,colEnd:l}=ht(oo,this).getPrevHorizontalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(ht(Yr,this).col>0){const{rowStart:a,colStart:l}=ht(oo,this).getNextHorizontalNode();s=r.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}else if(ht(Yr,this).row<0){const{rowEnd:a,colEnd:l}=ht(oo,this).getPrevVerticalNode();s=r.getNearestNotHiddenIndex(l,-1),o=i.getNearestNotHiddenIndex(a,-1)}else if(ht(Yr,this).row>0){const{rowStart:a,colStart:l}=ht(oo,this).getNextVerticalNode();s=r.getNearestNotHiddenIndex(l,1),o=i.getNearestNotHiddenIndex(a,1)}if(o!==null||s!==null){const a=this.hot._createCellCoords(o,s),l=this.mergedCellsCollection.get(a.row,a.col),u=this.hot.selection.highlight.getFocus();t=a.row,e=a.col,l?n.highlight.assign({row:this.hot.rowIndexMapper.getNearestNotHiddenIndex(l.row,1),col:this.hot.columnIndexMapper.getNearestNotHiddenIndex(l.col,1)}):n.highlight.assign(a),u.clear(),u.add(a).commit()}ht(oo,this).setActiveNode(t,e),sd(Yr,this,{row:0,col:0})}function jie(){this.hot.getSelectedRangeLast().isHeader()||ht(oo,this).buildFocusOrder(this.hot.getSelectedRangeLast())}function Uie(t,e,n){const r=this.mergedCellsCollection.get(t,e);r&&(r.row!==t||r.col!==e?n.copyable=!1:(n.rowspan=r.rowspan,n.colspan=r.colspan))}function zie(t){if(this.getSetting("virtualized"))return;const e=this.hot.countCols();this.modifyViewportRowStart(t,e),this.modifyViewportRowEnd(t,e)}function Yie(t){if(this.getSetting("virtualized"))return;const e=this.hot.countRows();this.modifyViewportColumnStart(t,e),this.modifyViewportColumnEnd(t,e)}function Gie(t,e){const n=this.autofillCalculations.getDirection(e,t);if(this.autofillCalculations.dragAreaOverlapsCollections(e,t,n))return e;const r=this.hot._createCellCoords(e[0],e[1]),i=this.hot._createCellCoords(e[2],e[3]),o=this.hot._createCellRange(r,r,i),s=this.mergedCellsCollection.getWithinRange(o);return s.length===0?t:this.autofillCalculations.snapDragArea(e,t,n,s)}function qie(t,e){this.mergedCellsCollection.shiftCollections("right",t,e)}function Kie(t,e){this.mergedCellsCollection.shiftCollections("left",t,e)}function Xie(t,e,n){n!=="auto"&&this.mergedCellsCollection.shiftCollections("down",t,e)}function Zie(t,e){this.mergedCellsCollection.shiftCollections("up",t,e)}function Qie(t,e){e==="Autofill.fill"&&this.autofillCalculations.recreateAfterDataPopulation(t)}function Jie(t,e){if(e&&e==="area"){const n=this.hot.getSelectedRangeLast(),r=this.mergedCellsCollection.getWithinRange(n);I(r,i=>{n.getBottomEndCorner().row===i.getLastRow()&&n.getBottomEndCorner().col===i.getLastColumn()&&(t[2]=i.row,t[3]=i.col)})}}function eoe(t,e,n,r){if(n)return this.selectionCalculations.getSelectedMergedCellClassName(t,e,n,r)}function toe(){return this.selectionCalculations.getSelectedMergedCellClassNameToRemove()}function noe(t,e,n,r){if(!(r instanceof MouseEvent))return;const i=this.hot.getSelectedRangeLast(),o=this.mergedCellsCollection.getByRange(i);if(!o)return;const s=this.hot._createCellCoords(o.row,o.col),a=this.hot._createCellCoords(o.row+o.rowspan-1,o.col+o.colspan-1);return this.hot.selection.getLayerLevel()===0&&i.isEqual(this.hot._createCellRange(s,s,a))}function roe(t,e,n){if(this.hot.getSettings().rowHeaders||n==="bottom"||n==="bottom_inline_start_corner")return t;let r,i;if(n==="master")r=this.hot.getFirstRenderedVisibleColumn(),i=this.hot.getLastRenderedVisibleColumn();else{const d=this.hot.view.getOverlayByName(n);r=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getFirstRenderedColumn()),i=this.hot.columnIndexMapper.getVisualFromRenderableIndex(d.clone.wtTable.getLastRenderedColumn())}if(!this.mergedCellsCollection.get(e,r))return t;const s=this.hot._createCellCoords(e,r),a=this.hot._createCellCoords(e,i),l=this.hot._createCellRange(s,s,a),u=this.mergedCellsCollection.getWithinRange(l,!0),c=u.reduce((d,f)=>{let{rowspan:m}=f;return Math.max(d,m)},1);let h=0;return u.length>1&&u[0].rowspan<c&&(h=c-u[0].rowspan),u.forEach(d=>{let{rowspan:f}=d,m=0;n==="top"||n==="top_inline_start_corner"?m=Math.min(c,this.hot.view.countNotHiddenFixedRowsTop()-e):m=f-h,t=Math.max(t??0,v$(this.hot,e,m))}),t}function ioe(t,e){return function(n,r){const[,...i]=n,[,...o]=r;return(function s(a){const l=t[a],u=e[a],c=i[a],h=o[a],d=u.multiColumnSorting,m=(d.compareFunctionFactory?d.compareFunctionFactory:Kk(u.type))(l,u,d)(c,h);if(m===so){const C=a+1;if(typeof e[C]<"u")return s(C)}return m})(0)}}const y$="sort";function ooe(t,e,n){const r=[];return n===!1||t.isColumnSorted(e)&&t.getNumberOfSortedColumns()>1&&r.push(`${y$}-${t.getIndexOfColumnInSortQueue(e)+1}`),r}function soe(t){const e=t.className.split(" "),n=new RegExp(`^${y$}-[0-9]{1,2}$`);return e.filter(r=>n.test(r))}function aoe(t,e,n){return(e=loe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function loe(t){var e=uoe(t,"string");return typeof e=="symbol"?e:e+""}function uoe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const xm="multiColumnSorting",coe=170,PH=xm;qk(xm,ioe);class hoe extends iL{constructor(){super(...arguments),aoe(this,"pluginKey",xm)}static get PLUGIN_KEY(){return xm}static get PLUGIN_PRIORITY(){return coe}isEnabled(){return!!this.hot.getSettings()[this.pluginKey]}enablePlugin(){super.enablePlugin()}disablePlugin(){super.disablePlugin()}registerShortcuts(){super.registerShortcuts(),this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Shift","Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast();return e.row===-1&&e.col>=0&&this.sort(this.getNextSortConfig(e.col,dm)),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.isHeader()},relativeToGroup:Js,position:"before",group:PH})}unregisterShortcuts(){super.unregisterShortcuts(),this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(PH)}sort(e){super.sort(e)}clearSort(){super.clearSort()}isSorted(){return super.isSorted()}getSortConfig(e){return super.getSortConfig(e)}setSortConfig(e){super.setSortConfig(e)}getNormalizedSortConfigs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Array.isArray(e)?e:[e]}updateHeaderClasses(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];super.updateHeaderClasses(e,...r),pe(e,soe(e)),this.enabled!==!1&&q(e,ooe(...r))}onAfterOnCellMouseDown(e,n){oT(n.row,n.col,e)!==!1&&this.wasClickableHeaderClicked(e,n.col)&&(this.hot.getShortcutManager().isCtrlPressed()?(this.hot.deselectCell(),this.hot.selectColumns(n.col),this.sort(this.getNextSortConfig(n.col,dm))):this.sort(this.getColumnNextConfig(n.col)))}}function OH(t,e,n){return(e=doe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function doe(t){var e=foe(t,"string");return typeof e=="symbol"?e:e+""}function foe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const goe="multipleSelectionHandles",moe=160;class poe extends Xe{constructor(){super(...arguments),OH(this,"dragged",[]),OH(this,"lastSetCell",null)}static get PLUGIN_KEY(){return goe}static get PLUGIN_PRIORITY(){return moe}isEnabled(){return Yo()}enablePlugin(){this.enabled||(this.registerListeners(),super.enablePlugin())}registerListeners(){const e=this,{rootElement:n}=this.hot;function r(i){if(e.dragged.length===1)return e.dragged.splice(0,e.dragged.length),!0;const o=e.dragged.indexOf(i);if(o===-1)return!1;o===0?e.dragged=e.dragged.slice(0,1):o===1&&(e.dragged=e.dragged.slice(-1))}this.eventManager.addEventListener(n,"touchstart",i=>{let o;if(ve(i.target,"topSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("top"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1;if(ve(i.target,"bottomSelectionHandle-HitArea"))return o=e.hot.getSelectedRangeLast(),e.dragged.push("bottom"),e.touchStartRange={width:o.getWidth(),height:o.getHeight(),direction:o.getDirection()},i.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchend",i=>{if(ve(i.target,"topSelectionHandle-HitArea"))return r.call(e,"top"),e.touchStartRange=void 0,i.preventDefault(),!1;if(ve(i.target,"bottomSelectionHandle-HitArea"))return r.call(e,"bottom"),e.touchStartRange=void 0,i.preventDefault(),!1}),this.eventManager.addEventListener(n,"touchmove",i=>{const{rootDocument:o}=this.hot;let s,a,l,u,c,h;if(e.dragged.length===0)return;const d=o.elementFromPoint(i.touches[0].clientX,i.touches[0].clientY);!d||d===e.lastSetCell||((d.nodeName==="TD"||d.nodeName==="TH")&&(s=e.hot.getCoords(d),s.col===-1&&(s.col=0),a=e.hot.getSelectedRangeLast(),l=a.getWidth(),u=a.getHeight(),c=a.getDirection(),l===1&&u===1&&e.hot.selection.setRangeEnd(s),h=e.getCurrentRangeCoords(a,s,e.touchStartRange.direction,c,e.dragged[0]),h.start!==null&&e.hot.selection.setRangeStart(h.start),e.hot.selection.setRangeEnd(h.end),e.lastSetCell=d),i.preventDefault())})}getCurrentRangeCoords(e,n,r,i,o){const s=e.getTopStartCorner(),a=e.getBottomEndCorner(),l=e.getBottomStartCorner(),u=e.getTopEndCorner();let c={start:null,end:null};switch(r){case"NE-SW":switch(i){case"NE-SW":case"NW-SE":o==="top"?c={start:this.hot._createCellCoords(n.row,e.highlight.col),end:this.hot._createCellCoords(l.row,n.col)}:c={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,s.col)};break;case"SE-NW":o==="bottom"&&(c={start:this.hot._createCellCoords(a.row,n.col),end:this.hot._createCellCoords(n.row,s.col)});break}break;case"NW-SE":switch(i){case"NE-SW":o==="top"?c={start:n,end:l}:c.end=n;break;case"NW-SE":o==="top"?c={start:n,end:a}:c.end=n;break;case"SE-NW":o==="top"?c={start:n,end:s}:c.end=n;break;case"SW-NE":o==="top"?c={start:n,end:u}:c.end=n;break}break;case"SW-NE":switch(i){case"NW-SE":o==="bottom"?c={start:this.hot._createCellCoords(n.row,s.col),end:this.hot._createCellCoords(l.row,n.col)}:c={start:this.hot._createCellCoords(s.row,n.col),end:this.hot._createCellCoords(n.row,a.col)};break;case"SW-NE":o==="top"?c={start:this.hot._createCellCoords(e.highlight.row,n.col),end:this.hot._createCellCoords(n.row,a.col)}:c={start:this.hot._createCellCoords(n.row,s.col),end:this.hot._createCellCoords(s.row,n.col)};break;case"SE-NW":o==="bottom"?c={start:this.hot._createCellCoords(n.row,u.col),end:this.hot._createCellCoords(s.row,n.col)}:o==="top"&&(c={start:l,end:n});break}break;case"SE-NW":switch(i){case"NW-SE":case"NE-SW":case"SW-NE":o==="top"&&(c.end=n);break;case"SE-NW":o==="top"?c.end=n:c={start:n,end:s};break}break}return c}isDragged(){return this.dragged.length>0}}function YS(){let{label:t="",colspan:e=1,origColspan:n=1,collapsible:r=!1,crossHiddenColumns:i=[],isCollapsed:o=!1,isHidden:s=!1,isRoot:a=!1,isPlaceholder:l=!1,headerClassNames:u=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{label:t,colspan:e,origColspan:n,collapsible:r,isCollapsed:o,crossHiddenColumns:i,isHidden:s,isRoot:a,isPlaceholder:l,headerClassNames:u}}function b$(){return{label:"",isPlaceholder:!0}}function woe(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0;const n=[];if(e===0)return n;I(t,i=>{const o=[];let s=0;n.push(o),I(i,a=>{const l=YS();if(Ae(a)){const{label:c,colspan:h,headerClassName:d}=a;l.label=Pt(c),typeof h=="number"&&h>1&&(l.colspan=h,l.origColspan=h),typeof d=="string"&&(l.headerClassNames=[...d.split(" ")])}else l.label=Pt(a);s+=l.origColspan;let u=!1;if(s>=e&&(l.colspan=l.origColspan-(s-e),l.origColspan=l.colspan,u=!0),o.push(l),l.colspan>1)for(let c=0;c<l.colspan-1;c++)o.push(b$());return!u})});const r=Math.max(...Be(n,i=>i.length));return I(n,i=>{if(i.length<r){const o=Be(new Array(r-i.length),()=>YS());i.splice(i.length,0,...o)}}),n}function _b(t,e,n){voe(t,e),e.set(t,n)}function voe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function li(t,e){return t.get(S$(t,e))}function th(t,e,n){return t.set(S$(t,e),n),n}function S$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const xH=["label","collapsible"];var Oo=new WeakMap,Fa=new WeakMap,Mb=new WeakMap;class Coe{constructor(){_b(this,Oo,[]),_b(this,Fa,0),_b(this,Mb,1/0)}setColumnsLimit(e){th(Mb,this,e)}setData(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];th(Oo,this,woe(e,li(Mb,this))),th(Fa,this,li(Oo,this).length)}getData(){return li(Oo,this)}mergeWith(e){I(e,n=>{let{row:r,col:i,...o}=n;const s=this.getHeaderSettings(r,i);s!==null&&on(s,o,xH)})}map(e){I(li(Oo,this),n=>{I(n,r=>{const i=e({...r});Ae(i)&&on(r,i,xH)})})}getHeaderSettings(e,n){var r;if(e>=li(Fa,this)||e<0)return null;const i=li(Oo,this)[e];return Array.isArray(i)===!1||n>=i.length?null:(r=i[n])!==null&&r!==void 0?r:null}getHeadersSettings(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const i=[];if(e>=li(Fa,this)||e<0)return i;const o=li(Oo,this)[e];let s=0;for(let a=n;a<o.length;a++){const l=o[a];if(l.isPlaceholder)throw new Error("The first column settings cannot overlap the other header layers");if(s+=l.colspan,i.push(l),l.colspan>1&&(a+=l.colspan-1),s===r)break;if(s>r)throw new Error("The last column settings cannot overlap the other header layers")}return i}getLayersCount(){return li(Fa,this)}getColumnsCount(){return li(Fa,this)>0?li(Oo,this)[0].length:0}clear(){th(Oo,this,[]),th(Fa,this,0)}}function Ib(t,e,n){return(e=yoe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yoe(t){var e=boe(t,"string");return typeof e=="symbol"?e:e+""}function boe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const R$="DF-pre-order";function E$(t,e){let n=t.call(e,this);for(let r=0;r<this.childs.length;r++){if(n===!1)return!1;n=E$.call(this.childs[r],t,e)}return n}const Soe="DF-post-order";function T$(t,e){for(let n=0;n<this.childs.length;n++)if(T$.call(this.childs[n],t,e)===!1)return!1;return t.call(e,this)}const _$="BF";function Roe(t,e){const n=[this];function r(){if(n.length===0)return;const i=n.shift();n.push(...i.childs),t.call(e,i)!==!1&&r()}r()}const Eoe=_$,AH=new Map([[R$,E$],[Soe,T$],[_$,Roe]]);class Am{constructor(e){Ib(this,"data",{}),Ib(this,"parent",null),Ib(this,"childs",[]),this.data=e}addChild(e){e.parent=this,this.childs.push(e)}cloneTree(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this;const n=new Am({...e.data});for(let r=0;r<e.childs.length;r++)n.addChild(this.cloneTree(e.childs[r]));return n}replaceTreeWith(e){this.data={...e.data},this.childs=[];for(let n=0;n<e.childs.length;n++)this.addChild(e.childs[n])}walkDown(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Eoe;if(!AH.has(n))throw new Error(`Traversal strategy "${n}" does not exist`);AH.get(n).call(this,e,this)}walkUp(e){const n=this,r=i=>{e.call(n,i)!==!1&&i.parent!==null&&r(i.parent)};r(this)}}function Pb(t,e,n){Toe(t,e),e.set(t,n)}function Toe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $n(t,e){return t.get(M$(t,e))}function _oe(t,e,n){return t.set(M$(t,e),n),n}function M$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var iu=new WeakMap,Va=new WeakMap,ou=new WeakMap;class Moe{constructor(e){Pb(this,iu,new Map),Pb(this,Va,new Map),Pb(this,ou,null),_oe(ou,this,e)}getRoots(){return Array.from($n(iu,this).values())}getRootByColumn(e){let n;return $n(Va,this).has(e)&&(n=$n(iu,this).get($n(Va,this).get(e))),n}getNode(e,n){const r=this.getRootByColumn(n);if(!r)return;const i=n-$n(Va,this).get(n);let o=0,s;return r.walkDown(a=>{const{data:{origColspan:l,headerLevel:u}}=a;if(e===u){if(i>=o&&i<=o+l-1)return s=a,s.data.isRoot=n===s.data.columnIndex,!1;o+=l}}),s}rebuildTreeIndex(){let e=0;$n(Va,this).clear(),I($n(iu,this),n=>{let[,{data:{colspan:r}}]=n;for(let i=e;i<e+r;i++)$n(Va,this).set(i,e);e+=r})}buildTree(){this.clear();const e=$n(ou,this).getColumnsCount();let n=0;for(;n<e;){const r=$n(ou,this).getHeaderSettings(0,n),i=new Am;$n(iu,this).set(n,i),this.buildLeaves(i,n,0,r.origColspan),n+=r.origColspan}this.rebuildTreeIndex()}buildLeaves(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;const o=$n(ou,this).getHeadersSettings(r,n,i);r+=1,I(o,s=>{const a={...s,headerLevel:r-1,columnIndex:n};let l;r===1?(e.data=a,l=e):(l=new Am(a),e.addChild(l)),r<$n(ou,this).getLayersCount()&&this.buildLeaves(l,n,r,s.origColspan),n+=s.origColspan})}clear(){$n(iu,this).clear(),$n(Va,this).clear()}}function I$(t,e){t.walkDown(n=>{let{data:r,childs:i}=n;if(!r.isHidden&&(e(r.columnIndex),i.length===0))for(let o=1;o<r.colspan;o++)e(r.columnIndex+o)})}function Hm(t,e){let{childs:n}=t;if(n.length!==0)return n[0].data[e]}function Nm(t){return Hm(t,"origColspan")===t.data.origColspan}function yT(t){const{data:e,childs:n}=t;if(!e.isCollapsed||e.isHidden||e.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Nm(t))return yT(n[0]);e.isCollapsed=!1;const i=n.slice(1),o=new Set;let s=0;if(i.length>0)I(i,a=>{a.replaceTreeWith(a.data.clonedTree),a.data.clonedTree=null;const l=a.data;s+=l.colspan,I$(a,u=>{o.add(u)})});else{const{colspan:a,origColspan:l,columnIndex:u}=e;s=l-a;for(let c=1;c<l;c++)o.add(u+c)}return t.walkUp(a=>{const{data:l}=a;l.colspan+=s,l.colspan>=l.origColspan?(l.colspan=l.origColspan,l.isCollapsed=!1):Nm(a)&&(l.isCollapsed=Hm(a,"isCollapsed"))}),{rollbackModification:()=>bT(t),affectedColumns:Array.from(o),colspanCompensation:s}}function bT(t){var e;const{data:n,childs:r}=t;if(n.isCollapsed||n.isHidden||n.origColspan<=1)return{rollbackModification:()=>{},affectedColumns:[],colspanCompensation:0};if(Nm(t))return bT(r[0]);n.isCollapsed=!0;const o=r.slice(1),s=new Set;if(o.length>0)I(o,l=>{I$(l,u=>{s.add(u)}),l.data.clonedTree=l.cloneTree(),l.walkDown(u=>{let{data:c}=u;c.isHidden=!0})});else{const{origColspan:l,columnIndex:u}=n;for(let c=1;c<l;c++){const h=u+c;s.add(h)}}const a=n.colspan-((e=Hm(t,"colspan"))!==null&&e!==void 0?e:1);return t.walkUp(l=>{const{data:u}=l;u.colspan-=a,u.colspan<=1?(u.colspan=1,u.isCollapsed=!0):Nm(l)&&(u.isCollapsed=Hm(l,"isCollapsed"))}),{rollbackModification:()=>yT(t),affectedColumns:Array.from(s),colspanCompensation:a}}function Ioe(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(nt`The passed node is not the last node on the tree. Only for\x20
275
+ the last node, the hide column modification can be applied.`);const{crossHiddenColumns:n}=t.data;if(n.includes(e))return;let r=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return r=!0,!1}),!r&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.push(e),o.colspan>1?o.colspan-=1:o.isHidden=!0})}function Poe(t,e){if(!Number.isInteger(e))throw new Error("The passed gridColumnIndex argument has invalid type.");if(t.childs.length>0)throw new Error(nt`The passed node is not the last node on the tree. Only for\x20
276
+ the last node, the show column modification can be applied.`);const{crossHiddenColumns:n}=t.data;if(!n.includes(e))return;let r=!1;t.walkUp(i=>{const{data:{collapsible:o}}=i;if(o)return r=!0,!1}),!r&&t.walkUp(i=>{const{data:o}=i;o.crossHiddenColumns.splice(o.crossHiddenColumns.indexOf(e),1),!o.isHidden&&o.colspan<o.origColspan&&(o.colspan+=1),o.isHidden=!1})}const HH=new Map([["collapse",bT],["expand",yT],["hide-column",Ioe],["show-column",Poe]]);function Ooe(t,e,n){if(!HH.has(t))throw new Error(`The node modifier action ("${t}") does not exist.`);return HH.get(t)(e,n)}function og(t){const e=[];return I(t,n=>{n.walkDown(r=>{const i=r.data,{origColspan:o,columnIndex:s,headerLevel:a,crossHiddenColumns:l}=i,u=Aoe(e,a);let c=!1;for(let h=s;h<s+o;h++)if(l.includes(h)||c)u.push(b$());else{const f=xoe(i);f.isRoot=!0,u.push(f),c=!0}})}),e}function xoe(t){const{crossHiddenColumns:e,...n}=YS(t);return n}function Aoe(t,e){let n;return Array.isArray(t[e])?n=t[e]:(n=[],t[e]=n),n}function Ob(t,e,n){Hoe(t,e),e.set(t,n)}function Hoe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function nh(t,e,n){return t.set(P$(t,e),n),n}function xt(t,e){return t.get(P$(t,e))}function P$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var Yi=new WeakMap,tr=new WeakMap,Wa=new WeakMap;class Noe{constructor(){Ob(this,Yi,new Coe),Ob(this,tr,new Moe(xt(Yi,this))),Ob(this,Wa,[[]])}setState(e){xt(Yi,this).setData(e);let n=!1;try{xt(tr,this).buildTree()}catch{xt(tr,this).clear(),xt(Yi,this).clear(),n=!0}return nh(Wa,this,og(xt(tr,this).getRoots())),n}setColumnsLimit(e){xt(Yi,this).setColumnsLimit(e)}mergeStateWith(e){const n=Be(e,r=>{let{row:i,...o}=r;return{row:i<0?this.rowCoordsToLevel(i):i,...o}});xt(Yi,this).mergeWith(n),xt(tr,this).buildTree(),nh(Wa,this,og(xt(tr,this).getRoots()))}mapState(e){xt(Yi,this).map(e),xt(tr,this).buildTree(),nh(Wa,this,og(xt(tr,this).getRoots()))}mapNodes(e){return gr(xt(tr,this).getRoots(),(n,r)=>(r.walkDown(i=>{const o=e(i.data);o!==void 0&&n.push(o)}),n),[])}triggerNodeModification(e,n,r){n<0&&(n=this.rowCoordsToLevel(n));const i=xt(tr,this).getNode(n,r);let o;return i&&(o=Ooe(e,i,r),nh(Wa,this,og(xt(tr,this).getRoots()))),o}triggerColumnModification(e,n){return this.triggerNodeModification(e,-1,n)}rowCoordsToLevel(e){if(e>=0)return null;const n=e+Math.max(this.getLayersCount(),1);return n<0?null:n}levelToRowCoords(e){if(e<0)return null;const n=e-Math.max(this.getLayersCount(),1);return n>=0?null:n}getHeaderSettings(e,n){var r,i;return e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount()?null:(r=(i=xt(Wa,this)[e])===null||i===void 0?void 0:i[n])!==null&&r!==void 0?r:null}getHeaderTreeNodeData(e,n){const r=this.getHeaderTreeNode(e,n);return r?{...r.data}:null}getHeaderTreeNode(e,n){if(e<0&&(e=this.rowCoordsToLevel(e)),e===null||e>=this.getLayersCount())return null;const r=xt(tr,this).getNode(e,n);return r||null}findTopMostEntireHeaderLevel(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;const r=n-e+1;let i=!1,o=null;for(let s=e;s<=n;s++){const a=xt(tr,this).getRootByColumn(s);if(!a)break;i=!0,a.walkDown(l=>{const{columnIndex:u,headerLevel:c,origColspan:h,isHidden:d}=l.data;d||h<=r&&u>=e&&u+h-1<=n&&(o===null||c<o)&&(o=c)},R$)}return i&&o===null?-1:this.levelToRowCoords(o??0)}findLeftMostColumnIndex(e,n){var r;const{isRoot:i}=(r=this.getHeaderSettings(e,n))!==null&&r!==void 0?r:{isRoot:!0};if(i)return n;let o=n-1;for(;o>=0;){var s;const{isRoot:a}=(s=this.getHeaderSettings(e,o))!==null&&s!==void 0?s:{isRoot:!0};if(a)break;o-=1}return o}findRightMostColumnIndex(e,n){var r;const{isRoot:i,origColspan:o}=(r=this.getHeaderSettings(e,n))!==null&&r!==void 0?r:{isRoot:!0,origColspan:1};if(i)return n+o-1;let s=n+1;for(;s<this.getColumnsCount();){var a;const{isRoot:l}=(a=this.getHeaderSettings(e,s))!==null&&a!==void 0?a:{isRoot:!0};if(l)break;s+=1}return s-1}getLayersCount(){return xt(Yi,this).getLayersCount()}getColumnsCount(){return xt(Yi,this).getColumnsCount()}clear(){nh(Wa,this,[]),xt(Yi,this).clear(),xt(tr,this).clear()}}function rh(t,e,n){return(e=Doe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Doe(t){var e=koe(t,"string");return typeof e=="symbol"?e:e+""}function koe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Loe{constructor(e,n){rh(this,"hot",void 0),rh(this,"nestedHeaderSettingsGetter",void 0),rh(this,"layersCount",0),rh(this,"container",void 0),rh(this,"widthsMap",void 0),this.hot=e,this.nestedHeaderSettingsGetter=n,this.widthsMap=this.hot.columnIndexMapper.createAndRegisterIndexMap("nestedHeaders.widthsMap","physicalIndexToValue")}setLayersCount(e){return this.layersCount=e,this}getWidth(e){return this.widthsMap.getValueAtIndex(this.hot.toPhysicalColumn(e))}buildWidthsMap(){const e=this.hot.getCurrentThemeName();this.container=this.hot.rootDocument.createElement("div"),this.container.classList.add("handsontable","htGhostTable","htAutoSize"),e&&this.container.classList.add(e),this._buildGhostTable(this.container),this.hot.rootDocument.body.appendChild(this.container);const n=this.container.querySelectorAll("tr:last-of-type th"),r=n.length;this.widthsMap.clear();for(let i=0;i<r;i++){const o=this.hot.columnIndexMapper.getVisualFromRenderableIndex(i),s=this.hot.toPhysicalColumn(o);this.widthsMap.setValueAtIndex(s,n[i].offsetWidth)}this.container.parentNode.removeChild(this.container),this.container=null}_buildGhostTable(e){const{rootDocument:n,columnIndexMapper:r}=this.hot,i=n.createDocumentFragment(),o=n.createElement("table"),s=!!this.hot.getSettings().dropdownMenu,a=r.getRenderableIndexesLength();for(let l=0;l<this.layersCount;l++){const u=n.createElement("tr");for(let c=0;c<a;c++){let h=r.getVisualFromRenderableIndex(c);h===null&&(h=c);const d=n.createElement("th"),f=this.nestedHeaderSettingsGetter(l,h);if(f&&(!f.isPlaceholder||f.isHidden)){let m=f.label;s&&(m+='<button class="changeType"></button>'),Xu(d,m),d.colSpan=f.colspan,u.appendChild(d)}}o.appendChild(u)}i.appendChild(o),e.appendChild(i)}clear(){this.widthsMap.clear(),this.container=null}}function $oe(t,e){O$(t,e),e.add(t)}function NH(t,e,n){return(e=Foe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Foe(t){var e=Voe(t,"string");return typeof e=="symbol"?e:e+""}function Voe(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ih(t,e,n){O$(t,e),e.set(t,n)}function O$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xo(t,e,n){return t.set(At(t,e),n),n}function Ve(t,e){return t.get(At(t,e))}function At(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const DH="nestedHeaders",Woe=280;var st=new WeakMap,Es=new WeakMap,$h=new WeakMap,Dp=new WeakMap,Dm=new WeakMap,Ft=new WeakSet;class Boe extends Xe{constructor(){super(...arguments),$oe(this,Ft),ih(this,st,new Noe),ih(this,Es,null),ih(this,$h,null),ih(this,Dp,!1),ih(this,Dm,null),NH(this,"ghostTable",new Loe(this.hot,(e,n)=>this.getHeaderSettings(e,n))),NH(this,"detectedOverlappedHeaders",!1)}static get PLUGIN_KEY(){return DH}static get PLUGIN_PRIORITY(){return Woe}isEnabled(){return!!this.hot.getSettings()[DH]}enablePlugin(){var e=this;if(this.enabled)return;const{nestedHeaders:n}=this.hot.getSettings();(!Array.isArray(n)||!Array.isArray(n[0]))&&Ze(nt`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
277
+ passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`),this.addHook("init",()=>At(Ft,this,ise).call(this)),this.addHook("afterLoadData",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,ose).call(e,...i)}),this.addHook("beforeOnCellMouseDown",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Yoe).call(e,...i)}),this.addHook("afterOnCellMouseDown",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Goe).call(e,...i)}),this.addHook("beforeOnCellMouseOver",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,qoe).call(e,...i)}),this.addHook("beforeOnCellMouseUp",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Koe).call(e,...i)}),this.addHook("beforeSelectionHighlightSet",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Xoe).call(e,...i)}),this.addHook("modifyTransformStart",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Zoe).call(e,...i)}),this.addHook("afterSelection",()=>At(Ft,this,sg).call(this)),this.addHook("afterSelectionFocusSet",()=>At(Ft,this,sg).call(this)),this.addHook("beforeViewportScrollHorizontally",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,joe).call(e,...i)}),this.addHook("afterGetColumnHeaderRenderers",r=>At(Ft,this,Joe).call(this,r)),this.addHook("modifyColWidth",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,tse).call(e,...i)}),this.addHook("modifyColumnHeaderValue",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,nse).call(e,...i)}),this.addHook("beforeHighlightingColumnHeader",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Uoe).call(e,...i)}),this.addHook("beforeCopy",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,zoe).call(e,...i)}),this.addHook("beforeSelectColumns",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,Qoe).call(e,...i)}),this.addHook("afterViewportColumnCalculatorOverride",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,ese).call(e,...i)}),this.addHook("modifyFocusedElement",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return At(Ft,e,rse).call(e,...i)}),this.hot.columnIndexMapper.addLocalHook("cacheUpdated",()=>At(Ft,this,sg).call(this)),this.hot.rowIndexMapper.addLocalHook("cacheUpdated",()=>At(Ft,this,sg).call(this)),super.enablePlugin(),this.updatePlugin()}updatePlugin(){if(!this.hot.view)return;const{nestedHeaders:e}=this.hot.getSettings();Ve(st,this).setColumnsLimit(this.hot.countCols()),Array.isArray(e)&&(this.detectedOverlappedHeaders=Ve(st,this).setState(e)),this.detectedOverlappedHeaders&&Ze(nt`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
278
+ is currently not supported.`),this.enabled&&this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((n,r)=>{const i=n===!0?"hide-column":"show-column";Ve(st,this).triggerColumnModification(i,r)}),!Ve(Es,this)&&this.enabled&&Xo(Es,this,this.hot.columnIndexMapper.createChangesObserver("hiding").subscribe(n=>{n.forEach(r=>{let{op:i,index:o,newValue:s}=r;if(i==="replace"){const a=s===!0?"hide-column":"show-column";Ve(st,this).triggerColumnModification(a,o)}}),this.ghostTable.buildWidthsMap()})),this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap(),super.updatePlugin()}disablePlugin(){this.clearColspans(),Ve(st,this).clear(),Ve(Es,this).unsubscribe(),Xo(Es,this,null),this.ghostTable.clear(),super.disablePlugin()}getStateManager(){return Ve(st,this)}getLayersCount(){return Ve(st,this).getLayersCount()}getHeaderSettings(e,n){return Ve(st,this).getHeaderSettings(e,n)}clearColspans(){if(!this.hot.view)return;const{_wt:e}=this.hot.view,n=e.getSetting("columnHeaders").length,r=e.wtTable.THEAD,i=e.wtOverlays.topOverlay.clone.wtTable.THEAD,o=e.wtOverlays.topInlineStartCornerOverlay?e.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.THEAD:null;for(let s=0;s<n;s++){const a=r.childNodes[s];if(!a)break;const l=i.childNodes[s],u=o?o.childNodes[s]:null;for(let c=0,h=a.childNodes.length;c<h;c++)a.childNodes[c].removeAttribute("colspan"),pe(a.childNodes[c],"hiddenHeader"),l&&l.childNodes[c]&&(l.childNodes[c].removeAttribute("colspan"),pe(l.childNodes[c],"hiddenHeader")),o&&u&&u.childNodes[c]&&(u.childNodes[c].removeAttribute("colspan"),pe(u.childNodes[c],"hiddenHeader"))}}headerRendererFactory(e){var n=this;const r=this.hot.view._wt.getSetting("fixedColumnsStart");return(i,o)=>{var s;const{columnIndexMapper:a,view:l}=this.hot;let u=a.getVisualFromRenderableIndex(i);u===null&&(u=i),o.removeAttribute("colspan"),pe(o,"hiddenHeader"),pe(o,"hiddenHeaderText");const{colspan:c,isHidden:h,isPlaceholder:d,headerClassNames:f}=(s=Ve(st,this).getHeaderSettings(e,u))!==null&&s!==void 0?s:{};if(d||h)q(o,"hiddenHeader");else if(c>1){var m,C,y;const{wtOverlays:E}=l._wt,v=(m=E.topInlineStartCornerOverlay)===null||m===void 0?void 0:m.clone.wtTable.THEAD.contains(o),_=(C=E.inlineStartOverlay)===null||C===void 0?void 0:C.clone.wtTable.THEAD.contains(o);((y=E.topOverlay)===null||y===void 0?void 0:y.clone.wtTable.THEAD.contains(o))&&u<r&&q(o,"hiddenHeaderText");const L=v||_?Math.min(c,r-i):c;L>1&&o.setAttribute("colspan",L)}if(this.hot.view.appendColHeader(u,o,function(){return n.getColumnHeaderValue(...arguments)},e),!d&&!h){const E=o.querySelector("div.relative");E&&f&&f.length>0&&(pe(E,this.hot.getColumnMeta(u).headerClassName),q(E,f))}}}getColumnHeaderValue(e,n){var r;const{isHidden:i,isPlaceholder:o}=(r=Ve(st,this).getHeaderSettings(n,e))!==null&&r!==void 0?r:{};return o||i?"":this.hot.getColHeader(e,n)}destroy(){Xo(st,this,null),Ve(Es,this)!==null&&(Ve(Es,this).unsubscribe(),Xo(Es,this,null)),super.destroy()}_getHeaderTreeNodeDataByCoords(e){if(!(e.row>=0||e.col<0))return Ve(st,this).getHeaderTreeNodeData(e.row,e.col)}}function sg(){var t;const e=(t=this.hot)===null||t===void 0?void 0:t.getSelectedRangeLast();if(!e)return;const{highlight:n}=e;if(n.isHeader()&&n.col>=0){const i=Ve(st,this).findLeftMostColumnIndex(n.row,n.col),o=this.hot.selection.highlight.getFocus();o.visualCellRange.highlight.col=i,o.visualCellRange.from.col=i,o.visualCellRange.to.col=i,o.commit()}}function joe(t,e){var n;const r=this.hot.getSelectedRangeLast();if(!r)return t;const{highlight:i}=r,{navigableHeaders:o}=this.hot.getSettings(),s=this.hot.selection.isSelectedByColumnHeader(),a=o?i.row:(n=Ve(Dm,this))===null||n===void 0?void 0:n.row,l=s?t:i.col,u=a<0&&l>=0;if(Xo(Dm,this,null),!u)return t;const c=this.hot.getFirstFullyVisibleColumn(),h=this.hot.getLastFullyVisibleColumn(),d=h-c+1,f=Ve(st,this).findLeftMostColumnIndex(a,l),m=Ve(st,this).findRightMostColumnIndex(a,l),C=m-f+1;if(f<c&&m>h)return f;if(s){let y=null;return f>=c&&m>h?C>d?(e.value="start",y=f):(e.value="end",y=m):f<c&&m<=h&&(C>d?(e.value="end",y=m):(e.value="start",y=f)),y}return f<=c?f:m}function Uoe(t,e,n){const r=Ve(st,this).getHeaderTreeNodeData(e,t);if(!r)return t;const{columnCursor:i,selectionType:o,selectionWidth:s}=n,{isRoot:a,colspan:l}=Ve(st,this).getHeaderSettings(e,t);if(o===XR){if(!a)return r.columnIndex}else if(o===RD&&(l>s-i||!a))return null;return t}function zoe(t,e,n){let{columnHeadersCount:r}=n;if(r!==0)for(let o=0;o<e.length;o++){const{startRow:s,startCol:a,endRow:l,endCol:u}=e[o],c=l-s+1,h=a-u+1;if(s>=0||h===1)break;for(let d=a;d<=u;d++)for(let f=s;f<=l;f++){var i;const m=c+f,C=d-a;if(C===0)continue;((i=Ve(st,this).getHeaderTreeNodeData(f,d))===null||i===void 0?void 0:i.isRoot)===!1&&(t[m][C]="")}}}function Yoe(t,e,n,r){this._getHeaderTreeNodeDataByCoords(e)&&(r.column=!0)}function Goe(t,e){const n=this._getHeaderTreeNodeDataByCoords(e);if(!n)return;Xo($h,this,e.clone()),Xo(Dp,this,!0);const{selection:r}=this.hot,i=r.isSelected()?r.getSelectedRange().current():null,o=[],{columnIndex:s,origColspan:a}=n,l=!r.inInSelection(e);t.shiftKey&&i?e.col<i.from.col?o.push(i.getTopEndCorner().col,s,e.row):e.col>i.from.col?o.push(i.getTopStartCorner().col,s+a-1,e.row):o.push(s,s+a-1,e.row):(FR(t)||sl(t)&&l||Az(t))&&o.push(s,s+a-1,e.row),r.selectColumns(...o)}function qoe(t,e,n,r){if(!this.hot.view.isMouseDown()||r.column)return;const i=this._getHeaderTreeNodeDataByCoords(e);if(!i)return;const{columnIndex:o,origColspan:s}=i,a=this.hot.getSelectedRangeLast(),l=a.getTopStartCorner(),u=a.getBottomEndCorner(),{from:c}=a;r.column=!0,r.cell=!0;const h=[],d=Ue(e.row,-1/0,-1);e.col<c.col?h.push(u.col,o,d):e.col>c.col?h.push(l.col,o+s-1,d):h.push(o,o+s-1,d),this.hot.selection.selectColumns(...h)}function Koe(){Xo(Dp,this,!1)}function Xoe(){const{navigableHeaders:t}=this.hot.getSettings();if(!this.hot.view.isMouseDown()||!Ve(Dp,this)||!t)return;const e=this.hot.getSelectedRangeLast(),n=e.getTopStartCorner().col,r=e.getBottomEndCorner().col,{columnIndex:i,origColspan:o}=Ve(st,this).getHeaderTreeNodeData(Ve($h,this).row,Ve($h,this).col);if(e.setHighlight(Ve($h,this)),o>e.getWidth()||i<n||i+o-1>r){const s=Ve(st,this).findTopMostEntireHeaderLevel(Ue(n,i,i+o-1),Ue(r,i,i+o-1));e.highlight.row=s,e.highlight.col=e.from.col}}function Zoe(t){const{highlight:e}=this.hot.getSelectedRangeLast(),n=this.hot._createCellCoords(e.row+t.row,e.col+t.col);if(!(n.isHeader()&&n.col>=0))return;const i=Ve(st,this).findLeftMostColumnIndex(n.row,n.col),o=Ve(st,this).findRightMostColumnIndex(n.row,n.col);if(t.col<0){const s=e.col>=i&&e.col<=o?i-1:o,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,-1);a===null?t.col=-this.hot.view.countRenderableColumnsInRange(0,e.col):t.col=-Math.max(this.hot.view.countRenderableColumnsInRange(a,e.col)-1,1)}else if(t.col>0){const s=e.col>=i&&e.col<=o?o+1:i,a=this.hot.columnIndexMapper.getNearestNotHiddenIndex(s,1);a===null?t.col=this.hot.view.countRenderableColumnsInRange(e.col,this.hot.countCols()):t.col=Math.max(this.hot.view.countRenderableColumnsInRange(e.col,a)-1,1)}}function Qoe(t,e,n){const r=t.row,i=this._getHeaderTreeNodeDataByCoords({row:r,col:t.col}),o=this._getHeaderTreeNodeDataByCoords({row:r,col:e.col});Xo(Dm,this,n.clone()),e.col<t.col?(i&&(t.col=i.columnIndex+i.origColspan-1),o&&(e.col=o.columnIndex)):e.col>=t.col&&(i&&(t.col=i.columnIndex),o&&(e.col=o.columnIndex+o.origColspan-1))}function Joe(t){if(Ve(st,this).getLayersCount()>0){t.length=0;for(let e=0;e<Ve(st,this).getLayersCount();e++)t.push(this.headerRendererFactory(e))}}function ese(t){const e=Ve(st,this).getLayersCount();let n=t.startColumn,r=!!e;for(let i=0;i<e;i++){const o=Ve(st,this).findLeftMostColumnIndex(i,t.startColumn),s=this.hot.columnIndexMapper.getRenderableFromVisualIndex(o);if(o>=0&&(r=!1),Un(s)&&s<t.startColumn){n=s;break}}t.startColumn=r?Ve(st,this).getHeaderTreeNodeData(0,n).columnIndex:n}function tse(t,e){const n=this.ghostTable.getWidth(e);return t>n?t:n}function nse(t,e,n){var r;const{label:i}=(r=Ve(st,this).getHeaderTreeNodeData(n,e))!==null&&r!==void 0?r:{label:""};return i}function rse(t,e){if(t<0)return this.hot.getCell(t,Ve(st,this).findLeftMostColumnIndex(t,e),!0)}function ise(){this.updatePlugin()}function ose(t,e){e||this.updatePlugin()}function oh(t,e,n){return(e=sse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sse(t){var e=ase(t,"string");return typeof e=="symbol"?e:e+""}function ase(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class lse{constructor(e,n){oh(this,"hot",void 0),oh(this,"data",null),oh(this,"plugin",void 0),oh(this,"parentReference",new WeakMap),oh(this,"cache",{levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap}),this.hot=n,this.plugin=e}setData(e){this.data=e}getData(){return this.data}getRawSourceData(){let e=null;return this.plugin.disableCoreAPIModifiers(),e=this.hot.getSourceData(),this.plugin.enableCoreAPIModifiers(),e}updateWithData(e){this.setData(e),this.rewriteCache()}rewriteCache(){this.cache={levels:[],levelCount:0,rows:[],nodeInfo:new WeakMap},de(0,this.data.length-1,e=>{this.cacheNode(this.data[e],0,null)})}cacheNode(e,n,r){this.cache.levels[n]||(this.cache.levels[n]=[],this.cache.levelCount+=1),this.cache.levels[n].push(e),this.cache.rows.push(e),this.cache.nodeInfo.set(e,{parent:r,row:this.cache.rows.length-1,level:n}),this.hasChildren(e)&&I(e.__children,i=>{this.cacheNode(i,n+1,e)})}getDataObject(e){return e==null?null:this.cache.rows[e]}readTreeNodes(e,n,r,i){let o=!1,s=n;if(isNaN(s)&&s.end)return s;let a=e;return a||(a={__children:this.data},o=!0,s-=1),r!=null&&s===r?{result:a,end:!0}:i!=null&&a===i?{result:s,end:!0}:(s+=1,a.__children&&I(a.__children,l=>{if(this.parentReference.set(l,o?null:a),s=this.readTreeNodes(l,s,r,i),isNaN(s)&&s.end)return!1}),s)}mockParent(){const e=this.mockNode();return e.__children=this.data,e}mockNode(){const e={};return He(this.data[0],(n,r)=>{e[r]=null}),e}getRowIndex(e){return e==null?null:this.cache.nodeInfo.get(e).row}getRowIndexWithinParent(e){let n=null;isNaN(e)?n=e:n=this.getDataObject(e);const r=this.getRowParent(e);return r==null?this.data.indexOf(n):r.__children.indexOf(n)}countAllRows(){const e={__children:this.data};return this.countChildren(e)}countChildren(e){let n=0,r=e;return isNaN(r)||(r=this.getDataObject(r)),!r||!r.__children?0:(I(r.__children,i=>{n+=1,i.__children&&(n+=this.countChildren(i))}),n)}getRowParent(e){let n;return isNaN(e)?n=e:n=this.getDataObject(e),this.getRowObjectParent(n)}getRowObjectParent(e){return!e||typeof e!="object"?null:this.cache.nodeInfo.get(e).parent}getRowLevel(e){let n=null;return isNaN(e)?n=e:n=this.getDataObject(e),n?this.getRowObjectLevel(n):null}getRowObjectLevel(e){return e==null?null:this.cache.nodeInfo.get(e).level}hasChildren(e){let n=e;return isNaN(n)||(n=this.getDataObject(n)),!!(n.__children&&n.__children.length)}isChild(e){return this.getRowParent(e)!==null}getChild(e,n){var r;return((r=e.__children)===null||r===void 0?void 0:r[n])||null}isRowHighestLevel(e){return!this.isChild(e)}isParent(e){var n;let r=e;return isNaN(r)||(r=this.getDataObject(r)),r&&!!r.__children&&((n=r.__children)===null||n===void 0?void 0:n.length)!==0}addChild(e,n){let r=n;this.hot.runHooks("beforeAddChild",e,r);let i=null;e&&(i=this.getRowIndex(e)),this.hot.runHooks("beforeCreateRow",i+this.countChildren(e)+1,1);let o=e;e||(o=this.mockParent()),o.__children||(o.__children=[]),r||(r=this.mockNode()),o.__children.push(r),this.rewriteCache();const s=this.getRowIndex(r);this.hot.rowIndexMapper.insertIndexes(s,1),this.hot.runHooks("afterCreateRow",s,1),this.hot.runHooks("afterAddChild",e,r)}addChildAtIndex(e,n,r){let i=r,o;if(i||(i=this.mockNode()),this.hot.runHooks("beforeAddChild",e,i,n),e){const a=this.getRowIndex(e)+n+1;this.hot.runHooks("beforeCreateRow",a,1),e.__children.splice(n,null,i),this.rewriteCache(),this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(e),"__children",e.__children,"NestedRows.addChildAtIndex"),this.hot.rowIndexMapper.insertIndexes(a,1),this.plugin.enableCoreAPIModifiers(),this.hot.runHooks("afterCreateRow",a,1),o=a}else this.plugin.disableCoreAPIModifiers(),this.hot.alter("insert_row_above",n,1,"NestedRows.addChildAtIndex"),this.plugin.enableCoreAPIModifiers(),o=this.getRowIndex(this.data[n]);i=this.getDataObject(o),this.hot.runHooks("afterAddChild",e,i,n)}addSibling(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"below";const r=this.translateTrimmedRow(e),i=this.getRowParent(r),o=this.getRowIndexWithinParent(r);switch(n){case"below":this.addChildAtIndex(i,o+1,null);break;case"above":this.addChildAtIndex(i,o,null);break}}detachFromParent(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=null;const i=[];Array.isArray(e)?(de(e[0],e[2],d=>{const f=this.translateTrimmedRow(d);i.push(this.getDataObject(f))}),de(0,i.length-2,d=>{this.detachFromParent(i[d],!1)}),r=i[i.length-1]):r=e;const o=this.getRowIndex(r),s=this.countChildren(r),a=this.getRowIndexWithinParent(r),l=this.getRowParent(r),u=this.getRowParent(l),c=this.getRowIndex(u);let h=null;if(this.hot.runHooks("beforeDetachChild",l,r),a!=null){const d=Array.from(new Array(o+s+1).keys()).splice(-1*(s+1));if(this.hot.runHooks("beforeRemoveRow",o,s+1,d,this.plugin.pluginName),l.__children.splice(a,1),this.rewriteCache(),this.hot.runHooks("afterRemoveRow",o,s+1,d,this.plugin.pluginName),u){h=c+this.countChildren(u);const f=this.getChild(u,this.countChildren(u)-1),m=this.getRowIndex(f);this.hot.runHooks("beforeCreateRow",m+1,s+1,this.plugin.pluginName),u.__children.push(r)}else h=this.hot.countRows()+1,this.hot.runHooks("beforeCreateRow",h-2,s+1,this.plugin.pluginName),this.data.push(r)}this.rewriteCache(),this.hot.runHooks("afterCreateRow",h-2,s+1,this.plugin.pluginName),this.hot.runHooks("afterDetachChild",l,r,this.getRowIndex(r)),n&&this.hot.render()}filterData(e,n,r){const i=[];I(r,o=>{i.push(this.getDataObject(o))}),I(i,o=>{const s=this.getRowIndexWithinParent(o),a=this.getRowParent(o);a===null?this.data.splice(s,1):a.__children.splice(s,1)}),this.rewriteCache()}spliceData(e,n,r){const i=this.getDataObject(e-1);let o=null,s=e;i&&i.__children&&i.__children.length===0?(o=i,s=0):e<this.countAllRows()&&(o=this.getRowParent(e),s=this.getRowIndexWithinParent(e)),o?r?o.__children.splice(s,n,...r):o.__children.splice(s,n):r?this.data.splice(s,n,...r):this.data.splice(s,n),this.rewriteCache()}syncRowWithRawSource(e){let n=e,r=n;do r=this.getRowParent(r),r!==null&&(n=r);while(r!==null);this.plugin.disableCoreAPIModifiers(),this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(n),"__children",n.__children,"NestedRows.syncRowWithRawSource"),this.plugin.enableCoreAPIModifiers()}moveRow(e,n,r,i){const o=n===this.hot.countRows(),s=this.getRowParent(e),a=this.getRowIndexWithinParent(e),l=s.__children.slice(a,a+1),u=e>n;let c=o?this.getRowParent(n-1):this.getRowParent(n);c==null&&(c=this.getRowParent(n-1)),c==null&&(c=this.getDataObject(n-1)),c?c.__children||(c.__children=[]):(c=this.getDataObject(n),c.__children=[]);const h=o||r||i?c.__children.length:this.getRowIndexWithinParent(n),d=s===c;c.__children.splice(h,0,l[0]),s.__children.splice(a+(u&&d?1:0),1),this.syncRowWithRawSource(s),d||this.syncRowWithRawSource(c)}translateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.translateTrimmedRow(e):e}untranslateTrimmedRow(e){return this.plugin.collapsingUI?this.plugin.collapsingUI.untranslateTrimmedRow(e):e}}function kH(t,e,n){return(e=use(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function use(t){var e=cse(t,"string");return typeof e=="symbol"?e:e+""}function cse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ST{constructor(e,n){kH(this,"hot",void 0),kH(this,"plugin",void 0),this.hot=n,this.plugin=e}}class to extends ST{static get CSS_CLASSES(){return{indicatorContainer:"ht_nestingLevels",parent:"ht_nestingParent",indicator:"ht_nestingLevel",emptyIndicator:"ht_nestingLevel_empty",button:"ht_nestingButton",expandButton:"ht_nestingExpand",collapseButton:"ht_nestingCollapse"}}constructor(e,n){super(e,n),this.dataManager=this.plugin.dataManager,this.collapsingUI=this.plugin.collapsingUI,this.rowHeaderWidthCache=null}appendLevelIndicators(e,n){const r=this.hot.toPhysicalRow(e),i=this.dataManager.getRowLevel(r),o=this.dataManager.getDataObject(r),s=n.getElementsByTagName("DIV")[0],a=s.querySelector("span.rowHeader"),l=s.querySelectorAll('[class^="ht_nesting"]'),u=this.hot.getSettings().ariaTags;if(I(l,c=>{c&&s.removeChild(c)}),q(n,to.CSS_CLASSES.indicatorContainer),i){const{rootDocument:c}=this.hot,h=a.cloneNode(!0);s.innerHTML="",de(0,i-1,()=>{const d=c.createElement("SPAN");q(d,to.CSS_CLASSES.emptyIndicator),s.appendChild(d)}),s.appendChild(h)}if(this.dataManager.hasChildren(o)){const c=this.hot.rootDocument.createElement("DIV");u&&ye(c,[yl()]),q(n,to.CSS_CLASSES.parent),this.collapsingUI.areChildrenCollapsed(r)?(q(c,`${to.CSS_CLASSES.button} ${to.CSS_CLASSES.expandButton}`),u&&ye(n,[Gr(!1)])):(q(c,`${to.CSS_CLASSES.button} ${to.CSS_CLASSES.collapseButton}`),u&&ye(n,[Gr(!0)])),s.appendChild(c)}}updateRowHeaderWidth(e){let n=e;n||(n=this.dataManager.cache.levelCount);const r=this.hot.view.getStylesHandler();let i=11;r.isClassicTheme()||(i=r.getCSSVariableValue("cell-horizontal-padding")*2),this.rowHeaderWidthCache=Math.max(50,i+10*n+25),this.hot.render()}}class hse extends ST{constructor(e,n){var r;super(e,n),r=this,this.dataManager=this.plugin.dataManager,this.collapsedRows=[],this.collapsedRowsStash={stash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;r.lastCollapsedRows=r.collapsedRows.slice(0),r.expandMultipleChildren(r.lastCollapsedRows,i)},shiftStash:function(i,o){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;o==null&&(o=1/0),I(r.lastCollapsedRows,(a,l)=>{a>=i&&a<o&&(r.lastCollapsedRows[l]=a+s)})},applyStash:function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;r.collapseMultipleChildren(r.lastCollapsedRows,i),r.lastCollapsedRows=void 0},trimStash:(i,o)=>{de(i,i+o-1,s=>{const a=this.lastCollapsedRows.indexOf(s);a>-1&&this.lastCollapsedRows.splice(a,1)})}}}collapseChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(o)):(o=this.dataManager.getDataObject(e),s=e),this.dataManager.hasChildren(o)&&I(o.__children,l=>{i.push(this.dataManager.getRowIndex(l))}),a=this.collapseRows(i,!0,!1),r&&this.trimRows(a),n&&this.renderAndAdjust(),this.collapsedRows.indexOf(s)===-1&&this.collapsedRows.push(s),a}collapseMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];I(e,o=>{i.push(...this.collapseChildren(o,!1,!1))}),r&&this.trimRows(i),n&&this.renderAndAdjust()}collapseRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.collapseRows([e],n)}collapseRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return I(e,o=>{i.push(o),n&&this.collapseChildRows(o,i)}),r&&this.trimRows(i),i}collapseChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);I(i.__children,o=>{const s=this.dataManager.getRowIndex(o);n.push(s),this.collapseChildRows(s,n)})}r&&this.trimRows(n)}expandRow(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.expandRows([e],n)}expandRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const i=[];return I(e,o=>{i.push(o),n&&this.expandChildRows(o,i)}),r&&this.untrimRows(i),i}expandChildRows(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(this.dataManager.hasChildren(e)){const i=this.dataManager.getDataObject(e);I(i.__children,o=>{if(!this.isAnyParentCollapsed(o)){const s=this.dataManager.getRowIndex(o);n.push(s),this.expandChildRows(s,n)}})}r&&this.untrimRows(n)}expandChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];let o=null,s=null,a=null;return isNaN(e)?(o=e,s=this.dataManager.getRowIndex(e)):(o=this.dataManager.getDataObject(e),s=e),this.collapsedRows.splice(this.collapsedRows.indexOf(s),1),this.dataManager.hasChildren(o)&&I(o.__children,l=>{const u=this.dataManager.getRowIndex(l);i.push(u)}),a=this.expandRows(i,!0,!1),r&&this.untrimRows(a),n&&this.renderAndAdjust(),a}expandMultipleChildren(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;const i=[];I(e,o=>{i.push(...this.expandChildren(o,!1,!1))}),r&&this.untrimRows(i),n&&this.renderAndAdjust()}collapseAll(){const e=this.dataManager.getData(),n=[];I(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.collapseMultipleChildren(n),this.renderAndAdjust()}expandAll(){const e=this.dataManager.getData(),n=[];I(e,r=>{this.dataManager.hasChildren(r)&&n.push(r)}),this.expandMultipleChildren(n),this.renderAndAdjust()}trimRows(e){this.hot.batchExecution(()=>{I(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!0)})},!0)}untrimRows(e){this.hot.batchExecution(()=>{I(e,n=>{this.plugin.collapsedRowsMap.setValueAtIndex(n,!1)})},!0)}areChildrenCollapsed(e){let n=isNaN(e)?e:this.dataManager.getDataObject(e),r=!0;return n===null&&(n={__children:this.dataManager.data}),this.dataManager.hasChildren(n)&&I(n.__children,i=>{const o=this.dataManager.getRowIndex(i);if(!this.plugin.collapsedRowsMap.getValueAtIndex(o))return r=!1,!1}),r}isAnyParentCollapsed(e){let n=e;for(;n!==null;){n=this.dataManager.getRowParent(n);const r=this.dataManager.getRowIndex(n);if(this.collapsedRows.indexOf(r)>-1)return!0}return!1}toggleState(e,n){if(n.col>=0)return;const r=this.translateTrimmedRow(n.row);ve(e.target,to.CSS_CLASSES.button)&&(this.areChildrenCollapsed(r)?this.expandChildren(r):this.collapseChildren(r),Pi(e))}translateTrimmedRow(e){return this.hot.toPhysicalRow(e)}untranslateTrimmedRow(e){return this.hot.toVisualRow(e)}renderAndAdjust(){this.hot.render(),this.hot.view.adjustElementsSize()}}function dse(t,e,n){fse(t,e),e.set(t,n)}function fse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gse(t,e,n){return(e=mse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mse(t){var e=pse(t,"string");return typeof e=="symbol"?e:e+""}function pse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wse(t,e){return t.get(vse(t,e))}function vse(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var LH=new WeakMap;class Cse extends ST{constructor(){super(...arguments),gse(this,"dataManager",this.plugin.dataManager),dse(this,LH,{row_above:(e,n)=>{const r=n[n.length-1];this.dataManager.addSibling(r.start.row,"above")},row_below:(e,n)=>{const r=n[n.length-1];this.dataManager.addSibling(r.start.row,"below")}})}appendOptions(e){const n=[{key:"add_child",name(){return this.getTranslatedPhrase(XE)},callback:()=>{const r=this.dataManager.translateTrimmedRow(this.hot.getSelectedLast()[0]),i=this.dataManager.getDataObject(r);this.dataManager.addChild(i)},disabled:()=>{const r=this.hot.getSelectedLast();return!r||r[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{key:"detach_from_parent",name(){return this.getTranslatedPhrase(ZE)},callback:()=>{this.dataManager.detachFromParent(this.hot.getSelectedLast())},disabled:()=>{const r=this.hot.getSelectedLast(),i=this.dataManager.translateTrimmedRow(r[0]);return!this.dataManager.getRowParent(i)||!r||r[0]<0||this.hot.selection.isSelectedByColumnHeader()||this.hot.countRows()>=this.hot.getSettings().maxRows}},{name:"---------"}];return de(0,e.items.length-1,r=>{if(r===0)return I(n,(i,o)=>{e.items.splice(r+o,0,i)}),!1}),this.modifyRowInsertingOptions(e)}modifyRowInsertingOptions(e){return de(0,e.items.length-1,n=>{const r=wse(LH,this)[e.items[n].key];r!=null&&(e.items[n].callback=r)}),e}}function ag(t,e,n){return(e=yse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yse(t){var e=bse(t,"string");return typeof e=="symbol"?e:e+""}function bse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Sse{constructor(e){ag(this,"plugin",void 0),ag(this,"hot",void 0),ag(this,"dataManager",void 0),ag(this,"collapsingUI",void 0),this.plugin=e,this.hot=e.hot,this.dataManager=e.dataManager,this.collapsingUI=e.collapsingUI}onBeforeRowMove(e,n,r,i){if(this.displayAPICompatibilityWarning({rows:e,finalIndex:n,dropIndex:r,movePossible:i}))return!1;this.movedToCollapsed=!1;const s=r===this.hot.countRows(),a=s?this.hot.countSourceRows():this.dataManager.translateTrimmedRow(r);let l=!0;const u=e.map(m=>{if(!l)return!1;const C=this.dataManager.translateTrimmedRow(m);return l=this.shouldAllowMoving(C,a),C}),c=u.indexOf(a)===-1;if(!l||!c)return!1;const h=this.getBaseParent(u),d=this.getTargetParent(s,a),f=h===d;return this.movedToCollapsed=this.collapsingUI.areChildrenCollapsed(d),this.collapsingUI.collapsedRowsStash.stash(),this.shiftCollapsibleParentsLocations(u,a,f),this.moveRows(u,a,d),this.dataManager.rewriteCache(),this.moveCellsMeta(u,a),this.collapsingUI.collapsedRowsStash.applyStash(!1),this.hot.runHooks("afterRowMove",e,n,r,i,i&&this.isRowOrderChanged(e,n)),this.hot.render(),this.selectCells(e,r),!1}displayAPICompatibilityWarning(e){const{rows:n,finalIndex:r,dropIndex:i,movePossible:o}=e;let s=!1;return It(i)&&(Ze(nt`Since version 8.0.0 of the Handsontable the 'moveRows' method isn't used for moving rows\x20
279
+ when the NestedRows plugin is enabled. Please use the 'dragRows' method instead.`),this.hot.runHooks("afterRowMove",n,r,i,o,!1),s=!0),s}shouldAllowMoving(e,n){return!(this.dataManager.isParent(e)||this.dataManager.isRowHighestLevel(e)||e===n||n===0)}getBaseParent(e){return this.dataManager.getRowParent(e[0])}getTargetParent(e,n){let r=this.dataManager.getRowParent(e?n-1:n);return r==null&&(r=this.dataManager.getRowParent(n-1)),r}shiftCollapsibleParentsLocations(e,n,r){r||(Math.max(...e)<=n?this.collapsingUI.collapsedRowsStash.shiftStash(e[0],n,-1*e.length):this.collapsingUI.collapsedRowsStash.shiftStash(n,e[0],e.length))}moveRows(e,n,r){const i=n===this.dataManager.getRowIndex(r)+this.dataManager.countChildren(r)+1;this.hot.batchRender(()=>{e.forEach(o=>{this.dataManager.moveRow(o,n,this.movedToCollapsed,i)})})}moveCellsMeta(e,n){const r=[],i=Math.max(...e)<n;e.forEach(o=>{r.push(this.hot.getCellMetaAtRow(o))}),this.hot.spliceCellsMeta(e[0],e.length),this.hot.spliceCellsMeta(n-(i?r.length:0),0,...r)}selectCells(e,n){const r=e.length;let i=0,o=0;if(this.movedToCollapsed){let s=null;e[r-1]<n?s=this.dataManager.translateTrimmedRow(n-r):s=this.dataManager.translateTrimmedRow(n);const a=this.dataManager.getRowParent(s===null?this.hot.countSourceRows()-1:s-1),l=this.dataManager.getRowIndex(a);i=this.dataManager.untranslateTrimmedRow(l),o=i}else e[r-1]<n?(o=n-1,i=o-r+1):(i=n,o=i+r-1);this.hot.selectCells([[i,0,o,this.hot.countCols()-1]],!1)}isRowOrderChanged(e,n){return e.some((r,i)=>r-i!==n)}}function Rse(t,e){x$(t,e),e.add(t)}function $H(t,e,n){x$(t,e),e.set(t,n)}function x$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xb(t,e,n){return(e=Ese(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ese(t){var e=Tse(t,"string");return typeof e=="symbol"?e:e+""}function Tse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vg(t,e){return t.get(fn(t,e))}function km(t,e,n){return t.set(fn(t,e),n),n}function fn(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Lm="nestedRows",_se=300,FH=Lm,Mse="The Nested Rows plugin requires an Array of Objects as a dataset to be provided. The plugin has been disabled.";var kp=new WeakMap,su=new WeakMap,vn=new WeakSet;class Ise extends Xe{constructor(){super(...arguments),Rse(this,vn),xb(this,"dataManager",null),xb(this,"headersUI",null),xb(this,"collapsedRowsMap",null),$H(this,kp,!1),$H(this,su,!1)}static get PLUGIN_KEY(){return Lm}static get PLUGIN_PRIORITY(){return _se}isEnabled(){return!!this.hot.getSettings()[Lm]}enablePlugin(){var e=this;this.enabled||(this.collapsedRowsMap=this.hot.rowIndexMapper.registerMap("nestedRows",new Ed),this.dataManager=new lse(this,this.hot),this.collapsingUI=new hse(this,this.hot),this.headersUI=new to(this,this.hot),this.contextMenuUI=new Cse(this,this.hot),this.rowMoveController=new Sse(this),this.addHook("afterInit",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,Bse).call(e,...r)}),this.addHook("beforeViewRender",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,jse).call(e,...r)}),this.addHook("modifyRowData",function(){return e.onModifyRowData(...arguments)}),this.addHook("modifySourceLength",function(){return e.onModifySourceLength(...arguments)}),this.addHook("beforeDataSplice",function(){return e.onBeforeDataSplice(...arguments)}),this.addHook("filterData",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,xse).call(e,...r)}),this.addHook("afterContextMenuDefaultOptions",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,Ase).call(e,...r)}),this.addHook("afterGetRowHeader",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,Hse).call(e,...r)}),this.addHook("beforeOnCellMouseDown",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,Ose).call(e,...r)}),this.addHook("beforeRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,kse).call(e,...r)}),this.addHook("afterRemoveRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,Dse).call(e,...r)}),this.addHook("beforeAddChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,Lse).call(e,...r)}),this.addHook("afterAddChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,$se).call(e,...r)}),this.addHook("beforeDetachChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,Fse).call(e,...r)}),this.addHook("afterDetachChild",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,Vse).call(e,...r)}),this.addHook("modifyRowHeaderWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,Nse).call(e,...r)}),this.addHook("afterCreateRow",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,Wse).call(e,...r)}),this.addHook("beforeRowMove",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return fn(vn,e,Pse).call(e,...r)}),this.addHook("beforeLoadData",n=>fn(vn,this,VH).call(this,n)),this.addHook("beforeUpdateData",n=>fn(vn,this,VH).call(this,n)),this.registerShortcuts(),super.enablePlugin())}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("nestedRows"),this.unregisterShortcuts(),super.disablePlugin()}updatePlugin(){this.disablePlugin();const e=this.dataManager.getData();this.enablePlugin(),this.dataManager.updateWithData(e),super.updatePlugin()}registerShortcuts(){this.hot.getShortcutManager().getContext("grid").addShortcut({keys:[["Enter"]],callback:()=>{const{highlight:e}=this.hot.getSelectedRangeLast(),n=this.collapsingUI.translateTrimmedRow(e.row);return this.collapsingUI.areChildrenCollapsed(n)?this.collapsingUI.expandChildren(n):this.collapsingUI.collapseChildren(n),!1},runOnlyIf:()=>{var e,n;const r=(e=this.hot.getSelectedRangeLast())===null||e===void 0?void 0:e.highlight;return r&&((n=this.hot.getSelectedRangeLast())===null||n===void 0?void 0:n.isSingle())&&this.hot.selection.isCellVisible(r)&&r.col===-1&&r.row>=0},group:FH,relativeToGroup:Js,position:"before"})}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(FH)}disableCoreAPIModifiers(){km(su,this,!0)}enableCoreAPIModifiers(){km(su,this,!1)}onModifyRowData(e){if(!Vg(su,this))return this.dataManager.getDataObject(e)}onModifySourceLength(){if(!Vg(su,this))return this.dataManager.countAllRows()}onBeforeDataSplice(e,n,r){return Vg(su,this)||this.dataManager.isRowHighestLevel(e)?!0:(this.dataManager.spliceData(e,n,r),!1)}destroy(){super.destroy()}}function Pse(t,e,n,r){return this.rowMoveController.onBeforeRowMove(t,e,n,r)}function Ose(t,e,n){this.collapsingUI.toggleState(t,e,n)}function xse(t,e,n){return this.collapsingUI.collapsedRowsStash.stash(),this.collapsingUI.collapsedRowsStash.trimStash(n[0],e),this.collapsingUI.collapsedRowsStash.shiftStash(n[0],null,-1*e),this.dataManager.filterData(t,e,n),km(kp,this,!0),this.dataManager.getData().slice()}function Ase(t){return this.contextMenuUI.appendOptions(t)}function Hse(t,e){this.headersUI.appendLevelIndicators(t,e)}function Nse(t){return Math.max(this.headersUI.rowHeaderWidthCache,t)}function Dse(t,e,n,r){r!==this.pluginName&&this.hot._registerTimeout(()=>{km(kp,this,!1),this.headersUI.updateRowHeaderWidth(),this.collapsingUI.collapsedRowsStash.applyStash()})}function kse(t,e,n){const r=Array.from(n.reduce((i,o)=>{if(this.dataManager.isParent(o)){const s=this.dataManager.getDataObject(o).__children;return i.add(o),Array.isArray(s)&&s.forEach(a=>i.add(this.dataManager.getRowIndex(a))),i}return i.add(o)},new Set));n.length=0,n.push(...r)}function Lse(){this.collapsingUI.collapsedRowsStash.stash()}function $se(t,e){this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(e)),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function Fse(){this.collapsingUI.collapsedRowsStash.stash()}function Vse(t,e,n){this.collapsingUI.collapsedRowsStash.shiftStash(n,null,-1),this.collapsingUI.collapsedRowsStash.applyStash(),this.headersUI.updateRowHeaderWidth()}function Wse(){this.dataManager.rewriteCache()}function Bse(){this.headersUI.updateRowHeaderWidth()}function jse(t,e){Vg(kp,this)&&(e.skipRender=!0)}function VH(t){if(!Yq(t)){VR(Mse),this.hot.getSettings()[Lm]=!1,this.disablePlugin();return}this.dataManager.setData(t),this.dataManager.rewriteCache()}function Ab(t,e,n){return(e=Use(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Use(t){var e=zse(t,"string");return typeof e=="symbol"?e:e+""}function zse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Yse{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;Ab(this,"rootWindow",void 0),Ab(this,"prefix",void 0),Ab(this,"savedKeys",[]),this.rootWindow=n,this.prefix=e,this.loadSavedKeys()}saveValue(e,n){this.rootWindow.localStorage.setItem(`${this.prefix}_${e}`,JSON.stringify(n)),this.savedKeys.indexOf(e)===-1&&(this.savedKeys.push(e),this.saveSavedKeys())}loadValue(e,n){const r=typeof e>"u"?n:e,i=this.rootWindow.localStorage.getItem(`${this.prefix}_${r}`);return i===null?void 0:JSON.parse(i)}reset(e){this.rootWindow.localStorage.removeItem(`${this.prefix}_${e}`)}resetAll(){I(this.savedKeys,(e,n)=>{this.rootWindow.localStorage.removeItem(`${this.prefix}_${this.savedKeys[n]}`)}),this.clearSavedKeys()}loadSavedKeys(){const e=this.rootWindow.localStorage.getItem(`${this.prefix}__persistentStateKeys`),n=typeof e=="string"?JSON.parse(e):void 0;this.savedKeys=n||[]}saveSavedKeys(){this.rootWindow.localStorage.setItem(`${this.prefix}__persistentStateKeys`,JSON.stringify(this.savedKeys))}clearSavedKeys(){this.savedKeys.length=0,this.saveSavedKeys()}}function Gse(t,e,n){return(e=qse(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qse(t){var e=Kse(t,"string");return typeof e=="symbol"?e:e+""}function Kse(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}re.getSingleton().register("persistentStateSave");re.getSingleton().register("persistentStateLoad");re.getSingleton().register("persistentStateReset");const WH="persistentState",Xse=0;class Zse extends Xe{constructor(){super(...arguments),Gse(this,"storage",void 0)}static get PLUGIN_KEY(){return WH}static get PLUGIN_PRIORITY(){return Xse}isEnabled(){return!!this.hot.getSettings()[WH]}enablePlugin(){this.enabled||(this.storage||(this.storage=new Yse(this.hot.rootElement.id,this.hot.rootWindow)),this.addHook("persistentStateSave",(e,n)=>this.saveValue(e,n)),this.addHook("persistentStateLoad",(e,n)=>this.loadValue(e,n)),this.addHook("persistentStateReset",()=>this.resetValue()),super.enablePlugin())}disablePlugin(){this.storage=void 0,super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}loadValue(e,n){n.value=this.storage.loadValue(e)}saveValue(e,n){this.storage.saveValue(e,n)}resetValue(e){typeof e>"u"?this.storage.resetAll():this.storage.reset(e)}destroy(){super.destroy()}}function Qse(t,e){Jse(t,e),e.add(t)}function Jse(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Hb(t,e,n){return(e=eae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function eae(t){var e=tae(t,"string");return typeof e=="symbol"?e:e+""}function tae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function BH(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Nb="search",nae=190,rae="htSearchResult",iae=function(t,e,n,r,i){t.getCellMeta(e,n).isSearchResult=i},oae=function(t,e,n){return It(t)||t===null||!t.toLocaleLowerCase||t.length===0||It(e)||e===null?!1:e.toString().toLocaleLowerCase(n.locale).indexOf(t.toLocaleLowerCase(n.locale))!==-1};var Db=new WeakSet;class sae extends Xe{constructor(){super(...arguments),Qse(this,Db),Hb(this,"callback",iae),Hb(this,"queryMethod",oae),Hb(this,"searchResultClass",rae)}static get PLUGIN_KEY(){return Nb}static get PLUGIN_PRIORITY(){return nae}isEnabled(){return this.hot.getSettings()[Nb]}enablePlugin(){var e=this;if(this.enabled)return;const n=this.hot.getSettings()[Nb];this.updatePluginSettings(n),this.addHook("beforeRenderer",function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return BH(Db,e,jH).call(e,...i)}),super.enablePlugin()}disablePlugin(){var e=this;const n=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return BH(Db,e,jH).call(e,...i)};this.hot.addHook("beforeRenderer",n),this.hot.addHookOnce("afterViewRender",()=>{this.hot.removeHook("beforeRenderer",n)}),super.disablePlugin()}updatePlugin(){this.disablePlugin(),this.enablePlugin(),super.updatePlugin()}query(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getCallback(),r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getQueryMethod();const i=this.hot.countRows(),o=this.hot.countCols(),s=[],a=this.hot;return de(0,i-1,l=>{de(0,o-1,u=>{const c=this.hot.getDataAtCell(l,u),h=this.hot.getCellMeta(l,u),d=h.search.callback||n,m=(h.search.queryMethod||r)(e,c,h);if(m){const C={row:l,col:u,data:c};s.push(C)}d&&d(a,l,u,c,m)})}),s}getCallback(){return this.callback}setCallback(e){this.callback=e}getQueryMethod(){return this.queryMethod}setQueryMethod(e){this.queryMethod=e}getSearchResultClass(){return this.searchResultClass}setSearchResultClass(e){this.searchResultClass=e}updatePluginSettings(e){Ae(e)&&(e.searchResultClass&&this.setSearchResultClass(e.searchResultClass),e.queryMethod&&this.setQueryMethod(e.queryMethod),e.callback&&this.setCallback(e.callback))}destroy(){super.destroy()}}function jH(t,e,n,r,i,o){const s=o.className||[];let a=[];typeof s=="string"?a=s.split(" "):a.push(...s),this.isEnabled()&&o.isSearchResult?a.includes(this.searchResultClass)||a.push(`${this.searchResultClass}`):a.includes(this.searchResultClass)&&a.splice(a.indexOf(this.searchResultClass),1),o.className=a.join(" ")}function lg(t,e,n){return(e=aae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function aae(t){var e=lae(t,"string");return typeof e=="symbol"?e:e+""}function lae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class A${constructor(e){lg(this,"viewportWidth",void 0),lg(this,"overwriteColumnWidthFn",void 0),lg(this,"baseWidths",new Map),lg(this,"stretchedWidths",new Map),this.overwriteColumnWidthFn=e}prepare(e){let{viewportWidth:n}=e;this.viewportWidth=n,this.baseWidths.clear(),this.stretchedWidths.clear()}setColumnBaseWidth(e,n){this.baseWidths.set(e,n)}calculate(){}getWidths(){return Array.from(this.stretchedWidths)}}class uae extends A${calculate(){const e=Array.from(this.baseWidths).reduce((h,d)=>{let[,f]=d;return h+f},0);if(this.viewportWidth-e<0){this.stretchedWidths.clear();return}const r=this.viewportWidth/e,i=[],o=[];let s=this.viewportWidth,a=0;if(this.baseWidths.forEach((h,d)=>{const f=Math.round(h*r),m=this.overwriteColumnWidthFn(f,d);f===m&&f>=Nu?(i.push([d,m]),a+=m):f!==m&&(i.push([d,m]),o.push(d),s-=m)}),s<=Nu){this.stretchedWidths.clear();return}const l=s/a;let u=-1,c=0;i.forEach((h,d)=>{let[f,m]=h,C=m;o.includes(f)||(C=Math.round(m*l)),this.stretchedWidths.set(f,C),u=f,d<i.length-1&&(c+=C)}),this.stretchedWidths.size>1&&this.stretchedWidths.set(u,Math.round(this.viewportWidth-c))}}function UH(t,e,n){cae(t,e),e.set(t,n)}function cae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kb(t,e){return t.get(H$(t,e))}function ug(t,e,n){return t.set(H$(t,e),n),n}function H$(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var cg=new WeakMap,sh=new WeakMap;class hae extends A${constructor(){super(...arguments),UH(this,cg,0),UH(this,sh,-1)}prepare(e){super.prepare(e),ug(cg,this,0),ug(sh,this,-1)}setColumnBaseWidth(e,n){super.setColumnBaseWidth(e,n),ug(sh,this,e),ug(cg,this,n)}calculate(){if(kb(sh,this)===-1)return;const e=Array.from(this.baseWidths).reduce((r,i)=>{let[,o]=i;return r+o},0),n=Math.max(this.viewportWidth-e+kb(cg,this),0);this.stretchedWidths.set(kb(sh,this),n)}}function dae(t,e){N$(t,e),e.add(t)}function hg(t,e,n){N$(t,e),e.set(t,n)}function N$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vt(t,e){return t.get(Ru(t,e))}function Lb(t,e,n){return t.set(Ru(t,e),n),n}function Ru(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const fae="stretchColumns";var xn=new WeakMap,au=new WeakMap,$b=new WeakMap,dg=new WeakMap,ah=new WeakSet;class gae{constructor(e){dae(this,ah),hg(this,xn,void 0),hg(this,au,void 0),hg(this,$b,new Map([["all",new uae(Ru(ah,this,zH).bind(this))],["last",new hae(Ru(ah,this,zH).bind(this))]])),hg(this,dg,"none"),Lb(xn,this,e),Lb(au,this,Vt(xn,this).columnIndexMapper.createAndRegisterIndexMap(fae,"physicalIndexToValue"))}useStrategy(e){Lb(dg,this,Vt($b,this).has(e)?e:"none")}refreshStretching(){if(Vt(dg,this)==="none"){Vt(au,this).clear();return}Vt(xn,this).batchExecution(()=>{Vt(au,this).clear();const e=Vt($b,this).get(Vt(dg,this));let r=Vt(xn,this).view.getViewportWidth();Ru(ah,this,mae).call(this)&&(r-=yn(Vt(xn,this).rootDocument)),e.prepare({viewportWidth:r});for(let i=0;i<Vt(xn,this).countCols();i++)Vt(xn,this).columnIndexMapper.isHidden(Vt(xn,this).toPhysicalColumn(i))||e.setColumnBaseWidth(i,Ru(ah,this,pae).call(this,i));e.calculate(),e.getWidths().forEach(i=>{let[o,s]=i;Vt(au,this).setValueAtIndex(Vt(xn,this).toPhysicalColumn(o),s)})},!0)}getStretchedWidth(e){return Vt(au,this).getValueAtIndex(Vt(xn,this).toPhysicalColumn(e))}}function mae(){const{view:t}=Vt(xn,this);if(t.isVerticallyScrollableByWindow())return!1;const e=t.getViewportHeight(),n=Vt(xn,this).countRows(),r=t.getStylesHandler().getDefaultRowHeight();let i=0,o=!1;for(let a=0;a<n;a++){var s;if(i+=((s=Vt(xn,this).getRowHeight(a))!==null&&s!==void 0?s:r)+(a===0?1:0),i>e){o=!0;break}}return o}function pae(t){var e;return(e=Vt(xn,this).getColWidth(t,"StretchColumns"))!==null&&e!==void 0?e:Nu}function zH(t,e){return Vt(xn,this).runHooks("beforeStretchingColumnWidth",t,e)}function wae(t,e){D$(t,e),e.add(t)}function Fb(t,e,n){D$(t,e),e.set(t,n)}function D$(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Vb(t,e,n){return t.set($m(t,e),n),n}function ko(t,e){return t.get($m(t,e))}function $m(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const vae="stretchColumns",Cae=155;var wu=new WeakMap,fg=new WeakMap,lh=new WeakMap,Wb=new WeakSet;class yae extends Xe{constructor(){super(...arguments),wae(this,Wb),Fb(this,wu,new gae(this.hot)),Fb(this,fg,null),Fb(this,lh,new ResizeObserver(e=>{requestAnimationFrame(()=>{var n;(n=this.hot)!==null&&n!==void 0&&n.view.isHorizontallyScrollableByWindow()&&e.forEach(r=>{let{contentRect:i}=r;ko(fg,this)!==null&&ko(fg,this)!==i.width&&(this.hot.refreshDimensions(),this.hot.view.adjustElementsSize()),Vb(fg,this,i.width)})})}))}static get PLUGIN_KEY(){return vae}static get PLUGIN_PRIORITY(){return Cae}static get SETTING_KEYS(){return!0}isEnabled(){return["all","last"].includes(this.hot.getSettings().stretchH)}enablePlugin(){var e=this;this.enabled||(ko(wu,this).useStrategy(this.hot.getSettings().stretchH),ko(lh,this).observe(this.hot.rootElement),this.addHook("beforeRender",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return $m(Wb,e,Sae).call(e,...r)}),this.addHook("modifyColWidth",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return $m(Wb,e,bae).call(e,...r)},10),super.enablePlugin())}updatePlugin(){ko(wu,this).useStrategy(this.hot.getSettings().stretchH),super.updatePlugin()}disablePlugin(){super.disablePlugin(),ko(lh,this).unobserve(this.hot.rootElement)}getColumnWidth(e){return ko(wu,this).getStretchedWidth(e)}destroy(){ko(lh,this).disconnect(),Vb(lh,this,null),Vb(wu,this,null),super.destroy()}}function bae(t,e,n){if(n===this.pluginName)return;const r=this.getColumnWidth(e);return typeof r=="number"?r:t}function Sae(t){t&&ko(wu,this).refreshStretching()}function Rae(t,e){Eae(t,e),e.add(t)}function Eae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gg(t,e,n){return(e=Tae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tae(t){var e=_ae(t,"string");return typeof e=="symbol"?e:e+""}function _ae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Bb(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Mae="touchScroll",Iae=200;var mg=new WeakSet;class Pae extends Xe{constructor(){super(...arguments),Rae(this,mg),gg(this,"scrollbars",[]),gg(this,"clones",[]),gg(this,"lockedCollection",!1),gg(this,"freezeOverlays",!1)}static get PLUGIN_KEY(){return Mae}static get PLUGIN_PRIORITY(){return Iae}static get SETTING_KEYS(){return!0}isEnabled(){return KN()}enablePlugin(){this.enabled||(this.addHook("afterViewRender",()=>Bb(mg,this,Oae).call(this)),this.registerEvents(),super.enablePlugin())}updatePlugin(){this.lockedCollection=!1,super.updatePlugin()}disablePlugin(){super.disablePlugin()}registerEvents(){this.addHook("beforeTouchScroll",()=>Bb(mg,this,xae).call(this)),this.addHook("afterMomentumScroll",()=>Bb(mg,this,Aae).call(this))}}function Oae(){if(this.lockedCollection)return;const{topOverlay:t,bottomOverlay:e,inlineStartOverlay:n,topInlineStartCornerOverlay:r,bottomInlineStartCornerOverlay:i}=this.hot.view._wt.wtOverlays;this.lockedCollection=!0,this.scrollbars.length=0,this.scrollbars.push(t),e.clone&&this.scrollbars.push(e),this.scrollbars.push(n),r&&this.scrollbars.push(r),i&&i.clone&&this.scrollbars.push(i),this.clones=[],t.needFullRender&&this.clones.push(t.clone.wtTable.holder.parentNode),e.needFullRender&&this.clones.push(e.clone.wtTable.holder.parentNode),n.needFullRender&&this.clones.push(n.clone.wtTable.holder.parentNode),r&&this.clones.push(r.clone.wtTable.holder.parentNode),i&&i.clone&&this.clones.push(i.clone.wtTable.holder.parentNode)}function xae(){this.freezeOverlays=!0,I(this.clones,t=>{q(t,"hide-tween")})}function Aae(){this.freezeOverlays=!1,I(this.clones,t=>{pe(t,"hide-tween"),q(t,"show-tween")}),this.hot._registerTimeout(()=>{I(this.clones,t=>{pe(t,"show-tween")})},400),I(this.scrollbars,t=>{t.refresh(),t.resetFixedPosition()}),this.hot.view._wt.wtOverlays.syncScrollWithMaster()}function Hae(t,e){Nae(t,e),e.add(t)}function Nae(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Dae(t,e,n){return(e=kae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function kae(t){var e=Lae(t,"string");return typeof e=="symbol"?e:e+""}function Lae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $ae(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const Wg="trimRows",Fae=330;var YH=new WeakSet;class Vae extends Xe{constructor(){super(...arguments),Hae(this,YH),Dae(this,"trimmedRowsMap",null)}static get PLUGIN_KEY(){return Wg}static get PLUGIN_PRIORITY(){return Fae}isEnabled(){return!!this.hot.getSettings()[Wg]}enablePlugin(){this.enabled||(this.trimmedRowsMap=this.hot.rowIndexMapper.registerMap("trimRows",new Ed),this.trimmedRowsMap.addLocalHook("init",()=>$ae(YH,this,Wae).call(this)),super.enablePlugin())}updatePlugin(){const e=this.hot.getSettings()[Wg];Array.isArray(e)&&this.hot.batchExecution(()=>{this.trimmedRowsMap.clear(),I(e,n=>{this.trimmedRowsMap.setValueAtIndex(n,!0)})},!0),super.updatePlugin()}disablePlugin(){this.hot.rowIndexMapper.unregisterMap("trimRows"),super.disablePlugin()}getTrimmedRows(){return this.trimmedRowsMap.getTrimmedIndexes()}trimRows(e){const n=this.getTrimmedRows(),r=this.isValidConfig(e);let i=n;r&&(i=Array.from(new Set(n.concat(e)))),this.hot.runHooks("beforeTrimRow",n,i,r)!==!1&&(r&&this.hot.batchExecution(()=>{I(e,s=>{this.trimmedRowsMap.setValueAtIndex(s,!0)})},!0),this.hot.runHooks("afterTrimRow",n,i,r,r&&i.length>n.length))}trimRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.trimRows(n)}untrimRows(e){const n=this.getTrimmedRows(),r=this.isValidConfig(e);let i=n;const o=this.trimmedRowsMap.getValues().slice(),s=e.length>0;r&&s&&(I(e,l=>{o[l]=!1}),i=gr(o,(l,u,c)=>(u&&l.push(c),l),[])),this.hot.runHooks("beforeUntrimRow",n,i,r&&s)!==!1&&(r&&s&&this.trimmedRowsMap.setValues(o),this.hot.runHooks("afterUntrimRow",n,i,r&&s,r&&i.length<n.length))}untrimRow(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.untrimRows(n)}isTrimmed(e){return this.trimmedRowsMap.getValueAtIndex(e)||!1}untrimAll(){this.untrimRows(this.getTrimmedRows())}isValidConfig(e){const n=this.hot.countSourceRows();return e.every(r=>Number.isInteger(r)&&r>=0&&r<n)}destroy(){super.destroy()}}function Wae(){const t=this.hot.getSettings()[Wg];Array.isArray(t)&&this.hot.batchExecution(()=>{I(t,e=>{this.trimmedRowsMap.setValueAtIndex(e,!0)})},!0)}function Bae(t,e,n){return(e=jae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jae(t){var e=Uae(t,"string");return typeof e=="symbol"?e:e+""}function Uae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ei{constructor(e){Bae(this,"actionType",""),this.actionType=e}undo(){throw new Error("Not implemented")}redo(){throw new Error("Not implemented")}}function pg(t,e,n){return(e=zae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function zae(t){var e=Yae(t,"string");return typeof e=="symbol"?e:e+""}function Yae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class RT extends ei{constructor(e){let{stateBefore:n,range:r,type:i,alignment:o}=e;super("cell_alignment"),pg(this,"stateBefore",void 0),pg(this,"range",void 0),pg(this,"type",void 0),pg(this,"alignment",void 0),this.stateBefore=n,this.range=r,this.type=i,this.alignment=o}static startRegisteringEvents(e,n){e.addHook("beforeCellAlignment",(r,i,o,s)=>{n.done(()=>new RT({stateBefore:r,range:i,type:o,alignment:s}))})}undo(e,n){I(this.range,r=>{r.forAll((i,o)=>{i>=0&&o>=0&&e.setCellMeta(i,o,"className",this.stateBefore[i][o]||" htLeft")})}),e.addHookOnce("afterViewRender",n),e.render()}redo(e,n){_s(this.range,this.type,this.alignment,(r,i)=>e.getCellMeta(r,i),(r,i,o,s)=>e.setCellMeta(r,i,o,s)),e.addHookOnce("afterViewRender",n),e.render()}}function GH(t,e,n){return(e=Gae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gae(t){var e=qae(t,"string");return typeof e=="symbol"?e:e+""}function qae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ET extends ei{constructor(e){let{columns:n,finalIndex:r}=e;super("col_move"),GH(this,"columns",void 0),GH(this,"finalColumnIndex",void 0),this.columns=n.slice(),this.finalColumnIndex=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnMove",(r,i)=>{r!==!1&&n.done(()=>new ET({columns:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),vT(this.columns,this.finalColumnIndex,e.columnIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),r.moveColumn(a,s)}),e.render(),e.deselectCell(),e.selectColumns(this.columns[0],this.columns[0]+this.columns.length-1)}redo(e,n){const r=e.getPlugin("manualColumnMove");e.addHookOnce("afterViewRender",n),r.moveColumns(this.columns.slice(),this.finalColumnIndex),e.render(),e.deselectCell(),e.selectColumns(this.finalColumnIndex,this.finalColumnIndex+this.columns.length-1)}}function qH(t,e,n){return(e=Kae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kae(t){var e=Xae(t,"string");return typeof e=="symbol"?e:e+""}function Xae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class TT extends ei{constructor(e){let{currentSortState:n,newSortState:r}=e;super("col_sort"),qH(this,"previousSortState",void 0),qH(this,"nextSortState",void 0),this.previousSortState=n,this.nextSortState=r}static startRegisteringEvents(e,n){e.addHook("beforeColumnSort",(r,i,o)=>{o&&n.done(()=>new TT({currentSortState:r,newSortState:i}))})}undo(e,n){const r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting"),o=i.isEnabled()?i:r;this.previousSortState.length?o.sort(this.previousSortState):o.clearSort(),n()}redo(e,n){const r=e.getPlugin("columnSorting"),i=e.getPlugin("multiColumnSorting");(i.isEnabled()?i:r).sort(this.nextSortState),n()}}function KH(t,e,n){return(e=Zae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zae(t){var e=Qae(t,"string");return typeof e=="symbol"?e:e+""}function Qae(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _T extends ei{constructor(e){let{index:n,amount:r}=e;super("insert_col"),KH(this,"index",void 0),KH(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateCol",(r,i,o)=>{n.done(()=>new _T({index:r,amount:i}),o)})}undo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterCreateCol",n),e.alter("insert_col_start",this.index,this.amount,"UndoRedo.redo")}}function XH(t,e,n){return(e=Jae(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Jae(t){var e=ele(t,"string");return typeof e=="symbol"?e:e+""}function ele(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class MT extends ei{constructor(e){let{index:n,amount:r}=e;super("insert_row"),XH(this,"index",void 0),XH(this,"amount",void 0),this.index=n,this.amount=r}static startRegisteringEvents(e,n){e.addHook("afterCreateRow",(r,i,o)=>{n.done(()=>new MT({index:r,amount:i}),o)})}undo(e,n){const r=e.countRows(),i=e.getSettings().minSpareRows;this.index>=r&&this.index-i<r&&(this.index-=i),e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",this.index,this.amount,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterCreateRow",n),e.alter("insert_row_above",this.index,this.amount,"UndoRedo.redo")}}function wg(t,e,n){return(e=tle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function tle(t){var e=nle(t,"string");return typeof e=="symbol"?e:e+""}function nle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class IT extends ei{constructor(e){let{changes:n,selected:r,countCols:i,countRows:o}=e;super("change"),wg(this,"changes",void 0),wg(this,"selected",void 0),wg(this,"countCols",void 0),wg(this,"countRows",void 0),this.changes=n,this.selected=r,this.countCols=i,this.countRows=o}static startRegisteringEvents(e,n){e.addHook("beforeChange",function(r,i){const o=r&&r.length;if(!o||!r.find(l=>{const[,,u,c]=l;return u!==c}))return;const a=()=>{const l=r.reduce((c,h)=>(c.push([...h]),c),[]);l.forEach(c=>{c[1]=e.propToCol(c[1])});const u=o>1?this.getSelected():[[l[0][0],l[0][1]]];return new IT({changes:l,selected:u,countCols:e.countCols(),countRows:e.countRows()})};n.done(a,i)})}undo(e,n){const r=Gn(this.changes);for(let s=0,a=r.length;s<a;s++)r[s].splice(3,1);e.addHookOnce("afterChange",n),e.setDataAtCell(r,null,null,"UndoRedo.undo");const i=e.countRows()-this.countRows;i>0&&e.alter("remove_row",null,i,"UndoRedo.undo");const o=e.countCols()-this.countCols;o>0&&e.isColumnModificationAllowed()&&e.alter("remove_col",null,o,"UndoRedo.undo"),e.scrollToFocusedCell(),e.selectCells(this.selected,!1,!1)}redo(e,n){const r=Gn(this.changes);for(let i=0,o=r.length;i<o;i++)r[i].splice(2,1);e.addHookOnce("afterChange",n),e.setDataAtCell(r,null,null,"UndoRedo.redo"),this.selected&&e.selectCells(this.selected,!1,!1)}}function ZH(t,e,n){return(e=rle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function rle(t){var e=ile(t,"string");return typeof e=="symbol"?e:e+""}function ile(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class PT extends ei{constructor(e){let{conditionsStack:n,previousConditionsStack:r}=e;super("filter"),ZH(this,"conditionsStack",void 0),ZH(this,"previousConditionsStack",void 0),this.conditionsStack=n,this.previousConditionsStack=r}static startRegisteringEvents(e,n){e.addHook("beforeFilter",(r,i)=>{n.done(()=>new PT({conditionsStack:r,previousConditionsStack:i}))})}undo(e,n){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",n),r.importConditions(this.previousConditionsStack),r.filter()}redo(e,n){const r=e.getPlugin("filters");e.addHookOnce("afterViewRender",n),r.importConditions(this.conditionsStack),r.filter()}}function ole(t,e,n){return(e=sle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function sle(t){var e=ale(t,"string");return typeof e=="symbol"?e:e+""}function ale(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class OT extends ei{constructor(e){let{data:n,cellRange:r}=e;super("merge_cells"),ole(this,"cellRange",void 0),this.cellRange=r,this.data=n}static startRegisteringEvents(e,n){e.addHook("beforeMergeCells",(r,i)=>{if(i)return;const o=r.getTopStartCorner(),s=r.getBottomEndCorner(),a=e.getData(o.row,o.col,s.row,s.col);n.done(()=>new OT({data:a,cellRange:r}))})}undo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.unmergeRange(this.cellRange,!0);const i=this.cellRange.getTopStartCorner();e.populateFromArray(i.row,i.col,this.data,void 0,void 0,"MergeCells")}redo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.mergeRange(this.cellRange)}}function k$(t,e,n,r,i){const o=["visualRow","visualCol","row","col","prop"],s=o.length,a=[];return de(r,i,l=>{de(e,n,u=>{const c=t.getCellMeta(u,l);if(Object.keys(c).length!==s){const h=Object.fromEntries(Object.entries(c).filter(d=>{let[f]=d;return o.includes(f)===!1}));a.push([c.visualRow,c.visualCol,h])}})}),a}function xo(t,e,n){return(e=lle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lle(t){var e=ule(t,"string");return typeof e=="symbol"?e:e+""}function ule(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class xT extends ei{constructor(e){let{index:n,indexes:r,data:i,amount:o,headers:s,columnPositions:a,rowPositions:l,fixedColumnsStart:u,removedCellMetas:c}=e;super("remove_col"),xo(this,"index",void 0),xo(this,"indexes",void 0),xo(this,"data",void 0),xo(this,"amount",void 0),xo(this,"headers",void 0),xo(this,"columnPositions",void 0),xo(this,"rowPositions",void 0),xo(this,"fixedColumnsStart",void 0),xo(this,"removedCellMetas",void 0),this.index=n,this.indexes=r,this.data=i,this.amount=o,this.headers=s,this.columnPositions=a.slice(0),this.rowPositions=l.slice(0),this.fixedColumnsStart=u,this.removedCellMetas=c}static startRegisteringEvents(e,n){e.addHook("beforeRemoveCol",(r,i,o,s)=>{const a=()=>{const l=e.getSourceDataArray(),u=(e.countCols()+r)%e.countCols(),c=u+i-1,h=[],d=[],f=[];return de(l.length-1,m=>{const C=[],y=l[m];de(u,c,E=>{C.push(y[e.toPhysicalColumn(E)])}),h.push(C)}),de(i-1,m=>{f.push(e.toPhysicalColumn(u+m))}),Array.isArray(e.getSettings().colHeaders)&&de(i-1,m=>{d.push(e.getSettings().colHeaders[e.toPhysicalColumn(u+m)]||null)}),new xT({index:u,indexes:f,data:h,amount:i,headers:d,columnPositions:e.columnIndexMapper.getIndexesSequence(),rowPositions:e.rowIndexMapper.getIndexesSequence(),fixedColumnsStart:e.getSettings().fixedColumnsStart,removedCellMetas:k$(e,0,e.countRows(),u,c)})};n.done(a,s)})}undo(e,n){const r=e.getSettings();r.fixedColumnsStart=this.fixedColumnsStart;const i=this.indexes.slice(0).sort(),o=(c,h,d)=>d[this.indexes.indexOf(i[h])],s=this.data.length,a=[];for(let c=0;c<s;c++)a.push(Be(this.data[c],o));const l=Be(this.headers,o),u=[];e.columnIndexMapper.setIndexesSequence(this.columnPositions),e.alter("insert_col_start",e.toVisualColumn(this.indexes[0]),this.indexes.length,"UndoRedo.undo"),e.batchExecution(()=>{e.rowIndexMapper.setIndexesSequence(this.rowPositions),e.columnIndexMapper.setIndexesSequence(this.columnPositions)},!0),I(e.getSourceDataArray(),(c,h)=>{I(i,(d,f)=>{c[d]=a[h][f],u.push([h,d,c[d]])})}),typeof this.headers<"u"&&I(l,(c,h)=>{e.getSettings().colHeaders[i[h]]=c}),this.removedCellMetas.forEach(c=>{let[h,d,f]=c;e.setCellMetaObject(h,d,f)}),e.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(u,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveCol",n),e.alter("remove_col",this.index,this.amount,"UndoRedo.redo")}}function lu(t,e,n){return(e=cle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cle(t){var e=hle(t,"string");return typeof e=="symbol"?e:e+""}function hle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class AT extends ei{constructor(e){let{index:n,data:r,fixedRowsBottom:i,fixedRowsTop:o,rowIndexesSequence:s,removedCellMetas:a}=e;super("remove_row"),lu(this,"index",void 0),lu(this,"data",void 0),lu(this,"fixedRowsBottom",void 0),lu(this,"fixedRowsTop",void 0),lu(this,"rowIndexesSequence",void 0),lu(this,"removedCellMetas",void 0),this.index=n,this.data=r,this.fixedRowsBottom=i,this.fixedRowsTop=o,this.rowIndexesSequence=s,this.removedCellMetas=a}static startRegisteringEvents(e,n){e.addHook("beforeRemoveRow",(r,i,o,s)=>{const a=()=>{const l=e.toPhysicalRow(r),u=l+i-1,c=Gn(e.getSourceData(l,0,l+i-1,e.countSourceCols()-1));return new AT({index:l,data:c,fixedRowsBottom:e.getSettings().fixedRowsBottom,fixedRowsTop:e.getSettings().fixedRowsTop,rowIndexesSequence:e.rowIndexMapper.getIndexesSequence(),removedCellMetas:k$(e,l,u,0,e.countCols()-1)})};n.done(a,s)})}undo(e,n){const r=e.getSettings(),i=[];r.fixedRowsBottom=this.fixedRowsBottom,r.fixedRowsTop=this.fixedRowsTop,this.data.forEach((o,s)=>{Object.keys(o).forEach(a=>{const l=parseInt(a,10);i.push([this.index+s,isNaN(l)?a:l,o[a]])})}),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),e.alter("insert_row_above",e.toVisualRow(this.index),this.data.length,"UndoRedo.undo"),e.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence),this.removedCellMetas.forEach(o=>{let[s,a,l]=o;e.setCellMetaObject(s,a,l)}),e.addHookOnce("afterViewRender",n),e.setSourceDataAtCell(i,null,null,"UndoRedo.undo")}redo(e,n){e.addHookOnce("afterRemoveRow",n),e.alter("remove_row",e.toVisualRow(this.index),this.data.length,"UndoRedo.redo")}}function QH(t,e,n){return(e=dle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function dle(t){var e=fle(t,"string");return typeof e=="symbol"?e:e+""}function fle(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class HT extends ei{constructor(e){let{rows:n,finalIndex:r}=e;super("row_move"),QH(this,"rows",void 0),QH(this,"finalRowIndex",void 0),this.rows=n.slice(),this.finalRowIndex=r}static startRegisteringEvents(e,n){e.addHook("beforeRowMove",(r,i)=>{r!==!1&&n.done(()=>new HT({rows:r,finalIndex:i}))})}undo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),vT(this.rows,this.finalRowIndex,e.rowIndexMapper.getNumberOfIndexes()).reverse().forEach(o=>{let{from:s,to:a}=o;s<a&&(a-=1),r.moveRow(a,s)}),e.render(),e.deselectCell(),e.selectRows(this.rows[0],this.rows[0]+this.rows.length-1)}redo(e,n){const r=e.getPlugin("manualRowMove");e.addHookOnce("afterViewRender",n),r.moveRows(this.rows.slice(),this.finalRowIndex),e.render(),e.deselectCell(),e.selectRows(this.finalRowIndex,this.finalRowIndex+this.rows.length-1)}}function gle(t,e,n){return(e=mle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function mle(t){var e=ple(t,"string");return typeof e=="symbol"?e:e+""}function ple(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class NT extends ei{constructor(e){let{cellRange:n}=e;super("unmerge_cells"),gle(this,"cellRange",void 0),this.cellRange=n}static startRegisteringEvents(e,n){e.addHook("afterUnmergeCells",(r,i)=>{i||n.done(()=>new NT({cellRange:r}))})}undo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.mergeRange(this.cellRange,!0)}redo(e,n){const r=e.getPlugin("mergeCells");e.addHookOnce("afterViewRender",n),r.unmergeRange(this.cellRange,!0),e.render()}}function wle(t,e){[RT,ET,TT,_T,MT,IT,PT,OT,xT,AT,HT,NT].forEach(n=>n.startRegisteringEvents(t,e))}function vle(t,e){Cle(t,e),e.add(t)}function Cle(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jb(t,e,n){return(e=yle(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yle(t){var e=ble(t,"string");return typeof e=="symbol"?e:e+""}function ble(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ub(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}const JH="undoRedo",Sle="undoRedo",Rle=1e3;re.getSingleton().register("beforeUndo");re.getSingleton().register("afterUndo");re.getSingleton().register("beforeRedo");re.getSingleton().register("afterRedo");const e1=new Set;var vg=new WeakSet;class Ele extends Xe{static get PLUGIN_KEY(){return Sle}static get PLUGIN_PRIORITY(){return Rle}static get SETTING_KEYS(){return!0}constructor(e){super(e),vle(this,vg),jb(this,"doneActions",[]),jb(this,"undoneActions",[]),jb(this,"ignoreNewActions",!1),wle(e,this)}isEnabled(){return!!this.hot.getSettings().undo}enablePlugin(){var e=this;this.enabled||(this.addHook("afterChange",function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return Ub(vg,e,Tle).call(e,...r)}),this.registerShortcuts(),Ub(vg,this,_le).call(this),super.enablePlugin())}disablePlugin(){super.disablePlugin(),this.clear(),this.unregisterShortcuts(),Ub(vg,this,Mle).call(this)}registerShortcuts(){const n=this.hot.getShortcutManager().getContext("grid"),i={runOnlyIf:o=>!o.altKey,group:JH};n.addShortcuts([{keys:[["Control/Meta","z"]],callback:()=>{this.undo()}},{keys:[["Control/Meta","y"],["Control/Meta","Shift","z"]],callback:()=>{this.redo()}}],i)}unregisterShortcuts(){this.hot.getShortcutManager().getContext("grid").removeShortcutsByGroup(JH)}done(e,n){if(this.ignoreNewActions||n==="UndoRedo.undo"||n==="UndoRedo.redo"||n==="auto")return;const i=this.doneActions.slice();if(this.hot.runHooks("beforeUndoStackChange",i,n)===!1)return;const s=e(),a=this.undoneActions.slice();this.doneActions.push(s),this.hot.runHooks("afterUndoStackChange",i,this.doneActions.slice()),this.hot.runHooks("beforeRedoStackChange",a),this.undoneActions.length=0,this.hot.runHooks("afterRedoStackChange",a,this.undoneActions.slice())}undo(){if(!this.isUndoAvailable())return;const e=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",e);const n=this.doneActions.pop();this.hot.runHooks("afterUndoStackChange",e,this.doneActions.slice());const r=Gn(n);if(this.hot.runHooks("beforeUndo",r)===!1)return;this.ignoreNewActions=!0;const o=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",o),n.undo(this.hot,()=>{this.ignoreNewActions=!1,this.undoneActions.push(n)}),this.hot.runHooks("afterRedoStackChange",o,this.undoneActions.slice()),this.hot.runHooks("afterUndo",r)}redo(){if(!this.isRedoAvailable())return;const e=this.undoneActions.slice();this.hot.runHooks("beforeRedoStackChange",e);const n=this.undoneActions.pop();this.hot.runHooks("afterRedoStackChange",e,this.undoneActions.slice());const r=Gn(n);if(this.hot.runHooks("beforeRedo",r)===!1)return;this.ignoreNewActions=!0;const o=this.doneActions.slice();this.hot.runHooks("beforeUndoStackChange",o),n.redo(this.hot,()=>{this.ignoreNewActions=!1,this.doneActions.push(n)}),this.hot.runHooks("afterUndoStackChange",o,this.doneActions.slice()),this.hot.runHooks("afterRedo",r)}isUndoAvailable(){return this.doneActions.length>0}isRedoAvailable(){return this.undoneActions.length>0}clear(){this.doneActions.length=0,this.undoneActions.length=0}destroy(){this.clear(),this.doneActions=null,this.undoneActions=null,super.destroy()}}function Tle(t,e){e==="loadData"&&this.clear()}function _le(){const t=e=>{e1.has(e)||(Ze(nt`The "${e}" method is deprecated and it will be removed\x20
280
+ from the Core API in the future. Please use the method from the UndoRedo plugin\x20
281
+ (e.g. \`hotInstance.getPlugin("undoRedo").${e}()\`).`),e1.add(e))};this.hot.undo=()=>{t("undo"),this.undo()},this.hot.redo=()=>{t("redo"),this.redo()},this.hot.isUndoAvailable=()=>(t("isUndoAvailable"),this.isUndoAvailable()),this.hot.isRedoAvailable=()=>(t("isRedoAvailable"),this.isRedoAvailable()),this.hot.clearUndo=()=>{t("clear"),this.clear()},this.hot.undoRedo=this}function Mle(){delete this.hot.undo,delete this.hot.redo,delete this.hot.isUndoAvailable,delete this.hot.isRedoAvailable,delete this.hot.clearUndo,delete this.hot.undoRedo}function Ile(){ze(Rh),ze(B8),ze(Eh),ze(C7),ze(M7),ze(iL),ze(S5),ze(sZ),ze(Pp),ze(mQ),ze(WQ),ze(KQ),ze(Ap),ze(xJ),ze(_te),ze(one),ze(Ane),ze(Une),ze(nre),ze(fre),ze(Rre),ze(Wre),ze(Xre),ze(Hie),ze(hoe),ze(poe),ze(Boe),ze(Ise),ze(Zse),ze(sae),ze(yae),ze(Pae),ze(Vae),ze(Ele)}function qle(){d9(),D6(),U6(),c8(),Ile()}export{UE as $,s0 as A,o0 as B,i0 as C,r0 as D,n0 as E,O0 as F,dp as G,t0 as H,e0 as I,JE as J,QE as K,ZE as L,XE as M,ME as N,RE as O,xE as P,OE as Q,t1 as R,DE as S,NE as T,HE as U,AE as V,KE as W,qE as X,GE as Y,YE as Z,zE as _,P0 as a,PE as a0,IE as a1,jE as a2,BE as a3,WE as a4,VE as a5,FE as a6,$E as a7,LE as a8,kE as a9,SE as aa,em as ab,bE as ac,yE as ad,CE as ae,vE as af,wE as ag,pE as ah,mE as ai,gE as aj,_E as ak,TE as al,EE as am,H0 as an,A0 as ao,fE as ap,qle as aq,UD as ar,D4 as as,BD as at,M4 as au,I0 as b,M0 as c,_0 as d,T0 as e,E0 as f,fp as g,R0 as h,S0 as i,b0 as j,tm as k,y0 as l,C0 as m,v0 as n,w0 as o,p0 as p,m0 as q,z$ as r,g0 as s,f0 as t,d0 as u,h0 as v,c0 as w,u0 as x,l0 as y,a0 as z};