@oracle/oraclejet 15.0.4 → 15.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/THIRDPARTYLICENSE.txt +8 -8
- package/dist/css/alta/oj-alta-min.css +1 -1
- package/dist/css/alta/oj-alta-notag-min.css +1 -1
- package/dist/css/alta/oj-alta-notag.css +1 -1
- package/dist/css/alta/oj-alta.css +1 -1
- package/dist/css/alta-android/oj-alta-min.css +1 -1
- package/dist/css/alta-android/oj-alta.css +1 -1
- package/dist/css/alta-ios/oj-alta-min.css +1 -1
- package/dist/css/alta-ios/oj-alta.css +1 -1
- package/dist/css/alta-windows/oj-alta-min.css +1 -1
- package/dist/css/alta-windows/oj-alta.css +1 -1
- package/dist/css/redwood/oj-redwood-min.css +1 -1
- package/dist/css/redwood/oj-redwood-notag-min.css +1 -1
- package/dist/css/redwood/oj-redwood-notag.css +17 -1
- package/dist/css/redwood/oj-redwood.css +17 -1
- package/dist/css/stable/oj-stable-min.css +1 -1
- package/dist/css/stable/oj-stable.css +17 -1
- package/dist/custom-tsc/metadataTransformer.js +2 -2
- package/dist/custom-tsc/metadataTransformer.js.map +1 -1
- package/dist/custom-tsc/utils/MetadataEventUtils.js +22 -8
- package/dist/custom-tsc/utils/MetadataEventUtils.js.map +1 -1
- package/dist/custom-tsc/utils/MetadataPropertyUtils.js +2 -2
- package/dist/custom-tsc/utils/MetadataPropertyUtils.js.map +1 -1
- package/dist/custom-tsc/utils/MetadataTypeUtils.d.ts +1 -1
- package/dist/custom-tsc/utils/MetadataTypeUtils.js +19 -9
- package/dist/custom-tsc/utils/MetadataTypeUtils.js.map +1 -1
- package/dist/custom-tsc/utils/MetadataTypes.d.ts +8 -0
- package/dist/custom-tsc/utils/MetadataTypes.js.map +1 -1
- package/dist/custom-tsc/utils/MetadataUtils.d.ts +1 -1
- package/dist/custom-tsc/utils/MetadataUtils.js +18 -16
- package/dist/custom-tsc/utils/MetadataUtils.js.map +1 -1
- package/dist/icu-l10n/package.json +2 -3
- package/dist/js/libs/oj/debug/ojbundletransform.js +81 -4
- package/dist/js/libs/oj/debug/ojchart-toolkit.js +85 -38
- package/dist/js/libs/oj/debug/ojchart.js +81 -10
- package/dist/js/libs/oj/debug/ojcore-base.js +2 -2
- package/dist/js/libs/oj/debug/ojdatagrid.js +2109 -127
- package/dist/js/libs/oj/debug/ojdataproviderscroller.js +11 -1
- package/dist/js/libs/oj/debug/ojdiagram-toolkit.js +7 -6
- package/dist/js/libs/oj/debug/ojdiagram.js +1 -1
- package/dist/js/libs/oj/debug/ojdrawerpopup.js +11 -1
- package/dist/js/libs/oj/debug/ojdvt-base.js +3 -0
- package/dist/js/libs/oj/debug/ojdvt-timecomponent.js +10 -4
- package/dist/js/libs/oj/debug/ojdvt-treeview.js +6 -1
- package/dist/js/libs/oj/debug/ojgantt-toolkit.js +130 -49
- package/dist/js/libs/oj/debug/ojknockout.js +26 -20
- package/dist/js/libs/oj/debug/ojlegend-toolkit.js +12 -2
- package/dist/js/libs/oj/debug/ojlegend.js +46 -21
- package/dist/js/libs/oj/debug/ojmonitoring.js +36 -0
- package/dist/js/libs/oj/debug/ojnavigationlist.js +1 -0
- package/dist/js/libs/oj/debug/ojrestdataprovider.js +10 -4
- package/dist/js/libs/oj/debug/ojtable.js +75 -52
- package/dist/js/libs/oj/debug/ojtagcloud.js +57 -0
- package/dist/js/libs/oj/debug/ojtimeline-toolkit.js +4 -0
- package/dist/js/libs/oj/debug/ojtoolbar.js +26 -23
- package/dist/js/libs/oj/debug/ojtreeview.js +1 -3
- package/dist/js/libs/oj/debug/ojvcomponent-template.js +8 -7
- package/dist/js/libs/oj/debug_esm/ojbundletransform.js +81 -4
- package/dist/js/libs/oj/debug_esm/ojchart-toolkit.js +85 -38
- package/dist/js/libs/oj/debug_esm/ojchart.js +81 -10
- package/dist/js/libs/oj/debug_esm/ojcore-base.js +2 -2
- package/dist/js/libs/oj/debug_esm/ojdatagrid.js +2109 -127
- package/dist/js/libs/oj/debug_esm/ojdataproviderscroller.js +11 -1
- package/dist/js/libs/oj/debug_esm/ojdiagram-toolkit.js +7 -6
- package/dist/js/libs/oj/debug_esm/ojdiagram.js +1 -1
- package/dist/js/libs/oj/debug_esm/ojdrawerpopup.js +11 -1
- package/dist/js/libs/oj/debug_esm/ojdvt-base.js +3 -0
- package/dist/js/libs/oj/debug_esm/ojdvt-timecomponent.js +10 -4
- package/dist/js/libs/oj/debug_esm/ojdvt-treeview.js +6 -1
- package/dist/js/libs/oj/debug_esm/ojgantt-toolkit.js +130 -49
- package/dist/js/libs/oj/debug_esm/ojknockout.js +26 -19
- package/dist/js/libs/oj/debug_esm/ojlegend-toolkit.js +12 -2
- package/dist/js/libs/oj/debug_esm/ojlegend.js +46 -21
- package/dist/js/libs/oj/debug_esm/ojmonitoring.js +28 -0
- package/dist/js/libs/oj/debug_esm/ojnavigationlist.js +1 -0
- package/dist/js/libs/oj/debug_esm/ojrestdataprovider.js +10 -4
- package/dist/js/libs/oj/debug_esm/ojtable.js +75 -52
- package/dist/js/libs/oj/debug_esm/ojtagcloud.js +57 -0
- package/dist/js/libs/oj/debug_esm/ojtimeline-toolkit.js +4 -0
- package/dist/js/libs/oj/debug_esm/ojtoolbar.js +26 -23
- package/dist/js/libs/oj/debug_esm/ojtreeview.js +1 -3
- package/dist/js/libs/oj/debug_esm/ojvcomponent-template.js +8 -6
- package/dist/js/libs/oj/main-template.js +3 -3
- package/dist/js/libs/oj/min/ojbundletransform.js +1 -1
- package/dist/js/libs/oj/min/ojbundletransform.js.map +1 -1
- package/dist/js/libs/oj/min/ojchart-toolkit.js +1 -1
- package/dist/js/libs/oj/min/ojchart-toolkit.js.map +1 -1
- package/dist/js/libs/oj/min/ojchart.js +1 -1
- package/dist/js/libs/oj/min/ojchart.js.map +1 -1
- package/dist/js/libs/oj/min/ojcore-base.js +1 -1
- package/dist/js/libs/oj/min/ojdatagrid.js +1 -1
- package/dist/js/libs/oj/min/ojdatagrid.js.map +1 -1
- package/dist/js/libs/oj/min/ojdataproviderscroller.js +1 -1
- package/dist/js/libs/oj/min/ojdataproviderscroller.js.map +1 -1
- package/dist/js/libs/oj/min/ojdiagram-toolkit.js +1 -1
- package/dist/js/libs/oj/min/ojdiagram-toolkit.js.map +1 -1
- package/dist/js/libs/oj/min/ojdrawerpopup.js +1 -1
- package/dist/js/libs/oj/min/ojdrawerpopup.js.map +1 -1
- package/dist/js/libs/oj/min/ojdvt-base.js +1 -1
- package/dist/js/libs/oj/min/ojdvt-base.js.map +1 -1
- package/dist/js/libs/oj/min/ojdvt-timecomponent.js +1 -1
- package/dist/js/libs/oj/min/ojdvt-timecomponent.js.map +1 -1
- package/dist/js/libs/oj/min/ojdvt-treeview.js +1 -1
- package/dist/js/libs/oj/min/ojdvt-treeview.js.map +1 -1
- package/dist/js/libs/oj/min/ojgantt-toolkit.js +1 -1
- package/dist/js/libs/oj/min/ojgantt-toolkit.js.map +1 -1
- package/dist/js/libs/oj/min/ojknockout.js +2 -2
- package/dist/js/libs/oj/min/ojknockout.js.map +1 -1
- package/dist/js/libs/oj/min/ojlegend-toolkit.js +1 -1
- package/dist/js/libs/oj/min/ojlegend-toolkit.js.map +1 -1
- package/dist/js/libs/oj/min/ojlegend.js +1 -1
- package/dist/js/libs/oj/min/ojlegend.js.map +1 -1
- package/dist/js/libs/oj/min/ojmonitoring.js +9 -0
- package/dist/js/libs/oj/min/ojmonitoring.js.map +1 -0
- package/dist/js/libs/oj/min/ojnavigationlist.js.map +1 -1
- package/dist/js/libs/oj/min/ojrestdataprovider.js +1 -1
- package/dist/js/libs/oj/min/ojrestdataprovider.js.map +1 -1
- package/dist/js/libs/oj/min/ojtable.js +1 -1
- package/dist/js/libs/oj/min/ojtable.js.map +1 -1
- package/dist/js/libs/oj/min/ojtagcloud.js.map +1 -1
- package/dist/js/libs/oj/min/ojtimeline-toolkit.js +1 -1
- package/dist/js/libs/oj/min/ojtimeline-toolkit.js.map +1 -1
- package/dist/js/libs/oj/min/ojtoolbar.js +1 -1
- package/dist/js/libs/oj/min/ojtoolbar.js.map +1 -1
- package/dist/js/libs/oj/min/ojtreeview.js +1 -1
- package/dist/js/libs/oj/min/ojtreeview.js.map +1 -1
- package/dist/js/libs/oj/min/ojvcomponent-template.js +1 -1
- package/dist/js/libs/oj/min/ojvcomponent-template.js.map +1 -1
- package/dist/js/libs/oj/resources/nls/ar/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/ar-XB/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/bg/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/bs/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/bs-Cyrl/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/cs/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/da/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/de/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/el/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/en-XA/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/en-XC/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/es/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/et/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/fi/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/fr/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/fr-CA/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/he/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/hr/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/hu/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/is/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/it/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/ja/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/ko/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/lt/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/lv/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/ms/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/nl/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/no/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/pl/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/pseudo/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/pt/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/pt-PT/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/ro/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/ru/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/sk/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/sl/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/sr/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/sr-Latn/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/sv/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/th/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/tr/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/uk/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/vi/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/zh-Hans/ojtranslations.js +1 -1
- package/dist/js/libs/oj/resources/nls/zh-Hant/ojtranslations.js +1 -1
- package/dist/metadata/components/allComponents.json +1142 -931
- package/dist/package-backup.json +3 -3
- package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/data-grid/themes/base/_oj-data-grid.scss +23 -0
- package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/helpers/themes/base/_oj-helpers.scss +1 -1
- package/dist/scss/common/helpers/_oj.common.helpers.scss +1 -1
- package/dist/types/ojchart/index.d.ts +12 -0
- package/dist/types/ojdatagrid/index.d.ts +15 -0
- package/dist/types/ojlegend/index.d.ts +16 -0
- package/dist/webpack-tools/4.x/webpack.config.js +3 -3
- package/dist/webpack-tools/webpack.config.js +3 -3
- package/package.json +4 -4
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/accordion/themes/base/_oj-accordion.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/accordion/themes/redwood/_oj-accordion.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/accordion/themes/redwood/oj-accordion.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/accordion/themes/stable/_oj-accordion.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/accordion/themes/stable/oj-accordion.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/action-card/themes/base/_oj-action-card.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/action-card/themes/redwood/_oj-action-card.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/action-card/themes/redwood/oj-action-card.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/action-card/themes/stable/_oj-action-card.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/action-card/themes/stable/oj-action-card.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/base/_oj.common.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/base/oj.common.settings.cssvariables.css +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/redwood/_oj-all-components-common.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/redwood/_oj-all-components-notag.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/redwood/_oj-all-components.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/redwood/_oj.redwood.settings.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/redwood/oj.redwood.cssvars.settings.css +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/stable/_oj-all-components-common.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/stable/_oj-all-components-notag.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/stable/_oj-all-components.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/stable/_oj.stable.settings.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/all-components/themes/stable/oj.stable.cssvars.settings.css +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/animation/themes/base/_oj-animation.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/animation/themes/redwood/_oj-animation.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/animation/themes/redwood/_oj-animation.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/animation/themes/redwood/oj-animation.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/animation/themes/stable/_oj-animation.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/animation/themes/stable/_oj-animation.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/animation/themes/stable/oj-animation.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout/themes/base/_oj-app-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout/themes/redwood/_oj-app-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout/themes/redwood/_oj-app-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout/themes/stable/_oj-app-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout/themes/stable/_oj-app-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout-hybrid/themes/base/_oj-app-layout-hybrid-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout-hybrid/themes/base/_oj-app-layout-hybrid.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout-hybrid/themes/redwood/_oj-app-layout-hybrid.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout-hybrid/themes/redwood/oj-app-layout-hybrid.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout-hybrid/themes/stable/_oj-app-layout-hybrid.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout-hybrid/themes/stable/oj-app-layout-hybrid.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout-web/themes/base/_oj-app-layout-web.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout-web/themes/redwood/_oj-app-layout-web.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout-web/themes/redwood/oj-app-layout-web.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout-web/themes/stable/_oj-app-layout-web.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/app-layout-web/themes/stable/oj-app-layout-web.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/avatar/themes/base/_oj-avatar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/avatar/themes/redwood/_oj-avatar-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/avatar/themes/redwood/_oj-avatar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/avatar/themes/redwood/_oj-avatar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/avatar/themes/redwood/oj-avatar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/avatar/themes/stable/_oj-avatar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/avatar/themes/stable/_oj-avatar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/avatar/themes/stable/oj-avatar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/badge/themes/base/_oj-badge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/badge/themes/redwood/_oj-badge-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/badge/themes/redwood/_oj-badge-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/badge/themes/redwood/_oj-badge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/badge/themes/redwood/oj-badge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/badge/themes/stable/_oj-badge-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/badge/themes/stable/_oj-badge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/badge/themes/stable/oj-badge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/button/themes/base/_oj-button.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/button/themes/redwood/_oj-button-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/button/themes/redwood/_oj-button-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/button/themes/redwood/_oj-button.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/button/themes/redwood/oj-button.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/button/themes/stable/_oj-button-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/button/themes/stable/_oj-button-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/button/themes/stable/_oj-button.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/button/themes/stable/oj-button.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/buttonset/themes/base/_oj-buttonset.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/buttonset/themes/redwood/_oj-buttonset-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/buttonset/themes/redwood/_oj-buttonset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/buttonset/themes/redwood/_oj-buttonset.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/buttonset/themes/stable/_oj-buttonset-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/buttonset/themes/stable/_oj-buttonset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/buttonset/themes/stable/_oj-buttonset.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/buttonset-many/themes/redwood/oj-buttonset-many.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/buttonset-many/themes/stable/oj-buttonset-many.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/buttonset-one/themes/redwood/oj-buttonset-one.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/buttonset-one/themes/stable/oj-buttonset-one.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/chart/themes/base/_oj-chart.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/chart/themes/redwood/_oj-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/chart/themes/redwood/oj-chart.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/chart/themes/stable/_oj-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/chart/themes/stable/oj-chart.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/checkboxset/themes/redwood/_oj-checkboxset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/checkboxset/themes/redwood/oj-checkboxset.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/checkboxset/themes/stable/_oj-checkboxset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/checkboxset/themes/stable/oj-checkboxset.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/collapsible/themes/base/_oj-collapsible.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/collapsible/themes/redwood/_oj-collapsible.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/collapsible/themes/redwood/oj-collapsible.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/collapsible/themes/stable/_oj-collapsible.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/collapsible/themes/stable/oj-collapsible.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/collection/themes/redwood/_oj-collection-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/collection/themes/redwood/_oj-collection-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/collection/themes/redwood/_oj-collection.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/collection/themes/stable/_oj-collection.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/color-palette/themes/base/_oj-color-palette.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/color-palette/themes/redwood/_oj-color-palette.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/color-palette/themes/redwood/oj-color-palette.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/color-palette/themes/stable/_oj-color-palette.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/color-palette/themes/stable/oj-color-palette.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/color-spectrum/themes/base/_oj-color-spectrum.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/color-spectrum/themes/redwood/_oj-color-spectrum.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/color-spectrum/themes/redwood/oj-color-spectrum.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/color-spectrum/themes/stable/_oj-color-spectrum.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/color-spectrum/themes/stable/oj-color-spectrum.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/combobox/themes/base/_oj-combobox.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/combobox/themes/redwood/_oj-combobox.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/combobox/themes/redwood/_oj-combobox.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/combobox/themes/stable/_oj-combobox.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/combobox/themes/stable/_oj-combobox.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/combobox-many/themes/redwood/oj-combobox-many.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/combobox-many/themes/stable/oj-combobox-many.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/combobox-one/themes/redwood/oj-combobox-one.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/combobox-one/themes/stable/oj-combobox-one.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/conveyor-belt/themes/base/_oj-conveyor-belt.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/conveyor-belt/themes/redwood/_oj-conveyor-belt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/conveyor-belt/themes/redwood/oj-conveyor-belt.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/conveyor-belt/themes/stable/_oj-conveyor-belt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/conveyor-belt/themes/stable/oj-conveyor-belt.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/core/themes/redwood/_oj-core-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/core/themes/redwood/_oj-core-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/core/themes/redwood/_oj-core.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/core/themes/stable/_oj-core-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/core/themes/stable/_oj-core-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/core/themes/stable/_oj-core.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/data-grid/themes/redwood/_oj-data-grid-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/data-grid/themes/redwood/_oj-data-grid.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/data-grid/themes/redwood/oj-data-grid.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/data-grid/themes/stable/_oj-data-grid-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/data-grid/themes/stable/_oj-data-grid.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/data-grid/themes/stable/oj-data-grid.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/date-picker/themes/redwood/oj-date-picker.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/date-picker/themes/stable/oj-date-picker.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/date-time-picker/themes/base/_oj-date-time-picker.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/date-time-picker/themes/redwood/_oj-date-time-picker.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/date-time-picker/themes/redwood/_oj-date-time-picker.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/date-time-picker/themes/redwood/oj-date-time-picker.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/date-time-picker/themes/stable/_oj-date-time-picker.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/date-time-picker/themes/stable/_oj-date-time-picker.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/date-time-picker/themes/stable/oj-date-time-picker.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/diagram/themes/base/_oj-diagram.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/diagram/themes/redwood/_oj-diagram.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/diagram/themes/redwood/oj-diagram.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/diagram/themes/stable/_oj-diagram.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/diagram/themes/stable/oj-diagram.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dialog/themes/base/_oj-dialog-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dialog/themes/base/_oj-dialog.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dialog/themes/redwood/_oj-dialog-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dialog/themes/redwood/_oj-dialog-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dialog/themes/redwood/_oj-dialog.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dialog/themes/redwood/_oj-dialog.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dialog/themes/redwood/oj-dialog.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dialog/themes/stable/_oj-dialog-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dialog/themes/stable/_oj-dialog.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dialog/themes/stable/_oj-dialog.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dialog/themes/stable/oj-dialog.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-layout/themes/base/_oj-drawer-layout-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-layout/themes/base/_oj-drawer-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-layout/themes/redwood/_oj-drawer-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-layout/themes/redwood/oj-drawer-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-layout/themes/stable/_oj-drawer-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-layout/themes/stable/oj-drawer-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-popup/themes/base/_oj-drawer-popup-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-popup/themes/base/_oj-drawer-popup.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-popup/themes/redwood/_oj-drawer-popup.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-popup/themes/redwood/oj-drawer-popup.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-popup/themes/stable/_oj-drawer-popup.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/drawer-popup/themes/stable/oj-drawer-popup.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dvt/themes/base/_oj-dvt.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dvt/themes/redwood/_oj-dvt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dvt/themes/redwood/_oj-dvt.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dvt/themes/stable/_oj-dvt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/dvt/themes/stable/_oj-dvt.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/file-picker/themes/base/_oj-file-picker.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/file-picker/themes/redwood/_oj-file-picker.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/file-picker/themes/redwood/oj-file-picker.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/file-picker/themes/stable/_oj-file-picker.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/file-picker/themes/stable/oj-file-picker.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/film-strip/themes/base/_oj-film-strip.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/film-strip/themes/redwood/_oj-film-strip.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/film-strip/themes/redwood/oj-film-strip.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/film-strip/themes/stable/_oj-film-strip.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/film-strip/themes/stable/oj-film-strip.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/flex/themes/base/_oj-flex.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/flex/themes/redwood/oj-flex.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/flex/themes/stable/oj-flex.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-control/themes/base/_oj-form-control.mixins.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-control/themes/base/_oj-form-control.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-control/themes/base/_oj-messaging.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-control/themes/redwood/_oj-form-control.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-control/themes/redwood/_oj-form-control.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-control/themes/redwood/_oj-messaging.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-control/themes/redwood/_oj-messaging.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-control/themes/stable/_oj-form-control.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-control/themes/stable/_oj-form-control.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-control/themes/stable/_oj-messaging.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-control/themes/stable/_oj-messaging.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-layout/themes/base/_oj-form-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-layout/themes/redwood/_oj-form-layout-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-layout/themes/redwood/_oj-form-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-layout/themes/redwood/_oj-form-layout.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-layout/themes/redwood/oj-form-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-layout/themes/stable/_oj-form-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-layout/themes/stable/_oj-form-layout.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/form-layout/themes/stable/oj-form-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/gantt/themes/base/_oj-gantt.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/gantt/themes/redwood/_oj-gantt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/gantt/themes/redwood/oj-gantt.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/gantt/themes/stable/_oj-gantt.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/gantt/themes/stable/oj-gantt.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/gauge/themes/base/_oj-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/gauge/themes/redwood/_oj-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/gauge/themes/redwood/oj-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/gauge/themes/stable/_oj-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/gauge/themes/stable/oj-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/grid/themes/base/_oj-grid.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/grid/themes/redwood/oj-grid.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/grid/themes/stable/oj-grid.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/helpers/themes/base/_oj-helpers-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/helpers/themes/base/_oj-responsive-helpers.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/helpers/themes/redwood/_oj-theme.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/helpers/themes/redwood/oj-helpers.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/helpers/themes/redwood/oj-responsive.helpers.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/helpers/themes/stable/_oj-theme.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/helpers/themes/stable/oj-helpers.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/helpers/themes/stable/oj-responsive.helpers.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/highlight-text/themes/base/_oj-highlight-text.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/highlight-text/themes/redwood/oj-highlight-text.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/highlight-text/themes/stable/oj-highlight-text.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icon-circle/themes/base/_oj-icon-circle.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icon-circle/themes/redwood/_oj-icon-circle-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icon-circle/themes/redwood/_oj-icon-circle.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icon-circle/themes/redwood/oj-icon-circle.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icons/themes/base/_oj-icons.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icons/themes/redwood/_oj-icon-font.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icons/themes/redwood/_oj-icons-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icons/themes/redwood/_oj-icons.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icons/themes/redwood/oj-icons.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icons/themes/stable/_oj-icon-font.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icons/themes/stable/_oj-icons-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icons/themes/stable/_oj-icons.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/icons/themes/stable/oj-icons.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/indexer/themes/base/_oj-indexer.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/indexer/themes/redwood/_oj-indexer.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/indexer/themes/redwood/oj-indexer.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/indexer/themes/stable/_oj-indexer.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/indexer/themes/stable/oj-indexer.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-date/themes/redwood/oj-input-date.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-date/themes/stable/oj-input-date.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-date-time/themes/redwood/oj-input-date-time.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-date-time/themes/stable/oj-input-date-time.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-number/themes/base/_oj-input-number.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-number/themes/redwood/_oj-input-number.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-number/themes/redwood/oj-input-number.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-number/themes/stable/_oj-input-number.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-number/themes/stable/oj-input-number.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-password/themes/redwood/oj-input-password.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-password/themes/stable/oj-input-password.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-search/themes/base/_oj-input-search.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-search/themes/redwood/_oj-input-search-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-search/themes/redwood/_oj-input-search.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-search/themes/redwood/_oj-input-search.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-search/themes/stable/_oj-input-search-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-search/themes/stable/_oj-input-search.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-search/themes/stable/_oj-input-search.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-text/themes/base/_oj-input-text.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-text/themes/redwood/_oj-input-text.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-text/themes/redwood/oj-input-text.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-text/themes/stable/_oj-input-text.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-text/themes/stable/oj-input-text.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-time/themes/redwood/oj-input-time.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/input-time/themes/stable/oj-input-time.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/label/themes/base/_oj-label.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/label/themes/redwood/_oj-label-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/label/themes/redwood/_oj-label.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/label/themes/redwood/oj-label.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/label/themes/stable/_oj-label-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/label/themes/stable/_oj-label.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/label/themes/stable/oj-label.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/label-value/themes/base/_oj-label-value.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/label-value/themes/redwood/_oj-label-value.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/label-value/themes/stable/_oj-label-value.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/led-gauge/themes/base/_oj-led-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/led-gauge/themes/redwood/_oj-led-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/led-gauge/themes/redwood/oj-led-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/led-gauge/themes/stable/_oj-led-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/led-gauge/themes/stable/oj-led-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/legend/themes/base/_oj-legend.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/legend/themes/redwood/_oj-legend.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/legend/themes/redwood/oj-legend.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/legend/themes/stable/_oj-legend.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/legend/themes/stable/oj-legend.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-box/themes/base/_oj-list-box.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-box/themes/redwood/_oj-list-box.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-box/themes/redwood/_oj-list-box.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-box/themes/stable/_oj-list-box.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-box/themes/stable/_oj-list-box.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-item-layout/themes/base/_oj-list-item-layout.scoped.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-item-layout/themes/base/_oj-list-item-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-item-layout/themes/redwood/_oj-list-item-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-item-layout/themes/redwood/oj-list-item-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-item-layout/themes/stable/_oj-list-item-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-item-layout/themes/stable/oj-list-item-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-view/themes/base/_oj-list-view.scoped.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-view/themes/base/_oj-list-view.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-view/themes/redwood/_oj-list-view-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-view/themes/redwood/_oj-list-view.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-view/themes/redwood/oj-list-view.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-view/themes/stable/_oj-list-view.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/list-view/themes/stable/oj-list-view.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/masonry-layout/themes/base/_oj-masonry-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/masonry-layout/themes/redwood/_oj-masonry-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/masonry-layout/themes/redwood/_oj-masonry-layout.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/masonry-layout/themes/redwood/oj-masonry-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/masonry-layout/themes/stable/_oj-masonry-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/masonry-layout/themes/stable/_oj-masonry-layout.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/masonry-layout/themes/stable/oj-masonry-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu/themes/base/_oj-menu.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu/themes/redwood/_oj-menu.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu/themes/redwood/oj-menu.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu/themes/stable/_oj-menu.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu/themes/stable/oj-menu.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-button/themes/base/_oj-menu-button.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-button/themes/redwood/_oj-menu-button.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-button/themes/redwood/_oj-menu-button.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-button/themes/redwood/oj-menu-button.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-button/themes/stable/_oj-menu-button.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-button/themes/stable/_oj-menu-button.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-button/themes/stable/oj-menu-button.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-select-many/themes/base/_oj-menu-select-many.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-select-many/themes/redwood/_oj-menu-select-many.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-select-many/themes/redwood/oj-menu-select-many.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-select-many/themes/stable/_oj-menu-select-many.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/menu-select-many/themes/stable/oj-menu-select-many.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message/themes/base/_oj-message.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message/themes/redwood/_oj-message-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message/themes/redwood/_oj-message.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message/themes/redwood/_oj-message.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message/themes/redwood/oj-message.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message/themes/stable/_oj-message-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message/themes/stable/_oj-message.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message/themes/stable/_oj-message.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message/themes/stable/oj-message.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message-banner/themes/base/_oj-message-banner.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message-banner/themes/redwood/_oj-message-banner-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message-banner/themes/redwood/_oj-message-banner.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message-banner/themes/redwood/_oj-message-banner.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message-banner/themes/stable/_oj-message-banner-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message-banner/themes/stable/_oj-message-banner.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/message-banner/themes/stable/_oj-message-banner.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/messages/themes/base/_oj-messages.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/messages/themes/redwood/_oj-messages.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/messages/themes/redwood/_oj-messages.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/messages/themes/redwood/oj-messages.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/messages/themes/stable/_oj-messages.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/messages/themes/stable/_oj-messages.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/messages/themes/stable/oj-messages.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/module/themes/base/_oj-module.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/module/themes/redwood/oj-module.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/module/themes/stable/oj-module.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/n-box/themes/base/_oj-n-box.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/n-box/themes/redwood/_oj-n-box.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/n-box/themes/redwood/oj-n-box.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/n-box/themes/stable/_oj-n-box.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/n-box/themes/stable/oj-n-box.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/navigation-list/themes/base/_oj-navigation-list.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/navigation-list/themes/redwood/_oj-navigation-list-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/navigation-list/themes/redwood/_oj-navigation-list.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/navigation-list/themes/redwood/oj-navigation-list.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/navigation-list/themes/stable/_oj-navigation-list-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/navigation-list/themes/stable/_oj-navigation-list.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/navigation-list/themes/stable/oj-navigation-list.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/off-canvas/themes/base/_oj-off-canvas.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/off-canvas/themes/redwood/_oj-off-canvas.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/off-canvas/themes/redwood/oj-off-canvas.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/off-canvas/themes/stable/_oj-off-canvas.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/off-canvas/themes/stable/oj-off-canvas.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/optgroup/themes/base/_oj-optgroup.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/optgroup/themes/redwood/oj-optgroup.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/optgroup/themes/stable/oj-optgroup.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/option/themes/base/_oj-option.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/option/themes/redwood/oj-option.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/option/themes/stable/oj-option.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/paging-control/themes/base/_oj-paging-control.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/paging-control/themes/redwood/_oj-paging-control.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/paging-control/themes/redwood/oj-paging-control.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/paging-control/themes/stable/_oj-paging-control.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/paging-control/themes/stable/oj-paging-control.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/palette/themes/redwood/_oj-palette-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/palette/themes/redwood/_oj-palette.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/palette/themes/stable/_oj-palette.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/panel/themes/base/_oj-panel-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/panel/themes/base/_oj-panel.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/panel/themes/redwood/_oj-panel-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/panel/themes/redwood/_oj-panel.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/panel/themes/redwood/oj-panel.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/panel/themes/stable/_oj-panel-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/panel/themes/stable/_oj-panel.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/panel/themes/stable/oj-panel.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/picto-chart/themes/base/_oj-picto-chart.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/picto-chart/themes/redwood/_oj-picto-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/picto-chart/themes/redwood/oj-picto-chart.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/picto-chart/themes/stable/_oj-picto-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/picto-chart/themes/stable/oj-picto-chart.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/popup/themes/base/_oj-layer.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/popup/themes/base/_oj-popup-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/popup/themes/base/_oj-popup.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/popup/themes/redwood/_oj-layer.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/popup/themes/redwood/_oj-popup-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/popup/themes/redwood/_oj-popup.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/popup/themes/redwood/oj-popup.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/popup/themes/stable/_oj-layer.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/popup/themes/stable/_oj-popup.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/popup/themes/stable/oj-popup.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-bar/themes/base/_oj-progress-bar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-bar/themes/redwood/_oj-progress-bar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-bar/themes/redwood/_oj-progress-bar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-bar/themes/redwood/oj-progress-bar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-bar/themes/stable/_oj-progress-bar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-bar/themes/stable/_oj-progress-bar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-bar/themes/stable/oj-progress-bar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-circle/themes/base/_oj-progress-circle.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-circle/themes/redwood/_oj-progress-circle-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-circle/themes/redwood/_oj-progress-circle.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-circle/themes/redwood/oj-progress-circle.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-circle/themes/stable/_oj-progress-circle-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-circle/themes/stable/_oj-progress-circle.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/progress-circle/themes/stable/oj-progress-circle.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/radio-checkbox/themes/base/_oj-radiocheckbox.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/radio-checkbox/themes/redwood/_oj-radiocheckbox.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/radio-checkbox/themes/stable/_oj-radiocheckbox.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/radioset/themes/redwood/_oj-radioset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/radioset/themes/redwood/oj-radioset.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/radioset/themes/stable/_oj-radioset.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/radioset/themes/stable/oj-radioset.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/rangeslider/themes/redwood/_oj-rangeslider.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/rangeslider/themes/redwood/oj-rangeslider.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/rangeslider/themes/stable/_oj-rangeslider.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/rangeslider/themes/stable/oj-rangeslider.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/rating-gauge/themes/base/_oj-rating-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/rating-gauge/themes/redwood/_oj-rating-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/rating-gauge/themes/redwood/oj-rating-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/rating-gauge/themes/stable/_oj-rating-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/rating-gauge/themes/stable/oj-rating-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/refresher/themes/base/_oj-refresher.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/refresher/themes/redwood/_oj-refresher.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/refresher/themes/redwood/_oj-refresher.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/refresher/themes/redwood/oj-refresher.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/refresher/themes/stable/_oj-refresher.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/refresher/themes/stable/_oj-refresher.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/refresher/themes/stable/oj-refresher.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/resizable/themes/base/_oj-resizable.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/resizable/themes/redwood/_oj-resizable.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/resizable/themes/stable/_oj-resizable.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/row-expander/themes/base/_oj-row-expander.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/row-expander/themes/redwood/_oj-row-expander.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/row-expander/themes/redwood/oj-row-expander.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/row-expander/themes/stable/_oj-row-expander.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/row-expander/themes/stable/oj-row-expander.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/scrollbar/themes/base/_oj-scrollbar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/scrollbar/themes/redwood/_oj-scrollbar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/scrollbar/themes/redwood/_oj-scrollbar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/scrollbar/themes/redwood/_oj-scrollbar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/scrollbar/themes/stable/_oj-scrollbar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/scrollbar/themes/stable/_oj-scrollbar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/scrollbar/themes/stable/_oj-scrollbar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select/themes/base/_oj-select.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select/themes/redwood/_oj-select.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select/themes/redwood/_oj-select.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select/themes/stable/_oj-select.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select/themes/stable/_oj-select.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select-many/themes/redwood/oj-select-many.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select-many/themes/stable/oj-select-many.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select-one/themes/redwood/oj-select-one.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select-original/themes/base/_oj-select-original.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select-original/themes/redwood/_oj-select-original.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select-original/themes/redwood/_oj-select-original.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select-original/themes/stable/_oj-select-original.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select-original/themes/stable/_oj-select-original.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select-single/themes/base/_oj-select-single.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select-single/themes/redwood/oj-select-single.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/select-single/themes/stable/oj-select-single.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/selector/themes/base/_oj-selector.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/selector/themes/redwood/_oj-selector.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/selector/themes/redwood/oj-selector.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/selector/themes/stable/_oj-selector.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/selector/themes/stable/oj-selector.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/slider/themes/base/_oj-slider.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/slider/themes/redwood/_oj-slider.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/slider/themes/redwood/oj-slider.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/slider/themes/stable/_oj-slider.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/slider/themes/stable/oj-slider.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/spark-chart/themes/base/_oj-spark-chart.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/spark-chart/themes/redwood/_oj-spark-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/spark-chart/themes/redwood/oj-spark-chart.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/spark-chart/themes/stable/_oj-spark-chart.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/spark-chart/themes/stable/oj-spark-chart.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/status-meter-gauge/themes/base/_oj-status-meter-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/status-meter-gauge/themes/redwood/_oj-status-meter-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/status-meter-gauge/themes/redwood/oj-status-meter-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/status-meter-gauge/themes/stable/_oj-status-meter-gauge.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/status-meter-gauge/themes/stable/oj-status-meter-gauge.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/stream-list/themes/base/_oj-stream-list.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/stream-list/themes/redwood/_oj-stream-list.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/stream-list/themes/redwood/_oj-stream-list.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/stream-list/themes/redwood/oj-stream-list.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/stream-list/themes/stable/_oj-stream-list.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/stream-list/themes/stable/_oj-stream-list.servervars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/stream-list/themes/stable/oj-stream-list.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/sunburst/themes/base/_oj-sunburst.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/sunburst/themes/redwood/_oj-sunburst.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/sunburst/themes/redwood/oj-sunburst.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/sunburst/themes/stable/_oj-sunburst.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/sunburst/themes/stable/oj-sunburst.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/swipe-actions/themes/base/_oj-swipe-actions.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/swipe-actions/themes/redwood/_oj-swipe-actions.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/swipe-actions/themes/redwood/oj-swipe-actions.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/swipe-actions/themes/stable/_oj-swipe-actions.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/swipe-actions/themes/stable/oj-swipe-actions.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/switch/themes/base/_oj-switch.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/switch/themes/redwood/_oj-switch.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/switch/themes/redwood/oj-switch.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/switch/themes/stable/_oj-switch.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/switch/themes/stable/oj-switch.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/switcher/themes/base/_oj-switcher.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/switcher/themes/redwood/oj-switcher.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/switcher/themes/stable/oj-switcher.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tab-bar/themes/base/_oj-tab-bar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tab-bar/themes/redwood/_oj-tab-bar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tab-bar/themes/redwood/_oj-tab-bar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tab-bar/themes/redwood/oj-tab-bar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tab-bar/themes/stable/_oj-tab-bar-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tab-bar/themes/stable/_oj-tab-bar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tab-bar/themes/stable/oj-tab-bar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/table/themes/base/_oj-table.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/table/themes/redwood/_oj-table-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/table/themes/redwood/_oj-table.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/table/themes/redwood/oj-table.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/table/themes/stable/_oj-table-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/table/themes/stable/_oj-table.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/table/themes/stable/oj-table.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tag-cloud/themes/base/_oj-tag-cloud.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tag-cloud/themes/redwood/_oj-tag-cloud.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tag-cloud/themes/redwood/oj-tag-cloud.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tag-cloud/themes/stable/_oj-tag-cloud.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tag-cloud/themes/stable/oj-tag-cloud.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/base/_oj-notags-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/base/_oj-notags.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/base/_oj-tags-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/base/_oj-tags.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/redwood/_oj-tags-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/redwood/_oj-tags.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/redwood/oj-notags.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/redwood/oj-tags.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/stable/_oj-tags-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/stable/_oj-tags.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/stable/oj-notags.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tags/themes/stable/oj-tags.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/text-area/themes/base/_oj-text-area.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/text-area/themes/redwood/_oj-text-area.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/text-area/themes/redwood/oj-text-area.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/text-area/themes/stable/_oj-text-area.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/text-area/themes/stable/oj-text-area.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/text-field/themes/base/_oj-text-field.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/text-field/themes/redwood/_oj-text-field-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/text-field/themes/redwood/_oj-text-field-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/text-field/themes/redwood/_oj-text-field.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/text-field/themes/stable/_oj-text-field-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/text-field/themes/stable/_oj-text-field.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/thematic-map/themes/base/_oj-thematic-map.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/thematic-map/themes/redwood/_oj-thematic-map.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/thematic-map/themes/redwood/oj-thematic-map.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/thematic-map/themes/stable/_oj-thematic-map.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/thematic-map/themes/stable/oj-thematic-map.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/time-axis/themes/base/_oj-time-axis.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/time-axis/themes/redwood/_oj-time-axis.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/time-axis/themes/redwood/oj-time-axis.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/time-axis/themes/stable/_oj-time-axis.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/time-axis/themes/stable/oj-time-axis.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/timeline/themes/base/_oj-timeline.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/timeline/themes/redwood/_oj-timeline-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/timeline/themes/redwood/_oj-timeline.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/timeline/themes/redwood/oj-timeline.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/timeline/themes/stable/_oj-timeline-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/timeline/themes/stable/_oj-timeline.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/timeline/themes/stable/oj-timeline.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/toolbar/themes/base/_oj-toolbar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/toolbar/themes/redwood/_oj-toolbar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/toolbar/themes/redwood/oj-toolbar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/toolbar/themes/stable/_oj-toolbar.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/toolbar/themes/stable/oj-toolbar.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tooltip/themes/base/_oj-tooltip.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tooltip/themes/redwood/_oj-tooltip.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tooltip/themes/redwood/oj-tooltip.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tooltip/themes/stable/_oj-tooltip.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tooltip/themes/stable/oj-tooltip.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/train/themes/base/_oj-train.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/train/themes/redwood/_oj-train-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/train/themes/redwood/_oj-train.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/train/themes/redwood/oj-train.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/train/themes/stable/_oj-train.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/train/themes/stable/oj-train.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tree-view/themes/base/_oj-tree-view.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tree-view/themes/redwood/_oj-tree-view.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tree-view/themes/redwood/oj-tree-view.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tree-view/themes/stable/_oj-tree-view.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/tree-view/themes/stable/oj-tree-view.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/treemap/themes/base/_oj-treemap.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/treemap/themes/redwood/_oj-treemap.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/treemap/themes/redwood/oj-treemap.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/treemap/themes/stable/_oj-treemap.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/treemap/themes/stable/oj-treemap.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/typography/themes/base/_oj-typography.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/typography/themes/redwood/_oj-typography-ignore.scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/typography/themes/redwood/_oj-typography-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/typography/themes/redwood/_oj-typography.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/typography/themes/redwood/oj-typography.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/typography/themes/stable/_oj-typography-scoped.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/typography/themes/stable/_oj-typography.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/typography/themes/stable/oj-typography.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/utilities/_oj.utilities.bidi.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/utilities/_oj.utilities.icons.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/utilities/_oj.utilities.json.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/utilities/_oj.utilities.masonrylayout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/utilities/_oj.utilities.modules.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/validation-group/themes/base/_oj-validation-group.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/validation-group/themes/redwood/oj-validation-group.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/validation-group/themes/stable/oj-validation-group.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/waterfall-layout/themes/base/_oj-waterfall-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/waterfall-layout/themes/redwood/_oj-waterfall-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/waterfall-layout/themes/redwood/oj-waterfall-layout.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/waterfall-layout/themes/stable/_oj-waterfall-layout.cssvars.scss +0 -0
- /package/dist/pcss/oj/{15.0.4 → 15.1.0}/oj/waterfall-layout/themes/stable/oj-waterfall-layout.scss +0 -0
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* as shown at https://oss.oracle.com/licenses/upl/
|
|
6
6
|
* @ignore
|
|
7
7
|
*/
|
|
8
|
-
define(["touchr","ojs/ojdatasource-common","ojs/ojdatacollection-utils","ojs/ojinputnumber","ojs/ojmenu","ojs/ojmenuselectmany","ojs/ojdialog","ojs/ojbutton","ojdnd","ojs/ojcore-base","@oracle/oraclejet-preact/hooks/UNSAFE_useFormVariantContext","ojs/ojcomponentcore","ojs/ojcontext","ojs/ojdatacollection-common","ojs/ojdomutils","ojs/ojconfig","ojs/ojcustomelement-utils","ojs/ojkeyboardfocus-utils","jquery","ojs/ojlogger","ojs/ojthemeutils"],function(e,t,i,s,n,o,r,l,a,h,d,m,c,u,_,p,g,C,f,y,E){"use strict";var v;h=h&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h,c=c&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c,f=f&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f,(v={properties:{bandingInterval:{type:"object",properties:{column:{type:"number",value:0},row:{type:"number",value:0}}},cell:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},currentCell:{type:"object",writeback:!0},data:{type:"DataGridProvider",extension:{webelement:{exceptionStatus:[{type:"unsupported",since:"13.0.0",description:"Data sets from a DataProvider cannot be sent to WebDriverJS; use ViewModels or page variables instead."}]}}},dataTransferOptions:{type:"object",properties:{copy:{type:"string",enumValues:["disable","enable"],value:"disable"},cut:{type:"string",enumValues:["disable","enable"],value:"disable"},fill:{type:"string",enumValues:["disable","enable"],value:"disable"},paste:{type:"string",enumValues:["disable","enable"],value:"disable"}}},dnd:{type:"object",properties:{drag:{type:"object",properties:{columns:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},drag:{type:"function"},dragEnd:{type:"function"},dragStart:{type:"function"}}},rows:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},drag:{type:"function"},dragEnd:{type:"function"},dragStart:{type:"function"}}}}},drop:{type:"object",properties:{columns:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},dragEnter:{type:"function"},dragLeave:{type:"function"},dragOver:{type:"function"},drop:{type:"function"}}},rows:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},dragEnter:{type:"function"},dragLeave:{type:"function"},dragOver:{type:"function"},drop:{type:"function"}}}}},reorder:{type:"object",properties:{row:{type:"string",enumValues:["disable","enable"],value:"disable"}}}}},editMode:{type:"string",writeback:!0,enumValues:["cellEdit","cellNavigation","none"],value:"none"},frozenColumnCount:{type:"number",writeback:!0,value:0},frozenRowCount:{type:"number",writeback:!0,value:0},gridlines:{type:"object",properties:{horizontal:{type:"string",enumValues:["hidden","visible"],value:"visible"},vertical:{type:"string",enumValues:["hidden","visible"],value:"visible"}}},header:{type:"object",properties:{column:{type:"object",properties:{className:{type:"function|string"},freezable:{type:"string",enumValues:["disable","enable"],value:"disable"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string",enumValues:["disable","enable"],value:"disable"},width:{type:"string|function",enumValues:["disable","enable"],value:"disable"}}},sortable:{type:"function|string",enumValues:["auto","disable","enable"],value:"auto"},style:{type:"function|string"}}},columnEnd:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string",enumValues:["disable","enable"],value:"disable"},width:{type:"string|function",enumValues:["disable","enable"],value:"disable"}}},style:{type:"function|string"}}},row:{type:"object",properties:{className:{type:"function|string"},freezable:{type:"string",enumValues:["disable","enable"],value:"disable"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string|function",enumValues:["disable","enable"],value:"disable"},width:{type:"string",enumValues:["disable","enable"],value:"disable"}}},sortable:{type:"function|string",enumValues:["auto","disable","enable"],value:"auto"},style:{type:"function|string"}}},rowEnd:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string|function",enumValues:["disable","enable"],value:"disable"},width:{type:"string",enumValues:["disable","enable"],value:"disable"}}},style:{type:"function|string"}}}}},scrollPolicy:{type:"string",enumValues:["auto","loadMoreOnScroll","scroll"],value:"auto"},scrollPolicyOptions:{type:"object",properties:{maxColumnCount:{type:"number",value:500},maxRowCount:{type:"number",value:500}}},scrollPosition:{type:"object",writeback:!0,value:{x:0,y:0},properties:{columnIndex:{type:"number"},columnKey:{type:"any"},offsetX:{type:"number"},offsetY:{type:"number"},rowIndex:{type:"number"},rowKey:{type:"any"},x:{type:"number"},y:{type:"number"}}},scrollToKey:{type:"string",enumValues:["always","auto","capability","never"],value:"auto"},selection:{type:"Array<Object>",writeback:!0,value:[]},selectionMode:{type:"object",properties:{cell:{type:"string",enumValues:["multiple","none","single"],value:"none"},row:{type:"string",enumValues:["multiple","none","single"],value:"none"}}},translations:{type:"object",value:{},properties:{accessibleActionableMode:{type:"string"},accessibleCollapsed:{type:"string"},accessibleColumnContext:{type:"string"},accessibleColumnEndHeaderContext:{type:"string"},accessibleColumnEndHeaderLabelContext:{type:"string"},accessibleColumnHeaderContext:{type:"string"},accessibleColumnHeaderLabelContext:{type:"string"},accessibleColumnHierarchicalFull:{type:"string"},accessibleColumnHierarchicalPartial:{type:"string"},accessibleColumnHierarchicalUnknown:{type:"string"},accessibleColumnSelected:{type:"string"},accessibleColumnSpanContext:{type:"string"},accessibleContainsControls:{type:"string"},accessibleExpanded:{type:"string"},accessibleFirstColumn:{type:"string"},accessibleFirstRow:{type:"string"},accessibleLastColumn:{type:"string"},accessibleLastRow:{type:"string"},accessibleLevelContext:{type:"string"},accessibleLevelHierarchicalContext:{type:"string"},accessibleMultiCellSelected:{type:"string"},accessibleNavigationMode:{type:"string"},accessibleRangeSelectModeOff:{type:"string"},accessibleRangeSelectModeOn:{type:"string"},accessibleRowCollapsed:{type:"string"},accessibleRowContext:{type:"string"},accessibleRowEndHeaderContext:{type:"string"},accessibleRowEndHeaderLabelContext:{type:"string"},accessibleRowExpanded:{type:"string"},accessibleRowHeaderContext:{type:"string"},accessibleRowHeaderLabelContext:{type:"string"},accessibleRowHierarchicalFull:{type:"string"},accessibleRowHierarchicalPartial:{type:"string"},accessibleRowHierarchicalUnknown:{type:"string"},accessibleRowSelected:{type:"string"},accessibleRowSpanContext:{type:"string"},accessibleSelectionAffordanceBottom:{type:"string"},accessibleSelectionAffordanceTop:{type:"string"},accessibleSortAscending:{type:"string"},accessibleSortDescending:{type:"string"},accessibleSortable:{type:"string"},accessibleStateSelected:{type:"string"},accessibleSummaryEstimate:{type:"string"},accessibleSummaryExact:{type:"string"},accessibleSummaryExpanded:{type:"string"},collapsedText:{type:"string"},columnWidth:{type:"string"},expandedText:{type:"string"},labelCopyCells:{type:"string"},labelCut:{type:"string"},labelCutCells:{type:"string"},labelDisableNonContiguous:{type:"string"},labelEnableNonContiguous:{type:"string"},labelFillCells:{type:"string"},labelFreezeCol:{type:"string"},labelFreezeRow:{type:"string"},labelPaste:{type:"string"},labelPasteCells:{type:"string"},labelResize:{type:"string"},labelResizeColumn:{type:"string"},labelResizeDialogApply:{type:"string"},labelResizeDialogCancel:{type:"string"},labelResizeDialogSubmit:{type:"string"},labelResizeFitToContent:{type:"string"},labelResizeHeight:{type:"string"},labelResizeRow:{type:"string"},labelResizeWidth:{type:"string"},labelSelectMultiple:{type:"string"},labelSortAsc:{type:"string"},labelSortCol:{type:"string"},labelSortColAsc:{type:"string"},labelSortColDsc:{type:"string"},labelSortDsc:{type:"string"},labelSortRow:{type:"string"},labelSortRowAsc:{type:"string"},labelSortRowDsc:{type:"string"},labelUnfreezeCol:{type:"string"},labelUnfreezeRow:{type:"string"},msgFetchingData:{type:"string"},msgNoData:{type:"string"},resizeColumnDialog:{type:"string"},resizeRowDialog:{type:"string"},rowHeight:{type:"string"},tooltipRequired:{type:"string"}}}},methods:{getContextByNode:{},getProperty:{},refresh:{},setProperties:{},setProperty:{},getNodeBySubId:{},getSubIdByNode:{}},events:{ojBeforeCurrentCell:{},ojBeforeEdit:{},ojBeforeEditEnd:{},ojCollapseRequest:{},ojCopyRequest:{},ojCutRequest:{},ojExpandRequest:{},ojFillRequest:{},ojPasteRequest:{},ojResize:{},ojScroll:{},ojSort:{},ojSortRequest:{}},extension:{}}).extension._WIDGET_NAME="ojDataGrid",v.extension._BINDING={provide:new Map([[d.FormVariantContext,"embedded"]])},h.CustomElementBridge.register("oj-data-grid",{metadata:h.CollectionUtils.mergeDeep(v,{properties:{userAssistanceDensity:{binding:{provide:[{name:"containerUserAssistanceDensity",default:"compact"},{name:"userAssistanceDensity",default:"compact"}]}}}})});const w=function(e,t,i,s){this.rtlMode=e,this.translationFunction=t,this.defaultOptions=i,this.widgetName=s,this.styles={},this.styles.datagrid="oj-datagrid",this.styles.cell="oj-datagrid-cell",this.styles.banded="oj-datagrid-banded",this.styles.row="oj-datagrid-row",this.styles.databody="oj-datagrid-databody",this.styles.topcorner="oj-datagrid-top-corner",this.styles.bottomcorner="oj-datagrid-bottom-corner",this.styles.rowheaderspacer="oj-datagrid-row-header-spacer",this.styles.colheaderspacer="oj-datagrid-column-header-spacer",this.styles.status="oj-datagrid-status",this.styles.loadingicon="oj-icon oj-datagrid-loading-icon",this.styles.emptytext="oj-datagrid-empty-text",this.styles.header="oj-datagrid-header",this.styles.endheader="oj-datagrid-end-header",this.styles.groupingcontainer="oj-datagrid-header-grouping",this.styles.headercell="oj-datagrid-header-cell",this.styles.rowheader="oj-datagrid-row-header",this.styles.colheader="oj-datagrid-column-header",this.styles.colheadercell="oj-datagrid-column-header-cell",this.styles.rowheadercell="oj-datagrid-row-header-cell",this.styles.endheadercell="oj-datagrid-end-header-cell",this.styles.rowendheader="oj-datagrid-row-end-header",this.styles.colendheader="oj-datagrid-column-end-header",this.styles.colendheadercell="oj-datagrid-column-end-header-cell",this.styles.rowendheadercell="oj-datagrid-row-end-header-cell",this.styles.headerlabel="oj-datagrid-header-label",this.styles.rowheaderlabel="oj-datagrid-row-header-label",this.styles.columnheaderlabel="oj-datagrid-column-header-label",this.styles.rowendheaderlabel="oj-datagrid-row-end-header-label",this.styles.columnendheaderlabel="oj-datagrid-column-end-header-label",this.styles["scroller-mobile"]="oj-datagrid-scroller-touch",this.styles.scroller="oj-datagrid-scroller",this.styles.scrollers="oj-datagrid-scrollers",this.styles.scrollbarForce="oj-scrollbar-force",this.styles.focus="oj-focus",this.styles.hover="oj-hover",this.styles.active="oj-active",this.styles.selected="oj-selected",this.styles.topSelected="oj-datagrid-selected-top",this.styles.bottomSelected="oj-datagrid-selected-bottom",this.styles.startSelected="oj-datagrid-selected-start",this.styles.endSelected="oj-datagrid-selected-end",this.styles.topEdit="oj-datagrid-cell-edit-top",this.styles.bottomEdit="oj-datagrid-cell-edit-bottom",this.styles.startEdit="oj-datagrid-cell-edit-start",this.styles.endEdit="oj-datagrid-cell-edit-end",this.styles.topFloodfill="oj-datagrid-floodfill-top",this.styles.bottomFloodfill="oj-datagrid-floodfill-bottom",this.styles.startFloodfill="oj-datagrid-floodfill-start",this.styles.endFloodfill="oj-datagrid-floodfill-end",this.styles.topResized="oj-datagrid-resized-top",this.styles.bottomResized="oj-datagrid-resized-bottom",this.styles.endResized="oj-datagrid-resized-end",this.styles.startResized="oj-datagrid-resized-start",this.styles.disabled="oj-disabled",this.styles.enabled="oj-enabled",this.styles.default="oj-default",this.styles.sortIcon="oj-datagrid-sort-icon",this.styles.sortascending="oj-datagrid-sort-ascending-icon",this.styles.sortdescending="oj-datagrid-sort-descending-icon",this.styles.sortdefault="oj-datagrid-sort-default-icon",this.styles.icon="oj-component-icon",this.styles.clickableicon="oj-clickable-icon-nocontext",this.styles.info="oj-helper-hidden-accessible",this.styles.rowexpander="oj-rowexpander",this.styles.cut="oj-datagrid-cut",this.styles.selectaffordance="oj-datagrid-touch-selection-affordance",this.styles.selectaffordancetopcornerbounded="oj-datagrid-touch-selection-affordance-top-corner-bounded",this.styles.selectaffordancebottomcornerbounded="oj-datagrid-touch-selection-affordance-bottom-corner-bounded",this.styles.selectaffordancetoprow="oj-datagrid-touch-selection-affordance-top-row",this.styles.selectaffordancebottomrow="oj-datagrid-touch-selection-affordance-bottom-row",this.styles.selectaffordancetopcolumn="oj-datagrid-touch-selection-affordance-top-column",this.styles.selectaffordancebottomcolumn="oj-datagrid-touch-selection-affordance-bottom-column",this.styles.floodfillaffordance="oj-datagrid-floodfill-affordance",this.styles.toucharea="oj-datagrid-touch-area",this.styles.readOnly="oj-read-only",this.styles.editable="oj-datagrid-editable",this.styles.cellEdit="oj-datagrid-cell-edit",this.styles.draggable="oj-draggable",this.styles.drag="oj-drag",this.styles.drop="oj-drop",this.styles.activedrop="oj-active-drop",this.styles.validdrop="oj-valid-drop",this.styles.invaliddrop="oj-invalid-drop",this.styles.formcontrol="oj-form-control-inherit",this.styles.borderHorizontalNone="oj-datagrid-border-horizontal-none",this.styles.borderVerticalNone="oj-datagrid-border-vertical-none",this.styles.borderHorizontalSmall="oj-datagrid-small-content-border-horizontal",this.styles.borderVerticalSmall="oj-datagrid-small-content-border-vertical",this.styles.offsetOutline="oj-datagrid-focus-offset",this.styles.depth="oj-datagrid-depth-",this.styles.popupHeader="oj-datagrid-popup-header",this.styles.popupContent="oj-datagrid-popup-content",this.styles.popupFooter="oj-datagrid-popup-footer",this.styles.dialogTitle="oj-dialog-title",this.styles.resizeDialog="oj-datagrid-resize-dialog",this.styles.headerAllSelected="oj-selected",this.styles.headerPartialSelected="oj-partial-selected",this.styles.disclosureContainer="oj-datagrid-disclosure-icon-container",this.styles.disclosureIcon="oj-datagrid-disclosure-icon",this.styles.expanded="oj-datagrid-expanded-icon",this.styles.collapsed="oj-datagrid-collapsed-icon",this.styles.spacer="oj-datagrid-tree-spacer",this.styles.hierarchicalTree="oj-datagrid-hierarchical-tree",this.styles.hierarchicalGroup="oj-datagrid-hierarchical-group",this.styles.iconContainer="oj-datagrid-icon-container",this.styles.requiredIcon="oj-datagrid-required-icon",this.styles.noDataContainer="oj-datagrid-no-data-container",this.styles.draggableItem="oj-datagrid-draggable",this.styles.dragSourceOpaque="drag-source-opaque",this.styles.rowDropTargetLine="oj-datagrid-row-drop-target-line",this.styles.colDropTargetLine="oj-datagrid-col-drop-target-line",this.styles.dragging="oj-datagrid-drag-active",this.styles.dropTarget="oj-datagrid-drop-target",this.styles.disabledElement="oj-datagrid-disabled-element",this.styles.databodyFrozenCol="oj-datagrid-databody-frozen-column",this.styles.databodyFrozenRow="oj-datagrid-databody-frozen-row",this.styles.databodyFrozenCorner="oj-datagrid-databody-frozen-corner",this.styles.colHeaderFrozen="oj-datagrid-column-header-frozen",this.styles.rowHeaderFrozen="oj-datagrid-row-header-frozen",this.styles.colEndHeaderFrozen="oj-datagrid-column-end-header-frozen",this.styles.rowEndHeaderFrozen="oj-datagrid-row-end-header-frozen",this.styles.rowFrozenIndicator="oj-datagrid-row-frozen-indicator",this.styles.colFrozenIndicator="oj-datagrid-col-frozen-indicator",this.styles.frozenHeader="oj-datagrid-header-frozen",this.styles.frozenCell="oj-datagrid-cell-frozen",this.styles.skeletonContainer="oj-datagrid-skeleton-container",this.styles.skeletonCell="oj-datagrid-skeleton-cell",this.styles.skeleton="oj-datagrid-skeleton",this.styles.skeletonAnimation="oj-animation-skeleton",this.commands={},this.commands.sortCol="oj-datagrid-sortCol",this.commands.sortColAsc="oj-datagrid-sortColAsc",this.commands.sortColDsc="oj-datagrid-sortColDsc",this.commands.sortRow="oj-datagrid-sortRow",this.commands.sortRowAsc="oj-datagrid-sortRowAsc",this.commands.sortRowDsc="oj-datagrid-sortRowDsc",this.commands.resize="oj-datagrid-resize",this.commands.resizeWidth="oj-datagrid-resizeWidth",this.commands.resizeHeight="oj-datagrid-resizeHeight",this.commands.resizeFitToContent="oj-datagrid-resizeFitToContent",this.commands.cut="oj-datagrid-cut",this.commands.paste="oj-datagrid-paste",this.commands.cutCells="oj-datagrid-cutCells",this.commands.copyCells="oj-datagrid-copyCells",this.commands.pasteCells="oj-datagrid-pasteCells",this.commands.autoFill="oj-datagrid-fillCells",this.commands.discontiguousSelection="oj-datagrid-discontiguousSelection",this.commands.freezeCol="oj-datagrid-freezeCol",this.commands.freezeRow="oj-datagrid-freezeRow",this.commands.unfreezeCol="oj-datagrid-unfreezeCol",this.commands.unfreezeRow="oj-datagrid-unfreezeRow",this.attributes={},this.attributes.busyContext=c._OJ_CONTEXT_ATTRIBUTE,this.attributes.context="data-oj-cellContext",this.attributes.resizable="data-oj-resizable",this.attributes.sortable="data-oj-sortable",this.attributes.sortDir="data-oj-sortdir",this.attributes.expander="data-oj-expander",this.attributes.expanderIndex="data-oj-expander-index",this.attributes.container=m._OJ_CONTAINER_ATTR,this.attributes.extent="data-oj-extent",this.attributes.start="data-oj-start",this.attributes.depth="data-oj-depth",this.attributes.level="data-oj-level",this.attributes.metadata="data-oj-metaData"};h._registerLegacyNamespaceProp("DataGridResources",w),w.prototype.setRTLMode=function(e){this.rtlMode=e},w.prototype.isRTLMode=function(){return"rtl"===this.rtlMode},w.prototype.getTranslatedText=function(e,t){return this.translationFunction(e,t)},w.prototype.getDefaultOption=function(e){return this.defaultOptions[e]},w.prototype.getMappedStyle=function(e){return null!=e?this.styles[e]:null},w.prototype.getMappedCommand=function(e){return null!=e?this.commands[e]:null},w.prototype.getMappedAttribute=function(e){return null!=e?this.attributes[e]:null};const H=function(e){this.dataprovider=e,this.pendingHeaderCallback={},e.options&&e.options.implicitSort&&(this.currentSortCriteria=e.options.implicitSort),this.sortUpdated=!1;var t=this.dataprovider.getCapability("fetchByOffset");this.fetchByOffset=null!=t&&"randomAccess"===t.implementation,this._registerEventListeners(),H.superclass.constructor.call(this)};function S(e,t,i,s){this.indexes=e,this.data=i,this.metadata=t,this.columns=s}function x(e,t,i){this.response=e,this.results=e.results,this.cellRanges=t,this.columns=i,this._setBounds(e,t,i)}function b(e,t,i,s){this.start=e,this.end=t,this.headers=i,this.sortCriteria=s}h.Object.createSubclass(H,h.DataGridDataSource,"DataProviderDataGridDataSource"),H.prototype._registerEventListeners=function(){this._mutationListener=this._handleDataProviderMutationEvent.bind(this),this._refreshListener=this._handleDataProviderRefreshEvent.bind(this),this.dataprovider.addEventListener("mutate",this._mutationListener),this.dataprovider.addEventListener("refresh",this._refreshListener)},H.prototype._handleDataProviderMutationEvent=function(e){var t,i=e.detail.add;if(null!=i){var s={indexes:[],keys:[]},n=[],o=[],r=[];for(t=0;t<i.data.length;t++)s.source=this,s.operation="insert",s.keys.push({row:i.metadata[t].key,column:null}),s.indexes.push({row:i.indexes[t],column:-1}),r.push(i.indexes[t]),n.push(i.data[t]),o.push(i.metadata[t]),t!==i.data.length-1&&i.indexes[t+1]===i.indexes[t]+1||(s.result=new S(r,o,n,this.columns),this.handleEvent("change",s),(s={}).indexes=[],s.keys=[],n=[],o=[],r=[])}var l=e.detail.remove;if(null!=l){var a={source:this,operation:"delete",keys:[],indexes:[]};for(t=0;t<l.data.length;t++)a.keys.push({row:l.metadata[t].key,column:null}),a.indexes.push({row:l.indexes[t],column:-1});this.handleEvent("change",a)}var h=e.detail.update;if(null!=h)for(t=0;t<h.data.length;t++){var d={source:this,operation:"update",keys:{row:h.metadata[t].key,column:null},indexes:{row:h.indexes[t],column:-1}};d.result=new S([h.indexes[t]],[h.metadata[t]],[h.data[t]],this.columns),this.handleEvent("change",d)}},S.prototype.getData=function(e){var t=this,i={};return Object.defineProperty(i,"data",{enumerable:!0,get:function(){return t.data[e.row-t.getStart("row")][t.columns[e.column]]},set:function(i){t.data[e.row-t.getStart("row")][t.columns[e.column]]=i}}),i},S.prototype.getMetadata=function(e){var t=this,i=t.metadata[e.row-t.getStart("row")];return i.keys={row:i.key,column:t.columns[e.column]},i},S.prototype.getStart=function(e){return"row"===e?this.indexes[0]:0},S.prototype.getCount=function(e){return"row"===e?this.data.length:"column"===e?this.columns.length:0},S.prototype.getExtent=function(){return{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}},H.prototype._handleDataProviderRefreshEvent=function(){this._asyncIterator=null,this.handleEvent("change",{operation:"refresh"})},H.prototype.fetchHeaders=function(e,t,i){if(null!=t){var s=e.axis,n={headerRange:e,callbacks:t,callbackObjects:i};this.pendingHeaderCallback[s]=n}},H.prototype._processPendingHeaderCallbacks=function(e){var t=this.pendingHeaderCallback[e];if(null!=t){var i=t.headerRange,s=t.callbacks,n=t.callbackObjects;this._handleHeaderFetchSuccess(i,s,n),this.pendingHeaderCallback[e]=null}},H.prototype._handleHeaderFetchSuccess=function(e,t,i){var s,n=e.axis,o=e.start,r=e.count;"column"===n&&null!=this.columns?s=new b(o,Math.min(this.columns.length,o+r),this.columns,this.currentSortCriteria):s=null;null!=t&&t.success&&t.success.call(i.success,s,e,null)},x.prototype._setBounds=function(e,t,i){for(var s=0;s<t.length;s+=1){var n=t[s];"row"===n.axis?(this.rowStart=e.fetchParameters.offset?e.fetchParameters.offset:n.start,this.rowEnd=this.rowStart+e.results.length-1):"column"===n.axis&&(this.colStart=n.start,this.colEnd=Math.min(this.colStart+n.count-1,this.colStart+i.length-1))}},x.prototype.getData=function(e){var t=this,i={};return Object.defineProperty(i,"data",{enumerable:!0,get:function(){return t.results[e.row-t.rowStart].data[t.columns[e.column]]},set:function(i){t.results[e.row-t.rowStart].data[t.columns[e.column]]=i}}),i},x.prototype.getMetadata=function(e){var t=this.results[e.row-this.rowStart].metadata;return t.keys={row:this.results[e.row-this.rowStart].metadata.key,column:this.columns[e.column]},t},x.prototype.getCount=function(e){return"row"===e?this.rowEnd-this.rowStart+1:"column"===e?this.colEnd-this.colStart+1:0},x.prototype.getExtent=function(){return{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}},H.prototype.setUpColumns=function(e){if(null==this.columns||0===this.columns.length){var t=[];if(e.results.length)for(var i=Object.keys(e.results[0].data),s=0;s<i.length;s++)t.push(i[s]);this.columns=t}},H.prototype.getRangeInfo=function(e){for(var t={},i=0;i<e.length;i+=1){var s=e[i];"row"===s.axis?(t.rowStart=s.start,t.rowEnd=t.rowStart+s.count-1):"column"===s.axis&&(t.colStart=s.start,t.colEnd=t.colStart+s.count-1)}return t},H.prototype._createResults=function(e){e.results=[];for(var t=0;t<e.value.data.length;t++){var i={data:e.value.data[t],metadata:e.value.metadata[t]};e.results.push(i)}},H.prototype.handleFetchResult=function(e,t,i,s){var n=s[0];n.results||(this._createResults(n),n.fetchParameters=n.value.fetchParameters),this.setUpColumns(n),this._processPendingHeaderCallbacks("column"),this._processPendingHeaderCallbacks("row");var o=new x(n,e,this.columns);if(null!=t&&null!=t.success){var r=i?i.success:null;t.success.call(r,o,e)}},H.prototype.fetchCells=function(e,t,i){var s=this;this.getCount("row");var n=s.getRangeInfo(e),o=n.rowEnd-n.rowStart+1;if(s.fetchByOffset){var r=n.rowStart;s._fetchPromise=s.dataprovider.fetchByOffset({size:o,offset:r,sortCriteria:s.currentSortCriteria})}else(null==s._asyncIterator||this.sortUpdated)&&(s._clientId=s._clientId||Symbol(),s._asyncIterator=s.dataprovider.fetchFirst({clientId:s._clientId,size:o,sortCriteria:s.currentSortCriteria})[Symbol.asyncIterator]()),s._fetchPromise=s._asyncIterator.next();this.sortUpdated=!1,Promise.all([s._fetchPromise,s._getCountPromise]).then(s.handleFetchResult.bind(s,e,t,i))},H.prototype.getCapability=function(e){if("sort"===e){var t=this.dataprovider.getCapability(e).attributes;return"multiple"===t||"single"===t?"column":t}return"none"},H.prototype.getCount=function(e){var t=this;if("row"===e){if(void 0!==t.totalRowCount)return t.totalRowCount;t._getCountPromise=this.dataprovider.getTotalSize(),t._getCountPromise.then(function(e){t.totalRowCount=e})}else if("column"===e&&null!=this.columns)return this.columns.length;return-1},H.prototype.getCountPrecision=function(){return"estimate"},H.prototype.indexes=function(){return{row:-1,column:-1}},H.prototype.keys=function(){return{row:null,column:null}},H.prototype.move=function(){return!1},H.prototype.moveOK=function(){return"invalid"},H.prototype.sort=function(e,t,i){this.sortUpdated=!0,this.currentSortCriteria=[{attribute:e.key,direction:e.direction}],null==i&&(i={}),null!=t&&null!=t.success&&t.success.call(i.success)},b.prototype.getData=function(e){return this.headers[e]},b.prototype.getMetadata=function(e){var t=this.getData(e),i={key:t};if(null!=this.sortCriteria)for(var s=0;s<this.sortCriteria.length;s++)this.sortCriteria[s].attribute===t&&(i.sortDirection=this.sortCriteria[s].direction);return i},b.prototype.getLevelCount=function(){return 1},b.prototype.getExtent=function(){return{extent:1,more:{before:!1,after:!1}}},b.prototype.getLabel=function(){return null},b.prototype.getDepth=function(){return 1},b.prototype.getCount=function(){return Math.max(0,this.end-this.start)};const R=function(e){this.grid=e};R.prototype.getAction=function(e,t){var i=e.keyCode,s=this.grid.m_utils.ctrlEquivalent(e),n=e.shiftKey,o=e.altKey,r=this.grid.keyCodes,l=t.cellOrHeader,a=t.readOnly,h=t.currentMode,d=t.activeMove,m=t.activeDrag,c=t.rowMove,u=t.columnSort;let _=t.rowSort;var p=t.selection,g=t.selectionMode,C=t.multipleSelection,f=t.expandCollapse,y=t.copyCells,E=t.cutCells,v=t.pasteCells,w=t.fill;switch(i){case r.TAB_KEY:if("actionable"===h)return n?"TAB_PREV_IN_CELL":"TAB_NEXT_IN_CELL";if(!a)return n?"FOCUS_LEFT":"FOCUS_RIGHT";break;case r.ENTER_KEY:if("actionable"===h)return"NO_OP";if("column"===l&&u||"row"===l&&_)return"SORT";if(!o&&a&&"navigation"===h||"cell"!==l)return"ACTIONABLE";if(!a&&!o)return n?"FOCUS_UP":"FOCUS_DOWN";if(o&&a&&"navigation"===h)return"EDITABLE";if(!a&&("navigation"===h||"edit"===h))return"EDIT";break;case r.ESC_KEY:if("actionable"===h)return"EXIT_ACTIONABLE";if(d)return"CANCEL_REORDER";if(m)return"CANCEL_DRAG";if(a){if(this.grid.m_discontiguousSelection)return"SELECT_DISCONTIGUOUS"}else{if("navigation"===h)return"EXIT_EDITABLE";if("edit"===h)return"CANCEL_EDIT"}break;case r.SPACE_KEY:if(-1!==l.indexOf("row")&&p&&("cell"===g&&C||"row"===g)&&"navigation"===h)return"SELECT_ROW";if(-1!==l.indexOf("column")&&p&&"cell"===g&&C&&"navigation"===h)return"SELECT_COLUMN";if("cell"===l)if(a&&"navigation"===h){if(s&&p&&"cell"===g&&C)return"SELECT_COLUMN";if(n&&p&&("cell"===g&&C||"row"===g))return"SELECT_ROW"}else if("navigation"===h)return"DATA_ENTRY";break;case r.PAGEUP_KEY:if("navigation"===h)return"FOCUS_ROW_FIRST";break;case r.PAGEDOWN_KEY:if("navigation"===h)return"FOCUS_ROW_LAST";break;case r.END_KEY:if("navigation"===h)return s&&"cell"===l?"FOCUS_LAST_CELL_IN_GRID":"FOCUS_COLUMN_LAST";break;case r.HOME_KEY:if("navigation"===h)return s&&"cell"===l?"FOCUS_FIRST_CELL_IN_GRID":"FOCUS_COLUMN_FIRST";break;case r.LEFT_KEY:if(s&&f&&this.grid._isHeaderExpanded(e.target))return"COLLAPSE";if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&"cell"===g&&C?"SELECT_EXTEND_LEFT":s?"FOCUS_LEFT_NON_EMPTY_CELL":"FOCUS_LEFT";break;case r.UP_KEY:if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&C?"SELECT_EXTEND_UP":s?"FOCUS_UP_NON_EMPTY_CELL":"FOCUS_UP";break;case r.RIGHT_KEY:if(s&&f&&this.grid._isHeaderCollapsed(e.target))return"EXPAND";if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&"cell"===g&&C?"SELECT_EXTEND_RIGHT":s?"FOCUS_RIGHT_NON_EMPTY_CELL":"FOCUS_RIGHT";break;case r.DOWN_KEY:if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&C?"SELECT_EXTEND_DOWN":s?"FOCUS_DOWN_NON_EMPTY_CELL":"FOCUS_DOWN";break;case r.F2_KEY:if("actionable"===h)return"EXIT_ACTIONABLE";if("cell"!==l)return"ACTIONABLE";if(a&&"navigation"===h)return"EDITABLE";if(!a&&"navigation"===h)return"EDIT";if(!a&&"edit"===h)return"CANCEL_EDIT";break;case r.F8_KEY:if(n&&p&&C)return"SELECT_DISCONTIGUOUS";break;case r.F10_KEY:if(n)return"NO_OP";break;case r.V_KEY:if("navigation"===h&&s){if(c)return"PASTE";if(v)return"PASTE_CELLS"}if(!a&&"navigation"===h&&"cell"===l)return"DATA_ENTRY";break;case r.X_KEY:if("navigation"===h&&s){if(c)return"CUT";if(E)return"CUT_CELLS"}if(!a&&"navigation"===h&&"cell"===l)return"DATA_ENTRY";break;case r.C_KEY:if("navigation"===h&&s&&y)return"COPY_CELLS";if(!a&&"navigation"===h&&"cell"===l)return"DATA_ENTRY";break;case r.D_KEY:case r.R_KEY:if("navigation"===h&&s&&w)return"FILL";if(!a&&"navigation"===h&&"cell"===l&&!s)return"DATA_ENTRY";break;case r.SHIFT_KEY:case r.CTRL_KEY:case r.ALT_KEY:break;case r.A_KEY:if(s&&p&&C&&"navigation"===h)return"SELECT_ALL";case r.NUM5_KEY:if(s&&o&&"navigation"===h)return"READ_CELL";default:if((i<r.F1_KEY||i>r.F15_KEY)&&!a&&"navigation"===h&&"cell"===l&&!s)return"DATA_ENTRY"}return"NO_OP"},R.prototype.getNoDataAction=function(e,t){var i=e.keyCode,s=e.shiftKey,n=this.grid.keyCodes,o=t.currentMode;switch(i){case n.TAB_KEY:if("actionable"===o)return s?"TAB_PREV_IN_CELL":"TAB_NEXT_IN_CELL";break;case n.ESC_KEY:if("actionable"===o)return"EXIT_ACTIONABLE";break;case n.F2_KEY:return"actionable"===o?"EXIT_ACTIONABLE":"ACTIONABLE";case n.UP_KEY:if("navigation"===o)return"FOCUS_COLUMN_HEADER";break;case n.DOWN_KEY:if("navigation"===o)return"FOCUS_COLUMN_END_HEADER";break;case n.LEFT_KEY:if("navigation"===o)return"FOCUS_ROW_HEADER";break;case n.RIGHT_KEY:if("navigation"===o)return"FOCUS_ROW_END_HEADER"}return"NO_OP"};const I=function(e,t){this.options=e,this.rendererWrapperFunction=t};I.prototype.extract=function(e,t,i,s){if(null!=e){var n=this.options[e];if(null!=t&&null!=n){var o=n[t];if(null!=i&&null!=o){var r=o[i];return null!=s&&null!=r?r[s]:r}return o}return n}return null},I.prototype.evaluate=function(e,t){return"function"==typeof e?e.call(this,t):e},I.prototype.getRawProperty=function(e,t,i){var s,n,o,r;return"row"===t||"column"===t||"rowEnd"===t||"columnEnd"===t?(s="header",n=t,i?(o="label",r=e):o=e):"cell"===t&&(s="cell",n=e),this.extract(s,n,o,r)},I.prototype.getProperty=function(e,t,i,s){return void 0===i?this.extract(e,t,s):this.evaluate(this.getRawProperty(e,t,s),i)},I.prototype.getRowBandingInterval=function(){var e=this.getProperty("bandingInterval","row");return null!=e?e:0},I.prototype.getColumnBandingInterval=function(){var e=this.getProperty("bandingInterval","column");return null!=e?e:0},I.prototype.getEmptyText=function(){return this.getProperty("emptyText")},I.prototype.getHorizontalGridlines=function(){var e=this.extract("gridlines","horizontal");return null!=e?e:"visible"},I.prototype.getVerticalGridlines=function(){var e=this.extract("gridlines","vertical");return null!=e?e:"visible"},I.prototype.getScrollToKey=function(){var e=this.getProperty("scrollToKey");return null!=e?e:"auto"},I.prototype.getScrollPosition=function(){var e=this.getProperty("scrollPosition");return null!=e?e:null},I.prototype.getSelectionCardinality=function(){var e=this.getProperty("selectionMode");if(null==e)return"none";var t=e[this.getSelectionMode()];return null!=t?t:"none"},I.prototype.getSelectionMode=function(){var e=this.getProperty("selectionMode");if(null==e)return"cell";var t=e.row;return null!=t&&"none"!==t?"row":"cell"},I.prototype.getSelection=function(){return this.getProperty("selection")},I.prototype.getCurrentCell=function(){return this.getProperty("currentCell")},I.prototype.getEditMode=function(){return this.getProperty("editMode")},I.prototype.isSortable=function(e,t){return this.getProperty("sortable",e,t)},I.prototype.isResizable=function(e,t,i){var s=this.extract("header",e,"resizable",t);return null!=i?this.evaluate(s,i):s},I.prototype.isMoveable=function(e){return this.extract("dnd","reorder",e)},I.prototype._isDragEnabled=function(e){let t=!1,i="row"===e||"rowEnd"===e?"rows":"columns",s=this.getProperty("dnd").drag;return s&&s[i]&&(t=!0),t},I.prototype._getDraggable=function(){return this.getProperty("dnd").drag},I.prototype.isFloodFillEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","fill")&&(e=!0),e},I.prototype.isCopyEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","copy")&&(e=!0),e},I.prototype.isCutEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","cut")&&(e=!0),e},I.prototype.isPasteEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","paste")&&(e=!0),e},I.prototype.isFreezeEnabled=function(e){let t=!1;return"scroll"!==this.getProperty("scrollPolicy")&&("enable"===this.extract("header",e,"freezable")&&(t=!0),t)},I.prototype._getFreezeIndex=function(e){let t=null;return"scroll"===this.getProperty("scrollPolicy")||(t="row"===e?this.getProperty("frozenRowCount"):this.getProperty("frozenColumnCount"),null!==t&&(t=parseInt(t,10)-1)),t},I.prototype.getInlineStyle=function(e,t,i){return this.getProperty("style",e,t,i)},I.prototype.getStyleClass=function(e,t,i){return this.getProperty("className",e,t,i)},I.prototype.getRenderer=function(e,t){return this.rendererWrapperFunction?this.rendererWrapperFunction(this.getRawProperty("renderer",e,t)):this.getRawProperty("renderer",e,t)},I.prototype.getScrollPolicy=function(){var e=this.getProperty("scrollPolicy");return null==e&&(e="auto"),e},I.prototype.getScrollPolicyOptions=function(){return this.getProperty("scrollPolicyOptions")};const M=function(){this.sizes={column:new Map,row:new Map}};M.prototype.setSize=function(e,t,i){this.sizes[e].set(t,i)},M.prototype.getSize=function(e,t){var i=this.sizes[e].get(t);return null!=i||this.sizes[e].forEach(function(e,s){null==i&&h.Object.compareValues(s,t)&&(i=e)}),i},M.prototype.clear=function(){this.sizes.column.clear(),this.sizes.row.clear()};const F=function(e){this.scrollbarSize=-1,this.dataGrid=e};F.prototype._getMaxDivHeightForScrolling=function(){return null==this.m_maxDivHeightForScrolling&&this._setMaxValuesForScrolling(),this.m_maxDivHeightForScrolling},F.prototype._getMaxDivWidthForScrolling=function(){return null==this.m_maxDivWidthForScrolling&&this._setMaxValuesForScrolling(),this.m_maxDivWidthForScrolling},F.prototype._setMaxValuesForScrolling=function(){this._calculateBrowserDefinedValues()},F.prototype._calculateBrowserDefinedValues=function(){var e=document.createElement("div");e.style.width="1000000000px",e.style.height="1000000000px",e.style.display="none";var t=document.createElement("div");t.style.width="100px",t.style.height="100px",t.style.overflow="scroll",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);let i=!1;u.isIE()||u.isEdge()?(this.m_maxDivHeightForScrolling=1e6,this.m_maxDivWidthForScrolling=1e6):(i=!0,document.body.appendChild(e),this.m_maxDivHeightForScrolling=parseInt(parseFloat(window.getComputedStyle(e).height)/2,10),this.m_maxDivWidthForScrolling=parseInt(parseFloat(window.getComputedStyle(e).width)/2,10)),this.scrollbarSize=t.offsetWidth-t.clientWidth,i&&document.body.removeChild(e),document.body.removeChild(t)},F.prototype.getScrollbarSize=function(){return-1===this.scrollbarSize&&this._calculateBrowserDefinedValues(),this.scrollbarSize},F.prototype.getScrollbarSize=function(){return-1===this.scrollbarSize&&this.calculateScrollbarSize(),this.scrollbarSize},F.prototype.isTouchDevice=function(){return null==this.isTouch&&(this.isTouch=u.isMobileTouchDevice()),this.isTouch},F.prototype.isTouchDeviceNotIOS=function(){if(null==this.isTouchNotIOS){let e=this.isTouchDevice();this.isTouchNotIOS=!!e&&!u.isIos()}return this.isTouchNotIOS},F.prototype.addCSSClassName=function(e,t){null!=t&&""!==t&&null!=e&&null!=e.classList&&e.classList.add(t)},F.prototype.removeCSSClassName=function(e,t){null!=t&&""!==t&&null!=e&&null!=e.classList&&e.classList.remove(t)},F.prototype.containsCSSClassName=function(e,t){var i=!1;return null!=t&&null!=e&&null!=e.classList&&(i=e.classList.contains(t)),i},F._getCSSClassNameIndex=function(e,t){if(!e||!e.indexOf)return-1;if(t===e)return 0;var i=t.length,s=e.length,n=e.indexOf(t);if(n>=0){var o=0===n||" "===e.charAt(n-1),r=n+i,l=r===s||" "===e.charAt(r);if(o&&l)return n;var a=e.lastIndexOf(t);if(a!==n)return o=e.charAt(a-1),l=(r=a+i)===s||" "===e.charAt(r),o&&l?a:e.indexOf(" "+t+" ")}return-1},F.prototype.ctrlEquivalent=function(e){return u.isMac()?e.metaKey:e.ctrlKey},F.prototype.getElementScrollLeft=function(e){return Math.abs(e.scrollLeft)},F.prototype.setElementScrollLeft=function(e,t){_.setScrollLeft(e,t)},F.prototype.getMousewheelEvent=function(){return"wheel"},F.prototype.getMousewheelScrollDelta=function(e){var t=-1,i=e.deltaMode;return i===e.DOM_DELTA_PIXEL?t=-1:i!==e.DOM_DELTA_LINE&&i!==e.DOM_DELTA_PAGE||(t=-40),{deltaX:e.deltaX*t,deltaY:e.deltaY*t}},F.prototype.empty=function(e){for(;e.firstChild;)this.dataGrid._remove(e.firstChild)},F.prototype.supportsTransitions=function(){var e=(document.body||document.documentElement).style,t="transition";if(!!u.isIE()&&u.getBrowserVersion()<11)return!1;if("string"==typeof e[t])return!0;var i=["Moz","webkit","Webkit","Khtml","O","ms"];t=t.charAt(0).toUpperCase()+t.substr(1);for(var s=0;s<i.length;s++)if("string"==typeof e[i[s]+t])return!0;return!1},F.prototype._isNodeEditableOrClickable=function(e,t){for(;null!=e&&e!==t;){var i=e.nodeName;if(3===e.nodeType)e=e.parentNode;else{var s=parseInt(e.getAttribute("tabIndex"),10),n=parseInt(e.getAttribute(this.dataGrid.getResources().getMappedAttribute("tabindex")),10);if(null!=s&&s>=0)return!(this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("cell"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("headerlabel"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("headercell"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("endheadercell")));if(i.match(/^INPUT|SELECT|OPTION|BUTTON|^A\b|TEXTAREA/)&&(-1!==s||-1!==n))return!0;e=e.parentNode}}return!1},F.prototype.shouldOffsetOutline=function(){return!(!u.isMac()||!u.isWebkit())};const z=function(e){this.m_root=e,this.MAX_COLUMN_THRESHOLD=20,this.MAX_ROW_THRESHOLD=30,this.m_utils=new F(this),this.m_discontiguousSelection=!1,this.m_sizingManager=new M,this.m_keyboardHandler=new R(this),this.m_rowHeaderWidth=null,this.m_rowEndHeaderWidth=null,this.m_colHeaderHeight=null,this.m_colEndHeaderHeight=null,this.m_styleClassDimensionMap={width:{},height:{}},this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.m_fetchingForUpdate=!1,this.m_initialized=!1,this.m_shouldFocus=null,this.m_renderCount=0,this.callbacks={},this._setupActions(),this.m_readinessStack=[],this.m_modelEvents=[],this.m_databodyMap=new Map};z.prototype.keyCodes={TAB_KEY:9,ENTER_KEY:13,SHIFT_KEY:16,CTRL_KEY:17,ALT_KEY:18,ESC_KEY:27,SPACE_KEY:32,PAGEUP_KEY:33,PAGEDOWN_KEY:34,END_KEY:35,HOME_KEY:36,LEFT_KEY:37,UP_KEY:38,RIGHT_KEY:39,DOWN_KEY:40,NUM5_KEY:53,V_KEY:86,X_KEY:88,C_KEY:67,D_KEY:68,R_KEY:82,F1_KEY:112,F2_KEY:113,F8_KEY:119,F10_KEY:121,F15_KEY:126,A_KEY:65},z.UPDATE_ANIMATION_FADE_INOUT=1,z.UPDATE_ANIMATION_SLIDE_INOUT=2,z.UPDATE_ANIMATION_DURATION=250,z.EXPAND_ANIMATION_DURATION=500,z.COLLAPSE_ANIMATION_DURATION=400,z.MAX_OVERSCROLL_PIXEL=50,z.BOUNCE_ANIMATION_DURATION=500,z.DECELERATION_FACTOR=6e-4,z.TAP_AND_SCROLL_RESET=300,z.MIN_SWIPE_DURATION=200,z.MAX_SWIPE_DURATION=400,z.MIN_SWIPE_DISTANCE=10,z.MIN_SWIPE_TRANSITION_DURATION=100,z.MAX_SWIPE_TRANSITION_DURATION=500,z.CONTEXT_MENU_TAP_HOLD_DURATION=750,z.HEADER_TAP_SHORT_HOLD_DURATION=300,z.FETCH_PIXEL_THRESHOLD=5,z.VISIBILITY_STATE_HIDDEN="hidden",z.VISIBILITY_STATE_REFRESH="refresh",z.VISIBILITY_STATE_RENDER="render",z.VISIBILITY_STATE_VISIBLE="visible",z.SPACER_DEFAULT_WIDTH=2,z.SKELETON_DEFAULT_COUNT=3,z.prototype.SetOptions=function(e,t){this.m_options=new I(e,t)},z.prototype.SetSortOriginalEvent=function(e){this.m_sortInfo&&(this.m_sortInfo.originalEvent=e)},z.prototype.UpdateOptions=function(e,t){var i,s,n=Object.keys(e);for(s=0;s<n.length;s++)(i=n[s])in this.m_options.options&&this.m_options.options[i]!==e[i]&&(this.m_options.options[i]=e[i]);for(s=0;s<n.length;s++)if(i=n[s],!this._updateDataGrid(i,t)){this.empty(),this.refresh(this.m_root);break}},z.prototype._updateDataGrid=function(e,t){var i;switch(e){case"bandingInterval":this._removeBanding(),this.updateColumnBanding(),this.updateRowBanding();break;case"currentCell":i=this.m_options.getCurrentCell(),this._updateActive(i,!0,!1);break;case"editMode":this.m_editMode=this.m_options.getEditMode();break;case"gridlines":this._updateGridlines();break;case"header":i=this.m_options.options.header,this._updateHeaderOptions(i,t);break;case"scrollPosition":i=this.m_options.getScrollPosition(),this._updateScrollPosition(i);break;case"selection":i=this.m_options.getSelection(),this._updateSelection(i);break;case"selectionMode":this._clearSelection(null);break;case"frozenColumnCount":i=this.m_options._getFreezeIndex("column"),this._updateFrozenSection(i,"column");break;case"frozenRowCount":i=this.m_options._getFreezeIndex("row"),this._updateFrozenSection(i,"row");break;default:return!1}return!0},z.prototype._updateSelection=function(e){null!=e&&this._isSelectionEnabled()&&this.SetSelection(e)},z.prototype._updateHeaderOptions=function(e,t){if(null!=t&&null!=t.subkey){var i,s=t.subkey.split("."),n=s[0],o=s[1];if("column"===n&&null!=this.m_colHeader&&null!=this.m_colHeader.firstChild?i=this.m_colHeader.firstChild.childNodes:"row"===n&&null!=this.m_rowHeader&&null!=this.m_rowHeader.firstChild?i=this.m_rowHeader.firstChild.childNodes:"columnEnd"===n&&null!=this.m_colEndHeader&&null!=this.m_colEndHeader.firstChild?i=this.m_colEndHeader.firstChild.childNodes:"rowEnd"===n&&null!=this.m_rowEndHeader&&null!=this.m_rowEndHeader.firstChild&&(i=this.m_rowEndHeader.firstChild.childNodes),null!=i)for(var r=0;r<i.length;r++){var l=i[r],a=l[this.getResources().getMappedAttribute("context")];if(a.index=this.getHeaderCellIndex(l),"resizable"===o)this._isHeaderResizeEnabled(n,a)?this._setAttribute(l,o,"true"):this._setAttribute(l,o,"false");else if("sortable"===o){var h=this.m_utils.containsCSSClassName(l.lastChild,this.getMappedStyle("sortIcon"));if(this._isSortEnabled(n,a)){if(!h){var d=this._buildSortIcon(a,l);l.appendChild(d)}this._setAttribute(l,o,"true")}else h&&this._remove(l.lastChild),this._setAttribute(l,o,"false")}}}},z.prototype._updateGridlines=function(){var e=this.m_options.getHorizontalGridlines(),t=this.m_options.getVerticalGridlines(),i=this.getResources().isRTLMode()?"right":"left";if(this.m_databody&&this.m_databody.firstChild){let s=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),n=this._getLastAxis("row"),o=this._getLastAxis("column");for(let r=0;r<s.length;r++){let l=s[r],a=this.getCellIndexes(l);"hidden"===t||a.column===o&&(this.getRowHeaderWidth()+this.getElementDir(l,i)+this.calculateColumnWidth(l)>=this.getWidth()||this.m_endRowEndHeader>-1)?this.m_utils.addCSSClassName(l,this.getMappedStyle("borderVerticalNone")):this.m_utils.removeCSSClassName(l,this.getMappedStyle("borderVerticalNone")),"hidden"===e||a.row===n&&(this.getRowBottom(l,null)>=this.getHeight()||this.m_endColEndHeader>-1)?this.m_utils.addCSSClassName(l,this.getMappedStyle("borderHorizontalNone")):this.m_utils.removeCSSClassName(l,this.getMappedStyle("borderHorizontalNone"))}}},z.prototype._updateEdgeCellBorders=function(e){if(null!=this.m_active&&"cell"===this.m_active.type){var t=this._getActiveElement();null!=t&&((this._isCellEditable()&&""===e||""!==e)&&this._applyBorderClassesAroundRange(t,{startIndex:this.m_active.indexes},""===e,"Edit"),this._isLastRow(this.m_active.indexes.row)&&("none"===e?this.m_utils.addCSSClassName(t,this.getMappedStyle("borderHorizontalNone")):this.m_utils.removeCSSClassName(t,this.getMappedStyle("borderHorizontalNone"))),this._isLastColumn(this.m_active.indexes.column)&&("none"===e?this.m_utils.addCSSClassName(t,this.getMappedStyle("borderVerticalNone")):this.m_utils.removeCSSClassName(t,this.getMappedStyle("borderVerticalNone"))))}},z.prototype.SetResources=function(e){this.m_resources=e},z.prototype.getResources=function(){return this.m_resources},z.prototype.getStartRowHeader=function(){return this.m_startRowHeader},z.prototype.getStartColumnHeader=function(){return this.m_startColHeader},z.prototype.getStartRowEndHeader=function(){return this.m_startRowEndHeader},z.prototype.getStartColumnEndHeader=function(){return this.m_startColEndHeader},z.prototype.getMappedStyle=function(e){return this.getResources().getMappedStyle(e)},z.prototype.SetDataSource=function(e){this.m_modelEvents=[],this.m_dataSource=e},z.prototype.getDataSource=function(){return this.m_dataSource},z.prototype.setVisibility=function(e){this.m_visibility=e},z.prototype.getVisibility=function(){return null==this.m_visibility&&(null!=this.m_root.offsetParent?this.setVisibility(z.VISIBILITY_STATE_VISIBLE):this.setVisibility(z.VISIBILITY_STATE_HIDDEN)),this.m_visibility},z.prototype.SetOptionCallback=function(e){this.m_setOptionCallback=e},z.prototype.SetContextCallback=function(e){this.m_contextCallback=e},z.prototype.SetCustomElementCallback=function(e){this.m_isCustomElementCallback=e},z.prototype.SetRemoveCallback=function(e){this.m_removeCallback=e},z.prototype.SetUniqueIdCallback=function(e){this._uniqueIdCallback=e},z.prototype.SetCompareValuesCallback=function(e){this._compareValuesCallback=e},z.prototype.SetSubtreeAttachedCallback=function(e){this.m_subtreeAttachedCallback=e},z.prototype.SetUpdateScrollPostionOnRefreshCallback=function(e){this.m_updateScrollPostionOnRefreshCallback=e},z.prototype._remove=function(e){null!=e&&(this._uniqueIdCallback(e,!0),this.m_removeCallback.call(null,e))},z.prototype._removeFromArray=function(e){for(var t=0;t<e.length;t++)this._remove(e[t])},z.prototype.SetNotReadyCallback=function(e){this.m_notReady=e},z.prototype.SetMakeReadyCallback=function(e){this.m_makeReady=e},z.prototype._signalTaskStart=function(){this.m_readinessStack&&(0===this.m_readinessStack.length&&this.m_notReady(),this.m_readinessStack.push(1))},z.prototype._signalTaskEnd=function(){this.m_readinessStack&&this.m_readinessStack.length>0&&(this.m_readinessStack.pop(),0===this.m_readinessStack.length&&this.m_makeReady())},z.prototype._indexes=function(e,t){var i=this,s=this.getDataSource().indexes(e);"function"==typeof s.then?(i._signalTaskStart(),s.then(function(s){t.call(i,s,e),i._signalTaskEnd()},function(){t.call(i,{row:-1,column:-1},e),i._signalTaskEnd()})):t.call(i,s,e)},z.prototype._keys=function(e,t){var i=this,s=this._getLocalKeys(e);if(void 0===s){var n=this.getDataSource().keys(e);"function"==typeof n.then?(i._signalTaskStart(),n.then(function(s){t.call(i,s,e),i._signalTaskEnd()},function(){t.call(i,{row:null,column:null},e),i._signalTaskEnd()})):t.call(i,n,e)}else t.call(i,s,e)},z.prototype._getLocalKeys=function(e){var t=this._getCellByIndex(e);if(t)return this.getCellKeys(t);var i,s,n=e.row,o=e.column;if(void 0!==n){if(-1===n)i=null;else{var r=this._getCellOrHeaderByIndex(n,"row");r&&(i=this._getKey(r,"row"))}if(void 0===i)return}if(void 0!==o){if(-1===o)s=null;else{var l=this._getCellOrHeaderByIndex(o,"column");l&&(s=this._getKey(l,"column"))}if(void 0===s)return}return this.createIndex(i,s)},z.prototype.SetCreateContextCallback=function(e){this.m_createContextCallback=e},z.prototype.SetFocusableCallback=function(e,t){this.m_focusInHandler=e,this.m_focusOutHandler=t},z.prototype.SetFixContextCallback=function(e){this.m_fixContextCallback=e},z.prototype.SetCustomElement=function(e){this.m_customElement=e},z.prototype._isHighWatermarkScrolling=function(){return"scroll"!==this.m_options.getScrollPolicy()},z.prototype.destroy=function(){delete this.m_fetching,this._removeDataSourceEventListeners(),this._removeDomEventListeners(),delete this.m_styleClassDimensionMap,this.m_styleClassDimensionMap={width:{},height:{}}},z.prototype._addDataSourceEventListeners=function(){this._removeDataSourceEventListeners(),null!=this.m_dataSource&&(this.m_handleModelEventListener=this.handleModelEvent.bind(this),this.m_handleExpandEventListener=this.handleExpandEvent.bind(this),this.m_handleCollapseEventListener=this.handleCollapseEvent.bind(this),this.m_dataSource.on("change",this.m_handleModelEventListener,this),this.m_dataSource.on("expand",this.m_handleExpandEventListener,this),this.m_dataSource.on("collapse",this.m_handleCollapseEventListener,this))},z.prototype._removeDataSourceEventListeners=function(){null!=this.m_dataSource&&(this.m_dataSource.off("change",this.m_handleModelEventListener),this.m_dataSource.off("expand",this.m_handleExpandEventListener),this.m_dataSource.off("collapse",this.m_handleCollapseEventListener))},z.prototype._addDomEventListeners=function(){this.m_handleDatabodyKeyDown||(this.m_handleDatabodyKeyDown=this.handleDatabodyKeyDown.bind(this)),this.m_handleDatabodyKeyUp||(this.m_handleDatabodyKeyUp=this.handleDatabodyKeyUp.bind(this)),this.m_handleRootFocus||(this.m_handleRootFocus=this.handleRootFocus.bind(this)),this.m_handleRootBlur||(this.m_handleRootBlur=this.handleRootBlur.bind(this)),this.m_root.addEventListener("keydown",this.m_handleDatabodyKeyDown,!1),this.m_root.addEventListener("keyup",this.m_handleDatabodyKeyUp,!1),this.m_root.addEventListener("focus",this.m_handleRootFocus,!0),this.m_root.addEventListener("blur",this.m_handleRootBlur,!0)},z.prototype._removeDomEventListeners=function(){document.removeEventListener("mousemove",this.m_docMouseMoveListener,!1),document.removeEventListener("mouseup",this.m_docMouseUpListener,!1),null!=this.m_root&&(this.m_handleDatabodyKeyDown&&this.m_root.removeEventListener("keydown",this.m_handleDatabodyKeyDown,!1),this.m_handleDatabodyKeyUp&&this.m_root.removeEventListener("keyup",this.m_handleDatabodyKeyUp,!1),this.m_handleRootFocus&&this.m_root.removeEventListener("focus",this.m_handleRootFocus,!0),this.m_handleRootBlur&&this.m_root.removeEventListener("blur",this.m_handleRootBlur,!0))},z.prototype.getRootElement=function(){return this.m_root},z.prototype.getWidth=function(){return null==this.m_width&&(this.m_width=this.getRootElement().clientWidth),this.m_width},z.prototype.getHeight=function(){return null==this.m_height&&(this.m_height=this.getRootElement().clientHeight),this.m_height},z.prototype.getScrollableWidth=function(){var e=this.m_databody.firstChild;return this.getElementWidth(e)},z.prototype.getViewportWidth=function(){var e=this.getWidth();return Math.round(1.5*e)},z.prototype.getViewportHeight=function(){var e=this.getHeight();return Math.round(1.5*e)},z.prototype._getViewportTop=function(){return this.m_currentScrollTop},z.prototype._getViewportBottom=function(){var e=this._getViewportTop(),t=this.getElementHeight(this.m_databody),i=this.m_utils.getScrollbarSize();return this.m_hasHorizontalScroller?e+t-i:e+t},z.prototype._getViewportLeft=function(){return this.m_currentScrollLeft},z.prototype._getViewportRight=function(){var e=this._getViewportLeft(),t=this.getElementWidth(this.m_databody),i=this.m_utils.getScrollbarSize();return this.m_hasVerticalScroller?e+t-i:e+t},z.prototype.getFetchSize=function(e){return"row"===e?(null==this.m_rowFetchSize&&(this.m_rowFetchSize=Math.max(1,Math.round(this.getViewportHeight()/this.getDefaultRowHeight()))),this.m_rowFetchSize):"column"===e?(null==this.m_columnFetchSize&&(this.m_columnFetchSize=Math.max(1,Math.round(this.getViewportWidth()/this.getDefaultColumnWidth()))),this.m_columnFetchSize):0},z.prototype.getEmptyText=function(){var e=this.m_options.getEmptyText();null==e&&(e=this.getResources().getTranslatedText("msgNoData"));return e},z.prototype._buildEmptyText=function(){let e;if(null==this.getDataSource()){let t=this.getWidth(),i=this.getHeight();e=this.buildDatabody(!0)[0],this.setElementWidth(e,t),this.setElementHeight(e,i),this.m_root.insertBefore(e,this.m_status)}const t=this._getTemplateEngine(),i=this._getItemTemplateBySlotName("noData");if(e=this.m_databody,i&&null!=t){let s=document.createElement("div");return s.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),s.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),s.id=this.createSubId("noData"),this.m_utils.addCSSClassName(s,this.getMappedStyle("noDataContainer")),t.execute(this.getRootElement(),i,{},null,e).forEach(function(e){s.appendChild(e)}),this._removeFocusFromChildElements({},s),s}var s=this.getEmptyText(),n=document.createElement("div");return n.id=this.createSubId("empty"),n.className=this.getMappedStyle("emptytext"),n.textContent=s,this.m_empty=n,n},z.prototype.getRowThreshold=function(){return 0},z.prototype.getColumnThreshold=function(){return 0},z.prototype.setDefaultDimensions=function(){var e=document.createElement("div");e.style.visibilty="hidden";var t=this.getResources();e.className=t.getMappedStyle("rowheadercell")+" "+t.getMappedStyle("colheadercell")+" "+t.getMappedStyle("headercell"),this.m_root.appendChild(e);var i=e.getBoundingClientRect();this.m_defaultColumnWidth=Math.round(i.width),this.m_defaultRowHeight=Math.round(i.height),this.getViewportWidth(),this.getViewportHeight(),this.m_root.removeChild(e)},z.prototype.getDefaultRowHeight=function(){return null==this.m_defaultRowHeight&&this.setDefaultDimensions(),this.m_defaultRowHeight},z.prototype.getDefaultColumnWidth=function(){return null==this.m_defaultColumnWidth&&this.setDefaultDimensions(),this.m_defaultColumnWidth},z.prototype._getHeaderDimension=function(e,t,i,s){var n=this.m_sizingManager.getSize(i,t);if(null!=n)return n;if(""!==e.style[s])return n=this.getElementDir(e,s),this.m_sizingManager.setSize(i,t,n),n;var o=e.className;return null==(n=this.m_styleClassDimensionMap[s][o])&&(n=this.getElementDir(e,s)),this.m_sizingManager.setSize(i,t,n),this.m_styleClassDimensionMap[s][o]=n,n},z.prototype.createSubId=function(e){return[this.getRootElement().id,e].join(":")},z.prototype.isHeaderFetchComplete=function(){return!1===this.m_fetching.row&&!1===this.m_fetching.column},z.prototype.isFetchComplete=function(){return null!=this.m_fetching&&this.isHeaderFetchComplete()&&!1===this.m_fetching.cells},z.prototype._isLastRow=function(e){return this._isCountUnknown("row")?e===this.m_endRow&&this.m_stopRowFetch:e+1===this.getDataSource().getCount("row")},z.prototype._isLastColumn=function(e){return this._isCountUnknown("column")?e===this.m_endCol&&this.m_stopColumnFetch:e+1===this.getDataSource().getCount("column")},z.prototype._getLastAxis=function(e){return this._isCountUnknown(e)?("row"===e?this.m_stopRowFetch:this.m_stopColumnFetch)?"row"===e?this.m_endRow:this.m_endCol:"row"===e?this.m_endRow+1:this.m_endCol+1:this.getDataSource().getCount(e)-1},z.prototype.empty=function(){this.m_empty&&this._remove(this.m_empty),this.m_corner&&this._remove(this.m_corner),this.m_bottomCorner&&this._remove(this.m_bottomCorner),this.m_columnHeaderScrollbarSpacer&&this._remove(this.m_columnHeaderScrollbarSpacer),this.m_rowHeaderScrollbarSpacer&&this._remove(this.m_rowHeaderScrollbarSpacer),this.m_root.removeChild(this.m_placeHolder),this.m_root.removeChild(this.m_status),this.m_root.removeChild(this.m_accSummary),this.m_root.removeChild(this.m_accInfo),this.m_root.removeChild(this.m_stateInfo),this.m_root.removeChild(this.m_contextInfo),this._remove(this.m_colHeader),this._remove(this.m_rowHeader),this._remove(this.m_colEndHeader),this._remove(this.m_rowEndHeader),this._remove(this.m_databody),this._remove(this.m_databodyFrozenCol),this._remove(this.m_databodyFrozenRow),this._remove(this.m_databodyFrozenCorner),this._remove(this.m_colHeaderFrozen),this._remove(this.m_colEndHeaderFrozen),this._remove(this.m_rowHeaderFrozen),this._remove(this.m_rowEndHeaderFrozen),this._clearDatabodyMap()},z.prototype.refresh=function(e){this.resetInternal(),this.render(e)},z.prototype.resetInternal=function(){this.m_initialized=!1,this.m_readinessStack=[],this._signalTaskStart(),this._signalTaskEnd(),this._clearDatabodyMap(),this.m_cursor=null,this.m_corner=null,this.m_bottomCorner=null,this.m_columnHeaderScrollbarSpacer=null,this.m_rowHeaderScrollbarSpacer=null,this.m_colHeader=null,this.m_colEndHeader=null,this.m_rowHeader=null,this.m_rowEndHeader=null,this.m_databody=null,this.m_empty=null,this.m_accInfo=null,this.m_accSummary=null,this.m_contextInfo=null,this.m_placeHolder=null,this.m_stateInfo=null,this.m_status=null,this.m_headerLabels={row:[],column:[],rowEnd:[],columnEnd:[]},this.m_rowHeaderFrozen=null,this.m_rowEndHeaderFrozen=null,this.m_colHeaderFrozen=null,this.m_colEndHeaderFrozen=null,this.m_databodyFrozenCorner=null,this.m_databodyFrozenRow=null,this.m_databodyFrozenCol=null,this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.m_rowFetchSize=null,this.m_columnFetchSize=null,this.m_fetching=null,this.m_processingModelEvent=!1,this.m_processingEventQueue=!1,this.m_animating=!1,this.m_fetchingForUpdate=!1,this.m_sizingManager.clear(),this.m_styleClassDimensionMap={width:{},height:{}},this.m_height=null,this.m_width=null,this.m_scrollHeight=null,this.m_scrollWidth=null,this.m_avgRowHeight=void 0,this.m_avgColWidth=void 0,this.m_defaultColumnWidth=null,this.m_defaultRowHeight=null,this.m_colHeaderHeight=null,this.m_colEndHeaderHeight=null,this.m_rowHeaderWidth=null,this.m_rowEndHeaderWidth=null,this.m_rowHeaderLevelWidths=[],this.m_rowEndHeaderLevelWidths=[],this.m_columnHeaderLevelHeights=[],this.m_columnEndHeaderLevelHeights=[],this.m_collisionResize=!1,this.m_active=null,this.m_prevActive=null,this.m_trueIndex={},this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_databodyMove=!1,this.m_moveRow=null,this.m_moveRowHeader=null,this.m_dropTarget=null,this.m_dropTargetHeader=null,this.m_floodFillDragState=!1,this.m_dataTransferAction=null,this.m_discontiguousSelection=!1,this.m_selectionFrontier=null,this.m_docMouseMoveListener=null,this.m_docMouseUpListener=null,this.m_modelEvents=[],this.m_hasHorizontalScroller=null,this.m_hasVerticalScroller=null,this.m_currentScrollLeft=null,this.m_currentScrollTop=null,this.m_prevScrollLeft=null,this.m_prevScrollTop=null,this.m_handleScrollOverflow=null,this._clearScrollPositionTimeout(),this.m_resizing=!1,this.m_resizingElement=null,this.m_resizingElementSibling=null,this.m_resizingElementMin=null,this.m_startRow=null,this.m_startCol=null,this.m_endRow=null,this.m_endCol=null,this.m_startRowPixel=null,this.m_startColPixel=null,this.m_endRowPixel=null,this.m_endColPixel=null,this.m_startRowHeader=null,this.m_startColHeader=null,this.m_endRowHeader=null,this.m_endColHeader=null,this.m_startRowHeaderPixel=null,this.m_startColHeaderPixel=null,this.m_endRowHeaderPixel=null,this.m_endColHeaderPixel=null,this.m_rowHeaderLevelCount=null,this.m_columnHeaderLevelCount=null,this.m_startRowEndHeader=null,this.m_startColEndHeader=null,this.m_endRowEndHeader=null,this.m_endColEndHeader=null,this.m_startRowEndHeaderPixel=null,this.m_startColEndHeaderPixel=null,this.m_endRowEndHeaderPixel=null,this.m_endColEndHeaderPixel=null,this.m_rowEndHeaderLevelCount=null,this.m_columnEndHeaderLevelCount=null,this.m_sortInfo=null,this.m_expandCollapseInfo=null,this.m_resizeRequired=null,this.m_externalFocus=null,this.m_currentMode=null,this.m_editMode=null,this.m_hasCells=null,this.m_hasRowHeader=null,this.m_hasRowEndHeader=null,this.m_hasColHeader=null,this.m_hasColEndHeader=null,this.m_isLongScroll=null,this.m_longScrollRow=null,this.m_longScrollColumn=null,this.m_longScrollRowPixel=null,this.m_longScrollColumnPixel=null,this.m_addBorderBottom=null,this.m_addBorderRight=null,this.m_sortContainerWidth=null,this.m_sortContainerHeight=null,this._resetSkeletonProperties(),this._destroyEditableClone(),this._clearFocusoutTimeout(),this._clearFocusoutBusyState()},z.prototype._shouldInitialize=function(){return this.isFetchComplete()&&!this.m_initialized&&null!=this.m_databody.parentNode},z.prototype._handleInitialization=function(e){!0===e?(this.resizeGrid(),0===this.m_startRow&&0===this.m_startCol&&this.fillViewport(),this.isFetchComplete()&&(this._updateActive(this.m_options.getCurrentCell(),!!this.m_focusOnRefresh,!0),this.m_initialized=!0,this.fireEvent("ready",{}),this._runModelEventQueue())):(this.m_initialized=!0,this.fireEvent("ready",{}),this._runModelEventQueue())},z.prototype._runModelEventQueue=function(){var e;if(null!=this.m_modelEvents){if(this.m_processingEventQueue=!0,0===this.m_modelEvents.length)return void(this.m_processingEventQueue=!1);"expand"===(e=this.m_modelEvents.shift()).operation?this.handleExpandEvent(e,!0):"collapse"===e.operation?this.handleCollapseEvent(e,!0):this.handleModelEvent(e,!0)}else this.m_processingEventQueue=!1},z.prototype.render=function(e){this.m_renderCount+=1,this.m_timingStart=new Date,this.m_fetching={},this.m_startRow=0,this.m_startCol=0,this.m_endRow=-1,this.m_endCol=-1,this.m_startRowPixel=0,this.m_startColPixel=0,this.m_endRowPixel=0,this.m_endColPixel=0,this.m_startRowHeader=0,this.m_startColHeader=0,this.m_endRowHeader=-1,this.m_endColHeader=-1,this.m_startRowHeaderPixel=0,this.m_startColHeaderPixel=0,this.m_endRowHeaderPixel=0,this.m_endColHeaderPixel=0,this.m_startRowEndHeader=0,this.m_startColEndHeader=0,this.m_endRowEndHeader=-1,this.m_endColEndHeader=-1,this.m_startRowEndHeaderPixel=0,this.m_startColEndHeaderPixel=0,this.m_endRowEndHeaderPixel=0,this.m_endColEndHeaderPixel=0,this.m_currentScrollLeft=0,this.m_currentScrollTop=0,this.m_prevScrollLeft=0,this.m_prevScrollTop=0,this.m_handleScrollOverflow=!1,this.m_rowHeaderLevelWidths=[],this.m_rowEndHeaderLevelWidths=[],this.m_columnHeaderLevelHeights=[],this.m_columnEndHeaderLevelHeights=[],this.m_frozenColIndex=null,this.m_frozenRowIndex=null,this._resetSkeletonProperties();var t=this._loadTemplateEngine();t?(this._signalTaskStart("loading template engine"),t.then(()=>{this._signalTaskEnd(),this.m_renderCount-=1,0===this.m_renderCount&&this.buildGrid(e)})):(this.m_renderCount-=1,this.buildGrid(e))},z.prototype._loadTemplateEngine=function(){var e=this._getSlotMap();if(this._isDataGridProvider()&&Object.keys(e).length>1||null==this.getDataSource()&&Object.keys(e).length>0){var t={customElement:this.m_customElement};return new Promise(e=>{p.__getTemplateEngine(t).then(t=>{this.m_engine=t,e(t)},function(e){throw new Error("Error loading template engine: "+e)})})}return null},z.prototype._getTemplateEngine=function(){return this.m_engine},z.prototype._cleanTemplateNodes=function(e){var t=this._getTemplateEngine();null!=t&&t.clean(e,this.m_root)},z.prototype._isDataGridProvider=function(){return this.m_options.options.data&&this.m_options.options.data.fetchByOffset&&!this.m_options.options.data.fetchFirst},z.prototype._getSlotMap=function(){return g.CustomElementUtils.getSlotMap(this.m_root)},z.prototype._getItemTemplateBySlotName=function(e){var t=this._getSlotMap()[e];return t&&t.length>0&&"template"===t[0].tagName.toLowerCase()?t[0]:null},z.prototype.buildGrid=function(e){this.m_root=e,this.m_root.setAttribute("role","application"),this._isCellEditable()?this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("editable")):this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.setDefaultDimensions(),e.tabIndex=0;var t=this.buildStatus();e.appendChild(t),this.m_status=t;var i=this.buildAccSummary();e.appendChild(i),this.m_accSummary=i;var s=this.buildAccInfo();e.appendChild(s),this.m_accInfo=s;var n=this.buildStateInfo();e.appendChild(n),this.m_stateInfo=n;var o=this.buildContextInfo();e.appendChild(o),this.m_contextInfo=o;var r=this.buildPlaceHolder();if(e.appendChild(r),this.m_placeHolder=r,this.m_headerLabels={row:[],column:[],rowEnd:[],columnEnd:[]},null!=this.getDataSource()){this.m_empty=null;var l=this.getResources().isRTLMode(),a=this.buildHeaders("column",this.getMappedStyle("colheader"),this.getMappedStyle("colendheader")),h=a.root,d=a.endRoot;let i=a.frozenHeader,s=a.frozenEndHeader;e.insertBefore(h,t),e.insertBefore(d,t),i&&e.insertBefore(i,t),s&&e.insertBefore(s,t);var m=(a=this.buildHeaders("row",this.getMappedStyle("rowheader"),this.getMappedStyle("rowendheader"))).root,c=a.endRoot;const n=a.frozenHeader,o=a.frozenEndHeader;e.insertBefore(m,t),e.insertBefore(c,t),n&&e.insertBefore(n,t),o&&e.insertBefore(o,t);const r=this.buildDatabody();for(let i=0;i<r.length;i++)e.insertBefore(r[i],t);const _=r[0];if(l&&(h.style.direction="rtl",_.style.direction="rtl"),this.m_isResizing=!1,this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_databodyDragState=!1,this.m_docMouseMoveListener=this.handleMouseMove.bind(this),this.m_docMouseUpListener=this.handleMouseUp.bind(this),this.m_utils.isTouchDevice())_.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),_.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),_.addEventListener("touchend",this.handleTouchEnd.bind(this),!1),_.addEventListener("touchcancel",this.handleTouchCancel.bind(this),!1),h.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),h.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),h.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),h.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),m.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),m.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),m.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),m.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),d.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),d.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),d.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),d.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),c.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),c.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),c.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),c.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1);else{var u=this.m_utils.getMousewheelEvent();_.addEventListener(u,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),_.addEventListener("mousedown",this.handleDatabodyMouseDown.bind(this),!1),_.addEventListener("mousemove",this.handleDatabodyMouseMove.bind(this),!1),_.addEventListener("mouseup",this.handleDatabodyMouseUp.bind(this),!1),_.addEventListener("mouseout",this.handleDatabodyMouseOut.bind(this),!1),_.addEventListener("mouseover",this.handleDatabodyMouseOver.bind(this),!1),_.addEventListener("dblclick",this.handleDatabodyDoubleClick.bind(this),!1),m.addEventListener(u,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),h.addEventListener(u,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),m.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),h.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),m.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),h.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),m.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),h.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),m.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),h.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),m.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),h.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),m.addEventListener("click",this.handleHeaderClick.bind(this),!1),m.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),h.addEventListener("click",this.handleHeaderClick.bind(this),!1),h.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),c.addEventListener(u,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),d.addEventListener(u,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),c.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),d.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),c.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),d.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),c.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),d.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),c.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),d.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),c.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),d.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),c.addEventListener("click",this.handleHeaderClick.bind(this),!1),c.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),d.addEventListener("click",this.handleHeaderClick.bind(this),!1),d.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1)}this._addDnDEventListener(m,c,h,d,_),this._addListenersOnFrozenSections(n,o,i,s),this._shouldInitialize()&&this._handleInitialization(!0)}else{var _=this._buildEmptyText();this.m_databody.firstChild.appendChild(_),this._handleInitialization(!1)}},z.prototype._addDnDEventListener=function(e,t,i,s,n){e&&(e.addEventListener("drag",this.handleRowDrag.bind(this),!1),e.addEventListener("dragstart",this.handleDragStart.bind(this),!1),e.addEventListener("dragend",this.handleRowDragEnd.bind(this),!1),e.addEventListener("dragover",this.handleRowDragOver.bind(this),!1),e.addEventListener("dragenter",this.handleRowDragEnter.bind(this),!1),e.addEventListener("dragleave",this.handleRowDragLeave.bind(this),!1),e.addEventListener("drop",this.handleRowDrop.bind(this),!1)),i&&(i.addEventListener("dragstart",this.handleDragStart.bind(this),!1),i.addEventListener("dragend",this.handleColumnDragEnd.bind(this),!1),i.addEventListener("dragover",this.handleColumnDragOver.bind(this),!1),i.addEventListener("dragenter",this.handleColumnDragEnter.bind(this),!1),i.addEventListener("dragleave",this.handleColumnDragLeave.bind(this),!1),i.addEventListener("drop",this.handleColumnDrop.bind(this),!1)),t&&(t.addEventListener("drag",this.handleRowDrag.bind(this),!1),t.addEventListener("dragstart",this.handleDragStart.bind(this),!1),t.addEventListener("dragend",this.handleRowDragEnd.bind(this),!1),t.addEventListener("dragover",this.handleRowDragOver.bind(this),!1),t.addEventListener("dragenter",this.handleRowDragEnter.bind(this),!1),t.addEventListener("dragleave",this.handleRowDragLeave.bind(this),!1),t.addEventListener("drop",this.handleRowDrop.bind(this),!1)),s&&(s.addEventListener("dragstart",this.handleDragStart.bind(this),!1),s.addEventListener("dragend",this.handleColumnDragEnd.bind(this),!1),s.addEventListener("dragover",this.handleColumnDragOver.bind(this),!1),s.addEventListener("dragenter",this.handleColumnDragEnter.bind(this),!1),s.addEventListener("dragleave",this.handleColumnDragLeave.bind(this),!1),s.addEventListener("drop",this.handleColumnDrop.bind(this),!1)),n&&(n.addEventListener("dragover",this.handleDatabodyDragOver.bind(this),!1),n.addEventListener("dragenter",this.handleDatabodyDragEnter.bind(this),!1),n.addEventListener("drop",this.handleDatabodyDrop.bind(this),!1))},z.prototype._addListenersOnFrozenSections=function(e,t,i,s){const n=this.m_utils.getMousewheelEvent();let o=[this.m_databodyFrozenCorner,this.m_databodyFrozenCol,this.m_databodyFrozenRow];o=o.filter(e=>e);for(let e=0;e<o.length;e++){let t=o[e];this.m_utils.isTouchDevice()?(t.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),t.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),t.addEventListener("touchend",this.handleTouchEnd.bind(this),!1),t.addEventListener("touchcancel",this.handleTouchCancel.bind(this),!1)):(t.addEventListener(n,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),t.addEventListener("mousedown",this.handleDatabodyMouseDown.bind(this),!1),t.addEventListener("mousemove",this.handleDatabodyMouseMove.bind(this),!1),t.addEventListener("mouseup",this.handleDatabodyMouseUp.bind(this),!1),t.addEventListener("mouseout",this.handleDatabodyMouseOut.bind(this),!1),t.addEventListener("mouseover",this.handleDatabodyMouseOver.bind(this),!1),t.addEventListener("dblclick",this.handleDatabodyDoubleClick.bind(this),!1),t.addEventListener("dragover",this.handleDatabodyDragOver.bind(this),!1),t.addEventListener("dragenter",this.handleDatabodyDragEnter.bind(this),!1),t.addEventListener("drop",this.handleDatabodyDrop.bind(this),!1))}e&&(this.m_utils.isTouchDevice()?(e.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),e.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),e.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),e.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1)):(e.addEventListener(n,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),e.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),e.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),e.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),e.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),e.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),e.addEventListener("click",this.handleHeaderClick.bind(this),!1),e.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1))),i&&(this.m_utils.isTouchDevice()?(i.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),i.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),i.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),i.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1)):(i.addEventListener(n,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),i.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),i.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),i.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),i.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),i.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),i.addEventListener("click",this.handleHeaderClick.bind(this),!1),i.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1))),t&&(this.m_utils.isTouchDevice()?(t.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),t.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),t.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),t.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1)):(t.addEventListener(n,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),t.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),t.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),t.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),t.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),t.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),t.addEventListener("click",this.handleHeaderClick.bind(this),!1),t.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1))),s&&(this.m_utils.isTouchDevice()?(s.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),s.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),s.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),s.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1)):(s.addEventListener(n,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),s.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),s.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),s.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),s.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),s.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),s.addEventListener("click",this.handleHeaderClick.bind(this),!1),s.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1))),this._addDnDEventListener(e,t,i,s)},z.prototype.HandleResize=function(e,t){e=this.getRootElement().clientWidth,t=this.getRootElement().clientHeight,e===this.m_width&&t===this.m_height||(this.m_width=e,this.m_height=t,this.m_rowFetchSize=null,this.m_columnFetchSize=null,this.m_initialized&&(this.resizeGrid(),this.isFetchComplete()&&(this.m_resizeRequired=!0,this.fillViewport())))},z.prototype.resizeGrid=function(){var e=this.getWidth(),t=this.getHeight(),i=this.m_colHeader,s=this.m_colEndHeader,n=this.m_rowHeader,o=this.m_rowEndHeader,r=this.m_databody,l=r.firstChild;const a=this.m_databodyFrozenCol,h=this.m_databodyFrozenRow;let d=0,m=0;var c=this.getColumnHeaderHeight(),u=this.getColumnEndHeaderHeight(),_=this.getRowHeaderWidth(),p=this.getRowEndHeaderWidth();a&&(d=this.getElementWidth(a)),h&&(m=this.getElementHeight(h)),this._hasFrozenColumns()&&this._hasFrozenRows()&&(d||(d=this.getElementWidth(this.m_databodyFrozenCorner)),m||(m=this.getElementHeight(this.m_databodyFrozenCorner))),this.m_headerLabels.row&&this.m_headerLabels.row.length&&0===c&&(c=this._getCellDimension(this.m_headerLabels.row[0],0,null,"column","height"),this.m_colHeaderHeight=c),this.m_headerLabels.column&&this.m_headerLabels.column.length&&0===_&&(_=this._getCellDimension(this.m_headerLabels.column[0],0,null,"row","width"),this.m_rowHeaderWidth=_);var g,C,f,y=t-c-u-m,E=e-_-p-d,v=this.m_utils.getScrollbarSize();this._databodyEmpty()&&(null==this.m_empty?(g=this._buildEmptyText(),C=this.getElementHeight(g),f=this.getElementWidth(g),l=r.firstChild,C>this.getElementHeight(l)&&this.setElementHeight(l,C),f>this.getElementWidth(l)&&this.setElementWidth(l,f),this.m_databody.firstChild.appendChild(g)):g=this.m_empty);var w,H,S,x,b,R=this.getElementWidth(r.firstChild),I=this.getElementHeight(r.firstChild),M=this.isDatabodyHorizontalScrollbarRequired(E);if(M)w=this.isDatabodyVerticalScrollbarRequired(y-v),r.style.overflow="auto";else if(w=this.isDatabodyVerticalScrollbarRequired(y))M=this.isDatabodyHorizontalScrollbarRequired(E-v),r.style.overflow="auto";else{this.m_handleScrollOverflow=!1;var F=this;setTimeout(function(){F.m_handleScrollOverflow||F.m_hasVerticalScroller||F.m_hasHorizontalScroller||(r.style.overflow="hidden",F.m_handleScrollOverflow=!0)},10)}this.m_hasHorizontalScroller=M,this.m_hasVerticalScroller=w,-1!==this.m_endColEndHeader?(H=Math.min(I+(M?v:0),y),S=M?H-v:H):(H=y,S=Math.min(I,M?H-v:H)),-1!==this.m_endRowEndHeader?(x=Math.min(R+(w?v:0),E),b=w?x-v:x):(x=E,b=Math.min(R,w?x-v:x));var z=_+b+d+(w?v:0),D=c+S+m+(M?v:0),L=this.getResources().isRTLMode()?"right":"left";this.setElementDir(n,0,L),this.setElementDir(n,c,"top"),this.setElementHeight(n,S),this.setElementDir(o,z,L),this.setElementDir(o,c,"top"),this.setElementHeight(o,S),this.setElementDir(i,_,L),this.setElementWidth(i,b),this.setElementDir(s,_,L),this.setElementDir(s,D,"top"),this.setElementWidth(s,b),[_,c]=this._setFrozenContainerDimension(E,y,_,p,c,u),this.setElementDir(r,c,"top"),this.setElementDir(r,_,L),this.setElementWidth(r,x),this.setElementHeight(r,H),this.m_scrollWidth=R-b,this.m_scrollHeight=I-S,this.buildCorners(),this._adjustHeaderBorders(),this._updateGridlines(),this.m_resizeRequired=!1},z.prototype._sizeDatabodyScroller=function(){var e=this.m_databody,t=e.firstChild,i=0,s=0;this._databodyEmptyState()?(i=Math.max(Math.max(this.m_endRowHeaderPixel,this.m_endRowEndHeaderPixel),1),s=Math.max(Math.max(this.m_endColHeaderPixel,this.m_endColEndHeaderPixel),1)):(i=this.m_endRowPixel,s=this.m_endColPixel),this._setScrollerDimension(t,i,s),this.m_initialized&&(this.m_scrollWidth=this.getElementWidth(t)-Math.min(this.getElementWidth(t),this.getElementWidth(e)-(this.m_hasVerticalScroller?this.m_utils.getScrollbarSize():0)),this.m_scrollHeight=this.getElementHeight(t)-Math.min(this.getElementHeight(t),this.getElementHeight(e)-(this.m_hasHorizontalScroller?this.m_utils.getScrollbarSize():0)))},z.prototype._setScrollerDimension=function(e,t,i){let s=this._isHighWatermarkScrolling(),n=this.m_utils._getMaxDivHeightForScrolling(),o=this.m_utils._getMaxDivWidthForScrolling(),r=this.getDataSource().getCount("row"),l=this.getDataSource().getCount("column"),a=0,h=0;a=-1===r||s?t:r*this.m_avgRowHeight,h=-1===l||s?i:l*this.m_avgColWidth,this.setElementHeight(e,Math.min(n,a)),this.setElementWidth(e,Math.min(o,h))},z.prototype._adjustLastHeadersAlongAxis=function(e,t,i,s,n,o,r){for(var l=0;l<t;){let t=this._getHeaderCellByIndex(e,r,l);o?this.m_utils.removeCSSClassName(t,n):this.m_utils.addCSSClassName(t,n),l+=this.getHeaderCellDepth(t)}},z.prototype._adjustHeaderBordersAlongAxis=function(e,t,i,s,n,o,r,l,a){null!=e&&i>=0&&(s?this.m_utils.addCSSClassName(n,o):this.m_utils.removeCSSClassName(n,o),t(i)&&this._adjustLastHeadersAlongAxis(i,r,e,l,o,s,a))},z.prototype._adjustHeaderBorders=function(){var e,t,i,s,n,o=this.m_utils.getScrollbarSize(),r=this.getWidth(),l=this.getHeight(),a=this.getColumnHeaderHeight(),h=this.getElementWidth(this.m_colHeader),d=this.getColumnEndHeaderHeight(),m=this.getRowHeaderWidth(),c=this.getElementHeight(this.m_rowHeader),u=m+h+this.getRowEndHeaderWidth()+(this.m_hasVerticalScroller?o:0)<r,_=a+c+d+(this.m_hasHorizontalScroller?o:0)<l;if(u&&this.m_endRowEndHeader>=0?(e=!0,this.m_addBorderRight=!0):!0===this.m_addBorderRight&&(e=!1),null!=e)for(t=this.getMappedStyle("borderVerticalSmall"),null!=this.m_columnHeaderScrollbarSpacer&&(e?this.m_utils.addCSSClassName(this.m_columnHeaderScrollbarSpacer,t):this.m_utils.removeCSSClassName(this.m_columnHeaderScrollbarSpacer,t)),null!=this.m_bottomCorner&&(e?this.m_utils.addCSSClassName(this.m_bottomCorner,t):this.m_utils.removeCSSClassName(this.m_bottomCorner,t)),s=this.m_rowEndHeader.firstChild.childNodes,i=0;i<s.length;i++)e?this.m_utils.addCSSClassName(s[i],t):this.m_utils.removeCSSClassName(s[i],t);else{t=this.getMappedStyle("borderVerticalNone"),n=this._isLastColumn.bind(this);let e=this.m_startColHeader,i=this.m_startColEndHeader;this._hasFrozenColumns()&&(e=this.m_frozenColIndex+1,i=e),this._adjustHeaderBordersAlongAxis(this.m_colHeader,n,this.m_endColHeader,u,this.m_columnHeaderScrollbarSpacer,t,this.m_columnHeaderLevelCount,e,"column"),this._adjustHeaderBordersAlongAxis(this.m_colEndHeader,n,this.m_endColEndHeader,u,this.m_bottomCorner,t,this.m_columnEndHeaderLevelCount,i,"columnEnd")}if(e=null,_&&this.m_endColEndHeader>=0?(this.m_addBorderBottom=!0,e=!0):!0===this.m_addBorderBottom&&(e=!1),null!=e){t=this.getMappedStyle("borderHorizontalSmall"),null!=this.m_rowHeaderScrollbarSpacer&&(e?this.m_utils.addCSSClassName(this.m_rowHeaderScrollbarSpacer,t):this.m_utils.removeCSSClassName(this.m_rowHeaderScrollbarSpacer,t)),null!=this.m_bottomCorner&&(e?this.m_utils.addCSSClassName(this.m_bottomCorner,t):this.m_utils.removeCSSClassName(this.m_bottomCorner,t)),s=this.m_colEndHeader.firstChild.childNodes;const n=this.getMappedStyle("groupingcontainer");for(i=0;i<s.length;i++){let o=s[i];o.classList.contains(n)&&(o=o.firstChild),e?this.m_utils.addCSSClassName(o,t):this.m_utils.removeCSSClassName(o,t)}}else{t=this.getMappedStyle("borderHorizontalNone"),n=this._isLastRow.bind(this);let e=this.m_startRowHeader,i=this.m_startRowEndHeader;null!==this.m_frozenRowIndex&&(e=this.m_frozenRowIndex+1,i=e),this._adjustHeaderBordersAlongAxis(this.m_rowHeader,n,this.m_endRowHeader,_,this.m_rowHeaderScrollbarSpacer,t,this.m_rowHeaderLevelCount,e,"row"),this._adjustHeaderBordersAlongAxis(this.m_rowEndHeader,n,this.m_endRowEndHeader,_,this.m_bottomCorner,t,this.m_rowEndHeaderLevelCount,i,"rowEnd")}},z.prototype._isHeaderLabelCollision=function(){return this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]},z.prototype.buildCorners=function(){var e,t,i,s,n=this.m_utils.getScrollbarSize(),o=this.getWidth(),r=this.getHeight(),l=this.getColumnHeaderHeight(),a=this.getElementWidth(this.m_colHeader),h=this.getColumnEndHeaderHeight(),d=this.getRowHeaderWidth(),m=this.getRowEndHeaderWidth(),c=this.getElementHeight(this.m_rowHeader),u=this.getResources().isRTLMode()?"right":"left";let _,p,g,C,f,y,E=!0,v=l,w=d,H=0,S=0;const x=this.m_databodyFrozenCol,b=this.m_databodyFrozenRow;if(x&&(H=this.getElementWidth(x)),b&&(S=this.getElementHeight(b)),-1!==this.m_endRowHeader&&-1!==this.m_endColHeader?(p=this.m_headerLabels.column.length?this.m_columnHeaderLevelHeights[this.m_columnHeaderLevelCount-1]:this.m_colHeaderHeight,_=this.m_headerLabels.row.length?this.m_rowHeaderLevelWidths[this.m_rowHeaderLevelCount-1]:this.m_rowHeaderWidth,f=c+l+S,y=h+(this.m_hasHorizontalScroller?n:0),g=d+a+H,C=m+(this.m_hasVerticalScroller?n:0)):-1!==this.m_endRowHeader&&-1===this.m_endColHeader?(p=l,f=c+l+S,y=h+(this.m_hasHorizontalScroller?n:0),g=d,C=m+a+H+(this.m_hasVerticalScroller?n:0)):-1===this.m_endRowHeader&&-1!==this.m_endColHeader?(_=d,f=l,y=h+c+S+(this.m_hasHorizontalScroller?n:0),g=d+a+H,C=m+(this.m_hasVerticalScroller?n:0)):E=!1,E){if(null!=this.m_corner?e=this.m_corner:((e=document.createElement("div")).id=this.createSubId("corner"),e.className=this.getMappedStyle("topcorner")),this.setElementWidth(e,d),this.setElementHeight(e,l),null==this.m_corner){if(this._attachEventListenersOnCorner(e),this.m_root.appendChild(e),this.m_corner=e,p)for(s=0;s<this.m_headerLabels.row.length;s++)null!=(i=this.m_headerLabels.row[s])&&(this.setElementHeight(i,p),e.appendChild(i));if(_)for(s=0;s<this.m_headerLabels.column.length;s++)null!=(i=this.m_headerLabels.column[s])&&(this.setElementWidth(i,_),e.appendChild(i));if(this.m_subtreeAttachedCallback(e),this._isHeaderLabelCollision()){let e=this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],t=this.getElementHeight(e);return this.m_colHeaderHeight+=t,this.m_columnHeaderLevelHeights[this.m_columnHeaderLevelCount-1]+=t,this.resizeColumnHeightsAndShift(t,this.m_columnHeaderLevelCount-1,!1),this.setElementHeight(this.m_colHeader,this.m_colHeaderHeight),this.m_colHeaderFrozen&&this.setElementHeight(this.m_colHeaderFrozen,this.m_colHeaderHeight),void this.manageResizeScrollbars()}}else{this.m_utils.isTouchDevice()?(e.addEventListener("touchstart",this.handleHeaderLabelMouseDown.bind(this),!1),e.addEventListener("touchmove",this.handleHeaderLabelMouseMove.bind(this),!1)):(e.addEventListener("mousedown",this.handleHeaderLabelMouseDown.bind(this),!1),e.addEventListener("mousemove",this.handleHeaderLabelMouseMove.bind(this),!1))}this._buildCornerOnHeaderAxisDisabled("row",u,0,f,w,y),this._buildCornerOnHeaderAxisDisabled("column",u,g,0,C,v)}else this.m_headerLabels.row=[],this.m_headerLabels.column=[];null!=this.m_corner&&null==e&&(this.m_root.removeChild(this.m_corner),this.m_corner=null),(this.m_hasHorizontalScroller&&this.m_hasVerticalScroller||this.m_hasVerticalScroller&&-1!==this.m_endColEndHeader||this.m_hasHorizontalScroller&&-1!==this.m_endRowEndHeader||-1!==this.m_endRowEndHeader&&-1!==this.m_endColEndHeader)&&(null!=this.m_bottomCorner?t=this.m_bottomCorner:((t=document.createElement("div")).id=this.createSubId("bcorner"),t.className=this.getMappedStyle("bottomcorner")),this.setElementDir(t,c+l+S,"top"),this.setElementDir(t,d+a+H,u),-1!==this.m_endRowEndHeader?this.setElementWidth(t,m+(this.m_hasVerticalScroller?n:0)):this.setElementWidth(t,o-a-d-H),-1!==this.m_endColEndHeader?this.setElementHeight(t,h+(this.m_hasHorizontalScroller?n:0)):this.setElementHeight(t,r-c-l-S),null==this.m_bottomCorner&&(this.m_root.appendChild(t),this.m_bottomCorner=t)),null!=this.m_bottomCorner&&null==t&&(this.m_root.removeChild(this.m_bottomCorner),this.m_bottomCorner=null)},z.prototype._attachEventListenersOnCorner=function(e){this.m_utils.isTouchDevice()?e.addEventListener("touchstart",this.handleCornerMouseDown.bind(this),{passive:!0}):(e.addEventListener("mousedown",this.handleCornerMouseDown.bind(this),!1),e.addEventListener("mouseover",this.handleCornerMouseOver.bind(this),!1),e.addEventListener("mouseout",this.handleCornerMouseOut.bind(this),!1)),e.addEventListener("click",this.handleCornerClick.bind(this),!1)},z.prototype._buildCornerOnHeaderAxisDisabled=function(e,t,i,s,n,o){let r,l="column"===e?this.m_columnHeaderScrollbarSpacer:this.m_rowHeaderScrollbarSpacer,a=!1;if("column"===e?(this.m_hasVerticalScroller||-1!==this.m_endRowEndHeader)&&(a=!0,null!=this.m_columnHeaderScrollbarSpacer?r=this.m_columnHeaderScrollbarSpacer:(r=document.createElement("div"),r.id=this.createSubId("chSbSpacer"),r.className=this.getMappedStyle("colheaderspacer"))):"row"===e&&(this.m_hasHorizontalScroller||-1!==this.m_endColEndHeader)&&(a=!0,null!=this.m_rowHeaderScrollbarSpacer?r=this.m_rowHeaderScrollbarSpacer:(r=document.createElement("div"),r.id=this.createSubId("rhSbSpacer"),r.className=this.getMappedStyle("rowheaderspacer"))),a){let a,h;if(this.setElementDir(r,i,t),this.setElementDir(r,s,"top"),this.setElementWidth(r,n),this.setElementHeight(r,o),null==l){if(this.m_utils.isTouchDevice()?r.addEventListener("touchstart",this.handleCornerMouseDown.bind(this),{passive:!0}):(r.addEventListener("mousedown",this.handleCornerMouseDown.bind(this),!1),r.addEventListener("mouseover",this.handleCornerMouseOver.bind(this),!1),r.addEventListener("mouseout",this.handleCornerMouseOut.bind(this),!1),"disable"!==this.isResizeEnabled()&&(r.addEventListener("mousedown",this.handleHeaderLabelMouseDown.bind(this),!1),r.addEventListener("mousemove",this.handleHeaderLabelMouseMove.bind(this),!1))),this.m_root.appendChild(r),"column"===e?(this.m_columnHeaderScrollbarSpacer=r,a=this.m_headerLabels.rowEnd):(this.m_rowHeaderScrollbarSpacer=r,a=this.m_headerLabels.columnEnd),a.length)for(let e=0;e<a.length;e++)h=a[e],null!=h&&r.appendChild(h);this.m_subtreeAttachedCallback(r)}}else"column"===e?(null!=this.m_columnHeaderScrollbarSpacer&&this.m_root.removeChild(this.m_columnHeaderScrollbarSpacer),this.m_columnHeaderScrollbarSpacer=null,this.m_headerLabels.rowEnd=[]):(null!=this.m_rowHeaderScrollbarSpacer&&this.m_root.removeChild(this.m_rowHeaderScrollbarSpacer),this.m_rowHeaderScrollbarSpacer=null,this.m_headerLabels.columnEnd=[])},z.prototype._updateScrollPosition=function(e){this._scrollToScrollPositionObject(e)},z.prototype._setScrollPosition=function(){this.m_setOptionCallback("scrollPosition",this._createScrollPositionObject(this.m_currentScrollLeft,this.m_currentScrollTop),{_context:{writeback:!0,internalSet:!0}})},z.prototype._clearScrollPositionKeys=function(){var e=this.m_options.getScrollPosition();e.rowKey=void 0,e.columnKey=void 0,this.m_setOptionCallback("scrollPosition",e,{_context:{internalSet:!0}})},z.prototype._createScrollPositionObject=function(e,t){var i={x:e,y:t},s=this.getResources().isRTLMode()?"right":"left",n=this._getCellAtPixel(e,t);if(null!=n)i.rowIndex=this._getIndex(n,"row"),i.columnIndex=this._getIndex(n,"column"),i.rowKey=this._getKey(n,"row"),i.columnKey=this._getKey(n,"column"),i.offsetX=e-this.getElementDir(n,s),i.offsetY=t-this.getElementDir(n,"top");else{var o=this._getHeaderAtPixel(t,"row");null!=o&&(i.rowIndex=this._getIndex(o),i.rowKey=this._getKey(o),i.offsetY=t-this.getElementDir(o,"top"));var r=this._getHeaderAtPixel(e,"column");null!=r&&(i.columnIndex=this._getIndex(r),i.columnKey=this._getKey(r),i.offsetX=e-this.getElementDir(r,s))}return i},z.prototype._getCellAtPixel=function(e,t){for(var i=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),s=this.getResources().isRTLMode()?"right":"left",n=0;n<i.length;n++){var o=i[n],r=this.getElementDir(o,s),l=r+this.getElementWidth(o);if(r<=e&&e<l){var a=this.getElementDir(o,"top"),h=a+this.getElementHeight(o);if(a<=t&&t<h)return o}}return null},z.prototype._getAxisInnerMostHeaders=function(e){var t,i,s=this.getMappedStyle("headercell");switch(e){case"row":t=this.m_rowHeader,i=this.m_rowHeaderLevelCount;break;case"column":t=this.m_colHeader,i=this.m_columnHeaderLevelCount;break;case"rowEnd":t=this.m_rowEndHeader,i=this.m_rowEndHeaderLevelCount;break;case"columnEnd":t=this.m_colEndHeader,i=this.m_columnEndHeaderLevelCount}var n=[];if(t)for(var o=t.getElementsByClassName(s),r=0;r<o.length;r++){var l=o[r],a=l[this.getResources().getMappedAttribute("context")];a.level+a.depth===i&&n.push(l)}return n},z.prototype._getHeaderAtPixel=function(e,t){var i,s,n,o,r=this;function l(t){for(var i=0;i<t.length;i++){var s=t[i],l=r.getElementDir(s,n),a=l+r.getElementDir(s,o);if(l<=e&&e<a)return s}}i=this._getAxisInnerMostHeaders(t),s=this._getAxisInnerMostHeaders(t+"End"),"row"===t?(n="top",o="height"):"column"===t&&(n=this.getResources().isRTLMode()?"right":"left",o="width");var a=l(i);return null==a&&(a=l(s)),a},z.prototype._checkScrollPosition=function(){null!=this.m_desiredScrollPositionObject?this._scrollToScrollPositionObject(this.m_desiredScrollPositionObject):this._setScrollPosition()},z.prototype._areKeysLocallyAvailable=function(e,t){var i=!0;return e&&null==this._getCellOrHeaderByKey(e,"row")&&(i=!1),t&&null==this._getCellOrHeaderByKey(t,"column")&&(i=!1),i},z.prototype._scrollToScrollPositionObject=function(e){var t=e.x,i=e.y,s=e.rowIndex,n=e.columnIndex,o=e.rowKey,r=e.columnKey,l=e.offsetX?e.offsetX:0,a=e.offsetY?e.offsetY:0,h=this.getResources().isRTLMode()?"right":"left",d=this.m_options.getScrollToKey();if("never"!==d||!o&&!r){if("always"!==d)if(this.getDataSource()instanceof H&&!this._areKeysLocallyAvailable(o,r)){var m=this.m_options.getProperty("data").getCapability("fetchFirst");if(null==m||"immediate"!==m.iterationSpeed)return}var c=this;this._getIndexFromKeyPromise(o,r).then(function(d){var m=Math.floor(c._getPositionEstimate("column",h,r,d.columnIndexFromKey,n,t,l,c.m_currentScrollLeft,c._getMaxRightPixel(),c.m_avgColWidth)),u=Math.floor(c._getPositionEstimate("row","top",o,d.rowIndexFromKey,s,i,a,c.m_currentScrollTop,c._getMaxBottomPixel(),c.m_avgRowHeight));m!==c.m_currentScrollLeft&&(c.m_currentScrollLeft!==c.m_scrollWidth||m<c.m_currentScrollLeft)||u!==c.m_currentScrollTop&&(c.m_currentScrollTop!==c.m_scrollHeight||u<c.m_currentScrollTop)?(null==c.m_desiredScrollPositionObject&&c._signalTaskStart("begin scrolling to new desired location"),c.m_desiredScrollPositionObject=e,c._setScrollPositionTimeout(),c._initiateScroll(m,u)):(null!=c.m_desiredScrollPositionObject&&c._signalTaskEnd("reached desired location"),c.m_desiredScrollPositionObject=null,c._setScrollPosition())})}},z.prototype._setScrollPositionTimeout=function(){this.m_utils.isTouchDeviceNotIOS()||(this.pendingScrollTimeout=setTimeout(function(){null!=this.m_desiredScrollPositionObject&&this._signalTaskEnd("reached desired location"),this.m_desiredScrollPositionObject=null,this._setScrollPosition()}.bind(this),300))},z.prototype._clearScrollPositionTimeout=function(){null!=this.pendingScrollTimeout&&(clearTimeout(this.pendingScrollTimeout),this.pendingScrollTimeout=null)},z.prototype._getPositionEstimate=function(e,t,i,s,n,o,r,l,a,h){var d,m,c=this._isHighWatermarkScrolling();return null!=i&&-1!==s&&(null!=(m=this._getCellOrHeaderByKey(i,e))?d=this.getElementDir(m,t)+r:c?d=a:null!=s&&(d=h*s+r),null!=d)?d:d=null!=n?null!=(m=this._getCellOrHeaderByIndex(n,e))?this.getElementDir(m,t)+r:c?a:h*n:null!=o?o:l},z.prototype.isDatabodyHorizontalScrollbarRequired=function(e){var t=this.m_databody.firstChild;return this.getElementWidth(t)>e},z.prototype.isDatabodyVerticalScrollbarRequired=function(e){var t=this.m_databody.firstChild;return this.getElementHeight(t)>e},z.prototype.buildStatus=function(){var e=document.createElement("div");return e.id=this.createSubId("status"),e.className=this.getMappedStyle("status"),e.setAttribute("role","status"),e},z.prototype.buildAccInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("info"),e.className=this.getMappedStyle("info"),e.setAttribute("role","status"),e},z.prototype.buildAccSummary=function(){var e=document.createElement("div");return e.id=this.createSubId("summary"),e.className=this.getMappedStyle("info"),e},z.prototype.buildStateInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("state"),e.className=this.getMappedStyle("info"),e},z.prototype.buildContextInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("context"),e.className=this.getMappedStyle("info"),e},z.prototype.buildPlaceHolder=function(){var e=document.createElement("div");return e.id=this.createSubId("placeHolder"),e.className=this.getMappedStyle("info"),e},z.prototype.populateAccInfo=function(){var e=this.getResources().getTranslatedText("accessibleSummaryExact",{rownum:this.m_endRow+1,colnum:this.m_endCol+1});this.getDataSource().getExpandedKeys&&(e=e+". "+this.getResources().getTranslatedText("accessibleSummaryExpanded",{num:this.getDataSource().getExpandedKeys().length}));e+=". ",this.m_accSummary.textContent=e},z.prototype.SetAccessibleContext=function(e){if(null!=e&&(null!=e.context&&(this.m_accessibleContext=e.context),null!=e.state&&(this.m_stateInfo.textContent=e.state),null!=e.ancestors&&this._isDatabodyCellActive())){var t="",i=e.ancestors,s=this.m_active.indexes.column;if(null!=s&&s>=0)for(var n=0;n<i.length;n++){n>0&&(t=t.concat(", "));var o=i[n],r=this._getAxisCellsByKey(o.key,"row");if(null!=r){var l=r[0].textContent;l=null!=l?l.replace(/\n|<br\s*\/?>/gi,"").trim():"",t=t.concat(o.label).concat(" ").concat(l)}}this.m_accessibleContext=t.concat(", ").concat(this.m_accessibleContext)}},z.prototype._updateStateInfo=function(e){for(var t=". ",i=0;i<e.length;i++){var s=this.getResources().getTranslatedText(e[i].key,e[i].args);null!=s&&(t=2===t.length?t+s:t+", "+s)}t=2===t.length?t:t+". ",this.m_stateInfo.textContent=t},z.prototype._updateContextInfo=function(e,t){var i,s;e.indexes&&(i=e.indexes.row,s=e.indexes.column);var n=e.level,o=e.rowHeader,r=e.rowEndHeader,l=e.columnHeader,a=e.columnEndHeader,h=e.rowHeaderLabel,d=e.rowEndHeaderLabel,m=e.columnHeaderLabel,c=e.columnEndHeaderLabel,u="";null!=this.m_accessibleContext||isNaN(i)||"row"===t||(u=this._updateAccessibleInfoString(u,"accessibleRowContext",{index:i+1})),isNaN(s)||"column"===t||(u=this._updateAccessibleInfoString(u,"accessibleColumnContext",{index:s+1})),isNaN(o)||(u=this._updateAccessibleInfoString(u,"accessibleRowHeaderContext",{index:o+1})),isNaN(l)||(u=this._updateAccessibleInfoString(u,"accessibleColumnHeaderContext",{index:l+1})),isNaN(r)||(u=this._updateAccessibleInfoString(u,"accessibleRowEndHeaderContext",{index:r+1})),isNaN(a)||(u=this._updateAccessibleInfoString(u,"accessibleColumnEndHeaderContext",{index:a+1})),isNaN(h)||(u=this._updateAccessibleInfoString(u,"accessibleRowHeaderLabelContext",{level:h+1})),isNaN(m)||(u=this._updateAccessibleInfoString(u,"accessibleColumnHeaderLabelContext",{level:m+1})),isNaN(d)||(u=this._updateAccessibleInfoString(u,"accessibleRowEndHeaderLabelContext",{level:d+1})),isNaN(c)||(u=this._updateAccessibleInfoString(u,"accessibleColumnEndHeaderLabelContext",{level:c+1})),isNaN(n)||(u=this._updateAccessibleInfoString(u,"accessibleLevelContext",{level:n+1})),u=0===u.length?u:u+". ",null!=this.m_accessibleContext&&(u+=this.m_accessibleContext,this.m_accessibleContext=null),this.m_contextInfo.textContent=u},z.prototype._updateAccessibleInfoString=function(e,t,i){var s=this.getResources().getTranslatedText(t,i);return null!=s?0===e.length?s:e+", "+s:e},z.prototype._isCountUnknown=function(e){var t=this.getDataSource();if("row"===e||"rowEnd"===e){var i=t.getCountPrecision("row"),s=t.getCount("row");return this.m_isEstimateRowCount="estimate"===i||s<0,this.m_isEstimateRowCount}if("column"===e||"columnEnd"===e){var n=t.getCountPrecision("column"),o=t.getCount("column");return this.m_isEstimateColumnCount="estimate"===n||o<0,this.m_isEstimateColumnCount}return!1},z.prototype._isCountUnknownOrHighwatermark=function(e){return this._isCountUnknown(e)||this._isHighWatermarkScrolling()},z.prototype._hideHeader=function(e){e.style.display="none"},z.prototype._showHeader=function(e){e.style.display=""},z.prototype.buildHeaders=function(e,t,i){var s=this.getMappedStyle("scroller")+(this.m_utils.isTouchDeviceNotIOS()?" "+this.getMappedStyle("scroller-mobile"):"");let n=this._createHeaderElement(e,t,s,!1),o=this._createHeaderElement(e,i,s,!0);const r=this.m_options._getFreezeIndex(e);let l,a;if("column"===e?(this.m_colHeader=n,this.m_colEndHeader=o):"row"===e&&(this.m_rowHeader=n,this.m_rowEndHeader=o),"column"===e&&null!==r&&(this.m_frozenColIndex=r,l=this._createHeaderElement("frozenColumn",this.getMappedStyle("colHeaderFrozen"),s,!1),this.m_colHeaderFrozen=l,this.m_colEndHeader&&(a=this._createHeaderElement("frozenColumn",this.getMappedStyle("colEndHeaderFrozen"),s,!0),this.m_colEndHeaderFrozen=a)),"row"===e&&null!==r&&(this.m_frozenRowIndex=r,l=this._createHeaderElement("frozenRow",this.getMappedStyle("rowHeaderFrozen"),s,!1),this.m_rowHeaderFrozen=l,this.m_rowEndHeader&&(a=this._createHeaderElement("frozenRow",this.getMappedStyle("rowEndHeaderFrozen"),s,!0),this.m_rowEndHeaderFrozen=a)),this._isHighWatermarkScrolling()){this.fetchHeaders(e,0,n,o,null,null)}else{var h=this,d=this.m_options.getScrollPosition();this._getIndexesFromScrollPosition(d).then(function(t){var i=t[e];"column"===e?(h.m_startColHeader=i,h.m_startColEndHeader=i):"row"===e&&(h.m_startRowHeader=i,h.m_startRowEndHeader=i);let s=null;h.m_fetching[e]=!1,null!==r&&(s=h.getFetchSize(e)+i,i=0),h.fetchHeaders(e,i,n,o,s,null)}),this.m_fetching[e]=!0}return{root:n,endRoot:o,frozenHeader:l,frozenEndHeader:a}},z.prototype._createHeaderElement=function(e,t,i,s){let n=document.createElement("div");n.id=s?this.createSubId(e+"EndHeader"):this.createSubId(e+"Header");let o=s?this.getMappedStyle("endheader"):this.getMappedStyle("header");n.className=t+" "+o;let r=document.createElement("div");return r.className=i,n.appendChild(r),n},z.prototype.fetchHeaders=function(e,t,i,s,n,o){if(!this.m_fetching[e]){null==n&&(n=this.getFetchCount(e,t));var r,l={axis:e,start:t,count:n,header:i,endHeader:s};this.m_fetching[e]=l,r=null!=o&&null!=o.success?o.success:this.handleHeadersFetchSuccess,this.m_initialized&&this.isSkeletonSupport()||this.showStatusText(!this.isSkeletonSupport()),this._signalTaskStart(),this.getDataSource().fetchHeaders(l,{success:r,error:this.handleHeadersFetchError},{success:this,error:this})}},z.prototype.isHeaderFetchResponseValid=function(e){var t=e.axis;return null!=this.m_fetching&&e===this.m_fetching[t]},z.prototype.isHeaderFetchResponseInViewport=function(e){if(!this.m_initialized)return!0;var t=e.axis,i=e.start;return("row"===t?this._getLongScrollStart(this.m_currentScrollTop,this.m_prevScrollTop,t):this._getLongScrollStart(this.m_currentScrollLeft,this.m_prevScrollLeft,t)).start===i},z.prototype.handleHeadersFetchSuccess=function(e,t,i,s){var n=this.m_options.getScrollPolicyOptions(),o=n?n.maxRowCount:null,r=n?n.maxColumnCount:null;if(this.isHeaderFetchResponseValid(t)){var l=t.axis;if(this.isLongScroll()&&!this.isHeaderFetchResponseInViewport(t))return this.m_fetching[l]=!1,this.m_headerInvalid=!0,void this._signalTaskEnd();this.m_fetching[l]=!1;var a=t.header,h=t.endHeader,d=t.start,m=this.getDataSource().getCount(l);if("column"===l){null===this.m_frozenColIndex&&(this.m_frozenColIndex=this.m_options._getFreezeIndex(l));let{headerStart:s,endHeaderStart:n,headerFetchCount:o,endHeaderFetchCount:c}=this._buildFrozenHeaders(l,e,i,t,m);if(null!=e&&o>0){d=s;let i=o;this.buildColumnHeaders(a,e,d,m,!1,!1,i,!1),(e.getCount()<t.count||r&&r>0&&r===d+e.getCount())&&(this.m_stopColumnHeaderFetch=!0)}else this.m_stopColumnHeaderFetch=!0;if(this.m_endColHeader<0?(this._hideHeader(a),this.m_stopColumnHeaderFetch=!0,this.m_startColHeader=0):(this.m_hasColHeader=!0,this._buildHeaderLabels(l,e)),null!=i&&c>0){d=n;let e=c;this.buildColumnEndHeaders(h,i,d,m,!1,!1,e,!1),(i.getCount()<t.count||r&&r>0&&r===d+i.getCount())&&(this.m_stopColumnEndHeaderFetch=!0)}else this.m_stopColumnEndHeaderFetch=!0;this.m_endColEndHeader<0?(this._hideHeader(h),this.m_stopColumnEndHeaderFetch=!0,this.m_startColEndHeader=0):(this.m_hasColEndHeader=!0,this._buildHeaderLabels("columnEnd",i))}else if("row"===l){null===this.m_frozenRowIndex&&(this.m_frozenRowIndex=this.m_options._getFreezeIndex("row"));let{headerStart:n,endHeaderStart:r,headerFetchCount:c,endHeaderFetchCount:u}=this._buildFrozenHeaders(l,e,i,t,m);if(null!=e&&c>0){d=n;const i=c;this.buildRowHeaders(a,e,d,m,s,!1,i,!1),(e.getCount()<t.count||o&&o>0&&o===d+e.getCount())&&(this.m_stopRowHeaderFetch=!0)}else this.m_stopRowHeaderFetch=!0;if(this.m_endRowHeader<0?(this._hideHeader(a),this.m_stopRowHeaderFetch=!0,this.m_startRowHeader=0):(this.m_hasRowHeader=!0,this._buildHeaderLabels(l,e)),null!=i&&u>0){d=r;const e=u;this.buildRowEndHeaders(h,i,d,m,s,!1,e,!1),(i.getCount()<t.count||o&&o>0&&o===d+i.getCount())&&(this.m_stopRowEndHeaderFetch=!0)}else this.m_stopRowEndHeaderFetch=!0;this.m_endRowEndHeader<0?(this._hideHeader(h),this.m_stopRowEndHeaderFetch=!0,this.m_startRowEndHeader=0):(this.m_hasRowEndHeader=!0,this._buildHeaderLabels("rowEnd",i))}this.isFetchComplete()&&(this.hideStatusText(),this._shouldInitialize()&&!s&&this._handleInitialization(!0)),this.m_initialized&&(this.isSkeletonSupport()&&this.loadSkeletonsOnHeaderLoad(l,d,e,i),this._sizeDatabodyScroller()),this._signalTaskEnd()}else this._signalTaskEnd()},z.prototype._calculateFrozenIndex=function(e,t){let i=e;if(t&&t.length){let e=0;for(let i=0;i<t.length;i++){let s=t[i];0===this._getAttribute(s,"level",10)&&(e+=this._getAttribute(s,"extent",10))}i=e}return i},z.prototype.handleHeadersFetchError=function(e,t){var i=t.axis;this.m_fetching[i]=!1,this._signalTaskEnd()},z.prototype.createHeaderContext=function(e,t,i,s,n,o,r,l){var a={axis:e,index:t,data:i};a.component=this,a.datasource=this.m_options.getProperty("data"),a.level=o,a.depth=l,a.extent=r,null!=n&&(a.parentElement=n);for(var h=Object.keys(s),d=0;d<h.length;d++){var m=h[d];a[m]=s[m]}return null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,a),this.m_fixContextCallback.call(this,a)},z.prototype._createLabelContext=function(e,t,i,s,n){var o={axis:e,level:t,data:i};if(o.component=this,o.datasource=this.m_options.getProperty("data"),null!=s&&(o.parentElement=s),null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,o),this._isDataGridProvider()&&null!=n)for(var r=Object.keys(n),l=0;l<r.length;l++){var a=r[l];o[a]=n[a]}return this.m_fixContextCallback.call(this,o)},z.prototype._buildHeaderLabels=function(e,t){if(0===this.m_headerLabels[e].length&&t&&t.getLabel){var i,s=t.getLevelCount();"rowEnd"===e?i=this.getResources().isRTLMode()?"left":"right":"row"===e?i=this.getResources().isRTLMode()?"right":"left":"column"===e?i="top":"columnEnd"===e&&(i="bottom");var n=0;if(s>0)for(var o=0;o<s;o++){var r,l=document.createElement("div"),a=t.getLabel(o);this._isDataGridProvider()&&(r=t.getLabelMetadata(o));var h=this._getLabelDimension(e,o);if(null!=a){var d=this._createLabelContext(e,o,a,l,r);l.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),l.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(l),l[this.getResources().getMappedAttribute("context")]=d;var m=this.m_options.getInlineStyle(e,d,!0);null!=m&&u.applyMergedInlineStyles(l,m,""),l.className=this.getMappedStyle("headerlabel")+" "+this.getMappedStyle(e.toLowerCase()+"headerlabel");var c=this.m_options.getStyleClass(e,d,!0);null!=c&&(l.className+=" "+c),"row"===e||"rowEnd"===e?("rowEnd"===e&&(l.style.height="100%"),this.setElementWidth(l,h),this.setElementDir(l,n,i),this.setElementDir(l,0,"bottom")):("columnEnd"===e&&(l.style.width="100%"),this.setElementHeight(l,h),this.setElementDir(l,n,i),this.setElementDir(l,0,this.getResources().isRTLMode()?"left":"right")),"enable"!==this.m_options.isResizable(e,"width")&&"enable"!==this.m_options.isResizable(e,"height")||this._setAttribute(l,"resizable","true");var _=this.getRendererOrTemplate(e,!0);this._renderContent(_,d,l,a,this.buildLabelTemplateContext(d,r||{})),this.m_headerLabels[e][o]=l}n+=h}}},z.prototype.buildLabelTemplateContext=function(e,t){return{item:{data:e.data,metadata:t.metadata},datasource:e.datasource}},z.prototype.buildHeaderTemplateContext=function(e,t){return{item:{data:e.data,depth:e.depth,extent:e.extent,index:e.index,level:e.level,metadata:t.metadata,axis:e.axis},datasource:e.datasource}},z.prototype.buildCellTemplateContext=function(e,t){return{item:{columnExtent:e.extents.column,columnIndex:e.indexes.column,data:e.data,metadata:t.metadata,rowExtent:e.extents.row,rowIndex:e.indexes.row},datasource:e.datasource,mode:e.mode}},z.prototype.getRendererOrTemplate=function(e,t){var i,s=this.m_options.getRenderer(e,t);return s||(i="cell"===e?"cellTemplate":t?e+"HeaderLabelTemplate":e+"HeaderTemplate",this._getItemTemplateBySlotName(i)||null)},z.prototype.buildColumnHeaders=function(e,t,i,s,n,o,r,l){if(null==this.m_columnHeaderLevelCount&&(this.m_columnHeaderLevelCount=t.getLevelCount()),0===this.m_columnHeaderLevelCount)return;let a=r;void 0===a&&(a=t.getCount());var h=i>this.m_endColHeader;var d=h?this.m_endColHeaderPixel:this.m_startColHeaderPixel,m=this.m_endColHeader,c=this.m_columnHeaderLevelCount,u=this.getMappedStyle("colheader")+" "+this.getMappedStyle("header"),_=this.getMappedStyle("headercell")+" "+this.getMappedStyle("colheadercell");l&&(_+=` ${this.getMappedStyle("frozenHeader")}`);var p=this.buildAxisHeaders(e,t,"column",i,a,h,false,null,d,m,c,u,_,false),g=p.totalHeaderDimension,C=p.totalLevelDimension;if(0===g||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=g/a),this.m_colHeaderHeight||(this.m_colHeaderHeight=C,this.setElementHeight(e,this.m_colHeaderHeight)),h?(this.m_endColHeader=i+a-1,this.m_endColHeaderPixel+=g):(this.m_startColHeader-=a,this.m_startColHeaderPixel-=g),-1===s&&(s=this.m_endColHeader),!this._isCountUnknown("column")&&this._isHighWatermarkScrolling()&&this.m_endColHeader+1>=s?this.m_stopColumnHeaderFetch=!0:this.m_stopColumnHeaderFetch=p.stopFetch,0===this.m_startColHeader&&0!==this.m_startColHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startColHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this.m_endColHeaderPixel-=this.m_startColHeaderPixel,this.m_startColHeaderPixel=0),!this.m_initialized&&this.m_startColHeader>0){var f=Math.round(this.m_avgColWidth*this.m_startColHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startColHeader,f-this.m_startColHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this.m_endColHeaderPixel=f+g,this.m_startColHeaderPixel=f}},z.prototype.buildColumnEndHeaders=function(e,t,i,s,n,o,r,l){if(null==this.m_columnEndHeaderLevelCount&&(this.m_columnEndHeaderLevelCount=t.getLevelCount()),0===this.m_columnEndHeaderLevelCount)return;let a=r;void 0===a&&(a=t.getCount());var h=i>this.m_endColEndHeader;var d=h?this.m_endColEndHeaderPixel:this.m_startColEndHeaderPixel,m=this.m_endColEndHeader,c=this.m_columnEndHeaderLevelCount,u=this.getMappedStyle("colendheader")+" "+this.getMappedStyle("endheader"),_=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("colendheadercell");l&&(_+=` ${this.getMappedStyle("frozenHeader")}`);var p=this.buildAxisHeaders(e,t,"columnEnd",i,a,h,false,null,d,m,c,u,_,false),g=p.totalHeaderDimension,C=p.totalLevelDimension;if(0===g||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=g/a),this.m_colEndHeaderHeight||(this.m_colEndHeaderHeight=C,this.setElementHeight(e,this.m_colEndHeaderHeight)),h?(this.m_endColEndHeader=i+(a-1),this.m_endColEndHeaderPixel+=g):(this.m_startColEndHeader-=a,this.m_startColEndHeaderPixel-=g),-1===s&&(s=this.m_endColEndHeader),!this._isCountUnknown("column")&&this._isHighWatermarkScrolling()&&this.m_endColEndHeader+1>=s?this.m_stopColumnEndHeaderFetch=!0:this.m_stopColumnEndHeaderFetch=p.stopFetch,0===this.m_startColEndHeader&&0!==this.m_startColEndHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startColEndHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell")),this.m_endColEndHeaderPixel-=this.m_startColEndHeaderPixel,this.m_startColEndHeaderPixel=0),!this.m_initialized&&this.m_startColEndHeader>0){var f=Math.round(this.m_avgColWidth*this.m_startColEndHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startColEndHeader,f-this.m_startColEndHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell")),this.m_endColEndHeaderPixel=f+g,this.m_startColEndHeaderPixel=f}},z.prototype.buildRowHeaders=function(e,t,i,s,n,o,r,l){if(null==this.m_rowHeaderLevelCount&&(this.m_rowHeaderLevelCount=t.getLevelCount()),0===this.m_rowHeaderLevelCount)return;let a=r;void 0===a&&(a=t.getCount());var h,d=i>this.m_endRowHeader,m=d?this.m_endRowHeaderPixel:this.m_startRowHeaderPixel;n?(h=e.firstChild.childNodes[i-this.m_startRowHeader],m=this.getElementDir(h,"top")):h=null;var c=this.m_endRowHeader,u=this.m_rowHeaderLevelCount,_=this.getMappedStyle("rowheader")+" "+this.getMappedStyle("header"),p=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell");l&&(p+=` ${this.getMappedStyle("frozenHeader")}`);var g=this.buildAxisHeaders(e,t,"row",i,a,d,n,h,m,c,u,_,p,o),C=g.totalHeaderDimension,f=g.totalLevelDimension;if(o)return g;if(0===C||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=C/a),this.m_rowHeaderWidth||(this.m_rowHeaderWidth=f,this.setElementWidth(e,this.m_rowHeaderWidth)),d){if(-1!==this.m_endRowHeader&&0!==a){var y=e.firstChild.childNodes[this.m_endRowHeader-this.m_startRowHeader];null!=y&&this.m_utils.removeCSSClassName(y,this.getMappedStyle("borderHorizontalNone"))}this.m_endRowHeader=i+(a-1),this.m_endRowHeaderPixel+=C}else n?(i<this.m_startRowHeader&&(this.m_startRowHeader=i,this.m_startRowHeaderPixel=Math.max(0,this.m_startRowHeaderPixel-C)),this.m_endRowHeader+=a,this.m_endRowHeaderPixel=Math.max(0,this.m_endRowHeaderPixel+C),this.pushRowHeadersDown(h,C)):(this.m_startRowHeader=Math.max(0,this.m_startRowHeader-a),this.m_startRowHeaderPixel-=C);if(-1===s&&(s=this.m_endRowHeader),!this._isCountUnknown("row")&&this._isHighWatermarkScrolling()&&this.m_endRowHeader+1>=s?this.m_stopRowHeaderFetch=!0:this.m_stopRowHeaderFetch=g.stopFetch,0===this.m_startRowHeader&&0!==this.m_startRowHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startRowHeaderPixel,"top",this.getMappedStyle("rowheadercell")),this.m_endRowHeaderPixel-=this.m_startRowHeaderPixel,this.m_startRowHeaderPixel=0),!this.m_initialized&&this.m_startRowHeader>0){var E=Math.round(this.m_avgRowHeight*this.m_startRowHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startRowHeader,E-this.m_startRowHeaderPixel,"top",this.getMappedStyle("rowheadercell")),this.m_endRowHeaderPixel=E+C,this.m_startRowHeaderPixel=E}},z.prototype.buildRowEndHeaders=function(e,t,i,s,n,o,r,l){if(null==this.m_rowEndHeaderLevelCount&&(this.m_rowEndHeaderLevelCount=t.getLevelCount()),0===this.m_rowEndHeaderLevelCount)return;let a=r;void 0===a&&(a=t.getCount());var h,d=i>this.m_endRowEndHeader,m=d?this.m_endRowEndHeaderPixel:this.m_startRowEndHeaderPixel;n?(h=e.firstChild.childNodes[i-this.m_startRowEndHeader],m=this.getElementDir(h,"top")):h=null;var c=this.m_endRowEndHeader,u=this.m_rowEndHeaderLevelCount,_=this.getMappedStyle("rowendheader")+" "+this.getMappedStyle("endheader"),p=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell");l&&(p+=` ${this.getMappedStyle("frozenHeader")}`);var g=this.buildAxisHeaders(e,t,"rowEnd",i,a,d,n,h,m,c,u,_,p,o);if(o)return g;var C=g.totalHeaderDimension,f=g.totalLevelDimension;if(0===C||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=C/a),this.m_rowEndHeaderWidth||(this.m_rowEndHeaderWidth=f,this.setElementWidth(e,this.m_rowEndHeaderWidth)),d){if(-1!==this.m_endRowEndHeader&&0!==a){var y=e.firstChild.childNodes[this.m_endRowEndHeader-this.m_startRowEndHeader];null!=y&&this.m_utils.removeCSSClassName(y,this.getMappedStyle("borderHorizontalNone"))}this.m_endRowEndHeader=i+(a-1),this.m_endRowEndHeaderPixel+=C}else n?(i<this.m_startRowEndHeader&&(this.m_startRowEndHeader=i,this.m_startRowEndHeaderPixel=Math.max(0,this.m_startRowEndHeaderPixel-C)),this.m_endRowEndHeader+=a,this.m_endRowEndHeaderPixel=Math.max(0,this.m_endRowEndHeaderPixel+C),this.pushRowHeadersDown(h,C)):(this.m_startRowEndHeader=Math.max(0,this.m_startRowEndHeader-a),this.m_startRowEndHeaderPixel-=C);if(-1===s&&(s=this.m_endRowEndHeader),!this._isCountUnknown("row")&&this._isHighWatermarkScrolling()&&this.m_endRowEndHeader+1>=s?this.m_stopRowEndHeaderFetch=!0:this.m_stopRowEndHeaderFetch=g.stopFetch,0===this.m_startRowEndHeader&&0!==this.m_startRowEndHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startRowEndHeaderPixel,"top",this.getMappedStyle("rowendheadercell")),this.m_endRowEndHeaderPixel-=this.m_startRowEndHeaderPixel,this.m_startRowEndHeaderPixel=0),!this.m_initialized&&this.m_startRowEndHeader>0){var E=Math.round(this.m_avgRowHeight*this.m_startRowEndHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startRowEndHeader,E-this.m_startRowEndHeaderPixel,"top",this.getMappedStyle("rowendheadercell")),this.m_endRowEndHeaderPixel=E+C,this.m_startRowEndHeaderPixel=E}},z.prototype.buildAxisHeaders=function(e,t,i,s,n,o,r,l,a,h,d,m,c,u){var _,p,g=-1!==i.indexOf("column"),C=g?"height":"width",f=!1,y=0,E=0,v=0,w=0;if(!u){if(0===n&&this._isCountUnknown(i))return{totalHeaderDimension:y,totalLevelDimension:E,stopFetch:f=!0};_=e.firstChild,-1===h&&""===e.className&&(e.className=m,e.style[C]="",_.style[C]="")}for(var H=this.getRendererOrTemplate(i),S=document.createDocumentFragment(),x=0;n-x>0;){o||r?(p=s+x,v=g?a+y:0,w=g?0:a+y):(p=s+(n-1-x),v=g?a-y:0,w=g?0:a-y);var b=this.buildLevelHeaders(S,p,0,v,w,o,r,H,t,i,c,d);x+=b.count,y+=b.totalHeaderDimension,b.totalLevelDimension>E&&(E=b.totalLevelDimension)}return u?S:(o?_.appendChild(S):r?_.insertBefore(S,l):_.insertBefore(S,_.firstChild),e.hasChildNodes()||r||e.appendChild(_),this.m_subtreeAttachedCallback(_),{totalHeaderDimension:y,totalLevelDimension:E,stopFetch:f})},z.prototype._renderContent=function(e,t,i,s,n){if(null!=e&&"function"==typeof e)u.applyRendererContent(i,e.call(this,t),!1,this.m_isCustomElementCallback()?null:this.m_subtreeAttachedCallback),this._removeFocusFromChildElements(t,i);else if(null!=e&&"object"==typeof e&&this.m_engine){for(var o=this.m_engine.execute(this.m_root,e,n,null),r=0;r<o.length;r++)i.appendChild(o[r]);this._removeFocusFromChildElements(t,i)}else null!=s&&"object"==typeof s&&Object.prototype.hasOwnProperty.call(s,"data")&&(s=s.data),null==s&&(s=""),i.appendChild(document.createTextNode(s.toString()))},z.prototype._removeFocusFromChildElements=function(e,t){if("edit"!==e.mode){var i=this;this._signalTaskStart(),this.m_contextCallback(t).getBusyContext().whenReady().then(function(){u.disableAllFocusableElements(t),i._signalTaskEnd()})}},z.prototype.buildLevelHeaders=function(e,t,i,s,n,o,r,l,a,h,d,m){var c,_,p,g,C,f,y,E,v,w,H,S,x,b,R,I=0,M=0,F=0,z=0;"row"===h?(c="row",_=this.m_rowHeader,p="width",g=this.m_rowHeaderLevelWidths,C="height",f="top",y=n,E=this.getResources().isRTLMode()?"right":"left",v=s,w=this.m_startRowHeader,H=this.m_endRowHeader,this._hasFrozenRows()&&t<=this.m_frozenRowIndex&&this.m_rowHeaderFrozen&&(_=this.m_rowHeaderFrozen)):"rowEnd"===h?(c="row",_=this.m_rowEndHeader,p="width",g=this.m_rowEndHeaderLevelWidths,C="height",f="top",y=n,E=this.getResources().isRTLMode()?"left":"right",v=s,w=this.m_startRowEndHeader,H=this.m_endRowEndHeader,this._hasFrozenRows()&&t<=this.m_frozenRowIndex&&this.m_rowEndHeaderFrozen&&(_=this.m_rowEndHeaderFrozen)):"column"===h?(c="column",_=this.m_colHeader,p="height",g=this.m_columnHeaderLevelHeights,C="width",f=this.getResources().isRTLMode()?"right":"left",y=s,E="top",v=n,w=this.m_startColHeader,H=this.m_endColHeader,this._hasFrozenColumns()&&t<=this.m_frozenColIndex&&this.m_colHeaderFrozen&&(_=this.m_colHeaderFrozen)):(c="column",_=this.m_colEndHeader,p="height",g=this.m_columnEndHeaderLevelHeights,C="width",f=this.getResources().isRTLMode()?"right":"left",y=s,E="bottom",v=n,w=this.m_startColEndHeader,H=this.m_endColEndHeader,this._hasFrozenColumns()&&t<=this.m_frozenColIndex&&this.m_colEndHeaderFrozen&&(_=this.m_colEndHeaderFrozen));var D=a.getExtent(t,i),L=D.extent,A=D.more.before,T=D.more.after,N=a.getDepth(t,i);let O;if(A&&t===H+1){for(S=this._getHeaderContainer(t-1,i,0,null,_,m),this._setAttribute(S,"extent",this._getAttribute(S,"extent",!0)+L),O=(x=S.firstChild)[this.getResources().getMappedAttribute("context")],O.extent+=L,I=this.getElementDir(x,p),b=0;b<L;)y+=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(S,t+b,i+N,y,v+I,o,r,l,a,h,d,m):this.buildLevelHeaders(S,t+b,i+N,v+I,y,o,r,l,a,h,d,m)).totalHeaderDimension,F+=R.totalHeaderDimension,z+=R.count,b+=R.count;this.setElementDir(x,this.getElementDir(x,C)+F,C)}else if(T&&t===w-1){for(S=this._getHeaderContainer(t+1,i,0,null,_,m),this._setAttribute(S,"extent",this._getAttribute(S,"extent",!0)+L),this._setAttribute(S,"start",this._getAttribute(S,"start",!0)-L),O=(x=S.firstChild)[this.getResources().getMappedAttribute("context")],O.extent+=L,O.index-=L,I=this.getElementDir(x,p),b=0;b<L;)y-=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(S,t-b,i+N,y,v+I,o,r,l,a,h,d,m):this.buildLevelHeaders(S,t-b,i+N,v+I,y,o,r,l,a,h,d,m)).totalHeaderDimension,F+=R.totalHeaderDimension,z+=R.count,b+=R.count;this.setElementDir(x,this.getElementDir(x,C)+F,C),this.setElementDir(x,y,f)}else{var P=a.getData(t,i),k=a.getMetadata(t,i);x=document.createElement("div"),O=this.createHeaderContext(h,t,P,k,x,i,L,N),x.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),x.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(x),x[this.getResources().getMappedAttribute("context")]=O,x[this.getResources().getMappedAttribute("metadata")]=k,x.extentInfo=D;var B=this.m_options.getInlineStyle(h,O),W=this.m_options.getStyleClass(h,O);null!=B&&u.applyMergedInlineStyles(x,B,""),x.className=d,x.className+=" "+this.getMappedStyle("depth")+N,null!=W&&(x.className+=" "+W),this.setElementDir(x,v,E),this.setElementDir(x,y,f);var j=this._getHeaderDimensions(x,C,p,g,i,c,O.key,N);I=j[p],this.setElementDir(x,I,p);var K=j[C];if(this._setAttribute(x,"depth",N),i!==m-1&&((S=document.createElement("div")).className=this.getMappedStyle("groupingcontainer"),S.appendChild(x),this._setAttribute(S,"start",o||r?t:t-L+1),this._setAttribute(S,"extent",L),this._setAttribute(S,"level",i)),i+N===m)this.setElementDir(x,K,C),F+=K,z+=1,M=I,o||r||(y-=K,this.setElementDir(x,y,f));else{for(b=0;b<L;b++){var U=o||r?t+b:t-b;K=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(S,U,i+N,y,v+I,o,r,l,a,h,d,m):this.buildLevelHeaders(S,U,i+N,v+I,y,o,r,l,a,h,d,m)).totalHeaderDimension,y=o||r?y+K:y-K,F+=K,z+=R.count,b+=R.count-1}M=I,R&&!isNaN(R.totalLevelDimension)&&(M+=R.totalLevelDimension),o||r||this.setElementDir(x,y,f),this.setElementDir(x,F,C)}if("columnEnd"===h&&this.m_addBorderBottom&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderHorizontalSmall")),"rowEnd"===h&&this.m_addBorderRight&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderVerticalSmall")),this._isHeaderResizeEnabled(h,O)&&this._setAttribute(x,"resizable","true"),this.m_isCustomElementCallback()||(null!=S?this.m_root.appendChild(S):this.m_root.appendChild(x)),this._renderContent(l,O,x,P,this.buildHeaderTemplateContext(O,k)),("column"===h||this._isDataGridProvider())&&this._isSortEnabled(h,O)){null!=k.sortDirection&&null==this.m_sortInfo&&(this.m_sortInfo={},this.m_sortInfo.key=k.key,this.m_sortInfo.direction=k.sortDirection,this.m_sortInfo.axis=h);var V=this._buildSortIcon(O,x,h);x.appendChild(V),this._setAttribute(x,"sortable","true")}if(this._isRequired(O)){var Y=document.createElement("span");this.m_utils.addCSSClassName(Y,this.getMappedStyle("iconContainer")),this.m_utils.addCSSClassName(Y,this.getMappedStyle("requiredIcon")),Y.setAttribute("title",this.getResources().getTranslatedText("tooltipRequired")),x.appendChild(Y)}if(this._isParentNode(O)){const e=this._buildDisclosureIcon(O);this._isHierarchicalGroup(O)?this.m_utils.addCSSClassName(x,this.getMappedStyle("hierarchicalGroup")):this.m_utils.addCSSClassName(x,this.getMappedStyle("hierarchicalTree")),x.prepend(e);const t=this._buildSpacer(O);x.prepend(t)}else if(this._isLeafNode(O)){this.m_utils.addCSSClassName(x,this.getMappedStyle("hierarchical"));const e=this._buildSpacer(O);x.prepend(e)}o||r?null!=S?e.appendChild(S):e.appendChild(x):null!=S?e.firstChild?this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("groupingcontainer"))?e.insertBefore(S,e.firstChild):(this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("headercell"))||this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("endheadercell")))&&e.insertBefore(S,e.firstChild.nextSibling):e.appendChild(S):this.m_utils.containsCSSClassName(e,this.getMappedStyle("groupingcontainer"))?e.insertBefore(x,e.firstChild.nextSibling):e.insertBefore(x,e.firstChild)}return"column"===h||"columnEnd"===h?this._isLastColumn(t+(L-1))&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderVerticalNone")):this._isLastRow(t+(L-1))&&!r&&this.m_utils.addCSSClassName(x,this.getMappedStyle("borderHorizontalNone")),{totalLevelDimension:M,totalHeaderDimension:F,count:z}},z.prototype._getHeaderDimensions=function(e,t,i,s,n,o,r,l){for(var a={},h=0,d=0;d<l;d++){var m=s[n+d];if(null==m){h=null;break}h+=m}null==h?a=this._computeElementWidthAndHeight(e):a[i]=h,1===l&&(s[n]=a[i]);var c=this.m_sizingManager.getSize(o,r);if(null!=c)return a[t]=c,a;if(""!==e.style[t])return null==a[t]&&(a[t]=this.getElementDir(e,t)),this.m_sizingManager.setSize(o,r,a[t]),a;var u=e.className;return null==a[t]&&(a[t]=this.m_styleClassDimensionMap[t][u],null==a[t]&&(a[t]=this.getElementDir(e,t))),this.m_sizingManager.setSize(o,r,a[t]),this.m_styleClassDimensionMap[t][u]=a[t],a},z.prototype._getHeaderLevelDimension=function(e,t,i,s,n){for(var o=0,r=0;r<n;r++){var l=i[e+r];if(null==l){o=null;break}o+=l}return null!=o||(o=this.getElementDir(t,s),1===n&&(i[e]=o)),o},z.prototype._getHeaderContainer=function(e,t,i,s,n,o){var r;if(null==s?(s=this._getAllNonSkeletonContainerNodes(n.firstChild),r=0):r=1,i===o-1)return s[0].parentNode;for(;r<s.length;r++){var l=this._getAttribute(s[r],"start",!0),a=this._getAttribute(s[r],"extent",!0),h=this._getAttribute(s[r].firstChild,"depth",!0);if(e>=l&&e<l+a)return t<i+h?s[r]:this._getHeaderContainer(e,t,i+h,s[r].childNodes,n,o)}return null},z.prototype._getHeaderCellByIndex=function(e,t,i){let s,n,o,r;return"column"===t||"columnEnd"===t?(n="column"===t?this.m_columnHeaderLevelCount:this.m_columnEndHeaderLevelCount,this._hasFrozenColumns()&&e<=this.m_frozenColIndex?s="column"===t?this.m_colHeaderFrozen:this.m_colEndHeaderFrozen:(s="column"===t?this.m_colHeader:this.m_colEndHeader,e-=this._hasFrozenColumns()&&e>this.m_frozenColIndex&&1===n?this.m_frozenColIndex+1:0),o="column"===t?this.m_startColHeader:this.m_startColEndHeader):"row"!==t&&"rowEnd"!==t||(n="row"===t?this.m_rowHeaderLevelCount:this.m_rowEndHeaderLevelCount,this._hasFrozenRows()&&e<=this.m_frozenRowIndex?s="row"===t?this.m_rowHeaderFrozen:this.m_rowEndHeaderFrozen:(s="row"===t?this.m_rowHeader:this.m_rowEndHeader,e-=this._hasFrozenRows()&&e>this.m_frozenRowIndex&&1===n?this.m_frozenRowIndex+1:0),o="row"===t?this.m_startRowHeader:this.m_startRowEndHeader),r=this._getHeaderByIndex(e,i,s,n,o),r},z.prototype._getHeaderCellsByIndex=function(e,t){let i,s,n,o=[];return"column"===t||"columnEnd"===t?(s="column"===t?this.m_columnHeaderLevelCount:this.m_columnEndHeaderLevelCount,this._hasFrozenColumns()&&e<=this.m_frozenColIndex?i="column"===t?this.m_colHeaderFrozen:this.m_colEndHeaderFrozen:(i="column"===t?this.m_colHeader:this.m_colEndHeader,e-=this._hasFrozenColumns()&&e>this.m_frozenColIndex&&1===s?this.m_frozenColIndex+1:0),n="column"===t?this.m_startColHeader:this.m_startColEndHeader):"row"!==t&&"rowEnd"!==t||(s="row"===t?this.m_rowHeaderLevelCount:this.m_rowEndHeaderLevelCount,this._hasFrozenRows()&&e<=this.m_frozenRowIndex?i="row"===t?this.m_rowHeaderFrozen:this.m_rowEndHeaderFrozen:(i="row"===t?this.m_rowHeader:this.m_rowEndHeader,e-=this._hasFrozenRows()&&e>this.m_frozenRowIndex&&1===s?this.m_frozenRowIndex+1:0),n="row"===t?this.m_startRowHeader:this.m_startRowEndHeader),o=this._getHeadersByIndex(e,i,s,n),o},z.prototype._getHeaderByIndex=function(e,t,i,s,n){var o;if(t<0)return null;if(1===s)return this._getAllNonSkeletonContainerNodes(i.firstChild)[o=e-n];var r=this._getHeaderContainer(e,t,0,null,i,s);return null==r?null:t<=this._getAttribute(r,"level",!0)+this._getAttribute(r.firstChild,"depth",!0)-1?r.firstChild:(o=e-this._getAttribute(r,"start",!0)+1,r.childNodes[o])},z.prototype._getHeadersByIndex=function(e,t,i,s){let n=[],o=1;for(let r=i-1;r>=0;r-=o){let l=this._getHeaderByIndex(e,r,t,i,s);l&&(o=this.getHeaderCellDepth(l),n.push(l))}return n},z.prototype._getAttribute=function(e,t,i){var s=e.getAttribute(this.getResources().getMappedAttribute(t));return i?parseInt(s,10):s},z.prototype._setAttribute=function(e,t,i){e.setAttribute(this.getResources().getMappedAttribute(t),i)},z.prototype.buildDatabody=function(e){let t=this._createDatabodyElement("databody");this.m_databody=t;const i=this.m_frozenRowIndex,s=this.m_frozenColIndex;let n,o,r;if(null!==i&&null!==s&&(r=this._createDatabodyElement("databodyFrozenCorner"),this.m_databodyFrozenCorner=r),null!==s&&(n=this._createDatabodyElement("databodyFrozenCol"),this.m_databodyFrozenCol=n),null!==i&&(o=this._createDatabodyElement("databodyFrozenRow"),this.m_databodyFrozenRow=o),!e)if(t.addEventListener?t.addEventListener("scroll",this.handleScroll.bind(this),!1):t.attachEvent("onscroll",this.handleScroll.bind(this)),this._isHighWatermarkScrolling()){this.fetchCells(t,0,0)}else{var l=this,a=this.m_options.getScrollPosition();this._getIndexesFromScrollPosition(a).then(function(e){var n=e.row,o=e.column;let r=null,a=null;l.m_startRow=n,l.m_startCol=o,l.m_fetching.cells=!1,null===s&&null===i||(null!==s&&(r=l.getFetchSize("column")+o,o=0),null!==i&&(a=l.getFetchSize("row")+n,n=0)),l.fetchCells(t,n,o,a,r)}),this.m_fetching.cells=!0}let h=[];return h.push(t),n&&h.push(n),o&&h.push(o),r&&h.push(r),h},z.prototype._createDatabodyElement=function(e){var t=document.createElement("div");t.id=this.createSubId(e),t.className=this.getMappedStyle(e)+" "+this.getMappedStyle("scrollbarForce"),t.tabIndex="-1";var i=document.createElement("div");return i.className=this.getMappedStyle("scroller")+(this.m_utils.isTouchDeviceNotIOS()?" "+this.getMappedStyle("scroller-mobile"):""),t.appendChild(i),t},z.prototype._getIndexFromKeyPromise=function(e,t){var i=this;return new Promise(function(s){null!=e||null!=t?i._indexes({row:e,column:t},function(e){s({rowIndexFromKey:e.row,columnIndexFromKey:e.column})}):s({rowIndexFromKey:null,columnIndexFromKey:null})})},z.prototype._getIndexesFromScrollPosition=function(e){var t=this,i=e.rowKey,s=e.columnKey;return this._getIndexFromKeyPromise(i,s).then(function(i){var s={};return null!=i.rowIndexFromKey&&i.rowIndexFromKey>0?s.row=i.rowIndexFromKey:null!=e.rowIndex?s.row=e.rowIndex:null!=e.y?s.row=Math.round(e.y/t.getDefaultRowHeight()):s.row=0,null!=i.columnIndexFromKey&&i.columnIndexFromKey>0?s.column=i.columnIndexFromKey:null!=e.columnIndex?s.column=e.columnIndex:null!=e.x?s.column=Math.round(e.x/t.getDefaultColumnWidth()):s.column=0,s})},z.prototype.getFetchCount=function(e,t){var i=this.getFetchSize(e);if(this._isHighWatermarkScrolling()){var s="row"===e?"maxRowCount":"maxColumnCount",n=this.m_options.getScrollPolicyOptions();n&&null!=n[s]&&n[s]>0&&(i=Math.max(Math.min(i,n[s]-t),0))}return i},z.prototype.fetchCells=function(e,t,i,s,n,o){var r;if(!this.m_fetching.cells){null==s&&(s=this.getFetchCount("row",t)),null==n&&(n=this.getFetchCount("column",i));var l={axis:"row",start:t,count:s},a={axis:"column",start:i,count:n,databody:e};this.m_fetching.cells={rowRange:l,columnRange:a},r=null!=o&&null!=o.success?o.success:this.handleCellsFetchSuccess,this.isSkeletonSupport()||this.showStatusText(!this.isSkeletonSupport()),this._signalTaskStart(),this.getDataSource().fetchCells([l,a],{success:r,error:this.handleCellsFetchError},{success:this,error:this})}},z.prototype.isCellFetchResponseValid=function(e){if(null==this.m_fetching)return!1;var t=e[0],i=e[1],s=this.m_fetching.cells;return t===s.rowRange&&i===s.columnRange},z.prototype.isLongScroll=function(){return this.m_isLongScroll},z.prototype.isCellFetchResponseInViewport=function(e,t){if(isNaN(this.m_avgRowHeight)||isNaN(this.m_avgColWidth)||null!=this.m_empty||!this.m_initialized)return!0;var i=t[0].start,s=t[1].start,n=this._getLongScrollStart(this.m_currentScrollTop,this.m_prevScrollTop,"row"),o=this._getLongScrollStart(this.m_currentScrollLeft,this.m_prevScrollLeft,"column");return n.start===i&&o.start===s},z.prototype.handleCellsFetchSuccess=function(e,t,i){var s=this.m_options.getScrollPolicyOptions(),n=s?s.maxRowCount:null,o=s?s.maxColumnCount:null,r=this.getDataSource().getCount("row"),l=this.getDataSource().getCount("column");if(void 0===i){if(i=!1,!this.isCellFetchResponseValid(t))return void this._signalTaskEnd();if(this.isLongScroll()&&(!this.isCellFetchResponseInViewport(e,t)||this.m_headerInvalid))return this.m_fetching.cells=!1,this.m_headerInvalid=!1,this.handleLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop),void this._signalTaskEnd();this.m_isLongScroll=!1,this.m_longScrollRow=null,this.m_longScrollColumn=null,this.m_longScrollRowPixel=null,this.m_longScrollColumnPixel=null}var a=t[0],h=a.start,d=e.getCount("row"),m=d>0&&(h>this.m_endRow||h+d<=this.m_startRow);let c=this.m_frozenRowIndex;this.m_initialized&&this._hasFrozenRows()&&h<c&&this.m_rowHeaderFrozen&&(h=c+1),(0===d&&this._isCountUnknown("row")&&a.count>0||m&&this._isHighWatermarkScrolling()&&!this._isCountUnknown("row")&&this.m_endRow+d+1>=r||d<a.count||this._isHighWatermarkScrolling()&&n&&n>0&&h+d===n)&&(this.m_stopRowFetch=!0);var u=t[1],_=u.start,p=e.getCount("column");let g=this.m_frozenColIndex;this.m_initialized&&this._hasFrozenColumns()&&_<g&&this.m_colHeaderFrozen&&(_=g+1);var C=p>0&&(_>this.m_endCol||_+p===this.m_startCol);(0===p&&this._isCountUnknown("column")&&u.count>0||C&&this._isHighWatermarkScrolling()&&!this._isCountUnknown("column")&&this.m_endCol+p+1>=l||p<u.count||this._isHighWatermarkScrolling()&&o&&o>0&&_+p===o)&&(this.m_stopColumnFetch=!0);var f=this.m_databody;null==f&&(f=u.databody);var y,E,v,w,H,S,x,b,R,I,M=f.firstChild;if(m||i){if(y=!(i||!(h>=this.m_startRow)))E=this.m_endRowPixel;else if(i){var F=this._getCellByIndex({row:h+d,column:this.m_startCol});E=this.getElementDir(F,"top")}else E=this.m_startRowPixel;v=_>=this.m_startCol?this.m_startColPixel:this.m_endColPixel;let t=_,s=h,n=d,o=p;!1===this.m_initialized?(this._hasFrozenRows()&&this._hasFrozenColumns()&&null!==this.m_colHeaderFrozen&&null!==this.m_rowHeaderFrozen&&(H=this._populateFrozenContainer(this.m_databodyFrozenCorner.firstChild,e,h,E,_,v,c+1,g+1),_=g+1,h=c+1,d=n-(c+1),0===(p=o-(g+1))&&(this.m_endRowPixel+=H.totalRowHeight)),this._hasFrozenRows()&&null!==this.m_rowHeaderFrozen&&(H=this._populateFrozenContainer(this.m_databodyFrozenRow.firstChild,e,s,E,_,v,c+1,p),d=n-(c+1),h=c+1),this._hasFrozenColumns()&&null!==this.m_colHeaderFrozen&&(H=this._populateFrozenContainer(this.m_databodyFrozenCol.firstChild,e,h,E,t,v,d,g+1),_=g+1,0===(p=o-(g+1))&&(this.m_endRowPixel+=H.totalRowHeight))):this._hasFrozenColumns()&&null!==this.m_colHeaderFrozen&&this.m_databodyFrozenCol.firstChild.childElementCount&&(H=this._populateFrozenContainer(this.m_databodyFrozenCol.firstChild,e,h,E,this.m_startCol,v,d,g+1),0===(p=o-(g+1))&&(this.m_endRowPixel+=H.totalRowHeight)),w=document.createDocumentFragment(),S=(H=this._addCellsToFragment(w,e,h,E,_,v,d,p)).totalColumnWidth,x=H.totalRowHeight,b=H.avgWidth,R=x/d,this._populateDatabody(M,w),y?(-1!==this.m_endRow&&0!==d&&this._highlightCellsAlongAxis(this.m_endRow,"row","index","remove",["borderHorizontalNone"]),this.m_endRow=h+(d-1),this.m_endRowPixel+=x):i?(h<this.m_startRow&&(this.m_startRow=h,this.m_startRowPixel=Math.max(0,this.m_startRowPixel-x)),this.m_endRow+=d,this.m_endRowPixel+=x,this.pushRowsDown(h+d,x)):(this.m_startRow-=d,this.m_startRowPixel-=x)}else if(C){if(v=(y=_>=this.m_startCol)?this.m_endColPixel:this.m_startColPixel,E=h>=this.m_startRow?this.m_startRowPixel:this.m_endRowPixel,!this.m_databody.firstChild.childElementCount&&y&&this._hasFrozenRows()&&this.m_initialized){const e=this.getResources().isRTLMode()?"right":"left",t=this.m_databodyFrozenRow.firstChild.lastChild;v=this.getElementDir(t,e)+this.getElementWidth(t)}null!==this.m_frozenRowIndex&&null!==this.m_rowHeaderFrozen&&(this._populateFrozenContainer(this.m_databodyFrozenRow.firstChild,e,this.m_startRow,E,_,v,c+1,p),d-=c+1,h=c+1),w=document.createDocumentFragment(),H=this._addCellsToFragment(w,e,h,E,_,v,d,p),this._populateDatabody(M,w),S=H.totalColumnWidth}if(null==b||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=b),null==R||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=R),C&&(_<this.m_startCol?(this.m_startCol-=p,this.m_startColPixel-=S):(this.m_endCol=_+(p-1),this.m_endColPixel+=S)),this._sizeDatabodyScroller(),this.m_endCol>=0&&this.m_endRow>=0?this.m_hasCells=!0:(this.m_startCol=0,this.m_startRow=0),0===this.m_startCol&&0!==this.m_startColPixel&&(this._shiftCellsAlongAxis("column",-this.m_startColPixel,0,!0),this.m_endColPixel-=this.m_startColPixel,this.m_startColPixel=0),0===this.m_startRow&&0!==this.m_startRowPixel&&(this._shiftCellsAlongAxis("row",-this.m_startRowPixel,0,!0),this.m_endRowPixel-=this.m_startRowPixel,this.m_startRowPixel=0),!this.m_initialized&&this.m_startCol>0&&(I=Math.round(this.m_avgColWidth*this.m_startCol),this._shiftCellsAlongAxis("column",I-this.m_startColPixel,this.m_startCol,!0),this.m_endColPixel=I+S,this.m_startColPixel=I),!this.m_initialized&&this.m_startRow>0&&(I=Math.round(this.m_avgRowHeight*this.m_startRow),this._shiftCellsAlongAxis("row",I-this.m_startRowPixel,this.m_startRow,!0),this.m_endRowPixel=I+x,this.m_startRowPixel=I),this.m_fetching.cells=!1,this.isFetchComplete()){if(this.hideStatusText(),this.m_initialized)this._checkScroll&&this._checkScrollPosition();else{if(this.m_utils.isTouchDeviceNotIOS()&&Object.prototype.hasOwnProperty.call(window,"WebKitCSSMatrix")){const e="translate3d(0, 0, 0)";M.style.transform=e,null!=this.m_rowHeader&&(this.m_rowHeader.firstChild.style.transform=e),null!=this.m_colHeader&&(this.m_colHeader.firstChild.style.transform=e),null!=this.m_rowEndHeader&&(this.m_rowEndHeader.firstChild.style.transform=e),null!=this.m_colEndHeader&&(this.m_colEndHeader.firstChild.style.transform=e)}this._updateScrollPosition(this.m_options.getScrollPosition())}if(null!=this.m_scrollIndexAfterFetch?this.scrollToIndex(this.m_scrollIndexAfterFetch):null!=this.m_scrollHeaderAfterFetch?this.scrollToHeader(this.m_scrollHeaderAfterFetch):this.isActionableMode()||null==this._getActiveElement()||this.m_utils.containsCSSClassName(this._getActiveElement(),this.getMappedStyle("focus"))||(!0!==this.m_shouldFocus&&(this.m_shouldFocus=!1),this._highlightActive(),this._manageMoveCursor()),this._isSelectionEnabled()&&this.applySelection(h,h+d,_,_+p),this.populateAccInfo(),this._shouldInitialize())this._handleInitialization(!0);else if(this.m_initialized){var z;(!0===this.m_resizeRequired||this.m_endRowPixel-x<this.getElementHeight(f))&&this.resizeGrid(),m?y?z="top":i||(z="bottom"):C&&(z=_===this.m_startCol?"right":"left"),this._cleanupViewport(z),this.fillViewport(),this.isFetchComplete()&&this.fireEvent("ready",{})}}this._isSelectionEnabled()&&this.isMultipleSelection()&&this._resetHeaderHighLight(),this._signalTaskEnd()},z.prototype._setZIndexBefore=function(e,t,i,s){if("row"===e)for(var n=this.m_startRow,o=this.m_currentScrollTop,r=this.m_rowHeader,l=this.m_rowHeaderLevelCount,a=this.m_startRowHeader,h=this.m_rowEndHeader,d=this.m_rowEndHeaderLevelCount,m=this.m_startRowEndHeader,c=t;c>=n;c--){var u,_=this._getAxisCellsByIndex(c,e);if(this.getElementDir(_[0],"top")<o)break;for(var p=0;p<_.length;p++)this.changeStyleProperty(_[p],this.getCssSupport("z-index"),10);i&&(u=this._getHeaderByIndex(c,0,r,l,a),this.changeStyleProperty(u,this.getCssSupport("z-index"),10)),s&&(u=this._getHeaderByIndex(c,0,h,d,m),this.changeStyleProperty(u,this.getCssSupport("z-index"),10))}},z.prototype._onEndEvent=function(e,t,i,s){var n;function o(){n&&(clearTimeout(n),n=void 0),t.removeEventListener(e,o),i()}t.addEventListener(e,o),n=setTimeout(o,s+100)},z.prototype._insertRowsWithAnimation=function(e,t,i,s,n,o,r,l){var a,h,d,m,c,u,_,p,g,C,f=this,y=0,E=0,v=0;f._signalTaskStart();var w=s>this.m_endRow,H=this.m_databody.firstChild,S=null!=t,x=null!=i;for(s>0&&(v=s-1,C=this._getAxisCellsByIndex(s-1,"row"),y=(E=this.getElementDir(C[0],"top"))+this.getElementHeight(C[0])),this._setZIndexBefore("row",v,S,x),S&&(d=(h=this.m_rowHeader.firstChild).childNodes[s-this.m_startRow-1]),x&&(c=(m=this.m_rowEndHeader.firstChild).childNodes[s-this.m_startRow-1]),a=0;a<e.childNodes.length;a++){var b=e.childNodes[a];p=E-(_=y+this.getElementDir(b,"top"))-this.getElementHeight(b),this.setElementDir(b,_,"top"),this.addTransformMoveStyle(b,0,0,"linear",0,p,0)}if(S)for(a=0;a<t.childNodes.length;a++)u=t.childNodes[a],p=E-(_=y+this.getElementDir(u,"top"))-this.getElementHeight(u),this.setElementDir(u,_,"top"),this.addTransformMoveStyle(u,0,0,"linear",0,p,0);if(x)for(a=0;a<i.childNodes.length;a++)g=i.childNodes[a],p=E-(_=y+this.getElementDir(g,"top"))-this.getElementHeight(g),this.setElementDir(g,_,"top"),this.addTransformMoveStyle(g,0,0,"linear",0,p,0);for(a=s;a<=this.m_endRow;a++){var R=this._getAxisCellsByIndex(a-this.m_startRow,"row");_=o+this.getElementDir(R[0],"top"),p=-o;for(var I=0;I<R.length;I++)this.setElementDir(R[I],_,"top"),this.addTransformMoveStyle(R[I],0,0,"linear",0,p,0);S&&(u=h.childNodes[a],this.setElementDir(u,_,"top"),this.addTransformMoveStyle(u,0,0,"linear",0,p,0)),x&&(g=m.childNodes[a],this.setElementDir(g,_,"top"),this.addTransformMoveStyle(g,0,0,"linear",0,p,0))}this._modifyAxisCellContextIndex("row",s,this.m_endRow-s+1,n),this.m_endRow+=n,this.m_endRowPixel+=o,S&&(this.m_endRowHeader+=t.childNodes.length,this.m_endRowHeaderPixel+=o),x&&(this.m_endRowEndHeader+=i.childNodes.length,this.m_endRowEndHeaderPixel+=o),H.appendChild(e),w?(S&&h.appendChild(t),x&&m.appendChild(i)):(S&&h.insertBefore(t,d.nextSibling),x&&m.insertBefore(i,c.nextSibling)),this.setElementHeight(H,this.getElementHeight(H)+o),this.resizeGrid(),this.updateRowBanding(),this._refreshDatabodyMap(),this._isSelectionEnabled()&&this.applySelection(s,s+n,r,r+l);var M=this._getCellByIndex(this.createIndex(s+(n-1),this.m_endCol));this.m_animating=!0;var F=f.m_processingEventQueue?1:z.EXPAND_ANIMATION_DURATION;this._onEndEvent("transitionend",M,function(){f._handleAnimationEnd()},F),setTimeout(function(){for(var e=z.EXPAND_ANIMATION_DURATION,t="ease-out",i=s;i<=f.m_endRow;i++){for(var n=f._getAxisCellsByIndex(i,"row"),o=0;o<n.length;o++)f.addTransformMoveStyle(n[o],e+"ms",0,t,0,0,0);S&&f.addTransformMoveStyle(h.childNodes[i],e+"ms",0,t,0,0,0),x&&f.addTransformMoveStyle(m.childNodes[i],e+"ms",0,t,0,0,0)}},0)},z.prototype._addCellsToFragment=function(e,t,i,s,n,o,r,l){var a=this.getResources().isRTLMode()?"right":"left",h=this.getRendererOrTemplate("cell"),d=this.m_options.getColumnBandingInterval(),m=this.m_options.getRowBandingInterval(),c=this.m_options.getHorizontalGridlines(),_=this.m_options.getVerticalGridlines();null==r&&(r=t.getCount("row")),null==l&&(l=t.getCount("column"));for(var p=i>=this.m_startRow,g=n>=this.m_startCol,C=0,f=s,y=[],E=[],v=0;v<r;v+=1){for(var w,H,S,x,b=o,R=p?i+v:i+(r-1-v),I=Math.floor(R/m)%2==1,M=0;M<l;M+=H.column){var F=0;w=0;var z,D=g?n+M:n+(l-1-M);H={row:(z=t.getExtent?t.getExtent(this.createIndex(R,D)):{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}).row.extent,column:z.column.extent},g||(D=D-H.column+1);var L=p?R:R-H.row+1,A=this.createIndex(L,D);if(y[v]&&y[v][M])F=y[v][M].width,b=g?b+F:b-F;else{var T=this._patchExistingCells(z,D,L,y);if(T)F=T.width;else{var N=t.getData(this.createIndex(L,D)),O=t.getMetadata(this.createIndex(L,D));S=document.createElement("div"),x=this.createCellContext(A,N,O,S,H),S.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),S.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(S),S[this.getResources().getMappedAttribute("context")]=x,S[this.getResources().getMappedAttribute("metadata")]=O;var P=this.m_options.getInlineStyle("cell",x);null!=P&&u.applyMergedInlineStyles(S,P,""),""!==S.style.height&&(S.style.height=""),""!==S.style.width&&(S.style.width=""),this.m_utils.addCSSClassName(S,this.getMappedStyle("cell")),this.m_utils.addCSSClassName(S,this.getMappedStyle("formcontrol")),(this._hasFrozenColumns()&&D<=this.m_frozenColIndex||this._hasFrozenRows()&&L<=this.m_frozenRowIndex)&&this.m_utils.addCSSClassName(S,this.getMappedStyle("frozenCell")),u.isIos()&&(S.setAttribute("aria-labelledby",this.getLabelledBy(this._createActiveObject(S),null,S,!0)),S.setAttribute("role","text")),(I||Math.floor(D/d)%2==1)&&this.m_utils.addCSSClassName(S,this.getMappedStyle("banded"));var k,B=this.m_options.getStyleClass("cell",x);for(null!=B&&(S.className+=" "+B),k=0;k<H.row;k++){var W=0===k?x.keys.row:this._getKey(this._getHeaderByIndex(L+k,0,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),"row");E[v+k]=this._getCellDimension(S,L+k,W,"row","height"),w+=E[v+k]}for(this.setElementHeight(S,w),k=0;k<H.column;k++){var j=0===k?x.keys.column:this._getKey(this._getHeaderByIndex(D+k,0,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),"column");F+=this._getCellDimension(S,D,j,"column","width")}this.setElementWidth(S,F),!S.classList.contains(this.getMappedStyle("frozenCell"))&&("hidden"===_||this._isLastColumn(D+(H.column-1))&&(this.getRowHeaderWidth()+b+F>=this.getWidth()||-1!==this.m_endRowEndHeader))&&this.m_utils.addCSSClassName(S,this.getMappedStyle("borderVerticalNone")),("hidden"===c||this._isLastRow(L+(H.row-1))&&(this.getRowBottom(S,f+w)>=this.getHeight()||-1!==this.m_endColEndHeader)&&!S.classList.contains(this.getMappedStyle("frozenCell")))&&this.m_utils.addCSSClassName(S,this.getMappedStyle("borderHorizontalNone")),p?this.setElementDir(S,f,"top"):this.setElementDir(S,f-w,"top"),g?this.setElementDir(S,b,a):this.setElementDir(S,b-F,a),this.m_isCustomElementCallback()&&this.m_root.appendChild(S),this._renderContent(h,x,S,N,this.buildCellTemplateContext(x,O)),e.appendChild(S)}this._updateTempArray(y,{width:F},v,M,H.row,H.column),b=g?b+F:b-F,0===v&&(C+=F)}}w=E[v],f=p?f+w:f-w,w}return{avgWidth:C/l,totalRowHeight:E.reduce(function(e,t){return e+t},0),totalColumnWidth:C}},z.prototype._updateCellDimension=function(e,t,i,s,n,o,r,l){var a,h,d,m,c,u=0,_="width"===r?"height":"width",p=this._getCellByIndex(this.createIndex(s,i)),g=this.getElementDir(p,r),C=p[this.getResources().getMappedAttribute("context")];C.extents[o]+=e,"row"===o?(a=s,h=this.m_rowHeader,d=this.m_rowHeaderLevelCount,m=this.m_startRowHeader):(a=i,h=this.m_colHeader,d=this.m_columnHeaderLevelCount,m=this.m_startColHeader);for(var f=1;f<=e;f++){var y=this._getKey(this._getHeaderByIndex(l?a-f:a+f,0,h,d,m),o);u+=this._getCellDimension(p,l?a-f:a+f,y,o,r);for(var E=0;E<t;E++){var v,w;"row"===o?(v=l?s-f:s+f,w=i+E):(v=s+E,w=l?i-f:i+f),this._addIndexToDatabodyMap(this.createIndex(v,w),p.id)}}l&&(c="width"===r?this.getResources().isRTLMode()?"right":"left":"top",this.setElementDir(p,this.getElementDir(p,c)-u,c),C.indexes[o]-=e);this.setElementDir(p,g+u,r);var H={};return H[r]=u,H[_]=this.getElementDir(p,_),H.cell=p,H},z.prototype._patchExistingCells=function(e,t,i,s){var n=e.column.extent,o=e.row.extent,r=e.row.more.before,l=e.row.more.after,a=e.column.more.before,h=e.column.more.after;return t-1===this.m_endCol&&a?this._updateCellDimension(n,o,this.m_endCol,i,s,"column","width",!1):i-1===this.m_endRow&&r?this._updateCellDimension(o,n,t,this.m_endRow,s,"row","height",!1):t+n===this.m_startCol&&h?this._updateCellDimension(n,o,this.m_startCol,i,s,"column","width",!0):!(i+o!==this.m_startRow||!l)&&this._updateCellDimension(o,n,t,this.m_startRow,s,"row","height",!0)},z.prototype._updateTempArray=function(e,t,i,s,n,o){for(var r=0;r<n;r++){null==e[i+r]&&(e[i+r]=[]);for(var l=0;l<o;l++)e[i+r][s+l]=t}},z.prototype._getCellDimension=function(e,t,i,s,n){var o,r,l;if("row"===s?(o=this.getMappedStyle("rowheadercell")+" "+this.getMappedStyle("headercell"),r=this.m_endRowHeader):"column"===s&&(o=this.getMappedStyle("colheadercell")+" "+this.getMappedStyle("headercell"),r=this.m_endColHeader),-1===r){var a=this.createHeaderContext(s,t,null,{key:i},null,0,0,1),h=this.m_options.getInlineStyle(s,a),d=this.m_options.getStyleClass(s,a);l=document.createElement("div"),null!=h&&u.applyMergedInlineStyles(l,h,""),l.className=o+" "+d}else l=e;return this._getHeaderDimension(l,i,s,n)},z.prototype._getLabelDimension=function(e,t){let i,s,n,o,r;"column"===e?(i=this.m_columnHeaderLevelHeights,s="height",n=this.m_startColHeader,o=this.m_columnHeaderLevelCount,r=this.m_colHeader):"columnEnd"===e?(i=this.m_columnEndHeaderLevelHeights,s="height",n=this.m_startColEndHeader,o=this.m_columnEndHeaderLevelCount,r=this.m_colEndHeader):"row"===e?(i=this.m_rowHeaderLevelWidths,s="width",n=this.m_startRowHeader,o=this.m_rowHeaderLevelCount,r=this.m_rowHeader):(i=this.m_rowEndHeaderLevelWidths,s="width",n=this.m_startRowEndHeader,o=this.m_rowEndHeaderLevelCount,r=this.m_rowEndHeader);let l=i[t];if(null!=l)return l;const a=this._getHeaderByIndex(n,t,r,o,n),h=a[this.getResources().getMappedAttribute("context")],d=h.level,m=h.depth,c=this.getElementDir(a,s);let u=0,_=0;for(let e=d;e<d+m;e++){let t=i[e];null!=t?u+=t:_+=1}return 0===_?c:(l=Math.max(0,Math.round((c-u)/_)),i[t]=l,l)},z.prototype._modifyAndPushCells=function(e,t,i,s,n,o,r,l){let a=this.getResources().isRTLMode()?"right":"left",h="row"===i?"top":a,d=this.getResources().getMappedAttribute("context"),m=r?1:-1,c=function(i,s,n){i.forEach(i=>{let o=s(i),a=0;if(r)o>=e[0]&&(a=e.length);else for(;a<e.length&&!(e[a]>=o);a++);if(0===e.length&&l>0&&(a+=l),a>0){let s=t.length?t.slice(0,a).reduce((e,t)=>e+t):0;s*=m,a*=m,l&&e.length&&(a+=l*m),n(i,s,a,o)}})};if(c(s.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),e=>e[d].indexes[i],(e,t,s)=>{if(0!==t){let i=this.getElementDir(e,h)+t;this.setElementDir(e,i,h)}e[d].indexes[i]+=s}),n){c(n.querySelectorAll("."+this.getMappedStyle("headercell")),e=>e[d].index,(e,t,i)=>{if(0!==t){let i=this.getElementDir(e,h)+t;this.setElementDir(e,i,h)}e[d].index+=i}),c(n.querySelectorAll("."+this.getMappedStyle("groupingcontainer")),e=>this._getAttribute(e,"start",!0),(e,t,i,s)=>{this._setAttribute(e,"start",s+i)})}if(o){c(o.querySelectorAll("."+this.getMappedStyle("endheadercell")),e=>e[d].index,(e,t,i)=>{if(0!==t){let i=this.getElementDir(e,h)+t;this.setElementDir(e,i,h)}e[d].index+=i}),c(o.querySelectorAll("."+this.getMappedStyle("groupingcontainer")),e=>this._getAttribute(e,"start",!0),(e,t,i,s)=>{this._setAttribute(e,"start",s+i)})}},z.prototype.pushRowsDown=function(e,t){for(;e<=this.m_endRow;){var i=this._getAxisCellsByIndex(e,"row");if(i.length>0)for(var s=0;s<i.length;s++){var n=i[s],o=this.getElementDir(n,"top")+t;n.style.top=o+"px"}e+=1}},z.prototype.pushRowsUp=function(e,t){this.pushRowsDown(e,-t)},z.prototype.pushRowHeadersDown=function(e,t){for(;e;){var i=this.getElementDir(e,"top")+t;e.style.top=i+"px",e=e.nextSibling}},z.prototype.pushRowHeadersUp=function(e,t){this.pushRowHeadersDown(e,-t)},z.prototype.createCellContext=function(e,t,i,s,n){var o={parentElement:s,indexes:e,cell:t};this._isDataGridProvider()?o.data=t:o.data=null!=t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"data")?t.data:t,o.component=this,o.datasource=this.m_options.getProperty("data"),o.mode="navigation",o.extents=n;for(var r=Object.keys(i),l=0;l<r.length;l++){var a=r[l];o[a]=i[a]}return null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,o),this.m_fixContextCallback.call(this,o)},z.prototype._createUniqueId=function(e){return this._uniqueIdCallback(e,!1)},z.prototype.getRowHeaderWidth=function(){return null===this.m_rowHeaderWidth?0:this.m_rowHeaderWidth},z.prototype.getColumnHeaderHeight=function(){return null===this.m_colHeaderHeight?0:this.m_colHeaderHeight},z.prototype.getRowEndHeaderWidth=function(){return-1===this.m_endRowEndHeader?0:this.m_rowEndHeaderWidth},z.prototype.getColumnEndHeaderHeight=function(){return-1===this.m_endColEndHeader?0:this.m_colEndHeaderHeight},z.prototype.getRowBottom=function(e,t){var i=this.getColumnHeaderHeight();if(null!=t)return i+t;var s=this.getElementDir(e,"top"),n=this.calculateRowHeight(e);return isNaN(s)||isNaN(n)?i:i+s+n},z.prototype.handleCellsFetchError=function(e,t){if(this.m_fetching.cells=!1,this.hideStatusText(),null==this.m_databody.firstChild)this._shouldInitialize()&&this._handleInitialization(!0);else{var i=t[0],s=t[1];s.start+(s.count-1)>this.m_endCol&&(this.m_stopColumnFetch=!0,this.m_stopColumnHeaderFetch=!0,this.m_stopColumnEndHeaderFetch=!0),i.start+(i.count-1)>this.m_endRow&&(this.m_stopRowFetch=!0,this.m_stopRowHeaderFetch=!0,this.m_stopRowEndHeaderFetch=!0)}},z.prototype._isFocusableElementBeforeCell=function(e){if(null==e||e===this.getRootElement()||this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return!1;var t=e.tagName;return!!("INPUT"===t||"TEXTAREA"===t||"SELECT"===t||"BUTTON"===t||"A"===t||this.m_utils.containsCSSClassName(e,this.getMappedStyle("active"))||null!=e.getAttribute("tabIndex")&&parseInt(e.getAttribute("tabIndex"),10)>=0&&this.findCell(e)!==e)||this._isFocusableElementBeforeCell(e.parentNode)},z.prototype._setFocusToFirstFocusableElement=function(e,t){u.enableAllFocusableElements(e);var i=u.getFocusableElementsInNode(e);if(i.length>0){var s=i[0];if(s.focus(),t&&t.preventDefault(),s.setSelectionRange&&s.value)try{s.setSelectionRange(s.value.length,s.value.length)}catch(e){}return!0===this._overwriteFlag&&"function"==typeof i[0].select&&s.select(),!0}return!1},z.prototype.handleScroll=function(e){if(this._clearScrollPositionTimeout(),this.m_handleScrollOverflow||(this.m_hasVerticalScroller||this.m_hasHorizontalScroller||(this.m_databody.style.overflow="hidden"),this.m_handleScrollOverflow=!0),this.m_animating)e.preventDefault();else if(!this.m_utils.isTouchDeviceNotIOS())if(!0!==this.m_silentScroll){var t;e||(e=window.event),t=e.target?e.target:e.srcElement;var i=this.m_utils.getElementScrollLeft(t),s=t.scrollTop;this.scrollTo(i,s)}else this.m_silentScroll=!1},z.prototype._getMaxScrollWidth=function(){return this._isCountUnknownOrHighwatermark("column")&&!this.m_stopColumnFetch?Number.MAX_VALUE:this.m_scrollWidth},z.prototype._getMaxScrollHeight=function(){return this._isCountUnknownOrHighwatermark("row")&&!this.m_stopRowFetch?Number.MAX_VALUE:this.m_scrollHeight},z.prototype.scroll=function(e){if(null!=e.position){var t={};t.x=Math.max(0,Math.min(this.m_scrollWidth,e.position.scrollX)),t.y=Math.max(0,Math.min(this.m_scrollHeight,e.position.scrollY)),this._scrollToScrollPositionObject(t)}},z.prototype.scrollDelta=function(e,t){this._adjustScrollerSize();var i=Math.max(0,Math.min(this._getMaxScrollWidth(),this.m_currentScrollLeft-e)),s=Math.max(0,Math.min(this._getMaxScrollHeight(),this.m_currentScrollTop-t));this._initiateScroll(i,s)},z.prototype.adjustTouchScroll=function(e,t){return this.m_utils.isTouchDevice()&&0!==e&&0!==t&&(Math.abs(e)>Math.abs(t)?(t=0,this.m_extraScrollOverY=null):(e=0,this.m_extraScrollOverX=null)),[e,t]},z.prototype._initiateScroll=function(e,t){this.m_utils.isTouchDeviceNotIOS()?this.scrollTo(e,t):(this.m_utils.setElementScrollLeft(this.m_databody,e),this.m_databody.scrollTop=t,this.m_databody.firstChild.childElementCount||!this._hasFrozenColumns()&&!this._hasFrozenRows()||this.scrollTo(e,t))},z.prototype._initiateScrollOnAttached=function(){this._initiateScroll(this.m_currentScrollLeft,this.m_currentScrollTop)},z.prototype._disableTouchScrollAnimation=function(){this.m_databody.firstChild.style.transitionDuration="0ms",this.m_rowHeader.firstChild.style.transitionDuration="0ms",this.m_colHeader.firstChild.style.transitionDuration="0ms",this.m_rowEndHeader.firstChild.style.transitionDuration="0ms",this.m_colEndHeader.firstChild.style.transitionDuration="0ms"},z.prototype._shouldLongScroll=function(e,t){return!this._isHighWatermarkScrolling()&&(e+this.getViewportWidth()<this._getMaxLeftPixel()||t+this.getViewportHeight()<this._getMaxTopPixel()||e>this._getMaxRightPixel()||t>this._getMaxBottomPixel())},z.prototype.scrollTo=function(e,t){if(this.m_prevScrollLeft=this.m_currentScrollLeft,this.m_currentScrollLeft=e,this.m_prevScrollTop=this.m_currentScrollTop,this.m_currentScrollTop=t,this._checkScroll=!1,this.m_utils.isTouchDeviceNotIOS()||(this._shouldLongScroll(e,t)?this.handleLongScroll(e,t):this.fillViewport(),this._checkScroll=!0),this._syncScroller(),this._adjustScrollerSize(),null!=this.m_cellToFocus){var i=this.m_cellToFocus;this.m_cellToFocus=null,this._setActive(i,this._createActiveObject(i),null,!1,!1,!0)}if(null!=this.m_scrollIndexAfterFetch&&this._isInViewport(this.m_scrollIndexAfterFetch)===z.INSIDE&&(this._isDatabodyCellActive()&&this.m_scrollIndexAfterFetch.row===this.m_active.indexes.row&&this.m_scrollIndexAfterFetch.column===this.m_active.indexes.column&&this._highlightActive(),this.m_scrollIndexAfterFetch=null),null!=this.m_scrollHeaderAfterFetch){let e="row";const t=this.m_scrollHeaderAfterFetch.index;"column"!==this.m_scrollHeaderAfterFetch.axis&&"columnEnd"!==this.m_scrollHeaderAfterFetch.axis||(e="column"),this._isAxisIndexInViewport(t,e)===z.INSIDE&&(this._isDatabodyCellActive()||this.m_scrollHeaderAfterFetch.axis!==this.m_active.axis||this.m_scrollHeaderAfterFetch.index!==this.m_active.index||this.m_scrollHeaderAfterFetch.level!==this.m_active.level||this._highlightActive(),this.m_scrollHeaderAfterFetch=null)}this.m_utils.isTouchDeviceNotIOS()||this.m_prevScrollTop===t&&this.m_prevScrollLeft===e||this.fireEvent("scroll",{event:null,ui:{scrollX:e,scrollY:t}}),!this.m_utils.isTouchDeviceNotIOS()&&this.isFetchComplete()&&this._checkScrollPosition()},z.prototype._scrollTransitionEnd=function(){this._isSelectionEnabled()&&this._scrollTouchSelectionAffordance(),this.fireEvent("scroll",{event:null,ui:{scrollX:this.m_currentScrollLeft,scrollY:this.m_currentScrollTop}}),this._shouldLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop)?this.handleLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop):this.fillViewport(),this._checkScroll=!0,this.isFetchComplete()&&this._checkScrollPosition()},z.prototype._bounceBack=function(){var e=this.m_currentScrollLeft,t=this.m_currentScrollTop,i=this.m_databody.firstChild,s=this.m_colHeader.firstChild,n=this.m_rowHeader.firstChild,o=this.m_colEndHeader.firstChild,r=this.m_rowEndHeader.firstChild;i.style.transitionDuration=z.BOUNCE_ANIMATION_DURATION+"ms",n.style.transitionDuration=z.BOUNCE_ANIMATION_DURATION+"ms",r.style.transitionDuration=z.BOUNCE_ANIMATION_DURATION+"ms",s.style.transitionDuration=z.BOUNCE_ANIMATION_DURATION+"ms",o.style.transitionDuration=z.BOUNCE_ANIMATION_DURATION+"ms",null==this.m_scrollTransitionEnd&&(this.m_scrollTransitionEnd=this._scrollTransitionEnd.bind(this)),this._onEndEvent("transitionend",i,this.m_scrollTransitionEnd,z.BOUNCE_ANIMATION_DURATION),this.getResources().isRTLMode()?(i.style.transform="translate3d("+e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+e+"px, 0, 0)",o.style.transform="translate3d("+e+"px, 0, 0)"):(i.style.transform="translate3d("+-e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+-e+"px, 0, 0)",o.style.transform="translate3d("+-e+"px, 0, 0)"),n.style.transform="translate3d(0, "+-t+"px, 0)",r.style.transform="translate3d(0, "+-t+"px, 0)",this.m_extraScrollOverX=null,this.m_extraScrollOverY=null},z.prototype._syncScroller=function(){var e=this.m_currentScrollLeft,t=this.m_currentScrollTop,i=this.m_databody.firstChild,s=this.m_colHeader.firstChild,n=this.m_rowHeader.firstChild,o=this.m_colEndHeader.firstChild,r=this.m_rowEndHeader.firstChild;let l,a;if(this.m_databodyFrozenCol&&(l=this.m_databodyFrozenCol.firstChild),this.m_databodyFrozenRow&&(a=this.m_databodyFrozenRow.firstChild),this.m_utils.isTouchDeviceNotIOS()&&Object.prototype.hasOwnProperty.call(window,"WebKitCSSMatrix"))this._checkScroll=!1,null!=this.m_extraScrollOverX||null!=this.m_extraScrollOverY?(null!=this.m_extraScrollOverX?e+=this.m_extraScrollOverX:t+=this.m_extraScrollOverY,null==this.m_bounceBack&&(this.m_bounceBack=this._bounceBack.bind(this)),this._onEndEvent("transitionend",i,this.m_bounceBack,500)):"0ms"===i.style.transitionDuration?this._scrollTransitionEnd():(null==this.m_scrollTransitionEnd&&(this.m_scrollTransitionEnd=this._scrollTransitionEnd.bind(this)),this._onEndEvent("transitionend",i,this.m_scrollTransitionEnd,i.style.transitionDuration)),this.getResources().isRTLMode()?(i.style.transform="translate3d("+e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+e+"px, 0, 0)",o.style.transform="translate3d("+e+"px, 0, 0)"):(i.style.transform="translate3d("+-e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+-e+"px, 0, 0)",o.style.transform="translate3d("+-e+"px, 0, 0)"),n.style.transform="translate3d(0, "+-t+"px, 0)",r.style.transform="translate3d(0, "+-t+"px, 0)";else{var h=this.getResources().isRTLMode()?"right":"left";this.setElementDir(s,-e,h),this.setElementDir(o,-e,h),this.setElementDir(n,-t,"top"),this.setElementDir(r,-t,"top"),a&&this.setElementDir(a,-e,h),l&&this.setElementDir(l,-t,"top")}},z.prototype._adjustScrollerSize=function(){var e=this.m_databody.firstChild,t=this.getElementHeight(e),i=this.getElementWidth(e),s=this._getEmptyElement(),n=0,o=0;s&&(n=this.getElementHeight(s),o=this.getElementWidth(s)),(this._getMaxBottomPixel()>t||this.getDataSource().getCount("row")===this._getMaxBottom()+1&&!this._isCountUnknown("row")&&this._getMaxBottom()>-1)&&this.setElementHeight(e,Math.max(this._getMaxBottomPixel(),n)),(this._getMaxRightPixel()>i||this.getDataSource().getCount("column")===this._getMaxRight()+1&&!this._isCountUnknown("column")&&this._getMaxRight()>-1)&&this.setElementWidth(e,Math.max(this._getMaxRightPixel(),o))},z.prototype._getLongScrollStart=function(e,t,i){var s,n,o,r,l,a,h,d;if(t!==e){"row"===i?(s=this.getElementHeight(this.m_databody.firstChild),n=this.m_utils._getMaxDivHeightForScrolling(),o=this._getMaxScrollHeight(),r=this.m_avgRowHeight,l=this.m_hasHorizontalScroller?this.m_utils.getScrollbarSize():0,d=Math.max(Math.max(this.getDataSource().getCount(i),this.m_endRow),0)):"column"===i&&(s=this.getElementWidth(this.m_databody.firstChild),n=this.m_utils._getMaxDivWidthForScrolling(),o=this._getMaxScrollWidth(),r=this.m_avgColWidth,l=this.m_hasVerticalScroller?this.m_utils.getScrollbarSize():0,d=Math.max(Math.max(this.getDataSource().getCount(i),this.m_endCol),0));var m=Math.max(Math.min(e/s,1),0),c=this.getFetchSize(i);a=Math.floor(d*m),h=n<=s?Math.min(e,o):a*r,(1===m||e+c*r>s-l)&&(a=Math.max(d-c,0),h=Math.max(s-c*r,0))}else"row"===i?(a=null!=this.m_longScrollRow?this.m_longScrollRow:this.m_startRow,h=null!=this.m_longScrollRowPixel?this.m_longScrollRowPixel:this.m_startRowPixel):"column"===i&&(a=null!=this.m_longScrollColumn?this.m_longScrollColumn:this.m_startCol,h=null!=this.m_longScrollColumnPixel?this.m_longScrollColumnPixel:this.m_startColPixel);return{start:a,startPixel:h}},z.prototype.handleLongScroll=function(e,t){this.m_isLongScroll=!0;const i=this._getLongScrollStart(t,this.m_prevScrollTop,"row");this.m_longScrollRow=i.start,this.m_longScrollRowPixel=i.startPixel;const s=this._getLongScrollStart(e,this.m_prevScrollLeft,"column");if(this.m_longScrollColumn=s.start,this.m_longScrollColumnPixel=s.startPixel,this.isSkeletonSupport()&&this.loadSkeletons(t,e,this.m_longScrollRow,this.m_longScrollColumn,this.m_longScrollRowPixel,this.m_longScrollColumnPixel),this.isFetchComplete()&&this._isScrollBackToEditable(!0)){const e=this.m_longScrollRow,t=this.m_longScrollRowPixel,i=this.m_longScrollColumn,s=this.m_longScrollColumnPixel;this.m_hasCells&&(this.m_startRow=e,this.m_endRow=-1,this.m_startRowPixel=t,this.m_endRowPixel=t,this.m_startCol=i,this.m_endCol=-1,this.m_startColPixel=s,this.m_endColPixel=s),this.m_hasRowHeader&&(this.m_startRowHeader=e,this.m_endRowHeader=-1,this.m_startRowHeaderPixel=t,this.m_endRowHeaderPixel=t),this.m_hasRowEndHeader&&(this.m_startRowEndHeader=e,this.m_endRowEndHeader=-1,this.m_startRowEndHeaderPixel=t,this.m_endRowEndHeaderPixel=t),this.m_hasColHeader&&(this.m_startColHeader=i,this.m_endColHeader=-1,this.m_startColHeaderPixel=s,this.m_endColHeaderPixel=s),this.m_hasColEndHeader&&(this.m_startColEndHeader=i,this.m_endColEndHeader=-1,this.m_startColEndHeaderPixel=s,this.m_endColEndHeaderPixel=s),this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.fetchHeaders("row",e,this.m_rowHeader,this.m_rowEndHeader,void 0,{success:function(e,t,i){this.handleHeadersFetchSuccessForLongScroll(e,t,i)}}),this.fetchHeaders("column",i,this.m_colHeader,this.m_colEndHeader,void 0,{success:function(e,t,i){this.handleHeadersFetchSuccessForLongScroll(e,t,i)}}),this.fetchCells(this.m_databody,e,i,null,null,{success:function(n,o){this.handleCellsFetchSuccessForLongScroll(n,o,e,i,t,s)}})}},z.prototype.handleHeadersFetchSuccessForLongScroll=function(e,t,i){let s=this.m_rowHeader.firstChild,n=this.m_rowEndHeader.firstChild;"column"===t.axis&&(s=this.m_colHeader.firstChild,n=this.m_colEndHeader.firstChild),null!=s&&this._removeAllNonSkeletonContainerNodes(s),null!=n&&this._removeAllNonSkeletonContainerNodes(n),this.handleHeadersFetchSuccess(e,t,i,!1)},z.prototype.handleCellsFetchSuccessForLongScroll=function(e,t,i,s,n,o){const r=this.m_databody.firstChild;if(null!=r&&!this._getEmptyElement()){this._getAllNonSkeletonContainerNodes(r).forEach(e=>{this._remove(e)})}this.handleCellsFetchSuccess(e,t)},z.prototype._cleanupViewport=function(e){if(!this._isHighWatermarkScrolling()&&this._isScrollBackToEditable()){null==e&&(this.m_prevScrollLeft>this.m_currentScrollLeft?e="right":this.m_prevScrollLeft<this.m_currentScrollLeft?e="left":this.m_prevScrollTop>this.m_currentScrollTop?e="bottom":this.m_prevScrollTop<this.m_currentScrollTop&&(e="top"));var t=this._getViewportLeft(),i=this._getViewportRight(),s=this._getViewportTop(),n=this._getViewportBottom();"top"===e&&s>this._getMaxTopPixel()?(this.removeRowsFromTop(this.m_databody),this.removeRowHeadersFromTop()):"bottom"===e&&n<this._getMaxBottomPixel()?(this.removeRowsFromBottom(this.m_databody),this.removeRowHeadersFromBottom()):"left"===e&&t>this._getMaxLeftPixel()?(this.removeColumnsFromLeft(this.m_databody),this.removeColumnHeadersFromLeft()):"right"===e&&i<this._getMaxRightPixel()&&(this.removeColumnsFromRight(this.m_databody),this.removeColumnHeadersFromRight())}},z.prototype.fillViewport=function(){var e,t;const i=this._getLongScrollStart(this.m_currentScrollTop,this.m_prevScrollTop,"row"),s=this._getLongScrollStart(this.m_currentScrollLeft,this.m_prevScrollLeft,"column");if(this.isSkeletonSupport()&&this.loadSkeletons(this.m_currentScrollTop,this.m_currentScrollLeft,i.start,s.start,i.startPixel,s.startPixel),this.isFetchComplete()){var n=this._getViewportLeft(),o=this._getViewportRight()+z.FETCH_PIXEL_THRESHOLD,r=this._getViewportTop(),l=this._getViewportBottom()+z.FETCH_PIXEL_THRESHOLD;if(this._getMaxBottomPixel()<=l&&(!this.m_stopRowHeaderFetch||!this.m_stopRowEndHeaderFetch||!this.m_stopRowFetch))return e=Math.max(0,this._getMaxBottom()+1),t=Math.max(0,this.getFetchCount("row",e)),this.fetchHeaders("row",e,this.m_rowHeader,this.m_rowEndHeader,t),void this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1);if((this._getMaxTopPixel()>r||0===this.m_currentScrollTop)&&this._getMaxTop()>0)return e=Math.max(0,this._getMaxTop()-this.getFetchSize("row")),t=Math.max(0,this._getMaxTop()-e),this.fetchHeaders("row",e,this.m_rowHeader,this.m_rowEndHeader,t),void this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1);if(this._getMaxRightPixel()<=o&&(!this.m_stopColumnHeaderFetch||!this.m_stopColumnEndHeaderFetch||!this.m_stopColumnFetch))return e=Math.max(0,this._getMaxRight()+1),t=Math.max(0,this.getFetchCount("column",e)),this.fetchHeaders("column",e,this.m_colHeader,this.m_colEndHeader,t),void this.fetchCells(this.m_databody,this.m_startRow,e,this.m_endRow-this.m_startRow+1,t);(this._getMaxLeftPixel()>n||0===this.m_currentScrollLeft)&&this._getMaxLeft()>0&&(e=Math.max(0,this._getMaxLeft()-this.getFetchSize("column")),t=Math.max(0,this._getMaxLeft()-e),this.fetchHeaders("column",e,this.m_colHeader,this.m_colEndHeader,t),this.fetchCells(this.m_databody,this.m_startRow,e,this.m_endRow-this.m_startRow+1,t))}},z.prototype._getMaxRight=function(){return Math.max(Math.max(this.m_endCol,this.m_endColHeader),this.m_endColEndHeader)},z.prototype._getMaxLeft=function(){return Math.max(Math.max(this.m_startCol,this.m_startColHeader),this.m_startColEndHeader)},z.prototype._getMaxRightPixel=function(){return Math.max(Math.max(this.m_endColPixel,this.m_endColHeaderPixel),this.m_endColEndHeaderPixel)},z.prototype._getMaxLeftPixel=function(){return Math.max(Math.max(this.m_startColPixel,this.m_startColHeaderPixel),this.m_startColEndHeaderPixel)},z.prototype._getMaxBottom=function(){return Math.max(Math.max(this.m_endRow,this.m_endRowHeader),this.m_endRowEndHeader)},z.prototype._getMaxTop=function(){return Math.max(Math.max(this.m_startRow,this.m_startRowHeader),this.m_startRowEndHeader)},z.prototype._getMaxBottomPixel=function(){return Math.max(Math.max(this.m_endRowPixel,this.m_endRowHeaderPixel),this.m_endRowEndHeaderPixel)},z.prototype._getMaxTopPixel=function(){return Math.max(Math.max(this.m_startRowPixel,this.m_startRowHeaderPixel),this.m_startRowEndHeaderPixel)},z.prototype._isScrollBackToEditable=function(e){var t=this._getCurrentMode(),i=this._getActiveElement();return"edit"!==t||!e&&!this._isCellGoingToBeRemoved(i)||this._handleExitEdit(null,i)},z.prototype._isCellGoingToBeRemoved=function(e){if(!this._isHighWatermarkScrolling()){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.getElementDir(e.parentNode,"top");if(t+this.getElementHeight(e)<this.m_currentScrollTop||t<this.m_currentScrollTop+this.getViewportHeight())return!0}if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var i=this.getElementDir(e,"left");if(i+this.getElementWidth(e)<this.m_currentScrollLeft||i<this.m_currentScrollLeft+this.getViewportHeight())return!0}}},z.prototype._removeCellsAlongAxis=function(e,t,i){var s,n,o,r,l,a,h,d,m,c,u,_,p,g,C=0,f=0;for("row"===e?(n=this.m_startRow,o=this.m_endRow,r=this.m_rowHeader,l=this.m_rowHeaderLevelCount,a=this.m_startRowHeader,h="height",d=this.m_startRowPixel,m=this.m_endRowPixel,c=this.m_currentScrollTop,u="column",_=this.m_startCol,p=this.m_endCol,g="top",s=i?o:n):(n=this.m_startCol,o=this.m_endCol,r=this.m_colHeader,l=this.m_columnHeaderLevelCount,a=this.m_startColHeader,h="width",d=this.m_startColPixel,m=this.m_endColPixel,c=this.m_currentScrollLeft,u="row",_=this.m_startRow,p=this.m_endRow,g=this.getResources().isRTLMode()?"right":"left",s=i?o:n);s<=o&&s>=n;){var y=this._getKey(this._getHeaderByIndex(s,l-1,r,l,a),e);null==y&&(y=this._getKey(this._getCellByIndex("column"===e?this.createIndex(this.m_startRow,s):this.createIndex(s,this.m_startCol)),e));var E=this._getCellDimension(null,s,y,e,h);if(!(i?m-E-C>t:d+E+C<c-t))break;for(var v,w=_;w<=p;w+=v){var H=this._getCellByIndex("column"===e?this.createIndex(w,s):this.createIndex(s,w)),S=H[this.getResources().getMappedAttribute("context")],x=S.extents[e];v=S.extents[u],1===x?this._remove(H):(S.extents[e]-=1,this.setElementDir(H,this.getElementDir(H,h)-E,h),i||(S.indexes[e]+=1,this.setElementDir(H,this.getElementDir(H,g)+E,g)));for(var b=0;b<v;b++){var R="column"===e?this.createIndex(w+b,s):this.createIndex(s,w+b);this._removeIndexFromDatabodyMap(R)}}C+=E,f+=1,s=i?s-1:s+1}return{dimensionChange:C,extentChange:f}},z.prototype.removeHeadersFromStartOfContainer=function(e,t,i,s,n,o,r,l){var a=0,h=0,d=null==t?e.firstChild:t.nextSibling;if(null==d)return{extentChange:0,dimensionChange:0};for(var m=this.m_utils.containsCSSClassName(d,n),c=m?d:d.firstChild,u=this.getElementDir(c,o);i+u<l-s;){if(this._remove(d),h+=u,a+=m?1:this._getAttribute(d,"extent",!0),i+=u,null==(d=null==t?e.firstChild:t.nextSibling))return{extentChange:a,dimensionChange:h};c=(m=this.m_utils.containsCSSClassName(d,n))?d:d.firstChild,u=this.getElementDir(c,o)}if(!m){var _=this.removeHeadersFromStartOfContainer(d,d.firstChild,i,s,n,o,r,l);this._setAttribute(d,"start",this._getAttribute(d,"start",!0)+_.extentChange),this._setAttribute(d,"extent",this._getAttribute(d,"extent",!0)-_.extentChange),this.setElementDir(c,this.getElementDir(c,r)+_.dimensionChange,r),this.setElementDir(c,this.getElementDir(c,o)-_.dimensionChange,o),a+=_.extentChange,h+=_.dimensionChange}return{extentChange:a,dimensionChange:h}},z.prototype.removeHeadersFromEndOfContainer=function(e,t,i,s,n){for(var o=0,r=0,l=e.lastChild,a=this.m_utils.containsCSSClassName(l,s),h=a?l:l.firstChild,d=this.getElementDir(h,n);t-d>i;)this._remove(l),r+=d,o+=a?1:this._getAttribute(l,"extent",!0),t-=d,l=e.lastChild,h=(a=this.m_utils.containsCSSClassName(l,s))?l:l.firstChild,d=this.getElementDir(h,n);if(!a){var m=this.removeHeadersFromEndOfContainer(l,t,i,s,n);this._setAttribute(l,"extent",this._getAttribute(l,"extent",!0)-m.extentChange),this.setElementDir(h,this.getElementDir(h,n)-m.dimensionChange,n),o+=m.extentChange,r+=m.dimensionChange}return{extentChange:o,dimensionChange:r}},z.prototype.removeColumnHeadersFromLeft=function(){var e,t;if(this.m_endColHeader-this.m_startColHeader>this.MAX_COLUMN_THRESHOLD){var i=this.m_colHeader.firstChild;e=this.getColumnThreshold(),this.m_startColHeaderPixel<=this.m_currentScrollLeft-e&&(t=this.removeHeadersFromStartOfContainer(i,null,this.m_startColHeaderPixel,e,this.getMappedStyle("colheadercell"),"width",this.getResources().isRTLMode()?"right":"left",this.m_currentScrollLeft),this.m_startColHeaderPixel+=t.dimensionChange,this.m_startColHeader+=t.extentChange)}if(this.m_endColEndHeader-this.m_startColEndHeader>this.MAX_COLUMN_THRESHOLD){var s=this.m_colEndHeader.firstChild;e=this.getColumnThreshold(),this.m_startColEndHeaderPixel<this.m_currentScrollLeft-e&&(t=this.removeHeadersFromStartOfContainer(s,null,this.m_startColEndHeaderPixel,e,this.getMappedStyle("colendheadercell"),"width",this.getResources().isRTLMode()?"right":"left",this.m_currentScrollLeft),this.m_startColEndHeaderPixel+=t.dimensionChange,this.m_startColEndHeader+=t.extentChange)}},z.prototype.removeColumnsFromLeft=function(e){if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var t=e.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getColumnThreshold();if(t.length<1)return;var s=this._removeCellsAlongAxis("column",i,!1);this.m_startColPixel+=s.dimensionChange,this.m_startCol+=s.extentChange}},z.prototype.removeColumnHeadersFromRight=function(){var e,t,i=this.m_currentScrollLeft+this.getViewportWidth()+this.getColumnThreshold();this.m_endColHeader-this.m_startColHeader>this.MAX_COLUMN_THRESHOLD&&(e=this.m_colHeader.firstChild,this.m_endColHeaderPixel>i&&(this.m_stopColumnHeaderFetch&&(this.m_stopColumnHeaderFetch=!1),t=this.removeHeadersFromEndOfContainer(e,this.m_endColHeaderPixel,i,this.getMappedStyle("colheadercell"),"width"),this.m_endColHeaderPixel-=t.dimensionChange,this.m_endColHeader-=t.extentChange)),this.m_endColEndHeader-this.m_startColEndHeader>this.MAX_COLUMN_THRESHOLD&&(e=this.m_colEndHeader.firstChild,this.m_endColEndHeaderPixel>i&&(this.m_stopColumnEndHeaderFetch&&(this.m_stopColumnEndHeaderFetch=!1),t=this.removeHeadersFromEndOfContainer(e,this.m_endColEndHeaderPixel,i,this.getMappedStyle("colendheadercell"),"width"),this.m_endColEndHeaderPixel-=t.dimensionChange,this.m_endColEndHeader-=t.extentChange))},z.prototype.removeColumnsFromRight=function(e){if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var t=e.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.m_currentScrollLeft+this.getViewportWidth()+this.getColumnThreshold();if(this.m_endColPixel<=i||t.length<1)return;this.m_stopColumnFetch&&(this.m_stopColumnFetch=!1);var s=this._removeCellsAlongAxis("column",i,!0);this.m_endColPixel-=s.dimensionChange,this.m_endCol-=s.extentChange}},z.prototype.removeRowHeadersFromTop=function(){var e,t;if(this.m_endRowHeader-this.m_startRowHeader>this.MAX_ROW_THRESHOLD){var i=this.m_rowHeader.firstChild;t=this.getRowThreshold(),this.m_startRowHeaderPixel>=this.m_currentScrollTop-t||(e=this.removeHeadersFromStartOfContainer(i,null,this.m_startRowHeaderPixel,t,this.getMappedStyle("rowheadercell"),"height","top",this.m_currentScrollTop),this.m_startRowHeaderPixel+=e.dimensionChange,this.m_startRowHeader+=e.extentChange)}if(this.m_endRowEndHeader-this.m_startRowEndHeader>this.MAX_ROW_THRESHOLD){var s=this.m_rowEndHeader.firstChild;t=this.getRowThreshold(),this.m_startRowEndHeaderPixel>=this.m_currentScrollTop-t||(e=this.removeHeadersFromStartOfContainer(s,null,this.m_startRowEndHeaderPixel,t,this.getMappedStyle("rowendheadercell"),"height","top",this.m_currentScrollTop),this.m_startRowEndHeaderPixel+=e.dimensionChange,this.m_startRowEndHeader+=e.extentChange)}},z.prototype.removeRowsFromTop=function(e){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.getRowThreshold();if(this.m_startRowPixel>=this.m_currentScrollTop-t)return;var i=this._removeCellsAlongAxis("row",t,!1);this.m_startRowPixel+=i.dimensionChange,this.m_startRow+=i.extentChange}},z.prototype.removeRowHeadersFromBottom=function(){var e,t=this.m_currentScrollTop+this.getViewportHeight()+this.getRowThreshold();if(this.m_endRowHeader-this.m_startRowHeader>this.MAX_ROW_THRESHOLD){var i=this.m_rowHeader.firstChild;this.m_endRowHeaderPixel<=t||(this.m_stopRowHeaderFetch&&(this.m_stopRowHeaderFetch=!1),e=this.removeHeadersFromEndOfContainer(i,this.m_endRowHeaderPixel,t,this.getMappedStyle("rowheadercell"),"height"),this.m_endRowHeaderPixel-=e.dimensionChange,this.m_endRowHeader-=e.extentChange)}if(this.m_endRowEndHeader-this.m_startRowEndHeader>this.MAX_ROW_THRESHOLD){var s=this.m_rowEndHeader.firstChild;this.m_endRowEndHeaderPixel<=t||(this.m_stopRowEndHeaderFetch&&(this.m_stopRowEndHeaderFetch=!1),e=this.removeHeadersFromEndOfContainer(s,this.m_endRowEndHeaderPixel,t,this.getMappedStyle("rowendheadercell"),"height"),this.m_endRowEndHeaderPixel-=e.dimensionChange,this.m_endRowEndHeader-=e.extentChange)}},z.prototype.removeRowsFromBottom=function(e){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.m_currentScrollTop+this.getViewportHeight()+this.getRowThreshold();if(this.m_endRowPixel<=t)return;this.m_stopRowFetch&&(this.m_stopRowFetch=!1);var i=this._removeCellsAlongAxis("row",t,!0);this.m_endRowPixel-=i.dimensionChange,this.m_endRow-=i.extentChange}},z.prototype.handleContextMenuGesture=function(e,t,i){var s,n,o,r,l=e.originalEvent.target,a=this.findCell(l),h=!1;if(null===a&&(a=this.findHeader(l))&&(h=!0,r=this.getHeaderCellAxis(a)),"touch"===t&&null!=a){s=h?this.getHeaderCellIndex(a):this.getCellIndexes(a);let t=h?this._isHeaderInsideSelection(s,r):this._isContainSelection(s);(!this.isMultipleSelection()||!t||this._isDatabodyCellActive()&&s.row!==this.m_active.indexes.row&&s.column!==this.m_active.indexes.column)&&(this._isSelectionEnabled()?this.handleDatabodyClickSelection(e.originalEvent):this.handleDatabodyClickActive(e.originalEvent))}if(!this.m_utils._isNodeEditableOrClickable(l,this.m_root)){if(null==a||h)if(null==(a=this.findHeader(l)||this.findLabel(l))){var d="disable";n={resize:d,resizeWidth:d,resizeHeight:d,sortRow:d,sortCol:d,cut:d,paste:d,sortColAsc:d,sortColDsc:d,sortRowAsc:d,sortRowDsc:d},o=a}else(n=this._getHeaderCapability(a)).resizeFitToContent=h?"enable":"disable","column"!==r&&"columnEnd"!==r||!this.m_selectionFrontier||"column"!==this.m_selectionFrontier.axis?"row"!==r&&"rowEnd"!==r||!this.m_selectionFrontier||"row"!==this.m_selectionFrontier.axis||(n.resizeWidth="disable"):n.resizeHeight="disable",o=a;else s=this.getCellIndexes(a),this.isMultipleSelection()&&this._isContainSelection(s)?(o=this._getActiveElement(),this._isDatabodyCellActive()?(null==o&&(o=a),(n="keyboard"===t?this._getCellCapability(o):this._getCellCapability(o,a)).resizeFitToContent="disable"):(n=this._getHeaderCapability(o,a)).resizeFitToContent="enable"):(o=a,(n=this._getCellCapability(o)).resizeFitToContent="disable"),this.m_selectionFrontier&&"row"===this.m_selectionFrontier.axis?n.resizeWidth="disable":this.m_selectionFrontier&&"column"===this.m_selectionFrontier.axis&&(n.resizeHeight="disable");i.call(null,{capabilities:n,launcher:o},e,t)}},z.prototype._getCellCapability=function(e,t){var i=!0,s=!0,n="disable",o="enable",r={resize:n,resizeWidth:n,resizeHeight:n,sortRow:n,sortCol:n,cut:n,cutCells:n,copyCells:n,paste:n,pasteCells:n,autoFill:n,sortColAsc:n,sortColDsc:n,sortRowAsc:n,sortRowDsc:n,freezeRow:n,freezeCol:n,unfreezeRow:n,unfreezeCol:n};if(null!=t&&(i=this._getIndex(e,"column")===this._getIndex(t,"column"),!1===(s=this._getKey(e,"row")===this._getKey(t,"row"))&&!1===i))return r;this.m_options.isCopyEnabled()&&(r.copyCells=o),this.m_options.isCutEnabled()&&(r.cutCells=o),this.m_options.isPasteEnabled()&&(r.pasteCells=o);let l=this.m_selection,a=!1;if(!this.m_discontiguousSelection&&l&&1===l.length){let e=l[0].startIndex.row,t=l[0].startIndex.column,i=l[0].endIndex.row,s=l[0].endIndex.column;e===i&&t===s||(a=!0)}this.m_options.isFloodFillEnabled()&&a&&(r.autoFill=o);const h=this.getResources().getMappedAttribute("context");this.m_options.isFreezeEnabled("column")&&(r.freezeCol=o,e[h].indexes.column===this.m_frozenColIndex&&(r.freezeCol=n),r.unfreezeCol=n,this._hasFrozenColumns()&&(r.unfreezeCol=o)),this.m_options.isFreezeEnabled("row")&&(r.freezeRow=o,e[h].indexes.row===this.m_frozenRowIndex&&(r.freezeRow=n),r.unfreezeRow=n,this._hasFrozenRows()&&(r.unfreezeRow=o));var d=this.getHeaderFromCell(e,"row"),m=this.getHeaderFromCell(e,"column"),c=this.getResources().getMappedAttribute("resizable"),u=this.getResources().getMappedAttribute("sortable");if(null!=m&&i&&("true"===m.getAttribute(c)&&(r.resize=o,r.resizeWidth=o),"true"===m.getAttribute(u))){r.sortCol=o,r.sortColAsc=o,r.sortColDsc=o;var _=m.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===_?r.sortColAsc=n:"descending"===_&&(r.sortColDsc=n)}return null!=d&&s&&(this._isMoveEnabled("row")&&(r.cut=o,r.paste=o),"true"===d.getAttribute(u)&&(r.sortRow=o,r.sortRowAsc=o,r.sortRowDsc=o),null!=d&&("true"===d.getAttribute(c)&&(r.resize=o,r.resizeHeight=o),"true"===d.getAttribute(u)&&(r.sortRow=o))),r},z.prototype._getHeaderCapability=function(e,t){var i=!0,s=!0,n="disable",o="enable",r={resize:n,resizeWidth:n,resizeHeight:n,sortRow:n,sortCol:n,cut:n,paste:n,sortColAsc:n,sortColDsc:n,sortRowAsc:n,sortRowDsc:n,freezeRow:n,freezeCol:n,unfreezeRow:n,unfreezeCol:n};if(null!=t&&(i=this.getHeaderCellIndex(e)===this._getIndex(t,"column"),!1===(s=this._getKey(e,"row")===this._getKey(t,"row"))&&!1===i))return r;var l=this.getHeaderCellAxis(e),a=this.getResources().getMappedAttribute("resizable"),h=this.getResources().getMappedAttribute("sortable");const d=this.getResources().getMappedAttribute("context");if(null!==e)if("column"!==l&&"columnEnd"!==l||!i){if(s){if(this._isMoveEnabled("row")&&(r.cut=o,r.paste=o),"true"===e.getAttribute(a)&&(r.resize=o,r.resizeHeight=o),r.resizeWidth=this.m_options.isResizable(l,"width"),"true"===e.getAttribute(h)){r.sortRow=o,r.sortRowAsc=o,r.sortRowDsc=o;let t=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===t?r.sortRowAsc=n:"descending"===t&&(r.sortRowDsc=n)}this.m_options.isFreezeEnabled("row")&&(r.freezeRow=o,e[d].index===this.m_frozenRowIndex&&(r.freezeRow=n),r.unfreezeRow=n,this._hasFrozenRows()&&(r.unfreezeRow=o))}}else{if("true"===e.getAttribute(a)&&(r.resizeWidth=o,r.resize=o),r.resizeHeight=this.m_options.isResizable(l,"height"),"true"===e.getAttribute(h)){r.sortCol=o,r.sortColAsc=o,r.sortColDsc=o;var m=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===m?r.sortColAsc=n:"descending"===m&&(r.sortColDsc=n)}this.m_options.isFreezeEnabled("column")&&(r.freezeCol=o,e[d].index===this.m_frozenColIndex&&(r.freezeCol=n),r.unfreezeCol=n,this._hasFrozenColumns()&&(r.unfreezeCol=o))}return r.resize=r.resizeHeight===o||r.resizeWidth===o?o:n,r},z.prototype.handleContextMenuReturn=function(e,t,i){var s,n;if(null!=this.m_active&&(s=this._getActiveElement()),t===this.m_resources.getMappedCommand("resizeHeight")||t===this.m_resources.getMappedCommand("resizeWidth"))this.isResizeEnabled()&&this.handleContextMenuResize(e,t,i,s);else if(t===this.m_resources.getMappedCommand("resizeFitToContent")){let t,i=this.findCell(e.target);i&&(t=this.getHeaderFromCell(i,this.m_selectionFrontier.axis)),t||(t=this.findHeader(e.target)),t||(t=this.findLabel(e.target)),t&&(this.m_resizingElement=t);const s=this.getHeaderCellAxis(this.m_resizingElement),n=this.getHeaderCellLevel(this.m_resizingElement);let o=!1;("row"!==s&&"rowEnd"!==s||n!==this.m_rowHeaderLevelCount-1)&&("column"!==s&&"columnEnd"!==s||n!==this.m_columnHeaderLevelCount-1)||(o=!0),o&&this.isResizeEnabled()&&this._getHeadersForResizeFitToContent(e)}else t===this.m_resources.getMappedCommand("sortColAsc")||t===this.m_resources.getMappedCommand("sortColDsc")?(n=t===this.m_resources.getMappedCommand("sortColAsc")?"ascending":"descending",this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=this.getHeaderFromCell(s,"column")),this._isDOMElementSortable(s)&&this._handleCellSort(e,n,s)):t===this.m_resources.getMappedCommand("sortRowAsc")||t===this.m_resources.getMappedCommand("sortRowDsc")?(n=t===this.m_resources.getMappedCommand("sortRowAsc")?"ascending":"descending",this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=this.getHeaderFromCell(s,"row")),this._isDOMElementSortable(s)&&this._handleCellSort(e,n,s)):t===this.m_resources.getMappedCommand("cut")?this._handleCut(e,s):t===this.m_resources.getMappedCommand("paste")?this._handlePaste(e,s):t===this.m_resources.getMappedCommand("cutCells")?this._handleCutCells(e,s):t===this.m_resources.getMappedCommand("copyCells")?this._handleCopyCells(e,s):t===this.m_resources.getMappedCommand("pasteCells")?this._handlePasteCells(e,s):t===this.m_resources.getMappedCommand("autoFill")?this._handleAutofill(e,s):t===this.m_resources.getMappedCommand("discontiguousSelection")?this.setDiscontiguousSelectionMode(i):t===this.m_resources.getMappedCommand("freezeRow")?this._handleFreezeRow(e,s):t===this.m_resources.getMappedCommand("freezeCol")?this._handleFreezeCol(e,s):t===this.m_resources.getMappedCommand("unfreezeCol")?this._handleUnFreeze("column",e):t===this.m_resources.getMappedCommand("unfreezeRow")&&this._handleUnFreeze("row",e)},z.prototype._isSortEnabled=function(e,t){var i=this.getDataSource().getCapability("sort"),s=this.m_options.isSortable(e,t);return!("enable"!==s&&"auto"!==s||"full"!==i&&i!==e)&&(!this._isDataGridProvider()||null!=t.metadata.sortDirection)},z.prototype._isParentNode=function(e){return!!this._isDataGridProvider()&&(e.metadata.expanded&&null!==e.metadata.expanded)},z.prototype._isRequired=function(e){return!!this._isDataGridProvider()&&!0===e.metadata.showRequired},z.prototype._isHierarchicalGroup=function(e){return null==e.metadata.treeDepth},z.prototype._isLeafNode=function(e){if(!e.metadata)return!1;const t=e.metadata.treeDepth;return!!this._isDataGridProvider()&&(null!=t&&0!==t)},z.prototype._isDOMElementSortable=function(e){if(null==e)return!1;var t=this.findHeader(e);return null!=t&&"true"===t.getAttribute(this.getResources().getMappedAttribute("sortable"))},z.prototype._isSelectionEnabled=function(){return"none"!==this.m_options.getSelectionCardinality()},z.prototype.isMultipleSelection=function(){return"multiple"===this.m_options.getSelectionCardinality()},z.prototype.isResizeEnabled=function(){return this.m_options.isResizable("row","width")||this.m_options.isResizable("row","height")||this.m_options.isResizable("column","width")||this.m_options.isResizable("column","height")||this.m_options.isResizable("rowEnd","width")||this.m_options.isResizable("rowEnd","height")||this.m_options.isResizable("columnEnd","width")||this.m_options.isResizable("columnEnd","height")},z.prototype._isHeaderResizeEnabled=function(e,t){return"column"===e||"columnEnd"===e?"enable"===this.m_options.isResizable(e,"width",t):("row"===e||"rowEnd"===e)&&"enable"===this.m_options.isResizable(e,"height",t)},z.prototype.handleMouseMove=function(e){this.isResizeEnabled()&&!1===this.m_databodyDragState&&this.handleResize(e)},z.prototype.handleRowHeaderMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_databodyMove&&!this._isDataGridProvider()?this._handleMove(e):this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("row")||this.m_deselectInfo&&this.m_deselectInfo.axis&&-1!==this.m_deselectInfo.axis.indexOf("row"))?this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress):this.m_isResizing||this.handleMouseMove(e)},z.prototype.handleColumnHeaderMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("column")||this.m_deselectInfo&&this.m_deselectInfo.axis&&-1!==this.m_deselectInfo.axis.indexOf("column"))?this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress):this.m_isResizing||this.handleMouseMove(e)},z.prototype.handleHeaderLabelMouseMove=function(e){this.m_isResizing||this.handleMouseMove(e)},z.prototype.handleHeaderMouseDown=function(e){var t;const i=this.findHeader(e.target);if(null!=i){this._exitActionableMode();var s=e.target;if(this._isEditOrEnter()){var n=this._getActiveElement();if(!1===this._leaveEditing(e,n,!1))return}if(this._isDisclosureIcon(s))this.handleHeaderClickActive(e,null,!0);else{var o=this.m_options.getSelectionMode();if(0===e.button){if((this.m_utils.containsCSSClassName(s,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(s,this.getMappedStyle("sortdescending")))&&this._isDOMElementSortable(s))return e.preventDefault(),void this._handleSortIconMouseDown(s);if(this.m_utils.containsCSSClassName(s,this.getMappedStyle("sortIcon"))&&this._isDOMElementSortable(s.lastChild))return e.preventDefault(),void this._handleSortIconMouseDown(s.lastChild);this.isResizeEnabled()&&(t=this.handleResizeMouseDown(e),this._highlightResizeMouseDown());var r=this.m_utils.ctrlEquivalent(e);this._isDataGridProvider()||this.m_isResizing||r||!this._isMoveOnElementEnabled(this.findHeader(s))||(this.m_databodyMove=!0,this.m_currentX=e.pageX,this.m_currentY=e.pageY,t=!0);let n=this.getHeaderCellAxis(i);if(this.m_utils.containsCSSClassName(i,this.getMappedStyle("draggableItem"))&&this.m_utils.addCSSClassName(i,this.getMappedStyle("dragging")),this._isDataGridProvider()&&this.m_options._isDragEnabled(n)&&this.shouldHoverHeader(i)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(i))return}if(!this.m_isResizing&&"default"===this.manageHeaderCursor(e,!1)){this.m_root.contains(document.activeElement)&&document.activeElement!==this.m_root||(this.m_externalFocus=!0);var l=i[this.getResources().getMappedAttribute("context")];if(!this._isSelectionEnabled()||!this.isMultipleSelection()||"row"===o&&-1===l.axis.indexOf("row")||this.m_databodyMove)if("row"===o&&-1!==l.axis.indexOf("row")&&this._isSelectionEnabled())this.handleHeaderClickSelection(e);else if("row"===o&&-1!==l.axis.indexOf("column")&&this._isSelectionEnabled()){let t=!1;e.shiftKey||(t=!0),this.handleHeaderClickActive(e,t)}else this.handleHeaderClickActive(e);else 0===e.button&&(this.m_headerDragState=!0),this.handleHeaderClickSelection(e)}this.m_options.isFloodFillEnabled()&&this.m_bottomFloodFillIconContainer&&this.m_bottomFloodFillIconContainer.parentNode&&(this.m_bottomFloodFillIconContainer.parentNode.removeChild(this.m_bottomFloodFillIconContainer),this.m_bottomFloodFillIconContainer.removeEventListener("mouseover",this.handleDatabodyMouseMove)),!0===t&&e.preventDefault()}}},z.prototype.handleHeaderLabelMouseDown=function(e){var t;this.find(e.target,"headerlabel")&&this.isResizeEnabled()&&(t=this.handleResizeMouseDown(e),this._highlightResizeMouseDown()),!0===t&&e.preventDefault()},z.prototype.handleMouseUp=function(e){this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_deselectInProgress=!1,this.m_databodyMove?this._handleMoveMouseUp(e,!1):this.isResizeEnabled()&&this.handleResizeMouseUp(e),this.m_databodyMove=!1},z.prototype.shouldHoverHeader=function(e){const t=null==e?null:this.getHeaderCellAxis(e),i=null===e?null:this.getHeaderCellLevel(e),s="row"===t||"rowEnd"===t,n=this.m_options.getSelectionMode();return this._isSelectionEnabled()&&(this.isMultipleSelection()&&"cell"===n||"row"===n&&s&&(this.isMultipleSelection()||null!==i&&i===this.m_rowHeaderLevelCount-1))},z.prototype.handleHeaderMouseOver=function(e){var t=e.target,i=this.findHeader(t);!this.m_isResizing&&"default"===this.manageHeaderCursor(e,!1)&&this.shouldHoverHeader(i)&&this.m_utils.addCSSClassName(i,this.getMappedStyle("hover"));let s=this.getHeaderCellAxis(i);this._isDataGridProvider()&&this.shouldHoverHeader(i)&&this.m_options._isDragEnabled(s)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(i)},z.prototype.handleHeaderMouseOut=function(e){var t=e.target;this.m_utils.removeCSSClassName(this.findHeader(t),this.getMappedStyle("hover")),!this.m_isResizing&&this.m_resizingElement&&(this.m_resizingElement.style.cursor="",null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor="")),this._isDOMElementSortable(t)&&this._handleSortMouseOut(e)},z.prototype.handleHeaderMouseUp=function(e){this.handleDragAnchorChange(e),this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_deselectInProgress=!1,this.m_floodFillDragState&&(this.unhighlightFloodFillRange(),this.m_selectionRange=null,this.m_floodFillRange=null,this.m_floodFillDirection=null,this.m_databody.style.cursor="default",this.m_cursor="default"),this.m_databodyMove&&this._handleMoveMouseUp(e,!0);let t=this.findHeader(e.target),i=this.getHeaderCellAxis(t);this._isDataGridProvider()&&this.m_options._isDragEnabled(i)&&this.shouldHoverHeader(t)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(t),this.m_utils.containsCSSClassName(t,this.getMappedStyle("dragging"))&&this.m_utils.removeCSSClassName(t,this.getMappedStyle("dragging"))},z.prototype.handleCornerMouseDown=function(e){let t,i=e.target,s=this.m_utils.containsCSSClassName(i,this.getMappedStyle("rowendheaderlabel"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("columnendheaderlabel")),n=this.findLabel(i);null!=n&&(t=s,this._setActive(n,this._createActiveObject(n),e,t),this.handleHeaderLabelMouseDown(e))},z.prototype.handleCornerMouseOver=function(e){var t=e.target;let i=this.findLabel(t);this._isSelectionEnabled()&&this.isMultipleSelection()&&(i?this.m_utils.addCSSClassName(i,this.getMappedStyle("hover")):this.m_utils.addCSSClassName(this.find(t,"topcorner"),this.getMappedStyle("hover"))),this.m_isResizing||null===i||this.handleMouseMove(e)},z.prototype.handleCornerMouseMove=function(e){var t=e.target;let i=this.findLabel(t);this.m_isResizing||null===i||this.handleMouseMove(e)},z.prototype.handleCornerMouseOut=function(e){var t=e.target;let i=this.findLabel(t);i?this.m_utils.removeCSSClassName(i,this.getMappedStyle("hover")):this.m_utils.removeCSSClassName(this.find(t,"topcorner"),this.getMappedStyle("hover"))},z.prototype.handleCornerClick=function(e){this._handleSelectAll(e)},z.prototype.handleHeaderClick=function(e){var t=e.target;(this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortdefault")))&&this._isDOMElementSortable(t)||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortIcon"))&&this._isDOMElementSortable(t.lastChild)?(this._removeTouchSelectionAffordance(),this._handleHeaderSort(e),e.preventDefault()):this._isDisclosureIcon(e.target)&&(this._removeTouchSelectionAffordance(),this._handleExpandCollapseRequest(e),e.preventDefault())},z.prototype.handleHeaderDoubleClick=function(e){if(document.contains(e.target)){let t=!1;if(this.m_cursor=this.manageHeaderCursor(e,t),"col-resize"===this.m_cursor||"row-resize"===this.m_cursor){this.m_resizingElement||(this.m_resizingElement=this.findHeader(e.target));const t=this.getHeaderCellAxis(this.m_resizingElement),i=this.getHeaderCellLevel(this.m_resizingElement);let s=!1;("row"!==t&&"rowEnd"!==t||i!==this.m_rowHeaderLevelCount-1||"row-resize"!==this.m_cursor)&&("column"!==t&&"columnEnd"!==t||i!==this.m_columnHeaderLevelCount-1||"col-resize"!==this.m_cursor)||(s=!0),s&&this.isResizeEnabled()&&this._getHeadersForResizeFitToContent(e)}}},z.prototype._getHeadersForResizeFitToContent=function(e){const t=this.getHeaderCellAxis(this.m_resizingElement),i=this.getHeaderCellIndex(this.m_resizingElement);let s=[];if(this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection.length){let e=this.m_selection[0];s=this._getHeadersWithinSelection(e,i,t)}s.length||s.push(this.m_resizingElement),s.forEach(i=>{this.handleResizeFitToContent(e,i,t)})},z.prototype._getHeadersWithinSelection=function(e,t,i){let s,n,o,r,l,a,h,d=[];if("column"===i?(s=this.m_startColHeader,n=this.m_columnHeaderLevelCount-1,o=this.m_columnHeaderLevelCount,r=this.m_colHeader,l="column"):"columnEnd"===i?(s=this.m_startColEndHeader,n=this.m_columnEndHeaderLevelCount-1,o=this.m_columnEndHeaderLevelCount,r=this.m_colEndHeader,l="column"):"row"===i?(s=this.m_startRowHeader,n=this.m_rowHeaderLevelCount-1,o=this.m_rowHeaderLevelCount,r=this.m_rowHeader,l="row"):(s=this.m_startRowEndHeader,n=this.m_rowEndHeaderLevelCount-1,o=this.m_rowEndHeaderLevelCount,r=this.m_rowEndHeader,l="row"),0===e.startIndex.column&&-1===e.endIndex.column&&0===e.startIndex.row&&-1===e.endIndex.row){a=0,h="row"===l?this.m_endRowHeader-this.m_startRowHeader:this.m_endColHeader-this.m_startColHeader}else 0===e.startIndex.column&&-1===e.endIndex.column||void 0===e.startIndex.column?e.startIndex.row<=t&&t<=e.endIndex.row&&("row"===i||"rowEnd"===i)&&(a=e.startIndex.row,h=e.endIndex.row):(0===e.startIndex.row&&-1===e.endIndex.row||void 0===e.startIndex.row)&&e.startIndex.column<=t&&t<=e.endIndex.column&&("column"===i||"columnEnd"===i)&&(a=e.startIndex.column,h=e.endIndex.column);for(let e=a;e<=h;e++){let t=this._getHeaderByIndex(e,n,r,o,s);t&&d.push(t)}return d},z.prototype._setHeaderDraggable=function(e){let t=!1;if(this.m_selection&&this.m_selection.length){if(this._isSelectionAcrossAxis())return!1;this.m_utils.containsCSSClassName(e,this.getMappedStyle("selected"))&&(t=!0)}return t&&(this.m_utils.addCSSClassName(e,this.getMappedStyle("draggableItem")),e.setAttribute("draggable",!0)),t},z.prototype._isSelectionAcrossAxis=function(){let e,t=!1;for(let i=0;i<this.m_selection.length;i++){let s=this.m_selection[i];if(e&&(-1===s.endIndex.row&&"column"!==e||-1===s.endIndex.column&&"row"!==e)){t=!0;break}-1===s.endIndex.row?e="column":-1===s.endIndex.column&&(e="row")}return t},z.prototype.handleDatabodyMouseDown=function(e){var t=e.target,i=this.findCell(t);if(null!=i){if(this._isEditOrEnter()){var s=this._getActiveElement();if(i===s)return;if(!1===this._leaveEditing(e,s,!1))return}else this._exitActionableMode();var n=this.m_utils.ctrlEquivalent(e);0!==e.button||n||this._isMoveOnElementEnabled(i)&&(this.m_databodyMove=!0,this.m_currentX=e.pageX,this.m_currentY=e.pageY),this.m_root.contains(document.activeElement)&&document.activeElement!==this.m_root||(this.m_externalFocus=!0),this._isGridEditable()&&(this.m_shouldFocus=!this._isFocusableElementBeforeCell(t)),this._isSelectionEnabled()?(this.isMultipleSelection()&&0===e.button&&(this.m_databodyDragState=!0),this.handleDatabodyClickSelection(e)):this.handleDatabodyClickActive(e)}else this.m_scrollbarFocus=!0},z.prototype.handleDatabodyMouseOut=function(e){if(!this.m_databodyMove){var t=e.target,i=this.findCell(t);this._setCellHover(i,"remove")}},z.prototype.handleDatabodyMouseOver=function(e){if(!this.m_databodyMove){var t=e.target,i=this.findCell(t);this._setCellHover(i,"add")}},z.prototype._setCellHover=function(e,t){if(null!=e&&this._isSelectionEnabled()){var i=this.m_options.getSelectionMode();if("cell"===i)"add"===t?this.m_utils.addCSSClassName(e,this.getMappedStyle("hover")):this.m_utils.removeCSSClassName(e,this.getMappedStyle("hover"));else if("row"===i)for(var s=this._getIndex(e,"row"),n=this._getSelectionStartAndEnd(this.createIndex(s,this.m_startCol),this.createIndex(s,this.m_endCol),0),o=n.min.row;o<=n.max.row;o++)this._highlightCellsAlongAxis(o,"row","index",t,["hover"])}},z.prototype.handleDatabodyDoubleClick=function(e){if(this._isGridEditable()){var t=e.target,i=this.findCell(t);if("edit"===this._getCurrentMode()){var s=this._getActiveElement();if(i===s)return;if(!this._handleExitEdit(e,s))return}this._handleEditable(e,i),this._handleEdit(e,i)}},z.prototype.handleDatabodyMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_databodyMove?this._handleMove(e):this.m_databodyDragState?this.m_floodFillDragState?this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionRange||(this.m_selectionRange=this.GetSelection()),this.handleDatabodyFloodFillDrag(e)):this.handleDatabodySelectionDrag(e):this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&(-1!==this.m_selectionFrontier.axis.indexOf("row")||-1!==this.m_selectionFrontier.axis.indexOf("column"))||this.m_deselectInfo&&this.m_deselectInfo.axis&&(-1!==this.m_deselectInfo.axis.indexOf("row")||-1!==this.m_deselectInfo.axis.indexOf("column")))&&this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress)},z.prototype.handleDatabodyMouseUp=function(e){this.m_databodyDragState=!1,this.m_headerDragState=!1,this.m_deselectInProgress=!1,this.m_databodyMove&&this._handleMoveMouseUp(e,!0),this.m_options.isFloodFillEnabled()&&this.m_floodFillDragState&&(this._handleFloodFillMouseUp(e),this.m_floodFillDragState=!1)},z.prototype.handleDatabodyKeyUp=function(e){this.m_deselectInProgress&&(this.m_deselectInProgress=e.shiftKey)},z.prototype.handleDatabodyKeyDown=function(e){var t,i=this.m_utils.ctrlEquivalent(e);if(e.defaultPrevented&&i&&(this.keyCodes.LEFT_KEY||this.keyCodes.RIGHT_KEY)||this.m_animating)return;let s=this._getActiveElement();null!=(t=null!=this.m_active&&"header"===this.m_active.type?this._getActionFromKeyDown(e,this.m_active.axis,!1):null!=this.m_active&&"label"===this.m_active.type?this._getActionFromKeyDown(e,this.m_active.axis,!0):null!=this.m_active&&"empty"===this.m_active.type?this._getActionFromNoDataKeydown(e):this._getActionFromKeyDown(e,"cell",!1))&&t.call(this,e,s)&&e.preventDefault()},z.prototype.findPos=function(e){if(e){var t=this.findPos(e.offsetParent),i=this.getElementTranslationXYZ(e.offsetParent);return[parseInt(t[0],10)+parseInt(e.offsetLeft,10)+i[0],parseInt(t[1],10)+parseInt(e.offsetTop,10)+i[1]]}return[0,0]},z.prototype._findHeaderOffset=function(e,t,i){if(i||(i=[0,0]),e!==t){for(;!e.offsetParent;)e=e.parentElement;return e.offsetLeft&&(i[0]+=parseInt(e.offsetLeft,10)),e.offsetTop&&(i[1]+=parseInt(e.offsetTop,10)),this._findHeaderOffset(e.offsetParent,t,i)}return i},z.prototype.getElementTranslationXYZ=function(e){if(e){var t=document.defaultView.getComputedStyle(e,null),i=t.getPropertyValue("-webkit-transform")||t.getPropertyValue("-moz-transform")||t.getPropertyValue("-ms-transform")||t.getPropertyValue("-o-transform")||t.getPropertyValue("transform"),s=i.substr(7,i.length-8).split(", ");return[isNaN(parseInt(s[4],10))?0:parseInt(s[4],10),isNaN(parseInt(s[5],10))?0:parseInt(s[5],10),isNaN(parseInt(s[6],10))?0:parseInt(s[6],10)]}return[0,0,0]},z.prototype.handleDatabodyMouseWheel=function(e){var t,i=this.find(e.target,"header");if(null==i&&(i=this.find(e.target,"endheader")),i&&(t=i===this.m_rowHeader||i===this.m_rowEndHeader?"row":"column"),("row"!==t||this.m_stopRowHeaderFetch&&this.m_stopRowEndHeaderFetch&&this.m_stopRowFetch)&&("column"!==t||this.m_stopColumnHeaderFetch&&this.m_stopColumnEndHeaderFetch&&this.m_stopColumnFetch)||e.preventDefault(),!this.m_animating){var s=this.m_utils.getMousewheelScrollDelta(e),n=s.deltaX,o=s.deltaY;if(null===i&&e.target.classList.contains(this.getMappedStyle("frozenCell"))){let t=this._getCellContainer(e.target);t.classList.contains(this.getMappedStyle("databodyFrozenRow"))?o=0:t.classList.contains(this.getMappedStyle("databodyFrozenCol"))?n=0:t.classList.contains(this.getMappedStyle("databodyFrozenCorner"))&&(n=0,o=0)}"row"===t?n=0:"column"===t&&(o=0);var r=Math.max(0,Math.min(this._getMaxScrollHeight(),this.m_currentScrollTop-o));this._getMaxScrollHeight()!==r&&0!==r&&(this.find(e.target,"header")||this.find(e.target,"databodyFrozenCol"))&&e.preventDefault(),this.scrollDelta(n,o)}},z.prototype.handleTouchStart=function(e){var t=e.touches.length,i=e.touches[0].target;if(1===t){if(this.m_startX=e.touches[0].pageX,this.m_startY=e.touches[0].pageY,this.m_currentX=this.m_startX,this.m_currentY=this.m_startY,this.m_prevX=this.m_startX,this.m_prevY=this.m_startY,this.m_startTime=(new Date).getTime(),this.m_touchActive=!0,this.isMultipleSelection()){i.classList.contains(this.getMappedStyle("selectaffordance"))&&(i=i.parentNode);var s=null;if(i===this.m_topSelectIconContainer?s="top":i===this.m_bottomSelectIconContainer&&(s="bottom"),s){this.m_touchMultipleSelect=!0;var n=this.GetSelection();this.m_touchSelectAnchor="top"===s?n[n.length-1].endIndex:n[n.length-1].startIndex}}!this.m_touchMultipleSelect&&this._isMoveOnElementEnabled(this.findCell(i))&&(this.m_databodyMove=!0)}else this.handleTouchCancel(e)},z.prototype.handleTouchMove=function(e){var t=e.target;if(this.m_touchActive){e.cancelable&&e.preventDefault(),this.m_currentX=e.touches[0].pageX,this.m_currentY=e.touches[0].pageY;var i=this.m_currentX-this.m_prevX,s=this.m_currentY-this.m_prevY,n=this.adjustTouchScroll(i,s);if(i=n[0],s=n[1],this.getResources().isRTLMode()&&(i*=-1),this.m_touchMultipleSelect)this.handleDatabodySelectionDrag(e),this.m_utils.isTouchDeviceNotIOS()||e.preventDefault();else if(this.m_databodyMove)this._removeTouchSelectionAffordance(),this._handleMove(e),this.m_utils.isTouchDeviceNotIOS()||e.preventDefault();else if(this._isEditOrEnter()&&this.m_utils.isTouchDeviceNotIOS()){var o=this._getActiveElement();this.findCell(t)!==o&&this._handleNonSwipeScroll(i,s)}else this._handleNonSwipeScroll(i,s);this.m_prevX=this.m_currentX,this.m_prevY=this.m_currentY}else this.handleTouchCancel(e)},z.prototype.handleTouchEnd=function(e){var t,i=e.target;if(this._isEditOrEnter()){if(t=this._getActiveElement(),this.findCell(i)===t)return void this.handleTouchCancel(e);this._leaveEditing(e,t,!1)}else this._exitActionableMode();if(null!=this.m_lastTapTime&&this.m_startTime-this.m_lastTapTime<250&&this.m_lastTapTarget===i?(this.m_lastTapTime=null,this.m_lastTapTarget=null,null!=(t=this.findCell(i))&&(this._handleEditable(e,t),this._handleEdit(e,t),e.cancelable&&e.preventDefault())):(this.m_lastTapTarget=e.target,this.m_lastTapTime=(new Date).getTime()),this.m_touchActive&&!e.defaultPrevented)if(this.m_touchMultipleSelect)e.cancelable&&e.preventDefault(),this.m_touchMultipleSelect=!1;else{var s=this.m_lastTapTime-this.m_startTime;if(this.m_currentX===this.m_startX&&this.m_currentY===this.m_startY)return this.m_databodyMove=!1,this._isSelectionEnabled()&&s<z.CONTEXT_MENU_TAP_HOLD_DURATION?void this.handleDatabodyClickSelection(e):void this.handleDatabodyClickActive(e);if(this.m_databodyMove)return e.cancelable&&e.preventDefault(),this.m_databodyMove=!1,void this._handleMoveMouseUp(e,!0);this.m_utils.isTouchDeviceNotIOS()&&this._handleSwipe(e)}this.handleTouchCancel(e)},z.prototype._calculateMomentum=function(e,t,i,s,n,o){var r,l=e-t,a=Math.abs(l)/i,h=a*a/(2*z.DECELERATION_FACTOR)*(l<0?-1:1),d=a/z.DECELERATION_FACTOR;return o&&(h*=-1),s-h>n?(r=Math.max(-1*z.MAX_OVERSCROLL_PIXEL,h),h=s-n,d=(l=n-s)/a):s-h<0&&(r=Math.min(z.MAX_OVERSCROLL_PIXEL,h),h=s,d=(l=s)/a),{destination:Math.round(h),duration:Math.min(Math.max(z.MIN_SWIPE_TRANSITION_DURATION,d),z.MAX_SWIPE_TRANSITION_DURATION),overScroll:r}},z.prototype.handleTouchCancel=function(e){this.m_databodyMove&&(this._handleMoveMouseUp(e,!1),this.m_databodyMove=!1),this.m_touchSelectAnchor=null,this.m_touchMultipleSelect=!1,this.m_touchActive=!1,this.m_startX=0,this.m_startY=0,this.m_prevX=0,this.m_prevY=0,this.m_currentX=0,this.m_currentY=0,this.m_startTime=0},z.prototype.handleHeaderTouchStart=function(e){this.m_touchStart=(new Date).getTime();var t=e.touches.length,i=e.target;if(1===t){this.m_startX=e.touches[0].pageX,this.m_startY=e.touches[0].pageY,this.m_currentX=this.m_startX,this.m_currentY=this.m_startY,this.m_prevX=this.m_startX,this.m_prevY=this.m_startY,this.m_touchActive=!0;var s=this.findHeader(i);this.isResizeEnabled()&&(this.handleResize(e),this.handleResizeMouseDown(e),this._highlightResizeMouseDown()),!this.m_isResizing&&this._isMoveOnElementEnabled(s)&&(this.m_databodyMove=!0);let t=this.getHeaderCellAxis(s);this._isDataGridProvider()&&this.m_options._isDragEnabled(t)&&(this.m_utils.addCSSClassName(s,this.getMappedStyle("draggableItem")),s.setAttribute("draggable",!0))}else this.handleHeaderTouchCancel(e)},z.prototype.handleHeaderTouchMove=function(e){if(this.m_touchActive){e.cancelable&&e.preventDefault(),this.m_currentX=e.touches[0].pageX,this.m_currentY=e.touches[0].pageY;var t=this.m_currentX-this.m_prevX,i=this.m_currentY-this.m_prevY;if(this.m_isResizing&&this.isResizeEnabled())this.handleResize(e);else if(this.m_databodyMove)this._removeTouchSelectionAffordance(),this._handleMove(e);else if(this.m_databodyReorder)this._removeTouchSelectionAffordance();else{var s=e.target,n=this.findHeader(s),o=this.getHeaderCellAxis(n);"column"===o||"columnEnd"===o?this._handleNonSwipeScroll(t,0):this._handleNonSwipeScroll(0,i)}this.m_prevX=this.m_currentX,this.m_prevY=this.m_currentY}else this.handleTouchCancel(e)},z.prototype.handleHeaderTouchEnd=function(e){var t;if(this.m_touchActive&&!e.defaultPrevented){var i=e.target;if(this.m_isResizing&&this.isResizeEnabled())this.handleResizeMouseUp(e),this.m_currentX!==this.m_startX&&this.m_currentY!==this.m_startY&&e.cancelable&&e.preventDefault();else if(this.m_currentX===this.m_startX&&this.m_currentY===this.m_startY){var s=this.m_options.getSelectionMode(),n=(t=this.findHeader(i))[this.getResources().getMappedAttribute("context")],o=this.m_root.getAttribute("id"),r=document.querySelector("#"+o+"contextmenu");r&&"none"===r.style.display&&((this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))&&this._isDOMElementSortable(i)?(e.cancelable&&e.preventDefault(),this._removeTouchSelectionAffordance(),this._handleSortIconMouseDown(i),this._handleHeaderSort(e)):this._isDisclosureIcon(i)?(this._removeTouchSelectionAffordance(),this._handleExpandCollapseRequest(e),e.preventDefault()):!this._isSelectionEnabled()||!this.isMultipleSelection()||"row"===s&&-1===n.axis.indexOf("row")||this.m_databodyMove?"row"===s&&-1!==n.axis.indexOf("row")&&this._isSelectionEnabled()?this.handleHeaderClickSelection(e):this.handleHeaderClickActive(e):(0===e.button&&(this.m_headerDragState=!0),this.handleHeaderClickSelection(e)))}else if(this.m_databodyMove)e.cancelable&&e.preventDefault(),this.m_databodyMove=!1,this._handleMoveMouseUp(e,!0);else if(this.m_databodyReorder){e.cancelable&&e.preventDefault(),this.m_databodyReorder=!1,t=this.findHeader(i),"row"===this.getHeaderCellAxis(t)?this.handleRowDragEnd(e):this.handleColumnDragEnd(e)}else t=this.findHeader(i),this._handleSwipe(e,this.getHeaderCellAxis(t))}this.handleHeaderTouchCancel(e)},z.prototype.handleHeaderTouchCancel=function(e){this.m_databodyMove&&(this._handleMoveMouseUp(e,!1),this.m_databodyMove=!1),this.m_touchActive=!1,this.m_startX=0,this.m_startY=0,this.m_prevX=0,this.m_prevY=0,this.m_currentX=0,this.m_currentY=0},z.prototype._handleNonSwipeScroll=function(e,t){var i=(new Date).getTime();this._disableTouchScrollAnimation();var s=this.adjustTouchScroll(e,t);e=s[0],t=s[1],this.scrollDelta(e,t),i-this.m_startTime>z.TAP_AND_SCROLL_RESET&&(this.m_startX=this.m_currentX,this.m_startY=this.m_currentY,this.m_startTime=(new Date).getTime())},z.prototype._handleSwipe=function(e,t){var i=(new Date).getTime()-this.m_startTime,s=this.getResources().isRTLMode(),n=this.m_currentX-this.m_startX,o=this.m_currentY-this.m_startY;if(s&&(n*=-1),Math.abs(n)<z.MIN_SWIPE_DISTANCE&&Math.abs(o)<z.MIN_SWIPE_DISTANCE&&i<z.MIN_SWIPE_DURATION)e.cancelable&&e.preventDefault(),this._isSelectionEnabled()&&this._scrollTouchSelectionAffordance();else if(i<z.MAX_SWIPE_DURATION){var r,l;if(e.cancelable&&e.preventDefault(),"row"!==t&&"rowEnd"!==t?(r=this._calculateMomentum(this.m_currentX,this.m_startX,i,this.m_currentScrollLeft,this.m_scrollWidth,s),isNaN(r.overScroll)||(r.overScroll>0||this.m_stopColumnFetch)&&(this.m_extraScrollOverX=-1*r.overScroll)):(r={duration:0,destination:0},n=0),"column"!==t&&"columnEnd"!==t?(l=this._calculateMomentum(this.m_currentY,this.m_startY,i,this.m_currentScrollTop,this.m_scrollHeight),isNaN(l.overScroll)||(l.overScroll>0||this.m_stopRowFetch)&&(this.m_extraScrollOverY=-1*l.overScroll)):(l={duration:0,destination:0},o=0),this.m_utils.isTouchDeviceNotIOS()){var a=Math.max(r.duration,l.duration);this.m_databody.firstChild.style.transitionDuration=a+"ms",this.m_rowHeader.firstChild.style.transitionDuration=a+"ms",this.m_colHeader.firstChild.style.transitionDuration=a+"ms",this.m_rowEndHeader.firstChild.style.transitionDuration=a+"ms",this.m_colEndHeader.firstChild.style.transitionDuration=a+"ms"}n+=r.destination,o+=l.destination;var h=this.adjustTouchScroll(n,o);n=h[0],o=h[1],this.scrollDelta(n,o)}},z.prototype.fireEvent=function(e,t){if(null!=e&&null!=t){var i=this.callbacks[e];return null==i||i(t)}},z.prototype.addListener=function(e,t){this.callbacks[e]=t},z.prototype.setElementHeight=function(e,t){e.style.height=t+"px"},z.prototype.getElementHeight=function(e){return this.getElementDir(e,"height")},z.prototype.setElementWidth=function(e,t){e.style.width=t+"px"},z.prototype.getElementWidth=function(e){return this.getElementDir(e,"width")},z.prototype.setElementDir=function(e,t,i){e.style[i]=t+"px"},z.prototype.getElementDir=function(e,t){var i;return e.style[t].indexOf("px")>-1&&-1===e.style[t].indexOf("e")?parseFloat(e.style[t]):(document.body.contains(e)?i=Math.round(e["offset"+t.charAt(0).toUpperCase()+t.slice(1)]):(e.style.visibility="hidden",this.m_root.appendChild(e),i=Math.round(e["offset"+t.charAt(0).toUpperCase()+t.slice(1)]),this.m_root.removeChild(e),e.style.visibility=""),i)},z.prototype._computeElementWidthAndHeight=function(e){var t={};return e.style.width.indexOf("px")>-1&&-1===e.style.width.indexOf("e")&&(t.width=parseFloat(e.style.width)),e.style.height.indexOf("px")>-1&&-1===e.style.height.indexOf("e")&&(t.height=parseFloat(e.style.height)),null!=t.width&&null!=t.height||(document.body.contains(e)?(t.width=Math.round(e.offsetWidth),t.height=Math.round(e.offsetHeight)):(e.style.visibility="hidden",this.m_root.appendChild(e),t.width=Math.round(e.offsetWidth),t.height=Math.round(e.offsetHeight),this.m_root.removeChild(e),e.style.visibility="")),t},z.BEFORE=1,z.AFTER=2,z.INSIDE=3,z.prototype._isInViewport=function(e){var t=e.row,i=e.column;return-1===t&&-1===i?-1:-1===t?this._isColumnIndexInViewport(i):-1===i?this._isRowIndexInViewport(t):i>=this.m_startCol&&i<=this.m_endCol&&t>=this.m_startRow&&t<=this.m_endRow?z.INSIDE:-1},z.prototype._isAxisIndexInViewport=function(e,t){return-1===e?-1:"column"===t?this._isColumnIndexInViewport(e):"row"===t?this._isRowIndexInViewport(e):-1},z.prototype._isColumnIndexInViewport=function(e){return e<this.m_startCol?z.BEFORE:e>this.m_endCol?z.AFTER:z.INSIDE},z.prototype._isRowIndexInViewport=function(e){return e<this.m_startRow?z.BEFORE:e>this.m_endRow?z.AFTER:z.INSIDE},z.prototype._isCellBoundaryInViewport=function(e,t,i,s){var n=this._getViewportTop(),o=this._getViewportBottom(),r=this._getViewportLeft(),l=this._getViewportRight();return(s<=o&&s>n||i>=n&&i<o)&&(t<=l&&t>r||e>=r&&e<l)},z.prototype.queueModelEvent=function(e){return!(this.m_initialized&&!this.m_processingEventQueue&&!this.m_animating&&!this.m_processingModelEvent)&&(null==this.m_modelEvents&&(this.m_modelEvents=[]),this.m_modelEvents.push(e),!0)},z.prototype.handleModelEvent=function(e,t){if(void 0!==t||!this.queueModelEvent(e)){var i=e.operation,s=e.keys,n=e.indexes,o=e.result,r=e.header,l=e.endheader,a=e.silent,h=!1;if(this.m_processingModelEvent=!0,e.detail)"delete"===i&&this._handleDeleteRangeEvent(e.detail),"insert"===i&&this._handleInsertRangeEvent(e.detail),"update"===i&&this._handleUpdateRangeEvent(e.detail),"refresh"===i&&this._handleModelRefreshEvent(e.detail);else if("insert"===i)this._adjustActive(i,n),this.m_shouldFocus=!0,this._adjustSelectionOnModelChange(i,s,n),null!=o?(this._handleModelInsertRangeEvent(o,r,l),h=!0):this._handleModelInsertEvent(n,s);else if("update"===i)this._handleModelUpdateEvent(n,s,o),h=!0;else if("delete"===i){let t;if(this._isEditOrEnter()&&(t=this._getCellByIndex(this.m_active.indexes)),t){let i=this.getCellIndexes(t),s=!1;n.forEach(e=>{e.row!==i.row&&e.column!==i.column||(s=!0)}),s&&(this._handleExitEditable(e,t),this._handleExitEdit(e,t))}this._adjustSelectionOnModelChange(i,s,n),this.m_utils.supportsTransitions()?(Array.isArray(s)||(s=new Array(s)),this._handleModelDeleteEventWithAnimation(e,s),s.length>0&&(h=!0)):(this._handleModelDeleteEvent(n,s,a),this._adjustActive(i,n))}else"refresh"===i||"reset"===i?this._handleModelRefreshEvent():"sync"===i&&this._handleModelSyncEvent(e);this.m_processingModelEvent=!1,!h&&t&&this._runModelEventQueue()}},z.prototype._adjustActive=function(e,t){var i,s;if(null!=this.m_active){if("cell"===this.m_active.type)s=!1,i=this.m_active.indexes.row;else{if("header"!==this.m_active.type||"row"!==this.m_active.axis)return;s=!0,i=this.m_active.index}if(Array.isArray(t)||(t=new Array(t)),!0===this.m_moveActive){if("insert"===e)return void(s?this.m_active.index=t[0].row:this.m_active.indexes.row=t[0].row);if("delete"===e&&t[0].row===i)return}for(var n="insert"===e?1:-1,o=0;o<t.length;o++){var r=this._isDataGridProvider()?t[o]:t[o].row;r<i&&this.m_active?s?this.m_active.index+=n:this.m_active.indexes.row+=n:r===i&&"delete"===e&&this._setActive(null,null)}}},z.prototype._adjustSelectionOnModelChange=function(e,t,i){Array.isArray(t)||(t=new Array(t)),Array.isArray(i)||(i=new Array(i));var s=this.GetSelection();if(null!=t&&null!=i&&t.length===i.length&&0!==s.length)for(var n="insert"===e?1:-1,o=0;o<t.length;o++)for(var r,l=t[o].row,a=i[o].row,h=s.length-1;h>=0;h--){var d=s[h],m=d.startKey.row,c=d.endKey.row,u=d.startIndex.row,_=d.endIndex.row;if(m===l){if(c===l&&"delete"===e){s.splice(h,1);continue}r=this._getKey(this._getAxisCellsByIndex(d.startIndex.row+1,"row")[0],"row"),d.startKey.row=r,d.endIndex.row+=n}else c===l?(r=this._getKey(this._getAxisCellsByIndex(d.startIndex.row-1,"row")[0],"row"),d.endKey.row=r,d.endIndex.row+=n):a<=u?(d.startIndex.row+=n,d.endIndex.row+=n):a<_&&(d.endIndex.row+=n)}else if(this.m_moveActive&&"insert"===e){var p;if(this._isSelectionEnabled()&&this._isDatabodyCellActive())p="cell"===this.m_options.getSelectionMode()?this.createRange(this.m_active.indexes,this.m_active.indexes,t[0],t[0]):this.createRange(i[0],i[0],t[0],t[0]),this.m_selectionFrontier=this.m_active.indexes,s.push(p);this.m_moveActive=!1}},z.prototype._simpleAdjustSelectionOnChange=function(e,t,i){let s=this.GetSelection(),n="insert"===e?1:-1;for(let o=0;o<t.length;o++){let r=t[o];for(let t=s.length-1;t>=0;t--){let o=s[t],l=o.startIndex[i],a=o.endIndex[i];if(l===r){if(a===r&&"delete"===e){s.splice(t,1);continue}if("delete"===e){let e=this._getKey(this._getAxisCellsByIndex(o.startIndex[i]+1,i)[0],i);o.startKey[i]=e}else o.startIndex[i]+=n;o.endIndex[i]+=n}else if(a===r){if("delete"===e){let e=this._getKey(this._getAxisCellsByIndex(o.endIndex[i]-1,i)[0],i);void 0===o.endKey&&(o.endKey={row:null,column:null}),o.endKey[i]=e}o.endIndex[i]+=n}else r<l?(o.startIndex[i]+=n,o.endIndex[i]+=n):r<a&&(o.endIndex[i]+=n)}}},z.prototype._handleInsertRangeEvent=function(e){let t=e.axis,i=e.ranges;if(0===i.length)return void this.fillViewport();i.sort(function(e,t){return e.offset-t.offset});let s=i.shift(),n=s.offset,o=s.count,r=this._isAxisIndexInViewport(n,t);if(r===z.INSIDE){let i=n,r=o,l=this.m_startCol,a=this.m_endCol-this.m_startCol+1;"column"===t&&(i=this.m_startRow,r=this.m_endRow-this.m_startRow+1,l=n,a=o);let h,d=document.createDocumentFragment(),m=document.createDocumentFragment(),c=new Promise(function(e){h=e}),u={axis:t,range:s,headerFragment:d,endHeaderFragment:m,totalDimension:0,promiseResolve:h};this.fetchHeaders(t,n,d,m,o,{success:this._handleInsertRangeHeaderFetchSuccess.bind(this,u),error:this.handleCellsFetchError}),this.fetchCells(this.m_databody,i,l,r,a,{success:this._handleInsertRangeCellFetchSuccess.bind(this,u),error:this.handleCellsFetchError}),c.then(this._handleInsertRangeEvent.bind(this,e))}else if(r===z.BEFORE){let i=this.m_avgRowHeight,s=i*o,r=this.m_rowHeader,l=this.m_rowEndHeader;"row"===t?(this.m_endRow>=0&&(this.m_startRow+=o,this.m_endRow+=o,this.m_startRowPixel+=s,this.m_endRowPixel+=s),this.m_endRowHeader>=0&&(this.m_startRowHeader+=o,this.m_endRowHeader+=o,this.m_startRowHeaderPixel+=s,this.m_endRowHeaderPixel+=s),this.m_endRowEndHeader>=0&&(this.m_startRowEndHeader+=o,this.m_endRowEndHeader+=o,this.m_startRowEndHeaderPixel+=s,this.m_endRowEndHeaderPixel+=s)):(i=this.m_avgColWidth,s=i*o,r=this.m_colHeader,l=this.m_colEndHeader,this.m_endCol>=0&&(this.m_startCol+=o,this.m_endCol+=o,this.m_startColPixel+=s,this.m_endColPixel+=s),this.m_endColHeader>=0&&(this.m_startColHeader+=o,this.m_endColHeader+=o,this.m_startColHeaderPixel+=s,this.m_endColHeaderPixel+=s),this.m_endColEndHeader>=0&&(this.m_startColEndHeader+=o,this.m_endColEndHeader+=o,this.m_startColEndHeaderPixel+=s,this.m_endColEndHeaderPixel+=s));let a=new Array(o).fill(n).map((e,t)=>e+t),h=new Array(o).fill(i);this._modifyAndPushCells(a,h,t,this.m_databody,r,l,!0),this._refreshDatabodyMap(),this._handleInsertRangeEvent(e)}else r===z.AFTER&&("row"===t?(this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1):(this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1),this._handleInsertRangeEvent(e))},z.prototype._handleUpdateRangeEvent=function(e){let t=e.ranges;if(0===t.length)return this._highlightActive(),this._resetEditableClone(),this.applySelection(),this._resetHeaderHighLight(),void this.fillViewport();t.sort(function(e,t){return e.offset-t.offset});let i=t.shift(),s=i.rowOffset,n=i.columnOffset,o=-1===i.rowCount?this._getMaxBottom()+1:i.rowCount,r=-1===i.columnCount?this._getMaxRight()+1:i.columnCount,l=s+o-1,a=n+r-1,h=this._isAxisIndexInViewport(s,"row"),d=this._isAxisIndexInViewport(l,"row"),m=this._isAxisIndexInViewport(n,"column"),c=this._isAxisIndexInViewport(a,"column");if(h!==z.AFTER&&d!==z.BEFORE&&m!==z.AFTER&&c!==z.BEFORE){let t;h===z.BEFORE&&(s=this._getMaxTop()),d===z.AFTER&&(l=this._getMaxBottom()),m===z.BEFORE&&(n=this._getMaxLeft()),c===z.AFTER&&(a=this._getMaxRight()),o=l-s+1,r=a-n+1;let u,_,p=!1;-1!==i.rowCount&&-1!==i.columnCount||(p=!0,t=-1===i.rowCount?"column":"row"),"row"===t?(u=s,_=o):"column"===t&&(u=n,_=r);let g,C=document.createDocumentFragment(),f=document.createDocumentFragment(),y=new Promise(function(e){g=e}),E={axis:t,range:i,headerFragment:C,endHeaderFragment:f,totalDimension:0,promiseResolve:g};this.m_fetchingForUpdate=!0,p?(E.editHeader=!0,this.fetchHeaders(t,u,C,void 0,_,{success:this._handleInsertRangeHeaderFetchSuccess.bind(this,E),error:this.handleHeadersFetchError}),this.fetchCells(this.m_databody,s,n,o,r,{success:this._handleUpdateEditableHeader.bind(this,E),error:this.handleCellsFetchError})):this.fetchCells(this.m_databody,s,n,o,r,{success:this._handleUpdateRangeFetchSuccess.bind(this,E),error:this.handleCellsFetchError}),y.then(this._handleUpdateRangeEvent.bind(this,e))}else this._handleUpdateRangeEvent(e)},z.prototype._handleUpdateEditableHeader=function(e,t,i){this.m_fetchingForUpdate=!1;let s,n,o=e,r=o.range,l=o.axis,a=o.editHeader;"column"===l?(s=r.columnOffset,n=r.columnCount):"row"===l&&(s=r.rowOffset,n=r.rowCount);let h={axis:l,ranges:[{offset:s,count:n}],editHeader:a};this._handleDeleteRangeEvent(h),delete o.range,o.range={offset:s,count:n},this._handleInsertRangeCellFetchSuccess(o,t,i),this._signalTaskEnd()},z.prototype._handleInsertRangeHeaderFetchSuccess=function(e,t,i,s){const n=i.axis;this._signalTaskEnd(),this.m_fetching[n]=!1;const o=this.getResources().isRTLMode()?"right":"left",r=i.start,l=e.headerFragment,a=e.endHeaderFragment,h="row"===n?"top":o;let d,m,c,u,_,p,g,C,f,y,E=0,v=0;if(null!=t){for(p=this.getMappedStyle("headercell"),"row"===n?(C=this.m_rowHeaderLevelCount,p+=" "+this.getMappedStyle("rowheadercell")):(C=this.m_columnHeaderLevelCount,p+=" "+this.getMappedStyle("colheadercell")),d=this._getHeaderCellByIndex(r,n,C-1),m=this.getElementDir(d,h),"column"===n&&this._hasFrozenColumns()&&r===this.m_frozenColIndex+1?this.m_colHeaderFrozen?m=this.getElementWidth(this.m_colHeaderFrozen):this.m_colEndHeaderFrozen&&(m=this.getElementWidth(this.m_colEndHeaderFrozen)):"row"===n&&this._hasFrozenRows()&&r===this.m_frozenRowIndex+1&&(this.m_rowHeaderFrozen?m=this.getElementHeight(this.m_rowHeaderFrozen):this.m_rowEndHeaderFrozen&&(m=this.getElementHeight(this.m_rowEndHeaderFrozen))),c=t.getCount(),g=this.getRendererOrTemplate(n);c-E>0;)"row"===n?(f=0,y=m+v):(f=m+v,y=0),u=r+E,("column"===n&&this._hasFrozenColumns()&&u<=this.m_frozenColIndex+1||"row"===n&&this._hasFrozenRows()&&u<=this.m_frozenRowIndex+1)&&(p=`${p} ${this.getMappedStyle("frozenHeader")}`),_=this.buildLevelHeaders(l,u,0,f,y,!0,!1,g,t,n,p,C),E+=_.count,v+=_.totalHeaderDimension;v>e.totalDimension&&(e.totalDimension=v)}if(v=0,E=0,null!=s){p=this.getMappedStyle("endheadercell"),"row"===n?(C=this.m_rowEndHeaderLevelCount,p+=" "+this.getMappedStyle("rowendheadercell")):(C=this.m_columnEndHeaderLevelCount,p+=" "+this.getMappedStyle("colendheadercell"));const t=`${n}End`;for(d=this._getHeaderCellByIndex(r,t,C-1),m=this.getElementDir(d,h),c=s.getCount(),g=this.getRendererOrTemplate(t);c-E>0;)"row"===n?(f=0,y=m+v):(f=m+v,y=0),u=r+E,_=this.buildLevelHeaders(a,u,0,f,y,!0,!1,g,s,t,p,C),E+=_.count,v+=_.totalHeaderDimension;v>e.totalDimension&&(e.totalDimension=v)}},z.prototype._handleInsertRangeCellFetchSuccess=function(e,t,i){const s=e.range,n=e.axis,o=e.editHeader,r=e.headerFragment,l=e.endHeaderFragment;let a=e.totalDimension;const h=this.getResources().isRTLMode()?"right":"left",d=document.createDocumentFragment(),m=document.createDocumentFragment(),c=document.createDocumentFragment(),u=document.createDocumentFragment();let _=this.m_rowHeader,p=this.m_rowEndHeader,g=this.m_databodyFrozenRow,C=this.m_rowHeaderFrozen,f=this.m_rowEndHeaderFrozen;if("column"===n&&(_=this.m_colHeader,p=this.m_colEndHeader,g=this.m_databodyFrozenCol,C=this.m_colHeaderFrozen,f=this.m_colEndHeaderFrozen),this._signalTaskEnd(),this.m_fetching.cells=!1,o||this.unhighlightSelection(),t){let e=i[0].start;let s=i[1].start,o=t.getCount("row"),r=t.getCount("column");const l=this._getCellByIndex(this.createIndex(e,s));let _,p;if(l?(_="row"===n?this.getElementDir(l,"top"):this.m_startRowPixel,p="row"===n?this.m_startColPixel:this.getElementDir(l,h),"column"===n&&this._hasFrozenColumns()&&s===this.m_frozenColIndex+1&&(p=this.getElementWidth(this.m_databodyFrozenCol)),"row"===n&&this._hasFrozenRows()&&e===this.m_frozenRowIndex+1&&(_=this.getElementHeight(this.m_databodyFrozenRow))):(_="row"===n?this._getMaxBottomPixel():this.m_startRowPixel,p="row"===n?this.m_startColPixel:this._getMaxRightPixel()),"column"===n)if(this._hasFrozenColumns()&&s<=this.m_frozenColIndex+1){this.m_databodyFrozenCorner&&(this._addCellsToFragment(u,t,e,_,s,p,this.m_frozenRowIndex+1,null),e=this.m_frozenRowIndex+1,o-=this.m_frozenRowIndex+1);const i=this._addCellsToFragment(m,t,e,_,s,p,o,r);a=Math.max(a,i.totalColumnWidth)}else{this._hasFrozenRows()&&(this._addCellsToFragment(c,t,e,_,s,p,this.m_frozenRowIndex+1,null),e=this.m_frozenRowIndex+1,o-=this.m_frozenRowIndex+1);const i=this._addCellsToFragment(d,t,e,_,s,p,o,null);a=Math.max(a,"row"===n?i.totalRowHeight:i.totalColumnWidth)}else if("row"===n)if(this._hasFrozenRows()&&e<=this.m_frozenRowIndex+1){this.m_databodyFrozenCorner&&(this._addCellsToFragment(u,t,e,_,s,p,null,this.m_frozenColIndex+1),s=this.m_frozenColIndex+1,r-=this.m_frozenColIndex+1);const i=this._addCellsToFragment(c,t,e,_,s,p,o,r);a=Math.max(a,i.totalRowHeight)}else{this._hasFrozenColumns()&&(this._addCellsToFragment(m,t,e,_,s,p,null,this.m_frozenColIndex+1),s=this.m_frozenColIndex+1,r-=this.m_frozenColIndex+1);const i=this._addCellsToFragment(d,t,e,_,s,p,null,r);a=Math.max(a,i.totalRowHeight)}}let y=this.getMappedStyle("frozenCell");if(u.childNodes&&u.childNodes.length)for(let e=0;e<=u.childNodes.length;e++){let t=u.childNodes[e];this.m_utils.addCSSClassName(t,y)}if(m.childNodes&&m.childNodes.length)for(let e=0;e<=m.childNodes.length;e++){let t=m.childNodes[e];this.m_utils.addCSSClassName(t,y)}if(c.childNodes&&c.childNodes.length)for(let e=0;e<=c.childNodes.length;e++){let t=c.childNodes[e];this.m_utils.addCSSClassName(t,y)}const E=s.offset,v=s.count;let w=new Array(v).fill(E).map((e,t)=>e+t),H=0,S=0;(this._hasFrozenColumns()||this._hasFrozenRows())&&("column"===n&&E<=this.m_frozenColIndex+1||"row"===n&&E<=this.m_frozenRowIndex+1)?S=new Array(v).fill(a/v):H=new Array(v).fill(a/v);let x=d.childNodes.length,b=r.childNodes.length,R=l.childNodes.length,I=this.m_databody.firstChild,M=[];for(let e=w.length-1;e>=0;e--){let t=w[e];("column"===n&&this._hasFrozenColumns()&&t<=this.m_frozenColIndex+1||"row"===n&&this._hasFrozenRows()&&t<=this.m_frozenRowIndex+1)&&(M.push(t),w.splice(e,1))}this._modifyAndPushCells(w,H,n,this.m_databody,_,p,!0,M.length),"column"===n&&this.m_databodyFrozenRow?this._modifyAndPushCells(w,H,n,this.m_databodyFrozenRow,null,null,!0,M.length):"row"===n&&this.m_databodyFrozenCol&&this._modifyAndPushCells(w,H,n,this.m_databodyFrozenCol,null,null,!0,M.length),M.length&&(this._modifyAndPushCells(M,S,n,g,C,f,!0),this.m_databodyFrozenCorner&&this._modifyAndPushCells(M,S,n,this.m_databodyFrozenCorner,null,null,!0),"column"===n?this.m_frozenColIndex+=M.length:this.m_frozenRowIndex+=M.length),o||this._simpleAdjustSelectionOnChange("insert",w,n);let F=!1;if(d.childNodes.length&&(I.appendChild(d),F=!0),m.childNodes.length&&(I=this.m_databodyFrozenCol.firstChild,I.appendChild(m),F=!0),c.childNodes.length&&(I=this.m_databodyFrozenRow.firstChild,I.appendChild(c),F=!0),u.childNodes.length&&(this.m_databodyFrozenCorner.firstChild.appendChild(u),F=!0),F&&this._refreshDatabodyMap(),this._insertHeaders(n,E,r,l),this.hideStatusText(),"row"===n){if(x&&(this.m_endRow+=v,this.m_endRowPixel+=a,this.m_stopRowFetch=!1),b&&(this.m_endRowHeader+=v,E>this.m_frozenRowIndex+1&&(this.m_endRowHeaderPixel+=a),this.m_stopRowHeaderFetch=!1),R&&(this.m_endRowEndHeader+=v,this.m_endRowEndHeaderPixel+=a,this.m_stopRowEndHeaderFetch=!1),this._hasFrozenRows()&&E<=this.m_frozenRowIndex+1){let e=this.getElementHeight(this.m_databodyFrozenRow)+a;this.setElementHeight(this.m_databodyFrozenRow,e),this.m_databodyFrozenCorner&&this.setElementHeight(this.m_databodyFrozenCorner,e)}else{let e=this.getElementHeight(I)+a;this.setElementHeight(I,e)}this.updateRowBanding()}else if("column"===n){if(x&&(this.m_endCol+=v,this.m_endColPixel+=a,this.m_stopColumnFetch=!1),b&&(this.m_endColHeader+=v,E>this.m_frozenColIndex+1&&(this.m_endColHeaderPixel+=a),this.m_stopColumnHeaderFetch=!1),R&&(this.m_endColEndHeader+=v,this.m_endColEndHeaderPixel+=a,this.m_stopColumnEndHeaderFetch=!1),this._hasFrozenColumns()&&E<=this.m_frozenColIndex+1){let e=this.getElementWidth(this.m_databodyFrozenCol)+a;this.setElementWidth(this.m_databodyFrozenCol,e),this.m_databodyFrozenCorner&&this.setElementWidth(this.m_databodyFrozenCorner,e)}else{let e=this.getElementWidth(I)+a;this.setElementWidth(I,e)}this.updateColumnBanding()}o||(this.applySelection(),this._resetHeaderHighLight(),this.resizeGrid()),e.promiseResolve()},z.prototype._insertHeaders=function(e,t,i,s){let n=this.m_rowHeader,o=this.m_rowEndHeader;this._hasFrozenRows()&&t<=this.m_frozenRowIndex&&(n=this.m_rowHeaderFrozen,o=this.m_rowEndHeaderFrozen);let r,l=this.m_rowHeaderLevelCount,a=this.m_rowEndHeaderLevelCount,h=this.m_startRowHeader,d=this.m_startRowEndHeader,m="height",c="top";"column"===e&&(n=this.m_colHeader,o=this.m_colEndHeader,this._hasFrozenColumns()&&t<=this.m_frozenColIndex&&(n=this.m_colHeaderFrozen,o=this.m_colEndHeaderFrozen),l=this.m_columnHeaderLevelCount,a=this.m_columnEndHeaderLevelCount,h=this.m_startColHeader,d=this.m_startColEndHeader,m="width",c=this.getResources().isRTLMode()?"right":"left");let u=(e,t,i,s,n,o,r)=>{for(;e.childNodes.length;){let l,a=e.firstChild;if(this.m_utils.containsCSSClassName(a,this.getMappedStyle("groupingcontainer"))){if(l=a.firstChild,null==l||this.m_utils.containsCSSClassName(l,this.getMappedStyle("groupingcontainer"))){e.removeChild(a);continue}}else l=a;let h=l.extentInfo,d=h.more.before,m=h.more.after,c=l[this.getResources().getMappedAttribute("context")],_=c.index,p=c.extent,g=c.level;if(d){let e=this._getHeaderContainer(_-1,g,0,null,t,i),s=e.firstChild,r=s[this.getResources().getMappedAttribute("context")];c.extent+=r.extent,c.index=r.index;let a=this._getAttribute(e,"extent",!0);this._setAttribute(e,"extent",a+p);let h=this.getElementDir(s,n),d=this.getElementDir(l,n);this.setElementDir(l,h+d,n);let m=this.getElementDir(s,o);this.setElementDir(l,m,o),e.replaceChild(l,s)}else if(m){let e=this._getHeaderContainer(_+p,g,0,null,t,i),s=e.firstChild,r=s[this.getResources().getMappedAttribute("context")];c.extent+=r.extent,c.index=r.index-p;let a=this._getAttribute(e,"extent",!0);this._setAttribute(e,"extent",a+p);let h=this._getAttribute(e,"start",!0);this._setAttribute(e,"start",h-p);let d=this.getElementDir(s,n),m=this.getElementDir(l,n);this.setElementDir(l,d+m,n);let u=this.getElementDir(s,o);this.setElementDir(l,u-m,o),e.replaceChild(l,s)}else{let e=this._getHeaderContainer(_,g,0,null,t,i);if(e){let t=this._getHeaderCellByIndex(_-1,r,g);if(null===t||t.parentNode!==e){let t=g===i-1?e.childNodes[1]:e.childNodes[0];e.insertBefore(l,t)}else t.nextSibling&&t.nextSibling.parentNode===e?e.insertBefore(l,t.nextSibling):e.appendChild(l)}else{let e=this._getHeaderContainer(_-1,g,0,null,t,i);if(null===e){let e=t.firstChild;e.firstChild?e.insertBefore(a,e.firstChild):e.appendChild(a)}else e.nextSibling?e.parentNode.insertBefore(a,e.nextSibling):e.parentNode.appendChild(a)}}if(d||m){let e=a.querySelector("."+this.getMappedStyle("groupingcontainer"));e&&u(e,t,i,s,n,o,r)}}};if(i.childNodes.length&&(1===l?(r=this._getHeaderCellByIndex(t,e,l-1),n.firstChild.insertBefore(i,r)):u(i,n,l,h,m,c,e)),s.childNodes.length){let i=e+"End";1===a?(r=this._getHeaderCellByIndex(t,i,l-1),o.firstChild.insertBefore(s,r)):u(s,o,a,d,m,c,i)}},z.prototype._handleModelInsertEvent=function(e,t){var i=this._isInViewport(e);if(i===z.INSIDE||i===z.AFTER&&e.row===this.m_endRow+1)null!=t.row&&(this._databodyEmpty()?(this.empty(),this.refresh(this.m_root)):(this._modifyAxisCellContextIndex("row",e.row,this.m_endRow-e.row+1,1),this._refreshDatabodyMap(),this.fetchHeaders("row",e.row,this.m_rowHeader,this.m_rowEndHeader,1,{success:this._handleHeaderInsertsFetchSuccess}),this.fetchCells(this.m_databody,e.row,this.m_startCol,1,this.m_endCol-this.m_startCol+1,{success:this._handleCellInsertsFetchSuccess})));else{if(i===z.BEFORE){this._modifyAxisCellContextIndex("row",0,this.m_endRow+1,1),this._refreshDatabodyMap(),this.m_startRow+=1,this.m_startRowHeader+=1,this.m_endRow+=1,this.m_endRowHeader+=1,this.m_startRowPixel+=this.m_avgRowHeight,this.m_startRowHeaderPixel+=this.m_avgRowHeight,this.m_endRowPixel+=this.m_avgRowHeight,this.m_endRowHeaderPixel+=this.m_avgRowHeight;var s=this.m_databody.firstChild.firstChild;null!=s&&this.pushRowsDown(s,this.m_avgRowHeight);var n=this.m_rowHeader.firstChild.firstChild;null!=n&&this.pushRowsDown(n,this.m_avgRowHeight);var o=this.m_rowEndHeader.firstChild.firstChild;null!=o&&this.pushRowsDown(o,this.m_avgRowHeight)}this.scrollToIndex(e)}},z.prototype._handleCellInsertsFetchSuccess=function(e,t){this.m_resizeRequired=!0,this.handleCellsFetchSuccess(e,t,this.m_endRow>=t[0].start);var i=t[0].start;this._scrollRowIntoViewport(i),this._isHighWatermarkScrolling()||this._cleanupViewport("top"),this.updateRowBanding(),this.m_stopRowFetch=!1,-1!==this.m_endRowHeader&&(this.m_stopRowHeaderFetch=!1),-1!==this.m_endRowEndHeader&&(this.m_stopRowEndHeaderFetch=!1),this.fillViewport()},z.prototype._handleHeaderInsertsFetchSuccess=function(e,t,i){this.m_resizeRequired=!0,this.handleHeadersFetchSuccess(e,t,i,this.m_endRowHeader>=t.start)},z.prototype._scrollRowIntoViewport=function(e){var t=this._getAxisCellsByIndex(e,"row");if(null!=t){var i=this._getViewportTop(),s=this._getViewportBottom(),n=this.getElementDir(t[0],"top"),o=i-n;(o>0||(o=s-n)<0)&&this.scrollDelta(0,o)}},z.prototype._handleModelInsertRangeEvent=function(e,t,i){var s,n,o,r,l,a,h,d,m=this._getEmptyElement(),c=e.getStart("row"),u=e.getCount("row"),_=e.getStart("column"),p=e.getCount("column");if(!(c>this.m_endRow+1))if(m)this.empty(),this.refresh(this.m_root);else if(this.m_utils.supportsTransitions()){if(null!=t){s=document.createDocumentFragment();var g=t.getCount();for(r=0,n=0,a=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell"),h=this.getRendererOrTemplate("row");g-n>0;)o=c+n,n+=(l=this.buildLevelHeaders(s,o,0,0,r,!0,c!==this.m_endRowHeader+1,h,t,"row",a,this.m_rowHeaderLevelCount)).count,r+=l.totalHeaderDimension}if(null!=i){d=document.createDocumentFragment();var C=i.getCount();for(r=0,n=0,a=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell"),h=this.getRendererOrTemplate("rowEnd");C-n>0;)o=c+n,n+=(l=this.buildLevelHeaders(d,o,0,0,r,!0,c!==this.m_endRowEndHeader+1,h,i,"rowEnd",a,this.m_rowEndHeaderLevelCount)).count,r+=l.totalHeaderDimension}var f=document.createDocumentFragment();if(l=this._addCellsToFragment(f,e,c,0,_,0),!(0!==f.childNodes.length||null!=s&&0!==s.childNodes.length||null!=d&&0!==d.childNodes.length))return;this._insertRowsWithAnimation(f,s,d,c,e.getCount("row"),l.totalRowHeight,_,p)}else{var y={axis:"row",start:c,count:u},E={axis:"column",start:_,count:p};if(null!=t){var v={axis:"row",header:this.m_rowHeader,endHeader:this.m_rowEndHeader,start:c,count:t.getCount()};this.m_fetching.row=v,this._handleHeaderInsertsFetchSuccess(t,v,i)}this._modifyAxisCellContextIndex("row",c,this.m_endRow-c+1,u),this._refreshDatabodyMap(),this._handleCellInsertsFetchSuccess(e,[y,E])}},z.prototype._handleModelUpdateEvent=function(e,t,i){if(this._isInViewport(e)===z.INSIDE)if(null!=i){var s=this.getRendererOrTemplate("cell"),n=this.m_options.getColumnBandingInterval();this._updateCellsInRow(i,i.getStart("row"),s,this.m_startCol,n)}else-1!==this.m_endRowHeader&&this.fetchHeaders("row",e.row,this.m_rowHeader,this.m_rowEndHeader,1,{success:this._handleHeaderUpdatesFetchSuccess,error:this.handleHeadersFetchError}),this.fetchCells(this.m_databody,e.row,this.m_startCol,1,this.m_endCol-this.m_startCol+1,{success:this._handleCellUpdatesFetchSuccess,error:this.handleCellsFetchError})},z.prototype._handleHeaderUpdatesFetchSuccess=function(e,t,i){var s=t.axis;this.m_fetching[s]=!1;var n=t.start;this._replaceHeaders(this.buildRowHeaders.bind(this),e,this.m_rowHeader,n,this.m_startRowHeader),this._replaceHeaders(this.buildRowEndHeaders.bind(this),i,this.m_rowEndHeader,n,this.m_startRowEndHeader);var o=this.m_rowHeader.firstChild.childNodes[n-this.m_startRowHeader];null==this.m_active||"header"!==this.m_active.type||"row"!==this.m_active.axis&&"rowEnd"!==this.m_active.axis||this._getKey(o,"row")!==this.m_active.key||this._highlightActive(),this._signalTaskEnd()},z.prototype._replaceHeaders=function(e,t,i,s,n){if(null!=t){var o=e(i,t,s,1,!0,!0),r=i.firstChild,l=r.childNodes[s-n];r.replaceChild(o,l)}},z.prototype._handleCellUpdatesFetchSuccess=function(e,t){this.m_fetching.cells=!1;var i=t[0].start,s=this.getRendererOrTemplate("cell"),n=this.m_options.getColumnBandingInterval();this._updateCellsInRow(e,i,s,this.m_startCol,n),this._signalTaskEnd()},z.prototype._getUpdateAnimationDuration=function(){return z.UPDATE_ANIMATION_DURATION},z.prototype._updateCellsInRow=function(e,t,i,s,n){var o,r=this._getUpdateAnimationDuration(),l=this._getAxisCellsByIndex(t,"row"),a=this.getElementDir(l[0],"top");if(0!==r&&this.m_utils.supportsTransitions()){var h=this;h._signalTaskStart(),this._removeFromArray(l),o=document.createDocumentFragment(),this._addCellsToFragment(o,e,t,a,s,this.m_startColPixel),l=o.childNodes;for(var d=this.getElementWidth(this.m_databody),m=0;m<l.length;m++)this.addTransformMoveStyle(l[m],0,0,"linear",d,0,0);this._populateDatabody(this.m_databody.firstChild,o),l=this._getAxisCellsByIndex(t,"row"),this.hideStatusText();this._onEndEvent("transitionend",l[l.length-1],function(){for(var e=0;e<l.length;e++)h.removeTransformMoveStyle(l[e]);h._isSelectionEnabled()&&h.applySelection(),h._highlightActive(),h._signalTaskEnd(),h._runModelEventQueue()},r),setTimeout(function(){for(var e=0;e<l.length;e++)h.addTransformMoveStyle(l[e],r+"ms",0,"linear",0,0,0)},0)}else this._removeFromArray(l),o=document.createDocumentFragment(),this._addCellsToFragment(o,e,t,a,s,this.m_startColPixel),this._populateDatabody(this.m_databody.firstChild,o),this._isSelectionEnabled()&&this.applySelection(),this._highlightActive(),this.hideStatusText()},z.prototype._handleUpdateRangeFetchSuccess=function(e,t,i){this.m_fetching.cells=!1,this.m_fetchingForUpdate=!1;const s=i[0].start,n=s+t.getCount("row")-1,o=i[1].start,r=o+t.getCount("column")-1;this._splitRange(t,s,n,o,r),this.hideStatusText(),this._signalTaskEnd(),e.promiseResolve()},z.prototype._splitRange=function(e,t,i,s,n){let o=i<this.m_frozenRowIndex?i:this.m_frozenRowIndex,r=n<this.m_frozenColIndex?n:this.m_frozenColIndex;null!==this.m_frozenRowIndex&&null!==this.m_frozenColIndex&&t<=this.m_frozenRowIndex&&s<=this.m_frozenColIndex?(this._fetchAndMutateCellsByRange(e,this.m_databodyFrozenCorner,t,o,s,r),i>this.m_frozenRowIndex&&this._fetchAndMutateCellsByRange(e,this.m_databodyFrozenCol,this.m_frozenRowIndex+1,i,s,r),n>this.m_frozenColIndex&&this._fetchAndMutateCellsByRange(e,this.m_databodyFrozenRow,t,o,this.m_frozenColIndex+1,n),i>this.m_frozenRowIndex&&(t=this.m_frozenRowIndex+1),n>this.m_frozenColIndex&&(s=this.m_frozenColIndex+1)):this.m_databodyFrozenCol&&null!==this.m_frozenColIndex&&s<=this.m_frozenColIndex?(this._fetchAndMutateCellsByRange(e,this.m_databodyFrozenCol,t,i,s,r),s=this.m_frozenColIndex+1):this.m_databodyFrozenRow&&null!==this.m_frozenRowIndex&&t<=this.m_frozenRowIndex&&(this._fetchAndMutateCellsByRange(e,this.m_databodyFrozenRow,t,o,s,n),t=this.m_frozenRowIndex+1);let l=null!==this.m_frozenColIndex&&-1!==this.m_frozenColIndex,a=null!==this.m_frozenRowIndex&&-1!==this.m_frozenRowIndex;(!l&&!a||(l||a)&&i>this.m_frozenRowIndex&&n>this.m_frozenColIndex)&&this._fetchAndMutateCellsByRange(e,this.m_databody,t,i,s,n)},z.prototype._fetchAndMutateCellsByRange=function(e,t,i,s,n,o){let r=this._getCellsInRange(i,n,s,o);const l=this.getElementDir(r[0],"top"),a=this.getResources().isRTLMode()?"right":"left",h=this.getElementDir(r[0],a),d=s-i+1,m=o-n+1;this._removeFromArray(r);let c=document.createDocumentFragment();this._addCellsToFragment(c,e,i,l,n,h,d,m),this._populateDatabody(t.firstChild,c)},z.prototype._removeAndModifyCells=function(e,t){e.forEach(e=>{let i=e[this.getResources().getMappedAttribute("context")];1===i.extents[t]?this._remove(e):i.extent[t]-=1})},z.prototype._removeAndModifyHeaders=function(e,t,i,s,n){e.forEach(e=>{let o=e[this.getResources().getMappedAttribute("context")],r=o.extent,l=e.parentNode;if(1===r)this._remove(e),0!==l.childNodes.length||l.classList.contains(this.getMappedStyle("scroller"))||this._remove(l);else{let r=this.getElementDir(e,i);this.setElementDir(e,r-t,i),o.extent-=1;let a=o.index;if(a===n){o.index+=1;let i=this.getElementDir(e,s);this.setElementDir(e,i+t,s)}if(l.classList.contains(this.getMappedStyle("groupingcontainer"))){let e=this._getAttribute(l,"extent",!0),t=this._getAttribute(l,"start",!0);this._setAttribute(l,"extent",e-1),a===n&&this._setAttribute(l,"start",t+1)}}})},z.prototype._handleDeleteRangeEvent=function(e){let t=e.ranges,i=new Set,s=e.axis,n=e.editHeader,o=this.getResources().isRTLMode()?"right":"left",r=this.m_selection;for(let e=0;e<r.length;e++)this._applyBorderClassesAroundRange(this.getElementsInRange(r[e]),r[e],!1,"Selected");t.forEach(function(e){let t=e.offset,s=e.count;for(var n=0;n<s;n++)i.add(t+n)});let l=Array.from(i);l.sort(function(e,t){return t-e});let a=0,h=0,d=0,m=0,c=0,u=0,_=this.m_databodyFrozenRow,p=this.m_rowHeader,g=this.m_rowHeaderFrozen,C=this.m_startRowEndHeader,f=this.m_rowEndHeader,y=this.m_rowEndHeaderFrozen,E=this.m_rowEndHeaderLevelCount,v=this.m_avgRowHeight,w=-1!==this.m_endRow,H=-1!==this.m_endRowHeader,S=-1!==this.m_endRowEndHeader,x="height",b="top";"column"===s&&(_=this.m_databodyFrozenCol,C=this.m_startColEndHeader,p=this.m_colHeader,g=this.m_colHeaderFrozen,f=this.m_colEndHeader,y=this.m_colEndHeaderFrozen,E=this.m_columnEndHeaderLevelCount,v=this.m_avgColWidth,w=-1!==this.m_endCol,H=-1!==this.m_endColHeader,S=-1!==this.m_endColEndHeader,x="width",b=o);let R,I=[],M=[];if(this._isEditOrEnter()&&(R=this._getCellByIndex(this.m_active.indexes)),R){let t=this.getCellIndexes(R),i=!1;l.forEach(e=>{("row"===s&&e===t.row||"column"===s&&e===t.column)&&(i=!0)}),i&&(this._handleExitEditable(e,R),this._handleExitEdit(e,R))}for(let e=0;e<l.length;e++){let t=l[e],i=0,n=this._isAxisIndexInViewport(t,s);if(n===z.BEFORE||n===z.INSIDE){if(n===z.BEFORE)d+=1,i=v,a+=i;else if(n===z.INSIDE){m+=1,i=this.getElementDir(this._getCellOrHeaderByIndex(t,s),x);let e=this._getAxisCellsByIndex(t,s);null!=e&&(this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]),this._removeAndModifyCells(e,s));let n=this._getHeaderCellsByIndex(t,s);n.length&&this._removeAndModifyHeaders(n,i,x,b,t);let o=this._getHeadersByIndex(t,f,E,C);o.length&&this._removeAndModifyHeaders(o,i,x,b,t)}"column"===s&&this._hasFrozenColumns()&&t<=this.m_frozenColIndex||"row"===s&&this._hasFrozenRows()&&t<=this.m_frozenRowIndex?M.unshift(i):(h+=i,I.unshift(i)),"column"===s&&this._hasFrozenColumns()&&t<=this.m_frozenColIndex||"row"===s&&this._hasFrozenRows()&&t<=this.m_frozenRowIndex?c+=i:u+=i}else n===z.AFTER&&"scroll"===this.m_options.getScrollPolicy()&&(u+=i)}l.reverse();let F=[];for(let e=l.length-1;e>=0;e--){let t=l[e];("column"===s&&this._hasFrozenColumns()&&t<=this.m_frozenColIndex||"row"===s&&this._hasFrozenRows()&&t<=this.m_frozenRowIndex)&&(F.push(t),l.splice(e,1))}if(F.reverse(),this._modifyAndPushCells(l,I,s,this.m_databody,p,f,!1,F.length),"column"===s&&this.m_databodyFrozenRow?this._modifyAndPushCells(l,I,s,this.m_databodyFrozenRow,null,null,!1,F.length):"row"===s&&this.m_databodyFrozenCol&&this._modifyAndPushCells(l,I,s,this.m_databodyFrozenCol,null,null,!1,F.length),F.length&&(this._modifyAndPushCells(F,M,s,_,g,y,!1),this.m_databodyFrozenCorner&&this._modifyAndPushCells(F,M,s,this.m_databodyFrozenCorner,null,null,!1),"column"===s?this.m_frozenColIndex-=F.length:this.m_frozenRowIndex-=F.length),this._refreshDatabodyMap(),!n){let t;this._adjustActive("delete",l),this._simpleAdjustSelectionOnChange("delete",l.reverse(),s);let i={};if(this.m_active&&"cell"===this.m_active.type&&(Object.assign(i,this.m_active.indexes),t=this._getCellByIndex(i),"row"===s))for(;!t&&i.row-1>0;)i.row-=1,t=this._getCellByIndex(i);t&&(this._setActiveByIndex(i,e),this._highlightActive())}var D=this.m_databody.firstChild;if("row"===s){w&&(this.m_startRow-=d,this.m_endRow=this.m_endRow-d-m,this.m_startRowPixel-=a,this.m_endRowPixel=this.m_endRowPixel-a-h,this.m_stopRowFetch=!1),H&&(this.m_startRowHeader-=d,this.m_endRowHeader=this.m_endRowHeader-d-m,this.m_startRowHeaderPixel-=a,this.m_endRowHeaderPixel=this.m_endRowHeaderPixel-a-h,this.m_stopRowHeaderFetch=!1),S&&(this.m_startRowEndHeader-=d,this.m_endRowEndHeader=this.m_endRowEndHeader-d-m,this.m_startRowEndHeaderPixel-=a,this.m_endRowEndHeaderPixel=this.m_endRowEndHeaderPixel-a-h,this.m_stopRowEndHeaderFetch=!1);var L=this.getElementHeight(D)-u;if(this.setElementHeight(D,L),this.m_databodyFrozenRow){var A=this.getElementHeight(this.m_databodyFrozenRow)-c;this.setElementHeight(this.m_databodyFrozenRow,A),this.m_databodyFrozenCorner&&this.setElementHeight(this.m_databodyFrozenCorner,A)}this.updateRowBanding()}else if("column"===s){w&&(this.m_startCol-=d,this.m_endCol=this.m_endCol-d-m,this.m_startColPixel-=a,this.m_endColPixel=this.m_endColPixel-a-h,this.m_stopColumnFetch=!1),H&&(this.m_startColHeader-=d,this.m_endColHeader=this.m_endColHeader-d-m,this.m_startColHeaderPixel-=a,this.m_endColHeaderPixel=this.m_endColHeaderPixel-a-h,this.m_stopColumnHeaderFetch=!1),S&&(this.m_startColEndHeader-=d,this.m_endColEndHeader=this.m_endColEndHeader-d-m,this.m_startColEndHeaderPixel-=a,this.m_endColEndHeaderPixel=this.m_endColEndHeaderPixel-a-h,this.m_stopColumnEndHeaderFetch=!1);var T=this.getElementWidth(D)-u;if(this.setElementWidth(D,T),this.m_databodyFrozenCol){var N=this.getElementWidth(this.m_databodyFrozenCol)-c;this.setElementWidth(this.m_databodyFrozenCol,N),this.m_databodyFrozenCorner&&this.setElementWidth(this.m_databodyFrozenCorner,N)}this.updateColumnBanding()}if(!n){this.applySelection(),this.m_utils.isTouchDevice()&&(this.GetSelection().length?this._moveTouchSelectionAffordance():this._removeTouchSelectionAffordance(!0)),this.resizeGrid(),this.m_resizeRequired=!0;let e=this;Promise.resolve().then(()=>{null!=e.m_modelEvents&&0===e.m_modelEvents.length&&e.fillViewport()})}},z.prototype._handleModelDeleteEvent=function(e,t,i){var s,n,o,r;Array.isArray(t)||(t=new Array(t),e=new Array(e));for(var l=0,a=0,h=0,d=0,m=0,c=0;c<t.length;c++){var u=t[c],_=e[c];if(null!=u.row){var p=0,g=u.row,C=this._isInViewport(_);C===z.BEFORE?(this._modifyAxisCellContextIndex("row",this.m_startRow,this.m_endRow-this.m_startRow+1,-1),d+=1,l+=this.m_avgRowHeight,this.m_startRowPixel-=this.m_avgRowHeight,this.m_endRowPixel-=this.m_avgRowHeight,-1!==this.m_endRowHeader&&(this.m_startRowHeaderPixel-=this.m_avgRowHeight,this.m_endRowHeaderPixel-=this.m_avgRowHeight),null!=(r=this._getAxisCellsByKey(g,"row"))&&this.pushRowsUp(this.m_startRow,this.m_avgRowHeight),null!=(n=this.m_rowHeader.firstChild.firstChild)&&this.pushRowHeadersUp(n,this.m_avgRowHeight),null!=(o=this.m_rowEndHeader.firstChild.firstChild)&&this.pushRowHeadersUp(o,this.m_avgRowHeight)):C===z.INSIDE?(m+=1,null!=(r=this._getAxisCellsByKey(g,"row"))&&(p=this.calculateRowHeight(r[0]),_=r[0][this.getResources().getMappedAttribute("context")].indexes.row,this._modifyAxisCellContextIndex("row",_+1,this.m_endRow-_,-1),this._removeFromArray(r),this.pushRowsUp(_,p),this.m_endRowPixel-=p),null!=(n=this._findHeaderByKey(g,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(p=this.calculateRowHeaderHeight(n),s=n.nextSibling,this._remove(n),this.pushRowHeadersUp(s,p),this.m_endRowHeaderPixel-=p),null!=(o=this._findHeaderByKey(g,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")))&&(p=this.calculateRowHeaderHeight(o),s=o.nextSibling,this._remove(o),this.pushRowHeadersUp(s,p),this.m_endRowEndHeaderPixel-=p),a+=p):"scroll"===this.m_options.getScrollPolicy()&&(h+=this.m_avgRowHeight)}}this._refreshDatabodyMap(),this.m_startRow-=d,this.m_endRow=this.m_endRow-d-m,-1!==this.m_endRowHeader&&(this.m_startRowHeader-=d,this.m_endRowHeader=this.m_endRowHeader-d-m),-1!==this.m_endRowEndHeader&&(this.m_startRowEndHeader-=d,this.m_endRowEndHeader=this.m_endRowEndHeader-d-m);var f=l+a+h,y=this.m_databody.firstChild,E=this.getElementHeight(y)-f;this.setElementHeight(y,E),this.resizeGrid(),i||!0===this.m_moveActive||(this.m_resizeRequired=!0,this.m_stopRowFetch=!1,-1!==this.m_endRowHeader&&(this.m_stopRowHeaderFetch=!1),-1!==this.m_endRowEndHeader&&(this.m_stopRowEndHeaderFetch=!1),this.fillViewport()),this.updateRowBanding()},z.prototype._handleModelDeleteEventWithAnimation=function(e,t){this._collapseRowsWithAnimation(e,t)},z.prototype._collapseRowsWithAnimation=function(e,t){var i,s,n,o,r,l,a,h;let d=e.indexes;if(0!==t.length){var m=this;m._signalTaskStart();var c=this.m_processingEventQueue?1:z.COLLAPSE_ANIMATION_DURATION,u=[],_=0,p=-1!==this.m_endRowHeader,g=-1!==this.m_endRowEndHeader,C=this.m_databody.firstChild,f=this._getIndex(this._getAxisCellsByKey(t[0].row,"row")[0],"row")-1;for(s=f;s>=this.m_startRow&&(i=this._getAxisCellsByIndex(s,"row"),!(this.getElementDir(i[0],"top")+this.getElementHeight(i[0])<this.m_currentScrollTop));s--)for(n=0;n<i.length;n++)this.changeStyleProperty(i[n],this.getCssSupport("z-index"),10);if(p)for(r=[],o=this._findHeaderByKey(t[0].row,this.m_rowHeader,this.getMappedStyle("rowheadercell")).previousSibling;o&&!(this.getElementDir(o,"top")+this.getElementHeight(o)<this.m_currentScrollTop);)this.changeStyleProperty(o,this.getCssSupport("z-index"),10),o=o.previousSibling;if(g)for(l=[],o=this._findHeaderByKey(t[0].row,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")).previousSibling;o&&!(this.getElementDir(o,"top")+this.getElementHeight(o)<this.m_currentScrollTop);)this.changeStyleProperty(o,this.getCssSupport("z-index"),10),o=o.previousSibling;for(s=0;s<t.length;s++){var y=t[s].row;if((i=this._getAxisCellsByKey(y,"row")).length)for(u.push(i),_+=this.getElementHeight(i[0]),n=0;n<i.length;n++)this.setElementDir(i[n],this.getElementDir(i[n],"top")-_,"top"),this.addTransformMoveStyle(i[n],0,0,"linear",0,_,0);p&&null!=(a=this._findHeaderByKey(y,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(r.push(a),this.setElementDir(a,this.getElementDir(a,"top")-_,"top"),this.addTransformMoveStyle(a,0,0,"linear",0,_,0)),g&&null!=(h=this._findHeaderByKey(y,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")))&&(l.push(h),this.setElementDir(h,this.getElementDir(h,"top")-_,"top"),this.addTransformMoveStyle(h,0,0,"linear",0,_,0))}for(s=f+t.length+1;s<=this.m_endRow;s++){for(i=this._getAxisCellsByIndex(s,"row"),n=0;n<i.length;n++)this.setElementDir(i[n],this.getElementDir(i[n],"top")-_,"top"),this.addTransformMoveStyle(i[n],0,0,"linear",0,_,0);p&&(a=a.nextSibling,this.setElementDir(a,this.getElementDir(a,"top")-_,"top"),this.addTransformMoveStyle(a,0,0,"linear",0,_,0)),g&&(h=h.nextSibling,this.setElementDir(h,this.getElementDir(h,"top")-_,"top"),this.addTransformMoveStyle(h,0,0,"linear",0,_,0))}var E=this._getCellByIndex(this.createIndex(this.m_endRow,this.m_endCol));m._onEndEvent("transitionend",E,function(){u.length&&m._modifyAxisCellContextIndex("row",f+t.length+1,m.m_endRow-(f+t.length),-1*t.length),p&&r.length&&m._modifyAxisHeaderContextIndex("row",f+t.length+1,m.m_endRow-(f+t.length),-1*t.length),g&&l.length&&m._modifyAxisHeaderContextIndex("rowEnd",f+t.length+1,m.m_endRow-(f+t.length),-1*t.length);for(var e=0;e<u.length;e++){for(var i=0;i<u[e].length;i++)m._remove(u[e][i]);p&&m._remove(r[e]),g&&m._remove(l[e])}m._adjustActive("delete",d),m._refreshDatabodyMap(),m._isEditOrEnter()&&(m._highlightActiveObject(m.m_active,m.m_prevActive),m._updateEdgeCellBorders("")),m.m_endRow-=u.length,m.m_endRowPixel-=_,m.m_stopRowFetch=!1,p&&(m.m_endRowHeader-=r.length,m.m_endRowHeaderPixel-=_,m.m_stopRowHeaderFetch=!1),g&&(m.m_endRowEndHeader-=r.length,m.m_endRowEndHeaderPixel-=_,m.m_stopRowEndHeaderFetch=!1),m.setElementHeight(C,m.m_endRowPixel-m.m_startRowPixel),m.resizeGrid(),m.updateRowBanding(),null==m.m_modelEvents||0!==m.m_modelEvents.length||m.m_moveActive||m.fillViewport(),m._handleAnimationEnd()},c),this.m_animating=!0,setTimeout(function(){for(s=f+1;s<=m.m_endRow;s++){for(i=m._getAxisCellsByIndex(s,"row"),n=0;n<i.length;n++)m.addTransformMoveStyle(i[n],c+"ms",0,"ease-out",0,0,0);p&&(a=m._getHeaderByIndex(s,0,m.m_rowHeader,m.m_rowHeaderLevelCount,m.m_startRowHeader),m.addTransformMoveStyle(a,c+"ms",0,"ease-out",0,0,0)),g&&(h=m._getHeaderByIndex(s,0,m.m_rowEndHeader,m.m_rowEndHeaderLevelCount,m.m_startRowEndHeader),m.addTransformMoveStyle(h,c+"ms",0,"ease-out",0,0,0))}},0)}},z.prototype._handleAnimationEnd=function(){var e,t=this.m_databody.firstChild,i=this.m_rowHeader.firstChild,s=this.m_rowEndHeader.firstChild;for(e=0;e<t.childNodes.length;e++)this.removeTransformMoveStyle(t.childNodes[e]),this.changeStyleProperty(t.childNodes[e],this.getCssSupport("z-index"),null,"remove");if(-1!==this.m_endRowHeader)for(e=0;e<i.childNodes.length;e++)this.removeTransformMoveStyle(i.childNodes[e]),this.changeStyleProperty(i.childNodes[e],this.getCssSupport("z-index"),null,"remove");if(-1!==this.m_endRowEndHeader)for(e=0;e<s.childNodes.length;e++)this.removeTransformMoveStyle(s.childNodes[e]),this.changeStyleProperty(s.childNodes[e],this.getCssSupport("z-index"),null,"remove");this.m_animating=!1,this._runModelEventQueue(),this._signalTaskEnd()},z.prototype._getCellOrHeaderByKey=function(e,t){var i=null,s=this._getAxisCellsByKey(e,t,!0);return null!=s&&s.length>0&&(i=s[0]),null==i&&("row"===t?null==(i=this._findHeaderByKey(e,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(i=this._findHeaderByKey(e,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell"))):"column"===t&&null==(i=this._findHeaderByKey(e,this.m_colHeader,this.getMappedStyle("colheadercell")))&&(i=this._findHeaderByKey(e,this.m_colEndHeader,this.getMappedStyle("colendheadercell")))),i},z.prototype._findHeaderByKey=function(e,t,i){if(null==t)return null;var s;this._hasFrozenRows()&&parseInt(e,10)<=this.m_frozenRowIndex&&(t===this.m_rowHeader||t===this.m_rowEndHeader)&&(t=t===this.m_rowHeader?this.m_rowHeaderFrozen:this.m_rowEndHeaderFrozen),this._hasFrozenColumns()&&parseInt(e,10)<=this.m_frozenColIndex&&(t===this.m_colHeader||t===this.m_colEndHeader)&&(t=t===this.m_colHeader?this.m_colHeaderFrozen:this.m_colEndHeaderFrozen),s=t.getElementsByClassName?t.getElementsByClassName(i):t.childNodes;for(var n=0;n<s.length;n++){var o=s[n],r=this._getKey(o);if(this._shallowThenDeepCompare(r,e))return o}return null},z.prototype._handleModelRefreshEvent=function(e){if(null!=e){const t={ranges:[]};let i=!0;if(null!=e.disregardAfterColumnOffset&&this._getCellOrHeaderByIndex(e.disregardAfterColumnOffset,"column")){t.axis="column";const s=e.disregardAfterColumnOffset+1;t.ranges.push({offset:s,count:this.m_endCol-e.disregardAfterColumnOffset}),i=!1}if(null!=e.disregardAfterRowOffset&&this._getCellOrHeaderByIndex(e.disregardAfterRowOffset,"row")){t.axis="row";const s=e.disregardAfterRowOffset+1;t.ranges.push({offset:s,count:this.m_endRow-e.disregardAfterRowOffset}),i=!1}if(!i)return void this._handleDeleteRangeEvent(t)}var t=this.getVisibility();this.m_focusOnRefresh=this.m_root.contains(document.activeElement),this.m_updateScrollPostionOnRefreshCallback(),t===z.VISIBILITY_STATE_VISIBLE?(this.empty(),null!=this.m_root.offsetParent?this.refresh(this.m_root):this.setVisibility(z.VISIBILITY_STATE_REFRESH)):t===z.VISIBILITY_STATE_HIDDEN&&(this.empty(),this.setVisibility(z.VISIBILITY_STATE_REFRESH))},z.prototype._handleModelSyncEvent=function(e){var t=e.pageSize;this.m_fetching={},this.m_startRow=0,this.m_endRow=-1,this.m_startRowHeader=0,this.m_endRowHeader=-1,this.m_startRowEndHeader=0,this.m_endRowEndHeader=-1,this.m_startRowPixel=0,this.m_endRowPixel=0,this.m_startRowHeaderPixel=0,this.m_endRowHeaderPixel=0,this.m_startRowEndHeaderPixel=0,this.m_endRowEndHeaderPixel=0,this.m_startCol=0,this.m_endCol=-1,this.m_startColHeader=0,this.m_endColHeader=-1,this.m_startColEndHeader=0,this.m_endColEndHeader=-1,this.m_startColPixel=0,this.m_endColPixel=0,this.m_startColHeaderPixel=0,this.m_endColHeaderPixel=0,this.m_startColEndHeaderPixel=0,this.m_endColEndHeaderPixel=0,this.m_rowHeaderLevelCount=void 0,this.m_columnHeaderLevelCount=void 0,this.m_rowEndHeaderLevelCount=void 0,this.m_columnEndHeaderLevelCount=void 0,this.m_avgRowHeight=void 0,this.m_avgColWidth=void 0,this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this._clearScrollPositionKeys(),this.m_selection=null,this.m_selectionRange=null,this.m_active=null,this.m_prevActive=null,this.m_trueIndex={},null!=this.m_empty&&(this.m_databody.firstChild.removeChild(this.m_empty),this.m_empty=null),this._showHeader(this.m_rowHeader),this._showHeader(this.m_colHeader),this._showHeader(this.m_rowEndHeader),this._showHeader(this.m_colEndHeader),this._emptyHeaders(),this._emptyHeaderLabels();var i=this.m_databody.firstChild;null!=i&&this._emptyDatabody(i),this.m_initialized=!1,this.fetchHeaders("row",0,this.m_rowHeader,this.m_rowEndHeader,t,{success:function(e,t,i){this.handleHeadersFetchSuccess(e,t,i,!1)}}),this.fetchHeaders("column",0,this.m_colHeader,this.m_colEndHeader,void 0,{success:function(e,t,i){this.handleHeadersFetchSuccess(e,t,i,!1)}}),this.fetchCells(this.m_databody,0,0,t,null,{success:function(e,t){this.handleCellsFetchSuccess(e,t)}})},z.prototype._emptyHeaders=function(){var e=this.m_rowHeader.firstChild,t=this.m_rowEndHeader.firstChild;null!=e&&this.m_utils.empty(e),null!=t&&this.m_utils.empty(t);var i=this.m_colHeader.firstChild,s=this.m_colEndHeader.firstChild;null!=i&&this.m_utils.empty(i),null!=s&&this.m_utils.empty(s)},z.prototype._emptyHeaderLabels=function(){var e=this.m_headerLabels.row,t=this.m_headerLabels.rowEnd,i=this.m_headerLabels.column,s=this.m_headerLabels.columnEnd;e&&e.length&&e.forEach(e=>{this.m_utils.empty(e)}),t&&t.length&&t.forEach(e=>{this.m_utils.empty(e)}),i&&i.length&&i.forEach(e=>{this.m_utils.empty(e)}),s&&s.length&&s.forEach(e=>{this.m_utils.empty(e)})},z.prototype._setActiveByIndex=function(e,t,i,s,n){let o=this._getCellByIndex(e);return this._setActive(o,{type:"cell",indexes:e},t,i,s,n)},z.prototype._updateActive=function(e,t,i){var s;if(null==e)this._setActive(null,null,null,!0,!1,i);else if(null!=e.keys)s=this._getCellByKeys(e.keys);else if(null!=e.indexes)s=this._getCellByIndex(e.indexes);else if(null!=e.axis){var n=null==e.level?0:e.level;"column"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_colHeader,this.getMappedStyle("colheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader)):"row"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_rowHeader,this.getMappedStyle("rowheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader)):"columnEnd"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_colEndHeader,this.getMappedStyle("colendheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader)):"rowEnd"===e.axis&&(null!=e.key?s=this._findHeaderByKey(e.key,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader)))}null!=s&&(t||(this.m_shouldFocus=!1),this._setActive(s,e,null,!0,!1,i))},z.prototype._setActive=function(e,t,i,s,n,o){var r;if(null==t||o||this._scrollToActive(t),null!=e)if(r=this._createActiveObject(e),this._compareActive(r,this.m_active)){if(n||this._fireBeforeCurrentCellEvent(r,this.m_active,i))return this.m_prevActive=this.m_active,this.m_active=r,i&&"mousedown"===i.type&&(this.m_trueIndex=null),s&&this._isSelectionEnabled()&&this._clearSelection(i),this._unhighlightActiveObject(this.m_prevActive),this._highlightActiveObject(this.m_active,this.m_prevActive,null,o),this._manageMoveCursor(),this._isGridEditable()&&"cell"===r.type&&(this._setEditableClone(e),this._updateEdgeCellBorders("")),n||this._fireCurrentCellEvent(r,i),this.m_options.isFloodFillEnabled()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"cell"===this.m_active.type&&i&&(this._addFloodfillAffordance(i),this._moveFloodFillAffordance()),!0}else this._highlightActive();else if(!this.m_scrollIndexAfterFetch&&!this.m_scrollHeaderAfterFetch)return(n||this._fireBeforeCurrentCellEvent(r,this.m_active,i))&&(this.m_prevActive=this.m_active,this.m_active=null,this._unhighlightActiveObject(this.m_prevActive),n||this._fireCurrentCellEvent(r,i)),!0;return!1},z.prototype._createActiveObject=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.m_utils.containsCSSClassName(e,this.getMappedStyle("headercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("endheadercell"))?{type:"header",axis:t.axis,index:this.getHeaderCellIndex(e),key:t.key,level:t.level}:this.m_utils.containsCSSClassName(e,this.getMappedStyle("headerlabel"))?{type:"label",axis:t.axis,level:t.level}:this.m_utils.containsCSSClassName(e,this.getMappedStyle("noDataContainer"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("emptytext"))?{type:"empty"}:{type:"cell",indexes:{row:t.indexes.row,column:t.indexes.column},keys:{row:t.keys.row,column:t.keys.column},extents:{row:t.extents.row,column:t.extents.column}}},z.prototype._getActiveElement=function(){return this._getElementFromActiveObject(this.m_active)},z.prototype._getElementFromActiveObject=function(e){if(null!=e){if("header"!==e.type)return"label"===e.type?this._getLabel(e.axis,e.level):"empty"===e.type?this._getEmptyElement():this._getCellByIndex(e.indexes);if("row"===e.axis){let t=this.m_rowHeader;return this._hasFrozenRows()&&e.index<=this.m_frozenRowIndex&&(t=this.m_rowHeaderFrozen),this._findHeaderByKey(e.key,t,this.getMappedStyle("rowheadercell"))}if("column"===e.axis){let t=this.m_colHeader;return this._hasFrozenColumns()&&e.index<=this.m_frozenColIndex&&(t=this.m_colHeaderFrozen),this._findHeaderByKey(e.key,t,this.getMappedStyle("colheadercell"))}if("rowEnd"===e.axis){let t=this.m_rowEndHeader;return this._hasFrozenRows()&&e.index<=this.m_frozenRowIndex&&(t=this.m_rowEndHeaderFrozen),this._findHeaderByKey(e.key,t,this.getMappedStyle("rowendheadercell"))}if("columnEnd"===e.axis){let t=this.m_colEndHeader;return this._hasFrozenColumns()&&e.index<=this.m_frozenColIndex&&(t=this.m_colEndHeaderFrozen),this._findHeaderByKey(e.key,t,this.getMappedStyle("colendheadercell"))}}return null},z.prototype._compareActive=function(e,t){if(null==e&&null==t)return!1;if(null==e&&null!=t||null!=e&&null==t)return!0;if(e.type!==t.type)return!0;if("header"===e.type){if(e.index!==t.index||e.key!==t.key||e.axis!==t.axis||e.level!==t.level)return!0}else if("label"===e.type){if(e.axis!==t.axis||e.level!==t.level)return!0}else if(e.indexes.row!==t.indexes.row||e.indexes.column!==t.indexes.column||e.keys.row!==t.keys.row||e.keys.column!==t.keys.column)return!0;return!1},z.prototype._fireBeforeCurrentCellEvent=function(e,t,i){var s={event:i,ui:{currentCell:e,previousCurrentCell:t}};return this.fireEvent("beforeCurrentCell",s)},z.prototype._fireCurrentCellEvent=function(e,t){var i={event:t,ui:e};return this.fireEvent("currentCell",i)},z.prototype._isDatabodyCellActive=function(){return null!=this.m_active&&"cell"===this.m_active.type},z.prototype._updateActiveContext=function(e,t){var i,s,n,o={};if("header"===e.type){i=e.axis;var r=e.index;s=e.level,"row"===e.axis?(this.m_rowHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.rowHeader=r)):"column"===i?(this.m_columnHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.columnHeader=r)):"rowEnd"===e.axis?(this.m_rowEndHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.rowEndHeader=r)):"columnEnd"===i&&(this.m_columnEndHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&r===t.index&&i===t.axis||(o.columnEndHeader=r)),this._updateContextInfo(o,n)}else"cell"===e.type?(null==t||"cell"!==t.type||null==e||this.m_externalFocus||(e.indexes.row===t.indexes.row?n="row":e.indexes.column===t.indexes.column&&(n="column")),this._updateContextInfo(e,n)):"label"===e.type&&(i=e.axis,s=e.level,(null==t||"label"!==t.type||"label"===t.type&&t.axis!==i||this.m_externalFocus)&&("column"===i?o.columnHeaderLabel=s:"row"===i?o.rowHeaderLabel=s:"rowEnd"===i?o.rowEndHeaderLabel=s:"columnEnd"===i&&(o.columnEndHeaderLabel=s)),this._updateContextInfo(o,n))},z.prototype.handleDatabodyClickActive=function(e){var t=e.target,i=this.findCell(t);null!=i&&this._setActive(i,this._createActiveObject(i),e)},z.prototype.handleHeaderClickActive=function(e,t,i){var s=e.target,n=this.findHeader(s);null!=n&&(t||this._clearSelection(e),this._setActive(n,this._createActiveObject(n),e,null,null,i))},z.prototype._scrollToActive=function(e){"header"===e.type?this.scrollToHeader(e):"cell"===e.type&&this.scrollToIndex(e.indexes)},z.prototype._getCellByKeys=function(e){if(null==e||null==e.row||null==e.column||null==this.m_databody||null==this.m_databody.firstChild)return null;for(var t=this.m_databody.firstChild.getElementsByClassName(this.getMappedStyle("cell")),i=0;i<t.length;i++){var s=t[i],n=this._getKey(s,"row");if(this._shallowThenDeepCompare(n,e.row)){var o=this._getKey(s,"column");if(this._shallowThenDeepCompare(o,e.column))return s}}return null},z.prototype._shallowThenDeepCompare=function(e,t){return e===t||this._compareValuesCallback(e,t)},z.prototype.getCellKeys=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.keys.row,t.keys.column)},z.prototype.getCellIndexes=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.indexes.row,t.indexes.column)},z.prototype.getCellExtents=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.extents.row,t.extents.column)},z.prototype.getCellEndIndexes=function(e){var t=this.getCellIndexes(e),i=this.getCellExtents(e);return this.createIndex(t.row+(i.row-1),t.column+(i.column-1))},z.prototype._getIndex=function(e,t){if(null!=e){if(null==t||!this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return this.getHeaderCellIndex(e);var i=e[this.getResources().getMappedAttribute("context")];if("row"===t)return i.indexes.row;if("column"===t)return i.indexes.column}return null},z.prototype._getExtent=function(e,t){if(null!=e){if(null==t||!this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return parseInt(this._getAttribute(e,"extent",!0),10);var i=e[this.getResources().getMappedAttribute("context")];if("row"===t)return i.extents.row;if("column"===t)return i.extents.column}return null},z.prototype.getHeaderCellIndex=function(e){var t,i,s;let n;switch(this.getHeaderCellAxis(e)){case"column":t=this.m_columnHeaderLevelCount,i=this.m_startColHeader,this._hasFrozenColumns()&&(n=this.m_colHeaderFrozen);break;case"row":t=this.m_rowHeaderLevelCount,i=this.m_startRowHeader,this._hasFrozenRows()&&(n=this.m_rowHeaderFrozen);break;case"columnEnd":t=this.m_columnEndHeaderLevelCount,i=this.m_startColEndHeader,this._hasFrozenColumns()&&(n=this.m_colEndHeaderFrozen);break;case"rowEnd":t=this.m_rowEndHeaderLevelCount,i=this.m_startRowEndHeader,this._hasFrozenRows()&&(n=this.m_rowEndHeaderFrozen);break;default:return-1}if(t>1){if(s=this._getAttribute(e.parentNode,"start",!0),e===e.parentNode.firstChild)return s;s-=1}else s=i;for(;e.previousSibling;)s+=1,e=e.previousSibling;return 1===t&&void 0!==n&&null===n.querySelector(`#${e.id}`)&&(s+=n.firstChild.childElementCount),s},z.prototype.getHeaderCellAxis=function(e){return this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))?"column":this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowheadercell"))?"row":this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowendheadercell"))?"rowEnd":this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))?"columnEnd":null},z.prototype.getHeaderCellLevel=function(e){if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))){if(1===this.m_columnHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowheadercell"))){if(1===this.m_rowHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))){if(1===this.m_columnEndHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowendheadercell"))&&1===this.m_rowEndHeaderLevelCount)return 0;var t=this._getAttribute(e.parentNode,"level",!0);return e===e.parentNode.firstChild?t:t+this.getHeaderCellDepth(e.parentNode.firstChild)},z.prototype.getHeaderCellDepth=function(e){return this._getAttribute(e,"depth",!0)},z.prototype.getHeaderLabelLevel=function(e){let t=e[this.getResources().getMappedAttribute("context")];return t?t.level:null},z.prototype.getHeaderLabelAxis=function(e){let t=e[this.getResources().getMappedAttribute("context")];return t?t.axis:null},z.prototype._getResizeHeaderMode=function(e){var t="row";return(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnheaderlabel"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnendheaderlabel")))&&(t="column"),t},z.prototype.findCellOrHeader=function(e){var t=this.findCell(e);return null==t&&(t=this.findHeader(e)),t},z.prototype.findCell=function(e){return this.find(e,"cell")},z.prototype.findLabel=function(e){return this.find(e,"headerlabel")},z.prototype.find=function(e,t,i){return null==e||e===this.getRootElement()?null:(null==i&&(i=this.getMappedStyle(t)),null==i?null:this.m_utils.containsCSSClassName(e,i)?e:this.find(e.parentNode,t,i))},z.prototype._highlightActive=function(e){this._highlightActiveObject(this.m_active,this.m_prevActive,e)},z.prototype._unhighlightActive=function(e){this._unhighlightActiveObject(this.m_active,e)},z.prototype._highlightActiveObject=function(e,t,i,s){if(null==i&&this.m_utils.shouldOffsetOutline()&&(i=["offsetOutline"]),null!=e){var n=this._getElementFromActiveObject(e);null!=n&&(this.m_focusInHandler(n),null!=i&&this._highlightElement(n,i),this._isCellEditable()&&"cell"===e.type&&this._applyBorderClassesAroundRange(n,{startIndex:e.indexes},!0,"Edit"),this._setAriaProperties(e,t,n,s))}},z.prototype._unhighlightActiveObject=function(e,t){if(null==t&&this.m_utils.shouldOffsetOutline()&&(t=["offsetOutline"]),null!=e){var i=this._getElementFromActiveObject(e);null!=i&&(this.m_focusOutHandler(i),null!=t&&this._unhighlightElement(i,t),this._isGridEditable()&&"cell"===e.type&&this._applyBorderClassesAroundRange(i,{startIndex:e.indexes},!1,"Edit"),this._unsetAriaProperties(i))}},z.prototype._highlightCellsAlongAxis=function(e,t,i,s,n){for(var o="key"===i?this._getAxisCellsByKey(e,t):this._getAxisCellsByIndex(e,t),r=0;r<o.length;r++)"add"===s?this._highlightElement(o[r],n):this._unhighlightElement(o[r],n)},z.prototype._highlightElement=function(e,t){for(var i=0;i<t.length;i++){var s=this.getMappedStyle(t[i]);this.m_utils.addCSSClassName(e,s)}},z.prototype._unhighlightElement=function(e,t){for(var i=0;i<t.length;i++){var s=this.getMappedStyle(t[i]);this.m_utils.removeCSSClassName(e,s)}},z.prototype._unhighlightElementsByClassName=function(e,t){if(e.length&&t.length)for(var i=0;i<e.length;i++)this._unhighlightElement(e[i],t)},z.prototype._setAriaProperties=function(e,t,i,s){var n=this.getLabelledBy(e,t,i);this._updateActiveContext(e,t),i.setAttribute("tabIndex",0),i.setAttribute("aria-labelledby",n),u.isFirefox()&&i.setAttribute("role","gridcell"),null!=this.m_cellToFocus&&this.m_cellToFocus===i||!1===this.m_shouldFocus||i.focus({preventScroll:s}),this.m_shouldFocus=null},z.prototype._unsetAriaProperties=function(e){null!=e&&(e.setAttribute("tabIndex",-1),e.removeAttribute("aria-labelledby"),u.isFirefox()&&e.removeAttribute("role"))},z.prototype.getLabelledBy=function(e,t,i,s){var n,o,r,l,a="",h=[];const d=i[this.getResources().getMappedAttribute("metadata")];if("header"===e.type){null==t||"header"!==t.type||this.m_externalFocus||("row"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader):"column"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader):"rowEnd"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader):"columnEnd"===t.axis&&(n=this._getHeaderByIndex(t.index,t.level,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader))),a=[this.createSubId("context"),this._getHeaderAndParentIds(i,n)].join(" ");var m=i.getAttribute(this.getResources().getMappedAttribute("sortDir"));if("ascending"===m?o="accessibleSortAscending":"descending"===m?o="accessibleSortDescending":this._getAttribute(i,"sortable")&&(o="accessibleSortable"),null!=o&&h.push({key:o,args:{id:""}}),d&&d.metadata){"expanded"===d.metadata.expanded?h.push({key:"accessibleExpanded",args:{}}):"collapsed"===d.metadata.expanded&&h.push({key:"accessibleCollapsed",args:{}});const t=d.metadata.treeDepth;if(null!=t){let i,s,n,o,r;"row"===e.axis?(i=this.m_stopRowHeaderFetch&&this.m_stopRowEndHeaderFetch&&this.m_stopRowFetch,s=this.m_endRowHeader,n=this.m_startRowHeader):"column"===e.axis&&(s=this.m_endColHeader,n=this.m_startColHeader,i=this.m_stopColumnHeaderFetch&&this.m_stopColumnEndHeaderFetch&&this.m_stopColumnFetch),h.push({key:"accessibleLevelHierarchicalContext",args:{level:t+1}});let l="";const a=[...this.m_root.querySelectorAll(".oj-datagrid-"+e.axis+"-header-cell")];if(t>0){let h,d;a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")],n=s.metadata;n.treeDepth<t&&s.index>e.index&&(!d||s.index<d)&&(d=s.index),n.treeDepth===t-1&&s.index<e.index&&(!h||s.index>h)&&(h=s.index)}),null!=h&&null!=d?l="Full":null!=h&&null==d?(d=s+1,l=i?"Full":"Partial"):null==h&&null!=d?(h=n-1,l="Unknown"):(h=n-1,d=s+1,l="Unknown"),o=0,r=0,a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")];s.metadata.treeDepth===t&&(s.index<=e.index&&s.index>h&&(r+=1),s.index>h&&s.index<d&&(o+=1))})}else{o=0,r=1;l=0===this.m_startRowHeader?i?"Full":"Partial":"Unknown",a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")];s.metadata.treeDepth===t&&(o+=1,s.index<e.index&&(r+=1))})}const d=this._getHierarchicalTranslationKey(l,e.axis);h.push({key:d,args:{posInSet:r,setSize:o}})}}0!==h.length&&(a=a+" "+this.createSubId("state")),i.setAttribute("tabIndex",0)}else if("label"===e.type)a=[this.createSubId("context"),this._getActiveElement().id].join(" ");else if("empty"===e.type)a=this._getActiveElement().id;else{null!=t&&("header"===t.type?(r="row"===t.axis?t.index:null,l="column"===t.axis?t.index:null):"cell"===t.type&&(r=t.indexes.row,l=t.indexes.column));var c=this._getHeaderLabelledBy("row",this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader,this.m_endRowHeader,e.indexes.row,r,i),_=this._getHeaderLabelledBy("rowEnd",this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader,this.m_endRowEndHeader,e.indexes.row,r,i),p=this._getHeaderLabelledBy("column",this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader,this.m_endColHeader,e.indexes.column,l,i),g=this._getHeaderLabelledBy("columnEnd",this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader,this.m_endColEndHeader,e.indexes.column,l,i),C=e.extents.row,f=e.extents.column;C>1&&h.push({key:"accessibleRowSpanContext",args:{extent:C}}),f>1&&h.push({key:"accessibleColumnSpanContext",args:{extent:f}}),a=(a=s?[c,_,p,g,i.id].join(" "):[this.createSubId("context"),c,_,p,g,i.id,this.createSubId("state")].join(" ")).replace(/ +(?= )/g,"")}!0===this.m_externalFocus&&(null!=this.m_root.id&&(a=[this.m_root.id,a].join(" ")),a=[this.createSubId("summary"),a].join(" "),this.m_externalFocus=!1);let y=u.getActionableElementsInNode(i);return y&&y.length>0&&h.push({key:"accessibleContainsControls"}),this._updateStateInfo(h),a},z.prototype._getHierarchicalTranslationKey=function(e,t){return"accessible"+(t.charAt(0).toUpperCase()+t.slice(1))+"Hierarchical"+e},z.prototype.getHeaderFromCell=function(e,t,i){var s,n,o;return"row"===t?null!=this.m_rowHeader&&(s=this._getIndex(e,"row"),n=this._getExtent(e,"row"),o=this.m_rowHeaderLevelCount-1):"column"===t?null!=this.m_colHeader&&(s=this._getIndex(e,"column"),n=this._getExtent(e,"column"),o=this.m_columnHeaderLevelCount-1):"rowEnd"===t?null!=this.m_rowEndHeader&&(s=this._getIndex(e,"row"),n=this._getExtent(e,"row"),o=this.m_rowEndHeaderLevelCount-1):"columnEnd"===t&&null!=this.m_colEndHeader&&(s=this._getIndex(e,"column"),n=this._getExtent(e,"column"),o=this.m_columnEndHeaderLevelCount-1),null!=s&&null!=o&&s>-1?(i&&(s+=n-1),this._getHeaderCellByIndex(s,t,o)):null},z.prototype._trimRangeForSelectionMode=function(e){return"row"===this.m_options.getSelectionMode()?this.createRange(this.createIndex(e.startIndex.row),this.createIndex(e.endIndex.row)):e},z.prototype.createRange=function(e,t,i,s){var n,o,r,l,a,h,d,m;return t&&(e.row<t.row||-1===t.row?(n=e.row,o=t.row,i&&(a=i.row,h=s.row)):(n=t.row,o=e.row,i&&(a=s.row,h=i.row)),isNaN(e.column)||isNaN(t.column)?(e={row:n},t={row:o},i&&(i={row:a,column:d},s={row:h,column:m})):(e.column<t.column||-1===t.column?(r=e.column,l=t.column,i&&(d=i.column,m=s.column)):(r=t.column,l=e.column,i&&(d=s.column,m=i.column)),e={row:n,column:r},t={row:o,column:l},i&&(i={row:a,column:d},s={row:h,column:m}))),i?{startIndex:e,endIndex:t,startKey:i,endKey:s}:{startIndex:e,endIndex:t}},z.prototype._createRangeWithKeys=function(e,t,i){this._keys(e,this._createRangeStartKeyCallback.bind(this,t,i))},z.prototype._createRangeStartKeyCallback=function(e,t,i,s){null!=e&&null!=s&&e.row===s.row&&e.column===s.column?this._createRangeEndKeyCallback(i,s,t,i,s):e?this._keys(e,this._createRangeEndKeyCallback.bind(this,i,s,t)):t.call(this,{startIndex:s,endIndex:s,startKey:i,endKey:i})},z.prototype._createRangeEndKeyCallback=function(e,t,i,s,n){i.call(this,this.createRange(t,n,e,s))},z.prototype.getEndIndex=function(e){return null==e.endIndex?e.startIndex:e.endIndex},z.prototype.getElementsInRange=function(e,t,i,s,n){var o,r,l,a,h;null==t&&(t=this.m_startRow),null==i&&(i=this.m_endRow+1);var d=e.startIndex,m=this.getEndIndex(e),c=d.row,u=m.row;if(-1===u&&(u=Number.MAX_VALUE),i<c||u<t)return null;if(!isNaN(d.column)&&!isNaN(m.column)&&(o=d.column,-1===(r=m.column)&&(r=Number.MAX_VALUE),this.m_endCol+1<o||r<this.m_startCol))return null;var _=[];if(null==this.m_databody.firstChild)return null;if(c=Math.max(this.m_startRow,c),u=Math.min(this.m_endRow,u),isNaN(o)||isNaN(r))for(o=Math.max(0,this.m_startCol),r=Math.max(o,this.m_endCol),l=c;l<=u;l+=1)for(a=o;a<=r;a+=1)null!=(h=this._getCellByIndex(this.createIndex(l,a)))&&-1===_.indexOf(h)&&_.push(h);else for(o=Math.max(this.m_startCol,o),r=Math.min(this.m_endCol,r),l=c;l<=u;l+=1)for(a=o;a<=r;a+=1)null!=(h=this._getCellByIndex(this.createIndex(l,a)))&&-1===_.indexOf(h)&&_.push(h);return _},z.prototype._getRangeInView=function(e){let t=e.startIndex,i=this.getEndIndex(e),s=t.row,n=i.row,o=t.column,r=i.column;return-1===n&&(n=Number.MAX_VALUE),-1===r&&(r=Number.MAX_VALUE),s=Math.max(this.m_startRow,s),n=Math.min(this.m_endRow,n),(isNaN(t.column)||isNaN(i.column))&&(o=Math.max(0,this.m_startCol),r=Math.max(o,this.m_endCol)),o=Math.max(this.m_startCol,o),r=Math.min(this.m_endCol,r),this.createRange(this.createIndex(s,o),this.createIndex(n,r))},z.prototype._applyBorderClassesAroundRange=function(e,t,i,s){if(null==this.m_databody.firstChild||null==e||0===e.length)return;let n=this._getRangeInView(t),o=n.startIndex.row,r=n.startIndex.column,l=n.endIndex.row,a=n.endIndex.column,h=0===o,d=0===r,m=h?0:o-1,c=l,u=d?0:r-1,_=a;for(let e=o;e<=l;e++){let t=this._getCellByIndex(this.createIndex(e,u)),n=this._getCellByIndex(this.createIndex(e,_)),o=(d?"start":"end")+s,r="end"+s;i?(this._highlightElement(t,[o]),this._highlightElement(n,[r])):(this._unhighlightElement(t,[o]),this._unhighlightElement(n,[r]))}for(let e=r;e<=a;e++){let t=this._getCellByIndex(this.createIndex(m,e)),n=this._getCellByIndex(this.createIndex(c,e)),o=(h?"top":"bottom")+s,r="bottom"+s;i?(this._highlightElement(t,[o]),this._highlightElement(n,[r])):(this._unhighlightElement(t,[o]),this._unhighlightElement(n,[r]))}},z.prototype.readCurrentContent=function(){var e,t;if(null==this.m_active)return!1;if("header"===this.m_active.type)e={},"row"===this.m_active.axis?(this.m_rowHeaderLevelCount>1&&(e.level=this.m_active.level),e.rowHeader=this.m_active.index):(this.m_columnHeaderLevelCount>1&&(e.level=this.m_active.level),e.columnHeader=this.m_active.index),t=this._getActiveElement();else if("cell"===this.m_active.type){if(e=this.m_active.indexes,this._isSelectionEnabled()&&this.isMultipleSelection()&&null!=this.m_selectionFrontier&&(e=this.m_selectionFrontier),null==e)return!1;var i=this.createRange(e),s=this.getElementsInRange(i);if(null==s||0===s.length)return!1;t=s[0]}else t=this._getActiveElement();this._updateActiveContext(this.m_active,this.m_prevActive),this.m_placeHolder.tabIndex=-1;var n=t.getAttribute("aria-labelledby");return this.m_placeHolder.setAttribute("aria-labelledby",n+" "+t.id),this.m_placeHolder===document.activeElement?t.focus():this.m_placeHolder.focus(),!0},z.prototype._enterActionableMode=function(e,t){return this._setFocusToFirstFocusableElement(e,t)&&(this.m_focusOutHandler(e),this.setActionableMode(!0)),!1},z.prototype._exitActionableMode=function(){if(this.isActionableMode()){var e=this._getActiveElement();this.setActionableMode(!1),u.disableAllFocusableElements(e),this.m_focusInHandler(e)}},z.prototype._reRenderCell=function(e,t,i,s){var n=this.getRendererOrTemplate("cell"),o=e[this.getResources().getMappedAttribute("context")],r=e[this.getResources().getMappedAttribute("metadata")];if(o.mode=t,this.m_utils.empty(e),this.m_utils.containsCSSClassName(e,i)?this.m_utils.removeCSSClassName(e,i):this.m_utils.addCSSClassName(e,i),s){for(;s.hasChildNodes();)e.appendChild(s.firstChild);this._destroyEditableClone()}else this._renderContent(n,o,e,o.data,this.buildCellTemplateContext(o,r))},z.prototype._resetEditableClone=function(){if(this._isGridEditable()&&this.m_active&&"cell"===this.m_active.type){let e=this._getActiveElement();e&&this._setEditableClone(e)}},z.prototype._setEditableClone=function(e){if(this._destroyEditableClone(),null!=e){var t=e.cloneNode(!1);t.removeAttribute("id"),this._createUniqueId(t),t[this.getResources().getMappedAttribute("context")]=e[this.getResources().getMappedAttribute("context")],t[this.getResources().getMappedAttribute("metadata")]=e[this.getResources().getMappedAttribute("metadata")],t[this.getResources().getMappedAttribute("context")].parentElement=t,this.m_root.appendChild(t),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),null),t.style.display="none",t[this.getResources().getMappedAttribute("context")].parentElement=e,this.m_editableClone=t}},z.prototype._destroyEditableClone=function(){this.m_editableClone&&(null!=this.m_editableClone.parentNode?this._remove(this.m_editableClone):this._cleanTemplateNodes(this.m_editableClone),delete this.m_editableClone)},z.prototype.isArrowKey=function(e){return e===this.keyCodes.UP_KEY||e===this.keyCodes.DOWN_KEY||e===this.keyCodes.LEFT_KEY||e===this.keyCodes.RIGHT_KEY},z.prototype.createIndex=function(e,t){var i={};return void 0!==e&&(i.row=e),void 0!==t&&(i.column=t),i},z.prototype.checkCorners=function(e,t,i){return"column"===this.m_selectionFrontier.axis&&this.m_columnHeaderLevelCount!==this.m_selectionFrontier.level||"row"===this.m_selectionFrontier.axis&&this.m_rowHeaderLevelCount!==this.m_selectionFrontier.level||"rowEnd"===this.m_selectionFrontier.axis&&this.m_rowEndHeaderLevelCount!==this.m_selectionFrontier.level||"columnEnd"===this.m_selectionFrontier.axis&&this.m_columnEndHeaderLevelCount!==this.m_selectionFrontier.level||(-1!==e.indexOf("row")?t===i.startIndex.row&&this.m_selectionFrontier.end===i.endIndex.row||t===i.endIndex.row&&this.m_selectionFrontier.end===i.startIndex.row:-1!==e.indexOf("column")&&(t===i.startIndex.column&&this.m_selectionFrontier.end===i.endIndex.column||t===i.endIndex.column&&this.m_selectionFrontier.end===i.startIndex.column))},z.prototype.handleLabelFocusChange=function(e,t,i,s){var n,o,r,l;if(!this.isFetchComplete())return!0;this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY));var a=this.m_active.axis,h=this.m_active.level;switch("column"===a?(r=this.m_startColHeader,l=this.m_columnHeaderLevelCount):"row"===a&&(r=this.m_startRowHeader,l=this.m_rowHeaderLevelCount),"columnEnd"===a&&(e===this.keyCodes.DOWN_KEY?e=this.keyCodes.UP_KEY:e===this.keyCodes.UP_KEY&&(e=this.keyCodes.DOWN_KEY),r=this.m_startColEndHeader,l=this.m_columnEndHeaderLevelCount),"rowEnd"===a&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY),r=this.m_startRowEndHeader,l=this.m_rowEndHeaderLevelCount),e){case this.keyCodes.DOWN_KEY:"row"!==a&&"rowEnd"!==a||(n=this._getHeaderCellByIndex(r,a,h),this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:r,level:h,axis:a},t)),"column"!==a&&"columnEnd"!==a||((n=this.m_headerLabels[a][h+1])?this._setActive(n,{type:"label",level:h+1,axis:a},t):"column"===a&&h===l-1&&this.m_headerLabels.row.length?(n=this.m_headerLabels.row[this.m_headerLabels.row.length-1],this._setActive(n,{type:"label",level:this.m_headerLabels.row.length-1,axis:"row"},t)):h===l-1&&(o="column"===a?this.m_startRowHeader:this.m_endRowHeader,n=this._getHeaderByIndex(o,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),n&&this._setActive(n,{type:"header",index:o,level:h,axis:"row"},t)));break;case this.keyCodes.UP_KEY:"row"===a&&h===l-1&&this.m_headerLabels.column.length&&(n=this.m_headerLabels.column[this.m_headerLabels.column.length-1],this._setActive(n,{type:"label",level:this.m_headerLabels.column.length-1,axis:"column"},t)),"column"!==a&&"columnEnd"!==a||(n=this.m_headerLabels[a][h-1])&&this._setActive(n,{type:"label",level:h-1,axis:a},t);break;case this.keyCodes.RIGHT_KEY:"row"!==a&&"rowEnd"!==a||((n=this.m_headerLabels[a][h+1])?this._setActive(n,{type:"label",level:h+1,axis:a},t):h===l-1&&(o="row"===a?this.m_startColHeader:this.m_endColHeader,(n=this._getHeaderCellByIndex(o,"column",this.m_columnHeaderLevelCount))&&(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:o,level:h,axis:"column"},t)))),"column"!==a&&"columnEnd"!==a||(n=this._getHeaderCellByIndex(r,a,h),this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:r,level:h,axis:a},t));break;case this.keyCodes.LEFT_KEY:"row"!==a&&"rowEnd"!==a||(n=this.m_headerLabels[a][h-1])&&this._setActive(n,{type:"label",level:h-1,axis:a},t)}return!0},z.prototype.handleHeaderFocusChange=function(e,t,i,s,n){var o,r,l,a,h,d,m;let c,u=this._getEmptyElement();this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY));var _=this.m_active.axis,p=this.m_active.index,g=this.m_active.level,C=this._getActiveElement(),f=null!=C?this._getAttribute(C,"depth",!0):1;if(_||p||!this.m_active||(_=this.m_selectionFrontier.axis,p=this.m_active.indexes[_]),t.shiftKey&&!i&&this.m_selectionFrontier&&this.isMultipleSelection()&&(i=this.checkHeaderToDatabody(_,e)),!(i&&this.isArrowKey(e)&&this.isHeaderSelectionType(this.m_selectionFrontier)&&this.checkCorners(_,p,this.m_selection[this.m_selection.length-1]))||(_=this.m_selectionFrontier.axis,p=this.m_selectionFrontier.index,g=this.m_selectionFrontier.level,-1===p&&(p=this.m_active.indexes[_]),"cell"!==this.m_active.type||(e!==this.keyCodes.LEFT_KEY&&e!==this.keyCodes.RIGHT_KEY||-1===_.indexOf("row"))&&(e!==this.keyCodes.UP_KEY&&e!==this.keyCodes.DOWN_KEY||-1===_.indexOf("column")))){if("column"===_?(h=this.m_endColHeader,d=this.m_columnHeaderLevelCount,m=this.m_stopColumnHeaderFetch,c=this.m_startColHeader):"row"===_&&(h=this.m_endRowHeader,d=this.m_rowHeaderLevelCount,m=this.m_stopRowHeaderFetch,c=this.m_startRowHeader),"columnEnd"===_&&(e===this.keyCodes.DOWN_KEY?e=this.keyCodes.UP_KEY:e===this.keyCodes.UP_KEY&&(e=this.keyCodes.DOWN_KEY),h=this.m_endColEndHeader,d=this.m_columnEndHeaderLevelCount,m=this.m_stopColumnEndHeaderFetch,c=this.m_startColEndHeader),"rowEnd"===_&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY),h=this.m_endRowEndHeader,d=this.m_rowEndHeaderLevelCount,m=this.m_stopRowEndHeaderFetch,c=this.m_startRowEndHeader),!this.isFetchComplete())return this.m_skeletonSet.size>0&&!i&&(l=1===d||g===d-1?p+1:null!=C?this._getAttribute(C.parentNode,"start",!0)+this._getAttribute(C.parentNode,"extent",!0):p+1,(e===this.keyCodes.RIGHT_KEY&&l===this.m_endCol+1||e===this.keyCodes.DOWN_KEY&&l===this.m_endRow+1)&&this._scrollSkeletonHeadersIntoViewport(l-1,_,g,!0)),!0;i&&this.isArrowKey(e)&&this.isHeaderSelectionType(this.m_selectionFrontier)&&(f=null!=(C=this._getHeaderCellByIndex(p,_,g))?this._getAttribute(C,"depth",!0):1);var y=this._isSelectionEnabled()?this.selectAndFocus.bind(this):this._setActiveByIndex.bind(this);switch(e){case this.keyCodes.LEFT_KEY:if("column"===_||"columnEnd"===_)if(p>0){if(s&&this.m_headerLabels[_][g]){this._setActive(this.m_headerLabels[_][g],{type:"label",level:g,axis:_},t);break}if("column"===_&&s&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]){this._setActive(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],{type:"label",level:this.m_rowHeaderLevelCount-1,axis:"row"},t);break}if(1===d)l=p-1,r=null!=C?C.previousSibling:null,null===C.previousSibling&&this._hasFrozenColumns()&&(r=this._getHeaderCellByIndex(p-1,_,g)),a=g;else if(l=null!=(r=this._getHeaderCellByIndex(p-1,_,g))?this._getAttribute(r.parentNode,"start",!0):p-1,a=null!=r?this.getHeaderCellLevel(r):g,l<0)break;i?this.extendSelectionHeader(r,t,!0):l<c?this._scrollSkeletonHeadersIntoViewport(p,_,g,!1):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"row"!==this.m_options.getSelectionMode()&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:_},t),this._highlightActive())}else this.m_headerLabels[_][g]?this._setActive(this.m_headerLabels[_][g],{type:"label",level:g,axis:_},t):"column"===_&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],{type:"label",level:this.m_rowHeaderLevelCount-1,axis:"row"},t);else("row"===_||"rowEnd"===_)&&g>0&&(r=this._getHeaderCellByIndex(p,_,g-1),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:_},t),this._highlightActive()));break;case this.keyCodes.RIGHT_KEY:if("rowEnd"===_&&s&&-1!==this.m_endRowHeader)r=this._getHeaderCellByIndex(p,_,this.m_rowHeaderLevelCount),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:p,level:this.m_rowHeaderLevelCount,axis:_},t),this._highlightActive());else if("row"===_&&s&&-1!==this.m_endRowEndHeader)r=this._getHeaderByIndex(p,this.m_rowEndHeaderLevelCount,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:p,level:this.m_rowEndHeaderLevelCount,axis:_},t),this._highlightActive());else if("row"===_||"rowEnd"===_)if(g+f>=d&&!i)if(this.m_trueIndex={row:p},n){if("row"===_){let e=this._getEmptyCellNeighborIndex({row:p,column:-1},{right:!0},this._getMaxRight(),this.m_endRowEndHeader);if(e)if(e.cell)y(e.cell,t);else if(e.header){let e=this._getHeaderCellByIndex(this.m_trueIndex.row,"rowEnd",this.m_rowEndHeaderLevelCount-1);this._setActive(e,{type:"header",index:p,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t,!0)}}else if("rowEnd"===_){let e=this._getEmptyCellNeighborIndex({row:p,column:this.m_endCol+1},{left:!0},this._getMaxLeft(),this.m_startRowHeader);if(e.cell)y(e.cell,t);else if(e.header){let e=this._getHeaderCellByIndex(this.m_trueIndex.row,"row",this.m_rowHeaderLevelCount-1);this._setActive(e,{type:"header",index:p,level:this.m_rowHeaderLevelCount-1,axis:"row"},t,!0)}}}else if(u)this._setActive(u,{type:"empty"},t,!0);else if(o="row"===_?this.createIndex(p,0):this._isHighWatermarkScrolling()?this.createIndex(p,this.m_endCol):this.createIndex(p,this.getDataSource().getCount("column")-1),this._isSelectionEnabled())this.selectAndFocus(o,t);else{let e=this._getCellByIndex(o).classList.contains(this.getMappedStyle("frozenCell"));this._setActiveByIndex(o,t,null,null,e),this._highlightActive()}else r=this._getHeaderCellByIndex(p,_,g+f),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:_},t),this._highlightActive());else"column"===_&&s&&this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1]?this._setActive(this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t):(1===d?(l=p+1,r=null!=C?C.nextSibling:null,null===C.nextSibling&&this._hasFrozenColumns()&&(r=this._getHeaderCellByIndex(l,_,g)),a=g):(l=g===d-1?p+1:null!=C?this._getAttribute(C.parentNode,"start",!0)+this._getAttribute(C.parentNode,"extent",!0):p+1,a=null!=(r=this._getHeaderCellByIndex(l,_,g))?this.getHeaderCellLevel(r):g),l>h&&m||!(this._isCountUnknown("column")||l<this.getDataSource().getCount("column"))?"column"===_&&this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t):i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"row"!==this.m_options.getSelectionMode()&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:_},t),this._highlightActive()));break;case this.keyCodes.UP_KEY:if("row"===_||"rowEnd"===_){if(s&&this.m_headerLabels[_][g]){this._setActive(this.m_headerLabels[_][g],{type:"label",level:g,axis:_},t);break}if("row"===_&&s&&this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]){this._setActive(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],{type:"label",level:this.m_columnHeaderLevelCount-1,axis:"column"},t);break}if(p>0){if(1===d)l=p-1,r=null!=C?C.previousSibling:null,null===C.previousSibling&&this._hasFrozenRows()&&(r=this._getHeaderCellByIndex(l,_,g)),a=g;else if(g===d-1?(l=p-1,r=this._getHeaderCellByIndex(l,_,g)):l=null!=(r=null!==C?this._getHeaderCellByIndex(this._getAttribute(C.parentNode,"start",!0)-1,_,g):null)?this._getAttribute(r.parentNode,"start",!0):p-1,a=null!=r?this.getHeaderCellLevel(r):g,l<0)break;i?this.extendSelectionHeader(r,t,!0):l<c?this._scrollSkeletonHeadersIntoViewport(p,_,g,!1):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(r,{type:"header",index:l,level:a,axis:_},t),this._highlightActive())}else this.m_headerLabels[_][g]?this._setActive(this.m_headerLabels[_][g],{type:"label",level:g,axis:_},t):"row"===_&&this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],{type:"label",level:this.m_columnHeaderLevelCount-1,axis:"column"},t)}else("column"===_||"columnEnd"===_)&&g>0&&(r=this._getHeaderCellByIndex(p,_,g-1),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(r,{type:"header",index:l,level:a,axis:_},t),this._highlightActive()));break;case this.keyCodes.DOWN_KEY:if("columnEnd"===_&&s&&-1!==this.m_endColHeader)r=this._getHeaderByIndex(p,this.m_columnHeaderLevelCount,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(r,{type:"header",index:p,level:this.m_columnHeaderLevelCount,axis:_},t),this._highlightActive());else if("column"===_&&s&&-1!==this.m_endColEndHeader)r=this._getHeaderByIndex(p,this.m_columnEndHeaderLevelCount,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:p,level:this.m_columnEndHeaderLevelCount,axis:_},t),this._highlightActive());else if("column"===_||"columnEnd"===_)if(g+f>=d&&!i)if(this.m_trueIndex={column:p},n){if("column"===_){let e=this._getEmptyCellNeighborIndex({row:0,column:this.m_trueIndex.column},{down:!0},this._getMaxBottom(),this.m_endColEndHeader);if(e)if(e.cell)y(e.cell,t);else if(e.header){let e=this._getHeaderCellByIndex(this.m_trueIndex.column,"columnEnd",this.m_columnEndHeaderLevelCount-1);this._setActive(e,{type:"header",index:p,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t,!0)}}else if("columnEnd"===_){let e=this._getEmptyCellNeighborIndex({row:this.m_endRow+1,column:this.m_trueIndex.column},{up:!0},this._getMaxTop(),this.m_startColHeader);if(e)if(e.cell)y(e.cell,t);else if(e.header){let e=this._getHeaderCellByIndex(this.m_trueIndex.column,"column",this.m_columnHeaderLevelCount-1);this._setActive(e,{type:"header",index:p,level:this.m_columnHeaderLevelCount-1,axis:"column"},t,!0)}}}else u?this._setActive(u,{type:"empty"},t,!0):(o="column"===_?this.createIndex(0,p):this._isHighWatermarkScrolling()?this.createIndex(this.m_endRow,p):this.createIndex(this.getDataSource().getCount("row")-1,p),this._isSelectionEnabled()?this.selectAndFocus(o,t):(this._setActiveByIndex(o,t),this._highlightActive()));else r=this._getHeaderCellByIndex(p,_,g+f),l=this._getAttribute(r.parentNode,"start",!0),a=this.getHeaderCellLevel(r),i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:_},t),this._highlightActive());else"row"===_&&s&&this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1]?this._setActive(this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1],{type:"label",level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t):(1===d?(l=p+1,r=null!=C?C.nextSibling:null,null===C.nextSibling&&(r=this._getHeaderCellByIndex(l,_,g)),a=g):(l=g===d-1?p+1:null!=C?this._getAttribute(C.parentNode,"start",!0)+this._getAttribute(C.parentNode,"extent",!0):p+1,a=null!=(r=this._getHeaderCellByIndex(l,_,g))?this.getHeaderCellLevel(r):g),l>h&&m||!(this._isCountUnknown("row")||l<this.getDataSource().getCount("row"))?"row"===_&&this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.columnEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t):i?this.extendSelectionHeader(r,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(r,{type:"header",index:l,level:a,axis:_},t),this._highlightActive()));break;case this.keyCodes.PAGEUP_KEY:"row"!==_&&"rowEnd"!==_||(C=this._getHeaderCellByIndex(0,_,g),this._setActive(C,{type:"header",index:0,level:g,axis:_},t));break;case this.keyCodes.PAGEDOWN_KEY:"row"!==_&&"rowEnd"!==_||(p=this._isCountUnknown("row")||this._isHighWatermarkScrolling()?Math.max(0,h):Math.max(0,this.getDataSource().getCount("row")-1),C=this._getHeaderCellByIndex(p,_,g),this._setActive(C,{type:"header",index:p,level:g,axis:_},t));break;case this.keyCodes.HOME_KEY:"column"!==_&&"columnEnd"!==_||(C=this._getHeaderCellByIndex(0,_,g),this._setActive(C,{type:"header",index:0,level:g,axis:_},t));break;case this.keyCodes.END_KEY:"column"!==_&&"columnEnd"!==_||(p=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?Math.max(0,h):Math.max(0,this.getDataSource().getCount("column")-1),C=this._getHeaderCellByIndex(p,_,g),this._setActive(C,{type:"header",index:p,level:g,axis:_},t))}return!0}},z.prototype.checkHeaderToDatabody=function(e,t){return!("row"===e&&this.m_rowHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.RIGHT_KEY||"rowEnd"===e&&this.m_rowEndHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.LEFT_KEY||"column"===e&&this.m_columnHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.DOWN_KEY||"columnEnd"===e&&this.m_columnEndHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.UP_KEY)},z.prototype._getHeaderLabelledBy=function(e,t,i,s,n,o,r,l){var a;if(-1!==n&&(o!==r||this.m_externalFocus)){var h=this.getHeaderFromCell(l,e);return null!=r&&(a=this._getHeaderByIndex(r,i-1,t,i,s)),this._getHeaderAndParentIds(h,a)}return""},z.prototype._getHeaderAndParentIds=function(e,t){var i="",s=[];if(null==e)return"";var n=this._getHeaderAndParents(e);null!=t&&(s=this._getHeaderAndParents(t));for(var o=0;o<n.length;o++)s[o]===n[o]&&o!==n.length-1||(i+=(""===i?"":" ")+n[o].id);return i},z.prototype._getHeaderAndParents=function(e){var t,i=[e],s=this.getHeaderCellAxis(e),n=this.getHeaderCellLevel(e),o=this._getLabel(s,n);if("row"===s?t=this.m_rowHeaderLevelCount:"column"===s?t=this.m_columnHeaderLevelCount:"rowEnd"===s?t=this.m_rowEndHeaderLevelCount:"columnEnd"===s&&(t=this.m_columnEndHeaderLevelCount),o&&i.unshift(o),1===t)return i;for(n===t-1&&(e=e.parentNode.firstChild,i.unshift(e),n-=1,(o=this._getLabel(s,n))&&i.unshift(o));n>0;)e=e.parentNode.parentNode.firstChild,i.unshift(e),n-=1,(o=this._getLabel(s,n))&&i.unshift(o);return i},z.prototype.isHeaderSelectionType=function(e){return!(!e||!e.axis)},z.prototype._isChildEmpty=function(e){if(e){let t=e.textContent.trim();return!(e.children.length>0||t.length>0)}return!1},z.prototype._isNeighborCellEmpty=function(e,t){let i=this._getIndex(e,"row"),s=this._getIndex(e,"column");if("row"===t){let t=this._getCellByIndex({row:i,column:s-1}),n=this._getCellByIndex({row:i,column:s+1});if((this._isChildEmpty(t)||this._isChildEmpty(n))&&!this._isChildEmpty(e))return!0}else if("column"===t){let t=this._getCellByIndex({row:i-1,column:s}),n=this._getCellByIndex({row:i+1,column:s});if((this._isChildEmpty(t)||this._isChildEmpty(n))&&!this._isChildEmpty(e))return!0}return!1},z.prototype._getEmptyCellNeighborIndex=function(e,t,i,s){let n,o,r,l,a,h,d,m=e.row,c=e.column,u=Object.create({}),_=t.left||t.right,p=t.up||t.down,g=t.right||t.down,C=t.left||t.up;_?(n="row",o=c,r=m):p&&(n="column",o=m,l=c),g?(a=1,d=i):C&&(a=-1,d=i-1);let f,y=o;for(;C?y>=i:y<=i;){if(g?f=y<i:C&&(f=y>i),_?l=y===i?d:y+a:p&&(r=y===i?d:y+a),h=this._getCellByIndex({row:r,column:l}),f&&this._isNeighborCellEmpty(h,n))return u.cell=this.createIndex(r,l),u;if(y===i){let e;return g?e=(t.right?this._isLastColumn(y):this._isLastRow(y))&&-1!==s:C&&(e=0===y),e?(u.header=!0,u):(u.cell=this.createIndex(r,l),u)}y+=a}return null},z.prototype.handleNoDataFocusChange=function(e,t,i,s){let n;if(null==this.m_active)return null;switch(this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY)),e){case this.keyCodes.UP_KEY:!t&&s&&-1!==this.m_endColHeader&&(n=this._getHeaderByIndex(this.m_startColHeader,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader,!0),this._setActive(n,{type:"header",index:this.m_startColHeader,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0));break;case this.keyCodes.DOWN_KEY:-1!==this.m_endColEndHeader&&s&&(n=this._getHeaderByIndex(this.m_startColEndHeader,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader,!0),this._setActive(n,{type:"header",index:this.m_startColEndHeader,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0));break;case this.keyCodes.LEFT_KEY:!t&&s&&-1!==this.m_endRowHeader&&(n=this._getHeaderByIndex(this.m_startRowHeader,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader,!0),this._setActive(n,{type:"header",index:this.m_startRowHeader,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0));break;case this.keyCodes.RIGHT_KEY:-1!==this.m_endRowEndHeader&&s&&(n=this._getHeaderByIndex(this.m_startRowEndHeader,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader,!0),this._setActive(n,{type:"header",index:this.m_startRowEndHeader,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0))}return!0},z.prototype.handleFocusChange=function(e,t,i,s,n,o=!1,r=!1){var l,a,h,d=1,m=1;if(this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY)),!this.isFetchComplete()&&!1===this.m_fetchingForUpdate){if(this.m_skeletonSet.size>0&&!t){const t=(l=this.m_active.indexes).column,i=l.row;e===this.keyCodes.RIGHT_KEY&&t+1===this.m_endCol+1?this._scrollSkeletonCellsIntoViewport(i,t,"column",!0):e===this.keyCodes.DOWN_KEY&&i+1===this.m_endRow+1&&this._scrollSkeletonCellsIntoViewport(i,t,"row",!0)}return!0}if(t){if(l=this.m_selectionFrontier,this.isHeaderSelectionType(this.m_selectionFrontier))return void this.handleHeaderFocusChange(e,i,t,n)}else l=this.m_active.indexes;if(null!=l){var c,u,_,p,g;switch(null==this.m_trueIndex&&(this.m_trueIndex={}),c=this._isSelectionEnabled()?this.selectAndFocus.bind(this):this._setActiveByIndex.bind(this),u=l.row,_=l.column,(p=this._getCellByIndex(l))&&(d=(g=p[this.getResources().getMappedAttribute("context")]).extents.row,m=g.extents.column),e){case this.keyCodes.LEFT_KEY:if(this.m_trueIndex.row||t||(this.m_trueIndex={row:u}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{left:!0},this._getMaxLeft(),this.m_startRowHeader);s&&(s.cell?c(s.cell,i):s.header&&(h=this._getHeaderCellByIndex(this.m_trueIndex.row,"row",this.m_rowHeaderLevelCount-1),this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0)))}else _>0&&(!n||-1===this.m_endRowHeader)?"row"===this.m_options.getSelectionMode()?(a=this.createIndex(this.m_trueIndex.row,_-1),this._setActiveByIndex(a,i)):(t?(a=this.createIndex(u,_-1),this.extendSelection(a,i,e)):_-1<this.m_startCol?this._scrollSkeletonCellsIntoViewport(u,_,"column",!1):c(a=this.createIndex(this.m_trueIndex.row,_-1),i),_-1==0&&this._setAccInfoText("accessibleFirstColumn")):!t&&s&&(h=this._getHeaderCellByIndex(this.m_trueIndex.row,"row",this.m_rowHeaderLevelCount-1),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"row",h,this.m_rowHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0));break;case this.keyCodes.RIGHT_KEY:if(this.m_trueIndex.row||t||(this.m_trueIndex={row:u}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{right:!0},this._getMaxRight(),this.m_endRowEndHeader);s&&(s.cell?c(s.cell,i):s.header&&(h=this._getHeaderCellByIndex(this.m_trueIndex.row,"rowEnd",this.m_rowEndHeaderLevelCount-1),this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0)))}else this._isLastColumn(_+(m-1))||n&&-1!==this.m_endRowEndHeader?-1!==this.m_endRowEndHeader&&s?(h=this._getHeaderCellByIndex(this.m_trueIndex.row,"rowEnd",this.m_rowEndHeaderLevelCount-1),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"rowEnd",h,this.m_rowEndHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0)):t||c(l,i):"row"===this.m_options.getSelectionMode()?(a=this.createIndex(this.m_trueIndex.row,_+m),this._setActiveByIndex(a,i)):(t?(a=this.createIndex(u,_+1),this.extendSelection(a,i,e)):c(a=this.createIndex(this.m_trueIndex.row,_+m),i),this._isLastColumn(_+m)&&this._setAccInfoText("accessibleLastColumn"));break;case this.keyCodes.UP_KEY:if(this.m_trueIndex.column||t||(this.m_trueIndex={column:_}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{up:!0},this._getMaxTop(),this.m_startColHeader);s&&(s.cell?c(s.cell,i):s.header&&(h=this._getHeaderCellByIndex(this.m_trueIndex.column,"column",this.m_columnHeaderLevelCount-1),this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0)))}else u>0&&(!n||-1===this.m_endColHeader)?(t?(a=this.createIndex(u-1,_),this.extendSelection(a,i,e)):u-1<this.m_startRow?this._scrollSkeletonCellsIntoViewport(u,_,"row",!1):c(a=this.createIndex(u-1,this.m_trueIndex.column),i),u-1==0&&this._setAccInfoText("accessibleFirstRow")):!t&&s&&(h=this._getHeaderCellByIndex(this.m_trueIndex.column,"column",this.m_columnHeaderLevelCount-1),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"column",h,this.m_columnHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0));break;case this.keyCodes.DOWN_KEY:if(this.m_trueIndex.column||t||(this.m_trueIndex={column:_}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{down:!0},this._getMaxBottom(),this.m_endColEndHeader);s&&(s.cell?c(s.cell,i):s.header&&(h=this._getHeaderCellByIndex(this.m_trueIndex.column,"columnEnd",this.m_columnEndHeaderLevelCount-1),this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0)))}else this._isLastRow(u+(d-1))||n&&-1!==this.m_endColEndHeader?-1!==this.m_endColEndHeader&&s?(h=this._getHeaderCellByIndex(this.m_trueIndex.column,"columnEnd",this.m_columnEndHeaderLevelCount-1),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"columnEnd",h,this.m_columnEndHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0)):t||c(l,i):(t?(a=this.createIndex(u+1,_),this.extendSelection(a,i,e)):c(a=this.createIndex(u+d,this.m_trueIndex.column),i),this._isLastRow(u+d)&&this._setAccInfoText("accessibleLastRow"));break;case this.keyCodes.HOME_KEY:if(r)c(this.createIndex(0,0),i);else this.m_trueIndex.row||(this.m_trueIndex={row:u}),c(a=this.createIndex(this.m_trueIndex.row,0),i);break;case this.keyCodes.END_KEY:if(this.m_trueIndex.row||(this.m_trueIndex={row:u,column:_}),r){let e;e=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(Math.max(0,this.m_endRow),Math.max(0,this.m_endCol)):this.createIndex(Math.max(0,this.getDataSource().getCount("row")-1),Math.max(0,this.getDataSource().getCount("column")-1)),c(e,i)}else c(a=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(this.m_trueIndex.row,Math.max(0,this.m_endCol)):this.createIndex(this.m_trueIndex.row,Math.max(0,this.getDataSource().getCount("column")-1)),i);break;case this.keyCodes.PAGEUP_KEY:this.m_trueIndex.column||(this.m_trueIndex={column:_}),c(a=this.createIndex(0,_),i);break;case this.keyCodes.PAGEDOWN_KEY:this.m_trueIndex.column||(this.m_trueIndex={column:_}),c(a=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(Math.max(0,this.m_endRow),this.m_trueIndex.column):this.createIndex(Math.max(0,this.getDataSource().getCount("row")-1),this.m_trueIndex.column),i)}return!0}},z.prototype.scrollToIndex=function(e,t,i){var s,n,o=e.row,r=e.column;t&&(this.m_shouldFocus=!1),i&&(e.scrollToOrigin=!0);var l=this.getResources().isRTLMode()?"right":"left",a=0,h=0,d=this._getViewportTop(),m=this._getViewportBottom(),c=this._getViewportLeft(),u=this._getViewportRight();if(o<this.m_startRow||o>this.m_endRow){var _;_=o<this.m_startRow?this.m_avgRowHeight*o:this.m_avgRowHeight*(o+1)-m+d,h=this.m_currentScrollTop-_,this.m_scrollIndexAfterFetch=e,s=!0}else{n=this._getCellByIndex(e);let t=this.getMappedStyle("frozenCell");var p;null===n?(n=this._getFirstCellWithMatchingStartIndex(o,"row"),p=this.m_sizingManager.getSize("row",this._getKey(n,"row"))):p=this.getElementHeight(n);var g=this.getElementDir(n,"top");if(i||e.scrollToOrigin?h=d-g:g+p>m?h=m-(g+p):g<d&&(h=d-g),n&&n.classList.contains(t)){let e=this._getCellContainer(n);(e.classList.contains(this.getMappedStyle("databodyFrozenRow"))||e.classList.contains(this.getMappedStyle("databodyFrozenCorner")))&&(h=0)}}if(!isNaN(r)&&!0!==s)if(r<this.m_startCol||r>this.m_endCol){var C;C=r<this.m_startCol?this.m_avgColWidth*r:this.m_avgColWidth*(r+1)-u+c,a=this.m_currentScrollLeft-C,this.m_scrollIndexAfterFetch=e}else{var f;null===(n=this._getCellByIndex(e))?(n=this._getFirstCellWithMatchingStartIndex(r,"column"),f=this.m_sizingManager.getSize("column",this._getKey(n,"column"))):f=this.getElementWidth(n);var y=this.getElementDir(n,l);i||e.scrollToOrigin||y<c?a=c-y:y+f>u&&(a=u-(y+f));let t=this.getMappedStyle("frozenCell");if(n&&n.classList.contains(t)){let e=this._getCellContainer(n);(e.classList.contains(this.getMappedStyle("databodyFrozenCol"))||e.classList.contains(this.getMappedStyle("databodyFrozenCorner")))&&(a=0)}}0!==a||0!==h?(null!=(n=this._getCellByIndex(e))&&!0!==t&&!1!==this.m_shouldFocus&&(this.m_cellToFocus=n),this.scrollDelta(a,h)):null!=this.m_scrollIndexAfterFetch&&(t||!1===this.m_shouldFocus||this._setActiveByIndex(this.m_scrollIndexAfterFetch,null,!1,!1,!0))&&(this.m_scrollIndexAfterFetch=null)},z.prototype.scrollToHeader=function(e){var t,i,s,n,o,r,l,a,h,d=e.axis,m=e.index,c=e.level,u=0;"row"===d?(t=this.m_startRowHeader,i=this.m_endRowHeader,s=this.m_avgRowHeight,n=this.m_currentScrollTop,a=this._getViewportTop(),h=this._getViewportBottom()):"column"===d?(t=this.m_startColHeader,i=this.m_endColHeader,s=this.m_avgColWidth,n=this.m_currentScrollLeft,a=this._getViewportLeft(),h=this._getViewportRight()):"rowEnd"===d?(t=this.m_startRowEndHeader,i=this.m_endRowEndHeader,s=this.m_avgRowHeight,n=this.m_currentScrollTop,a=this._getViewportTop(),h=this._getViewportBottom()):"columnEnd"===d&&(t=this.m_startColEndHeader,i=this.m_endColEndHeader,s=this.m_avgColWidth,n=this.m_currentScrollLeft,a=this._getViewportLeft(),h=this._getViewportRight());var _=h-a;if(m<t||m>i?(u=n-(m<t?s*m:s*(m+1)-_),this.m_scrollHeaderAfterFetch=e):("row"===d||"rowEnd"===d?(l=this._getHeaderCellByIndex(m,d,c),o=this.getElementDir(l,"top"),r=this.getElementHeight(l)):"column"!==d&&"columnEnd"!==d||(l=this._getHeaderCellByIndex(m,d,c),o=this.getElementDir(l,this.getResources().isRTLMode()?"right":"left"),r=this.getElementWidth(l)),_>r?o+r>h?u=h-(o+r):o<a&&(u=a-o):u=a-o),l){let e=this.getMappedStyle("frozenHeader");l.classList.contains(e)&&(u=0)}0!==u?(null!=l&&!1!==this.m_shouldFocus&&(this.m_cellToFocus=l),"row"===d||"rowEnd"===d?this.scrollDelta(0,u):this.scrollDelta(u,0)):null!=this.m_scrollHeaderAfterFetch&&(this._updateActive(e,!0,!0),this.m_scrollHeaderAfterFetch=null)},z.prototype.findHeader=function(e,t,i){if(null==t&&(t=this.getMappedStyle("headercell")),null==i&&(i=this.getMappedStyle("endheadercell")),null!=t){if(this.m_utils.containsCSSClassName(e,t)||this.m_utils.containsCSSClassName(e,i))return e;if(e.parentNode)return this.findHeader(e.parentNode,t,i);if(e===this.m_root)return null}return null},z.prototype.updateRowBanding=function(){var e=this.m_options.getRowBandingInterval();if(e>0)for(var t=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getMappedStyle("banded"),s=0;s<t.length;s++){var n=t[s],o=this._getIndex(n,"row");Math.floor(o/e)%2==1?this.m_utils.containsCSSClassName(n,i)||this.m_utils.addCSSClassName(n,i):this.m_utils.containsCSSClassName(n,i)&&this.m_utils.removeCSSClassName(n,i)}},z.prototype.updateColumnBanding=function(){var e=this.m_options.getColumnBandingInterval();if(e>0)for(var t=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getMappedStyle("banded"),s=0;s<t.length;s+=1){var n=t[s],o=this._getIndex(n,"column");Math.floor(o/e)%2==1?this.m_utils.containsCSSClassName(n,i)||this.m_utils.addCSSClassName(n,i):this.m_utils.containsCSSClassName(n,i)&&this.m_utils.removeCSSClassName(n,i)}},z.prototype._removeBanding=function(){for(var e=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),t=this.getMappedStyle("banded"),i=0;i<e.length;i++)this.m_utils.containsCSSClassName(e[i],t)&&this.m_utils.removeCSSClassName(e[i],t)},z.prototype._setAccInfoText=function(e,t){var i=this.getResources().getTranslatedText(e,t);null!=i&&(this.m_accInfo.textContent=i)},z.prototype.handleExpandEvent=function(e,t){void 0===t&&this.queueModelEvent(e)?e.operation="expand":(this._setAccInfoText("accessibleRowExpanded"),this.populateAccInfo(),t&&this._runModelEventQueue())},z.prototype.handleCollapseEvent=function(e,t){void 0===t&&this.queueModelEvent(e)?e.operation="collapse":(this._setAccInfoText("accessibleRowCollapsed"),this.populateAccInfo(),t&&this._runModelEventQueue())},z.prototype._getKey=function(e,t){return null!=e&&e[this.getResources().getMappedAttribute("context")]?null!=t&&this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell"))?e[this.getResources().getMappedAttribute("context")].keys[t]:e[this.getResources().getMappedAttribute("context")].key:null},z.prototype._getActiveKey=function(e,t){if(t&&null!=this.m_prevActive){if("header"===this.m_prevActive.type&&(this.m_prevActive.axis===e||this.m_prevActive.axis===e+"End"))return this.m_prevActive.key;if("cell"===this.m_prevActive.type)return this.m_prevActive.keys[e]}else if(null!=this.m_active){if("header"===this.m_active.type&&(this.m_active.axis===e||this.m_active.axis===e+"End"))return this.m_active.key;if("cell"===this.m_active.type)return this.m_active.keys[e]}return null},z.prototype._handleCut=function(e,t){null==t&&(t=e.target);var i=this.findCellOrHeader(t);if(this._isMoveOnElementEnabled(i)){if(null!=this.m_cutCells)for(var s=0;s<this.m_cutCells.length;s++)this.m_utils.removeCSSClassName(this.m_cutCells[s],this.getMappedStyle("cut"));var n=this._getKey(i,"row");return this.m_cutCells=this._getAxisCellsByKey(n,"row"),this.m_cutRowHeader=this._findHeaderByKey(n,this.m_rowHeader,this.getMappedStyle("rowheadercell")),this.m_cutRowEndHeader=this._findHeaderByKey(n,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")),this._highlightCellsAlongAxis(n,"row","key","add",["cut"]),null!==this.m_cutRowHeader&&this.m_utils.addCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),null!==this.m_cutRowEndHeader&&this.m_utils.addCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),!0}return!1},z.prototype._handleCutCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&this.m_options.isCutEnabled()&&this.m_selection&&this.m_selection.length){this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]);let t=this.m_selection[this.m_selection.length-1];this.m_selectionRange=[t],this.m_dataTransferAction="cut";var i={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0]}};if(!this.fireEvent("cutRequest",i))return!0;this.highlightFloodFillRange(t),this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance()}return!0},z.prototype._handleCopyCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&this.m_options.isCopyEnabled()){this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]);let t=this.m_selection[this.m_selection.length-1];this.m_selectionRange=[t],this.m_dataTransferAction="copy";let i={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0]}};return!this.fireEvent("copyRequest",i)||(this.highlightFloodFillRange(t),this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance(),!0)}return!1},z.prototype._handlePaste=function(e,t){if(null==t&&(t=e.target),null!=this.m_cutCells){for(var i=0;i<this.m_cutCells.length;i++)this.m_utils.removeCSSClassName(this.m_cutCells[i],this.getMappedStyle("cut"));null!==this.m_cutRowHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),this.m_cutRowHeader=null),null!==this.m_cutRowEndHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),this.m_cutRowEndHeader=null);var s=this._getKey(this.findCellOrHeader(t),"row"),n=this._getKey(this.m_cutCells[0],"row");n!==s&&(this._isSelectionEnabled()&&this._clearSelection(e),this._isDatabodyCellActive()&&this._unhighlightActive(),this.m_moveActive=!0,this.getDataSource().move(n,s)),this.m_cutCells=null}return!0},z.prototype._handlePasteCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this.m_options.isPasteEnabled())if(this.m_selectionRange&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&1===this.m_selection.length){let t={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0],targetRange:this.m_selection[0]}};if(!this.fireEvent("pasteRequest",t))return!0;this.unhighlightFloodFillRange(this.m_selectionRange[0]),this.m_selectionRange=null,this.m_dataTransferAction=null}else if(!this.m_selectionRange){let t={event:e,ui:{action:"unknown",sourceRange:{},targetRange:this.m_selection[0]}};if(!this.fireEvent("pasteRequest",t))return!0;this.m_selectionRange=null,this.m_dataTransferAction=null}return!0},z.prototype._handleAutofill=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&this.m_options.isFloodFillEnabled()&&1===this.m_selection.length){let t="down";"keydown"===e.type&&(t="d"===e.key?"down":"end");let s=this.m_selection[0].startIndex,n=this.m_selection[0].endIndex,o=this.createRange(s,n),r=this.createRange(s,n),l=!1;if("down"===t?(o.endIndex.row=o.startIndex.row,r.startIndex.row=o.startIndex.row+1,r.startIndex.row>=o.startIndex.row&&r.startIndex.row<=r.endIndex.row&&(l=!0)):(o.endIndex.column=o.startIndex.column,r.startIndex.column=o.startIndex.column+1,r.startIndex.column>=o.startIndex.column&&r.startIndex.column<=r.endIndex.column&&(l=!0)),l){var i={event:e,ui:{action:t,sourceRange:o,targetRange:r}};if(!this.fireEvent("fillRequest",i))return!0}return this.unhighlightFloodFillRange(this.m_selection[0]),this._removeFloodFillAffordance(),this.m_selectionRange=null,this.m_dataTransferAction=null,this.m_floodFillDirection=null,!0}return!1},z.prototype._handleCancelReorder=function(e,t){if(null!=this.m_cutCells){for(var i=0;i<this.m_cutCells.length;i++)this.m_utils.removeCSSClassName(this.m_cutCells[i],this.getMappedStyle("cut"));return this.m_cutCells=null,null!==this.m_cutRowHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),this.m_cutRowHeader=null),null!==this.m_cutRowEndHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),this.m_cutRowEndHeader=null),!0}null!==this.m_dataTransferAction&&(this.unhighlightFloodFillRange(this.m_selectionRange[0]),this.m_selectionRange=null,this.m_dataTransferAction=null)},z.prototype._handleMove=function(e){if(null==this.m_moveCells){var t=e.target,i=this.findCellOrHeader(t),s=this._getKey(i,"row");this.m_originalMoveIndex=this._getIndex(i,"row"),this.m_moveIndex=this.m_originalMoveIndex,this.m_moveCells=this._getAxisCellsByIndex(this.m_moveIndex,"row"),this.m_moveRowHeader=this._findHeaderByKey(s,this.m_rowHeader,this.getMappedStyle("rowheadercell")),this.m_moveRowEndHeader=this._findHeaderByKey(s,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")),this._highlightCellsAlongAxis(this.m_moveIndex,"row","index","add",["drag"]),this.m_originalTop=this.getElementDir(this.m_moveCells[0],"top"),this.m_dropTarget=document.createElement("div"),this.m_utils.addCSSClassName(this.m_dropTarget,this.getMappedStyle("drop")),this.setElementHeight(this.m_dropTarget,this.calculateRowHeight(this.m_moveCells[0])),this.setElementDir(this.m_dropTarget,this.m_originalTop,"top"),this.m_databody.firstChild.appendChild(this.m_dropTarget),this._addHeaderDropTarget(this.m_moveRowHeader,this.m_rowHeader,!1),this._addHeaderDropTarget(this.m_moveRowEndHeader,this.m_rowEndHeader,!0)}this.m_utils.isTouchDevice()||(this.m_prevY=this.m_currentY,this.m_currentY=e.pageY);for(var n=this.m_currentY-this.m_prevY,o=this.calculateRowHeight(this.m_moveCells[0]),r=0;r<this.m_moveCells.length;r++)this.setElementDir(this.m_moveCells[r],this.getElementDir(this.m_moveCells[r],"top")+n,"top");null!==this.m_moveRowHeader&&this.setElementDir(this.m_moveRowHeader,this.getElementDir(this.m_moveRowHeader,"top")+n,"top"),null!==this.m_moveRowEndHeader&&this.setElementDir(this.m_moveRowEndHeader,this.getElementDir(this.m_moveRowEndHeader,"top")+n,"top");var l=this.m_moveIndex+1,a=this.m_moveIndex-1,h=this._getCellByIndex(this.createIndex(l,this.m_startCol)),d=this._getCellByIndex(this.createIndex(a,this.m_startCol));null!=h&&this.getElementDir(h,"top")<this.getElementDir(this.m_moveCells[0],"top")+o/2?this._moveDropRows("nextSibling",l):null!=d&&this.getElementDir(d,"top")>this.getElementDir(this.m_moveCells[0],"top")-o/2&&this._moveDropRows("previousSibling",a)},z.prototype._addHeaderDropTarget=function(e,t,i){var s;null!==e&&(null==e.style.height&&this.setElementHeight(e,this.calculateRowHeight(e)),this.m_utils.addCSSClassName(e,this.getMappedStyle("drag")),s=document.createElement("div"),this.m_utils.addCSSClassName(s,this.getMappedStyle("drop")),this.setElementHeight(s,this.calculateRowHeight(e)),this.setElementDir(s,this.m_originalTop,"top"),t.firstChild.appendChild(s),i?this.m_dropTargetEndHeader=s:this.m_dropTargetHeader=s)},z.prototype._moveDropRows=function(e,t){var i,s,n,o,r;"nextSibling"===e?(r=this._getAxisCellsByIndex(t,"row"),i=this.m_originalTop+this.calculateRowHeight(r[0]),s=this.m_originalTop):(r=this._getAxisCellsByIndex(t,"row"),s=(i=this.getElementDir(r[0],"top"))+this.calculateRowHeight(r[0])),this.setElementDir(this.m_dropTarget,i,"top");for(var l=0;l<r.length;l++)this.setElementDir(r[l],s,"top");null!==this.m_moveRowHeader&&(n=this.m_moveRowHeader.parentNode,this.setElementDir(this.m_dropTargetHeader,i,"top"),this.setElementDir(this.m_moveRowHeader[e],s,"top")),null!==this.m_moveRowEndHeader&&(o=this.m_moveRowEndHeader.parentNode,this.setElementDir(this.m_dropTargetEndHeader,i,"top"),this.setElementDir(this.m_moveRowEndHeader[e],s,"top")),this.m_originalTop=i,this._highlightCellsAlongAxis(this.m_moveIndex+1,"row","index","remove",["activedrop"]),"nextSibling"===e?(this._modifyAxisCellContextIndex("row",this.m_moveIndex,1,1),this._modifyAxisCellContextIndex("row",this.m_moveIndex+1,1,-1),this.m_moveIndex+=1,null!==this.m_moveRowHeader&&n&&n.insertBefore(this.m_moveRowHeader,this.m_moveRowHeader[e][e]),null!==this.m_moveRowEndHeader&&o&&o.insertBefore(this.m_moveRowEndHeader,this.m_moveRowEndHeader[e][e])):(this._modifyAxisCellContextIndex("row",this.m_moveIndex,1,-1),this._modifyAxisCellContextIndex("row",this.m_moveIndex-1,1,1),this.m_moveIndex-=1,null!==this.m_moveRowHeader&&n&&n.insertBefore(this.m_moveRowHeader,this.m_moveRowHeader[e]),null!==this.m_moveRowEndHeader&&o&&o.insertBefore(this.m_moveRowEndHeader,this.m_moveRowEndHeader[e])),this._refreshDatabodyMap(),this._highlightCellsAlongAxis(this.m_moveIndex+1,"row","index","add",["activedrop"])},z.prototype._isMoveEnabled=function(e){var t=this.getDataSource().getCapability("move");return"enable"===this.m_options.isMoveable("row")&&("full"===t||t===e)},z.prototype._handleMoveMouseUp=function(e,t){if(null!=this.m_moveCells){this._remove(this.m_dropTarget),null!==this.m_moveRowHeader&&this._remove(this.m_dropTargetHeader),null!==this.m_moveRowEndHeader&&this._remove(this.m_dropTargetEndHeader),null!=this.m_active&&"column"!==this.m_active.axis&&(this.m_moveActive=!0),this._isSelectionEnabled()&&this._clearSelection(e);var i=this.m_moveCells[0],s=this._getKey(i,"row");if(!0===t){var n=this.m_moveIndex+1,o=this._getKey(this._getCellByIndex(this.createIndex(n,this.m_startCol)),"row");this.getDataSource().move(s,o)}else this.getDataSource().move(s,s);this.m_moveCells=null,this.m_originalMoveIndex=null,this.m_moveIndex=null}this.m_databodyMove=!1},z.prototype._handleFloodFillMouseUp=function(e){if(this.m_floodFillRange&&this.m_floodFillRange.length){var t={event:e,ui:{action:this.m_floodFillDirection,sourceRange:this.m_selectionRange[0],targetRange:this.m_floodFillRange[0]}};if(!this.fireEvent("fillRequest",t))return!0;this.unhighlightFloodFillRange()}this.m_selectionRange=null,this.m_floodFillRange=null,this.m_floodFillDirection=null;const i=[this.m_databody,this.m_databodyFrozenCol,this.m_databodyFrozenRow,this.m_databodyFrozenCorner];for(let e=0;e<i.length;e++)i[e]&&(i[e].style.cursor="default");return this.m_cursor="default",!0},z.prototype._isMoveOnElementEnabled=function(e){return!(null==e||!this._isMoveEnabled("row")||this._getActiveKey("row")!==this._getKey(e,"row"))},z.prototype._manageMoveCursor=function(){if(!this._isDataGridProvider()){var e=this._getActiveKey("row"),t=this._getActiveKey("row",!0),i=this.getMappedStyle("draggable"),s=this.getMappedStyle("rowheadercell"),n=this.getMappedStyle("rowendheadercell");if(null!=t){this._highlightCellsAlongAxis(t,"row","key","remove",["draggable"]);var o=this._findHeaderByKey(t,this.m_rowHeader,s);this.m_utils.containsCSSClassName(o,i)&&this.m_utils.removeCSSClassName(o,i),o=this._findHeaderByKey(t,this.m_rowEndHeader,n),this.m_utils.containsCSSClassName(o,i)&&this.m_utils.removeCSSClassName(o,i)}if(null!=e){var r=this._getAxisCellsByKey(e,"row");if(this._isMoveOnElementEnabled(r[0])){this._highlightCellsAlongAxis(e,"row","key","add",["draggable"]);var l=this._findHeaderByKey(e,this.m_rowHeader,s);this.m_utils.addCSSClassName(l,i);var a=this._findHeaderByKey(e,this.m_rowEndHeader,n);this.m_utils.addCSSClassName(a,i)}}}},z.prototype.handleRootFocus=function(e,t){if(this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("focus")),this._clearFocusoutTimeout(),this._clearFocusoutBusyState(),!t){if(this._clearOpenPopupListeners(),!this.m_root.contains(document.activeElement)||document.activeElement===this.m_root&&0===this.m_root.tabIndex||document.activeElement===this.m_databody&&this.m_scrollbarFocus&&0===this.m_root.tabIndex){this.m_externalFocus=!0,this._isCellEditable()?this._setAccInfoText("accessibleEditableMode"):this._isGridEditable()&&this._setAccInfoText("accessibleNavigationMode");var i=!1;!0===this.m_scrollbarFocus&&(this.m_shouldFocus=!1,this.m_scrollbarFocus=!1,i=!0);let t=this._getEmptyElement();if(null==this.m_active&&t)this._setActive(t,{type:"empty"},e,null,null,i,!0);else if(null!=this.m_active||this._databodyEmpty())null!=this.m_active&&this._highlightActive();else{var s=this.createIndex(0,0);i||this.scrollToIndex(s),this._setActiveByIndex(s,e,null,null,i)}}this.m_root.tabIndex=-1}},z.prototype._handlePopupFocusout=function(e){this.handleRootBlur(e,!0)},z.prototype._handlePopupFocusin=function(e){this.handleRootFocus(e,!0)},z.prototype.handleRootBlur=function(e,t){if(this._clearFocusoutTimeout(),!t){this._clearOpenPopupListeners();var i=C.getLogicalChildPopup(this.m_root);if(null!=i)return this._openPopup=i,t=!1,this._handlePopupFocusinListener=this._handlePopupFocusin.bind(this),this._handlePopupFocusoutListener=this._handlePopupFocusout.bind(this),i.addEventListener("focusin",this._handlePopupFocusinListener),void i.addEventListener("focusout",this._handlePopupFocusoutListener)}this._setFocusoutBusyState(),this.m_focusoutTimeout=setTimeout(function(){if(!this.m_root.contains(document.activeElement)||!0===t){this.m_root.tabIndex=0;var i=this._getActiveElement();null!=i&&(this._unsetAriaProperties(i),this._isEditOrEnter()&&!this.m_animating&&this._leaveEditing(e,i,!1,!1))}this._clearFocusoutBusyState()}.bind(this),100),null==this.m_moveRow&&this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("focus"))},z.prototype._clearOpenPopupListeners=function(){null!=this._openPopup&&(this._openPopup.removeEventListener("focusin",this._handlePopupFocusinListener),this._openPopup.removeEventListener("focusout",this._handlePopupFocusoutListener),this._openPopup=null),this._handlePopupFocusinListener=null,this._handlePopupFocusoutListener=null},z.prototype._handlePopupFocusout=function(e){this.handleRootBlur(e,!0)},z.prototype._handlePopupFocusin=function(e){this.handleRootFocus(e,!0)},z.prototype._clearFocusoutTimeout=function(){this.m_focusoutTimeout&&(clearTimeout(this.m_focusoutTimeout),this.m_focusoutTimeout=null)},z.prototype._setFocusoutBusyState=function(){if(!this.m_focusoutResolveFunc){var e=c.getContext(this.m_root).getBusyContext(),t={description:"Datagrid component 'is handling focusout."};this.m_focusoutResolveFunc=e.addBusyState(t)}},z.prototype._clearFocusoutBusyState=function(){this.m_focusoutResolveFunc&&(this.m_focusoutResolveFunc(),this.m_focusoutResolveFunc=null)},z.prototype.calculateRowHeight=function(e){return""!==e.style.height?this.getElementHeight(e):null!=e.nextSibling?this.getElementDir(e.nextSibling,"top")-this.getElementDir(e,"top"):this.m_endRowPixel-this.getElementDir(e,"top")},z.prototype.calculateRowHeaderHeight=function(e){return""!==e.style.height?this.getElementHeight(e):null!=e.nextSibling?this.getElementDir(e.nextSibling,"top")-this.getElementDir(e,"top"):this.m_endRowHeaderPixel-this.getElementDir(e,"top")},z.prototype.calculateRowHeaderLabelHeight=function(e){return this.getElementHeight(e)},z.prototype.calculateColumnWidth=function(e){if(""!==e.style.width)return this.getElementWidth(e);var t=this.getResources().isRTLMode()?"right":"left";return null!=e.nextSibling?this.getElementDir(e.nextSibling,t)-this.getElementDir(e,t):this.m_endColPixel-this.getElementDir(e,t)},z.prototype.calculateColumnHeaderWidth=function(e){if(""!==e.style.width)return this.getElementWidth(e);var t=this.getResources().isRTLMode()?"right":"left";return null!=e.nextSibling?this.getElementDir(e.nextSibling,t)-this.getElementDir(e,t):this.m_endColHeaderPixel-this.getElementDir(e,t)},z.prototype._databodyEmpty=function(){return!(null!=this.m_databody.firstChild&&null!=this.m_databody.firstChild.firstChild||this._hasFrozenColumns()||this._hasFrozenRows())},z.prototype._databodyEmptyState=function(){return!(null!=this.m_databody.firstChild&&null!=this.m_databody.firstChild.firstChild&&!this._getEmptyElement())},z.prototype._getEmptyElement=function(){let e=this.m_databody.querySelector("."+this.getMappedStyle("noDataContainer")),t=this.m_databody.querySelector("."+this.getMappedStyle("emptytext"));return e||t},z.prototype.changeStyleProperty=function(e,t,i,s){void 0!==t&&(e.style[t]="remove"===s?"":i)},z.prototype.addTransformMoveStyle=function(e,t,i,s,n,o,r){this.changeStyleProperty(e,this.getCssSupport("transition-delay"),i),this.changeStyleProperty(e,this.getCssSupport("transition-timing-function"),s),this.changeStyleProperty(e,this.getCssSupport("transition-duration"),t),this.changeStyleProperty(e,this.getCssSupport("transform"),"translate3d("+n+"px,"+o+"px,"+r+"px)")},z.prototype.removeTransformMoveStyle=function(e){this.changeStyleProperty(e,this.getCssSupport("transition-delay"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transition-timing-function"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transition-duration"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transform"),null,"remove")},z.prototype.getCssSupport=function(e){var t=["","-moz-","-webkit-","-o-","-ms-","-khtml-"],i=document.documentElement;for(var s=0;s<t.length;s++){var n=(t[s]+e).replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()});if("Ms"===n.substr(0,2)&&(n="m"+n.substr(1)),n in i.style)return n}},z.prototype._refreshDatabodyMap=function(){this._clearDatabodyMap(),this._addNodesToDatabodyMap(this.m_databody.firstChild.childNodes),this.m_databodyFrozenCol&&this._addNodesToDatabodyMap(this.m_databodyFrozenCol.firstChild.childNodes),this.m_databodyFrozenCorner&&this._addNodesToDatabodyMap(this.m_databodyFrozenCorner.firstChild.childNodes),this.m_databodyFrozenRow&&this._addNodesToDatabodyMap(this.m_databodyFrozenRow.firstChild.childNodes)},z.prototype._populateDatabody=function(e,t){this._addNodesToDatabodyMap(t.childNodes),e.appendChild(t),this.m_subtreeAttachedCallback(e)},z.prototype._emptyDatabody=function(e){this._clearDatabodyMap(),this.m_utils.empty(e)},z.prototype._addNodesToDatabodyMap=function(e){for(var t=0;t<e.length;t++){var i=e[t];if(this.m_utils.containsCSSClassName(i,this.getMappedStyle("cell"))){var s=this.getCellIndexes(i),n=this.getCellExtents(i),o=i.id;this._addToDatabodyMap(s,o,n)}}},z.prototype._addToDatabodyMap=function(e,t,i){for(var s=i.row,n=i.column,o=0;o<s;o++)for(var r=0;r<n;r++)this._addIndexToDatabodyMap(this.createIndex(e.row+o,e.column+r),t)},z.prototype._addIndexToDatabodyMap=function(e,t){var i="r"+e.row+"c"+e.column;this.m_databodyMap.set(i,t)},z.prototype._removeIndexFromDatabodyMap=function(e){var t="r"+e.row+"c"+e.column;return this.m_databodyMap.delete(t)},z.prototype._getFromDatabodyMap=function(e){var t="r"+e.row+"c"+e.column;return this.m_databodyMap.get(t)},z.prototype._clearDatabodyMap=function(){return this.m_databodyMap.clear()},z.prototype._modifyAxisCellContextIndex=function(e,t,i,s){for(var n=t;n<t+i;n++)for(var o=this._getAxisCellsByIndex(n,e),r=0;r<o.length;r++){o[r][this.getResources().getMappedAttribute("context")].indexes[e]+=s}},z.prototype._modifyAxisHeaderContextIndex=function(e,t,i,s){for(var n=t;n<t+i;n++){var o;o="row"===e?this._getHeadersByIndex(n,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader):this._getHeadersByIndex(n,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader);for(var r=0;r<o.length;r++){o[r][this.getResources().getMappedAttribute("context")].index+=s}}},z.prototype._getCellOrHeaderByIndex=function(e,t){var i=null,s=this._getAxisCellsByIndex(e,t,!0);return null!=s&&s.length>0&&(i=s[0]),null==i&&("row"===t&&null==(i=this._getHeaderCellByIndex(e,t))&&(i=this._getHeaderCellByIndex(e,"rowEnd")),"column"===t&&null==(i=this._getHeaderCellByIndex(e,t))&&(i=this._getHeaderCellByIndex(e,"columnEnd"))),i},z.prototype._getLabel=function(e,t){return this.m_headerLabels[e][t]},z.prototype._getCellByIndex=function(e){var t=this._getFromDatabodyMap(e);let i=null;if(null!=t){let e=[this.m_databody,this.m_databodyFrozenCorner,this.m_databodyFrozenCol,this.m_databodyFrozenRow];e=e.filter(e=>e);for(let s=0;s<e.length&&(i=e[s].querySelector(`#${t}`),!i);s++);}return i},z.prototype._getCellContainer=function(e){let t=this.m_databody,i=[this.m_databodyFrozenCorner,this.m_databodyFrozenCol,this.m_databodyFrozenRow];i=i.filter(e=>e);for(let s=0;s<i.length;s++){if(i[s].querySelector(`#${e.id}`)){t=i[s];break}}return t},z.prototype._getFrozenCellByIndex=function(e,t,i){var s=this._getFromDatabodyMap(e);if(null!=s){let e;return i?e=this.m_databodyFrozenCorner.querySelector("#"+s):"row"===t?e=this.m_databodyFrozenCol.querySelector("#"+s):"column"===t&&(e=this.m_databodyFrozenRow.querySelector("#"+s)),e}return null},z.prototype._getCellsInRange=function(e,t,i,s){let n=[];for(let o=e;o<=i;o++)for(let e=t;e<=s;e++){let t=this._getCellByIndex(this.createIndex(o,e));t&&n.push(t)}return n},z.prototype._getFirstCellWithMatchingStartIndex=function(e,t){let i,s,n="row"===t?this.m_startCol:this.m_startRow,o="row"===t?this.m_endCol:this.m_endRow;for(let r=n;r<=o;r++)if(i=this.createIndex("row"===t?e:r,"row"===t?r:e),s=this._getCellByIndex(i),this._getIndex(s,t)===e)return s;return null},z.prototype._getAxisCellsByIndex=function(e,t,i){for(var s,n="row"===t?this.m_startCol:this.m_startRow,o="row"===t?this.m_endCol:this.m_endRow,r=[],l=n;l<=o;l+=s){var a=this._getCellByIndex(this.createIndex("row"===t?e:l,"row"===t?l:e));if(null!=a){if(s=this.getCellExtents(a)["row"===t?"column":"row"],r.push(a),i)break}else s=1}return r},z.prototype._getAxisCellsByKey=function(e,t,i){if(null==e||null==this.m_databody||null==this.m_databody.firstChild)return null;for(var s=[],n=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),o=0;o<n.length;o++){var r=n[o];if(this.m_utils.containsCSSClassName(r,this.getMappedStyle("cell")))if(this._getKey(r,t)===e&&(s.push(r),i))break}return s},z.prototype._setupActions=function(){this.actions={ACTIONABLE:this._handleActionable,EXIT_ACTIONABLE:this._handleExitActionable,TAB_NEXT_IN_CELL:u.handleActionableTab,TAB_PREV_IN_CELL:u.handleActionablePrevTab,EDITABLE:this._handleEditable,EXIT_EDITABLE:this._handleExitEditable,DATA_ENTRY:this._handleDataEntry,EXIT_DATA_ENTRY:this._handleExitDataEntry,EDIT:this._handleEdit,EXIT_EDIT:this._handleExitEdit,CANCEL_EDIT:this._handleCancelEdit,NO_OP:this._handleNoOp,FOCUS_LEFT:this._handleFocusLeft,FOCUS_LEFT_NON_EMPTY_CELL:this._handleFocusLeftNonEmptyCell,FOCUS_RIGHT:this._handleFocusRight,FOCUS_RIGHT_NON_EMPTY_CELL:this._handleFocusRightNonEmptyCell,FOCUS_UP:this._handleFocusUp,FOCUS_UP_NON_EMPTY_CELL:this._handleFocusUpNonEmptyCell,FOCUS_DOWN:this._handleFocusDown,FOCUS_DOWN_NON_EMPTY_CELL:this._handleFocusDownNonEmptyCell,FOCUS_ROW_FIRST:this._handleFocusRowFirst,FOCUS_ROW_LAST:this._handleFocusRowLast,FOCUS_COLUMN_FIRST:this._handleFocusColumnFirst,FOCUS_COLUMN_LAST:this._handleFocusColumnLast,FOCUS_COLUMN_HEADER:this._handleFocusColumnHeader,FOCUS_COLUMN_END_HEADER:this._handleFocusColumnEndHeader,FOCUS_ROW_HEADER:this._handleFocusRowHeader,FOCUS_ROW_END_HEADER:this._handleFocusRowEndHeader,FOCUS_FIRST_CELL_IN_GRID:this._handleFocusFirstCellInGrid,FOCUS_LAST_CELL_IN_GRID:this._handleFocusLastCellInGrid,READ_CELL:this.readCurrentContent,SORT:this._handleSortKey,EXPAND:this._handleExpandKey,COLLAPSE:this._handleCollapseKey,SELECT_DISCONTIGUOUS:this._handleSelectDiscontiguous,SELECT_EXTEND_LEFT:this._handleExtendSelectionLeft,SELECT_EXTEND_RIGHT:this._handleExtendSelectionRight,SELECT_EXTEND_UP:this._handleExtendSelectionUp,SELECT_EXTEND_DOWN:this._handleExtendSelectionDown,SELECT_ROW:this._handleSelectRow,SELECT_COLUMN:this._handleSelectColumn,SELECT_ALL:this._handleSelectAll,CUT:this._handleCut,CUT_CELLS:this._handleCutCells,COPY_CELLS:this._handleCopyCells,CANCEL_REORDER:this._handleCancelReorder,PASTE:this._handlePaste,PASTE_CELLS:this._handlePasteCells,FILL:this._handleAutofill,CANCEL_DRAG:this.handleCancelDrag}},z.prototype._getActionFromKeyDown=function(e,t,i){var s={cellOrHeader:t,isLabel:i,readOnly:!this._isCellEditable(),currentMode:this._getCurrentMode(),activeMove:null!=this.m_cutCells||null!=this.m_dataTransferAction,rowMove:this._isMoveEnabled("row"),columnSort:"column"===t&&this._isDOMElementSortable(this._getActiveElement()),rowSort:"row"===t&&this._isDOMElementSortable(this._getActiveElement()),selection:this._isSelectionEnabled(),selectionMode:this.m_options.getSelectionMode(),multipleSelection:this.isMultipleSelection(),expandCollapse:this._isTargetExpandCollapseEnabled(e.target)};return this._isDataGridProvider()&&(s.cutCells=!0,s.copyCells=!0,s.pasteCells=!0,s.activeDrag=!(!this._cellsDragged||!this._cellsDragged.length)),this.m_options.isFloodFillEnabled()&&(s.fill=!0),this.actions[this.m_keyboardHandler.getAction(e,s)]},z.prototype._getActionFromNoDataKeydown=function(e){var t={readOnly:!this._isCellEditable(),currentMode:this._getCurrentMode()};return this.actions[this.m_keyboardHandler.getNoDataAction(e,t)]},z.prototype.isActionableMode=function(){return"actionable"===this.m_currentMode},z.prototype.setActionableMode=function(e){this.m_currentMode=e?"actionable":"navigation",this._setAccInfoText(this.isActionableMode()?"accessibleActionableMode":"accessibleNavigationMode")},z.prototype._handleActionable=function(e,t){return this._enterActionableMode(t,e),!1},z.prototype._handleExitActionable=function(e,t){return this._exitActionableMode(),this._highlightActive(),!1},z.prototype._getEditMode=function(){return null==this.m_editMode&&(this.m_editMode=this.m_options.getEditMode()),this.m_editMode},z.prototype._getCurrentMode=function(){return null==this.m_currentMode&&(this.m_currentMode="navigation"),this.m_currentMode},z.prototype._isEditOrEnter=function(){return"edit"===this._getCurrentMode()},z.prototype._isGridEditable=function(){var e=this._getEditMode();return"cellNavigation"===e||"cellEdit"===e},z.prototype._isCellEditable=function(){return"cellEdit"===this._getEditMode()},z.prototype._handleEditable=function(e,t){return this._isGridEditable()?(this.m_editMode=null,this.m_setOptionCallback("editMode","cellEdit",{_context:{writeback:!0,internalSet:!0}}),this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("editable")),this._updateEdgeCellBorders(""),this._setAccInfoText("accessibleEditableMode"),this._setEditableClone(t)):this._handleActionable(e,t),!1},z.prototype._handleExitEditable=function(e,t){this.m_editMode=null,this.m_setOptionCallback("editMode","cellNavigation",{_context:{writeback:!0,internalSet:!0}}),this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("editable")),this._updateEdgeCellBorders("none"),this._setAccInfoText("accessibleNavigationMode"),this._destroyEditableClone()},z.prototype._handleDataEntry=function(e,t){var i={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")]}};return this.fireEvent("beforeEdit",i)&&(this._removeFloodFillAffordance(),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),this.m_editableClone),this._overwriteFlag=!0,this._setFocusToFirstFocusableElement(t)?this.m_currentMode="edit":this.m_utils.removeCSSClassName(t,this.getMappedStyle("cellEdit")),this._overwriteFlag=!1),!1},z.prototype._handleExitDataEntry=function(e,t){return this._leaveEditing(e,t,!1)},z.prototype._handleEdit=function(e,t){var i={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")]}},s=this.fireEvent("beforeEdit",i);if(s){this._removeFloodFillAffordance(),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),this.m_editableClone),this.m_currentMode="edit";var n=this;c.getContext(t).getBusyContext().whenReady().then(function(){n._setFocusToFirstFocusableElement(t)||(n.m_utils.removeCSSClassName(t,n.getMappedStyle("cellEdit")),n.m_currentMode="navigation")})}else s=!1,this._enterActionableMode(t);return s},z.prototype._handleExitEdit=function(e,t){return this._leaveEditing(e,t,!1)},z.prototype._handleCancelEdit=function(e,t){return!!this._leaveEditing(e,t,!0)&&(this._setEditableClone(t),!0)},z.prototype._leaveEditing=function(e,t,i,s){var n={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")],cancelEdit:i}};i||(u.disableAllFocusableElements(t),!1===s&&(this.m_shouldFocus=s),this._highlightActive());var o=this.fireEvent("beforeEditEnd",n);return o?(this.m_currentMode="navigation",u.disableAllFocusableElements(t),!1===s&&(this.m_shouldFocus=s),this._highlightActive(),this._reRenderCell(t,"navigation",this.getMappedStyle("cellEdit"),this.m_editableClone)):(o=!1,this._scrollToActive(this.m_active),this._setFocusToFirstFocusableElement(t)),o},z.prototype._handleFocusKey=function(e,t,i,s,n,o,r){var l,a=!0,h=!0;if(null!=this.m_active){if("cell"===this.m_active.type){if(this._isEditOrEnter()?(l=!0,a=this._leaveEditing(e,t,!1),h=!1):this.isActionableMode()&&this._exitActionableMode(),a){this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance();var d=this.m_active,m=this.handleFocusChange(i,s,e,h,n,o,r);return this._isGridEditable()&&d!==this.m_active&&l&&this.m_utils.isTouchDevice()?this._handleDataEntry(e,this._getActiveElement()):m}return!0}if("header"===this.m_active.type)return this.handleHeaderFocusChange(i,e,s,n,o);if("label"===this.m_active.type)return this.handleLabelFocusChange(i,e,s,n);if("empty"===this.m_active.type)return this.handleNoDataFocusChange(i,s,e,h)}return!1},z.prototype._handleFocusLeft=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!1)},z.prototype._handleFocusLeftNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!1,!0)},z.prototype._handleFocusRight=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!1)},z.prototype._handleFocusRightNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!1,!0)},z.prototype._handleFocusUp=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!1)},z.prototype._handleFocusUpNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!1,!0)},z.prototype._handleFocusDown=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!1)},z.prototype._handleFocusDownNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!1,!0)},z.prototype._handleFocusRowFirst=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.PAGEUP_KEY,!1,!1)},z.prototype._handleFocusRowLast=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.PAGEDOWN_KEY,!1,!1)},z.prototype._handleFocusColumnFirst=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.HOME_KEY,!1,!1)},z.prototype._handleFocusColumnLast=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.END_KEY,!1,!1)},z.prototype._handleFocusRowHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!0)},z.prototype._handleFocusRowEndHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!0)},z.prototype._handleFocusColumnHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!0)},z.prototype._handleFocusColumnEndHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!0)},z.prototype._handleFocusFirstCellInGrid=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.HOME_KEY,!1,!1,!1,!0)},z.prototype._handleFocusLastCellInGrid=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.END_KEY,!1,!1,!1,!0)},z.prototype._handleSelectRow=function(e,t){var i,s,n,o,r=1;if(!this._isSelectionEnabled()||!this.isMultipleSelection()&&"row"!==this.m_options.getSelectionMode())return!1;if(this.m_utils.containsCSSClassName(t,this.getMappedStyle("cell")))i=o=this.m_active.indexes.row,s=o,n=this.m_rowHeaderLevelCount-1;else{if(null==this.m_active||"header"!==this.m_active.type||-1===this.m_active.axis.indexOf("row"))return!1;if(o=this.m_active.index,n=this.m_active.level,this.m_rowHeaderLevelCount-1===n)i=o,s=o;else{var l=this._getActiveElement();s=(i=this._getAttribute(l.parentNode,"start",!0))+(r=this._getAttribute(l.parentNode,"extent",!0))-1}}if(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("column"))return this._handleSelectAll(e),!0;if(this.setHeaderSelectionFrontier("row",s,o,n,t,!0),this._shouldDeselectHeader(o,r,"row")){var a=this.createIndex(o,0),h=this.createIndex(o+r-1,-1),d=this._getSelectionStartAndEnd(a,h,0),m=this.createRange(this.createIndex(d.min.row,0),this.createIndex(d.max.row,-1)),c=this._trimRangeForSelectionMode(m);return this.m_deselectInfo={selection:this.GetSelection()},this._deselectRange(c,e),!0}return this._selectEntireRow(i,s,e),this._setAccInfoText("accessibleRowSelected",{row:o+1}),!0},z.prototype._handleSelectColumn=function(e,t){var i,s,n,o,r=1;if(!this._isSelectionEnabled()||!this.isMultipleSelection()||"cell"!==this.m_options.getSelectionMode())return!1;if(this.m_utils.containsCSSClassName(t,this.getMappedStyle("cell")))i=o=this.m_active.indexes.column,s=o,n=this.m_columnHeaderLevelCount-1;else{if(null==this.m_active||"header"!==this.m_active.type||-1===this.m_active.axis.indexOf("column"))return!1;if(o=this.m_active.index,n=this.m_active.level,this.m_columnHeaderLevelCount-1===n)i=o,s=o;else{var l=this._getActiveElement();s=(i=this._getAttribute(l.parentNode,"start",!0))+(r=this._getAttribute(l.parentNode,"extent",!0))-1}}if(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("row"))return this._handleSelectAll(e),!0;if(this.setHeaderSelectionFrontier("column",s,o,n,t,!0),this._shouldDeselectHeader(o,r,"column")){var a=this.createIndex(0,o),h=this.createIndex(-1,o+r-1),d=this._getSelectionStartAndEnd(a,h,0),m=this.createRange(this.createIndex(0,d.min.column),this.createIndex(-1,d.max.column)),c=this._trimRangeForSelectionMode(m);return this.m_deselectInfo={selection:this.GetSelection()},this._deselectRange(c,e),!0}return this._selectEntireColumn(i,s,e),this._setAccInfoText("accessibleColumnSelected",{column:o+1}),!0},z.prototype._handleSelectDiscontiguous=function(e,t){return this.setDiscontiguousSelectionMode(!this.m_discontiguousSelection),!0},z.prototype._handleExtendSelectionLeft=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!0,!1)},z.prototype._handleExtendSelectionRight=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!0,!1)},z.prototype._handleExtendSelectionUp=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!0,!1)},z.prototype._handleExtendSelectionDown=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!0,!1)},z.prototype._handleSortKey=function(e,t){return"true"===t.getAttribute(this.getResources().getMappedAttribute("sortable"))?(this._handleKeyboardSort(t,e),!0):this._handleActionable(e,t)},z.prototype._handleExpandKey=function(e,t){return!!this._isHeaderCollapsed(t)&&(this._handleExpandCollapseRequest(e),!0)},z.prototype._handleCollapseKey=function(e,t){return!!this._isHeaderExpanded(t)&&(this._handleExpandCollapseRequest(e),!0)},z.prototype._handleNoOp=function(e,t){return!1},z.RESIZE_OFFSET=5,z.RESIZE_TOUCH_OFFSET=8,z.prototype.handleResize=function(e){if(!1===this.m_isResizing){var t=this.find(e.target,"header"),i=this.find(e.target,"headerlabel");if(null==t&&(t=this.find(e.target,"endheader")),null!=t&&(t===this.m_rowHeader||t===this.m_colHeader||t===this.m_rowEndHeader||t===this.m_colEndHeader||t===this.m_colHeaderFrozen||t===this.m_colEndHeaderFrozen||t===this.m_rowHeaderFrozen||t===this.m_rowEndHeaderFrozen)||null!=i){let s=!1;i&&(s=!0),this.m_cursor=this.manageHeaderCursor(e,s),null!=this.m_resizingElement&&("default"===this.m_cursor?(this.m_resizingElement.style.cursor="",this._isSelectionEnabled()&&(t&&this.shouldHoverHeader(t)||i)&&this.m_utils.addCSSClassName(e.target,this.getMappedStyle("hover")),null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor="")):(this.m_resizingElement.style.cursor=this.m_cursor,this.m_utils.removeCSSClassName(e.target,this.getMappedStyle("hover")),null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor=this.m_cursor)))}}else this.handleResizeMouseMove(e)},z.prototype.handleResizeMouseDown=function(e){return("col-resize"===this.m_cursor||"row-resize"===this.m_cursor)&&(this.m_isResizing=!0,this.m_utils.isTouchDevice()?(this.m_lastMouseX=e.touches[0].pageX,this.m_lastMouseY=e.touches[0].pageY):(document.addEventListener("mousemove",this.m_docMouseMoveListener,!1),document.addEventListener("mouseup",this.m_docMouseUpListener,!1),this.m_lastMouseX=e.pageX,this.m_lastMouseY=e.pageY),this.m_overResizeLeft=0,this.m_overResizeMinLeft=0,this.m_overResizeTop=0,this.m_overResizeMinTop=0,this.m_overResizeRight=0,this.m_overResizeBottom=0,this.m_orginalResizeDimensions={width:this.getElementWidth(this.m_resizingElement),height:this.getElementHeight(this.m_resizingElement)},!0)},z.prototype._resizeSelectedHeaders=function(e,t,i,s,n,o){let r,l=this.m_resizingElement,a=this.getHeaderCellAxis(this.m_resizingElement),h=this.getHeaderCellIndex(this.m_resizingElement),d=this._getResizeHeaderMode(this.m_resizingElement),m=this.getHeaderCellLevel(this.m_resizingElement),c=!1;if(("column"===a&&m===this.m_columnHeaderLevelCount-1||"row"===a&&m===this.m_rowHeaderLevelCount-1||"columnEnd"===a&&m===this.m_columnEndHeaderLevelCount-1||"rowEnd"===a&&m===this.m_rowEndHeaderLevelCount-1)&&(c=!0),this.m_selection&&this.m_selection.length&&c&&!this.m_discontiguousSelection&&(r=this._getHeadersWithinSelection(this.m_selection[0],h,a)),r&&r.length)for(let a=0;a<r.length;a++)l!==r[a]&&(this.m_resizingElement=r[a],"column"===d?this.resizeColWidth(this.getElementDir(r[a],"width"),s):this.resizeRowHeight(this.getElementDir(r[a],"height"),n)),this._fireResizeEvent(e,t,i,s,n,o);else"column"===d?this.resizeColWidth(this.getElementDir(this.m_resizingElement,"width"),s):this.resizeRowHeight(this.getElementDir(this.m_resizingElement,"height"),n),this._fireResizeEvent(e,t,i,s,n,o)},z.prototype._fireResizeEvent=function(e,t,i,s,n,o){let r={event:e,ui:{header:this._getKey(this.m_resizingElement),oldDimensions:{width:t,height:i},newDimensions:{width:s,height:n},size:o}};this.fireEvent("resize",r)},z.prototype.handleResizeMouseUp=function(e){if(!0===this.m_isResizing){var t=this.getElementWidth(this.m_resizingElement),i=this.getElementHeight(this.m_resizingElement);let s=this.m_orginalResizeDimensions.width,n=this.m_orginalResizeDimensions.height,o=this.m_resizingElement,r="col-resize"===this.m_cursor?o.style.width:o.style.height;t===this.m_orginalResizeDimensions.width&&i===this.m_orginalResizeDimensions.height||"col-resize"!==this.m_cursor&&"row-resize"!==this.m_cursor||this._resizeSelectedHeaders(e,s,n,t,i,r),o.style.cursor="",this._unhighlightResizeBorderColor(),this.m_isResizing=!1,this.m_cursor="default",null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor=""),this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_resizingElementSibling=null,this.m_orginalResizeDimensions=null,document.removeEventListener("mousemove",this.m_docMouseMoveListener,!1),document.removeEventListener("mouseup",this.m_docMouseUpListener,!1)}},z.prototype._isDOMElementResizable=function(e){return null!=e&&"true"===e.getAttribute(this.getResources().getMappedAttribute("resizable"))},z.prototype.manageHeaderCursor=function(e,t){var i,s,n,o,r,l,a,h,d;if((d=t?this.find(e.target,"headerlabel"):this.find(e.target,"headercell"))||t||(d=this.find(e.target,"endheadercell")),!d)return"default";var m=t?this.getHeaderLabelAxis(d):this.getHeaderCellAxis(d),c=t?this.getHeaderLabelLevel(d):this.getHeaderCellIndex(d),u=t?c:this.getHeaderCellLevel(d);if("column"===m?(r="enable"===this.m_options.isResizable(m,"height"),o=this._isDOMElementResizable(d),t?(a=null,l=null,h=this.m_headerLabels.column[c-1]):((a=this._getHeaderCellByIndex(c-1,"column",u))||(this.m_headerLabels.column.length?(a=this._getLabel("column",u),u===this.m_columnHeaderLevelCount-1&&this._isHeaderLabelCollision()&&(a=this.m_headerLabels.row[this.m_rowHeaderLevelCount-1])):a=this._getLabel("row",u)),l=this._isDOMElementResizable(a),h=this._getHeaderCellByIndex(c,"column",u-1))):"row"===m?(o="enable"===this.m_options.isResizable(m,"width"),r=t?"enable"===this.m_options.isResizable(m,"height"):this._isDOMElementResizable(d),t?(h=this.m_headerLabels.row[c-1],this._isHeaderLabelCollision()&&d===this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]&&(a=this.m_headerLabels.column[this.m_columnHeaderLevelCount-1])):(a=this._getHeaderCellByIndex(c-1,"row",u),l=this._isDOMElementResizable(a),h=this._getHeaderCellByIndex(c,"row",u-1))):"columnEnd"===m?(r="enable"===this.m_options.isResizable(m).height,o=this._isDOMElementResizable(d),t?(a=null,l=null,h=this.m_headerLabels.columnEnd[c-1]):((a=this._getHeaderCellByIndex(c-1,"columnEnd",u))||(a=this._getLabel("columnEnd",u)),l=this._isDOMElementResizable(a),h=this._getHeaderCellByIndex(c,"columnEnd",u-1))):"rowEnd"===m&&(o="enable"===this.m_options.isResizable(m).width,r=this._isDOMElementResizable(d),t?(a=this.m_headerLabels.rowEnd[c-1],l=this._isDOMElementResizable(a)):(a=this._getHeaderCellByIndex(c-1,"rowEnd",u),l=this._isDOMElementResizable(a),h=this._getHeaderCellByIndex(c,"rowEnd",u-1))),this.m_utils.isTouchDevice())i=e.touches[0].pageX,s=e.touches[0].pageY,n=z.RESIZE_TOUCH_OFFSET;else{i=e.offsetX,s=e.offsetY,n=z.RESIZE_OFFSET;var _=this._findHeaderOffset(e.target,d);i+=_[0],s+=_[1]}var p=this.getHeaderEdgePixels(d),g=this.getResources().isRTLMode(),C="columnEnd"===m||"rowEnd"===m,f=i<p[0]+n,y=s<p[1]+n,E=i>p[2]-n,v=s>p[3]-n;if("column"===m||"columnEnd"===m){if(o&&(g?f:E))return this.m_resizingElement=d,"col-resize";if(l&&(g?E:f)){if(this.m_resizingElement=a,this.m_resizingElementSibling=d,null!==this.m_resizingElement)return"col-resize"}else if(r){if(!C&&v||C&&y)return this.m_resizingElement=d,"row-resize";if(!C&&y||C&&v)return this.m_resizingElement=h,this.m_resizingElementSibling=d,"row-resize"}}else if("row"===m||"rowEnd"===m){if(r&&v)return this.m_resizingElement=d,"row-resize";if(l&&y&&!t){if(this.m_resizingElement=a,this.m_resizingElementSibling=d,null!==this.m_resizingElement)return"row-resize"}else if(h&&y&&t&&a&&(this.m_resizingElement=h,this.m_resizingElementSibling=d,null!==this.m_resizingElement))return"row-resize";if(o){if(!C&&(g?f:E)||C&&(g?E:f))return this.m_resizingElement=d,"col-resize";if((!C&&(g?E:f)||C&&(g?f:E))&&(this.m_resizingElement=h,this.m_resizingElementSibling=d,null!==this.m_resizingElement))return"col-resize"}}return"default"},z.prototype.handleResizeMouseMove=function(e){var t,i,s,n,o;this.m_currentMouseX=e.pageX,this.m_currentMouseY=e.pageY,this.m_utils.isTouchDevice()?(this.m_currentMouseX=e.touches[0].pageX,this.m_currentMouseY=e.touches[0].pageY):(this.m_currentMouseX=e.pageX,this.m_currentMouseY=e.pageY),t=this._getResizeHeaderMode(this.m_resizingElement);var r=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"));let l=this.find(this.m_resizingElement,"headerlabel");"col-resize"===this.m_cursor?"column"===t?(r=!l&&r,i=this.calculateColumnHeaderWidth(this.m_resizingElement),s=this.getNewElementWidth("column",i,r,null,l),l?this.resizeRowWidth(s,s-i,r,l):this.resizeColWidth(i,s)):"row"===t&&(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(r=!0),i=this.getElementWidth(this.m_resizingElement),s=this.getNewElementWidth("row",i,r,null,l),this.resizeRowWidth(s,s-i,r,l)):"row-resize"===this.m_cursor&&("row"===t?(n=this.calculateRowHeaderHeight(this.m_resizingElement),o=this.getNewElementHeight("row",n,r,null,l),l?this.resizeColHeight(o,o-n,r):this.resizeRowHeight(n,o)):"column"===t&&(n=this.getElementHeight(this.m_resizingElement),o=this.getNewElementHeight("column",n,r,null,l),this.resizeColHeight(o,o-n,r))),this.buildCorners(),this.m_utils.isTouchDevice()&&this._moveTouchSelectionAffordance(),this.m_lastMouseX=this.m_currentMouseX,this.m_lastMouseY=this.m_currentMouseY},z.prototype.resizeColWidth=function(e,t){var i,s=t-e;const n=this.getResources().isRTLMode()?"right":"left";if(0!==s){let e=!1;if(this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader"))&&(e=!0),null==this.m_databody.firstChild||e){if(e&&this.m_databodyFrozenCol){let e=this.getElementWidth(this.m_databodyFrozenCol),t=this.getElementDir(this.m_databodyFrozenCol,n);if(-1!==this.m_endRowEndHeader){let i=this.getElementDir(this.m_rowEndHeader,n);s=t+e+s>i?i-(t+e):s}i=e+s,this.setElementWidth(this.m_databodyFrozenCol,i),this.setElementWidth(this.m_databodyFrozenCol,i),this.m_databodyFrozenCorner&&(this.setElementWidth(this.m_databodyFrozenCorner,i),this.setElementWidth(this.m_databodyFrozenCorner,i))}}else{i=this.getElementWidth(this.m_databody.firstChild)+s,this.setElementWidth(this.m_databody.firstChild,i),this.m_databodyFrozenRow&&this.setElementWidth(this.m_databodyFrozenRow.firstChild,i)}this.resizeColumnWidthAndShift(s),e||(this.m_endColPixel+=s,this.m_endColHeaderPixel+=s,this.m_endColEndHeaderPixel+=s,null!=i&&(this.m_avgColWidth=i/this.getDataSource().getCount("column"))),this.manageResizeScrollbars()}},z.prototype.resizeRowHeight=function(e,t){var i,s=t-e;if(0!==s){let e=!1;if(this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader"))&&(e=!0),null==this.m_databody.firstChild||e){if(e&&this.m_databodyFrozenRow){let e=this.getElementHeight(this.m_databodyFrozenRow),t=this.getElementDir(this.m_databodyFrozenRow,"top");if(-1!==this.m_endColEndHeader){let i=this.getElementDir(this.m_colEndHeader,"top");s=t+e+s>i?i-(t+e):s}i=e+s,this.setElementHeight(this.m_databodyFrozenRow,i),this.setElementHeight(this.m_databodyFrozenRow,i),this.m_databodyFrozenCorner&&(this.setElementHeight(this.m_databodyFrozenCorner,i),this.setElementHeight(this.m_databodyFrozenCorner,i))}}else{i=this.getElementHeight(this.m_databody.firstChild)+s,this.setElementHeight(this.m_databody.firstChild,i)}this.resizeRowHeightAndShift(s),e||(this.m_endRowPixel+=s,this.m_endRowHeaderPixel+=s,this.m_endRowEndHeaderPixel+=s,null!=i&&(this.m_avgRowHeight=i/this.getDataSource().getCount("row"))),this.manageResizeScrollbars()}},z.prototype.resizeColHeight=function(e,t,i){if(0!==t){var s,n,o,r=!0,l=this.find(this.m_resizingElement,"headerlabel");if(l?"column"===(o=this.getHeaderLabelAxis(this.m_resizingElement))||"columnEnd"===o?n=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==o&&"rowEnd"!==o||(n=this.m_columnHeaderLevelCount-1,r=!1):(n=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),o=this.getHeaderCellAxis(this.m_resizingElement)),i?this.m_columnEndHeaderLevelHeights[n]+=t:(s=this.m_columnHeaderLevelHeights[n],this.m_columnHeaderLevelHeights[n]+=t),!i&&n===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(r=!1),this.resizeColumnHeightsAndShift(t,n,i,r),i)this.m_colEndHeaderHeight+=t,this.setElementHeight(this.m_colEndHeader,this.m_colEndHeaderHeight),this.m_colEndHeaderFrozen&&this.setElementHeight(this.m_colEndHeaderFrozen,this.m_colEndHeaderHeight);else{if(this.m_colHeaderHeight+=t,this.setElementHeight(this.m_colHeader,this.m_colHeaderHeight),this.m_colHeaderFrozen&&this.setElementHeight(this.m_colHeaderFrozen,this.m_colHeaderHeight),0===this.m_headerLabels.column.length&&-1!==n)this._resizeHeaderLabelDirs(n,t,["row"],"height");else if(null!=this.m_columnHeaderLevelCount&&n===this.m_columnHeaderLevelCount-1)if(this.m_headerLabels.row.length){var a,h;if(l){if("column"===o)h=e,this.m_collisionResize=!0;else if("row"===o)a=t,this.m_collisionResize=!0;else if("rowEnd"===o)if(this._isHeaderLabelCollision()){let e=0;for(let t=0;t<this.m_columnHeaderLevelCount-1;t++)e+=this.getElementHeight(this.m_headerLabels.column[t]);let t=this.m_colHeaderHeight-e,i=this._calculateCollisionDimension(t,s,l,o);a=i.rowHeightChange,h=i.colHeight}else a=t,h=this.m_colHeaderHeight}else if(this._isHeaderLabelCollision()){let t=this._calculateCollisionDimension(e,s,!0,o);a=t.rowHeightChange,h=t.colHeight}else a=t,h=e;var d=this._getLabel("column",this.m_columnHeaderLevelCount-1);d&&this.setElementHeight(d,h),this._resizeHeaderLabelDirs(this.m_rowHeaderLevelCount-1,a,["row"],"height")}else{let t=["bottomResized"],i=this._getLabel("column",this.m_columnHeaderLevelCount-1);this._highlightElement(i.parentNode,t);let s=0;if("rowEnd"===o)for(let e=0;e<this.m_columnHeaderLevelCount-1;e++)s+=this.getElementHeight(this.m_headerLabels.column[e]);let n=e-s;this.setElementHeight(i,n)}else if(n<0){let t=this._getLabel("row",this.m_rowHeaderLevelCount-1),i=["bottomResized"];if(t&&n<0){this._highlightElement(t.parentNode,i);for(let i=0;i<this.m_rowHeaderLevelCount;i++)t=this._getLabel("row",i),this.setElementHeight(t,e)}}let i=this._getLabel("rowEnd",this.m_rowEndHeaderLevelCount-1),r=["bottomResized"];if(i){let t=-1===this.m_endColHeader?e:this.m_colHeaderHeight;this._highlightElement(i.parentNode,r);for(let e=0;e<this.m_rowEndHeaderLevelCount;e++)i=this._getLabel("rowEnd",e),this.setElementHeight(i,t)}}this.manageResizeScrollbars()}},z.prototype._calculateCollisionDimension=function(e,t,i,s){let n,o,r={},l=this._getMinValue("height",s,i);if(this.m_collisionResize){let r=this.getElementDir(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],"height"),a=this.getElementDir(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],"height"),h=r+a,d=a/h,m=r/h;r===l&&a===l?(n=Math.floor(e/2)-Math.floor(t/2),o=Math.ceil(e/2),this.m_collisionResize=!1):d>m?(o=Math.floor(e*d),n=e-o-r,r+n<this._getMinValue("height",s,i)&&(n=0)):(n=Math.floor(e*m)-r,r+n<this._getMinValue("height",s,i)&&(n=0),o=e-(r+n),o=Math.max(o,this._getMinValue("height",s,i)))}else n=Math.floor(e/2)-Math.floor(t/2),o=Math.ceil(e/2);return r.colHeight=o,r.rowHeightChange=n,r},z.prototype.resizeRowWidth=function(e,t,i,s){if(0!==t){var n;if(s){let e=this.getHeaderLabelAxis(this.m_resizingElement);"column"===e||"columnEnd"===e?n=this.m_rowHeaderLevelCount-1:"row"!==e&&"rowEnd"!==e||(n=this.getHeaderLabelLevel(this.m_resizingElement))}else n=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1);if(i?this.m_rowEndHeaderLevelWidths[n]+=t:this.m_rowHeaderLevelWidths[n]+=t,this.resizeRowWidthsAndShift(t,n,i),i)this.m_rowEndHeaderWidth+=t,this.setElementWidth(this.m_rowEndHeader,this.m_rowEndHeaderWidth),this.m_rowEndHeaderFrozen&&this.setElementWidth(this.m_rowEndHeaderFrozen,this.m_rowEndHeaderWidth);else{if(this.m_rowHeaderWidth+=t,n<0){let t=this.getResources().isRTLMode()?["startResized"]:["endResized"],i=this._getLabel("column",this.m_columnHeaderLevelCount-1);this._highlightElement(i.parentNode,t);for(let t=0;t<this.m_columnHeaderLevelCount;t++)i=this._getLabel("column",t),this.setElementWidth(i,e)}else this.setElementWidth(this.m_rowHeader,this.m_rowHeaderWidth),this.m_rowHeaderFrozen&&this.setElementWidth(this.m_rowHeaderFrozen,this.m_rowHeaderWidth),(n===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._resizeHeaderLabelDirs(n,t,["column"],"width");let i=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1),s=this.getResources().isRTLMode()?["startResized"]:["endResized"];if(i){this._highlightElement(i.parentNode,s);let e=this.getElementWidth(i)+t;for(let t=0;t<this.m_columnEndHeaderLevelCount;t++)i=this._getLabel("columnEnd",t),this.setElementWidth(i,e)}}this.manageResizeScrollbars()}},z.prototype._resizeHeaderLabelDirs=function(e,t,i,s){for(var n=0;n<i.length;n++){for(var o=i[n],r=0;r<this.m_headerLabels[o].length;r++){var l=this.m_headerLabels[o][r];if(null!=l){var a=this.getElementDir(l,s)+t;this.setElementDir(l,a,s)}}this._highlightResizeLabelDirs(o,e)}},z.prototype._highlightResizeLabelDirs=function(e,t){let i=this.getResources().isRTLMode()?["startResized"]:["endResized"],s="column"===e?i:["bottomResized"];this.m_corner&&("column"===e&&t===this.m_columnHeaderLevelCount-1||"row"===e&&t===this.m_rowHeaderLevelCount-1)&&this._highlightElement(this.m_corner,s);let n=this._getLabel("rowEnd",this.m_columnHeaderLevelCount-1);n&&this._highlightElement(n.parentNode,s)},z.prototype._unhighlightResizeBorderColor=function(){let e=this.m_root.querySelectorAll(".oj-datagrid-resized-start,\n .oj-datagrid-resized-end, .oj-datagrid-resized-top, .oj-datagrid-resized-bottom");this._unhighlightElementsByClassName(e,["startResized","endResized","topResized","bottomResized"])},z.prototype.getNewElementWidth=function(e,t,i,s,n){var o;o=this._getMinValue("width",e,n),null==s&&(s=this.getResources().isRTLMode()?this.m_lastMouseX-this.m_currentMouseX:this.m_currentMouseX-this.m_lastMouseX),i&&"row"===e&&(s*=-1);var r=t+s+this.m_overResizeLeft+this.m_overResizeMinLeft+this.m_overResizeRight;if(r<o?(this.m_overResizeMinLeft+=s-o+t,r=o):(this.m_overResizeMinLeft=0,this.m_overResizeLeft=0),"row"===e){var l=this.getRowHeaderWidth()+this.getRowEndHeaderWidth()-t,a=Math.round(this.getWidth()-this.m_utils.getScrollbarSize()-1)-l;r>a?(this.m_overResizeRight+=s-a+t,r=a):this.m_overResizeRight=0}return r},z.prototype.getNewElementHeight=function(e,t,i,s,n){var o;let r=this._getMinValue("height",e,!0);if(n){if(o=r,"rowEnd"===this.getHeaderLabelAxis(this.m_resizingElement)&&this.m_headerLabels.column&&this.m_headerLabels.column.length){this._isHeaderLabelCollision()&&(o=2*r);for(let e=0;e<this.m_columnHeaderLevelCount-1;e++)o+=this.getElementHeight(this.m_headerLabels.column[e])}}else o=this._getMinValue("height",e,n);"column"===e&&!i&&this.getHeaderCellLevel(this.m_resizingElement)+this.getHeaderCellDepth(this.m_resizingElement)===this.m_columnHeaderLevelCount&&this._isHeaderLabelCollision()&&(o=2*r),null==s&&(s=this.m_currentMouseY-this.m_lastMouseY),i&&"column"===e&&(s*=-1);var l=t+s+this.m_overResizeTop+this.m_overResizeMinTop+this.m_overResizeBottom;if(l<o?(this.m_overResizeMinTop+=s-o+t,l=o):(this.m_overResizeMinTop=0,this.m_overResizeTop=0),"column"===e){var a=this.getColumnHeaderHeight()+this.getColumnEndHeaderHeight()-t,h=Math.round(this.getHeight()-this.m_utils.getScrollbarSize()-1)-a;l>h?(this.m_overResizeBottom+=s-h+t,l=h):this.m_overResizeBottom=0}return l},z.prototype._getMinValue=function(e,t,i){var s,n,o=this.m_resizingElement,r=this._getCellPaddingBorder(e,o),l=r;if(i)return Math.max(this.m_utils.isTouchDevice()?2*z.RESIZE_TOUCH_OFFSET:2*z.RESIZE_OFFSET,l);var a=this.getHeaderCellLevel(o),h=this.getHeaderCellDepth(o),d=this.getResources().getMappedAttribute("sortable");"true"===o.getAttribute(d)&&this._setSortContainerSize(this._getSortContainer(o),r),"column"===t&&"true"===o.getAttribute(d)&&(l="width"===e?this.m_sortContainerWidth:this.m_sortContainerHeight);var m=Math.max(this.m_utils.isTouchDevice()?2*z.RESIZE_TOUCH_OFFSET:2*z.RESIZE_OFFSET,l);if("column"===t&&(1===this.m_columnHeaderLevelCount||"width"===e&&this.m_columnHeaderLevelCount===a+1||"height"===e&&1===h)||"row"===t&&-1===this.m_endRowHeader||"column"===t&&-1===this.m_endColHeader||"row"===t&&(1===this.m_rowHeaderLevelCount||"height"===e&&this.m_rowHeaderLevelCount===a+1||"width"===e&&1===h))return m;var c=this.getHeaderCellIndex(o),u=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0),_=this.getElementDir(o,e);return"column"===t?"width"===e?(s=this._getHeaderCellByIndex(c+(u-1),t,this.m_columnHeaderLevelCount-1),n=this.getElementDir(s,e)):n=this._getHeaderLevelDimension(a+(h-1),o,this.m_columnHeaderLevelHeights,"height",1):"row"===t&&("height"===e?(s=this._getHeaderCellByIndex(c+(u-1),t,this.m_rowHeaderLevelCount-1),n=this.getElementDir(s,e)):n=this._getHeaderLevelDimension(a+(h-1),o,this.m_rowHeaderLevelWidths,"width",1)),_-(n-m)},z.prototype._getLabelMinValue=function(e){var t=this.m_resizingElement,i=this._getCellPaddingBorder(e,t);return Math.max(this.m_utils.isTouchDevice()?2*z.RESIZE_TOUCH_OFFSET:2*z.RESIZE_OFFSET,i)},z.prototype._setSortContainerSize=function(e,t){this.m_sortContainerWidth=this.getElementWidth(e)+t,this.m_sortContainerHeight=this.getElementHeight(e)},z.prototype._getCellPaddingBorder=function(e,t){if(null==this.m_resizingElementMin){for(var i=["top","right","bottom","left"],s="width"===e?1:0,n=0,o=window.getComputedStyle(t);s<4;s+=2)n+=parseFloat(o.getPropertyValue("padding-"+i[s])),n+=parseFloat(o.getPropertyValue("border-"+i[s]+"-width"));this.m_resizingElementMin=Math.round(n)}return this.m_resizingElementMin},z.prototype.manageResizeScrollbars=function(){var e=this.getWidth(),t=this.getHeight(),i=this.m_colHeader,s=this.m_colEndHeader,n=this.m_rowHeader,o=this.m_rowEndHeader,r=this.m_databody,l=r.firstChild;const a=this.m_databodyFrozenCol,h=this.m_databodyFrozenRow;let d=0,m=0;var c=this.getColumnHeaderHeight(),u=this.getColumnEndHeaderHeight(),_=this.getRowHeaderWidth(),p=this.getRowEndHeaderWidth();if(a&&(d=this.getElementWidth(a)),h&&(m=this.getElementHeight(h)),-1===this.m_endRowHeader&&-1!==this.m_endColHeader){let e=this._getLabel("column",this.m_columnHeaderLevelCount-1);e&&(_=this.getElementWidth(e))}else if(-1!==this.m_endRowHeader&&-1===this.m_endColHeader){let e=this._getLabel("row",this.m_rowHeaderLevelCount-1);e&&(c=this.getElementHeight(e))}var g,C=t-c-u-m,f=e-_-p-d,y=this.m_utils.getScrollbarSize(),E=this.getResources().isRTLMode()?"right":"left";if(this._databodyEmpty())if(null==this.m_empty){g=this._buildEmptyText();var v=this.getElementHeight(g),w=this.getElementWidth(g);v>this.getElementHeight(l)&&this.setElementHeight(l,v),w>this.getElementWidth(l)&&this.setElementWidth(l,w),this.m_databody.firstChild.appendChild(g)}else g=this.m_empty,this.setElementDir(g,this.m_endColHeader>=0?c:0,"top");var H,S,x,b,R,I=this.getElementWidth(r.firstChild),M=this.getElementHeight(r.firstChild),F=this.isDatabodyHorizontalScrollbarRequired(f);F?(H=this.isDatabodyVerticalScrollbarRequired(C-y),r.style.overflow="auto"):(H=this.isDatabodyVerticalScrollbarRequired(C))?(F=this.isDatabodyHorizontalScrollbarRequired(f-y),r.style.overflow="auto"):r.style.overflow="hidden",this.m_hasHorizontalScroller=F,this.m_hasVerticalScroller=H,-1!==this.m_endColEndHeader?(S=Math.min(M+(F?y:0),C),x=F?S-y:S):(S=C,x=Math.min(M,F?S-y:S)),-1!==this.m_endRowEndHeader?(b=Math.min(I+(H?y:0),f),R=H?b-y:b):(b=f,R=Math.min(I,H?b-y:b));var z=_+R+d+(H?y:0),D=c+x+m+(F?y:0);if(this.setElementDir(n,0,E),this.setElementDir(n,c,"top"),this.setElementHeight(n,x),this.setElementDir(o,z,E),this.setElementDir(o,c,"top"),this.setElementHeight(o,x),this.setElementDir(i,_,E),this.setElementWidth(i,R),this.setElementDir(s,_,E),this.setElementDir(s,D,"top"),this.setElementWidth(s,R),[_,c]=this._setFrozenContainerDimension(f,C,_,p,c,u),this.setElementDir(r,c,"top"),this.setElementDir(r,_,E),this.setElementWidth(r,b),this.setElementHeight(r,S),-1===this.m_endRowHeader&&-1!==this.m_endColHeader&&this.m_rowHeaderScrollbarSpacer?(this.setElementDir(this.m_rowHeaderScrollbarSpacer,c,"top"),this.setElementHeight(this.m_rowHeaderScrollbarSpacer,S+u),this.setElementWidth(this.m_rowHeaderScrollbarSpacer,_)):-1!==this.m_endRowHeader&&-1===this.m_endColHeader&&this.m_columnHeaderScrollbarSpacer&&(this.setElementDir(this.m_columnHeaderScrollbarSpacer,_,"left"),this.setElementWidth(this.m_columnHeaderScrollbarSpacer,b+p),this.setElementHeight(this.m_columnHeaderScrollbarSpacer,c)),this.m_scrollWidth=I-R,this.m_scrollHeight=M-x,this.buildCorners(),this._adjustHeaderBorders(),this._updateGridlines(),this.m_utils.isTouchDevice()){var L=0,A=0;if(this.m_currentScrollLeft>this.m_scrollWidth&&(L=this.m_scrollWidth-this.m_currentScrollLeft),this.m_currentScrollTop>this.m_scrollHeight&&(A=this.m_scrollHeight-this.m_currentScrollTop),0!==L||0!==A){this.m_utils.isTouchDeviceNotIOS()&&this._disableTouchScrollAnimation();var T=this.adjustTouchScroll(L,A);L=T[0],A=T[1],this.scrollDelta(L,A)}}},z.prototype.resizeColumnWidthAndShift=function(e){var t=this.getResources().isRTLMode()?"right":"left",i=this.m_colHeader.style.display,s=this.m_colEndHeader.style.display;let n=this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader")),o=!1;n?(this.m_databodyFrozenCol.style.display="none",this.m_colHeaderFrozen.style.display="none",this.m_colEndHeaderFrozen.style.display="none",this.m_databodyFrozenCorner&&(this.m_databodyFrozenCorner.style.display="none",o=!0)):(this.m_databody.style.display="none",this.m_colHeader.style.display="none",this.m_colEndHeader.style.display="none",this.m_databodyFrozenRow&&(this.m_databodyFrozenRow.style.display="none"));var r=this.getHeaderCellIndex(this.m_resizingElement);this.m_columnHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(r+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);var l,a=this.createIndex(-1,r),h=this.getElementsInRange(this.createRange(a,a));if(h)for(let e=0;e<h.length;e++)l=this.getResources().isRTLMode()?["startResized"]:["endResized"],this._highlightElement(h[e],l);let d=this.m_colHeader.firstChild,m=this.m_colEndHeader.firstChild;n&&(d=this.m_colHeaderFrozen.firstChild,m=this.m_colEndHeaderFrozen.firstChild),this._shiftHeadersAlongAxisInContainer(d,r,e,t,this.getMappedStyle("colheadercell"),"column"),this._shiftHeadersAlongAxisInContainer(m,r,e,t,this.getMappedStyle("colendheadercell"),"column"),n?this._shiftCellsAlongAxis("column",e,r,null,this.m_frozenColIndex,o):(this._shiftCellsAlongAxis("column",e,r),this.m_databodyFrozenRow&&this._shiftFrozenCellsAlongAxis("column",e,r,!1)),n?(this.m_databodyFrozenCol.style.display="",this.m_colHeaderFrozen.style.display=i,this.m_colEndHeaderFrozen.style.display=s,this.m_databodyFrozenCorner&&(this.m_databodyFrozenCorner.style.display="")):(this.m_databody.style.display="",this.m_colHeader.style.display=i,this.m_colEndHeader.style.display=s,this.m_databodyFrozenRow&&(this.m_databodyFrozenRow.style.display=""))},z.prototype._shiftCellsAlongAxis=function(e,t,i,s,n,o){var r,l,a,h,d=[];let m=n;if(null==s&&(s=!1),"row"===e?(r="height",l="top",void 0===m&&(m=this.m_endRow),a=null===this.m_frozenColIndex||-1===this.m_frozenColndex||o?this.m_startCol:this.m_frozenColIndex+1,h=this.m_endCol):(r="width",l=this.getResources().isRTLMode()?"right":"left",void 0===m&&(m=this.m_endCol),a=this._hasFrozenRows()&&!o?this.m_frozenRowIndex+1:this.m_startRow,h=this.m_endRow),null!=this.m_databody.firstChild)for(var c=a;c<=h;c++){var u="row"===e?this.createIndex(i,c):this.createIndex(c,i),_=this._getCellByIndex(u),p=_[this.getResources().getMappedAttribute("context")],g=p.indexes[e],C=p.extents[e],f=i-g,y=C-f;d[c]&&d[c][i]||!0===s||(this.setElementDir(_,this.getElementDir(_,r)+t,r),"row"===e?this._updateTempArray(d,!0,c,i,p.extents.column,C-f):this._updateTempArray(d,!0,c,i,p.extents.row,C-f));var E=i;!0!==s&&(E=i+y);for(var v=E;v<=m;v++)if(!d[c]||!d[c][v]){u="row"===e?this.createIndex(v,c):this.createIndex(c,v),C=(p=(_=this._getCellByIndex(u))[this.getResources().getMappedAttribute("context")]).extents[e];var w=this.getElementDir(_,l)+t;this.setElementDir(_,w,l),"row"===e?this._updateTempArray(d,!0,c,v,p.extents.column,C):this._updateTempArray(d,!0,c,v,p.extents.row,C)}}},z.prototype._shiftFrozenCellsAlongAxis=function(e,t,i,s){const n=[];let o,r,l,a,h;"row"===e?(o="top",r=this.m_endRow,l=this.m_startCol,a=this.m_frozenColIndex,h="height"):(o=this.getResources().isRTLMode()?"right":"left",r=this.m_endCol,l=this.m_startRow,a=this.m_frozenRowIndex,h="width");for(let d=l;d<=a;d++){let l="row"===e?this.createIndex(i,d):this.createIndex(d,i),a=this._getFrozenCellByIndex(l,e),m=a[this.getResources().getMappedAttribute("context")],c=m.extents[e],u=i-m.indexes[e],_=c-u;n[d]&&n[d][i]||!0===s||(this.setElementDir(a,this.getElementDir(a,h)+t,h),"row"===e?this._updateTempArray(n,!0,d,i,m.extents.column,c-u):this._updateTempArray(n,!0,d,i,m.extents.row,c-u));let p=i;!0!==s&&(p=i+_);for(let i=p;i<=r;i++)if(!n[d]||!n[d][i]){l="row"===e?this.createIndex(i,d):this.createIndex(d,i),a=this._getFrozenCellByIndex(l,e),m=a[this.getResources().getMappedAttribute("context")],c=m.extents[e];let s=this.getElementDir(a,o)+t;this.setElementDir(a,s,o),"row"===e?this._updateTempArray(n,!0,d,i,m.extents.column,c):this._updateTempArray(n,!0,d,i,m.extents.row,c)}}},z.prototype.resizeRowHeightAndShift=function(e){var t=this.m_rowHeader.style.display,i=this.m_rowEndHeader.style.display;let s=this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader")),n=!1;s?(this.m_databodyFrozenRow.style.display="none",this.m_rowHeaderFrozen.style.display="none",this.m_rowEndHeaderFrozen.style.display="none",this.m_databodyFrozenCorner&&(this.m_databodyFrozenCorner.style.display="none",n=!0)):(this.m_databody.style.display="none",this.m_rowHeader.style.display="none",this.m_rowEndHeader.style.display="none");var o=this.getHeaderCellIndex(this.m_resizingElement);this.m_rowHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(o+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);var r,l=this.createIndex(o,-1),a=this.getElementsInRange(this.createRange(l,l));if(a)for(let e=0;e<a.length;e++)r=["bottomResized"],this._highlightElement(a[e],r);let h=this.m_rowHeader.firstChild,d=this.m_rowEndHeader.firstChild;s&&(h=this.m_rowHeaderFrozen.firstChild,d=this.m_rowEndHeaderFrozen.firstChild),this._shiftHeadersAlongAxisInContainer(h,o,e,"top",this.getMappedStyle("rowheadercell"),"row"),this._shiftHeadersAlongAxisInContainer(d,o,e,"top",this.getMappedStyle("rowendheadercell"),"row"),s?this._shiftCellsAlongAxis("row",e,o,null,this.m_frozenRowIndex,n):(this._shiftCellsAlongAxis("row",e,o),this.m_databodyFrozenCol&&this._shiftFrozenCellsAlongAxis("row",e,o,!1)),s?(this.m_databodyFrozenRow.style.display="",this.m_rowHeaderFrozen.style.display=t,this.m_rowEndHeaderFrozen.style.display=i,this.m_databodyFrozenCorner&&(this.m_databodyFrozenCorner.style.display="",n=!0)):(this.m_databody.style.display="",this.m_rowHeader.style.display=t,this.m_rowEndHeader.style.display=i)},z.prototype._shiftHeadersAlongAxisInContainer=function(e,t,i,s,n,o){var r,l,a,h,d=0,m=e.lastChild;if(null!=m){var c,u=this.m_utils.containsCSSClassName(m,n);for(u?(l=m.parentNode,r=m,a=this.getHeaderCellIndex(r)):(l=m,r=m.firstChild,a=this._getAttribute(l,"start",!0));t<a;)if(u)h=this.getElementDir(r,s)+i,this.setElementDir(r,h,s),m=m.previousSibling,u=this.m_utils.containsCSSClassName(m,n),l=m.parentNode,r=m,a=this.getHeaderCellIndex(r);else{for(var _=l.getElementsByClassName(n),p=0;p<_.length;p++)h=this.getElementDir(_[p],s)+i,this.setElementDir(_[p],h,s);m=m.previousSibling,u=this.m_utils.containsCSSClassName(m,n),l=m,r=m.firstChild,a=this._getAttribute(l,"start",!0)}if(this.m_resizingElement&&(c=this.getHeaderCellLevel(this.m_resizingElement)),"column"===o?(d=this.getElementWidth(r)+i,this.setElementWidth(r,d)):"row"===o?(d=this.getElementHeight(r)+i,this.setElementHeight(r,d)):null==o&&(h=this.getElementDir(r,s)+i,this.setElementDir(r,h,s)),"row"===o||"column"===o){let e=this.getResources().isRTLMode()?["startResized"]:["endResized"],t="row"===o?["bottomResized"]:e;void 0!==c&&this.getHeaderCellLevel(r)>=c&&this._highlightElement(r,t),r!==this.m_resizingElement||r!==l.lastChild&&r!==l.firstChild||this._highlightResizeBorder(t,o)}u||null==r.nextSibling?null!=o&&this.m_sizingManager.setSize(o,this._getKey(r),d):this._shiftHeadersAlongAxisInContainer(m,t,i,s,n,o)}},z.prototype._highlightResizeBorder=function(e,t){let i=this.getHeaderCellIndex(this.m_resizingElement),s="column"===t?this.m_columnHeaderLevelCount:this.m_rowHeaderLevelCount,n=this.m_resizingElement[this.getResources().getMappedAttribute("context")],o=n.index+n.extent-1;for(let n=0;n<s-1;n++){let s=this._getHeaderCellByIndex(i,t,n),r=s[this.getResources().getMappedAttribute("context")];r.index+r.extent-1===o&&this._highlightElement(s,e)}},z.prototype.resizeColumnHeightsAndShift=function(e,t,i,s){var n,o,r,l;i?(n=this.m_colEndHeader,o=this.getMappedStyle("colendheadercell"),r="columnEnd",l="bottom"):(n=this.m_colHeader,o=this.getMappedStyle("colheadercell"),r="column",l="top"),n.style.display="none",this.m_databody.style.display="none",this._hasFrozenColumns()&&(i?this.m_colEndHeaderFrozen.style.display="none":this.m_colHeaderFrozen.style.display="none",this.m_databodyFrozenCol.style.display="none"),s&&this._shiftLabelsDir(this.m_headerLabels[r],e,t,l,r),this._shiftHeadersDirInContainer(n.firstChild,e,t,l,o,r),this.m_colHeaderFrozen&&this._shiftHeadersDirInContainer(this.m_colHeaderFrozen.firstChild,e,t,l,o,r),n.style.display="",this.m_databody.style.display="",this._hasFrozenColumns()&&(i?this.m_colEndHeaderFrozen.style.display="":this.m_colHeaderFrozen.style.display="",this.m_databodyFrozenCol.style.display="")},z.prototype.resizeRowWidthsAndShift=function(e,t,i){var s,n,o,r;i?(s=this.m_rowEndHeader,n=this.getMappedStyle("rowendheadercell"),o="rowEnd",r=this.getResources().isRTLMode()?"left":"right"):(s=this.m_rowHeader,n=this.getMappedStyle("rowheadercell"),o="row",r=this.getResources().isRTLMode()?"right":"left"),s.style.display="none",this.m_databody.style.display="none",this._hasFrozenRows()&&(i?this.m_rowEndHeaderFrozen.style.display="none":this.m_rowHeaderFrozen.style.display="none",this.m_databodyFrozenRow.style.display="none"),this._shiftLabelsDir(this.m_headerLabels[o],e,t,r,o),this._shiftHeadersDirInContainer(s.firstChild,e,t,r,n,o),this.m_rowHeaderFrozen&&this._shiftHeadersDirInContainer(this.m_rowHeaderFrozen.firstChild,e,t,r,n,o),s.style.display="",this.m_databody.style.display="",this._hasFrozenRows()&&(i?this.m_rowEndHeaderFrozen.style.display="":this.m_rowHeaderFrozen.style.display="",this.m_databodyFrozenRow.style.display="")},z.prototype._shiftLabelsDir=function(e,t,i,s,n){for(var o=0;o<e.length;o++){var r,l=e[o];if(o===i)if("column"===n||"columnEnd"===n)if(r=this.getElementHeight(l)+t,this.setElementHeight(l,r),"column"===n&&this._isHeaderLabelCollision()&&i===this.m_columnHeaderLevelCount-1){let e=["bottomResized"];this._highlightElement(this.m_corner,e)}else if("columnEnd"===n){let e=["topResized"],t=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1);t&&this._highlightElement(t,e)}else{let e="column"===n?["bottomResized"]:["topResized"];this._highlightElement(l,e)}else{r=this.getElementWidth(l)+t,this.setElementWidth(l,r);let e=this.getResources().isRTLMode()?["startResized"]:["endResized"],i=this.getResources().isRTLMode()?["endResized"]:["startResized"],s="row"===n?e:i;this._highlightElement(l,s);let o=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1);o&&this._highlightElement(o.parentNode,s)}o>i&&(r=this.getElementDir(l,s)+t,this.setElementDir(l,r,s))}},z.prototype._shiftHeadersDirInContainer=function(e,t,i,s,n,o){for(var r=e.childNodes,l=0;l<r.length;l++){var a,h,d=r[l];if(this.m_utils.containsCSSClassName(d,n)){a=this.getHeaderCellLevel(d);var m=this.getHeaderCellDepth(d);if(a<=i&&i<a+m){if("column"===o||"columnEnd"===o){if(h=this.getElementHeight(d)+t,this.setElementHeight(d,h),this.m_resizingElement){var c=this.getMappedStyle("colendheadercell");if(this.m_utils.containsCSSClassName(d,c)){let e=["topResized"];this._highlightElement(d,e)}else{let e=["bottomResized"];this._highlightElement(d,e)}}}else if(h=this.getElementWidth(d)+t,this.setElementWidth(d,h),this.m_resizingElement){var u=this.getMappedStyle("rowendheadercell");if(this.m_utils.containsCSSClassName(d,u)){let e=this.getResources().isRTLMode()?["endResized"]:["startResized"];this._highlightElement(d,e)}else{let e=this.getResources().isRTLMode()?["startResized"]:["endResized"];this._highlightElement(d,e)}}}else a>i&&(h=this.getElementDir(d,s)+t,this.setElementDir(d,h,s))}else if((a=this._getAttribute(d,"level",!0))<=i)this._shiftHeadersDirInContainer(d,t,i,s,n,o);else for(var _=d.getElementsByClassName(n),p=0;p<_.length;p++)h=this.getElementDir(_[p],s)+t,this.setElementDir(_[p],h,s)}},z.prototype.handleContextMenuResize=function(e,t,i,s){this.m_overResizeLeft=0,this.m_overResizeMinLeft=0,this.m_overResizeTop=0,this.m_overResizeMinTop=0,this.m_overResizeRight=0,this.m_overResizeBottom=0;var n=parseFloat(i,10),o=n-this.getElementWidth(s),r=n-this.getElementHeight(s);this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=t===this.m_resources.getMappedCommand("resizeHeight")?this.getHeaderFromCell(s,"row",!0):this.getHeaderFromCell(s,"column",!0)),this.m_isResizing=!0,this.m_resizingElement=s;let l=this.find(this.m_resizingElement,"headerlabel");var a=this.getElementWidth(s),h=this.getElementHeight(s),d=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"));if(t===this.m_resources.getMappedCommand("resizeWidth")){if(a!==n)if("column"===this._getResizeHeaderMode(this.m_resizingElement)){if(this._isDOMElementResizable(this.m_resizingElement))if(l)this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"))&&(d=!1),this.resizeRowWidth(n,n-a,d,l),this._fireResizeEvent(e,a,h,n,h,n);else{let t=this.getNewElementWidth("column",a,d,o,l);this.resizeColWidth(a,t),this._resizeSelectedHeaders(e,a,h,n,h,n)}}else this.resizeRowWidth(n,n-a,d,l),this._fireResizeEvent(e,a,h,n,h,n)}else if(t===this.m_resources.getMappedCommand("resizeHeight")&&h!==n)if("column"===this._getResizeHeaderMode(this.m_resizingElement))this.resizeColHeight(n,n-h,d),this._fireResizeEvent(e,a,h,a,n,n);else if(this._isDOMElementResizable(this.m_resizingElement)){let t=this.getNewElementHeight("row",h,d,r,l);l?(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(d=!1),this.resizeColHeight(t,t-h,d),this._fireResizeEvent(e,a,h,a,n,n)):(this.resizeRowHeight(h,t),this._resizeSelectedHeaders(e,a,h,a,t,n))}var m=this.getElementWidth(s),c=this.getElementHeight(s);m===a&&c===h||(this.buildCorners(),this.m_utils.isTouchDevice()&&this._moveTouchSelectionAffordance()),this._unhighlightResizeBorderColor(),this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_isResizing=!1},z.prototype._getResizeNestedHeaderIndex=function(e,t){let i=this.getHeaderCellIndex(this.m_resizingElement),s=t?this.m_columnEndHeaderLevelCount:this.m_columnHeaderLevelCount,n=t?this.m_rowEndHeaderLevelCount:this.m_rowHeaderLevelCount;return("column"===e||"columnEnd"===e?s:n)>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1),i},z.prototype._highlightResizeMouseDown=function(){let e,t,i=this.getHeaderCellIndex(this.m_resizingElement),s=this._getResizeHeaderMode(this.m_resizingElement),n=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel")),o=this.getResources().isRTLMode()?"right":"left",r=this.find(this.m_resizingElement,"headerlabel");if("col-resize"===this.m_cursor)if("column"===s)if(n=!r&&n,r)t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.m_rowHeaderLevelCount-1:"row"!==t&&"rowEnd"!==t||(e=this.getHeaderLabelLevel(this.m_resizingElement)),this.resizeRowWidthsAndShift(0,e,n),n||(e===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._highlightResizeLabelDirs("column",e);else{this.m_columnHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);let e,t=this.createIndex(-1,i),s=this.getElementsInRange(this.createRange(t,t));if(s)for(let t=0;t<s.length;t++)e=this.getResources().isRTLMode()?["startResized"]:["endResized"],this._highlightElement(s[t],e);let n=this.m_colHeader.firstChild,r=this.m_colEndHeader.firstChild;this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader"))&&(n=this.m_colHeaderFrozen.firstChild,r=this.m_colEndHeaderFrozen.firstChild),this._shiftHeadersAlongAxisInContainer(n,i,0,o,this.getMappedStyle("colheadercell"),"column"),this._shiftHeadersAlongAxisInContainer(r,i,0,o,this.getMappedStyle("colendheadercell"),"column")}else"row"===s&&(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(n=!0),r?(t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.m_rowHeaderLevelCount-1:"row"!==t&&"rowEnd"!==t||(e=this.getHeaderLabelLevel(this.m_resizingElement))):e=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),this.resizeRowWidthsAndShift(0,e,n),n||(e===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._highlightResizeLabelDirs("column",e));else if("row-resize"===this.m_cursor)if("row"===s)if(r){let i=!0;t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==t&&"rowEnd"!==t||(e=this.m_columnHeaderLevelCount-1,i=!1),!n&&e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(i=!1),this.resizeColumnHeightsAndShift(0,e,n,i),n||(0===this.m_headerLabels.column.length||e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length)&&this._highlightResizeLabelDirs("row",e)}else{this.m_rowHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);let e,t=this.createIndex(i,-1),s=this.getElementsInRange(this.createRange(t,t));if(s)for(let t=0;t<s.length;t++)e=["bottomResized"],this._highlightElement(s[t],e);let n=this.m_rowHeader.firstChild,o=this.m_rowEndHeader.firstChild;this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader"))&&(n=this.m_rowHeaderFrozen.firstChild,o=this.m_rowEndHeaderFrozen.firstChild),this._shiftHeadersAlongAxisInContainer(n,i,0,"top",this.getMappedStyle("rowheadercell"),"row"),this._shiftHeadersAlongAxisInContainer(o,i,0,"top",this.getMappedStyle("rowendheadercell"),"row")}else{let i=!0;r?(t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==t&&"rowEnd"!==t||(e=this.m_columnHeaderLevelCount-1,i=!1)):(e=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),t=this.getHeaderCellAxis(this.m_resizingElement)),!n&&e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(i=!1),this.resizeColumnHeightsAndShift(0,e,n,i),n||(0===this.m_headerLabels.column.length||e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length)&&this._highlightResizeLabelDirs("row",e)}},z.prototype.handleResizeFitToContent=function(e,t,i){let s=this.find(t,"header")||this.find(t,"endheadercell"),n=this.m_utils.containsCSSClassName(t,this.getMappedStyle("endheadercell"));if(!s){let e=this.findCell(t);if(!e)return;t=this.getHeaderFromCell(e,i)}this.m_resizingElement=t;let o,r,l,a,h,d,m=this.m_resizingElement,c=this.getHeaderCellAxis(m),u=!1;if("column"===c||"columnEnd"===c){let e=s?this._getResizeNestedHeaderIndex(c,n):this.getHeaderCellIndex(m);this.m_resizingElement=n?this._getHeaderCellByIndex(e,c,this.m_columnEndHeaderLevelCount-1):this._getHeaderCellByIndex(e,c,this.m_columnHeaderLevelCount-1);let t=this.createIndex(-1,e);o=this.getElementsInRange(this.createRange(t,t)),o.push(m),r=this.calculateColumnHeaderWidth(this.m_resizingElement),l=this.getElementHeight(this.m_resizingElement),a=this._calculateResizeFitToContentValue(o,"column"),h=l,d=a,u=r!==a,this.resizeColWidth(r,a)}else if("row"===c||"rowEnd"===c){let e=s?this._getResizeNestedHeaderIndex(c,n):this.getHeaderCellIndex(m);this.m_resizingElement=n?this._getHeaderCellByIndex(e,"rowEnd",this.m_rowEndHeaderLevelCount-1):this._getHeaderCellByIndex(e,"row",this.m_rowHeaderLevelCount-1);let t=this.createIndex(e,-1);o=this.getElementsInRange(this.createRange(t,t)),o.push(m),r=this.getElementWidth(this.m_resizingElement),l=this.calculateRowHeaderHeight(this.m_resizingElement),a=r,h=this._calculateResizeFitToContentValue(o,"row"),d=h,u=l!==h,this.resizeRowHeight(l,h)}u&&this._fireResizeEvent(e,r,l,a,h,d),this._unhighlightResizeBorderColor()},z.prototype._calculateResizeFitToContentValue=function(e,t){let i,s="height";"column"===t&&(s="width");let n=this._getMinValue(s,t,!1),o=document.createElement("div");if("width"===s){o.style.display="inline-flex",o.style.flexFlow="column nowrap",o.style.justifyContent="flex-start",o.style.alignItems="stretch";for(let t=0;t<e.length;t++){let i=e[t].cloneNode(!0);i.classList.remove(...i.classList),i.style[s]="",i.style.whiteSpace="nowrap !important",i.style.overflow="hidden",o.appendChild(i)}}else if("height"===s){o.style.display="flex";for(let t=0;t<e.length;t++){let i=e[t].cloneNode(!0);i.style[s]="",i.style.whiteSpace="break-spaces",o.appendChild(i)}}o.style.visibility="hidden",o.style.top="0px",this.m_root.appendChild(o);let r="column"===t?this.m_databody.offsetWidth:this.m_databody.offsetHeight,l="column"===t?this._getCellPaddingBorder(s,this.m_resizingElement):0;return i=("column"===t?Math.ceil(o.firstElementChild.getBoundingClientRect().width):Math.ceil(o.firstElementChild.getBoundingClientRect().height))+l,i=i<n?n:i,i=i>r?r:i,this.m_root.removeChild(o),i},z.prototype.getHeaderEdgePixels=function(e){var t,i,s=0,n=0;if(this.m_utils.isTouchDevice()){var o=this.findPos(e);s=o[0],n=o[1]}return this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))?(t=this.calculateColumnHeaderWidth(e),i=this.getElementHeight(e)):(t=this.getElementWidth(e),i=this.calculateRowHeaderHeight(e)),[s,n,s+t,n+i]},z.prototype.getHeaderLabelEdgePixels=function(e){var t,i,s=this.findPos(e),n=s[0],o=s[1];return this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnheaderlabel"))?(t=this.calculateColumnHeaderWidth(e),i=this.getElementHeight(e)):(t=this.getElementWidth(e),i=this.calculateRowHeaderLabelHeight(e)),[n,o,n+t,o+i]},z.prototype.unhighlightSelection=function(){for(var e=this.GetSelection(),t=0;t<e.length;t+=1)this.unhighlightRange(e[t]);this.getResources()&&this._clearHeaderHighLight()},z.prototype.unhighlightRange=function(e){var t=this.getElementsInRange(e);this.unhighlightElems(t),this._applyBorderClassesAroundRange(t,e,!1,"Selected")},z.prototype.highlightRange=function(e,t){const i=this.getHeadersByRange(e,"row"),s=this.getHeadersByRange(e,"column");this._highlightHeaders(e,i,s);var n,o=this.getElementsInRange(e);(this.highlightElems(o,e),this._applyBorderClassesAroundRange(o,e,!0,"Selected"),t)&&(n=1===this.GetSelection().length?o.length:this._getCurrentSelectionCellCount(),this._setAccInfoText("accessibleMultiCellSelected",{num:n}))},z.prototype.getHeadersByRange=function(e,t){const i=new Set;let s,n,o,r;if("row"===t&&this.m_rowHeaderLevelCount>0){for(e.endIndex&&e.endIndex.row&&(r=e.endIndex.row),r?-1===r&&(r=this.m_endRowHeader):r=e.startIndex.row,n=Math.max(this.m_startRowHeader,e.startIndex.row);n<=r;n++)for(s=this._getHeaderCellsByIndex(n,t),o=0;o<s.length;o++)i.add(s[o])}else if("column"===t&&this.m_columnHeaderLevelCount>0){for(e.endIndex&&e.endIndex.column&&(r=e.endIndex.column),r?-1===r&&(r=this.m_endColHeader):r=e.startIndex.column,n=Math.max(this.m_startColHeader,e.startIndex.column);n<=r;n++)for(s=this._getHeaderCellsByIndex(n,t),o=0;o<s.length;o++)i.add(s[o])}if("row"===t&&this.m_rowEndHeaderLevelCount>0){for(e.endIndex&&e.endIndex.row&&(r=e.endIndex.row),r?-1===r&&(r=this.m_endRowHeader):r=e.startIndex.row,n=Math.max(this.m_startRowEndHeader,e.startIndex.row);n<=r;n++)for(s=this._getHeaderCellsByIndex(n,"rowEnd"),o=0;o<s.length;o++)i.add(s[o])}else if("column"===t&&this.m_columnEndHeaderLevelCount>0){for(e.endIndex&&e.endIndex.column&&(r=e.endIndex.column),r?-1===r&&(r=this.m_endColHeader):r=e.startIndex.column,n=Math.max(this.m_startColEndHeader,e.startIndex.column);n<=r;n++)for(s=this._getHeaderCellsByIndex(n,"columnEnd"),o=0;o<s.length;o++)i.add(s[o])}return i},z.prototype._highlightHeaders=function(e,t,i){t.forEach(t=>{const i=t[this.getResources().getMappedAttribute("context")];null==e.endIndex.column||-1===e.endIndex.row&&-1===e.endIndex.column||-1===e.endIndex.column&&0===e.startIndex.column&&this._isHeaderSelected(i,"row")?(t.classList.remove(this.getMappedStyle("headerPartialSelected")),t.classList.add(this.getMappedStyle("headerAllSelected"))):(t.classList.remove(this.getMappedStyle("headerAllSelected")),t.classList.add(this.getMappedStyle("headerPartialSelected")))}),i.forEach(t=>{const i=t[this.getResources().getMappedAttribute("context")];-1===e.endIndex.row&&-1===e.endIndex.column||-1===e.endIndex.row&&0===e.startIndex.row&&this._isHeaderSelected(i,"column")?(t.classList.remove(this.getMappedStyle("headerPartialSelected")),t.classList.add(this.getMappedStyle("headerAllSelected"))):(t.classList.remove(this.getMappedStyle("headerAllSelected")),t.classList.add(this.getMappedStyle("headerPartialSelected")))})},z.prototype._isHeaderSelected=function(e,t){let i=!1;return this.GetSelection().forEach(s=>{e.index>=s.startIndex[t]&&e.index+(e.extent-1)<=s.endIndex[t]&&(i=!0)}),i},z.prototype._clearHeaderHighLight=function(){const e=this.getMappedStyle("headerAllSelected"),t=this.getMappedStyle("headerPartialSelected"),i=this.getMappedStyle("headercell"),s=this.getMappedStyle("endheadercell"),n=this.m_root.querySelectorAll("."+e+"."+i+",."+e+"."+s+",."+t+"."+i+",."+t+"."+s);for(let i=0;i<n.length;i++)n[i].classList.remove(e,t,this.getMappedStyle("draggableItem"))},z.prototype._getCurrentSelectionCellCount=function(){for(var e=0,t=this.GetSelection(),i=0;i<t.length;i++){var s=this.getElementsInRange(t[i]);null!=s&&(e+=s.length)}return e},z.prototype.unhighlightElems=function(e){if(null!=e&&0!==e.length)for(let t=0;t<e.length;t+=1){let i=e[t],s=["selected","topSelected","bottomSelected","startSelected","endSelected"];this._unhighlightElement(i,s)}},z.prototype.highlightElems=function(e){if(null!=e&&0!==e.length)for(let t=0;t<e.length;t+=1)this._highlightElement(e[t],["selected"])},z.prototype.applySelection=function(e,t,i,s){for(var n=this.GetSelection(),o=0;o<n.length;o+=1){var r=this.getElementsInRange(n[o],e,t,i,s);if(this.highlightElems(r),this._applyBorderClassesAroundRange(r,n[o],!0,"Selected"),this.m_dragIndex&&r&&r.length)for(let e=0;e<r.length;e++)this._highlightElement(r[e],["dragSourceOpaque"])}},z.prototype.handleDatabodySelectionDrag=function(e){var t,i;if(this.m_utils.isTouchDevice()?t=this.findCell(document.elementFromPoint(e.touches[0].clientX,e.touches[0].clientY)):(i=e.target,t=this.findCell(i)),null!=t){var s=this.getCellIndexes(t);this.m_deselectInProgress?this.extendDeselection(s,e):this.isHeaderSelectionType(this.m_selectionFrontier)?this.extendSelectionHeader(t,e):this.extendSelection(s,e)}},z.prototype.handleHeaderClickSelection=function(e){var t,i,s,n,o=e.target,r=this.findHeader(o),l=e.shiftKey,a=this.isMultipleSelection(),h=this.m_utils.ctrlEquivalent(e);if(l&&a||!r||this._setActive(r,this._createActiveObject(r),e),null==this.m_active||"header"!==this.m_active.type&&!e.shiftKey)return!1;var d=r[this.getResources().getMappedAttribute("context")];if(t=d.axis,i=d.index,n=d.extent,h&&this._shouldDeselectHeader(i,n,t)){var m,c,u,_;-1!==t.indexOf("row")?(m=this.createIndex(i,0),c=this.createIndex(i+n-1,-1),_=this._getSelectionStartAndEnd(m,c,0),u=this.createRange(this.createIndex(_.min.row,0),this.createIndex(_.max.row,-1))):(m=this.createIndex(0,i),c=this.createIndex(-1,i+n-1),_=this._getSelectionStartAndEnd(m,c,0),u=this.createRange(this.createIndex(0,_.min.column),this.createIndex(-1,_.max.column)));var p=this._trimRangeForSelectionMode(u);return this.m_deselectInfo={anchor:p.startIndex,selection:this.GetSelection(),axis:-1!==t.indexOf("row")?"row":"column",sourceParent:r},void(this.m_deselectInProgress=this._deselectRange(p,e))}"header"===this.m_active.type&&(t=this.m_active.axis,i=this.m_active.index,s=this.m_active.level),this.m_utils.isTouchDevice()?(this._removeTouchSelectionAffordance(),this._selectHeader(t,i,s,e)):l&&a?(null==t&&(t=d.axis),(-1!==t.indexOf("row")&&-1!==d.axis.indexOf("row")||-1!==t.indexOf("column")&&-1!==d.axis.indexOf("column"))&&this.extendSelectionHeader(r,e)):2!==e.button&&this._selectHeader(t,i,s,e)},z.prototype.discontiguousHeaderSetActiveFromDatabody=function(e,t,i,s){var n=t.replace("End",""),o=this.m_selection[this.m_selection.length-1];this.unhighlightSelection(),o.startIndex.row===this.m_active.indexes.row&&o.endIndex.row===this.m_active.indexes.row&&o.startIndex.column===this.m_active.indexes.column&&o.endIndex.column===this.m_active.indexes.column&&this.m_selection.pop(),this._setActive(i,{type:"header",index:this.m_trueIndex[n],level:s-1,axis:t},e,!1),this.rehighlightSelection()},z.prototype.handleDragAnchorChange=function(e){if(this.m_headerDragState){var t,i,s=e.target,n=this.findHeader(s),o=n[this.getResources().getMappedAttribute("context")],r=this._getActiveElement(),l=r[this.getResources().getMappedAttribute("context")],a=this._getAttribute(r.parentNode,"start",!0),h=a+(this._getAttribute(r.parentNode,"extent",!0)-1);if(!o.extent)return;1===o.extent?(t=o.index,i=o.index):i=(t=this._getAttribute(n.parentNode,"start",!0))+(this._getAttribute(n.parentNode,"extent",!0)-1),1!==l.extent?(t<=a&&i>=h||t>=a&&i<=h)&&this._setActive(n,this._createActiveObject(n),e):t!==i&&t<=a&&a<=i&&this._setActive(n,this._createActiveObject(n),e)}},z.prototype.handleDatabodyClickSelection=function(e){var t,i=e.target,s=this.findCell(i);if(null!=s&&(t=this.getCellIndexes(s)),null!=t){if(this.isMultipleSelection()&&2===e.button&&this._isContainSelection(t))return;var n=this.m_utils.ctrlEquivalent(e),o=e.shiftKey;if(this.m_utils.containsCSSClassName(s,this.getMappedStyle("selected"))&&n){this.m_deselectInfo={anchor:t,selection:this.GetSelection()};var r=this.getCellEndIndexes(s),l=this._trimRangeForSelectionMode(this.createRange(t,r));return void(this.m_deselectInProgress=this._deselectRange(l,e))}this.isMultipleSelection()?(this._removeTouchSelectionAffordance(),this.m_utils.isTouchDevice()?(null!=this.m_active&&this._unhighlightActive(),this.selectAndFocus(t,e,!1)):n?n&&o?this.extendSelection(t,e):this.selectAndFocus(t,e,!0):o?this.extendSelection(t,e):this.selectAndFocus(t,e,!1)):this.selectAndFocus(t,e,!1)}},z.prototype._doRangesOverlap=function(e,t){var i=e.startIndex,s=i.column,n=i.row,o=e.endIndex,r=o.column,l=o.row,a=t.startIndex,h=a.column,d=a.row,m=t.endIndex,c=m.column,u=m.row;return(s<=c||-1===c||void 0===c)&&(r>=h||-1===r||void 0===r)&&(n<=u||-1===u)&&(l>=d||-1===l)},z.prototype._isRangeValid=function(e){return(e.startIndex.row<=e.endIndex.row||e.startIndex.row>=0&&-1===e.endIndex.row)&&(e.startIndex.column<=e.endIndex.column||e.startIndex.column>=0&&-1===e.endIndex.column||void 0===e.startIndex.column&&void 0===e.endIndex.column)},z.prototype._deselectRange=function(e,t){var i=this.m_deselectInfo.selection,s=e.startIndex,n=s.column,o=s.row,r=e.endIndex,l=r.column,a=r.row,h=!1,d=[],m=0,c=[],u=this;return i.forEach(function(t){var i=t.startIndex,s=i.column,r=i.row,_=t.endIndex,p=_.column,g=_.row;if(this._doRangesOverlap(t,e)){var C,f,y=function(e,t,i){return new Promise(function(s){u._createRangeWithKeys(e,t,function(e){d[i]=e,s()})})};h=!0,r<o&&(C=this.createIndex(r,s),f=this.createIndex(o-1,p),this._isRangeValid({startIndex:C,endIndex:f})&&(c.push(y(C,f,m)),m+=1)),-1!==a&&(C=this.createIndex(a+1,s),f=this.createIndex(g,p),this._isRangeValid({startIndex:C,endIndex:f})&&(c.push(y(C,f,m)),m+=1)),s<n&&void 0!==s&&(C=this.createIndex(Math.max(o,r),s),f=this.createIndex(Math.min(-1===a?g:a,-1===g?a:g),n-1),this._isRangeValid({startIndex:C,endIndex:f})&&(c.push(y(C,f,m)),m+=1)),-1!==l&&void 0!==s&&(C=this.createIndex(Math.max(o,r),l+1),f=this.createIndex(Math.min(-1===a?g:a,-1===g?a:g),p),this._isRangeValid({startIndex:C,endIndex:f})&&(c.push(y(C,f,m)),m+=1))}else d[m]=t,m+=1},this),!!h&&(Promise.all(c).then(function(){var e=u.m_selection;u.SetSelection(d),u._compareSelectionAndFire(t,e)}),!0)},z.prototype._shouldDeselectHeader=function(e,t,i){var s,n,o=this.GetSelection();"row"===i||"rowEnd"===i?(s="row",n="column"):(s="column",n="row");var r=!1,l=this.m_options.getSelectionMode();return o.forEach(function(i){var o=i.startIndex[n],a=i.endIndex[n];if(0===o&&-1===a||"row"===l&&"row"===s){var h=i.startIndex[s],d=i.endIndex[s];h<=e&&(d>=e+t-1||-1===d)&&(r=!0)}}),r},z.prototype._handleSelectAll=function(e){return!(!this._isSelectionEnabled()||!this.isMultipleSelection())&&("row"===this.m_options.getSelectionMode()?this._selectRange(this.createIndex(0),this.createIndex(-1),e):this._selectRange(this.createIndex(0,0),this.createIndex(-1,-1),e),this.m_utils.isTouchDevice()&&this.m_topSelectIconContainer&&this.m_bottomSelectIconContainer&&(this.m_topSelectIconContainer.parentNode.removeChild(this.m_topSelectIconContainer),this.m_bottomSelectIconContainer.parentNode.removeChild(this.m_bottomSelectIconContainer)),!0)},z.prototype._isContainSelection=function(e,t){null==t&&(t=this.GetSelection());for(var i=0;i<t.length;i+=1){var s=t[i],n=s.startIndex,o=this.getEndIndex(s),r=n.row,l=o.row;if(e.row>=r&&(-1===l||e.row<=l)){var a=n.column,h=o.column;if(isNaN(a)||isNaN(h))return!0;if(e.column>=a&&(-1===h||e.column<=h))return!0}}return!1},z.prototype._isHeaderInsideSelection=function(e,t){const i=this.GetSelection();for(let s=0;s<i.length;s+=1){let n=i[s],o=n.startIndex,r=this.getEndIndex(n),l=o.row,a=r.row,h=o.column,d=r.column;if("column"===t||"columnEnd"===t){if(e>=h&&(-1===d||e<=d)&&0===l&&-1===a)return!0}else if(("row"===t||"rowEnd"===t)&&e>=l&&(-1===a||e<=a)&&0===h&&-1===d)return!0}return!1},z.prototype._getContainedSelectionCssClass=function(e,t){var i=[],s={contains:!1,class:[]};null==t&&(t=this.GetSelection());for(var n=0;n<t.length;n+=1){var o=t[n],r=o.startIndex,l=this.getEndIndex(o),a=r.row,h=l.row,d=r.column,m=l.column;e.row>=a&&(-1===h||e.row<=h)&&(e.column>=d&&(-1===m||e.column<=m)||isNaN(d)||isNaN(m))&&(e.row===a&&i.push("topSelected"),e.row===h&&i.push("bottomSelected"),(isNaN(d)||isNaN(m))&&(s.contains=!0,s.class=i),e.column>=d&&(-1===m||e.column<=m)&&(e.column===d&&i.push("startSelected"),e.column===m&&i.push("endSelected"),s.contains=!0,s.class=i))}return s},z.prototype._compareSelections=function(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i+=1){for(var s=!1,n=0;n<t.length;n+=1)this._compareIndividualSelectionObjects(e[i],t[n])&&(s=!0);if(!1===s)return!1}return!0},z.prototype._compareIndividualSelectionObjects=function(e,t){return e.startIndex.row===t.startIndex.row&&e.startIndex.column===t.startIndex.column&&e.endIndex.row===t.endIndex.row&&e.endIndex.column===t.endIndex.column},z.prototype._clearSelection=function(e){this.unhighlightSelection(),this._removeTouchSelectionAffordance();var t=this.GetSelection();this.m_selection=[],this._compareSelectionAndFire(e,t)},z.prototype.setDiscontiguousSelectionMode=function(e){this.m_discontiguousSelection=e,this._setAccInfoText(e?"accessibleRangeSelectModeOn":"accessibleRangeSelectModeOff")},z.prototype._selectEntireRow=function(e,t,i){var s=this.createIndex(e,0),n=this.createIndex(t,-1),o=this._getSelectionStartAndEnd(s,n,0);"row"===this.m_options.getSelectionMode()?this._selectRange(this.createIndex(o.min.row),this.createIndex(o.max.row),i):this._selectRange(this.createIndex(o.min.row,0),this.createIndex(o.max.row,-1),i)},z.prototype._selectEntireColumn=function(e,t,i){var s=this.createIndex(0,e),n=this.createIndex(-1,t),o=this._getSelectionStartAndEnd(s,n,0);this._selectRange(this.createIndex(0,o.min.column),this.createIndex(-1,o.max.column),i)},z.prototype._selectRange=function(e,t,i){this.unhighlightSelection(),this._createRangeWithKeys(e,t,this._selectRangeCallback.bind(this,i))},z.prototype._selectRangeCallback=function(e,t){var i,s=this.GetSelection();(i=this.m_discontiguousSelection||!e||this.m_utils.ctrlEquivalent(e)&&this.isMultipleSelection()&&0===e.button?this.m_utils.ctrlEquivalent(e)&&this.isMultipleSelection()&&!0===e.shiftKey?s.slice(0,s.length-1):s.slice(0):[]).push(t),this.m_selection=i,this.rehighlightSelection(),this._isDatabodyCellActive()&&e.target[this.getResources().getMappedAttribute("context")]&&!e.target[this.getResources().getMappedAttribute("context")].axis&&!this.m_selectionFrontier.axis&&(this.m_selectionFrontier=this.m_active.indexes,this._highlightActive()),this._compareSelectionAndFire(e,s)},z.prototype.rehighlightSelection=function(){for(var e=0;e<this.m_selection.length;e++)this.highlightRange(this.m_selection[e])},z.prototype.GetSelection=function(){return null==this.m_selection&&(this.m_selection=[]),this.m_selection},z.prototype.SetSelection=function(e){void 0!==e&&(null===e&&(e=[]),this.unhighlightSelection(),this.m_selection=e,this._resetHeaderHighLight(),null!=this.m_databody&&this.applySelection(this.m_startRow,this.m_endRow,this.m_startCol,this.m_endCol),this.m_bottomFloodFillIconContainer&&(1===this.m_selection.length?this._moveFloodFillAffordance():this._removeFloodFillAffordance()))},z.prototype.fireSelectionEvent=function(e,t){var i={event:e,ui:{selection:this.GetSelection(),previousSelection:t}};this.fireEvent("select",i)},z.prototype.extendSelection=function(e,t,i){if("header"!==this.m_active.type){var s;if(this.m_utils.isTouchDevice())s=this.m_touchSelectAnchor;else s={row:this.m_active.indexes.row,column:this.m_active.indexes.column};if(null!=s){this._resetSelectionFrontierFocus();var n=this._updateSelectionFrontier(s,e,i),o=n.min,r=n.max;if("row"===this.m_options.getSelectionMode()&&(o=this.createIndex(o.row),r=this.createIndex(r.row)),this.m_discontiguousSelection&&(this.m_deselectInProgress||this._isContainSelection(s,this.GetSelection().slice(0,-1)))){this.m_deselectInProgress||(this.m_deselectInfo={anchor:s,selection:this.GetSelection()});var l=this._trimRangeForSelectionMode(this.createRange(o,r));this.m_deselectInProgress=this._deselectRange(l,t)}else this._createRangeWithKeys(o,r,this._extendSelectionCallback.bind(this,t,s))}}},z.prototype.extendDeselection=function(e,t){var i=this.m_deselectInfo.anchor,s=this._updateSelectionFrontier(i,e),n=s.min,o=s.max,r=this._trimRangeForSelectionMode(this.createRange(n,o));this._deselectRange(r,t)},z.prototype.extendSelectionHeader=function(e,t,i,s){if(null!==e){var n=this.findCellOrHeader(e);if(null!==n){var o,r,l,a,h,d=n[this.getResources().getMappedAttribute("context")];if(null==i&&(i=this.m_discontiguousSelection),d){if(d.cell)a=l=-1!==this.m_selectionFrontier.axis.indexOf("column")?d.indexes.column:d.indexes.row,h=l;else{if(this.m_selectionFrontier&&d.index===this.m_selectionFrontier.index&&d.level===this.m_selectionFrontier.level)return;1===d.extent?(l=d.index,a=d.index,h=d.index):a=(l=this._getAttribute(e.parentNode,"start",!0))+(this._getAttribute(e.parentNode,"extent",!0)-1)}var m=s?this.m_deselectInfo.sourceParent:this._getActiveElement();if(m){var c,u,_,p=m[this.getResources().getMappedAttribute("context")];if(s?(r=this.m_deselectInfo.axis,o=this.m_deselectInfo.anchor[r],u=(c=this._getAttribute(m.parentNode,"start",!0))+(this._getAttribute(m.parentNode,"extent",!0)-1)):this.m_utils.isTouchDevice()?(-1===(o=-1!==this.m_selectionFrontier.axis.indexOf("column")?this.m_touchSelectAnchor.column:this.m_touchSelectAnchor.row)&&(o=0),c=o,u=o,r=this.m_selectionFrontier.axis):(u=(c=this._getAttribute(m.parentNode,"start",!0))+(this._getAttribute(m.parentNode,"extent",!0)-1),"header"===this.m_active.type&&(r=this.m_active.axis,o=this.m_active.index)),"cell"===this.m_active.type?(_=1,o=-1!==(r=d.axis).indexOf("row")?this.m_active.indexes.row:this.m_active.indexes.column):_=p.extent,i&&!s){var g=this.m_selection[this.m_selection.length-1];this.unhighlightSelection(),g&&this.checkCorners(r,o,g)&&this.m_selection.pop()}if(1!==_?l<=c&&a>=u||l>=c&&a<=u?(this.m_headerDragState||this._setActive(n,this._createActiveObject(n),t),o=l,h=a):l>c&&a>u?(o=c,h=a):l<c&&a<u&&(o=l,h=u):1===_&&l!==a&&(l<=o&&o<=a?(this.m_headerDragState||"cell"===this.m_active.type||this._setActive(n,this._createActiveObject(n),t),o=l,h=a):l<=o&&a<=o?(h=o,o=l):l>=o&&a>=o&&(h=a)),d.cell?this.setHeaderSelectionFrontier(r,h,h,this.m_selectionFrontier.level,n,!0):this.setHeaderSelectionFrontier(r,h,d.index,d.level,n,!0),!s&&r)-1!==r.indexOf("column")?this._selectEntireColumn(o,h,t):-1!==r.indexOf("row")&&this._selectEntireRow(o,h,t);else{var C,f=Math.min(o,h),y=Math.max(o,h);C=null!=r&&-1!==r.indexOf("row")?this.createRange(this.createIndex(f,0),this.createIndex(y,-1)):this.createRange(this.createIndex(0,f),this.createIndex(-1,y));var E=this._trimRangeForSelectionMode(C);this._deselectRange(E,t)}}}}}},z.prototype._updateSelectionFrontier=function(e,t,i){var s,n,o;if("row"===this.m_options.getSelectionMode()?(s=this.createIndex(e.row,this.m_startCol),n=this.createIndex(t.row,this.m_endCol)):(s=e,n=t),null!=i){if(this.m_deselectInProgress)o=this.createRange(this.m_deselectInfo.anchor,this.m_selectionFrontier);else{var r=this.GetSelection();o=r[this._getLastAnchoredSelectionIndex(r,s)]}var l=o.startIndex,a=o.endIndex;l.row===this.m_selectionFrontier.row&&s.row!==l.row?s.row=a.row:a.row===this.m_selectionFrontier.row&&s.row!==a.row&&(s.row=l.row),l.column===this.m_selectionFrontier.column&&s.column!==l.column?s.column=a.column:a.column===this.m_selectionFrontier.column&&s.column!==a.column&&(s.column=l.column)}var h=this._getSelectionStartAndEnd(s,n,0),d=n;if(null!=i){var m=h.min,c=h.max;for("row"===this.m_options.getSelectionMode()&&(m=this.createIndex(m.row),c=this.createIndex(c.row));this._compareIndividualSelectionObjects(o,this.createRange(m,c));){if(i===this.keyCodes.LEFT_KEY){if(0===n.column)break;n.column-=1}else if(i===this.keyCodes.RIGHT_KEY){if(n.column===this.m_endCol)break;n.column+=1}else if(i===this.keyCodes.UP_KEY){if(0===n.row)break;n.row-=1}else{if(i!==this.keyCodes.DOWN_KEY)break;if(n.row===this.m_endRow)break;n.row+=1}m=(h=this._getSelectionStartAndEnd(s,n,0)).min,c=h.max,"row"===this.m_options.getSelectionMode()&&(m=this.createIndex(m.row),c=this.createIndex(c.row))}i===this.keyCodes.LEFT_KEY?(d.column=m.column<s.column?m.column:c.column,d.row=m.row<s.row?m.row:c.row):i===this.keyCodes.RIGHT_KEY?(d.column=c.column>s.column?c.column:m.column,d.row=m.row<s.row?m.row:c.row):i===this.keyCodes.UP_KEY?(d.row=m.row<s.row?m.row:c.row,d.column=m.column<s.column?m.column:c.column):i===this.keyCodes.DOWN_KEY&&(d.row=c.row>s.row?c.row:m.row,d.column=m.column<s.column?m.column:c.column)}else d=this.getCellIndexes(this._getCellByIndex(d));return"row"===this.m_options.getSelectionMode()&&(d=this.createIndex(d.row,this.m_active.indexes.column)),this.m_selectionFrontier=d,h},z.prototype._getMinOrMax=function(e,t,i){return isNaN(e)?isNaN(t)?null:t:isNaN(t)?e:i(e,t)},z.prototype._getSelectionStartAndEnd=function(e,t,i){var s=this.getElementsInRange(this.createRange(e,t));if(null==s||s.length===i)return{min:e,max:t};for(var n={row:this._getMinOrMax(e.row,t.row,Math.min),column:this._getMinOrMax(e.column,t.column,Math.min)},o={row:this._getMinOrMax(e.row,t.row,Math.max),column:this._getMinOrMax(e.column,t.column,Math.max)},r=0;r<s.length;r++){var l=this.getCellIndexes(s[r]),a=this.getCellEndIndexes(s[r]);(l.row<n.row||null==n.row)&&(n.row=l.row),(l.column<n.column||null==n.column)&&(n.column=l.column),(a.row>o.row||null==o.row)&&(o.row=a.row),(a.column>o.column||null==o.column)&&(o.column=a.column)}return this._getSelectionStartAndEnd(n,o,s.length)},z.prototype._getLastAnchoredSelectionIndex=function(e,t){var i;for(i=e.length-1;i>-1;i--)if(this._isContainSelection(t,[e[i]]))return i;return i-1},z.prototype._extendSelectionCallback=function(e,t,i){var s=this.GetSelection(),n=this._getLastAnchoredSelectionIndex(s,t),o=s[n];if(null!=o){var r=o.startIndex.row===i.startIndex.row;null!=o.startIndex.column&&null!=i.startIndex.column&&(r=r&&o.startIndex.column===i.startIndex.column);var l=o.endIndex.row===i.endIndex.row;if(null!=o.endIndex.column&&null!=i.endIndex.column&&(l=l&&o.endIndex.column===i.endIndex.column),!r||!l){var a;if(this.m_discontiguousSelection||e&&this.m_utils.ctrlEquivalent(e)&&0===e.button?(a=s.slice(0),this.unhighlightRange(o),a.splice(n,1)):(a=[],this.unhighlightSelection()),a.push(i),this.m_selection=a,this.m_discontiguousSelection||e&&this.m_utils.ctrlEquivalent(e)&&0===e.button)for(var h=0;h<this.m_selection.length;h++)this.highlightRange(this.m_selection[h]);else this.highlightRange(i,!0);this._makeSelectionFrontierFocus(),this._compareSelectionAndFire(e,s)}}},z.prototype._resetSelectionFrontierFocus=function(){if(!(null==this.m_selectionFrontier||this._isDatabodyCellActive()&&this.m_selectionFrontier.row===this.m_active.indexes.row&&this.m_selectionFrontier.column===this.m_active.indexes.column)){var e=this.createRange(this.m_selectionFrontier),t=this.getElementsInRange(e);null!=t&&t.length>0&&this._unsetAriaProperties(t[0])}},z.prototype._makeSelectionFrontierFocus=function(){if(!(null==this.m_selectionFrontier||this._isDatabodyCellActive()&&this.m_selectionFrontier.row===this.m_active.indexes.row&&this.m_selectionFrontier.column===this.m_active.indexes.column)){if(this._isDatabodyCellActive()){var e=this.createRange(this.m_active.indexes),t=this.getElementsInRange(e);null!=t&&t.length>0&&this._unsetAriaProperties(t[0])}var i=this.createRange(this.m_selectionFrontier),s=this.getElementsInRange(i);if(null!=s&&0!==s.length){this._updateContextInfo(this.m_selectionFrontier);var n=this.m_utils.containsCSSClassName(s[0],this.getMappedStyle("row"))?s[0].firstChild:s[0];this._setAriaProperties(this._createActiveObject(n),null,n)}}},z.prototype._selectHeader=function(e,t,i,s){var n,o;if(-1!==e.indexOf("row")&&this.m_rowHeaderLevelCount-1===i||-1!==e.indexOf("column")&&this.m_columnHeaderLevelCount-1===i)n=t,o=t;else{var r=this._getActiveElement();o=(n=this._getAttribute(r.parentNode,"start",!0))+(this._getAttribute(r.parentNode,"extent",!0)-1)}-1!==e.indexOf("row")?((n===o&&!this.isMultipleSelection()||this.isMultipleSelection())&&(this.setHeaderSelectionFrontier(e,o,t,i,s.target,!0),this._selectEntireRow(n,o,s)),this._setAccInfoText("accessibleRowSelected",{row:t+1})):-1!==e.indexOf("column")&&(this.setHeaderSelectionFrontier(e,o,t,i,s.target,!0),this._selectEntireColumn(n,o,s),this._setAccInfoText("accessibleColumnSelected",{column:t+1})),this.isMultipleSelection()&&(this.m_headerDragState=!0)},z.prototype.setHeaderSelectionFrontier=function(e,t,i,s,n,o){o&&(this.m_selectionFrontier={}),this.m_selectionFrontier.axis=e,this.m_selectionFrontier.end=t,this.m_selectionFrontier.index=i,this.m_selectionFrontier.level=s,this.m_selectionFrontier.target=n},z.prototype._resetHeaderHighLight=function(){this.GetSelection().forEach(e=>{var t=this.getHeadersByRange(e,"row"),i=this.getHeadersByRange(e,"column");this._highlightHeaders(e,t,i)})},z.prototype.updateSelectionHeader=function(){this.m_selectionFrontier&&this.m_selectionFrontier.target&&(this.m_utils.isTouchDevice()&&this.m_selection.length&&(this.m_touchSelectAnchor=this.m_selection[this.m_selection.length-1].startIndex),this.extendSelectionHeader(this.m_selectionFrontier.target,null)),this._resetHeaderHighLight()},z.prototype.selectAndFocus=function(e,t,i){null==i&&(i=!1),this._resetSelectionFrontierFocus(),this._setActiveByIndex(e,t),"row"===this.m_options.getSelectionMode()&&(e=this.createIndex(e.row));var s=this._getSelectionStartAndEnd(e,e,0),n=s.min,o=s.max;"row"===this.m_options.getSelectionMode()&&(n=this.createIndex(n.row),o=this.createIndex(o.row)),this._createRangeWithKeys(n,o,this._selectAndFocusRangeCallback.bind(this,n,t,i))},z.prototype._selectAndFocusRangeCallback=function(e,t,i,s){var n=this.GetSelection(),o=n.slice(0);i||(this.m_discontiguousSelection||!t||this.isMultipleSelection()&&this.m_utils.ctrlEquivalent(t)&&0===t.button?!this._isDatabodyCellActive()||null==this.m_prevActive||"cell"!==this.m_prevActive.type||this.m_selectionFrontier.row!==this.m_prevActive.indexes.row||this.m_selectionFrontier.column!==this.m_prevActive.indexes.column||this.m_utils.isTouchDevice()||!t.keyCode&&this.isMultipleSelection()||(o.pop(),this._unhighlightDiscontiguousSelection(o)):(this.unhighlightSelection(),o=[])),this.m_selectionFrontier=e,o.push(s),this.m_selection=o,this.highlightRange(s),this._compareSelectionAndFire(t,n)},z.prototype._getSurrondingCellIndexes=function(e,t,i){let s={};return Object.assign(s,t),s[e]+=i,s},z.prototype._unhighlightDiscontiguousSelection=function(e){var t=this._getContainedSelectionCssClass(this.m_prevActive.indexes,e);let i=this._getSurrondingCellIndexes("row",this.m_prevActive.indexes,-1),s=this._getSurrondingCellIndexes("column",this.m_prevActive.indexes,-1),n=this._getSurrondingCellIndexes("row",this.m_prevActive.indexes,1),o=this._getSurrondingCellIndexes("column",this.m_prevActive.indexes,1),r=this._getContainedSelectionCssClass(s,e),l=this._getContainedSelectionCssClass(i,e),a=this._getContainedSelectionCssClass(o,e),h=this._getContainedSelectionCssClass(n,e);if(t.contains){let e=t.class,n=-1!==e.indexOf("topSelected"),o=-1!==e.indexOf("bottomSelected"),d=-1!==e.indexOf("startSelected"),m=-1!==e.indexOf("endSelected"),c=[];e.length?(n&&o?m&&d||(m&&this.unhighlightPreviousColumnCell(r,s),d&&this.getNextColumnCellSelectedClass(a,c),d||m||(this.getNextColumnCellSelectedClass(a,c),this.unhighlightPreviousColumnCell(r,s)),n||this.unhighlightPreviousRowCell(l,i),o||this.getNextRowCellSelectedClass(h,c)):(n&&this.getNextRowCellSelectedClass(h,c),o&&this.unhighlightPreviousRowCell(l,i),n||o||(this.getNextRowCellSelectedClass(h,c),this.unhighlightPreviousRowCell(l,i)),d||this.unhighlightPreviousColumnCell(r,s),m||this.getNextColumnCellSelectedClass(a,c)),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),c)):(this.getNextRowCellSelectedClass(h,c),m||this.getNextColumnCellSelectedClass(a,c),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),c),d||this.unhighlightPreviousColumnCell(r,s),this.unhighlightPreviousRowCell(l,i))}else{let e=["selected","topSelected","startSelected"];h.contains||e.push("bottomSelected"),a.contains||e.push("endSelected"),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),e),l.contains||this._unhighlightElement(this._getCellByIndex(i),["bottomSelected"]),r.contains||this._unhighlightElement(this._getCellByIndex(s),["endSelected"])}},z.prototype.unhighlightPreviousRowCell=function(e,t){e.contains?-1===e.class.indexOf("bottomSelected")&&this._unhighlightElement(this._getCellByIndex(t),["bottomSelected"]):this._unhighlightElement(this._getCellByIndex(t),["bottomSelected"])},z.prototype.unhighlightPreviousColumnCell=function(e,t){e.contains?-1===e.class.indexOf("endSelected")&&this._unhighlightElement(this._getCellByIndex(t),["endSelected"]):this._unhighlightElement(this._getCellByIndex(t),["endSelected"])},z.prototype.getNextColumnCellSelectedClass=function(e,t){e.contains?-1===e.class.indexOf("startSelected")&&t.push("endSelected"):t.push("endSelected")},z.prototype.getNextRowCellSelectedClass=function(e,t){e.contains?-1===e.class.indexOf("topSelected")&&t.push("bottomSelected"):t.push("bottomSelected")},z.prototype._compareSelectionAndFire=function(e,t){var i=this.GetSelection();this.isMultipleSelection()&&i.length>0&&(this.m_utils.isTouchDevice()?(this._addTouchSelectionAffordance(e),this._moveTouchSelectionAffordance()):this.m_options.isFloodFillEnabled()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"cell"===this.m_active.type&&(this._addFloodfillAffordance(e),this._moveFloodFillAffordance())),this._compareSelections(i,t)||(this._resetHeaderHighLight(),this.fireSelectionEvent(e,t))},z.prototype._addTouchSelectionAffordance=function(e){if(null==this.m_topSelectIconContainer&&null==this.m_bottomSelectIconContainer){var t=e.target,i=this.findCell(t);if(i||(i=this.findHeader(t)),!i)return;this.m_topSelectIconContainer=document.createElement("div"),this.m_topSelectIconContainer.className=this.getMappedStyle("toucharea");var s=document.createElement("div");s.className=this.getMappedStyle("selectaffordance"),s.setAttribute("role","button"),s.setAttribute("aria-label",this.getResources().getTranslatedText("accessibleSelectionAffordanceTop")),this.m_topSelectIconContainer.appendChild(s),this.m_bottomSelectIconContainer=document.createElement("div"),this.m_bottomSelectIconContainer.className=this.getMappedStyle("toucharea");var n=document.createElement("div");n.className=this.getMappedStyle("selectaffordance"),n.setAttribute("role","button"),n.setAttribute("aria-label",this.getResources().getTranslatedText("accessibleSelectionAffordanceBottom")),this.m_bottomSelectIconContainer.appendChild(n),this.m_databody.firstChild.appendChild(this.m_topSelectIconContainer),this.m_databody.firstChild.appendChild(this.m_bottomSelectIconContainer),this.m_touchSelectionAffordanceHeight=this.m_topSelectIconContainer.firstElementChild.offsetHeight,this.m_touchSelectionAffordanceWidth=this.m_topSelectIconContainer.firstElementChild.offsetWidth}},z.prototype._addRoundedAffordanceClasses=function(e,t,i,s){if(e&&t)i||"row"!==s?i||"column"!==s?(e.classList.add(this.getMappedStyle("selectaffordancetopcornerbounded")),t.classList.add(this.getMappedStyle("selectaffordancebottomcornerbounded"))):(e.classList.add(this.getMappedStyle("selectaffordancetopcolumn")),t.classList.add(this.getMappedStyle("selectaffordancebottomcolumn"))):(e.classList.add(this.getMappedStyle("selectaffordancetoprow")),t.classList.add(this.getMappedStyle("selectaffordancebottomrow")));else if(t){let e;e=i||"row"!==s?i||"column"!==s?"selectaffordancebottomcornerbounded":"selectaffordancebottomcolumn":"selectaffordancebottomrow",t.classList.add(this.getMappedStyle(e))}},z.prototype._clearRoundedAffordanceClasses=function(e,t){e&&(e.classList.remove(this.getMappedStyle("selectaffordancetopcornerbounded")),e.classList.remove(this.getMappedStyle("selectaffordancetopcolumn")),e.classList.remove(this.getMappedStyle("selectaffordancetoprow"))),t.classList.remove(this.getMappedStyle("selectaffordancebottomcornerbounded")),t.classList.remove(this.getMappedStyle("selectaffordancebottomcolumn")),t.classList.remove(this.getMappedStyle("selectaffordancebottomrow"))},z.prototype._removeTouchSelectionAffordance=function(e){(this._isDatabodyCellActive()||e)&&this.m_topSelectIconContainer&&this.m_topSelectIconContainer.parentNode&&(this.m_topSelectIconContainer.parentNode.removeChild(this.m_topSelectIconContainer),this.m_bottomSelectIconContainer.parentNode.removeChild(this.m_bottomSelectIconContainer))},z.prototype._moveTouchSelectionAffordance=function(){var e,t,i=this.getResources().isRTLMode()?"right":"left",s=this.GetSelection();if(s.length>0){var n=this.m_options.getSelectionMode(),o=this._getTouchSelectionAffordanceSize();if(null!=this.m_topSelectIconContainer&&null!=this.m_bottomSelectIconContainer){var r=this.m_topSelectIconContainer.firstElementChild,l=this.m_bottomSelectIconContainer.firstElementChild;if(this._clearRoundedAffordanceClasses(r,l),"row"===n||-1!==s[s.length-1].endIndex.row&&-1===s[s.length-1].endIndex.column){this._addRoundedAffordanceClasses(r,l,!1,"row");const n=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft-o/2;let a;if(this.setElementDir(this.m_topSelectIconContainer,n,i),this.setElementDir(this.m_bottomSelectIconContainer,n,i),e=this._getAxisCellsByKey(s[s.length-1].startKey.row,"row"),(t=this._getAxisCellsByKey(s[s.length-1].endKey.row,"row"))&&t.length&&(a=t[0]),!a){let e=this.createIndex(-1,0),t=this.getElementsInRange(this.createRange(e,e));a=t[t.length-1]}this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(e[0],"top")-this.m_touchSelectionAffordanceHeight-1,"top"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(a,"top")+this.getElementHeight(a)-o+this.m_touchSelectionAffordanceHeight,"top")}else if(-1!==s[s.length-1].endIndex.column&&-1===s[s.length-1].endIndex.row){this._addRoundedAffordanceClasses(r,l,!1,"column"),e=this._getAxisCellsByKey(s[s.length-1].startKey.column,"column"),t=this._getAxisCellsByKey(s[s.length-1].endKey.column,"column");var a=this.getElementHeight(this.m_databody)/2+this.m_currentScrollTop-o/2;this.setElementDir(this.m_topSelectIconContainer,a,"top"),this.setElementDir(this.m_bottomSelectIconContainer,a,"top"),this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(e[0],"left")-this.m_touchSelectionAffordanceWidth-2,"left"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(t[0],"left")+this.getElementWidth(t[0])-(o-this.m_touchSelectionAffordanceWidth-1),"left")}else{this._addRoundedAffordanceClasses(r,l,!0);var h=this._getCellByIndex(s[s.length-1].startIndex),d=this._getCellByIndex(s[s.length-1].endIndex);if(!d){let e=this.createIndex(-1,-1),t=this.getElementsInRange(this.createRange(e,e));d=t[t.length-1]}this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(h,"top")-this.m_touchSelectionAffordanceHeight-1,"top"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(d,"top")+this.getElementHeight(d)-o+this.m_touchSelectionAffordanceWidth,"top"),this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(h,i)-this.m_touchSelectionAffordanceWidth-2,i),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(d,i)+this.getElementWidth(d)-(o-this.m_touchSelectionAffordanceWidth),i)}null==this.m_topSelectIconContainer.parentNode&&(this.m_databody.firstChild.appendChild(this.m_topSelectIconContainer),this.m_databody.firstChild.appendChild(this.m_bottomSelectIconContainer))}}},z.prototype._scrollTouchSelectionAffordance=function(){var e,t,i=this.m_options.getSelectionMode();if("row"===i)null!=this.m_topSelectIconContainer&&(t=this.getResources().isRTLMode()?"right":"left",e=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft,this.setElementDir(this.m_topSelectIconContainer,e,t),this.setElementDir(this.m_bottomSelectIconContainer,e,t));else if("cell"===i&&this.isHeaderSelectionType(this.m_selectionFrontier)&&null!=this.m_topSelectIconContainer)if(-1!==this.m_selectionFrontier.axis.indexOf("row"))t=this.getResources().isRTLMode()?"right":"left",e=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft,this.setElementDir(this.m_topSelectIconContainer,e,t),this.setElementDir(this.m_bottomSelectIconContainer,e,t);else{var s=this.getElementHeight(this.m_databody)/2+this.m_currentScrollTop;this.setElementDir(this.m_topSelectIconContainer,s,"top"),this.setElementDir(this.m_bottomSelectIconContainer,s,"top")}},z.prototype._getTouchSelectionAffordanceSize=function(){if(null==this.m_touchSelectionAffordanceSize){var e=document.createElement("div");e.className=this.getMappedStyle("toucharea"),e.style.visibilty="hidden",e.style.top="0px",e.style.visibilty="0px",this.m_root.appendChild(e);var t=e.offsetWidth;this.m_root.removeChild(e),this.m_touchSelectionAffordanceSize=t}return this.m_touchSelectionAffordanceSize},z.SORT_ANIMATION_DURATION=800,z.prototype._handleSortContainerMouseOver=function(e){var t=e.target,i=this.findHeader(t),s=this._getSortIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("sortIcon"))&&(this.m_utils.addCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("disabled")))},z.prototype._handleSortMouseOut=function(e){if(!this._databodyEmpty()){var t,i=e.target,s=e.relatedTarget,n=this.findHeader(i);null!=n&&null!=s&&n===this.findHeader(s)||this._displaySortIcon(n),(t=this._getSortIcon(n))&&(this.m_utils.removeCSSClassName(t,this.getMappedStyle("hover")),this.m_utils.containsCSSClassName(t,this.getMappedStyle("selected"))||(this.m_utils.addCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("enabled"))));var o=this._getSortContainer(n);o&&(this.m_utils.removeCSSClassName(o,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(o,this.getMappedStyle("selected")))}},z.prototype._handleSortIconMouseDown=function(e){this._databodyEmpty()||(this.m_utils.addCSSClassName(e,this.getMappedStyle("selected")),this.m_utils.removeCSSClassName(e,this.getMappedStyle("disabled")))},z.prototype._toggleSortIconDirection=function(e,t){if(null!=e){var i=this._getSortIcon(e);"descending"===t&&(this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))?(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortascending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdefault")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortdescending")),i.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc"))):"ascending"===t&&(this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))?(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdescending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdefault")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortascending")),i.setAttribute("title",this.getResources().getTranslatedText("labelSortDsc"))):"default"===t&&(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdescending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortascending")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortdefault")),i.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc")))}},z.prototype._displaySortIcon=function(e){var t=!1;if(null!=e){var i=this._getSortIcon(e);null!=this.m_sortInfo&&(t=this.m_sortInfo.key===this._getKey(e)),t&&this.m_utils.addCSSClassName(i,this.getMappedStyle("default"))}},z.prototype._buildSortIcon=function(e,t,i){var s=document.createElement("div");this.m_utils.addCSSClassName(s,this.getMappedStyle("iconContainer")),this.m_utils.addCSSClassName(s,this.getMappedStyle("sortIcon"));var n=document.createElement("div"),o=this.getMappedStyle("icon")+" "+this.getMappedStyle("clickableicon"),r=null!=this.m_sortInfo&&this.m_sortInfo.axis===i?this.m_sortInfo.key:null;if(e.key===r){var l=null!=this.m_sortInfo&&this.m_sortInfo.axis===i?this.m_sortInfo.direction:null;"ascending"===l?(n.className=this.getMappedStyle("sortascending")+" "+o,t.setAttribute(this.getResources().getMappedAttribute("sortDir"),l),n.setAttribute("title",this.getResources().getTranslatedText("labelSortDsc"))):"descending"===l?(n.className=this.getMappedStyle("sortdescending")+" "+o,t.setAttribute(this.getResources().getMappedAttribute("sortDir"),l),n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc"))):(n.className=this.getMappedStyle("sortdefault")+" "+o,n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc")))}else o+=" "+this.getMappedStyle("disabled"),n.className=this.getMappedStyle("sortdefault")+" "+o,n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc"));return s.appendChild(n),s.addEventListener("mouseover",this._handleSortContainerMouseOver.bind(this)),s},z.prototype._handleKeyboardSort=function(e,t){if(!this._databodyEmpty()){var i=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));i=null==i||"descending"===i?"ascending":"descending",this._doHeaderSort(t,e,i)}},z.prototype._handleHeaderSort=function(e,t){if(!this._databodyEmpty()){var i=e.target,s=this.findHeader(i);null!=s&&(null==t&&(t=null!=this.m_sortInfo&&this.m_sortInfo.key===this._getKey(s)&&"ascending"===this.m_sortInfo.direction?"descending":"ascending"),this._doHeaderSort(e,s,t))}},z.prototype._handleCellSort=function(e,t,i){null==i||this._databodyEmpty()||(this._removeTouchSelectionAffordance(),this._doHeaderSort(e,i,t))},z.prototype._doHeaderSort=function(e,t,i){if(!0!==this.m_isSorting){this.m_delayedSort=null;var s=this._getKey(t),n=this._getAxis(t);if(this._removeSortSelection(),t.setAttribute(this.getResources().getMappedAttribute("sortDir"),i),this.m_sortInfo={event:e,key:s,axis:n,direction:i,header:t},this._toggleSortIconDirection(t,i),this._addSortSelection(),this._setAccInfoText("ascending"===i?"accessibleSortAscending":"accessibleSortDescending",{id:s}),null!=i&&null!=s&&null!=n)if(this._isDataGridProvider())this._fireSortRequestEvent(n);else{this.m_isSorting=!0,this.showStatusText(!this.isSkeletonSupport());var o={axis:n,key:s,direction:i};this.getDataSource().sort(o,{success:this._handleSortSuccess.bind(this),error:this._handleSortError.bind(this)})}}else this.m_delayedSort={event:e,header:t,direction:i}},z.prototype._handleSortError=function(){this.hideStatusText()},z.prototype._removeSortSelection=function(){if(null!=this.m_sortInfo){var e;if(!(e="column"===this.m_sortInfo.axis?this._findHeaderByKey(this.m_sortInfo.key,this.m_colHeader,this.getMappedStyle("colheadercell")):this._findHeaderByKey(this.m_sortInfo.key,this.m_rowHeader,this.getMappedStyle("rowheadercell"))))return;e.removeAttribute(this.getResources().getMappedAttribute("sortDir"));var t=this._getSortIcon(e);this._toggleSortIconDirection(e,"default"),"descending"===this.m_sortInfo.direction&&(this.m_utils.removeCSSClassName(t,this.getMappedStyle("sortdescending")),this.m_utils.addCSSClassName(t,this.getMappedStyle("sortascending"))),this.m_utils.addCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("default")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("selected")),this.m_utils.removeCSSClassName(this._getSortContainer(e),this.getMappedStyle("enabled"))}},z.prototype._addSortSelection=function(){if(null!=this.m_sortInfo){var e;e="column"===this.m_sortInfo.axis?this._findHeaderByKey(this.m_sortInfo.key,this.m_colHeader,this.getMappedStyle("colheadercell")):this._findHeaderByKey(this.m_sortInfo.key,this.m_rowHeader,this.getMappedStyle("rowheadercell"));var t=this._getSortIcon(e);this.m_utils.addCSSClassName(t,this.getMappedStyle("default")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.addCSSClassName(t,this.getMappedStyle("selected"))}},z.prototype._getAxis=function(e){var t=this.getMappedStyle("colheadercell"),i=this.getMappedStyle("rowheadercell");return this.m_utils.containsCSSClassName(e,t)?"column":this.m_utils.containsCSSClassName(e,i)?"row":null},z.prototype._handleSortSuccess=function(){this.hideStatusText(),this._isDatabodyCellActive()?this._indexes({row:this.m_active.keys.row,column:this.m_active.keys.column},this._handlePreSortScrolling):this._fetchForSort(this.m_startRow,this.m_endRow-this.m_startRow+1,!1)},z.prototype._handlePreSortScrolling=function(e){var t=(-1===e.row?0:e.row)*this.m_avgRowHeight,i=t+this.m_avgRowHeight,s=this._isHighWatermarkScrolling();if(this.m_currentScrollTop<=t&&i<=this.m_currentScrollTop+this.getElementHeight(this.m_databody)||s)this._fetchForSort(this.m_startRow,this.m_endRow-this.m_startRow+1,!1);else{this.m_currentScrollTop=Math.min(t,this._getMaxScrollHeight());var n=Math.floor(this.m_currentScrollTop/this.m_avgRowHeight),o=n*this.m_avgRowHeight;this.m_startRow=n,this.m_endRow=-1,this.m_startRowHeader=n,this.m_endRowHeader=-1,this.m_startRowPixel=o,this.m_endRowPixel=o,this.m_startRowHeaderPixel=o,this.m_endRowHeaderPixel=o,this._fetchForSort(n,null,!0)}},z.prototype._fetchForSort=function(e,t,i){var s=document.createDocumentFragment(),n=document.createDocumentFragment();this.fetchHeaders("row",e,s,n,t,{success:this.handleHeadersFetchSuccessForSort.bind(this),error:this.handleCellsFetchError}),this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1,{success:this.handleCellsFetchSuccessForSort.bind(this,s,n,i),error:this.handleCellsFetchError})},z.prototype.handleHeadersFetchSuccessForSort=function(e,t,i,s){var n,o,r,l,a,h,d,m=t.axis,c=t.start,u=t.header,_=t.endHeader;if(this.m_fetching[m]=!1,null!=e){for(n=e.getCount(),l=0,o=0,h=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell"),d=this.getRendererOrTemplate("row");n-o>0;)r=c+o,o+=(a=this.buildLevelHeaders(u,r,0,0,this.m_startRowPixel+l,!0,s,d,e,"row",h,this.m_rowHeaderLevelCount)).count,l+=a.totalHeaderDimension;this.m_endRowHeader=this.m_startRowHeader+(n-1),this.m_endRowHeaderPixel=this.m_startRowHeaderPixel+l}if(null!=i){for(n=i.getCount(),l=0,o=0,h=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell"),d=this.getRendererOrTemplate("rowEnd");n-o>0;)r=c+o,o+=(a=this.buildLevelHeaders(_,r,0,0,this.m_startRowPixel+l,!0,s,d,i,"rowEnd",h,this.m_rowEndHeaderLevelCount)).count,l+=a.totalHeaderDimension;this.m_endRowEndHeader=this.m_startRowEndHeader+(n-1),this.m_endRowEndHeaderPixel=this.m_startRowEndHeaderPixel+l}this._signalTaskEnd()},z.prototype.handleCellsFetchSuccessForSort=function(e,t,i,s,n){var o;this.m_fetching.cells=!1;var r=z.SORT_ANIMATION_DURATION;this.isFetchComplete()&&this.hideStatusText();var l=n[0].start,a=s.getCount("row"),h=n[1].start,d=document.createDocumentFragment(),m=this._addCellsToFragment(d,s,l,this.m_startRowPixel,h,this.m_startColPixel);this.m_endRow=this.m_startRow+(a-1),this.m_endRowPixel=this.m_startRowPixel+m.totalRowHeight;var u=this.m_databody.firstChild,_=this.m_rowHeader.firstChild,p=this.m_rowEndHeader.firstChild;if(!0===i&&(o=this._isHighWatermarkScrolling(),this.m_utils.isTouchDeviceNotIOS()?(this._disableTouchScrollAnimation(),this.scrollTo(this.m_currentScrollLeft,this.m_currentScrollTop)):(this.m_silentScroll=!0,this.m_databody.scrollTop=this.m_currentScrollTop,this._syncScroller())),!r||!this.m_utils.supportsTransitions()||1===a||this.m_rowHeaderLevelCount>1&&null!=this.m_rowHeaderLevelCount||!1===o)this._signalTaskStart(),this._handleSortEnd(d,e,t);else if(this.m_isCustomElementCallback()){this._signalTaskStart("processing sort render");let i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("div");i.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),s.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),n.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),i.className=this.getMappedStyle("info"),s.className=this.getMappedStyle("info"),n.className=this.getMappedStyle("info"),i.appendChild(d),s.appendChild(e),n.appendChild(t),this.m_root.appendChild(i),this.m_root.appendChild(s),this.m_root.appendChild(n);var g=c.getContext(i).getBusyContext().whenReady(),C=c.getContext(s).getBusyContext().whenReady(),f=c.getContext(n).getBusyContext().whenReady();Promise.all([g,C,f]).then(function(){for(;i.childNodes.length>0;)d.appendChild(i.childNodes[0]);for(;s.childNodes.length>0;)e.appendChild(s.childNodes[0]);for(;n.childNodes.length>0;)t.appendChild(n.childNodes[0]);this.m_root.removeChild(i),this.m_root.removeChild(s),this.m_root.removeChild(n),this._signalTaskEnd(),this.processSortAnimationToPosition(r,0,"ease-in",_,e,u,d,p,t)}.bind(this))}else this.processSortAnimationToPosition(r,0,"ease-in",_,e,u,d,p,t);this._signalTaskEnd()},z.prototype._handleSortEnd=function(e,t,i,s,n,o){var r;if(t.childNodes.length>1){if(r=this.m_rowHeader.firstChild,n)for(let e=0;e<n.length;e++){let i=n[e];t.insertBefore(i.element,t.childNodes[i.index])}this.m_utils.empty(r),r.appendChild(t),this.m_subtreeAttachedCallback(r)}if(i.childNodes.length>1){if(r=this.m_rowEndHeader.firstChild,o)for(let e=0;e<o.length;e++){let t=o[e];i.insertBefore(t.element,i.childNodes[t.index])}this.m_utils.empty(r),r.appendChild(i),this.m_subtreeAttachedCallback(r)}var l=this.m_databody.firstChild,a=this.m_rowHeader.firstChild,h=this.m_rowEndHeader.firstChild;if(s)for(let t=0;t<s.length;t++)e.appendChild(s[t]);this._emptyDatabody(l),this._populateDatabody(l,e),this._fireSortEvent(),this._restoreActive(),this.m_isSorting=!1,this._doDelayedSort(),this.m_animating=!1;for(let e=0;e<l.childNodes.length;e++)this.removeTransformMoveStyle(l.childNodes[e]);if(-1!==this.m_endRowHeader)for(let e=0;e<a.childNodes.length;e++)this.removeTransformMoveStyle(a.childNodes[e]);if(-1!==this.m_endRowEndHeader)for(let e=0;e<h.childNodes.length;e++)this.removeTransformMoveStyle(h.childNodes[e]);this._signalTaskEnd(),this._runModelEventQueue()},z.prototype.processSortAnimationToPosition=function(e,t,i,s,n,o,r,l,a){var h,d,m,c,u,_,p,g,C,f,y=this;this._signalTaskStart();var E=n.childNodes.length>1,v=a.childNodes.length>1,w=this.getResources().isRTLMode()?"right":"left",H=this._getViewportBottom(),S=this._getViewportLeft(),x=this._getViewportRight(),b={},R={},I=[];for(c=0;c<o.childNodes.length;c++)u=o.childNodes[c],h=this._getKey(u,"row"),f=(C=this.getElementDir(u,w))+this.getElementWidth(u),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(C,f,d,_)&&(b[h]?b[h].cell.push(u):(m=H,b[h]={cell:[u],oldTop:d,newTop:m}),m-d!=0&&(g=u));for(c=0;c<s.childNodes.length;c++)E&&(u=s.childNodes[c],h=this._getKey(u,"row"),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(S,x,d,_)&&(m=H,b[h]||(b[h]={oldTop:d,newTop:m}),b[h].rowHeader=u));for(c=0;c<l.childNodes.length;c++)E&&(u=l.childNodes[c],h=this._getKey(u,"row"),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(S,x,d,_)&&(m=H,b[h]||(b[h]={oldTop:d,newTop:m}),b[h].rowEndHeader=u));for(c=0;c<r.childNodes.length;c++)u=r.childNodes[c],h=this._getKey(u,"row"),m=this.getElementDir(u,"top"),b[h]?b[h].newTop=m:(d=H,p=m+this.getElementHeight(u),f=(C=this.getElementDir(u,w))+this.getElementWidth(u),this._isCellBoundaryInViewport(C,f,m,p)&&(this.changeStyleProperty(u,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),I.push(u),R[h]?R[h].cell.push(u):R[h]={cell:[u],oldTop:d,newTop:m,add:!0},m-d!=0&&(g=u)));for(let e=0;e<I.length;e++)o.appendChild(I[e]);var M=[];for(c=0;c<n.childNodes.length;c++)if(E){var F=n.childNodes[c];h=this._getKey(F,"row"),b[h]||(p=(m=this.getElementDir(F,"top"))+this.getElementHeight(F),d=H,this._isCellBoundaryInViewport(S,x,m,p)&&(this.changeStyleProperty(F,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),M.push({element:F,index:c}),R[h]||(R[h]={oldTop:d,newTop:m,add:!0}),R[h].rowHeader=F))}for(let e=0;e<M.length;e++)s.appendChild(M[e].element);var z=[];for(c=0;c<a.childNodes.length;c++)if(v){var D=a.childNodes[c];h=this._getKey(D,"row"),b[h]||(p=(m=this.getElementDir(D,"top"))+this.getElementHeight(D),d=H,this._isCellBoundaryInViewport(S,-1,m,p)&&(this.changeStyleProperty(D,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),z.push({element:D,index:c}),R[h].rowEndHeader=D,R[h]||(R[h]={oldTop:d,newTop:m,add:!0})))}for(let e=0;e<z.length;e++)l.appendChild(z[e].element);if(null!=g){var L=this._handleSortEnd.bind(this,r,n,a,I,M,z);y._onEndEvent("transitionend",g,L,e),this.m_animating=!0,setTimeout(function(){var s,n,o,r,l=0,a=Object.keys(b);for(r=0;r<a.length;r++){if(h=a[r],o=b[a[r]],n=t+"ms",s=o.newTop-o.oldTop,o.cell)for(l=0;l<o.cell.length;l++)y.addTransformMoveStyle(o.cell[l],e/2+"ms",n,i,0,s,0);E&&o.rowHeader&&y.addTransformMoveStyle(o.rowHeader,e/2+"ms",n,i,0,s,0),v&&o.rowEndHeader&&y.addTransformMoveStyle(o.rowEndHeader,e/2+"ms",n,i,0,s,0)}for(a=Object.keys(R),r=0;r<a.length;r++){if(h=a[r],o=R[a[r]],n=t*l+"ms",s=0,o.cell)for(var d=0;d<o.cell.length;d++)y.addTransformMoveStyle(o.cell[d],e/2+"ms",n,i,0,s,0);E&&o.rowHeader&&y.addTransformMoveStyle(o.rowHeader,e/2+"ms",n,i,0,s,0),v&&o.rowEndHeader&&y.addTransformMoveStyle(o.rowEndHeader,e/2+"ms",n,i,0,s,0)}},0)}else this._handleSortEnd(r,n,a)},z.prototype._restoreActive=function(){if(null!=this.m_active){var e=this.m_active.axis,t=this.m_sortInfo.originalEvent;if("cell"===this.m_active.type){var i=this._getCellByKeys(this.m_active.keys);if(null!=i){var s=this.getCellIndexes(i);this._isSelectionEnabled()?this.selectAndFocus(s,t):this._setActiveByIndex(s,t)}else this._setActive(null,null,t,!0),this._isSelectionEnabled()&&this._clearSelection(t)}else if("row"===e||"rowEnd"===e){var n="row"===e?this.m_rowHeader:this.m_rowEndHeader,o="row"===e?this.getMappedStyle("rowheadercell"):this.getMappedStyle("rowendheadercell"),r=this._findHeaderByKey(this.m_active.key,n,o);if(null!=r){var l=r[this.getResources().getMappedAttribute("context")];this._setActive(r,{type:"header",axis:e,index:l.index,key:l.key,level:l.level},t)}else this._setActive(null,null,t)}}},z.prototype._getSortIcon=function(e){return e.lastChild.firstChild},z.prototype._getSortContainer=function(e){return e.lastChild},z.prototype._fireSortEvent=function(){var e={event:this.m_sortInfo.event,ui:{header:this.m_sortInfo.key,direction:this.m_sortInfo.direction}};this.fireEvent("sort",e)},z.prototype._fireSortRequestEvent=function(){let e=this.m_sortInfo.header[this.getResources().getMappedAttribute("context")],t=this.m_sortInfo.header[this.getResources().getMappedAttribute("metadata")],i=this.buildHeaderTemplateContext(e,t).item;var s={event:this.m_sortInfo.event,ui:{direction:this.m_sortInfo.direction,item:i,axis:this.m_sortInfo.axis}};this.fireEvent("sortRequest",s)},z.prototype._doDelayedSort=function(){null!=this.m_delayedSort?this._doHeaderSort(this.m_delayedSort.event,this.m_delayedSort.header,this.m_delayedSort.direction):this.fillViewport()},z.prototype._fireExpandRequestEvent=function(e){const t=this.findHeader(e.target),i=t[this.getResources().getMappedAttribute("context")],s=t[this.getResources().getMappedAttribute("metadata")];s.metadata.expanded="expanded";const n={item:this.buildHeaderTemplateContext(i,s).item,axis:i.axis},o=this._getDisclosureIcon(t);this.m_utils.removeCSSClassName(o,this.getMappedStyle("collapsed")),this.m_utils.addCSSClassName(o,this.getMappedStyle("expanded")),this.fireEvent("expandRequest",n)},z.prototype._fireCollapseRequestEvent=function(e){const t=this.findHeader(e.target),i=t[this.getResources().getMappedAttribute("context")],s=t[this.getResources().getMappedAttribute("metadata")];s.metadata.expanded="collapsed";const n={item:this.buildHeaderTemplateContext(i,s).item,axis:i.axis},o=this._getDisclosureIcon(t);this.m_utils.removeCSSClassName(o,this.getMappedStyle("expanded")),this.m_utils.addCSSClassName(o,this.getMappedStyle("collapsed")),this.fireEvent("collapseRequest",n)},z.prototype._handleExpandCollapseRequest=function(e){this._isHeaderExpanded(e.target)?this._fireCollapseRequestEvent(e):this._isHeaderCollapsed(e.target)&&this._fireExpandRequestEvent(e)},z.prototype._isTargetExpandCollapseEnabled=function(e){return this._isHeaderCollapsed(e)||this._isHeaderExpanded(e)},z.prototype._isHeaderCollapsed=function(e){const t=this._getDisclosureIcon(e);return!!t&&this.m_utils.containsCSSClassName(t,this.getMappedStyle("collapsed"))},z.prototype._isHeaderExpanded=function(e){const t=this._getDisclosureIcon(e);return!!t&&this.m_utils.containsCSSClassName(t,this.getMappedStyle("expanded"))},z.prototype._buildDisclosureIcon=function(e){const t=document.createElement("div");t.classList.add(this.getMappedStyle("iconContainer")),t.classList.add(this.getMappedStyle("disclosureIcon"));const i=document.createElement("div");let s;return i.classList.add(this.getMappedStyle("icon")),i.classList.add(this.getMappedStyle("clickableicon")),"expanded"===e.metadata.expanded?(i.classList.add(this.getMappedStyle("expanded")),s=this.getResources().getTranslatedText("collapsedText")):"collapsed"===e.metadata.expanded&&(i.classList.add(this.getMappedStyle("collapsed")),s=this.getResources().getTranslatedText("expandedText")),t.setAttribute("title",s),t.appendChild(i),t.addEventListener("mouseover",this._handleExpandCollapseContainerMouseOver.bind(this)),t.addEventListener("mouseout",this._handleDisclosureMouseOut.bind(this)),t},z.prototype._handleExpandCollapseContainerMouseOver=function(e){const t=e.target,i=this.findHeader(t),s=this._getDisclosureIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("disclosureIcon"))&&(this.m_utils.addCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("disabled")))},z.prototype._buildSpacer=function(e){const t=document.createElement("span");return this._addDataGridSpacerClass(t),this._addIndentation(e,t),t},z.prototype._getTreeDepth=function(e){return e.metadata.treeDepth?e.metadata.treeDepth:null},z.prototype._addDataGridSpacerClass=function(e){this.m_utils.addCSSClassName(e,this.getMappedStyle("spacer"))},z.prototype._isLeaf=function(e){return!e.metadata.expanded||null===e.metadata.expanded},z.prototype._addIndentation=function(e,t){let i=this._getTreeDepth(e);null!==i&&this._appendSpacerClass(i,t,e)},z.prototype._appendSpacerClass=function(e,t,i){t.style.width=e*z.SPACER_DEFAULT_WIDTH+(this._isLeaf(i)?z.SPACER_DEFAULT_WIDTH:0)+"rem"},z.prototype._handleDisclosureMouseOut=function(e){const t=e.target,i=this.findHeader(t),s=this._getDisclosureIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("disclosureIcon"))&&(this.m_utils.removeCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("enabled")))},z.prototype._isDisclosureIcon=function(e){return this.m_utils.containsCSSClassName(e,this.getMappedStyle("icon"))&&this.m_utils.containsCSSClassName(e.parentElement,this.getMappedStyle("disclosureIcon"))},z.prototype._getDisclosureIcon=function(e){return this._isDisclosureIcon(e)?e:e.getElementsByClassName(this.getMappedStyle("icon"))[0]},z.prototype._getDisclosureIconContainer=function(e){return e.firstChild};const D=function(e){this.datagridprovider=e,this.pendingHeaderCallback={},this._registerEventListeners(),this.totalRowCount=-1,this.totalColumnCount=-1,this.rowKeyMap=new T,this.columnKeyMap=new T,D.superclass.constructor.call(this)};function L(e,t,i){this.results=e,this.rowKeyMap=t,this.columnKeyMap=i,this.databodyResults=e.results.databody,this.rowStart=this.results.rowOffset,this.rowCount=this.results.rowCount,this.rowEnd=this.rowStart+this.rowCount-1,this.columnStart=this.results.columnOffset,this.columnCount=this.results.columnCount,this.columnEnd=this.columnStart+this.columnCount-1,this.lastItem=null}function A(e,t,i){this.results=e,this.axis=t,this.axisResults=e.results[this.axis+"Header"],this.axisLabels=e.results[this.axis+"HeaderLabel"],"row"===this.axis||"rowEnd"===this.axis?(this.start=this.results.rowOffset,this.count=this.results.rowCount):(this.start=this.results.columnOffset,this.count=this.results.columnCount),this.end=this.start+this.count-1,this.lastItem=null,this.keyMap=i,this.levelCount=null}function T(){this.keyMap=new Map,this.nextKey=0,this.set=(e,t,i,s)=>{const n=""+this.nextKey;null==s&&(s=1);for(let o=0;o<s;o++){let s=null==t?t:t+o,r=this.pairIndexLevel(e,s,i);this.keyMap.set(r,n)}return this.nextKey+=1,n},this.get=(e,t,i,s)=>{const n=this.pairIndexLevel(e,t,i);let o=this.keyMap.get(n);return null==o&&(o=this.set(e,t,i,s)),o},this.pairIndexLevel=(e,t,i)=>null==t||null!=i&&t===i-1?""+e:e+","+t,this.handleOffsetChange=e=>{let t=new Map;const i=[...this.keyMap.keys()];for(let s=0;s<i.length;s++){let n=i[s].split(",");parseInt(n[0],10)<e&&t.set(i[s],this.keyMap.get(i[s]))}this.keyMap=t},this.handleChange=(e,t)=>{let i=new Set;e.forEach(function(e){let t=e.offset,s=e.count;for(var n=0;n<s;n++)i.add(t+n)});let s=Array.from(i);s.sort(function(e,t){return e-t});let n=new Map;this.keyMap.forEach((e,i)=>{let o=i.split(","),r=parseInt(o[0],10),l=o[1];if(t&&s.some(e=>e===r))return;let a=0;if(r>=s[0]){let e=r;a=s.findIndex(i=>(!t&&e>=i&&(e+=1),i>e)),-1===a&&(a=s.length)}let h=t?r-a:r+a,d=this.pairIndexLevel(h,l);n.set(d,e)}),this.keyMap=n}}h.Object.createSubclass(D,h.DataGridDataSource,"DataGridProviderDataGridDataSource"),D.prototype.fetchHeaders=function(e,t,i){if(null!=t){var s=e.axis,n={headerRange:e,callbacks:t,callbackObjects:i};this.pendingHeaderCallback[s]=n}},D.prototype.fetchCells=function(e,t,i){let s,n,o,r;for(let t=0;t<e.length;t+=1){let i=e[t];"row"===i.axis?(s=i.start,n=i.count):"column"===i.axis&&(o=i.start,r=i.count)}let l,a=this.pendingHeaderCallback.row,h=this.pendingHeaderCallback.column;this.pendingHeaderCallback={},l=a&&h?["all"]:a?["databody","rowHeader","rowEndHeader","rowHeaderLabel","rowEndHeaderLabel"]:h?["databody","columnHeader","columnEndHeader","columnHeaderLabel","columnEndHeaderLabel"]:["databody"];let d={rowOffset:s,columnOffset:o,rowCount:n,columnCount:r,fetchRegions:new Set(l)},m=(s,n)=>{let o,r,l;null!=n?(s.results=Object.assign({},s.results,n.results),null!=n.next&&(o=n.next)):null!=s.next&&(o=s.next),this.totalRowCount=s.totalRowCount,this.totalColumnCount=s.totalColumnCount;let d=s.results;if(h&&(!o||null!=d.columnHeader&&null!=d.columnEndHeader&&null!=d.columnHeaderLabel&&null!=d.columnEndHeaderLabel)&&(r=h.callbacks,null!=r&&null!=r.success)){let e,t;l=h.callbackObjects,null!=d.columnHeader&&(e=new A(s,"column",this.columnKeyMap)),null!=d.columnEndHeader&&(t=new A(s,"columnEnd",this.columnKeyMap)),r.success.call(l.success,e,h.headerRange,t),h=null}if(a&&(!o||null!=d.rowHeader&&null!=d.rowEndHeader&&null!=d.rowHeaderLabel&&null!=d.rowEndHeaderLabel)&&(r=a.callbacks,null!=r&&null!=r.success)){let e,t;l=a.callbackObjects,null!=d.rowHeader&&(e=new A(s,"row",this.rowKeyMap)),null!=d.rowEndHeader&&(t=new A(s,"rowEnd",this.rowKeyMap)),r.success.call(l.success,e,a.headerRange,t),a=null}if(null!=t&&null!=t.success&&!o){let n=new L(s,this.rowKeyMap,this.columnKeyMap);t.success.call(i.success,n,e)}o&&o.then(m.bind(this,s))};this.datagridprovider.fetchByOffset(d).then(m)},D.prototype.getCapability=function(e){return"sort"===e?"full":"sort"===e||"move"===e?"none":null},D.prototype.getCount=function(e){return"row"===e?this.totalRowCount:"column"===e?this.totalColumnCount:-1},D.prototype.getCountPrecision=function(){return"exact"},D.prototype.indexes=function(){return{row:-1,column:-1}},D.prototype.keys=function(){return{row:null,column:null}},D.prototype.move=function(){},D.prototype.moveOK=function(){return"invalid"},D.prototype.sort=function(){},D.prototype._registerEventListeners=function(){this._addListener=this._handleDataGridProviderAddEvent.bind(this),this._removeListener=this._handleDataGridProviderRemoveEvent.bind(this),this._updateListener=this._handleDataGridProviderUpdateEvent.bind(this),this._refreshListener=this._handleDataGridProviderRefreshEvent.bind(this),this.datagridprovider.addEventListener("add",this._addListener),this.datagridprovider.addEventListener("remove",this._removeListener),this.datagridprovider.addEventListener("update",this._updateListener),this.datagridprovider.addEventListener("refresh",this._refreshListener)},D.prototype.Destroy=function(){this.datagridprovider.removeEventListener("add",this._addListener),this.datagridprovider.removeEventListener("remove",this._removeListener),this.datagridprovider.removeEventListener("update",this._updateListener),this.datagridprovider.removeEventListener("refresh",this._refreshListener)},D.prototype.updateTotalCount=function(e,t,i){"row"===t&&-1===this.totalRowCount||"column"===t&&-1===this.totalColumnCount||e.forEach(e=>{let s=i*e.count;"row"===t?this.totalRowCount+=s:"column"===t&&(this.totalColumnCount+=s)})},D.prototype._handleDataGridProviderAddEvent=function(e){var t={source:this,operation:"insert",detail:e.detail};("row"===e.detail.axis?this.rowKeyMap:this.columnKeyMap).handleChange(e.detail.ranges,!1),this.updateTotalCount(e.detail.ranges,e.detail.axis,1),this.handleEvent("change",t)},D.prototype._handleDataGridProviderRemoveEvent=function(e){var t={source:this,operation:"delete",detail:e.detail};("row"===e.detail.axis?this.rowKeyMap:this.columnKeyMap).handleChange(e.detail.ranges,!0),this.updateTotalCount(e.detail.ranges,e.detail.axis,-1),this.handleEvent("change",t)},D.prototype._handleDataGridProviderUpdateEvent=function(e){var t={source:this,operation:"update",detail:e.detail};this.handleEvent("change",t)},D.prototype._handleDataGridProviderRefreshEvent=function(e){let t=!0,i=!0;if(e&&null!=e.detail){const s=e.detail;if(null!=s.disregardAfterColumnOffset){const e=s.disregardAfterColumnOffset+1;this.columnKeyMap.handleOffsetChange(e),i=!1}if(null!=s.disregardAfterRowOffset){const e=s.disregardAfterRowOffset+1;this.rowKeyMap.handleOffsetChange(e),t=!1}}i&&(this.columnKeyMap=new T),t&&(this.rowKeyMap=new T);const s={source:this,operation:"refresh",detail:e.detail};this.handleEvent("change",s)},L.prototype.getData=function(e){return this._findItemByIndex(e.row,e.column).data},L.prototype.getMetadata=function(e){let t=this._findItemByIndex(e.row,e.column);return{metadata:t.metadata,keys:{row:this.rowKeyMap.get(t.rowIndex),column:this.columnKeyMap.get(t.columnIndex)}}},L.prototype.getCount=function(e){if(null!=this.databodyResults){if("row"===e)return this.rowCount;if("column"===e)return this.columnCount}return 0},L.prototype.getExtent=function(e){let t=!1,i=!1,s=!1,n=!1,o=this._findItemByIndex(e.row,e.column),r=o.rowIndex,l=o.rowExtent,a=r+l-1,h=o.columnIndex,d=o.columnExtent,m=h+d-1;return r<this.rowStart&&(l-=this.rowStart-r,t=!0),a>this.rowEnd&&(l-=a-this.rowEnd,i=!0),h<this.columnStart&&(d-=this.columnStart-h,s=!0),m>this.columnEnd&&(d-=m-this.columnEnd,n=!0),{row:{extent:l,more:{before:t,after:i}},column:{extent:d,more:{before:s,after:n}}}},L.prototype._findItemByIndex=function(e,t){let i=i=>{let s=i.rowIndex,n=i.rowExtent,o=i.columnIndex,r=i.columnExtent;return e>=s&&e<s+n&&t>=o&&t<o+r};return null!=this.lastItem&&i(this.lastItem)||(this.lastItem=this.databodyResults.find(i)),this.lastItem},A.prototype.getData=function(e,t){return this._findItemByIndexLevel(e,t).data},A.prototype.getMetadata=function(e,t){let i=this._findItemByIndexLevel(e,t),s=i.metadata.sortDirection;return null!=s&&(s="unsorted"===i.metadata.sortDirection?null:s),{metadata:i.metadata,key:this.keyMap.get(i.index,i.level,this.getLevelCount(),i.depth),sortDirection:s}},A.prototype.getLevelCount=function(){if(null==this.levelCount){let e=0;null!=this.axisResults&&this.axisResults.forEach(t=>{let i=t.level+t.depth-1;i>e&&(e=i)}),this.levelCount=e+1}return this.levelCount},A.prototype.getExtent=function(e,t){let i=this._findItemByIndexLevel(e,t),s=i.extent,n=i.index,o=i.index+s-1,r=!1,l=!1;return n<this.start&&(s-=this.start-n,r=!0),o>this.end&&(s-=o-this.end,l=!0),{extent:s,more:{before:r,after:l}}},A.prototype.getLabel=function(e){return null!=this.axisLabels?this.axisLabels[e].data:null},A.prototype.getLabelMetadata=function(e){return null!=this.axisLabels?{metadata:this.axisLabels[e].metadata}:null},A.prototype.getDepth=function(e,t){return this._findItemByIndexLevel(e,t).depth},A.prototype.getCount=function(){return null!=this.axisResults?this.count:0},A.prototype._findItemByIndexLevel=function(e,t){let i=i=>{let s=i.index,n=i.extent,o=i.level,r=i.depth;return e>=s&&e<s+n&&t>=o&&t<o+r};return null!=this.lastItem&&i(this.lastItem)||(this.lastItem=this.axisResults.find(i)),this.lastItem},h.__registerWidget("oj.ojDataGrid",f.oj.baseComponent,{widgetEventPrefix:"oj",options:{bandingInterval:{row:0,column:0},data:null,gridlines:{horizontal:"visible",vertical:"visible"},scrollToKey:"auto",scrollPosition:{x:0,y:0},selectionMode:{cell:"none",row:"none"},dnd:{reorder:{row:"disable"},drag:null,drop:null},dataTransferOptions:{cut:"disable",copy:"disable",paste:"disable",fill:"disable"},frozenColumnCount:null,frozenRowCount:null,scrollPolicy:"auto",scrollPolicyOptions:{maxRowCount:500,maxColumnCount:500},selection:[],currentCell:null,editMode:"none",header:{row:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},sortable:"auto",style:null,freezable:"disable"},column:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},sortable:"auto",style:null,freezable:"disable"},columnEnd:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},style:null},rowEnd:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},style:null}},cell:{className:null,renderer:null,style:null},resize:null,sort:null,sortRequest:null,collapseRequest:null,expandRequest:null,ready:null,scroll:null,beforeCurrentCell:null,beforeEdit:null,beforeEditEnd:null,cutRequest:null,copyRequest:null,pasteRequest:null,fillRequest:null},_ComponentCreate:function(){this._super(),this.root=this.element[0],this.rootId=this.root.getAttribute("id"),this.grid=new z(this.root),this.grid.setVisibility(z.VISIBILITY_STATE_RENDER),f(this.root).addClass("oj-datagrid oj-component"),f(this.root).attr(m._OJ_CONTAINER_ATTR,this.widgetName),u.disableDefaultBrowserStyling(this.root),this.redrawSet={data:"all",header:["className","renderer","style","template"]}},_AfterCreate:function(){var e=this;this._unregisterResizeListener(this.root),this._removeAllChildren(),this._super(),this.resources=new w(this._GetReadingDirection(),this._getTranslation.bind(e),{showIndicatorDelay:E.getCachedCSSVarValues(["--oj-private-core-global-loading-indicator-delay-duration"])[0],loadIndicator:E.getCachedCSSVarValues(["--oj-private-data-grid-global-load-indicator-default"])[0]},this.widgetName),this._setDataSource(),this._setSelection(),null!=this.datasource&&(this.grid.SetDataSource(this.datasource),this._addContextMenu(),this._isCreate=!0,this.grid._addDataSourceEventListeners()),this._checkSelectionMode(this.options),this.grid.SetOptions(this.options,this._WrapCustomElementRenderer.bind(e)),this.grid.SetResources(this.resources),this.grid.SetCreateContextCallback(this._modifyContext.bind(e)),this.grid.SetFixContextCallback(this._FixRendererContext.bind(e)),this.grid.SetRemoveCallback(this._remove.bind(e)),this.grid.SetUniqueIdCallback(this._uniqueId.bind(e)),this.grid.SetCompareValuesCallback(this._compareValues.bind(e)),this.grid.SetNotReadyCallback(this._NotReady.bind(e)),this.grid.SetMakeReadyCallback(this._MakeReady.bind(e)),this.grid.SetOptionCallback(this.option.bind(e)),this.grid.SetSubtreeAttachedCallback(m.subtreeAttached),this.grid.SetContextCallback(c.getContext),this.grid.SetCustomElementCallback(this._IsCustomElement.bind(e)),this.grid.SetUpdateScrollPostionOnRefreshCallback(this._updateScrollPositionOnRefresh.bind(e)),this.grid.SetCustomElement(this._GetCustomElement()),this._focusable({applyHighlight:!0,setupHandlers:function(t,i){e.grid.SetFocusableCallback.call(e.grid,function(e){return t(f(e))},function(e){return i(f(e))})}}),this._registerEventListeners(),this._possiblyRenderOrRefresh()},_SetupResources:function(){this._super(),this.setupResources(!this._isCreate)},setupResources:function(e){null!=this.datasource&&(e||this.grid._addDataSourceEventListeners(),this.grid._addDomEventListeners(),this._registerResizeListener(this.root)),e&&this.refresh(),this._isCreate=!1},_ReleaseResources:function(){this._super(),this.releaseResources()},releaseResources:function(){this.grid._removeDataSourceEventListeners(),this.grid._removeDomEventListeners(),this._unregisterResizeListener(this.root),this.contextMenuEvent=null,this._removeAllChildren()},_registerEventListeners:function(){var e=this;this.grid.addListener("resize",function(t){e._trigger("resize",t.event,t.ui)}),this.grid.addListener("select",function(t){e.option("selection",t.ui.selection,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})}),this.grid.addListener("currentCell",function(t){e.option("currentCell",t.ui,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})}),this.grid.addListener("beforeCurrentCell",function(t){return e._trigger("beforeCurrentCell",t.event,t.ui)}),this.grid.addListener("sort",function(t){var i=e._trigger2("sort",t.event,t.ui);e.grid.SetSortOriginalEvent(i.event)}),this.grid.addListener("sortRequest",function(t){return e._trigger("sortRequest",t.event,t.ui)}),this.grid.addListener("expandRequest",function(t){return e._trigger("expandRequest",t.event,t)}),this.grid.addListener("collapseRequest",function(t){return e._trigger("collapseRequest",t.event,t)}),this.grid.addListener("keydown",function(t){return e._trigger("keydown",t.event,t.ui)}),this.grid.addListener("ready",function(){e._trigger("ready",null,{})}),this.grid.addListener("scroll",function(t){e._trigger("scroll",t.event,t.ui)}),this.grid.addListener("beforeEdit",function(t){return e._trigger("beforeEdit",t.event,t.ui)}),this.grid.addListener("beforeEditEnd",function(t){return e._trigger("beforeEditEnd",t.event,t.ui)}),this.grid.addListener("cutRequest",function(t){return e._trigger("cutRequest",t.event,t.ui)}),this.grid.addListener("copyRequest",function(t){return e._trigger("copyRequest",t.event,t.ui)}),this.grid.addListener("pasteRequest",function(t){return e._trigger("pasteRequest",t.event,t.ui)}),this.grid.addListener("fillRequest",function(t){return e._trigger("fillRequest",t.event,t.ui)}),this.grid.addListener("rowFreeze",function(t){e.option("frozenRowCount",t.ui.frozenCount,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})}),this.grid.addListener("columnFreeze",function(t){e.option("frozenColumnCount",t.ui.frozenCount,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})})},refresh:function(){this._super();let e=!this._IsCustomElement()||null!=this._defaultContextMenu;e&&this._ReleaseContextMenu(),this.releaseResources(),this._removeAllChildren(),this._defaultContextMenu&&(this.options.contextMenu=null,this._defaultContextMenu=null),this._setDataSource(),null!=this.datasource&&(h.FlattenedTreeDataGridDataSource&&this.datasource instanceof h.FlattenedTreeDataGridDataSource&&(this.datasource.Destroy(),this.datasource.Init()),this.grid.SetDataSource(this.datasource),this._addContextMenu()),this.grid.SetOptions(this.options,this._WrapCustomElementRenderer.bind(this)),this.resources.setRTLMode(this._GetReadingDirection()),this.grid.SetResources(this.resources),e&&this._SetupContextMenu(),this.setupResources(!1),this.grid.getVisibility()!==z.VISIBILITY_STATE_RENDER&&this.grid.setVisibility(z.VISIBILITY_STATE_REFRESH),this._possiblyRenderOrRefresh()},_updateScrollPositionOnRefresh:function(){var e,t=this.options.selection;if(null!=t&&0!==t.length){e={};var i=t[t.length-1];i&&(i.startKey?(e.rowKey=i.startKey.row,e.columnKey=i.startKey.column):i.startIndex&&(e.rowIndex=0,e.columnIndex=0))}else e={x:0,y:0};this.option("scrollPosition",e,{_context:{internalSet:!0},changed:!1})},_destroy:function(){f(this.root).removeAttr(m._OJ_CONTAINER_ATTR),null!=this.datasource&&this.datasource.Destroy&&this.datasource.Destroy(),this.grid.destroy(),this._unregisterResizeListener(this.root),f(this.root).empty(),this._MakeReady()},_setOptions:function(e,t){if(this.datasource){var i=this._handleOptionUpdate(e,t);this._super(e,t),"refresh"===i?this.refresh():"pass"===i&&this.grid.UpdateOptions(e,t)}else this._super(e,t),null!=e.data&&this.refresh()},_checkSelectionMode:function(e){var t=e.selectionMode;if(t&&t.row&&t.cell&&"none"!==t.row&&"none"!==t.cell)throw new Error("JET DataGrid does not support selectionMode on cell and row simultaneously.")},_NotifyShown:function(){this._super(),this._possiblyRenderOrRefresh()},_NotifyHidden:function(){this._super(),this.grid.getVisibility()===z.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(z.VISIBILITY_STATE_HIDDEN)},_NotifyAttached:function(){this._super(),this._possiblyRenderOrRefresh()&&this.grid._initiateScrollOnAttached()},_NotifyDetached:function(){this._super(),this.grid.getVisibility()===z.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(z.VISIBILITY_STATE_HIDDEN)},_VerifyConnectedForSetup:function(){return!0},_handleOptionUpdate:function(e,t){for(var i="ignore",s=Object.keys(e),n=0;n<s.length;n++){switch(s[n]){case"bandingInterval":case"currentCell":case"editMode":case"gridlines":case"scrollPosition":case"selection":case"frozenColumnCount":case"frozenRowCount":i="pass";break;case"beforeCurrentCell":case"beforeEdit":case"beforeEditEnd":case"cutRequest":case"copyRequest":case"pasteRequest":case"fillRequest":case"create":case"disabled":case"dnd":case"optionChange":case"ready":case"resize":case"rootAttributes":case"scroll":case"sort":break;case"selectionMode":this._checkSelectionMode(e),i="pass";break;case"cell":case"header":var o=t.subkey;if(null!=o){var r=o.split(".");if("resizable"===r[1]||"sortable"===r[1]){i="pass";break}}return"refresh";case"data":return this._updateScrollPositionOnRefresh(),"refresh";default:return"refresh"}}return i},_isResizeEnabled:function(e,t){return!(!this.options.header[e]||!this.options.header[e].resizable)&&"disable"!==this.options.header[e].resizable[t]},_isSortEnabled:function(e){return!!this.options.header[e]&&"disable"!==this.options.header[e].sortable},_isFreezeEnabled:function(e){return!!this.options.header[e]&&"disable"!==this.options.header[e].freezable},_removeAllChildren:function(){for(var e=this.root.children,t=e.length-1;t>=0;t--)"TEMPLATE"!==e[t].tagName&&"OJ-SURROGATE"!==e[t].tagName&&("OJ-MENU"!==e[t].tagName||"OJ-MENU"===e[t].tagName&&"contextMenu"!==e[t].slot)&&this._remove(e[t])},_GetDefaultContextMenu:function(){return this._defaultContextMenu},_addContextMenu:function(){var e=this,t=e._IsCustomElement(),i=this._GetContextMenu()?this._GetContextMenu():this._menuContainer;if(i){null==this._menuItemsSetByGrid&&(this._menuItemsSetByGrid=[]),this._menuContainer=i;var s=(i=f(i)).find("[data-oj-command]"),n=[];s.each(function(){var i=e._shouldUpdateListItem(this,t);if(i.shouldUpdate){var s=f(this).attr("data-oj-command").split("-");if(t){var o=e._getContextMenuText(s[s.length-1],t);i.itemToUpdate?(i.itemToUpdate.textContent=o,n.push(i.itemToUpdate)):(i.toFirstChild,this.textContent=o,n.push(this))}else{var r=f(e._buildContextMenuItem(s[s.length-1],t));f(this).replaceWith(r),n.push(r.children("a").get(0))}}}),this._menuItemsSetByGrid=n,i.data("oj-ojMenu")&&(t?i[0].refresh():i.ojMenu("refresh"))}else null!=this.datasource&&(i=this._createDefaultContextMenu())&&(this._defaultContextMenu=i[0]);i&&this._addMenuSelectListener(i)},_shouldUpdateListItem:function(e,t){var i,s=!1;if(t){if(null!=e.firstElementChild&&"opt"===e.firstElementChild.getAttribute("ojmenu")?(i=g.CustomElementUtils.getSlotMap(e.firstElementChild),s=!0):i=g.CustomElementUtils.getSlotMap(e),!i[""]||0===i[""].length)return{shouldUpdate:!0,toFirstChild:s};if(i[""]){var n=this._menuItemsSetByGrid.indexOf(e);if(-1!==n)return{shouldUpdate:!0,itemToUpdate:this._menuItemsSetByGrid[n]}}return{shouldUpdate:!1}}var o=f(e).children("a");return{shouldUpdate:0===o.length||-1!==this._menuItemsSetByGrid.indexOf(o.get(0))}},_addMenuSelectListener:function(e){var t=this._handleContextMenuSelect.bind(this);this._IsCustomElement()?e[0].addEventListener("ojAction",t):e.on("ojselect",t)},_createDefaultContextMenu:function(){let e,t,i,s,n,o,r,l=null,a=null,h=null;const d=this._IsCustomElement();r=d?this._createCustomElementContextMenu():this._createWidgetContextMenu(),(this._isResizeEnabled("column","height")||this._isResizeEnabled("row","height"))&&(l=this._buildContextMenuItem("resizeHeight",d)),(this._isResizeEnabled("column","width")||this._isResizeEnabled("row","width"))&&(a=this._buildContextMenuItem("resizeWidth",d)),(this._isResizeEnabled("column","width")||this._isResizeEnabled("column","height")||this._isResizeEnabled("row","width")||this._isResizeEnabled("row","height"))&&(h=this._buildContextMenuItem("resizeFitToContent",d));const m=this.datasource.getCapability("sort");if(this._isSortEnabled("column")&&("column"!==m&&"full"!==m||(e=this._buildContextMenuItem("sortCol",d))),this._isSortEnabled("row")&&("row"!==m&&"full"!==m||(t=this._buildContextMenuItem("sortRow",d))),"enable"===this.options.dnd.reorder.row)if("none"===this.datasource.getCapability("move"));else d?(s=new DocumentFragment,s.appendChild(this._buildContextMenuOjOption("cut")),s.appendChild(this._buildContextMenuOjOption("paste")),s.appendChild(this._buildContextMenuDivider())):(s=new DocumentFragment,s.appendChild(this._buildContextMenuListItem("cut")),s.appendChild(this._buildContextMenuListItem("paste")));let c=[];if(c=Object.keys(this.options.dataTransferOptions).filter(e=>"enable"===this.options.dataTransferOptions[e]),c.length){let e=this.options.dataTransferOptions;n=new DocumentFragment,d?("enable"===e.cut&&n.appendChild(this._buildContextMenuOjOption("cutCells")),"enable"===e.copy&&n.appendChild(this._buildContextMenuOjOption("copyCells")),"enable"===e.paste&&n.appendChild(this._buildContextMenuOjOption("pasteCells")),"enable"===e.fill&&n.appendChild(this._buildContextMenuOjOption("autoFill")),n.appendChild(this._buildContextMenuDivider())):("enable"===e.cut&&n.appendChild(this._buildContextMenuListItem("cutCells")),"enable"===e.copy&&n.appendChild(this._buildContextMenuListItem("copyCells")),"enable"===e.paste&&n.appendChild(this._buildContextMenuListItem("pasteCells")),"enable"===e.fill&&n.appendChild(this._buildContextMenuListItem("autoFill")))}return this._isMultipleSelection()&&_.isTouchSupported()&&(this._discontiguousSelection=!1,d?(i=document.createElement("oj-menu-select-many"),i.setAttribute("data-oj-binding-provider","none"),i.appendChild(this._buildContextMenuOjOption("discontiguousSelection"))):i=this._buildContextMenuListItem("discontiguousSelection")),this._isFreezeEnabled("row")&&(o=new DocumentFragment,d?(o.appendChild(this._buildContextMenuOjOption("freezeRow")),o.appendChild(this._buildContextMenuOjOption("unfreezeRow"))):(o.appendChild(this._buildContextMenuListItem("freezeRow")),o.appendChild(this._buildContextMenuListItem("unfreezeRow")))),this._isFreezeEnabled("column")&&(void 0===o&&(o=new DocumentFragment),d?(o.appendChild(this._buildContextMenuOjOption("freezeCol")),o.appendChild(this._buildContextMenuOjOption("unfreezeCol"))):(o.appendChild(this._buildContextMenuListItem("freezeCol")),o.appendChild(this._buildContextMenuListItem("unfreezeCol")))),l||a||h||e||t||s||i||o||n?(n&&r.appendChild(n),l&&r.appendChild(l),a&&r.appendChild(a),h&&r.appendChild(h),o&&r.appendChild(o),(e||t)&&((l||a||h||o)&&r.appendChild(this._buildContextMenuDivider()),e&&r.appendChild(e),t&&r.appendChild(t)),s&&((l||a||h||o||e||t)&&r.appendChild(this._buildContextMenuDivider()),r.appendChild(s)),i&&((l||a||h||o||e||t||s)&&r.appendChild(this._buildContextMenuDivider()),r.appendChild(i)),d||f(r).ojMenu(),this.option("contextMenu",r,{_context:{internalSet:!0}}),f(r)):null},_createCustomElementContextMenu:function(e){const t=document.createElement("oj-menu");t.setAttribute("data-oj-binding-provider","none"),t.style.display="none";let i=e?"contextsubmenu":"contextmenu";return t.setAttribute("id",this.rootId+i),e||this.root.appendChild(t),t},_createWidgetContextMenu:function(e){const t=document.createElement("ul");let i=e?"contextsubmenu":"contextmenu";return t.setAttribute("id",this.rootId+i),t.style.display="none",e||this.root.appendChild(t),t},_buildContextMenuItem:function(e,t){if(t){if("resize"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("resizeRow")),e.appendChild(this._buildContextMenuOjOption("resizeColumn")),e}if("sortCol"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("sortColAsc")),e.appendChild(this._buildContextMenuOjOption("sortColDsc")),e}if("sortRow"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("sortRowAsc")),e.appendChild(this._buildContextMenuOjOption("sortRowDsc")),e}if(-1!==Object.keys(this.resources.commands).indexOf(e))return this._buildContextMenuOjOption(e)}else{if("resize"===e){const e=this._buildContextMenuListItem("resize"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("resizeWidth")),t.appendChild(this._buildContextMenuListItem("resizeHeight")),e.appendChild(t),e}if("sortCol"===e){const e=this._buildContextMenuListItem("sortCol"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("sortColAsc")),t.appendChild(this._buildContextMenuListItem("sortColDsc")),e.appendChild(t),e}if("sortRow"===e){const e=this._buildContextMenuListItem("sortRow"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("sortRowAsc")),t.appendChild(this._buildContextMenuListItem("sortRowDsc")),e.appendChild(t),e}if(-1!==Object.keys(this.resources.commands).indexOf(e))return this._buildContextMenuListItem(e)}},_buildContextMenuOjOption:function(e){const t=document.createElement("oj-option");let i;if(t.setAttribute("data-oj-command",this._getMappedCommand(e)),-1!==["cutCells","copyCells","pasteCells"].indexOf(e)){i=document.createElement("span");let t=e.indexOf("Cells"),s=e.slice(0,t);i=document.createElement("span"),i.setAttribute("slot","startIcon"),i.setAttribute("class",`oj-ux-ico-${s}`)}return t.textContent=this._getContextMenuText(e),i&&t.appendChild(i),t},_buildContextMenuDivider:function(){const e=document.createElement("oj-option");return e.textContent="---",e},_buildContextMenuListItem:function(e){const t=document.createElement("li");return t.setAttribute("data-oj-command",this._getMappedCommand(e)),t.appendChild(this._buildContextMenuLabel(e)),t},_getContextMenuText:function(e){var t=this._IsCustomElement();t&&"discontiguousSelection"===e&&(e="SelectMultiple"),"resizeWidth"===e?e="resizeColumn":"resizeHeight"===e&&(e="resizeRow");let i="label"+e.charAt(0).toUpperCase()+e.slice(1);return t||"discontiguousSelection"!==e||(i="labelEnableNonContiguous"),this._getTranslation(i)},_buildContextMenuLabel:function(e){const t=this._getContextMenuText(e),i=document.createElement("a");return i.setAttribute("href","#"),i.textContent=t,i},_getDataGridContextMenu:function(){return this._GetContextMenu()||this._GetDefaultContextMenu()},_getTranslation:function(e,t){return this.getTranslatedString(e,t)},_handleResizeDialog:function(e){var t,i;this._IsCustomElement()?(t=document.getElementById(this.rootId+"inputNumber").value,i=document.getElementById(this.rootId+"modal").getAttribute("dimension"),document.getElementById(this.rootId+"modal").close()):(t=f("#"+this.rootId+"inputNumber").ojInputNumber("option","value"),f("#"+this.rootId+"modal").ojDialog("close")),this.grid.handleContextMenuReturn(this.contextMenuEvent,this._getMappedCommand(i),t),this.contextMenuEvent.target.focus()},_buildResizeDialog:function(e,t,i){var s,n,o,r,l,a,h,d,m,u=this._IsCustomElement(),_=this;if(u)if(s=document.getElementById(this.rootId+"inputNumber"),null===(o=document.getElementById(this.rootId+"modal"))||null===s){(o=document.createElement("oj-dialog")).id=this.rootId+"modal",o.setAttribute("data-oj-binding-provider","none"),o.setAttribute("initial-focus","firstFocusable"),o.className=this._getMappedStyle("resizeDialog"),(r=document.createElement("div")).setAttribute("slot","header"),(l=document.createElement("div")).setAttribute("slot","body"),(a=document.createElement("div")).setAttribute("slot","footer"),(m=document.createElement("h5")).textContent=e,r.appendChild(m),r.className=this._getMappedStyle("dialogTitle"),o.appendChild(r),o.appendChild(l),o.appendChild(a),(s=document.createElement("oj-input-number")).id=this.rootId+"inputNumber",s.setAttribute("label-edge","inside"),s.setAttribute("user-assistance-density","efficient"),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dimension","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dimension","resizeHeight")),o.setAttribute("title",e),(h=document.createElement("oj-button")).id=this.rootId+"modalcancel",h.style.margin="5px",(d=document.createElement("oj-button")).id=this.rootId+"modalsubmit",d.style.margin="5px",d.setAttribute("chroming","callToAction"),l.appendChild(s),a.appendChild(h),a.appendChild(d),this.root.appendChild(o),h.textContent=this._getTranslation("labelResizeDialogCancel"),d.textContent=this._getTranslation("labelResizeDialogApply"),n=function(){d.disabled=!1,s.value=0,o.close()},h.addEventListener("click",n),d.addEventListener("click",this._handleResizeDialog.bind(this)),s.setAttribute("max",2e3),s.setAttribute("min",20),s.setAttribute("step",1),s.setAttribute("value",t),s.setAttribute("display-options",'{"converterHint": "none", "validatorHint": "none"}'),s.addEventListener("validChanged",function(e){"valid"===e.detail.value?d.disabled=!1:d.disabled=!0});o.setAttribute("position",JSON.stringify({my:{horizontal:"center",vertical:"center"},at:{horizontal:"center",vertical:"center"},collision:"none"})),c.getContext(o).getBusyContext().whenReady().then(function(){o.open(_.root)})}else s.setAttribute("max",2e3),s.setAttribute("min",20),s.setAttribute("step",1),s.setAttribute("value",t),s.setAttribute("label-edge","inside"),s.setAttribute("user-assistance-density","efficient"),s.setAttribute("display-options",'{"converterHint": "none", "validatorHint": "none"}'),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dimension","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dimension","resizeHeight")),o.setAttribute("dialog-title",e),o.open(_.root);else o=f("#"+this.rootId+"modal"),s=f("#"+this.rootId+"inputNumber"),0===o.length||0===s.length?((o=document.createElement("div")).id=this.rootId+"modal",r=document.createElement("div"),l=document.createElement("div"),a=document.createElement("div"),r.className=this._getMappedStyle("dialogTitle"),o.appendChild(r),o.appendChild(l),o.appendChild(a),(m=document.createElement("h5")).textContent=e,r.appendChild(m),(s=document.createElement("input")).id=this.rootId+"inputNumber",s.setAttribute("label-edge","inside"),(h=document.createElement("oj-button")).id=this.rootId+"modalcancel",h.style.margin="5px",(d=document.createElement("oj-button")).id=this.rootId+"modalsubmit",d.style.margin="5px",l.appendChild(s),a.appendChild(h),a.appendChild(d),this.root.appendChild(o),f(h).ojButton({component:"ojButton",label:this._getTranslation("labelResizeDialogCancel")}),f(d).ojButton({component:"ojButton",label:this._getTranslation("labelResizeDialogApply")}),n=function(){f(d).ojButton({disabled:!1}),f(s).ojInputNumber({value:0}),f(o).ojDialog("close")},h.addEventListener("click",n),d.addEventListener("click",this._handleResizeDialog.bind(this)),f(s).ojInputNumber({component:"ojInputNumber",max:1e3,min:20,step:1,value:t}),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dialog-title","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dialog-title","resizeHeight")),f(s).on("change",function(){f(d).ojButton({disabled:!f(s).ojInputNumber("validate")})}),f(o).ojDialog({initialFocus:"firstFocusable",position:{my:"center center",at:"center center",collision:"none",of:f(this.root)}}),f(o).ojDialog("open")):(s.ojInputNumber("option","value",t),s.setAttribute("label-edge","inside"),o.find("."+this._getMappedStyle("dialogTitle"))[0].firstChild.textContent=e,o.ojDialog("open"))},_handleContextMenuSelect:function(e,t){var i;if(i=t?t.item:f(e.target),this.menuItemFunction=i.attr("data-oj-command"),this.menuItemFunction===this._getMappedCommand("sortColAsc")||this.menuItemFunction===this._getMappedCommand("sortColDsc")||this.menuItemFunction===this._getMappedCommand("sortRowAsc")||this.menuItemFunction===this._getMappedCommand("sortRowDsc")||this.menuItemFunction===this._getMappedCommand("cut")||this.menuItemFunction===this._getMappedCommand("paste")||this.menuItemFunction===this._getMappedCommand("cutCells")||this.menuItemFunction===this._getMappedCommand("pasteCells")||this.menuItemFunction===this._getMappedCommand("copyCells")||this.menuItemFunction===this._getMappedCommand("autoFill")||this.menuItemFunction===this._getMappedCommand("freezeRow")||this.menuItemFunction===this._getMappedCommand("freezeCol")||this.menuItemFunction===this._getMappedCommand("unfreezeRow")||this.menuItemFunction===this._getMappedCommand("unfreezeCol"))this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,null);else if(this.menuItemFunction===this._getMappedCommand("resizeWidth")||this.menuItemFunction===this._getMappedCommand("resizeHeight")){var s=f(this.contextMenuEvent.target).closest("."+this._getMappedStyle("cell"));if(0===s.length&&(s=f(this.contextMenuEvent.target).closest("."+this._getMappedStyle("headercell"))),0===s.length&&(s=f(this.contextMenuEvent.target).closest("."+this._getMappedStyle("endheadercell"))),0===s.length&&(s=f(this.contextMenuEvent.target).closest("."+this._getMappedStyle("headerlabel"))),s.length>0){var n=this.menuItemFunction===this._getMappedCommand("resizeWidth")?s.outerWidth():s.outerHeight(),o=this.menuItemFunction===this._getMappedCommand("resizeWidth")?"width":"height",r="width"===o?this._getTranslation("resizeColumnDialog"):this._getTranslation("resizeRowDialog");this._buildResizeDialog(r,n,o)}}else if(this.menuItemFunction===this._getMappedCommand("resizeFitToContent"))this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,null);else if(this.menuItemFunction===this._getMappedCommand("discontiguousSelection")){let e;this._discontiguousSelection=!this._discontiguousSelection,this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,this._discontiguousSelection);e=this._IsCustomElement()?"labelSelectMultiple":this._discontiguousSelection?"labelDisableNonContiguous":"labelEnableNonContiguous",i.children().first().text(this._getTranslation(e))}},_NotifyContextMenuGesture:function(e,t,i){this.grid.handleContextMenuGesture(t,i,this._contextMenuGestureCallback.bind(this))},_contextMenuGestureCallback:function(e,t,i){if(null!=e){this.contextMenuEvent=t.originalEvent;var s=e.launcher,n=e.capabilities;this._manageContextMenu(n);var o="keyboard"===i?{position:{of:s},launcher:f(s)}:{launcher:f(s)};_.isTouchSupported()&&this.grid.m_databodyReorder||this._OpenContextMenu(t,i,o)}},_addContextMenuCapability:function(e){var t=f(this._getDataGridContextMenu());this._IsCustomElement()?t.find("[data-oj-command="+e+"]").attr("disabled")||t.find("[data-oj-command="+e+"]").attr("disabled",!0):t.find("[data-oj-command="+e+"]").hasClass("oj-disabled")||t.find("[data-oj-command="+e+"]").addClass("oj-disabled")},_removeContextMenuCapability:function(e){f(this._getDataGridContextMenu()).find("[data-oj-command="+e+"]").removeClass("oj-disabled").attr("disabled",!1)},_manageContextMenu:function(e){for(var t=Object.keys(e),i=0;i<t.length;i++){var s=t[i],n=this.resources.getMappedCommand(s);"disable"===e[s]?this._addContextMenuCapability(n):this._removeContextMenuCapability(n)}},_findCellIndex:function(e){return e[this._getMappedAttribute("context")].indexes},_setDataSource:function(){null!=this.options.data?this.options.data.fetchByOffset&&!this.options.data.fetchFirst?(null!=this.datasource&&this.datasource.Destroy&&this.datasource.Destroy(),this.datasource=new D(this.options.data)):h.DataProviderFeatureChecker.isDataProvider(this.options.data)?(this.datasource=new H(this.options.data),"randomAccess"!==this.options.data.getCapability("fetchByOffset").implementation&&"scroll"===this.options.scrollPolicy&&(y.error("oj.DataProvider does not support fetchByOffset and scrollPolicy is set to scroll. scrollPolicy will fall back to auto."),this.options.scrollPolicy="auto")):this.datasource=this.options.data:this.datasource=null},_setSelection:function(){var e=this.options.selection;null!=e&&this.grid.SetSelection(e)},_modifyContext:function(e){e.component=m.__GetWidgetConstructor(this.element,"ojDataGrid")},_setAccessibleContext:function(e){this.grid.SetAccessibleContext(e)},_unregisterResizeListener:function(e){e&&this._resizeHandler&&(_.removeResizeListener(e,this._resizeHandler),this._resizeHandler=null)},_registerResizeListener:function(e){e&&(null==this._resizeHandler&&(this._resizeHandler=this._handleResize.bind(this)),_.addResizeListener(e,this._resizeHandler))},_handleResize:function(e,t){e>0&&t>0&&(this._possiblyRenderOrRefresh(),this.grid.HandleResize(e,t))},getNodeBySubId:function(e){var t;if(null==e)return this.element?this.element[0]:null;var i=e.subId;if("oj-datagrid-cell"===i){var s=e.rowIndex,n=e.columnIndex;t=f(this.grid._getCellByIndex({row:s,column:n}))}else if("oj-datagrid-sort-icon"===i||"oj-datagrid-sort-ascending"===i||"oj-datagrid-sort-default"===i||"oj-datagrid-sort-descending"===i||"oj-datagrid-header"===i){var o,r=e.axis,l=e.index,a=null==e.level?0:e.level;if("column"===r?o=this._getHeaderByIndex(l,a,f(document.getElementById(this.rootId+":columnHeader")),this.grid.getStartColumnHeader()):"row"===r?o=this._getHeaderByIndex(l,a,f(document.getElementById(this.rootId+":rowHeader")),this.grid.getStartRowHeader()):"columnEnd"===r?o=this._getHeaderByIndex(l,a,f(document.getElementById(this.rootId+":columnEndHeader")),this.grid.getStartColumnEndHeader()):"rowEnd"===r&&(o=this._getHeaderByIndex(l,a,f(document.getElementById(this.rootId+":rowEndHeader")),this.grid.getStartRowEndHeader())),null==o)return null;if("oj-datagrid-sort-icon"===i)return o.children("."+this._getMappedStyle("sortIcon")).children().get(0);t="oj-datagrid-sort-ascending"===i?o.find("."+this._getMappedStyle("sortascending")):"oj-datagrid-sort-default"===i?o.find("."+this._getMappedStyle("sortdefault")):"oj-datagrid-sort-descending"===i?o.find("."+this._getMappedStyle("sortdescending")):o}else"oj-datagrid-header-label"===i&&(t=f(this.grid._getLabel(e.axis,e.level)));return null!=t&&t.length>0?t[0]:null},getSubIdByNode:function(e){var t,i=f(e).closest("."+this._getMappedStyle("cell"));if(i.length>0){var s=this._findCellIndex(i[0]);return{subId:"oj-datagrid-cell",rowIndex:s.row,columnIndex:s.column}}var n=f(e).closest("."+this._getMappedStyle("headercell"));if(0===n.length&&(n=f(e).closest("."+this._getMappedStyle("endheadercell"))),n.length>0)return t=n[0][this._getMappedAttribute("context")],{subId:f(e).hasClass(this._getMappedStyle("sortascending"))?"oj-datagrid-sort-ascending":f(e).hasClass(this._getMappedStyle("sortdefault"))?"oj-datagrid-sort-default":f(e).hasClass(this._getMappedStyle("sortdescending"))?"oj-datagrid-sort-descending":"oj-datagrid-header",axis:t.axis,index:this._getHeaderIndex(n),level:t.level};var o=f(e).closest("."+this._getMappedStyle("headerlabel"));return o.length>0?{subId:"oj-datagrid-header-label",axis:(t=o[0][this._getMappedAttribute("context")]).axis,level:t.level}:null},getContextByNode:function(e){var t,i,s=f(e).closest("."+this._getMappedStyle("cell"));if(s.length>0)return t=s[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-cell",i;var n=f(e).closest("."+this._getMappedStyle("headercell"));if(0===n.length&&(n=f(e).closest("."+this._getMappedStyle("endheadercell"))),n.length>0)return t=n[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-header",i.index=this._getHeaderIndex(n),i;var o=f(e).closest("."+this._getMappedStyle("headerlabel"));return o.length>0?(t=o[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-header-label",i):null},_getMappedStyle:function(e){return this.resources.getMappedStyle(e)},_getMappedAttribute:function(e){return this.resources.getMappedAttribute(e)},_getMappedCommand:function(e){return this.resources.getMappedCommand(e)},_isDataGridSizingAvailable:function(){return null!=this.root.offsetParent},_possiblyRenderOrRefresh:function(){var e=this.grid.getVisibility(),t=!1;return this._isDataGridSizingAvailable()?(e===z.VISIBILITY_STATE_RENDER?(this.grid.render(this.root),t=!0):e===z.VISIBILITY_STATE_REFRESH&&(this.grid.refresh(this.root),t=!0),this.grid.setVisibility(z.VISIBILITY_STATE_VISIBLE)):e===z.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(z.VISIBILITY_STATE_HIDDEN),t},_getHeaderByIndex:function(e,t,i,s){if(t<0)return null;var n=i.children().first().children().last();if(n.hasClass(this._getMappedStyle("headercell")))return i.children().first().children("."+this._getMappedStyle("headercell")).eq(e-s);if(n.hasClass(this._getMappedStyle("endheadercell")))return i.children().first().children("."+this._getMappedStyle("endheadercell")).eq(e-s);var o=this._getGroupingContainer(e,t,0,i.children().first().children());if(null==o)return null;if(t<=parseInt(o.attr(this._getMappedAttribute("level")),10)+parseInt(o.children().eq(0).attr(this._getMappedAttribute("depth")),10)-1)return o.children().eq(0);var r=e-(s=parseInt(o.attr(this._getMappedAttribute("start")),10))+1;return o.children().eq(r)},_getGroupingContainer:function(e,t,i,s){if(null==s.eq(1)||s.eq(1).hasClass(this._getMappedStyle("headercell"))||s.eq(1).hasClass(this._getMappedStyle("endheadercell")))return t===i?s.eq(0).parent():null;var n,o=s.parent().parent();for(n=o.hasClass(this._getMappedStyle("header"))||o.hasClass(this._getMappedStyle("endheader"))?0:1;n<s.length;n++){var r=parseInt(s.eq(n).attr(this._getMappedAttribute("start")),10),l=parseInt(s.eq(n).attr(this._getMappedAttribute("extent")),10),a=parseInt(s.eq(n).children().eq(0).attr(this._getMappedAttribute("depth")),10);if(e>=r&&e<r+l)return t<i+a?s.eq(n):this._getGroupingContainer(e,t,i+a,s.eq(n).children())}return null},_getHeaderIndex:function(e){var t;let i;if(e.parent().hasClass(this._getMappedStyle("groupingcontainer"))){if(t=parseInt(e.parent().attr(this._getMappedAttribute("start")),10),e.get(0)===e.parent().children(":first").get(0))return t;t-=1}else e.hasClass(this._getMappedStyle("rowheadercell"))?(t=this.grid.getStartRowHeader(),i="row"):e.hasClass(this._getMappedStyle("colheadercell"))?(t=this.grid.getStartColumnHeader(),i="column"):e.hasClass(this._getMappedStyle("colendheadercell"))?(t=this.grid.getStartColumnEndHeader(),i="column"):(t=this.grid.getStartRowEndHeader(),i="row");return i&&this.grid.m_options.isFreezeEnabled(i)&&this.grid.m_options._getFreezeIndex(i)>=0&&!e.parent().parent().hasClass(this._getMappedStyle("frozenHeader"))&&(t+=this.grid.m_options._getFreezeIndex(i)+1),t+=e.index()},_isMultipleSelection:function(){return null!=this.options.selectionMode&&("multiple"===this.options.selectionMode.row||"multiple"===this.options.selectionMode.cell)},_remove:function(e){null!=e&&(this.grid._cleanTemplateNodes(e),f(e).remove())},_uniqueId:function(e,t){t?f(e).removeUniqueId():f(e).uniqueId()},_compareValues:function(e,t){return h.Object.compareValues(e,t)},scrollTo:function(e){this.grid.scroll(e)},whenReady:function(){if(this._ready)return Promise.resolve(!0);if(!this._readyPromise){var e=this;this._readyPromise=new Promise(function(t){e._readyPromiseResolve=t})}return this._readyPromise},_NotReady:function(){if(this._ready=!1,!this._readyResolveFunc){var e=c.getContext(this.element[0]).getBusyContext(),t={description:"The component identified by '"+this.element.attr("id")+"' is being loaded."};this._readyResolveFunc=e.addBusyState(t)}},_MakeReady:function(){this._readyPromiseResolve&&(this._readyPromiseResolve(!0),this._readyPromiseResolve=null),this._ready=!0,this._readyPromise=null,this._readyResolveFunc&&(this._readyResolveFunc(),this._readyResolveFunc=null)},_CompareOptionValues:function(e,t,i){switch(e){case"currentCell":case"selection":return h.Object.compareValues(t,i);default:return this._super(e,t,i)}}}),z.prototype.unhighlightFloodFillRange=function(e){null==e&&(e=this.GetFloodFillRange()[0]),null!=e&&this._applyBorderClassesAroundRange(this.getElementsInRange(e),e,!1,"Floodfill")},z.prototype.highlightFloodFillRange=function(e){this._applyBorderClassesAroundRange(this.getElementsInRange(e),e,!0,"Floodfill")},z.prototype.handleDatabodyFloodFillDrag=function(e){var t=e.target,i=this.findCell(t);if(null!=i){var s=this.getCellIndexes(i);this.extendFloodFillSelection(s,e)}else this.unhighlightFloodFillRange(),this.m_floodFillRange=[]},z.prototype.GetFloodFillRange=function(){return null==this.m_floodFillRange&&(this.m_floodFillRange=[]),this.m_floodFillRange},z.prototype.extendFloodFillSelection=function(e,t){if("header"===this.m_active.type)return;var i;if(null==(i={row:this.m_active.indexes.row,column:this.m_active.indexes.column}))return;let s,n=!1;s||(s=this.m_selection);let o,r=s[0].startIndex,l=s[0].endIndex;e.row>=r.row&&e.row<=l.row&&(n=!0,e.column>l.column?o="right":e.column<r.column&&(o="left"),e.row=l.row);let a=!1;e.column>=r.column&&e.column<=l.column&&(a=!0,e.row>l.row?o="bottom":e.row<r.row&&(o="top"));let h=r.row===l.row,d=r.column===l.column;if(h&&e.row===r.row&&a||d&&e.column===r.column&&n)return this.unhighlightFloodFillRange(),void(this.m_floodFillRange=[]);if((!n&&!a||e.column<=l.column&&!n)&&(e.column=l.column),n||a||(e.row>l.row?o="bottom":e.row<r.row&&(o="top")),o){let s=r,n=e;this._createRangeWithKeys(s,n,this._extendFloodFillSelectionCallback.bind(this,t,i,o))}else this.unhighlightFloodFillRange()},z.prototype._extendFloodFillSelectionCallback=function(e,t,i,s){let n=s;"top"===i?n.endIndex.row-=1:"bottom"===i?n.startIndex.row=this.m_selectionRange[0].endIndex.row+1:"left"===i?n.endIndex.column-=1:n.startIndex.column=this.m_selectionRange[0].endIndex.column+1;let o=[];this.unhighlightFloodFillRange(),o.push(n),this.m_floodFillRange=o,this.m_floodFillDirection="flood",this.highlightFloodFillRange(n)},z.prototype._addFloodfillAffordance=function(e){if(null==this.m_bottomFloodFillIconContainer){var t=e.target,i=this.findCell(t);if(i||(i=this.findHeader(t)),!i)return;this._attachFloodFillIcon()}},z.prototype._attachFloodFillIcon=function(){this.m_bottomFloodFillIconContainer=document.createElement("div"),this.m_bottomFloodFillIconContainer.className=this.getMappedStyle("toucharea");var e=document.createElement("div");e.className=this.getMappedStyle("floodfillaffordance"),e.setAttribute("role","button"),this.m_bottomFloodFillIconContainer.appendChild(e),this.m_databody.firstChild.appendChild(this.m_bottomFloodFillIconContainer),this.m_floodFillAffordanceHeight=this.m_bottomFloodFillIconContainer.firstElementChild.offsetHeight,this.m_floodFillAffordanceWidth=this.m_bottomFloodFillIconContainer.firstElementChild.offsetWidth,this.m_options.isFloodFillEnabled()&&(this.m_bottomFloodFillIconContainer.addEventListener("mouseover",this.handleFloodFillAffordanceMouseOver.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mousedown",this.handleFloodFillAffordanceMouseDown.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mouseup",this.handleFloodFillAffordanceMouseUp.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mouseleave",this.handleFloodFillAffordanceMouseLeave.bind(this)))},z.prototype.handleFloodFillAffordanceMouseOver=function(e){if(0===e.buttons){e.currentTarget.parentNode.parentNode.style.cursor="crosshair",this.m_cursor="crosshair"}},z.prototype.handleFloodFillAffordanceMouseDown=function(){this.m_databodyDragState=!0,this.m_floodFillDragState=!0,this.m_selectionRange=null,this.m_floodFillRange=null;const e=[this.m_databody,this.m_databodyFrozenCol,this.m_databodyFrozenRow,this.m_databodyFrozenCorner];for(let t=0;t<e.length;t++)e[t]&&(e[t].style.cursor="crosshair");this.m_cursor="crosshair"},z.prototype.handleFloodFillAffordanceMouseUp=function(e){this.m_databodyDragState=!1,this.m_floodFillDragState=!1;e.currentTarget.parentNode.parentNode.style.cursor="default",this.m_cursor="default",this.m_selectionRange=null,this.m_floodFillRange=null},z.prototype.handleFloodFillAffordanceMouseLeave=function(e){if(0===e.buttons){this.m_databodyDragState=!1,this.m_floodFillDragState=!1;e.currentTarget.parentNode.parentNode.style.cursor="default",this.m_cursor="default"}},z.prototype._removeFloodFillAffordance=function(){this._isDatabodyCellActive()&&this.m_bottomFloodFillIconContainer&&this.m_bottomFloodFillIconContainer.parentNode&&(this.m_databody.style.cursor="default",this.m_cursor="default",this.m_bottomFloodFillIconContainer.parentNode.removeChild(this.m_bottomFloodFillIconContainer))},z.prototype._moveFloodFillAffordance=function(){var e=this.getResources().isRTLMode()?"right":"left",t=this.GetSelection();if(t.length>0){var i=this._getTouchSelectionAffordanceSize();if(null!=this.m_bottomFloodFillIconContainer){var s=this._getCellByIndex(t[t.length-1].endIndex);if(s)if(this.setElementDir(this.m_bottomFloodFillIconContainer,this.getElementDir(s,"top")+this.getElementHeight(s)-i+this.m_floodFillAffordanceHeight+1,"top"),this.setElementDir(this.m_bottomFloodFillIconContainer,this.getElementDir(s,e)+this.getElementWidth(s)-(i-this.m_floodFillAffordanceWidth)+1,e),s.classList.contains(this.getMappedStyle("frozenCell"))){this._getCellContainer(s).firstChild.appendChild(this.m_bottomFloodFillIconContainer)}else this.m_databody.firstChild.appendChild(this.m_bottomFloodFillIconContainer);else this._removeFloodFillAffordance()}}},z.prototype.handleDragStart=function(e){let t,i=e.target,s=this.findHeader(i);if(s){let i=this.getHeaderCellAxis(s),n=this.getHeaderCellLevel(s),o=this.getHeaderCellIndex(s);if(this.m_options._isDragEnabled(i)){let r,l,a,h=this.m_selection,d=0,m=0,c=1,u=this.m_options.options.dnd.drag,_="row"===i||"rowEnd"===i?u.rows.dataTypes:u.columns.dataTypes,p="row"===i||"rowEnd"===i?"rows":"columns",g=[],C=[],f=[],y=JSON.parse(JSON.stringify(h));y.sort((e,t)=>e.startIndex[i]<t.startIndex[i]?-1:1),"row"===i||"rowEnd"===i?(a=-1!==this.m_endRowEndHeader,this.m_rowHeader&&(r=this.m_rowHeaderLevelCount-1),this.m_rowEndHeader&&(l=this.m_rowEndHeaderLevelCount-1)):(a=-1!==this.m_endColEndHeader,this.m_colHeader&&(r=this.m_columnHeaderLevelCount-1),this.m_endColHeader&&(l=this.m_columnEndHeaderLevelCount-1));let E="row"===i||"rowEnd"===i?"row":"column";[g,C]=this._getHeadersInSelection(n,y,E,a),g&&g[r]&&f.push(...g[r]),C&&C[l]&&f.push(...C[l]),[t,c,d,m]=this._getCellsForDndContainer(E,y,f,c),this._cellsDragged=t,this.m_dragIndex=o,this.m_dragHeader=s,this._setDragRowsData(e,_);const v=this.m_utils.containsCSSClassName(s,this.getMappedStyle("endheadercell"));this._setDragImage(e,E,t,d,m,c,v,g,C),this._draggedElements=[];for(let e=0;e<h.length;e++){let t=this.getElementsInRange(h[e]);this._draggedElements.push(...t);for(let e=0;e<t.length;e++)this._highlightElement(t[e],["dragSourceOpaque"]);this._applyBorderClassesAroundRange(t,h[e],!1,"Selected")}const w=s[[this.getResources().getMappedAttribute("context")]];"expanded"===w.metadata.expanded&&null!==w.metadata.treeDepth&&this._disableChildElements(i);let H={range:y,axis:E};return this._invokeDndCallback("drag",p,"dragStart",e,H)}e.preventDefault()}},z.prototype._getHeadersInSelection=function(e,t,i){let s={},n={};for(let o=0;o<t.length;o++){let r=[...this.getHeadersByRange(t[o],i)];for(let e=r.length-1;e>=0;e--)this.m_utils.containsCSSClassName(r[e],this.getMappedStyle("selected"))||r.splice(e,1);[s,n]=this._getHeadersUnderLevel(e,r,i,s,n)}return[s,n]},z.prototype._getHeadersUnderLevel=function(e,t,i,s,n){let o="row"===i?this.m_rowHeaderLevelCount:this.m_columnHeaderLevelCount,r="row"===i?this.m_rowEndHeaderLevelCount:this.m_columnEndHeaderLevelCount;for(let i=0;i<t.length;i++){let l=this.getHeaderCellLevel(t[i]);const a=this.m_utils.containsCSSClassName(t[i],this.getMappedStyle("endheadercell"));a?a&&(n[l]||(n[l]=[]),(r>1&&l>=e||1===r)&&n[l].push(t[i])):(s[l]||(s[l]=[]),(o>1&&l>=e||1===o)&&s[l].push(t[i]))}return[s,n]},z.prototype.handleRowDragEnd=function(e){return this._destroyDragImage(),this._unhighlightDragSource(),this._removeDropTargetLine("row"),this._removeDropTargetClass(),this._enableChildElements(),this.m_databodyReorder=!1,this._removeDragStyle("row"),this.m_dragIndex=null,this._invokeDndCallback("drag","rows","dragEnd",e,this._cellsDragged)},z.prototype.handleRowDragOver=function(e){this.m_databodyReorder=!0;let t="row",i=this._getOverIndex(e,t),s=-1===i?0:i,n=this.getResources().isRTLMode()?"right":"left",o=this._getHeaderCellByIndex(s,t,this.m_rowHeaderLevelCount),r=this._isHeaderWithinSelection(o,t);if(void 0!==i&&this.m_dragIndex!==i){let l;if(this.m_utils.containsCSSClassName(o,this.getMappedStyle("disabledElement")))this._removeDropTargetLine(t),this._removeDropTargetClass(),this.m_dropRowIndex=null;else{let a=this._getRelativePosition(e,t,o,!0),h=this._getDropContext(e,this.m_dropRowIndex,"row");if(l=this._invokeDropCallback("rows","dragOver",e,h),(!1===l||e.defaultPrevented)&&(this._removeDropTargetLine(t),this._removeDropTargetClass(),!r))if("inside"===a)this._highlightElement(o,["dropTarget"]),this._highlightCellsAlongAxis(i,t,"index","add",["dropTarget"]);else{let e=this.getElementDir(o,"top");e+=-1===i?0:this.getElementHeight(o),this._hasFrozenRows()&&i>this.m_frozenRowIndex&&(e+=this.getElementHeight(this.m_databodyFrozenRow)),this._addDropTargetLine(t,e,n,0,s)}}return l}},z.prototype.handleDatabodyDragOver=function(e){let t;this.m_databodyReorder=!0,t=this._matchDragDataType(e,"rows")?"row":"column";let i=this._getOverIndex(e,t),s=this.getResources().isRTLMode()?"right":"left";if(i){let n=JSON.parse(JSON.stringify(i));-1===i[t]&&(n[t]=0);let o=this._getCellByIndex(n);if(o){let r,l=this._getRelativePosition(e,t,o,!1),a=this.m_utils.containsCSSClassName(o,"selected");if(this.m_utils.containsCSSClassName(o,this.getMappedStyle("disabledElement")))this._removeDropTargetLine(t),this._removeDropTargetClass(),"row"===t?this.m_dropRowIndex=null:this.m_dropColumnIndex=null;else if(r="row"===t?this._invokeDropCallback("rows","dragOver",e,{index:this.m_dropRowIndex,position:l,axis:"row"}):this._invokeDropCallback("columns","dragOver",e,{index:this.m_dropColumnIndex,position:l,axis:"column"}),(!1===r||e.defaultPrevented)&&(this._removeDropTargetLine(t),this._removeDropTargetClass(),!a)){let e;"inside"===l?this._highlightCellsAlongAxis(i,t,"index","add",["dropTarget"]):"row"===t?(e=this.getElementDir(o,"top"),e+=-1===i[t]?0:this.getElementHeight(o),this._hasFrozenRows()&&i[t]>this.m_frozenRowIndex&&(e+=this.getElementHeight(this.m_databodyFrozenRow)),this._addDropTargetLine(t,e,s,0,n)):(e=this.getElementDir(o,s),e+=-1===i[t]?0:this.getElementWidth(o),this._hasFrozenColumns()&&i[t]>this.m_frozenColIndex&&(e+=this.getElementWidth(this.m_databodyFrozenCol)),this._addDropTargetLine(t,0,s,e,n))}return r}}},z.prototype.handleDatabodyDrop=function(e){let t;t=this._matchDragDataType(e,"rows")?"row":"column";let i,s,n=this.getResources().isRTLMode()?"right":"left",o=e.target.getBoundingClientRect();this._destroyDragImage(),this._removeDropTargetLine(t),this._removeDropTargetClass();let r="after";if("row"===t){i=this.m_dropRowIndex,e.clientY-o.top<.4*o.height&&(r="before"),this.m_dropRowIndex=null,s={index:i,position:r,axis:"row"}}else{i=this.m_dropColumnIndex,Math.abs(e.clientX-o[n])<.4*o.width&&(r="before"),this.m_dropColumnIndex=null,s={index:i,position:r,axis:"column"}}this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==i&&this._invokeDropCallback(`${t}s`,"drop",e,s)},z.prototype.handleRowDragEnter=function(e){if(this._getOverIndex(e,"row"),this.m_dropRowIndex){let t=this._getDropContext(e,this.m_dropRowIndex,"row");return this._invokeDropCallback("rows","dragEnter",e,t)}},z.prototype.handleDatabodyDragEnter=function(e){let t;t=this._matchDragDataType(e,"rows")?"row":"column";let i=this._getOverIndex(e,t);if(i){let s=JSON.parse(JSON.stringify(i));-1===i[t]&&(s[t]=0);let n=this._getCellByIndex(s);if(n){let s={index:i,position:this._getRelativePosition(e,t,n,!1),axis:t};if(this.m_dropRowIndex)return this._invokeDropCallback("rows","dragEnter",e,s)}}},z.prototype.handleRowDragLeave=function(e){let t=this._getDropContext(e,this.m_dropRowIndex,"row");var i=this._invokeDndCallback("drop","rows","dragLeave",e,t);return this.m_dropRowIndex=null,i},z.prototype.handleRowDrag=function(e){return!this.m_dragImageAttached&&this.m_utils.isTouchDevice()&&(document.body.appendChild(this.m_dndContainer),this.m_dragImageAttached=!0),this._invokeDndCallback("drag","rows","drag",e)},z.prototype.handleRowDrop=function(e){let t=this.m_dropRowIndex;if(null===this.m_dropRowIndex&&(t=this._getOverIndex(e,"row")),this._destroyDragImage(),this._removeDropTargetLine("row"),this._removeDropTargetClass(),this.m_dropRowIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==t){let i=this._getDropContext(e,t,"row");this._invokeDropCallback("rows","drop",e,i)}},z.prototype.handleColumnDragEnd=function(e){let t="column";return this._destroyDragImage(),this._unhighlightDragSource(),this._removeDragStyle(t),this._removeDropTargetLine(t),this._removeDropTargetClass(),this._enableChildElements(),this.m_dragIndex=null,this._invokeDndCallback("drag","columns","dragEnd",e)},z.prototype.handleColumnDragOver=function(e){this.m_databodyReorder=!0;let t="column",i=this._getOverIndex(e,t),s=-1===i?0:i,n=this.getResources().isRTLMode()?"right":"left",o=this._getHeaderCellByIndex(s,t,this.m_columnHeaderLevelCount);if(this.m_utils.containsCSSClassName(o,this.getMappedStyle("disabledElement")))this._removeDropTargetLine(t),this._removeDropTargetClass(),this.m_dropColumnIndex=null;else if(void 0!==i&&o){let r=this._getRelativePosition(e,t,o,!0),l={axis:"column",position:r,index:this.m_dropColumnIndex},a=this._invokeDropCallback("columns","dragOver",e,l);if(!1===a||e.defaultPrevented)if(this._removeDropTargetLine(t),this._removeDropTargetClass(),"inside"===r)this._highlightElement(o,["dropTarget"]),this._highlightCellsAlongAxis(i,t,"index","add",["dropTarget"]);else{let e=this.getElementDir(o,n);e+=-1===i?0:this.getElementWidth(o),this._hasFrozenColumns()&&i>this.m_frozenColIndex&&(e+=this.getElementWidth(this.m_databodyFrozenCol)),this._addDropTargetLine(t,0,n,e,s)}return a}},z.prototype.handleColumnDragEnter=function(e){this._getOverIndex(e,"column");let t=this._getDropContext(e,this.m_dropColumnIndex,"column");return this._invokeDropCallback("columns","dragEnter",e,t)},z.prototype.handleColumnDragLeave=function(e){let t=this._getDropContext(e,this.m_dropColumnIndex,"column");var i=this._invokeDndCallback("drop","columns","dragLeave",e,t);return this.m_dropColumnIndex=null,i},z.prototype.handleColumnDrag=function(e){return this._invokeDndCallback("drag","columns","drag",e)},z.prototype.handleColumnDrop=function(e){let t=this.m_dropColumnIndex;if(null===this.m_dropColumnIndex&&(t=this._getOverIndex(e,"column")),this._destroyDragImage(),this._removeDropTargetLine("column"),this._removeDropTargetClass(),this.m_dropColumnIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==t){let i=this._getDropContext(e,t,"column");this._invokeDropCallback("columns","drop",e,i)}},z.prototype._computeDndContainerOffsetHeight=function(e,t,i,s){let n=0;if("row"===e)for(let e=0;e<t.length;e++){n+=t[e].offsetHeight}else{let e=t[0].offsetHeight;i&&(e+=s[0].offsetHeight),n=this.m_databody.offsetHeight+e}return n},z.prototype._computeDndContainerOffsetWidth=function(e,t,i,s){let n=0;if("row"===e){let e=t[0].offsetWidth;i&&(e+=s[0].offsetWidth),n=this.m_databody.offsetWidth+e}else for(let e=0;e<t.length;e++){n+=t[e].offsetWidth}return n},z.prototype._getCellsForDndContainer=function(e,t,i,s){let n,o,r=[],l=this.getResources().isRTLMode()?"right":"left",a=this.m_databody.scrollLeft,h=this.m_databody.scrollTop,d=0,m=0;o="row"===e?-1!==this.m_endRowEndHeader:-1!==this.m_endColEndHeader,n="row"===e?"width":"height";let c=Math.abs(a);"column"===e&&(l="top",c=h);for(let a=0,h=0;a<t.length;a++)for(let u=t[a].startIndex[e];u<=t[a].endIndex[e];u++){let t,a=this._getAxisCellsByIndex(u,e);i[h]&&r.push(i[h]);for(let e=0;e<a.length;e++)if(this.getElementDir(a[e],l)>c){t=e-1;break}a=a.slice(t,a.length);let _=0,p=this.getElementDir(this.m_databody,n);"row"===e&&this._hasFrozenColumns()&&(p+=this.getElementWidth(this.m_databodyFrozenCol)),"column"===e&&this._hasFrozenRows()&&(p+=this.getElementHeight(this.m_databodyFrozenRow));for(let e=0;e<a.length;e++)if(_+=this.getElementDir(a[e],n),_>p){t=e;break}t>0&&(a=a.slice(0,t+1)),r.push(...a),o&&r.push(i[Math.ceil(i.length/2+h)]),"row"!==e||d?"column"===e&&(d+=this.getElementDir(i[h],"width")):d=this._computeContainerDimension(r,"width"),"column"!==e||m?"row"===e&&(m+=this.getElementDir(i[h],"height")):m=this._computeContainerDimension(r,"height"),h+=1,s=a.length}return[r,s,d,m]},z.prototype._computeContainerDimension=function(e,t){let i=0;for(let s=0;s<e.length;s++)i+=this.getElementDir(e[s],t);return i},z.prototype._setDragImage=function(e,t,i,s,n,o,r,l,a){let h=this.getResources().isRTLMode()?"right":"left",d=this._populateDndContainer(i,t,h,o,l,a,s,n),m=Math.max(0,e.offsetX),c=Math.max(0,e.offsetY);r?(m="row"===t&&"left"===h?s-m:m,c="column"===t?n-c:c):m="row"===t&&"left"===h?m:s-m,e.dataTransfer.setDragImage(d,m,c)},z.prototype._computeDndContainerCellCountInRow=function(e,t){let i,s=e,n=1;return i="row"===t||"rowEnd"===t?-1!==this.m_endRowEndHeader:-1!==this.m_endColEndHeader,i&&(n=2),s+=n,s},z.prototype._populateDndContainer=function(e,t,i,s,n,o,r,l){let a=document.getElementById("dndContainer");a||(a=document.createElement("div"),a.setAttribute("id","dndContainer"),a.setAttribute("class","dndContainer"));let h=[this.getMappedStyle("focus"),this.getMappedStyle("hover"),this.getMappedStyle("active"),this.getMappedStyle("topSelected"),this.getMappedStyle("startSelected"),this.getMappedStyle("bottomSelected"),this.getMappedStyle("endSelected"),this.getMappedStyle("selected")],d=0,m=0,c=0,u=0;this._headersDragged=[];let _=this._computeDndContainerCellCountInRow(s,t);[u,c]=this._appendNestedHeadersToContainer(i,t,a,d,m,n,!1),m=u,d=c;for(let s=0;s<e.length;s++){let n=e[s],o=n.cloneNode(!0);o.classList.remove(...h),o.setAttribute("draggable",!1),o.style.top=`${d}px`,o.style[i]=`${m}px`,"row"===t?(s%_==0?m=u+n.offsetWidth:m+=n.offsetWidth,s%_==_-1&&(d+=n.offsetHeight,s===e.length-1?d=0:m=u)):(s%_==0?d=c+n.offsetHeight:d+=n.offsetHeight,s%_==_-1&&(m+=n.offsetWidth,s===e.length-1?m=0:d=c)),a.appendChild(o),n.classList.add("drag-source-opaque")}return[u,c]=this._appendNestedHeadersToContainer(i,t,a,d,m,o,!0),a.style.width=`${r}px`,a.style.height=`${l}px`,"column"===t?a.style.height=`${l+c}px`:a.style.width=`${r+u}px`,this.m_utils.isTouchDevice()?(this.m_dragImageAttached=!1,this.m_dndContainer=a):document.body.appendChild(a),a},z.prototype._appendNestedHeadersToContainer=function(e,t,i,s,n,o,r){let l;r?(this.m_rowEndHeaderLevelCount||this.m_columnEndHeaderLevelCount)&&(l="row"===t?this.m_rowEndHeaderLevelCount-1:this.m_columnEndHeaderLevelCount-1):l="row"===t?this.m_rowHeaderLevelCount-1:this.m_columnHeaderLevelCount-1;let a=Object.keys(o),h=[this.getMappedStyle("focus"),this.getMappedStyle("hover"),this.getMappedStyle("active"),this.getMappedStyle("selected")];r&&(a=a.reverse());for(let r=0;r<a.length;r++){let d=parseInt(a[r],10);if(d!==l){let r=o[d].length;for(let l=0;l<o[d].length;l++){let a=o[d][l];this._headersDragged.push(a);let m=a.cloneNode(!0);m.classList.remove(...h),m.style.top=`${s}px`,m.style[e]=`${n}px`,"row"===t?(l%r==0?s=a.offsetHeight:s+=a.offsetHeight,l===r-1&&(n+=a.offsetWidth,s=0)):(l%r==0?n=a.offsetWidth:n+=a.offsetWidth,l===r-1&&(n=0,s+=a.offsetHeight)),i.appendChild(m),a.classList.add("drag-source-opaque")}}}return[n,s]},z.prototype._destroyDragImage=function(){let e=document.getElementById("dndContainer");e&&e.parentNode.removeChild(e),this.m_dragImageAttached=!1,this.m_dndContainer=null},z.prototype._setDragRowsData=function(e,t){if(t){let i=e.dataTransfer,s=JSON.stringify(this.m_selection);if("string"==typeof t)i.setData(t,s);else for(let e=0;e<t.length;e++)i.setData(t[e],s)}},z.prototype._getOverIndex=function(e,t){let i,s,n,o=e.target,r=this.getResources().isRTLMode()?"right":"left",l=o.getBoundingClientRect(),a=this.findHeader(o),h=!1,d=!1;if(a?(s=a[this.getResources().getMappedAttribute("context")],n=s.index,"column"===t?this.m_dropColumnIndex=n:this.m_dropRowIndex=n,h=this._isParentNode(s),d=this._isLeafNode(s)):(i=this.findCell(o),i&&(s=i[this.getResources().getMappedAttribute("context")],n=s.indexes,"column"===t?this.m_dropColumnIndex=s.indexes[t]:this.m_dropRowIndex=s.indexes[t])),void 0!==n){let o,m="width";if("column"===t?o=Math.abs(e.clientX-l[r]):(o=e.clientY-l.top,m="height"),a&&(h||d))o<.25*l[m]&&(n-=1);else if(o<.4*l[m])if(a)n-=1;else if(i&&void 0!==n){let e=s.indexes.row,i=s.indexes.column;n="row"===t?this.createIndex(e-1,i):this.createIndex(e,i-1)}}return n},z.prototype._getRelativePosition=function(e,t,i,s){let n,o=e.target,r=this.getResources().isRTLMode()?"right":"left",l=o.getBoundingClientRect(),a=!1,h=!1,d="before",m=i[this.getResources().getMappedAttribute("context")];s&&(a=this._isParentNode(m),h=this._isLeafNode(m));let c="width";return"column"===t?n=Math.abs(e.clientX-l[r]):(n=e.clientY-l.top,c="height"),i&&(a||h)?n>=.25*l[c]&&n<=.75*l[c]?d="inside":n>.75*l[c]&&(d="after"):n>.4*l[c]&&(d="after"),d},z.prototype._addDropTargetLine=function(e,t,i,s,n){let o="row"===e?"rowDropTargetLine":"colDropTargetLine";this.m_dropTarget=document.createElement("div"),this.m_dropHeaderTarget=document.createElement("div"),this.m_dropEndHeaderTarget=document.createElement("div"),this._setAttribute(this.m_dropTarget,"index",n);let r=this.m_databody,l=this.m_rowHeader,a=this.m_rowEndHeader;"column"===e&&(l=this.m_colHeader,a=this.m_colEndHeader),"row"===e&&this._hasFrozenRows()&&n<=this.m_frozenRowIndex?(r=this.m_databodyFrozenRow,l=this.m_rowHeaderFrozen,a=this.m_rowEndHeaderFrozen):"column"===e&&this._hasFrozenColumns()&&n<=this.m_frozenColIndex&&(r=this.m_databodyFrozenCol,l=this.m_colHeaderFrozen,a=this.m_colEndHeaderFrozen);const h=function(t,s,o,r,a,h,d,m,c){let u="row"===e?this._getCornerDimensions("height"):this._getCornerDimensions("width");if("row"===e){let e=Math.abs(this.getElementDir(l.firstChild,"top"));0!==e&&(s-=e),t=s+=u,o=s,this._hasFrozenColumns()&&n<=this.m_frozenRowIndex&&(d+=this.getElementWidth(this.m_databodyFrozenCol))}else{let e=Math.abs(this.getElementDir(l.firstChild,i));0!==e&&(a-=e),r=a+=u,h=a,this._hasFrozenRows()&&n<=this.m_frozenColIndex&&(d+=this.getElementHeight(this.m_databodyFrozenRow))}return[t,s,o,r,a,h,d,m,c]}.bind(this);this._addVisualIndicator(e,t,i,s,o,this.m_dropTarget,this.m_dropHeaderTarget,this.m_dropEndHeaderTarget,r,l,a,h),this._addDnDVisualIndicatorEventListener()},z.prototype._addVisualIndicator=function(e,t,i,s,n,o,r,l,a,h,d,m){let c,u="width",_="width";"row"===e?c=-1!==this.m_endRowEndHeader:(u="height",_="height",c=-1!==this.m_endColEndHeader);let[p,g,C,f,y,E,v,w,H]=this._calculateVisualIndicatorPosition(a,h,d,t,s,i,e);m&&"function"==typeof m&&([p,g,C,f,y,E,v,w,H]=m(p,g,C,f,y,E,v,w,H)),this._setVisualIndicatorStyle(o,n,p,i,f,v,u),this._setVisualIndicatorStyle(r,n,g,i,y,w,_),c&&this._setVisualIndicatorStyle(l,n,C,i,E,H,_),this.m_root.appendChild(o),this.m_root.appendChild(r),c&&this.m_root.appendChild(l)},z.prototype._addDnDVisualIndicatorEventListener=function(){this.m_dropTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropHeaderTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropEndHeaderTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1),this.m_dropHeaderTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1),this.m_dropEndHeaderTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1)},z.prototype._setVisualIndicatorStyle=function(e,t,i,s,n,o,r){this.m_utils.addCSSClassName(e,this.getMappedStyle(t)),this.setElementDir(e,i,"top"),this.setElementDir(e,n,s),"width"===r?this.setElementWidth(e,o):this.setElementHeight(e,o)},z.prototype._calculateVisualIndicatorPosition=function(e,t,i,s,n,o,r){let l=s,a=n,h=s,d=n,m=s,c=n,u=0,_=0,p=0,g="row"===r?this.getElementWidth.bind(this):this.getElementHeight.bind(this);return u=g(e.firstChild),_=g(t.firstChild),p=g(i.firstChild),"column"===r?l+=_:a+=_,"row"===r&&this.m_rowEndHeader?c=n+this.getElementDir(this.m_rowEndHeader,o):"column"===r&&this.m_colEndHeader&&(m=s+this.getElementDir(this.m_colEndHeader,"top")),[l,h,m,a,d,c,u,_,p]},z.prototype._getCornerDimensions=function(e){let t=0,i=0;return this.m_corner&&(t=this.getElementHeight(this.m_corner),i=this.getElementWidth(this.m_corner)),e?"height"===e?t:i:[t,i]},z.prototype._setDropTargetLineStyle=function(e,t,i,s,n,o,r){this.m_utils.addCSSClassName(e,this.getMappedStyle(t)),this.setElementDir(e,i,"top"),this.setElementDir(e,n,s),"width"===r?this.setElementWidth(e,o):this.setElementHeight(e,o)},z.prototype._removeDropTargetLine=function(){this._removeDropTargetEventListeners(),this._remove(this.m_dropTarget),this._remove(this.m_dropHeaderTarget),this.m_dropEndHeaderTarget&&this._remove(this.m_dropEndHeaderTarget)},z.prototype._removeDropTargetEventListeners=function(){this.m_dropTarget&&(this.m_dropTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropTarget.removeEventListener("drop",this.handleDropTargetDrop,!1)),this.m_dropHeaderTarget&&(this.m_dropHeaderTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropHeaderTarget.removeEventListener("drop",this.handleDropTargetDrop,!1)),this.m_dropEndHeaderTarget&&(this.m_dropEndHeaderTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropEndHeaderTarget.removeEventListener("drop",this.handleDropTargetDrop,!1))},z.prototype._removeDropTargetClass=function(){let e=document.querySelectorAll(`.${this.getMappedStyle("dropTarget")}`);e&&e.length&&this._unhighlightElementsByClassName(e,["dropTarget"])},z.prototype._isHeaderWithinSelection=function(e,t){let i=this.getHeaderCellIndex(e),s=!1;if(this.m_selection&&this.m_selection.length)for(let n=0;n<this.m_selection.length;n++){let o=this._getHeadersWithinSelection(this.m_selection[n],i,t);for(let t=0;t<o.length;t++)if(o[t]===e&&o[o.length-1]!==e){s=!0;break}}return s},z.prototype._invokeDndCallback=function(e,t,i,s,n){let o,r=this.m_options.options.dnd[e];if(r&&r[t]){let e=r[t][i];if(e&&"function"==typeof e)try{this.m_customElement?e(s,n):o=e(s,n)}catch(e){throw new Error(e)}}return o},z.prototype._invokeDropCallback=function(e,t,i,s){var n=this._invokeDndCallback("drop",e,t,i,s);return void 0===n&&this._matchDragDataType(i,e)&&i.preventDefault(),n},z.prototype._matchDragDataType=function(e,t){var i=e.dataTransfer.types,s=this.m_options.options.dnd.drop;if(s&&s[t]&&s[t].dataTypes)for(var n=s[t].dataTypes,o="string"==typeof n?[n]:n,r=0;r<i.length;r++)if(o.indexOf(i[r])>=0)return!0;return!1},z.prototype.handleCancelDrag=function(){this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals()},z.prototype._resetDragInternals=function(){this._draggedElements=[],this._cellsDragged=[],this._headersDragged=[],this.m_dragIndex=null,this.m_dragHeader=null,this.m_databodyReorder=!1},z.prototype._disableChildElements=function(e){const t=this.getResources().getMappedAttribute("context");let i="row"===e?this.m_rowHeader:this.m_colHeader;i=i.querySelectorAll(`.${this.getResources().getMappedStyle("headercell")}`);let s=this._getLogicalChildHeaderNodes(i,e,this.m_dragHeader,this.m_dragIndex+1);for(let i=0;i<s.length;i++){let n=s[i][t].index;this._highlightCellsAlongAxis(n,e,"index","add",["disabledElement"]),this._highlightElement(s[i],["disabledElement"])}},z.prototype._getLogicalChildHeaderNodes=function(e,t,i,s){const n=this.getResources().getMappedAttribute("context");let o=[];if("row"===t){let t=i[n].metadata.treeDepth;for(let i=s;i<e.length;i++){if(!(t<e[i][n].metadata.treeDepth))break;o.push(e[i])}}else{let t=i[n].level;for(let i=s;i<e.length;i++){if(!(t<e[i][n].level))break;o.push(e[i])}}return o},z.prototype._enableChildElements=function(){let e=this.getMappedStyle("disabledElement"),t=document.querySelectorAll(`.${e}`);this._unhighlightElementsByClassName(t,["disabledElement"])},z.prototype._unhighlightDragSource=function(){if(this._cellsDragged&&this._cellsDragged.length){let e=["draggableItem","dragSourceOpaque"];this._unhighlightElementsByClassName(this._draggedElements,e),this._unhighlightElementsByClassName(this._cellsDragged,e),this._unhighlightElementsByClassName(this._headersDragged,e)}},z.prototype._removeDragStyle=function(e){let t="row"===e?this.m_rowHeader:this.m_rowEndHeader,i="row"===e?this.m_colHeader:this.m_colEndHeader,s=this.getMappedStyle("dragging"),n=t.firstChild.querySelectorAll(`.${s}`);this._unhighlightElementsByClassName(n,["dragging"]),-1!==this.m_endRowEndHeader&&(n=i.firstChild.querySelectorAll(`.${s}`),this._unhighlightElementsByClassName(n,["dragging"]))},z.prototype._getDropContext=function(e,t,i){let s=e.target,n=this.findHeader(s);return{index:t,axis:i,position:this._getRelativePosition(e,i,n,!0)}},z.prototype.handleDropTargetDragOver=function(e){let t=e.target,i=this.m_utils.containsCSSClassName(t,this.getMappedStyle("rowDropTargetLine"))?"row":"column",s={axis:i,position:"after",index:this._getAttribute(this.m_dropTarget,"index")},n="row"===i||"rowEnd"===i?"rows":"columns";this._invokeDropCallback(n,"dragOver",e,s)},z.prototype.handleDropTargetDrop=function(e){let t=e.target,i=this.m_utils.containsCSSClassName(t,this.getMappedStyle("rowDropTargetLine"))?"row":"column",s=this._getAttribute(this.m_dropTarget,"index"),n="row"===i||"rowEnd"===i?"rows":"columns";if(this._destroyDragImage(),this._removeDropTargetLine(i),this._removeDropTargetClass(),"row"===i?this.m_dropRowIndex=null:this.m_dropColumnIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==s){let t={axis:i,position:"after",index:s};this._invokeDropCallback(n,"drop",e,t)}},z.prototype._populateFrozenContainer=function(e,t,i,s,n,o,r,l){let a=document.createDocumentFragment(),h=this._addCellsToFragment(a,t,i,s,n,o,r,l);return this._populateDatabody(e,a),this.m_initialized||this._setScrollerDimension(e.parentElement,h.totalRowHeight,h.totalColumnWidth),h},z.prototype._addFrozenIndicator=function(e,t,i,s,n){const o="row"===e?"rowFrozenIndicator":"colFrozenIndicator",r="FrozenIndicator",l=this.createSubId(`databody${e}${r}`),a=this.createSubId(`${e}header${r}`),h=this.createSubId(`${e}endHeader${r}`);if(null===document.getElementById(l)){const t=document.createElement("div");t.id=l,"row"===e?this.m_databodyRowFrozenTarget=t:this.m_databodyColFrozenTarget=t,this._setAttribute(t,"index",n)}if(null===document.getElementById(a)){const t=document.createElement("div");t.id=a,"row"===e?this.m_rowHeaderFrozenTarget=t:this.m_colHeaderFrozenTarget=t}if(null===document.getElementById(h)){const t=document.createElement("div");t.id=h,"row"===e?this.m_rowEndHeaderFrozenTarget=t:this.m_colEndHeaderFrozenTarget=t}const d=function(t,i,s,n,o,r,l,a,h){let d="row"===e?this.getElementWidth.bind(this):this.getElementHeight.bind(this);return this._hasFrozenRows()&&this._hasFrozenColumns()?l+=d(this.m_databodyFrozenCorner.firstChild):this._hasFrozenRows()&&"column"===e?l+=d(this.m_databodyFrozenRow.firstChild):this._hasFrozenColumns()&&"row"===e&&(l+=d(this.m_databodyFrozenCol.firstChild)),[t,i,s,n,o,r,l,a,h]}.bind(this);"row"===e?this._addVisualIndicator(e,t,i,s,o,this.m_databodyRowFrozenTarget,this.m_rowHeaderFrozenTarget,this.m_rowEndHeaderFrozenTarget,this.m_databodyFrozenRow,this.m_rowHeaderFrozen,this.m_rowEndHeaderFrozen,d):this._addVisualIndicator(e,t,i,s,o,this.m_databodyColFrozenTarget,this.m_colHeaderFrozenTarget,this.m_colEndHeaderFrozenTarget,this.m_databodyFrozenCol,this.m_colHeaderFrozen,this.m_colEndHeaderFrozen,d)},z.prototype._removeFrozenIndicator=function(e){if("column"===e){let e=-1!==this.m_endColEndHeader;this.m_root.removeChild(this.m_databodyColFrozenTarget),this.m_root.removeChild(this.m_colHeaderFrozenTarget),e&&this.m_root.removeChild(this.m_colEndHeaderFrozenTarget)}else{let e=-1!==this.m_endRowEndHeader;this.m_root.removeChild(this.m_databodyRowFrozenTarget),this.m_root.removeChild(this.m_rowHeaderFrozenTarget),e&&this.m_root.removeChild(this.m_rowEndHeaderFrozenTarget)}},z.prototype._setFrozenContainerDimension=function(e,t,i,s,n,o){const r=this.getResources().isRTLMode()?"right":"left",l=this.m_databodyFrozenCol,a=this.m_databodyFrozenRow,h=this.m_databodyFrozenCorner,d=this.m_colHeader,m=this.m_colEndHeader,c=this.m_rowHeader,u=this.m_rowEndHeader,_=t,p=e;let g,C,f,y=0,E=0;if(this._hasFrozenColumns()&&(y=this.getElementWidth(l),!y&&(-1!==this.m_endColHeader||-1!==this.m_endColEndHeader))){const e=-1!==this.m_endColHeader?this.m_colHeaderFrozen:this.m_colEndHeaderFrozen;for(let t=0;t<e.firstChild.childElementCount;t++){let i=e.firstChild.childNodes[t];y+=this.getElementWidth(i)}}if(this._hasFrozenRows()&&(E=this.getElementHeight(a),!E&&(-1!==this.m_endRowHeader||-1!==this.m_endRowEndHeader))){const e=-1!==this.m_endRowHeader?this.m_rowHeaderFrozen:this.m_rowEndHeaderFrozen;for(let t=0;t<e.firstChild.childElementCount;t++){let i=e.firstChild.childNodes[t];E+=this.getElementHeight(i)}}if(this._hasFrozenColumns()&&this._hasFrozenRows()&&(C=this.getElementHeight(h),g=this.getElementWidth(h),y||(y=g),E||(E=C)),l&&(f=n),this._hasFrozenColumns()&&this._hasFrozenRows()&&(this._setElementDimension(h,n,i,C,g),f=C+n),this._hasFrozenColumns()&&this._setElementDimension(l,f,i,_,y),this.m_colHeaderFrozen){let e=this.getElementHeight(this.m_colHeaderFrozen);this._setElementDimension(this.m_colHeaderFrozen,0,i,e,y)}if(this.m_colEndHeaderFrozen){let e=this.getElementHeight(this.m_colEndHeaderFrozen);this._setElementDimension(this.m_colEndHeaderFrozen,t+n+E,i,e,y)}const v=this.m_frozenColIndex;if(this._hasFrozenColumns()&&this._addFrozenIndicator("column",0,r,i+y,v),i+=y,this.setElementDir(d,i,r),this.setElementDir(m,i,r),this.setElementHeight(d,n),this.setElementHeight(m,o),a&&this._setElementDimension(a,n,i,E,p),this.m_rowHeaderFrozen){let e=this.getElementWidth(this.m_rowHeaderFrozen);this._setElementDimension(this.m_rowHeaderFrozen,n,0,E,e)}if(this.m_rowEndHeaderFrozen){let t=this.getElementWidth(this.m_rowEndHeaderFrozen);this._setElementDimension(this.m_rowEndHeaderFrozen,n,e+i,E,t)}const w=this.m_frozenRowIndex;return this._hasFrozenRows()&&this._addFrozenIndicator("row",n+E,r,0,w),n+=E,this.setElementDir(c,n,"top"),this.setElementDir(u,n,"top"),this.setElementWidth(c,i-y),this.setElementWidth(u,s),[i,n]},z.prototype._setElementDimension=function(e,t,i,s,n){const o=this.getResources().isRTLMode()?"right":"left";null!==n&&this.setElementWidth(e,n),null!==s&&this.setElementHeight(e,s),null!==t&&this.setElementDir(e,t,"top"),null!==i&&this.setElementDir(e,i,o)},z.prototype._buildFrozenHeaders=function(e,t,i,s){let n=s.start,o={headerStart:s.start,endHeaderStart:s.start,headerFetchCount:0,endHeaderFetchCount:0};if(null===this.m_options._getFreezeIndex(e)||!this._isFreezeFeasible(e,t,i,n,0)){o={headerStart:n,endHeaderStart:n},t&&(o.headerFetchCount=t.getCount()),i&&(o.endHeaderFetchCount=i.getCount()),"column"===e?this.m_frozenColIndex=this.m_options.isFreezeEnabled(e)?-1:null:this.m_frozenRowIndex=this.m_options.isFreezeEnabled(e)?-1:null;let s=this.m_rowHeaderFrozen,r=this.m_rowEndHeaderFrozen;return"column"===e&&(s=this.m_colHeaderFrozen,r=this.m_colEndHeaderFrozen),s&&(this.m_root.removeChild(s),"column"===e?this.m_colHeaderFrozen=null:this.m_rowHeaderFrozen=null),r&&(this.m_root.removeChild(r),"column"===e?this.m_colEndHeaderFrozen=null:this.m_rowEndHeaderFrozen=null),o}return o=this._buildFrozenAxisHeaders(e,t,i,s,o),o},z.prototype._isFreezeFeasible=function(e,t,i,s,n){let o=!1;if(t&&i){if("column"===e&&(this.m_frozenColIndex>=t.getCount()||this.m_frozenColIndex>=i.getCount())||"row"===e&&(this.m_frozenRowIndex>=t.getCount()||this.m_frozenRowIndex>=i.getCount()))return o;const r=t.getExtent(s,n),l=i.getExtent(s,n);if(r.more.after||l.more.after)return o;let a=r.extent,h=l.extent;a===h||1===a||1===h?o=!0:a>h?(h+=i.getExtent(s+1,n).extent,a===h&&(o=!0)):(a+=t.getExtent(s+1,n).extent,a===h&&(o=!0));const d=r.extent>l.extent?r.extent:l.extent;if(o&&d>1){const t="row"===e?this.m_frozenRowIndex:this.m_frozenColIndex;let i=this._adjustFrozenIndexBasedOnExtent(t,d);"row"===e?this.m_frozenRowIndex=i:this.m_frozenColIndex=i}}else t&&("column"===e&&this.m_frozenColIndex<t.getCount()||"row"===e&&this.m_frozenRowIndex<t.getCount())||i&&("column"===e&&this.m_frozenColIndex<i.getCount()||"row"===e&&this.m_frozenRowIndex<i.getCount())?o=!0:t||i||(o=!0);return o},z.prototype._adjustFrozenIndexBasedOnExtent=function(e,t){let i;return i=e>=t?e+(t-e%t)-1:t-1,i},z.prototype._buildFrozenAxisHeaders=function(e,t,i,s,n){let o=s.start,r=this.getDataSource().getCount(e),l=this.buildRowHeaders.bind(this),a=this.buildRowEndHeaders.bind(this),h=this.m_frozenRowIndex,d=this.m_rowHeaderFrozen,m=this.m_rowEndHeaderFrozen;if("column"===e&&(h=this.m_frozenColIndex,d=this.m_colHeaderFrozen,m=this.m_colEndHeaderFrozen,l=this.buildColumnHeaders.bind(this),a=this.buildColumnEndHeaders.bind(this)),null!=t){let i=t.getCount();if(n.headerFetchCount=i,null!==h&&-1!==h&&(!1===this.m_initialized&&(i-=h+1),d&&d.firstChild&&!d.firstChild.childNodes.length)){l(d,t,o,r,!1,!1,h+1,!0);let s=d.firstChild.querySelectorAll(`.${this.getMappedStyle("groupingcontainer")}`);o=this._calculateFrozenIndex(h+1,s),i=t.getCount()-o,"column"===e?(this.m_endColHeaderPixel=0,this.m_frozenColIndex=o-1):(this.m_endRowHeaderPixel=0,this.m_frozenRowIndex=o-1),n.headerFetchCount=i,n.headerStart=o}}if(null!=i){let t=i.getCount();if(n.endHeaderFetchCount=t,null!==h&&-1!==h&&(!1===this.m_initialized&&(t-=h+1),m&&m.firstChild&&!m.firstChild.childNodes.length)){o=s.start,a(m,i,o,r,!1,!1,h+1,!0),"column"===e?this.m_endColEndHeaderPixel=0:this.m_endRowEndHeaderPixel=0,o=h+1;let l=m.firstChild.querySelectorAll(`.${this.getMappedStyle("groupingcontainer")}`);o=this._calculateFrozenIndex(h+1,l),t=i.getCount()-o,n.endHeaderFetchCount=t,n.endHeaderStart=o,"column"===e?this.m_frozenColIndex=o-1:this.m_frozenRowIndex=o-1}}return n},z.prototype._handleFreezeRow=function(e){let t;if(this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection&&this.m_selection.length){let e=[],i=[];-1===this.m_endRowHeader&&-1===this.m_endRowEndHeader||([e,i]=this._getHeadersInSelection(this.m_rowHeaderLevelCount-1,this.m_selection,"row"),-1!==this.m_endRowHeader&&e&&Object.keys(e).length?(e=e[0],t=e[e.length-1]):-1!==this.m_endRowEndHeader&&i&&Object.keys(i).length&&(i=i[0],t=i[i.length-1]))}t||(t=this.findHeader(e.target));let i,s="row",n=!0;const o=this.getResources().getMappedAttribute("context");if(null===t){let r,l;i=this.findCell(e.target),this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection&&this.m_selection.length&&(i=this._getCellByIndex(this.m_selection[0].endIndex));const a=i[o].indexes;let h=!1;if(a.row<this.m_frozenRowIndex+1&&(h=!0),-1!==this.m_endRowHeader&&-1!==this.m_endRowEndHeader){let e=this._isDynamicFreezeFeasible(a.row,s,h);n=e.isFeasible,r=e.headerIndex,l=e.endHeaderIndex,t=this._getMaxExtentNestedHeader(s,r,l,h)}else-1!==this.m_endRowHeader?s="row":-1!==this.m_endRowEndHeader&&(s="rowEnd"),t=this.getHeaderFromCell(i,s)}else{let e,i=t[o].index,r=!1;if(i<this.m_frozenRowIndex+1&&(r=!0),-1!==this.m_endRowHeader&&-1!==this.m_endRowEndHeader){let o=this._isDynamicFreezeFeasible(i,s,r);n=o.isFeasible,i=o.headerIndex,e=o.endHeaderIndex,t=this._getMaxExtentNestedHeader(s,i,e,r)}}if(n){this._mutateRowFrozenContainer(t,i,s);let n={event:e,ui:{frozenCount:this.m_frozenRowIndex+1}};this.fireEvent("rowFreeze",n)}},z.prototype._handleFreezeCol=function(e){let t;if(this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection&&this.m_selection.length){let e,i;-1===this.m_endColHeader&&-1===this.m_endColEndHeader||([e,i]=this._getHeadersInSelection(this.m_columnHeaderLevelCount-1,this.m_selection,"column"),-1!==this.m_endColHeader&&e&&Object.keys(e).length?(e=e[0],t=e[e.length-1]):-1!==this.m_endColEndHeader&&i&&Object.keys(i).length&&(i=i[0],t=i[i.length-1]))}t||(t=this.findHeader(e.target));let i,s="column",n=!0;const o=this.getResources().getMappedAttribute("context");if(null===t){i=this.findCell(e.target),this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection&&this.m_selection.length&&(i=this._getCellByIndex(this.m_selection[0].endIndex));let r,l,a=i[o].indexes,h=!1;if(a.column<this.m_frozenColIndex+1&&(h=!0),-1!==this.m_endColHeader&&-1!==this.m_endColEndHeader){let e=this._isDynamicFreezeFeasible(a.column,s,h);n=e.isFeasible,r=e.headerIndex,l=e.endHeaderIndex,t=this._getMaxExtentNestedHeader(s,r,l,h)}else-1!==this.m_endColHeader?s="column":-1!==this.m_endColEndHeader&&(s="columnEnd"),t=this.getHeaderFromCell(i,s)}else{let e,i=t[o].index,r=!1;if(i<this.m_frozenColIndex+1&&(r=!0),-1!==this.m_endColHeader&&-1!==this.m_endColEndHeader){let o=this._isDynamicFreezeFeasible(i,s,r);n=o.isFeasible,i=o.headerIndex,e=o.endHeaderIndex,t=this._getMaxExtentNestedHeader(s,i,e,r)}}if(n){this._mutateColumnFrozenContainer(t,i,s);let n={event:e,ui:{frozenCount:this.m_frozenColIndex+1}};this.fireEvent("columnFreeze",n)}},z.prototype._getMaxExtentNestedHeader=function(e,t,i,s){let n,o=t,r=s?this.m_colHeaderFrozen:this.m_colHeader,l=s?this.m_colEndHeaderFrozen:this.m_colEndHeader,a="column"===e?this.m_columnHeaderLevelCount:this.m_rowHeaderLevelCount,h="column"===e?this.m_startColHeader:this.m_startRowHeader;"row"===e&&(r=s?this.m_rowHeaderFrozen:this.m_rowHeader,l=s?this.m_rowEndHeaderFrozen:this.m_rowEndHeader);let d=r;return t<i&&(o=i,a="column"===e?this.m_columnEndHeaderLevelCount:this.m_rowEndHeaderLevelCount,d=l,h="column"===e?this.m_startColEndHeader:this.m_startRowEndHeader),n=this._getHeaderByIndex(o,a-1,d,a,h),n},z.prototype._isDynamicFreezeFeasible=function(e,t,i){let s=!1,n=e,o=e,r=this.m_frozenRowIndex,l=i?this.m_rowHeaderFrozen:this.m_rowHeader,a=i?this.m_rowEndHeaderFrozen:this.m_rowEndHeader,h=this.m_rowHeaderLevelCount,d=this.m_rowEndHeaderLevelCount;"column"===t&&(r=this.m_frozenColIndex,l=i?this.m_colHeaderFrozen:this.m_colHeader,a=i?this.m_colEndHeaderFrozen:this.m_colEndHeader,h=this.m_columnHeaderLevelCount,d=this.m_columnEndHeaderLevelCount),i||(1===h&&(n=e-(r+1)),1===d&&(o=e-(r+1)));let m,c,u=1,_=1,p=n,g=o;h>1&&(m=this._getHeaderContainer(n,0,0,null,l,h),u=this._getExtent(m,t),p=this._getAttribute(m,"start",!0)+u),d>1&&(c=this._getHeaderContainer(o,0,0,null,a,d),_=this._getExtent(c,t),g=this._getAttribute(c,"start",!0)+_),u!==_&&1!==u&&1!==_&&p!==g||(s=!0);const C=u>_?u:_;return s&&C>1&&(C===u?n=this._adjustFrozenIndexBasedOnExtent(n,C):o=this._adjustFrozenIndexBasedOnExtent(o,C)),{isFeasible:s,headerIndex:n,endHeaderIndex:o}},z.prototype._getOutermostHeaderFromNestedHeaders=function(e){let t=!1;const i=this.getMappedStyle("groupingcontainer"),s=this.getMappedStyle("endheadercell"),n=this.getMappedStyle("headercell");for(;e.parentNode.classList.contains(i);)e.classList.contains(s)&&(t=!0),e=e.parentNode;return e.classList.contains(i)&&(e=t?e.querySelector(`.${s}`):e.querySelector(`.${n}`)),e},z.prototype._mutateColumnFrozenContainer=function(e,t,i){const s=this.getResources().getMappedAttribute("context");if(e){e=this._getOutermostHeaderFromNestedHeaders(e);let t=this.getHeaderCellIndex(e),n=e[s].extent;n>1&&(t+=n-1);const o=this.m_utils.containsCSSClassName(e,this.getMappedStyle("frozenHeader"));this._hasFrozenColumns()?o?t!==this.m_frozenColIndex&&this._removeCellsFromFrozenColumnContainer(t,e):this._appendCellsToFrozenColumnContainer(t,e,!1):null!==this.m_frozenColIndex&&-1!==this.m_frozenColIndex||this._createColumnFrozenSectionAndMutate(i,t,e)}else{let e=t[s].indexes.column;if(null===this.m_frozenColIndex||-1===this.m_frozenColIndex)this._createColumnFrozenSectionAndMutate(i,e,null);else{let i=!1;this.m_utils.containsCSSClassName(t,this.getMappedStyle("frozenCell"))&&(this.m_databodyFrozenCorner.querySelector(`#${t.id}`)||this.m_databodyFrozenCol.querySelector(`#${t.id}`))&&(i=!0),i?this._removeCellsFromFrozenColumnContainer(e):this._appendCellsToFrozenColumnContainer(e,null,!1)}}},z.prototype._createColumnFrozenSectionAndMutate=function(e,t,i){this._createFrozenHeaderElements("column",this.getMappedStyle("colHeaderFrozen"),this.getMappedStyle("colEndHeaderFrozen"));const s=this._createDatabodyElement("databodyFrozenCol");if(this.m_root.insertBefore(s,this.m_status),this.m_databodyFrozenCol=s,this._hasFrozenRows()){const e=this._createDatabodyElement("databodyFrozenCorner");this.m_root.insertBefore(e,this.m_status),this.m_databodyFrozenCorner=e}this._addListenersOnFrozenSections(null,null,this.m_colHeaderFrozen,this.m_colEndHeaderFrozen),this._appendCellsToFrozenColumnContainer(t,i,!0)},z.prototype._mutateRowFrozenContainer=function(e,t,i){const s=this.getResources().getMappedAttribute("context");if(e){e=this._getOutermostHeaderFromNestedHeaders(e);let t=this.getHeaderCellIndex(e),n=e[s].extent;n>1&&(t+=n-1);const o=this.m_utils.containsCSSClassName(e,this.getMappedStyle("frozenHeader"));this._hasFrozenRows()?o?t!==this.m_frozenRowIndex&&this._removeCellsFromFrozenRowContainer(t):this._appendCellsToFrozenRowContainer(t,e,!1):null!==this.m_frozenRowIndex&&-1!==this.m_frozenRowIndex||this._createRowFrozenSectionAndMutate(i,t)}else{let e=t[s].indexes.row;if(null===this.m_frozenRowIndex||-1===this.m_frozenRowIndex)this._createRowFrozenSectionAndMutate(i,e,null);else{let i=!1;this.m_utils.containsCSSClassName(t,this.getMappedStyle("frozenCell"))&&(this.m_databodyFrozenRow.querySelector(`#${t.id}`)||this.m_databodyFrozenCorner.querySelector(`#${t.id}`))&&(i=!0),i?this._removeCellsFromFrozenRowContainer(e):this._appendCellsToFrozenRowContainer(e,null,!1)}}},z.prototype._createRowFrozenSectionAndMutate=function(e,t,i){this._createFrozenHeaderElements("row",this.getMappedStyle("rowHeaderFrozen"),this.getMappedStyle("rowEndHeaderFrozen"));const s=this._createDatabodyElement("databodyFrozenRow");if(this.m_root.insertBefore(s,this.m_status),this.m_databodyFrozenRow=s,this._hasFrozenColumns()){const e=this._createDatabodyElement("databodyFrozenCorner");this.m_root.insertBefore(e,this.m_status),this.m_databodyFrozenCorner=e}this._addListenersOnFrozenSections(this.m_rowHeaderFrozen,this.m_rowEndHeaderFrozen,null,null),this._appendCellsToFrozenRowContainer(t,i,!0)},z.prototype._updateFrozenSection=function(e,t){if(-1===e)this._handleUnFreeze(t);else if(this.m_options.isFreezeEnabled(t)){let i=this.createIndex(0,e);"row"===t&&(i=this.createIndex(e,0));let s,n,o=null,r=this._getCellByIndex(i),l=!0,a=!1;if("column"===t){if(e<this.m_frozenColIndex+1&&(a=!0),-1!==this.m_endColHeader&&-1!==this.m_endColEndHeader){let i=this._isDynamicFreezeFeasible(e,t,a);l=i.isFeasible,s=i.headerIndex,n=i.endHeaderIndex,o=this._getMaxExtentNestedHeader(t,s,n,a)}else(-1!==this.m_endColHeader&&e>this.m_endColHeader||-1!==this.m_endColEndHeader&&e>this.m_endColEndHeader)&&(l=!1);l&&this._mutateColumnFrozenContainer(o,r,t)}else{if(e<this.m_frozenRowIndex+1&&(a=!0),-1!==this.m_endRowHeader&&-1!==this.m_endRowEndHeader){let i=this._isDynamicFreezeFeasible(e,t,a);l=i.isFeasible,s=i.headerIndex,n=i.endHeaderIndex,o=this._getMaxExtentNestedHeader(t,s,n,a)}else(-1!==this.m_endRowHeader&&e>this.m_endRowHeader||-1!==this.m_endRowEndHeader&&e>this.m_endRowEndHeader)&&(l=!1);l&&this._mutateRowFrozenContainer(o,r,t)}}},z.prototype._appendCellsToFrozenColumnContainer=function(e,t,i){const s=this.m_frozenColIndex,n="column",o=this.getResources().isRTLMode()?"right":"left";let r=this.getElementWidth(this.m_databodyFrozenCol),l=this.getElementDir(this.m_databodyFrozenCol,o);i&&(l=this.getElementDir(this.m_databody,o));let a=this.getElementWidth(this.m_databody);this.m_databodyFrozenRow&&(a=this.getElementWidth(this.m_databodyFrozenRow));let h=r,d=e+1,m=0;null!==s&&(m=s+1);let c=e,u=e+1,_=e+1;null!==s&&-1!==s||(u=this.m_columnHeaderLevelCount>1?e+1:0,_=this.m_columnEndHeaderLevelCount>1?e+1:0),d-=m;let p=[],{cells:g,cellsDimensionToAdjust:C}=this._getCellsToFreeze(m,c,n),f=!1;0===C&&(f=!0);let{headers:y,endHeaders:E}=this._getColumnHeadersToFreeze(t,e,c,m);if(this.m_databodyFrozenCorner){if(p=this._getFrozenAxisCells(n,c),f){let e=p[p.length-1];C=this.getElementDir(e,o)+this.getElementWidth(e)}for(let e=0;e<p.length;e++)this.setElementDir(p[e],h,o),this.m_databodyFrozenCorner.firstChild.appendChild(p[e]),e%d==d-1?h=r:h+=this.getElementWidth(p[e])}let v=h;g.length?h=this._appendElementsToFrozenContainer(n,g,this.m_databodyFrozenCol,v,o,this.getMappedStyle("frozenCell"),d):h+=C,this._appendElementsToFrozenContainer(n,y,this.m_colHeaderFrozen,v,o,this.getMappedStyle("frozenHeader"),d),E.length&&this._appendElementsToFrozenContainer(n,E,this.m_colEndHeaderFrozen,v,o,this.getMappedStyle("frozenHeader"),d),c+1<=this.m_endCol&&(this._shiftCellsAlongAxis(n,-C,c+1,!0),this.m_databodyFrozenRow&&this._hasFrozenRows()&&this._shiftFrozenCellsAlongAxis(n,-C,c+1,!0),this._shiftHeadersAlongAxisInContainer(this.m_colHeader.firstChild,u,-C,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this._shiftHeadersAlongAxisInContainer(this.m_colEndHeader.firstChild,_,-C,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell"))),this.m_endColPixel-=C,this.m_endColHeaderPixel-=C,this.m_endColEndHeaderPixel-=C;let w=l+h,H=a-C;if(H=H<0?0:H,this.m_endRowEndHeader){const e=this.getElementDir(this.m_rowEndHeader,o);h=h>e?e-l:h,w=l+h}this._setElementDimension(this.m_databody,null,w,null,H),this._setElementDimension(this.m_colHeader,null,w,null,H),this.m_colEndHeader&&this._setElementDimension(this.m_colEndHeader,null,w,null,H),i?(this._setElementDimension(this.m_databodyFrozenCol,this.getElementDir(this.m_databody,"top"),l,this.getElementHeight(this.m_databody),h),this._setElementDimension(this.m_colHeaderFrozen,this.getElementDir(this.m_colHeader,"top"),l,this.getElementHeight(this.m_colHeader),h),this.m_colEndHeader&&this._setElementDimension(this.m_colEndHeaderFrozen,this.getElementDir(this.m_colEndHeader,"top"),l,this.getElementHeight(this.m_colEndHeader),h),this.m_databodyFrozenCorner&&this._setElementDimension(this.m_databodyFrozenCorner,this.getElementDir(this.m_databodyFrozenRow,"top"),this.getElementDir(this.m_databodyFrozenRow,o),this.getElementHeight(this.m_databodyFrozenRow),h)):(this.setElementWidth(this.m_databodyFrozenCol,h),this.setElementWidth(this.m_colHeaderFrozen,h),this.m_colEndHeaderFrozen&&this.setElementWidth(this.m_colEndHeaderFrozen,h),this.m_databodyFrozenCorner&&this.setElementWidth(this.m_databodyFrozenCorner,h)),this.m_databodyFrozenRow&&this._setElementDimension(this.m_databodyFrozenRow,null,w,null,H),this._addFrozenIndicator(n,0,o,l+h,c),this.m_frozenColIndex=c},z.prototype._appendCellsToFrozenRowContainer=function(e,t,i){const s=this.m_frozenRowIndex,n="row",o=this.getResources().isRTLMode()?"right":"left";let r=this.getElementHeight(this.m_databodyFrozenRow),l=this.getElementDir(this.m_databodyFrozenRow,"top");i&&(l=this.getElementDir(this.m_databody,"top"));let a=this.getElementHeight(this.m_databody);this.m_databodyFrozenCol&&(a=this.getElementHeight(this.m_databodyFrozenCol));let h=r,d=e+1,m=0;null!==s&&(m=s+1);let c=e,u=e+1,_=e+1;null!==s&&-1!==s||(u=this.m_rowHeaderLevelCount>1?e+1:0,_=this.m_rowEndHeaderLevelCount>1?e+1:0),d-=m;let p=[],{cells:g,cellsDimensionToAdjust:C}=this._getCellsToFreeze(m,c,n),f=!1;0===C&&(f=!0);let{headers:y,endHeaders:E}=this._getRowHeadersToFreeze(t,e,c,m);if(this.m_databodyFrozenCorner){p=this._getFrozenAxisCells(n,c);for(let e=0;e<p.length;e++)this.setElementDir(p[e],h,"top"),this.m_databodyFrozenCorner.firstChild.appendChild(p[e]),e%(this.m_frozenColIndex+1)===this.m_frozenColIndex&&(h+=this.getElementHeight(p[e]),f&&(C+=this.getElementHeight(p[e])))}let v=r;g.length&&(h=this._appendElementsToFrozenContainer(n,g,this.m_databodyFrozenRow,v,"top",this.getMappedStyle("frozenCell"),d)),this._appendElementsToFrozenContainer(n,y,this.m_rowHeaderFrozen,v,"top",this.getMappedStyle("frozenHeader"),d),E.length&&this._appendElementsToFrozenContainer(n,E,this.m_rowEndHeaderFrozen,v,"top",this.getMappedStyle("frozenHeader"),d),c+1<=this.m_endRow&&(this._shiftCellsAlongAxis(n,-C,c+1,!0),this.m_databodyFrozenCol&&this._hasFrozenColumns()&&this._shiftFrozenCellsAlongAxis(n,-C,c+1,!0),this._shiftHeadersAlongAxisInContainer(this.m_rowHeader.firstChild,u,-C,"top",this.getMappedStyle("rowheadercell")),this._shiftHeadersAlongAxisInContainer(this.m_rowEndHeader.firstChild,_,-C,"top",this.getMappedStyle("rowendheadercell"))),this.m_endRowPixel-=C,this.m_endRowHeaderPixel-=C,this.m_endRowEndHeaderPixel-=C;let w=l+h,H=a-C;if(H=H<0?0:H,this.m_endColEndHeader){const e=this.getElementDir(this.m_colEndHeader,"top");h=h>e?e-l:h,w=l+h}this._setElementDimension(this.m_databody,w,null,H,null),this._setElementDimension(this.m_rowHeader,w,null,H,null),this.m_rowEndHeader&&this._setElementDimension(this.m_rowEndHeader,w,null,H,null),i?(this._setElementDimension(this.m_databodyFrozenRow,l,this.getElementDir(this.m_databody,o),h,this.getElementWidth(this.m_databody)),this._setElementDimension(this.m_rowHeaderFrozen,l,this.getElementDir(this.m_rowHeader,o),h,this.getElementWidth(this.m_rowHeader)),this.m_rowEndHeader&&this._setElementDimension(this.m_rowEndHeaderFrozen,l,this.getElementDir(this.m_rowEndHeader,o),h,this.getElementWidth(this.m_rowEndHeader)),this.m_databodyFrozenCorner&&this._setElementDimension(this.m_databodyFrozenCorner,l,this.getElementDir(this.m_databodyFrozenCol,o),h,this.getElementWidth(this.m_databodyFrozenCol))):(this.setElementHeight(this.m_databodyFrozenRow,h),this.setElementHeight(this.m_rowHeaderFrozen,h),this.m_rowEndHeaderFrozen&&this.setElementHeight(this.m_rowEndHeaderFrozen,h),this.m_databodyFrozenCorner&&this.setElementHeight(this.m_databodyFrozenCorner,h)),this.m_databodyFrozenCol&&this._setElementDimension(this.m_databodyFrozenCol,w,null,H,null),this._addFrozenIndicator(n,w,o,0,c),this.m_frozenRowIndex=c},z.prototype._getCellsToFreeze=function(e,t,i){const s="row"===i?this.getElementHeight.bind(this):this.getElementWidth.bind(this);let n=0,o=[];for(let r=e,l=0;r<=t;r+=1,l+=1){let e=this._getAxisCellsByIndex(r,i);e=e.filter(e=>!e.classList.contains(this.getMappedStyle("frozenCell"))),e.length&&(n+=s(e[0]),o.push(...e))}return{cells:o,cellsDimensionToAdjust:n}},z.prototype._getColumnHeadersToFreeze=function(e,t,i,s){let n=[],o=[];if(-1!==this.m_endColHeader)if(1===this.m_columnHeaderLevelCount)for(let e=s;e<=i;e++){let t=this._getHeaderCellsByIndex(e,"column");n.push(...t)}else{let i=!1,o=s,r=e;for(this.m_utils.containsCSSClassName(r,this.getMappedStyle("headercell"))||(r=this._getHeaderCellByIndex(t,"column",0));!i;){let e=this._getHeaderContainer(o,0,0,null,this.m_colHeader,this.m_columnHeaderLevelCount);e.querySelector(`#${r.id}`)?i=!0:o+=this._getAttribute(e,"extent",!0),n.push(e)}}if(-1!==this.m_endColEndHeader)if(1===this.m_columnEndHeaderLevelCount)for(let e=s;e<=i;e++){let t=this._getHeaderCellsByIndex(e,"columnEnd");o.push(...t)}else{let i=!1,n=s;let r=e;for(this.m_utils.containsCSSClassName(e,this.getMappedStyle("endheadercell"))||(r=this._getHeaderCellByIndex(t,"columnEnd",0));!i;){let e=this._getHeaderContainer(n,0,0,null,this.m_colEndHeader,this.m_columnEndHeaderLevelCount);e.querySelector(`#${r.id}`)?i=!0:n+=this._getAttribute(e,"extent",!0),o.push(e)}}return{headers:n,endHeaders:o}},z.prototype._getRowHeadersToFreeze=function(e,t,i,s){let n=[],o=[];if(-1!==this.m_endRowHeader)if(1===this.m_rowHeaderLevelCount)for(let e=s;e<=i;e++){let t=this._getHeaderCellsByIndex(e,"row");n.push(...t)}else{let i=!1,o=s,r=e;for(this.m_utils.containsCSSClassName(r,this.getMappedStyle("headercell"))||(r=this._getHeaderCellByIndex(t,"row",0));!i;){let e=this._getHeaderContainer(o,0,0,null,this.m_rowHeader,this.m_rowHeaderLevelCount);e.querySelector(`#${r.id}`)?i=!0:o+=this._getAttribute(e,"extent",!0),n.push(e)}}if(-1!==this.m_endRowEndHeader)if(1===this.m_rowEndHeaderLevelCount)for(let e=s;e<=i;e++){let t=this._getHeaderCellsByIndex(e,"rowEnd");o.push(...t)}else{let i=!1,n=s;let r=e;for(this.m_utils.containsCSSClassName(e,this.getMappedStyle("endheadercell"))||(r=this._getHeaderCellByIndex(t,"rowEnd",0));!i;){let e=this._getHeaderContainer(n,0,0,null,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount);e.querySelector(`#${r.id}`)?i=!0:n+=this._getAttribute(e,"extent",!0),o.push(e)}}return{headers:n,endHeaders:o}},z.prototype._removeCellsFromFrozenColumnContainer=function(e){const t=this.m_frozenColIndex,i="column",s=this.getResources().isRTLMode()?"right":"left";let n=this.getElementWidth(this.m_databodyFrozenCol),o=this.getElementWidth(this.m_databody);this.m_databodyFrozenRow&&(o=this.getElementWidth(this.m_databodyFrozenRow));const r=this.getElementDir(this.m_databodyFrozenCol,s);let l=-1===e?t+1:t-e,a=0,h=[],d=[],m=this.m_columnHeaderLevelCount>1?t+1:e+1,c=this.m_columnEndHeaderLevelCount>1?t+1:e+1,{headers:u,endHeaders:_}=this._getColumnHeadersToUnFreeze(e+1),p=0;null!==this.m_frozenRowIndex&&(p=this.m_frozenRowIndex+1);for(let t=p;t<=this.m_endRow;t++)for(let i=e+1;i<=this.m_frozenColIndex;i++){let e=this._getFrozenCellByIndex(this.createIndex(t,i),"row");t===p&&(a+=this.getElementWidth(e)),h.push(e)}let g=a;for(let t=p,i=0;i<=e;i++){let e=this._getFrozenCellByIndex(this.createIndex(t,i),"row");g+=this.getElementWidth(e)}if(!g)for(let t=0,i=0;t<=e;t++){let e=this._getFrozenCellByIndex(this.createIndex(t,i),"row",!0);e&&(g+=this.getElementWidth(e))}let C=0;if(this.m_databodyFrozenCorner){let t=this.m_databodyFrozenRow.firstChild.firstChild;d=this._getFrozenAxisCells(i,e+1,!0);for(let e=0;e<d.length;e++)this.setElementDir(d[e],C,s),this.m_databodyFrozenRow.firstChild.insertBefore(d[e],t),e%l==l-1?C=0:C+=this.getElementWidth(d[e])}if(!h.length&&d.length){let e=d[d.length-1];a=this.getElementWidth(e)+this.getElementDir(e,s),g+=a}C=0;let f=this.m_databody.firstChild.firstChild;for(let e=0;e<h.length;e++)this.setElementDir(h[e],C,s),this.m_utils.removeCSSClassName(h[e],this.getMappedStyle("frozenCell")),this.m_databody.firstChild.insertBefore(h[e],f),e%l==l-1?C=0:C+=this.getElementWidth(h[e]);let y=this.m_colHeader.firstChild.firstChild;const E=this.getMappedStyle("frozenHeader");C=-a,n=g;let v=n-a;if(this.m_columnHeaderLevelCount>1&&(C=-v),this._insertFrozenElementsToContainer(i,u,this.m_colHeader,y,C,s,E,l),this.m_colEndHeader){C=-a,this.m_columnEndHeaderLevelCount>1&&(C=-v);let e=this.m_colEndHeader.firstChild.firstChild;this._insertFrozenElementsToContainer(i,_,this.m_colEndHeader,e,C,s,E,l)}t+1<=this.m_endCol&&(this._shiftCellsAlongAxis(i,a,t+1,!0),this.m_databodyFrozenRow&&this._shiftFrozenCellsAlongAxis(i,a,t+1,!0)),this._shiftHeadersAlongAxisInContainer(this.m_colHeader.firstChild,m,a,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this._shiftHeadersAlongAxisInContainer(this.m_colEndHeader.firstChild,c,a,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell")),this.m_endColPixel+=a,this.m_endColHeaderPixel+=a,this.m_endColEndHeaderPixel+=a;let w=v+r,H=o+a;if(this.m_endRowEndHeader){const e=this.getElementDir(this.m_rowEndHeader,s);H=w+H>e?e-w:H}this._setElementDimension(this.m_databody,null,w,null,H),this._setElementDimension(this.m_colHeader,null,w,null,H),this.m_colEndHeader&&this._setElementDimension(this.m_colEndHeader,null,w,null,H),this.setElementWidth(this.m_databodyFrozenCol,v),this.setElementWidth(this.m_colHeaderFrozen,v),this.m_colEndHeaderFrozen&&this.setElementWidth(this.m_colEndHeaderFrozen,v),this.m_databodyFrozenRow&&this._setElementDimension(this.m_databodyFrozenRow,null,w,null,H),this.m_databodyFrozenCorner&&this.setElementWidth(this.m_databodyFrozenCorner,v),-1===e?this._removeFrozenIndicator(i):this._addFrozenIndicator(i,0,s,w,e),this.m_frozenColIndex=e},z.prototype._removeCellsFromFrozenRowContainer=function(e){const t=this.m_frozenRowIndex,i="row",s=this.getResources().isRTLMode()?"right":"left";let n=this.getElementHeight(this.m_databodyFrozenRow),o=this.getElementDir(this.m_databodyFrozenRow,"top"),r=this.getElementHeight(this.m_databody);this.m_databodyFrozenCol&&(r=this.getElementHeight(this.m_databodyFrozenCol));let l=-1===e?t+1:t-e,a=0,h=[],d=[],{headers:m,endHeaders:c}=this._getRowHeadersToUnFreeze(e+1),u=this.m_columnHeaderLevelCount>1?t+1:e+1,_=this.m_columnEndHeaderLevelCount>1?t+1:e+1,p=0;this._hasFrozenColumns()&&(p=this.m_frozenColIndex+1);for(let t=e+1;t<=this.m_frozenRowIndex;t++)for(let e=p;e<=this.m_endCol;e++){let i=this._getFrozenCellByIndex(this.createIndex(t,e),"column");e===p&&(a+=this.getElementHeight(i)),h.push(i)}let g=a;for(let t=0,i=p;t<=e;t++){let e=this._getFrozenCellByIndex(this.createIndex(t,i),"column");e&&(g+=this.getElementHeight(e))}if(!g)for(let t=0,i=0;t<=e;t++){let e=this._getFrozenCellByIndex(this.createIndex(t,i),"column",!0);e&&(g+=this.getElementHeight(e))}let C=0;if(this.m_databodyFrozenCorner){let t=this.m_databodyFrozenCol.firstChild.firstChild;d=this._getFrozenAxisCells(i,e+1,!0);for(let e=0;e<d.length;e++)this.setElementDir(d[e],C,"top"),this.m_databodyFrozenCol.firstChild.insertBefore(d[e],t),(e+1)%(this.m_frozenColIndex+1)==0&&(C+=this.getElementHeight(d[e]))}if(!h.length&&d.length){let e=d[d.length-1];a=this.getElementHeight(e)+this.getElementDir(e,"top"),g+=a}C=0;let f=this.m_databody.firstChild.firstChild;for(let e=0;e<h.length;e++)this.setElementDir(h[e],C,"top"),this.m_utils.removeCSSClassName(h[e],this.getMappedStyle("frozenCell")),this.m_databody.firstChild.insertBefore(h[e],f),(e+1)%Math.floor(h.length/l)==0&&(C+=this.getElementHeight(h[e]));let y=this.m_rowHeader.firstChild.firstChild;const E=this.getMappedStyle("frozenHeader");n=g;let v=n-a;if(C=-a,this.m_rowHeaderLevelCount>1&&(C=-v),this._insertFrozenElementsToContainer(i,m,this.m_rowHeader,y,C,"top",E,l),this.m_rowEndHeader){C=-a,this.m_rowEndHeaderLevelCount>1&&(C=-v);let e=this.m_rowEndHeader.firstChild.firstChild;this._insertFrozenElementsToContainer(i,c,this.m_rowEndHeader,e,C,"top",E,l)}t+1<=this.m_endRow&&(this._shiftCellsAlongAxis(i,a,t+1,!0),this.m_databodyFrozenCol&&this._shiftFrozenCellsAlongAxis(i,a,t+1,!0)),this._shiftHeadersAlongAxisInContainer(this.m_rowHeader.firstChild,u,a,"top",this.getMappedStyle("rowheadercell")),this._shiftHeadersAlongAxisInContainer(this.m_rowEndHeader.firstChild,_,a,"top",this.getMappedStyle("rowendheadercell"));let w=v+o,H=r+a;if(this.m_endColEndHeader){const e=this.getElementDir(this.m_colEndHeader,"top");H=w+H>e?e-w:H}this.m_endRowPixel+=a,this.m_endRowHeaderPixel+=a,this.m_endRowEndHeaderPixel+=a,this._setElementDimension(this.m_databody,w,null,H,null),this._setElementDimension(this.m_rowHeader,w,null,H,null),this.m_rowEndHeader&&this._setElementDimension(this.m_rowEndHeader,w,null,H,null),this.setElementHeight(this.m_databodyFrozenRow,v),this.setElementHeight(this.m_rowHeaderFrozen,v),this.m_rowEndHeaderFrozen&&this.setElementHeight(this.m_rowEndHeaderFrozen,v),this.m_databodyFrozenCol&&this._setElementDimension(this.m_databodyFrozenCol,w,null,H,null),this.m_databodyFrozenCorner&&this.setElementHeight(this.m_databodyFrozenCorner,v),-1===e?this._removeFrozenIndicator(i):this._addFrozenIndicator(i,w,s,0,e),this.m_frozenRowIndex=e},z.prototype._getColumnHeadersToUnFreeze=function(e){let t=[],i=[];if(this.m_colHeaderFrozen&&-1!==this.m_endColHeader)if(1===this.m_columnHeaderLevelCount)for(let i=e;i<=this.m_frozenColIndex;i++){let e=this._getHeaderCellsByIndex(i,"column");t.push(...e)}else for(let i=e;i<this.m_frozenColIndex;){let e=this._getHeaderContainer(i,0,0,null,this.m_colHeaderFrozen,this.m_columnHeaderLevelCount);t.push(e);i+=this._getAttribute(e,"extent",!0)}if(this.m_colEndHeaderFrozen&&-1!==this.m_endColEndHeader)if(1===this.m_columnEndHeaderLevelCount)for(let t=e;t<=this.m_frozenColIndex;t++){let e=this._getHeaderCellsByIndex(t,"columnEnd");i.push(...e)}else for(let t=e;t<this.m_frozenColIndex;){let e=this._getHeaderContainer(t,0,0,null,this.m_colEndHeaderFrozen,this.m_columnEndHeaderLevelCount);i.push(e);t+=this._getAttribute(e,"extent",!0)}return{headers:t,endHeaders:i}},z.prototype._getRowHeadersToUnFreeze=function(e){let t=[],i=[];if(this.m_rowHeaderFrozen&&-1!==this.m_endRowHeader)if(1===this.m_rowHeaderLevelCount)for(let i=e;i<=this.m_frozenRowIndex;i++){let e=this._getHeaderCellsByIndex(i,"row");t.push(...e)}else for(let i=e;i<this.m_frozenRowIndex;){let e=this._getHeaderContainer(i,0,0,null,this.m_rowHeaderFrozen,this.m_rowHeaderLevelCount);t.push(e);i+=this._getAttribute(e,"extent",!0)}if(this.m_rowEndHeaderFrozen&&-1!==this.m_endRowEndHeader)if(1===this.m_rowEndHeaderLevelCount)for(let t=e;t<=this.m_frozenRowIndex;t++){let e=this._getHeaderCellsByIndex(t,"rowEnd");i.push(...e)}else for(let t=e;t<this.m_frozenRowIndex;){let e=this._getHeaderContainer(t,0,0,null,this.m_rowEndHeaderFrozen,this.m_rowEndHeaderLevelCount);i.push(e);t+=this._getAttribute(e,"extent",!0)}return{headers:t,endHeaders:i}},z.prototype._appendElementsToFrozenContainer=function(e,t,i,s,n,o,r){let l=this.getElementHeight.bind(this);"column"===e&&(l=this.getElementWidth.bind(this));for(let e=0;e<t.length;e++)o===this.getMappedStyle("frozenHeader")&&t[e].classList.contains(this.getMappedStyle("groupingcontainer"))?(this._adjustContainerElementsDirValue(t[e],s,n,o,!1),i.firstChild.appendChild(t[e])):(this.setElementDir(t[e],s,n),this.m_utils.addCSSClassName(t[e],o),i.firstChild.appendChild(t[e]),(e+1)%Math.floor(t.length/r)==0&&(s+=l(t[e])));return s},z.prototype._adjustContainerElementsDirValue=function(e,t,i,s,n){let o=e.childNodes;for(let e=0;e<o.length;e++)if(o[e].classList&&(o[e].classList.contains(this.getMappedStyle("headercell"))||o[e].classList.contains(this.getMappedStyle("endheadercell")))){let r=this.getElementDir(o[e],i)+t;n?this.m_utils.removeCSSClassName(o[e],s):this.m_utils.addCSSClassName(o[e],s),this.setElementDir(o[e],r,i)}else this._adjustContainerElementsDirValue(o[e],t,i,s,n);return t},z.prototype._insertFrozenElementsToContainer=function(e,t,i,s,n,o,r,l){let a=this.getElementHeight.bind(this);"column"===e&&(a=this.getElementWidth.bind(this));for(let e=0;e<t.length;e++)r===this.getMappedStyle("frozenHeader")&&t[e].classList.contains(this.getMappedStyle("groupingcontainer"))?(this._adjustContainerElementsDirValue(t[e],n,o,r,!0),i.firstChild.insertBefore(t[e],s)):(this.setElementDir(t[e],n,o),this.m_utils.removeCSSClassName(t[e],r),i.firstChild.insertBefore(t[e],s),(e+1)%(t.length/l)==0&&(n+=a(t[e])))},z.prototype._getFrozenAxisCells=function(e,t,i){const s=this.m_frozenRowIndex,n=this.m_frozenColIndex;let o=0,r=s,l=n+1,a=t,h=[];null===n&&(l=0),"row"!==e||i||(s&&(o=s+1),r=t,l=0,a=n),i&&(o="row"===e?t:0,l="row"===e?0:t,a=n,r=s);for(let t=o;t<=r;t++)for(let s=l;s<=a;s++){let n=this._getFrozenCellByIndex(this.createIndex(t,s),e,i);n&&h.push(n)}return h},z.prototype._createFrozenHeaderElements=function(e,t,i){const s=this.getMappedStyle("scroller")+(this.m_utils.isTouchDeviceNotIOS()?" "+this.getMappedStyle("scroller-mobile"):"");let n;n="column"===e?"frozenColumn":"frozenRow";const o=this._createHeaderElement(n,t,s,!1);if(this.m_root.insertBefore(o,this.m_status),"column"===e?this.m_colHeaderFrozen=o:this.m_rowHeaderFrozen=o,"column"===e&&this.m_colEndHeader||"row"===e&&this.m_rowEndHeader){const t=this._createHeaderElement(n,i,s,!0);this.m_root.insertBefore(t,this.m_status),"column"===e?this.m_colEndHeaderFrozen=t:this.m_rowEndHeaderFrozen=t}},z.prototype._handleUnFreeze=function(e,t){if("column"===e&&-1!==this.m_frozenColIndex){if(this._removeCellsFromFrozenColumnContainer(-1),this.m_root.removeChild(this.m_databodyFrozenCol),this._hasFrozenColumns()&&this._hasFrozenRows()&&this.m_root.removeChild(this.m_databodyFrozenCorner),this.m_colHeaderFrozen&&this.m_root.removeChild(this.m_colHeaderFrozen),this.m_colEndHeaderFrozen&&this.m_root.removeChild(this.m_colEndHeaderFrozen),t){let e={event:t,ui:{frozenCount:0}};this.fireEvent("columnFreeze",e)}}else if("row"===e&&-1!==this.m_frozenRowIndex&&(this._removeCellsFromFrozenRowContainer(-1),this.m_root.removeChild(this.m_databodyFrozenRow),this._hasFrozenColumns()&&this._hasFrozenRows()&&this.m_root.removeChild(this.m_databodyFrozenCorner),this.m_rowHeaderFrozen&&this.m_root.removeChild(this.m_rowHeaderFrozen),this.m_rowEndHeaderFrozen&&this.m_root.removeChild(this.m_rowEndHeaderFrozen),t)){let e={event:t,ui:{frozenCount:0}};this.fireEvent("rowFreeze",e)}},z.prototype._hasFrozenRows=function(){let e=!1;return null!==this.m_frozenRowIndex&&-1!==this.m_frozenRowIndex&&(e=!0),e},z.prototype._hasFrozenColumns=function(){let e=!1;return null!==this.m_frozenColIndex&&-1!==this.m_frozenColIndex&&(e=!0),e},z.prototype.showStatusText=function(e){const t=this;"block"===this.m_status.style.display||this.m_showStatusTimeout||(this.m_showStatusTimeout=setTimeout(function(){const i=t.getResources().getTranslatedText("msgFetchingData");let s,n;if(t.m_status.setAttribute("aria-label",i),t.m_status.style.display="block",e){const e=document.createElement("div");e.className=t.getMappedStyle("loadingicon"),t.m_status.appendChild(e),s=t.getWidth()/2-t.m_status.offsetWidth/2,n=t.getHeight()/2-t.m_status.offsetHeight/2}else{s=0,n=0;const e=document.createDocumentFragment();t.buildSkeletonGrid(e),t.m_status.appendChild(e)}t.m_status.style.left=s+"px",t.m_status.style.top=n+"px",t.m_showStatusTimeout=null},this.getShowStatusDelay()))},z.prototype.buildSkeletonGrid=function(e){const t=this.getWidth(),i=this.getHeight(),s=this.getDefaultColumnWidth(),n=this.getDefaultRowHeight(),o=Math.max(1,Math.ceil(i/n)),r=Math.max(1,Math.ceil(t/s));let l=0;for(let t=0;t<o;t++){let i=0;for(let a=0;a<r;a++){const h=this.createSkeletonCell(s,n,i,l);a===r-1&&h.classList.add(this.getMappedStyle("borderVerticalNone")),t===o-1&&h.classList.add(this.getMappedStyle("borderHorizontalNone")),e.appendChild(h),i+=s}l+=n}},z.prototype.isSkeletonSupport=function(){return"skeleton"===this.getResources().getDefaultOption("loadIndicator")},z.prototype.getShowStatusDelay=function(){const e=_.getCSSTimeUnitAsMillis(this.getResources().getDefaultOption("showIndicatorDelay"));return isNaN(e)?0:e},z.prototype.hideStatusText=function(){this.m_showStatusTimeout&&(clearTimeout(this.m_showStatusTimeout),this.m_showStatusTimeout=null),this.m_status.style.display="none",this.m_utils.empty(this.m_status),this.isSkeletonSupport()&&this._removeAllSkeletons()},z.prototype._removeAllSkeletons=function(){this._resetSkeletonProperties();const e=this._getAllSkeletonContainers(this.m_root);if(e.length>0)for(let t=0;t<e.length;t++)this._remove(e[t])},z.prototype.addSkeletonCells=function(e,t,i,s,n,o,r,l,a,h){const d=this.getDefaultColumnWidth(),m=this.getDefaultRowHeight(),c=document.createDocumentFragment(),u=document.createDocumentFragment(),_=document.createDocumentFragment(),p=[],g=[];let C,f,y=o,E=r;const v=this.m_databody.firstChild;let w,H;this._hasFrozenRows()&&(w=this.m_databodyFrozenRow.firstChild),this._hasFrozenColumns()&&(H=this.m_databodyFrozenCol.firstChild);for(let o=0;o<t;o++){E=r,C=a?s+o:s+(t-1-o),"column"===e&&this._hasFrozenRows()&&C===this.m_frozenRowIndex+1&&(y-=m*(this.m_frozenRowIndex+1));for(let s=0;s<i;s++){if(f=h?n+s:n+(i-1-s),null==g[o]||null==p[s]){const e=this._getCellOrHeaderByIndex(C,"row"),t=this._getCellOrHeaderByIndex(f,"column");if(e){const t=e[this.getResources().getMappedAttribute("context")];t&&(g[o]=this._getCellDimension(null,C,t.keys?t.keys.row:t.key,"row","height"))}if(t){const e=t[this.getResources().getMappedAttribute("context")];e&&(p[s]=this._getCellDimension(null,f,e.keys?e.keys.column:e.key,"column","width"))}null==g[o]&&(g[o]=m),null==p[s]&&(p[s]=d)}"row"===e&&this._hasFrozenColumns()&&f===this.m_frozenColIndex+1&&(E-=d*(this.m_frozenColIndex+1));const r=this.createIndex(C,f);if(l||!this._skeletonSetHas(r)){const e=this.createSkeletonCell(p[s],g[o],h?E:E-p[s],a?y:y-g[o]);this._addIndexToSkeletonSet(r),s===i-1&&this.m_utils.addCSSClassName(e,this.getMappedStyle("borderVerticalNone")),o===t-1&&this.m_utils.addCSSClassName(e,this.getMappedStyle("borderHorizontalNone")),this._hasFrozenColumns()&&f<this.m_frozenColIndex+1?_.appendChild(e):this._hasFrozenRows()&&C<this.m_frozenRowIndex+1?u.appendChild(e):c.appendChild(e)}E=h?E+p[s]:E-p[s]}y=a?y+g[o]:y-g[o]}if(this.m_skeletonRowStart=s,this.m_skeletonRowEnd=s+t-1,this.m_skeletonColStart=n,this.m_skeletonColEnd=n+i-1,this.m_skeletonColStartPixel=h?r:E,this.m_skeletonColEndPixel=h?E:r,this.m_skeletonRowStartPixel=a?o:y,this.m_skeletonRowEndPixel=a?y:o,c.childElementCount>0){let e=this._getAllSkeletonContainers(v);e=0===e.length?this._createSkeletonContainer():e[0],e.appendChild(c),v.appendChild(e)}if(_.childElementCount>0){let e=this._getAllSkeletonContainers(H);e=0===e.length?this._createSkeletonContainer():e[0],e.appendChild(_),H.appendChild(e)}if(u.childElementCount>0){let e=this._getAllSkeletonContainers(w);e=0===e.length?this._createSkeletonContainer():e[0],e.appendChild(u),w.appendChild(e)}l||("row"===e?(this.m_hasRowHeader&&this.createHeaderSkeletonCells(this.m_rowHeader,"row",t,this.m_rowHeaderLevelWidths,0,o,a),this.m_hasRowEndHeader&&this.createHeaderSkeletonCells(this.m_rowEndHeader,"row",t,this.m_rowEndHeaderLevelWidths,0,o,a)):"column"===e&&(this.m_hasColHeader&&this.createHeaderSkeletonCells(this.m_colHeader,"column",i,this.m_columnHeaderLevelHeights,r,0,h),this.m_hasColEndHeader&&this.createHeaderSkeletonCells(this.m_colEndHeader,"column",i,this.m_columnEndHeaderLevelHeights,r,0,h)))},z.prototype.createSkeletonCell=function(e,t,i,s){const n=this.getResources().isRTLMode()?"right":"left",o=document.createElement("div");o.className=this.getMappedStyle("skeletonCell");const r=document.createElement("div");return r.classList.add(this.getMappedStyle("skeleton"),this.getMappedStyle("skeletonAnimation")),o.appendChild(r),this.setElementHeight(o,t),this.setElementWidth(o,e),this.setElementDir(o,s,"top"),this.setElementDir(o,i,n),o},z.prototype.createHeaderSkeletonCells=function(e,t,i,s,n,o,r){let l=i,a=s.length,h=this.getDefaultColumnWidth(),d=this.getDefaultRowHeight();"column"===t&&(l=s.length,a=i);const m=document.createDocumentFragment();let c=o;for(let e=0;e<l;e++){let i=n;for(let n=0;n<a;n++){let o;"row"===t?h=s[n]:d=s[e],r?(o=this.createSkeletonCell(h,d,i,c),i+=h):"row"===t?(o=this.createSkeletonCell(h,d,i,c-d),i+=h):(o=this.createSkeletonCell(h,d,i-h,c),i-=h),m.appendChild(o)}r||"column"===t?c+=d:c-=d}if(m.childElementCount>0){let t=this._getAllSkeletonContainers(e);t=0===t.length?this._createSkeletonContainer():t[0],t.appendChild(m),e.firstChild.appendChild(t)}},z.prototype.loadSkeletons=function(e,t,i,s,n,o){let r,l,a,h,d,m=this.getFetchSize("row"),c=this.getFetchSize("column"),u=!0,_=!0;const p=this._getViewportLeft(),g=this._getViewportRight(),C=this._getViewportTop()<0?0:this._getViewportTop(),f=this._getViewportBottom(),y=null!=this.m_skeletonRowStart?this.m_skeletonRowStart:this.m_startRow,E=null!=this.m_skeletonRowStartPixel?this.m_skeletonRowStartPixel:this.m_startRowPixel,v=null!=this.m_skeletonRowEnd?this.m_skeletonRowEnd:this.m_endRow,w=null!=this.m_skeletonRowEndPixel?this.m_skeletonRowEndPixel:this.m_endRowPixel,H=null!=this.m_skeletonColStart?this.m_skeletonColStart:this.m_startCol,S=null!=this.m_skeletonColStartPixel?this.m_skeletonColStartPixel:this.m_startColPixel,x=null!=this.m_skeletonColEnd?this.m_skeletonColEnd:this.m_endCol,b=null!=this.m_skeletonColEndPixel?this.m_skeletonColEndPixel:this.m_endColPixel;if(this.m_prevScrollLeft>t&&S>p)r=i,h=n,m=Math.max(this.getFetchCount("row",r),this.m_endRow-r),l=Math.min(H-c,s),a=Math.min(S,o+c*this.getDefaultColumnWidth()),_=!1,d="column";else if(!(this.m_prevScrollLeft<t&&b<=g)||this.m_stopColumnHeaderFetch&&this.m_stopColumnEndHeaderFetch&&this.m_stopColumnFetch)if(this.m_prevScrollTop>e&&E>C)l=s,a=o,c=Math.max(this.getFetchCount("column",l),this.m_endCol-l),r=Math.min(y-m,i),h=Math.min(E,n+m*this.getDefaultRowHeight()),u=!1,d="row";else{if(!(this.m_prevScrollTop<e&&w<=f)||this.m_stopRowHeaderFetch&&this.m_stopRowEndHeaderFetch&&this.m_stopRowFetch)return;this._isHighWatermarkScrolling()?(r=this.m_endRow+1,l=this.m_startCol,u=i>=this.m_startRow,h=u?this.m_endRowPixel:this.m_startRowPixel,a=this.m_startColPixel,m=z.SKELETON_DEFAULT_COUNT,c=this.m_endCol-this.m_startCol+1):(l=s,a=o,c=Math.max(this.getFetchCount("column",l),this.m_endCol-l),r=Math.max(v+1,i),h=Math.max(w,n),m=this.getFetchCount("row",r)),d="row"}else this._isHighWatermarkScrolling()?(m=this.m_endRow-this.m_startRow+1,c=z.SKELETON_DEFAULT_COUNT,r=this.m_startRow,l=this.m_endCol+1,_=l>=this.m_startCol,h=this.m_startRowPixel,a=_?this.m_endColPixel:this.m_startColPixel):(r=i,h=n,m=Math.max(this.getFetchCount("row",r),this.m_endRow-r),l=Math.max(x+1,s),a=Math.max(b,o),c=this.getFetchCount("column",l)),d="column";this._isHighWatermarkScrolling()&&!this.isFetchComplete()||this.addSkeletonCells(d,m,c,r,l,h,a,!1,u,_)},z.prototype.loadSkeletonsOnHeaderLoad=function(e,t,i,s){let n=i&&i.getCount()||s&&s.getCount();if(0===n||!this.isSkeletonSupport())return;let o=n,r=this.isLongScroll()?this.getFetchSize("column"):this.m_endCol-this.m_startCol+1,l=t,a=this.m_startCol,h=l>=this.m_startRow,d=!0,m=!this.isLongScroll()&&h?this.m_endRowPixel:this.m_startRowPixel,c=this.m_startColPixel;"column"===e&&(o=this.isLongScroll()?this.getFetchSize("row"):this.m_endRow-this.m_startRow+1,r=n,l=this.m_startRow,a=t,h=!0,d=a>=this.m_startCol,m=this.m_startRowPixel,c=!this.isLongScroll()&&d?this.m_endColPixel:this.m_startColPixel),this.isLongScroll()&&(h=!0,d=!0),this.isHeaderFetchComplete()&&!this.m_headerInvalid&&(this.hideStatusText(),this.addSkeletonCells(e,o,r,l,a,m,c,!0,h,d))},z.prototype._addIndexToSkeletonSet=function(e){const t="r"+e.row+"c"+e.column;this.m_skeletonSet.add(t)},z.prototype._skeletonSetHas=function(e){const t="r"+e.row+"c"+e.column;return this.m_skeletonSet.has(t)},z.prototype._getAllNonSkeletonContainerNodes=function(e){return e.querySelectorAll(`:scope > div:not(.${this.getMappedStyle("skeletonContainer")})`)},z.prototype._removeAllNonSkeletonContainerNodes=function(e){this._getAllNonSkeletonContainerNodes(e).forEach(e=>{this._remove(e)})},z.prototype._getAllSkeletonContainers=function(e){return e.querySelectorAll(`.${this.getMappedStyle("skeletonContainer")}`)},z.prototype._createSkeletonContainer=function(){const e=document.createElement("div");return e.classList.add(this.getMappedStyle("skeletonContainer")),e},z.prototype._scrollSkeletonHeadersIntoViewport=function(e,t,i,s){const n={index:s?e+z.SKELETON_DEFAULT_COUNT:Math.max(0,e-z.SKELETON_DEFAULT_COUNT),axis:t,level:i};this.scrollToHeader(n),n.index=s?e+1:e-1,this.m_scrollHeaderAfterFetch=n},z.prototype._scrollSkeletonCellsIntoViewport=function(e,t,i,s){let n=e,o=t;"column"===i?(o=s?t+z.SKELETON_DEFAULT_COUNT:Math.max(0,t-z.SKELETON_DEFAULT_COUNT),t=s?t+1:t-1):(n=s?e+z.SKELETON_DEFAULT_COUNT:Math.max(0,e-z.SKELETON_DEFAULT_COUNT),e=s?e+1:e-1),this.scrollToIndex(this.createIndex(n,o),!1),this.m_scrollIndexAfterFetch=this.createIndex(e,t)},z.prototype._resetSkeletonProperties=function(){this.m_skeletonRowStart=null,this.m_skeletonRowEnd=null,this.m_skeletonColStart=null,this.m_skeletonColEnd=null,this.m_skeletonColStartPixel=null,this.m_skeletonColEndPixel=null,this.m_skeletonRowStartPixel=null,this.m_skeletonRowEndPixel=null,this.m_skeletonSet=new Set}});
|
|
8
|
+
define(["touchr","ojs/ojdatasource-common","ojs/ojdatacollection-utils","ojs/ojinputnumber","ojs/ojmenu","ojs/ojmenuselectmany","ojs/ojdialog","ojs/ojbutton","ojdnd","ojs/ojcore-base","@oracle/oraclejet-preact/hooks/UNSAFE_useFormVariantContext","ojs/ojcomponentcore","ojs/ojcontext","ojs/ojdatacollection-common","ojs/ojdomutils","ojs/ojconfig","ojs/ojcustomelement-utils","ojs/ojkeyboardfocus-utils","jquery","ojs/ojlogger","ojs/ojthemeutils"],function(e,t,i,s,n,o,l,r,a,h,d,m,c,u,_,p,g,C,f,y,E){"use strict";var v;h=h&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h,c=c&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c,f=f&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f,(v={properties:{bandingInterval:{type:"object",properties:{column:{type:"number",value:0},row:{type:"number",value:0}}},cell:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},currentCell:{type:"object",writeback:!0},data:{type:"DataGridProvider",extension:{webelement:{exceptionStatus:[{type:"unsupported",since:"13.0.0",description:"Data sets from a DataProvider cannot be sent to WebDriverJS; use ViewModels or page variables instead."}]}}},dataTransferOptions:{type:"object",properties:{copy:{type:"string",enumValues:["disable","enable"],value:"disable"},cut:{type:"string",enumValues:["disable","enable"],value:"disable"},fill:{type:"string",enumValues:["disable","enable"],value:"disable"},paste:{type:"string",enumValues:["disable","enable"],value:"disable"}}},dnd:{type:"object",properties:{drag:{type:"object",properties:{columns:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},drag:{type:"function"},dragEnd:{type:"function"},dragStart:{type:"function"}}},rows:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},drag:{type:"function"},dragEnd:{type:"function"},dragStart:{type:"function"}}}}},drop:{type:"object",properties:{columns:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},dragEnter:{type:"function"},dragLeave:{type:"function"},dragOver:{type:"function"},drop:{type:"function"}}},rows:{type:"object",properties:{dataTypes:{type:"string|Array<string>"},dragEnter:{type:"function"},dragLeave:{type:"function"},dragOver:{type:"function"},drop:{type:"function"}}}}},reorder:{type:"object",properties:{row:{type:"string",enumValues:["disable","enable"],value:"disable"}}}}},editMode:{type:"string",writeback:!0,enumValues:["cellEdit","cellNavigation","none"],value:"none"},frozenColumnCount:{type:"number",writeback:!0,value:0},frozenRowCount:{type:"number",writeback:!0,value:0},gridlines:{type:"object",properties:{horizontal:{type:"string",enumValues:["hidden","visible"],value:"visible"},vertical:{type:"string",enumValues:["hidden","visible"],value:"visible"}}},header:{type:"object",properties:{column:{type:"object",properties:{className:{type:"function|string"},freezable:{type:"string",enumValues:["disable","enable"],value:"disable"},hidable:{type:"string",value:"disable"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string",enumValues:["disable","enable"],value:"disable"},width:{type:"string|function",enumValues:["disable","enable"],value:"disable"}}},sortable:{type:"function|string",enumValues:["auto","disable","enable"],value:"auto"},style:{type:"function|string"}}},columnEnd:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string",enumValues:["disable","enable"],value:"disable"},width:{type:"string|function",enumValues:["disable","enable"],value:"disable"}}},style:{type:"function|string"}}},row:{type:"object",properties:{className:{type:"function|string"},freezable:{type:"string",enumValues:["disable","enable"],value:"disable"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string|function",enumValues:["disable","enable"],value:"disable"},width:{type:"string",enumValues:["disable","enable"],value:"disable"}}},sortable:{type:"function|string",enumValues:["auto","disable","enable"],value:"auto"},style:{type:"function|string"}}},rowEnd:{type:"object",properties:{className:{type:"function|string"},label:{type:"object",properties:{className:{type:"function|string"},renderer:{type:"function"},style:{type:"function|string"}}},renderer:{type:"function"},resizable:{type:"object",properties:{height:{type:"string|function",enumValues:["disable","enable"],value:"disable"},width:{type:"string",enumValues:["disable","enable"],value:"disable"}}},style:{type:"function|string"}}}}},hiddenColumns:{type:"object",writeback:!0},scrollPolicy:{type:"string",enumValues:["auto","loadMoreOnScroll","scroll"],value:"auto"},scrollPolicyOptions:{type:"object",properties:{maxColumnCount:{type:"number",value:500},maxRowCount:{type:"number",value:500}}},scrollPosition:{type:"object",writeback:!0,value:{x:0,y:0},properties:{columnIndex:{type:"number"},columnKey:{type:"any"},offsetX:{type:"number"},offsetY:{type:"number"},rowIndex:{type:"number"},rowKey:{type:"any"},x:{type:"number"},y:{type:"number"}}},scrollToKey:{type:"string",enumValues:["always","auto","capability","never"],value:"auto"},selection:{type:"Array<Object>",writeback:!0,value:[]},selectionMode:{type:"object",properties:{cell:{type:"string",enumValues:["multiple","none","single"],value:"none"},row:{type:"string",enumValues:["multiple","none","single"],value:"none"}}},translations:{type:"object",value:{},properties:{accessibleActionableMode:{type:"string"},accessibleCollapsed:{type:"string"},accessibleColumnContext:{type:"string"},accessibleColumnEndHeaderContext:{type:"string"},accessibleColumnEndHeaderLabelContext:{type:"string"},accessibleColumnHeaderContext:{type:"string"},accessibleColumnHeaderLabelContext:{type:"string"},accessibleColumnHierarchicalFull:{type:"string"},accessibleColumnHierarchicalPartial:{type:"string"},accessibleColumnHierarchicalUnknown:{type:"string"},accessibleColumnSelected:{type:"string"},accessibleColumnSpanContext:{type:"string"},accessibleContainsControls:{type:"string"},accessibleExpanded:{type:"string"},accessibleFirstColumn:{type:"string"},accessibleFirstRow:{type:"string"},accessibleLastColumn:{type:"string"},accessibleLastRow:{type:"string"},accessibleLevelContext:{type:"string"},accessibleLevelHierarchicalContext:{type:"string"},accessibleMultiCellSelected:{type:"string"},accessibleNavigationMode:{type:"string"},accessibleRangeSelectModeOff:{type:"string"},accessibleRangeSelectModeOn:{type:"string"},accessibleRowCollapsed:{type:"string"},accessibleRowContext:{type:"string"},accessibleRowEndHeaderContext:{type:"string"},accessibleRowEndHeaderLabelContext:{type:"string"},accessibleRowExpanded:{type:"string"},accessibleRowHeaderContext:{type:"string"},accessibleRowHeaderLabelContext:{type:"string"},accessibleRowHierarchicalFull:{type:"string"},accessibleRowHierarchicalPartial:{type:"string"},accessibleRowHierarchicalUnknown:{type:"string"},accessibleRowSelected:{type:"string"},accessibleRowSpanContext:{type:"string"},accessibleSelectionAffordanceBottom:{type:"string"},accessibleSelectionAffordanceTop:{type:"string"},accessibleSortAscending:{type:"string"},accessibleSortDescending:{type:"string"},accessibleSortable:{type:"string"},accessibleStateSelected:{type:"string"},accessibleSummaryEstimate:{type:"string"},accessibleSummaryExact:{type:"string"},accessibleSummaryExpanded:{type:"string"},collapsedText:{type:"string"},columnWidth:{type:"string"},expandedText:{type:"string"},labelCopyCells:{type:"string"},labelCut:{type:"string"},labelCutCells:{type:"string"},labelDisableNonContiguous:{type:"string"},labelEnableNonContiguous:{type:"string"},labelFillCells:{type:"string"},labelFreezeCol:{type:"string"},labelFreezeRow:{type:"string"},labelHideColumn:{type:"string"},labelPaste:{type:"string"},labelPasteCells:{type:"string"},labelResize:{type:"string"},labelResizeColumn:{type:"string"},labelResizeDialogApply:{type:"string"},labelResizeDialogCancel:{type:"string"},labelResizeDialogSubmit:{type:"string"},labelResizeFitToContent:{type:"string"},labelResizeHeight:{type:"string"},labelResizeRow:{type:"string"},labelResizeWidth:{type:"string"},labelSelectMultiple:{type:"string"},labelSortAsc:{type:"string"},labelSortCol:{type:"string"},labelSortColAsc:{type:"string"},labelSortColDsc:{type:"string"},labelSortDsc:{type:"string"},labelSortRow:{type:"string"},labelSortRowAsc:{type:"string"},labelSortRowDsc:{type:"string"},labelUnfreezeCol:{type:"string"},labelUnfreezeRow:{type:"string"},labelUnhideColumn:{type:"string"},msgFetchingData:{type:"string"},msgNoData:{type:"string"},resizeColumnDialog:{type:"string"},resizeRowDialog:{type:"string"},rowHeight:{type:"string"},tooltipRequired:{type:"string"}}}},methods:{getContextByNode:{},getProperty:{},refresh:{},setProperties:{},setProperty:{},getNodeBySubId:{},getSubIdByNode:{}},events:{ojBeforeCurrentCell:{},ojBeforeEdit:{},ojBeforeEditEnd:{},ojCollapseRequest:{},ojCopyRequest:{},ojCutRequest:{},ojExpandRequest:{},ojFillRequest:{},ojPasteRequest:{},ojResize:{},ojScroll:{},ojSort:{},ojSortRequest:{}},extension:{}}).extension._WIDGET_NAME="ojDataGrid",v.extension._BINDING={provide:new Map([[d.FormVariantContext,"embedded"]])},h.CustomElementBridge.register("oj-data-grid",{metadata:h.CollectionUtils.mergeDeep(v,{properties:{userAssistanceDensity:{binding:{provide:[{name:"containerUserAssistanceDensity",default:"compact"},{name:"userAssistanceDensity",default:"compact"}]}}}})});const w=function(e,t,i,s){this.rtlMode=e,this.translationFunction=t,this.defaultOptions=i,this.widgetName=s,this.styles={},this.styles.datagrid="oj-datagrid",this.styles.cell="oj-datagrid-cell",this.styles.banded="oj-datagrid-banded",this.styles.row="oj-datagrid-row",this.styles.databody="oj-datagrid-databody",this.styles.topcorner="oj-datagrid-top-corner",this.styles.bottomcorner="oj-datagrid-bottom-corner",this.styles.rowheaderspacer="oj-datagrid-row-header-spacer",this.styles.colheaderspacer="oj-datagrid-column-header-spacer",this.styles.status="oj-datagrid-status",this.styles.loadingicon="oj-icon oj-datagrid-loading-icon",this.styles.emptytext="oj-datagrid-empty-text",this.styles.header="oj-datagrid-header",this.styles.endheader="oj-datagrid-end-header",this.styles.groupingcontainer="oj-datagrid-header-grouping",this.styles.headercell="oj-datagrid-header-cell",this.styles.rowheader="oj-datagrid-row-header",this.styles.colheader="oj-datagrid-column-header",this.styles.colheadercell="oj-datagrid-column-header-cell",this.styles.rowheadercell="oj-datagrid-row-header-cell",this.styles.endheadercell="oj-datagrid-end-header-cell",this.styles.rowendheader="oj-datagrid-row-end-header",this.styles.colendheader="oj-datagrid-column-end-header",this.styles.colendheadercell="oj-datagrid-column-end-header-cell",this.styles.rowendheadercell="oj-datagrid-row-end-header-cell",this.styles.headerlabel="oj-datagrid-header-label",this.styles.rowheaderlabel="oj-datagrid-row-header-label",this.styles.columnheaderlabel="oj-datagrid-column-header-label",this.styles.rowendheaderlabel="oj-datagrid-row-end-header-label",this.styles.columnendheaderlabel="oj-datagrid-column-end-header-label",this.styles["scroller-mobile"]="oj-datagrid-scroller-touch",this.styles.scroller="oj-datagrid-scroller",this.styles.scrollers="oj-datagrid-scrollers",this.styles.scrollbarForce="oj-scrollbar-force",this.styles.focus="oj-focus",this.styles.hover="oj-hover",this.styles.active="oj-active",this.styles.selected="oj-selected",this.styles.topSelected="oj-datagrid-selected-top",this.styles.bottomSelected="oj-datagrid-selected-bottom",this.styles.startSelected="oj-datagrid-selected-start",this.styles.endSelected="oj-datagrid-selected-end",this.styles.topEdit="oj-datagrid-cell-edit-top",this.styles.bottomEdit="oj-datagrid-cell-edit-bottom",this.styles.startEdit="oj-datagrid-cell-edit-start",this.styles.endEdit="oj-datagrid-cell-edit-end",this.styles.topFloodfill="oj-datagrid-floodfill-top",this.styles.bottomFloodfill="oj-datagrid-floodfill-bottom",this.styles.startFloodfill="oj-datagrid-floodfill-start",this.styles.endFloodfill="oj-datagrid-floodfill-end",this.styles.topResized="oj-datagrid-resized-top",this.styles.bottomResized="oj-datagrid-resized-bottom",this.styles.endResized="oj-datagrid-resized-end",this.styles.startResized="oj-datagrid-resized-start",this.styles.disabled="oj-disabled",this.styles.enabled="oj-enabled",this.styles.default="oj-default",this.styles.sortIcon="oj-datagrid-sort-icon",this.styles.sortascending="oj-datagrid-sort-ascending-icon",this.styles.sortdescending="oj-datagrid-sort-descending-icon",this.styles.sortdefault="oj-datagrid-sort-default-icon",this.styles.icon="oj-component-icon",this.styles.clickableicon="oj-clickable-icon-nocontext",this.styles.info="oj-helper-hidden-accessible",this.styles.rowexpander="oj-rowexpander",this.styles.cut="oj-datagrid-cut",this.styles.selectaffordance="oj-datagrid-touch-selection-affordance",this.styles.selectaffordancetopcornerbounded="oj-datagrid-touch-selection-affordance-top-corner-bounded",this.styles.selectaffordancebottomcornerbounded="oj-datagrid-touch-selection-affordance-bottom-corner-bounded",this.styles.selectaffordancetoprow="oj-datagrid-touch-selection-affordance-top-row",this.styles.selectaffordancebottomrow="oj-datagrid-touch-selection-affordance-bottom-row",this.styles.selectaffordancetopcolumn="oj-datagrid-touch-selection-affordance-top-column",this.styles.selectaffordancebottomcolumn="oj-datagrid-touch-selection-affordance-bottom-column",this.styles.floodfillaffordance="oj-datagrid-floodfill-affordance",this.styles.toucharea="oj-datagrid-touch-area",this.styles.readOnly="oj-read-only",this.styles.editable="oj-datagrid-editable",this.styles.cellEdit="oj-datagrid-cell-edit",this.styles.draggable="oj-draggable",this.styles.drag="oj-drag",this.styles.drop="oj-drop",this.styles.activedrop="oj-active-drop",this.styles.validdrop="oj-valid-drop",this.styles.invaliddrop="oj-invalid-drop",this.styles.formcontrol="oj-form-control-inherit",this.styles.borderHorizontalNone="oj-datagrid-border-horizontal-none",this.styles.borderVerticalNone="oj-datagrid-border-vertical-none",this.styles.borderHorizontalSmall="oj-datagrid-small-content-border-horizontal",this.styles.borderVerticalSmall="oj-datagrid-small-content-border-vertical",this.styles.offsetOutline="oj-datagrid-focus-offset",this.styles.depth="oj-datagrid-depth-",this.styles.popupHeader="oj-datagrid-popup-header",this.styles.popupContent="oj-datagrid-popup-content",this.styles.popupFooter="oj-datagrid-popup-footer",this.styles.dialogTitle="oj-dialog-title",this.styles.resizeDialog="oj-datagrid-resize-dialog",this.styles.headerAllSelected="oj-selected",this.styles.headerPartialSelected="oj-partial-selected",this.styles.disclosureContainer="oj-datagrid-disclosure-icon-container",this.styles.disclosureIcon="oj-datagrid-disclosure-icon",this.styles.expanded="oj-datagrid-expanded-icon",this.styles.collapsed="oj-datagrid-collapsed-icon",this.styles.spacer="oj-datagrid-tree-spacer",this.styles.hierarchicalTree="oj-datagrid-hierarchical-tree",this.styles.hierarchicalGroup="oj-datagrid-hierarchical-group",this.styles.iconContainer="oj-datagrid-icon-container",this.styles.requiredIcon="oj-datagrid-required-icon",this.styles.noDataContainer="oj-datagrid-no-data-container",this.styles.draggableItem="oj-datagrid-draggable",this.styles.dragSourceOpaque="drag-source-opaque",this.styles.rowDropTargetLine="oj-datagrid-row-drop-target-line",this.styles.colDropTargetLine="oj-datagrid-col-drop-target-line",this.styles.dragging="oj-datagrid-drag-active",this.styles.dropTarget="oj-datagrid-drop-target",this.styles.disabledElement="oj-datagrid-disabled-element",this.styles.databodyFrozenCol="oj-datagrid-databody-frozen-column",this.styles.databodyFrozenRow="oj-datagrid-databody-frozen-row",this.styles.databodyFrozenCorner="oj-datagrid-databody-frozen-corner",this.styles.colHeaderFrozen="oj-datagrid-column-header-frozen",this.styles.rowHeaderFrozen="oj-datagrid-row-header-frozen",this.styles.colEndHeaderFrozen="oj-datagrid-column-end-header-frozen",this.styles.rowEndHeaderFrozen="oj-datagrid-row-end-header-frozen",this.styles.rowFrozenIndicator="oj-datagrid-row-frozen-indicator",this.styles.colFrozenIndicator="oj-datagrid-col-frozen-indicator",this.styles.frozenHeader="oj-datagrid-header-frozen",this.styles.frozenCell="oj-datagrid-cell-frozen",this.styles.skeletonContainer="oj-datagrid-skeleton-container",this.styles.skeletonCell="oj-datagrid-skeleton-cell",this.styles.skeleton="oj-datagrid-skeleton",this.styles.skeletonAnimation="oj-animation-skeleton",this.styles.databodyHiddenIndicator="oj-datagrid-databody-hidden-indicator",this.styles.headerHiddenIndicator="oj-datagrid-header-hidden-indicator",this.commands={},this.commands.sortCol="oj-datagrid-sortCol",this.commands.sortColAsc="oj-datagrid-sortColAsc",this.commands.sortColDsc="oj-datagrid-sortColDsc",this.commands.sortRow="oj-datagrid-sortRow",this.commands.sortRowAsc="oj-datagrid-sortRowAsc",this.commands.sortRowDsc="oj-datagrid-sortRowDsc",this.commands.resize="oj-datagrid-resize",this.commands.resizeWidth="oj-datagrid-resizeWidth",this.commands.resizeHeight="oj-datagrid-resizeHeight",this.commands.resizeFitToContent="oj-datagrid-resizeFitToContent",this.commands.cut="oj-datagrid-cut",this.commands.paste="oj-datagrid-paste",this.commands.cutCells="oj-datagrid-cutCells",this.commands.copyCells="oj-datagrid-copyCells",this.commands.pasteCells="oj-datagrid-pasteCells",this.commands.autoFill="oj-datagrid-fillCells",this.commands.discontiguousSelection="oj-datagrid-discontiguousSelection",this.commands.freezeCol="oj-datagrid-freezeCol",this.commands.freezeRow="oj-datagrid-freezeRow",this.commands.unfreezeCol="oj-datagrid-unfreezeCol",this.commands.unfreezeRow="oj-datagrid-unfreezeRow",this.commands.hideCol="oj-datagrid-hideCol",this.commands.unhideCol="oj-datagrid-unhideCol",this.attributes={},this.attributes.busyContext=c._OJ_CONTEXT_ATTRIBUTE,this.attributes.context="data-oj-cellContext",this.attributes.resizable="data-oj-resizable",this.attributes.sortable="data-oj-sortable",this.attributes.sortDir="data-oj-sortdir",this.attributes.expander="data-oj-expander",this.attributes.expanderIndex="data-oj-expander-index",this.attributes.container=m._OJ_CONTAINER_ATTR,this.attributes.extent="data-oj-extent",this.attributes.start="data-oj-start",this.attributes.depth="data-oj-depth",this.attributes.level="data-oj-level",this.attributes.metadata="data-oj-metaData",this.attributes.hiddenIndicatorIndex="data-oj-hiddenIndicatorIndex"};h._registerLegacyNamespaceProp("DataGridResources",w),w.prototype.setRTLMode=function(e){this.rtlMode=e},w.prototype.isRTLMode=function(){return"rtl"===this.rtlMode},w.prototype.getTranslatedText=function(e,t){return this.translationFunction(e,t)},w.prototype.getDefaultOption=function(e){return this.defaultOptions[e]},w.prototype.getMappedStyle=function(e){return null!=e?this.styles[e]:null},w.prototype.getMappedCommand=function(e){return null!=e?this.commands[e]:null},w.prototype.getMappedAttribute=function(e){return null!=e?this.attributes[e]:null};const H=function(e){this.dataprovider=e,this.pendingHeaderCallback={},e.options&&e.options.implicitSort&&(this.currentSortCriteria=e.options.implicitSort),this.sortUpdated=!1;var t=this.dataprovider.getCapability("fetchByOffset");this.fetchByOffset=null!=t&&"randomAccess"===t.implementation,this._registerEventListeners(),H.superclass.constructor.call(this)};function x(e,t,i,s){this.indexes=e,this.data=i,this.metadata=t,this.columns=s}function S(e,t,i){this.response=e,this.results=e.results,this.cellRanges=t,this.columns=i,this._setBounds(e,t,i)}function b(e,t,i,s){this.start=e,this.end=t,this.headers=i,this.sortCriteria=s}h.Object.createSubclass(H,h.DataGridDataSource,"DataProviderDataGridDataSource"),H.prototype._registerEventListeners=function(){this._mutationListener=this._handleDataProviderMutationEvent.bind(this),this._refreshListener=this._handleDataProviderRefreshEvent.bind(this),this.dataprovider.addEventListener("mutate",this._mutationListener),this.dataprovider.addEventListener("refresh",this._refreshListener)},H.prototype._handleDataProviderMutationEvent=function(e){var t,i=e.detail.add;if(null!=i){var s={indexes:[],keys:[]},n=[],o=[],l=[];for(t=0;t<i.data.length;t++)s.source=this,s.operation="insert",s.keys.push({row:i.metadata[t].key,column:null}),s.indexes.push({row:i.indexes[t],column:-1}),l.push(i.indexes[t]),n.push(i.data[t]),o.push(i.metadata[t]),t!==i.data.length-1&&i.indexes[t+1]===i.indexes[t]+1||(s.result=new x(l,o,n,this.columns),this.handleEvent("change",s),(s={}).indexes=[],s.keys=[],n=[],o=[],l=[])}var r=e.detail.remove;if(null!=r){var a={source:this,operation:"delete",keys:[],indexes:[]};for(t=0;t<r.data.length;t++)a.keys.push({row:r.metadata[t].key,column:null}),a.indexes.push({row:r.indexes[t],column:-1});this.handleEvent("change",a)}var h=e.detail.update;if(null!=h)for(t=0;t<h.data.length;t++){var d={source:this,operation:"update",keys:{row:h.metadata[t].key,column:null},indexes:{row:h.indexes[t],column:-1}};d.result=new x([h.indexes[t]],[h.metadata[t]],[h.data[t]],this.columns),this.handleEvent("change",d)}},x.prototype.getData=function(e){var t=this,i={};return Object.defineProperty(i,"data",{enumerable:!0,get:function(){return t.data[e.row-t.getStart("row")][t.columns[e.column]]},set:function(i){t.data[e.row-t.getStart("row")][t.columns[e.column]]=i}}),i},x.prototype.getMetadata=function(e){var t=this,i=t.metadata[e.row-t.getStart("row")];return i.keys={row:i.key,column:t.columns[e.column]},i},x.prototype.getStart=function(e){return"row"===e?this.indexes[0]:0},x.prototype.getCount=function(e){return"row"===e?this.data.length:"column"===e?this.columns.length:0},x.prototype.getExtent=function(){return{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}},H.prototype._handleDataProviderRefreshEvent=function(){this._asyncIterator=null,this.handleEvent("change",{operation:"refresh"})},H.prototype.fetchHeaders=function(e,t,i){if(null!=t){var s=e.axis,n={headerRange:e,callbacks:t,callbackObjects:i};this.pendingHeaderCallback[s]=n}},H.prototype._processPendingHeaderCallbacks=function(e){var t=this.pendingHeaderCallback[e];if(null!=t){var i=t.headerRange,s=t.callbacks,n=t.callbackObjects;this._handleHeaderFetchSuccess(i,s,n),this.pendingHeaderCallback[e]=null}},H.prototype._handleHeaderFetchSuccess=function(e,t,i){var s,n=e.axis,o=e.start,l=e.count;"column"===n&&null!=this.columns?s=new b(o,Math.min(this.columns.length,o+l),this.columns,this.currentSortCriteria):s=null;null!=t&&t.success&&t.success.call(i.success,s,e,null)},S.prototype._setBounds=function(e,t,i){for(var s=0;s<t.length;s+=1){var n=t[s];"row"===n.axis?(this.rowStart=e.fetchParameters.offset?e.fetchParameters.offset:n.start,this.rowEnd=this.rowStart+e.results.length-1):"column"===n.axis&&(this.colStart=n.start,this.colEnd=Math.min(this.colStart+n.count-1,this.colStart+i.length-1))}},S.prototype.getData=function(e){var t=this,i={};return Object.defineProperty(i,"data",{enumerable:!0,get:function(){return t.results[e.row-t.rowStart].data[t.columns[e.column]]},set:function(i){t.results[e.row-t.rowStart].data[t.columns[e.column]]=i}}),i},S.prototype.getMetadata=function(e){var t=this.results[e.row-this.rowStart].metadata;return t.keys={row:this.results[e.row-this.rowStart].metadata.key,column:this.columns[e.column]},t},S.prototype.getCount=function(e){return"row"===e?this.rowEnd-this.rowStart+1:"column"===e?this.colEnd-this.colStart+1:0},S.prototype.getExtent=function(){return{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}},H.prototype.setUpColumns=function(e){if(null==this.columns||0===this.columns.length){var t=[];if(e.results.length)for(var i=Object.keys(e.results[0].data),s=0;s<i.length;s++)t.push(i[s]);this.columns=t}},H.prototype.getRangeInfo=function(e){for(var t={},i=0;i<e.length;i+=1){var s=e[i];"row"===s.axis?(t.rowStart=s.start,t.rowEnd=t.rowStart+s.count-1):"column"===s.axis&&(t.colStart=s.start,t.colEnd=t.colStart+s.count-1)}return t},H.prototype._createResults=function(e){e.results=[];for(var t=0;t<e.value.data.length;t++){var i={data:e.value.data[t],metadata:e.value.metadata[t]};e.results.push(i)}},H.prototype.handleFetchResult=function(e,t,i,s){var n=s[0];n.results||(this._createResults(n),n.fetchParameters=n.value.fetchParameters),this.setUpColumns(n),this._processPendingHeaderCallbacks("column"),this._processPendingHeaderCallbacks("row");var o=new S(n,e,this.columns);if(null!=t&&null!=t.success){var l=i?i.success:null;t.success.call(l,o,e)}},H.prototype.fetchCells=function(e,t,i){var s=this;this.getCount("row");var n=s.getRangeInfo(e),o=n.rowEnd-n.rowStart+1;if(s.fetchByOffset){var l=n.rowStart;s._fetchPromise=s.dataprovider.fetchByOffset({size:o,offset:l,sortCriteria:s.currentSortCriteria})}else(null==s._asyncIterator||this.sortUpdated)&&(s._clientId=s._clientId||Symbol(),s._asyncIterator=s.dataprovider.fetchFirst({clientId:s._clientId,size:o,sortCriteria:s.currentSortCriteria})[Symbol.asyncIterator]()),s._fetchPromise=s._asyncIterator.next();this.sortUpdated=!1,Promise.all([s._fetchPromise,s._getCountPromise]).then(s.handleFetchResult.bind(s,e,t,i))},H.prototype.getCapability=function(e){if("sort"===e){var t=this.dataprovider.getCapability(e).attributes;return"multiple"===t||"single"===t?"column":t}return"none"},H.prototype.getCount=function(e){var t=this;if("row"===e){if(void 0!==t.totalRowCount)return t.totalRowCount;t._getCountPromise=this.dataprovider.getTotalSize(),t._getCountPromise.then(function(e){t.totalRowCount=e})}else if("column"===e&&null!=this.columns)return this.columns.length;return-1},H.prototype.getCountPrecision=function(){return"estimate"},H.prototype.indexes=function(){return{row:-1,column:-1}},H.prototype.keys=function(){return{row:null,column:null}},H.prototype.move=function(){return!1},H.prototype.moveOK=function(){return"invalid"},H.prototype.sort=function(e,t,i){this.sortUpdated=!0,this.currentSortCriteria=[{attribute:e.key,direction:e.direction}],null==i&&(i={}),null!=t&&null!=t.success&&t.success.call(i.success)},b.prototype.getData=function(e){return this.headers[e]},b.prototype.getMetadata=function(e){var t=this.getData(e),i={key:t};if(null!=this.sortCriteria)for(var s=0;s<this.sortCriteria.length;s++)this.sortCriteria[s].attribute===t&&(i.sortDirection=this.sortCriteria[s].direction);return i},b.prototype.getLevelCount=function(){return 1},b.prototype.getExtent=function(){return{extent:1,more:{before:!1,after:!1}}},b.prototype.getLabel=function(){return null},b.prototype.getDepth=function(){return 1},b.prototype.getCount=function(){return Math.max(0,this.end-this.start)};const R=function(e){this.grid=e};R.prototype.getAction=function(e,t){var i=e.keyCode,s=this.grid.m_utils.ctrlEquivalent(e),n=e.shiftKey,o=e.altKey,l=this.grid.keyCodes,r=t.cellOrHeader,a=t.readOnly,h=t.currentMode,d=t.activeMove,m=t.activeDrag,c=t.rowMove,u=t.columnSort;let _=t.rowSort;var p=t.selection,g=t.selectionMode,C=t.multipleSelection,f=t.expandCollapse,y=t.copyCells,E=t.cutCells,v=t.pasteCells,w=t.fill;switch(i){case l.TAB_KEY:if("actionable"===h)return n?"TAB_PREV_IN_CELL":"TAB_NEXT_IN_CELL";if(!a)return n?"FOCUS_LEFT":"FOCUS_RIGHT";break;case l.ENTER_KEY:if("actionable"===h)return"NO_OP";if("column"===r&&u||"row"===r&&_)return"SORT";if(!o&&a&&"navigation"===h||"cell"!==r)return"ACTIONABLE";if(!a&&!o)return n?"FOCUS_UP":"FOCUS_DOWN";if(o&&a&&"navigation"===h)return"EDITABLE";if(!a&&("navigation"===h||"edit"===h))return"EDIT";break;case l.ESC_KEY:if("actionable"===h)return"EXIT_ACTIONABLE";if(d)return"CANCEL_REORDER";if(m)return"CANCEL_DRAG";if(a){if(this.grid.m_discontiguousSelection)return"SELECT_DISCONTIGUOUS"}else{if("navigation"===h)return"EXIT_EDITABLE";if("edit"===h)return"CANCEL_EDIT"}break;case l.SPACE_KEY:if(-1!==r.indexOf("row")&&p&&("cell"===g&&C||"row"===g)&&"navigation"===h)return"SELECT_ROW";if(-1!==r.indexOf("column")&&p&&"cell"===g&&C&&"navigation"===h)return"SELECT_COLUMN";if("cell"===r)if(a&&"navigation"===h){if(s&&p&&"cell"===g&&C)return"SELECT_COLUMN";if(n&&p&&("cell"===g&&C||"row"===g))return"SELECT_ROW"}else if("navigation"===h)return"DATA_ENTRY";break;case l.PAGEUP_KEY:if("navigation"===h)return"FOCUS_ROW_FIRST";break;case l.PAGEDOWN_KEY:if("navigation"===h)return"FOCUS_ROW_LAST";break;case l.END_KEY:if("navigation"===h)return s&&"cell"===r?"FOCUS_LAST_CELL_IN_GRID":"FOCUS_COLUMN_LAST";break;case l.HOME_KEY:if("navigation"===h)return s&&"cell"===r?"FOCUS_FIRST_CELL_IN_GRID":"FOCUS_COLUMN_FIRST";break;case l.LEFT_KEY:if(s&&f&&this.grid._isHeaderExpanded(e.target))return"COLLAPSE";if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&"cell"===g&&C?"SELECT_EXTEND_LEFT":s?"FOCUS_LEFT_NON_EMPTY_CELL":"FOCUS_LEFT";break;case l.UP_KEY:if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&C?"SELECT_EXTEND_UP":s?"FOCUS_UP_NON_EMPTY_CELL":"FOCUS_UP";break;case l.RIGHT_KEY:if(s&&f&&this.grid._isHeaderCollapsed(e.target))return"EXPAND";if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&"cell"===g&&C?"SELECT_EXTEND_RIGHT":s?"FOCUS_RIGHT_NON_EMPTY_CELL":"FOCUS_RIGHT";break;case l.DOWN_KEY:if("actionable"===h)return"NO_OP";if("navigation"===h)return n&&p&&C?"SELECT_EXTEND_DOWN":s?"FOCUS_DOWN_NON_EMPTY_CELL":"FOCUS_DOWN";break;case l.F2_KEY:if("actionable"===h)return"EXIT_ACTIONABLE";if("cell"!==r)return"ACTIONABLE";if(a&&"navigation"===h)return"EDITABLE";if(!a&&"navigation"===h)return"EDIT";if(!a&&"edit"===h)return"CANCEL_EDIT";break;case l.F8_KEY:if(n&&p&&C)return"SELECT_DISCONTIGUOUS";break;case l.F10_KEY:if(n)return"NO_OP";break;case l.V_KEY:if("navigation"===h&&s){if(c)return"PASTE";if(v)return"PASTE_CELLS"}if(!a&&"navigation"===h&&"cell"===r)return"DATA_ENTRY";break;case l.X_KEY:if("navigation"===h&&s){if(c)return"CUT";if(E)return"CUT_CELLS"}if(!a&&"navigation"===h&&"cell"===r)return"DATA_ENTRY";break;case l.C_KEY:if("navigation"===h&&s&&y)return"COPY_CELLS";if(!a&&"navigation"===h&&"cell"===r)return"DATA_ENTRY";break;case l.D_KEY:case l.R_KEY:if("navigation"===h&&s&&w)return"FILL";if(!a&&"navigation"===h&&"cell"===r&&!s)return"DATA_ENTRY";break;case l.SHIFT_KEY:case l.CTRL_KEY:case l.ALT_KEY:break;case l.A_KEY:if(s&&p&&C&&"navigation"===h)return"SELECT_ALL";case l.NUM5_KEY:if(s&&o&&"navigation"===h)return"READ_CELL";default:if((i<l.F1_KEY||i>l.F15_KEY)&&!a&&"navigation"===h&&"cell"===r&&!s)return"DATA_ENTRY"}return"NO_OP"},R.prototype.getNoDataAction=function(e,t){var i=e.keyCode,s=e.shiftKey,n=this.grid.keyCodes,o=t.currentMode;switch(i){case n.TAB_KEY:if("actionable"===o)return s?"TAB_PREV_IN_CELL":"TAB_NEXT_IN_CELL";break;case n.ESC_KEY:if("actionable"===o)return"EXIT_ACTIONABLE";break;case n.F2_KEY:return"actionable"===o?"EXIT_ACTIONABLE":"ACTIONABLE";case n.UP_KEY:if("navigation"===o)return"FOCUS_COLUMN_HEADER";break;case n.DOWN_KEY:if("navigation"===o)return"FOCUS_COLUMN_END_HEADER";break;case n.LEFT_KEY:if("navigation"===o)return"FOCUS_ROW_HEADER";break;case n.RIGHT_KEY:if("navigation"===o)return"FOCUS_ROW_END_HEADER"}return"NO_OP"};const I=function(e,t){this.options=e,this.rendererWrapperFunction=t};I.prototype.extract=function(e,t,i,s){if(null!=e){var n=this.options[e];if(null!=t&&null!=n){var o=n[t];if(null!=i&&null!=o){var l=o[i];return null!=s&&null!=l?l[s]:l}return o}return n}return null},I.prototype.evaluate=function(e,t){return"function"==typeof e?e.call(this,t):e},I.prototype.getRawProperty=function(e,t,i){var s,n,o,l;return"row"===t||"column"===t||"rowEnd"===t||"columnEnd"===t?(s="header",n=t,i?(o="label",l=e):o=e):"cell"===t&&(s="cell",n=e),this.extract(s,n,o,l)},I.prototype.getProperty=function(e,t,i,s){return void 0===i?this.extract(e,t,s):this.evaluate(this.getRawProperty(e,t,s),i)},I.prototype.getRowBandingInterval=function(){var e=this.getProperty("bandingInterval","row");return null!=e?e:0},I.prototype.getColumnBandingInterval=function(){var e=this.getProperty("bandingInterval","column");return null!=e?e:0},I.prototype.getEmptyText=function(){return this.getProperty("emptyText")},I.prototype.getHorizontalGridlines=function(){var e=this.extract("gridlines","horizontal");return null!=e?e:"visible"},I.prototype.getVerticalGridlines=function(){var e=this.extract("gridlines","vertical");return null!=e?e:"visible"},I.prototype.getScrollToKey=function(){var e=this.getProperty("scrollToKey");return null!=e?e:"auto"},I.prototype.getScrollPosition=function(){var e=this.getProperty("scrollPosition");return null!=e?e:null},I.prototype.getSelectionCardinality=function(){var e=this.getProperty("selectionMode");if(null==e)return"none";var t=e[this.getSelectionMode()];return null!=t?t:"none"},I.prototype.getSelectionMode=function(){var e=this.getProperty("selectionMode");if(null==e)return"cell";var t=e.row;return null!=t&&"none"!==t?"row":"cell"},I.prototype.getSelection=function(){return this.getProperty("selection")},I.prototype.getCurrentCell=function(){return this.getProperty("currentCell")},I.prototype.getEditMode=function(){return this.getProperty("editMode")},I.prototype.isSortable=function(e,t){return this.getProperty("sortable",e,t)},I.prototype.isResizable=function(e,t,i){var s=this.extract("header",e,"resizable",t);return null!=i?this.evaluate(s,i):s},I.prototype.isMoveable=function(e){return this.extract("dnd","reorder",e)},I.prototype._isDragEnabled=function(e){let t=!1,i="row"===e||"rowEnd"===e?"rows":"columns",s=this.getProperty("dnd").drag;return s&&s[i]&&(t=!0),t},I.prototype._getDraggable=function(){return this.getProperty("dnd").drag},I.prototype.isFloodFillEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","fill")&&(e=!0),e},I.prototype.isCopyEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","copy")&&(e=!0),e},I.prototype.isCutEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","cut")&&(e=!0),e},I.prototype.isPasteEnabled=function(){let e=!1;return"enable"===this.extract("dataTransferOptions","paste")&&(e=!0),e},I.prototype.isFreezeEnabled=function(e){let t=!1;return"scroll"!==this.getProperty("scrollPolicy")&&("enable"===this.extract("header",e,"freezable")&&(t=!0),t)},I.prototype._getFreezeIndex=function(e){let t=null;return"scroll"===this.getProperty("scrollPolicy")||(t="row"===e?this.getProperty("frozenRowCount"):this.getProperty("frozenColumnCount"),null!==t&&(t=parseInt(t,10)-1)),t},I.prototype.isHideEnabled=function(e){let t=!1;return"enable"===this.extract("header",e,"hidable")&&(t=!0),t},I.prototype._getHiddenColumnIndices=function(e){let t;return"column"===e&&(t=this.getProperty("hiddenColumns")),t},I.prototype.getInlineStyle=function(e,t,i){return this.getProperty("style",e,t,i)},I.prototype.getStyleClass=function(e,t,i){return this.getProperty("className",e,t,i)},I.prototype.getRenderer=function(e,t){return this.rendererWrapperFunction?this.rendererWrapperFunction(this.getRawProperty("renderer",e,t)):this.getRawProperty("renderer",e,t)},I.prototype.getScrollPolicy=function(){var e=this.getProperty("scrollPolicy");return null==e&&(e="auto"),e},I.prototype.getScrollPolicyOptions=function(){return this.getProperty("scrollPolicyOptions")};const M=function(){this.sizes={column:new Map,row:new Map}};M.prototype.setSize=function(e,t,i){this.sizes[e].set(t,i)},M.prototype.getSize=function(e,t){var i=this.sizes[e].get(t);return null!=i||this.sizes[e].forEach(function(e,s){null==i&&h.Object.compareValues(s,t)&&(i=e)}),i},M.prototype.clear=function(){this.sizes.column.clear(),this.sizes.row.clear()};const F=function(e){this.scrollbarSize=-1,this.dataGrid=e};F.prototype._getMaxDivHeightForScrolling=function(){return null==this.m_maxDivHeightForScrolling&&this._setMaxValuesForScrolling(),this.m_maxDivHeightForScrolling},F.prototype._getMaxDivWidthForScrolling=function(){return null==this.m_maxDivWidthForScrolling&&this._setMaxValuesForScrolling(),this.m_maxDivWidthForScrolling},F.prototype._setMaxValuesForScrolling=function(){this._calculateBrowserDefinedValues()},F.prototype._calculateBrowserDefinedValues=function(){var e=document.createElement("div");e.style.width="1000000000px",e.style.height="1000000000px",e.style.display="none";var t=document.createElement("div");t.style.width="100px",t.style.height="100px",t.style.overflow="scroll",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);let i=!1;u.isIE()||u.isEdge()?(this.m_maxDivHeightForScrolling=1e6,this.m_maxDivWidthForScrolling=1e6):(i=!0,document.body.appendChild(e),this.m_maxDivHeightForScrolling=parseInt(parseFloat(window.getComputedStyle(e).height)/2,10),this.m_maxDivWidthForScrolling=parseInt(parseFloat(window.getComputedStyle(e).width)/2,10)),this.scrollbarSize=t.offsetWidth-t.clientWidth,i&&document.body.removeChild(e),document.body.removeChild(t)},F.prototype.getScrollbarSize=function(){return-1===this.scrollbarSize&&this._calculateBrowserDefinedValues(),this.scrollbarSize},F.prototype.getScrollbarSize=function(){return-1===this.scrollbarSize&&this.calculateScrollbarSize(),this.scrollbarSize},F.prototype.isTouchDevice=function(){return null==this.isTouch&&(this.isTouch=u.isMobileTouchDevice()),this.isTouch},F.prototype.isTouchDeviceNotIOS=function(){if(null==this.isTouchNotIOS){let e=this.isTouchDevice();this.isTouchNotIOS=!!e&&!u.isIos()}return this.isTouchNotIOS},F.prototype.addCSSClassName=function(e,t){null!=t&&""!==t&&null!=e&&null!=e.classList&&e.classList.add(t)},F.prototype.removeCSSClassName=function(e,t){null!=t&&""!==t&&null!=e&&null!=e.classList&&e.classList.remove(t)},F.prototype.containsCSSClassName=function(e,t){var i=!1;return null!=t&&null!=e&&null!=e.classList&&(i=e.classList.contains(t)),i},F._getCSSClassNameIndex=function(e,t){if(!e||!e.indexOf)return-1;if(t===e)return 0;var i=t.length,s=e.length,n=e.indexOf(t);if(n>=0){var o=0===n||" "===e.charAt(n-1),l=n+i,r=l===s||" "===e.charAt(l);if(o&&r)return n;var a=e.lastIndexOf(t);if(a!==n)return o=e.charAt(a-1),r=(l=a+i)===s||" "===e.charAt(l),o&&r?a:e.indexOf(" "+t+" ")}return-1},F.prototype.ctrlEquivalent=function(e){return u.isMac()?e.metaKey:e.ctrlKey},F.prototype.getElementScrollLeft=function(e){return Math.abs(e.scrollLeft)},F.prototype.setElementScrollLeft=function(e,t){_.setScrollLeft(e,t)},F.prototype.getMousewheelEvent=function(){return"wheel"},F.prototype.getMousewheelScrollDelta=function(e){var t=-1,i=e.deltaMode;return i===e.DOM_DELTA_PIXEL?t=-1:i!==e.DOM_DELTA_LINE&&i!==e.DOM_DELTA_PAGE||(t=-40),{deltaX:e.deltaX*t,deltaY:e.deltaY*t}},F.prototype.empty=function(e){for(;e.firstChild;)this.dataGrid._remove(e.firstChild)},F.prototype.supportsTransitions=function(){var e=(document.body||document.documentElement).style,t="transition";if(!!u.isIE()&&u.getBrowserVersion()<11)return!1;if("string"==typeof e[t])return!0;var i=["Moz","webkit","Webkit","Khtml","O","ms"];t=t.charAt(0).toUpperCase()+t.substr(1);for(var s=0;s<i.length;s++)if("string"==typeof e[i[s]+t])return!0;return!1},F.prototype._isNodeEditableOrClickable=function(e,t){for(;null!=e&&e!==t;){var i=e.nodeName;if(3===e.nodeType)e=e.parentNode;else{var s=parseInt(e.getAttribute("tabIndex"),10),n=parseInt(e.getAttribute(this.dataGrid.getResources().getMappedAttribute("tabindex")),10);if(null!=s&&s>=0)return!(this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("cell"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("headerlabel"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("headercell"))||this.containsCSSClassName(e,this.dataGrid.getResources().getMappedStyle("endheadercell")));if(i.match(/^INPUT|SELECT|OPTION|BUTTON|^A\b|TEXTAREA/)&&(-1!==s||-1!==n))return!0;e=e.parentNode}}return!1},F.prototype.shouldOffsetOutline=function(){return!(!u.isMac()||!u.isWebkit())};const z=function(e){this.m_root=e,this.MAX_COLUMN_THRESHOLD=20,this.MAX_ROW_THRESHOLD=30,this.m_utils=new F(this),this.m_discontiguousSelection=!1,this.m_sizingManager=new M,this.m_keyboardHandler=new R(this),this.m_rowHeaderWidth=null,this.m_rowEndHeaderWidth=null,this.m_colHeaderHeight=null,this.m_colEndHeaderHeight=null,this.m_styleClassDimensionMap={width:{},height:{}},this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.m_fetchingForUpdate=!1,this.m_initialized=!1,this.m_shouldFocus=null,this.m_renderCount=0,this.callbacks={},this._setupActions(),this.m_readinessStack=[],this.m_modelEvents=[],this.m_databodyMap=new Map};z.prototype.keyCodes={TAB_KEY:9,ENTER_KEY:13,SHIFT_KEY:16,CTRL_KEY:17,ALT_KEY:18,ESC_KEY:27,SPACE_KEY:32,PAGEUP_KEY:33,PAGEDOWN_KEY:34,END_KEY:35,HOME_KEY:36,LEFT_KEY:37,UP_KEY:38,RIGHT_KEY:39,DOWN_KEY:40,NUM5_KEY:53,V_KEY:86,X_KEY:88,C_KEY:67,D_KEY:68,R_KEY:82,F1_KEY:112,F2_KEY:113,F8_KEY:119,F10_KEY:121,F15_KEY:126,A_KEY:65},z.UPDATE_ANIMATION_FADE_INOUT=1,z.UPDATE_ANIMATION_SLIDE_INOUT=2,z.UPDATE_ANIMATION_DURATION=250,z.EXPAND_ANIMATION_DURATION=500,z.COLLAPSE_ANIMATION_DURATION=400,z.MAX_OVERSCROLL_PIXEL=50,z.BOUNCE_ANIMATION_DURATION=500,z.DECELERATION_FACTOR=6e-4,z.TAP_AND_SCROLL_RESET=300,z.MIN_SWIPE_DURATION=200,z.MAX_SWIPE_DURATION=400,z.MIN_SWIPE_DISTANCE=10,z.MIN_SWIPE_TRANSITION_DURATION=100,z.MAX_SWIPE_TRANSITION_DURATION=500,z.CONTEXT_MENU_TAP_HOLD_DURATION=750,z.HEADER_TAP_SHORT_HOLD_DURATION=300,z.FETCH_PIXEL_THRESHOLD=5,z.VISIBILITY_STATE_HIDDEN="hidden",z.VISIBILITY_STATE_REFRESH="refresh",z.VISIBILITY_STATE_RENDER="render",z.VISIBILITY_STATE_VISIBLE="visible",z.SPACER_DEFAULT_WIDTH=2,z.SKELETON_DEFAULT_COUNT=3,z.prototype.SetOptions=function(e,t){this.m_options=new I(e,t)},z.prototype.SetSortOriginalEvent=function(e){this.m_sortInfo&&(this.m_sortInfo.originalEvent=e)},z.prototype.UpdateOptions=function(e,t){var i,s,n=Object.keys(e);for(s=0;s<n.length;s++)(i=n[s])in this.m_options.options&&this.m_options.options[i]!==e[i]&&(this.m_options.options[i]=e[i]);for(s=0;s<n.length;s++)if(i=n[s],!this._updateDataGrid(i,t)){this.empty(),this.refresh(this.m_root);break}},z.prototype._updateDataGrid=function(e,t){var i;switch(e){case"bandingInterval":this._removeBanding(),this.updateColumnBanding(),this.updateRowBanding();break;case"currentCell":i=this.m_options.getCurrentCell(),this._updateActive(i,!0,!1);break;case"editMode":this.m_editMode=this.m_options.getEditMode();break;case"gridlines":this._updateGridlines();break;case"header":i=this.m_options.options.header,this._updateHeaderOptions(i,t);break;case"scrollPosition":i=this.m_options.getScrollPosition(),this._updateScrollPosition(i);break;case"selection":i=this.m_options.getSelection(),this._updateSelection(i);break;case"selectionMode":this._clearSelection(null);break;case"frozenColumnCount":i=this.m_options._getFreezeIndex("column"),this._updateFrozenSection(i,"column");break;case"frozenRowCount":i=this.m_options._getFreezeIndex("row"),this._updateFrozenSection(i,"row");break;case"hiddenColumns":i=this.m_options._getHiddenColumnIndices("column"),this._updateHiddenSection(Array.from(i));break;default:return!1}return!0},z.prototype._updateSelection=function(e){null!=e&&this._isSelectionEnabled()&&this.SetSelection(e)},z.prototype._updateHeaderOptions=function(e,t){if(null!=t&&null!=t.subkey){var i,s=t.subkey.split("."),n=s[0],o=s[1];if("column"===n&&null!=this.m_colHeader&&null!=this.m_colHeader.firstChild?i=this.m_colHeader.firstChild.childNodes:"row"===n&&null!=this.m_rowHeader&&null!=this.m_rowHeader.firstChild?i=this.m_rowHeader.firstChild.childNodes:"columnEnd"===n&&null!=this.m_colEndHeader&&null!=this.m_colEndHeader.firstChild?i=this.m_colEndHeader.firstChild.childNodes:"rowEnd"===n&&null!=this.m_rowEndHeader&&null!=this.m_rowEndHeader.firstChild&&(i=this.m_rowEndHeader.firstChild.childNodes),null!=i)for(var l=0;l<i.length;l++){var r=i[l],a=r[this.getResources().getMappedAttribute("context")];if(a.index=this.getHeaderCellIndex(r),"resizable"===o)this._isHeaderResizeEnabled(n,a)?this._setAttribute(r,o,"true"):this._setAttribute(r,o,"false");else if("sortable"===o){var h=this.m_utils.containsCSSClassName(r.lastChild,this.getMappedStyle("sortIcon"));if(this._isSortEnabled(n,a)){if(!h){var d=this._buildSortIcon(a,r);r.appendChild(d)}this._setAttribute(r,o,"true")}else h&&this._remove(r.lastChild),this._setAttribute(r,o,"false")}}}},z.prototype._updateGridlines=function(){var e=this.m_options.getHorizontalGridlines(),t=this.m_options.getVerticalGridlines(),i=this.getResources().isRTLMode()?"right":"left";if(this.m_databody&&this.m_databody.firstChild){let s=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),n=this._getLastAxis("row"),o=this._getLastAxis("column");for(let l=0;l<s.length;l++){let r=s[l],a=this.getCellIndexes(r);"hidden"===t||a.column===o&&(this.getRowHeaderWidth()+this.getElementDir(r,i)+this.calculateColumnWidth(r)>=this.getWidth()||this.m_endRowEndHeader>-1)?this.m_utils.addCSSClassName(r,this.getMappedStyle("borderVerticalNone")):this.m_utils.removeCSSClassName(r,this.getMappedStyle("borderVerticalNone")),"hidden"===e||a.row===n&&(this.getRowBottom(r,null)>=this.getHeight()||this.m_endColEndHeader>-1)?this.m_utils.addCSSClassName(r,this.getMappedStyle("borderHorizontalNone")):this.m_utils.removeCSSClassName(r,this.getMappedStyle("borderHorizontalNone"))}}},z.prototype._updateEdgeCellBorders=function(e){if(null!=this.m_active&&"cell"===this.m_active.type){var t=this._getActiveElement();null!=t&&((this._isCellEditable()&&""===e||""!==e)&&this._applyBorderClassesAroundRange(t,{startIndex:this.m_active.indexes},""===e,"Edit"),this._isLastRow(this.m_active.indexes.row)&&("none"===e?this.m_utils.addCSSClassName(t,this.getMappedStyle("borderHorizontalNone")):this.m_utils.removeCSSClassName(t,this.getMappedStyle("borderHorizontalNone"))),this._isLastColumn(this.m_active.indexes.column)&&("none"===e?this.m_utils.addCSSClassName(t,this.getMappedStyle("borderVerticalNone")):this.m_utils.removeCSSClassName(t,this.getMappedStyle("borderVerticalNone"))))}},z.prototype.SetResources=function(e){this.m_resources=e},z.prototype.getResources=function(){return this.m_resources},z.prototype.getStartRowHeader=function(){return this.m_startRowHeader},z.prototype.getStartColumnHeader=function(){return this.m_startColHeader},z.prototype.getStartRowEndHeader=function(){return this.m_startRowEndHeader},z.prototype.getStartColumnEndHeader=function(){return this.m_startColEndHeader},z.prototype.getMappedStyle=function(e){return this.getResources().getMappedStyle(e)},z.prototype.SetDataSource=function(e){this.m_modelEvents=[],this.m_dataSource=e},z.prototype.getDataSource=function(){return this.m_dataSource},z.prototype.setVisibility=function(e){this.m_visibility=e},z.prototype.getVisibility=function(){return null==this.m_visibility&&(null!=this.m_root.offsetParent?this.setVisibility(z.VISIBILITY_STATE_VISIBLE):this.setVisibility(z.VISIBILITY_STATE_HIDDEN)),this.m_visibility},z.prototype.SetOptionCallback=function(e){this.m_setOptionCallback=e},z.prototype.SetContextCallback=function(e){this.m_contextCallback=e},z.prototype.SetCustomElementCallback=function(e){this.m_isCustomElementCallback=e},z.prototype.SetRemoveCallback=function(e){this.m_removeCallback=e},z.prototype.SetUniqueIdCallback=function(e){this._uniqueIdCallback=e},z.prototype.SetCompareValuesCallback=function(e){this._compareValuesCallback=e},z.prototype.SetSubtreeAttachedCallback=function(e){this.m_subtreeAttachedCallback=e},z.prototype.SetUpdateScrollPostionOnRefreshCallback=function(e){this.m_updateScrollPostionOnRefreshCallback=e},z.prototype._remove=function(e){null!=e&&(this._uniqueIdCallback(e,!0),this.m_removeCallback.call(null,e))},z.prototype._removeFromArray=function(e){for(var t=0;t<e.length;t++)this._remove(e[t])},z.prototype.SetNotReadyCallback=function(e){this.m_notReady=e},z.prototype.SetMakeReadyCallback=function(e){this.m_makeReady=e},z.prototype._signalTaskStart=function(){this.m_readinessStack&&(0===this.m_readinessStack.length&&this.m_notReady(),this.m_readinessStack.push(1))},z.prototype._signalTaskEnd=function(){this.m_readinessStack&&this.m_readinessStack.length>0&&(this.m_readinessStack.pop(),0===this.m_readinessStack.length&&this.m_makeReady())},z.prototype._indexes=function(e,t){var i=this,s=this.getDataSource().indexes(e);"function"==typeof s.then?(i._signalTaskStart(),s.then(function(s){t.call(i,s,e),i._signalTaskEnd()},function(){t.call(i,{row:-1,column:-1},e),i._signalTaskEnd()})):t.call(i,s,e)},z.prototype._keys=function(e,t){var i=this,s=this._getLocalKeys(e);if(void 0===s){var n=this.getDataSource().keys(e);"function"==typeof n.then?(i._signalTaskStart(),n.then(function(s){t.call(i,s,e),i._signalTaskEnd()},function(){t.call(i,{row:null,column:null},e),i._signalTaskEnd()})):t.call(i,n,e)}else t.call(i,s,e)},z.prototype._getLocalKeys=function(e){var t=this._getCellByIndex(e);if(t)return this.getCellKeys(t);var i,s,n=e.row,o=e.column;if(void 0!==n){if(-1===n)i=null;else{var l=this._getCellOrHeaderByIndex(n,"row");l&&(i=this._getKey(l,"row"))}if(void 0===i)return}if(void 0!==o){if(-1===o)s=null;else{var r=this._getCellOrHeaderByIndex(o,"column");r&&(s=this._getKey(r,"column"))}if(void 0===s)return}return this.createIndex(i,s)},z.prototype.SetCreateContextCallback=function(e){this.m_createContextCallback=e},z.prototype.SetFocusableCallback=function(e,t){this.m_focusInHandler=e,this.m_focusOutHandler=t},z.prototype.SetFixContextCallback=function(e){this.m_fixContextCallback=e},z.prototype.SetCustomElement=function(e){this.m_customElement=e},z.prototype._isHighWatermarkScrolling=function(){return"scroll"!==this.m_options.getScrollPolicy()},z.prototype.destroy=function(){delete this.m_fetching,this._removeDataSourceEventListeners(),this._removeDomEventListeners(),delete this.m_styleClassDimensionMap,this.m_styleClassDimensionMap={width:{},height:{}}},z.prototype._addDataSourceEventListeners=function(){this._removeDataSourceEventListeners(),null!=this.m_dataSource&&(this.m_handleModelEventListener=this.handleModelEvent.bind(this),this.m_handleExpandEventListener=this.handleExpandEvent.bind(this),this.m_handleCollapseEventListener=this.handleCollapseEvent.bind(this),this.m_dataSource.on("change",this.m_handleModelEventListener,this),this.m_dataSource.on("expand",this.m_handleExpandEventListener,this),this.m_dataSource.on("collapse",this.m_handleCollapseEventListener,this))},z.prototype._removeDataSourceEventListeners=function(){null!=this.m_dataSource&&(this.m_dataSource.off("change",this.m_handleModelEventListener),this.m_dataSource.off("expand",this.m_handleExpandEventListener),this.m_dataSource.off("collapse",this.m_handleCollapseEventListener))},z.prototype._addDomEventListeners=function(){this.m_handleDatabodyKeyDown||(this.m_handleDatabodyKeyDown=this.handleDatabodyKeyDown.bind(this)),this.m_handleDatabodyKeyUp||(this.m_handleDatabodyKeyUp=this.handleDatabodyKeyUp.bind(this)),this.m_handleRootFocus||(this.m_handleRootFocus=this.handleRootFocus.bind(this)),this.m_handleRootBlur||(this.m_handleRootBlur=this.handleRootBlur.bind(this)),this.m_root.addEventListener("keydown",this.m_handleDatabodyKeyDown,!1),this.m_root.addEventListener("keyup",this.m_handleDatabodyKeyUp,!1),this.m_root.addEventListener("focus",this.m_handleRootFocus,!0),this.m_root.addEventListener("blur",this.m_handleRootBlur,!0)},z.prototype._removeDomEventListeners=function(){document.removeEventListener("mousemove",this.m_docMouseMoveListener,!1),document.removeEventListener("mouseup",this.m_docMouseUpListener,!1),null!=this.m_root&&(this.m_handleDatabodyKeyDown&&this.m_root.removeEventListener("keydown",this.m_handleDatabodyKeyDown,!1),this.m_handleDatabodyKeyUp&&this.m_root.removeEventListener("keyup",this.m_handleDatabodyKeyUp,!1),this.m_handleRootFocus&&this.m_root.removeEventListener("focus",this.m_handleRootFocus,!0),this.m_handleRootBlur&&this.m_root.removeEventListener("blur",this.m_handleRootBlur,!0))},z.prototype.getRootElement=function(){return this.m_root},z.prototype.getWidth=function(){return null==this.m_width&&(this.m_width=this.getRootElement().clientWidth),this.m_width},z.prototype.getHeight=function(){return null==this.m_height&&(this.m_height=this.getRootElement().clientHeight),this.m_height},z.prototype.getScrollableWidth=function(){var e=this.m_databody.firstChild;return this.getElementWidth(e)},z.prototype.getViewportWidth=function(){var e=this.getWidth();return Math.round(1.5*e)},z.prototype.getViewportHeight=function(){var e=this.getHeight();return Math.round(1.5*e)},z.prototype._getViewportTop=function(){return this.m_currentScrollTop},z.prototype._getViewportBottom=function(){var e=this._getViewportTop(),t=this.getElementHeight(this.m_databody),i=this.m_utils.getScrollbarSize();return this.m_hasHorizontalScroller?e+t-i:e+t},z.prototype._getViewportLeft=function(){return this.m_currentScrollLeft},z.prototype._getViewportRight=function(){var e=this._getViewportLeft(),t=this.getElementWidth(this.m_databody),i=this.m_utils.getScrollbarSize();return this.m_hasVerticalScroller?e+t-i:e+t},z.prototype.getFetchSize=function(e){return"row"===e?(null==this.m_rowFetchSize&&(this.m_rowFetchSize=Math.max(1,Math.round(this.getViewportHeight()/this.getDefaultRowHeight()))),this.m_rowFetchSize):"column"===e?(null==this.m_columnFetchSize&&(this.m_columnFetchSize=Math.max(1,Math.round(this.getViewportWidth()/this.getDefaultColumnWidth()))),this.m_columnFetchSize):0},z.prototype.getEmptyText=function(){var e=this.m_options.getEmptyText();null==e&&(e=this.getResources().getTranslatedText("msgNoData"));return e},z.prototype._buildEmptyText=function(){let e;if(null==this.getDataSource()){let t=this.getWidth(),i=this.getHeight();e=this.buildDatabody(!0)[0],this.setElementWidth(e,t),this.setElementHeight(e,i),this.m_root.insertBefore(e,this.m_status)}const t=this._getTemplateEngine(),i=this._getItemTemplateBySlotName("noData");if(e=this.m_databody,i&&null!=t){let s=document.createElement("div");return s.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),s.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),s.id=this.createSubId("noData"),this.m_utils.addCSSClassName(s,this.getMappedStyle("noDataContainer")),t.execute(this.getRootElement(),i,{},null,e).forEach(function(e){s.appendChild(e)}),this._removeFocusFromChildElements({},s),s}var s=this.getEmptyText(),n=document.createElement("div");return n.id=this.createSubId("empty"),n.className=this.getMappedStyle("emptytext"),n.textContent=s,this.m_empty=n,n},z.prototype.getRowThreshold=function(){return 0},z.prototype.getColumnThreshold=function(){return 0},z.prototype.setDefaultDimensions=function(){var e=document.createElement("div");e.style.visibilty="hidden";var t=this.getResources();e.className=t.getMappedStyle("rowheadercell")+" "+t.getMappedStyle("colheadercell")+" "+t.getMappedStyle("headercell"),this.m_root.appendChild(e);var i=e.getBoundingClientRect();this.m_defaultColumnWidth=Math.round(i.width),this.m_defaultRowHeight=Math.round(i.height),this.getViewportWidth(),this.getViewportHeight(),this.m_root.removeChild(e)},z.prototype.getDefaultRowHeight=function(){return null==this.m_defaultRowHeight&&this.setDefaultDimensions(),this.m_defaultRowHeight},z.prototype.getDefaultColumnWidth=function(){return null==this.m_defaultColumnWidth&&this.setDefaultDimensions(),this.m_defaultColumnWidth},z.prototype._getHeaderDimension=function(e,t,i,s){var n=this.m_sizingManager.getSize(i,t);if(null!=n)return n;if(""!==e.style[s])return n=this.getElementDir(e,s),this.m_sizingManager.setSize(i,t,n),n;var o=e.className;return null==(n=this.m_styleClassDimensionMap[s][o])&&(n=this.getElementDir(e,s)),this.m_sizingManager.setSize(i,t,n),this.m_styleClassDimensionMap[s][o]=n,n},z.prototype.createSubId=function(e){return[this.getRootElement().id,e].join(":")},z.prototype.isHeaderFetchComplete=function(){return!1===this.m_fetching.row&&!1===this.m_fetching.column},z.prototype.isFetchComplete=function(){return null!=this.m_fetching&&this.isHeaderFetchComplete()&&!1===this.m_fetching.cells},z.prototype._isLastRow=function(e){return this._isCountUnknown("row")?e===this.m_endRow&&this.m_stopRowFetch:e+1===this.getDataSource().getCount("row")},z.prototype._isLastColumn=function(e){return this._isCountUnknown("column")?e===this.m_endCol&&this.m_stopColumnFetch:e+1===this.getDataSource().getCount("column")},z.prototype._getLastAxis=function(e){return this._isCountUnknown(e)?("row"===e?this.m_stopRowFetch:this.m_stopColumnFetch)?"row"===e?this.m_endRow:this.m_endCol:"row"===e?this.m_endRow+1:this.m_endCol+1:this.getDataSource().getCount(e)-1},z.prototype.empty=function(){this.m_empty&&this._remove(this.m_empty),this.m_corner&&this._remove(this.m_corner),this.m_bottomCorner&&this._remove(this.m_bottomCorner),this.m_columnHeaderScrollbarSpacer&&this._remove(this.m_columnHeaderScrollbarSpacer),this.m_rowHeaderScrollbarSpacer&&this._remove(this.m_rowHeaderScrollbarSpacer),this.m_root.removeChild(this.m_placeHolder),this.m_root.removeChild(this.m_status),this.m_root.removeChild(this.m_accSummary),this.m_root.removeChild(this.m_accInfo),this.m_root.removeChild(this.m_stateInfo),this.m_root.removeChild(this.m_contextInfo),this._remove(this.m_colHeader),this._remove(this.m_rowHeader),this._remove(this.m_colEndHeader),this._remove(this.m_rowEndHeader),this._remove(this.m_databody),this._remove(this.m_databodyFrozenCol),this._remove(this.m_databodyFrozenRow),this._remove(this.m_databodyFrozenCorner),this._remove(this.m_colHeaderFrozen),this._remove(this.m_colEndHeaderFrozen),this._remove(this.m_rowHeaderFrozen),this._remove(this.m_rowEndHeaderFrozen),this._clearDatabodyMap()},z.prototype.refresh=function(e){this.resetInternal(),this.render(e)},z.prototype.resetInternal=function(){this.m_initialized=!1,this.m_readinessStack=[],this._signalTaskStart(),this._signalTaskEnd(),this._clearDatabodyMap(),this.m_cursor=null,this.m_corner=null,this.m_bottomCorner=null,this.m_columnHeaderScrollbarSpacer=null,this.m_rowHeaderScrollbarSpacer=null,this.m_colHeader=null,this.m_colEndHeader=null,this.m_rowHeader=null,this.m_rowEndHeader=null,this.m_databody=null,this.m_empty=null,this.m_accInfo=null,this.m_accSummary=null,this.m_contextInfo=null,this.m_placeHolder=null,this.m_stateInfo=null,this.m_status=null,this.m_headerLabels={row:[],column:[],rowEnd:[],columnEnd:[]},this.m_rowHeaderFrozen=null,this.m_rowEndHeaderFrozen=null,this.m_colHeaderFrozen=null,this.m_colEndHeaderFrozen=null,this.m_databodyFrozenCorner=null,this.m_databodyFrozenRow=null,this.m_databodyFrozenCol=null,this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.m_rowFetchSize=null,this.m_columnFetchSize=null,this.m_fetching=null,this.m_processingModelEvent=!1,this.m_processingEventQueue=!1,this.m_animating=!1,this.m_fetchingForUpdate=!1,this.m_sizingManager.clear(),this.m_styleClassDimensionMap={width:{},height:{}},this.m_height=null,this.m_width=null,this.m_scrollHeight=null,this.m_scrollWidth=null,this.m_avgRowHeight=void 0,this.m_avgColWidth=void 0,this.m_defaultColumnWidth=null,this.m_defaultRowHeight=null,this.m_colHeaderHeight=null,this.m_colEndHeaderHeight=null,this.m_rowHeaderWidth=null,this.m_rowEndHeaderWidth=null,this.m_rowHeaderLevelWidths=[],this.m_rowEndHeaderLevelWidths=[],this.m_columnHeaderLevelHeights=[],this.m_columnEndHeaderLevelHeights=[],this.m_collisionResize=!1,this.m_active=null,this.m_prevActive=null,this.m_trueIndex={},this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_databodyMove=!1,this.m_moveRow=null,this.m_moveRowHeader=null,this.m_dropTarget=null,this.m_dropTargetHeader=null,this.m_floodFillDragState=!1,this.m_dataTransferAction=null,this.m_discontiguousSelection=!1,this.m_selectionFrontier=null,this.m_docMouseMoveListener=null,this.m_docMouseUpListener=null,this.m_modelEvents=[],this.m_hasHorizontalScroller=null,this.m_hasVerticalScroller=null,this.m_currentScrollLeft=null,this.m_currentScrollTop=null,this.m_prevScrollLeft=null,this.m_prevScrollTop=null,this.m_handleScrollOverflow=null,this._clearScrollPositionTimeout(),this.m_resizing=!1,this.m_resizingElement=null,this.m_resizingElementSibling=null,this.m_resizingElementMin=null,this.m_startRow=null,this.m_startCol=null,this.m_endRow=null,this.m_endCol=null,this.m_startRowPixel=null,this.m_startColPixel=null,this.m_endRowPixel=null,this.m_endColPixel=null,this.m_startRowHeader=null,this.m_startColHeader=null,this.m_endRowHeader=null,this.m_endColHeader=null,this.m_startRowHeaderPixel=null,this.m_startColHeaderPixel=null,this.m_endRowHeaderPixel=null,this.m_endColHeaderPixel=null,this.m_rowHeaderLevelCount=null,this.m_columnHeaderLevelCount=null,this.m_startRowEndHeader=null,this.m_startColEndHeader=null,this.m_endRowEndHeader=null,this.m_endColEndHeader=null,this.m_startRowEndHeaderPixel=null,this.m_startColEndHeaderPixel=null,this.m_endRowEndHeaderPixel=null,this.m_endColEndHeaderPixel=null,this.m_rowEndHeaderLevelCount=null,this.m_columnEndHeaderLevelCount=null,this.m_sortInfo=null,this.m_expandCollapseInfo=null,this.m_resizeRequired=null,this.m_externalFocus=null,this.m_currentMode=null,this.m_editMode=null,this.m_hasCells=null,this.m_hasRowHeader=null,this.m_hasRowEndHeader=null,this.m_hasColHeader=null,this.m_hasColEndHeader=null,this.m_isLongScroll=null,this.m_longScrollRow=null,this.m_longScrollColumn=null,this.m_longScrollRowPixel=null,this.m_longScrollColumnPixel=null,this.m_addBorderBottom=null,this.m_addBorderRight=null,this.m_sortContainerWidth=null,this.m_sortContainerHeight=null,this._resetSkeletonProperties(),this._destroyEditableClone(),this._clearFocusoutTimeout(),this._clearFocusoutBusyState()},z.prototype._shouldInitialize=function(){return this.isFetchComplete()&&!this.m_initialized&&null!=this.m_databody.parentNode},z.prototype._handleInitialization=function(e){!0===e?(this.resizeGrid(),0===this.m_startRow&&0===this.m_startCol&&this.fillViewport(),this.isFetchComplete()&&(this._updateActive(this.m_options.getCurrentCell(),!!this.m_focusOnRefresh,!0),this.m_initialized=!0,this.fireEvent("ready",{}),this._runModelEventQueue())):(this.m_initialized=!0,this.fireEvent("ready",{}),this._runModelEventQueue())},z.prototype._runModelEventQueue=function(){var e;if(null!=this.m_modelEvents){if(this.m_processingEventQueue=!0,0===this.m_modelEvents.length)return void(this.m_processingEventQueue=!1);"expand"===(e=this.m_modelEvents.shift()).operation?this.handleExpandEvent(e,!0):"collapse"===e.operation?this.handleCollapseEvent(e,!0):this.handleModelEvent(e,!0)}else this.m_processingEventQueue=!1},z.prototype.render=function(e){this.m_renderCount+=1,this.m_timingStart=new Date,this.m_fetching={},this.m_startRow=0,this.m_startCol=0,this.m_endRow=-1,this.m_endCol=-1,this.m_startRowPixel=0,this.m_startColPixel=0,this.m_endRowPixel=0,this.m_endColPixel=0,this.m_startRowHeader=0,this.m_startColHeader=0,this.m_endRowHeader=-1,this.m_endColHeader=-1,this.m_startRowHeaderPixel=0,this.m_startColHeaderPixel=0,this.m_endRowHeaderPixel=0,this.m_endColHeaderPixel=0,this.m_startRowEndHeader=0,this.m_startColEndHeader=0,this.m_endRowEndHeader=-1,this.m_endColEndHeader=-1,this.m_startRowEndHeaderPixel=0,this.m_startColEndHeaderPixel=0,this.m_endRowEndHeaderPixel=0,this.m_endColEndHeaderPixel=0,this.m_currentScrollLeft=0,this.m_currentScrollTop=0,this.m_prevScrollLeft=0,this.m_prevScrollTop=0,this.m_handleScrollOverflow=!1,this.m_rowHeaderLevelWidths=[],this.m_rowEndHeaderLevelWidths=[],this.m_columnHeaderLevelHeights=[],this.m_columnEndHeaderLevelHeights=[],this.m_frozenColIndex=null,this.m_frozenRowIndex=null,this._resetSkeletonProperties();var t=this._loadTemplateEngine();t?(this._signalTaskStart("loading template engine"),t.then(()=>{this._signalTaskEnd(),this.m_renderCount-=1,0===this.m_renderCount&&this.buildGrid(e)})):(this.m_renderCount-=1,this.buildGrid(e))},z.prototype._loadTemplateEngine=function(){var e=this._getSlotMap();if(this._isDataGridProvider()&&Object.keys(e).length>1||null==this.getDataSource()&&Object.keys(e).length>0){var t={customElement:this.m_customElement};return new Promise(e=>{p.__getTemplateEngine(t).then(t=>{this.m_engine=t,e(t)},function(e){throw new Error("Error loading template engine: "+e)})})}return null},z.prototype._getTemplateEngine=function(){return this.m_engine},z.prototype._cleanTemplateNodes=function(e){var t=this._getTemplateEngine();null!=t&&t.clean(e,this.m_root)},z.prototype._isDataGridProvider=function(){return this.m_options.options.data&&this.m_options.options.data.fetchByOffset&&!this.m_options.options.data.fetchFirst},z.prototype._getSlotMap=function(){return g.CustomElementUtils.getSlotMap(this.m_root)},z.prototype._getItemTemplateBySlotName=function(e){var t=this._getSlotMap()[e];return t&&t.length>0&&"template"===t[0].tagName.toLowerCase()?t[0]:null},z.prototype.buildGrid=function(e){this.m_root=e,this.m_root.setAttribute("role","application"),this._isCellEditable()?this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("editable")):this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.setDefaultDimensions(),e.tabIndex=0;var t=this.buildStatus();e.appendChild(t),this.m_status=t;var i=this.buildAccSummary();e.appendChild(i),this.m_accSummary=i;var s=this.buildAccInfo();e.appendChild(s),this.m_accInfo=s;var n=this.buildStateInfo();e.appendChild(n),this.m_stateInfo=n;var o=this.buildContextInfo();e.appendChild(o),this.m_contextInfo=o;var l=this.buildPlaceHolder();if(e.appendChild(l),this.m_placeHolder=l,this.m_headerLabels={row:[],column:[],rowEnd:[],columnEnd:[]},null!=this.getDataSource()){this.m_empty=null;var r=this.getResources().isRTLMode(),a=this.buildHeaders("column",this.getMappedStyle("colheader"),this.getMappedStyle("colendheader")),h=a.root,d=a.endRoot;let i=a.frozenHeader,s=a.frozenEndHeader;e.insertBefore(h,t),e.insertBefore(d,t),i&&e.insertBefore(i,t),s&&e.insertBefore(s,t);var m=(a=this.buildHeaders("row",this.getMappedStyle("rowheader"),this.getMappedStyle("rowendheader"))).root,c=a.endRoot;const n=a.frozenHeader,o=a.frozenEndHeader;e.insertBefore(m,t),e.insertBefore(c,t),n&&e.insertBefore(n,t),o&&e.insertBefore(o,t);const l=this.buildDatabody();for(let i=0;i<l.length;i++)e.insertBefore(l[i],t);const _=l[0];if(r&&(h.style.direction="rtl",_.style.direction="rtl"),this.m_isResizing=!1,this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_databodyDragState=!1,this.m_docMouseMoveListener=this.handleMouseMove.bind(this),this.m_docMouseUpListener=this.handleMouseUp.bind(this),this.m_utils.isTouchDevice())_.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),_.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),_.addEventListener("touchend",this.handleTouchEnd.bind(this),!1),_.addEventListener("touchcancel",this.handleTouchCancel.bind(this),!1),h.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),h.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),h.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),h.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),m.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),m.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),m.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),m.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),d.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),d.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),d.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),d.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1),c.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),c.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),c.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),c.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1);else{var u=this.m_utils.getMousewheelEvent();_.addEventListener(u,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),_.addEventListener("mousedown",this.handleDatabodyMouseDown.bind(this),!1),_.addEventListener("mousemove",this.handleDatabodyMouseMove.bind(this),!1),_.addEventListener("mouseup",this.handleDatabodyMouseUp.bind(this),!1),_.addEventListener("mouseout",this.handleDatabodyMouseOut.bind(this),!1),_.addEventListener("mouseover",this.handleDatabodyMouseOver.bind(this),!1),_.addEventListener("dblclick",this.handleDatabodyDoubleClick.bind(this),!1),m.addEventListener(u,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),h.addEventListener(u,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),m.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),h.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),m.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),h.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),m.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),h.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),m.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),h.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),m.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),h.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),m.addEventListener("click",this.handleHeaderClick.bind(this),!1),m.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),h.addEventListener("click",this.handleHeaderClick.bind(this),!1),h.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),c.addEventListener(u,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),d.addEventListener(u,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),c.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),d.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),c.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),d.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),c.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),d.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),c.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),d.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),c.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),d.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),c.addEventListener("click",this.handleHeaderClick.bind(this),!1),c.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1),d.addEventListener("click",this.handleHeaderClick.bind(this),!1),d.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1)}this._addDnDEventListener(m,c,h,d,_),this._addListenersOnFrozenSections(n,o,i,s),this._shouldInitialize()&&this._handleInitialization(!0)}else{var _=this._buildEmptyText();this.m_databody.firstChild.appendChild(_),this._handleInitialization(!1)}},z.prototype._addDnDEventListener=function(e,t,i,s,n){e&&(e.addEventListener("drag",this.handleRowDrag.bind(this),!1),e.addEventListener("dragstart",this.handleDragStart.bind(this),!1),e.addEventListener("dragend",this.handleRowDragEnd.bind(this),!1),e.addEventListener("dragover",this.handleRowDragOver.bind(this),!1),e.addEventListener("dragenter",this.handleRowDragEnter.bind(this),!1),e.addEventListener("dragleave",this.handleRowDragLeave.bind(this),!1),e.addEventListener("drop",this.handleRowDrop.bind(this),!1)),i&&(i.addEventListener("dragstart",this.handleDragStart.bind(this),!1),i.addEventListener("dragend",this.handleColumnDragEnd.bind(this),!1),i.addEventListener("dragover",this.handleColumnDragOver.bind(this),!1),i.addEventListener("dragenter",this.handleColumnDragEnter.bind(this),!1),i.addEventListener("dragleave",this.handleColumnDragLeave.bind(this),!1),i.addEventListener("drop",this.handleColumnDrop.bind(this),!1)),t&&(t.addEventListener("drag",this.handleRowDrag.bind(this),!1),t.addEventListener("dragstart",this.handleDragStart.bind(this),!1),t.addEventListener("dragend",this.handleRowDragEnd.bind(this),!1),t.addEventListener("dragover",this.handleRowDragOver.bind(this),!1),t.addEventListener("dragenter",this.handleRowDragEnter.bind(this),!1),t.addEventListener("dragleave",this.handleRowDragLeave.bind(this),!1),t.addEventListener("drop",this.handleRowDrop.bind(this),!1)),s&&(s.addEventListener("dragstart",this.handleDragStart.bind(this),!1),s.addEventListener("dragend",this.handleColumnDragEnd.bind(this),!1),s.addEventListener("dragover",this.handleColumnDragOver.bind(this),!1),s.addEventListener("dragenter",this.handleColumnDragEnter.bind(this),!1),s.addEventListener("dragleave",this.handleColumnDragLeave.bind(this),!1),s.addEventListener("drop",this.handleColumnDrop.bind(this),!1)),n&&(n.addEventListener("dragover",this.handleDatabodyDragOver.bind(this),!1),n.addEventListener("dragenter",this.handleDatabodyDragEnter.bind(this),!1),n.addEventListener("drop",this.handleDatabodyDrop.bind(this),!1))},z.prototype._addListenersOnFrozenSections=function(e,t,i,s){const n=this.m_utils.getMousewheelEvent();let o=[this.m_databodyFrozenCorner,this.m_databodyFrozenCol,this.m_databodyFrozenRow];o=o.filter(e=>e);for(let e=0;e<o.length;e++){let t=o[e];this.m_utils.isTouchDevice()?(t.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),t.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!1}),t.addEventListener("touchend",this.handleTouchEnd.bind(this),!1),t.addEventListener("touchcancel",this.handleTouchCancel.bind(this),!1)):(t.addEventListener(n,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),t.addEventListener("mousedown",this.handleDatabodyMouseDown.bind(this),!1),t.addEventListener("mousemove",this.handleDatabodyMouseMove.bind(this),!1),t.addEventListener("mouseup",this.handleDatabodyMouseUp.bind(this),!1),t.addEventListener("mouseout",this.handleDatabodyMouseOut.bind(this),!1),t.addEventListener("mouseover",this.handleDatabodyMouseOver.bind(this),!1),t.addEventListener("dblclick",this.handleDatabodyDoubleClick.bind(this),!1),t.addEventListener("dragover",this.handleDatabodyDragOver.bind(this),!1),t.addEventListener("dragenter",this.handleDatabodyDragEnter.bind(this),!1),t.addEventListener("drop",this.handleDatabodyDrop.bind(this),!1))}e&&(this.m_utils.isTouchDevice()?(e.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),e.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),e.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),e.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1)):(e.addEventListener(n,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),e.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),e.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),e.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),e.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),e.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),e.addEventListener("click",this.handleHeaderClick.bind(this),!1),e.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1))),i&&(this.m_utils.isTouchDevice()?(i.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),i.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),i.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),i.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1)):(i.addEventListener(n,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),i.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),i.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),i.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),i.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),i.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),i.addEventListener("click",this.handleHeaderClick.bind(this),!1),i.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1))),t&&(this.m_utils.isTouchDevice()?(t.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),t.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),t.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),t.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1)):(t.addEventListener(n,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),t.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),t.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),t.addEventListener("mousemove",this.handleRowHeaderMouseMove.bind(this),!1),t.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),t.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),t.addEventListener("click",this.handleHeaderClick.bind(this),!1),t.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1))),s&&(this.m_utils.isTouchDevice()?(s.addEventListener("touchstart",this.handleHeaderTouchStart.bind(this),{passive:!0}),s.addEventListener("touchmove",this.handleHeaderTouchMove.bind(this),{passive:!1}),s.addEventListener("touchend",this.handleHeaderTouchEnd.bind(this),!1),s.addEventListener("touchcancel",this.handleHeaderTouchCancel.bind(this),!1)):(s.addEventListener(n,this.handleDatabodyMouseWheel.bind(this),{passive:!1}),s.addEventListener("mousedown",this.handleHeaderMouseDown.bind(this),!1),s.addEventListener("mouseover",this.handleHeaderMouseOver.bind(this),!1),s.addEventListener("mousemove",this.handleColumnHeaderMouseMove.bind(this),!1),s.addEventListener("mouseup",this.handleHeaderMouseUp.bind(this),!1),s.addEventListener("mouseout",this.handleHeaderMouseOut.bind(this),!1),s.addEventListener("click",this.handleHeaderClick.bind(this),!1),s.addEventListener("dblclick",this.handleHeaderDoubleClick.bind(this),!1))),this._addDnDEventListener(e,t,i,s)},z.prototype.HandleResize=function(e,t){e=this.getRootElement().clientWidth,t=this.getRootElement().clientHeight,e===this.m_width&&t===this.m_height||(this.m_width=e,this.m_height=t,this.m_rowFetchSize=null,this.m_columnFetchSize=null,this.m_initialized&&(this.resizeGrid(),this.isFetchComplete()&&(this.m_resizeRequired=!0,this.fillViewport())))},z.prototype.resizeGrid=function(){var e=this.getWidth(),t=this.getHeight(),i=this.m_colHeader,s=this.m_colEndHeader,n=this.m_rowHeader,o=this.m_rowEndHeader,l=this.m_databody,r=l.firstChild;const a=this.m_databodyFrozenCol,h=this.m_databodyFrozenRow;let d=0,m=0;var c=this.getColumnHeaderHeight(),u=this.getColumnEndHeaderHeight(),_=this.getRowHeaderWidth(),p=this.getRowEndHeaderWidth();a&&(d=this.getElementWidth(a)),h&&(m=this.getElementHeight(h)),this._hasFrozenColumns()&&this._hasFrozenRows()&&(d||(d=this.getElementWidth(this.m_databodyFrozenCorner)),m||(m=this.getElementHeight(this.m_databodyFrozenCorner))),this.m_headerLabels.row&&this.m_headerLabels.row.length&&0===c&&(c=this._getCellDimension(this.m_headerLabels.row[0],0,null,"column","height"),this.m_colHeaderHeight=c),this.m_headerLabels.column&&this.m_headerLabels.column.length&&0===_&&(_=this._getCellDimension(this.m_headerLabels.column[0],0,null,"row","width"),this.m_rowHeaderWidth=_);var g,C,f,y=t-c-u-m,E=e-_-p-d,v=this.m_utils.getScrollbarSize();this._databodyEmpty()&&(null==this.m_empty?(g=this._buildEmptyText(),C=this.getElementHeight(g),f=this.getElementWidth(g),r=l.firstChild,C>this.getElementHeight(r)&&this.setElementHeight(r,C),f>this.getElementWidth(r)&&this.setElementWidth(r,f),this.m_databody.firstChild.appendChild(g)):g=this.m_empty);var w,H,x,S,b,R=this.getElementWidth(l.firstChild),I=this.getElementHeight(l.firstChild),M=this.isDatabodyHorizontalScrollbarRequired(E);if(M)w=this.isDatabodyVerticalScrollbarRequired(y-v),l.style.overflow="auto";else if(w=this.isDatabodyVerticalScrollbarRequired(y))M=this.isDatabodyHorizontalScrollbarRequired(E-v),l.style.overflow="auto";else{this.m_handleScrollOverflow=!1;var F=this;setTimeout(function(){F.m_handleScrollOverflow||F.m_hasVerticalScroller||F.m_hasHorizontalScroller||(l.style.overflow="hidden",F.m_handleScrollOverflow=!0)},10)}this.m_hasHorizontalScroller=M,this.m_hasVerticalScroller=w,-1!==this.m_endColEndHeader?(H=Math.min(I+(M?v:0),y),x=M?H-v:H):(H=y,x=Math.min(I,M?H-v:H)),-1!==this.m_endRowEndHeader?(S=Math.min(R+(w?v:0),E),b=w?S-v:S):(S=E,b=Math.min(R,w?S-v:S));var z=_+b+d+(w?v:0),A=c+x+m+(M?v:0),D=this.getResources().isRTLMode()?"right":"left";this.setElementDir(n,0,D),this.setElementDir(n,c,"top"),this.setElementHeight(n,x),this.setElementDir(o,z,D),this.setElementDir(o,c,"top"),this.setElementHeight(o,x),this.setElementDir(i,_,D),this.setElementWidth(i,b),this.setElementDir(s,_,D),this.setElementDir(s,A,"top"),this.setElementWidth(s,b),[_,c]=this._setFrozenContainerDimension(E,y,_,p,c,u),this.setElementDir(l,c,"top"),this.setElementDir(l,_,D),this.setElementWidth(l,S),this.setElementHeight(l,H),this.m_scrollWidth=R-b,this.m_scrollHeight=I-x,this.buildCorners(),this._adjustHeaderBorders(),this._updateGridlines(),this.m_resizeRequired=!1},z.prototype._sizeDatabodyScroller=function(){var e=this.m_databody,t=e.firstChild,i=0,s=0;this._databodyEmptyState()?(i=Math.max(Math.max(this.m_endRowHeaderPixel,this.m_endRowEndHeaderPixel),1),s=Math.max(Math.max(this.m_endColHeaderPixel,this.m_endColEndHeaderPixel),1)):(i=this.m_endRowPixel,s=this.m_endColPixel),this._setScrollerDimension(t,i,s),this.m_initialized&&(this.m_scrollWidth=this.getElementWidth(t)-Math.min(this.getElementWidth(t),this.getElementWidth(e)-(this.m_hasVerticalScroller?this.m_utils.getScrollbarSize():0)),this.m_scrollHeight=this.getElementHeight(t)-Math.min(this.getElementHeight(t),this.getElementHeight(e)-(this.m_hasHorizontalScroller?this.m_utils.getScrollbarSize():0)))},z.prototype._setScrollerDimension=function(e,t,i){let s=this._isHighWatermarkScrolling(),n=this.m_utils._getMaxDivHeightForScrolling(),o=this.m_utils._getMaxDivWidthForScrolling(),l=this.getDataSource().getCount("row"),r=this.getDataSource().getCount("column"),a=0,h=0;a=-1===l||s?t:l*this.m_avgRowHeight,h=-1===r||s?i:r*this.m_avgColWidth,this.setElementHeight(e,Math.min(n,a)),this.setElementWidth(e,Math.min(o,h))},z.prototype._adjustLastHeadersAlongAxis=function(e,t,i,s,n,o,l){for(var r=0;r<t;){let t=this._getHeaderCellByIndex(e,l,r);o?this.m_utils.removeCSSClassName(t,n):this.m_utils.addCSSClassName(t,n),r+=this.getHeaderCellDepth(t)}},z.prototype._adjustHeaderBordersAlongAxis=function(e,t,i,s,n,o,l,r,a){null!=e&&i>=0&&(s?this.m_utils.addCSSClassName(n,o):this.m_utils.removeCSSClassName(n,o),t(i)&&this._adjustLastHeadersAlongAxis(i,l,e,r,o,s,a))},z.prototype._adjustHeaderBorders=function(){var e,t,i,s,n,o=this.m_utils.getScrollbarSize(),l=this.getWidth(),r=this.getHeight(),a=this.getColumnHeaderHeight(),h=this.getElementWidth(this.m_colHeader),d=this.getColumnEndHeaderHeight(),m=this.getRowHeaderWidth(),c=this.getElementHeight(this.m_rowHeader),u=m+h+this.getRowEndHeaderWidth()+(this.m_hasVerticalScroller?o:0)<l,_=a+c+d+(this.m_hasHorizontalScroller?o:0)<r;if(u&&this.m_endRowEndHeader>=0?(e=!0,this.m_addBorderRight=!0):!0===this.m_addBorderRight&&(e=!1),null!=e)for(t=this.getMappedStyle("borderVerticalSmall"),null!=this.m_columnHeaderScrollbarSpacer&&(e?this.m_utils.addCSSClassName(this.m_columnHeaderScrollbarSpacer,t):this.m_utils.removeCSSClassName(this.m_columnHeaderScrollbarSpacer,t)),null!=this.m_bottomCorner&&(e?this.m_utils.addCSSClassName(this.m_bottomCorner,t):this.m_utils.removeCSSClassName(this.m_bottomCorner,t)),s=this.m_rowEndHeader.firstChild.childNodes,i=0;i<s.length;i++)e?this.m_utils.addCSSClassName(s[i],t):this.m_utils.removeCSSClassName(s[i],t);else{t=this.getMappedStyle("borderVerticalNone"),n=this._isLastColumn.bind(this);let e=this.m_startColHeader,i=this.m_startColEndHeader;this._hasFrozenColumns()&&(e=this.m_frozenColIndex+1,i=e),this._adjustHeaderBordersAlongAxis(this.m_colHeader,n,this.m_endColHeader,u,this.m_columnHeaderScrollbarSpacer,t,this.m_columnHeaderLevelCount,e,"column"),this._adjustHeaderBordersAlongAxis(this.m_colEndHeader,n,this.m_endColEndHeader,u,this.m_bottomCorner,t,this.m_columnEndHeaderLevelCount,i,"columnEnd")}if(e=null,_&&this.m_endColEndHeader>=0?(this.m_addBorderBottom=!0,e=!0):!0===this.m_addBorderBottom&&(e=!1),null!=e){t=this.getMappedStyle("borderHorizontalSmall"),null!=this.m_rowHeaderScrollbarSpacer&&(e?this.m_utils.addCSSClassName(this.m_rowHeaderScrollbarSpacer,t):this.m_utils.removeCSSClassName(this.m_rowHeaderScrollbarSpacer,t)),null!=this.m_bottomCorner&&(e?this.m_utils.addCSSClassName(this.m_bottomCorner,t):this.m_utils.removeCSSClassName(this.m_bottomCorner,t)),s=this.m_colEndHeader.firstChild.childNodes;const n=this.getMappedStyle("groupingcontainer");for(i=0;i<s.length;i++){let o=s[i];o.classList.contains(n)&&(o=o.firstChild),e?this.m_utils.addCSSClassName(o,t):this.m_utils.removeCSSClassName(o,t)}}else{t=this.getMappedStyle("borderHorizontalNone"),n=this._isLastRow.bind(this);let e=this.m_startRowHeader,i=this.m_startRowEndHeader;null!==this.m_frozenRowIndex&&(e=this.m_frozenRowIndex+1,i=e),this._adjustHeaderBordersAlongAxis(this.m_rowHeader,n,this.m_endRowHeader,_,this.m_rowHeaderScrollbarSpacer,t,this.m_rowHeaderLevelCount,e,"row"),this._adjustHeaderBordersAlongAxis(this.m_rowEndHeader,n,this.m_endRowEndHeader,_,this.m_bottomCorner,t,this.m_rowEndHeaderLevelCount,i,"rowEnd")}},z.prototype._isHeaderLabelCollision=function(){return this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]},z.prototype.buildCorners=function(){var e,t,i,s,n=this.m_utils.getScrollbarSize(),o=this.getWidth(),l=this.getHeight(),r=this.getColumnHeaderHeight(),a=this.getElementWidth(this.m_colHeader),h=this.getColumnEndHeaderHeight(),d=this.getRowHeaderWidth(),m=this.getRowEndHeaderWidth(),c=this.getElementHeight(this.m_rowHeader),u=this.getResources().isRTLMode()?"right":"left";let _,p,g,C,f,y,E=!0,v=r,w=d,H=0,x=0;const S=this.m_databodyFrozenCol,b=this.m_databodyFrozenRow;if(S&&(H=this.getElementWidth(S)),b&&(x=this.getElementHeight(b)),-1!==this.m_endRowHeader&&-1!==this.m_endColHeader?(p=this.m_headerLabels.column.length?this.m_columnHeaderLevelHeights[this.m_columnHeaderLevelCount-1]:this.m_colHeaderHeight,_=this.m_headerLabels.row.length?this.m_rowHeaderLevelWidths[this.m_rowHeaderLevelCount-1]:this.m_rowHeaderWidth,f=c+r+x,y=h+(this.m_hasHorizontalScroller?n:0),g=d+a+H,C=m+(this.m_hasVerticalScroller?n:0)):-1!==this.m_endRowHeader&&-1===this.m_endColHeader?(p=r,f=c+r+x,y=h+(this.m_hasHorizontalScroller?n:0),g=d,C=m+a+H+(this.m_hasVerticalScroller?n:0)):-1===this.m_endRowHeader&&-1!==this.m_endColHeader?(_=d,f=r,y=h+c+x+(this.m_hasHorizontalScroller?n:0),g=d+a+H,C=m+(this.m_hasVerticalScroller?n:0)):E=!1,E){if(null!=this.m_corner?e=this.m_corner:((e=document.createElement("div")).id=this.createSubId("corner"),e.className=this.getMappedStyle("topcorner")),this.setElementWidth(e,d),this.setElementHeight(e,r),null==this.m_corner){if(this._attachEventListenersOnCorner(e),this.m_root.appendChild(e),this.m_corner=e,p)for(s=0;s<this.m_headerLabels.row.length;s++)null!=(i=this.m_headerLabels.row[s])&&(this.setElementHeight(i,p),e.appendChild(i));if(_)for(s=0;s<this.m_headerLabels.column.length;s++)null!=(i=this.m_headerLabels.column[s])&&(this.setElementWidth(i,_),e.appendChild(i));if(this.m_subtreeAttachedCallback(e),this._isHeaderLabelCollision()){let e=this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],t=this.getElementHeight(e);return this.m_colHeaderHeight+=t,this.m_columnHeaderLevelHeights[this.m_columnHeaderLevelCount-1]+=t,this.resizeColumnHeightsAndShift(t,this.m_columnHeaderLevelCount-1,!1),this.setElementHeight(this.m_colHeader,this.m_colHeaderHeight),this.m_colHeaderFrozen&&this.setElementHeight(this.m_colHeaderFrozen,this.m_colHeaderHeight),void this.manageResizeScrollbars()}}else{this.m_utils.isTouchDevice()?(e.addEventListener("touchstart",this.handleHeaderLabelMouseDown.bind(this),!1),e.addEventListener("touchmove",this.handleHeaderLabelMouseMove.bind(this),!1)):(e.addEventListener("mousedown",this.handleHeaderLabelMouseDown.bind(this),!1),e.addEventListener("mousemove",this.handleHeaderLabelMouseMove.bind(this),!1))}this._buildCornerOnHeaderAxisDisabled("row",u,0,f,w,y),this._buildCornerOnHeaderAxisDisabled("column",u,g,0,C,v)}else this.m_headerLabels.row=[],this.m_headerLabels.column=[];null!=this.m_corner&&null==e&&(this.m_root.removeChild(this.m_corner),this.m_corner=null),(this.m_hasHorizontalScroller&&this.m_hasVerticalScroller||this.m_hasVerticalScroller&&-1!==this.m_endColEndHeader||this.m_hasHorizontalScroller&&-1!==this.m_endRowEndHeader||-1!==this.m_endRowEndHeader&&-1!==this.m_endColEndHeader)&&(null!=this.m_bottomCorner?t=this.m_bottomCorner:((t=document.createElement("div")).id=this.createSubId("bcorner"),t.className=this.getMappedStyle("bottomcorner")),this.setElementDir(t,c+r+x,"top"),this.setElementDir(t,d+a+H,u),-1!==this.m_endRowEndHeader?this.setElementWidth(t,m+(this.m_hasVerticalScroller?n:0)):this.setElementWidth(t,o-a-d-H),-1!==this.m_endColEndHeader?this.setElementHeight(t,h+(this.m_hasHorizontalScroller?n:0)):this.setElementHeight(t,l-c-r-x),null==this.m_bottomCorner&&(this.m_root.appendChild(t),this.m_bottomCorner=t)),null!=this.m_bottomCorner&&null==t&&(this.m_root.removeChild(this.m_bottomCorner),this.m_bottomCorner=null)},z.prototype._attachEventListenersOnCorner=function(e){this.m_utils.isTouchDevice()?e.addEventListener("touchstart",this.handleCornerMouseDown.bind(this),{passive:!0}):(e.addEventListener("mousedown",this.handleCornerMouseDown.bind(this),!1),e.addEventListener("mouseover",this.handleCornerMouseOver.bind(this),!1),e.addEventListener("mouseout",this.handleCornerMouseOut.bind(this),!1)),e.addEventListener("click",this.handleCornerClick.bind(this),!1)},z.prototype._buildCornerOnHeaderAxisDisabled=function(e,t,i,s,n,o){let l,r="column"===e?this.m_columnHeaderScrollbarSpacer:this.m_rowHeaderScrollbarSpacer,a=!1;if("column"===e?(this.m_hasVerticalScroller||-1!==this.m_endRowEndHeader)&&(a=!0,null!=this.m_columnHeaderScrollbarSpacer?l=this.m_columnHeaderScrollbarSpacer:(l=document.createElement("div"),l.id=this.createSubId("chSbSpacer"),l.className=this.getMappedStyle("colheaderspacer"))):"row"===e&&(this.m_hasHorizontalScroller||-1!==this.m_endColEndHeader)&&(a=!0,null!=this.m_rowHeaderScrollbarSpacer?l=this.m_rowHeaderScrollbarSpacer:(l=document.createElement("div"),l.id=this.createSubId("rhSbSpacer"),l.className=this.getMappedStyle("rowheaderspacer"))),a){let a,h;if(this.setElementDir(l,i,t),this.setElementDir(l,s,"top"),this.setElementWidth(l,n),this.setElementHeight(l,o),null==r){if(this.m_utils.isTouchDevice()?l.addEventListener("touchstart",this.handleCornerMouseDown.bind(this),{passive:!0}):(l.addEventListener("mousedown",this.handleCornerMouseDown.bind(this),!1),l.addEventListener("mouseover",this.handleCornerMouseOver.bind(this),!1),l.addEventListener("mouseout",this.handleCornerMouseOut.bind(this),!1),"disable"!==this.isResizeEnabled()&&(l.addEventListener("mousedown",this.handleHeaderLabelMouseDown.bind(this),!1),l.addEventListener("mousemove",this.handleHeaderLabelMouseMove.bind(this),!1))),this.m_root.appendChild(l),"column"===e?(this.m_columnHeaderScrollbarSpacer=l,a=this.m_headerLabels.rowEnd):(this.m_rowHeaderScrollbarSpacer=l,a=this.m_headerLabels.columnEnd),a.length)for(let e=0;e<a.length;e++)h=a[e],null!=h&&l.appendChild(h);this.m_subtreeAttachedCallback(l)}}else"column"===e?(null!=this.m_columnHeaderScrollbarSpacer&&this.m_root.removeChild(this.m_columnHeaderScrollbarSpacer),this.m_columnHeaderScrollbarSpacer=null,this.m_headerLabels.rowEnd=[]):(null!=this.m_rowHeaderScrollbarSpacer&&this.m_root.removeChild(this.m_rowHeaderScrollbarSpacer),this.m_rowHeaderScrollbarSpacer=null,this.m_headerLabels.columnEnd=[])},z.prototype._updateScrollPosition=function(e){this._scrollToScrollPositionObject(e)},z.prototype._setScrollPosition=function(){this.m_setOptionCallback("scrollPosition",this._createScrollPositionObject(this.m_currentScrollLeft,this.m_currentScrollTop),{_context:{writeback:!0,internalSet:!0}})},z.prototype._clearScrollPositionKeys=function(){var e=this.m_options.getScrollPosition();e.rowKey=void 0,e.columnKey=void 0,this.m_setOptionCallback("scrollPosition",e,{_context:{internalSet:!0}})},z.prototype._createScrollPositionObject=function(e,t){var i={x:e,y:t},s=this.getResources().isRTLMode()?"right":"left",n=this._getCellAtPixel(e,t);if(null!=n)i.rowIndex=this._getIndex(n,"row"),i.columnIndex=this._getIndex(n,"column"),i.rowKey=this._getKey(n,"row"),i.columnKey=this._getKey(n,"column"),i.offsetX=e-this.getElementDir(n,s),i.offsetY=t-this.getElementDir(n,"top");else{var o=this._getHeaderAtPixel(t,"row");null!=o&&(i.rowIndex=this._getIndex(o),i.rowKey=this._getKey(o),i.offsetY=t-this.getElementDir(o,"top"));var l=this._getHeaderAtPixel(e,"column");null!=l&&(i.columnIndex=this._getIndex(l),i.columnKey=this._getKey(l),i.offsetX=e-this.getElementDir(l,s))}return i},z.prototype._getCellAtPixel=function(e,t){for(var i=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),s=this.getResources().isRTLMode()?"right":"left",n=0;n<i.length;n++){var o=i[n],l=this.getElementDir(o,s),r=l+this.getElementWidth(o);if(l<=e&&e<r){var a=this.getElementDir(o,"top"),h=a+this.getElementHeight(o);if(a<=t&&t<h)return o}}return null},z.prototype._getAxisInnerMostHeaders=function(e){var t,i,s=this.getMappedStyle("headercell");switch(e){case"row":t=this.m_rowHeader,i=this.m_rowHeaderLevelCount;break;case"column":t=this.m_colHeader,i=this.m_columnHeaderLevelCount;break;case"rowEnd":t=this.m_rowEndHeader,i=this.m_rowEndHeaderLevelCount;break;case"columnEnd":t=this.m_colEndHeader,i=this.m_columnEndHeaderLevelCount}var n=[];if(t)for(var o=t.getElementsByClassName(s),l=0;l<o.length;l++){var r=o[l],a=r[this.getResources().getMappedAttribute("context")];a.level+a.depth===i&&n.push(r)}return n},z.prototype._getHeaderAtPixel=function(e,t){var i,s,n,o,l=this;function r(t){for(var i=0;i<t.length;i++){var s=t[i],r=l.getElementDir(s,n),a=r+l.getElementDir(s,o);if(r<=e&&e<a)return s}}i=this._getAxisInnerMostHeaders(t),s=this._getAxisInnerMostHeaders(t+"End"),"row"===t?(n="top",o="height"):"column"===t&&(n=this.getResources().isRTLMode()?"right":"left",o="width");var a=r(i);return null==a&&(a=r(s)),a},z.prototype._checkScrollPosition=function(){null!=this.m_desiredScrollPositionObject?this._scrollToScrollPositionObject(this.m_desiredScrollPositionObject):this._setScrollPosition()},z.prototype._areKeysLocallyAvailable=function(e,t){var i=!0;return e&&null==this._getCellOrHeaderByKey(e,"row")&&(i=!1),t&&null==this._getCellOrHeaderByKey(t,"column")&&(i=!1),i},z.prototype._scrollToScrollPositionObject=function(e){var t=e.x,i=e.y,s=e.rowIndex,n=e.columnIndex,o=e.rowKey,l=e.columnKey,r=e.offsetX?e.offsetX:0,a=e.offsetY?e.offsetY:0,h=this.getResources().isRTLMode()?"right":"left",d=this.m_options.getScrollToKey();if("never"!==d||!o&&!l){if("always"!==d)if(this.getDataSource()instanceof H&&!this._areKeysLocallyAvailable(o,l)){var m=this.m_options.getProperty("data").getCapability("fetchFirst");if(null==m||"immediate"!==m.iterationSpeed)return}var c=this;this._getIndexFromKeyPromise(o,l).then(function(d){var m=Math.floor(c._getPositionEstimate("column",h,l,d.columnIndexFromKey,n,t,r,c.m_currentScrollLeft,c._getMaxRightPixel(),c.m_avgColWidth)),u=Math.floor(c._getPositionEstimate("row","top",o,d.rowIndexFromKey,s,i,a,c.m_currentScrollTop,c._getMaxBottomPixel(),c.m_avgRowHeight));m!==c.m_currentScrollLeft&&(c.m_currentScrollLeft!==c.m_scrollWidth||m<c.m_currentScrollLeft)||u!==c.m_currentScrollTop&&(c.m_currentScrollTop!==c.m_scrollHeight||u<c.m_currentScrollTop)?(null==c.m_desiredScrollPositionObject&&c._signalTaskStart("begin scrolling to new desired location"),c.m_desiredScrollPositionObject=e,c._setScrollPositionTimeout(),c._initiateScroll(m,u)):(null!=c.m_desiredScrollPositionObject&&c._signalTaskEnd("reached desired location"),c.m_desiredScrollPositionObject=null,c._setScrollPosition())})}},z.prototype._setScrollPositionTimeout=function(){this.m_utils.isTouchDeviceNotIOS()||(this.pendingScrollTimeout=setTimeout(function(){null!=this.m_desiredScrollPositionObject&&this._signalTaskEnd("reached desired location"),this.m_desiredScrollPositionObject=null,this._setScrollPosition()}.bind(this),300))},z.prototype._clearScrollPositionTimeout=function(){null!=this.pendingScrollTimeout&&(clearTimeout(this.pendingScrollTimeout),this.pendingScrollTimeout=null)},z.prototype._getPositionEstimate=function(e,t,i,s,n,o,l,r,a,h){var d,m,c=this._isHighWatermarkScrolling();return null!=i&&-1!==s&&(null!=(m=this._getCellOrHeaderByKey(i,e))?d=this.getElementDir(m,t)+l:c?d=a:null!=s&&(d=h*s+l),null!=d)?d:d=null!=n?null!=(m=this._getCellOrHeaderByIndex(n,e))?this.getElementDir(m,t)+l:c?a:h*n:null!=o?o:r},z.prototype.isDatabodyHorizontalScrollbarRequired=function(e){var t=this.m_databody.firstChild;return this.getElementWidth(t)>e},z.prototype.isDatabodyVerticalScrollbarRequired=function(e){var t=this.m_databody.firstChild;return this.getElementHeight(t)>e},z.prototype.buildStatus=function(){var e=document.createElement("div");return e.id=this.createSubId("status"),e.className=this.getMappedStyle("status"),e.setAttribute("role","status"),e},z.prototype.buildAccInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("info"),e.className=this.getMappedStyle("info"),e.setAttribute("role","status"),e},z.prototype.buildAccSummary=function(){var e=document.createElement("div");return e.id=this.createSubId("summary"),e.className=this.getMappedStyle("info"),e},z.prototype.buildStateInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("state"),e.className=this.getMappedStyle("info"),e},z.prototype.buildContextInfo=function(){var e=document.createElement("div");return e.id=this.createSubId("context"),e.className=this.getMappedStyle("info"),e},z.prototype.buildPlaceHolder=function(){var e=document.createElement("div");return e.id=this.createSubId("placeHolder"),e.className=this.getMappedStyle("info"),e},z.prototype.populateAccInfo=function(){var e=this.getResources().getTranslatedText("accessibleSummaryExact",{rownum:this.m_endRow+1,colnum:this.m_endCol+1});this.getDataSource().getExpandedKeys&&(e=e+". "+this.getResources().getTranslatedText("accessibleSummaryExpanded",{num:this.getDataSource().getExpandedKeys().length}));e+=". ",this.m_accSummary.textContent=e},z.prototype.SetAccessibleContext=function(e){if(null!=e&&(null!=e.context&&(this.m_accessibleContext=e.context),null!=e.state&&(this.m_stateInfo.textContent=e.state),null!=e.ancestors&&this._isDatabodyCellActive())){var t="",i=e.ancestors,s=this.m_active.indexes.column;if(null!=s&&s>=0)for(var n=0;n<i.length;n++){n>0&&(t=t.concat(", "));var o=i[n],l=this._getAxisCellsByKey(o.key,"row");if(null!=l){var r=l[0].textContent;r=null!=r?r.replace(/\n|<br\s*\/?>/gi,"").trim():"",t=t.concat(o.label).concat(" ").concat(r)}}this.m_accessibleContext=t.concat(", ").concat(this.m_accessibleContext)}},z.prototype._updateStateInfo=function(e){for(var t=". ",i=0;i<e.length;i++){var s=this.getResources().getTranslatedText(e[i].key,e[i].args);null!=s&&(t=2===t.length?t+s:t+", "+s)}t=2===t.length?t:t+". ",this.m_stateInfo.textContent=t},z.prototype._updateContextInfo=function(e,t){var i,s;e.indexes&&(i=e.indexes.row,s=e.indexes.column);var n=e.level,o=e.rowHeader,l=e.rowEndHeader,r=e.columnHeader,a=e.columnEndHeader,h=e.rowHeaderLabel,d=e.rowEndHeaderLabel,m=e.columnHeaderLabel,c=e.columnEndHeaderLabel,u="";null!=this.m_accessibleContext||isNaN(i)||"row"===t||(u=this._updateAccessibleInfoString(u,"accessibleRowContext",{index:i+1})),isNaN(s)||"column"===t||(u=this._updateAccessibleInfoString(u,"accessibleColumnContext",{index:s+1})),isNaN(o)||(u=this._updateAccessibleInfoString(u,"accessibleRowHeaderContext",{index:o+1})),isNaN(r)||(u=this._updateAccessibleInfoString(u,"accessibleColumnHeaderContext",{index:r+1})),isNaN(l)||(u=this._updateAccessibleInfoString(u,"accessibleRowEndHeaderContext",{index:l+1})),isNaN(a)||(u=this._updateAccessibleInfoString(u,"accessibleColumnEndHeaderContext",{index:a+1})),isNaN(h)||(u=this._updateAccessibleInfoString(u,"accessibleRowHeaderLabelContext",{level:h+1})),isNaN(m)||(u=this._updateAccessibleInfoString(u,"accessibleColumnHeaderLabelContext",{level:m+1})),isNaN(d)||(u=this._updateAccessibleInfoString(u,"accessibleRowEndHeaderLabelContext",{level:d+1})),isNaN(c)||(u=this._updateAccessibleInfoString(u,"accessibleColumnEndHeaderLabelContext",{level:c+1})),isNaN(n)||(u=this._updateAccessibleInfoString(u,"accessibleLevelContext",{level:n+1})),u=0===u.length?u:u+". ",null!=this.m_accessibleContext&&(u+=this.m_accessibleContext,this.m_accessibleContext=null),this.m_contextInfo.textContent=u},z.prototype._updateAccessibleInfoString=function(e,t,i){var s=this.getResources().getTranslatedText(t,i);return null!=s?0===e.length?s:e+", "+s:e},z.prototype._isCountUnknown=function(e){var t=this.getDataSource();if("row"===e||"rowEnd"===e){var i=t.getCountPrecision("row"),s=t.getCount("row");return this.m_isEstimateRowCount="estimate"===i||s<0,this.m_isEstimateRowCount}if("column"===e||"columnEnd"===e){var n=t.getCountPrecision("column"),o=t.getCount("column");return this.m_isEstimateColumnCount="estimate"===n||o<0,this.m_isEstimateColumnCount}return!1},z.prototype._isCountUnknownOrHighwatermark=function(e){return this._isCountUnknown(e)||this._isHighWatermarkScrolling()},z.prototype._hideHeader=function(e){e.style.display="none"},z.prototype._showHeader=function(e){e.style.display=""},z.prototype.buildHeaders=function(e,t,i){var s=this.getMappedStyle("scroller")+(this.m_utils.isTouchDeviceNotIOS()?" "+this.getMappedStyle("scroller-mobile"):"");let n=this._createHeaderElement(e,t,s,!1),o=this._createHeaderElement(e,i,s,!0);const l=this.m_options._getFreezeIndex(e);let r,a;if("column"===e?(this.m_colHeader=n,this.m_colEndHeader=o):"row"===e&&(this.m_rowHeader=n,this.m_rowEndHeader=o),"column"===e&&null!==l&&(this.m_frozenColIndex=l,r=this._createHeaderElement("frozenColumn",this.getMappedStyle("colHeaderFrozen"),s,!1),this.m_colHeaderFrozen=r,this.m_colEndHeader&&(a=this._createHeaderElement("frozenColumn",this.getMappedStyle("colEndHeaderFrozen"),s,!0),this.m_colEndHeaderFrozen=a)),"row"===e&&null!==l&&(this.m_frozenRowIndex=l,r=this._createHeaderElement("frozenRow",this.getMappedStyle("rowHeaderFrozen"),s,!1),this.m_rowHeaderFrozen=r,this.m_rowEndHeader&&(a=this._createHeaderElement("frozenRow",this.getMappedStyle("rowEndHeaderFrozen"),s,!0),this.m_rowEndHeaderFrozen=a)),this._isHighWatermarkScrolling()){this.fetchHeaders(e,0,n,o,null,null)}else{var h=this,d=this.m_options.getScrollPosition();this._getIndexesFromScrollPosition(d).then(function(t){var i=t[e];"column"===e?(h.m_startColHeader=i,h.m_startColEndHeader=i):"row"===e&&(h.m_startRowHeader=i,h.m_startRowEndHeader=i);let s=null;h.m_fetching[e]=!1,null!==l&&(s=h.getFetchSize(e)+i,i=0),h.fetchHeaders(e,i,n,o,s,null)}),this.m_fetching[e]=!0}return{root:n,endRoot:o,frozenHeader:r,frozenEndHeader:a}},z.prototype._createHeaderElement=function(e,t,i,s){let n=document.createElement("div");n.id=s?this.createSubId(e+"EndHeader"):this.createSubId(e+"Header");let o=s?this.getMappedStyle("endheader"):this.getMappedStyle("header");n.className=t+" "+o;let l=document.createElement("div");return l.className=i,n.appendChild(l),n},z.prototype.fetchHeaders=function(e,t,i,s,n,o){if(!this.m_fetching[e]){null==n&&(n=this.getFetchCount(e,t));var l,r={axis:e,start:t,count:n,header:i,endHeader:s};this.m_fetching[e]=r,l=null!=o&&null!=o.success?o.success:this.handleHeadersFetchSuccess,this.m_initialized&&this.isSkeletonSupport()||this.showStatusText(!this.isSkeletonSupport()),this._signalTaskStart(),this.getDataSource().fetchHeaders(r,{success:l,error:this.handleHeadersFetchError},{success:this,error:this})}},z.prototype.isHeaderFetchResponseValid=function(e){var t=e.axis;return null!=this.m_fetching&&e===this.m_fetching[t]},z.prototype.isHeaderFetchResponseInViewport=function(e){if(!this.m_initialized)return!0;var t=e.axis,i=e.start;return("row"===t?this._getLongScrollStart(this.m_currentScrollTop,this.m_prevScrollTop,t):this._getLongScrollStart(this.m_currentScrollLeft,this.m_prevScrollLeft,t)).start===i},z.prototype.handleHeadersFetchSuccess=function(e,t,i,s){var n=this.m_options.getScrollPolicyOptions(),o=n?n.maxRowCount:null,l=n?n.maxColumnCount:null;if(!this.isHeaderFetchResponseValid(t))return void this._signalTaskEnd();var r=t.axis;if(this.isLongScroll()&&!this.isHeaderFetchResponseInViewport(t))return this.m_fetching[r]=!1,this.m_headerInvalid=!0,void this._signalTaskEnd();this.m_fetching[r]=!1;let a=this.m_hiddenColumns;var h=t.header,d=t.endHeader,m=t.start,c=this.getDataSource().getCount(r)-a.length;if("column"===r){null===this.m_frozenColIndex&&(this.m_frozenColIndex=this.m_options._getFreezeIndex(r));let{headerStart:s,endHeaderStart:n,headerFetchCount:o,endHeaderFetchCount:a}=this._buildFrozenHeaders(r,e,i,t,c);if(null!=e&&o>0){m=s;let i=o;this.buildColumnHeaders(h,e,m,c,!1,!1,i,!1),(e.getCount()<t.count||l&&l>0&&l===m+e.getCount())&&(this.m_stopColumnHeaderFetch=!0)}else this.m_stopColumnHeaderFetch=!0;if(this.m_endColHeader<0?(this._hideHeader(h),this.m_stopColumnHeaderFetch=!0,this.m_startColHeader=0):(this.m_hasColHeader=!0,this._buildHeaderLabels(r,e)),null!=i&&a>0){m=n;let e=a;this.buildColumnEndHeaders(d,i,m,c,!1,!1,e,!1),(i.getCount()<t.count||l&&l>0&&l===m+i.getCount())&&(this.m_stopColumnEndHeaderFetch=!0)}else this.m_stopColumnEndHeaderFetch=!0;this.m_endColEndHeader<0?(this._hideHeader(d),this.m_stopColumnEndHeaderFetch=!0,this.m_startColEndHeader=0):(this.m_hasColEndHeader=!0,this._buildHeaderLabels("columnEnd",i))}else if("row"===r){null===this.m_frozenRowIndex&&(this.m_frozenRowIndex=this.m_options._getFreezeIndex("row"));let{headerStart:n,endHeaderStart:l,headerFetchCount:a,endHeaderFetchCount:u}=this._buildFrozenHeaders(r,e,i,t,c);if(null!=e&&a>0){m=n;const i=a;this.buildRowHeaders(h,e,m,c,s,!1,i,!1),(e.getCount()<t.count||o&&o>0&&o===m+e.getCount())&&(this.m_stopRowHeaderFetch=!0)}else this.m_stopRowHeaderFetch=!0;if(this.m_endRowHeader<0?(this._hideHeader(h),this.m_stopRowHeaderFetch=!0,this.m_startRowHeader=0):(this.m_hasRowHeader=!0,this._buildHeaderLabels(r,e)),null!=i&&u>0){m=l;const e=u;this.buildRowEndHeaders(d,i,m,c,s,!1,e,!1),(i.getCount()<t.count||o&&o>0&&o===m+i.getCount())&&(this.m_stopRowEndHeaderFetch=!0)}else this.m_stopRowEndHeaderFetch=!0;this.m_endRowEndHeader<0?(this._hideHeader(d),this.m_stopRowEndHeaderFetch=!0,this.m_startRowEndHeader=0):(this.m_hasRowEndHeader=!0,this._buildHeaderLabels("rowEnd",i))}this.isFetchComplete()&&(this.hideStatusText(),this._shouldInitialize()&&!s&&this._handleInitialization(!0)),this.m_initialized&&(this.isSkeletonSupport()&&this.loadSkeletonsOnHeaderLoad(r,m,e,i),this._sizeDatabodyScroller()),this._signalTaskEnd()},z.prototype._calculateFrozenIndex=function(e,t){let i=e;if(t&&t.length){let e=0;for(let i=0;i<t.length;i++){let s=t[i];0===this._getAttribute(s,"level",10)&&(e+=this._getAttribute(s,"extent",10))}i=e}return i},z.prototype.handleHeadersFetchError=function(e,t){var i=t.axis;this.m_fetching[i]=!1,this._signalTaskEnd()},z.prototype.createHeaderContext=function(e,t,i,s,n,o,l,r){var a={axis:e,index:t,data:i};a.component=this,a.datasource=this.m_options.getProperty("data"),a.level=o,a.depth=r,a.extent=l,null!=n&&(a.parentElement=n);for(var h=Object.keys(s),d=0;d<h.length;d++){var m=h[d];a[m]=s[m]}return null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,a),this.m_fixContextCallback.call(this,a)},z.prototype._createLabelContext=function(e,t,i,s,n){var o={axis:e,level:t,data:i};if(o.component=this,o.datasource=this.m_options.getProperty("data"),null!=s&&(o.parentElement=s),null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,o),this._isDataGridProvider()&&null!=n)for(var l=Object.keys(n),r=0;r<l.length;r++){var a=l[r];o[a]=n[a]}return this.m_fixContextCallback.call(this,o)},z.prototype._buildHeaderLabels=function(e,t){if(0===this.m_headerLabels[e].length&&t&&t.getLabel){var i,s=t.getLevelCount();"rowEnd"===e?i=this.getResources().isRTLMode()?"left":"right":"row"===e?i=this.getResources().isRTLMode()?"right":"left":"column"===e?i="top":"columnEnd"===e&&(i="bottom");var n=0;if(s>0)for(var o=0;o<s;o++){var l,r=document.createElement("div"),a=t.getLabel(o);this._isDataGridProvider()&&(l=t.getLabelMetadata(o));var h=this._getLabelDimension(e,o);if(null!=a){var d=this._createLabelContext(e,o,a,r,l);r.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),r.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(r),r[this.getResources().getMappedAttribute("context")]=d;var m=this.m_options.getInlineStyle(e,d,!0);null!=m&&u.applyMergedInlineStyles(r,m,""),r.className=this.getMappedStyle("headerlabel")+" "+this.getMappedStyle(e.toLowerCase()+"headerlabel");var c=this.m_options.getStyleClass(e,d,!0);null!=c&&(r.className+=" "+c),"row"===e||"rowEnd"===e?("rowEnd"===e&&(r.style.height="100%"),this.setElementWidth(r,h),this.setElementDir(r,n,i),this.setElementDir(r,0,"bottom")):("columnEnd"===e&&(r.style.width="100%"),this.setElementHeight(r,h),this.setElementDir(r,n,i),this.setElementDir(r,0,this.getResources().isRTLMode()?"left":"right")),"enable"!==this.m_options.isResizable(e,"width")&&"enable"!==this.m_options.isResizable(e,"height")||this._setAttribute(r,"resizable","true");var _=this.getRendererOrTemplate(e,!0);this._renderContent(_,d,r,a,this.buildLabelTemplateContext(d,l||{})),this.m_headerLabels[e][o]=r}n+=h}}},z.prototype.buildLabelTemplateContext=function(e,t){return{item:{data:e.data,metadata:t.metadata},datasource:e.datasource}},z.prototype.buildHeaderTemplateContext=function(e,t){return{item:{data:e.data,depth:e.depth,extent:e.extent,index:e.index,level:e.level,metadata:t.metadata,axis:e.axis},datasource:e.datasource}},z.prototype.buildCellTemplateContext=function(e,t){return{item:{columnExtent:e.extents.column,columnIndex:e.indexes.column,data:e.data,metadata:t.metadata,rowExtent:e.extents.row,rowIndex:e.indexes.row},datasource:e.datasource,mode:e.mode}},z.prototype.getRendererOrTemplate=function(e,t){var i,s=this.m_options.getRenderer(e,t);return s||(i="cell"===e?"cellTemplate":t?e+"HeaderLabelTemplate":e+"HeaderTemplate",this._getItemTemplateBySlotName(i)||null)},z.prototype.buildColumnHeaders=function(e,t,i,s,n,o,l,r){if(null==this.m_columnHeaderLevelCount&&(this.m_columnHeaderLevelCount=t.getLevelCount()),0===this.m_columnHeaderLevelCount)return;let a=l;void 0===a&&(a=t.getCount());var h=i>this.m_endColHeader;var d=h?this.m_endColHeaderPixel:this.m_startColHeaderPixel,m=this.m_endColHeader,c=this.m_columnHeaderLevelCount,u=this.getMappedStyle("colheader")+" "+this.getMappedStyle("header"),_=this.getMappedStyle("headercell")+" "+this.getMappedStyle("colheadercell");r&&(_+=` ${this.getMappedStyle("frozenHeader")}`);var p=this.buildAxisHeaders(e,t,"column",i,a,h,false,null,d,m,c,u,_,false),g=p.totalHeaderDimension,C=p.totalLevelDimension;if(0===g||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=g/p.visibleHeaderCount),this.m_colHeaderHeight||(this.m_colHeaderHeight=C,this.setElementHeight(e,this.m_colHeaderHeight)),h?(this.m_endColHeader=i+a-1,this.m_endColHeaderPixel+=g):(this.m_startColHeader-=a,this.m_startColHeaderPixel-=g),-1===s&&(s=this.m_endColHeader),!this._isCountUnknown("column")&&this._isHighWatermarkScrolling()&&this.m_endColHeader+1>=s?this.m_stopColumnHeaderFetch=!0:this.m_stopColumnHeaderFetch=p.stopFetch,0===this.m_startColHeader&&0!==this.m_startColHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startColHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this.m_endColHeaderPixel-=this.m_startColHeaderPixel,this.m_startColHeaderPixel=0),!this.m_initialized&&this.m_startColHeader>0){var f=Math.round(this.m_avgColWidth*this.m_startColHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startColHeader,f-this.m_startColHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this.m_endColHeaderPixel=f+g,this.m_startColHeaderPixel=f}},z.prototype.buildColumnEndHeaders=function(e,t,i,s,n,o,l,r){if(null==this.m_columnEndHeaderLevelCount&&(this.m_columnEndHeaderLevelCount=t.getLevelCount()),0===this.m_columnEndHeaderLevelCount)return;let a=l;void 0===a&&(a=t.getCount());var h=i>this.m_endColEndHeader;var d=h?this.m_endColEndHeaderPixel:this.m_startColEndHeaderPixel,m=this.m_endColEndHeader,c=this.m_columnEndHeaderLevelCount,u=this.getMappedStyle("colendheader")+" "+this.getMappedStyle("endheader"),_=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("colendheadercell");r&&(_+=` ${this.getMappedStyle("frozenHeader")}`);var p=this.buildAxisHeaders(e,t,"columnEnd",i,a,h,false,null,d,m,c,u,_,false),g=p.totalHeaderDimension,C=p.totalLevelDimension;if(0===g||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=g/p.visibleHeaderCount),this.m_colEndHeaderHeight||(this.m_colEndHeaderHeight=C,this.setElementHeight(e,this.m_colEndHeaderHeight)),h?(this.m_endColEndHeader=i+(a-1),this.m_endColEndHeaderPixel+=g):(this.m_startColEndHeader-=a,this.m_startColEndHeaderPixel-=g),-1===s&&(s=this.m_endColEndHeader),!this._isCountUnknown("column")&&this._isHighWatermarkScrolling()&&this.m_endColEndHeader+1>=s?this.m_stopColumnEndHeaderFetch=!0:this.m_stopColumnEndHeaderFetch=p.stopFetch,0===this.m_startColEndHeader&&0!==this.m_startColEndHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startColEndHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell")),this.m_endColEndHeaderPixel-=this.m_startColEndHeaderPixel,this.m_startColEndHeaderPixel=0),!this.m_initialized&&this.m_startColEndHeader>0){var f=Math.round(this.m_avgColWidth*this.m_startColEndHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startColEndHeader,f-this.m_startColEndHeaderPixel,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell")),this.m_endColEndHeaderPixel=f+g,this.m_startColEndHeaderPixel=f}},z.prototype.buildRowHeaders=function(e,t,i,s,n,o,l,r){if(null==this.m_rowHeaderLevelCount&&(this.m_rowHeaderLevelCount=t.getLevelCount()),0===this.m_rowHeaderLevelCount)return;let a=l;void 0===a&&(a=t.getCount());var h,d=i>this.m_endRowHeader,m=d?this.m_endRowHeaderPixel:this.m_startRowHeaderPixel;n?(h=e.firstChild.childNodes[i-this.m_startRowHeader],m=this.getElementDir(h,"top")):h=null;var c=this.m_endRowHeader,u=this.m_rowHeaderLevelCount,_=this.getMappedStyle("rowheader")+" "+this.getMappedStyle("header"),p=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell");r&&(p+=` ${this.getMappedStyle("frozenHeader")}`);var g=this.buildAxisHeaders(e,t,"row",i,a,d,n,h,m,c,u,_,p,o),C=g.totalHeaderDimension,f=g.totalLevelDimension;if(o)return g;if(0===C||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=C/a),this.m_rowHeaderWidth||(this.m_rowHeaderWidth=f,this.setElementWidth(e,this.m_rowHeaderWidth)),d){if(-1!==this.m_endRowHeader&&0!==a){var y=e.firstChild.childNodes[this.m_endRowHeader-this.m_startRowHeader];null!=y&&this.m_utils.removeCSSClassName(y,this.getMappedStyle("borderHorizontalNone"))}this.m_endRowHeader=i+(a-1),this.m_endRowHeaderPixel+=C}else n?(i<this.m_startRowHeader&&(this.m_startRowHeader=i,this.m_startRowHeaderPixel=Math.max(0,this.m_startRowHeaderPixel-C)),this.m_endRowHeader+=a,this.m_endRowHeaderPixel=Math.max(0,this.m_endRowHeaderPixel+C),this.pushRowHeadersDown(h,C)):(this.m_startRowHeader=Math.max(0,this.m_startRowHeader-a),this.m_startRowHeaderPixel-=C);if(-1===s&&(s=this.m_endRowHeader),!this._isCountUnknown("row")&&this._isHighWatermarkScrolling()&&this.m_endRowHeader+1>=s?this.m_stopRowHeaderFetch=!0:this.m_stopRowHeaderFetch=g.stopFetch,0===this.m_startRowHeader&&0!==this.m_startRowHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startRowHeaderPixel,"top",this.getMappedStyle("rowheadercell")),this.m_endRowHeaderPixel-=this.m_startRowHeaderPixel,this.m_startRowHeaderPixel=0),!this.m_initialized&&this.m_startRowHeader>0){var E=Math.round(this.m_avgRowHeight*this.m_startRowHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startRowHeader,E-this.m_startRowHeaderPixel,"top",this.getMappedStyle("rowheadercell")),this.m_endRowHeaderPixel=E+C,this.m_startRowHeaderPixel=E}},z.prototype.buildRowEndHeaders=function(e,t,i,s,n,o,l,r){if(null==this.m_rowEndHeaderLevelCount&&(this.m_rowEndHeaderLevelCount=t.getLevelCount()),0===this.m_rowEndHeaderLevelCount)return;let a=l;void 0===a&&(a=t.getCount());var h,d=i>this.m_endRowEndHeader,m=d?this.m_endRowEndHeaderPixel:this.m_startRowEndHeaderPixel;n?(h=e.firstChild.childNodes[i-this.m_startRowEndHeader],m=this.getElementDir(h,"top")):h=null;var c=this.m_endRowEndHeader,u=this.m_rowEndHeaderLevelCount,_=this.getMappedStyle("rowendheader")+" "+this.getMappedStyle("endheader"),p=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell");r&&(p+=` ${this.getMappedStyle("frozenHeader")}`);var g=this.buildAxisHeaders(e,t,"rowEnd",i,a,d,n,h,m,c,u,_,p,o);if(o)return g;var C=g.totalHeaderDimension,f=g.totalLevelDimension;if(0===C||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=C/a),this.m_rowEndHeaderWidth||(this.m_rowEndHeaderWidth=f,this.setElementWidth(e,this.m_rowEndHeaderWidth)),d){if(-1!==this.m_endRowEndHeader&&0!==a){var y=e.firstChild.childNodes[this.m_endRowEndHeader-this.m_startRowEndHeader];null!=y&&this.m_utils.removeCSSClassName(y,this.getMappedStyle("borderHorizontalNone"))}this.m_endRowEndHeader=i+(a-1),this.m_endRowEndHeaderPixel+=C}else n?(i<this.m_startRowEndHeader&&(this.m_startRowEndHeader=i,this.m_startRowEndHeaderPixel=Math.max(0,this.m_startRowEndHeaderPixel-C)),this.m_endRowEndHeader+=a,this.m_endRowEndHeaderPixel=Math.max(0,this.m_endRowEndHeaderPixel+C),this.pushRowHeadersDown(h,C)):(this.m_startRowEndHeader=Math.max(0,this.m_startRowEndHeader-a),this.m_startRowEndHeaderPixel-=C);if(-1===s&&(s=this.m_endRowEndHeader),!this._isCountUnknown("row")&&this._isHighWatermarkScrolling()&&this.m_endRowEndHeader+1>=s?this.m_stopRowEndHeaderFetch=!0:this.m_stopRowEndHeaderFetch=g.stopFetch,0===this.m_startRowEndHeader&&0!==this.m_startRowEndHeaderPixel&&(this._shiftHeadersAlongAxisInContainer(e.firstChild,0,-1*this.m_startRowEndHeaderPixel,"top",this.getMappedStyle("rowendheadercell")),this.m_endRowEndHeaderPixel-=this.m_startRowEndHeaderPixel,this.m_startRowEndHeaderPixel=0),!this.m_initialized&&this.m_startRowEndHeader>0){var E=Math.round(this.m_avgRowHeight*this.m_startRowEndHeader);this._shiftHeadersAlongAxisInContainer(e.firstChild,this.m_startRowEndHeader,E-this.m_startRowEndHeaderPixel,"top",this.getMappedStyle("rowendheadercell")),this.m_endRowEndHeaderPixel=E+C,this.m_startRowEndHeaderPixel=E}},z.prototype.buildAxisHeaders=function(e,t,i,s,n,o,l,r,a,h,d,m,c,u){var _,p,g=-1!==i.indexOf("column"),C=g?"height":"width",f=!1,y=0,E=0,v=0,w=0;let H=0;if(!u){if(0===n&&this._isCountUnknown(i))return{totalHeaderDimension:y,totalLevelDimension:E,stopFetch:f=!0};_=e.firstChild,-1===h&&""===e.className&&(e.className=m,e.style[C]="",_.style[C]="")}for(var x=this.getRendererOrTemplate(i),S=document.createDocumentFragment(),b=0;n-b>0;){o||l?(p=s+b,v=g?a+y:0,w=g?0:a+y):(p=s+(n-1-b),v=g?a-y:0,w=g?0:a-y),this.isHidden(i,p)&&(H+=1);var R=this.buildLevelHeaders(S,p,0,v,w,o,l,x,t,i,c,d);b+=R.count,y+=R.totalHeaderDimension,R.totalLevelDimension>E&&(E=R.totalLevelDimension)}return u?S:(o?_.appendChild(S):l?_.insertBefore(S,r):_.insertBefore(S,_.firstChild),e.hasChildNodes()||l||e.appendChild(_),this.m_subtreeAttachedCallback(_),{totalHeaderDimension:y,totalLevelDimension:E,stopFetch:f,visibleHeaderCount:n-H})},z.prototype._renderContent=function(e,t,i,s,n){if(null!=e&&"function"==typeof e)u.applyRendererContent(i,e.call(this,t),!1,this.m_isCustomElementCallback()?null:this.m_subtreeAttachedCallback),this._removeFocusFromChildElements(t,i);else if(null!=e&&"object"==typeof e&&this.m_engine){for(var o=this.m_engine.execute(this.m_root,e,n,null),l=0;l<o.length;l++)i.appendChild(o[l]);this._removeFocusFromChildElements(t,i)}else null!=s&&"object"==typeof s&&Object.prototype.hasOwnProperty.call(s,"data")&&(s=s.data),null==s&&(s=""),i.appendChild(document.createTextNode(s.toString()))},z.prototype._removeFocusFromChildElements=function(e,t){if("edit"!==e.mode){var i=this;this._signalTaskStart(),this.m_contextCallback(t).getBusyContext().whenReady().then(function(){u.disableAllFocusableElements(t),i._signalTaskEnd()})}},z.prototype.buildLevelHeaders=function(e,t,i,s,n,o,l,r,a,h,d,m){var c,_,p,g,C,f,y,E,v,w,H,x,S,b,R,I=0,M=0,F=0,z=0;let A;"row"===h?(c="row",_=this.m_rowHeader,p="width",g=this.m_rowHeaderLevelWidths,C="height",f="top",y=n,E=this.getResources().isRTLMode()?"right":"left",v=s,w=this.m_startRowHeader,H=this.m_endRowHeader,this._hasFrozenRows()&&t<=this.m_frozenRowIndex&&this.m_rowHeaderFrozen&&(_=this.m_rowHeaderFrozen)):"rowEnd"===h?(c="row",_=this.m_rowEndHeader,p="width",g=this.m_rowEndHeaderLevelWidths,C="height",f="top",y=n,E=this.getResources().isRTLMode()?"left":"right",v=s,w=this.m_startRowEndHeader,H=this.m_endRowEndHeader,this._hasFrozenRows()&&t<=this.m_frozenRowIndex&&this.m_rowEndHeaderFrozen&&(_=this.m_rowEndHeaderFrozen)):"column"===h?(c="column",_=this.m_colHeader,p="height",g=this.m_columnHeaderLevelHeights,C="width",f=this.getResources().isRTLMode()?"right":"left",y=s,E="top",v=n,w=this.m_startColHeader,H=this.m_endColHeader,this._hasFrozenColumns()&&t<=this.m_frozenColIndex&&this.m_colHeaderFrozen&&(_=this.m_colHeaderFrozen),A=this.isHidden(h,t)):(c="column",_=this.m_colEndHeader,p="height",g=this.m_columnEndHeaderLevelHeights,C="width",f=this.getResources().isRTLMode()?"right":"left",y=s,E="bottom",v=n,w=this.m_startColEndHeader,H=this.m_endColEndHeader,this._hasFrozenColumns()&&t<=this.m_frozenColIndex&&this.m_colEndHeaderFrozen&&(_=this.m_colEndHeaderFrozen),A=this.isHidden(h,t));var D=a.getExtent(t,i),L=D.extent,T=D.more.before,N=D.more.after,O=a.getDepth(t,i);let k;if(T&&t===H+1){for(x=this._getHeaderContainer(t-1,i,0,null,_,m),this._setAttribute(x,"extent",this._getAttribute(x,"extent",!0)+L),k=(S=x.firstChild)[this.getResources().getMappedAttribute("context")],k.extent+=L,I=this.getElementDir(S,p),b=0;b<L;)y+=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(x,t+b,i+O,y,v+I,o,l,r,a,h,d,m):this.buildLevelHeaders(x,t+b,i+O,v+I,y,o,l,r,a,h,d,m)).totalHeaderDimension,F+=R.totalHeaderDimension,z+=R.count,b+=R.count;this.setElementDir(S,this.getElementDir(S,C)+F,C),"none"===S.style.display&&0!==F&&(S.style.display="",this.deleteAndApplyHiddenIndicators())}else if(N&&t===w-1){for(x=this._getHeaderContainer(t+1,i,0,null,_,m),this._setAttribute(x,"extent",this._getAttribute(x,"extent",!0)+L),this._setAttribute(x,"start",this._getAttribute(x,"start",!0)-L),k=(S=x.firstChild)[this.getResources().getMappedAttribute("context")],k.extent+=L,k.index-=L,I=this.getElementDir(S,p),b=0;b<L;)y-=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(x,t-b,i+O,y,v+I,o,l,r,a,h,d,m):this.buildLevelHeaders(x,t-b,i+O,v+I,y,o,l,r,a,h,d,m)).totalHeaderDimension,F+=R.totalHeaderDimension,z+=R.count,b+=R.count;this.setElementDir(S,this.getElementDir(S,C)+F,C),"none"===S.style.display&&0!==F&&(S.style.display="",this.deleteAndApplyHiddenIndicators()),this.setElementDir(S,y,f)}else{var P=a.getData(t,i),B=a.getMetadata(t,i);S=document.createElement("div"),k=this.createHeaderContext(h,t,P,B,S,i,L,O),S.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),S.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(S),S[this.getResources().getMappedAttribute("context")]=k,S[this.getResources().getMappedAttribute("metadata")]=B,S.extentInfo=D;var W=this.m_options.getInlineStyle(h,k),j=this.m_options.getStyleClass(h,k);null!=W&&u.applyMergedInlineStyles(S,W,""),S.className=d,S.className+=" "+this.getMappedStyle("depth")+O,null!=j&&(S.className+=" "+j),this.setElementDir(S,v,E),this.setElementDir(S,y,f);var K=this._getHeaderDimensions(S,C,p,g,i,c,k.key,O);I=K[p],this.setElementDir(S,I,p);var U=K[C];if(this._setAttribute(S,"depth",O),i!==m-1&&((x=document.createElement("div")).className=this.getMappedStyle("groupingcontainer"),x.appendChild(S),this._setAttribute(x,"start",o||l?t:t-L+1),this._setAttribute(x,"extent",L),this._setAttribute(x,"level",i)),i+O===m)A&&(U=0,S.style.display="none"),this.setElementDir(S,U,C),F+=U,z+=1,M=I,o||l||(y-=U,this.setElementDir(S,y,f));else{for(b=0;b<L;b++){var V=o||l?t+b:t-b;U=(R="column"===h||"columnEnd"===h?this.buildLevelHeaders(x,V,i+O,y,v+I,o,l,r,a,h,d,m):this.buildLevelHeaders(x,V,i+O,v+I,y,o,l,r,a,h,d,m)).totalHeaderDimension,y=o||l?y+U:y-U,F+=U,z+=R.count,b+=R.count-1}M=I,R&&!isNaN(R.totalLevelDimension)&&(M+=R.totalLevelDimension),o||l||this.setElementDir(S,y,f),this.setElementDir(S,F,C),this.isHeaderHidden(S)&&(S.style.display="none")}if("columnEnd"===h&&this.m_addBorderBottom&&this.m_utils.addCSSClassName(S,this.getMappedStyle("borderHorizontalSmall")),"rowEnd"===h&&this.m_addBorderRight&&this.m_utils.addCSSClassName(S,this.getMappedStyle("borderVerticalSmall")),this._isHeaderResizeEnabled(h,k)&&this._setAttribute(S,"resizable","true"),this.m_isCustomElementCallback()||(null!=x?this.m_root.appendChild(x):this.m_root.appendChild(S)),this._renderContent(r,k,S,P,this.buildHeaderTemplateContext(k,B)),("column"===h||this._isDataGridProvider())&&this._isSortEnabled(h,k)){null!=B.sortDirection&&null==this.m_sortInfo&&(this.m_sortInfo={},this.m_sortInfo.key=B.key,this.m_sortInfo.direction=B.sortDirection,this.m_sortInfo.axis=h);var Y=this._buildSortIcon(k,S,h);S.appendChild(Y),this._setAttribute(S,"sortable","true")}if(this._isRequired(k)){var G=document.createElement("span");this.m_utils.addCSSClassName(G,this.getMappedStyle("iconContainer")),this.m_utils.addCSSClassName(G,this.getMappedStyle("requiredIcon")),G.setAttribute("title",this.getResources().getTranslatedText("tooltipRequired")),S.appendChild(G)}if(this._isParentNode(k)){const e=this._buildDisclosureIcon(k);this._isHierarchicalGroup(k)?this.m_utils.addCSSClassName(S,this.getMappedStyle("hierarchicalGroup")):this.m_utils.addCSSClassName(S,this.getMappedStyle("hierarchicalTree")),S.prepend(e);const t=this._buildSpacer(k);S.prepend(t)}else if(this._isLeafNode(k)){this.m_utils.addCSSClassName(S,this.getMappedStyle("hierarchical"));const e=this._buildSpacer(k);S.prepend(e)}o||l?null!=x?e.appendChild(x):e.appendChild(S):null!=x?e.firstChild?this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("groupingcontainer"))?e.insertBefore(x,e.firstChild):(this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("headercell"))||this.m_utils.containsCSSClassName(e.firstChild,this.getMappedStyle("endheadercell")))&&e.insertBefore(x,e.firstChild.nextSibling):e.appendChild(x):this.m_utils.containsCSSClassName(e,this.getMappedStyle("groupingcontainer"))?e.insertBefore(S,e.firstChild.nextSibling):e.insertBefore(S,e.firstChild)}return"column"===h||"columnEnd"===h?this._isLastColumn(t+(L-1))&&this.m_utils.addCSSClassName(S,this.getMappedStyle("borderVerticalNone")):this._isLastRow(t+(L-1))&&!l&&this.m_utils.addCSSClassName(S,this.getMappedStyle("borderHorizontalNone")),{totalLevelDimension:M,totalHeaderDimension:F,count:z}},z.prototype._getHeaderDimensions=function(e,t,i,s,n,o,l,r){for(var a={},h=0,d=0;d<r;d++){var m=s[n+d];if(null==m){h=null;break}h+=m}null==h?a=this._computeElementWidthAndHeight(e):a[i]=h,1===r&&(s[n]=a[i]);var c=this.m_sizingManager.getSize(o,l);if(null!=c)return a[t]=c,a;if(""!==e.style[t])return null==a[t]&&(a[t]=this.getElementDir(e,t)),this.m_sizingManager.setSize(o,l,a[t]),a;var u=e.className;return null==a[t]&&(a[t]=this.m_styleClassDimensionMap[t][u],null==a[t]&&(a[t]=this.getElementDir(e,t))),this.m_sizingManager.setSize(o,l,a[t]),this.m_styleClassDimensionMap[t][u]=a[t],a},z.prototype._getHeaderLevelDimension=function(e,t,i,s,n){for(var o=0,l=0;l<n;l++){var r=i[e+l];if(null==r){o=null;break}o+=r}return null!=o||(o=this.getElementDir(t,s),1===n&&(i[e]=o)),o},z.prototype._getHeaderContainer=function(e,t,i,s,n,o){var l;if(null==s?(s=Array.from(this._getAllNonSkeletonContainerNodes(n.firstChild)).filter(e=>!e.classList.contains(this.getMappedStyle("headerHiddenIndicator"))),l=0):l=1,i===o-1)return s[0].parentNode;for(;l<s.length;l++){var r=this._getAttribute(s[l],"start",!0),a=this._getAttribute(s[l],"extent",!0),h=this._getAttribute(s[l].firstChild,"depth",!0);if(e>=r&&e<r+a)return t<i+h?s[l]:this._getHeaderContainer(e,t,i+h,s[l].childNodes,n,o)}return null},z.prototype._getChildElementCountByClassName=function(e,t){if(null==e)return 0;let i=0;return t&&(i+=Array.from(e.children).filter(e=>this.m_utils.containsCSSClassName(e,t)).length),i},z.prototype._getHeaderPreviousSibling=function(e){if(!e||!e.previousSibling)return null;const t=this.getMappedStyle("headercell"),i=this.getMappedStyle("endheadercell"),s=this.getMappedStyle("groupingcontainer"),n=e.previousSibling;return n.classList.contains(t)||n.classList.contains(i)||n.classList.contains(s)?n:this._getHeaderPreviousSibling(n)},z.prototype._getHeaderLastChild=function(e){let t=e.lastChild;const i=this.getMappedStyle("headercell"),s=this.getMappedStyle("endheadercell"),n=this.getMappedStyle("groupingcontainer");if(!t)return null;for(;t&&!(t.classList.contains(i)||t.classList.contains(s)||t.classList.contains(n));)t=t.previousSibling;return t},z.prototype._getHeaderCellByIndex=function(e,t,i){let s,n,o,l;return"column"===t||"columnEnd"===t?(n="column"===t?this.m_columnHeaderLevelCount:this.m_columnEndHeaderLevelCount,this._hasFrozenColumns()&&e<=this.m_frozenColIndex?s="column"===t?this.m_colHeaderFrozen:this.m_colEndHeaderFrozen:(s="column"===t?this.m_colHeader:this.m_colEndHeader,e-=this._hasFrozenColumns()&&e>this.m_frozenColIndex&&1===n?this.m_frozenColIndex+1:0),o="column"===t?this.m_startColHeader:this.m_startColEndHeader):"row"!==t&&"rowEnd"!==t||(n="row"===t?this.m_rowHeaderLevelCount:this.m_rowEndHeaderLevelCount,this._hasFrozenRows()&&e<=this.m_frozenRowIndex?s="row"===t?this.m_rowHeaderFrozen:this.m_rowEndHeaderFrozen:(s="row"===t?this.m_rowHeader:this.m_rowEndHeader,e-=this._hasFrozenRows()&&e>this.m_frozenRowIndex&&1===n?this.m_frozenRowIndex+1:0),o="row"===t?this.m_startRowHeader:this.m_startRowEndHeader),l=this._getHeaderByIndex(e,i,s,n,o),l},z.prototype._getHeaderCellsByIndex=function(e,t){let i,s,n,o=[];return"column"===t||"columnEnd"===t?(s="column"===t?this.m_columnHeaderLevelCount:this.m_columnEndHeaderLevelCount,this._hasFrozenColumns()&&e<=this.m_frozenColIndex?i="column"===t?this.m_colHeaderFrozen:this.m_colEndHeaderFrozen:(i="column"===t?this.m_colHeader:this.m_colEndHeader,e-=this._hasFrozenColumns()&&e>this.m_frozenColIndex&&1===s?this.m_frozenColIndex+1:0),n="column"===t?this.m_startColHeader:this.m_startColEndHeader):"row"!==t&&"rowEnd"!==t||(s="row"===t?this.m_rowHeaderLevelCount:this.m_rowEndHeaderLevelCount,this._hasFrozenRows()&&e<=this.m_frozenRowIndex?i="row"===t?this.m_rowHeaderFrozen:this.m_rowEndHeaderFrozen:(i="row"===t?this.m_rowHeader:this.m_rowEndHeader,e-=this._hasFrozenRows()&&e>this.m_frozenRowIndex&&1===s?this.m_frozenRowIndex+1:0),n="row"===t?this.m_startRowHeader:this.m_startRowEndHeader),o=this._getHeadersByIndex(e,i,s,n),o},z.prototype._getHeaderByIndex=function(e,t,i,s,n){var o;if(t<0)return null;if(1===s){return Array.from(this._getAllNonSkeletonContainerNodes(i.firstChild)).filter(e=>!e.classList.contains(this.getMappedStyle("headerHiddenIndicator")))[o=e-n]}var l=this._getHeaderContainer(e,t,0,null,i,s);return null==l?null:t<=this._getAttribute(l,"level",!0)+this._getAttribute(l.firstChild,"depth",!0)-1?l.firstChild:(o=e-this._getAttribute(l,"start",!0)+1,l.childNodes[o])},z.prototype._getHeadersByIndex=function(e,t,i,s){let n=[],o=1;for(let l=i-1;l>=0;l-=o){let r=this._getHeaderByIndex(e,l,t,i,s);r&&(o=this.getHeaderCellDepth(r),n.push(r))}return n},z.prototype._getAttribute=function(e,t,i){var s=e.getAttribute(this.getResources().getMappedAttribute(t));return i?parseInt(s,10):s},z.prototype._setAttribute=function(e,t,i){e.setAttribute(this.getResources().getMappedAttribute(t),i)},z.prototype.buildDatabody=function(e){let t=this._createDatabodyElement("databody");this.m_databody=t;const i=this.m_frozenRowIndex,s=this.m_frozenColIndex;let n,o,l;if(null!==i&&null!==s&&(l=this._createDatabodyElement("databodyFrozenCorner"),this.m_databodyFrozenCorner=l),null!==s&&(n=this._createDatabodyElement("databodyFrozenCol"),this.m_databodyFrozenCol=n),null!==i&&(o=this._createDatabodyElement("databodyFrozenRow"),this.m_databodyFrozenRow=o),!e)if(t.addEventListener?t.addEventListener("scroll",this.handleScroll.bind(this),!1):t.attachEvent("onscroll",this.handleScroll.bind(this)),this._isHighWatermarkScrolling()){this.fetchCells(t,0,0)}else{var r=this,a=this.m_options.getScrollPosition();this._getIndexesFromScrollPosition(a).then(function(e){var n=e.row,o=e.column;let l=null,a=null;r.m_startRow=n,r.m_startCol=o,r.m_fetching.cells=!1,null===s&&null===i||(null!==s&&(l=r.getFetchSize("column")+o,o=0),null!==i&&(a=r.getFetchSize("row")+n,n=0)),r.fetchCells(t,n,o,a,l)}),this.m_fetching.cells=!0}let h=[];return h.push(t),n&&h.push(n),o&&h.push(o),l&&h.push(l),h},z.prototype._createDatabodyElement=function(e){var t=document.createElement("div");t.id=this.createSubId(e),t.className=this.getMappedStyle(e)+" "+this.getMappedStyle("scrollbarForce"),t.tabIndex="-1";var i=document.createElement("div");return i.className=this.getMappedStyle("scroller")+(this.m_utils.isTouchDeviceNotIOS()?" "+this.getMappedStyle("scroller-mobile"):""),t.appendChild(i),t},z.prototype._getIndexFromKeyPromise=function(e,t){var i=this;return new Promise(function(s){null!=e||null!=t?i._indexes({row:e,column:t},function(e){s({rowIndexFromKey:e.row,columnIndexFromKey:e.column})}):s({rowIndexFromKey:null,columnIndexFromKey:null})})},z.prototype._getIndexesFromScrollPosition=function(e){var t=this,i=e.rowKey,s=e.columnKey;return this._getIndexFromKeyPromise(i,s).then(function(i){var s={};return null!=i.rowIndexFromKey&&i.rowIndexFromKey>0?s.row=i.rowIndexFromKey:null!=e.rowIndex?s.row=e.rowIndex:null!=e.y?s.row=Math.round(e.y/t.getDefaultRowHeight()):s.row=0,null!=i.columnIndexFromKey&&i.columnIndexFromKey>0?s.column=i.columnIndexFromKey:null!=e.columnIndex?s.column=e.columnIndex:null!=e.x?s.column=Math.round(e.x/t.getDefaultColumnWidth()):s.column=0,s})},z.prototype.getFetchCount=function(e,t){var i=this.getFetchSize(e);if(this._isHighWatermarkScrolling()){var s="row"===e?"maxRowCount":"maxColumnCount",n=this.m_options.getScrollPolicyOptions();n&&null!=n[s]&&n[s]>0&&(i=Math.max(Math.min(i,n[s]-t),0))}return i},z.prototype.fetchCells=function(e,t,i,s,n,o){var l;if(!this.m_fetching.cells){null==s&&(s=this.getFetchCount("row",t)),null==n&&(n=this.getFetchCount("column",i));var r={axis:"row",start:t,count:s},a={axis:"column",start:i,count:n,databody:e};this.m_fetching.cells={rowRange:r,columnRange:a},l=null!=o&&null!=o.success?o.success:this.handleCellsFetchSuccess,this.isSkeletonSupport()||this.showStatusText(!this.isSkeletonSupport()),this._signalTaskStart(),this.getDataSource().fetchCells([r,a],{success:l,error:this.handleCellsFetchError},{success:this,error:this})}},z.prototype.isCellFetchResponseValid=function(e){if(null==this.m_fetching)return!1;var t=e[0],i=e[1],s=this.m_fetching.cells;return t===s.rowRange&&i===s.columnRange},z.prototype.isLongScroll=function(){return this.m_isLongScroll},z.prototype.isCellFetchResponseInViewport=function(e,t){if(isNaN(this.m_avgRowHeight)||isNaN(this.m_avgColWidth)||null!=this.m_empty||!this.m_initialized)return!0;var i=t[0].start,s=t[1].start,n=this._getLongScrollStart(this.m_currentScrollTop,this.m_prevScrollTop,"row"),o=this._getLongScrollStart(this.m_currentScrollLeft,this.m_prevScrollLeft,"column");return n.start===i&&o.start===s},z.prototype.handleCellsFetchSuccess=function(e,t,i){var s=this.m_options.getScrollPolicyOptions(),n=s?s.maxRowCount:null,o=s?s.maxColumnCount:null,l=this.getDataSource().getCount("row"),r=this.getDataSource().getCount("column");if(void 0===i){if(i=!1,!this.isCellFetchResponseValid(t))return void this._signalTaskEnd();if(this.isLongScroll()&&(!this.isCellFetchResponseInViewport(e,t)||this.m_headerInvalid))return this.m_fetching.cells=!1,this.m_headerInvalid=!1,this.handleLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop),void this._signalTaskEnd();this.m_isLongScroll=!1,this.m_longScrollRow=null,this.m_longScrollColumn=null,this.m_longScrollRowPixel=null,this.m_longScrollColumnPixel=null}var a=t[0],h=a.start,d=e.getCount("row"),m=d>0&&(h>this.m_endRow||h+d<=this.m_startRow);let c=this.m_frozenRowIndex;this.m_initialized&&this._hasFrozenRows()&&h<c&&this.m_rowHeaderFrozen&&(h=c+1),(0===d&&this._isCountUnknown("row")&&a.count>0||m&&this._isHighWatermarkScrolling()&&!this._isCountUnknown("row")&&this.m_endRow+d+1>=l||d<a.count||this._isHighWatermarkScrolling()&&n&&n>0&&h+d===n)&&(this.m_stopRowFetch=!0);var u=t[1],_=u.start,p=e.getCount("column");let g=this.m_frozenColIndex;this.m_initialized&&this._hasFrozenColumns()&&_<g&&this.m_colHeaderFrozen&&(_=g+1);var C=p>0&&(_>this.m_endCol||_+p===this.m_startCol);(0===p&&this._isCountUnknown("column")&&u.count>0||C&&this._isHighWatermarkScrolling()&&!this._isCountUnknown("column")&&this.m_endCol+p+1>=r||p<u.count||this._isHighWatermarkScrolling()&&o&&o>0&&_+p===o)&&(this.m_stopColumnFetch=!0);var f=this.m_databody;null==f&&(f=u.databody);var y,E,v,w,H,x,S,b,R,I,M=f.firstChild;if(m||i){if(y=!(i||!(h>=this.m_startRow)))E=this.m_endRowPixel;else if(i){var F=this._getCellByIndex({row:h+d,column:this.m_startCol});E=this.getElementDir(F,"top")}else E=this.m_startRowPixel;v=_>=this.m_startCol?this.m_startColPixel:this.m_endColPixel;let t=_,s=h,n=d,o=p;!1===this.m_initialized?(this._hasFrozenRows()&&this._hasFrozenColumns()&&null!==this.m_colHeaderFrozen&&null!==this.m_rowHeaderFrozen&&(H=this._populateFrozenContainer(this.m_databodyFrozenCorner.firstChild,e,h,E,_,v,c+1,g+1),_=g+1,h=c+1,d=n-(c+1),0===(p=o-(g+1))&&(this.m_endRowPixel+=H.totalRowHeight)),this._hasFrozenRows()&&null!==this.m_rowHeaderFrozen&&(H=this._populateFrozenContainer(this.m_databodyFrozenRow.firstChild,e,s,E,_,v,c+1,p),d=n-(c+1),h=c+1),this._hasFrozenColumns()&&null!==this.m_colHeaderFrozen&&(H=this._populateFrozenContainer(this.m_databodyFrozenCol.firstChild,e,h,E,t,v,d,g+1),_=g+1,0===(p=o-(g+1))&&(this.m_endRowPixel+=H.totalRowHeight))):this._hasFrozenColumns()&&null!==this.m_colHeaderFrozen&&this.m_databodyFrozenCol.firstChild.childElementCount&&(H=this._populateFrozenContainer(this.m_databodyFrozenCol.firstChild,e,h,E,this.m_startCol,v,d,g+1),0===(p=o-(g+1))&&(this.m_endRowPixel+=H.totalRowHeight)),w=document.createDocumentFragment(),x=(H=this._addCellsToFragment(w,e,h,E,_,v,d,p)).totalColumnWidth,S=H.totalRowHeight,b=H.avgWidth,R=S/d,this._populateDatabody(M,w),y?(-1!==this.m_endRow&&0!==d&&this._highlightCellsAlongAxis(this.m_endRow,"row","index","remove",["borderHorizontalNone"]),this.m_endRow=h+(d-1),this.m_endRowPixel+=S):i?(h<this.m_startRow&&(this.m_startRow=h,this.m_startRowPixel=Math.max(0,this.m_startRowPixel-S)),this.m_endRow+=d,this.m_endRowPixel+=S,this.pushRowsDown(h+d,S)):(this.m_startRow-=d,this.m_startRowPixel-=S)}else if(C){if(v=(y=_>=this.m_startCol)?this.m_endColPixel:this.m_startColPixel,E=h>=this.m_startRow?this.m_startRowPixel:this.m_endRowPixel,!this.m_databody.firstChild.childElementCount&&y&&this._hasFrozenRows()&&this.m_initialized){const e=this.getResources().isRTLMode()?"right":"left",t=this.m_databodyFrozenRow.firstChild.lastChild;v=this.getElementDir(t,e)+this.getElementWidth(t)}this._hasFrozenRows()&&null!==this.m_rowHeaderFrozen&&(this._populateFrozenContainer(this.m_databodyFrozenRow.firstChild,e,this.m_startRow,E,_,v,c+1,p),d-=c+1,h=c+1),w=document.createDocumentFragment(),H=this._addCellsToFragment(w,e,h,E,_,v,d,p),this._populateDatabody(M,w),x=H.totalColumnWidth}if(null==b||0!==this.m_avgColWidth&&null!=this.m_avgColWidth||(this.m_avgColWidth=b),null==R||0!==this.m_avgRowHeight&&null!=this.m_avgRowHeight||(this.m_avgRowHeight=R),C&&(_<this.m_startCol?(this.m_startCol-=p,this.m_startColPixel-=x):(this.m_endCol=_+(p-1),this.m_endColPixel+=x)),this._sizeDatabodyScroller(),this.m_endCol>=0&&this.m_endRow>=0?this.m_hasCells=!0:(this.m_startCol=0,this.m_startRow=0),0===this.m_startCol&&0!==this.m_startColPixel&&(this._shiftCellsAlongAxis("column",-this.m_startColPixel,0,!0),this.m_endColPixel-=this.m_startColPixel,this.m_startColPixel=0),0===this.m_startRow&&0!==this.m_startRowPixel&&(this._shiftCellsAlongAxis("row",-this.m_startRowPixel,0,!0),this.m_endRowPixel-=this.m_startRowPixel,this.m_startRowPixel=0),!this.m_initialized&&this.m_startCol>0&&(I=Math.round(this.m_avgColWidth*this.m_startCol),this._shiftCellsAlongAxis("column",I-this.m_startColPixel,this.m_startCol,!0),this.m_endColPixel=I+x,this.m_startColPixel=I),!this.m_initialized&&this.m_startRow>0&&(I=Math.round(this.m_avgRowHeight*this.m_startRow),this._shiftCellsAlongAxis("row",I-this.m_startRowPixel,this.m_startRow,!0),this.m_endRowPixel=I+S,this.m_startRowPixel=I),this.m_fetching.cells=!1,this.isFetchComplete()){if(this.hideStatusText(),this.m_initialized)this._checkScroll&&this._checkScrollPosition();else{if(this.m_utils.isTouchDeviceNotIOS()&&Object.prototype.hasOwnProperty.call(window,"WebKitCSSMatrix")){const e="translate3d(0, 0, 0)";M.style.transform=e,null!=this.m_rowHeader&&(this.m_rowHeader.firstChild.style.transform=e),null!=this.m_colHeader&&(this.m_colHeader.firstChild.style.transform=e),null!=this.m_rowEndHeader&&(this.m_rowEndHeader.firstChild.style.transform=e),null!=this.m_colEndHeader&&(this.m_colEndHeader.firstChild.style.transform=e)}this._updateScrollPosition(this.m_options.getScrollPosition())}if(null!=this.m_scrollIndexAfterFetch?this.scrollToIndex(this.m_scrollIndexAfterFetch):null!=this.m_scrollHeaderAfterFetch?this.scrollToHeader(this.m_scrollHeaderAfterFetch):this.isActionableMode()||null==this._getActiveElement()||this.m_utils.containsCSSClassName(this._getActiveElement(),this.getMappedStyle("focus"))||(!0!==this.m_shouldFocus&&(this.m_shouldFocus=!1),this._highlightActive(),this._manageMoveCursor()),this._isSelectionEnabled()&&this.applySelection(h,h+d,_,_+p),this.populateAccInfo(),this._shouldInitialize())this._handleInitialization(!0);else if(this.m_initialized){var z;(!0===this.m_resizeRequired||this.m_endRowPixel-S<this.getElementHeight(f))&&this.resizeGrid(),m?y?z="top":i||(z="bottom"):C&&(z=_===this.m_startCol?"right":"left"),this._cleanupViewport(z),this.fillViewport(),this.isFetchComplete()&&this.fireEvent("ready",{})}}this._isSelectionEnabled()&&this.isMultipleSelection()&&this._resetHeaderHighLight();let A=this.getActiveDatabodyIndicators();this.deleteAndApplyHiddenIndicators(A),this._signalTaskEnd()},z.prototype._setZIndexBefore=function(e,t,i,s){if("row"===e)for(var n=this.m_startRow,o=this.m_currentScrollTop,l=this.m_rowHeader,r=this.m_rowHeaderLevelCount,a=this.m_startRowHeader,h=this.m_rowEndHeader,d=this.m_rowEndHeaderLevelCount,m=this.m_startRowEndHeader,c=t;c>=n;c--){var u,_=this._getAxisCellsByIndex(c,e);if(this.getElementDir(_[0],"top")<o)break;for(var p=0;p<_.length;p++)this.changeStyleProperty(_[p],this.getCssSupport("z-index"),10);i&&(u=this._getHeaderByIndex(c,0,l,r,a),this.changeStyleProperty(u,this.getCssSupport("z-index"),10)),s&&(u=this._getHeaderByIndex(c,0,h,d,m),this.changeStyleProperty(u,this.getCssSupport("z-index"),10))}},z.prototype._onEndEvent=function(e,t,i,s){var n;function o(){n&&(clearTimeout(n),n=void 0),t.removeEventListener(e,o),i()}t.addEventListener(e,o),n=setTimeout(o,s+100)},z.prototype._insertRowsWithAnimation=function(e,t,i,s,n,o,l,r){var a,h,d,m,c,u,_,p,g,C,f=this,y=0,E=0,v=0;f._signalTaskStart();var w=s>this.m_endRow,H=this.m_databody.firstChild,x=null!=t,S=null!=i;for(s>0&&(v=s-1,C=this._getAxisCellsByIndex(s-1,"row"),y=(E=this.getElementDir(C[0],"top"))+this.getElementHeight(C[0])),this._setZIndexBefore("row",v,x,S),x&&(d=(h=this.m_rowHeader.firstChild).childNodes[s-this.m_startRow-1]),S&&(c=(m=this.m_rowEndHeader.firstChild).childNodes[s-this.m_startRow-1]),a=0;a<e.childNodes.length;a++){var b=e.childNodes[a];p=E-(_=y+this.getElementDir(b,"top"))-this.getElementHeight(b),this.setElementDir(b,_,"top"),this.addTransformMoveStyle(b,0,0,"linear",0,p,0)}if(x)for(a=0;a<t.childNodes.length;a++)u=t.childNodes[a],p=E-(_=y+this.getElementDir(u,"top"))-this.getElementHeight(u),this.setElementDir(u,_,"top"),this.addTransformMoveStyle(u,0,0,"linear",0,p,0);if(S)for(a=0;a<i.childNodes.length;a++)g=i.childNodes[a],p=E-(_=y+this.getElementDir(g,"top"))-this.getElementHeight(g),this.setElementDir(g,_,"top"),this.addTransformMoveStyle(g,0,0,"linear",0,p,0);for(a=s;a<=this.m_endRow;a++){var R=this._getAxisCellsByIndex(a-this.m_startRow,"row");_=o+this.getElementDir(R[0],"top"),p=-o;for(var I=0;I<R.length;I++)this.setElementDir(R[I],_,"top"),this.addTransformMoveStyle(R[I],0,0,"linear",0,p,0);x&&(u=h.childNodes[a],this.setElementDir(u,_,"top"),this.addTransformMoveStyle(u,0,0,"linear",0,p,0)),S&&(g=m.childNodes[a],this.setElementDir(g,_,"top"),this.addTransformMoveStyle(g,0,0,"linear",0,p,0))}this._modifyAxisCellContextIndex("row",s,this.m_endRow-s+1,n),this.m_endRow+=n,this.m_endRowPixel+=o,x&&(this.m_endRowHeader+=t.childNodes.length,this.m_endRowHeaderPixel+=o),S&&(this.m_endRowEndHeader+=i.childNodes.length,this.m_endRowEndHeaderPixel+=o),H.appendChild(e),w?(x&&h.appendChild(t),S&&m.appendChild(i)):(x&&h.insertBefore(t,d.nextSibling),S&&m.insertBefore(i,c.nextSibling)),this.setElementHeight(H,this.getElementHeight(H)+o),this.resizeGrid(),this.updateRowBanding(),this._refreshDatabodyMap(),this._isSelectionEnabled()&&this.applySelection(s,s+n,l,l+r);var M=this._getCellByIndex(this.createIndex(s+(n-1),this.m_endCol));this.m_animating=!0;var F=f.m_processingEventQueue?1:z.EXPAND_ANIMATION_DURATION;this._onEndEvent("transitionend",M,function(){f._handleAnimationEnd()},F),setTimeout(function(){for(var e=z.EXPAND_ANIMATION_DURATION,t="ease-out",i=s;i<=f.m_endRow;i++){for(var n=f._getAxisCellsByIndex(i,"row"),o=0;o<n.length;o++)f.addTransformMoveStyle(n[o],e+"ms",0,t,0,0,0);x&&f.addTransformMoveStyle(h.childNodes[i],e+"ms",0,t,0,0,0),S&&f.addTransformMoveStyle(m.childNodes[i],e+"ms",0,t,0,0,0)}},0)},z.prototype._addCellsToFragment=function(e,t,i,s,n,o,l,r){var a=this.getResources().isRTLMode()?"right":"left";let h=0;var d=this.getRendererOrTemplate("cell"),m=this.m_options.getColumnBandingInterval(),c=this.m_options.getRowBandingInterval(),_=this.m_options.getHorizontalGridlines(),p=this.m_options.getVerticalGridlines();null==l&&(l=t.getCount("row")),null==r&&(r=t.getCount("column"));for(var g=i>=this.m_startRow,C=n>=this.m_startCol,f=0,y=s,E=[],v=[],w=0;w<l;w+=1){for(var H,x,S,b,R=o,I=g?i+w:i+(l-1-w),M=Math.floor(I/c)%2==1,F=0;F<r;F+=x.column){var z=0;H=0;var A,D=C?n+F:n+(r-1-F);x={row:(A=t.getExtent?t.getExtent(this.createIndex(I,D)):{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}).row.extent,column:A.column.extent},C||(D=D-x.column+1);var L=g?I:I-x.row+1,T=this.createIndex(L,D);if(E[w]&&E[w][F])z=E[w][F].width,R=C?R+z:R-z;else{var N=this._patchExistingCells(A,D,L,E);if(N)z=N.width;else{var O=t.getData(this.createIndex(L,D)),k=t.getMetadata(this.createIndex(L,D));S=document.createElement("div"),b=this.createCellContext(T,O,k,S,x),S.setAttribute(this.getResources().getMappedAttribute("container"),this.getResources().widgetName),S.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),this._createUniqueId(S),S[this.getResources().getMappedAttribute("context")]=b,S[this.getResources().getMappedAttribute("metadata")]=k;var P=this.m_options.getInlineStyle("cell",b);null!=P&&u.applyMergedInlineStyles(S,P,""),""!==S.style.height&&(S.style.height=""),""!==S.style.width&&(S.style.width=""),this.m_utils.addCSSClassName(S,this.getMappedStyle("cell")),this.m_utils.addCSSClassName(S,this.getMappedStyle("formcontrol")),(this._hasFrozenColumns()&&D<=this.m_frozenColIndex||this._hasFrozenRows()&&L<=this.m_frozenRowIndex)&&this.m_utils.addCSSClassName(S,this.getMappedStyle("frozenCell")),u.isIos()&&(S.setAttribute("aria-labelledby",this.getLabelledBy(this._createActiveObject(S),null,S,!0)),S.setAttribute("role","text")),(M||Math.floor(D/m)%2==1)&&this.m_utils.addCSSClassName(S,this.getMappedStyle("banded"));var B,W=this.m_options.getStyleClass("cell",b);for(null!=W&&(S.className+=" "+W),B=0;B<x.row;B++){var j=0===B?b.keys.row:this._getKey(this._getHeaderByIndex(L+B,0,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),"row");v[w+B]=this._getCellDimension(S,L+B,j,"row","height"),H+=v[w+B]}for(this.setElementHeight(S,H),B=0;B<x.column;B++){var K=0===B?b.keys.column:this._getKey(this._getHeaderByIndex(D+B,0,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),"column");z+=this._getCellDimension(S,D,K,"column","width")}this.isHidden("column",D)&&(z=0,S.style.display="none",h+=1),this.setElementWidth(S,z),!S.classList.contains(this.getMappedStyle("frozenCell"))&&("hidden"===p||this._isLastColumn(D+(x.column-1))&&(this.getRowHeaderWidth()+R+z>=this.getWidth()||-1!==this.m_endRowEndHeader))&&this.m_utils.addCSSClassName(S,this.getMappedStyle("borderVerticalNone")),("hidden"===_||this._isLastRow(L+(x.row-1))&&(this.getRowBottom(S,y+H)>=this.getHeight()||-1!==this.m_endColEndHeader)&&!S.classList.contains(this.getMappedStyle("frozenCell")))&&this.m_utils.addCSSClassName(S,this.getMappedStyle("borderHorizontalNone")),g?this.setElementDir(S,y,"top"):this.setElementDir(S,y-H,"top"),C?this.setElementDir(S,R,a):this.setElementDir(S,R-z,a),this.m_isCustomElementCallback()&&this.m_root.appendChild(S),this._renderContent(d,b,S,O,this.buildCellTemplateContext(b,k)),e.appendChild(S)}this._updateTempArray(E,{width:z},w,F,x.row,x.column),R=C?R+z:R-z,0===w&&(f+=z)}}H=v[w],y=g?y+H:y-H,H}return{avgWidth:f/(r-h),totalRowHeight:v.reduce(function(e,t){return e+t},0),totalColumnWidth:f}},z.prototype._updateCellDimension=function(e,t,i,s,n,o,l,r){var a,h,d,m,c,u=0,_="width"===l?"height":"width",p=this._getCellByIndex(this.createIndex(s,i)),g=this.getElementDir(p,l),C=p[this.getResources().getMappedAttribute("context")];C.extents[o]+=e,"row"===o?(a=s,h=this.m_rowHeader,d=this.m_rowHeaderLevelCount,m=this.m_startRowHeader):(a=i,h=this.m_colHeader,d=this.m_columnHeaderLevelCount,m=this.m_startColHeader);for(var f=1;f<=e;f++){var y=this._getKey(this._getHeaderByIndex(r?a-f:a+f,0,h,d,m),o);u+=this._getCellDimension(p,r?a-f:a+f,y,o,l);for(var E=0;E<t;E++){var v,w;"row"===o?(v=r?s-f:s+f,w=i+E):(v=s+E,w=r?i-f:i+f),this._addIndexToDatabodyMap(this.createIndex(v,w),p.id)}}r&&(c="width"===l?this.getResources().isRTLMode()?"right":"left":"top",this.setElementDir(p,this.getElementDir(p,c)-u,c),C.indexes[o]-=e);this.setElementDir(p,g+u,l);var H={};return H[l]=u,H[_]=this.getElementDir(p,_),H.cell=p,H},z.prototype._patchExistingCells=function(e,t,i,s){var n=e.column.extent,o=e.row.extent,l=e.row.more.before,r=e.row.more.after,a=e.column.more.before,h=e.column.more.after;return t-1===this.m_endCol&&a?this._updateCellDimension(n,o,this.m_endCol,i,s,"column","width",!1):i-1===this.m_endRow&&l?this._updateCellDimension(o,n,t,this.m_endRow,s,"row","height",!1):t+n===this.m_startCol&&h?this._updateCellDimension(n,o,this.m_startCol,i,s,"column","width",!0):!(i+o!==this.m_startRow||!r)&&this._updateCellDimension(o,n,t,this.m_startRow,s,"row","height",!0)},z.prototype._updateTempArray=function(e,t,i,s,n,o){for(var l=0;l<n;l++){null==e[i+l]&&(e[i+l]=[]);for(var r=0;r<o;r++)e[i+l][s+r]=t}},z.prototype._getCellDimension=function(e,t,i,s,n){var o,l,r;if("row"===s?(o=this.getMappedStyle("rowheadercell")+" "+this.getMappedStyle("headercell"),l=this.m_endRowHeader):"column"===s&&(o=this.getMappedStyle("colheadercell")+" "+this.getMappedStyle("headercell"),l=this.m_endColHeader),-1===l){var a=this.createHeaderContext(s,t,null,{key:i},null,0,0,1),h=this.m_options.getInlineStyle(s,a),d=this.m_options.getStyleClass(s,a);r=document.createElement("div"),null!=h&&u.applyMergedInlineStyles(r,h,""),r.className=o+" "+d}else r=e;return this._getHeaderDimension(r,i,s,n)},z.prototype._getLabelDimension=function(e,t){let i,s,n,o,l;"column"===e?(i=this.m_columnHeaderLevelHeights,s="height",n=this.m_startColHeader,o=this.m_columnHeaderLevelCount,l=this.m_colHeader):"columnEnd"===e?(i=this.m_columnEndHeaderLevelHeights,s="height",n=this.m_startColEndHeader,o=this.m_columnEndHeaderLevelCount,l=this.m_colEndHeader):"row"===e?(i=this.m_rowHeaderLevelWidths,s="width",n=this.m_startRowHeader,o=this.m_rowHeaderLevelCount,l=this.m_rowHeader):(i=this.m_rowEndHeaderLevelWidths,s="width",n=this.m_startRowEndHeader,o=this.m_rowEndHeaderLevelCount,l=this.m_rowEndHeader);let r=i[t];if(null!=r)return r;const a=this._getHeaderByIndex(n,t,l,o,n),h=a[this.getResources().getMappedAttribute("context")],d=h.level,m=h.depth,c=this.getElementDir(a,s);let u=0,_=0;for(let e=d;e<d+m;e++){let t=i[e];null!=t?u+=t:_+=1}return 0===_?c:(r=Math.max(0,Math.round((c-u)/_)),i[t]=r,r)},z.prototype._modifyAndPushCells=function(e,t,i,s,n,o,l,r){let a=this.getResources().isRTLMode()?"right":"left",h="row"===i?"top":a,d=this.getResources().getMappedAttribute("context"),m=l?1:-1,c=function(i,s,n){i.forEach(i=>{let o=s(i),a=0;if(l)o>=e[0]&&(a=e.length);else for(;a<e.length&&!(e[a]>=o);a++);if(0===e.length&&r>0&&(a+=r),a>0){let s=t.length?t.slice(0,a).reduce((e,t)=>e+t):0;s*=m,a*=m,r&&e.length&&(a+=r*m),n(i,s,a,o)}})};if(c(s.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),e=>e[d].indexes[i],(e,t,s)=>{if(0!==t){let i=this.getElementDir(e,h)+t;this.setElementDir(e,i,h)}e[d].indexes[i]+=s}),n){c(n.querySelectorAll("."+this.getMappedStyle("headercell")),e=>e[d].index,(e,t,i)=>{if(0!==t){let i=this.getElementDir(e,h)+t;this.setElementDir(e,i,h)}e[d].index+=i}),c(n.querySelectorAll("."+this.getMappedStyle("groupingcontainer")),e=>this._getAttribute(e,"start",!0),(e,t,i,s)=>{this._setAttribute(e,"start",s+i)})}if(o){c(o.querySelectorAll("."+this.getMappedStyle("endheadercell")),e=>e[d].index,(e,t,i)=>{if(0!==t){let i=this.getElementDir(e,h)+t;this.setElementDir(e,i,h)}e[d].index+=i}),c(o.querySelectorAll("."+this.getMappedStyle("groupingcontainer")),e=>this._getAttribute(e,"start",!0),(e,t,i,s)=>{this._setAttribute(e,"start",s+i)})}},z.prototype.pushRowsDown=function(e,t){for(;e<=this.m_endRow;){var i=this._getAxisCellsByIndex(e,"row");if(i.length>0)for(var s=0;s<i.length;s++){var n=i[s],o=this.getElementDir(n,"top")+t;n.style.top=o+"px"}e+=1}},z.prototype.pushRowsUp=function(e,t){this.pushRowsDown(e,-t)},z.prototype.pushRowHeadersDown=function(e,t){for(;e;){var i=this.getElementDir(e,"top")+t;e.style.top=i+"px",e=e.nextSibling}},z.prototype.pushRowHeadersUp=function(e,t){this.pushRowHeadersDown(e,-t)},z.prototype.createCellContext=function(e,t,i,s,n){var o={parentElement:s,indexes:e,cell:t};this._isDataGridProvider()?o.data=t:o.data=null!=t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"data")?t.data:t,o.component=this,o.datasource=this.m_options.getProperty("data"),o.mode="navigation",o.extents=n;for(var l=Object.keys(i),r=0;r<l.length;r++){var a=l[r];o[a]=i[a]}return null!=this.m_createContextCallback&&this.m_createContextCallback.call(this,o),this.m_fixContextCallback.call(this,o)},z.prototype._createUniqueId=function(e){return this._uniqueIdCallback(e,!1)},z.prototype.getRowHeaderWidth=function(){return null===this.m_rowHeaderWidth?0:this.m_rowHeaderWidth},z.prototype.getColumnHeaderHeight=function(){return null===this.m_colHeaderHeight?0:this.m_colHeaderHeight},z.prototype.getRowEndHeaderWidth=function(){return-1===this.m_endRowEndHeader?0:this.m_rowEndHeaderWidth},z.prototype.getColumnEndHeaderHeight=function(){return-1===this.m_endColEndHeader?0:this.m_colEndHeaderHeight},z.prototype.getRowBottom=function(e,t){var i=this.getColumnHeaderHeight();if(null!=t)return i+t;var s=this.getElementDir(e,"top"),n=this.calculateRowHeight(e);return isNaN(s)||isNaN(n)?i:i+s+n},z.prototype.handleCellsFetchError=function(e,t){if(this.m_fetching.cells=!1,this.hideStatusText(),null==this.m_databody.firstChild)this._shouldInitialize()&&this._handleInitialization(!0);else{var i=t[0],s=t[1];s.start+(s.count-1)>this.m_endCol&&(this.m_stopColumnFetch=!0,this.m_stopColumnHeaderFetch=!0,this.m_stopColumnEndHeaderFetch=!0),i.start+(i.count-1)>this.m_endRow&&(this.m_stopRowFetch=!0,this.m_stopRowHeaderFetch=!0,this.m_stopRowEndHeaderFetch=!0)}},z.prototype._isFocusableElementBeforeCell=function(e){if(null==e||e===this.getRootElement()||this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return!1;var t=e.tagName;return!!("INPUT"===t||"TEXTAREA"===t||"SELECT"===t||"BUTTON"===t||"A"===t||this.m_utils.containsCSSClassName(e,this.getMappedStyle("active"))||null!=e.getAttribute("tabIndex")&&parseInt(e.getAttribute("tabIndex"),10)>=0&&this.findCell(e)!==e)||this._isFocusableElementBeforeCell(e.parentNode)},z.prototype._setFocusToFirstFocusableElement=function(e,t){u.enableAllFocusableElements(e);var i=u.getFocusableElementsInNode(e);if(i.length>0){var s=i[0];if(s.focus(),t&&t.preventDefault(),s.setSelectionRange&&s.value)try{s.setSelectionRange(s.value.length,s.value.length)}catch(e){}return!0===this._overwriteFlag&&"function"==typeof i[0].select&&s.select(),!0}return!1},z.prototype.handleScroll=function(e){if(this._clearScrollPositionTimeout(),this.m_handleScrollOverflow||(this.m_hasVerticalScroller||this.m_hasHorizontalScroller||(this.m_databody.style.overflow="hidden"),this.m_handleScrollOverflow=!0),this.m_animating)e.preventDefault();else if(!this.m_utils.isTouchDeviceNotIOS())if(!0!==this.m_silentScroll){var t;e||(e=window.event),t=e.target?e.target:e.srcElement;var i=this.m_utils.getElementScrollLeft(t),s=t.scrollTop;this.scrollTo(i,s)}else this.m_silentScroll=!1},z.prototype._getMaxScrollWidth=function(){return this._isCountUnknownOrHighwatermark("column")&&!this.m_stopColumnFetch?Number.MAX_VALUE:this.m_scrollWidth},z.prototype._getMaxScrollHeight=function(){return this._isCountUnknownOrHighwatermark("row")&&!this.m_stopRowFetch?Number.MAX_VALUE:this.m_scrollHeight},z.prototype.scroll=function(e){if(null!=e.position){var t={};t.x=Math.max(0,Math.min(this.m_scrollWidth,e.position.scrollX)),t.y=Math.max(0,Math.min(this.m_scrollHeight,e.position.scrollY)),this._scrollToScrollPositionObject(t)}},z.prototype.scrollDelta=function(e,t){this._adjustScrollerSize();var i=Math.max(0,Math.min(this._getMaxScrollWidth(),this.m_currentScrollLeft-e)),s=Math.max(0,Math.min(this._getMaxScrollHeight(),this.m_currentScrollTop-t));this._initiateScroll(i,s)},z.prototype.adjustTouchScroll=function(e,t){return this.m_utils.isTouchDevice()&&0!==e&&0!==t&&(Math.abs(e)>Math.abs(t)?(t=0,this.m_extraScrollOverY=null):(e=0,this.m_extraScrollOverX=null)),[e,t]},z.prototype._initiateScroll=function(e,t){this.m_utils.isTouchDeviceNotIOS()?this.scrollTo(e,t):(this.m_utils.setElementScrollLeft(this.m_databody,e),this.m_databody.scrollTop=t,this.m_databody.firstChild.childElementCount||!this._hasFrozenColumns()&&!this._hasFrozenRows()||this.scrollTo(e,t))},z.prototype._initiateScrollOnAttached=function(){this._initiateScroll(this.m_currentScrollLeft,this.m_currentScrollTop)},z.prototype._disableTouchScrollAnimation=function(){this.m_databody.firstChild.style.transitionDuration="0ms",this.m_rowHeader.firstChild.style.transitionDuration="0ms",this.m_colHeader.firstChild.style.transitionDuration="0ms",this.m_rowEndHeader.firstChild.style.transitionDuration="0ms",this.m_colEndHeader.firstChild.style.transitionDuration="0ms"},z.prototype._shouldLongScroll=function(e,t){return!this._isHighWatermarkScrolling()&&(e+this.getViewportWidth()<this._getMaxLeftPixel()||t+this.getViewportHeight()<this._getMaxTopPixel()||e>this._getMaxRightPixel()||t>this._getMaxBottomPixel())},z.prototype.scrollTo=function(e,t){if(this.m_prevScrollLeft=this.m_currentScrollLeft,this.m_currentScrollLeft=e,this.m_prevScrollTop=this.m_currentScrollTop,this.m_currentScrollTop=t,this._checkScroll=!1,this.m_utils.isTouchDeviceNotIOS()||(this._shouldLongScroll(e,t)?this.handleLongScroll(e,t):this.fillViewport(),this._checkScroll=!0),this._syncScroller(),this._adjustScrollerSize(),null!=this.m_cellToFocus){var i=this.m_cellToFocus;this.m_cellToFocus=null,this._setActive(i,this._createActiveObject(i),null,!1,!1,!0)}if(null!=this.m_scrollIndexAfterFetch&&this._isInViewport(this.m_scrollIndexAfterFetch)===z.INSIDE&&(this._isDatabodyCellActive()&&this.m_scrollIndexAfterFetch.row===this.m_active.indexes.row&&this.m_scrollIndexAfterFetch.column===this.m_active.indexes.column&&this._highlightActive(),this.m_scrollIndexAfterFetch=null),null!=this.m_scrollHeaderAfterFetch){let e="row";const t=this.m_scrollHeaderAfterFetch.index;"column"!==this.m_scrollHeaderAfterFetch.axis&&"columnEnd"!==this.m_scrollHeaderAfterFetch.axis||(e="column"),this._isAxisIndexInViewport(t,e)===z.INSIDE&&(this._isDatabodyCellActive()||this.m_scrollHeaderAfterFetch.axis!==this.m_active.axis||this.m_scrollHeaderAfterFetch.index!==this.m_active.index||this.m_scrollHeaderAfterFetch.level!==this.m_active.level||this._highlightActive(),this.m_scrollHeaderAfterFetch=null)}this.m_utils.isTouchDeviceNotIOS()||this.m_prevScrollTop===t&&this.m_prevScrollLeft===e||this.fireEvent("scroll",{event:null,ui:{scrollX:e,scrollY:t}}),!this.m_utils.isTouchDeviceNotIOS()&&this.isFetchComplete()&&this._checkScrollPosition()},z.prototype._scrollTransitionEnd=function(){this._isSelectionEnabled()&&this._scrollTouchSelectionAffordance(),this.fireEvent("scroll",{event:null,ui:{scrollX:this.m_currentScrollLeft,scrollY:this.m_currentScrollTop}}),this._shouldLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop)?this.handleLongScroll(this.m_currentScrollLeft,this.m_currentScrollTop):this.fillViewport(),this._checkScroll=!0,this.isFetchComplete()&&this._checkScrollPosition()},z.prototype._bounceBack=function(){var e=this.m_currentScrollLeft,t=this.m_currentScrollTop,i=this.m_databody.firstChild,s=this.m_colHeader.firstChild,n=this.m_rowHeader.firstChild,o=this.m_colEndHeader.firstChild,l=this.m_rowEndHeader.firstChild;i.style.transitionDuration=z.BOUNCE_ANIMATION_DURATION+"ms",n.style.transitionDuration=z.BOUNCE_ANIMATION_DURATION+"ms",l.style.transitionDuration=z.BOUNCE_ANIMATION_DURATION+"ms",s.style.transitionDuration=z.BOUNCE_ANIMATION_DURATION+"ms",o.style.transitionDuration=z.BOUNCE_ANIMATION_DURATION+"ms",null==this.m_scrollTransitionEnd&&(this.m_scrollTransitionEnd=this._scrollTransitionEnd.bind(this)),this._onEndEvent("transitionend",i,this.m_scrollTransitionEnd,z.BOUNCE_ANIMATION_DURATION),this.getResources().isRTLMode()?(i.style.transform="translate3d("+e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+e+"px, 0, 0)",o.style.transform="translate3d("+e+"px, 0, 0)"):(i.style.transform="translate3d("+-e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+-e+"px, 0, 0)",o.style.transform="translate3d("+-e+"px, 0, 0)"),n.style.transform="translate3d(0, "+-t+"px, 0)",l.style.transform="translate3d(0, "+-t+"px, 0)",this.m_extraScrollOverX=null,this.m_extraScrollOverY=null},z.prototype._syncScroller=function(){var e=this.m_currentScrollLeft,t=this.m_currentScrollTop,i=this.m_databody.firstChild,s=this.m_colHeader.firstChild,n=this.m_rowHeader.firstChild,o=this.m_colEndHeader.firstChild,l=this.m_rowEndHeader.firstChild;let r,a;if(this.m_databodyFrozenCol&&(r=this.m_databodyFrozenCol.firstChild),this.m_databodyFrozenRow&&(a=this.m_databodyFrozenRow.firstChild),this.m_utils.isTouchDeviceNotIOS()&&Object.prototype.hasOwnProperty.call(window,"WebKitCSSMatrix"))this._checkScroll=!1,null!=this.m_extraScrollOverX||null!=this.m_extraScrollOverY?(null!=this.m_extraScrollOverX?e+=this.m_extraScrollOverX:t+=this.m_extraScrollOverY,null==this.m_bounceBack&&(this.m_bounceBack=this._bounceBack.bind(this)),this._onEndEvent("transitionend",i,this.m_bounceBack,500)):"0ms"===i.style.transitionDuration?this._scrollTransitionEnd():(null==this.m_scrollTransitionEnd&&(this.m_scrollTransitionEnd=this._scrollTransitionEnd.bind(this)),this._onEndEvent("transitionend",i,this.m_scrollTransitionEnd,i.style.transitionDuration)),this.getResources().isRTLMode()?(i.style.transform="translate3d("+e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+e+"px, 0, 0)",o.style.transform="translate3d("+e+"px, 0, 0)"):(i.style.transform="translate3d("+-e+"px, "+-t+"px, 0)",s.style.transform="translate3d("+-e+"px, 0, 0)",o.style.transform="translate3d("+-e+"px, 0, 0)"),n.style.transform="translate3d(0, "+-t+"px, 0)",l.style.transform="translate3d(0, "+-t+"px, 0)";else{var h=this.getResources().isRTLMode()?"right":"left";this.setElementDir(s,-e,h),this.setElementDir(o,-e,h),this.setElementDir(n,-t,"top"),this.setElementDir(l,-t,"top"),a&&this.setElementDir(a,-e,h),r&&this.setElementDir(r,-t,"top")}},z.prototype._adjustScrollerSize=function(){var e=this.m_databody.firstChild,t=this.getElementHeight(e),i=this.getElementWidth(e),s=this._getEmptyElement(),n=0,o=0;s&&(n=this.getElementHeight(s),o=this.getElementWidth(s)),(this._getMaxBottomPixel()>t||this.getDataSource().getCount("row")===this._getMaxBottom()+1&&!this._isCountUnknown("row")&&this._getMaxBottom()>-1)&&this.setElementHeight(e,Math.max(this._getMaxBottomPixel(),n)),(this._getMaxRightPixel()>i||this.getDataSource().getCount("column")===this._getMaxRight()+1&&!this._isCountUnknown("column")&&this._getMaxRight()>-1)&&this.setElementWidth(e,Math.max(this._getMaxRightPixel(),o))},z.prototype._getLongScrollStart=function(e,t,i){var s,n,o,l,r,a,h,d;if(t!==e){"row"===i?(s=this.getElementHeight(this.m_databody.firstChild),n=this.m_utils._getMaxDivHeightForScrolling(),o=this._getMaxScrollHeight(),l=this.m_avgRowHeight,r=this.m_hasHorizontalScroller?this.m_utils.getScrollbarSize():0,d=Math.max(Math.max(this.getDataSource().getCount(i),this.m_endRow),0)):"column"===i&&(s=this.getElementWidth(this.m_databody.firstChild),n=this.m_utils._getMaxDivWidthForScrolling(),o=this._getMaxScrollWidth(),l=this.m_avgColWidth,r=this.m_hasVerticalScroller?this.m_utils.getScrollbarSize():0,d=Math.max(Math.max(this.getDataSource().getCount(i),this.m_endCol),0));var m=Math.max(Math.min(e/s,1),0),c=this.getFetchSize(i);a=Math.floor(d*m),h=n<=s?Math.min(e,o):a*l,(1===m||e+c*l>s-r)&&(a=Math.max(d-c,0),h=Math.max(s-c*l,0))}else"row"===i?(a=null!=this.m_longScrollRow?this.m_longScrollRow:this.m_startRow,h=null!=this.m_longScrollRowPixel?this.m_longScrollRowPixel:this.m_startRowPixel):"column"===i&&(a=null!=this.m_longScrollColumn?this.m_longScrollColumn:this.m_startCol,h=null!=this.m_longScrollColumnPixel?this.m_longScrollColumnPixel:this.m_startColPixel);return{start:a,startPixel:h}},z.prototype.handleLongScroll=function(e,t){this.m_isLongScroll=!0;const i=this._getLongScrollStart(t,this.m_prevScrollTop,"row");this.m_longScrollRow=i.start,this.m_longScrollRowPixel=i.startPixel;const s=this._getLongScrollStart(e,this.m_prevScrollLeft,"column");if(this.m_longScrollColumn=s.start,this.m_longScrollColumnPixel=s.startPixel,this.isSkeletonSupport()&&this.loadSkeletons(t,e,this.m_longScrollRow,this.m_longScrollColumn,this.m_longScrollRowPixel,this.m_longScrollColumnPixel),this.isFetchComplete()&&this._isScrollBackToEditable(!0)){const e=this.m_longScrollRow,t=this.m_longScrollRowPixel,i=this.m_longScrollColumn,s=this.m_longScrollColumnPixel;this.m_hasCells&&(this.m_startRow=e,this.m_endRow=-1,this.m_startRowPixel=t,this.m_endRowPixel=t,this.m_startCol=i,this.m_endCol=-1,this.m_startColPixel=s,this.m_endColPixel=s),this.m_hasRowHeader&&(this.m_startRowHeader=e,this.m_endRowHeader=-1,this.m_startRowHeaderPixel=t,this.m_endRowHeaderPixel=t),this.m_hasRowEndHeader&&(this.m_startRowEndHeader=e,this.m_endRowEndHeader=-1,this.m_startRowEndHeaderPixel=t,this.m_endRowEndHeaderPixel=t),this.m_hasColHeader&&(this.m_startColHeader=i,this.m_endColHeader=-1,this.m_startColHeaderPixel=s,this.m_endColHeaderPixel=s),this.m_hasColEndHeader&&(this.m_startColEndHeader=i,this.m_endColEndHeader=-1,this.m_startColEndHeaderPixel=s,this.m_endColEndHeaderPixel=s),this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this.fetchHeaders("row",e,this.m_rowHeader,this.m_rowEndHeader,void 0,{success:function(e,t,i){this.handleHeadersFetchSuccessForLongScroll(e,t,i)}}),this.fetchHeaders("column",i,this.m_colHeader,this.m_colEndHeader,void 0,{success:function(e,t,i){this.handleHeadersFetchSuccessForLongScroll(e,t,i)}}),this.fetchCells(this.m_databody,e,i,null,null,{success:function(n,o){this.handleCellsFetchSuccessForLongScroll(n,o,e,i,t,s)}})}},z.prototype.handleHeadersFetchSuccessForLongScroll=function(e,t,i){let s=this.m_rowHeader.firstChild,n=this.m_rowEndHeader.firstChild;"column"===t.axis&&(s=this.m_colHeader.firstChild,n=this.m_colEndHeader.firstChild),null!=s&&this._removeAllNonSkeletonContainerNodes(s),null!=n&&this._removeAllNonSkeletonContainerNodes(n),this.handleHeadersFetchSuccess(e,t,i,!1)},z.prototype.handleCellsFetchSuccessForLongScroll=function(e,t,i,s,n,o){const l=this.m_databody.firstChild;if(null!=l&&!this._getEmptyElement()){this._getAllNonSkeletonContainerNodes(l).forEach(e=>{this._remove(e)})}this.handleCellsFetchSuccess(e,t)},z.prototype._cleanupViewport=function(e){if(!this._isHighWatermarkScrolling()&&this._isScrollBackToEditable()){null==e&&(this.m_prevScrollLeft>this.m_currentScrollLeft?e="right":this.m_prevScrollLeft<this.m_currentScrollLeft?e="left":this.m_prevScrollTop>this.m_currentScrollTop?e="bottom":this.m_prevScrollTop<this.m_currentScrollTop&&(e="top"));var t=this._getViewportLeft(),i=this._getViewportRight(),s=this._getViewportTop(),n=this._getViewportBottom();"top"===e&&s>this._getMaxTopPixel()?(this.removeRowsFromTop(this.m_databody),this.removeRowHeadersFromTop()):"bottom"===e&&n<this._getMaxBottomPixel()?(this.removeRowsFromBottom(this.m_databody),this.removeRowHeadersFromBottom()):"left"===e&&t>this._getMaxLeftPixel()?(this.removeColumnsFromLeft(this.m_databody),this.removeColumnHeadersFromLeft()):"right"===e&&i<this._getMaxRightPixel()&&(this.removeColumnsFromRight(this.m_databody),this.removeColumnHeadersFromRight())}},z.prototype.fillViewport=function(){var e,t;const i=this._getLongScrollStart(this.m_currentScrollTop,this.m_prevScrollTop,"row"),s=this._getLongScrollStart(this.m_currentScrollLeft,this.m_prevScrollLeft,"column");if(this.isSkeletonSupport()&&this.loadSkeletons(this.m_currentScrollTop,this.m_currentScrollLeft,i.start,s.start,i.startPixel,s.startPixel),this.isFetchComplete()){var n=this._getViewportLeft(),o=this._getViewportRight()+z.FETCH_PIXEL_THRESHOLD,l=this._getViewportTop(),r=this._getViewportBottom()+z.FETCH_PIXEL_THRESHOLD;if(this._getMaxBottomPixel()<=r&&(!this.m_stopRowHeaderFetch||!this.m_stopRowEndHeaderFetch||!this.m_stopRowFetch))return e=Math.max(0,this._getMaxBottom()+1),t=Math.max(0,this.getFetchCount("row",e)),this.fetchHeaders("row",e,this.m_rowHeader,this.m_rowEndHeader,t),void this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1);if((this._getMaxTopPixel()>l||0===this.m_currentScrollTop)&&this._getMaxTop()>0)return e=Math.max(0,this._getMaxTop()-this.getFetchSize("row")),t=Math.max(0,this._getMaxTop()-e),this.fetchHeaders("row",e,this.m_rowHeader,this.m_rowEndHeader,t),void this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1);if(this._getMaxRightPixel()<=o&&(!this.m_stopColumnHeaderFetch||!this.m_stopColumnEndHeaderFetch||!this.m_stopColumnFetch))return e=Math.max(0,this._getMaxRight()+1),t=Math.max(0,this.getFetchCount("column",e)),this.fetchHeaders("column",e,this.m_colHeader,this.m_colEndHeader,t),void this.fetchCells(this.m_databody,this.m_startRow,e,this.m_endRow-this.m_startRow+1,t);(this._getMaxLeftPixel()>n||0===this.m_currentScrollLeft)&&this._getMaxLeft()>0&&(e=Math.max(0,this._getMaxLeft()-this.getFetchSize("column")),t=Math.max(0,this._getMaxLeft()-e),this.fetchHeaders("column",e,this.m_colHeader,this.m_colEndHeader,t),this.fetchCells(this.m_databody,this.m_startRow,e,this.m_endRow-this.m_startRow+1,t))}},z.prototype._getMaxRight=function(){return Math.max(Math.max(this.m_endCol,this.m_endColHeader),this.m_endColEndHeader)},z.prototype._getMaxLeft=function(){return Math.max(Math.max(this.m_startCol,this.m_startColHeader),this.m_startColEndHeader)},z.prototype._getMaxRightPixel=function(){return Math.max(Math.max(this.m_endColPixel,this.m_endColHeaderPixel),this.m_endColEndHeaderPixel)},z.prototype._getMaxLeftPixel=function(){return Math.max(Math.max(this.m_startColPixel,this.m_startColHeaderPixel),this.m_startColEndHeaderPixel)},z.prototype._getMaxBottom=function(){return Math.max(Math.max(this.m_endRow,this.m_endRowHeader),this.m_endRowEndHeader)},z.prototype._getMaxTop=function(){return Math.max(Math.max(this.m_startRow,this.m_startRowHeader),this.m_startRowEndHeader)},z.prototype._getMaxBottomPixel=function(){return Math.max(Math.max(this.m_endRowPixel,this.m_endRowHeaderPixel),this.m_endRowEndHeaderPixel)},z.prototype._getMaxTopPixel=function(){return Math.max(Math.max(this.m_startRowPixel,this.m_startRowHeaderPixel),this.m_startRowEndHeaderPixel)},z.prototype._isScrollBackToEditable=function(e){var t=this._getCurrentMode(),i=this._getActiveElement();return"edit"!==t||!e&&!this._isCellGoingToBeRemoved(i)||this._handleExitEdit(null,i)},z.prototype._isCellGoingToBeRemoved=function(e){if(!this._isHighWatermarkScrolling()){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.getElementDir(e.parentNode,"top");if(t+this.getElementHeight(e)<this.m_currentScrollTop||t<this.m_currentScrollTop+this.getViewportHeight())return!0}if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var i=this.getElementDir(e,"left");if(i+this.getElementWidth(e)<this.m_currentScrollLeft||i<this.m_currentScrollLeft+this.getViewportHeight())return!0}}},z.prototype._removeCellsAlongAxis=function(e,t,i){var s,n,o,l,r,a,h,d,m,c,u,_,p,g,C=0,f=0;for("row"===e?(n=this.m_startRow,o=this.m_endRow,l=this.m_rowHeader,r=this.m_rowHeaderLevelCount,a=this.m_startRowHeader,h="height",d=this.m_startRowPixel,m=this.m_endRowPixel,c=this.m_currentScrollTop,u="column",_=this.m_startCol,p=this.m_endCol,g="top",s=i?o:n):(n=this.m_startCol,o=this.m_endCol,l=this.m_colHeader,r=this.m_columnHeaderLevelCount,a=this.m_startColHeader,h="width",d=this.m_startColPixel,m=this.m_endColPixel,c=this.m_currentScrollLeft,u="row",_=this.m_startRow,p=this.m_endRow,g=this.getResources().isRTLMode()?"right":"left",s=i?o:n);s<=o&&s>=n;){var y=this._getKey(this._getHeaderByIndex(s,r-1,l,r,a),e);null==y&&(y=this._getKey(this._getCellByIndex("column"===e?this.createIndex(this.m_startRow,s):this.createIndex(s,this.m_startCol)),e));var E=this.isHidden(e,s)?0:this._getCellDimension(null,s,y,e,h);if(!(i?m-E-C>t:d+E+C<c-t))break;for(var v,w=_;w<=p;w+=v){var H=this._getCellByIndex("column"===e?this.createIndex(w,s):this.createIndex(s,w)),x=H[this.getResources().getMappedAttribute("context")],S=x.extents[e];v=x.extents[u],1===S?(this._remove(H),this.isHidden(e,s)&&this._remove(this.getHiddenIndicatorByIndex(s,this.m_databody.firstChild,!1))):(x.extents[e]-=1,this.setElementDir(H,this.getElementDir(H,h)-E,h),i||(x.indexes[e]+=1,this.setElementDir(H,this.getElementDir(H,g)+E,g)));for(var b=0;b<v;b++){var R="column"===e?this.createIndex(w+b,s):this.createIndex(s,w+b);this._removeIndexFromDatabodyMap(R)}}C+=E,f+=1,s=i?s-1:s+1}return{dimensionChange:C,extentChange:f}},z.prototype.removeHeadersFromStartOfContainer=function(e,t,i,s,n,o,l,r){var a=0,h=0;let d=Array.from(e.children).filter(e=>this.m_utils.containsCSSClassName(e,n)||this.m_utils.containsCSSClassName(e,this.getMappedStyle("groupingcontainer")));var m=null==t?d[0]:t.nextSibling;if(null==m)return{extentChange:0,dimensionChange:0};for(var c=this.m_utils.containsCSSClassName(m,n),u=c?m:m.firstChild,_=this.getElementDir(u,o);i+_<r-s;){if(this._remove(m),c){const t=this.getResources().getMappedAttribute("context");let i=m[t].axis,s=m[t].index;this.isHidden(i,s)&&this._remove(this.getHiddenIndicatorByIndex(s,e,!0))}if(d.shift(),h+=_,a+=c?1:this._getAttribute(m,"extent",!0),i+=_,null==(m=null==t?d[0]:t.nextSibling))return{extentChange:a,dimensionChange:h};u=(c=this.m_utils.containsCSSClassName(m,n))?m:m.firstChild,_=this.getElementDir(u,o)}if(!c){var p=this.removeHeadersFromStartOfContainer(m,m.firstChild,i,s,n,o,l,r);this._setAttribute(m,"start",this._getAttribute(m,"start",!0)+p.extentChange),this._setAttribute(m,"extent",this._getAttribute(m,"extent",!0)-p.extentChange),this.setElementDir(u,this.getElementDir(u,l)+p.dimensionChange,l),this.setElementDir(u,this.getElementDir(u,o)-p.dimensionChange,o),a+=p.extentChange,h+=p.dimensionChange}return{extentChange:a,dimensionChange:h}},z.prototype.removeHeadersFromEndOfContainer=function(e,t,i,s,n){var o=0,l=0;let r=Array.from(e.children).filter(e=>this.m_utils.containsCSSClassName(e,s)||this.m_utils.containsCSSClassName(e,this.getMappedStyle("groupingcontainer"))),a=r[r.length-1];for(var h=this.m_utils.containsCSSClassName(a,s),d=h?a:a.firstChild,m=this.getElementDir(d,n);t-m>i;){if(this._remove(a),h){const t=this.getResources().getMappedAttribute("context");let i=a[t].axis,s=a[t].index;this.isHidden(i,s)&&this._remove(this.getHiddenIndicatorByIndex(s,e,!0))}r.pop(),l+=m,o+=h?1:this._getAttribute(a,"extent",!0),t-=m,a=r[r.length-1],d=(h=this.m_utils.containsCSSClassName(a,s))?a:a.firstChild,m=this.getElementDir(d,n)}if(!h){var c=this.removeHeadersFromEndOfContainer(a,t,i,s,n);this._setAttribute(a,"extent",this._getAttribute(a,"extent",!0)-c.extentChange),this.setElementDir(d,this.getElementDir(d,n)-c.dimensionChange,n),o+=c.extentChange,l+=c.dimensionChange}return{extentChange:o,dimensionChange:l}},z.prototype.removeColumnHeadersFromLeft=function(){var e,t;if(this.m_endColHeader-this.m_startColHeader>this.MAX_COLUMN_THRESHOLD){var i=this.m_colHeader.firstChild;e=this.getColumnThreshold(),this.m_startColHeaderPixel<=this.m_currentScrollLeft-e&&(t=this.removeHeadersFromStartOfContainer(i,null,this.m_startColHeaderPixel,e,this.getMappedStyle("colheadercell"),"width",this.getResources().isRTLMode()?"right":"left",this.m_currentScrollLeft),this.m_startColHeaderPixel+=t.dimensionChange,this.m_startColHeader+=t.extentChange)}if(this.m_endColEndHeader-this.m_startColEndHeader>this.MAX_COLUMN_THRESHOLD){var s=this.m_colEndHeader.firstChild;e=this.getColumnThreshold(),this.m_startColEndHeaderPixel<this.m_currentScrollLeft-e&&(t=this.removeHeadersFromStartOfContainer(s,null,this.m_startColEndHeaderPixel,e,this.getMappedStyle("colendheadercell"),"width",this.getResources().isRTLMode()?"right":"left",this.m_currentScrollLeft),this.m_startColEndHeaderPixel+=t.dimensionChange,this.m_startColEndHeader+=t.extentChange)}},z.prototype.removeColumnsFromLeft=function(e){if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var t=e.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getColumnThreshold();if(t.length<1)return;var s=this._removeCellsAlongAxis("column",i,!1);this.m_startColPixel+=s.dimensionChange,this.m_startCol+=s.extentChange}},z.prototype.removeColumnHeadersFromRight=function(){var e,t,i=this.m_currentScrollLeft+this.getViewportWidth()+this.getColumnThreshold();this.m_endColHeader-this.m_startColHeader>this.MAX_COLUMN_THRESHOLD&&(e=this.m_colHeader.firstChild,this.m_endColHeaderPixel>i&&(this.m_stopColumnHeaderFetch&&(this.m_stopColumnHeaderFetch=!1),t=this.removeHeadersFromEndOfContainer(e,this.m_endColHeaderPixel,i,this.getMappedStyle("colheadercell"),"width"),this.m_endColHeaderPixel-=t.dimensionChange,this.m_endColHeader-=t.extentChange)),this.m_endColEndHeader-this.m_startColEndHeader>this.MAX_COLUMN_THRESHOLD&&(e=this.m_colEndHeader.firstChild,this.m_endColEndHeaderPixel>i&&(this.m_stopColumnEndHeaderFetch&&(this.m_stopColumnEndHeaderFetch=!1),t=this.removeHeadersFromEndOfContainer(e,this.m_endColEndHeaderPixel,i,this.getMappedStyle("colendheadercell"),"width"),this.m_endColEndHeaderPixel-=t.dimensionChange,this.m_endColEndHeader-=t.extentChange))},z.prototype.removeColumnsFromRight=function(e){if(this.m_endCol-this.m_startCol>this.MAX_COLUMN_THRESHOLD){var t=e.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.m_currentScrollLeft+this.getViewportWidth()+this.getColumnThreshold();if(this.m_endColPixel<=i||t.length<1)return;this.m_stopColumnFetch&&(this.m_stopColumnFetch=!1);var s=this._removeCellsAlongAxis("column",i,!0);this.m_endColPixel-=s.dimensionChange,this.m_endCol-=s.extentChange}},z.prototype.removeRowHeadersFromTop=function(){var e,t;if(this.m_endRowHeader-this.m_startRowHeader>this.MAX_ROW_THRESHOLD){var i=this.m_rowHeader.firstChild;t=this.getRowThreshold(),this.m_startRowHeaderPixel>=this.m_currentScrollTop-t||(e=this.removeHeadersFromStartOfContainer(i,null,this.m_startRowHeaderPixel,t,this.getMappedStyle("rowheadercell"),"height","top",this.m_currentScrollTop),this.m_startRowHeaderPixel+=e.dimensionChange,this.m_startRowHeader+=e.extentChange)}if(this.m_endRowEndHeader-this.m_startRowEndHeader>this.MAX_ROW_THRESHOLD){var s=this.m_rowEndHeader.firstChild;t=this.getRowThreshold(),this.m_startRowEndHeaderPixel>=this.m_currentScrollTop-t||(e=this.removeHeadersFromStartOfContainer(s,null,this.m_startRowEndHeaderPixel,t,this.getMappedStyle("rowendheadercell"),"height","top",this.m_currentScrollTop),this.m_startRowEndHeaderPixel+=e.dimensionChange,this.m_startRowEndHeader+=e.extentChange)}},z.prototype.removeRowsFromTop=function(e){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.getRowThreshold();if(this.m_startRowPixel>=this.m_currentScrollTop-t)return;var i=this._removeCellsAlongAxis("row",t,!1);this.m_startRowPixel+=i.dimensionChange,this.m_startRow+=i.extentChange}},z.prototype.removeRowHeadersFromBottom=function(){var e,t=this.m_currentScrollTop+this.getViewportHeight()+this.getRowThreshold();if(this.m_endRowHeader-this.m_startRowHeader>this.MAX_ROW_THRESHOLD){var i=this.m_rowHeader.firstChild;this.m_endRowHeaderPixel<=t||(this.m_stopRowHeaderFetch&&(this.m_stopRowHeaderFetch=!1),e=this.removeHeadersFromEndOfContainer(i,this.m_endRowHeaderPixel,t,this.getMappedStyle("rowheadercell"),"height"),this.m_endRowHeaderPixel-=e.dimensionChange,this.m_endRowHeader-=e.extentChange)}if(this.m_endRowEndHeader-this.m_startRowEndHeader>this.MAX_ROW_THRESHOLD){var s=this.m_rowEndHeader.firstChild;this.m_endRowEndHeaderPixel<=t||(this.m_stopRowEndHeaderFetch&&(this.m_stopRowEndHeaderFetch=!1),e=this.removeHeadersFromEndOfContainer(s,this.m_endRowEndHeaderPixel,t,this.getMappedStyle("rowendheadercell"),"height"),this.m_endRowEndHeaderPixel-=e.dimensionChange,this.m_endRowEndHeader-=e.extentChange)}},z.prototype.removeRowsFromBottom=function(e){if(this.m_endRow-this.m_startRow>this.MAX_ROW_THRESHOLD){var t=this.m_currentScrollTop+this.getViewportHeight()+this.getRowThreshold();if(this.m_endRowPixel<=t)return;this.m_stopRowFetch&&(this.m_stopRowFetch=!1);var i=this._removeCellsAlongAxis("row",t,!0);this.m_endRowPixel-=i.dimensionChange,this.m_endRow-=i.extentChange}},z.prototype.handleContextMenuGesture=function(e,t,i){var s,n,o,l,r=e.originalEvent.target,a=this.findCell(r),h=!1;if(null===a&&(a=this.findHeader(r))&&(h=!0,l=this.getHeaderCellAxis(a)),"touch"===t&&null!=a){s=h?this.getHeaderCellIndex(a):this.getCellIndexes(a);let t=h?this._isHeaderInsideSelection(s,l):this._isContainSelection(s);(!this.isMultipleSelection()||!t||this._isDatabodyCellActive()&&s.row!==this.m_active.indexes.row&&s.column!==this.m_active.indexes.column)&&(this._isSelectionEnabled()?this.handleDatabodyClickSelection(e.originalEvent):this.handleDatabodyClickActive(e.originalEvent))}if(!this.m_utils._isNodeEditableOrClickable(r,this.m_root)){if(null==a||h)if(null==(a=this.findHeader(r)||this.findLabel(r))){var d="disable";n={resize:d,resizeWidth:d,resizeHeight:d,sortRow:d,sortCol:d,cut:d,paste:d,sortColAsc:d,sortColDsc:d,sortRowAsc:d,sortRowDsc:d},o=a}else(n=this._getHeaderCapability(a)).resizeFitToContent=h?"enable":"disable","column"!==l&&"columnEnd"!==l||!this.m_selectionFrontier||"column"!==this.m_selectionFrontier.axis?"row"!==l&&"rowEnd"!==l||!this.m_selectionFrontier||"row"!==this.m_selectionFrontier.axis||(n.resizeWidth="disable"):n.resizeHeight="disable",o=a;else s=this.getCellIndexes(a),this.isMultipleSelection()&&this._isContainSelection(s)?(o=this._getActiveElement(),this._isDatabodyCellActive()?(null==o&&(o=a),(n="keyboard"===t?this._getCellCapability(o):this._getCellCapability(o,a)).resizeFitToContent="disable"):(n=this._getHeaderCapability(o,a)).resizeFitToContent="enable"):(o=a,(n=this._getCellCapability(o)).resizeFitToContent="disable"),this.m_selectionFrontier&&"row"===this.m_selectionFrontier.axis?n.resizeWidth="disable":this.m_selectionFrontier&&"column"===this.m_selectionFrontier.axis&&(n.resizeHeight="disable");i.call(null,{capabilities:n,launcher:o},e,t)}},z.prototype._getCellCapability=function(e,t){var i=!0,s=!0,n="disable",o="enable",l={resize:n,resizeWidth:n,resizeHeight:n,sortRow:n,sortCol:n,cut:n,cutCells:n,copyCells:n,paste:n,pasteCells:n,autoFill:n,sortColAsc:n,sortColDsc:n,sortRowAsc:n,sortRowDsc:n,freezeRow:n,freezeCol:n,unfreezeRow:n,unfreezeCol:n,hideCol:n,unhideCol:n};if(null!=t&&(i=this._getIndex(e,"column")===this._getIndex(t,"column"),!1===(s=this._getKey(e,"row")===this._getKey(t,"row"))&&!1===i))return l;this.m_options.isCopyEnabled()&&(l.copyCells=o),this.m_options.isCutEnabled()&&(l.cutCells=o),this.m_options.isPasteEnabled()&&(l.pasteCells=o);let r=this.m_selection,a=!1;if(!this.m_discontiguousSelection&&r&&1===r.length){let e=r[0].startIndex.row,t=r[0].startIndex.column,i=r[0].endIndex.row,s=r[0].endIndex.column;e===i&&t===s||(a=!0)}this.m_options.isFloodFillEnabled()&&a&&(l.autoFill=o);const h=this.getResources().getMappedAttribute("context");if(this.m_options.isFreezeEnabled("column")&&(l.freezeCol=o,e[h].indexes.column===this.m_frozenColIndex&&(l.freezeCol=n),l.unfreezeCol=n,this._hasFrozenColumns()&&(l.unfreezeCol=o)),this.m_options.isHideEnabled("column")){let t=this._getCellHidabilityContextMenuCapability(e);t.canHide&&(l.hideCol=o),t.canUnhide&&(l.unhideCol=o)}this.m_options.isFreezeEnabled("row")&&(l.freezeRow=o,e[h].indexes.row===this.m_frozenRowIndex&&(l.freezeRow=n),l.unfreezeRow=n,this._hasFrozenRows()&&(l.unfreezeRow=o));var d=this.getHeaderFromCell(e,"row"),m=this.getHeaderFromCell(e,"column"),c=this.getResources().getMappedAttribute("resizable"),u=this.getResources().getMappedAttribute("sortable");if(null!=m&&i&&("true"===m.getAttribute(c)&&(l.resize=o,l.resizeWidth=o),"true"===m.getAttribute(u))){l.sortCol=o,l.sortColAsc=o,l.sortColDsc=o;var _=m.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===_?l.sortColAsc=n:"descending"===_&&(l.sortColDsc=n)}return null!=d&&s&&(this._isMoveEnabled("row")&&(l.cut=o,l.paste=o),"true"===d.getAttribute(u)&&(l.sortRow=o,l.sortRowAsc=o,l.sortRowDsc=o),null!=d&&("true"===d.getAttribute(c)&&(l.resize=o,l.resizeHeight=o),"true"===d.getAttribute(u)&&(l.sortRow=o))),l},z.prototype._getHeaderCapability=function(e,t){var i=!0,s=!0,n="disable",o="enable",l={resize:n,resizeWidth:n,resizeHeight:n,sortRow:n,sortCol:n,cut:n,paste:n,sortColAsc:n,sortColDsc:n,sortRowAsc:n,sortRowDsc:n,freezeRow:n,freezeCol:n,unfreezeRow:n,unfreezeCol:n,hideCol:n,unhideCol:n};if(null!=t&&(i=this.getHeaderCellIndex(e)===this._getIndex(t,"column"),!1===(s=this._getKey(e,"row")===this._getKey(t,"row"))&&!1===i))return l;var r=this.getHeaderCellAxis(e),a=this.getResources().getMappedAttribute("resizable"),h=this.getResources().getMappedAttribute("sortable");const d=this.getResources().getMappedAttribute("context");if(null!==e){if("column"!==r&&"columnEnd"!==r||!i){if(s){if(this._isMoveEnabled("row")&&(l.cut=o,l.paste=o),"true"===e.getAttribute(a)&&(l.resize=o,l.resizeHeight=o),l.resizeWidth=this.m_options.isResizable(r,"width"),"true"===e.getAttribute(h)){l.sortRow=o,l.sortRowAsc=o,l.sortRowDsc=o;let t=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===t?l.sortRowAsc=n:"descending"===t&&(l.sortRowDsc=n)}this.m_options.isFreezeEnabled("row")&&(l.freezeRow=o,e[d].index===this.m_frozenRowIndex&&(l.freezeRow=n),l.unfreezeRow=n,this._hasFrozenRows()&&(l.unfreezeRow=o))}}else{if("true"===e.getAttribute(a)&&(l.resizeWidth=o,l.resize=o),l.resizeHeight=this.m_options.isResizable(r,"height"),"true"===e.getAttribute(h)){l.sortCol=o,l.sortColAsc=o,l.sortColDsc=o;var m=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));"ascending"===m?l.sortColAsc=n:"descending"===m&&(l.sortColDsc=n)}this.m_options.isFreezeEnabled("column")&&(l.freezeCol=o,e[d].index===this.m_frozenColIndex&&(l.freezeCol=n),l.unfreezeCol=n,this._hasFrozenColumns()&&(l.unfreezeCol=o))}if(this.m_options.isHideEnabled("column")){let i=this._getHeaderHidabilityContextMenuCapability(e,t);i.canHide&&(l.hideCol=o),i.canUnhide&&(l.unhideCol=o)}"row"!==r||t||(l.hideCol=n,l.unhideCol=n)}return l.resize=l.resizeHeight===o||l.resizeWidth===o?o:n,l},z.prototype.handleContextMenuReturn=function(e,t,i){var s,n;if(null!=this.m_active&&(s=this._getActiveElement()),t===this.m_resources.getMappedCommand("resizeHeight")||t===this.m_resources.getMappedCommand("resizeWidth"))this.isResizeEnabled()&&this.handleContextMenuResize(e,t,i,s);else if(t===this.m_resources.getMappedCommand("resizeFitToContent")){let t,i=this.findCell(e.target);i&&(t=this.getHeaderFromCell(i,this.m_selectionFrontier.axis)),t||(t=this.findHeader(e.target)),t||(t=this.findLabel(e.target)),t&&(this.m_resizingElement=t);const s=this.getHeaderCellAxis(this.m_resizingElement),n=this.getHeaderCellLevel(this.m_resizingElement);let o=!1;("row"!==s&&"rowEnd"!==s||n!==this.m_rowHeaderLevelCount-1)&&("column"!==s&&"columnEnd"!==s||n!==this.m_columnHeaderLevelCount-1)||(o=!0),o&&this.isResizeEnabled()&&this._getHeadersForResizeFitToContent(e)}else t===this.m_resources.getMappedCommand("sortColAsc")||t===this.m_resources.getMappedCommand("sortColDsc")?(n=t===this.m_resources.getMappedCommand("sortColAsc")?"ascending":"descending",this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=this.getHeaderFromCell(s,"column")),this._isDOMElementSortable(s)&&this._handleCellSort(e,n,s)):t===this.m_resources.getMappedCommand("sortRowAsc")||t===this.m_resources.getMappedCommand("sortRowDsc")?(n=t===this.m_resources.getMappedCommand("sortRowAsc")?"ascending":"descending",this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=this.getHeaderFromCell(s,"row")),this._isDOMElementSortable(s)&&this._handleCellSort(e,n,s)):t===this.m_resources.getMappedCommand("cut")?this._handleCut(e,s):t===this.m_resources.getMappedCommand("paste")?this._handlePaste(e,s):t===this.m_resources.getMappedCommand("cutCells")?this._handleCutCells(e,s):t===this.m_resources.getMappedCommand("copyCells")?this._handleCopyCells(e,s):t===this.m_resources.getMappedCommand("pasteCells")?this._handlePasteCells(e,s):t===this.m_resources.getMappedCommand("autoFill")?this._handleAutofill(e,s):t===this.m_resources.getMappedCommand("discontiguousSelection")?this.setDiscontiguousSelectionMode(i):t===this.m_resources.getMappedCommand("freezeRow")?this._handleFreezeRow(e,s):t===this.m_resources.getMappedCommand("freezeCol")?this._handleFreezeCol(e,s):t===this.m_resources.getMappedCommand("unfreezeCol")?this._handleUnFreeze("column",e):t===this.m_resources.getMappedCommand("unfreezeRow")?this._handleUnFreeze("row",e):t===this.m_resources.getMappedCommand("hideCol")?this._handleHideColumn(e,s):t===this.m_resources.getMappedCommand("unhideCol")&&this._handleUnhideColumn(e,s)},z.prototype._isSortEnabled=function(e,t){var i=this.getDataSource().getCapability("sort"),s=this.m_options.isSortable(e,t);return!("enable"!==s&&"auto"!==s||"full"!==i&&i!==e)&&(!this._isDataGridProvider()||null!=t.metadata.sortDirection)},z.prototype._isParentNode=function(e){return!!this._isDataGridProvider()&&(e.metadata.expanded&&null!==e.metadata.expanded)},z.prototype._isRequired=function(e){return!!this._isDataGridProvider()&&!0===e.metadata.showRequired},z.prototype._isHierarchicalGroup=function(e){return null==e.metadata.treeDepth},z.prototype._isLeafNode=function(e){if(!e.metadata)return!1;const t=e.metadata.treeDepth;return!!this._isDataGridProvider()&&(null!=t&&0!==t)},z.prototype._isDOMElementSortable=function(e){if(null==e)return!1;var t=this.findHeader(e);return null!=t&&"true"===t.getAttribute(this.getResources().getMappedAttribute("sortable"))},z.prototype._isSelectionEnabled=function(){return"none"!==this.m_options.getSelectionCardinality()},z.prototype.isMultipleSelection=function(){return"multiple"===this.m_options.getSelectionCardinality()},z.prototype.isResizeEnabled=function(){return this.m_options.isResizable("row","width")||this.m_options.isResizable("row","height")||this.m_options.isResizable("column","width")||this.m_options.isResizable("column","height")||this.m_options.isResizable("rowEnd","width")||this.m_options.isResizable("rowEnd","height")||this.m_options.isResizable("columnEnd","width")||this.m_options.isResizable("columnEnd","height")},z.prototype._isHeaderResizeEnabled=function(e,t){return"column"===e||"columnEnd"===e?"enable"===this.m_options.isResizable(e,"width",t):("row"===e||"rowEnd"===e)&&"enable"===this.m_options.isResizable(e,"height",t)},z.prototype.handleMouseMove=function(e){this.isResizeEnabled()&&!1===this.m_databodyDragState&&this.handleResize(e)},z.prototype.handleRowHeaderMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_databodyMove&&!this._isDataGridProvider()?this._handleMove(e):this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("row")||this.m_deselectInfo&&this.m_deselectInfo.axis&&-1!==this.m_deselectInfo.axis.indexOf("row"))?this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress):this.m_isResizing||this.handleMouseMove(e)},z.prototype.handleColumnHeaderMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("column")||this.m_deselectInfo&&this.m_deselectInfo.axis&&-1!==this.m_deselectInfo.axis.indexOf("column"))?this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress):this.m_isResizing||this.handleMouseMove(e)},z.prototype.handleHeaderLabelMouseMove=function(e){this.m_isResizing||this.handleMouseMove(e)},z.prototype.handleHeaderMouseDown=function(e){var t;this.deleteDatabodyHiddenVisualIndicators();const i=this.findHeader(e.target);if(null!=i){this._exitActionableMode();var s=e.target;if(this._isEditOrEnter()){var n=this._getActiveElement();if(!1===this._leaveEditing(e,n,!1))return}if(this._isDisclosureIcon(s))this.handleHeaderClickActive(e,null,!0);else{var o=this.m_options.getSelectionMode();if(0===e.button){if((this.m_utils.containsCSSClassName(s,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(s,this.getMappedStyle("sortdescending")))&&this._isDOMElementSortable(s))return e.preventDefault(),void this._handleSortIconMouseDown(s);if(this.m_utils.containsCSSClassName(s,this.getMappedStyle("sortIcon"))&&this._isDOMElementSortable(s.lastChild))return e.preventDefault(),void this._handleSortIconMouseDown(s.lastChild);this.isResizeEnabled()&&(t=this.handleResizeMouseDown(e),this._highlightResizeMouseDown());var l=this.m_utils.ctrlEquivalent(e);this._isDataGridProvider()||this.m_isResizing||l||!this._isMoveOnElementEnabled(this.findHeader(s))||(this.m_databodyMove=!0,this.m_currentX=e.pageX,this.m_currentY=e.pageY,t=!0);let n=this.getHeaderCellAxis(i);if(this.m_utils.containsCSSClassName(i,this.getMappedStyle("draggableItem"))&&this.m_utils.addCSSClassName(i,this.getMappedStyle("dragging")),this._isDataGridProvider()&&this.m_options._isDragEnabled(n)&&this.shouldHoverHeader(i)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(i))return}if(!this.m_isResizing&&"default"===this.manageHeaderCursor(e,!1)){this.m_root.contains(document.activeElement)&&document.activeElement!==this.m_root||(this.m_externalFocus=!0);var r=i[this.getResources().getMappedAttribute("context")];if(!this._isSelectionEnabled()||!this.isMultipleSelection()||"row"===o&&-1===r.axis.indexOf("row")||this.m_databodyMove)if("row"===o&&-1!==r.axis.indexOf("row")&&this._isSelectionEnabled())this.handleHeaderClickSelection(e);else if("row"===o&&-1!==r.axis.indexOf("column")&&this._isSelectionEnabled()){let t=!1;e.shiftKey||(t=!0),this.handleHeaderClickActive(e,t)}else this.handleHeaderClickActive(e);else 0===e.button&&(this.m_headerDragState=!0),this.handleHeaderClickSelection(e)}this.m_options.isFloodFillEnabled()&&this.m_bottomFloodFillIconContainer&&this.m_bottomFloodFillIconContainer.parentNode&&(this.m_bottomFloodFillIconContainer.parentNode.removeChild(this.m_bottomFloodFillIconContainer),this.m_bottomFloodFillIconContainer.removeEventListener("mouseover",this.handleDatabodyMouseMove)),!0===t&&e.preventDefault()}}},z.prototype.handleHeaderLabelMouseDown=function(e){var t;this.find(e.target,"headerlabel")&&this.isResizeEnabled()&&(t=this.handleResizeMouseDown(e),this._highlightResizeMouseDown()),!0===t&&e.preventDefault()},z.prototype.handleMouseUp=function(e){this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_deselectInProgress=!1,this.m_databodyMove?this._handleMoveMouseUp(e,!1):this.isResizeEnabled()&&this.handleResizeMouseUp(e),this.m_databodyMove=!1},z.prototype.shouldHoverHeader=function(e){const t=null==e?null:this.getHeaderCellAxis(e),i=null===e?null:this.getHeaderCellLevel(e),s="row"===t||"rowEnd"===t,n=this.m_options.getSelectionMode();return this._isSelectionEnabled()&&(this.isMultipleSelection()&&"cell"===n||"row"===n&&s&&(this.isMultipleSelection()||null!==i&&i===this.m_rowHeaderLevelCount-1))},z.prototype.handleHeaderMouseOver=function(e){var t=e.target,i=this.findHeader(t);!this.m_isResizing&&"default"===this.manageHeaderCursor(e,!1)&&this.shouldHoverHeader(i)&&this.m_utils.addCSSClassName(i,this.getMappedStyle("hover"));let s=this.getHeaderCellAxis(i);this._isDataGridProvider()&&this.shouldHoverHeader(i)&&this.m_options._isDragEnabled(s)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(i)},z.prototype.handleHeaderMouseOut=function(e){var t=e.target;this.m_utils.removeCSSClassName(this.findHeader(t),this.getMappedStyle("hover")),!this.m_isResizing&&this.m_resizingElement&&(this.m_resizingElement.style.cursor="",null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor="")),this._isDOMElementSortable(t)&&this._handleSortMouseOut(e)},z.prototype.handleHeaderMouseUp=function(e){this.handleDragAnchorChange(e),this.m_headerDragState=!1,this.m_databodyDragState=!1,this.m_deselectInProgress=!1,this.m_floodFillDragState&&(this.unhighlightFloodFillRange(),this.m_selectionRange=null,this.m_floodFillRange=null,this.m_floodFillDirection=null,this.m_databody.style.cursor="default",this.m_cursor="default"),this.m_databodyMove&&this._handleMoveMouseUp(e,!0);let t=this.findHeader(e.target),i=this.getHeaderCellAxis(t);this._isDataGridProvider()&&this.m_options._isDragEnabled(i)&&this.shouldHoverHeader(t)&&this.m_selection&&this.m_selection.length&&this._setHeaderDraggable(t),this.m_utils.containsCSSClassName(t,this.getMappedStyle("dragging"))&&this.m_utils.removeCSSClassName(t,this.getMappedStyle("dragging"))},z.prototype.handleCornerMouseDown=function(e){this.deleteDatabodyHiddenVisualIndicators();let t,i=e.target,s=this.m_utils.containsCSSClassName(i,this.getMappedStyle("rowendheaderlabel"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("columnendheaderlabel")),n=this.findLabel(i);null!=n&&(t=s,this._setActive(n,this._createActiveObject(n),e,t),this.handleHeaderLabelMouseDown(e))},z.prototype.handleCornerMouseOver=function(e){var t=e.target;let i=this.findLabel(t);this._isSelectionEnabled()&&this.isMultipleSelection()&&(i?this.m_utils.addCSSClassName(i,this.getMappedStyle("hover")):this.m_utils.addCSSClassName(this.find(t,"topcorner"),this.getMappedStyle("hover"))),this.m_isResizing||null===i||this.handleMouseMove(e)},z.prototype.handleCornerMouseMove=function(e){var t=e.target;let i=this.findLabel(t);this.m_isResizing||null===i||this.handleMouseMove(e)},z.prototype.handleCornerMouseOut=function(e){var t=e.target;let i=this.findLabel(t);i?this.m_utils.removeCSSClassName(i,this.getMappedStyle("hover")):this.m_utils.removeCSSClassName(this.find(t,"topcorner"),this.getMappedStyle("hover"))},z.prototype.handleCornerClick=function(e){this._handleSelectAll(e)},z.prototype.handleHeaderClick=function(e){var t=e.target;(this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortdefault")))&&this._isDOMElementSortable(t)||this.m_utils.containsCSSClassName(t,this.getMappedStyle("sortIcon"))&&this._isDOMElementSortable(t.lastChild)?(this._removeTouchSelectionAffordance(),this._handleHeaderSort(e),e.preventDefault()):this._isDisclosureIcon(e.target)&&(this._removeTouchSelectionAffordance(),this._handleExpandCollapseRequest(e),e.preventDefault())},z.prototype.handleHeaderDoubleClick=function(e){if(document.contains(e.target)){let t=!1;if(this.m_cursor=this.manageHeaderCursor(e,t),"col-resize"===this.m_cursor||"row-resize"===this.m_cursor){this.m_resizingElement||(this.m_resizingElement=this.findHeader(e.target));const t=this.getHeaderCellAxis(this.m_resizingElement),i=this.getHeaderCellLevel(this.m_resizingElement);let s=!1;("row"!==t&&"rowEnd"!==t||i!==this.m_rowHeaderLevelCount-1||"row-resize"!==this.m_cursor)&&("column"!==t&&"columnEnd"!==t||i!==this.m_columnHeaderLevelCount-1||"col-resize"!==this.m_cursor)||(s=!0),s&&this.isResizeEnabled()&&this._getHeadersForResizeFitToContent(e)}}},z.prototype._getHeadersForResizeFitToContent=function(e){const t=this.getHeaderCellAxis(this.m_resizingElement),i=this.getHeaderCellIndex(this.m_resizingElement);let s=[];if(this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection.length){let e=this.m_selection[0];s=this._getHeadersWithinSelection(e,i,t)}s.length||s.push(this.m_resizingElement),s.forEach(i=>{this.handleResizeFitToContent(e,i,t)})},z.prototype._getHeadersWithinSelection=function(e,t,i){let s,n,o,l,r,a,h,d=[];if("column"===i?(s=this.m_startColHeader,n=this.m_columnHeaderLevelCount-1,o=this.m_columnHeaderLevelCount,l=this.m_colHeader,r="column"):"columnEnd"===i?(s=this.m_startColEndHeader,n=this.m_columnEndHeaderLevelCount-1,o=this.m_columnEndHeaderLevelCount,l=this.m_colEndHeader,r="column"):"row"===i?(s=this.m_startRowHeader,n=this.m_rowHeaderLevelCount-1,o=this.m_rowHeaderLevelCount,l=this.m_rowHeader,r="row"):(s=this.m_startRowEndHeader,n=this.m_rowEndHeaderLevelCount-1,o=this.m_rowEndHeaderLevelCount,l=this.m_rowEndHeader,r="row"),0===e.startIndex.column&&-1===e.endIndex.column&&0===e.startIndex.row&&-1===e.endIndex.row){a=0,h="row"===r?this.m_endRowHeader-this.m_startRowHeader:this.m_endColHeader-this.m_startColHeader}else 0===e.startIndex.column&&-1===e.endIndex.column||void 0===e.startIndex.column?e.startIndex.row<=t&&t<=e.endIndex.row&&("row"===i||"rowEnd"===i)&&(a=e.startIndex.row,h=e.endIndex.row):(0===e.startIndex.row&&-1===e.endIndex.row||void 0===e.startIndex.row)&&e.startIndex.column<=t&&t<=e.endIndex.column&&("column"===i||"columnEnd"===i)&&(a=e.startIndex.column,h=e.endIndex.column);for(let e=a;e<=h;e++){let t=this._getHeaderByIndex(e,n,l,o,s);t&&d.push(t)}return d},z.prototype._setHeaderDraggable=function(e){let t=!1;if(this.m_selection&&this.m_selection.length){if(this._isSelectionAcrossAxis())return!1;this.m_utils.containsCSSClassName(e,this.getMappedStyle("selected"))&&(t=!0)}return t&&(this.m_utils.addCSSClassName(e,this.getMappedStyle("draggableItem")),e.setAttribute("draggable",!0)),t},z.prototype._isSelectionAcrossAxis=function(){let e,t=!1;for(let i=0;i<this.m_selection.length;i++){let s=this.m_selection[i];if(e&&(-1===s.endIndex.row&&"column"!==e||-1===s.endIndex.column&&"row"!==e)){t=!0;break}-1===s.endIndex.row?e="column":-1===s.endIndex.column&&(e="row")}return t},z.prototype.handleDatabodyMouseDown=function(e){this.deleteDatabodyHiddenVisualIndicators();var t=e.target,i=this.findCell(t);if(null!=i){if(this._isEditOrEnter()){var s=this._getActiveElement();if(i===s)return;if(!1===this._leaveEditing(e,s,!1))return}else this._exitActionableMode();var n=this.m_utils.ctrlEquivalent(e);0!==e.button||n||this._isMoveOnElementEnabled(i)&&(this.m_databodyMove=!0,this.m_currentX=e.pageX,this.m_currentY=e.pageY),this.m_root.contains(document.activeElement)&&document.activeElement!==this.m_root||(this.m_externalFocus=!0),this._isGridEditable()&&(this.m_shouldFocus=!this._isFocusableElementBeforeCell(t)),this._isSelectionEnabled()?(this.isMultipleSelection()&&0===e.button&&(this.m_databodyDragState=!0),this.handleDatabodyClickSelection(e)):this.handleDatabodyClickActive(e)}else this.m_scrollbarFocus=!0},z.prototype.handleDatabodyMouseOut=function(e){if(!this.m_databodyMove){var t=e.target,i=this.findCell(t);this._setCellHover(i,"remove")}},z.prototype.handleDatabodyMouseOver=function(e){if(!this.m_databodyMove){var t=e.target,i=this.findCell(t);this._setCellHover(i,"add")}},z.prototype._setCellHover=function(e,t){if(null!=e&&this._isSelectionEnabled()){var i=this.m_options.getSelectionMode();if("cell"===i)"add"===t?this.m_utils.addCSSClassName(e,this.getMappedStyle("hover")):this.m_utils.removeCSSClassName(e,this.getMappedStyle("hover"));else if("row"===i)for(var s=this._getIndex(e,"row"),n=this._getSelectionStartAndEnd(this.createIndex(s,this.m_startCol),this.createIndex(s,this.m_endCol),0),o=n.min.row;o<=n.max.row;o++)this._highlightCellsAlongAxis(o,"row","index",t,["hover"])}},z.prototype.handleDatabodyDoubleClick=function(e){if(this._isGridEditable()){var t=e.target,i=this.findCell(t);if("edit"===this._getCurrentMode()){var s=this._getActiveElement();if(i===s)return;if(!this._handleExitEdit(e,s))return}this._handleEditable(e,i),this._handleEdit(e,i)}},z.prototype.handleDatabodyMouseMove=function(e){0===e.buttons&&this.handleMouseUp(e),this.m_databodyMove?this._handleMove(e):this.m_databodyDragState?this.m_floodFillDragState?this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionRange||(this.m_selectionRange=this.GetSelection()),this.handleDatabodyFloodFillDrag(e)):this.handleDatabodySelectionDrag(e):this.m_headerDragState&&(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&(-1!==this.m_selectionFrontier.axis.indexOf("row")||-1!==this.m_selectionFrontier.axis.indexOf("column"))||this.m_deselectInfo&&this.m_deselectInfo.axis&&(-1!==this.m_deselectInfo.axis.indexOf("row")||-1!==this.m_deselectInfo.axis.indexOf("column")))&&this.extendSelectionHeader(e.target,e,!0,this.m_deselectInProgress)},z.prototype.handleDatabodyMouseUp=function(e){this.m_databodyDragState=!1,this.m_headerDragState=!1,this.m_deselectInProgress=!1,this.m_databodyMove&&this._handleMoveMouseUp(e,!0),this.m_options.isFloodFillEnabled()&&this.m_floodFillDragState&&(this._handleFloodFillMouseUp(e),this.m_floodFillDragState=!1)},z.prototype.handleDatabodyKeyUp=function(e){this.m_deselectInProgress&&(this.m_deselectInProgress=e.shiftKey)},z.prototype.handleDatabodyKeyDown=function(e){var t,i=this.m_utils.ctrlEquivalent(e);if(e.defaultPrevented&&i&&(this.keyCodes.LEFT_KEY||this.keyCodes.RIGHT_KEY)||this.m_animating)return;let s=this._getActiveElement();null!=(t=null!=this.m_active&&"header"===this.m_active.type?this._getActionFromKeyDown(e,this.m_active.axis,!1):null!=this.m_active&&"label"===this.m_active.type?this._getActionFromKeyDown(e,this.m_active.axis,!0):null!=this.m_active&&"empty"===this.m_active.type?this._getActionFromNoDataKeydown(e):this._getActionFromKeyDown(e,"cell",!1))&&t.call(this,e,s)&&e.preventDefault()},z.prototype.findPos=function(e){if(e){var t=this.findPos(e.offsetParent),i=this.getElementTranslationXYZ(e.offsetParent);return[parseInt(t[0],10)+parseInt(e.offsetLeft,10)+i[0],parseInt(t[1],10)+parseInt(e.offsetTop,10)+i[1]]}return[0,0]},z.prototype._findHeaderOffset=function(e,t,i){if(i||(i=[0,0]),e!==t){for(;!e.offsetParent;)e=e.parentElement;return e.offsetLeft&&(i[0]+=parseInt(e.offsetLeft,10)),e.offsetTop&&(i[1]+=parseInt(e.offsetTop,10)),this._findHeaderOffset(e.offsetParent,t,i)}return i},z.prototype.getElementTranslationXYZ=function(e){if(e){var t=document.defaultView.getComputedStyle(e,null),i=t.getPropertyValue("-webkit-transform")||t.getPropertyValue("-moz-transform")||t.getPropertyValue("-ms-transform")||t.getPropertyValue("-o-transform")||t.getPropertyValue("transform"),s=i.substr(7,i.length-8).split(", ");return[isNaN(parseInt(s[4],10))?0:parseInt(s[4],10),isNaN(parseInt(s[5],10))?0:parseInt(s[5],10),isNaN(parseInt(s[6],10))?0:parseInt(s[6],10)]}return[0,0,0]},z.prototype.handleDatabodyMouseWheel=function(e){var t,i=this.find(e.target,"header");if(null==i&&(i=this.find(e.target,"endheader")),i&&(t=i===this.m_rowHeader||i===this.m_rowEndHeader?"row":"column"),("row"!==t||this.m_stopRowHeaderFetch&&this.m_stopRowEndHeaderFetch&&this.m_stopRowFetch)&&("column"!==t||this.m_stopColumnHeaderFetch&&this.m_stopColumnEndHeaderFetch&&this.m_stopColumnFetch)||e.preventDefault(),!this.m_animating){var s=this.m_utils.getMousewheelScrollDelta(e),n=s.deltaX,o=s.deltaY;if(null===i&&e.target.classList.contains(this.getMappedStyle("frozenCell"))){let t=this._getCellContainer(e.target);t.classList.contains(this.getMappedStyle("databodyFrozenRow"))?o=0:t.classList.contains(this.getMappedStyle("databodyFrozenCol"))?n=0:t.classList.contains(this.getMappedStyle("databodyFrozenCorner"))&&(n=0,o=0)}"row"===t?n=0:"column"===t&&(o=0);var l=Math.max(0,Math.min(this._getMaxScrollHeight(),this.m_currentScrollTop-o));this._getMaxScrollHeight()!==l&&0!==l&&(this.find(e.target,"header")||this.find(e.target,"databodyFrozenCol"))&&e.preventDefault(),this.scrollDelta(n,o)}},z.prototype.handleTouchStart=function(e){var t=e.touches.length,i=e.touches[0].target;if(1===t){if(this.m_startX=e.touches[0].pageX,this.m_startY=e.touches[0].pageY,this.m_currentX=this.m_startX,this.m_currentY=this.m_startY,this.m_prevX=this.m_startX,this.m_prevY=this.m_startY,this.m_startTime=(new Date).getTime(),this.m_touchActive=!0,this.isMultipleSelection()){i.classList.contains(this.getMappedStyle("selectaffordance"))&&(i=i.parentNode);var s=null;if(i===this.m_topSelectIconContainer?s="top":i===this.m_bottomSelectIconContainer&&(s="bottom"),s){this.m_touchMultipleSelect=!0;var n=this.GetSelection();this.m_touchSelectAnchor="top"===s?n[n.length-1].endIndex:n[n.length-1].startIndex}}!this.m_touchMultipleSelect&&this._isMoveOnElementEnabled(this.findCell(i))&&(this.m_databodyMove=!0)}else this.handleTouchCancel(e)},z.prototype.handleTouchMove=function(e){var t=e.target;if(this.m_touchActive){e.cancelable&&e.preventDefault(),this.m_currentX=e.touches[0].pageX,this.m_currentY=e.touches[0].pageY;var i=this.m_currentX-this.m_prevX,s=this.m_currentY-this.m_prevY,n=this.adjustTouchScroll(i,s);if(i=n[0],s=n[1],this.getResources().isRTLMode()&&(i*=-1),this.m_touchMultipleSelect)this.handleDatabodySelectionDrag(e),this.m_utils.isTouchDeviceNotIOS()||e.preventDefault();else if(this.m_databodyMove)this._removeTouchSelectionAffordance(),this._handleMove(e),this.m_utils.isTouchDeviceNotIOS()||e.preventDefault();else if(this._isEditOrEnter()&&this.m_utils.isTouchDeviceNotIOS()){var o=this._getActiveElement();this.findCell(t)!==o&&this._handleNonSwipeScroll(i,s)}else this._handleNonSwipeScroll(i,s);this.m_prevX=this.m_currentX,this.m_prevY=this.m_currentY}else this.handleTouchCancel(e)},z.prototype.handleTouchEnd=function(e){var t,i=e.target;if(this._isEditOrEnter()){if(t=this._getActiveElement(),this.findCell(i)===t)return void this.handleTouchCancel(e);this._leaveEditing(e,t,!1)}else this._exitActionableMode();if(null!=this.m_lastTapTime&&this.m_startTime-this.m_lastTapTime<250&&this.m_lastTapTarget===i?(this.m_lastTapTime=null,this.m_lastTapTarget=null,null!=(t=this.findCell(i))&&(this._handleEditable(e,t),this._handleEdit(e,t),e.cancelable&&e.preventDefault())):(this.m_lastTapTarget=e.target,this.m_lastTapTime=(new Date).getTime()),this.m_touchActive&&!e.defaultPrevented)if(this.m_touchMultipleSelect)e.cancelable&&e.preventDefault(),this.m_touchMultipleSelect=!1;else{var s=this.m_lastTapTime-this.m_startTime;if(this.m_currentX===this.m_startX&&this.m_currentY===this.m_startY)return this.m_databodyMove=!1,this._isSelectionEnabled()&&s<z.CONTEXT_MENU_TAP_HOLD_DURATION?void this.handleDatabodyClickSelection(e):void this.handleDatabodyClickActive(e);if(this.m_databodyMove)return e.cancelable&&e.preventDefault(),this.m_databodyMove=!1,void this._handleMoveMouseUp(e,!0);this.m_utils.isTouchDeviceNotIOS()&&this._handleSwipe(e)}this.handleTouchCancel(e)},z.prototype._calculateMomentum=function(e,t,i,s,n,o){var l,r=e-t,a=Math.abs(r)/i,h=a*a/(2*z.DECELERATION_FACTOR)*(r<0?-1:1),d=a/z.DECELERATION_FACTOR;return o&&(h*=-1),s-h>n?(l=Math.max(-1*z.MAX_OVERSCROLL_PIXEL,h),h=s-n,d=(r=n-s)/a):s-h<0&&(l=Math.min(z.MAX_OVERSCROLL_PIXEL,h),h=s,d=(r=s)/a),{destination:Math.round(h),duration:Math.min(Math.max(z.MIN_SWIPE_TRANSITION_DURATION,d),z.MAX_SWIPE_TRANSITION_DURATION),overScroll:l}},z.prototype.handleTouchCancel=function(e){this.m_databodyMove&&(this._handleMoveMouseUp(e,!1),this.m_databodyMove=!1),this.m_touchSelectAnchor=null,this.m_touchMultipleSelect=!1,this.m_touchActive=!1,this.m_startX=0,this.m_startY=0,this.m_prevX=0,this.m_prevY=0,this.m_currentX=0,this.m_currentY=0,this.m_startTime=0},z.prototype.handleHeaderTouchStart=function(e){this.m_touchStart=(new Date).getTime();var t=e.touches.length,i=e.target;if(1===t){this.m_startX=e.touches[0].pageX,this.m_startY=e.touches[0].pageY,this.m_currentX=this.m_startX,this.m_currentY=this.m_startY,this.m_prevX=this.m_startX,this.m_prevY=this.m_startY,this.m_touchActive=!0;var s=this.findHeader(i);this.isResizeEnabled()&&(this.handleResize(e),this.handleResizeMouseDown(e),this._highlightResizeMouseDown()),!this.m_isResizing&&this._isMoveOnElementEnabled(s)&&(this.m_databodyMove=!0);let t=this.getHeaderCellAxis(s);this._isDataGridProvider()&&this.m_options._isDragEnabled(t)&&(this.m_utils.addCSSClassName(s,this.getMappedStyle("draggableItem")),s.setAttribute("draggable",!0))}else this.handleHeaderTouchCancel(e)},z.prototype.handleHeaderTouchMove=function(e){if(this.m_touchActive){e.cancelable&&e.preventDefault(),this.m_currentX=e.touches[0].pageX,this.m_currentY=e.touches[0].pageY;var t=this.m_currentX-this.m_prevX,i=this.m_currentY-this.m_prevY;if(this.m_isResizing&&this.isResizeEnabled())this.handleResize(e);else if(this.m_databodyMove)this._removeTouchSelectionAffordance(),this._handleMove(e);else if(this.m_databodyReorder)this._removeTouchSelectionAffordance();else{var s=e.target,n=this.findHeader(s),o=this.getHeaderCellAxis(n);"column"===o||"columnEnd"===o?this._handleNonSwipeScroll(t,0):this._handleNonSwipeScroll(0,i)}this.m_prevX=this.m_currentX,this.m_prevY=this.m_currentY}else this.handleTouchCancel(e)},z.prototype.handleHeaderTouchEnd=function(e){var t;if(this.m_touchActive&&!e.defaultPrevented){var i=e.target;if(this.m_isResizing&&this.isResizeEnabled())this.handleResizeMouseUp(e),this.m_currentX!==this.m_startX&&this.m_currentY!==this.m_startY&&e.cancelable&&e.preventDefault();else if(this.m_currentX===this.m_startX&&this.m_currentY===this.m_startY){var s=this.m_options.getSelectionMode(),n=(t=this.findHeader(i))[this.getResources().getMappedAttribute("context")],o=this.m_root.getAttribute("id"),l=document.querySelector("#"+o+"contextmenu");l&&"none"===l.style.display&&((this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))&&this._isDOMElementSortable(i)?(e.cancelable&&e.preventDefault(),this._removeTouchSelectionAffordance(),this._handleSortIconMouseDown(i),this._handleHeaderSort(e)):this._isDisclosureIcon(i)?(this._removeTouchSelectionAffordance(),this._handleExpandCollapseRequest(e),e.preventDefault()):!this._isSelectionEnabled()||!this.isMultipleSelection()||"row"===s&&-1===n.axis.indexOf("row")||this.m_databodyMove?"row"===s&&-1!==n.axis.indexOf("row")&&this._isSelectionEnabled()?this.handleHeaderClickSelection(e):this.handleHeaderClickActive(e):(0===e.button&&(this.m_headerDragState=!0),this.handleHeaderClickSelection(e)))}else if(this.m_databodyMove)e.cancelable&&e.preventDefault(),this.m_databodyMove=!1,this._handleMoveMouseUp(e,!0);else if(this.m_databodyReorder){e.cancelable&&e.preventDefault(),this.m_databodyReorder=!1,t=this.findHeader(i),"row"===this.getHeaderCellAxis(t)?this.handleRowDragEnd(e):this.handleColumnDragEnd(e)}else t=this.findHeader(i),this._handleSwipe(e,this.getHeaderCellAxis(t))}this.handleHeaderTouchCancel(e)},z.prototype.handleHeaderTouchCancel=function(e){this.m_databodyMove&&(this._handleMoveMouseUp(e,!1),this.m_databodyMove=!1),this.m_touchActive=!1,this.m_startX=0,this.m_startY=0,this.m_prevX=0,this.m_prevY=0,this.m_currentX=0,this.m_currentY=0},z.prototype._handleNonSwipeScroll=function(e,t){var i=(new Date).getTime();this._disableTouchScrollAnimation();var s=this.adjustTouchScroll(e,t);e=s[0],t=s[1],this.scrollDelta(e,t),i-this.m_startTime>z.TAP_AND_SCROLL_RESET&&(this.m_startX=this.m_currentX,this.m_startY=this.m_currentY,this.m_startTime=(new Date).getTime())},z.prototype._handleSwipe=function(e,t){var i=(new Date).getTime()-this.m_startTime,s=this.getResources().isRTLMode(),n=this.m_currentX-this.m_startX,o=this.m_currentY-this.m_startY;if(s&&(n*=-1),Math.abs(n)<z.MIN_SWIPE_DISTANCE&&Math.abs(o)<z.MIN_SWIPE_DISTANCE&&i<z.MIN_SWIPE_DURATION)e.cancelable&&e.preventDefault(),this._isSelectionEnabled()&&this._scrollTouchSelectionAffordance();else if(i<z.MAX_SWIPE_DURATION){var l,r;if(e.cancelable&&e.preventDefault(),"row"!==t&&"rowEnd"!==t?(l=this._calculateMomentum(this.m_currentX,this.m_startX,i,this.m_currentScrollLeft,this.m_scrollWidth,s),isNaN(l.overScroll)||(l.overScroll>0||this.m_stopColumnFetch)&&(this.m_extraScrollOverX=-1*l.overScroll)):(l={duration:0,destination:0},n=0),"column"!==t&&"columnEnd"!==t?(r=this._calculateMomentum(this.m_currentY,this.m_startY,i,this.m_currentScrollTop,this.m_scrollHeight),isNaN(r.overScroll)||(r.overScroll>0||this.m_stopRowFetch)&&(this.m_extraScrollOverY=-1*r.overScroll)):(r={duration:0,destination:0},o=0),this.m_utils.isTouchDeviceNotIOS()){var a=Math.max(l.duration,r.duration);this.m_databody.firstChild.style.transitionDuration=a+"ms",this.m_rowHeader.firstChild.style.transitionDuration=a+"ms",this.m_colHeader.firstChild.style.transitionDuration=a+"ms",this.m_rowEndHeader.firstChild.style.transitionDuration=a+"ms",this.m_colEndHeader.firstChild.style.transitionDuration=a+"ms"}n+=l.destination,o+=r.destination;var h=this.adjustTouchScroll(n,o);n=h[0],o=h[1],this.scrollDelta(n,o)}},z.prototype.fireEvent=function(e,t){if(null!=e&&null!=t){var i=this.callbacks[e];return null==i||i(t)}},z.prototype.addListener=function(e,t){this.callbacks[e]=t},z.prototype.setElementHeight=function(e,t){e.style.height=t+"px"},z.prototype.getElementHeight=function(e){return this.getElementDir(e,"height")},z.prototype.setElementWidth=function(e,t){e.style.width=t+"px"},z.prototype.getElementWidth=function(e){return this.getElementDir(e,"width")},z.prototype.setElementDir=function(e,t,i){e.style[i]=t+"px"},z.prototype.getElementDir=function(e,t){var i;return e.style[t].indexOf("px")>-1&&-1===e.style[t].indexOf("e")?parseFloat(e.style[t]):(document.body.contains(e)?i=Math.round(e["offset"+t.charAt(0).toUpperCase()+t.slice(1)]):(e.style.visibility="hidden",this.m_root.appendChild(e),i=Math.round(e["offset"+t.charAt(0).toUpperCase()+t.slice(1)]),this.m_root.removeChild(e),e.style.visibility=""),i)},z.prototype._computeElementWidthAndHeight=function(e){var t={};return e.style.width.indexOf("px")>-1&&-1===e.style.width.indexOf("e")&&(t.width=parseFloat(e.style.width)),e.style.height.indexOf("px")>-1&&-1===e.style.height.indexOf("e")&&(t.height=parseFloat(e.style.height)),null!=t.width&&null!=t.height||(document.body.contains(e)?(t.width=Math.round(e.offsetWidth),t.height=Math.round(e.offsetHeight)):(e.style.visibility="hidden",this.m_root.appendChild(e),t.width=Math.round(e.offsetWidth),t.height=Math.round(e.offsetHeight),this.m_root.removeChild(e),e.style.visibility="")),t},z.BEFORE=1,z.AFTER=2,z.INSIDE=3,z.prototype._isInViewport=function(e){var t=e.row,i=e.column;return-1===t&&-1===i?-1:-1===t?this._isColumnIndexInViewport(i):-1===i?this._isRowIndexInViewport(t):i>=this.m_startCol&&i<=this.m_endCol&&t>=this.m_startRow&&t<=this.m_endRow?z.INSIDE:-1},z.prototype._isAxisIndexInViewport=function(e,t){return-1===e?-1:"column"===t?this._isColumnIndexInViewport(e):"row"===t?this._isRowIndexInViewport(e):-1},z.prototype._isColumnIndexInViewport=function(e){return e<this.m_startCol?z.BEFORE:e>this.m_endCol?z.AFTER:z.INSIDE},z.prototype._isRowIndexInViewport=function(e){return e<this.m_startRow?z.BEFORE:e>this.m_endRow?z.AFTER:z.INSIDE},z.prototype._isCellBoundaryInViewport=function(e,t,i,s){var n=this._getViewportTop(),o=this._getViewportBottom(),l=this._getViewportLeft(),r=this._getViewportRight();return(s<=o&&s>n||i>=n&&i<o)&&(t<=r&&t>l||e>=l&&e<r)},z.prototype.queueModelEvent=function(e){return!(this.m_initialized&&!this.m_processingEventQueue&&!this.m_animating&&!this.m_processingModelEvent)&&(null==this.m_modelEvents&&(this.m_modelEvents=[]),this.m_modelEvents.push(e),!0)},z.prototype.handleModelEvent=function(e,t){if(void 0!==t||!this.queueModelEvent(e)){var i=e.operation,s=e.keys,n=e.indexes,o=e.result,l=e.header,r=e.endheader,a=e.silent,h=!1;if(this.m_processingModelEvent=!0,e.detail)"delete"===i&&this._handleDeleteRangeEvent(e.detail),"insert"===i&&this._handleInsertRangeEvent(e.detail),"update"===i&&this._handleUpdateRangeEvent(e.detail),"refresh"===i&&this._handleModelRefreshEvent(e.detail);else if("insert"===i)this._adjustActive(i,n),this.m_shouldFocus=!0,this._adjustSelectionOnModelChange(i,s,n),null!=o?(this._handleModelInsertRangeEvent(o,l,r),h=!0):this._handleModelInsertEvent(n,s);else if("update"===i)this._handleModelUpdateEvent(n,s,o),h=!0;else if("delete"===i){let t;if(this._isEditOrEnter()&&(t=this._getCellByIndex(this.m_active.indexes)),t){let i=this.getCellIndexes(t),s=!1;n.forEach(e=>{e.row!==i.row&&e.column!==i.column||(s=!0)}),s&&(this._handleExitEditable(e,t),this._handleExitEdit(e,t))}this._adjustSelectionOnModelChange(i,s,n),this.m_utils.supportsTransitions()?(Array.isArray(s)||(s=new Array(s)),this._handleModelDeleteEventWithAnimation(e,s),s.length>0&&(h=!0)):(this._handleModelDeleteEvent(n,s,a),this._adjustActive(i,n))}else"refresh"===i||"reset"===i?this._handleModelRefreshEvent():"sync"===i&&this._handleModelSyncEvent(e);this.m_processingModelEvent=!1,!h&&t&&this._runModelEventQueue()}},z.prototype._adjustActive=function(e,t){var i,s;if(null!=this.m_active){if("cell"===this.m_active.type)s=!1,i=this.m_active.indexes.row;else{if("header"!==this.m_active.type||"row"!==this.m_active.axis)return;s=!0,i=this.m_active.index}if(Array.isArray(t)||(t=new Array(t)),!0===this.m_moveActive){if("insert"===e)return void(s?this.m_active.index=t[0].row:this.m_active.indexes.row=t[0].row);if("delete"===e&&t[0].row===i)return}for(var n="insert"===e?1:-1,o=0;o<t.length;o++){var l=this._isDataGridProvider()?t[o]:t[o].row;l<i&&this.m_active?s?this.m_active.index+=n:this.m_active.indexes.row+=n:l===i&&"delete"===e&&this._setActive(null,null)}}},z.prototype._adjustSelectionOnModelChange=function(e,t,i){Array.isArray(t)||(t=new Array(t)),Array.isArray(i)||(i=new Array(i));var s=this.GetSelection();if(null!=t&&null!=i&&t.length===i.length&&0!==s.length)for(var n="insert"===e?1:-1,o=0;o<t.length;o++)for(var l,r=t[o].row,a=i[o].row,h=s.length-1;h>=0;h--){var d=s[h],m=d.startKey.row,c=d.endKey.row,u=d.startIndex.row,_=d.endIndex.row;if(m===r){if(c===r&&"delete"===e){s.splice(h,1);continue}l=this._getKey(this._getAxisCellsByIndex(d.startIndex.row+1,"row")[0],"row"),d.startKey.row=l,d.endIndex.row+=n}else c===r?(l=this._getKey(this._getAxisCellsByIndex(d.startIndex.row-1,"row")[0],"row"),d.endKey.row=l,d.endIndex.row+=n):a<=u?(d.startIndex.row+=n,d.endIndex.row+=n):a<_&&(d.endIndex.row+=n)}else if(this.m_moveActive&&"insert"===e){var p;if(this._isSelectionEnabled()&&this._isDatabodyCellActive())p="cell"===this.m_options.getSelectionMode()?this.createRange(this.m_active.indexes,this.m_active.indexes,t[0],t[0]):this.createRange(i[0],i[0],t[0],t[0]),this.m_selectionFrontier=this.m_active.indexes,s.push(p);this.m_moveActive=!1}},z.prototype._simpleAdjustSelectionOnChange=function(e,t,i){let s=this.GetSelection(),n="insert"===e?1:-1;for(let o=0;o<t.length;o++){let l=t[o];for(let t=s.length-1;t>=0;t--){let o=s[t],r=o.startIndex[i],a=o.endIndex[i];if(r===l){if(a===l&&"delete"===e){s.splice(t,1);continue}if("delete"===e){let e=this._getKey(this._getAxisCellsByIndex(o.startIndex[i]+1,i)[0],i);o.startKey[i]=e}else o.startIndex[i]+=n;o.endIndex[i]+=n}else if(a===l){if("delete"===e){let e=this._getKey(this._getAxisCellsByIndex(o.endIndex[i]-1,i)[0],i);void 0===o.endKey&&(o.endKey={row:null,column:null}),o.endKey[i]=e}o.endIndex[i]+=n}else l<r?(o.startIndex[i]+=n,o.endIndex[i]+=n):l<a&&(o.endIndex[i]+=n)}}},z.prototype._handleInsertRangeEvent=function(e){let t=e.axis,i=e.ranges;if(0===i.length)return void this.fillViewport();i.sort(function(e,t){return e.offset-t.offset});let s=i.shift(),n=s.offset,o=s.count,l=this._isAxisIndexInViewport(n,t);if(l===z.INSIDE){let i=n,l=o,r=this.m_startCol,a=this.m_endCol-this.m_startCol+1;"column"===t&&(i=this.m_startRow,l=this.m_endRow-this.m_startRow+1,r=n,a=o);let h,d=document.createDocumentFragment(),m=document.createDocumentFragment(),c=new Promise(function(e){h=e}),u={axis:t,range:s,headerFragment:d,endHeaderFragment:m,totalDimension:0,promiseResolve:h};this.fetchHeaders(t,n,d,m,o,{success:this._handleInsertRangeHeaderFetchSuccess.bind(this,u),error:this.handleCellsFetchError}),this.fetchCells(this.m_databody,i,r,l,a,{success:this._handleInsertRangeCellFetchSuccess.bind(this,u),error:this.handleCellsFetchError}),c.then(this._handleInsertRangeEvent.bind(this,e))}else if(l===z.BEFORE){let i=this.m_avgRowHeight,s=i*o,l=this.m_rowHeader,r=this.m_rowEndHeader;"row"===t?(this.m_endRow>=0&&(this.m_startRow+=o,this.m_endRow+=o,this.m_startRowPixel+=s,this.m_endRowPixel+=s),this.m_endRowHeader>=0&&(this.m_startRowHeader+=o,this.m_endRowHeader+=o,this.m_startRowHeaderPixel+=s,this.m_endRowHeaderPixel+=s),this.m_endRowEndHeader>=0&&(this.m_startRowEndHeader+=o,this.m_endRowEndHeader+=o,this.m_startRowEndHeaderPixel+=s,this.m_endRowEndHeaderPixel+=s)):(i=this.m_avgColWidth,s=i*o,l=this.m_colHeader,r=this.m_colEndHeader,this.m_endCol>=0&&(this.m_startCol+=o,this.m_endCol+=o,this.m_startColPixel+=s,this.m_endColPixel+=s),this.m_endColHeader>=0&&(this.m_startColHeader+=o,this.m_endColHeader+=o,this.m_startColHeaderPixel+=s,this.m_endColHeaderPixel+=s),this.m_endColEndHeader>=0&&(this.m_startColEndHeader+=o,this.m_endColEndHeader+=o,this.m_startColEndHeaderPixel+=s,this.m_endColEndHeaderPixel+=s));let a=new Array(o).fill(n).map((e,t)=>e+t),h=new Array(o).fill(i);this._modifyAndPushCells(a,h,t,this.m_databody,l,r,!0),this._refreshDatabodyMap(),this._handleInsertRangeEvent(e)}else l===z.AFTER&&("row"===t?(this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1):(this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1),this._handleInsertRangeEvent(e))},z.prototype._handleUpdateRangeEvent=function(e){let t=e.ranges;if(0===t.length)return this._highlightActive(),this._resetEditableClone(),this.applySelection(),this._resetHeaderHighLight(),void this.fillViewport();t.sort(function(e,t){return e.offset-t.offset});let i=t.shift(),s=i.rowOffset,n=i.columnOffset,o=-1===i.rowCount?this._getMaxBottom()+1:i.rowCount,l=-1===i.columnCount?this._getMaxRight()+1:i.columnCount,r=s+o-1,a=n+l-1,h=this._isAxisIndexInViewport(s,"row"),d=this._isAxisIndexInViewport(r,"row"),m=this._isAxisIndexInViewport(n,"column"),c=this._isAxisIndexInViewport(a,"column");if(h!==z.AFTER&&d!==z.BEFORE&&m!==z.AFTER&&c!==z.BEFORE){let t;h===z.BEFORE&&(s=this._getMaxTop()),d===z.AFTER&&(r=this._getMaxBottom()),m===z.BEFORE&&(n=this._getMaxLeft()),c===z.AFTER&&(a=this._getMaxRight()),o=r-s+1,l=a-n+1;let u,_,p=!1;-1!==i.rowCount&&-1!==i.columnCount||(p=!0,t=-1===i.rowCount?"column":"row"),"row"===t?(u=s,_=o):"column"===t&&(u=n,_=l);let g,C=document.createDocumentFragment(),f=document.createDocumentFragment(),y=new Promise(function(e){g=e}),E={axis:t,range:i,headerFragment:C,endHeaderFragment:f,totalDimension:0,promiseResolve:g};this.m_fetchingForUpdate=!0,p?(E.editHeader=!0,this.fetchHeaders(t,u,C,void 0,_,{success:this._handleInsertRangeHeaderFetchSuccess.bind(this,E),error:this.handleHeadersFetchError}),this.fetchCells(this.m_databody,s,n,o,l,{success:this._handleUpdateEditableHeader.bind(this,E),error:this.handleCellsFetchError})):this.fetchCells(this.m_databody,s,n,o,l,{success:this._handleUpdateRangeFetchSuccess.bind(this,E),error:this.handleCellsFetchError}),y.then(this._handleUpdateRangeEvent.bind(this,e))}else this._handleUpdateRangeEvent(e)},z.prototype._handleUpdateEditableHeader=function(e,t,i){this.m_fetchingForUpdate=!1;let s,n,o=e,l=o.range,r=o.axis,a=o.editHeader;"column"===r?(s=l.columnOffset,n=l.columnCount):"row"===r&&(s=l.rowOffset,n=l.rowCount);let h={axis:r,ranges:[{offset:s,count:n}],editHeader:a};this._handleDeleteRangeEvent(h),delete o.range,o.range={offset:s,count:n},this._handleInsertRangeCellFetchSuccess(o,t,i),this._signalTaskEnd()},z.prototype._handleInsertRangeHeaderFetchSuccess=function(e,t,i,s){const n=i.axis;this._signalTaskEnd(),this.m_fetching[n]=!1;const o=this.getResources().isRTLMode()?"right":"left",l=i.start,r=e.range.count,a=e.headerFragment,h=e.endHeaderFragment,d="row"===n?"top":o;let m,c,u;"column"===n&&this.updateHiddenColumnsForInsertion(l,r);let _,p,g,C,f,y,E,v=0,w=0;if(null!=t){for(g=this.getMappedStyle("headercell"),"row"===n?(f=this.m_rowHeaderLevelCount,g+=" "+this.getMappedStyle("rowheadercell")):(f=this.m_columnHeaderLevelCount,g+=" "+this.getMappedStyle("colheadercell")),m=this._getHeaderCellByIndex(l,n,f-1),c=this.getElementDir(m,d),"column"===n&&this._hasFrozenColumns()&&l===this.m_frozenColIndex+1?this.m_colHeaderFrozen?c=this.getElementWidth(this.m_colHeaderFrozen):this.m_colEndHeaderFrozen&&(c=this.getElementWidth(this.m_colEndHeaderFrozen)):"row"===n&&this._hasFrozenRows()&&l===this.m_frozenRowIndex+1&&(this.m_rowHeaderFrozen?c=this.getElementHeight(this.m_rowHeaderFrozen):this.m_rowEndHeaderFrozen&&(c=this.getElementHeight(this.m_rowEndHeaderFrozen))),u=t.getCount(),C=this.getRendererOrTemplate(n);u-v>0;)"row"===n?(y=0,E=c+w):(y=c+w,E=0),_=l+v,("column"===n&&this._hasFrozenColumns()&&_<=this.m_frozenColIndex+1||"row"===n&&this._hasFrozenRows()&&_<=this.m_frozenRowIndex+1)&&(g=`${g} ${this.getMappedStyle("frozenHeader")}`),p=this.buildLevelHeaders(a,_,0,y,E,!0,!1,C,t,n,g,f),v+=p.count,w+=p.totalHeaderDimension;w>e.totalDimension&&(e.totalDimension=w)}if(w=0,v=0,null!=s){g=this.getMappedStyle("endheadercell"),"row"===n?(f=this.m_rowEndHeaderLevelCount,g+=" "+this.getMappedStyle("rowendheadercell")):(f=this.m_columnEndHeaderLevelCount,g+=" "+this.getMappedStyle("colendheadercell"));const t=`${n}End`;for(m=this._getHeaderCellByIndex(l,t,f-1),c=this.getElementDir(m,d),u=s.getCount(),C=this.getRendererOrTemplate(t);u-v>0;)"row"===n?(y=0,E=c+w):(y=c+w,E=0),_=l+v,p=this.buildLevelHeaders(h,_,0,y,E,!0,!1,C,s,t,g,f),v+=p.count,w+=p.totalHeaderDimension;w>e.totalDimension&&(e.totalDimension=w)}},z.prototype._handleInsertRangeCellFetchSuccess=function(e,t,i){const s=e.range,n=e.axis,o=e.editHeader,l=e.headerFragment,r=e.endHeaderFragment;let a=e.totalDimension;const h=this.getResources().isRTLMode()?"right":"left",d=document.createDocumentFragment(),m=document.createDocumentFragment(),c=document.createDocumentFragment(),u=document.createDocumentFragment();let _=this.m_rowHeader,p=this.m_rowEndHeader,g=this.m_databodyFrozenRow,C=this.m_rowHeaderFrozen,f=this.m_rowEndHeaderFrozen;if("column"===n&&(_=this.m_colHeader,p=this.m_colEndHeader,g=this.m_databodyFrozenCol,C=this.m_colHeaderFrozen,f=this.m_colEndHeaderFrozen),this._signalTaskEnd(),this.m_fetching.cells=!1,o||this.unhighlightSelection(),t){let e=i[0].start;let s=i[1].start,o=t.getCount("row"),l=t.getCount("column");const r=this._getCellByIndex(this.createIndex(e,s));let _,p;if(r?(_="row"===n?this.getElementDir(r,"top"):this.m_startRowPixel,p="row"===n?this.m_startColPixel:this.getElementDir(r,h),"column"===n&&this._hasFrozenColumns()&&s===this.m_frozenColIndex+1&&(p=this.getElementWidth(this.m_databodyFrozenCol)),"row"===n&&this._hasFrozenRows()&&e===this.m_frozenRowIndex+1&&(_=this.getElementHeight(this.m_databodyFrozenRow))):(_="row"===n?this._getMaxBottomPixel():this.m_startRowPixel,p="row"===n?this.m_startColPixel:this._getMaxRightPixel()),"column"===n)if(this._hasFrozenColumns()&&s<=this.m_frozenColIndex+1){this.m_databodyFrozenCorner&&(this._addCellsToFragment(u,t,e,_,s,p,this.m_frozenRowIndex+1,null),e=this.m_frozenRowIndex+1,o-=this.m_frozenRowIndex+1);const i=this._addCellsToFragment(m,t,e,_,s,p,o,l);a=Math.max(a,i.totalColumnWidth)}else{this._hasFrozenRows()&&(this._addCellsToFragment(c,t,e,_,s,p,this.m_frozenRowIndex+1,null),e=this.m_frozenRowIndex+1,o-=this.m_frozenRowIndex+1);const i=this._addCellsToFragment(d,t,e,_,s,p,o,null);a=Math.max(a,"row"===n?i.totalRowHeight:i.totalColumnWidth)}else if("row"===n)if(this._hasFrozenRows()&&e<=this.m_frozenRowIndex+1){this.m_databodyFrozenCorner&&(this._addCellsToFragment(u,t,e,_,s,p,null,this.m_frozenColIndex+1),s=this.m_frozenColIndex+1,l-=this.m_frozenColIndex+1);const i=this._addCellsToFragment(c,t,e,_,s,p,o,l);a=Math.max(a,i.totalRowHeight)}else{this._hasFrozenColumns()&&(this._addCellsToFragment(m,t,e,_,s,p,null,this.m_frozenColIndex+1),s=this.m_frozenColIndex+1,l-=this.m_frozenColIndex+1);const i=this._addCellsToFragment(d,t,e,_,s,p,null,l);a=Math.max(a,i.totalRowHeight)}}let y=this.getMappedStyle("frozenCell");if(u.childNodes&&u.childNodes.length)for(let e=0;e<=u.childNodes.length;e++){let t=u.childNodes[e];this.m_utils.addCSSClassName(t,y)}if(m.childNodes&&m.childNodes.length)for(let e=0;e<=m.childNodes.length;e++){let t=m.childNodes[e];this.m_utils.addCSSClassName(t,y)}if(c.childNodes&&c.childNodes.length)for(let e=0;e<=c.childNodes.length;e++){let t=c.childNodes[e];this.m_utils.addCSSClassName(t,y)}const E=s.offset,v=s.count;let w=new Array(v).fill(E).map((e,t)=>e+t),H=0,x=0;(this._hasFrozenColumns()||this._hasFrozenRows())&&("column"===n&&E<=this.m_frozenColIndex+1||"row"===n&&E<=this.m_frozenRowIndex+1)?x=new Array(v).fill(a/v):H=new Array(v).fill(a/v);let S=d.childNodes.length,b=l.childNodes.length,R=r.childNodes.length,I=this.m_databody.firstChild,M=[];for(let e=w.length-1;e>=0;e--){let t=w[e];("column"===n&&this._hasFrozenColumns()&&t<=this.m_frozenColIndex+1||"row"===n&&this._hasFrozenRows()&&t<=this.m_frozenRowIndex+1)&&(M.push(t),w.splice(e,1))}this._modifyAndPushCells(w,H,n,this.m_databody,_,p,!0,M.length),"column"===n&&this.m_databodyFrozenRow?this._modifyAndPushCells(w,H,n,this.m_databodyFrozenRow,null,null,!0,M.length):"row"===n&&this.m_databodyFrozenCol&&this._modifyAndPushCells(w,H,n,this.m_databodyFrozenCol,null,null,!0,M.length),M.length&&(this._modifyAndPushCells(M,x,n,g,C,f,!0),this.m_databodyFrozenCorner&&this._modifyAndPushCells(M,x,n,this.m_databodyFrozenCorner,null,null,!0),"column"===n?this.m_frozenColIndex+=M.length:this.m_frozenRowIndex+=M.length),o||this._simpleAdjustSelectionOnChange("insert",w,n);let F=!1;if(d.childNodes.length&&(I.appendChild(d),F=!0),m.childNodes.length&&(I=this.m_databodyFrozenCol.firstChild,I.appendChild(m),F=!0),c.childNodes.length&&(I=this.m_databodyFrozenRow.firstChild,I.appendChild(c),F=!0),u.childNodes.length&&(this.m_databodyFrozenCorner.firstChild.appendChild(u),F=!0),F&&this._refreshDatabodyMap(),this._insertHeaders(n,E,l,r),this.hideStatusText(),"row"===n){if(S&&(this.m_endRow+=v,this.m_endRowPixel+=a,this.m_stopRowFetch=!1),b&&(this.m_endRowHeader+=v,(!this._hasFrozenRows()||this._hasFrozenRows()&&E>this.m_frozenRowIndex+1)&&(this.m_endRowHeaderPixel+=a),this.m_stopRowHeaderFetch=!1),R&&(this.m_endRowEndHeader+=v,this.m_endRowEndHeaderPixel+=a,this.m_stopRowEndHeaderFetch=!1),this._hasFrozenRows()&&E<=this.m_frozenRowIndex+1){let e=this.getElementHeight(this.m_databodyFrozenRow)+a;this.setElementHeight(this.m_databodyFrozenRow,e),this.m_databodyFrozenCorner&&this.setElementHeight(this.m_databodyFrozenCorner,e)}else{let e=this.getElementHeight(I)+a;this.setElementHeight(I,e)}this.updateRowBanding()}else if("column"===n){if(S&&(this.m_endCol+=v,this.m_endColPixel+=a,this.m_stopColumnFetch=!1),b&&(this.m_endColHeader+=v,(!this._hasFrozenColumns()||this._hasFrozenColumns()&&E>this.m_frozenColIndex+1)&&(this.m_endColHeaderPixel+=a),this.m_stopColumnHeaderFetch=!1),R&&(this.m_endColEndHeader+=v,this.m_endColEndHeaderPixel+=a,this.m_stopColumnEndHeaderFetch=!1),this._hasFrozenColumns()&&E<=this.m_frozenColIndex+1){let e=this.getElementWidth(this.m_databodyFrozenCol)+a;this.setElementWidth(this.m_databodyFrozenCol,e),this.m_databodyFrozenCorner&&this.setElementWidth(this.m_databodyFrozenCorner,e)}else{let e=this.getElementWidth(I)+a;this.setElementWidth(I,e)}this.updateColumnBanding()}this.deleteAndApplyHiddenIndicators(),o||(this.applySelection(),this._resetHeaderHighLight(),this.resizeGrid()),e.promiseResolve()},z.prototype._insertHeaders=function(e,t,i,s){let n=this.m_rowHeader,o=this.m_rowEndHeader;this._hasFrozenRows()&&t<=this.m_frozenRowIndex&&(n=this.m_rowHeaderFrozen,o=this.m_rowEndHeaderFrozen);let l,r=this.m_rowHeaderLevelCount,a=this.m_rowEndHeaderLevelCount,h=this.m_startRowHeader,d=this.m_startRowEndHeader,m="height",c="top";"column"===e&&(n=this.m_colHeader,o=this.m_colEndHeader,this._hasFrozenColumns()&&t<=this.m_frozenColIndex&&(n=this.m_colHeaderFrozen,o=this.m_colEndHeaderFrozen),r=this.m_columnHeaderLevelCount,a=this.m_columnEndHeaderLevelCount,h=this.m_startColHeader,d=this.m_startColEndHeader,m="width",c=this.getResources().isRTLMode()?"right":"left");let u=(e,t,i,s,n,o,l)=>{for(;e.childNodes.length;){let r,a=e.firstChild;if(this.m_utils.containsCSSClassName(a,this.getMappedStyle("groupingcontainer"))){if(r=a.firstChild,null==r||this.m_utils.containsCSSClassName(r,this.getMappedStyle("groupingcontainer"))){e.removeChild(a);continue}}else r=a;let h=r.extentInfo,d=h.more.before,m=h.more.after,c=r[this.getResources().getMappedAttribute("context")],_=c.index,p=c.extent,g=c.level;if(d){let e=this._getHeaderContainer(_-1,g,0,null,t,i),s=e.firstChild,l=s[this.getResources().getMappedAttribute("context")];c.extent+=l.extent,c.index=l.index;let a=this._getAttribute(e,"extent",!0);this._setAttribute(e,"extent",a+p);let h=this.getElementDir(s,n),d=this.getElementDir(r,n);this.setElementDir(r,h+d,n);let m=this.getElementDir(s,o);this.setElementDir(r,m,o),e.replaceChild(r,s)}else if(m){let e=this._getHeaderContainer(_+p,g,0,null,t,i),s=e.firstChild,l=s[this.getResources().getMappedAttribute("context")];c.extent+=l.extent,c.index=l.index-p;let a=this._getAttribute(e,"extent",!0);this._setAttribute(e,"extent",a+p);let h=this._getAttribute(e,"start",!0);this._setAttribute(e,"start",h-p);let d=this.getElementDir(s,n),m=this.getElementDir(r,n);this.setElementDir(r,d+m,n);let u=this.getElementDir(s,o);this.setElementDir(r,u-m,o),e.replaceChild(r,s)}else{let e=this._getHeaderContainer(_,g,0,null,t,i);if(e){let t=this._getHeaderCellByIndex(_-1,l,g);if(null===t||t.parentNode!==e){let t=g===i-1?e.childNodes[1]:e.childNodes[0];e.insertBefore(r,t)}else t.nextSibling&&t.nextSibling.parentNode===e?e.insertBefore(r,t.nextSibling):e.appendChild(r)}else{let e=this._getHeaderContainer(_-1,g,0,null,t,i);if(null===e){let e=t.firstChild;e.firstChild?e.insertBefore(a,e.firstChild):e.appendChild(a)}else e.nextSibling?e.parentNode.insertBefore(a,e.nextSibling):e.parentNode.appendChild(a)}}if(d||m){let e=a.querySelector("."+this.getMappedStyle("groupingcontainer"));e&&u(e,t,i,s,n,o,l)}}};if(i.childNodes.length&&(1===r?(l=this._getHeaderCellByIndex(t,e,r-1),n.firstChild.insertBefore(i,l)):u(i,n,r,h,m,c,e)),s.childNodes.length){let i=e+"End";1===a?(l=this._getHeaderCellByIndex(t,i,r-1),o.firstChild.insertBefore(s,l)):u(s,o,a,d,m,c,i)}},z.prototype._handleModelInsertEvent=function(e,t){var i=this._isInViewport(e);if(i===z.INSIDE||i===z.AFTER&&e.row===this.m_endRow+1)null!=t.row&&(this._databodyEmpty()?(this.empty(),this.refresh(this.m_root)):(this._modifyAxisCellContextIndex("row",e.row,this.m_endRow-e.row+1,1),this._refreshDatabodyMap(),this.fetchHeaders("row",e.row,this.m_rowHeader,this.m_rowEndHeader,1,{success:this._handleHeaderInsertsFetchSuccess}),this.fetchCells(this.m_databody,e.row,this.m_startCol,1,this.m_endCol-this.m_startCol+1,{success:this._handleCellInsertsFetchSuccess})));else{if(i===z.BEFORE){this._modifyAxisCellContextIndex("row",0,this.m_endRow+1,1),this._refreshDatabodyMap(),this.m_startRow+=1,this.m_startRowHeader+=1,this.m_endRow+=1,this.m_endRowHeader+=1,this.m_startRowPixel+=this.m_avgRowHeight,this.m_startRowHeaderPixel+=this.m_avgRowHeight,this.m_endRowPixel+=this.m_avgRowHeight,this.m_endRowHeaderPixel+=this.m_avgRowHeight;var s=this.m_databody.firstChild.firstChild;null!=s&&this.pushRowsDown(s,this.m_avgRowHeight);var n=this.m_rowHeader.firstChild.firstChild;null!=n&&this.pushRowsDown(n,this.m_avgRowHeight);var o=this.m_rowEndHeader.firstChild.firstChild;null!=o&&this.pushRowsDown(o,this.m_avgRowHeight)}this.scrollToIndex(e)}},z.prototype._handleCellInsertsFetchSuccess=function(e,t){this.m_resizeRequired=!0,this.handleCellsFetchSuccess(e,t,this.m_endRow>=t[0].start);var i=t[0].start;this._scrollRowIntoViewport(i),this._isHighWatermarkScrolling()||this._cleanupViewport("top"),this.updateRowBanding(),this.m_stopRowFetch=!1,-1!==this.m_endRowHeader&&(this.m_stopRowHeaderFetch=!1),-1!==this.m_endRowEndHeader&&(this.m_stopRowEndHeaderFetch=!1),this.fillViewport()},z.prototype._handleHeaderInsertsFetchSuccess=function(e,t,i){this.m_resizeRequired=!0,this.handleHeadersFetchSuccess(e,t,i,this.m_endRowHeader>=t.start)},z.prototype._scrollRowIntoViewport=function(e){var t=this._getAxisCellsByIndex(e,"row");if(null!=t){var i=this._getViewportTop(),s=this._getViewportBottom(),n=this.getElementDir(t[0],"top"),o=i-n;(o>0||(o=s-n)<0)&&this.scrollDelta(0,o)}},z.prototype._handleModelInsertRangeEvent=function(e,t,i){var s,n,o,l,r,a,h,d,m=this._getEmptyElement(),c=e.getStart("row"),u=e.getCount("row"),_=e.getStart("column"),p=e.getCount("column");if(!(c>this.m_endRow+1))if(m)this.empty(),this.refresh(this.m_root);else if(this.m_utils.supportsTransitions()){if(null!=t){s=document.createDocumentFragment();var g=t.getCount();for(l=0,n=0,a=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell"),h=this.getRendererOrTemplate("row");g-n>0;)o=c+n,n+=(r=this.buildLevelHeaders(s,o,0,0,l,!0,c!==this.m_endRowHeader+1,h,t,"row",a,this.m_rowHeaderLevelCount)).count,l+=r.totalHeaderDimension}if(null!=i){d=document.createDocumentFragment();var C=i.getCount();for(l=0,n=0,a=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell"),h=this.getRendererOrTemplate("rowEnd");C-n>0;)o=c+n,n+=(r=this.buildLevelHeaders(d,o,0,0,l,!0,c!==this.m_endRowEndHeader+1,h,i,"rowEnd",a,this.m_rowEndHeaderLevelCount)).count,l+=r.totalHeaderDimension}var f=document.createDocumentFragment();if(r=this._addCellsToFragment(f,e,c,0,_,0),!(0!==f.childNodes.length||null!=s&&0!==s.childNodes.length||null!=d&&0!==d.childNodes.length))return;this._insertRowsWithAnimation(f,s,d,c,e.getCount("row"),r.totalRowHeight,_,p)}else{var y={axis:"row",start:c,count:u},E={axis:"column",start:_,count:p};if(null!=t){var v={axis:"row",header:this.m_rowHeader,endHeader:this.m_rowEndHeader,start:c,count:t.getCount()};this.m_fetching.row=v,this._handleHeaderInsertsFetchSuccess(t,v,i)}this._modifyAxisCellContextIndex("row",c,this.m_endRow-c+1,u),this._refreshDatabodyMap(),this._handleCellInsertsFetchSuccess(e,[y,E])}},z.prototype._handleModelUpdateEvent=function(e,t,i){if(this._isInViewport(e)===z.INSIDE)if(null!=i){var s=this.getRendererOrTemplate("cell"),n=this.m_options.getColumnBandingInterval();this._updateCellsInRow(i,i.getStart("row"),s,this.m_startCol,n)}else-1!==this.m_endRowHeader&&this.fetchHeaders("row",e.row,this.m_rowHeader,this.m_rowEndHeader,1,{success:this._handleHeaderUpdatesFetchSuccess,error:this.handleHeadersFetchError}),this.fetchCells(this.m_databody,e.row,this.m_startCol,1,this.m_endCol-this.m_startCol+1,{success:this._handleCellUpdatesFetchSuccess,error:this.handleCellsFetchError})},z.prototype._handleHeaderUpdatesFetchSuccess=function(e,t,i){var s=t.axis;this.m_fetching[s]=!1;var n=t.start;this._replaceHeaders(this.buildRowHeaders.bind(this),e,this.m_rowHeader,n,this.m_startRowHeader),this._replaceHeaders(this.buildRowEndHeaders.bind(this),i,this.m_rowEndHeader,n,this.m_startRowEndHeader);var o=this.m_rowHeader.firstChild.childNodes[n-this.m_startRowHeader];null==this.m_active||"header"!==this.m_active.type||"row"!==this.m_active.axis&&"rowEnd"!==this.m_active.axis||this._getKey(o,"row")!==this.m_active.key||this._highlightActive(),this._signalTaskEnd()},z.prototype._replaceHeaders=function(e,t,i,s,n){if(null!=t){var o=e(i,t,s,1,!0,!0),l=i.firstChild,r=l.childNodes[s-n];l.replaceChild(o,r)}},z.prototype._handleCellUpdatesFetchSuccess=function(e,t){this.m_fetching.cells=!1;var i=t[0].start,s=this.getRendererOrTemplate("cell"),n=this.m_options.getColumnBandingInterval();this._updateCellsInRow(e,i,s,this.m_startCol,n),this._signalTaskEnd()},z.prototype._getUpdateAnimationDuration=function(){return z.UPDATE_ANIMATION_DURATION},z.prototype._updateCellsInRow=function(e,t,i,s,n){var o,l=this._getUpdateAnimationDuration(),r=this._getAxisCellsByIndex(t,"row"),a=this.getElementDir(r[0],"top");if(0!==l&&this.m_utils.supportsTransitions()){var h=this;h._signalTaskStart(),this._removeFromArray(r),o=document.createDocumentFragment(),this._addCellsToFragment(o,e,t,a,s,this.m_startColPixel),r=o.childNodes;for(var d=this.getElementWidth(this.m_databody),m=0;m<r.length;m++)this.addTransformMoveStyle(r[m],0,0,"linear",d,0,0);this._populateDatabody(this.m_databody.firstChild,o),r=this._getAxisCellsByIndex(t,"row"),this.hideStatusText();this._onEndEvent("transitionend",r[r.length-1],function(){for(var e=0;e<r.length;e++)h.removeTransformMoveStyle(r[e]);h._isSelectionEnabled()&&h.applySelection(),h._highlightActive(),h._signalTaskEnd(),h._runModelEventQueue()},l),setTimeout(function(){for(var e=0;e<r.length;e++)h.addTransformMoveStyle(r[e],l+"ms",0,"linear",0,0,0)},0)}else this._removeFromArray(r),o=document.createDocumentFragment(),this._addCellsToFragment(o,e,t,a,s,this.m_startColPixel),this._populateDatabody(this.m_databody.firstChild,o),this._isSelectionEnabled()&&this.applySelection(),this._highlightActive(),this.hideStatusText()},z.prototype._handleUpdateRangeFetchSuccess=function(e,t,i){this.m_fetching.cells=!1,this.m_fetchingForUpdate=!1;const s=i[0].start,n=s+t.getCount("row")-1,o=i[1].start,l=o+t.getCount("column")-1;this._splitRange(t,s,n,o,l),this.hideStatusText(),this._signalTaskEnd(),e.promiseResolve()},z.prototype._splitRange=function(e,t,i,s,n){let o=i<this.m_frozenRowIndex?i:this.m_frozenRowIndex,l=n<this.m_frozenColIndex?n:this.m_frozenColIndex;null!==this.m_frozenRowIndex&&null!==this.m_frozenColIndex&&t<=this.m_frozenRowIndex&&s<=this.m_frozenColIndex?(this._fetchAndMutateCellsByRange(e,this.m_databodyFrozenCorner,t,o,s,l),i>this.m_frozenRowIndex&&this._fetchAndMutateCellsByRange(e,this.m_databodyFrozenCol,this.m_frozenRowIndex+1,i,s,l),n>this.m_frozenColIndex&&this._fetchAndMutateCellsByRange(e,this.m_databodyFrozenRow,t,o,this.m_frozenColIndex+1,n),i>this.m_frozenRowIndex&&(t=this.m_frozenRowIndex+1),n>this.m_frozenColIndex&&(s=this.m_frozenColIndex+1)):this.m_databodyFrozenCol&&null!==this.m_frozenColIndex&&s<=this.m_frozenColIndex?(this._fetchAndMutateCellsByRange(e,this.m_databodyFrozenCol,t,i,s,l),s=this.m_frozenColIndex+1):this.m_databodyFrozenRow&&null!==this.m_frozenRowIndex&&t<=this.m_frozenRowIndex&&(this._fetchAndMutateCellsByRange(e,this.m_databodyFrozenRow,t,o,s,n),t=this.m_frozenRowIndex+1);let r=null!==this.m_frozenColIndex&&-1!==this.m_frozenColIndex,a=null!==this.m_frozenRowIndex&&-1!==this.m_frozenRowIndex;(!r&&!a||(r||a)&&i>this.m_frozenRowIndex&&n>this.m_frozenColIndex)&&this._fetchAndMutateCellsByRange(e,this.m_databody,t,i,s,n)},z.prototype._fetchAndMutateCellsByRange=function(e,t,i,s,n,o){let l=this._getCellsInRange(i,n,s,o);const r=this.getElementDir(l[0],"top"),a=this.getResources().isRTLMode()?"right":"left",h=this.getElementDir(l[0],a),d=s-i+1,m=o-n+1;this._removeFromArray(l);let c=document.createDocumentFragment();this._addCellsToFragment(c,e,i,r,n,h,d,m),this._populateDatabody(t.firstChild,c)},z.prototype._removeAndModifyCells=function(e,t){e.forEach(e=>{let i=e[this.getResources().getMappedAttribute("context")];1===i.extents[t]?this._remove(e):i.extent[t]-=1})},z.prototype._removeAndModifyHeaders=function(e,t,i,s,n){e.forEach(e=>{let o=e[this.getResources().getMappedAttribute("context")],l=o.extent,r=e.parentNode;if(1===l)this._remove(e),0!==r.childNodes.length||r.classList.contains(this.getMappedStyle("scroller"))||this._remove(r);else{let l=this.getElementDir(e,i);this.setElementDir(e,l-t,i),o.extent-=1;let a=o.index;if(a===n){o.index+=1;let i=this.getElementDir(e,s);this.setElementDir(e,i+t,s)}if(r.classList.contains(this.getMappedStyle("groupingcontainer"))){let e=this._getAttribute(r,"extent",!0),t=this._getAttribute(r,"start",!0);this._setAttribute(r,"extent",e-1),a===n&&this._setAttribute(r,"start",t+1)}}})},z.prototype._handleDeleteRangeEvent=function(e){let t=e.ranges,i=new Set,s=e.axis,n=e.editHeader,o=this.getResources().isRTLMode()?"right":"left",l=this.m_selection;for(let e=0;e<l.length;e++)this._applyBorderClassesAroundRange(this.getElementsInRange(l[e]),l[e],!1,"Selected");t.forEach(function(e){let t=e.offset,s=e.count;for(var n=0;n<s;n++)i.add(t+n)});let r=Array.from(i);r.sort(function(e,t){return t-e});let a=0,h=0,d=0,m=0,c=0,u=0,_=this.m_databodyFrozenRow,p=this.m_rowHeader,g=this.m_rowHeaderFrozen,C=this.m_startRowEndHeader,f=this.m_rowEndHeader,y=this.m_rowEndHeaderFrozen,E=this.m_rowEndHeaderLevelCount,v=this.m_avgRowHeight,w=-1!==this.m_endRow,H=-1!==this.m_endRowHeader,x=-1!==this.m_endRowEndHeader,S="height",b="top";"column"===s&&(_=this.m_databodyFrozenCol,C=this.m_startColEndHeader,p=this.m_colHeader,g=this.m_colHeaderFrozen,f=this.m_colEndHeader,y=this.m_colEndHeaderFrozen,E=this.m_columnEndHeaderLevelCount,v=this.m_avgColWidth,w=-1!==this.m_endCol,H=-1!==this.m_endColHeader,x=-1!==this.m_endColEndHeader,S="width",b=o);let R,I=[],M=[];if(this._isEditOrEnter()&&(R=this._getCellByIndex(this.m_active.indexes)),R){let t=this.getCellIndexes(R),i=!1;r.forEach(e=>{("row"===s&&e===t.row||"column"===s&&e===t.column)&&(i=!0)}),i&&(this._handleExitEditable(e,R),this._handleExitEdit(e,R))}for(let e=0;e<r.length;e++){let t=r[e],i=0,n=this._isAxisIndexInViewport(t,s);if(n===z.BEFORE||n===z.INSIDE){if(n===z.BEFORE)d+=1,i=v,a+=i;else if(n===z.INSIDE){m+=1,i=this.getElementDir(this._getCellOrHeaderByIndex(t,s),S);let e=this._getAxisCellsByIndex(t,s);null!=e&&(this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]),this._removeAndModifyCells(e,s));let n=this._getHeaderCellsByIndex(t,s);n.length&&this._removeAndModifyHeaders(n,i,S,b,t);let o=this._getHeadersByIndex(t,f,E,C);o.length&&this._removeAndModifyHeaders(o,i,S,b,t)}"column"===s&&this._hasFrozenColumns()&&t<=this.m_frozenColIndex||"row"===s&&this._hasFrozenRows()&&t<=this.m_frozenRowIndex?M.unshift(i):(h+=i,I.unshift(i)),"column"===s&&this._hasFrozenColumns()&&t<=this.m_frozenColIndex||"row"===s&&this._hasFrozenRows()&&t<=this.m_frozenRowIndex?c+=i:u+=i}else n===z.AFTER&&"scroll"===this.m_options.getScrollPolicy()&&(u+=i)}this.updateHiddenColumnsForDeletion(r),r.reverse();let F=[];for(let e=r.length-1;e>=0;e--){let t=r[e];("column"===s&&this._hasFrozenColumns()&&t<=this.m_frozenColIndex||"row"===s&&this._hasFrozenRows()&&t<=this.m_frozenRowIndex)&&(F.push(t),r.splice(e,1))}if(F.reverse(),this._modifyAndPushCells(r,I,s,this.m_databody,p,f,!1,F.length),"column"===s&&this.m_databodyFrozenRow?this._modifyAndPushCells(r,I,s,this.m_databodyFrozenRow,null,null,!1,F.length):"row"===s&&this.m_databodyFrozenCol&&this._modifyAndPushCells(r,I,s,this.m_databodyFrozenCol,null,null,!1,F.length),F.length&&(this._modifyAndPushCells(F,M,s,_,g,y,!1),this.m_databodyFrozenCorner&&this._modifyAndPushCells(F,M,s,this.m_databodyFrozenCorner,null,null,!1),"column"===s?this.m_frozenColIndex-=F.length:this.m_frozenRowIndex-=F.length),this._refreshDatabodyMap(),!n){let t;this._adjustActive("delete",r),this._simpleAdjustSelectionOnChange("delete",r.reverse(),s);let i={};if(this.m_active&&"cell"===this.m_active.type&&(Object.assign(i,this.m_active.indexes),t=this._getCellByIndex(i),"row"===s))for(;!t&&i.row-1>0;)i.row-=1,t=this._getCellByIndex(i);t&&(this._setActiveByIndex(i,e),this._highlightActive())}var A=this.m_databody.firstChild;if("row"===s){w&&(this.m_startRow-=d,this.m_endRow=this.m_endRow-d-m,this.m_startRowPixel-=a,this.m_endRowPixel=this.m_endRowPixel-a-h,this.m_stopRowFetch=!1),H&&(this.m_startRowHeader-=d,this.m_endRowHeader=this.m_endRowHeader-d-m,this.m_startRowHeaderPixel-=a,this.m_endRowHeaderPixel=this.m_endRowHeaderPixel-a-h,this.m_stopRowHeaderFetch=!1),x&&(this.m_startRowEndHeader-=d,this.m_endRowEndHeader=this.m_endRowEndHeader-d-m,this.m_startRowEndHeaderPixel-=a,this.m_endRowEndHeaderPixel=this.m_endRowEndHeaderPixel-a-h,this.m_stopRowEndHeaderFetch=!1);var D=this.getElementHeight(A)-u;if(this.setElementHeight(A,D),this.m_databodyFrozenRow){var L=this.getElementHeight(this.m_databodyFrozenRow)-c;this.setElementHeight(this.m_databodyFrozenRow,L),this.m_databodyFrozenCorner&&this.setElementHeight(this.m_databodyFrozenCorner,L)}this.updateRowBanding()}else if("column"===s){w&&(this.m_startCol-=d,this.m_endCol=this.m_endCol-d-m,this.m_startColPixel-=a,this.m_endColPixel=this.m_endColPixel-a-h,this.m_stopColumnFetch=!1),H&&(this.m_startColHeader-=d,this.m_endColHeader=this.m_endColHeader-d-m,this.m_startColHeaderPixel-=a,this.m_endColHeaderPixel=this.m_endColHeaderPixel-a-h,this.m_stopColumnHeaderFetch=!1),x&&(this.m_startColEndHeader-=d,this.m_endColEndHeader=this.m_endColEndHeader-d-m,this.m_startColEndHeaderPixel-=a,this.m_endColEndHeaderPixel=this.m_endColEndHeaderPixel-a-h,this.m_stopColumnEndHeaderFetch=!1);var T=this.getElementWidth(A)-u;if(this.setElementWidth(A,T),this.m_databodyFrozenCol){var N=this.getElementWidth(this.m_databodyFrozenCol)-c;this.setElementWidth(this.m_databodyFrozenCol,N),this.m_databodyFrozenCorner&&this.setElementWidth(this.m_databodyFrozenCorner,N)}this.updateColumnBanding()}if(!n){this.applySelection(),this.m_utils.isTouchDevice()&&(this.GetSelection().length?this._moveTouchSelectionAffordance():this._removeTouchSelectionAffordance(!0)),this.resizeGrid(),this.deleteAndApplyHiddenIndicators(),this.m_resizeRequired=!0;let e=this;Promise.resolve().then(()=>{null!=e.m_modelEvents&&0===e.m_modelEvents.length&&e.fillViewport()})}},z.prototype._handleModelDeleteEvent=function(e,t,i){var s,n,o,l;Array.isArray(t)||(t=new Array(t),e=new Array(e));for(var r=0,a=0,h=0,d=0,m=0,c=0;c<t.length;c++){var u=t[c],_=e[c];if(null!=u.row){var p=0,g=u.row,C=this._isInViewport(_);C===z.BEFORE?(this._modifyAxisCellContextIndex("row",this.m_startRow,this.m_endRow-this.m_startRow+1,-1),d+=1,r+=this.m_avgRowHeight,this.m_startRowPixel-=this.m_avgRowHeight,this.m_endRowPixel-=this.m_avgRowHeight,-1!==this.m_endRowHeader&&(this.m_startRowHeaderPixel-=this.m_avgRowHeight,this.m_endRowHeaderPixel-=this.m_avgRowHeight),null!=(l=this._getAxisCellsByKey(g,"row"))&&this.pushRowsUp(this.m_startRow,this.m_avgRowHeight),null!=(n=this.m_rowHeader.firstChild.firstChild)&&this.pushRowHeadersUp(n,this.m_avgRowHeight),null!=(o=this.m_rowEndHeader.firstChild.firstChild)&&this.pushRowHeadersUp(o,this.m_avgRowHeight)):C===z.INSIDE?(m+=1,null!=(l=this._getAxisCellsByKey(g,"row"))&&(p=this.calculateRowHeight(l[0]),_=l[0][this.getResources().getMappedAttribute("context")].indexes.row,this._modifyAxisCellContextIndex("row",_+1,this.m_endRow-_,-1),this._removeFromArray(l),this.pushRowsUp(_,p),this.m_endRowPixel-=p),null!=(n=this._findHeaderByKey(g,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(p=this.calculateRowHeaderHeight(n),s=n.nextSibling,this._remove(n),this.pushRowHeadersUp(s,p),this.m_endRowHeaderPixel-=p),null!=(o=this._findHeaderByKey(g,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")))&&(p=this.calculateRowHeaderHeight(o),s=o.nextSibling,this._remove(o),this.pushRowHeadersUp(s,p),this.m_endRowEndHeaderPixel-=p),a+=p):"scroll"===this.m_options.getScrollPolicy()&&(h+=this.m_avgRowHeight)}}this._refreshDatabodyMap(),this.m_startRow-=d,this.m_endRow=this.m_endRow-d-m,-1!==this.m_endRowHeader&&(this.m_startRowHeader-=d,this.m_endRowHeader=this.m_endRowHeader-d-m),-1!==this.m_endRowEndHeader&&(this.m_startRowEndHeader-=d,this.m_endRowEndHeader=this.m_endRowEndHeader-d-m);var f=r+a+h,y=this.m_databody.firstChild,E=this.getElementHeight(y)-f;this.setElementHeight(y,E),this.resizeGrid(),i||!0===this.m_moveActive||(this.m_resizeRequired=!0,this.m_stopRowFetch=!1,-1!==this.m_endRowHeader&&(this.m_stopRowHeaderFetch=!1),-1!==this.m_endRowEndHeader&&(this.m_stopRowEndHeaderFetch=!1),this.fillViewport()),this.updateRowBanding()},z.prototype._handleModelDeleteEventWithAnimation=function(e,t){this._collapseRowsWithAnimation(e,t)},z.prototype._collapseRowsWithAnimation=function(e,t){var i,s,n,o,l,r,a,h;let d=e.indexes;if(0!==t.length){var m=this;m._signalTaskStart();var c=this.m_processingEventQueue?1:z.COLLAPSE_ANIMATION_DURATION,u=[],_=0,p=-1!==this.m_endRowHeader,g=-1!==this.m_endRowEndHeader,C=this.m_databody.firstChild,f=this._getIndex(this._getAxisCellsByKey(t[0].row,"row")[0],"row")-1;for(s=f;s>=this.m_startRow&&(i=this._getAxisCellsByIndex(s,"row"),!(this.getElementDir(i[0],"top")+this.getElementHeight(i[0])<this.m_currentScrollTop));s--)for(n=0;n<i.length;n++)this.changeStyleProperty(i[n],this.getCssSupport("z-index"),10);if(p)for(l=[],o=this._findHeaderByKey(t[0].row,this.m_rowHeader,this.getMappedStyle("rowheadercell")).previousSibling;o&&!(this.getElementDir(o,"top")+this.getElementHeight(o)<this.m_currentScrollTop);)this.changeStyleProperty(o,this.getCssSupport("z-index"),10),o=o.previousSibling;if(g)for(r=[],o=this._findHeaderByKey(t[0].row,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")).previousSibling;o&&!(this.getElementDir(o,"top")+this.getElementHeight(o)<this.m_currentScrollTop);)this.changeStyleProperty(o,this.getCssSupport("z-index"),10),o=o.previousSibling;for(s=0;s<t.length;s++){var y=t[s].row;if((i=this._getAxisCellsByKey(y,"row")).length)for(u.push(i),_+=this.getElementHeight(i[0]),n=0;n<i.length;n++)this.setElementDir(i[n],this.getElementDir(i[n],"top")-_,"top"),this.addTransformMoveStyle(i[n],0,0,"linear",0,_,0);p&&null!=(a=this._findHeaderByKey(y,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(l.push(a),this.setElementDir(a,this.getElementDir(a,"top")-_,"top"),this.addTransformMoveStyle(a,0,0,"linear",0,_,0)),g&&null!=(h=this._findHeaderByKey(y,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")))&&(r.push(h),this.setElementDir(h,this.getElementDir(h,"top")-_,"top"),this.addTransformMoveStyle(h,0,0,"linear",0,_,0))}for(s=f+t.length+1;s<=this.m_endRow;s++){for(i=this._getAxisCellsByIndex(s,"row"),n=0;n<i.length;n++)this.setElementDir(i[n],this.getElementDir(i[n],"top")-_,"top"),this.addTransformMoveStyle(i[n],0,0,"linear",0,_,0);p&&(a=a.nextSibling,this.setElementDir(a,this.getElementDir(a,"top")-_,"top"),this.addTransformMoveStyle(a,0,0,"linear",0,_,0)),g&&(h=h.nextSibling,this.setElementDir(h,this.getElementDir(h,"top")-_,"top"),this.addTransformMoveStyle(h,0,0,"linear",0,_,0))}var E=this._getCellByIndex(this.createIndex(this.m_endRow,this.m_endCol));m._onEndEvent("transitionend",E,function(){u.length&&m._modifyAxisCellContextIndex("row",f+t.length+1,m.m_endRow-(f+t.length),-1*t.length),p&&l.length&&m._modifyAxisHeaderContextIndex("row",f+t.length+1,m.m_endRow-(f+t.length),-1*t.length),g&&r.length&&m._modifyAxisHeaderContextIndex("rowEnd",f+t.length+1,m.m_endRow-(f+t.length),-1*t.length);for(var e=0;e<u.length;e++){for(var i=0;i<u[e].length;i++)m._remove(u[e][i]);p&&m._remove(l[e]),g&&m._remove(r[e])}m._adjustActive("delete",d),m._refreshDatabodyMap(),m._isEditOrEnter()&&(m._highlightActiveObject(m.m_active,m.m_prevActive),m._updateEdgeCellBorders("")),m.m_endRow-=u.length,m.m_endRowPixel-=_,m.m_stopRowFetch=!1,p&&(m.m_endRowHeader-=l.length,m.m_endRowHeaderPixel-=_,m.m_stopRowHeaderFetch=!1),g&&(m.m_endRowEndHeader-=l.length,m.m_endRowEndHeaderPixel-=_,m.m_stopRowEndHeaderFetch=!1),m.setElementHeight(C,m.m_endRowPixel-m.m_startRowPixel),m.resizeGrid(),m.updateRowBanding(),null==m.m_modelEvents||0!==m.m_modelEvents.length||m.m_moveActive||m.fillViewport(),m._handleAnimationEnd()},c),this.m_animating=!0,setTimeout(function(){for(s=f+1;s<=m.m_endRow;s++){for(i=m._getAxisCellsByIndex(s,"row"),n=0;n<i.length;n++)m.addTransformMoveStyle(i[n],c+"ms",0,"ease-out",0,0,0);p&&(a=m._getHeaderByIndex(s,0,m.m_rowHeader,m.m_rowHeaderLevelCount,m.m_startRowHeader),m.addTransformMoveStyle(a,c+"ms",0,"ease-out",0,0,0)),g&&(h=m._getHeaderByIndex(s,0,m.m_rowEndHeader,m.m_rowEndHeaderLevelCount,m.m_startRowEndHeader),m.addTransformMoveStyle(h,c+"ms",0,"ease-out",0,0,0))}},0)}},z.prototype._handleAnimationEnd=function(){var e,t=this.m_databody.firstChild,i=this.m_rowHeader.firstChild,s=this.m_rowEndHeader.firstChild;for(e=0;e<t.childNodes.length;e++)this.removeTransformMoveStyle(t.childNodes[e]),this.changeStyleProperty(t.childNodes[e],this.getCssSupport("z-index"),null,"remove");if(-1!==this.m_endRowHeader)for(e=0;e<i.childNodes.length;e++)this.removeTransformMoveStyle(i.childNodes[e]),this.changeStyleProperty(i.childNodes[e],this.getCssSupport("z-index"),null,"remove");if(-1!==this.m_endRowEndHeader)for(e=0;e<s.childNodes.length;e++)this.removeTransformMoveStyle(s.childNodes[e]),this.changeStyleProperty(s.childNodes[e],this.getCssSupport("z-index"),null,"remove");this.m_animating=!1,this._runModelEventQueue(),this._signalTaskEnd()},z.prototype._getCellOrHeaderByKey=function(e,t){var i=null,s=this._getAxisCellsByKey(e,t,!0);return null!=s&&s.length>0&&(i=s[0]),null==i&&("row"===t?null==(i=this._findHeaderByKey(e,this.m_rowHeader,this.getMappedStyle("rowheadercell")))&&(i=this._findHeaderByKey(e,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell"))):"column"===t&&null==(i=this._findHeaderByKey(e,this.m_colHeader,this.getMappedStyle("colheadercell")))&&(i=this._findHeaderByKey(e,this.m_colEndHeader,this.getMappedStyle("colendheadercell")))),i},z.prototype._findHeaderByKey=function(e,t,i){if(null==t)return null;var s;this._hasFrozenRows()&&parseInt(e,10)<=this.m_frozenRowIndex&&(t===this.m_rowHeader||t===this.m_rowEndHeader)&&(t=t===this.m_rowHeader?this.m_rowHeaderFrozen:this.m_rowEndHeaderFrozen),this._hasFrozenColumns()&&parseInt(e,10)<=this.m_frozenColIndex&&(t===this.m_colHeader||t===this.m_colEndHeader)&&(t=t===this.m_colHeader?this.m_colHeaderFrozen:this.m_colEndHeaderFrozen),s=t.getElementsByClassName?t.getElementsByClassName(i):t.childNodes;for(var n=0;n<s.length;n++){var o=s[n],l=this._getKey(o);if(this._shallowThenDeepCompare(l,e))return o}return null},z.prototype._handleModelRefreshEvent=function(e){if(null!=e){const t={ranges:[]};let i=!0;if(null!=e.disregardAfterColumnOffset&&this._getCellOrHeaderByIndex(e.disregardAfterColumnOffset,"column")){t.axis="column";const s=e.disregardAfterColumnOffset+1;t.ranges.push({offset:s,count:this.m_endCol-e.disregardAfterColumnOffset}),i=!1}if(null!=e.disregardAfterRowOffset&&this._getCellOrHeaderByIndex(e.disregardAfterRowOffset,"row")){t.axis="row";const s=e.disregardAfterRowOffset+1;t.ranges.push({offset:s,count:this.m_endRow-e.disregardAfterRowOffset}),i=!1}if(!i)return void this._handleDeleteRangeEvent(t)}var t=this.getVisibility();this.m_focusOnRefresh=this.m_root.contains(document.activeElement),this.m_updateScrollPostionOnRefreshCallback(),t===z.VISIBILITY_STATE_VISIBLE?(this.empty(),null!=this.m_root.offsetParent?this.refresh(this.m_root):this.setVisibility(z.VISIBILITY_STATE_REFRESH)):t===z.VISIBILITY_STATE_HIDDEN&&(this.empty(),this.setVisibility(z.VISIBILITY_STATE_REFRESH))},z.prototype._handleModelSyncEvent=function(e){var t=e.pageSize;this.m_fetching={},this.m_startRow=0,this.m_endRow=-1,this.m_startRowHeader=0,this.m_endRowHeader=-1,this.m_startRowEndHeader=0,this.m_endRowEndHeader=-1,this.m_startRowPixel=0,this.m_endRowPixel=0,this.m_startRowHeaderPixel=0,this.m_endRowHeaderPixel=0,this.m_startRowEndHeaderPixel=0,this.m_endRowEndHeaderPixel=0,this.m_startCol=0,this.m_endCol=-1,this.m_startColHeader=0,this.m_endColHeader=-1,this.m_startColEndHeader=0,this.m_endColEndHeader=-1,this.m_startColPixel=0,this.m_endColPixel=0,this.m_startColHeaderPixel=0,this.m_endColHeaderPixel=0,this.m_startColEndHeaderPixel=0,this.m_endColEndHeaderPixel=0,this.m_rowHeaderLevelCount=void 0,this.m_columnHeaderLevelCount=void 0,this.m_rowEndHeaderLevelCount=void 0,this.m_columnEndHeaderLevelCount=void 0,this.m_avgRowHeight=void 0,this.m_avgColWidth=void 0,this.m_isEstimateRowCount=void 0,this.m_isEstimateColumnCount=void 0,this.m_stopRowFetch=!1,this.m_stopRowHeaderFetch=!1,this.m_stopRowEndHeaderFetch=!1,this.m_stopColumnFetch=!1,this.m_stopColumnHeaderFetch=!1,this.m_stopColumnEndHeaderFetch=!1,this._clearScrollPositionKeys(),this.m_selection=null,this.m_selectionRange=null,this.m_active=null,this.m_prevActive=null,this.m_trueIndex={},null!=this.m_empty&&(this.m_databody.firstChild.removeChild(this.m_empty),this.m_empty=null),this._showHeader(this.m_rowHeader),this._showHeader(this.m_colHeader),this._showHeader(this.m_rowEndHeader),this._showHeader(this.m_colEndHeader),this._emptyHeaders(),this._emptyHeaderLabels();var i=this.m_databody.firstChild;null!=i&&this._emptyDatabody(i),this.m_initialized=!1,this.fetchHeaders("row",0,this.m_rowHeader,this.m_rowEndHeader,t,{success:function(e,t,i){this.handleHeadersFetchSuccess(e,t,i,!1)}}),this.fetchHeaders("column",0,this.m_colHeader,this.m_colEndHeader,void 0,{success:function(e,t,i){this.handleHeadersFetchSuccess(e,t,i,!1)}}),this.fetchCells(this.m_databody,0,0,t,null,{success:function(e,t){this.handleCellsFetchSuccess(e,t)}})},z.prototype._emptyHeaders=function(){var e=this.m_rowHeader.firstChild,t=this.m_rowEndHeader.firstChild;null!=e&&this.m_utils.empty(e),null!=t&&this.m_utils.empty(t);var i=this.m_colHeader.firstChild,s=this.m_colEndHeader.firstChild;null!=i&&this.m_utils.empty(i),null!=s&&this.m_utils.empty(s)},z.prototype._emptyHeaderLabels=function(){var e=this.m_headerLabels.row,t=this.m_headerLabels.rowEnd,i=this.m_headerLabels.column,s=this.m_headerLabels.columnEnd;e&&e.length&&e.forEach(e=>{this.m_utils.empty(e)}),t&&t.length&&t.forEach(e=>{this.m_utils.empty(e)}),i&&i.length&&i.forEach(e=>{this.m_utils.empty(e)}),s&&s.length&&s.forEach(e=>{this.m_utils.empty(e)})},z.prototype._setActiveByIndex=function(e,t,i,s,n){let o=this._getCellByIndex(e);return this._setActive(o,{type:"cell",indexes:e},t,i,s,n)},z.prototype._updateActive=function(e,t,i){var s;if(null==e)this._setActive(null,null,null,!0,!1,i);else if(null!=e.keys)s=this._getCellByKeys(e.keys);else if(null!=e.indexes)s=this._getCellByIndex(e.indexes);else if(null!=e.axis){var n=null==e.level?0:e.level;"column"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_colHeader,this.getMappedStyle("colheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader)):"row"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_rowHeader,this.getMappedStyle("rowheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader)):"columnEnd"===e.axis?null!=e.key?s=this._findHeaderByKey(e.key,this.m_colEndHeader,this.getMappedStyle("colendheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader)):"rowEnd"===e.axis&&(null!=e.key?s=this._findHeaderByKey(e.key,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")):null!=e.index&&(s=this._getHeaderByIndex(e.index,n,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader)))}null!=s&&(t||(this.m_shouldFocus=!1),this._setActive(s,e,null,!0,!1,i))},z.prototype._setActive=function(e,t,i,s,n,o){var l;if(null==t||o||this._scrollToActive(t),null!=e)if(l=this._createActiveObject(e),this._compareActive(l,this.m_active)){if(n||this._fireBeforeCurrentCellEvent(l,this.m_active,i))return this.m_prevActive=this.m_active,this.m_active=l,i&&"mousedown"===i.type&&(this.m_trueIndex=null),s&&this._isSelectionEnabled()&&this._clearSelection(i),this.deleteDatabodyHiddenVisualIndicators(),this._unhighlightActiveObject(this.m_prevActive),this._highlightActiveObject(this.m_active,this.m_prevActive,null,o),this._manageMoveCursor(),this._isGridEditable()&&"cell"===l.type&&(this._setEditableClone(e),this._updateEdgeCellBorders("")),n||this._fireCurrentCellEvent(l,i),this.m_options.isFloodFillEnabled()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"cell"===this.m_active.type&&i&&(this._addFloodfillAffordance(i),this._moveFloodFillAffordance()),!0}else this._highlightActive();else if(!this.m_scrollIndexAfterFetch&&!this.m_scrollHeaderAfterFetch)return(n||this._fireBeforeCurrentCellEvent(l,this.m_active,i))&&(this.m_prevActive=this.m_active,this.m_active=null,this._unhighlightActiveObject(this.m_prevActive),n||this._fireCurrentCellEvent(l,i)),!0;return!1},z.prototype._createActiveObject=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.m_utils.containsCSSClassName(e,this.getMappedStyle("headercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("endheadercell"))?{type:"header",axis:t.axis,index:this.getHeaderCellIndex(e),key:t.key,level:t.level}:this.m_utils.containsCSSClassName(e,this.getMappedStyle("headerlabel"))?{type:"label",axis:t.axis,level:t.level}:this.m_utils.containsCSSClassName(e,this.getMappedStyle("noDataContainer"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("emptytext"))?{type:"empty"}:{type:"cell",indexes:{row:t.indexes.row,column:t.indexes.column},keys:{row:t.keys.row,column:t.keys.column},extents:{row:t.extents.row,column:t.extents.column}}},z.prototype._getActiveElement=function(){return this._getElementFromActiveObject(this.m_active)},z.prototype._getElementFromActiveObject=function(e){if(null!=e){if("header"!==e.type)return"label"===e.type?this._getLabel(e.axis,e.level):"empty"===e.type?this._getEmptyElement():this._getCellByIndex(e.indexes);if("row"===e.axis){let t=this.m_rowHeader;return this._hasFrozenRows()&&e.index<=this.m_frozenRowIndex&&(t=this.m_rowHeaderFrozen),this._findHeaderByKey(e.key,t,this.getMappedStyle("rowheadercell"))}if("column"===e.axis){let t=this.m_colHeader;return this._hasFrozenColumns()&&e.index<=this.m_frozenColIndex&&(t=this.m_colHeaderFrozen),this._findHeaderByKey(e.key,t,this.getMappedStyle("colheadercell"))}if("rowEnd"===e.axis){let t=this.m_rowEndHeader;return this._hasFrozenRows()&&e.index<=this.m_frozenRowIndex&&(t=this.m_rowEndHeaderFrozen),this._findHeaderByKey(e.key,t,this.getMappedStyle("rowendheadercell"))}if("columnEnd"===e.axis){let t=this.m_colEndHeader;return this._hasFrozenColumns()&&e.index<=this.m_frozenColIndex&&(t=this.m_colEndHeaderFrozen),this._findHeaderByKey(e.key,t,this.getMappedStyle("colendheadercell"))}}return null},z.prototype._compareActive=function(e,t){if(null==e&&null==t)return!1;if(null==e&&null!=t||null!=e&&null==t)return!0;if(e.type!==t.type)return!0;if("header"===e.type){if(e.index!==t.index||e.key!==t.key||e.axis!==t.axis||e.level!==t.level)return!0}else if("label"===e.type){if(e.axis!==t.axis||e.level!==t.level)return!0}else if(e.indexes.row!==t.indexes.row||e.indexes.column!==t.indexes.column||e.keys.row!==t.keys.row||e.keys.column!==t.keys.column)return!0;return!1},z.prototype._fireBeforeCurrentCellEvent=function(e,t,i){var s={event:i,ui:{currentCell:e,previousCurrentCell:t}};return this.fireEvent("beforeCurrentCell",s)},z.prototype._fireCurrentCellEvent=function(e,t){var i={event:t,ui:e};return this.fireEvent("currentCell",i)},z.prototype._isDatabodyCellActive=function(){return null!=this.m_active&&"cell"===this.m_active.type},z.prototype._updateActiveContext=function(e,t){var i,s,n,o={};if("header"===e.type){i=e.axis;var l=e.index;s=e.level,"row"===e.axis?(this.m_rowHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&l===t.index&&i===t.axis||(o.rowHeader=l)):"column"===i?(this.m_columnHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&l===t.index&&i===t.axis||(o.columnHeader=l)):"rowEnd"===e.axis?(this.m_rowEndHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&l===t.index&&i===t.axis||(o.rowEndHeader=l)):"columnEnd"===i&&(this.m_columnEndHeaderLevelCount>1&&(null!=t&&s===t.level&&i===t.axis||(o.level=s)),null!=t&&l===t.index&&i===t.axis||(o.columnEndHeader=l)),this._updateContextInfo(o,n)}else"cell"===e.type?(null==t||"cell"!==t.type||null==e||this.m_externalFocus||(e.indexes.row===t.indexes.row?n="row":e.indexes.column===t.indexes.column&&(n="column")),this._updateContextInfo(e,n)):"label"===e.type&&(i=e.axis,s=e.level,(null==t||"label"!==t.type||"label"===t.type&&t.axis!==i||this.m_externalFocus)&&("column"===i?o.columnHeaderLabel=s:"row"===i?o.rowHeaderLabel=s:"rowEnd"===i?o.rowEndHeaderLabel=s:"columnEnd"===i&&(o.columnEndHeaderLabel=s)),this._updateContextInfo(o,n))},z.prototype.handleDatabodyClickActive=function(e){var t=e.target,i=this.findCell(t);null!=i&&this._setActive(i,this._createActiveObject(i),e)},z.prototype.handleHeaderClickActive=function(e,t,i){var s=e.target,n=this.findHeader(s);null!=n&&(t||this._clearSelection(e),this._setActive(n,this._createActiveObject(n),e,null,null,i))},z.prototype._scrollToActive=function(e){"header"===e.type?this.scrollToHeader(e):"cell"===e.type&&this.scrollToIndex(e.indexes)},z.prototype._getCellByKeys=function(e){if(null==e||null==e.row||null==e.column||null==this.m_databody||null==this.m_databody.firstChild)return null;for(var t=this.m_databody.firstChild.getElementsByClassName(this.getMappedStyle("cell")),i=0;i<t.length;i++){var s=t[i],n=this._getKey(s,"row");if(this._shallowThenDeepCompare(n,e.row)){var o=this._getKey(s,"column");if(this._shallowThenDeepCompare(o,e.column))return s}}return null},z.prototype._shallowThenDeepCompare=function(e,t){return e===t||this._compareValuesCallback(e,t)},z.prototype.getCellKeys=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.keys.row,t.keys.column)},z.prototype.getCellIndexes=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.indexes.row,t.indexes.column)},z.prototype.getCellExtents=function(e){var t=e[this.getResources().getMappedAttribute("context")];return this.createIndex(t.extents.row,t.extents.column)},z.prototype.getCellEndIndexes=function(e){var t=this.getCellIndexes(e),i=this.getCellExtents(e);return this.createIndex(t.row+(i.row-1),t.column+(i.column-1))},z.prototype._getIndex=function(e,t){if(null!=e){if(null==t||!this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return this.getHeaderCellIndex(e);var i=e[this.getResources().getMappedAttribute("context")];if("row"===t)return i.indexes.row;if("column"===t)return i.indexes.column}return null},z.prototype._getExtent=function(e,t){if(null!=e){if(null==t||!this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell")))return parseInt(this._getAttribute(e,"extent",!0),10);var i=e[this.getResources().getMappedAttribute("context")];if("row"===t)return i.extents.row;if("column"===t)return i.extents.column}return null},z.prototype.getHeaderCellIndex=function(e){var t,i,s;let n,o=e;switch(this.getHeaderCellAxis(e)){case"column":t=this.m_columnHeaderLevelCount,i=this.m_startColHeader,this._hasFrozenColumns()&&(n=this.m_colHeaderFrozen);break;case"row":t=this.m_rowHeaderLevelCount,i=this.m_startRowHeader,this._hasFrozenRows()&&(n=this.m_rowHeaderFrozen);break;case"columnEnd":t=this.m_columnEndHeaderLevelCount,i=this.m_startColEndHeader,this._hasFrozenColumns()&&(n=this.m_colEndHeaderFrozen);break;case"rowEnd":t=this.m_rowEndHeaderLevelCount,i=this.m_startRowEndHeader,this._hasFrozenRows()&&(n=this.m_rowEndHeaderFrozen);break;default:return-1}if(t>1){if(s=this._getAttribute(e.parentNode,"start",!0),e===e.parentNode.firstChild)return s;s-=1}else s=i;for(o=this._getHeaderPreviousSibling(o);o;)s+=1,o=this._getHeaderPreviousSibling(o);return 1===t&&void 0!==n&&null===n.querySelector(`#${e.id}`)&&(s+=this._getChildElementCountByClassName(n.firstChild,this.getMappedStyle("headercell"))),s},z.prototype.getHeaderCellAxis=function(e){return this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))?"column":this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowheadercell"))?"row":this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowendheadercell"))?"rowEnd":this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))?"columnEnd":null},z.prototype.getHeaderCellLevel=function(e){if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))){if(1===this.m_columnHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowheadercell"))){if(1===this.m_rowHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))){if(1===this.m_columnEndHeaderLevelCount)return 0}else if(this.m_utils.containsCSSClassName(e,this.getMappedStyle("rowendheadercell"))&&1===this.m_rowEndHeaderLevelCount)return 0;var t=this._getAttribute(e.parentNode,"level",!0);return e===e.parentNode.firstChild?t:t+this.getHeaderCellDepth(e.parentNode.firstChild)},z.prototype.getHeaderCellDepth=function(e){return this._getAttribute(e,"depth",!0)},z.prototype.getHeaderLabelLevel=function(e){let t=e[this.getResources().getMappedAttribute("context")];return t?t.level:null},z.prototype.getHeaderLabelAxis=function(e){let t=e[this.getResources().getMappedAttribute("context")];return t?t.axis:null},z.prototype._getResizeHeaderMode=function(e){var t="row";return(this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("colendheadercell"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnheaderlabel"))||this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnendheaderlabel")))&&(t="column"),t},z.prototype.findCellOrHeader=function(e){var t=this.findCell(e);return null==t&&(t=this.findHeader(e)),t},z.prototype.findCell=function(e){return this.find(e,"cell")},z.prototype.findLabel=function(e){return this.find(e,"headerlabel")},z.prototype.find=function(e,t,i){return null==e||e===this.getRootElement()?null:(null==i&&(i=this.getMappedStyle(t)),null==i?null:this.m_utils.containsCSSClassName(e,i)?e:this.find(e.parentNode,t,i))},z.prototype._highlightActive=function(e){this._highlightActiveObject(this.m_active,this.m_prevActive,e)},z.prototype._unhighlightActive=function(e){this._unhighlightActiveObject(this.m_active,e)},z.prototype._highlightActiveObject=function(e,t,i,s){if(null==i&&this.m_utils.shouldOffsetOutline()&&(i=["offsetOutline"]),null!=e){var n=this._getElementFromActiveObject(e);null!=n&&(this.m_focusInHandler(n),null!=i&&this._highlightElement(n,i),this._isCellEditable()&&"cell"===e.type&&this._applyBorderClassesAroundRange(n,{startIndex:e.indexes},!0,"Edit"),this._setAriaProperties(e,t,n,s))}},z.prototype._unhighlightActiveObject=function(e,t){if(null==t&&this.m_utils.shouldOffsetOutline()&&(t=["offsetOutline"]),null!=e){var i=this._getElementFromActiveObject(e);null!=i&&(this.m_focusOutHandler(i),null!=t&&this._unhighlightElement(i,t),this._isGridEditable()&&"cell"===e.type&&this._applyBorderClassesAroundRange(i,{startIndex:e.indexes},!1,"Edit"),this._unsetAriaProperties(i))}},z.prototype._highlightCellsAlongAxis=function(e,t,i,s,n){for(var o="key"===i?this._getAxisCellsByKey(e,t):this._getAxisCellsByIndex(e,t),l=0;l<o.length;l++)"add"===s?this._highlightElement(o[l],n):this._unhighlightElement(o[l],n)},z.prototype._highlightElement=function(e,t){for(var i=0;i<t.length;i++){var s=this.getMappedStyle(t[i]);this.m_utils.addCSSClassName(e,s)}},z.prototype._unhighlightElement=function(e,t){for(var i=0;i<t.length;i++){var s=this.getMappedStyle(t[i]);this.m_utils.removeCSSClassName(e,s)}},z.prototype._unhighlightElementsByClassName=function(e,t){if(e.length&&t.length)for(var i=0;i<e.length;i++)this._unhighlightElement(e[i],t)},z.prototype._setAriaProperties=function(e,t,i,s){var n=this.getLabelledBy(e,t,i);this._updateActiveContext(e,t),i.setAttribute("tabIndex",0),i.setAttribute("aria-labelledby",n),u.isFirefox()&&i.setAttribute("role","gridcell"),null!=this.m_cellToFocus&&this.m_cellToFocus===i||!1===this.m_shouldFocus||i.focus({preventScroll:s}),this.m_shouldFocus=null},z.prototype._unsetAriaProperties=function(e){null!=e&&(e.setAttribute("tabIndex",-1),e.removeAttribute("aria-labelledby"),u.isFirefox()&&e.removeAttribute("role"))},z.prototype.getLabelledBy=function(e,t,i,s){var n,o,l,r,a="",h=[];const d=i[this.getResources().getMappedAttribute("metadata")];if("header"===e.type){null==t||"header"!==t.type||this.m_externalFocus||("row"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader):"column"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader):"rowEnd"===t.axis?n=this._getHeaderByIndex(t.index,t.level,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader):"columnEnd"===t.axis&&(n=this._getHeaderByIndex(t.index,t.level,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader))),a=[this.createSubId("context"),this._getHeaderAndParentIds(i,n)].join(" ");var m=i.getAttribute(this.getResources().getMappedAttribute("sortDir"));if("ascending"===m?o="accessibleSortAscending":"descending"===m?o="accessibleSortDescending":this._getAttribute(i,"sortable")&&(o="accessibleSortable"),null!=o&&h.push({key:o,args:{id:""}}),d&&d.metadata){"expanded"===d.metadata.expanded?h.push({key:"accessibleExpanded",args:{}}):"collapsed"===d.metadata.expanded&&h.push({key:"accessibleCollapsed",args:{}});const t=d.metadata.treeDepth;if(null!=t){let i,s,n,o,l;"row"===e.axis?(i=this.m_stopRowHeaderFetch&&this.m_stopRowEndHeaderFetch&&this.m_stopRowFetch,s=this.m_endRowHeader,n=this.m_startRowHeader):"column"===e.axis&&(s=this.m_endColHeader,n=this.m_startColHeader,i=this.m_stopColumnHeaderFetch&&this.m_stopColumnEndHeaderFetch&&this.m_stopColumnFetch),h.push({key:"accessibleLevelHierarchicalContext",args:{level:t+1}});let r="";const a=[...this.m_root.querySelectorAll(".oj-datagrid-"+e.axis+"-header-cell")];if(t>0){let h,d;a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")],n=s.metadata;n.treeDepth<t&&s.index>e.index&&(!d||s.index<d)&&(d=s.index),n.treeDepth===t-1&&s.index<e.index&&(!h||s.index>h)&&(h=s.index)}),null!=h&&null!=d?r="Full":null!=h&&null==d?(d=s+1,r=i?"Full":"Partial"):null==h&&null!=d?(h=n-1,r="Unknown"):(h=n-1,d=s+1,r="Unknown"),o=0,l=0,a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")];s.metadata.treeDepth===t&&(s.index<=e.index&&s.index>h&&(l+=1),s.index>h&&s.index<d&&(o+=1))})}else{o=0,l=1;r=0===this.m_startRowHeader?i?"Full":"Partial":"Unknown",a.forEach(i=>{const s=i[this.getResources().getMappedAttribute("context")];s.metadata.treeDepth===t&&(o+=1,s.index<e.index&&(l+=1))})}const d=this._getHierarchicalTranslationKey(r,e.axis);h.push({key:d,args:{posInSet:l,setSize:o}})}}0!==h.length&&(a=a+" "+this.createSubId("state")),i.setAttribute("tabIndex",0)}else if("label"===e.type)a=[this.createSubId("context"),this._getActiveElement().id].join(" ");else if("empty"===e.type)a=this._getActiveElement().id;else{null!=t&&("header"===t.type?(l="row"===t.axis?t.index:null,r="column"===t.axis?t.index:null):"cell"===t.type&&(l=t.indexes.row,r=t.indexes.column));var c=this._getHeaderLabelledBy("row",this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader,this.m_endRowHeader,e.indexes.row,l,i),_=this._getHeaderLabelledBy("rowEnd",this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader,this.m_endRowEndHeader,e.indexes.row,l,i),p=this._getHeaderLabelledBy("column",this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader,this.m_endColHeader,e.indexes.column,r,i),g=this._getHeaderLabelledBy("columnEnd",this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader,this.m_endColEndHeader,e.indexes.column,r,i),C=e.extents.row,f=e.extents.column;C>1&&h.push({key:"accessibleRowSpanContext",args:{extent:C}}),f>1&&h.push({key:"accessibleColumnSpanContext",args:{extent:f}}),a=(a=s?[c,_,p,g,i.id].join(" "):[this.createSubId("context"),c,_,p,g,i.id,this.createSubId("state")].join(" ")).replace(/ +(?= )/g,"")}!0===this.m_externalFocus&&(null!=this.m_root.id&&(a=[this.m_root.id,a].join(" ")),a=[this.createSubId("summary"),a].join(" "),this.m_externalFocus=!1);let y=u.getActionableElementsInNode(i);return y&&y.length>0&&h.push({key:"accessibleContainsControls"}),this._updateStateInfo(h),a},z.prototype._getHierarchicalTranslationKey=function(e,t){return"accessible"+(t.charAt(0).toUpperCase()+t.slice(1))+"Hierarchical"+e},z.prototype.getHeaderFromCell=function(e,t,i){var s,n,o;return"row"===t?null!=this.m_rowHeader&&(s=this._getIndex(e,"row"),n=this._getExtent(e,"row"),o=this.m_rowHeaderLevelCount-1):"column"===t?null!=this.m_colHeader&&(s=this._getIndex(e,"column"),n=this._getExtent(e,"column"),o=this.m_columnHeaderLevelCount-1):"rowEnd"===t?null!=this.m_rowEndHeader&&(s=this._getIndex(e,"row"),n=this._getExtent(e,"row"),o=this.m_rowEndHeaderLevelCount-1):"columnEnd"===t&&null!=this.m_colEndHeader&&(s=this._getIndex(e,"column"),n=this._getExtent(e,"column"),o=this.m_columnEndHeaderLevelCount-1),null!=s&&null!=o&&s>-1?(i&&(s+=n-1),this._getHeaderCellByIndex(s,t,o)):null},z.prototype._trimRangeForSelectionMode=function(e){return"row"===this.m_options.getSelectionMode()?this.createRange(this.createIndex(e.startIndex.row),this.createIndex(e.endIndex.row)):e},z.prototype.createRange=function(e,t,i,s){var n,o,l,r,a,h,d,m;return t&&(e.row<t.row||-1===t.row?(n=e.row,o=t.row,i&&(a=i.row,h=s.row)):(n=t.row,o=e.row,i&&(a=s.row,h=i.row)),isNaN(e.column)||isNaN(t.column)?(e={row:n},t={row:o},i&&(i={row:a,column:d},s={row:h,column:m})):(e.column<t.column||-1===t.column?(l=e.column,r=t.column,i&&(d=i.column,m=s.column)):(l=t.column,r=e.column,i&&(d=s.column,m=i.column)),e={row:n,column:l},t={row:o,column:r},i&&(i={row:a,column:d},s={row:h,column:m}))),i?{startIndex:e,endIndex:t,startKey:i,endKey:s}:{startIndex:e,endIndex:t}},z.prototype._createRangeWithKeys=function(e,t,i){this._keys(e,this._createRangeStartKeyCallback.bind(this,t,i))},z.prototype._createRangeStartKeyCallback=function(e,t,i,s){null!=e&&null!=s&&e.row===s.row&&e.column===s.column?this._createRangeEndKeyCallback(i,s,t,i,s):e?this._keys(e,this._createRangeEndKeyCallback.bind(this,i,s,t)):t.call(this,{startIndex:s,endIndex:s,startKey:i,endKey:i})},z.prototype._createRangeEndKeyCallback=function(e,t,i,s,n){i.call(this,this.createRange(t,n,e,s))},z.prototype.getEndIndex=function(e){return null==e.endIndex?e.startIndex:e.endIndex},z.prototype.getElementsInRange=function(e,t,i,s,n){var o,l,r,a,h;null==t&&(t=this.m_startRow),null==i&&(i=this.m_endRow+1);var d=e.startIndex,m=this.getEndIndex(e),c=d.row,u=m.row;if(-1===u&&(u=Number.MAX_VALUE),i<c||u<t)return null;if(!isNaN(d.column)&&!isNaN(m.column)&&(o=d.column,-1===(l=m.column)&&(l=Number.MAX_VALUE),this.m_endCol+1<o||l<this.m_startCol))return null;var _=[];if(null==this.m_databody.firstChild)return null;if(c=Math.max(this.m_startRow,c),u=Math.min(this.m_endRow,u),isNaN(o)||isNaN(l))for(o=Math.max(0,this.m_startCol),l=Math.max(o,this.m_endCol),r=c;r<=u;r+=1)for(a=o;a<=l;a+=1)null!=(h=this._getCellByIndex(this.createIndex(r,a)))&&-1===_.indexOf(h)&&_.push(h);else for(o=Math.max(this.m_startCol,o),l=Math.min(this.m_endCol,l),r=c;r<=u;r+=1)for(a=o;a<=l;a+=1)null!=(h=this._getCellByIndex(this.createIndex(r,a)))&&-1===_.indexOf(h)&&_.push(h);return _},z.prototype._getRangeInView=function(e){let t=e.startIndex,i=this.getEndIndex(e),s=t.row,n=i.row,o=t.column,l=i.column;return-1===n&&(n=Number.MAX_VALUE),-1===l&&(l=Number.MAX_VALUE),s=Math.max(this.m_startRow,s),n=Math.min(this.m_endRow,n),(isNaN(t.column)||isNaN(i.column))&&(o=Math.max(0,this.m_startCol),l=Math.max(o,this.m_endCol)),o=Math.max(this.m_startCol,o),l=Math.min(this.m_endCol,l),this.createRange(this.createIndex(s,o),this.createIndex(n,l))},z.prototype._applyBorderClassesAroundRange=function(e,t,i,s){if(null==this.m_databody.firstChild||null==e||0===e.length)return;let n=this._getRangeInView(t),o=n.startIndex.row,l=n.startIndex.column,r=n.endIndex.row,a=n.endIndex.column,h=0===o,d=this.isFirstOrFirstNonHiddenIndex(l),m=h?0:o-1,c=r,u=d?l:this.getVisibleCellIndexInDirection("column",l-1,{left:!0}),_=a;for(let e=o;e<=r;e++){let t=this._getCellByIndex(this.createIndex(e,u)),n=this._getCellByIndex(this.createIndex(e,_)),o=(d?"start":"end")+s,l="end"+s;i?(this._highlightElement(t,[o]),this._highlightElement(n,[l])):(this._unhighlightElement(t,[o]),this._unhighlightElement(n,[l]))}for(let e=l;e<=a;e++){let t=this._getCellByIndex(this.createIndex(m,e)),n=this._getCellByIndex(this.createIndex(c,e)),o=(h?"top":"bottom")+s,l="bottom"+s;i?(this._highlightElement(t,[o]),this._highlightElement(n,[l])):(this._unhighlightElement(t,[o]),this._unhighlightElement(n,[l]))}},z.prototype.readCurrentContent=function(){var e,t;if(null==this.m_active)return!1;if("header"===this.m_active.type)e={},"row"===this.m_active.axis?(this.m_rowHeaderLevelCount>1&&(e.level=this.m_active.level),e.rowHeader=this.m_active.index):(this.m_columnHeaderLevelCount>1&&(e.level=this.m_active.level),e.columnHeader=this.m_active.index),t=this._getActiveElement();else if("cell"===this.m_active.type){if(e=this.m_active.indexes,this._isSelectionEnabled()&&this.isMultipleSelection()&&null!=this.m_selectionFrontier&&(e=this.m_selectionFrontier),null==e)return!1;var i=this.createRange(e),s=this.getElementsInRange(i);if(null==s||0===s.length)return!1;t=s[0]}else t=this._getActiveElement();this._updateActiveContext(this.m_active,this.m_prevActive),this.m_placeHolder.tabIndex=-1;var n=t.getAttribute("aria-labelledby");return this.m_placeHolder.setAttribute("aria-labelledby",n+" "+t.id),this.m_placeHolder===document.activeElement?t.focus():this.m_placeHolder.focus(),!0},z.prototype._enterActionableMode=function(e,t){return this._setFocusToFirstFocusableElement(e,t)&&(this.m_focusOutHandler(e),this.setActionableMode(!0)),!1},z.prototype._exitActionableMode=function(){if(this.isActionableMode()){var e=this._getActiveElement();this.setActionableMode(!1),u.disableAllFocusableElements(e),this.m_focusInHandler(e)}},z.prototype._reRenderCell=function(e,t,i,s){var n=this.getRendererOrTemplate("cell"),o=e[this.getResources().getMappedAttribute("context")],l=e[this.getResources().getMappedAttribute("metadata")];if(o.mode=t,this.m_utils.empty(e),this.m_utils.containsCSSClassName(e,i)?this.m_utils.removeCSSClassName(e,i):this.m_utils.addCSSClassName(e,i),s){for(;s.hasChildNodes();)e.appendChild(s.firstChild);this._destroyEditableClone()}else this._renderContent(n,o,e,o.data,this.buildCellTemplateContext(o,l))},z.prototype._resetEditableClone=function(){if(this._isGridEditable()&&this.m_active&&"cell"===this.m_active.type){let e=this._getActiveElement();e&&this._setEditableClone(e)}},z.prototype._setEditableClone=function(e){if(this._destroyEditableClone(),null!=e){var t=e.cloneNode(!1);t.removeAttribute("id"),this._createUniqueId(t),t[this.getResources().getMappedAttribute("context")]=e[this.getResources().getMappedAttribute("context")],t[this.getResources().getMappedAttribute("metadata")]=e[this.getResources().getMappedAttribute("metadata")],t[this.getResources().getMappedAttribute("context")].parentElement=t,this.m_root.appendChild(t),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),null),t.style.display="none",t[this.getResources().getMappedAttribute("context")].parentElement=e,this.m_editableClone=t}},z.prototype._destroyEditableClone=function(){this.m_editableClone&&(null!=this.m_editableClone.parentNode?this._remove(this.m_editableClone):this._cleanTemplateNodes(this.m_editableClone),delete this.m_editableClone)},z.prototype.isArrowKey=function(e){return e===this.keyCodes.UP_KEY||e===this.keyCodes.DOWN_KEY||e===this.keyCodes.LEFT_KEY||e===this.keyCodes.RIGHT_KEY},z.prototype.createIndex=function(e,t){var i={};return void 0!==e&&(i.row=e),void 0!==t&&(i.column=t),i},z.prototype.checkCorners=function(e,t,i){return"column"===this.m_selectionFrontier.axis&&this.m_columnHeaderLevelCount!==this.m_selectionFrontier.level||"row"===this.m_selectionFrontier.axis&&this.m_rowHeaderLevelCount!==this.m_selectionFrontier.level||"rowEnd"===this.m_selectionFrontier.axis&&this.m_rowEndHeaderLevelCount!==this.m_selectionFrontier.level||"columnEnd"===this.m_selectionFrontier.axis&&this.m_columnEndHeaderLevelCount!==this.m_selectionFrontier.level||(-1!==e.indexOf("row")?t===i.startIndex.row&&this.m_selectionFrontier.end===i.endIndex.row||t===i.endIndex.row&&this.m_selectionFrontier.end===i.startIndex.row:-1!==e.indexOf("column")&&(t===i.startIndex.column&&this.m_selectionFrontier.end===i.endIndex.column||t===i.endIndex.column&&this.m_selectionFrontier.end===i.startIndex.column))},z.prototype.handleLabelFocusChange=function(e,t,i,s){var n,o,l,r;if(!this.isFetchComplete())return!0;this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY));var a=this.m_active.axis,h=this.m_active.level;switch("column"===a?(l=this.m_startColHeader,r=this.m_columnHeaderLevelCount):"row"===a&&(l=this.m_startRowHeader,r=this.m_rowHeaderLevelCount),"columnEnd"===a&&(e===this.keyCodes.DOWN_KEY?e=this.keyCodes.UP_KEY:e===this.keyCodes.UP_KEY&&(e=this.keyCodes.DOWN_KEY),l=this.m_startColEndHeader,r=this.m_columnEndHeaderLevelCount),"rowEnd"===a&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY),l=this.m_startRowEndHeader,r=this.m_rowEndHeaderLevelCount),e){case this.keyCodes.DOWN_KEY:"row"!==a&&"rowEnd"!==a||(n=this._getHeaderCellByIndex(l,a,h),this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:l,level:h,axis:a},t)),"column"!==a&&"columnEnd"!==a||((n=this.m_headerLabels[a][h+1])?this._setActive(n,{type:"label",level:h+1,axis:a},t):"column"===a&&h===r-1&&this.m_headerLabels.row.length?(n=this.m_headerLabels.row[this.m_headerLabels.row.length-1],this._setActive(n,{type:"label",level:this.m_headerLabels.row.length-1,axis:"row"},t)):h===r-1&&(o="column"===a?this.m_startRowHeader:this.m_endRowHeader,n=this._getHeaderByIndex(o,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),n&&this._setActive(n,{type:"header",index:o,level:h,axis:"row"},t)));break;case this.keyCodes.UP_KEY:"row"===a&&h===r-1&&this.m_headerLabels.column.length&&(n=this.m_headerLabels.column[this.m_headerLabels.column.length-1],this._setActive(n,{type:"label",level:this.m_headerLabels.column.length-1,axis:"column"},t)),"column"!==a&&"columnEnd"!==a||(n=this.m_headerLabels[a][h-1])&&this._setActive(n,{type:"label",level:h-1,axis:a},t);break;case this.keyCodes.RIGHT_KEY:if("row"===a||"rowEnd"===a)if(n=this.m_headerLabels[a][h+1])this._setActive(n,{type:"label",level:h+1,axis:a},t);else if(h===r-1){for(o="row"===a?this.m_startColHeader:this.m_endColHeader;this.isHidden("column",o);)o="row"===a?o+1:o-1;(n=this._getHeaderCellByIndex(o,"column",this.m_columnHeaderLevelCount))&&(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:o,level:h,axis:"column"},t))}if("column"===a||"columnEnd"===a){for(o=l,n=this._getHeaderCellByIndex(o,a,h);n&&this.isHeaderHidden(n);)o=h!==r-1?this._getAttribute(n.parentNode,"start",!0)+this._getAttribute(n.parentNode,"extent",!0):o+1,n=this._getHeaderCellByIndex(o,a,h);this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(n,{type:"header",index:l,level:h,axis:a},t)}break;case this.keyCodes.LEFT_KEY:"row"!==a&&"rowEnd"!==a||(n=this.m_headerLabels[a][h-1])&&this._setActive(n,{type:"label",level:h-1,axis:a},t)}return!0},z.prototype.handleHeaderFocusChange=function(e,t,i,s,n){var o,l,r,a,h,d,m;let c,u,_=this._getEmptyElement();this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY));var p=this.m_active.axis,g=this.m_active.index,C=this.m_active.level,f=this._getActiveElement(),y=null!=f?this._getAttribute(f,"depth",!0):1;if(p||g||!this.m_active||(p=this.m_selectionFrontier.axis,g=this.m_active.indexes[p]),t.shiftKey&&!i&&this.m_selectionFrontier&&this.isMultipleSelection()&&(i=this.checkHeaderToDatabody(p,e)),!(i&&this.isArrowKey(e)&&this.isHeaderSelectionType(this.m_selectionFrontier)&&this.checkCorners(p,g,this.m_selection[this.m_selection.length-1]))||(p=this.m_selectionFrontier.axis,g=this.m_selectionFrontier.index,C=this.m_selectionFrontier.level,-1===g&&(g=this.m_active.indexes[p]),"cell"!==this.m_active.type||(e!==this.keyCodes.LEFT_KEY&&e!==this.keyCodes.RIGHT_KEY||-1===p.indexOf("row"))&&(e!==this.keyCodes.UP_KEY&&e!==this.keyCodes.DOWN_KEY||-1===p.indexOf("column")))){if("column"===p?(u=this.m_colHeader,h=this.m_endColHeader,d=this.m_columnHeaderLevelCount,m=this.m_stopColumnHeaderFetch,c=this.m_startColHeader):"row"===p&&(h=this.m_endRowHeader,d=this.m_rowHeaderLevelCount,m=this.m_stopRowHeaderFetch,c=this.m_startRowHeader),"columnEnd"===p&&(e===this.keyCodes.DOWN_KEY?e=this.keyCodes.UP_KEY:e===this.keyCodes.UP_KEY&&(e=this.keyCodes.DOWN_KEY),u=this.m_colEndHeader,h=this.m_endColEndHeader,d=this.m_columnEndHeaderLevelCount,m=this.m_stopColumnEndHeaderFetch,c=this.m_startColEndHeader),"rowEnd"===p&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY),h=this.m_endRowEndHeader,d=this.m_rowEndHeaderLevelCount,m=this.m_stopRowEndHeaderFetch,c=this.m_startRowEndHeader),!this.isFetchComplete())return this.m_skeletonSet.size>0&&!i&&(r=1===d||C===d-1?g+1:null!=f?this._getAttribute(f.parentNode,"start",!0)+this._getAttribute(f.parentNode,"extent",!0):g+1,(e===this.keyCodes.RIGHT_KEY&&r===this.m_endCol+1||e===this.keyCodes.DOWN_KEY&&r===this.m_endRow+1)&&this._scrollSkeletonHeadersIntoViewport(r-1,p,C,!0)),!0;i&&this.isArrowKey(e)&&this.isHeaderSelectionType(this.m_selectionFrontier)&&(y=null!=(f=this._getHeaderCellByIndex(g,p,C))?this._getAttribute(f,"depth",!0):1);var E=this._isSelectionEnabled()?this.selectAndFocus.bind(this):this._setActiveByIndex.bind(this);switch(e){case this.keyCodes.LEFT_KEY:if("column"===p||"columnEnd"===p)if(g>0&&!this.isFirstOrFirstNonHiddenIndex(g)){if(s&&this.m_headerLabels[p][C]){this._setActive(this.m_headerLabels[p][C],{type:"label",level:C,axis:p},t);break}if("column"===p&&s&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]){this._setActive(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],{type:"label",level:this.m_rowHeaderLevelCount-1,axis:"row"},t);break}r=null!=(l=this._getHeaderByIndex(g-1,C,u,d,c))&&C!==d-1?this._getAttribute(l.parentNode,"start",!0)-this._getAttribute(l.parentNode,"extent",!0):g-1;let e=1;for(;this.isHeaderHidden(l);)r=g-1-e,l=this._getHeaderByIndex(r,C,u,d,c),e+=1;if(r=null!=l&&C!==d-1?this._getAttribute(l.parentNode,"start",!0):r,a=null!=l?this.getHeaderCellLevel(l):C,r<0)break;i?this.extendSelectionHeader(l,t,!0):r<c?this._scrollSkeletonHeadersIntoViewport(g,p,C,!1):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"row"!==this.m_options.getSelectionMode()&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(l,{type:"header",index:r,level:a,axis:p},t),this._highlightActive())}else this.m_headerLabels[p][C]?this._setActive(this.m_headerLabels[p][C],{type:"label",level:C,axis:p},t):"column"===p&&this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],{type:"label",level:this.m_rowHeaderLevelCount-1,axis:"row"},t);else("row"===p||"rowEnd"===p)&&C>0&&(l=this._getHeaderCellByIndex(g,p,C-1),r=this._getAttribute(l.parentNode,"start",!0),a=this.getHeaderCellLevel(l),i?this.extendSelectionHeader(l,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(l,{type:"header",index:r,level:a,axis:p},t),this._highlightActive()));break;case this.keyCodes.RIGHT_KEY:if("rowEnd"===p&&s&&-1!==this.m_endRowHeader)l=this._getHeaderCellByIndex(g,p,this.m_rowHeaderLevelCount),i?this.extendSelectionHeader(l,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(l,{type:"header",index:g,level:this.m_rowHeaderLevelCount,axis:p},t),this._highlightActive());else if("row"===p&&s&&-1!==this.m_endRowEndHeader)l=this._getHeaderByIndex(g,this.m_rowEndHeaderLevelCount,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),i?this.extendSelectionHeader(l,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(l,{type:"header",index:g,level:this.m_rowEndHeaderLevelCount,axis:p},t),this._highlightActive());else if("row"===p||"rowEnd"===p)if(C+y>=d&&!i)if(this.m_trueIndex={row:g},n){if("row"===p){let e=this._getEmptyCellNeighborIndex({row:g,column:-1},{right:!0},this._getMaxRight(),this.m_endRowEndHeader);if(e)if(e.cell)E(e.cell,t);else if(e.header){let e=this._getHeaderCellByIndex(this.m_trueIndex.row,"rowEnd",this.m_rowEndHeaderLevelCount-1);this._setActive(e,{type:"header",index:g,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t,!0)}}else if("rowEnd"===p){let e=this._getEmptyCellNeighborIndex({row:g,column:this.m_endCol+1},{left:!0},this._getMaxLeft(),this.m_startRowHeader);if(e.cell)E(e.cell,t);else if(e.header){let e=this._getHeaderCellByIndex(this.m_trueIndex.row,"row",this.m_rowHeaderLevelCount-1);this._setActive(e,{type:"header",index:g,level:this.m_rowHeaderLevelCount-1,axis:"row"},t,!0)}}}else if(_)this._setActive(_,{type:"empty"},t,!0);else{let e,i;if("row"===p){for(let e=0;e<=this.getDataSource().getCount("column")-1;e++)if(!this.isHidden("column",e)){i=e;break}o=this.createIndex(g,i)}else this._isHighWatermarkScrolling()?(e=this.getVisibleCellIndexInDirection("column",this.m_endCol,{left:!0}),o=this.createIndex(g,e)):(e=this.getVisibleCellIndexInDirection("column",this.getDataSource().getCount("column")-1,{left:!0}),o=this.createIndex(g,e));if(this._isSelectionEnabled())this.selectAndFocus(o,t);else{let e=this._getCellByIndex(o).classList.contains(this.getMappedStyle("frozenCell"));this._setActiveByIndex(o,t,null,null,e),this._highlightActive()}}else l=this._getHeaderCellByIndex(g,p,C+y),r=this._getAttribute(l.parentNode,"start",!0),a=this.getHeaderCellLevel(l),i?this.extendSelectionHeader(l,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(l,{type:"header",index:r,level:a,axis:p},t),this._highlightActive());else if("column"===p&&s&&this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1])this._setActive(this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t);else{for(r=null!=f&&C!==d-1?this._getAttribute(f.parentNode,"start",!0)+this._getAttribute(f.parentNode,"extent",!0):g+1,l=this._getHeaderCellByIndex(r,p,C);l&&this.isHeaderHidden(l);)r=C!==d-1?this._getAttribute(l.parentNode,"start",!0)+this._getAttribute(l.parentNode,"extent",!0):r+1,l=this._getHeaderCellByIndex(r,p,C);a=null!=l?this.getHeaderCellLevel(l):C,r>h&&m||!(this._isCountUnknown("column")||r<this.getDataSource().getCount("column"))?"column"===p&&this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.rowEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},t):i?this.extendSelectionHeader(l,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"row"!==this.m_options.getSelectionMode()&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(l,{type:"header",index:r,level:a,axis:p},t),this._highlightActive())}break;case this.keyCodes.UP_KEY:if("row"===p||"rowEnd"===p){if(s&&this.m_headerLabels[p][C]){this._setActive(this.m_headerLabels[p][C],{type:"label",level:C,axis:p},t);break}if("row"===p&&s&&this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]){this._setActive(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],{type:"label",level:this.m_columnHeaderLevelCount-1,axis:"column"},t);break}if(g>0){if(1===d)r=g-1,l=null!=f?f.previousSibling:null,null===f.previousSibling&&this._hasFrozenRows()&&(l=this._getHeaderCellByIndex(r,p,C)),a=C;else if(C===d-1?(r=g-1,l=this._getHeaderCellByIndex(r,p,C)):r=null!=(l=null!==f?this._getHeaderCellByIndex(this._getAttribute(f.parentNode,"start",!0)-1,p,C):null)?this._getAttribute(l.parentNode,"start",!0):g-1,a=null!=l?this.getHeaderCellLevel(l):C,r<0)break;i?this.extendSelectionHeader(l,t,!0):r<c?this._scrollSkeletonHeadersIntoViewport(g,p,C,!1):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(l,{type:"header",index:r,level:a,axis:p},t),this._highlightActive())}else this.m_headerLabels[p][C]?this._setActive(this.m_headerLabels[p][C],{type:"label",level:C,axis:p},t):"row"===p&&this.m_headerLabels.column[this.m_columnHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],{type:"label",level:this.m_columnHeaderLevelCount-1,axis:"column"},t)}else("column"===p||"columnEnd"===p)&&C>0&&(l=this._getHeaderCellByIndex(g,p,C-1),r=this._getAttribute(l.parentNode,"start",!0),a=this.getHeaderCellLevel(l),i?this.extendSelectionHeader(l,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(l,{type:"header",index:r,level:a,axis:p},t),this._highlightActive()));break;case this.keyCodes.DOWN_KEY:if("columnEnd"===p&&s&&-1!==this.m_endColHeader)l=this._getHeaderByIndex(g,this.m_columnHeaderLevelCount,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader),i?this.extendSelectionHeader(l,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this.m_selectionFrontier={},this._clearSelection(t)),this._setActive(l,{type:"header",index:g,level:this.m_columnHeaderLevelCount,axis:p},t),this._highlightActive());else if("column"===p&&s&&-1!==this.m_endColEndHeader)l=this._getHeaderByIndex(g,this.m_columnEndHeaderLevelCount,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader),i?this.extendSelectionHeader(l,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(l,{type:"header",index:g,level:this.m_columnEndHeaderLevelCount,axis:p},t),this._highlightActive());else if("column"===p||"columnEnd"===p)if(C+y>=d&&!i)if(this.m_trueIndex={column:g},n){if("column"===p){let e=this._getEmptyCellNeighborIndex({row:0,column:this.m_trueIndex.column},{down:!0},this._getMaxBottom(),this.m_endColEndHeader);if(e)if(e.cell)E(e.cell,t);else if(e.header){let e=this._getHeaderCellByIndex(this.m_trueIndex.column,"columnEnd",this.m_columnEndHeaderLevelCount-1);this._setActive(e,{type:"header",index:g,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t,!0)}}else if("columnEnd"===p){let e=this._getEmptyCellNeighborIndex({row:this.m_endRow+1,column:this.m_trueIndex.column},{up:!0},this._getMaxTop(),this.m_startColHeader);if(e)if(e.cell)E(e.cell,t);else if(e.header){let e=this._getHeaderCellByIndex(this.m_trueIndex.column,"column",this.m_columnHeaderLevelCount-1);this._setActive(e,{type:"header",index:g,level:this.m_columnHeaderLevelCount-1,axis:"column"},t,!0)}}}else _?this._setActive(_,{type:"empty"},t,!0):(o="column"===p?this.createIndex(0,g):this._isHighWatermarkScrolling()?this.createIndex(this.m_endRow,g):this.createIndex(this.getDataSource().getCount("row")-1,g),this._isSelectionEnabled()?this.selectAndFocus(o,t):(this._setActiveByIndex(o,t),this._highlightActive()));else g=this.getVisibleCellIndexInDirection("column",g,{down:!0}),l=this._getHeaderCellByIndex(g,p,C+y),r=this._getAttribute(l.parentNode,"start",!0),a=this.getHeaderCellLevel(l),i?this.extendSelectionHeader(l,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(l,{type:"header",index:r,level:a,axis:p},t),this._highlightActive());else"row"===p&&s&&this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1]?this._setActive(this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1],{type:"label",level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t):(1===d?(r=g+1,l=null!=f?f.nextSibling:null,null===f.nextSibling&&(l=this._getHeaderCellByIndex(r,p,C)),a=C):(r=C===d-1?g+1:null!=f?this._getAttribute(f.parentNode,"start",!0)+this._getAttribute(f.parentNode,"extent",!0):g+1,a=null!=(l=this._getHeaderCellByIndex(r,p,C))?this.getHeaderCellLevel(l):C),r>h&&m||!(this._isCountUnknown("row")||r<this.getDataSource().getCount("row"))?"row"===p&&this.m_headerLabels.columnEnd[this.m_columnEndHeaderLevelCount-1]&&this._setActive(this.m_headerLabels.columnEnd[this.m_rowEndHeaderLevelCount-1],{type:"label",level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},t):i?this.extendSelectionHeader(l,t,!0):(this._isSelectionEnabled()&&!this.m_discontiguousSelection&&(this._clearSelection(t),this.m_selectionFrontier={}),this._setActive(l,{type:"header",index:r,level:a,axis:p},t),this._highlightActive()));break;case this.keyCodes.PAGEUP_KEY:"row"!==p&&"rowEnd"!==p||(f=this._getHeaderCellByIndex(0,p,C),this._setActive(f,{type:"header",index:0,level:C,axis:p},t));break;case this.keyCodes.PAGEDOWN_KEY:"row"!==p&&"rowEnd"!==p||(g=this._isCountUnknown("row")||this._isHighWatermarkScrolling()?Math.max(0,h):Math.max(0,this.getDataSource().getCount("row")-1),f=this._getHeaderCellByIndex(g,p,C),this._setActive(f,{type:"header",index:g,level:C,axis:p},t));break;case this.keyCodes.HOME_KEY:if("column"===p||"columnEnd"===p){let e;for(let t=0;t<=g;t++)if(!this.isHidden(p,t)){e=t;break}f=this._getHeaderCellByIndex(e,p,C),this._setActive(f,{type:"header",index:e,level:C,axis:p},t)}break;case this.keyCodes.END_KEY:if("column"===p||"columnEnd"===p){let e;e=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?Math.max(0,h):Math.max(0,this.getDataSource().getCount("column")-1);for(let t=e;t>=g;t--)if(!this.isHidden(p,t)){e=t;break}f=this._getHeaderCellByIndex(e,p,C),this._setActive(f,{type:"header",index:e,level:C,axis:p},t)}}return!0}},z.prototype.checkHeaderToDatabody=function(e,t){return!("row"===e&&this.m_rowHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.RIGHT_KEY||"rowEnd"===e&&this.m_rowEndHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.LEFT_KEY||"column"===e&&this.m_columnHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.DOWN_KEY||"columnEnd"===e&&this.m_columnEndHeaderLevelCount===this.m_selectionFrontier.level&&t===this.keyCodes.UP_KEY)},z.prototype._getHeaderLabelledBy=function(e,t,i,s,n,o,l,r){var a;if(-1!==n&&(o!==l||this.m_externalFocus)){var h=this.getHeaderFromCell(r,e);return null!=l&&(a=this._getHeaderByIndex(l,i-1,t,i,s)),this._getHeaderAndParentIds(h,a)}return""},z.prototype._getHeaderAndParentIds=function(e,t){var i="",s=[];if(null==e)return"";var n=this._getHeaderAndParents(e);null!=t&&(s=this._getHeaderAndParents(t));for(var o=0;o<n.length;o++)s[o]===n[o]&&o!==n.length-1||(i+=(""===i?"":" ")+n[o].id);return i},z.prototype._getHeaderAndParents=function(e){var t,i=[e],s=this.getHeaderCellAxis(e),n=this.getHeaderCellLevel(e),o=this._getLabel(s,n);if("row"===s?t=this.m_rowHeaderLevelCount:"column"===s?t=this.m_columnHeaderLevelCount:"rowEnd"===s?t=this.m_rowEndHeaderLevelCount:"columnEnd"===s&&(t=this.m_columnEndHeaderLevelCount),o&&i.unshift(o),1===t)return i;for(n===t-1&&(e=e.parentNode.firstChild,i.unshift(e),n-=1,(o=this._getLabel(s,n))&&i.unshift(o));n>0;)e=e.parentNode.parentNode.firstChild,i.unshift(e),n-=1,(o=this._getLabel(s,n))&&i.unshift(o);return i},z.prototype.isHeaderSelectionType=function(e){return!(!e||!e.axis)},z.prototype._isChildEmpty=function(e){if(e){let t=e.textContent.trim();return!(e.children.length>0||t.length>0)}return!1},z.prototype._isNeighborCellEmpty=function(e,t){let i=this._getIndex(e,"row"),s=this._getIndex(e,"column");if("row"===t){let t=this.getVisibleCellIndexInDirection("column",s-1,{left:!0}),n=this.getVisibleCellIndexInDirection("column",s+1,{right:!0}),o=this._getCellByIndex({row:i,column:t}),l=this._getCellByIndex({row:i,column:n});if((this._isChildEmpty(o)||this._isChildEmpty(l))&&!this._isChildEmpty(e)&&!this.isHidden("column",s))return!0}else if("column"===t){let t=this._getCellByIndex({row:i-1,column:s}),n=this._getCellByIndex({row:i+1,column:s});if((this._isChildEmpty(t)||this._isChildEmpty(n))&&!this._isChildEmpty(e))return!0}return!1},z.prototype._getEmptyCellNeighborIndex=function(e,t,i,s){let n,o,l,r,a,h,d,m=e.row,c=e.column,u=Object.create({}),_=t.left||t.right,p=t.up||t.down,g=t.right||t.down,C=t.left||t.up;_?(n="row",o=c,l=m):p&&(n="column",o=m,r=c),g?(a=1,d=i):C&&(a=-1,d=i-1);let f,y=o;for(;C?y>=i:y<=i;){if(g?f=y<i:C&&(f=y>i),_?r=y===i?d:y+a:p&&(l=y===i?d:y+a),h=this._getCellByIndex({row:l,column:r}),f&&this._isNeighborCellEmpty(h,n))return u.cell=this.createIndex(l,r),u;if(y===i){let e;return g?e=(t.right?this._isLastColumn(y):this._isLastRow(y))&&-1!==s:C&&(e=0===y),e?(u.header=!0,u):(u.cell=this.createIndex(l,r),u)}y+=a}return null},z.prototype.handleNoDataFocusChange=function(e,t,i,s){let n;if(null==this.m_active)return null;switch(this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY)),e){case this.keyCodes.UP_KEY:!t&&s&&-1!==this.m_endColHeader&&(n=this._getHeaderByIndex(this.m_startColHeader,this.m_columnHeaderLevelCount-1,this.m_colHeader,this.m_columnHeaderLevelCount,this.m_startColHeader,!0),this._setActive(n,{type:"header",index:this.m_startColHeader,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0));break;case this.keyCodes.DOWN_KEY:-1!==this.m_endColEndHeader&&s&&(n=this._getHeaderByIndex(this.m_startColEndHeader,this.m_columnEndHeaderLevelCount-1,this.m_colEndHeader,this.m_columnEndHeaderLevelCount,this.m_startColEndHeader,!0),this._setActive(n,{type:"header",index:this.m_startColEndHeader,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0));break;case this.keyCodes.LEFT_KEY:!t&&s&&-1!==this.m_endRowHeader&&(n=this._getHeaderByIndex(this.m_startRowHeader,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader,!0),this._setActive(n,{type:"header",index:this.m_startRowHeader,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0));break;case this.keyCodes.RIGHT_KEY:-1!==this.m_endRowEndHeader&&s&&(n=this._getHeaderByIndex(this.m_startRowEndHeader,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader,!0),this._setActive(n,{type:"header",index:this.m_startRowEndHeader,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0))}return!0},z.prototype.handleFocusChange=function(e,t,i,s,n,o=!1,l=!1){var r,a,h,d=1,m=1;if(this.getResources().isRTLMode()&&(e===this.keyCodes.LEFT_KEY?e=this.keyCodes.RIGHT_KEY:e===this.keyCodes.RIGHT_KEY&&(e=this.keyCodes.LEFT_KEY)),!this.isFetchComplete()&&!1===this.m_fetchingForUpdate){if(this.m_skeletonSet.size>0&&!t){const t=(r=this.m_active.indexes).column,i=r.row;e===this.keyCodes.RIGHT_KEY&&t+1===this.m_endCol+1?this._scrollSkeletonCellsIntoViewport(i,t,"column",!0):e===this.keyCodes.DOWN_KEY&&i+1===this.m_endRow+1&&this._scrollSkeletonCellsIntoViewport(i,t,"row",!0)}return!0}if(t){if(r=this.m_selectionFrontier,this.isHeaderSelectionType(this.m_selectionFrontier))return void this.handleHeaderFocusChange(e,i,t,n)}else r=this.m_active.indexes;if(null!=r){var c,u,_,p,g;switch(null==this.m_trueIndex&&(this.m_trueIndex={}),c=this._isSelectionEnabled()?this.selectAndFocus.bind(this):this._setActiveByIndex.bind(this),u=r.row,_=r.column,(p=this._getCellByIndex(r))&&(d=(g=p[this.getResources().getMappedAttribute("context")]).extents.row,m=g.extents.column),e){case this.keyCodes.LEFT_KEY:if(this.m_trueIndex.row||t||(this.m_trueIndex={row:u}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{left:!0},this._getMaxLeft(),this.m_startRowHeader);s&&(s.cell?c(s.cell,i):s.header&&(h=this._getHeaderCellByIndex(this.m_trueIndex.row,"row",this.m_rowHeaderLevelCount-1),this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0)))}else if(_>0&&(!n||-1===this.m_endRowHeader))if("row"===this.m_options.getSelectionMode())a=this.createIndex(this.m_trueIndex.row,_-1),this._setActiveByIndex(a,i);else{if(t)a=this.createIndex(u,_-1),this.extendSelection(a,i,e);else if(_-1<this.m_startCol)this._scrollSkeletonCellsIntoViewport(u,_,"column",!1);else{let e=_-1,t=!1;for(;this.isHidden("column",e);){if(0===e){e=this.getVisibleCellIndexInDirection("column",e,{right:!0}),t=!0;break}e-=1}t&&s?(h=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowHeaderLevelCount-1,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader),this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0)):c(a=this.createIndex(this.m_trueIndex.row,e),i)}_-1==0&&this._setAccInfoText("accessibleFirstColumn")}else!t&&s&&(h=this._getHeaderCellByIndex(this.m_trueIndex.row,"row",this.m_rowHeaderLevelCount-1),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"row",h,this.m_rowHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowHeaderLevelCount-1,axis:"row"},i,!0));break;case this.keyCodes.RIGHT_KEY:if(this.m_trueIndex.row||t||(this.m_trueIndex={row:u}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{right:!0},this._getMaxRight(),this.m_endRowEndHeader);s&&(s.cell?c(s.cell,i):s.header&&(h=this._getHeaderCellByIndex(this.m_trueIndex.row,"rowEnd",this.m_rowEndHeaderLevelCount-1),this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0)))}else if(this._isLastColumn(_+(m-1))||n&&-1!==this.m_endRowEndHeader)-1!==this.m_endRowEndHeader&&s?(h=this._getHeaderCellByIndex(this.m_trueIndex.row,"rowEnd",this.m_rowEndHeaderLevelCount-1),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"rowEnd",h,this.m_rowEndHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0)):t||c(r,i);else if("row"===this.m_options.getSelectionMode())a=this.createIndex(this.m_trueIndex.row,_+m),this._setActiveByIndex(a,i);else{if(t)a=this.createIndex(u,_+1),this.extendSelection(a,i,e);else{let e=_+m,t=!1;for(;this.isHidden("column",e);){if(this._isLastColumn(e)){e=this.getVisibleCellIndexInDirection("column",e,{left:!0}),t=!0;break}e+=1}t&&-1!==this.m_endRowEndHeader?(h=this._getHeaderByIndex(this.m_trueIndex.row,this.m_rowEndHeaderLevelCount-1,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader),this._setActive(h,{type:"header",index:this.m_trueIndex.row,level:this.m_rowEndHeaderLevelCount-1,axis:"rowEnd"},i,!0)):c(a=this.createIndex(this.m_trueIndex.row,e),i)}this._isLastColumn(_+m)&&this._setAccInfoText("accessibleLastColumn")}break;case this.keyCodes.UP_KEY:if(this.m_trueIndex.column||t||(this.m_trueIndex={column:_}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{up:!0},this._getMaxTop(),this.m_startColHeader);s&&(s.cell?c(s.cell,i):s.header&&(h=this._getHeaderCellByIndex(this.m_trueIndex.column,"column",this.m_columnHeaderLevelCount-1),this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0)))}else u>0&&(!n||-1===this.m_endColHeader)?(t?(a=this.createIndex(u-1,_),this.extendSelection(a,i,e)):u-1<this.m_startRow?this._scrollSkeletonCellsIntoViewport(u,_,"row",!1):c(a=this.createIndex(u-1,this.m_trueIndex.column),i),u-1==0&&this._setAccInfoText("accessibleFirstRow")):!t&&s&&(h=this._getHeaderCellByIndex(this.m_trueIndex.column,"column",this.m_columnHeaderLevelCount-1),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"column",h,this.m_columnHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnHeaderLevelCount-1,axis:"column"},i,!0));break;case this.keyCodes.DOWN_KEY:if(this.m_trueIndex.column||t||(this.m_trueIndex={column:_}),o){let e=g.indexes.row,t=g.indexes.column,s=this._getEmptyCellNeighborIndex({row:e,column:t},{down:!0},this._getMaxBottom(),this.m_endColEndHeader);s&&(s.cell?c(s.cell,i):s.header&&(h=this._getHeaderCellByIndex(this.m_trueIndex.column,"columnEnd",this.m_columnEndHeaderLevelCount-1),this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0)))}else this._isLastRow(u+(d-1))||n&&-1!==this.m_endColEndHeader?-1!==this.m_endColEndHeader&&s?(h=this._getHeaderCellByIndex(this.m_trueIndex.column,"columnEnd",this.m_columnEndHeaderLevelCount-1),this.m_discontiguousSelection?this.discontiguousHeaderSetActiveFromDatabody(i,"columnEnd",h,this.m_columnEndHeaderLevelCount):this._setActive(h,{type:"header",index:this.m_trueIndex.column,level:this.m_columnEndHeaderLevelCount-1,axis:"columnEnd"},i,!0)):t||c(r,i):(t?(a=this.createIndex(u+1,_),this.extendSelection(a,i,e)):c(a=this.createIndex(u+d,this.m_trueIndex.column),i),this._isLastRow(u+d)&&this._setAccInfoText("accessibleLastRow"));break;case this.keyCodes.HOME_KEY:{let e=0,t=0;for(let e=0;e<=_;e++)if(!this.isHidden("column",e)){t=e;break}if(l)c(this.createIndex(e,t),i);else this.m_trueIndex.row||(this.m_trueIndex={row:u}),c(a=this.createIndex(this.m_trueIndex.row,t),i);break}case this.keyCodes.END_KEY:{let e;this.m_trueIndex.row||(this.m_trueIndex={row:u,column:_}),e=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?Math.max(0,this.m_endCol):Math.max(0,this.getDataSource().getCount("column")-1);for(let t=e;t>=_;t--)if(!this.isHidden("column",t)){e=t;break}if(l){let t;t=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(Math.max(0,this.m_endRow),e):this.createIndex(Math.max(0,this.getDataSource().getCount("row")-1),e),c(t,i)}else c(a=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(this.m_trueIndex.row,Math.max(0,e)):this.createIndex(this.m_trueIndex.row,e),i);break}case this.keyCodes.PAGEUP_KEY:this.m_trueIndex.column||(this.m_trueIndex={column:_}),c(a=this.createIndex(0,_),i);break;case this.keyCodes.PAGEDOWN_KEY:this.m_trueIndex.column||(this.m_trueIndex={column:_}),c(a=this._isCountUnknown("column")||this._isHighWatermarkScrolling()?this.createIndex(Math.max(0,this.m_endRow),this.m_trueIndex.column):this.createIndex(Math.max(0,this.getDataSource().getCount("row")-1),this.m_trueIndex.column),i)}return!0}},z.prototype.scrollToIndex=function(e,t,i){var s,n,o=e.row,l=e.column;t&&(this.m_shouldFocus=!1),i&&(e.scrollToOrigin=!0);var r=this.getResources().isRTLMode()?"right":"left",a=0,h=0,d=this._getViewportTop(),m=this._getViewportBottom(),c=this._getViewportLeft(),u=this._getViewportRight();if(o<this.m_startRow||o>this.m_endRow){var _;_=o<this.m_startRow?this.m_avgRowHeight*o:this.m_avgRowHeight*(o+1)-m+d,h=this.m_currentScrollTop-_,this.m_scrollIndexAfterFetch=e,s=!0}else{n=this._getCellByIndex(e);let t=this.getMappedStyle("frozenCell");var p;null===n?(n=this._getFirstCellWithMatchingStartIndex(o,"row"),p=this.m_sizingManager.getSize("row",this._getKey(n,"row"))):p=this.getElementHeight(n);var g=this.getElementDir(n,"top");if(i||e.scrollToOrigin?h=d-g:g+p>m?h=m-(g+p):g<d&&(h=d-g),n&&n.classList.contains(t)){let e=this._getCellContainer(n);(e.classList.contains(this.getMappedStyle("databodyFrozenRow"))||e.classList.contains(this.getMappedStyle("databodyFrozenCorner")))&&(h=0)}}if(!isNaN(l)&&!0!==s)if(l<this.m_startCol||l>this.m_endCol){var C;let t,i;l<this.m_startCol?(t=this.hiddenColumnsInDirection(l,{left:!0}),i=t.length,C=this.m_avgColWidth*(l-i)):(t=this.hiddenColumnsInDirection(l,{right:!0}),i=t.length,C=this.m_avgColWidth*(l-i+1)-u+c),a=this.m_currentScrollLeft-C,this.m_scrollIndexAfterFetch=e}else{var f;null===(n=this._getCellByIndex(e))?(n=this._getFirstCellWithMatchingStartIndex(l,"column"),f=this.m_sizingManager.getSize("column",this._getKey(n,"column"))):f=this.getElementWidth(n);var y=this.getElementDir(n,r);i||e.scrollToOrigin||y<c?a=c-y:y+f>u&&(a=u-(y+f));let t=this.getMappedStyle("frozenCell");if(n&&n.classList.contains(t)){let e=this._getCellContainer(n);(e.classList.contains(this.getMappedStyle("databodyFrozenCol"))||e.classList.contains(this.getMappedStyle("databodyFrozenCorner")))&&(a=0)}}0!==a||0!==h?(null!=(n=this._getCellByIndex(e))&&!0!==t&&!1!==this.m_shouldFocus&&(this.m_cellToFocus=n),this.scrollDelta(a,h)):null!=this.m_scrollIndexAfterFetch&&(t||!1===this.m_shouldFocus||this._setActiveByIndex(this.m_scrollIndexAfterFetch,null,!1,!1,!0))&&(this.m_scrollIndexAfterFetch=null)},z.prototype.scrollToHeader=function(e){var t,i,s,n,o,l,r,a,h,d=e.axis,m=e.index,c=e.level,u=0;"row"===d?(t=this.m_startRowHeader,i=this.m_endRowHeader,s=this.m_avgRowHeight,n=this.m_currentScrollTop,a=this._getViewportTop(),h=this._getViewportBottom()):"column"===d?(t=this.m_startColHeader,i=this.m_endColHeader,s=this.m_avgColWidth,n=this.m_currentScrollLeft,a=this._getViewportLeft(),h=this._getViewportRight()):"rowEnd"===d?(t=this.m_startRowEndHeader,i=this.m_endRowEndHeader,s=this.m_avgRowHeight,n=this.m_currentScrollTop,a=this._getViewportTop(),h=this._getViewportBottom()):"columnEnd"===d&&(t=this.m_startColEndHeader,i=this.m_endColEndHeader,s=this.m_avgColWidth,n=this.m_currentScrollLeft,a=this._getViewportLeft(),h=this._getViewportRight());var _=h-a;if(m<t||m>i?(u=n-(m<t?s*m:s*(m+1)-_),this.m_scrollHeaderAfterFetch=e):("row"===d||"rowEnd"===d?(r=this._getHeaderCellByIndex(m,d,c),o=this.getElementDir(r,"top"),l=this.getElementHeight(r)):"column"!==d&&"columnEnd"!==d||(r=this._getHeaderCellByIndex(m,d,c),o=this.getElementDir(r,this.getResources().isRTLMode()?"right":"left"),l=this.getElementWidth(r)),_>l?o+l>h?u=h-(o+l):o<a&&(u=a-o):u=a-o),r){let e=this.getMappedStyle("frozenHeader");r.classList.contains(e)&&(u=0)}0!==u?(null!=r&&!1!==this.m_shouldFocus&&(this.m_cellToFocus=r),"row"===d||"rowEnd"===d?this.scrollDelta(0,u):this.scrollDelta(u,0)):null!=this.m_scrollHeaderAfterFetch&&(this._updateActive(e,!0,!0),this.m_scrollHeaderAfterFetch=null)},z.prototype.findHeader=function(e,t,i){if(null==t&&(t=this.getMappedStyle("headercell")),null==i&&(i=this.getMappedStyle("endheadercell")),null!=t){if(this.m_utils.containsCSSClassName(e,t)||this.m_utils.containsCSSClassName(e,i))return e;if(e.parentNode)return this.findHeader(e.parentNode,t,i);if(e===this.m_root)return null}return null},z.prototype.updateRowBanding=function(){var e=this.m_options.getRowBandingInterval();if(e>0)for(var t=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getMappedStyle("banded"),s=0;s<t.length;s++){var n=t[s],o=this._getIndex(n,"row");Math.floor(o/e)%2==1?this.m_utils.containsCSSClassName(n,i)||this.m_utils.addCSSClassName(n,i):this.m_utils.containsCSSClassName(n,i)&&this.m_utils.removeCSSClassName(n,i)}},z.prototype.updateColumnBanding=function(){var e=this.m_options.getColumnBandingInterval();if(e>0)for(var t=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),i=this.getMappedStyle("banded"),s=0;s<t.length;s+=1){var n=t[s],o=this._getIndex(n,"column");Math.floor(o/e)%2==1?this.m_utils.containsCSSClassName(n,i)||this.m_utils.addCSSClassName(n,i):this.m_utils.containsCSSClassName(n,i)&&this.m_utils.removeCSSClassName(n,i)}},z.prototype._removeBanding=function(){for(var e=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),t=this.getMappedStyle("banded"),i=0;i<e.length;i++)this.m_utils.containsCSSClassName(e[i],t)&&this.m_utils.removeCSSClassName(e[i],t)},z.prototype._setAccInfoText=function(e,t){var i=this.getResources().getTranslatedText(e,t);null!=i&&(this.m_accInfo.textContent=i)},z.prototype.handleExpandEvent=function(e,t){void 0===t&&this.queueModelEvent(e)?e.operation="expand":(this._setAccInfoText("accessibleRowExpanded"),this.populateAccInfo(),t&&this._runModelEventQueue())},z.prototype.handleCollapseEvent=function(e,t){void 0===t&&this.queueModelEvent(e)?e.operation="collapse":(this._setAccInfoText("accessibleRowCollapsed"),this.populateAccInfo(),t&&this._runModelEventQueue())},z.prototype._getKey=function(e,t){return null!=e&&e[this.getResources().getMappedAttribute("context")]?null!=t&&this.m_utils.containsCSSClassName(e,this.getMappedStyle("cell"))?e[this.getResources().getMappedAttribute("context")].keys[t]:e[this.getResources().getMappedAttribute("context")].key:null},z.prototype._getActiveKey=function(e,t){if(t&&null!=this.m_prevActive){if("header"===this.m_prevActive.type&&(this.m_prevActive.axis===e||this.m_prevActive.axis===e+"End"))return this.m_prevActive.key;if("cell"===this.m_prevActive.type)return this.m_prevActive.keys[e]}else if(null!=this.m_active){if("header"===this.m_active.type&&(this.m_active.axis===e||this.m_active.axis===e+"End"))return this.m_active.key;if("cell"===this.m_active.type)return this.m_active.keys[e]}return null},z.prototype._handleCut=function(e,t){null==t&&(t=e.target);var i=this.findCellOrHeader(t);if(this._isMoveOnElementEnabled(i)){if(null!=this.m_cutCells)for(var s=0;s<this.m_cutCells.length;s++)this.m_utils.removeCSSClassName(this.m_cutCells[s],this.getMappedStyle("cut"));var n=this._getKey(i,"row");return this.m_cutCells=this._getAxisCellsByKey(n,"row"),this.m_cutRowHeader=this._findHeaderByKey(n,this.m_rowHeader,this.getMappedStyle("rowheadercell")),this.m_cutRowEndHeader=this._findHeaderByKey(n,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")),this._highlightCellsAlongAxis(n,"row","key","add",["cut"]),null!==this.m_cutRowHeader&&this.m_utils.addCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),null!==this.m_cutRowEndHeader&&this.m_utils.addCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),!0}return!1},z.prototype._handleCutCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&this.m_options.isCutEnabled()&&this.m_selection&&this.m_selection.length){this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]);let t=this.m_selection[this.m_selection.length-1];this.m_selectionRange=[t],this.m_dataTransferAction="cut";var i={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0]}};if(!this.fireEvent("cutRequest",i))return!0;this.highlightFloodFillRange(t),this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance()}return!0},z.prototype._handleCopyCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&this.m_options.isCopyEnabled()){this.m_selectionRange&&this.m_selectionRange.length&&this.unhighlightFloodFillRange(this.m_selectionRange[0]);let t=this.m_selection[this.m_selection.length-1];this.m_selectionRange=[t],this.m_dataTransferAction="copy";let i={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0]}};return!this.fireEvent("copyRequest",i)||(this.highlightFloodFillRange(t),this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance(),!0)}return!1},z.prototype._handlePaste=function(e,t){if(null==t&&(t=e.target),null!=this.m_cutCells){for(var i=0;i<this.m_cutCells.length;i++)this.m_utils.removeCSSClassName(this.m_cutCells[i],this.getMappedStyle("cut"));null!==this.m_cutRowHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),this.m_cutRowHeader=null),null!==this.m_cutRowEndHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),this.m_cutRowEndHeader=null);var s=this._getKey(this.findCellOrHeader(t),"row"),n=this._getKey(this.m_cutCells[0],"row");n!==s&&(this._isSelectionEnabled()&&this._clearSelection(e),this._isDatabodyCellActive()&&this._unhighlightActive(),this.m_moveActive=!0,this.getDataSource().move(n,s)),this.m_cutCells=null}return!0},z.prototype._handlePasteCells=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this.m_options.isPasteEnabled())if(this.m_selectionRange&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&1===this.m_selection.length){let t={event:e,ui:{action:this.m_dataTransferAction,sourceRange:this.m_selectionRange[0],targetRange:this.m_selection[0]}};if(!this.fireEvent("pasteRequest",t))return!0;this.unhighlightFloodFillRange(this.m_selectionRange[0]),this.m_selectionRange=null,this.m_dataTransferAction=null}else if(!this.m_selectionRange){let t={event:e,ui:{action:"unknown",sourceRange:{},targetRange:this.m_selection[0]}};if(!this.fireEvent("pasteRequest",t))return!0;this.m_selectionRange=null,this.m_dataTransferAction=null}return!0},z.prototype._handleAutofill=function(e,t){if(null==t&&(t=e.target),this._isDataGridProvider()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&this.m_options.isFloodFillEnabled()&&1===this.m_selection.length){let t="down";"keydown"===e.type&&(t="d"===e.key?"down":"end");let s=this.m_selection[0].startIndex,n=this.m_selection[0].endIndex,o=this.createRange(s,n),l=this.createRange(s,n),r=!1;if("down"===t?(o.endIndex.row=o.startIndex.row,l.startIndex.row=o.startIndex.row+1,l.startIndex.row>=o.startIndex.row&&l.startIndex.row<=l.endIndex.row&&(r=!0)):(o.endIndex.column=o.startIndex.column,l.startIndex.column=o.startIndex.column+1,l.startIndex.column>=o.startIndex.column&&l.startIndex.column<=l.endIndex.column&&(r=!0)),r){var i={event:e,ui:{action:t,sourceRange:o,targetRange:l}};if(!this.fireEvent("fillRequest",i))return!0}return this.unhighlightFloodFillRange(this.m_selection[0]),this._removeFloodFillAffordance(),this.m_selectionRange=null,this.m_dataTransferAction=null,this.m_floodFillDirection=null,!0}return!1},z.prototype._handleCancelReorder=function(e,t){if(null!=this.m_cutCells){for(var i=0;i<this.m_cutCells.length;i++)this.m_utils.removeCSSClassName(this.m_cutCells[i],this.getMappedStyle("cut"));return this.m_cutCells=null,null!==this.m_cutRowHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowHeader,this.getMappedStyle("cut")),this.m_cutRowHeader=null),null!==this.m_cutRowEndHeader&&(this.m_utils.removeCSSClassName(this.m_cutRowEndHeader,this.getMappedStyle("cut")),this.m_cutRowEndHeader=null),!0}null!==this.m_dataTransferAction&&(this.unhighlightFloodFillRange(this.m_selectionRange[0]),this.m_selectionRange=null,this.m_dataTransferAction=null)},z.prototype._handleMove=function(e){if(null==this.m_moveCells){var t=e.target,i=this.findCellOrHeader(t),s=this._getKey(i,"row");this.m_originalMoveIndex=this._getIndex(i,"row"),this.m_moveIndex=this.m_originalMoveIndex,this.m_moveCells=this._getAxisCellsByIndex(this.m_moveIndex,"row"),this.m_moveRowHeader=this._findHeaderByKey(s,this.m_rowHeader,this.getMappedStyle("rowheadercell")),this.m_moveRowEndHeader=this._findHeaderByKey(s,this.m_rowEndHeader,this.getMappedStyle("rowendheadercell")),this._highlightCellsAlongAxis(this.m_moveIndex,"row","index","add",["drag"]),this.m_originalTop=this.getElementDir(this.m_moveCells[0],"top"),this.m_dropTarget=document.createElement("div"),this.m_utils.addCSSClassName(this.m_dropTarget,this.getMappedStyle("drop")),this.setElementHeight(this.m_dropTarget,this.calculateRowHeight(this.m_moveCells[0])),this.setElementDir(this.m_dropTarget,this.m_originalTop,"top"),this.m_databody.firstChild.appendChild(this.m_dropTarget),this._addHeaderDropTarget(this.m_moveRowHeader,this.m_rowHeader,!1),this._addHeaderDropTarget(this.m_moveRowEndHeader,this.m_rowEndHeader,!0)}this.m_utils.isTouchDevice()||(this.m_prevY=this.m_currentY,this.m_currentY=e.pageY);for(var n=this.m_currentY-this.m_prevY,o=this.calculateRowHeight(this.m_moveCells[0]),l=0;l<this.m_moveCells.length;l++)this.setElementDir(this.m_moveCells[l],this.getElementDir(this.m_moveCells[l],"top")+n,"top");null!==this.m_moveRowHeader&&this.setElementDir(this.m_moveRowHeader,this.getElementDir(this.m_moveRowHeader,"top")+n,"top"),null!==this.m_moveRowEndHeader&&this.setElementDir(this.m_moveRowEndHeader,this.getElementDir(this.m_moveRowEndHeader,"top")+n,"top");var r=this.m_moveIndex+1,a=this.m_moveIndex-1,h=this._getCellByIndex(this.createIndex(r,this.m_startCol)),d=this._getCellByIndex(this.createIndex(a,this.m_startCol));null!=h&&this.getElementDir(h,"top")<this.getElementDir(this.m_moveCells[0],"top")+o/2?this._moveDropRows("nextSibling",r):null!=d&&this.getElementDir(d,"top")>this.getElementDir(this.m_moveCells[0],"top")-o/2&&this._moveDropRows("previousSibling",a)},z.prototype._addHeaderDropTarget=function(e,t,i){var s;null!==e&&(null==e.style.height&&this.setElementHeight(e,this.calculateRowHeight(e)),this.m_utils.addCSSClassName(e,this.getMappedStyle("drag")),s=document.createElement("div"),this.m_utils.addCSSClassName(s,this.getMappedStyle("drop")),this.setElementHeight(s,this.calculateRowHeight(e)),this.setElementDir(s,this.m_originalTop,"top"),t.firstChild.appendChild(s),i?this.m_dropTargetEndHeader=s:this.m_dropTargetHeader=s)},z.prototype._moveDropRows=function(e,t){var i,s,n,o,l;"nextSibling"===e?(l=this._getAxisCellsByIndex(t,"row"),i=this.m_originalTop+this.calculateRowHeight(l[0]),s=this.m_originalTop):(l=this._getAxisCellsByIndex(t,"row"),s=(i=this.getElementDir(l[0],"top"))+this.calculateRowHeight(l[0])),this.setElementDir(this.m_dropTarget,i,"top");for(var r=0;r<l.length;r++)this.setElementDir(l[r],s,"top");null!==this.m_moveRowHeader&&(n=this.m_moveRowHeader.parentNode,this.setElementDir(this.m_dropTargetHeader,i,"top"),this.setElementDir(this.m_moveRowHeader[e],s,"top")),null!==this.m_moveRowEndHeader&&(o=this.m_moveRowEndHeader.parentNode,this.setElementDir(this.m_dropTargetEndHeader,i,"top"),this.setElementDir(this.m_moveRowEndHeader[e],s,"top")),this.m_originalTop=i,this._highlightCellsAlongAxis(this.m_moveIndex+1,"row","index","remove",["activedrop"]),"nextSibling"===e?(this._modifyAxisCellContextIndex("row",this.m_moveIndex,1,1),this._modifyAxisCellContextIndex("row",this.m_moveIndex+1,1,-1),this.m_moveIndex+=1,null!==this.m_moveRowHeader&&n&&n.insertBefore(this.m_moveRowHeader,this.m_moveRowHeader[e][e]),null!==this.m_moveRowEndHeader&&o&&o.insertBefore(this.m_moveRowEndHeader,this.m_moveRowEndHeader[e][e])):(this._modifyAxisCellContextIndex("row",this.m_moveIndex,1,-1),this._modifyAxisCellContextIndex("row",this.m_moveIndex-1,1,1),this.m_moveIndex-=1,null!==this.m_moveRowHeader&&n&&n.insertBefore(this.m_moveRowHeader,this.m_moveRowHeader[e]),null!==this.m_moveRowEndHeader&&o&&o.insertBefore(this.m_moveRowEndHeader,this.m_moveRowEndHeader[e])),this._refreshDatabodyMap(),this._highlightCellsAlongAxis(this.m_moveIndex+1,"row","index","add",["activedrop"])},z.prototype._isMoveEnabled=function(e){var t=this.getDataSource().getCapability("move");return"enable"===this.m_options.isMoveable("row")&&("full"===t||t===e)},z.prototype._handleMoveMouseUp=function(e,t){if(null!=this.m_moveCells){this._remove(this.m_dropTarget),null!==this.m_moveRowHeader&&this._remove(this.m_dropTargetHeader),null!==this.m_moveRowEndHeader&&this._remove(this.m_dropTargetEndHeader),null!=this.m_active&&"column"!==this.m_active.axis&&(this.m_moveActive=!0),this._isSelectionEnabled()&&this._clearSelection(e);var i=this.m_moveCells[0],s=this._getKey(i,"row");if(!0===t){var n=this.m_moveIndex+1,o=this._getKey(this._getCellByIndex(this.createIndex(n,this.m_startCol)),"row");this.getDataSource().move(s,o)}else this.getDataSource().move(s,s);this.m_moveCells=null,this.m_originalMoveIndex=null,this.m_moveIndex=null}this.m_databodyMove=!1},z.prototype._handleFloodFillMouseUp=function(e){if(this.m_floodFillRange&&this.m_floodFillRange.length){var t={event:e,ui:{action:this.m_floodFillDirection,sourceRange:this.m_selectionRange[0],targetRange:this.m_floodFillRange[0]}};if(!this.fireEvent("fillRequest",t))return!0;this.unhighlightFloodFillRange()}this.m_selectionRange=null,this.m_floodFillRange=null,this.m_floodFillDirection=null;const i=[this.m_databody,this.m_databodyFrozenCol,this.m_databodyFrozenRow,this.m_databodyFrozenCorner];for(let e=0;e<i.length;e++)i[e]&&(i[e].style.cursor="default");return this.m_cursor="default",!0},z.prototype._isMoveOnElementEnabled=function(e){return!(null==e||!this._isMoveEnabled("row")||this._getActiveKey("row")!==this._getKey(e,"row"))},z.prototype._manageMoveCursor=function(){if(!this._isDataGridProvider()){var e=this._getActiveKey("row"),t=this._getActiveKey("row",!0),i=this.getMappedStyle("draggable"),s=this.getMappedStyle("rowheadercell"),n=this.getMappedStyle("rowendheadercell");if(null!=t){this._highlightCellsAlongAxis(t,"row","key","remove",["draggable"]);var o=this._findHeaderByKey(t,this.m_rowHeader,s);this.m_utils.containsCSSClassName(o,i)&&this.m_utils.removeCSSClassName(o,i),o=this._findHeaderByKey(t,this.m_rowEndHeader,n),this.m_utils.containsCSSClassName(o,i)&&this.m_utils.removeCSSClassName(o,i)}if(null!=e){var l=this._getAxisCellsByKey(e,"row");if(this._isMoveOnElementEnabled(l[0])){this._highlightCellsAlongAxis(e,"row","key","add",["draggable"]);var r=this._findHeaderByKey(e,this.m_rowHeader,s);this.m_utils.addCSSClassName(r,i);var a=this._findHeaderByKey(e,this.m_rowEndHeader,n);this.m_utils.addCSSClassName(a,i)}}}},z.prototype.handleRootFocus=function(e,t){if(this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("focus")),this._clearFocusoutTimeout(),this._clearFocusoutBusyState(),!t){if(this._clearOpenPopupListeners(),!this.m_root.contains(document.activeElement)||document.activeElement===this.m_root&&0===this.m_root.tabIndex||document.activeElement===this.m_databody&&this.m_scrollbarFocus&&0===this.m_root.tabIndex){this.m_externalFocus=!0,this._isCellEditable()?this._setAccInfoText("accessibleEditableMode"):this._isGridEditable()&&this._setAccInfoText("accessibleNavigationMode");var i=!1;!0===this.m_scrollbarFocus&&(this.m_shouldFocus=!1,this.m_scrollbarFocus=!1,i=!0);let t=this._getEmptyElement();if(null==this.m_active&&t)this._setActive(t,{type:"empty"},e,null,null,i,!0);else if(null!=this.m_active||this._databodyEmpty())null!=this.m_active&&this._highlightActive();else{var s;let t=this.getVisibleCellIndexInDirection("column",0,{right:!0});s=this.createIndex(0,t),i||this.scrollToIndex(s),this._setActiveByIndex(s,e,null,null,i)}}this.m_root.tabIndex=-1}},z.prototype._handlePopupFocusout=function(e){this.handleRootBlur(e,!0)},z.prototype._handlePopupFocusin=function(e){this.handleRootFocus(e,!0)},z.prototype.handleRootBlur=function(e,t){if(this._clearFocusoutTimeout(),!t){this._clearOpenPopupListeners();var i=C.getLogicalChildPopup(this.m_root);if(null!=i)return this._openPopup=i,t=!1,this._handlePopupFocusinListener=this._handlePopupFocusin.bind(this),this._handlePopupFocusoutListener=this._handlePopupFocusout.bind(this),i.addEventListener("focusin",this._handlePopupFocusinListener),void i.addEventListener("focusout",this._handlePopupFocusoutListener)}this._setFocusoutBusyState(),this.m_focusoutTimeout=setTimeout(function(){if(!this.m_root.contains(document.activeElement)||!0===t){this.m_root.tabIndex=0;var i=this._getActiveElement();null!=i&&(this._unsetAriaProperties(i),this._isEditOrEnter()&&!this.m_animating&&this._leaveEditing(e,i,!1,!1))}this._clearFocusoutBusyState()}.bind(this),100),null==this.m_moveRow&&this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("focus"))},z.prototype._clearOpenPopupListeners=function(){null!=this._openPopup&&(this._openPopup.removeEventListener("focusin",this._handlePopupFocusinListener),this._openPopup.removeEventListener("focusout",this._handlePopupFocusoutListener),this._openPopup=null),this._handlePopupFocusinListener=null,this._handlePopupFocusoutListener=null},z.prototype._handlePopupFocusout=function(e){this.handleRootBlur(e,!0)},z.prototype._handlePopupFocusin=function(e){this.handleRootFocus(e,!0)},z.prototype._clearFocusoutTimeout=function(){this.m_focusoutTimeout&&(clearTimeout(this.m_focusoutTimeout),this.m_focusoutTimeout=null)},z.prototype._setFocusoutBusyState=function(){if(!this.m_focusoutResolveFunc){var e=c.getContext(this.m_root).getBusyContext(),t={description:"Datagrid component 'is handling focusout."};this.m_focusoutResolveFunc=e.addBusyState(t)}},z.prototype._clearFocusoutBusyState=function(){this.m_focusoutResolveFunc&&(this.m_focusoutResolveFunc(),this.m_focusoutResolveFunc=null)},z.prototype.calculateRowHeight=function(e){return""!==e.style.height?this.getElementHeight(e):null!=e.nextSibling?this.getElementDir(e.nextSibling,"top")-this.getElementDir(e,"top"):this.m_endRowPixel-this.getElementDir(e,"top")},z.prototype.calculateRowHeaderHeight=function(e){return""!==e.style.height?this.getElementHeight(e):null!=e.nextSibling?this.getElementDir(e.nextSibling,"top")-this.getElementDir(e,"top"):this.m_endRowHeaderPixel-this.getElementDir(e,"top")},z.prototype.calculateRowHeaderLabelHeight=function(e){return this.getElementHeight(e)},z.prototype.calculateColumnWidth=function(e){if(""!==e.style.width)return this.getElementWidth(e);var t=this.getResources().isRTLMode()?"right":"left";return null!=e.nextSibling?this.getElementDir(e.nextSibling,t)-this.getElementDir(e,t):this.m_endColPixel-this.getElementDir(e,t)},z.prototype.calculateColumnHeaderWidth=function(e){if(""!==e.style.width)return this.getElementWidth(e);var t=this.getResources().isRTLMode()?"right":"left";return null!=e.nextSibling?this.getElementDir(e.nextSibling,t)-this.getElementDir(e,t):this.m_endColHeaderPixel-this.getElementDir(e,t)},z.prototype._databodyEmpty=function(){return!(null!=this.m_databody.firstChild&&null!=this.m_databody.firstChild.firstChild||this._hasFrozenColumns()||this._hasFrozenRows())},z.prototype._databodyEmptyState=function(){return!(null!=this.m_databody.firstChild&&null!=this.m_databody.firstChild.firstChild&&!this._getEmptyElement())},z.prototype._getEmptyElement=function(){let e=this.m_databody.querySelector("."+this.getMappedStyle("noDataContainer")),t=this.m_databody.querySelector("."+this.getMappedStyle("emptytext"));return e||t},z.prototype.changeStyleProperty=function(e,t,i,s){void 0!==t&&(e.style[t]="remove"===s?"":i)},z.prototype.addTransformMoveStyle=function(e,t,i,s,n,o,l){this.changeStyleProperty(e,this.getCssSupport("transition-delay"),i),this.changeStyleProperty(e,this.getCssSupport("transition-timing-function"),s),this.changeStyleProperty(e,this.getCssSupport("transition-duration"),t),this.changeStyleProperty(e,this.getCssSupport("transform"),"translate3d("+n+"px,"+o+"px,"+l+"px)")},z.prototype.removeTransformMoveStyle=function(e){this.changeStyleProperty(e,this.getCssSupport("transition-delay"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transition-timing-function"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transition-duration"),null,"remove"),this.changeStyleProperty(e,this.getCssSupport("transform"),null,"remove")},z.prototype.getCssSupport=function(e){var t=["","-moz-","-webkit-","-o-","-ms-","-khtml-"],i=document.documentElement;for(var s=0;s<t.length;s++){var n=(t[s]+e).replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()});if("Ms"===n.substr(0,2)&&(n="m"+n.substr(1)),n in i.style)return n}},z.prototype._refreshDatabodyMap=function(){this._clearDatabodyMap(),this._addNodesToDatabodyMap(this.m_databody.firstChild.childNodes),this.m_databodyFrozenCol&&this._addNodesToDatabodyMap(this.m_databodyFrozenCol.firstChild.childNodes),this.m_databodyFrozenCorner&&this._addNodesToDatabodyMap(this.m_databodyFrozenCorner.firstChild.childNodes),this.m_databodyFrozenRow&&this._addNodesToDatabodyMap(this.m_databodyFrozenRow.firstChild.childNodes)},z.prototype._populateDatabody=function(e,t){this._addNodesToDatabodyMap(t.childNodes),e.appendChild(t),this.m_subtreeAttachedCallback(e)},z.prototype._emptyDatabody=function(e){this._clearDatabodyMap(),this.m_utils.empty(e)},z.prototype._addNodesToDatabodyMap=function(e){for(var t=0;t<e.length;t++){var i=e[t];if(this.m_utils.containsCSSClassName(i,this.getMappedStyle("cell"))){var s=this.getCellIndexes(i),n=this.getCellExtents(i),o=i.id;this._addToDatabodyMap(s,o,n)}}},z.prototype._addToDatabodyMap=function(e,t,i){for(var s=i.row,n=i.column,o=0;o<s;o++)for(var l=0;l<n;l++)this._addIndexToDatabodyMap(this.createIndex(e.row+o,e.column+l),t)},z.prototype._addIndexToDatabodyMap=function(e,t){var i="r"+e.row+"c"+e.column;this.m_databodyMap.set(i,t)},z.prototype._removeIndexFromDatabodyMap=function(e){var t="r"+e.row+"c"+e.column;return this.m_databodyMap.delete(t)},z.prototype._getFromDatabodyMap=function(e){var t="r"+e.row+"c"+e.column;return this.m_databodyMap.get(t)},z.prototype._clearDatabodyMap=function(){return this.m_databodyMap.clear()},z.prototype._modifyAxisCellContextIndex=function(e,t,i,s){for(var n=t;n<t+i;n++)for(var o=this._getAxisCellsByIndex(n,e),l=0;l<o.length;l++){o[l][this.getResources().getMappedAttribute("context")].indexes[e]+=s}},z.prototype._modifyAxisHeaderContextIndex=function(e,t,i,s){for(var n=t;n<t+i;n++){var o;o="row"===e?this._getHeadersByIndex(n,this.m_rowHeader,this.m_rowHeaderLevelCount,this.m_startRowHeader):this._getHeadersByIndex(n,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount,this.m_startRowEndHeader);for(var l=0;l<o.length;l++){o[l][this.getResources().getMappedAttribute("context")].index+=s}}},z.prototype._getCellOrHeaderByIndex=function(e,t){var i=null,s=this._getAxisCellsByIndex(e,t,!0);return null!=s&&s.length>0&&(i=s[0]),null==i&&("row"===t&&null==(i=this._getHeaderCellByIndex(e,t))&&(i=this._getHeaderCellByIndex(e,"rowEnd")),"column"===t&&null==(i=this._getHeaderCellByIndex(e,t))&&(i=this._getHeaderCellByIndex(e,"columnEnd"))),i},z.prototype._getLabel=function(e,t){return this.m_headerLabels[e][t]},z.prototype._getCellByIndex=function(e){var t=this._getFromDatabodyMap(e);let i=null;if(null!=t){let e=[this.m_databody,this.m_databodyFrozenCorner,this.m_databodyFrozenCol,this.m_databodyFrozenRow];e=e.filter(e=>e);for(let s=0;s<e.length&&(i=e[s].querySelector(`#${t}`),!i);s++);}return i},z.prototype._getCellContainer=function(e){let t=this.m_databody,i=[this.m_databodyFrozenCorner,this.m_databodyFrozenCol,this.m_databodyFrozenRow];i=i.filter(e=>e);for(let s=0;s<i.length;s++){if(i[s].querySelector(`#${e.id}`)){t=i[s];break}}return t},z.prototype._getFrozenCellByIndex=function(e,t,i){var s=this._getFromDatabodyMap(e);if(null!=s){let e;return i?e=this.m_databodyFrozenCorner.querySelector("#"+s):"row"===t?e=this.m_databodyFrozenCol.querySelector("#"+s):"column"===t&&(e=this.m_databodyFrozenRow.querySelector("#"+s)),e}return null},z.prototype._getCellsInRange=function(e,t,i,s){let n=[];for(let o=e;o<=i;o++)for(let e=t;e<=s;e++){let t=this._getCellByIndex(this.createIndex(o,e));t&&n.push(t)}return n},z.prototype._getFirstCellWithMatchingStartIndex=function(e,t){let i,s,n="row"===t?this.m_startCol:this.m_startRow,o="row"===t?this.m_endCol:this.m_endRow;for(let l=n;l<=o;l++)if(i=this.createIndex("row"===t?e:l,"row"===t?l:e),s=this._getCellByIndex(i),this._getIndex(s,t)===e)return s;return null},z.prototype._getAxisCellsByIndex=function(e,t,i){for(var s,n="row"===t?this.m_startCol:this.m_startRow,o="row"===t?this.m_endCol:this.m_endRow,l=[],r=n;r<=o;r+=s){var a=this._getCellByIndex(this.createIndex("row"===t?e:r,"row"===t?r:e));if(null!=a){if(s=this.getCellExtents(a)["row"===t?"column":"row"],l.push(a),i)break}else s=1}return l},z.prototype._getAxisCellsByKey=function(e,t,i){if(null==e||null==this.m_databody||null==this.m_databody.firstChild)return null;for(var s=[],n=this.m_databody.firstChild.querySelectorAll("."+this.getMappedStyle("cell")),o=0;o<n.length;o++){var l=n[o];if(this.m_utils.containsCSSClassName(l,this.getMappedStyle("cell")))if(this._getKey(l,t)===e&&(s.push(l),i))break}return s},z.prototype._setupActions=function(){this.actions={ACTIONABLE:this._handleActionable,EXIT_ACTIONABLE:this._handleExitActionable,TAB_NEXT_IN_CELL:u.handleActionableTab,TAB_PREV_IN_CELL:u.handleActionablePrevTab,EDITABLE:this._handleEditable,EXIT_EDITABLE:this._handleExitEditable,DATA_ENTRY:this._handleDataEntry,EXIT_DATA_ENTRY:this._handleExitDataEntry,EDIT:this._handleEdit,EXIT_EDIT:this._handleExitEdit,CANCEL_EDIT:this._handleCancelEdit,NO_OP:this._handleNoOp,FOCUS_LEFT:this._handleFocusLeft,FOCUS_LEFT_NON_EMPTY_CELL:this._handleFocusLeftNonEmptyCell,FOCUS_RIGHT:this._handleFocusRight,FOCUS_RIGHT_NON_EMPTY_CELL:this._handleFocusRightNonEmptyCell,FOCUS_UP:this._handleFocusUp,FOCUS_UP_NON_EMPTY_CELL:this._handleFocusUpNonEmptyCell,FOCUS_DOWN:this._handleFocusDown,FOCUS_DOWN_NON_EMPTY_CELL:this._handleFocusDownNonEmptyCell,FOCUS_ROW_FIRST:this._handleFocusRowFirst,FOCUS_ROW_LAST:this._handleFocusRowLast,FOCUS_COLUMN_FIRST:this._handleFocusColumnFirst,FOCUS_COLUMN_LAST:this._handleFocusColumnLast,FOCUS_COLUMN_HEADER:this._handleFocusColumnHeader,FOCUS_COLUMN_END_HEADER:this._handleFocusColumnEndHeader,FOCUS_ROW_HEADER:this._handleFocusRowHeader,FOCUS_ROW_END_HEADER:this._handleFocusRowEndHeader,FOCUS_FIRST_CELL_IN_GRID:this._handleFocusFirstCellInGrid,FOCUS_LAST_CELL_IN_GRID:this._handleFocusLastCellInGrid,READ_CELL:this.readCurrentContent,SORT:this._handleSortKey,EXPAND:this._handleExpandKey,COLLAPSE:this._handleCollapseKey,SELECT_DISCONTIGUOUS:this._handleSelectDiscontiguous,SELECT_EXTEND_LEFT:this._handleExtendSelectionLeft,SELECT_EXTEND_RIGHT:this._handleExtendSelectionRight,SELECT_EXTEND_UP:this._handleExtendSelectionUp,SELECT_EXTEND_DOWN:this._handleExtendSelectionDown,SELECT_ROW:this._handleSelectRow,SELECT_COLUMN:this._handleSelectColumn,SELECT_ALL:this._handleSelectAll,CUT:this._handleCut,CUT_CELLS:this._handleCutCells,COPY_CELLS:this._handleCopyCells,CANCEL_REORDER:this._handleCancelReorder,PASTE:this._handlePaste,PASTE_CELLS:this._handlePasteCells,FILL:this._handleAutofill,CANCEL_DRAG:this.handleCancelDrag}},z.prototype._getActionFromKeyDown=function(e,t,i){var s={cellOrHeader:t,isLabel:i,readOnly:!this._isCellEditable(),currentMode:this._getCurrentMode(),activeMove:null!=this.m_cutCells||null!=this.m_dataTransferAction,rowMove:this._isMoveEnabled("row"),columnSort:"column"===t&&this._isDOMElementSortable(this._getActiveElement()),rowSort:"row"===t&&this._isDOMElementSortable(this._getActiveElement()),selection:this._isSelectionEnabled(),selectionMode:this.m_options.getSelectionMode(),multipleSelection:this.isMultipleSelection(),expandCollapse:this._isTargetExpandCollapseEnabled(e.target)};return this._isDataGridProvider()&&(s.cutCells=!0,s.copyCells=!0,s.pasteCells=!0,s.activeDrag=!(!this._cellsDragged||!this._cellsDragged.length)),this.m_options.isFloodFillEnabled()&&(s.fill=!0),this.actions[this.m_keyboardHandler.getAction(e,s)]},z.prototype._getActionFromNoDataKeydown=function(e){var t={readOnly:!this._isCellEditable(),currentMode:this._getCurrentMode()};return this.actions[this.m_keyboardHandler.getNoDataAction(e,t)]},z.prototype.isActionableMode=function(){return"actionable"===this.m_currentMode},z.prototype.setActionableMode=function(e){this.m_currentMode=e?"actionable":"navigation",this._setAccInfoText(this.isActionableMode()?"accessibleActionableMode":"accessibleNavigationMode")},z.prototype._handleActionable=function(e,t){return this._enterActionableMode(t,e),!1},z.prototype._handleExitActionable=function(e,t){return this._exitActionableMode(),this._highlightActive(),!1},z.prototype._getEditMode=function(){return null==this.m_editMode&&(this.m_editMode=this.m_options.getEditMode()),this.m_editMode},z.prototype._getCurrentMode=function(){return null==this.m_currentMode&&(this.m_currentMode="navigation"),this.m_currentMode},z.prototype._isEditOrEnter=function(){return"edit"===this._getCurrentMode()},z.prototype._isGridEditable=function(){var e=this._getEditMode();return"cellNavigation"===e||"cellEdit"===e},z.prototype._isCellEditable=function(){return"cellEdit"===this._getEditMode()},z.prototype._handleEditable=function(e,t){return this._isGridEditable()?(this.m_editMode=null,this.m_setOptionCallback("editMode","cellEdit",{_context:{writeback:!0,internalSet:!0}}),this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("editable")),this._updateEdgeCellBorders(""),this._setAccInfoText("accessibleEditableMode"),this._setEditableClone(t)):this._handleActionable(e,t),!1},z.prototype._handleExitEditable=function(e,t){this.m_editMode=null,this.m_setOptionCallback("editMode","cellNavigation",{_context:{writeback:!0,internalSet:!0}}),this.m_utils.addCSSClassName(this.m_root,this.getMappedStyle("readOnly")),this.m_utils.removeCSSClassName(this.m_root,this.getMappedStyle("editable")),this._updateEdgeCellBorders("none"),this._setAccInfoText("accessibleNavigationMode"),this._destroyEditableClone()},z.prototype._handleDataEntry=function(e,t){var i={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")]}};return this.fireEvent("beforeEdit",i)&&(this._removeFloodFillAffordance(),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),this.m_editableClone),this._overwriteFlag=!0,this._setFocusToFirstFocusableElement(t)?this.m_currentMode="edit":this.m_utils.removeCSSClassName(t,this.getMappedStyle("cellEdit")),this._overwriteFlag=!1),!1},z.prototype._handleExitDataEntry=function(e,t){return this._leaveEditing(e,t,!1)},z.prototype._handleEdit=function(e,t){var i={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")]}},s=this.fireEvent("beforeEdit",i);if(s){this._removeFloodFillAffordance(),this._reRenderCell(t,"edit",this.getMappedStyle("cellEdit"),this.m_editableClone),this.m_currentMode="edit";var n=this;c.getContext(t).getBusyContext().whenReady().then(function(){n._setFocusToFirstFocusableElement(t)||(n.m_utils.removeCSSClassName(t,n.getMappedStyle("cellEdit")),n.m_currentMode="navigation")})}else s=!1,this._enterActionableMode(t);return s},z.prototype._handleExitEdit=function(e,t){return this._leaveEditing(e,t,!1)},z.prototype._handleCancelEdit=function(e,t){return!!this._leaveEditing(e,t,!0)&&(this._setEditableClone(t),!0)},z.prototype._leaveEditing=function(e,t,i,s){var n={event:e,ui:{cell:t,cellContext:t[this.getResources().getMappedAttribute("context")],cancelEdit:i}};i||(u.disableAllFocusableElements(t),!1===s&&(this.m_shouldFocus=s),this._highlightActive());var o=this.fireEvent("beforeEditEnd",n);return o?(this.m_currentMode="navigation",u.disableAllFocusableElements(t),!1===s&&(this.m_shouldFocus=s),this._highlightActive(),this._reRenderCell(t,"navigation",this.getMappedStyle("cellEdit"),this.m_editableClone)):(o=!1,this._scrollToActive(this.m_active),this._setFocusToFirstFocusableElement(t)),o},z.prototype._handleFocusKey=function(e,t,i,s,n,o,l){var r,a=!0,h=!0;if(null!=this.m_active){if("cell"===this.m_active.type){if(this._isEditOrEnter()?(r=!0,a=this._leaveEditing(e,t,!1),h=!1):this.isActionableMode()&&this._exitActionableMode(),a){this.m_options.isFloodFillEnabled()&&this._removeFloodFillAffordance();var d=this.m_active,m=this.handleFocusChange(i,s,e,h,n,o,l);return this._isGridEditable()&&d!==this.m_active&&r&&this.m_utils.isTouchDevice()?this._handleDataEntry(e,this._getActiveElement()):m}return!0}if("header"===this.m_active.type)return this.handleHeaderFocusChange(i,e,s,n,o);if("label"===this.m_active.type)return this.handleLabelFocusChange(i,e,s,n);if("empty"===this.m_active.type)return this.handleNoDataFocusChange(i,s,e,h)}return!1},z.prototype._handleFocusLeft=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!1)},z.prototype._handleFocusLeftNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!1,!0)},z.prototype._handleFocusRight=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!1)},z.prototype._handleFocusRightNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!1,!0)},z.prototype._handleFocusUp=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!1)},z.prototype._handleFocusUpNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!1,!0)},z.prototype._handleFocusDown=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!1)},z.prototype._handleFocusDownNonEmptyCell=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!1,!0)},z.prototype._handleFocusRowFirst=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.PAGEUP_KEY,!1,!1)},z.prototype._handleFocusRowLast=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.PAGEDOWN_KEY,!1,!1)},z.prototype._handleFocusColumnFirst=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.HOME_KEY,!1,!1)},z.prototype._handleFocusColumnLast=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.END_KEY,!1,!1)},z.prototype._handleFocusRowHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!1,!0)},z.prototype._handleFocusRowEndHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!1,!0)},z.prototype._handleFocusColumnHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!1,!0)},z.prototype._handleFocusColumnEndHeader=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!1,!0)},z.prototype._handleFocusFirstCellInGrid=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.HOME_KEY,!1,!1,!1,!0)},z.prototype._handleFocusLastCellInGrid=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.END_KEY,!1,!1,!1,!0)},z.prototype._handleSelectRow=function(e,t){var i,s,n,o,l=1;if(!this._isSelectionEnabled()||!this.isMultipleSelection()&&"row"!==this.m_options.getSelectionMode())return!1;if(this.m_utils.containsCSSClassName(t,this.getMappedStyle("cell")))i=o=this.m_active.indexes.row,s=o,n=this.m_rowHeaderLevelCount-1;else{if(null==this.m_active||"header"!==this.m_active.type||-1===this.m_active.axis.indexOf("row"))return!1;if(o=this.m_active.index,n=this.m_active.level,this.m_rowHeaderLevelCount-1===n)i=o,s=o;else{var r=this._getActiveElement();s=(i=this._getAttribute(r.parentNode,"start",!0))+(l=this._getAttribute(r.parentNode,"extent",!0))-1}}if(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("column"))return this._handleSelectAll(e),!0;if(this.setHeaderSelectionFrontier("row",s,o,n,t,!0),this._shouldDeselectHeader(o,l,"row")){var a=this.createIndex(o,0),h=this.createIndex(o+l-1,-1),d=this._getSelectionStartAndEnd(a,h,0),m=this.createRange(this.createIndex(d.min.row,0),this.createIndex(d.max.row,-1)),c=this._trimRangeForSelectionMode(m);return this.m_deselectInfo={selection:this.GetSelection()},this._deselectRange(c,e),!0}return this._selectEntireRow(i,s,e),this._setAccInfoText("accessibleRowSelected",{row:o+1}),!0},z.prototype._handleSelectColumn=function(e,t){var i,s,n,o,l=1;if(!this._isSelectionEnabled()||!this.isMultipleSelection()||"cell"!==this.m_options.getSelectionMode())return!1;if(this.m_utils.containsCSSClassName(t,this.getMappedStyle("cell")))i=o=this.m_active.indexes.column,s=o,n=this.m_columnHeaderLevelCount-1;else{if(null==this.m_active||"header"!==this.m_active.type||-1===this.m_active.axis.indexOf("column"))return!1;if(o=this.m_active.index,n=this.m_active.level,this.m_columnHeaderLevelCount-1===n)i=o,s=o;else{var r=this._getActiveElement();s=(i=this._getAttribute(r.parentNode,"start",!0))+(l=this._getAttribute(r.parentNode,"extent",!0))-1}}if(this.m_selectionFrontier&&this.m_selectionFrontier.axis&&-1!==this.m_selectionFrontier.axis.indexOf("row"))return this._handleSelectAll(e),!0;if(this.setHeaderSelectionFrontier("column",s,o,n,t,!0),this._shouldDeselectHeader(o,l,"column")){var a=this.createIndex(0,o),h=this.createIndex(-1,o+l-1),d=this._getSelectionStartAndEnd(a,h,0),m=this.createRange(this.createIndex(0,d.min.column),this.createIndex(-1,d.max.column)),c=this._trimRangeForSelectionMode(m);return this.m_deselectInfo={selection:this.GetSelection()},this._deselectRange(c,e),!0}return this._selectEntireColumn(i,s,e),this._setAccInfoText("accessibleColumnSelected",{column:o+1}),!0},z.prototype._handleSelectDiscontiguous=function(e,t){return this.setDiscontiguousSelectionMode(!this.m_discontiguousSelection),!0},z.prototype._handleExtendSelectionLeft=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.LEFT_KEY,!0,!1)},z.prototype._handleExtendSelectionRight=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.RIGHT_KEY,!0,!1)},z.prototype._handleExtendSelectionUp=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.UP_KEY,!0,!1)},z.prototype._handleExtendSelectionDown=function(e,t){return this._handleFocusKey(e,t,this.keyCodes.DOWN_KEY,!0,!1)},z.prototype._handleSortKey=function(e,t){return"true"===t.getAttribute(this.getResources().getMappedAttribute("sortable"))?(this._handleKeyboardSort(t,e),!0):this._handleActionable(e,t)},z.prototype._handleExpandKey=function(e,t){return!!this._isHeaderCollapsed(t)&&(this._handleExpandCollapseRequest(e),!0)},z.prototype._handleCollapseKey=function(e,t){return!!this._isHeaderExpanded(t)&&(this._handleExpandCollapseRequest(e),!0)},z.prototype._handleNoOp=function(e,t){return!1},z.RESIZE_OFFSET=5,z.RESIZE_TOUCH_OFFSET=8,z.prototype.handleResize=function(e){if(!1===this.m_isResizing){var t=this.find(e.target,"header"),i=this.find(e.target,"headerlabel");if(null==t&&(t=this.find(e.target,"endheader")),null!=t&&(t===this.m_rowHeader||t===this.m_colHeader||t===this.m_rowEndHeader||t===this.m_colEndHeader||t===this.m_colHeaderFrozen||t===this.m_colEndHeaderFrozen||t===this.m_rowHeaderFrozen||t===this.m_rowEndHeaderFrozen)||null!=i){let s=!1;i&&(s=!0),this.m_cursor=this.manageHeaderCursor(e,s),null!=this.m_resizingElement&&("default"===this.m_cursor?(this.m_resizingElement.style.cursor="",this._isSelectionEnabled()&&(t&&this.shouldHoverHeader(t)||i)&&this.m_utils.addCSSClassName(e.target,this.getMappedStyle("hover")),null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor="")):(this.m_resizingElement.style.cursor=this.m_cursor,this.m_utils.removeCSSClassName(e.target,this.getMappedStyle("hover")),null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor=this.m_cursor)))}}else this.handleResizeMouseMove(e)},z.prototype.handleResizeMouseDown=function(e){return("col-resize"===this.m_cursor||"row-resize"===this.m_cursor)&&(this.m_isResizing=!0,this.m_utils.isTouchDevice()?(this.m_lastMouseX=e.touches[0].pageX,this.m_lastMouseY=e.touches[0].pageY):(document.addEventListener("mousemove",this.m_docMouseMoveListener,!1),document.addEventListener("mouseup",this.m_docMouseUpListener,!1),this.m_lastMouseX=e.pageX,this.m_lastMouseY=e.pageY),this.m_overResizeLeft=0,this.m_overResizeMinLeft=0,this.m_overResizeTop=0,this.m_overResizeMinTop=0,this.m_overResizeRight=0,this.m_overResizeBottom=0,this.m_orginalResizeDimensions={width:this.getElementWidth(this.m_resizingElement),height:this.getElementHeight(this.m_resizingElement)},!0)},z.prototype._resizeSelectedHeaders=function(e,t,i,s,n,o){let l,r=this.m_resizingElement,a=this.getHeaderCellAxis(this.m_resizingElement),h=this.getHeaderCellIndex(this.m_resizingElement),d=this._getResizeHeaderMode(this.m_resizingElement),m=this.getHeaderCellLevel(this.m_resizingElement),c=!1;if(("column"===a&&m===this.m_columnHeaderLevelCount-1||"row"===a&&m===this.m_rowHeaderLevelCount-1||"columnEnd"===a&&m===this.m_columnEndHeaderLevelCount-1||"rowEnd"===a&&m===this.m_rowEndHeaderLevelCount-1)&&(c=!0),this.m_selection&&this.m_selection.length&&c&&!this.m_discontiguousSelection&&(l=this._getHeadersWithinSelection(this.m_selection[0],h,a)),l&&l.length)for(let a=0;a<l.length;a++){let h=l[a][this.getResources().getMappedAttribute("context")],m=h.index;if(r!==l[a])if(this.m_resizingElement=l[a],"column"===d)if(this.isHidden("column",m)){let e=h.key;this.m_sizingManager.setSize("column",e,s),this.resizeColWidth(this.getElementDir(l[a],"width"),0)}else this.resizeColWidth(this.getElementDir(l[a],"width"),s);else this.resizeRowHeight(this.getElementDir(l[a],"height"),n);this._fireResizeEvent(e,t,i,s,n,o)}else"column"===d?this.resizeColWidth(this.getElementDir(this.m_resizingElement,"width"),s):this.resizeRowHeight(this.getElementDir(this.m_resizingElement,"height"),n),this._fireResizeEvent(e,t,i,s,n,o)},z.prototype._fireResizeEvent=function(e,t,i,s,n,o){let l={event:e,ui:{header:this._getKey(this.m_resizingElement),oldDimensions:{width:t,height:i},newDimensions:{width:s,height:n},size:o}};this.fireEvent("resize",l)},z.prototype.handleResizeMouseUp=function(e){if(!0===this.m_isResizing){var t=this.getElementWidth(this.m_resizingElement),i=this.getElementHeight(this.m_resizingElement);let s=this.m_orginalResizeDimensions.width,n=this.m_orginalResizeDimensions.height,o=this.m_resizingElement,l="col-resize"===this.m_cursor?o.style.width:o.style.height;t===this.m_orginalResizeDimensions.width&&i===this.m_orginalResizeDimensions.height||"col-resize"!==this.m_cursor&&"row-resize"!==this.m_cursor||this._resizeSelectedHeaders(e,s,n,t,i,l),o.style.cursor="",this._unhighlightResizeBorderColor(),this.m_isResizing=!1,this.m_cursor="default",null!=this.m_resizingElementSibling&&(this.m_resizingElementSibling.style.cursor=""),this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_resizingElementSibling=null,this.m_orginalResizeDimensions=null,document.removeEventListener("mousemove",this.m_docMouseMoveListener,!1),document.removeEventListener("mouseup",this.m_docMouseUpListener,!1)}},z.prototype._isDOMElementResizable=function(e){return null!=e&&"true"===e.getAttribute(this.getResources().getMappedAttribute("resizable"))},z.prototype.manageHeaderCursor=function(e,t){var i,s,n,o,l,r,a,h,d;if((d=t?this.find(e.target,"headerlabel"):this.find(e.target,"headercell"))||t||(d=this.find(e.target,"endheadercell")),!d)return"default";var m=t?this.getHeaderLabelAxis(d):this.getHeaderCellAxis(d),c=t?this.getHeaderLabelLevel(d):this.getHeaderCellIndex(d),u=t?c:this.getHeaderCellLevel(d);if("column"===m)if(l="enable"===this.m_options.isResizable(m,"height"),o=this._isDOMElementResizable(d),t)a=null,r=null,h=this.m_headerLabels.column[c-1];else{let e=this.getVisibleCellIndexInDirection("column",c-1,{left:!0});(a=this._getHeaderCellByIndex(e,"column",u))||(this.m_headerLabels.column.length?(a=this._getLabel("column",u),u===this.m_columnHeaderLevelCount-1&&this._isHeaderLabelCollision()&&(a=this.m_headerLabels.row[this.m_rowHeaderLevelCount-1])):a=this._getLabel("row",u)),r=this._isDOMElementResizable(a),h=this._getHeaderCellByIndex(c,"column",u-1)}else if("row"===m)o="enable"===this.m_options.isResizable(m,"width"),l=t?"enable"===this.m_options.isResizable(m,"height"):this._isDOMElementResizable(d),t?(h=this.m_headerLabels.row[c-1],this._isHeaderLabelCollision()&&d===this.m_headerLabels.row[this.m_rowHeaderLevelCount-1]&&(a=this.m_headerLabels.column[this.m_columnHeaderLevelCount-1])):(a=this._getHeaderCellByIndex(c-1,"row",u),r=this._isDOMElementResizable(a),h=this._getHeaderCellByIndex(c,"row",u-1));else if("columnEnd"===m)if(l="enable"===this.m_options.isResizable(m).height,o=this._isDOMElementResizable(d),t)a=null,r=null,h=this.m_headerLabels.columnEnd[c-1];else{let e=this.getVisibleCellIndexInDirection("column",c-1,{left:!0});(a=this._getHeaderCellByIndex(e,"columnEnd",u))||(a=this._getLabel("columnEnd",u)),r=this._isDOMElementResizable(a),h=this._getHeaderCellByIndex(c,"columnEnd",u-1)}else"rowEnd"===m&&(o="enable"===this.m_options.isResizable(m).width,l=this._isDOMElementResizable(d),t?(a=this.m_headerLabels.rowEnd[c-1],r=this._isDOMElementResizable(a)):(a=this._getHeaderCellByIndex(c-1,"rowEnd",u),r=this._isDOMElementResizable(a),h=this._getHeaderCellByIndex(c,"rowEnd",u-1)));if(this.m_utils.isTouchDevice())i=e.touches[0].pageX,s=e.touches[0].pageY,n=z.RESIZE_TOUCH_OFFSET;else{i=e.offsetX,s=e.offsetY,n=z.RESIZE_OFFSET;var _=this._findHeaderOffset(e.target,d);i+=_[0],s+=_[1]}var p=this.getHeaderEdgePixels(d),g=this.getResources().isRTLMode(),C="columnEnd"===m||"rowEnd"===m,f=i<p[0]+n,y=s<p[1]+n,E=i>p[2]-n,v=s>p[3]-n;if("column"===m||"columnEnd"===m){if(o&&(g?f:E))return this.m_resizingElement=d,"col-resize";if(r&&(g?E:f)){if(this.m_resizingElement=a,this.m_resizingElementSibling=d,null!==this.m_resizingElement)return"col-resize"}else if(l){if(!C&&v||C&&y)return this.m_resizingElement=d,"row-resize";if(!C&&y||C&&v)return this.m_resizingElement=h,this.m_resizingElementSibling=d,"row-resize"}}else if("row"===m||"rowEnd"===m){if(l&&v)return this.m_resizingElement=d,"row-resize";if(r&&y&&!t){if(this.m_resizingElement=a,this.m_resizingElementSibling=d,null!==this.m_resizingElement)return"row-resize"}else if(h&&y&&t&&a&&(this.m_resizingElement=h,this.m_resizingElementSibling=d,null!==this.m_resizingElement))return"row-resize";if(o){if(!C&&(g?f:E)||C&&(g?E:f))return this.m_resizingElement=d,"col-resize";if((!C&&(g?E:f)||C&&(g?f:E))&&(this.m_resizingElement=h,this.m_resizingElementSibling=d,null!==this.m_resizingElement))return"col-resize"}}return"default"},z.prototype.handleResizeMouseMove=function(e){var t,i,s,n,o;this.m_currentMouseX=e.pageX,this.m_currentMouseY=e.pageY,this.m_utils.isTouchDevice()?(this.m_currentMouseX=e.touches[0].pageX,this.m_currentMouseY=e.touches[0].pageY):(this.m_currentMouseX=e.pageX,this.m_currentMouseY=e.pageY),t=this._getResizeHeaderMode(this.m_resizingElement);var l=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"));let r=this.find(this.m_resizingElement,"headerlabel");"col-resize"===this.m_cursor?"column"===t?(l=!r&&l,i=this.calculateColumnHeaderWidth(this.m_resizingElement),s=this.getNewElementWidth("column",i,l,null,r),r?this.resizeRowWidth(s,s-i,l,r):this.resizeColWidth(i,s)):"row"===t&&(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(l=!0),i=this.getElementWidth(this.m_resizingElement),s=this.getNewElementWidth("row",i,l,null,r),this.resizeRowWidth(s,s-i,l,r)):"row-resize"===this.m_cursor&&("row"===t?(n=this.calculateRowHeaderHeight(this.m_resizingElement),o=this.getNewElementHeight("row",n,l,null,r),r?this.resizeColHeight(o,o-n,l):this.resizeRowHeight(n,o)):"column"===t&&(n=this.getElementHeight(this.m_resizingElement),o=this.getNewElementHeight("column",n,l,null,r),this.resizeColHeight(o,o-n,l))),this.buildCorners(),this.m_utils.isTouchDevice()&&this._moveTouchSelectionAffordance(),this.m_lastMouseX=this.m_currentMouseX,this.m_lastMouseY=this.m_currentMouseY},z.prototype.resizeColWidth=function(e,t){var i,s=t-e;const n=this.getResources().isRTLMode()?"right":"left";if(0!==s){let e=!1;if(this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader"))&&(e=!0),null==this.m_databody.firstChild||e){if(e&&this.m_databodyFrozenCol){let e=this.getElementWidth(this.m_databodyFrozenCol),t=this.getElementDir(this.m_databodyFrozenCol,n);if(-1!==this.m_endRowEndHeader){let i=this.getElementDir(this.m_rowEndHeader,n);s=t+e+s>i?i-(t+e):s}i=e+s,this.setElementWidth(this.m_databodyFrozenCol,i),this.setElementWidth(this.m_databodyFrozenCol,i),this.m_databodyFrozenCorner&&(this.setElementWidth(this.m_databodyFrozenCorner,i),this.setElementWidth(this.m_databodyFrozenCorner,i))}}else{i=this.getElementWidth(this.m_databody.firstChild)+s,this.setElementWidth(this.m_databody.firstChild,i),this.m_databodyFrozenRow&&this.setElementWidth(this.m_databodyFrozenRow.firstChild,i)}this.resizeColumnWidthAndShift(s),this.deleteAndApplyHiddenIndicators(),e||(this.m_endColPixel+=s,this.m_endColHeaderPixel+=s,this.m_endColEndHeaderPixel+=s,null!=i&&(this.m_avgColWidth=i/this.getDataSource().getCount("column"))),this.manageResizeScrollbars()}},z.prototype.resizeRowHeight=function(e,t){var i,s=t-e;if(0!==s){let e=!1;if(this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader"))&&(e=!0),null==this.m_databody.firstChild||e){if(e&&this.m_databodyFrozenRow){let e=this.getElementHeight(this.m_databodyFrozenRow),t=this.getElementDir(this.m_databodyFrozenRow,"top");if(-1!==this.m_endColEndHeader){let i=this.getElementDir(this.m_colEndHeader,"top");s=t+e+s>i?i-(t+e):s}i=e+s,this.setElementHeight(this.m_databodyFrozenRow,i),this.setElementHeight(this.m_databodyFrozenRow,i),this.m_databodyFrozenCorner&&(this.setElementHeight(this.m_databodyFrozenCorner,i),this.setElementHeight(this.m_databodyFrozenCorner,i))}}else{i=this.getElementHeight(this.m_databody.firstChild)+s,this.setElementHeight(this.m_databody.firstChild,i)}this.resizeRowHeightAndShift(s),e||(this.m_endRowPixel+=s,this.m_endRowHeaderPixel+=s,this.m_endRowEndHeaderPixel+=s,null!=i&&(this.m_avgRowHeight=i/this.getDataSource().getCount("row"))),this.manageResizeScrollbars()}},z.prototype.resizeColHeight=function(e,t,i){if(0!==t){var s,n,o,l=!0,r=this.find(this.m_resizingElement,"headerlabel");if(r?"column"===(o=this.getHeaderLabelAxis(this.m_resizingElement))||"columnEnd"===o?n=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==o&&"rowEnd"!==o||(n=this.m_columnHeaderLevelCount-1,l=!1):(n=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),o=this.getHeaderCellAxis(this.m_resizingElement)),i?this.m_columnEndHeaderLevelHeights[n]+=t:(s=this.m_columnHeaderLevelHeights[n],this.m_columnHeaderLevelHeights[n]+=t),!i&&n===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(l=!1),this.resizeColumnHeightsAndShift(t,n,i,l),this.deleteAndApplyHiddenIndicators(),i)this.m_colEndHeaderHeight+=t,this.setElementHeight(this.m_colEndHeader,this.m_colEndHeaderHeight),this.m_colEndHeaderFrozen&&this.setElementHeight(this.m_colEndHeaderFrozen,this.m_colEndHeaderHeight);else{if(this.m_colHeaderHeight+=t,this.setElementHeight(this.m_colHeader,this.m_colHeaderHeight),this.m_colHeaderFrozen&&this.setElementHeight(this.m_colHeaderFrozen,this.m_colHeaderHeight),0===this.m_headerLabels.column.length&&-1!==n)this._resizeHeaderLabelDirs(n,t,["row"],"height");else if(null!=this.m_columnHeaderLevelCount&&n===this.m_columnHeaderLevelCount-1)if(this.m_headerLabels.row.length){var a,h;if(r){if("column"===o)h=e,this.m_collisionResize=!0;else if("row"===o)a=t,this.m_collisionResize=!0;else if("rowEnd"===o)if(this._isHeaderLabelCollision()){let e=0;for(let t=0;t<this.m_columnHeaderLevelCount-1;t++)e+=this.getElementHeight(this.m_headerLabels.column[t]);let t=this.m_colHeaderHeight-e,i=this._calculateCollisionDimension(t,s,r,o);a=i.rowHeightChange,h=i.colHeight}else a=t,h=this.m_colHeaderHeight}else if(this._isHeaderLabelCollision()){let t=this._calculateCollisionDimension(e,s,!0,o);a=t.rowHeightChange,h=t.colHeight}else a=t,h=e;var d=this._getLabel("column",this.m_columnHeaderLevelCount-1);d&&this.setElementHeight(d,h),this._resizeHeaderLabelDirs(this.m_rowHeaderLevelCount-1,a,["row"],"height")}else{let t=["bottomResized"],i=this._getLabel("column",this.m_columnHeaderLevelCount-1);this._highlightElement(i.parentNode,t);let s=0;if("rowEnd"===o)for(let e=0;e<this.m_columnHeaderLevelCount-1;e++)s+=this.getElementHeight(this.m_headerLabels.column[e]);let n=e-s;this.setElementHeight(i,n)}else if(n<0){let t=this._getLabel("row",this.m_rowHeaderLevelCount-1),i=["bottomResized"];if(t&&n<0){this._highlightElement(t.parentNode,i);for(let i=0;i<this.m_rowHeaderLevelCount;i++)t=this._getLabel("row",i),this.setElementHeight(t,e)}}let i=this._getLabel("rowEnd",this.m_rowEndHeaderLevelCount-1),l=["bottomResized"];if(i){let t=-1===this.m_endColHeader?e:this.m_colHeaderHeight;this._highlightElement(i.parentNode,l);for(let e=0;e<this.m_rowEndHeaderLevelCount;e++)i=this._getLabel("rowEnd",e),this.setElementHeight(i,t)}}this.manageResizeScrollbars()}},z.prototype._calculateCollisionDimension=function(e,t,i,s){let n,o,l={},r=this._getMinValue("height",s,i);if(this.m_collisionResize){let l=this.getElementDir(this.m_headerLabels.row[this.m_rowHeaderLevelCount-1],"height"),a=this.getElementDir(this.m_headerLabels.column[this.m_columnHeaderLevelCount-1],"height"),h=l+a,d=a/h,m=l/h;l===r&&a===r?(n=Math.floor(e/2)-Math.floor(t/2),o=Math.ceil(e/2),this.m_collisionResize=!1):d>m?(o=Math.floor(e*d),n=e-o-l,l+n<this._getMinValue("height",s,i)&&(n=0)):(n=Math.floor(e*m)-l,l+n<this._getMinValue("height",s,i)&&(n=0),o=e-(l+n),o=Math.max(o,this._getMinValue("height",s,i)))}else n=Math.floor(e/2)-Math.floor(t/2),o=Math.ceil(e/2);return l.colHeight=o,l.rowHeightChange=n,l},z.prototype.resizeRowWidth=function(e,t,i,s){if(0!==t){var n;if(s){let e=this.getHeaderLabelAxis(this.m_resizingElement);"column"===e||"columnEnd"===e?n=this.m_rowHeaderLevelCount-1:"row"!==e&&"rowEnd"!==e||(n=this.getHeaderLabelLevel(this.m_resizingElement))}else n=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1);if(i?this.m_rowEndHeaderLevelWidths[n]+=t:this.m_rowHeaderLevelWidths[n]+=t,this.resizeRowWidthsAndShift(t,n,i),i)this.m_rowEndHeaderWidth+=t,this.setElementWidth(this.m_rowEndHeader,this.m_rowEndHeaderWidth),this.m_rowEndHeaderFrozen&&this.setElementWidth(this.m_rowEndHeaderFrozen,this.m_rowEndHeaderWidth);else{if(this.m_rowHeaderWidth+=t,n<0){let t=this.getResources().isRTLMode()?["startResized"]:["endResized"],i=this._getLabel("column",this.m_columnHeaderLevelCount-1);this._highlightElement(i.parentNode,t);for(let t=0;t<this.m_columnHeaderLevelCount;t++)i=this._getLabel("column",t),this.setElementWidth(i,e)}else this.setElementWidth(this.m_rowHeader,this.m_rowHeaderWidth),this.m_rowHeaderFrozen&&this.setElementWidth(this.m_rowHeaderFrozen,this.m_rowHeaderWidth),(n===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._resizeHeaderLabelDirs(n,t,["column"],"width");let i=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1),s=this.getResources().isRTLMode()?["startResized"]:["endResized"];if(i){this._highlightElement(i.parentNode,s);let e=this.getElementWidth(i)+t;for(let t=0;t<this.m_columnEndHeaderLevelCount;t++)i=this._getLabel("columnEnd",t),this.setElementWidth(i,e)}}this.manageResizeScrollbars()}},z.prototype._resizeHeaderLabelDirs=function(e,t,i,s){for(var n=0;n<i.length;n++){for(var o=i[n],l=0;l<this.m_headerLabels[o].length;l++){var r=this.m_headerLabels[o][l];if(null!=r){var a=this.getElementDir(r,s)+t;this.setElementDir(r,a,s)}}this._highlightResizeLabelDirs(o,e)}},z.prototype._highlightResizeLabelDirs=function(e,t){let i=this.getResources().isRTLMode()?["startResized"]:["endResized"],s="column"===e?i:["bottomResized"];this.m_corner&&("column"===e&&t===this.m_columnHeaderLevelCount-1||"row"===e&&t===this.m_rowHeaderLevelCount-1)&&this._highlightElement(this.m_corner,s);let n=this._getLabel("rowEnd",this.m_columnHeaderLevelCount-1);n&&this._highlightElement(n.parentNode,s)},z.prototype._unhighlightResizeBorderColor=function(){let e=this.m_root.querySelectorAll(".oj-datagrid-resized-start,\n .oj-datagrid-resized-end, .oj-datagrid-resized-top, .oj-datagrid-resized-bottom");this._unhighlightElementsByClassName(e,["startResized","endResized","topResized","bottomResized"])},z.prototype.getNewElementWidth=function(e,t,i,s,n){var o;o=this._getMinValue("width",e,n),null==s&&(s=this.getResources().isRTLMode()?this.m_lastMouseX-this.m_currentMouseX:this.m_currentMouseX-this.m_lastMouseX),i&&"row"===e&&(s*=-1);var l=t+s+this.m_overResizeLeft+this.m_overResizeMinLeft+this.m_overResizeRight;if(l<o?(this.m_overResizeMinLeft+=s-o+t,l=o):(this.m_overResizeMinLeft=0,this.m_overResizeLeft=0),"row"===e){var r=this.getRowHeaderWidth()+this.getRowEndHeaderWidth()-t,a=Math.round(this.getWidth()-this.m_utils.getScrollbarSize()-1)-r;l>a?(this.m_overResizeRight+=s-a+t,l=a):this.m_overResizeRight=0}return l},z.prototype.getNewElementHeight=function(e,t,i,s,n){var o;let l=this._getMinValue("height",e,!0);if(n){if(o=l,"rowEnd"===this.getHeaderLabelAxis(this.m_resizingElement)&&this.m_headerLabels.column&&this.m_headerLabels.column.length){this._isHeaderLabelCollision()&&(o=2*l);for(let e=0;e<this.m_columnHeaderLevelCount-1;e++)o+=this.getElementHeight(this.m_headerLabels.column[e])}}else o=this._getMinValue("height",e,n);"column"===e&&!i&&this.getHeaderCellLevel(this.m_resizingElement)+this.getHeaderCellDepth(this.m_resizingElement)===this.m_columnHeaderLevelCount&&this._isHeaderLabelCollision()&&(o=2*l),null==s&&(s=this.m_currentMouseY-this.m_lastMouseY),i&&"column"===e&&(s*=-1);var r=t+s+this.m_overResizeTop+this.m_overResizeMinTop+this.m_overResizeBottom;if(r<o?(this.m_overResizeMinTop+=s-o+t,r=o):(this.m_overResizeMinTop=0,this.m_overResizeTop=0),"column"===e){var a=this.getColumnHeaderHeight()+this.getColumnEndHeaderHeight()-t,h=Math.round(this.getHeight()-this.m_utils.getScrollbarSize()-1)-a;r>h?(this.m_overResizeBottom+=s-h+t,r=h):this.m_overResizeBottom=0}return r},z.prototype._getMinValue=function(e,t,i){var s,n,o=this.m_resizingElement,l=this._getCellPaddingBorder(e,o),r=l;if(i)return Math.max(this.m_utils.isTouchDevice()?2*z.RESIZE_TOUCH_OFFSET:2*z.RESIZE_OFFSET,r);var a=this.getHeaderCellLevel(o),h=this.getHeaderCellDepth(o),d=this.getResources().getMappedAttribute("sortable");"true"===o.getAttribute(d)&&this._setSortContainerSize(this._getSortContainer(o),l),"column"===t&&"true"===o.getAttribute(d)&&(r="width"===e?this.m_sortContainerWidth:this.m_sortContainerHeight);var m=Math.max(this.m_utils.isTouchDevice()?2*z.RESIZE_TOUCH_OFFSET:2*z.RESIZE_OFFSET,r);if("column"===t&&(1===this.m_columnHeaderLevelCount||"width"===e&&this.m_columnHeaderLevelCount===a+1||"height"===e&&1===h)||"row"===t&&-1===this.m_endRowHeader||"column"===t&&-1===this.m_endColHeader||"row"===t&&(1===this.m_rowHeaderLevelCount||"height"===e&&this.m_rowHeaderLevelCount===a+1||"width"===e&&1===h))return m;var c=this.getHeaderCellIndex(o),u=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0),_=this.getElementDir(o,e);if("column"===t)if("width"===e){let i=c+(u-1);for(;this.isHidden("column",i);)i-=1;s=this._getHeaderCellByIndex(i,t,this.m_columnHeaderLevelCount-1),n=this.getElementDir(s,e)}else n=this._getHeaderLevelDimension(a+(h-1),o,this.m_columnHeaderLevelHeights,"height",1);else"row"===t&&("height"===e?(s=this._getHeaderCellByIndex(c+(u-1),t,this.m_rowHeaderLevelCount-1),n=this.getElementDir(s,e)):n=this._getHeaderLevelDimension(a+(h-1),o,this.m_rowHeaderLevelWidths,"width",1));return _-(n-m)},z.prototype._getLabelMinValue=function(e){var t=this.m_resizingElement,i=this._getCellPaddingBorder(e,t);return Math.max(this.m_utils.isTouchDevice()?2*z.RESIZE_TOUCH_OFFSET:2*z.RESIZE_OFFSET,i)},z.prototype._setSortContainerSize=function(e,t){this.m_sortContainerWidth=this.getElementWidth(e)+t,this.m_sortContainerHeight=this.getElementHeight(e)},z.prototype._getCellPaddingBorder=function(e,t){if(null==this.m_resizingElementMin){for(var i=["top","right","bottom","left"],s="width"===e?1:0,n=0,o=window.getComputedStyle(t);s<4;s+=2)n+=parseFloat(o.getPropertyValue("padding-"+i[s])),n+=parseFloat(o.getPropertyValue("border-"+i[s]+"-width"));this.m_resizingElementMin=Math.round(n)}return this.m_resizingElementMin},z.prototype.manageResizeScrollbars=function(){var e=this.getWidth(),t=this.getHeight(),i=this.m_colHeader,s=this.m_colEndHeader,n=this.m_rowHeader,o=this.m_rowEndHeader,l=this.m_databody,r=l.firstChild;const a=this.m_databodyFrozenCol,h=this.m_databodyFrozenRow;let d=0,m=0;var c=this.getColumnHeaderHeight(),u=this.getColumnEndHeaderHeight(),_=this.getRowHeaderWidth(),p=this.getRowEndHeaderWidth();if(a&&(d=this.getElementWidth(a)),h&&(m=this.getElementHeight(h)),-1===this.m_endRowHeader&&-1!==this.m_endColHeader){let e=this._getLabel("column",this.m_columnHeaderLevelCount-1);e&&(_=this.getElementWidth(e))}else if(-1!==this.m_endRowHeader&&-1===this.m_endColHeader){let e=this._getLabel("row",this.m_rowHeaderLevelCount-1);e&&(c=this.getElementHeight(e))}var g,C=t-c-u-m,f=e-_-p-d,y=this.m_utils.getScrollbarSize(),E=this.getResources().isRTLMode()?"right":"left";if(this._databodyEmpty())if(null==this.m_empty){g=this._buildEmptyText();var v=this.getElementHeight(g),w=this.getElementWidth(g);v>this.getElementHeight(r)&&this.setElementHeight(r,v),w>this.getElementWidth(r)&&this.setElementWidth(r,w),this.m_databody.firstChild.appendChild(g)}else g=this.m_empty,this.setElementDir(g,this.m_endColHeader>=0?c:0,"top");var H,x,S,b,R,I=this.getElementWidth(l.firstChild),M=this.getElementHeight(l.firstChild),F=this.isDatabodyHorizontalScrollbarRequired(f);F?(H=this.isDatabodyVerticalScrollbarRequired(C-y),l.style.overflow="auto"):(H=this.isDatabodyVerticalScrollbarRequired(C))?(F=this.isDatabodyHorizontalScrollbarRequired(f-y),l.style.overflow="auto"):l.style.overflow="hidden",this.m_hasHorizontalScroller=F,this.m_hasVerticalScroller=H,-1!==this.m_endColEndHeader?(x=Math.min(M+(F?y:0),C),S=F?x-y:x):(x=C,S=Math.min(M,F?x-y:x)),-1!==this.m_endRowEndHeader?(b=Math.min(I+(H?y:0),f),R=H?b-y:b):(b=f,R=Math.min(I,H?b-y:b));var z=_+R+d+(H?y:0),A=c+S+m+(F?y:0);if(this.setElementDir(n,0,E),this.setElementDir(n,c,"top"),this.setElementHeight(n,S),this.setElementDir(o,z,E),this.setElementDir(o,c,"top"),this.setElementHeight(o,S),this.setElementDir(i,_,E),this.setElementWidth(i,R),this.setElementDir(s,_,E),this.setElementDir(s,A,"top"),this.setElementWidth(s,R),[_,c]=this._setFrozenContainerDimension(f,C,_,p,c,u),this.setElementDir(l,c,"top"),this.setElementDir(l,_,E),this.setElementWidth(l,b),this.setElementHeight(l,x),-1===this.m_endRowHeader&&-1!==this.m_endColHeader&&this.m_rowHeaderScrollbarSpacer?(this.setElementDir(this.m_rowHeaderScrollbarSpacer,c,"top"),this.setElementHeight(this.m_rowHeaderScrollbarSpacer,x+u),this.setElementWidth(this.m_rowHeaderScrollbarSpacer,_)):-1!==this.m_endRowHeader&&-1===this.m_endColHeader&&this.m_columnHeaderScrollbarSpacer&&(this.setElementDir(this.m_columnHeaderScrollbarSpacer,_,"left"),this.setElementWidth(this.m_columnHeaderScrollbarSpacer,b+p),this.setElementHeight(this.m_columnHeaderScrollbarSpacer,c)),this.m_scrollWidth=I-R,this.m_scrollHeight=M-S,this.buildCorners(),this._adjustHeaderBorders(),this._updateGridlines(),this.m_utils.isTouchDevice()){var D=0,L=0;if(this.m_currentScrollLeft>this.m_scrollWidth&&(D=this.m_scrollWidth-this.m_currentScrollLeft),this.m_currentScrollTop>this.m_scrollHeight&&(L=this.m_scrollHeight-this.m_currentScrollTop),0!==D||0!==L){this.m_utils.isTouchDeviceNotIOS()&&this._disableTouchScrollAnimation();var T=this.adjustTouchScroll(D,L);D=T[0],L=T[1],this.scrollDelta(D,L)}}},z.prototype.resizeColumnWidthAndShift=function(e){var t=this.getResources().isRTLMode()?"right":"left",i=this.m_colHeader.style.display,s=this.m_colEndHeader.style.display;let n=this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader")),o=!1;n?(this.m_databodyFrozenCol.style.display="none",this.m_colHeaderFrozen.style.display="none",this.m_colEndHeaderFrozen.style.display="none",this.m_databodyFrozenCorner&&(this.m_databodyFrozenCorner.style.display="none",o=!0)):(this.m_databody.style.display="none",this.m_colHeader.style.display="none",this.m_colEndHeader.style.display="none",this.m_databodyFrozenRow&&(this.m_databodyFrozenRow.style.display="none"));var l=this.getHeaderCellIndex(this.m_resizingElement);if(this.m_columnHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling)for(l+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1;this.isHidden("column",l);)l-=1;var r,a=this.createIndex(-1,l),h=this.getElementsInRange(this.createRange(a,a));if(h)for(let e=0;e<h.length;e++)r=this.getResources().isRTLMode()?["startResized"]:["endResized"],this._highlightElement(h[e],r);let d=this.m_colHeader.firstChild,m=this.m_colEndHeader.firstChild;n&&(d=this.m_colHeaderFrozen.firstChild,m=this.m_colEndHeaderFrozen.firstChild),this._shiftHeadersAlongAxisInContainer(d,l,e,t,this.getMappedStyle("colheadercell"),"column"),this._shiftHeadersAlongAxisInContainer(m,l,e,t,this.getMappedStyle("colendheadercell"),"column"),n?this._shiftCellsAlongAxis("column",e,l,null,this.m_frozenColIndex,o):(this._shiftCellsAlongAxis("column",e,l),this.m_databodyFrozenRow&&this._shiftFrozenCellsAlongAxis("column",e,l,!1)),n?(this.m_databodyFrozenCol.style.display="",this.m_colHeaderFrozen.style.display=i,this.m_colEndHeaderFrozen.style.display=s,this.m_databodyFrozenCorner&&(this.m_databodyFrozenCorner.style.display="")):(this.m_databody.style.display="",this.m_colHeader.style.display=i,this.m_colEndHeader.style.display=s,this.m_databodyFrozenRow&&(this.m_databodyFrozenRow.style.display=""))},z.prototype._shiftCellsAlongAxis=function(e,t,i,s,n,o,l){var r,a,h,d,m=[];let c=n;if(null==s&&(s=!1),"row"===e?(r="height",a="top",void 0===c&&(c=this.m_endRow),h=null===this.m_frozenColIndex||-1===this.m_frozenColndex||o?this.m_startCol:this.m_frozenColIndex+1,d=this.m_endCol):(r="width",a=this.getResources().isRTLMode()?"right":"left",void 0===c&&(c=this.m_endCol),h=this._hasFrozenRows()&&!o?this.m_frozenRowIndex+1:this.m_startRow,d=this.m_endRow),null!=this.m_databody.firstChild)for(var u=h;u<=d;u++){var _="row"===e?this.createIndex(i,u):this.createIndex(u,i),p=this._getCellByIndex(_),g=p[this.getResources().getMappedAttribute("context")],C=g.indexes[e],f=g.extents[e],y=i-C,E=f-y;m[u]&&m[u][i]||!0===s||(this.setElementDir(p,this.getElementDir(p,r)+t,r),"row"===e?this._updateTempArray(m,!0,u,i,g.extents.column,f-y):(l&&(this.isHidden(e,i)?p.style.display="none":p.style.display=""),this._updateTempArray(m,!0,u,i,g.extents.row,f-y)));var v=i;!0!==s&&(v=i+E);for(var w=v;w<=c;w++)if(!m[u]||!m[u][w]){_="row"===e?this.createIndex(w,u):this.createIndex(u,w),f=(g=(p=this._getCellByIndex(_))[this.getResources().getMappedAttribute("context")]).extents[e];var H=this.getElementDir(p,a)+t;this.setElementDir(p,H,a),"row"===e?this._updateTempArray(m,!0,u,w,g.extents.column,f):this._updateTempArray(m,!0,u,w,g.extents.row,f)}}},z.prototype._shiftFrozenCellsAlongAxis=function(e,t,i,s,n){const o=[];let l,r,a,h,d;"row"===e?(l="top",r=this.m_endRow,a=this.m_startCol,h=this.m_frozenColIndex,d="height"):(l=this.getResources().isRTLMode()?"right":"left",r=this.m_endCol,a=this.m_startRow,h=this.m_frozenRowIndex,d="width");for(let m=a;m<=h;m++){let a="row"===e?this.createIndex(i,m):this.createIndex(m,i),h=this._getFrozenCellByIndex(a,e),c=h[this.getResources().getMappedAttribute("context")],u=c.extents[e],_=i-c.indexes[e],p=u-_;o[m]&&o[m][i]||!0===s||(this.setElementDir(h,this.getElementDir(h,d)+t,d),"row"===e?this._updateTempArray(o,!0,m,i,c.extents.column,u-_):(n&&(this.isHidden(e,i)?h.style.display="none":h.style.display=""),this._updateTempArray(o,!0,m,i,c.extents.row,u-_)));let g=i;!0!==s&&(g=i+p);for(let i=g;i<=r;i++)if(!o[m]||!o[m][i]){a="row"===e?this.createIndex(i,m):this.createIndex(m,i),h=this._getFrozenCellByIndex(a,e),c=h[this.getResources().getMappedAttribute("context")],u=c.extents[e];let s=this.getElementDir(h,l)+t;this.setElementDir(h,s,l),"row"===e?this._updateTempArray(o,!0,m,i,c.extents.column,u):this._updateTempArray(o,!0,m,i,c.extents.row,u)}}},z.prototype.resizeRowHeightAndShift=function(e){var t=this.m_rowHeader.style.display,i=this.m_rowEndHeader.style.display;let s=this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader")),n=!1;s?(this.m_databodyFrozenRow.style.display="none",this.m_rowHeaderFrozen.style.display="none",this.m_rowEndHeaderFrozen.style.display="none",this.m_databodyFrozenCorner&&(this.m_databodyFrozenCorner.style.display="none",n=!0)):(this.m_databody.style.display="none",this.m_rowHeader.style.display="none",this.m_rowEndHeader.style.display="none");var o=this.getHeaderCellIndex(this.m_resizingElement);this.m_rowHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(o+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);var l,r=this.createIndex(o,-1),a=this.getElementsInRange(this.createRange(r,r));if(a)for(let e=0;e<a.length;e++)l=["bottomResized"],this._highlightElement(a[e],l);let h=this.m_rowHeader.firstChild,d=this.m_rowEndHeader.firstChild;s&&(h=this.m_rowHeaderFrozen.firstChild,d=this.m_rowEndHeaderFrozen.firstChild),this._shiftHeadersAlongAxisInContainer(h,o,e,"top",this.getMappedStyle("rowheadercell"),"row"),this._shiftHeadersAlongAxisInContainer(d,o,e,"top",this.getMappedStyle("rowendheadercell"),"row"),s?this._shiftCellsAlongAxis("row",e,o,null,this.m_frozenRowIndex,n):(this._shiftCellsAlongAxis("row",e,o),this.m_databodyFrozenCol&&this._shiftFrozenCellsAlongAxis("row",e,o,!1)),s?(this.m_databodyFrozenRow.style.display="",this.m_rowHeaderFrozen.style.display=t,this.m_rowEndHeaderFrozen.style.display=i,this.m_databodyFrozenCorner&&(this.m_databodyFrozenCorner.style.display="",n=!0)):(this.m_databody.style.display="",this.m_rowHeader.style.display=t,this.m_rowEndHeader.style.display=i)},z.prototype._shiftHeadersAlongAxisInContainer=function(e,t,i,s,n,o,l){var r,a,h,d,m=0,c=this._getHeaderLastChild(e);if(null!=c){var u,_=this.m_utils.containsCSSClassName(c,n);for(_?(a=c.parentNode,r=c,h=this.getHeaderCellIndex(r)):(a=c,r=c.firstChild,h=this._getAttribute(a,"start",!0));t<h;)if(_)d=this.getElementDir(r,s)+i,this.setElementDir(r,d,s),c=this._getHeaderPreviousSibling(c),_=this.m_utils.containsCSSClassName(c,n),a=c.parentNode,r=c,h=this.getHeaderCellIndex(r);else{for(var p=a.getElementsByClassName(n),g=0;g<p.length;g++)d=this.getElementDir(p[g],s)+i,this.setElementDir(p[g],d,s);c=this._getHeaderPreviousSibling(c),_=this.m_utils.containsCSSClassName(c,n),a=c,r=c.firstChild,h=this._getAttribute(a,"start",!0)}if(this.m_resizingElement&&(u=this.getHeaderCellLevel(this.m_resizingElement)),"column"===o?(m=this.getElementWidth(r)+i,this.setElementWidth(r,m)):"row"===o?(m=this.getElementHeight(r)+i,this.setElementHeight(r,m)):null==o&&(d=this.getElementDir(r,s)+i,this.setElementDir(r,d,s)),l&&"column"===o&&(this.isHeaderHidden(r)?r.style.display="none":r.style.display=""),("row"===o||"column"===o)&&!l){let e=this.getResources().isRTLMode()?["startResized"]:["endResized"],t="row"===o?["bottomResized"]:e;void 0!==u&&this.getHeaderCellLevel(r)>=u&&this._highlightElement(r,t),r!==this.m_resizingElement||r!==a.lastChild&&r!==a.firstChild||this._highlightResizeBorder(t,o)}_||null==r.nextSibling?null==o||l||"column"===o&&this.isHidden("column",t)||this.m_sizingManager.setSize(o,this._getKey(r),m):this._shiftHeadersAlongAxisInContainer(c,t,i,s,n,o,l)}},z.prototype._highlightResizeBorder=function(e,t){let i=this.getHeaderCellIndex(this.m_resizingElement),s="column"===t?this.m_columnHeaderLevelCount:this.m_rowHeaderLevelCount,n=this.m_resizingElement[this.getResources().getMappedAttribute("context")],o=n.index+n.extent-1;for(let n=0;n<s-1;n++){let s=this._getHeaderCellByIndex(i,t,n),l=s[this.getResources().getMappedAttribute("context")];l.index+l.extent-1===o&&this._highlightElement(s,e)}},z.prototype.resizeColumnHeightsAndShift=function(e,t,i,s){var n,o,l,r;i?(n=this.m_colEndHeader,o=this.getMappedStyle("colendheadercell"),l="columnEnd",r="bottom"):(n=this.m_colHeader,o=this.getMappedStyle("colheadercell"),l="column",r="top"),n.style.display="none",this.m_databody.style.display="none",this._hasFrozenColumns()&&(i?this.m_colEndHeaderFrozen.style.display="none":this.m_colHeaderFrozen.style.display="none",this.m_databodyFrozenCol.style.display="none"),s&&this._shiftLabelsDir(this.m_headerLabels[l],e,t,r,l),this._shiftHeadersDirInContainer(n.firstChild,e,t,r,o,l),this.m_colHeaderFrozen&&this._shiftHeadersDirInContainer(this.m_colHeaderFrozen.firstChild,e,t,r,o,l),n.style.display="",this.m_databody.style.display="",this._hasFrozenColumns()&&(i?this.m_colEndHeaderFrozen.style.display="":this.m_colHeaderFrozen.style.display="",this.m_databodyFrozenCol.style.display="")},z.prototype.resizeRowWidthsAndShift=function(e,t,i){var s,n,o,l;i?(s=this.m_rowEndHeader,n=this.getMappedStyle("rowendheadercell"),o="rowEnd",l=this.getResources().isRTLMode()?"left":"right"):(s=this.m_rowHeader,n=this.getMappedStyle("rowheadercell"),o="row",l=this.getResources().isRTLMode()?"right":"left"),s.style.display="none",this.m_databody.style.display="none",this._hasFrozenRows()&&(i?this.m_rowEndHeaderFrozen.style.display="none":this.m_rowHeaderFrozen.style.display="none",this.m_databodyFrozenRow.style.display="none"),this._shiftLabelsDir(this.m_headerLabels[o],e,t,l,o),this._shiftHeadersDirInContainer(s.firstChild,e,t,l,n,o),this.m_rowHeaderFrozen&&this._shiftHeadersDirInContainer(this.m_rowHeaderFrozen.firstChild,e,t,l,n,o),s.style.display="",this.m_databody.style.display="",this._hasFrozenRows()&&(i?this.m_rowEndHeaderFrozen.style.display="":this.m_rowHeaderFrozen.style.display="",this.m_databodyFrozenRow.style.display="")},z.prototype._shiftLabelsDir=function(e,t,i,s,n){for(var o=0;o<e.length;o++){var l,r=e[o];if(o===i)if("column"===n||"columnEnd"===n)if(l=this.getElementHeight(r)+t,this.setElementHeight(r,l),"column"===n&&this._isHeaderLabelCollision()&&i===this.m_columnHeaderLevelCount-1){let e=["bottomResized"];this._highlightElement(this.m_corner,e)}else if("columnEnd"===n){let e=["topResized"],t=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1);t&&this._highlightElement(t,e)}else{let e="column"===n?["bottomResized"]:["topResized"];this._highlightElement(r,e)}else{l=this.getElementWidth(r)+t,this.setElementWidth(r,l);let e=this.getResources().isRTLMode()?["startResized"]:["endResized"],i=this.getResources().isRTLMode()?["endResized"]:["startResized"],s="row"===n?e:i;this._highlightElement(r,s);let o=this._getLabel("columnEnd",this.m_columnEndHeaderLevelCount-1);o&&this._highlightElement(o.parentNode,s)}o>i&&(l=this.getElementDir(r,s)+t,this.setElementDir(r,l,s))}},z.prototype._shiftHeadersDirInContainer=function(e,t,i,s,n,o){for(var l=e.childNodes,r=0;r<l.length;r++){var a,h,d=l[r];if(this.m_utils.containsCSSClassName(d,n)){a=this.getHeaderCellLevel(d);var m=this.getHeaderCellDepth(d);if(a<=i&&i<a+m){if("column"===o||"columnEnd"===o){if(h=this.getElementHeight(d)+t,this.setElementHeight(d,h),this.m_resizingElement){var c=this.getMappedStyle("colendheadercell");if(this.m_utils.containsCSSClassName(d,c)){let e=["topResized"];this._highlightElement(d,e)}else{let e=["bottomResized"];this._highlightElement(d,e)}}}else if(h=this.getElementWidth(d)+t,this.setElementWidth(d,h),this.m_resizingElement){var u=this.getMappedStyle("rowendheadercell");if(this.m_utils.containsCSSClassName(d,u)){let e=this.getResources().isRTLMode()?["endResized"]:["startResized"];this._highlightElement(d,e)}else{let e=this.getResources().isRTLMode()?["startResized"]:["endResized"];this._highlightElement(d,e)}}}else a>i&&(h=this.getElementDir(d,s)+t,this.setElementDir(d,h,s))}else if((a=this._getAttribute(d,"level",!0))<=i)this._shiftHeadersDirInContainer(d,t,i,s,n,o);else for(var _=d.getElementsByClassName(n),p=0;p<_.length;p++)h=this.getElementDir(_[p],s)+t,this.setElementDir(_[p],h,s)}},z.prototype.handleContextMenuResize=function(e,t,i,s){this.m_overResizeLeft=0,this.m_overResizeMinLeft=0,this.m_overResizeTop=0,this.m_overResizeMinTop=0,this.m_overResizeRight=0,this.m_overResizeBottom=0;var n=parseFloat(i,10),o=n-this.getElementWidth(s),l=n-this.getElementHeight(s);this.m_utils.containsCSSClassName(s,this.getMappedStyle("cell"))&&(s=t===this.m_resources.getMappedCommand("resizeHeight")?this.getHeaderFromCell(s,"row",!0):this.getHeaderFromCell(s,"column",!0)),this.m_isResizing=!0,this.m_resizingElement=s;let r=this.find(this.m_resizingElement,"headerlabel");var a=this.getElementWidth(s),h=this.getElementHeight(s),d=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"));if(t===this.m_resources.getMappedCommand("resizeWidth")){if(a!==n)if("column"===this._getResizeHeaderMode(this.m_resizingElement)){if(this._isDOMElementResizable(this.m_resizingElement))if(r)this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel"))&&(d=!1),this.resizeRowWidth(n,n-a,d,r),this._fireResizeEvent(e,a,h,n,h,n);else{let t=this.getNewElementWidth("column",a,d,o,r);this.resizeColWidth(a,t),this._resizeSelectedHeaders(e,a,h,n,h,n)}}else this.resizeRowWidth(n,n-a,d,r),this._fireResizeEvent(e,a,h,n,h,n)}else if(t===this.m_resources.getMappedCommand("resizeHeight")&&h!==n)if("column"===this._getResizeHeaderMode(this.m_resizingElement))this.resizeColHeight(n,n-h,d),this._fireResizeEvent(e,a,h,a,n,n);else if(this._isDOMElementResizable(this.m_resizingElement)){let t=this.getNewElementHeight("row",h,d,l,r);r?(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(d=!1),this.resizeColHeight(t,t-h,d),this._fireResizeEvent(e,a,h,a,n,n)):(this.resizeRowHeight(h,t),this._resizeSelectedHeaders(e,a,h,a,t,n))}var m=this.getElementWidth(s),c=this.getElementHeight(s);m===a&&c===h||(this.buildCorners(),this.m_utils.isTouchDevice()&&this._moveTouchSelectionAffordance()),this._unhighlightResizeBorderColor(),this.m_resizingElement=null,this.m_resizingElementMin=null,this.m_isResizing=!1},z.prototype._getResizeNestedHeaderIndex=function(e,t){let i=this.getHeaderCellIndex(this.m_resizingElement),s=t?this.m_columnEndHeaderLevelCount:this.m_columnHeaderLevelCount,n=t?this.m_rowEndHeaderLevelCount:this.m_rowHeaderLevelCount;return("column"===e||"columnEnd"===e?s:n)>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1),i},z.prototype._highlightResizeMouseDown=function(){let e,t,i=this.getHeaderCellIndex(this.m_resizingElement),s=this._getResizeHeaderMode(this.m_resizingElement),n=this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("endheadercell"))||this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("columnendheaderlabel")),o=this.getResources().isRTLMode()?"right":"left",l=this.find(this.m_resizingElement,"headerlabel");if("col-resize"===this.m_cursor)if("column"===s)if(n=!l&&n,l)t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.m_rowHeaderLevelCount-1:"row"!==t&&"rowEnd"!==t||(e=this.getHeaderLabelLevel(this.m_resizingElement)),this.resizeRowWidthsAndShift(0,e,n),n||(e===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._highlightResizeLabelDirs("column",e);else{this.m_columnHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);let e,t=this.createIndex(-1,i),s=this.getElementsInRange(this.createRange(t,t));if(s)for(let t=0;t<s.length;t++)e=this.getResources().isRTLMode()?["startResized"]:["endResized"],this._highlightElement(s[t],e);let n=this.m_colHeader.firstChild,l=this.m_colEndHeader.firstChild;this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader"))&&(n=this.m_colHeaderFrozen.firstChild,l=this.m_colEndHeaderFrozen.firstChild),this._shiftHeadersAlongAxisInContainer(n,i,0,o,this.getMappedStyle("colheadercell"),"column"),this._shiftHeadersAlongAxisInContainer(l,i,0,o,this.getMappedStyle("colendheadercell"),"column")}else"row"===s&&(this.m_utils.containsCSSClassName(this.m_resizingElement,this.getMappedStyle("rowendheaderlabel"))&&(n=!0),l?(t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.m_rowHeaderLevelCount-1:"row"!==t&&"rowEnd"!==t||(e=this.getHeaderLabelLevel(this.m_resizingElement))):e=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),this.resizeRowWidthsAndShift(0,e,n),n||(e===this.m_rowHeaderLevelCount-1||0===this.m_headerLabels.row.length&&this.m_headerLabels.column.length)&&this._highlightResizeLabelDirs("column",e));else if("row-resize"===this.m_cursor)if("row"===s)if(l){let i=!0;t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==t&&"rowEnd"!==t||(e=this.m_columnHeaderLevelCount-1,i=!1),!n&&e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(i=!1),this.resizeColumnHeightsAndShift(0,e,n,i),n||(0===this.m_headerLabels.column.length||e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length)&&this._highlightResizeLabelDirs("row",e)}else{this.m_rowHeaderLevelCount>1&&this.m_resizingElement===this.m_resizingElement.parentNode.firstChild&&null!=this.m_resizingElement.nextSibling&&(i+=this._getAttribute(this.m_resizingElement.parentNode,"extent",!0)-1);let e,t=this.createIndex(i,-1),s=this.getElementsInRange(this.createRange(t,t));if(s)for(let t=0;t<s.length;t++)e=["bottomResized"],this._highlightElement(s[t],e);let n=this.m_rowHeader.firstChild,o=this.m_rowEndHeader.firstChild;this.m_resizingElement.classList.contains(this.getMappedStyle("frozenHeader"))&&(n=this.m_rowHeaderFrozen.firstChild,o=this.m_rowEndHeaderFrozen.firstChild),this._shiftHeadersAlongAxisInContainer(n,i,0,"top",this.getMappedStyle("rowheadercell"),"row"),this._shiftHeadersAlongAxisInContainer(o,i,0,"top",this.getMappedStyle("rowendheadercell"),"row")}else{let i=!0;l?(t=this.getHeaderLabelAxis(this.m_resizingElement),"column"===t||"columnEnd"===t?e=this.getHeaderLabelLevel(this.m_resizingElement):"row"!==t&&"rowEnd"!==t||(e=this.m_columnHeaderLevelCount-1,i=!1)):(e=this.getHeaderCellLevel(this.m_resizingElement)+(this.getHeaderCellDepth(this.m_resizingElement)-1),t=this.getHeaderCellAxis(this.m_resizingElement)),!n&&e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length&&this._isHeaderLabelCollision()&&(i=!1),this.resizeColumnHeightsAndShift(0,e,n,i),n||(0===this.m_headerLabels.column.length||e===this.m_columnHeaderLevelCount-1&&this.m_headerLabels.row.length)&&this._highlightResizeLabelDirs("row",e)}},z.prototype.handleResizeFitToContent=function(e,t,i){let s=this.find(t,"header")||this.find(t,"endheadercell"),n=this.m_utils.containsCSSClassName(t,this.getMappedStyle("endheadercell"));if(!s){let e=this.findCell(t);if(!e)return;t=this.getHeaderFromCell(e,i)}this.m_resizingElement=t;let o,l,r,a,h,d,m=this.m_resizingElement,c=this.getHeaderCellAxis(m),u=!1;if("column"===c||"columnEnd"===c){let e=s?this._getResizeNestedHeaderIndex(c,n):this.getHeaderCellIndex(m);if(this.m_resizingElement=n?this._getHeaderCellByIndex(e,c,this.m_columnEndHeaderLevelCount-1):this._getHeaderCellByIndex(e,c,this.m_columnHeaderLevelCount-1),!this.isHidden("column",e)){let t=this.createIndex(-1,e);o=this.getElementsInRange(this.createRange(t,t)),o.push(m),l=this.calculateColumnHeaderWidth(this.m_resizingElement),r=this.getElementHeight(this.m_resizingElement),a=this._calculateResizeFitToContentValue(o,"column"),h=r,d=a,u=l!==a,this.resizeColWidth(l,a)}}else if("row"===c||"rowEnd"===c){let e=s?this._getResizeNestedHeaderIndex(c,n):this.getHeaderCellIndex(m);this.m_resizingElement=n?this._getHeaderCellByIndex(e,"rowEnd",this.m_rowEndHeaderLevelCount-1):this._getHeaderCellByIndex(e,"row",this.m_rowHeaderLevelCount-1);let t=this.createIndex(e,-1);o=this.getElementsInRange(this.createRange(t,t)),o.push(m),l=this.getElementWidth(this.m_resizingElement),r=this.calculateRowHeaderHeight(this.m_resizingElement),a=l,h=this._calculateResizeFitToContentValue(o,"row"),d=h,u=r!==h,this.resizeRowHeight(r,h)}u&&this._fireResizeEvent(e,l,r,a,h,d),this._unhighlightResizeBorderColor()},z.prototype._calculateResizeFitToContentValue=function(e,t){let i,s="height";"column"===t&&(s="width");let n=this._getMinValue(s,t,!1),o=document.createElement("div");if("width"===s){o.style.display="inline-flex",o.style.flexFlow="column nowrap",o.style.justifyContent="flex-start",o.style.alignItems="stretch";for(let t=0;t<e.length;t++){let i=e[t].cloneNode(!0);i.classList.remove(...i.classList),i.style[s]="",i.style.whiteSpace="nowrap !important",i.style.overflow="hidden",o.appendChild(i)}}else if("height"===s){o.style.display="flex";for(let t=0;t<e.length;t++){let i=e[t].cloneNode(!0);i.style[s]="",i.style.whiteSpace="break-spaces",o.appendChild(i)}}o.style.visibility="hidden",o.style.top="0px",this.m_root.appendChild(o);let l="column"===t?this.m_databody.offsetWidth:this.m_databody.offsetHeight,r="column"===t?this._getCellPaddingBorder(s,this.m_resizingElement):0;return i=("column"===t?Math.ceil(o.firstElementChild.getBoundingClientRect().width):Math.ceil(o.firstElementChild.getBoundingClientRect().height))+r,i=i<n?n:i,i=i>l?l:i,this.m_root.removeChild(o),i},z.prototype.getHeaderEdgePixels=function(e){var t,i,s=0,n=0;if(this.m_utils.isTouchDevice()){var o=this.findPos(e);s=o[0],n=o[1]}return this.m_utils.containsCSSClassName(e,this.getMappedStyle("colheadercell"))?(t=this.calculateColumnHeaderWidth(e),i=this.getElementHeight(e)):(t=this.getElementWidth(e),i=this.calculateRowHeaderHeight(e)),[s,n,s+t,n+i]},z.prototype.getHeaderLabelEdgePixels=function(e){var t,i,s=this.findPos(e),n=s[0],o=s[1];return this.m_utils.containsCSSClassName(e,this.getMappedStyle("columnheaderlabel"))?(t=this.calculateColumnHeaderWidth(e),i=this.getElementHeight(e)):(t=this.getElementWidth(e),i=this.calculateRowHeaderLabelHeight(e)),[n,o,n+t,o+i]},z.prototype.unhighlightSelection=function(){for(var e=this.GetSelection(),t=0;t<e.length;t+=1)this.unhighlightRange(e[t]);this.getResources()&&this._clearHeaderHighLight()},z.prototype.unhighlightRange=function(e){var t=this.getElementsInRange(e);this.unhighlightElems(t),this._applyBorderClassesAroundRange(t,e,!1,"Selected")},z.prototype.highlightRange=function(e,t){const i=this.getHeadersByRange(e,"row"),s=this.getHeadersByRange(e,"column");this._highlightHeaders(e,i,s);var n,o=this.getElementsInRange(e);(this.highlightElems(o,e),this._applyBorderClassesAroundRange(o,e,!0,"Selected"),t)&&(n=1===this.GetSelection().length?o.length:this._getCurrentSelectionCellCount(),this._setAccInfoText("accessibleMultiCellSelected",{num:n}))},z.prototype.getHeadersByRange=function(e,t){const i=new Set;let s,n,o,l;if("row"===t&&this.m_rowHeaderLevelCount>0){for(e.endIndex&&e.endIndex.row&&(l=e.endIndex.row),l?-1===l&&(l=this.m_endRowHeader):l=e.startIndex.row,n=Math.max(this.m_startRowHeader,e.startIndex.row);n<=l;n++)for(s=this._getHeaderCellsByIndex(n,t),o=0;o<s.length;o++)i.add(s[o])}else if("column"===t&&this.m_columnHeaderLevelCount>0){for(e.endIndex&&e.endIndex.column&&(l=e.endIndex.column),l?-1===l&&(l=this.m_endColHeader):l=e.startIndex.column,n=Math.max(this.m_startColHeader,e.startIndex.column);n<=l;n++)for(s=this._getHeaderCellsByIndex(n,t),o=0;o<s.length;o++)i.add(s[o])}if("row"===t&&this.m_rowEndHeaderLevelCount>0){for(e.endIndex&&e.endIndex.row&&(l=e.endIndex.row),l?-1===l&&(l=this.m_endRowHeader):l=e.startIndex.row,n=Math.max(this.m_startRowEndHeader,e.startIndex.row);n<=l;n++)for(s=this._getHeaderCellsByIndex(n,"rowEnd"),o=0;o<s.length;o++)i.add(s[o])}else if("column"===t&&this.m_columnEndHeaderLevelCount>0){for(e.endIndex&&e.endIndex.column&&(l=e.endIndex.column),l?-1===l&&(l=this.m_endColHeader):l=e.startIndex.column,n=Math.max(this.m_startColEndHeader,e.startIndex.column);n<=l;n++)for(s=this._getHeaderCellsByIndex(n,"columnEnd"),o=0;o<s.length;o++)i.add(s[o])}return i},z.prototype._highlightHeaders=function(e,t,i){t.forEach(t=>{const i=t[this.getResources().getMappedAttribute("context")];null==e.endIndex.column||-1===e.endIndex.row&&-1===e.endIndex.column||-1===e.endIndex.column&&0===e.startIndex.column&&this._isHeaderSelected(i,"row")?(t.classList.remove(this.getMappedStyle("headerPartialSelected")),t.classList.add(this.getMappedStyle("headerAllSelected"))):(t.classList.remove(this.getMappedStyle("headerAllSelected")),t.classList.add(this.getMappedStyle("headerPartialSelected")))}),i.forEach(t=>{const i=t[this.getResources().getMappedAttribute("context")];-1===e.endIndex.row&&-1===e.endIndex.column||-1===e.endIndex.row&&0===e.startIndex.row&&this._isHeaderSelected(i,"column")?(t.classList.remove(this.getMappedStyle("headerPartialSelected")),t.classList.add(this.getMappedStyle("headerAllSelected"))):(t.classList.remove(this.getMappedStyle("headerAllSelected")),t.classList.add(this.getMappedStyle("headerPartialSelected")))})},z.prototype._isHeaderSelected=function(e,t){let i=!1;return this.GetSelection().forEach(s=>{e.index>=s.startIndex[t]&&e.index+(e.extent-1)<=s.endIndex[t]&&(i=!0)}),i},z.prototype._clearHeaderHighLight=function(){const e=this.getMappedStyle("headerAllSelected"),t=this.getMappedStyle("headerPartialSelected"),i=this.getMappedStyle("headercell"),s=this.getMappedStyle("endheadercell"),n=this.m_root.querySelectorAll("."+e+"."+i+",."+e+"."+s+",."+t+"."+i+",."+t+"."+s);for(let i=0;i<n.length;i++)n[i].classList.remove(e,t,this.getMappedStyle("draggableItem"))},z.prototype._getCurrentSelectionCellCount=function(){for(var e=0,t=this.GetSelection(),i=0;i<t.length;i++){var s=this.getElementsInRange(t[i]);null!=s&&(e+=s.length)}return e},z.prototype.unhighlightElems=function(e){if(null!=e&&0!==e.length)for(let t=0;t<e.length;t+=1){let i=e[t],s=["selected","topSelected","bottomSelected","startSelected","endSelected"];this._unhighlightElement(i,s)}},z.prototype.highlightElems=function(e){if(null!=e&&0!==e.length)for(let t=0;t<e.length;t+=1)this._highlightElement(e[t],["selected"])},z.prototype.applySelection=function(e,t,i,s){for(var n=this.GetSelection(),o=0;o<n.length;o+=1){var l=this.getElementsInRange(n[o],e,t,i,s);if(this.highlightElems(l),this._applyBorderClassesAroundRange(l,n[o],!0,"Selected"),this.m_dragIndex&&l&&l.length)for(let e=0;e<l.length;e++)this._highlightElement(l[e],["dragSourceOpaque"])}},z.prototype.handleDatabodySelectionDrag=function(e){var t,i;if(this.m_utils.isTouchDevice()?t=this.findCell(document.elementFromPoint(e.touches[0].clientX,e.touches[0].clientY)):(i=e.target,t=this.findCell(i)),null!=t){var s=this.getCellIndexes(t);this.m_deselectInProgress?this.extendDeselection(s,e):this.isHeaderSelectionType(this.m_selectionFrontier)?this.extendSelectionHeader(t,e):this.extendSelection(s,e)}},z.prototype.handleHeaderClickSelection=function(e){var t,i,s,n,o=e.target,l=this.findHeader(o),r=e.shiftKey,a=this.isMultipleSelection(),h=this.m_utils.ctrlEquivalent(e);if(r&&a||!l||this._setActive(l,this._createActiveObject(l),e),null==this.m_active||"header"!==this.m_active.type&&!e.shiftKey)return!1;var d=l[this.getResources().getMappedAttribute("context")];if(t=d.axis,i=d.index,n=d.extent,h&&this._shouldDeselectHeader(i,n,t)){var m,c,u,_;-1!==t.indexOf("row")?(m=this.createIndex(i,0),c=this.createIndex(i+n-1,-1),_=this._getSelectionStartAndEnd(m,c,0),u=this.createRange(this.createIndex(_.min.row,0),this.createIndex(_.max.row,-1))):(m=this.createIndex(0,i),c=this.createIndex(-1,i+n-1),_=this._getSelectionStartAndEnd(m,c,0),u=this.createRange(this.createIndex(0,_.min.column),this.createIndex(-1,_.max.column)));var p=this._trimRangeForSelectionMode(u);return this.m_deselectInfo={anchor:p.startIndex,selection:this.GetSelection(),axis:-1!==t.indexOf("row")?"row":"column",sourceParent:l},void(this.m_deselectInProgress=this._deselectRange(p,e))}"header"===this.m_active.type&&(t=this.m_active.axis,i=this.m_active.index,s=this.m_active.level),this.m_utils.isTouchDevice()?(this._removeTouchSelectionAffordance(),this._selectHeader(t,i,s,e)):r&&a?(null==t&&(t=d.axis),(-1!==t.indexOf("row")&&-1!==d.axis.indexOf("row")||-1!==t.indexOf("column")&&-1!==d.axis.indexOf("column"))&&this.extendSelectionHeader(l,e)):2!==e.button&&this._selectHeader(t,i,s,e)},z.prototype.discontiguousHeaderSetActiveFromDatabody=function(e,t,i,s){var n=t.replace("End",""),o=this.m_selection[this.m_selection.length-1];this.unhighlightSelection(),o.startIndex.row===this.m_active.indexes.row&&o.endIndex.row===this.m_active.indexes.row&&o.startIndex.column===this.m_active.indexes.column&&o.endIndex.column===this.m_active.indexes.column&&this.m_selection.pop(),this._setActive(i,{type:"header",index:this.m_trueIndex[n],level:s-1,axis:t},e,!1),this.rehighlightSelection()},z.prototype.handleDragAnchorChange=function(e){if(this.m_headerDragState){var t,i,s=e.target,n=this.findHeader(s),o=n[this.getResources().getMappedAttribute("context")],l=this._getActiveElement(),r=l[this.getResources().getMappedAttribute("context")],a=this._getAttribute(l.parentNode,"start",!0),h=a+(this._getAttribute(l.parentNode,"extent",!0)-1);if(!o.extent)return;1===o.extent?(t=o.index,i=o.index):i=(t=this._getAttribute(n.parentNode,"start",!0))+(this._getAttribute(n.parentNode,"extent",!0)-1),1!==r.extent?(t<=a&&i>=h||t>=a&&i<=h)&&this._setActive(n,this._createActiveObject(n),e):t!==i&&t<=a&&a<=i&&this._setActive(n,this._createActiveObject(n),e)}},z.prototype.handleDatabodyClickSelection=function(e){var t,i=e.target,s=this.findCell(i);if(null!=s&&(t=this.getCellIndexes(s)),null!=t){if(this.isMultipleSelection()&&2===e.button&&this._isContainSelection(t))return;var n=this.m_utils.ctrlEquivalent(e),o=e.shiftKey;if(this.m_utils.containsCSSClassName(s,this.getMappedStyle("selected"))&&n){this.m_deselectInfo={anchor:t,selection:this.GetSelection()};var l=this.getCellEndIndexes(s),r=this._trimRangeForSelectionMode(this.createRange(t,l));return void(this.m_deselectInProgress=this._deselectRange(r,e))}this.isMultipleSelection()?(this._removeTouchSelectionAffordance(),this.m_utils.isTouchDevice()?(null!=this.m_active&&this._unhighlightActive(),this.selectAndFocus(t,e,!1)):n?n&&o?this.extendSelection(t,e):this.selectAndFocus(t,e,!0):o?this.extendSelection(t,e):this.selectAndFocus(t,e,!1)):this.selectAndFocus(t,e,!1)}},z.prototype._doRangesOverlap=function(e,t){var i=e.startIndex,s=i.column,n=i.row,o=e.endIndex,l=o.column,r=o.row,a=t.startIndex,h=a.column,d=a.row,m=t.endIndex,c=m.column,u=m.row;return(s<=c||-1===c||void 0===c)&&(l>=h||-1===l||void 0===l)&&(n<=u||-1===u)&&(r>=d||-1===r)},z.prototype._isRangeValid=function(e){return(e.startIndex.row<=e.endIndex.row||e.startIndex.row>=0&&-1===e.endIndex.row)&&(e.startIndex.column<=e.endIndex.column||e.startIndex.column>=0&&-1===e.endIndex.column||void 0===e.startIndex.column&&void 0===e.endIndex.column)},z.prototype._deselectRange=function(e,t){var i=this.m_deselectInfo.selection,s=e.startIndex,n=s.column,o=s.row,l=e.endIndex,r=l.column,a=l.row,h=!1,d=[],m=0,c=[],u=this;return i.forEach(function(t){var i=t.startIndex,s=i.column,l=i.row,_=t.endIndex,p=_.column,g=_.row;if(this._doRangesOverlap(t,e)){var C,f,y=function(e,t,i){return new Promise(function(s){u._createRangeWithKeys(e,t,function(e){d[i]=e,s()})})};h=!0,l<o&&(C=this.createIndex(l,s),f=this.createIndex(o-1,p),this._isRangeValid({startIndex:C,endIndex:f})&&(c.push(y(C,f,m)),m+=1)),-1!==a&&(C=this.createIndex(a+1,s),f=this.createIndex(g,p),this._isRangeValid({startIndex:C,endIndex:f})&&(c.push(y(C,f,m)),m+=1)),s<n&&void 0!==s&&(C=this.createIndex(Math.max(o,l),s),f=this.createIndex(Math.min(-1===a?g:a,-1===g?a:g),n-1),this._isRangeValid({startIndex:C,endIndex:f})&&(c.push(y(C,f,m)),m+=1)),-1!==r&&void 0!==s&&(C=this.createIndex(Math.max(o,l),r+1),f=this.createIndex(Math.min(-1===a?g:a,-1===g?a:g),p),this._isRangeValid({startIndex:C,endIndex:f})&&(c.push(y(C,f,m)),m+=1))}else d[m]=t,m+=1},this),!!h&&(Promise.all(c).then(function(){var e=u.m_selection;u.SetSelection(d),u._compareSelectionAndFire(t,e)}),!0)},z.prototype._shouldDeselectHeader=function(e,t,i){var s,n,o=this.GetSelection();"row"===i||"rowEnd"===i?(s="row",n="column"):(s="column",n="row");var l=!1,r=this.m_options.getSelectionMode();return o.forEach(function(i){var o=i.startIndex[n],a=i.endIndex[n];if(0===o&&-1===a||"row"===r&&"row"===s){var h=i.startIndex[s],d=i.endIndex[s];h<=e&&(d>=e+t-1||-1===d)&&(l=!0)}}),l},z.prototype._handleSelectAll=function(e){return!(!this._isSelectionEnabled()||!this.isMultipleSelection())&&("row"===this.m_options.getSelectionMode()?this._selectRange(this.createIndex(0),this.createIndex(-1),e):this._selectRange(this.createIndex(0,0),this.createIndex(-1,-1),e),this.m_utils.isTouchDevice()&&this.m_topSelectIconContainer&&this.m_bottomSelectIconContainer&&(this.m_topSelectIconContainer.parentNode.removeChild(this.m_topSelectIconContainer),this.m_bottomSelectIconContainer.parentNode.removeChild(this.m_bottomSelectIconContainer)),!0)},z.prototype._isContainSelection=function(e,t){null==t&&(t=this.GetSelection());for(var i=0;i<t.length;i+=1){var s=t[i],n=s.startIndex,o=this.getEndIndex(s),l=n.row,r=o.row;if(e.row>=l&&(-1===r||e.row<=r)){var a=n.column,h=o.column;if(isNaN(a)||isNaN(h))return!0;if(e.column>=a&&(-1===h||e.column<=h))return!0}}return!1},z.prototype._isHeaderInsideSelection=function(e,t){const i=this.GetSelection();for(let s=0;s<i.length;s+=1){let n=i[s],o=n.startIndex,l=this.getEndIndex(n),r=o.row,a=l.row,h=o.column,d=l.column;if("column"===t||"columnEnd"===t){if(e>=h&&(-1===d||e<=d)&&0===r&&-1===a)return!0}else if(("row"===t||"rowEnd"===t)&&e>=r&&(-1===a||e<=a)&&0===h&&-1===d)return!0}return!1},z.prototype._getContainedSelectionCssClass=function(e,t){var i=[],s={contains:!1,class:[]};null==t&&(t=this.GetSelection());for(var n=0;n<t.length;n+=1){var o=t[n],l=o.startIndex,r=this.getEndIndex(o),a=l.row,h=r.row,d=l.column,m=r.column;e.row>=a&&(-1===h||e.row<=h)&&(e.column>=d&&(-1===m||e.column<=m)||isNaN(d)||isNaN(m))&&(e.row===a&&i.push("topSelected"),e.row===h&&i.push("bottomSelected"),(isNaN(d)||isNaN(m))&&(s.contains=!0,s.class=i),e.column>=d&&(-1===m||e.column<=m)&&(e.column===d&&i.push("startSelected"),e.column===m&&i.push("endSelected"),s.contains=!0,s.class=i))}return s},z.prototype._compareSelections=function(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i+=1){for(var s=!1,n=0;n<t.length;n+=1)this._compareIndividualSelectionObjects(e[i],t[n])&&(s=!0);if(!1===s)return!1}return!0},z.prototype._compareIndividualSelectionObjects=function(e,t){return e.startIndex.row===t.startIndex.row&&e.startIndex.column===t.startIndex.column&&e.endIndex.row===t.endIndex.row&&e.endIndex.column===t.endIndex.column},z.prototype._clearSelection=function(e){this.unhighlightSelection(),this._removeTouchSelectionAffordance();var t=this.GetSelection();this.m_selection=[],this._compareSelectionAndFire(e,t)},z.prototype.setDiscontiguousSelectionMode=function(e){this.m_discontiguousSelection=e,this._setAccInfoText(e?"accessibleRangeSelectModeOn":"accessibleRangeSelectModeOff")},z.prototype._selectEntireRow=function(e,t,i){var s=this.createIndex(e,0),n=this.createIndex(t,-1),o=this._getSelectionStartAndEnd(s,n,0);"row"===this.m_options.getSelectionMode()?this._selectRange(this.createIndex(o.min.row),this.createIndex(o.max.row),i):this._selectRange(this.createIndex(o.min.row,0),this.createIndex(o.max.row,-1),i)},z.prototype._selectEntireColumn=function(e,t,i){var s=this.createIndex(0,e),n=this.createIndex(-1,t),o=this._getSelectionStartAndEnd(s,n,0);this._selectRange(this.createIndex(0,o.min.column),this.createIndex(-1,o.max.column),i)},z.prototype._selectRange=function(e,t,i){this.unhighlightSelection(),this._createRangeWithKeys(e,t,this._selectRangeCallback.bind(this,i))},z.prototype._selectRangeCallback=function(e,t){var i,s=this.GetSelection();(i=this.m_discontiguousSelection||!e||this.m_utils.ctrlEquivalent(e)&&this.isMultipleSelection()&&0===e.button?this.m_utils.ctrlEquivalent(e)&&this.isMultipleSelection()&&!0===e.shiftKey?s.slice(0,s.length-1):s.slice(0):[]).push(t),this.m_selection=i,this.rehighlightSelection(),this._isDatabodyCellActive()&&e.target[this.getResources().getMappedAttribute("context")]&&!e.target[this.getResources().getMappedAttribute("context")].axis&&!this.m_selectionFrontier.axis&&(this.m_selectionFrontier=this.m_active.indexes,this._highlightActive()),this._compareSelectionAndFire(e,s)},z.prototype.rehighlightSelection=function(){for(var e=0;e<this.m_selection.length;e++)this.highlightRange(this.m_selection[e])},z.prototype.GetSelection=function(){return null==this.m_selection&&(this.m_selection=[]),this.m_selection},z.prototype.SetSelection=function(e){void 0!==e&&(null===e&&(e=[]),this.unhighlightSelection(),this.m_selection=e,this._resetHeaderHighLight(),null!=this.m_databody&&this.applySelection(this.m_startRow,this.m_endRow,this.m_startCol,this.m_endCol),this.m_bottomFloodFillIconContainer&&(1===this.m_selection.length?this._moveFloodFillAffordance():this._removeFloodFillAffordance()))},z.prototype.fireSelectionEvent=function(e,t){var i={event:e,ui:{selection:this.GetSelection(),previousSelection:t}};this.fireEvent("select",i)},z.prototype.extendSelection=function(e,t,i){if("header"!==this.m_active.type){var s;if(this.m_utils.isTouchDevice())s=this.m_touchSelectAnchor;else s={row:this.m_active.indexes.row,column:this.m_active.indexes.column};if(null!=s){this._resetSelectionFrontierFocus();var n=this._updateSelectionFrontier(s,e,i),o=n.min,l=n.max;if("row"===this.m_options.getSelectionMode()&&(o=this.createIndex(o.row),l=this.createIndex(l.row)),this.m_discontiguousSelection&&(this.m_deselectInProgress||this._isContainSelection(s,this.GetSelection().slice(0,-1)))){this.m_deselectInProgress||(this.m_deselectInfo={anchor:s,selection:this.GetSelection()});var r=this._trimRangeForSelectionMode(this.createRange(o,l));this.m_deselectInProgress=this._deselectRange(r,t)}else this._createRangeWithKeys(o,l,this._extendSelectionCallback.bind(this,t,s))}}},z.prototype.extendDeselection=function(e,t){var i=this.m_deselectInfo.anchor,s=this._updateSelectionFrontier(i,e),n=s.min,o=s.max,l=this._trimRangeForSelectionMode(this.createRange(n,o));this._deselectRange(l,t)},z.prototype.extendSelectionHeader=function(e,t,i,s){if(null!==e){var n=this.findCellOrHeader(e);if(null!==n){var o,l,r,a,h,d=n[this.getResources().getMappedAttribute("context")];if(null==i&&(i=this.m_discontiguousSelection),d){if(d.cell)a=r=-1!==this.m_selectionFrontier.axis.indexOf("column")?d.indexes.column:d.indexes.row,h=r;else{if(this.m_selectionFrontier&&d.index===this.m_selectionFrontier.index&&d.level===this.m_selectionFrontier.level)return;1===d.extent?(r=d.index,a=d.index,h=d.index):a=(r=this._getAttribute(e.parentNode,"start",!0))+(this._getAttribute(e.parentNode,"extent",!0)-1)}var m=s?this.m_deselectInfo.sourceParent:this._getActiveElement();if(m){var c,u,_,p=m[this.getResources().getMappedAttribute("context")];if(s?(l=this.m_deselectInfo.axis,o=this.m_deselectInfo.anchor[l],u=(c=this._getAttribute(m.parentNode,"start",!0))+(this._getAttribute(m.parentNode,"extent",!0)-1)):this.m_utils.isTouchDevice()?(-1===(o=-1!==this.m_selectionFrontier.axis.indexOf("column")?this.m_touchSelectAnchor.column:this.m_touchSelectAnchor.row)&&(o=0),c=o,u=o,l=this.m_selectionFrontier.axis):(u=(c=this._getAttribute(m.parentNode,"start",!0))+(this._getAttribute(m.parentNode,"extent",!0)-1),"header"===this.m_active.type&&(l=this.m_active.axis,o=this.m_active.index)),"cell"===this.m_active.type?(_=1,o=-1!==(l=d.axis).indexOf("row")?this.m_active.indexes.row:this.m_active.indexes.column):_=p.extent,i&&!s){var g=this.m_selection[this.m_selection.length-1];this.unhighlightSelection(),g&&this.checkCorners(l,o,g)&&this.m_selection.pop()}if(1!==_?r<=c&&a>=u||r>=c&&a<=u?(this.m_headerDragState||this._setActive(n,this._createActiveObject(n),t),o=r,h=a):r>c&&a>u?(o=c,h=a):r<c&&a<u&&(o=r,h=u):1===_&&r!==a&&(r<=o&&o<=a?(this.m_headerDragState||"cell"===this.m_active.type||this._setActive(n,this._createActiveObject(n),t),o=r,h=a):r<=o&&a<=o?(h=o,o=r):r>=o&&a>=o&&(h=a)),d.cell?this.setHeaderSelectionFrontier(l,h,h,this.m_selectionFrontier.level,n,!0):this.setHeaderSelectionFrontier(l,h,d.index,d.level,n,!0),!s&&l)-1!==l.indexOf("column")?this._selectEntireColumn(o,h,t):-1!==l.indexOf("row")&&this._selectEntireRow(o,h,t);else{var C,f=Math.min(o,h),y=Math.max(o,h);C=null!=l&&-1!==l.indexOf("row")?this.createRange(this.createIndex(f,0),this.createIndex(y,-1)):this.createRange(this.createIndex(0,f),this.createIndex(-1,y));var E=this._trimRangeForSelectionMode(C);this._deselectRange(E,t)}}}}}},z.prototype._updateSelectionFrontier=function(e,t,i){var s,n,o;if("row"===this.m_options.getSelectionMode()?(s=this.createIndex(e.row,this.m_startCol),n=this.createIndex(t.row,this.m_endCol)):(s=e,n=t),null!=i){if(this.m_deselectInProgress)o=this.createRange(this.m_deselectInfo.anchor,this.m_selectionFrontier);else{var l=this.GetSelection();o=l[this._getLastAnchoredSelectionIndex(l,s)]}var r=o.startIndex,a=o.endIndex;r.row===this.m_selectionFrontier.row&&s.row!==r.row?s.row=a.row:a.row===this.m_selectionFrontier.row&&s.row!==a.row&&(s.row=r.row),r.column===this.m_selectionFrontier.column&&s.column!==r.column?s.column=a.column:a.column===this.m_selectionFrontier.column&&s.column!==a.column&&(s.column=r.column)}var h=this._getSelectionStartAndEnd(s,n,0),d=n;if(null!=i){var m=h.min,c=h.max;for("row"===this.m_options.getSelectionMode()&&(m=this.createIndex(m.row),c=this.createIndex(c.row));this._compareIndividualSelectionObjects(o,this.createRange(m,c));){if(i===this.keyCodes.LEFT_KEY){if(0===n.column)break;n.column-=1}else if(i===this.keyCodes.RIGHT_KEY){if(n.column===this.m_endCol)break;n.column+=1}else if(i===this.keyCodes.UP_KEY){if(0===n.row)break;n.row-=1}else{if(i!==this.keyCodes.DOWN_KEY)break;if(n.row===this.m_endRow)break;n.row+=1}m=(h=this._getSelectionStartAndEnd(s,n,0)).min,c=h.max,"row"===this.m_options.getSelectionMode()&&(m=this.createIndex(m.row),c=this.createIndex(c.row))}i===this.keyCodes.LEFT_KEY?(d.column=m.column<s.column?m.column:c.column,d.row=m.row<s.row?m.row:c.row):i===this.keyCodes.RIGHT_KEY?(d.column=c.column>s.column?c.column:m.column,d.row=m.row<s.row?m.row:c.row):i===this.keyCodes.UP_KEY?(d.row=m.row<s.row?m.row:c.row,d.column=m.column<s.column?m.column:c.column):i===this.keyCodes.DOWN_KEY&&(d.row=c.row>s.row?c.row:m.row,d.column=m.column<s.column?m.column:c.column)}else d=this.getCellIndexes(this._getCellByIndex(d));return"row"===this.m_options.getSelectionMode()&&(d=this.createIndex(d.row,this.m_active.indexes.column)),this.m_selectionFrontier=d,h},z.prototype._getMinOrMax=function(e,t,i){return isNaN(e)?isNaN(t)?null:t:isNaN(t)?e:i(e,t)},z.prototype._getSelectionStartAndEnd=function(e,t,i){var s=this.getElementsInRange(this.createRange(e,t));if(null==s||s.length===i)return{min:e,max:t};for(var n={row:this._getMinOrMax(e.row,t.row,Math.min),column:this._getMinOrMax(e.column,t.column,Math.min)},o={row:this._getMinOrMax(e.row,t.row,Math.max),column:this._getMinOrMax(e.column,t.column,Math.max)},l=0;l<s.length;l++){var r=this.getCellIndexes(s[l]),a=this.getCellEndIndexes(s[l]);(r.row<n.row||null==n.row)&&(n.row=r.row),(r.column<n.column||null==n.column)&&(n.column=r.column),(a.row>o.row||null==o.row)&&(o.row=a.row),(a.column>o.column||null==o.column)&&(o.column=a.column)}return this._getSelectionStartAndEnd(n,o,s.length)},z.prototype._getLastAnchoredSelectionIndex=function(e,t){var i;for(i=e.length-1;i>-1;i--)if(this._isContainSelection(t,[e[i]]))return i;return i-1},z.prototype._extendSelectionCallback=function(e,t,i){var s=this.GetSelection(),n=this._getLastAnchoredSelectionIndex(s,t),o=s[n];if(null!=o){var l=o.startIndex.row===i.startIndex.row;null!=o.startIndex.column&&null!=i.startIndex.column&&(l=l&&o.startIndex.column===i.startIndex.column);var r=o.endIndex.row===i.endIndex.row;if(null!=o.endIndex.column&&null!=i.endIndex.column&&(r=r&&o.endIndex.column===i.endIndex.column),!l||!r){var a;if(this.m_discontiguousSelection||e&&this.m_utils.ctrlEquivalent(e)&&0===e.button?(a=s.slice(0),this.unhighlightRange(o),a.splice(n,1)):(a=[],this.unhighlightSelection()),a.push(i),this.m_selection=a,this.m_discontiguousSelection||e&&this.m_utils.ctrlEquivalent(e)&&0===e.button)for(var h=0;h<this.m_selection.length;h++)this.highlightRange(this.m_selection[h]);else this.highlightRange(i,!0);this._makeSelectionFrontierFocus(),this._compareSelectionAndFire(e,s)}}},z.prototype._resetSelectionFrontierFocus=function(){if(!(null==this.m_selectionFrontier||this._isDatabodyCellActive()&&this.m_selectionFrontier.row===this.m_active.indexes.row&&this.m_selectionFrontier.column===this.m_active.indexes.column)){var e=this.createRange(this.m_selectionFrontier),t=this.getElementsInRange(e);null!=t&&t.length>0&&this._unsetAriaProperties(t[0])}},z.prototype._makeSelectionFrontierFocus=function(){if(!(null==this.m_selectionFrontier||this._isDatabodyCellActive()&&this.m_selectionFrontier.row===this.m_active.indexes.row&&this.m_selectionFrontier.column===this.m_active.indexes.column)){if(this._isDatabodyCellActive()){var e=this.createRange(this.m_active.indexes),t=this.getElementsInRange(e);null!=t&&t.length>0&&this._unsetAriaProperties(t[0])}var i=this.createRange(this.m_selectionFrontier),s=this.getElementsInRange(i);if(null!=s&&0!==s.length){this._updateContextInfo(this.m_selectionFrontier);var n=this.m_utils.containsCSSClassName(s[0],this.getMappedStyle("row"))?s[0].firstChild:s[0];this._setAriaProperties(this._createActiveObject(n),null,n)}}},z.prototype._selectHeader=function(e,t,i,s){var n,o;if(-1!==e.indexOf("row")&&this.m_rowHeaderLevelCount-1===i||-1!==e.indexOf("column")&&this.m_columnHeaderLevelCount-1===i)n=t,o=t;else{var l=this._getActiveElement();o=(n=this._getAttribute(l.parentNode,"start",!0))+(this._getAttribute(l.parentNode,"extent",!0)-1)}-1!==e.indexOf("row")?((n===o&&!this.isMultipleSelection()||this.isMultipleSelection())&&(this.setHeaderSelectionFrontier(e,o,t,i,s.target,!0),this._selectEntireRow(n,o,s)),this._setAccInfoText("accessibleRowSelected",{row:t+1})):-1!==e.indexOf("column")&&(this.setHeaderSelectionFrontier(e,o,t,i,s.target,!0),this._selectEntireColumn(n,o,s),this._setAccInfoText("accessibleColumnSelected",{column:t+1})),this.isMultipleSelection()&&(this.m_headerDragState=!0)},z.prototype.setHeaderSelectionFrontier=function(e,t,i,s,n,o){o&&(this.m_selectionFrontier={}),this.m_selectionFrontier.axis=e,this.m_selectionFrontier.end=t,this.m_selectionFrontier.index=i,this.m_selectionFrontier.level=s,this.m_selectionFrontier.target=n},z.prototype._resetHeaderHighLight=function(){this.GetSelection().forEach(e=>{var t=this.getHeadersByRange(e,"row"),i=this.getHeadersByRange(e,"column");this._highlightHeaders(e,t,i)})},z.prototype.updateSelectionHeader=function(){this.m_selectionFrontier&&this.m_selectionFrontier.target&&(this.m_utils.isTouchDevice()&&this.m_selection.length&&(this.m_touchSelectAnchor=this.m_selection[this.m_selection.length-1].startIndex),this.extendSelectionHeader(this.m_selectionFrontier.target,null)),this._resetHeaderHighLight()},z.prototype.selectAndFocus=function(e,t,i){null==i&&(i=!1),this._resetSelectionFrontierFocus(),this._setActiveByIndex(e,t),"row"===this.m_options.getSelectionMode()&&(e=this.createIndex(e.row));var s=this._getSelectionStartAndEnd(e,e,0),n=s.min,o=s.max;"row"===this.m_options.getSelectionMode()&&(n=this.createIndex(n.row),o=this.createIndex(o.row)),this._createRangeWithKeys(n,o,this._selectAndFocusRangeCallback.bind(this,n,t,i))},z.prototype._selectAndFocusRangeCallback=function(e,t,i,s){var n=this.GetSelection(),o=n.slice(0);i||(this.m_discontiguousSelection||!t||this.isMultipleSelection()&&this.m_utils.ctrlEquivalent(t)&&0===t.button?!this._isDatabodyCellActive()||null==this.m_prevActive||"cell"!==this.m_prevActive.type||this.m_selectionFrontier.row!==this.m_prevActive.indexes.row||this.m_selectionFrontier.column!==this.m_prevActive.indexes.column||this.m_utils.isTouchDevice()||!t.keyCode&&this.isMultipleSelection()||(o.pop(),this._unhighlightDiscontiguousSelection(o)):(this.unhighlightSelection(),o=[])),this.m_selectionFrontier=e,o.push(s),this.m_selection=o,this.highlightRange(s),this._compareSelectionAndFire(t,n)},z.prototype._getSurrondingCellIndexes=function(e,t,i){let s={};return Object.assign(s,t),s[e]+=i,s},z.prototype._unhighlightDiscontiguousSelection=function(e){var t=this._getContainedSelectionCssClass(this.m_prevActive.indexes,e);let i=this._getSurrondingCellIndexes("row",this.m_prevActive.indexes,-1),s=this._getSurrondingCellIndexes("column",this.m_prevActive.indexes,-1),n=this._getSurrondingCellIndexes("row",this.m_prevActive.indexes,1),o=this._getSurrondingCellIndexes("column",this.m_prevActive.indexes,1),l=this._getContainedSelectionCssClass(s,e),r=this._getContainedSelectionCssClass(i,e),a=this._getContainedSelectionCssClass(o,e),h=this._getContainedSelectionCssClass(n,e);if(t.contains){let e=t.class,n=-1!==e.indexOf("topSelected"),o=-1!==e.indexOf("bottomSelected"),d=-1!==e.indexOf("startSelected"),m=-1!==e.indexOf("endSelected"),c=[];e.length?(n&&o?m&&d||(m&&this.unhighlightPreviousColumnCell(l,s),d&&this.getNextColumnCellSelectedClass(a,c),d||m||(this.getNextColumnCellSelectedClass(a,c),this.unhighlightPreviousColumnCell(l,s)),n||this.unhighlightPreviousRowCell(r,i),o||this.getNextRowCellSelectedClass(h,c)):(n&&this.getNextRowCellSelectedClass(h,c),o&&this.unhighlightPreviousRowCell(r,i),n||o||(this.getNextRowCellSelectedClass(h,c),this.unhighlightPreviousRowCell(r,i)),d||this.unhighlightPreviousColumnCell(l,s),m||this.getNextColumnCellSelectedClass(a,c)),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),c)):(this.getNextRowCellSelectedClass(h,c),m||this.getNextColumnCellSelectedClass(a,c),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),c),d||this.unhighlightPreviousColumnCell(l,s),this.unhighlightPreviousRowCell(r,i))}else{let e=["selected","topSelected","startSelected"];h.contains||e.push("bottomSelected"),a.contains||e.push("endSelected"),this._unhighlightElement(this._getCellByIndex(this.m_prevActive.indexes),e),r.contains||this._unhighlightElement(this._getCellByIndex(i),["bottomSelected"]),l.contains||this._unhighlightElement(this._getCellByIndex(s),["endSelected"])}},z.prototype.unhighlightPreviousRowCell=function(e,t){e.contains?-1===e.class.indexOf("bottomSelected")&&this._unhighlightElement(this._getCellByIndex(t),["bottomSelected"]):this._unhighlightElement(this._getCellByIndex(t),["bottomSelected"])},z.prototype.unhighlightPreviousColumnCell=function(e,t){e.contains?-1===e.class.indexOf("endSelected")&&this._unhighlightElement(this._getCellByIndex(t),["endSelected"]):this._unhighlightElement(this._getCellByIndex(t),["endSelected"])},z.prototype.getNextColumnCellSelectedClass=function(e,t){e.contains?-1===e.class.indexOf("startSelected")&&t.push("endSelected"):t.push("endSelected")},z.prototype.getNextRowCellSelectedClass=function(e,t){e.contains?-1===e.class.indexOf("topSelected")&&t.push("bottomSelected"):t.push("bottomSelected")},z.prototype._compareSelectionAndFire=function(e,t){var i=this.GetSelection();this.isMultipleSelection()&&i.length>0&&(this.m_utils.isTouchDevice()?(this._addTouchSelectionAffordance(e),this._moveTouchSelectionAffordance()):this.m_options.isFloodFillEnabled()&&this._isSelectionEnabled()&&!this.m_discontiguousSelection&&"cell"===this.m_active.type&&(this._addFloodfillAffordance(e),this._moveFloodFillAffordance())),this._compareSelections(i,t)||(this._resetHeaderHighLight(),this.fireSelectionEvent(e,t))},z.prototype._addTouchSelectionAffordance=function(e){if(null==this.m_topSelectIconContainer&&null==this.m_bottomSelectIconContainer){var t=e.target,i=this.findCell(t);if(i||(i=this.findHeader(t)),!i)return;this.m_topSelectIconContainer=document.createElement("div"),this.m_topSelectIconContainer.className=this.getMappedStyle("toucharea");var s=document.createElement("div");s.className=this.getMappedStyle("selectaffordance"),s.setAttribute("role","button"),s.setAttribute("aria-label",this.getResources().getTranslatedText("accessibleSelectionAffordanceTop")),this.m_topSelectIconContainer.appendChild(s),this.m_bottomSelectIconContainer=document.createElement("div"),this.m_bottomSelectIconContainer.className=this.getMappedStyle("toucharea");var n=document.createElement("div");n.className=this.getMappedStyle("selectaffordance"),n.setAttribute("role","button"),n.setAttribute("aria-label",this.getResources().getTranslatedText("accessibleSelectionAffordanceBottom")),this.m_bottomSelectIconContainer.appendChild(n),this.m_databody.firstChild.appendChild(this.m_topSelectIconContainer),this.m_databody.firstChild.appendChild(this.m_bottomSelectIconContainer),this.m_touchSelectionAffordanceHeight=this.m_topSelectIconContainer.firstElementChild.offsetHeight,this.m_touchSelectionAffordanceWidth=this.m_topSelectIconContainer.firstElementChild.offsetWidth}},z.prototype._addRoundedAffordanceClasses=function(e,t,i,s){if(e&&t)i||"row"!==s?i||"column"!==s?(e.classList.add(this.getMappedStyle("selectaffordancetopcornerbounded")),t.classList.add(this.getMappedStyle("selectaffordancebottomcornerbounded"))):(e.classList.add(this.getMappedStyle("selectaffordancetopcolumn")),t.classList.add(this.getMappedStyle("selectaffordancebottomcolumn"))):(e.classList.add(this.getMappedStyle("selectaffordancetoprow")),t.classList.add(this.getMappedStyle("selectaffordancebottomrow")));else if(t){let e;e=i||"row"!==s?i||"column"!==s?"selectaffordancebottomcornerbounded":"selectaffordancebottomcolumn":"selectaffordancebottomrow",t.classList.add(this.getMappedStyle(e))}},z.prototype._clearRoundedAffordanceClasses=function(e,t){e&&(e.classList.remove(this.getMappedStyle("selectaffordancetopcornerbounded")),e.classList.remove(this.getMappedStyle("selectaffordancetopcolumn")),e.classList.remove(this.getMappedStyle("selectaffordancetoprow"))),t.classList.remove(this.getMappedStyle("selectaffordancebottomcornerbounded")),t.classList.remove(this.getMappedStyle("selectaffordancebottomcolumn")),t.classList.remove(this.getMappedStyle("selectaffordancebottomrow"))},z.prototype._removeTouchSelectionAffordance=function(e){(this._isDatabodyCellActive()||e)&&this.m_topSelectIconContainer&&this.m_topSelectIconContainer.parentNode&&(this.m_topSelectIconContainer.parentNode.removeChild(this.m_topSelectIconContainer),this.m_bottomSelectIconContainer.parentNode.removeChild(this.m_bottomSelectIconContainer))},z.prototype._moveTouchSelectionAffordance=function(){var e,t,i=this.getResources().isRTLMode()?"right":"left",s=this.GetSelection();if(s.length>0){var n=this.m_options.getSelectionMode(),o=this._getTouchSelectionAffordanceSize();if(null!=this.m_topSelectIconContainer&&null!=this.m_bottomSelectIconContainer){var l=this.m_topSelectIconContainer.firstElementChild,r=this.m_bottomSelectIconContainer.firstElementChild;if(this._clearRoundedAffordanceClasses(l,r),"row"===n||-1!==s[s.length-1].endIndex.row&&-1===s[s.length-1].endIndex.column){this._addRoundedAffordanceClasses(l,r,!1,"row");const n=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft-o/2;let a;if(this.setElementDir(this.m_topSelectIconContainer,n,i),this.setElementDir(this.m_bottomSelectIconContainer,n,i),e=this._getAxisCellsByKey(s[s.length-1].startKey.row,"row"),(t=this._getAxisCellsByKey(s[s.length-1].endKey.row,"row"))&&t.length&&(a=t[0]),!a){let e=this.createIndex(-1,0),t=this.getElementsInRange(this.createRange(e,e));a=t[t.length-1]}this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(e[0],"top")-this.m_touchSelectionAffordanceHeight-1,"top"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(a,"top")+this.getElementHeight(a)-o+this.m_touchSelectionAffordanceHeight,"top")}else if(-1!==s[s.length-1].endIndex.column&&-1===s[s.length-1].endIndex.row){this._addRoundedAffordanceClasses(l,r,!1,"column"),e=this._getAxisCellsByKey(s[s.length-1].startKey.column,"column"),t=this._getAxisCellsByKey(s[s.length-1].endKey.column,"column");var a=this.getElementHeight(this.m_databody)/2+this.m_currentScrollTop-o/2;this.setElementDir(this.m_topSelectIconContainer,a,"top"),this.setElementDir(this.m_bottomSelectIconContainer,a,"top"),this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(e[0],"left")-this.m_touchSelectionAffordanceWidth-2,"left"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(t[0],"left")+this.getElementWidth(t[0])-(o-this.m_touchSelectionAffordanceWidth-1),"left")}else{this._addRoundedAffordanceClasses(l,r,!0);var h=this._getCellByIndex(s[s.length-1].startIndex),d=this._getCellByIndex(s[s.length-1].endIndex);if(!d){let e=this.createIndex(-1,-1),t=this.getElementsInRange(this.createRange(e,e));d=t[t.length-1]}this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(h,"top")-this.m_touchSelectionAffordanceHeight-1,"top"),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(d,"top")+this.getElementHeight(d)-o+this.m_touchSelectionAffordanceWidth,"top"),this.setElementDir(this.m_topSelectIconContainer,this.getElementDir(h,i)-this.m_touchSelectionAffordanceWidth-2,i),this.setElementDir(this.m_bottomSelectIconContainer,this.getElementDir(d,i)+this.getElementWidth(d)-(o-this.m_touchSelectionAffordanceWidth),i)}null==this.m_topSelectIconContainer.parentNode&&(this.m_databody.firstChild.appendChild(this.m_topSelectIconContainer),this.m_databody.firstChild.appendChild(this.m_bottomSelectIconContainer))}}},z.prototype._scrollTouchSelectionAffordance=function(){var e,t,i=this.m_options.getSelectionMode();if("row"===i)null!=this.m_topSelectIconContainer&&(t=this.getResources().isRTLMode()?"right":"left",e=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft,this.setElementDir(this.m_topSelectIconContainer,e,t),this.setElementDir(this.m_bottomSelectIconContainer,e,t));else if("cell"===i&&this.isHeaderSelectionType(this.m_selectionFrontier)&&null!=this.m_topSelectIconContainer)if(-1!==this.m_selectionFrontier.axis.indexOf("row"))t=this.getResources().isRTLMode()?"right":"left",e=this.getElementWidth(this.m_databody)/2+this.m_currentScrollLeft,this.setElementDir(this.m_topSelectIconContainer,e,t),this.setElementDir(this.m_bottomSelectIconContainer,e,t);else{var s=this.getElementHeight(this.m_databody)/2+this.m_currentScrollTop;this.setElementDir(this.m_topSelectIconContainer,s,"top"),this.setElementDir(this.m_bottomSelectIconContainer,s,"top")}},z.prototype._getTouchSelectionAffordanceSize=function(){if(null==this.m_touchSelectionAffordanceSize){var e=document.createElement("div");e.className=this.getMappedStyle("toucharea"),e.style.visibilty="hidden",e.style.top="0px",e.style.visibilty="0px",this.m_root.appendChild(e);var t=e.offsetWidth;this.m_root.removeChild(e),this.m_touchSelectionAffordanceSize=t}return this.m_touchSelectionAffordanceSize},z.SORT_ANIMATION_DURATION=800,z.prototype._handleSortContainerMouseOver=function(e){var t=e.target,i=this.findHeader(t),s=this._getSortIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("sortIcon"))&&(this.m_utils.addCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("disabled")))},z.prototype._handleSortMouseOut=function(e){if(!this._databodyEmpty()){var t,i=e.target,s=e.relatedTarget,n=this.findHeader(i);null!=n&&null!=s&&n===this.findHeader(s)||this._displaySortIcon(n),(t=this._getSortIcon(n))&&(this.m_utils.removeCSSClassName(t,this.getMappedStyle("hover")),this.m_utils.containsCSSClassName(t,this.getMappedStyle("selected"))||(this.m_utils.addCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("enabled"))));var o=this._getSortContainer(n);o&&(this.m_utils.removeCSSClassName(o,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(o,this.getMappedStyle("selected")))}},z.prototype._handleSortIconMouseDown=function(e){this._databodyEmpty()||(this.m_utils.addCSSClassName(e,this.getMappedStyle("selected")),this.m_utils.removeCSSClassName(e,this.getMappedStyle("disabled")))},z.prototype._toggleSortIconDirection=function(e,t){if(null!=e){var i=this._getSortIcon(e);"descending"===t&&(this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortascending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))?(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortascending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdefault")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortdescending")),i.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc"))):"ascending"===t&&(this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdescending"))||this.m_utils.containsCSSClassName(i,this.getMappedStyle("sortdefault")))?(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdescending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdefault")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortascending")),i.setAttribute("title",this.getResources().getTranslatedText("labelSortDsc"))):"default"===t&&(this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortdescending")),this.m_utils.removeCSSClassName(i,this.getMappedStyle("sortascending")),this.m_utils.addCSSClassName(i,this.getMappedStyle("sortdefault")),i.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc")))}},z.prototype._displaySortIcon=function(e){var t=!1;if(null!=e){var i=this._getSortIcon(e);null!=this.m_sortInfo&&(t=this.m_sortInfo.key===this._getKey(e)),t&&this.m_utils.addCSSClassName(i,this.getMappedStyle("default"))}},z.prototype._buildSortIcon=function(e,t,i){var s=document.createElement("div");this.m_utils.addCSSClassName(s,this.getMappedStyle("iconContainer")),this.m_utils.addCSSClassName(s,this.getMappedStyle("sortIcon"));var n=document.createElement("div"),o=this.getMappedStyle("icon")+" "+this.getMappedStyle("clickableicon"),l=null!=this.m_sortInfo&&this.m_sortInfo.axis===i?this.m_sortInfo.key:null;if(e.key===l){var r=null!=this.m_sortInfo&&this.m_sortInfo.axis===i?this.m_sortInfo.direction:null;"ascending"===r?(n.className=this.getMappedStyle("sortascending")+" "+o,t.setAttribute(this.getResources().getMappedAttribute("sortDir"),r),n.setAttribute("title",this.getResources().getTranslatedText("labelSortDsc"))):"descending"===r?(n.className=this.getMappedStyle("sortdescending")+" "+o,t.setAttribute(this.getResources().getMappedAttribute("sortDir"),r),n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc"))):(n.className=this.getMappedStyle("sortdefault")+" "+o,n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc")))}else o+=" "+this.getMappedStyle("disabled"),n.className=this.getMappedStyle("sortdefault")+" "+o,n.setAttribute("title",this.getResources().getTranslatedText("labelSortAsc"));return s.appendChild(n),s.addEventListener("mouseover",this._handleSortContainerMouseOver.bind(this)),s},z.prototype._handleKeyboardSort=function(e,t){if(!this._databodyEmpty()){var i=e.getAttribute(this.getResources().getMappedAttribute("sortDir"));i=null==i||"descending"===i?"ascending":"descending",this._doHeaderSort(t,e,i)}},z.prototype._handleHeaderSort=function(e,t){if(!this._databodyEmpty()){var i=e.target,s=this.findHeader(i);null!=s&&(null==t&&(t=null!=this.m_sortInfo&&this.m_sortInfo.key===this._getKey(s)&&"ascending"===this.m_sortInfo.direction?"descending":"ascending"),this._doHeaderSort(e,s,t))}},z.prototype._handleCellSort=function(e,t,i){null==i||this._databodyEmpty()||(this._removeTouchSelectionAffordance(),this._doHeaderSort(e,i,t))},z.prototype._doHeaderSort=function(e,t,i){if(!0!==this.m_isSorting){this.m_delayedSort=null;var s=this._getKey(t),n=this._getAxis(t);if(this._removeSortSelection(),t.setAttribute(this.getResources().getMappedAttribute("sortDir"),i),this.m_sortInfo={event:e,key:s,axis:n,direction:i,header:t},this._toggleSortIconDirection(t,i),this._addSortSelection(),this._setAccInfoText("ascending"===i?"accessibleSortAscending":"accessibleSortDescending",{id:s}),null!=i&&null!=s&&null!=n)if(this._isDataGridProvider())this._fireSortRequestEvent(n);else{this.m_isSorting=!0,this.showStatusText(!this.isSkeletonSupport());var o={axis:n,key:s,direction:i};this.getDataSource().sort(o,{success:this._handleSortSuccess.bind(this),error:this._handleSortError.bind(this)})}}else this.m_delayedSort={event:e,header:t,direction:i}},z.prototype._handleSortError=function(){this.hideStatusText()},z.prototype._removeSortSelection=function(){if(null!=this.m_sortInfo){var e;if(!(e="column"===this.m_sortInfo.axis?this._findHeaderByKey(this.m_sortInfo.key,this.m_colHeader,this.getMappedStyle("colheadercell")):this._findHeaderByKey(this.m_sortInfo.key,this.m_rowHeader,this.getMappedStyle("rowheadercell"))))return;e.removeAttribute(this.getResources().getMappedAttribute("sortDir"));var t=this._getSortIcon(e);this._toggleSortIconDirection(e,"default"),"descending"===this.m_sortInfo.direction&&(this.m_utils.removeCSSClassName(t,this.getMappedStyle("sortdescending")),this.m_utils.addCSSClassName(t,this.getMappedStyle("sortascending"))),this.m_utils.addCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("default")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("selected")),this.m_utils.removeCSSClassName(this._getSortContainer(e),this.getMappedStyle("enabled"))}},z.prototype._addSortSelection=function(){if(null!=this.m_sortInfo){var e;e="column"===this.m_sortInfo.axis?this._findHeaderByKey(this.m_sortInfo.key,this.m_colHeader,this.getMappedStyle("colheadercell")):this._findHeaderByKey(this.m_sortInfo.key,this.m_rowHeader,this.getMappedStyle("rowheadercell"));var t=this._getSortIcon(e);this.m_utils.addCSSClassName(t,this.getMappedStyle("default")),this.m_utils.removeCSSClassName(t,this.getMappedStyle("disabled")),this.m_utils.addCSSClassName(t,this.getMappedStyle("selected"))}},z.prototype._getAxis=function(e){var t=this.getMappedStyle("colheadercell"),i=this.getMappedStyle("rowheadercell");return this.m_utils.containsCSSClassName(e,t)?"column":this.m_utils.containsCSSClassName(e,i)?"row":null},z.prototype._handleSortSuccess=function(){this.hideStatusText(),this._isDatabodyCellActive()?this._indexes({row:this.m_active.keys.row,column:this.m_active.keys.column},this._handlePreSortScrolling):this._fetchForSort(this.m_startRow,this.m_endRow-this.m_startRow+1,!1)},z.prototype._handlePreSortScrolling=function(e){var t=(-1===e.row?0:e.row)*this.m_avgRowHeight,i=t+this.m_avgRowHeight,s=this._isHighWatermarkScrolling();if(this.m_currentScrollTop<=t&&i<=this.m_currentScrollTop+this.getElementHeight(this.m_databody)||s)this._fetchForSort(this.m_startRow,this.m_endRow-this.m_startRow+1,!1);else{this.m_currentScrollTop=Math.min(t,this._getMaxScrollHeight());var n=Math.floor(this.m_currentScrollTop/this.m_avgRowHeight),o=n*this.m_avgRowHeight;this.m_startRow=n,this.m_endRow=-1,this.m_startRowHeader=n,this.m_endRowHeader=-1,this.m_startRowPixel=o,this.m_endRowPixel=o,this.m_startRowHeaderPixel=o,this.m_endRowHeaderPixel=o,this._fetchForSort(n,null,!0)}},z.prototype._fetchForSort=function(e,t,i){var s=document.createDocumentFragment(),n=document.createDocumentFragment();this.fetchHeaders("row",e,s,n,t,{success:this.handleHeadersFetchSuccessForSort.bind(this),error:this.handleCellsFetchError}),this.fetchCells(this.m_databody,e,this.m_startCol,t,this.m_endCol-this.m_startCol+1,{success:this.handleCellsFetchSuccessForSort.bind(this,s,n,i),error:this.handleCellsFetchError})},z.prototype.handleHeadersFetchSuccessForSort=function(e,t,i,s){var n,o,l,r,a,h,d,m=t.axis,c=t.start,u=t.header,_=t.endHeader;if(this.m_fetching[m]=!1,null!=e){for(n=e.getCount(),r=0,o=0,h=this.getMappedStyle("headercell")+" "+this.getMappedStyle("rowheadercell"),d=this.getRendererOrTemplate("row");n-o>0;)l=c+o,o+=(a=this.buildLevelHeaders(u,l,0,0,this.m_startRowPixel+r,!0,s,d,e,"row",h,this.m_rowHeaderLevelCount)).count,r+=a.totalHeaderDimension;this.m_endRowHeader=this.m_startRowHeader+(n-1),this.m_endRowHeaderPixel=this.m_startRowHeaderPixel+r}if(null!=i){for(n=i.getCount(),r=0,o=0,h=this.getMappedStyle("endheadercell")+" "+this.getMappedStyle("rowendheadercell"),d=this.getRendererOrTemplate("rowEnd");n-o>0;)l=c+o,o+=(a=this.buildLevelHeaders(_,l,0,0,this.m_startRowPixel+r,!0,s,d,i,"rowEnd",h,this.m_rowEndHeaderLevelCount)).count,r+=a.totalHeaderDimension;this.m_endRowEndHeader=this.m_startRowEndHeader+(n-1),this.m_endRowEndHeaderPixel=this.m_startRowEndHeaderPixel+r}this._signalTaskEnd()},z.prototype.handleCellsFetchSuccessForSort=function(e,t,i,s,n){var o;this.m_fetching.cells=!1;var l=z.SORT_ANIMATION_DURATION;this.isFetchComplete()&&this.hideStatusText();var r=n[0].start,a=s.getCount("row"),h=n[1].start,d=document.createDocumentFragment(),m=this._addCellsToFragment(d,s,r,this.m_startRowPixel,h,this.m_startColPixel);this.m_endRow=this.m_startRow+(a-1),this.m_endRowPixel=this.m_startRowPixel+m.totalRowHeight;var u=this.m_databody.firstChild,_=this.m_rowHeader.firstChild,p=this.m_rowEndHeader.firstChild;if(!0===i&&(o=this._isHighWatermarkScrolling(),this.m_utils.isTouchDeviceNotIOS()?(this._disableTouchScrollAnimation(),this.scrollTo(this.m_currentScrollLeft,this.m_currentScrollTop)):(this.m_silentScroll=!0,this.m_databody.scrollTop=this.m_currentScrollTop,this._syncScroller())),!l||!this.m_utils.supportsTransitions()||1===a||this.m_rowHeaderLevelCount>1&&null!=this.m_rowHeaderLevelCount||!1===o)this._signalTaskStart(),this._handleSortEnd(d,e,t);else if(this.m_isCustomElementCallback()){this._signalTaskStart("processing sort render");let i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("div");i.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),s.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),n.setAttribute(this.getResources().getMappedAttribute("busyContext"),""),i.className=this.getMappedStyle("info"),s.className=this.getMappedStyle("info"),n.className=this.getMappedStyle("info"),i.appendChild(d),s.appendChild(e),n.appendChild(t),this.m_root.appendChild(i),this.m_root.appendChild(s),this.m_root.appendChild(n);var g=c.getContext(i).getBusyContext().whenReady(),C=c.getContext(s).getBusyContext().whenReady(),f=c.getContext(n).getBusyContext().whenReady();Promise.all([g,C,f]).then(function(){for(;i.childNodes.length>0;)d.appendChild(i.childNodes[0]);for(;s.childNodes.length>0;)e.appendChild(s.childNodes[0]);for(;n.childNodes.length>0;)t.appendChild(n.childNodes[0]);this.m_root.removeChild(i),this.m_root.removeChild(s),this.m_root.removeChild(n),this._signalTaskEnd(),this.processSortAnimationToPosition(l,0,"ease-in",_,e,u,d,p,t)}.bind(this))}else this.processSortAnimationToPosition(l,0,"ease-in",_,e,u,d,p,t);this._signalTaskEnd()},z.prototype._handleSortEnd=function(e,t,i,s,n,o){var l;if(t.childNodes.length>1){if(l=this.m_rowHeader.firstChild,n)for(let e=0;e<n.length;e++){let i=n[e];t.insertBefore(i.element,t.childNodes[i.index])}this.m_utils.empty(l),l.appendChild(t),this.m_subtreeAttachedCallback(l)}if(i.childNodes.length>1){if(l=this.m_rowEndHeader.firstChild,o)for(let e=0;e<o.length;e++){let t=o[e];i.insertBefore(t.element,i.childNodes[t.index])}this.m_utils.empty(l),l.appendChild(i),this.m_subtreeAttachedCallback(l)}var r=this.m_databody.firstChild,a=this.m_rowHeader.firstChild,h=this.m_rowEndHeader.firstChild;if(s)for(let t=0;t<s.length;t++)e.appendChild(s[t]);this._emptyDatabody(r),this._populateDatabody(r,e),this._fireSortEvent(),this._restoreActive(),this.m_isSorting=!1,this._doDelayedSort(),this.m_animating=!1;for(let e=0;e<r.childNodes.length;e++)this.removeTransformMoveStyle(r.childNodes[e]);if(-1!==this.m_endRowHeader)for(let e=0;e<a.childNodes.length;e++)this.removeTransformMoveStyle(a.childNodes[e]);if(-1!==this.m_endRowEndHeader)for(let e=0;e<h.childNodes.length;e++)this.removeTransformMoveStyle(h.childNodes[e]);this._signalTaskEnd(),this._runModelEventQueue()},z.prototype.processSortAnimationToPosition=function(e,t,i,s,n,o,l,r,a){var h,d,m,c,u,_,p,g,C,f,y=this;this._signalTaskStart();var E=n.childNodes.length>1,v=a.childNodes.length>1,w=this.getResources().isRTLMode()?"right":"left",H=this._getViewportBottom(),x=this._getViewportLeft(),S=this._getViewportRight(),b={},R={},I=[];for(c=0;c<o.childNodes.length;c++)u=o.childNodes[c],h=this._getKey(u,"row"),f=(C=this.getElementDir(u,w))+this.getElementWidth(u),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(C,f,d,_)&&(b[h]?b[h].cell.push(u):(m=H,b[h]={cell:[u],oldTop:d,newTop:m}),m-d!=0&&(g=u));for(c=0;c<s.childNodes.length;c++)E&&(u=s.childNodes[c],h=this._getKey(u,"row"),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(x,S,d,_)&&(m=H,b[h]||(b[h]={oldTop:d,newTop:m}),b[h].rowHeader=u));for(c=0;c<r.childNodes.length;c++)E&&(u=r.childNodes[c],h=this._getKey(u,"row"),_=(d=this.getElementDir(u,"top"))+this.getElementHeight(u),this._isCellBoundaryInViewport(x,S,d,_)&&(m=H,b[h]||(b[h]={oldTop:d,newTop:m}),b[h].rowEndHeader=u));for(c=0;c<l.childNodes.length;c++)u=l.childNodes[c],h=this._getKey(u,"row"),m=this.getElementDir(u,"top"),b[h]?b[h].newTop=m:(d=H,p=m+this.getElementHeight(u),f=(C=this.getElementDir(u,w))+this.getElementWidth(u),this._isCellBoundaryInViewport(C,f,m,p)&&(this.changeStyleProperty(u,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),I.push(u),R[h]?R[h].cell.push(u):R[h]={cell:[u],oldTop:d,newTop:m,add:!0},m-d!=0&&(g=u)));for(let e=0;e<I.length;e++)o.appendChild(I[e]);var M=[];for(c=0;c<n.childNodes.length;c++)if(E){var F=n.childNodes[c];h=this._getKey(F,"row"),b[h]||(p=(m=this.getElementDir(F,"top"))+this.getElementHeight(F),d=H,this._isCellBoundaryInViewport(x,S,m,p)&&(this.changeStyleProperty(F,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),M.push({element:F,index:c}),R[h]||(R[h]={oldTop:d,newTop:m,add:!0}),R[h].rowHeader=F))}for(let e=0;e<M.length;e++)s.appendChild(M[e].element);var z=[];for(c=0;c<a.childNodes.length;c++)if(v){var A=a.childNodes[c];h=this._getKey(A,"row"),b[h]||(p=(m=this.getElementDir(A,"top"))+this.getElementHeight(A),d=H,this._isCellBoundaryInViewport(x,-1,m,p)&&(this.changeStyleProperty(A,this.getCssSupport("transform"),"translate3d(0px,"+d+"px,0px)"),z.push({element:A,index:c}),R[h].rowEndHeader=A,R[h]||(R[h]={oldTop:d,newTop:m,add:!0})))}for(let e=0;e<z.length;e++)r.appendChild(z[e].element);if(null!=g){var D=this._handleSortEnd.bind(this,l,n,a,I,M,z);y._onEndEvent("transitionend",g,D,e),this.m_animating=!0,setTimeout(function(){var s,n,o,l,r=0,a=Object.keys(b);for(l=0;l<a.length;l++){if(h=a[l],o=b[a[l]],n=t+"ms",s=o.newTop-o.oldTop,o.cell)for(r=0;r<o.cell.length;r++)y.addTransformMoveStyle(o.cell[r],e/2+"ms",n,i,0,s,0);E&&o.rowHeader&&y.addTransformMoveStyle(o.rowHeader,e/2+"ms",n,i,0,s,0),v&&o.rowEndHeader&&y.addTransformMoveStyle(o.rowEndHeader,e/2+"ms",n,i,0,s,0)}for(a=Object.keys(R),l=0;l<a.length;l++){if(h=a[l],o=R[a[l]],n=t*r+"ms",s=0,o.cell)for(var d=0;d<o.cell.length;d++)y.addTransformMoveStyle(o.cell[d],e/2+"ms",n,i,0,s,0);E&&o.rowHeader&&y.addTransformMoveStyle(o.rowHeader,e/2+"ms",n,i,0,s,0),v&&o.rowEndHeader&&y.addTransformMoveStyle(o.rowEndHeader,e/2+"ms",n,i,0,s,0)}},0)}else this._handleSortEnd(l,n,a)},z.prototype._restoreActive=function(){if(null!=this.m_active){var e=this.m_active.axis,t=this.m_sortInfo.originalEvent;if("cell"===this.m_active.type){var i=this._getCellByKeys(this.m_active.keys);if(null!=i){var s=this.getCellIndexes(i);this._isSelectionEnabled()?this.selectAndFocus(s,t):this._setActiveByIndex(s,t)}else this._setActive(null,null,t,!0),this._isSelectionEnabled()&&this._clearSelection(t)}else if("row"===e||"rowEnd"===e){var n="row"===e?this.m_rowHeader:this.m_rowEndHeader,o="row"===e?this.getMappedStyle("rowheadercell"):this.getMappedStyle("rowendheadercell"),l=this._findHeaderByKey(this.m_active.key,n,o);if(null!=l){var r=l[this.getResources().getMappedAttribute("context")];this._setActive(l,{type:"header",axis:e,index:r.index,key:r.key,level:r.level},t)}else this._setActive(null,null,t)}}},z.prototype._getSortIcon=function(e){return e.lastChild.firstChild},z.prototype._getSortContainer=function(e){return e.lastChild},z.prototype._fireSortEvent=function(){var e={event:this.m_sortInfo.event,ui:{header:this.m_sortInfo.key,direction:this.m_sortInfo.direction}};this.fireEvent("sort",e)},z.prototype._fireSortRequestEvent=function(){let e=this.m_sortInfo.header[this.getResources().getMappedAttribute("context")],t=this.m_sortInfo.header[this.getResources().getMappedAttribute("metadata")],i=this.buildHeaderTemplateContext(e,t).item;var s={event:this.m_sortInfo.event,ui:{direction:this.m_sortInfo.direction,item:i,axis:this.m_sortInfo.axis}};this.fireEvent("sortRequest",s)},z.prototype._doDelayedSort=function(){null!=this.m_delayedSort?this._doHeaderSort(this.m_delayedSort.event,this.m_delayedSort.header,this.m_delayedSort.direction):this.fillViewport()},z.prototype._fireExpandRequestEvent=function(e){const t=this.findHeader(e.target),i=t[this.getResources().getMappedAttribute("context")],s=t[this.getResources().getMappedAttribute("metadata")];s.metadata.expanded="expanded";const n={item:this.buildHeaderTemplateContext(i,s).item,axis:i.axis},o=this._getDisclosureIcon(t);this.m_utils.removeCSSClassName(o,this.getMappedStyle("collapsed")),this.m_utils.addCSSClassName(o,this.getMappedStyle("expanded")),this.fireEvent("expandRequest",n)},z.prototype._fireCollapseRequestEvent=function(e){const t=this.findHeader(e.target),i=t[this.getResources().getMappedAttribute("context")],s=t[this.getResources().getMappedAttribute("metadata")];s.metadata.expanded="collapsed";const n={item:this.buildHeaderTemplateContext(i,s).item,axis:i.axis},o=this._getDisclosureIcon(t);this.m_utils.removeCSSClassName(o,this.getMappedStyle("expanded")),this.m_utils.addCSSClassName(o,this.getMappedStyle("collapsed")),this.fireEvent("collapseRequest",n)},z.prototype._handleExpandCollapseRequest=function(e){this._isHeaderExpanded(e.target)?this._fireCollapseRequestEvent(e):this._isHeaderCollapsed(e.target)&&this._fireExpandRequestEvent(e)},z.prototype._isTargetExpandCollapseEnabled=function(e){return this._isHeaderCollapsed(e)||this._isHeaderExpanded(e)},z.prototype._isHeaderCollapsed=function(e){const t=this._getDisclosureIcon(e);return!!t&&this.m_utils.containsCSSClassName(t,this.getMappedStyle("collapsed"))},z.prototype._isHeaderExpanded=function(e){const t=this._getDisclosureIcon(e);return!!t&&this.m_utils.containsCSSClassName(t,this.getMappedStyle("expanded"))},z.prototype._buildDisclosureIcon=function(e){const t=document.createElement("div");t.classList.add(this.getMappedStyle("iconContainer")),t.classList.add(this.getMappedStyle("disclosureIcon"));const i=document.createElement("div");let s;return i.classList.add(this.getMappedStyle("icon")),i.classList.add(this.getMappedStyle("clickableicon")),"expanded"===e.metadata.expanded?(i.classList.add(this.getMappedStyle("expanded")),s=this.getResources().getTranslatedText("collapsedText")):"collapsed"===e.metadata.expanded&&(i.classList.add(this.getMappedStyle("collapsed")),s=this.getResources().getTranslatedText("expandedText")),t.setAttribute("title",s),t.appendChild(i),t.addEventListener("mouseover",this._handleExpandCollapseContainerMouseOver.bind(this)),t.addEventListener("mouseout",this._handleDisclosureMouseOut.bind(this)),t},z.prototype._handleExpandCollapseContainerMouseOver=function(e){const t=e.target,i=this.findHeader(t),s=this._getDisclosureIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("disclosureIcon"))&&(this.m_utils.addCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.addCSSClassName(s,this.getMappedStyle("enabled")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("disabled")))},z.prototype._buildSpacer=function(e){const t=document.createElement("span");return this._addDataGridSpacerClass(t),this._addIndentation(e,t),t},z.prototype._getTreeDepth=function(e){return e.metadata.treeDepth?e.metadata.treeDepth:null},z.prototype._addDataGridSpacerClass=function(e){this.m_utils.addCSSClassName(e,this.getMappedStyle("spacer"))},z.prototype._isLeaf=function(e){return!e.metadata.expanded||null===e.metadata.expanded},z.prototype._addIndentation=function(e,t){let i=this._getTreeDepth(e);null!==i&&this._appendSpacerClass(i,t,e)},z.prototype._appendSpacerClass=function(e,t,i){t.style.width=e*z.SPACER_DEFAULT_WIDTH+(this._isLeaf(i)?z.SPACER_DEFAULT_WIDTH:0)+"rem"},z.prototype._handleDisclosureMouseOut=function(e){const t=e.target,i=this.findHeader(t),s=this._getDisclosureIcon(i);this.m_utils.containsCSSClassName(e.currentTarget,this.getMappedStyle("disclosureIcon"))&&(this.m_utils.removeCSSClassName(e.currentTarget,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("hover")),this.m_utils.removeCSSClassName(s,this.getMappedStyle("enabled")))},z.prototype._isDisclosureIcon=function(e){return this.m_utils.containsCSSClassName(e,this.getMappedStyle("icon"))&&this.m_utils.containsCSSClassName(e.parentElement,this.getMappedStyle("disclosureIcon"))},z.prototype._getDisclosureIcon=function(e){return this._isDisclosureIcon(e)?e:e.getElementsByClassName(this.getMappedStyle("icon"))[0]},z.prototype._getDisclosureIconContainer=function(e){return e.firstChild};const A=function(e){this.datagridprovider=e,this.pendingHeaderCallback={},this._registerEventListeners(),this.totalRowCount=-1,this.totalColumnCount=-1,this.rowKeyMap=new T,this.columnKeyMap=new T,A.superclass.constructor.call(this)};function D(e,t,i){this.results=e,this.rowKeyMap=t,this.columnKeyMap=i,this.databodyResults=e.results.databody,this.rowStart=this.results.rowOffset,this.rowCount=this.results.rowCount,this.rowEnd=this.rowStart+this.rowCount-1,this.columnStart=this.results.columnOffset,this.columnCount=this.results.columnCount,this.columnEnd=this.columnStart+this.columnCount-1,this.lastItem=null}function L(e,t,i){this.results=e,this.axis=t,this.axisResults=e.results[this.axis+"Header"],this.axisLabels=e.results[this.axis+"HeaderLabel"],"row"===this.axis||"rowEnd"===this.axis?(this.start=this.results.rowOffset,this.count=this.results.rowCount):(this.start=this.results.columnOffset,this.count=this.results.columnCount),this.end=this.start+this.count-1,this.lastItem=null,this.keyMap=i,this.levelCount=null}function T(){this.keyMap=new Map,this.nextKey=0,this.set=(e,t,i,s)=>{const n=""+this.nextKey;null==s&&(s=1);for(let o=0;o<s;o++){let s=null==t?t:t+o,l=this.pairIndexLevel(e,s,i);this.keyMap.set(l,n)}return this.nextKey+=1,n},this.get=(e,t,i,s)=>{const n=this.pairIndexLevel(e,t,i);let o=this.keyMap.get(n);return null==o&&(o=this.set(e,t,i,s)),o},this.pairIndexLevel=(e,t,i)=>null==t||null!=i&&t===i-1?""+e:e+","+t,this.handleOffsetChange=e=>{let t=new Map;const i=[...this.keyMap.keys()];for(let s=0;s<i.length;s++){let n=i[s].split(",");parseInt(n[0],10)<e&&t.set(i[s],this.keyMap.get(i[s]))}this.keyMap=t},this.handleChange=(e,t)=>{let i=new Set;e.forEach(function(e){let t=e.offset,s=e.count;for(var n=0;n<s;n++)i.add(t+n)});let s=Array.from(i);s.sort(function(e,t){return e-t});let n=new Map;this.keyMap.forEach((e,i)=>{let o=i.split(","),l=parseInt(o[0],10),r=o[1];if(t&&s.some(e=>e===l))return;let a=0;if(l>=s[0]){let e=l;a=s.findIndex(i=>(!t&&e>=i&&(e+=1),i>e)),-1===a&&(a=s.length)}let h=t?l-a:l+a,d=this.pairIndexLevel(h,r);n.set(d,e)}),this.keyMap=n}}h.Object.createSubclass(A,h.DataGridDataSource,"DataGridProviderDataGridDataSource"),A.prototype.fetchHeaders=function(e,t,i){if(null!=t){var s=e.axis,n={headerRange:e,callbacks:t,callbackObjects:i};this.pendingHeaderCallback[s]=n}},A.prototype.fetchCells=function(e,t,i){let s,n,o,l;for(let t=0;t<e.length;t+=1){let i=e[t];"row"===i.axis?(s=i.start,n=i.count):"column"===i.axis&&(o=i.start,l=i.count)}let r,a=this.pendingHeaderCallback.row,h=this.pendingHeaderCallback.column;this.pendingHeaderCallback={},r=a&&h?["all"]:a?["databody","rowHeader","rowEndHeader","rowHeaderLabel","rowEndHeaderLabel"]:h?["databody","columnHeader","columnEndHeader","columnHeaderLabel","columnEndHeaderLabel"]:["databody"];let d={rowOffset:s,columnOffset:o,rowCount:n,columnCount:l,fetchRegions:new Set(r)},m=(s,n)=>{let o,l,r;null!=n?(s.results=Object.assign({},s.results,n.results),null!=n.next&&(o=n.next)):null!=s.next&&(o=s.next),this.totalRowCount=s.totalRowCount,this.totalColumnCount=s.totalColumnCount;let d=s.results;if(h&&(!o||null!=d.columnHeader&&null!=d.columnEndHeader&&null!=d.columnHeaderLabel&&null!=d.columnEndHeaderLabel)&&(l=h.callbacks,null!=l&&null!=l.success)){let e,t;r=h.callbackObjects,null!=d.columnHeader&&(e=new L(s,"column",this.columnKeyMap)),null!=d.columnEndHeader&&(t=new L(s,"columnEnd",this.columnKeyMap)),l.success.call(r.success,e,h.headerRange,t),h=null}if(a&&(!o||null!=d.rowHeader&&null!=d.rowEndHeader&&null!=d.rowHeaderLabel&&null!=d.rowEndHeaderLabel)&&(l=a.callbacks,null!=l&&null!=l.success)){let e,t;r=a.callbackObjects,null!=d.rowHeader&&(e=new L(s,"row",this.rowKeyMap)),null!=d.rowEndHeader&&(t=new L(s,"rowEnd",this.rowKeyMap)),l.success.call(r.success,e,a.headerRange,t),a=null}if(null!=t&&null!=t.success&&!o){let n=new D(s,this.rowKeyMap,this.columnKeyMap);t.success.call(i.success,n,e)}o&&o.then(m.bind(this,s))};this.datagridprovider.fetchByOffset(d).then(m)},A.prototype.getCapability=function(e){return"sort"===e?"full":"sort"===e||"move"===e?"none":null},A.prototype.getCount=function(e){return"row"===e?this.totalRowCount:"column"===e?this.totalColumnCount:-1},A.prototype.getCountPrecision=function(){return"exact"},A.prototype.indexes=function(){return{row:-1,column:-1}},A.prototype.keys=function(){return{row:null,column:null}},A.prototype.move=function(){},A.prototype.moveOK=function(){return"invalid"},A.prototype.sort=function(){},A.prototype._registerEventListeners=function(){this._addListener=this._handleDataGridProviderAddEvent.bind(this),this._removeListener=this._handleDataGridProviderRemoveEvent.bind(this),this._updateListener=this._handleDataGridProviderUpdateEvent.bind(this),this._refreshListener=this._handleDataGridProviderRefreshEvent.bind(this),this.datagridprovider.addEventListener("add",this._addListener),this.datagridprovider.addEventListener("remove",this._removeListener),this.datagridprovider.addEventListener("update",this._updateListener),this.datagridprovider.addEventListener("refresh",this._refreshListener)},A.prototype.Destroy=function(){this.datagridprovider.removeEventListener("add",this._addListener),this.datagridprovider.removeEventListener("remove",this._removeListener),this.datagridprovider.removeEventListener("update",this._updateListener),this.datagridprovider.removeEventListener("refresh",this._refreshListener)},A.prototype.updateTotalCount=function(e,t,i){"row"===t&&-1===this.totalRowCount||"column"===t&&-1===this.totalColumnCount||e.forEach(e=>{let s=i*e.count;"row"===t?this.totalRowCount+=s:"column"===t&&(this.totalColumnCount+=s)})},A.prototype._handleDataGridProviderAddEvent=function(e){var t={source:this,operation:"insert",detail:e.detail};("row"===e.detail.axis?this.rowKeyMap:this.columnKeyMap).handleChange(e.detail.ranges,!1),this.updateTotalCount(e.detail.ranges,e.detail.axis,1),this.handleEvent("change",t)},A.prototype._handleDataGridProviderRemoveEvent=function(e){var t={source:this,operation:"delete",detail:e.detail};("row"===e.detail.axis?this.rowKeyMap:this.columnKeyMap).handleChange(e.detail.ranges,!0),this.updateTotalCount(e.detail.ranges,e.detail.axis,-1),this.handleEvent("change",t)},A.prototype._handleDataGridProviderUpdateEvent=function(e){var t={source:this,operation:"update",detail:e.detail};this.handleEvent("change",t)},A.prototype._handleDataGridProviderRefreshEvent=function(e){let t=!0,i=!0;if(e&&null!=e.detail){const s=e.detail;if(null!=s.disregardAfterColumnOffset){const e=s.disregardAfterColumnOffset+1;this.columnKeyMap.handleOffsetChange(e),i=!1}if(null!=s.disregardAfterRowOffset){const e=s.disregardAfterRowOffset+1;this.rowKeyMap.handleOffsetChange(e),t=!1}}i&&(this.columnKeyMap=new T),t&&(this.rowKeyMap=new T);const s={source:this,operation:"refresh",detail:e.detail};this.handleEvent("change",s)},D.prototype.getData=function(e){return this._findItemByIndex(e.row,e.column).data},D.prototype.getMetadata=function(e){let t=this._findItemByIndex(e.row,e.column);return{metadata:t.metadata,keys:{row:this.rowKeyMap.get(t.rowIndex),column:this.columnKeyMap.get(t.columnIndex)}}},D.prototype.getCount=function(e){if(null!=this.databodyResults){if("row"===e)return this.rowCount;if("column"===e)return this.columnCount}return 0},D.prototype.getExtent=function(e){let t=!1,i=!1,s=!1,n=!1,o=this._findItemByIndex(e.row,e.column),l=o.rowIndex,r=o.rowExtent,a=l+r-1,h=o.columnIndex,d=o.columnExtent,m=h+d-1;return l<this.rowStart&&(r-=this.rowStart-l,t=!0),a>this.rowEnd&&(r-=a-this.rowEnd,i=!0),h<this.columnStart&&(d-=this.columnStart-h,s=!0),m>this.columnEnd&&(d-=m-this.columnEnd,n=!0),{row:{extent:r,more:{before:t,after:i}},column:{extent:d,more:{before:s,after:n}}}},D.prototype._findItemByIndex=function(e,t){let i=i=>{let s=i.rowIndex,n=i.rowExtent,o=i.columnIndex,l=i.columnExtent;return e>=s&&e<s+n&&t>=o&&t<o+l};return null!=this.lastItem&&i(this.lastItem)||(this.lastItem=this.databodyResults.find(i)),this.lastItem},L.prototype.getData=function(e,t){return this._findItemByIndexLevel(e,t).data},L.prototype.getMetadata=function(e,t){let i=this._findItemByIndexLevel(e,t),s=i.metadata.sortDirection;return null!=s&&(s="unsorted"===i.metadata.sortDirection?null:s),{metadata:i.metadata,key:this.keyMap.get(i.index,i.level,this.getLevelCount(),i.depth),sortDirection:s}},L.prototype.getLevelCount=function(){if(null==this.levelCount){let e=0;null!=this.axisResults&&this.axisResults.forEach(t=>{let i=t.level+t.depth-1;i>e&&(e=i)}),this.levelCount=e+1}return this.levelCount},L.prototype.getExtent=function(e,t){let i=this._findItemByIndexLevel(e,t),s=i.extent,n=i.index,o=i.index+s-1,l=!1,r=!1;return n<this.start&&(s-=this.start-n,l=!0),o>this.end&&(s-=o-this.end,r=!0),{extent:s,more:{before:l,after:r}}},L.prototype.getLabel=function(e){return null!=this.axisLabels?this.axisLabels[e].data:null},L.prototype.getLabelMetadata=function(e){return null!=this.axisLabels?{metadata:this.axisLabels[e].metadata}:null},L.prototype.getDepth=function(e,t){return this._findItemByIndexLevel(e,t).depth},L.prototype.getCount=function(){return null!=this.axisResults?this.count:0},L.prototype._findItemByIndexLevel=function(e,t){let i=i=>{let s=i.index,n=i.extent,o=i.level,l=i.depth;return e>=s&&e<s+n&&t>=o&&t<o+l};return null!=this.lastItem&&i(this.lastItem)||(this.lastItem=this.axisResults.find(i)),this.lastItem},h.__registerWidget("oj.ojDataGrid",f.oj.baseComponent,{widgetEventPrefix:"oj",options:{bandingInterval:{row:0,column:0},data:null,gridlines:{horizontal:"visible",vertical:"visible"},scrollToKey:"auto",scrollPosition:{x:0,y:0},selectionMode:{cell:"none",row:"none"},dnd:{reorder:{row:"disable"},drag:null,drop:null},dataTransferOptions:{cut:"disable",copy:"disable",paste:"disable",fill:"disable"},frozenColumnCount:null,frozenRowCount:null,scrollPolicy:"auto",scrollPolicyOptions:{maxRowCount:500,maxColumnCount:500},selection:[],hiddenColumns:new Set([]),currentCell:null,editMode:"none",header:{row:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},sortable:"auto",style:null,freezable:"disable"},column:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},sortable:"auto",style:null,hidable:"disable",freezable:"disable"},columnEnd:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},style:null},rowEnd:{className:null,label:{renderer:null,className:null,style:null},renderer:null,resizable:{width:"disable",height:"disable"},style:null}},cell:{className:null,renderer:null,style:null},resize:null,sort:null,sortRequest:null,collapseRequest:null,expandRequest:null,ready:null,scroll:null,beforeCurrentCell:null,beforeEdit:null,beforeEditEnd:null,cutRequest:null,copyRequest:null,pasteRequest:null,fillRequest:null},_ComponentCreate:function(){this._super(),this.root=this.element[0],this.rootId=this.root.getAttribute("id"),this.grid=new z(this.root),this.grid.setVisibility(z.VISIBILITY_STATE_RENDER),f(this.root).addClass("oj-datagrid oj-component"),f(this.root).attr(m._OJ_CONTAINER_ATTR,this.widgetName),u.disableDefaultBrowserStyling(this.root),this.redrawSet={data:"all",header:["className","renderer","style","template"]}},_AfterCreate:function(){var e=this;this._unregisterResizeListener(this.root),this._removeAllChildren(),this._super(),this.resources=new w(this._GetReadingDirection(),this._getTranslation.bind(e),{showIndicatorDelay:E.getCachedCSSVarValues(["--oj-private-core-global-loading-indicator-delay-duration"])[0],loadIndicator:E.getCachedCSSVarValues(["--oj-private-data-grid-global-load-indicator-default"])[0]},this.widgetName),this._setDataSource(),this._setSelection(),this._hideColumns(),null!=this.datasource&&(this.grid.SetDataSource(this.datasource),this._addContextMenu(),this._isCreate=!0,this.grid._addDataSourceEventListeners()),this._checkSelectionMode(this.options),this.grid.SetOptions(this.options,this._WrapCustomElementRenderer.bind(e)),this.grid.SetResources(this.resources),this.grid.SetCreateContextCallback(this._modifyContext.bind(e)),this.grid.SetFixContextCallback(this._FixRendererContext.bind(e)),this.grid.SetRemoveCallback(this._remove.bind(e)),this.grid.SetUniqueIdCallback(this._uniqueId.bind(e)),this.grid.SetCompareValuesCallback(this._compareValues.bind(e)),this.grid.SetNotReadyCallback(this._NotReady.bind(e)),this.grid.SetMakeReadyCallback(this._MakeReady.bind(e)),this.grid.SetOptionCallback(this.option.bind(e)),this.grid.SetSubtreeAttachedCallback(m.subtreeAttached),this.grid.SetContextCallback(c.getContext),this.grid.SetCustomElementCallback(this._IsCustomElement.bind(e)),this.grid.SetUpdateScrollPostionOnRefreshCallback(this._updateScrollPositionOnRefresh.bind(e)),this.grid.SetCustomElement(this._GetCustomElement()),this._focusable({applyHighlight:!0,setupHandlers:function(t,i){e.grid.SetFocusableCallback.call(e.grid,function(e){return t(f(e))},function(e){return i(f(e))})}}),this._registerEventListeners(),this._possiblyRenderOrRefresh()},_SetupResources:function(){this._super(),this.setupResources(!this._isCreate)},setupResources:function(e){null!=this.datasource&&(e||this.grid._addDataSourceEventListeners(),this.grid._addDomEventListeners(),this._registerResizeListener(this.root)),e&&this.refresh(),this._isCreate=!1},_ReleaseResources:function(){this._super(),this.releaseResources()},releaseResources:function(){this.grid._removeDataSourceEventListeners(),this.grid._removeDomEventListeners(),this._unregisterResizeListener(this.root),this.contextMenuEvent=null,this._removeAllChildren()},_registerEventListeners:function(){var e=this;this.grid.addListener("resize",function(t){e._trigger("resize",t.event,t.ui)}),this.grid.addListener("select",function(t){e.option("selection",t.ui.selection,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})}),this.grid.addListener("currentCell",function(t){e.option("currentCell",t.ui,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})}),this.grid.addListener("beforeCurrentCell",function(t){return e._trigger("beforeCurrentCell",t.event,t.ui)}),this.grid.addListener("sort",function(t){var i=e._trigger2("sort",t.event,t.ui);e.grid.SetSortOriginalEvent(i.event)}),this.grid.addListener("sortRequest",function(t){return e._trigger("sortRequest",t.event,t.ui)}),this.grid.addListener("expandRequest",function(t){return e._trigger("expandRequest",t.event,t)}),this.grid.addListener("collapseRequest",function(t){return e._trigger("collapseRequest",t.event,t)}),this.grid.addListener("keydown",function(t){return e._trigger("keydown",t.event,t.ui)}),this.grid.addListener("ready",function(){e._trigger("ready",null,{})}),this.grid.addListener("scroll",function(t){e._trigger("scroll",t.event,t.ui)}),this.grid.addListener("beforeEdit",function(t){return e._trigger("beforeEdit",t.event,t.ui)}),this.grid.addListener("beforeEditEnd",function(t){return e._trigger("beforeEditEnd",t.event,t.ui)}),this.grid.addListener("cutRequest",function(t){return e._trigger("cutRequest",t.event,t.ui)}),this.grid.addListener("copyRequest",function(t){return e._trigger("copyRequest",t.event,t.ui)}),this.grid.addListener("pasteRequest",function(t){return e._trigger("pasteRequest",t.event,t.ui)}),this.grid.addListener("fillRequest",function(t){return e._trigger("fillRequest",t.event,t.ui)}),this.grid.addListener("rowFreeze",function(t){e.option("frozenRowCount",t.ui.frozenCount,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})}),this.grid.addListener("columnFreeze",function(t){e.option("frozenColumnCount",t.ui.frozenCount,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})}),this.grid.addListener("columnHide",function(t){e.option("hiddenColumns",t.ui.hiddenColumns,{_context:{originalEvent:t.event,internalSet:!0},changed:!0})})},refresh:function(){this._super();let e=!this._IsCustomElement()||null!=this._defaultContextMenu;e&&this._ReleaseContextMenu(),this.releaseResources(),this._removeAllChildren(),this._defaultContextMenu&&(this.options.contextMenu=null,this._defaultContextMenu=null),this._setDataSource(),null!=this.datasource&&(h.FlattenedTreeDataGridDataSource&&this.datasource instanceof h.FlattenedTreeDataGridDataSource&&(this.datasource.Destroy(),this.datasource.Init()),this.grid.SetDataSource(this.datasource),this._addContextMenu()),this.grid.SetOptions(this.options,this._WrapCustomElementRenderer.bind(this)),this.resources.setRTLMode(this._GetReadingDirection()),this.grid.SetResources(this.resources),e&&this._SetupContextMenu(),this.setupResources(!1),this.grid.getVisibility()!==z.VISIBILITY_STATE_RENDER&&this.grid.setVisibility(z.VISIBILITY_STATE_REFRESH),this._possiblyRenderOrRefresh()},_updateScrollPositionOnRefresh:function(){var e,t=this.options.selection;if(null!=t&&0!==t.length){e={};var i=t[t.length-1];i&&(i.startKey?(e.rowKey=i.startKey.row,e.columnKey=i.startKey.column):i.startIndex&&(e.rowIndex=0,e.columnIndex=0))}else e={x:0,y:0};this.option("scrollPosition",e,{_context:{internalSet:!0},changed:!1})},_destroy:function(){f(this.root).removeAttr(m._OJ_CONTAINER_ATTR),null!=this.datasource&&this.datasource.Destroy&&this.datasource.Destroy(),this.grid.destroy(),this._unregisterResizeListener(this.root),f(this.root).empty(),this._MakeReady()},_setOptions:function(e,t){if(this.datasource){var i=this._handleOptionUpdate(e,t);this._super(e,t),"refresh"===i?this.refresh():"pass"===i&&this.grid.UpdateOptions(e,t)}else this._super(e,t),null!=e.data&&this.refresh()},_checkSelectionMode:function(e){var t=e.selectionMode;if(t&&t.row&&t.cell&&"none"!==t.row&&"none"!==t.cell)throw new Error("JET DataGrid does not support selectionMode on cell and row simultaneously.")},_NotifyShown:function(){this._super(),this._possiblyRenderOrRefresh()},_NotifyHidden:function(){this._super(),this.grid.getVisibility()===z.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(z.VISIBILITY_STATE_HIDDEN)},_NotifyAttached:function(){this._super(),this._possiblyRenderOrRefresh()&&this.grid._initiateScrollOnAttached()},_NotifyDetached:function(){this._super(),this.grid.getVisibility()===z.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(z.VISIBILITY_STATE_HIDDEN)},_VerifyConnectedForSetup:function(){return!0},_handleOptionUpdate:function(e,t){for(var i="ignore",s=Object.keys(e),n=0;n<s.length;n++){switch(s[n]){case"bandingInterval":case"currentCell":case"editMode":case"gridlines":case"scrollPosition":case"selection":case"frozenColumnCount":case"frozenRowCount":case"hiddenColumns":i="pass";break;case"beforeCurrentCell":case"beforeEdit":case"beforeEditEnd":case"cutRequest":case"copyRequest":case"pasteRequest":case"fillRequest":case"create":case"disabled":case"dnd":case"optionChange":case"ready":case"resize":case"rootAttributes":case"scroll":case"sort":break;case"selectionMode":this._checkSelectionMode(e),i="pass";break;case"cell":case"header":var o=t.subkey;if(null!=o){var l=o.split(".");if("resizable"===l[1]||"sortable"===l[1]){i="pass";break}}return"refresh";case"data":return this._updateScrollPositionOnRefresh(),"refresh";default:return"refresh"}}return i},_isResizeEnabled:function(e,t){return!(!this.options.header[e]||!this.options.header[e].resizable)&&"disable"!==this.options.header[e].resizable[t]},_isSortEnabled:function(e){return!!this.options.header[e]&&"disable"!==this.options.header[e].sortable},_isFreezeEnabled:function(e){return!!this.options.header[e]&&"disable"!==this.options.header[e].freezable},_isHideEnabled:function(e){return!!this.options.header[e]&&"disable"!==this.options.header[e].hidable},_removeAllChildren:function(){for(var e=this.root.children,t=e.length-1;t>=0;t--)"TEMPLATE"!==e[t].tagName&&"OJ-SURROGATE"!==e[t].tagName&&("OJ-MENU"!==e[t].tagName||"OJ-MENU"===e[t].tagName&&"contextMenu"!==e[t].slot)&&this._remove(e[t])},_GetDefaultContextMenu:function(){return this._defaultContextMenu},_addContextMenu:function(){var e=this,t=e._IsCustomElement(),i=this._GetContextMenu()?this._GetContextMenu():this._menuContainer;if(i){null==this._menuItemsSetByGrid&&(this._menuItemsSetByGrid=[]),this._menuContainer=i;var s=(i=f(i)).find("[data-oj-command]"),n=[];s.each(function(){var i=e._shouldUpdateListItem(this,t);if(i.shouldUpdate){var s=f(this).attr("data-oj-command").split("-");if(t){var o=e._getContextMenuText(s[s.length-1],t);i.itemToUpdate?(i.itemToUpdate.textContent=o,n.push(i.itemToUpdate)):(i.toFirstChild,this.textContent=o,n.push(this))}else{var l=f(e._buildContextMenuItem(s[s.length-1],t));f(this).replaceWith(l),n.push(l.children("a").get(0))}}}),this._menuItemsSetByGrid=n,i.data("oj-ojMenu")&&(t?i[0].refresh():i.ojMenu("refresh"))}else null!=this.datasource&&(i=this._createDefaultContextMenu())&&(this._defaultContextMenu=i[0]);i&&this._addMenuSelectListener(i)},_shouldUpdateListItem:function(e,t){var i,s=!1;if(t){if(null!=e.firstElementChild&&"opt"===e.firstElementChild.getAttribute("ojmenu")?(i=g.CustomElementUtils.getSlotMap(e.firstElementChild),s=!0):i=g.CustomElementUtils.getSlotMap(e),!i[""]||0===i[""].length)return{shouldUpdate:!0,toFirstChild:s};if(i[""]){var n=this._menuItemsSetByGrid.indexOf(e);if(-1!==n)return{shouldUpdate:!0,itemToUpdate:this._menuItemsSetByGrid[n]}}return{shouldUpdate:!1}}var o=f(e).children("a");return{shouldUpdate:0===o.length||-1!==this._menuItemsSetByGrid.indexOf(o.get(0))}},_addMenuSelectListener:function(e){var t=this._handleContextMenuSelect.bind(this);this._IsCustomElement()?e[0].addEventListener("ojAction",t):e.on("ojselect",t)},_createDefaultContextMenu:function(){let e,t,i,s,n,o,l,r,a,h=null,d=null,m=null;const c=this._IsCustomElement();l=c?this._createCustomElementContextMenu():this._createWidgetContextMenu(),(this._isResizeEnabled("column","height")||this._isResizeEnabled("row","height"))&&(h=this._buildContextMenuItem("resizeHeight",c)),(this._isResizeEnabled("column","width")||this._isResizeEnabled("row","width"))&&(d=this._buildContextMenuItem("resizeWidth",c)),(this._isResizeEnabled("column","width")||this._isResizeEnabled("column","height")||this._isResizeEnabled("row","width")||this._isResizeEnabled("row","height"))&&(m=this._buildContextMenuItem("resizeFitToContent",c));const u=this.datasource.getCapability("sort");if(this._isSortEnabled("column")&&("column"!==u&&"full"!==u||(e=this._buildContextMenuItem("sortCol",c))),this._isSortEnabled("row")&&("row"!==u&&"full"!==u||(t=this._buildContextMenuItem("sortRow",c))),this._isHideEnabled("column")&&(r=this._buildContextMenuItem("hideCol",c),a=this._buildContextMenuItem("unhideCol",c)),"enable"===this.options.dnd.reorder.row)if("none"===this.datasource.getCapability("move"));else c?(s=new DocumentFragment,s.appendChild(this._buildContextMenuOjOption("cut")),s.appendChild(this._buildContextMenuOjOption("paste")),s.appendChild(this._buildContextMenuDivider())):(s=new DocumentFragment,s.appendChild(this._buildContextMenuListItem("cut")),s.appendChild(this._buildContextMenuListItem("paste")));let p=[];if(p=Object.keys(this.options.dataTransferOptions).filter(e=>"enable"===this.options.dataTransferOptions[e]),p.length){let e=this.options.dataTransferOptions;n=new DocumentFragment,c?("enable"===e.cut&&n.appendChild(this._buildContextMenuOjOption("cutCells")),"enable"===e.copy&&n.appendChild(this._buildContextMenuOjOption("copyCells")),"enable"===e.paste&&n.appendChild(this._buildContextMenuOjOption("pasteCells")),"enable"===e.fill&&n.appendChild(this._buildContextMenuOjOption("autoFill")),n.appendChild(this._buildContextMenuDivider())):("enable"===e.cut&&n.appendChild(this._buildContextMenuListItem("cutCells")),"enable"===e.copy&&n.appendChild(this._buildContextMenuListItem("copyCells")),"enable"===e.paste&&n.appendChild(this._buildContextMenuListItem("pasteCells")),"enable"===e.fill&&n.appendChild(this._buildContextMenuListItem("autoFill")))}return this._isMultipleSelection()&&_.isTouchSupported()&&(this._discontiguousSelection=!1,c?(i=document.createElement("oj-menu-select-many"),i.setAttribute("data-oj-binding-provider","none"),i.appendChild(this._buildContextMenuOjOption("discontiguousSelection"))):i=this._buildContextMenuListItem("discontiguousSelection")),this._isFreezeEnabled("row")&&(o=new DocumentFragment,c?(o.appendChild(this._buildContextMenuOjOption("freezeRow")),o.appendChild(this._buildContextMenuOjOption("unfreezeRow"))):(o.appendChild(this._buildContextMenuListItem("freezeRow")),o.appendChild(this._buildContextMenuListItem("unfreezeRow")))),this._isFreezeEnabled("column")&&(void 0===o&&(o=new DocumentFragment),c?(o.appendChild(this._buildContextMenuOjOption("freezeCol")),o.appendChild(this._buildContextMenuOjOption("unfreezeCol"))):(o.appendChild(this._buildContextMenuListItem("freezeCol")),o.appendChild(this._buildContextMenuListItem("unfreezeCol")))),h||d||m||e||t||s||i||o||r||a||n?(n&&l.appendChild(n),r&&l.appendChild(r),a&&l.appendChild(a),o&&l.appendChild(o),(r||a||o)&&l.appendChild(this._buildContextMenuDivider()),h&&l.appendChild(h),d&&l.appendChild(d),m&&l.appendChild(m),(e||t)&&((h||d||m)&&l.appendChild(this._buildContextMenuDivider()),e&&l.appendChild(e),t&&l.appendChild(t)),s&&((h||d||m||o||r||a||e||t)&&l.appendChild(this._buildContextMenuDivider()),l.appendChild(s)),i&&((h||d||m||o||e||t||r||a||s)&&l.appendChild(this._buildContextMenuDivider()),l.appendChild(i)),c||f(l).ojMenu(),this.option("contextMenu",l,{_context:{internalSet:!0}}),f(l)):null},_createCustomElementContextMenu:function(e){const t=document.createElement("oj-menu");t.setAttribute("data-oj-binding-provider","none"),t.style.display="none";let i=e?"contextsubmenu":"contextmenu";return t.setAttribute("id",this.rootId+i),e||this.root.appendChild(t),t},_createWidgetContextMenu:function(e){const t=document.createElement("ul");let i=e?"contextsubmenu":"contextmenu";return t.setAttribute("id",this.rootId+i),t.style.display="none",e||this.root.appendChild(t),t},_buildContextMenuItem:function(e,t){if(t){if("resize"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("resizeRow")),e.appendChild(this._buildContextMenuOjOption("resizeColumn")),e}if("sortCol"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("sortColAsc")),e.appendChild(this._buildContextMenuOjOption("sortColDsc")),e}if("sortRow"===e){const e=new DocumentFragment;return e.appendChild(this._buildContextMenuOjOption("sortRowAsc")),e.appendChild(this._buildContextMenuOjOption("sortRowDsc")),e}if(-1!==Object.keys(this.resources.commands).indexOf(e))return this._buildContextMenuOjOption(e)}else{if("resize"===e){const e=this._buildContextMenuListItem("resize"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("resizeWidth")),t.appendChild(this._buildContextMenuListItem("resizeHeight")),e.appendChild(t),e}if("sortCol"===e){const e=this._buildContextMenuListItem("sortCol"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("sortColAsc")),t.appendChild(this._buildContextMenuListItem("sortColDsc")),e.appendChild(t),e}if("sortRow"===e){const e=this._buildContextMenuListItem("sortRow"),t=document.createElement("ul");return t.appendChild(this._buildContextMenuListItem("sortRowAsc")),t.appendChild(this._buildContextMenuListItem("sortRowDsc")),e.appendChild(t),e}if(-1!==Object.keys(this.resources.commands).indexOf(e))return this._buildContextMenuListItem(e)}},_buildContextMenuOjOption:function(e){const t=document.createElement("oj-option");let i;if(t.setAttribute("data-oj-command",this._getMappedCommand(e)),-1!==["cutCells","copyCells","pasteCells"].indexOf(e)){i=document.createElement("span");let t=e.indexOf("Cells"),s=e.slice(0,t);i=document.createElement("span"),i.setAttribute("slot","startIcon"),i.setAttribute("class",`oj-ux-ico-${s}`)}return t.textContent=this._getContextMenuText(e),i&&t.appendChild(i),t},_buildContextMenuDivider:function(){const e=document.createElement("oj-option");return e.textContent="---",e},_buildContextMenuListItem:function(e){const t=document.createElement("li");return t.setAttribute("data-oj-command",this._getMappedCommand(e)),t.appendChild(this._buildContextMenuLabel(e)),t},_getContextMenuText:function(e){var t=this._IsCustomElement();t&&"discontiguousSelection"===e&&(e="SelectMultiple"),"resizeWidth"===e?e="resizeColumn":"resizeHeight"===e&&(e="resizeRow"),"hideCol"===e&&(e="hideColumns"),"unhideCol"===e&&(e="unhideColumns");let i="label"+e.charAt(0).toUpperCase()+e.slice(1);return t||"discontiguousSelection"!==e||(i="labelEnableNonContiguous"),this._getTranslation(i)},_buildContextMenuLabel:function(e){const t=this._getContextMenuText(e),i=document.createElement("a");return i.setAttribute("href","#"),i.textContent=t,i},_getDataGridContextMenu:function(){return this._GetContextMenu()||this._GetDefaultContextMenu()},_getTranslation:function(e,t){return this.getTranslatedString(e,t)},_handleResizeDialog:function(e){var t,i;this._IsCustomElement()?(t=document.getElementById(this.rootId+"inputNumber").value,i=document.getElementById(this.rootId+"modal").getAttribute("dimension"),document.getElementById(this.rootId+"modal").close()):(t=f("#"+this.rootId+"inputNumber").ojInputNumber("option","value"),f("#"+this.rootId+"modal").ojDialog("close")),this.grid.handleContextMenuReturn(this.contextMenuEvent,this._getMappedCommand(i),t),this.contextMenuEvent.target.focus()},_buildResizeDialog:function(e,t,i){var s,n,o,l,r,a,h,d,m,u=this._IsCustomElement(),_=this;if(u)if(s=document.getElementById(this.rootId+"inputNumber"),null===(o=document.getElementById(this.rootId+"modal"))||null===s){(o=document.createElement("oj-dialog")).id=this.rootId+"modal",o.setAttribute("data-oj-binding-provider","none"),o.setAttribute("initial-focus","firstFocusable"),o.className=this._getMappedStyle("resizeDialog"),(l=document.createElement("div")).setAttribute("slot","header"),(r=document.createElement("div")).setAttribute("slot","body"),(a=document.createElement("div")).setAttribute("slot","footer"),(m=document.createElement("h5")).textContent=e,l.appendChild(m),l.className=this._getMappedStyle("dialogTitle"),o.appendChild(l),o.appendChild(r),o.appendChild(a),(s=document.createElement("oj-input-number")).id=this.rootId+"inputNumber",s.setAttribute("label-edge","inside"),s.setAttribute("user-assistance-density","efficient"),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dimension","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dimension","resizeHeight")),o.setAttribute("title",e),(h=document.createElement("oj-button")).id=this.rootId+"modalcancel",h.style.margin="5px",(d=document.createElement("oj-button")).id=this.rootId+"modalsubmit",d.style.margin="5px",d.setAttribute("chroming","callToAction"),r.appendChild(s),a.appendChild(h),a.appendChild(d),this.root.appendChild(o),h.textContent=this._getTranslation("labelResizeDialogCancel"),d.textContent=this._getTranslation("labelResizeDialogApply"),n=function(){d.disabled=!1,s.value=0,o.close()},h.addEventListener("click",n),d.addEventListener("click",this._handleResizeDialog.bind(this)),s.setAttribute("max",2e3),s.setAttribute("min",20),s.setAttribute("step",1),s.setAttribute("value",t),s.setAttribute("display-options",'{"converterHint": "none", "validatorHint": "none"}'),s.addEventListener("validChanged",function(e){"valid"===e.detail.value?d.disabled=!1:d.disabled=!0});o.setAttribute("position",JSON.stringify({my:{horizontal:"center",vertical:"center"},at:{horizontal:"center",vertical:"center"},collision:"none"})),c.getContext(o).getBusyContext().whenReady().then(function(){o.open(_.root)})}else s.setAttribute("max",2e3),s.setAttribute("min",20),s.setAttribute("step",1),s.setAttribute("value",t),s.setAttribute("label-edge","inside"),s.setAttribute("user-assistance-density","efficient"),s.setAttribute("display-options",'{"converterHint": "none", "validatorHint": "none"}'),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dimension","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dimension","resizeHeight")),o.setAttribute("dialog-title",e),o.open(_.root);else o=f("#"+this.rootId+"modal"),s=f("#"+this.rootId+"inputNumber"),0===o.length||0===s.length?((o=document.createElement("div")).id=this.rootId+"modal",l=document.createElement("div"),r=document.createElement("div"),a=document.createElement("div"),l.className=this._getMappedStyle("dialogTitle"),o.appendChild(l),o.appendChild(r),o.appendChild(a),(m=document.createElement("h5")).textContent=e,l.appendChild(m),(s=document.createElement("input")).id=this.rootId+"inputNumber",s.setAttribute("label-edge","inside"),(h=document.createElement("oj-button")).id=this.rootId+"modalcancel",h.style.margin="5px",(d=document.createElement("oj-button")).id=this.rootId+"modalsubmit",d.style.margin="5px",r.appendChild(s),a.appendChild(h),a.appendChild(d),this.root.appendChild(o),f(h).ojButton({component:"ojButton",label:this._getTranslation("labelResizeDialogCancel")}),f(d).ojButton({component:"ojButton",label:this._getTranslation("labelResizeDialogApply")}),n=function(){f(d).ojButton({disabled:!1}),f(s).ojInputNumber({value:0}),f(o).ojDialog("close")},h.addEventListener("click",n),d.addEventListener("click",this._handleResizeDialog.bind(this)),f(s).ojInputNumber({component:"ojInputNumber",max:1e3,min:20,step:1,value:t}),"width"===i?(s.setAttribute("label-hint",this._getTranslation("columnWidth")),o.setAttribute("dialog-title","resizeWidth")):(s.setAttribute("label-hint",this._getTranslation("rowHeight")),o.setAttribute("dialog-title","resizeHeight")),f(s).on("change",function(){f(d).ojButton({disabled:!f(s).ojInputNumber("validate")})}),f(o).ojDialog({initialFocus:"firstFocusable",position:{my:"center center",at:"center center",collision:"none",of:f(this.root)}}),f(o).ojDialog("open")):(s.ojInputNumber("option","value",t),s.setAttribute("label-edge","inside"),o.find("."+this._getMappedStyle("dialogTitle"))[0].firstChild.textContent=e,o.ojDialog("open"))},_handleContextMenuSelect:function(e,t){var i;if(i=t?t.item:f(e.target),this.menuItemFunction=i.attr("data-oj-command"),this.menuItemFunction===this._getMappedCommand("sortColAsc")||this.menuItemFunction===this._getMappedCommand("sortColDsc")||this.menuItemFunction===this._getMappedCommand("sortRowAsc")||this.menuItemFunction===this._getMappedCommand("sortRowDsc")||this.menuItemFunction===this._getMappedCommand("cut")||this.menuItemFunction===this._getMappedCommand("paste")||this.menuItemFunction===this._getMappedCommand("cutCells")||this.menuItemFunction===this._getMappedCommand("pasteCells")||this.menuItemFunction===this._getMappedCommand("copyCells")||this.menuItemFunction===this._getMappedCommand("autoFill")||this.menuItemFunction===this._getMappedCommand("freezeRow")||this.menuItemFunction===this._getMappedCommand("freezeCol")||this.menuItemFunction===this._getMappedCommand("unfreezeRow")||this.menuItemFunction===this._getMappedCommand("unfreezeCol")||this.menuItemFunction===this._getMappedCommand("hideCol")||this.menuItemFunction===this._getMappedCommand("unhideCol"))this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,null);else if(this.menuItemFunction===this._getMappedCommand("resizeWidth")||this.menuItemFunction===this._getMappedCommand("resizeHeight")){var s=f(this.contextMenuEvent.target).closest("."+this._getMappedStyle("cell"));if(0===s.length&&(s=f(this.contextMenuEvent.target).closest("."+this._getMappedStyle("headercell"))),0===s.length&&(s=f(this.contextMenuEvent.target).closest("."+this._getMappedStyle("endheadercell"))),0===s.length&&(s=f(this.contextMenuEvent.target).closest("."+this._getMappedStyle("headerlabel"))),s.length>0){var n=this.menuItemFunction===this._getMappedCommand("resizeWidth")?s.outerWidth():s.outerHeight(),o=this.menuItemFunction===this._getMappedCommand("resizeWidth")?"width":"height",l="width"===o?this._getTranslation("resizeColumnDialog"):this._getTranslation("resizeRowDialog");this._buildResizeDialog(l,n,o)}}else if(this.menuItemFunction===this._getMappedCommand("resizeFitToContent"))this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,null);else if(this.menuItemFunction===this._getMappedCommand("discontiguousSelection")){let e;this._discontiguousSelection=!this._discontiguousSelection,this.grid.handleContextMenuReturn(this.contextMenuEvent,this.menuItemFunction,this._discontiguousSelection);e=this._IsCustomElement()?"labelSelectMultiple":this._discontiguousSelection?"labelDisableNonContiguous":"labelEnableNonContiguous",i.children().first().text(this._getTranslation(e))}},_NotifyContextMenuGesture:function(e,t,i){this.grid.handleContextMenuGesture(t,i,this._contextMenuGestureCallback.bind(this))},_contextMenuGestureCallback:function(e,t,i){if(null!=e){this.contextMenuEvent=t.originalEvent;var s=e.launcher,n=e.capabilities;this._manageContextMenu(n);var o="keyboard"===i?{position:{of:s},launcher:f(s)}:{launcher:f(s)};_.isTouchSupported()&&this.grid.m_databodyReorder||this._OpenContextMenu(t,i,o)}},_addContextMenuCapability:function(e){var t=f(this._getDataGridContextMenu());this._IsCustomElement()?t.find("[data-oj-command="+e+"]").attr("disabled")||t.find("[data-oj-command="+e+"]").attr("disabled",!0):t.find("[data-oj-command="+e+"]").hasClass("oj-disabled")||t.find("[data-oj-command="+e+"]").addClass("oj-disabled")},_removeContextMenuCapability:function(e){f(this._getDataGridContextMenu()).find("[data-oj-command="+e+"]").removeClass("oj-disabled").attr("disabled",!1)},_manageContextMenu:function(e){for(var t=Object.keys(e),i=0;i<t.length;i++){var s=t[i],n=this.resources.getMappedCommand(s);"disable"===e[s]?this._addContextMenuCapability(n):this._removeContextMenuCapability(n)}},_findCellIndex:function(e){return e[this._getMappedAttribute("context")].indexes},_setDataSource:function(){null!=this.options.data?this.options.data.fetchByOffset&&!this.options.data.fetchFirst?(null!=this.datasource&&this.datasource.Destroy&&this.datasource.Destroy(),this.datasource=new A(this.options.data)):h.DataProviderFeatureChecker.isDataProvider(this.options.data)?(this.datasource=new H(this.options.data),"randomAccess"!==this.options.data.getCapability("fetchByOffset").implementation&&"scroll"===this.options.scrollPolicy&&(y.error("oj.DataProvider does not support fetchByOffset and scrollPolicy is set to scroll. scrollPolicy will fall back to auto."),this.options.scrollPolicy="auto")):this.datasource=this.options.data:this.datasource=null},_setSelection:function(){var e=this.options.selection;null!=e&&this.grid.SetSelection(e)},_hideColumns:function(){var e=this.options.hiddenColumns;null!=e&&(e=[...e],this.grid.setHiddenColumns(e))},_modifyContext:function(e){e.component=m.__GetWidgetConstructor(this.element,"ojDataGrid")},_setAccessibleContext:function(e){this.grid.SetAccessibleContext(e)},_unregisterResizeListener:function(e){e&&this._resizeHandler&&(_.removeResizeListener(e,this._resizeHandler),this._resizeHandler=null)},_registerResizeListener:function(e){e&&(null==this._resizeHandler&&(this._resizeHandler=this._handleResize.bind(this)),_.addResizeListener(e,this._resizeHandler))},_handleResize:function(e,t){e>0&&t>0&&(this._possiblyRenderOrRefresh(),this.grid.HandleResize(e,t))},getNodeBySubId:function(e){var t;if(null==e)return this.element?this.element[0]:null;var i=e.subId;if("oj-datagrid-cell"===i){var s=e.rowIndex,n=e.columnIndex;t=f(this.grid._getCellByIndex({row:s,column:n}))}else if("oj-datagrid-sort-icon"===i||"oj-datagrid-sort-ascending"===i||"oj-datagrid-sort-default"===i||"oj-datagrid-sort-descending"===i||"oj-datagrid-header"===i){var o,l=e.axis,r=e.index,a=null==e.level?0:e.level;if("column"===l?o=this._getHeaderByIndex(r,a,f(document.getElementById(this.rootId+":columnHeader")),this.grid.getStartColumnHeader()):"row"===l?o=this._getHeaderByIndex(r,a,f(document.getElementById(this.rootId+":rowHeader")),this.grid.getStartRowHeader()):"columnEnd"===l?o=this._getHeaderByIndex(r,a,f(document.getElementById(this.rootId+":columnEndHeader")),this.grid.getStartColumnEndHeader()):"rowEnd"===l&&(o=this._getHeaderByIndex(r,a,f(document.getElementById(this.rootId+":rowEndHeader")),this.grid.getStartRowEndHeader())),null==o)return null;if("oj-datagrid-sort-icon"===i)return o.children("."+this._getMappedStyle("sortIcon")).children().get(0);t="oj-datagrid-sort-ascending"===i?o.find("."+this._getMappedStyle("sortascending")):"oj-datagrid-sort-default"===i?o.find("."+this._getMappedStyle("sortdefault")):"oj-datagrid-sort-descending"===i?o.find("."+this._getMappedStyle("sortdescending")):o}else"oj-datagrid-header-label"===i&&(t=f(this.grid._getLabel(e.axis,e.level)));return null!=t&&t.length>0?t[0]:null},getSubIdByNode:function(e){var t,i=f(e).closest("."+this._getMappedStyle("cell"));if(i.length>0){var s=this._findCellIndex(i[0]);return{subId:"oj-datagrid-cell",rowIndex:s.row,columnIndex:s.column}}var n=f(e).closest("."+this._getMappedStyle("headercell"));if(0===n.length&&(n=f(e).closest("."+this._getMappedStyle("endheadercell"))),n.length>0)return t=n[0][this._getMappedAttribute("context")],{subId:f(e).hasClass(this._getMappedStyle("sortascending"))?"oj-datagrid-sort-ascending":f(e).hasClass(this._getMappedStyle("sortdefault"))?"oj-datagrid-sort-default":f(e).hasClass(this._getMappedStyle("sortdescending"))?"oj-datagrid-sort-descending":"oj-datagrid-header",axis:t.axis,index:this._getHeaderIndex(n),level:t.level};var o=f(e).closest("."+this._getMappedStyle("headerlabel"));return o.length>0?{subId:"oj-datagrid-header-label",axis:(t=o[0][this._getMappedAttribute("context")]).axis,level:t.level}:null},getContextByNode:function(e){var t,i,s=f(e).closest("."+this._getMappedStyle("cell"));if(s.length>0)return t=s[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-cell",i;var n=f(e).closest("."+this._getMappedStyle("headercell"));if(0===n.length&&(n=f(e).closest("."+this._getMappedStyle("endheadercell"))),n.length>0)return t=n[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-header",i.index=this._getHeaderIndex(n),i;var o=f(e).closest("."+this._getMappedStyle("headerlabel"));return o.length>0?(t=o[0][this._getMappedAttribute("context")],(i=h.CollectionUtils.copyInto({},t,void 0,!0)).subId="oj-datagrid-header-label",i):null},_getMappedStyle:function(e){return this.resources.getMappedStyle(e)},_getMappedAttribute:function(e){return this.resources.getMappedAttribute(e)},_getMappedCommand:function(e){return this.resources.getMappedCommand(e)},_isDataGridSizingAvailable:function(){return null!=this.root.offsetParent},_possiblyRenderOrRefresh:function(){var e=this.grid.getVisibility(),t=!1;return this._isDataGridSizingAvailable()?(e===z.VISIBILITY_STATE_RENDER?(this.grid.render(this.root),t=!0):e===z.VISIBILITY_STATE_REFRESH&&(this.grid.refresh(this.root),t=!0),this.grid.setVisibility(z.VISIBILITY_STATE_VISIBLE)):e===z.VISIBILITY_STATE_VISIBLE&&this.grid.setVisibility(z.VISIBILITY_STATE_HIDDEN),t},_getHeaderByIndex:function(e,t,i,s){if(t<0)return null;var n=i.children().first().children().last();if(n.hasClass(this._getMappedStyle("headercell")))return i.children().first().children("."+this._getMappedStyle("headercell")).eq(e-s);if(n.hasClass(this._getMappedStyle("endheadercell")))return i.children().first().children("."+this._getMappedStyle("endheadercell")).eq(e-s);var o=this._getGroupingContainer(e,t,0,i.children().first().children());if(null==o)return null;if(t<=parseInt(o.attr(this._getMappedAttribute("level")),10)+parseInt(o.children().eq(0).attr(this._getMappedAttribute("depth")),10)-1)return o.children().eq(0);var l=e-(s=parseInt(o.attr(this._getMappedAttribute("start")),10))+1;return o.children().eq(l)},_getGroupingContainer:function(e,t,i,s){if(null==s.eq(1)||s.eq(1).hasClass(this._getMappedStyle("headercell"))||s.eq(1).hasClass(this._getMappedStyle("endheadercell")))return t===i?s.eq(0).parent():null;var n,o=s.parent().parent();for(n=o.hasClass(this._getMappedStyle("header"))||o.hasClass(this._getMappedStyle("endheader"))?0:1;n<s.length;n++){var l=parseInt(s.eq(n).attr(this._getMappedAttribute("start")),10),r=parseInt(s.eq(n).attr(this._getMappedAttribute("extent")),10),a=parseInt(s.eq(n).children().eq(0).attr(this._getMappedAttribute("depth")),10);if(e>=l&&e<l+r)return t<i+a?s.eq(n):this._getGroupingContainer(e,t,i+a,s.eq(n).children())}return null},_getHeaderIndex:function(e){var t;let i;if(e.parent().hasClass(this._getMappedStyle("groupingcontainer"))){if(t=parseInt(e.parent().attr(this._getMappedAttribute("start")),10),e.get(0)===e.parent().children(":first").get(0))return t;t-=1}else e.hasClass(this._getMappedStyle("rowheadercell"))?(t=this.grid.getStartRowHeader(),i="row"):e.hasClass(this._getMappedStyle("colheadercell"))?(t=this.grid.getStartColumnHeader(),i="column"):e.hasClass(this._getMappedStyle("colendheadercell"))?(t=this.grid.getStartColumnEndHeader(),i="column"):(t=this.grid.getStartRowEndHeader(),i="row");return i&&this.grid.m_options.isFreezeEnabled(i)&&this.grid.m_options._getFreezeIndex(i)>=0&&!e.parent().parent().hasClass(this._getMappedStyle("frozenHeader"))&&(t+=this.grid.m_options._getFreezeIndex(i)+1),t+=e.index()},_isMultipleSelection:function(){return null!=this.options.selectionMode&&("multiple"===this.options.selectionMode.row||"multiple"===this.options.selectionMode.cell)},_remove:function(e){null!=e&&(this.grid._cleanTemplateNodes(e),f(e).remove())},_uniqueId:function(e,t){t?f(e).removeUniqueId():f(e).uniqueId()},_compareValues:function(e,t){return h.Object.compareValues(e,t)},scrollTo:function(e){this.grid.scroll(e)},whenReady:function(){if(this._ready)return Promise.resolve(!0);if(!this._readyPromise){var e=this;this._readyPromise=new Promise(function(t){e._readyPromiseResolve=t})}return this._readyPromise},_NotReady:function(){if(this._ready=!1,!this._readyResolveFunc){var e=c.getContext(this.element[0]).getBusyContext(),t={description:"The component identified by '"+this.element.attr("id")+"' is being loaded."};this._readyResolveFunc=e.addBusyState(t)}},_MakeReady:function(){this._readyPromiseResolve&&(this._readyPromiseResolve(!0),this._readyPromiseResolve=null),this._ready=!0,this._readyPromise=null,this._readyResolveFunc&&(this._readyResolveFunc(),this._readyResolveFunc=null)},_CompareOptionValues:function(e,t,i){switch(e){case"currentCell":case"selection":return h.Object.compareValues(t,i);default:return this._super(e,t,i)}}}),z.prototype.unhighlightFloodFillRange=function(e){null==e&&(e=this.GetFloodFillRange()[0]),null!=e&&this._applyBorderClassesAroundRange(this.getElementsInRange(e),e,!1,"Floodfill")},z.prototype.highlightFloodFillRange=function(e){this._applyBorderClassesAroundRange(this.getElementsInRange(e),e,!0,"Floodfill")},z.prototype.handleDatabodyFloodFillDrag=function(e){var t=e.target,i=this.findCell(t);if(null!=i){var s=this.getCellIndexes(i);this.extendFloodFillSelection(s,e)}else this.unhighlightFloodFillRange(),this.m_floodFillRange=[]},z.prototype.GetFloodFillRange=function(){return null==this.m_floodFillRange&&(this.m_floodFillRange=[]),this.m_floodFillRange},z.prototype.extendFloodFillSelection=function(e,t){if("header"===this.m_active.type)return;var i;if(null==(i={row:this.m_active.indexes.row,column:this.m_active.indexes.column}))return;let s,n=!1;s||(s=this.m_selection);let o,l=s[0].startIndex,r=s[0].endIndex;e.row>=l.row&&e.row<=r.row&&(n=!0,e.column>r.column?o="right":e.column<l.column&&(o="left"),e.row=r.row);let a=!1;e.column>=l.column&&e.column<=r.column&&(a=!0,e.row>r.row?o="bottom":e.row<l.row&&(o="top"));let h=l.row===r.row,d=l.column===r.column;if(h&&e.row===l.row&&a||d&&e.column===l.column&&n)return this.unhighlightFloodFillRange(),void(this.m_floodFillRange=[]);if((!n&&!a||e.column<=r.column&&!n)&&(e.column=r.column),n||a||(e.row>r.row?o="bottom":e.row<l.row&&(o="top")),o){let s=l,n=e;this._createRangeWithKeys(s,n,this._extendFloodFillSelectionCallback.bind(this,t,i,o))}else this.unhighlightFloodFillRange()},z.prototype._extendFloodFillSelectionCallback=function(e,t,i,s){let n=s;"top"===i?n.endIndex.row-=1:"bottom"===i?n.startIndex.row=this.m_selectionRange[0].endIndex.row+1:"left"===i?n.endIndex.column-=1:n.startIndex.column=this.m_selectionRange[0].endIndex.column+1;let o=[];this.unhighlightFloodFillRange(),o.push(n),this.m_floodFillRange=o,this.m_floodFillDirection="flood",this.highlightFloodFillRange(n)},z.prototype._addFloodfillAffordance=function(e){if(null==this.m_bottomFloodFillIconContainer){var t=e.target,i=this.findCell(t);if(i||(i=this.findHeader(t)),!i)return;this._attachFloodFillIcon()}},z.prototype._attachFloodFillIcon=function(){this.m_bottomFloodFillIconContainer=document.createElement("div"),this.m_bottomFloodFillIconContainer.className=this.getMappedStyle("toucharea");var e=document.createElement("div");e.className=this.getMappedStyle("floodfillaffordance"),e.setAttribute("role","button"),this.m_bottomFloodFillIconContainer.appendChild(e),this.m_databody.firstChild.appendChild(this.m_bottomFloodFillIconContainer),this.m_floodFillAffordanceHeight=this.m_bottomFloodFillIconContainer.firstElementChild.offsetHeight,this.m_floodFillAffordanceWidth=this.m_bottomFloodFillIconContainer.firstElementChild.offsetWidth,this.m_options.isFloodFillEnabled()&&(this.m_bottomFloodFillIconContainer.addEventListener("mouseover",this.handleFloodFillAffordanceMouseOver.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mousedown",this.handleFloodFillAffordanceMouseDown.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mouseup",this.handleFloodFillAffordanceMouseUp.bind(this)),this.m_bottomFloodFillIconContainer.addEventListener("mouseleave",this.handleFloodFillAffordanceMouseLeave.bind(this)))},z.prototype.handleFloodFillAffordanceMouseOver=function(e){if(0===e.buttons){e.currentTarget.parentNode.parentNode.style.cursor="crosshair",this.m_cursor="crosshair"}},z.prototype.handleFloodFillAffordanceMouseDown=function(){this.m_databodyDragState=!0,this.m_floodFillDragState=!0,this.m_selectionRange=null,this.m_floodFillRange=null;const e=[this.m_databody,this.m_databodyFrozenCol,this.m_databodyFrozenRow,this.m_databodyFrozenCorner];for(let t=0;t<e.length;t++)e[t]&&(e[t].style.cursor="crosshair");this.m_cursor="crosshair"},z.prototype.handleFloodFillAffordanceMouseUp=function(e){this.m_databodyDragState=!1,this.m_floodFillDragState=!1;e.currentTarget.parentNode.parentNode.style.cursor="default",this.m_cursor="default",this.m_selectionRange=null,this.m_floodFillRange=null},z.prototype.handleFloodFillAffordanceMouseLeave=function(e){if(0===e.buttons){this.m_databodyDragState=!1,this.m_floodFillDragState=!1;e.currentTarget.parentNode.parentNode.style.cursor="default",this.m_cursor="default"}},z.prototype._removeFloodFillAffordance=function(){this._isDatabodyCellActive()&&this.m_bottomFloodFillIconContainer&&this.m_bottomFloodFillIconContainer.parentNode&&(this.m_databody.style.cursor="default",this.m_cursor="default",this.m_bottomFloodFillIconContainer.parentNode.removeChild(this.m_bottomFloodFillIconContainer))},z.prototype._moveFloodFillAffordance=function(){var e=this.getResources().isRTLMode()?"right":"left",t=this.GetSelection();if(t.length>0){var i=this._getTouchSelectionAffordanceSize();if(null!=this.m_bottomFloodFillIconContainer){var s=this._getCellByIndex(t[t.length-1].endIndex);if(s)if(this.setElementDir(this.m_bottomFloodFillIconContainer,this.getElementDir(s,"top")+this.getElementHeight(s)-i+this.m_floodFillAffordanceHeight+1,"top"),this.setElementDir(this.m_bottomFloodFillIconContainer,this.getElementDir(s,e)+this.getElementWidth(s)-(i-this.m_floodFillAffordanceWidth)+1,e),s.classList.contains(this.getMappedStyle("frozenCell"))){this._getCellContainer(s).firstChild.appendChild(this.m_bottomFloodFillIconContainer)}else this.m_databody.firstChild.appendChild(this.m_bottomFloodFillIconContainer);else this._removeFloodFillAffordance()}}},z.prototype.handleDragStart=function(e){let t,i=e.target,s=this.findHeader(i);if(s){let i=this.getHeaderCellAxis(s),n=this.getHeaderCellLevel(s),o=this.getHeaderCellIndex(s);if(this.m_options._isDragEnabled(i)){let l,r,a,h=this.m_selection,d=0,m=0,c=1,u=this.m_options.options.dnd.drag,_="row"===i||"rowEnd"===i?u.rows.dataTypes:u.columns.dataTypes,p="row"===i||"rowEnd"===i?"rows":"columns",g=[],C=[],f=[],y=JSON.parse(JSON.stringify(h));y.sort((e,t)=>e.startIndex[i]<t.startIndex[i]?-1:1),"row"===i||"rowEnd"===i?(a=-1!==this.m_endRowEndHeader,this.m_rowHeader&&(l=this.m_rowHeaderLevelCount-1),this.m_rowEndHeader&&(r=this.m_rowEndHeaderLevelCount-1)):(a=-1!==this.m_endColEndHeader,this.m_colHeader&&(l=this.m_columnHeaderLevelCount-1),this.m_endColHeader&&(r=this.m_columnEndHeaderLevelCount-1));let E="row"===i||"rowEnd"===i?"row":"column";[g,C]=this._getHeadersInSelection(n,y,E,a),g&&g[l]&&f.push(...g[l]),C&&C[r]&&f.push(...C[r]),[t,c,d,m]=this._getCellsForDndContainer(E,y,f,c),this._cellsDragged=t,this.m_dragIndex=o,this.m_dragHeader=s,this._setDragRowsData(e,_);const v=this.m_utils.containsCSSClassName(s,this.getMappedStyle("endheadercell"));this._setDragImage(e,E,t,d,m,c,v,g,C),this._draggedElements=[];for(let e=0;e<h.length;e++){let t=this.getElementsInRange(h[e]);this._draggedElements.push(...t);for(let e=0;e<t.length;e++)this._highlightElement(t[e],["dragSourceOpaque"]);this._applyBorderClassesAroundRange(t,h[e],!1,"Selected")}const w=s[[this.getResources().getMappedAttribute("context")]];"expanded"===w.metadata.expanded&&null!==w.metadata.treeDepth&&this._disableChildElements(i);let H={range:y,axis:E};return this._invokeDndCallback("drag",p,"dragStart",e,H)}e.preventDefault()}},z.prototype._getHeadersInSelection=function(e,t,i){let s={},n={};for(let o=0;o<t.length;o++){let l=[...this.getHeadersByRange(t[o],i)];for(let e=l.length-1;e>=0;e--)this.m_utils.containsCSSClassName(l[e],this.getMappedStyle("selected"))||l.splice(e,1);[s,n]=this._getHeadersUnderLevel(e,l,i,s,n)}return[s,n]},z.prototype._getHeadersUnderLevel=function(e,t,i,s,n){let o="row"===i?this.m_rowHeaderLevelCount:this.m_columnHeaderLevelCount,l="row"===i?this.m_rowEndHeaderLevelCount:this.m_columnEndHeaderLevelCount;for(let i=0;i<t.length;i++){let r=this.getHeaderCellLevel(t[i]);const a=this.m_utils.containsCSSClassName(t[i],this.getMappedStyle("endheadercell"));a?a&&(n[r]||(n[r]=[]),(l>1&&r>=e||1===l)&&n[r].push(t[i])):(s[r]||(s[r]=[]),(o>1&&r>=e||1===o)&&s[r].push(t[i]))}return[s,n]},z.prototype.handleRowDragEnd=function(e){return this._destroyDragImage(),this._unhighlightDragSource(),this._removeDropTargetLine("row"),this._removeDropTargetClass(),this._enableChildElements(),this.m_databodyReorder=!1,this._removeDragStyle("row"),this.m_dragIndex=null,this._invokeDndCallback("drag","rows","dragEnd",e,this._cellsDragged)},z.prototype.handleRowDragOver=function(e){this.m_databodyReorder=!0;let t="row",i=this._getOverIndex(e,t),s=-1===i?0:i,n=this.getResources().isRTLMode()?"right":"left",o=this._getHeaderCellByIndex(s,t,this.m_rowHeaderLevelCount),l=this._isHeaderWithinSelection(o,t);if(void 0!==i&&this.m_dragIndex!==i){let r;if(this.m_utils.containsCSSClassName(o,this.getMappedStyle("disabledElement")))this._removeDropTargetLine(t),this._removeDropTargetClass(),this.m_dropRowIndex=null;else{let a=this._getRelativePosition(e,t,o,!0),h=this._getDropContext(e,this.m_dropRowIndex,"row");if(r=this._invokeDropCallback("rows","dragOver",e,h),(!1===r||e.defaultPrevented)&&(this._removeDropTargetLine(t),this._removeDropTargetClass(),!l))if("inside"===a)this._highlightElement(o,["dropTarget"]),this._highlightCellsAlongAxis(i,t,"index","add",["dropTarget"]);else{let e=this.getElementDir(o,"top");e+=-1===i?0:this.getElementHeight(o),this._hasFrozenRows()&&i>this.m_frozenRowIndex&&(e+=this.getElementHeight(this.m_databodyFrozenRow)),this._addDropTargetLine(t,e,n,0,s)}}return r}},z.prototype.handleDatabodyDragOver=function(e){let t;this.m_databodyReorder=!0,t=this._matchDragDataType(e,"rows")?"row":"column";let i=this._getOverIndex(e,t),s=this.getResources().isRTLMode()?"right":"left";if(i){let n=JSON.parse(JSON.stringify(i));-1===i[t]&&(n[t]=0);let o=this._getCellByIndex(n);if(o){let l,r=this._getRelativePosition(e,t,o,!1),a=this.m_utils.containsCSSClassName(o,"selected");if(this.m_utils.containsCSSClassName(o,this.getMappedStyle("disabledElement")))this._removeDropTargetLine(t),this._removeDropTargetClass(),"row"===t?this.m_dropRowIndex=null:this.m_dropColumnIndex=null;else if(l="row"===t?this._invokeDropCallback("rows","dragOver",e,{index:this.m_dropRowIndex,position:r,axis:"row"}):this._invokeDropCallback("columns","dragOver",e,{index:this.m_dropColumnIndex,position:r,axis:"column"}),(!1===l||e.defaultPrevented)&&(this._removeDropTargetLine(t),this._removeDropTargetClass(),!a)){let e;"inside"===r?this._highlightCellsAlongAxis(i,t,"index","add",["dropTarget"]):"row"===t?(e=this.getElementDir(o,"top"),e+=-1===i[t]?0:this.getElementHeight(o),this._hasFrozenRows()&&i[t]>this.m_frozenRowIndex&&(e+=this.getElementHeight(this.m_databodyFrozenRow)),this._addDropTargetLine(t,e,s,0,n)):(e=this.getElementDir(o,s),e+=-1===i[t]?0:this.getElementWidth(o),this._hasFrozenColumns()&&i[t]>this.m_frozenColIndex&&(e+=this.getElementWidth(this.m_databodyFrozenCol)),this._addDropTargetLine(t,0,s,e,n))}return l}}},z.prototype.handleDatabodyDrop=function(e){let t;t=this._matchDragDataType(e,"rows")?"row":"column";let i,s,n=this.getResources().isRTLMode()?"right":"left",o=e.target.getBoundingClientRect();this._destroyDragImage(),this._removeDropTargetLine(t),this._removeDropTargetClass();let l="after";if("row"===t){i=this.m_dropRowIndex,e.clientY-o.top<.4*o.height&&(l="before"),this.m_dropRowIndex=null,s={index:i,position:l,axis:"row"}}else{i=this.m_dropColumnIndex,Math.abs(e.clientX-o[n])<.4*o.width&&(l="before"),this.m_dropColumnIndex=null,s={index:i,position:l,axis:"column"}}this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==i&&this._invokeDropCallback(`${t}s`,"drop",e,s)},z.prototype.handleRowDragEnter=function(e){if(this._getOverIndex(e,"row"),this.m_dropRowIndex){let t=this._getDropContext(e,this.m_dropRowIndex,"row");return this._invokeDropCallback("rows","dragEnter",e,t)}},z.prototype.handleDatabodyDragEnter=function(e){let t;t=this._matchDragDataType(e,"rows")?"row":"column";let i=this._getOverIndex(e,t);if(i){let s=JSON.parse(JSON.stringify(i));-1===i[t]&&(s[t]=0);let n=this._getCellByIndex(s);if(n){let s={index:i,position:this._getRelativePosition(e,t,n,!1),axis:t};if(this.m_dropRowIndex)return this._invokeDropCallback("rows","dragEnter",e,s)}}},z.prototype.handleRowDragLeave=function(e){let t=this._getDropContext(e,this.m_dropRowIndex,"row");var i=this._invokeDndCallback("drop","rows","dragLeave",e,t);return this.m_dropRowIndex=null,i},z.prototype.handleRowDrag=function(e){return!this.m_dragImageAttached&&this.m_utils.isTouchDevice()&&(document.body.appendChild(this.m_dndContainer),this.m_dragImageAttached=!0),this._invokeDndCallback("drag","rows","drag",e)},z.prototype.handleRowDrop=function(e){let t=this.m_dropRowIndex;if(null===this.m_dropRowIndex&&(t=this._getOverIndex(e,"row")),this._destroyDragImage(),this._removeDropTargetLine("row"),this._removeDropTargetClass(),this.m_dropRowIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==t){let i=this._getDropContext(e,t,"row");this._invokeDropCallback("rows","drop",e,i)}},z.prototype.handleColumnDragEnd=function(e){let t="column";return this._destroyDragImage(),this._unhighlightDragSource(),this._removeDragStyle(t),this._removeDropTargetLine(t),this._removeDropTargetClass(),this._enableChildElements(),this.m_dragIndex=null,this._invokeDndCallback("drag","columns","dragEnd",e)},z.prototype.handleColumnDragOver=function(e){this.m_databodyReorder=!0;let t="column",i=this._getOverIndex(e,t),s=-1===i?0:i,n=this.getResources().isRTLMode()?"right":"left",o=this._getHeaderCellByIndex(s,t,this.m_columnHeaderLevelCount);if(this.m_utils.containsCSSClassName(o,this.getMappedStyle("disabledElement")))this._removeDropTargetLine(t),this._removeDropTargetClass(),this.m_dropColumnIndex=null;else if(void 0!==i&&o){let l=this._getRelativePosition(e,t,o,!0),r={axis:"column",position:l,index:this.m_dropColumnIndex},a=this._invokeDropCallback("columns","dragOver",e,r);if(!1===a||e.defaultPrevented)if(this._removeDropTargetLine(t),this._removeDropTargetClass(),"inside"===l)this._highlightElement(o,["dropTarget"]),this._highlightCellsAlongAxis(i,t,"index","add",["dropTarget"]);else{let e=this.getElementDir(o,n);e+=-1===i?0:this.getElementWidth(o),this._hasFrozenColumns()&&i>this.m_frozenColIndex&&(e+=this.getElementWidth(this.m_databodyFrozenCol)),this._addDropTargetLine(t,0,n,e,s)}return a}},z.prototype.handleColumnDragEnter=function(e){this._getOverIndex(e,"column");let t=this._getDropContext(e,this.m_dropColumnIndex,"column");return this._invokeDropCallback("columns","dragEnter",e,t)},z.prototype.handleColumnDragLeave=function(e){let t=this._getDropContext(e,this.m_dropColumnIndex,"column");var i=this._invokeDndCallback("drop","columns","dragLeave",e,t);return this.m_dropColumnIndex=null,i},z.prototype.handleColumnDrag=function(e){return this._invokeDndCallback("drag","columns","drag",e)},z.prototype.handleColumnDrop=function(e){let t=this.m_dropColumnIndex;if(null===this.m_dropColumnIndex&&(t=this._getOverIndex(e,"column")),this._destroyDragImage(),this._removeDropTargetLine("column"),this._removeDropTargetClass(),this.m_dropColumnIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==t){let i=this._getDropContext(e,t,"column");this._invokeDropCallback("columns","drop",e,i)}},z.prototype._computeDndContainerOffsetHeight=function(e,t,i,s){let n=0;if("row"===e)for(let e=0;e<t.length;e++){n+=t[e].offsetHeight}else{let e=t[0].offsetHeight;i&&(e+=s[0].offsetHeight),n=this.m_databody.offsetHeight+e}return n},z.prototype._computeDndContainerOffsetWidth=function(e,t,i,s){let n=0;if("row"===e){let e=t[0].offsetWidth;i&&(e+=s[0].offsetWidth),n=this.m_databody.offsetWidth+e}else for(let e=0;e<t.length;e++){n+=t[e].offsetWidth}return n},z.prototype._getCellsForDndContainer=function(e,t,i,s){let n,o,l=[],r=this.getResources().isRTLMode()?"right":"left",a=this.m_databody.scrollLeft,h=this.m_databody.scrollTop,d=0,m=0;o="row"===e?-1!==this.m_endRowEndHeader:-1!==this.m_endColEndHeader,n="row"===e?"width":"height";let c=Math.abs(a);"column"===e&&(r="top",c=h);for(let a=0,h=0;a<t.length;a++)for(let u=t[a].startIndex[e];u<=t[a].endIndex[e];u++){let t,a=this._getAxisCellsByIndex(u,e);i[h]&&l.push(i[h]);for(let e=0;e<a.length;e++)if(this.getElementDir(a[e],r)>c){t=e-1;break}a=a.slice(t,a.length);let _=0,p=this.getElementDir(this.m_databody,n);"row"===e&&this._hasFrozenColumns()&&(p+=this.getElementWidth(this.m_databodyFrozenCol)),"column"===e&&this._hasFrozenRows()&&(p+=this.getElementHeight(this.m_databodyFrozenRow));for(let e=0;e<a.length;e++)if(_+=this.getElementDir(a[e],n),_>p){t=e;break}t>0&&(a=a.slice(0,t+1)),l.push(...a),o&&l.push(i[Math.ceil(i.length/2+h)]),"row"!==e||d?"column"===e&&(d+=this.getElementDir(i[h],"width")):d=this._computeContainerDimension(l,"width"),"column"!==e||m?"row"===e&&(m+=this.getElementDir(i[h],"height")):m=this._computeContainerDimension(l,"height"),h+=1,s=a.length}return[l,s,d,m]},z.prototype._computeContainerDimension=function(e,t){let i=0;for(let s=0;s<e.length;s++)i+=this.getElementDir(e[s],t);return i},z.prototype._setDragImage=function(e,t,i,s,n,o,l,r,a){let h=this.getResources().isRTLMode()?"right":"left",d=this._populateDndContainer(i,t,h,o,r,a,s,n),m=Math.max(0,e.offsetX),c=Math.max(0,e.offsetY);l?(m="row"===t&&"left"===h?s-m:m,c="column"===t?n-c:c):m="row"===t&&"left"===h?m:s-m,e.dataTransfer.setDragImage(d,m,c)},z.prototype._computeDndContainerCellCountInRow=function(e,t){let i,s=e,n=1;return i="row"===t||"rowEnd"===t?-1!==this.m_endRowEndHeader:-1!==this.m_endColEndHeader,i&&(n=2),s+=n,s},z.prototype._populateDndContainer=function(e,t,i,s,n,o,l,r){let a=document.getElementById("dndContainer");a||(a=document.createElement("div"),a.setAttribute("id","dndContainer"),a.setAttribute("class","dndContainer"));let h=[this.getMappedStyle("focus"),this.getMappedStyle("hover"),this.getMappedStyle("active"),this.getMappedStyle("topSelected"),this.getMappedStyle("startSelected"),this.getMappedStyle("bottomSelected"),this.getMappedStyle("endSelected"),this.getMappedStyle("selected")],d=0,m=0,c=0,u=0;this._headersDragged=[];let _=this._computeDndContainerCellCountInRow(s,t);[u,c]=this._appendNestedHeadersToContainer(i,t,a,d,m,n,!1),m=u,d=c;for(let s=0;s<e.length;s++){let n=e[s],o=n.cloneNode(!0);o.classList.remove(...h),o.setAttribute("draggable",!1),o.style.top=`${d}px`,o.style[i]=`${m}px`,"row"===t?(s%_==0?m=u+n.offsetWidth:m+=n.offsetWidth,s%_==_-1&&(d+=n.offsetHeight,s===e.length-1?d=0:m=u)):(s%_==0?d=c+n.offsetHeight:d+=n.offsetHeight,s%_==_-1&&(m+=n.offsetWidth,s===e.length-1?m=0:d=c)),a.appendChild(o),n.classList.add("drag-source-opaque")}return[u,c]=this._appendNestedHeadersToContainer(i,t,a,d,m,o,!0),a.style.width=`${l}px`,a.style.height=`${r}px`,"column"===t?a.style.height=`${r+c}px`:a.style.width=`${l+u}px`,this.m_utils.isTouchDevice()?(this.m_dragImageAttached=!1,this.m_dndContainer=a):document.body.appendChild(a),a},z.prototype._appendNestedHeadersToContainer=function(e,t,i,s,n,o,l){let r;l?(this.m_rowEndHeaderLevelCount||this.m_columnEndHeaderLevelCount)&&(r="row"===t?this.m_rowEndHeaderLevelCount-1:this.m_columnEndHeaderLevelCount-1):r="row"===t?this.m_rowHeaderLevelCount-1:this.m_columnHeaderLevelCount-1;let a=Object.keys(o),h=[this.getMappedStyle("focus"),this.getMappedStyle("hover"),this.getMappedStyle("active"),this.getMappedStyle("selected")];l&&(a=a.reverse());for(let l=0;l<a.length;l++){let d=parseInt(a[l],10);if(d!==r){let l=o[d].length;for(let r=0;r<o[d].length;r++){let a=o[d][r];this._headersDragged.push(a);let m=a.cloneNode(!0);m.classList.remove(...h),m.style.top=`${s}px`,m.style[e]=`${n}px`,"row"===t?(r%l==0?s=a.offsetHeight:s+=a.offsetHeight,r===l-1&&(n+=a.offsetWidth,s=0)):(r%l==0?n=a.offsetWidth:n+=a.offsetWidth,r===l-1&&(n=0,s+=a.offsetHeight)),i.appendChild(m),a.classList.add("drag-source-opaque")}}}return[n,s]},z.prototype._destroyDragImage=function(){let e=document.getElementById("dndContainer");e&&e.parentNode.removeChild(e),this.m_dragImageAttached=!1,this.m_dndContainer=null},z.prototype._setDragRowsData=function(e,t){if(t){let i=e.dataTransfer,s=JSON.stringify(this.m_selection);if("string"==typeof t)i.setData(t,s);else for(let e=0;e<t.length;e++)i.setData(t[e],s)}},z.prototype._getOverIndex=function(e,t){let i,s,n,o=e.target,l=this.getResources().isRTLMode()?"right":"left",r=o.getBoundingClientRect(),a=this.findHeader(o),h=!1,d=!1;if(a?(s=a[this.getResources().getMappedAttribute("context")],n=s.index,"column"===t?this.m_dropColumnIndex=n:this.m_dropRowIndex=n,h=this._isParentNode(s),d=this._isLeafNode(s)):(i=this.findCell(o),i&&(s=i[this.getResources().getMappedAttribute("context")],n=s.indexes,"column"===t?this.m_dropColumnIndex=s.indexes[t]:this.m_dropRowIndex=s.indexes[t])),void 0!==n){let o,m="width";if("column"===t?o=Math.abs(e.clientX-r[l]):(o=e.clientY-r.top,m="height"),a&&(h||d))o<.25*r[m]&&(n-=1);else if(o<.4*r[m])if(a)n-=1;else if(i&&void 0!==n){let e=s.indexes.row,i=s.indexes.column;n="row"===t?this.createIndex(e-1,i):this.createIndex(e,i-1)}}return n},z.prototype._getRelativePosition=function(e,t,i,s){let n,o=e.target,l=this.getResources().isRTLMode()?"right":"left",r=o.getBoundingClientRect(),a=!1,h=!1,d="before",m=i[this.getResources().getMappedAttribute("context")];s&&(a=this._isParentNode(m),h=this._isLeafNode(m));let c="width";return"column"===t?n=Math.abs(e.clientX-r[l]):(n=e.clientY-r.top,c="height"),i&&(a||h)?n>=.25*r[c]&&n<=.75*r[c]?d="inside":n>.75*r[c]&&(d="after"):n>.4*r[c]&&(d="after"),d},z.prototype._addDropTargetLine=function(e,t,i,s,n){let o="row"===e?"rowDropTargetLine":"colDropTargetLine";this.m_dropTarget=document.createElement("div"),this.m_dropHeaderTarget=document.createElement("div"),this.m_dropEndHeaderTarget=document.createElement("div"),this._setAttribute(this.m_dropTarget,"index",n);let l=this.m_databody,r=this.m_rowHeader,a=this.m_rowEndHeader;"column"===e&&(r=this.m_colHeader,a=this.m_colEndHeader),"row"===e&&this._hasFrozenRows()&&n<=this.m_frozenRowIndex?(l=this.m_databodyFrozenRow,r=this.m_rowHeaderFrozen,a=this.m_rowEndHeaderFrozen):"column"===e&&this._hasFrozenColumns()&&n<=this.m_frozenColIndex&&(l=this.m_databodyFrozenCol,r=this.m_colHeaderFrozen,a=this.m_colEndHeaderFrozen);const h=function(t,s,o,l,a,h,d,m,c){let u="row"===e?this._getCornerDimensions("height"):this._getCornerDimensions("width");if("row"===e){let e=Math.abs(this.getElementDir(r.firstChild,"top"));0!==e&&(s-=e),t=s+=u,o=s,this._hasFrozenColumns()&&n<=this.m_frozenRowIndex&&(d+=this.getElementWidth(this.m_databodyFrozenCol))}else{let e=Math.abs(this.getElementDir(r.firstChild,i));0!==e&&(a-=e),l=a+=u,h=a,this._hasFrozenRows()&&n<=this.m_frozenColIndex&&(d+=this.getElementHeight(this.m_databodyFrozenRow))}return[t,s,o,l,a,h,d,m,c]}.bind(this);this._addVisualIndicator(e,t,i,s,o,this.m_dropTarget,this.m_dropHeaderTarget,this.m_dropEndHeaderTarget,l,r,a,h),this._addDnDVisualIndicatorEventListener()},z.prototype._addVisualIndicator=function(e,t,i,s,n,o,l,r,a,h,d,m){let c,u="width",_="width";"row"===e?c=-1!==this.m_endRowEndHeader:(u="height",_="height",c=-1!==this.m_endColEndHeader);let[p,g,C,f,y,E,v,w,H]=this._calculateVisualIndicatorPosition(a,h,d,t,s,i,e);m&&"function"==typeof m&&([p,g,C,f,y,E,v,w,H]=m(p,g,C,f,y,E,v,w,H)),this._setVisualIndicatorStyle(o,n,p,i,f,v,u),this._setVisualIndicatorStyle(l,n,g,i,y,w,_),c&&this._setVisualIndicatorStyle(r,n,C,i,E,H,_),this.m_root.appendChild(o),this.m_root.appendChild(l),c&&this.m_root.appendChild(r)},z.prototype._addDnDVisualIndicatorEventListener=function(){this.m_dropTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropHeaderTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropEndHeaderTarget.addEventListener("dragover",this.handleDropTargetDragOver.bind(this),!1),this.m_dropTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1),this.m_dropHeaderTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1),this.m_dropEndHeaderTarget.addEventListener("drop",this.handleDropTargetDrop.bind(this),!1)},z.prototype._setVisualIndicatorStyle=function(e,t,i,s,n,o,l){this.m_utils.addCSSClassName(e,this.getMappedStyle(t)),this.setElementDir(e,i,"top"),this.setElementDir(e,n,s),"width"===l?this.setElementWidth(e,o):this.setElementHeight(e,o)},z.prototype._calculateVisualIndicatorPosition=function(e,t,i,s,n,o,l){let r=s,a=n,h=s,d=n,m=s,c=n,u=0,_=0,p=0,g="row"===l?this.getElementWidth.bind(this):this.getElementHeight.bind(this);return u=g(e.firstChild),_=g(t.firstChild),p=g(i.firstChild),"column"===l?r+=_:a+=_,"row"===l&&this.m_rowEndHeader?c=n+this.getElementDir(this.m_rowEndHeader,o):"column"===l&&this.m_colEndHeader&&(m=s+this.getElementDir(this.m_colEndHeader,"top")),[r,h,m,a,d,c,u,_,p]},z.prototype._getCornerDimensions=function(e){let t=0,i=0;return this.m_corner&&(t=this.getElementHeight(this.m_corner),i=this.getElementWidth(this.m_corner)),e?"height"===e?t:i:[t,i]},z.prototype._setDropTargetLineStyle=function(e,t,i,s,n,o,l){this.m_utils.addCSSClassName(e,this.getMappedStyle(t)),this.setElementDir(e,i,"top"),this.setElementDir(e,n,s),"width"===l?this.setElementWidth(e,o):this.setElementHeight(e,o)},z.prototype._removeDropTargetLine=function(){this._removeDropTargetEventListeners(),this._remove(this.m_dropTarget),this._remove(this.m_dropHeaderTarget),this.m_dropEndHeaderTarget&&this._remove(this.m_dropEndHeaderTarget)},z.prototype._removeDropTargetEventListeners=function(){this.m_dropTarget&&(this.m_dropTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropTarget.removeEventListener("drop",this.handleDropTargetDrop,!1)),this.m_dropHeaderTarget&&(this.m_dropHeaderTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropHeaderTarget.removeEventListener("drop",this.handleDropTargetDrop,!1)),this.m_dropEndHeaderTarget&&(this.m_dropEndHeaderTarget.removeEventListener("dragover",this.handleDropTargetDragOver,!1),this.m_dropEndHeaderTarget.removeEventListener("drop",this.handleDropTargetDrop,!1))},z.prototype._removeDropTargetClass=function(){let e=document.querySelectorAll(`.${this.getMappedStyle("dropTarget")}`);e&&e.length&&this._unhighlightElementsByClassName(e,["dropTarget"])},z.prototype._isHeaderWithinSelection=function(e,t){let i=this.getHeaderCellIndex(e),s=!1;if(this.m_selection&&this.m_selection.length)for(let n=0;n<this.m_selection.length;n++){let o=this._getHeadersWithinSelection(this.m_selection[n],i,t);for(let t=0;t<o.length;t++)if(o[t]===e&&o[o.length-1]!==e){s=!0;break}}return s},z.prototype._invokeDndCallback=function(e,t,i,s,n){let o,l=this.m_options.options.dnd[e];if(l&&l[t]){let e=l[t][i];if(e&&"function"==typeof e)try{this.m_customElement?e(s,n):o=e(s,n)}catch(e){throw new Error(e)}}return o},z.prototype._invokeDropCallback=function(e,t,i,s){var n=this._invokeDndCallback("drop",e,t,i,s);return void 0===n&&this._matchDragDataType(i,e)&&i.preventDefault(),n},z.prototype._matchDragDataType=function(e,t){var i=e.dataTransfer.types,s=this.m_options.options.dnd.drop;if(s&&s[t]&&s[t].dataTypes)for(var n=s[t].dataTypes,o="string"==typeof n?[n]:n,l=0;l<i.length;l++)if(o.indexOf(i[l])>=0)return!0;return!1},z.prototype.handleCancelDrag=function(){this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals()},z.prototype._resetDragInternals=function(){this._draggedElements=[],this._cellsDragged=[],this._headersDragged=[],this.m_dragIndex=null,this.m_dragHeader=null,this.m_databodyReorder=!1},z.prototype._disableChildElements=function(e){const t=this.getResources().getMappedAttribute("context");let i="row"===e?this.m_rowHeader:this.m_colHeader;i=i.querySelectorAll(`.${this.getResources().getMappedStyle("headercell")}`);let s=this._getLogicalChildHeaderNodes(i,e,this.m_dragHeader,this.m_dragIndex+1);for(let i=0;i<s.length;i++){let n=s[i][t].index;this._highlightCellsAlongAxis(n,e,"index","add",["disabledElement"]),this._highlightElement(s[i],["disabledElement"])}},z.prototype._getLogicalChildHeaderNodes=function(e,t,i,s){const n=this.getResources().getMappedAttribute("context");let o=[];if("row"===t){let t=i[n].metadata.treeDepth;for(let i=s;i<e.length;i++){if(!(t<e[i][n].metadata.treeDepth))break;o.push(e[i])}}else{let t=i[n].level;for(let i=s;i<e.length;i++){if(!(t<e[i][n].level))break;o.push(e[i])}}return o},z.prototype._enableChildElements=function(){let e=this.getMappedStyle("disabledElement"),t=document.querySelectorAll(`.${e}`);this._unhighlightElementsByClassName(t,["disabledElement"])},z.prototype._unhighlightDragSource=function(){if(this._cellsDragged&&this._cellsDragged.length){let e=["draggableItem","dragSourceOpaque"];this._unhighlightElementsByClassName(this._draggedElements,e),this._unhighlightElementsByClassName(this._cellsDragged,e),this._unhighlightElementsByClassName(this._headersDragged,e)}},z.prototype._removeDragStyle=function(e){let t="row"===e?this.m_rowHeader:this.m_rowEndHeader,i="row"===e?this.m_colHeader:this.m_colEndHeader,s=this.getMappedStyle("dragging"),n=t.firstChild.querySelectorAll(`.${s}`);this._unhighlightElementsByClassName(n,["dragging"]),-1!==this.m_endRowEndHeader&&(n=i.firstChild.querySelectorAll(`.${s}`),this._unhighlightElementsByClassName(n,["dragging"]))},z.prototype._getDropContext=function(e,t,i){let s=e.target,n=this.findHeader(s);return{index:t,axis:i,position:this._getRelativePosition(e,i,n,!0)}},z.prototype.handleDropTargetDragOver=function(e){let t=e.target,i=this.m_utils.containsCSSClassName(t,this.getMappedStyle("rowDropTargetLine"))?"row":"column",s={axis:i,position:"after",index:this._getAttribute(this.m_dropTarget,"index")},n="row"===i||"rowEnd"===i?"rows":"columns";this._invokeDropCallback(n,"dragOver",e,s)},z.prototype.handleDropTargetDrop=function(e){let t=e.target,i=this.m_utils.containsCSSClassName(t,this.getMappedStyle("rowDropTargetLine"))?"row":"column",s=this._getAttribute(this.m_dropTarget,"index"),n="row"===i||"rowEnd"===i?"rows":"columns";if(this._destroyDragImage(),this._removeDropTargetLine(i),this._removeDropTargetClass(),"row"===i?this.m_dropRowIndex=null:this.m_dropColumnIndex=null,this._unhighlightDragSource(),this._enableChildElements(),this._resetDragInternals(),null!==s){let t={axis:i,position:"after",index:s};this._invokeDropCallback(n,"drop",e,t)}},z.prototype._populateFrozenContainer=function(e,t,i,s,n,o,l,r){let a=document.createDocumentFragment(),h=this._addCellsToFragment(a,t,i,s,n,o,l,r);return this._populateDatabody(e,a),this.m_initialized||this._setScrollerDimension(e.parentElement,h.totalRowHeight,h.totalColumnWidth),h},z.prototype._addFrozenIndicator=function(e,t,i,s,n){const o="row"===e?"rowFrozenIndicator":"colFrozenIndicator",l="FrozenIndicator",r=this.createSubId(`databody${e}${l}`),a=this.createSubId(`${e}header${l}`),h=this.createSubId(`${e}endHeader${l}`);if(null===document.getElementById(r)){const t=document.createElement("div");t.id=r,"row"===e?this.m_databodyRowFrozenTarget=t:this.m_databodyColFrozenTarget=t,this._setAttribute(t,"index",n)}if(null===document.getElementById(a)){const t=document.createElement("div");t.id=a,"row"===e?this.m_rowHeaderFrozenTarget=t:this.m_colHeaderFrozenTarget=t}if(null===document.getElementById(h)){const t=document.createElement("div");t.id=h,"row"===e?this.m_rowEndHeaderFrozenTarget=t:this.m_colEndHeaderFrozenTarget=t}const d=function(t,s,n,o,l,r,a,h,d){let m="row"===e?this.getElementWidth.bind(this):this.getElementHeight.bind(this);return this._hasFrozenRows()&&this._hasFrozenColumns()?a+=m(this.m_databodyFrozenCorner.firstChild):this._hasFrozenRows()&&"column"===e?a+=m(this.m_databodyFrozenRow.firstChild):this._hasFrozenColumns()&&"row"===e&&(a+=m(this.m_databodyFrozenCol.firstChild)),"row"===e&&-1===this.m_endRowHeader&&this.m_headerLabels.column&&this.m_headerLabels.column.length&&(o=this._hasFrozenColumns()?this.getElementDir(this.m_databodyFrozenCol,i):this.getElementDir(this.m_databody,i)),"column"===e&&-1===this.m_endColHeader&&this.m_headerLabels.row&&this.m_headerLabels.row.length&&(t=this.getElementHeight(this.m_headerLabels.row[0])),[t,s,n,o,l,r,a,h,d]}.bind(this);"row"===e?this._addVisualIndicator(e,t,i,s,o,this.m_databodyRowFrozenTarget,this.m_rowHeaderFrozenTarget,this.m_rowEndHeaderFrozenTarget,this.m_databodyFrozenRow,this.m_rowHeaderFrozen,this.m_rowEndHeaderFrozen,d):this._addVisualIndicator(e,t,i,s,o,this.m_databodyColFrozenTarget,this.m_colHeaderFrozenTarget,this.m_colEndHeaderFrozenTarget,this.m_databodyFrozenCol,this.m_colHeaderFrozen,this.m_colEndHeaderFrozen,d)},z.prototype._removeFrozenIndicator=function(e){if("column"===e){let e=-1!==this.m_endColEndHeader;this.m_root.removeChild(this.m_databodyColFrozenTarget),this.m_root.removeChild(this.m_colHeaderFrozenTarget),e&&this.m_root.removeChild(this.m_colEndHeaderFrozenTarget)}else{let e=-1!==this.m_endRowEndHeader;this.m_root.removeChild(this.m_databodyRowFrozenTarget),this.m_root.removeChild(this.m_rowHeaderFrozenTarget),e&&this.m_root.removeChild(this.m_rowEndHeaderFrozenTarget)}},z.prototype._setFrozenContainerDimension=function(e,t,i,s,n,o){const l=this.getResources().isRTLMode()?"right":"left",r=this.m_databodyFrozenCol,a=this.m_databodyFrozenRow,h=this.m_databodyFrozenCorner,d=this.m_colHeader,m=this.m_colEndHeader,c=this.m_rowHeader,u=this.m_rowEndHeader,_=t,p=e;let g,C,f,y=0,E=0;if(this._hasFrozenColumns()&&(y=this.getElementWidth(r),!y&&(-1!==this.m_endColHeader||-1!==this.m_endColEndHeader))){const e=-1!==this.m_endColHeader?this.m_colHeaderFrozen:this.m_colEndHeaderFrozen;for(let t=0;t<e.firstChild.childElementCount;t++){let i=e.firstChild.childNodes[t];y+=this.getElementWidth(i)}}if(this._hasFrozenRows()&&(E=this.getElementHeight(a),!E&&(-1!==this.m_endRowHeader||-1!==this.m_endRowEndHeader))){const e=-1!==this.m_endRowHeader?this.m_rowHeaderFrozen:this.m_rowEndHeaderFrozen;for(let t=0;t<e.firstChild.childElementCount;t++){let i=e.firstChild.childNodes[t];E+=this.getElementHeight(i)}}if(this._hasFrozenColumns()&&this._hasFrozenRows()&&(C=this.getElementHeight(h),g=this.getElementWidth(h),y||(y=g),E||(E=C)),r&&(f=n),this._hasFrozenColumns()&&this._hasFrozenRows()&&(this._setElementDimension(h,n,i,C,g),f=C+n),this._hasFrozenColumns()&&this._setElementDimension(r,f,i,_,y),this.m_colHeaderFrozen){let e=this.getElementHeight(this.m_colHeaderFrozen);this._setElementDimension(this.m_colHeaderFrozen,0,i,e,y)}if(this.m_colEndHeaderFrozen){let e=this.getElementHeight(this.m_colEndHeaderFrozen);this._setElementDimension(this.m_colEndHeaderFrozen,t+n+E,i,e,y)}const v=this.m_frozenColIndex;if(this._hasFrozenColumns()&&this._addFrozenIndicator("column",0,l,i+y,v),i+=y,this.setElementDir(d,i,l),this.setElementDir(m,i,l),this.setElementHeight(d,n),this.setElementHeight(m,o),a&&this._setElementDimension(a,n,i,E,p),this.m_rowHeaderFrozen){let e=this.getElementWidth(this.m_rowHeaderFrozen);this._setElementDimension(this.m_rowHeaderFrozen,n,0,E,e)}if(this.m_rowEndHeaderFrozen){let t=this.getElementWidth(this.m_rowEndHeaderFrozen);this._setElementDimension(this.m_rowEndHeaderFrozen,n,e+i,E,t)}const w=this.m_frozenRowIndex;return this._hasFrozenRows()&&this._addFrozenIndicator("row",n+E,l,0,w),n+=E,this.setElementDir(c,n,"top"),this.setElementDir(u,n,"top"),this.setElementWidth(c,i-y),this.setElementWidth(u,s),[i,n]},z.prototype._setElementDimension=function(e,t,i,s,n){const o=this.getResources().isRTLMode()?"right":"left";null!==n&&this.setElementWidth(e,n),null!==s&&this.setElementHeight(e,s),null!==t&&this.setElementDir(e,t,"top"),null!==i&&this.setElementDir(e,i,o)},z.prototype._buildFrozenHeaders=function(e,t,i,s){let n=s.start,o={headerStart:s.start,endHeaderStart:s.start,headerFetchCount:0,endHeaderFetchCount:0};if(null===this.m_options._getFreezeIndex(e)||!this._isFreezeFeasible(e,t,i,n,0)){o={headerStart:n,endHeaderStart:n},t&&(o.headerFetchCount=t.getCount()),i&&(o.endHeaderFetchCount=i.getCount()),"column"===e?this.m_frozenColIndex=this.m_options.isFreezeEnabled(e)?-1:null:this.m_frozenRowIndex=this.m_options.isFreezeEnabled(e)?-1:null;let s=this.m_rowHeaderFrozen,l=this.m_rowEndHeaderFrozen;return"column"===e&&(s=this.m_colHeaderFrozen,l=this.m_colEndHeaderFrozen),s&&(this.m_root.removeChild(s),"column"===e?this.m_colHeaderFrozen=null:this.m_rowHeaderFrozen=null),l&&(this.m_root.removeChild(l),"column"===e?this.m_colEndHeaderFrozen=null:this.m_rowEndHeaderFrozen=null),o}return o=this._buildFrozenAxisHeaders(e,t,i,s,o),o},z.prototype._isFreezeFeasible=function(e,t,i,s,n){let o=!1;if(t&&i){if("column"===e&&!this.m_initialized&&(this.m_frozenColIndex>=t.getCount()||this.m_frozenColIndex>=i.getCount())||"row"===e&&!this.m_initialized&&(this.m_frozenRowIndex>=t.getCount()||this.m_frozenRowIndex>=i.getCount()))return o;const l=t.getExtent(s,n),r=i.getExtent(s,n);if(l.more.after||r.more.after)return o;let a=l.extent,h=r.extent;a===h||1===a||1===h?o=!0:a>h?(h+=i.getExtent(s+1,n).extent,a===h&&(o=!0)):(a+=t.getExtent(s+1,n).extent,a===h&&(o=!0));const d=l.extent>r.extent?l.extent:r.extent;if(o&&d>1){const t="row"===e?this.m_frozenRowIndex:this.m_frozenColIndex;let i=this._adjustFrozenIndexBasedOnExtent(t,d);"row"===e?this.m_frozenRowIndex=i:this.m_frozenColIndex=i}}else t&&(!this.m_initialized&&("column"===e&&this.m_frozenColIndex<t.getCount()||"row"===e&&this.m_frozenRowIndex<t.getCount())||this.m_initialized)||i&&(!this.m_initialized&&("column"===e&&this.m_frozenColIndex<i.getCount()||"row"===e&&this.m_frozenRowIndex<i.getCount())||this.m_initialized)?o=!0:t||i||(o=!0);return o},z.prototype._adjustFrozenIndexBasedOnExtent=function(e,t){let i;return i=e>=t?e+(t-e%t)-1:t-1,i},z.prototype._buildFrozenAxisHeaders=function(e,t,i,s,n){let o=s.start,l=this.getDataSource().getCount(e),r=this.buildRowHeaders.bind(this),a=this.buildRowEndHeaders.bind(this),h=this.m_frozenRowIndex,d=this.m_rowHeaderFrozen,m=this.m_rowEndHeaderFrozen;if("column"===e&&(h=this.m_frozenColIndex,d=this.m_colHeaderFrozen,m=this.m_colEndHeaderFrozen,r=this.buildColumnHeaders.bind(this),a=this.buildColumnEndHeaders.bind(this)),null!=t){let i=t.getCount();if(n.headerFetchCount=i,null!==h&&-1!==h&&(!1===this.m_initialized&&(i-=h+1),d&&d.firstChild&&!d.firstChild.childNodes.length)){r(d,t,o,l,!1,!1,h+1,!0);let s=d.firstChild.querySelectorAll(`.${this.getMappedStyle("groupingcontainer")}`);o=this._calculateFrozenIndex(h+1,s),i=t.getCount()-o,"column"===e?(this.m_endColHeaderPixel=0,this.m_frozenColIndex=o-1):(this.m_endRowHeaderPixel=0,this.m_frozenRowIndex=o-1),n.headerFetchCount=i,n.headerStart=o}}if(null!=i){let t=i.getCount();if(n.endHeaderFetchCount=t,null!==h&&-1!==h&&(!1===this.m_initialized&&(t-=h+1),m&&m.firstChild&&!m.firstChild.childNodes.length)){o=s.start,a(m,i,o,l,!1,!1,h+1,!0),"column"===e?this.m_endColEndHeaderPixel=0:this.m_endRowEndHeaderPixel=0,o=h+1;let r=m.firstChild.querySelectorAll(`.${this.getMappedStyle("groupingcontainer")}`);o=this._calculateFrozenIndex(h+1,r),t=i.getCount()-o,n.endHeaderFetchCount=t,n.endHeaderStart=o,"column"===e?this.m_frozenColIndex=o-1:this.m_frozenRowIndex=o-1}}return n},z.prototype._handleFreezeRow=function(e){let t;if(this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection&&this.m_selection.length){let e=[],i=[];-1===this.m_endRowHeader&&-1===this.m_endRowEndHeader||([e,i]=this._getHeadersInSelection(this.m_rowHeaderLevelCount-1,this.m_selection,"row"),-1!==this.m_endRowHeader&&e&&Object.keys(e).length?(e=e[0],t=e[e.length-1]):-1!==this.m_endRowEndHeader&&i&&Object.keys(i).length&&(i=i[0],t=i[i.length-1]))}t||(t=this.findHeader(e.target));let i,s="row",n=!0;const o=this.getResources().getMappedAttribute("context");if(null===t){let l,r;i=this.findCell(e.target),this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection&&this.m_selection.length&&(i=this._getCellByIndex(this.m_selection[0].endIndex));const a=i[o].indexes;let h=!1;if(a.row<this.m_frozenRowIndex+1&&(h=!0),-1!==this.m_endRowHeader&&-1!==this.m_endRowEndHeader){let e=this._isDynamicFreezeFeasible(a.row,s,h);n=e.isFeasible,l=e.headerIndex,r=e.endHeaderIndex,t=this._getMaxExtentNestedHeader(s,l,r,h)}else-1!==this.m_endRowHeader?s="row":-1!==this.m_endRowEndHeader&&(s="rowEnd"),t=this.getHeaderFromCell(i,s)}else{let e,i=t[o].index,l=!1;if(i<this.m_frozenRowIndex+1&&(l=!0),-1!==this.m_endRowHeader&&-1!==this.m_endRowEndHeader){let o=this._isDynamicFreezeFeasible(i,s,l);n=o.isFeasible,i=o.headerIndex,e=o.endHeaderIndex,t=this._getMaxExtentNestedHeader(s,i,e,l)}}if(n){this._mutateRowFrozenContainer(t,i,s),this.deleteAndApplyHiddenIndicators();let n={event:e,ui:{frozenCount:this.m_frozenRowIndex+1}};this.fireEvent("rowFreeze",n)}},z.prototype._handleFreezeCol=function(e){let t;if(this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection&&this.m_selection.length){let e,i;-1===this.m_endColHeader&&-1===this.m_endColEndHeader||([e,i]=this._getHeadersInSelection(this.m_columnHeaderLevelCount-1,this.m_selection,"column"),-1!==this.m_endColHeader&&e&&Object.keys(e).length?(e=e[0],t=e[e.length-1]):-1!==this.m_endColEndHeader&&i&&Object.keys(i).length&&(i=i[0],t=i[i.length-1]))}t||(t=this.findHeader(e.target));let i,s="column",n=!0;const o=this.getResources().getMappedAttribute("context");if(null===t){i=this.findCell(e.target),this._isSelectionEnabled()&&this.isMultipleSelection()&&this.m_selection&&this.m_selection.length&&(i=this._getCellByIndex(this.m_selection[0].endIndex));let l,r,a=i[o].indexes,h=!1;if(a.column<this.m_frozenColIndex+1&&(h=!0),-1!==this.m_endColHeader&&-1!==this.m_endColEndHeader){let e=this._isDynamicFreezeFeasible(a.column,s,h);n=e.isFeasible,l=e.headerIndex,r=e.endHeaderIndex,t=this._getMaxExtentNestedHeader(s,l,r,h)}else-1!==this.m_endColHeader?s="column":-1!==this.m_endColEndHeader&&(s="columnEnd"),t=this.getHeaderFromCell(i,s)}else{let e,i=t[o].index,l=!1;if(i<this.m_frozenColIndex+1&&(l=!0),-1!==this.m_endColHeader&&-1!==this.m_endColEndHeader){let o=this._isDynamicFreezeFeasible(i,s,l);n=o.isFeasible,i=o.headerIndex,e=o.endHeaderIndex,t=this._getMaxExtentNestedHeader(s,i,e,l)}}if(n){this._mutateColumnFrozenContainer(t,i,s),this.deleteAndApplyHiddenIndicators();let n={event:e,ui:{frozenCount:this.m_frozenColIndex+1}};this.fireEvent("columnFreeze",n)}},z.prototype._getMaxExtentNestedHeader=function(e,t,i,s){let n,o=t,l=s?this.m_colHeaderFrozen:this.m_colHeader,r=s?this.m_colEndHeaderFrozen:this.m_colEndHeader,a="column"===e?this.m_columnHeaderLevelCount:this.m_rowHeaderLevelCount,h="column"===e?this.m_startColHeader:this.m_startRowHeader;"row"===e&&(l=s?this.m_rowHeaderFrozen:this.m_rowHeader,r=s?this.m_rowEndHeaderFrozen:this.m_rowEndHeader);let d=l;return t<i&&(o=i,a="column"===e?this.m_columnEndHeaderLevelCount:this.m_rowEndHeaderLevelCount,d=r,h="column"===e?this.m_startColEndHeader:this.m_startRowEndHeader),n=this._getHeaderByIndex(o,a-1,d,a,h),n},z.prototype._isDynamicFreezeFeasible=function(e,t,i){let s=!1,n=e,o=e,l=this.m_frozenRowIndex,r=i?this.m_rowHeaderFrozen:this.m_rowHeader,a=i?this.m_rowEndHeaderFrozen:this.m_rowEndHeader,h=this.m_rowHeaderLevelCount,d=this.m_rowEndHeaderLevelCount;"column"===t&&(l=this.m_frozenColIndex,r=i?this.m_colHeaderFrozen:this.m_colHeader,a=i?this.m_colEndHeaderFrozen:this.m_colEndHeader,h=this.m_columnHeaderLevelCount,d=this.m_columnEndHeaderLevelCount),i||(1===h&&(n=e-(l+1)),1===d&&(o=e-(l+1)));let m,c,u=1,_=1,p=n,g=o;h>1&&(m=this._getHeaderContainer(n,0,0,null,r,h),u=this._getExtent(m,t),p=this._getAttribute(m,"start",!0)+u),d>1&&(c=this._getHeaderContainer(o,0,0,null,a,d),_=this._getExtent(c,t),g=this._getAttribute(c,"start",!0)+_),u!==_&&1!==u&&1!==_&&p!==g||(s=!0);const C=u>_?u:_;return s&&C>1&&(C===u?n=this._adjustFrozenIndexBasedOnExtent(n,C):o=this._adjustFrozenIndexBasedOnExtent(o,C)),{isFeasible:s,headerIndex:n,endHeaderIndex:o}},z.prototype._getOutermostHeaderFromNestedHeaders=function(e){let t=!1;const i=this.getMappedStyle("groupingcontainer"),s=this.getMappedStyle("endheadercell"),n=this.getMappedStyle("headercell");for(;e.parentNode.classList.contains(i);)e.classList.contains(s)&&(t=!0),e=e.parentNode;return e.classList.contains(i)&&(e=t?e.querySelector(`.${s}`):e.querySelector(`.${n}`)),e},z.prototype._mutateColumnFrozenContainer=function(e,t,i){const s=this.getResources().getMappedAttribute("context");if(e){e=this._getOutermostHeaderFromNestedHeaders(e);let t=this.getHeaderCellIndex(e),n=e[s].extent;n>1&&(t+=n-1);const o=this.m_utils.containsCSSClassName(e,this.getMappedStyle("frozenHeader"));this._hasFrozenColumns()?o?t!==this.m_frozenColIndex&&this._removeCellsFromFrozenColumnContainer(t,e):this._appendCellsToFrozenColumnContainer(t,e,!1):null!==this.m_frozenColIndex&&-1!==this.m_frozenColIndex||this._createColumnFrozenSectionAndMutate(i,t,e)}else{let e=t[s].indexes.column;if(null===this.m_frozenColIndex||-1===this.m_frozenColIndex)this._createColumnFrozenSectionAndMutate(i,e,null);else{let i=!1;this.m_utils.containsCSSClassName(t,this.getMappedStyle("frozenCell"))&&(this.m_databodyFrozenCorner.querySelector(`#${t.id}`)||this.m_databodyFrozenCol.querySelector(`#${t.id}`))&&(i=!0),i?this._removeCellsFromFrozenColumnContainer(e):this._appendCellsToFrozenColumnContainer(e,null,!1)}}},z.prototype._createColumnFrozenSectionAndMutate=function(e,t,i){this._createFrozenHeaderElements("column",this.getMappedStyle("colHeaderFrozen"),this.getMappedStyle("colEndHeaderFrozen"));const s=this._createDatabodyElement("databodyFrozenCol");if(this.m_root.insertBefore(s,this.m_status),this.m_databodyFrozenCol=s,this._hasFrozenRows()){const e=this._createDatabodyElement("databodyFrozenCorner");this.m_root.insertBefore(e,this.m_status),this.m_databodyFrozenCorner=e}this._addListenersOnFrozenSections(null,null,this.m_colHeaderFrozen,this.m_colEndHeaderFrozen),this._appendCellsToFrozenColumnContainer(t,i,!0)},z.prototype._mutateRowFrozenContainer=function(e,t,i){const s=this.getResources().getMappedAttribute("context");if(e){e=this._getOutermostHeaderFromNestedHeaders(e);let t=this.getHeaderCellIndex(e),n=e[s].extent;n>1&&(t+=n-1);const o=this.m_utils.containsCSSClassName(e,this.getMappedStyle("frozenHeader"));this._hasFrozenRows()?o?t!==this.m_frozenRowIndex&&this._removeCellsFromFrozenRowContainer(t):this._appendCellsToFrozenRowContainer(t,e,!1):null!==this.m_frozenRowIndex&&-1!==this.m_frozenRowIndex||this._createRowFrozenSectionAndMutate(i,t)}else{let e=t[s].indexes.row;if(null===this.m_frozenRowIndex||-1===this.m_frozenRowIndex)this._createRowFrozenSectionAndMutate(i,e,null);else{let i=!1;this.m_utils.containsCSSClassName(t,this.getMappedStyle("frozenCell"))&&(this.m_databodyFrozenRow.querySelector(`#${t.id}`)||this.m_databodyFrozenCorner.querySelector(`#${t.id}`))&&(i=!0),i?this._removeCellsFromFrozenRowContainer(e):this._appendCellsToFrozenRowContainer(e,null,!1)}}},z.prototype._createRowFrozenSectionAndMutate=function(e,t,i){this._createFrozenHeaderElements("row",this.getMappedStyle("rowHeaderFrozen"),this.getMappedStyle("rowEndHeaderFrozen"));const s=this._createDatabodyElement("databodyFrozenRow");if(this.m_root.insertBefore(s,this.m_status),this.m_databodyFrozenRow=s,this._hasFrozenColumns()){const e=this._createDatabodyElement("databodyFrozenCorner");this.m_root.insertBefore(e,this.m_status),this.m_databodyFrozenCorner=e}this._addListenersOnFrozenSections(this.m_rowHeaderFrozen,this.m_rowEndHeaderFrozen,null,null),this._appendCellsToFrozenRowContainer(t,i,!0)},z.prototype._updateFrozenSection=function(e,t){if(-1===e)this._handleUnFreeze(t);else if(this.m_options.isFreezeEnabled(t)){let i=this.createIndex(0,e);"row"===t&&(i=this.createIndex(e,0));let s,n,o=null,l=this._getCellByIndex(i),r=!0,a=!1;if("column"===t){if(e<this.m_frozenColIndex+1&&(a=!0),-1!==this.m_endColHeader&&-1!==this.m_endColEndHeader){let i=this._isDynamicFreezeFeasible(e,t,a);r=i.isFeasible,s=i.headerIndex,n=i.endHeaderIndex,o=this._getMaxExtentNestedHeader(t,s,n,a)}else(-1!==this.m_endColHeader&&e>this.m_endColHeader||-1!==this.m_endColEndHeader&&e>this.m_endColEndHeader)&&(r=!1);r&&this._mutateColumnFrozenContainer(o,l,t)}else{if(e<this.m_frozenRowIndex+1&&(a=!0),-1!==this.m_endRowHeader&&-1!==this.m_endRowEndHeader){let i=this._isDynamicFreezeFeasible(e,t,a);r=i.isFeasible,s=i.headerIndex,n=i.endHeaderIndex,o=this._getMaxExtentNestedHeader(t,s,n,a)}else(-1!==this.m_endRowHeader&&e>this.m_endRowHeader||-1!==this.m_endRowEndHeader&&e>this.m_endRowEndHeader)&&(r=!1);r&&this._mutateRowFrozenContainer(o,l,t)}}},z.prototype._appendCellsToFrozenColumnContainer=function(e,t,i){const s=this.m_frozenColIndex,n="column",o=this.getResources().isRTLMode()?"right":"left";let l=this.getElementWidth(this.m_databodyFrozenCol),r=this.getElementDir(this.m_databodyFrozenCol,o);i&&(r=this.getElementDir(this.m_databody,o));let a=this.getElementWidth(this.m_databody);this.m_databodyFrozenRow&&(a=this.getElementWidth(this.m_databodyFrozenRow));let h=l,d=e+1,m=0;null!==s&&(m=s+1);let c=e,u=e+1,_=e+1;null!==s&&-1!==s||(u=this.m_columnHeaderLevelCount>1?e+1:0,_=this.m_columnEndHeaderLevelCount>1?e+1:0),d-=m;let p=[],{cells:g,cellsDimensionToAdjust:C}=this._getCellsToFreeze(m,c,n),f=!1;0===C&&(f=!0);let{headers:y,endHeaders:E}=this._getColumnHeadersToFreeze(t,e,c,m);if(this.m_databodyFrozenCorner){if(p=this._getFrozenAxisCells(n,c),f){let e=p[p.length-1];C=this.getElementDir(e,o)+this.getElementWidth(e)}for(let e=0;e<p.length;e++)this.setElementDir(p[e],h,o),this.m_databodyFrozenCorner.firstChild.appendChild(p[e]),e%d==d-1?h=l:h+=this.getElementWidth(p[e])}let v=h;g.length?h=this._appendElementsToFrozenContainer(n,g,this.m_databodyFrozenCol,v,o,this.getMappedStyle("frozenCell"),d):h+=C,this._appendElementsToFrozenContainer(n,y,this.m_colHeaderFrozen,v,o,this.getMappedStyle("frozenHeader"),d),E.length&&this._appendElementsToFrozenContainer(n,E,this.m_colEndHeaderFrozen,v,o,this.getMappedStyle("frozenHeader"),d),c+1<=this.m_endCol&&(this._shiftCellsAlongAxis(n,-C,c+1,!0),this.m_databodyFrozenRow&&this._hasFrozenRows()&&this._shiftFrozenCellsAlongAxis(n,-C,c+1,!0),this._shiftHeadersAlongAxisInContainer(this.m_colHeader.firstChild,u,-C,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this._shiftHeadersAlongAxisInContainer(this.m_colEndHeader.firstChild,_,-C,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell"))),this.m_endColPixel-=C,this.m_endColHeaderPixel-=C,this.m_endColEndHeaderPixel-=C;let w=r+h,H=a-C;if(H=H<0?0:H,this.m_endRowEndHeader){const e=this.getElementDir(this.m_rowEndHeader,o);h=h>e?e-r:h,w=r+h}this._setElementDimension(this.m_databody,null,w,null,H),this._setElementDimension(this.m_colHeader,null,w,null,H),this.m_colEndHeader&&this._setElementDimension(this.m_colEndHeader,null,w,null,H),i?(this._setElementDimension(this.m_databodyFrozenCol,this.getElementDir(this.m_databody,"top"),r,this.getElementHeight(this.m_databody),h),this._setElementDimension(this.m_colHeaderFrozen,this.getElementDir(this.m_colHeader,"top"),r,this.getElementHeight(this.m_colHeader),h),this.m_colEndHeader&&this._setElementDimension(this.m_colEndHeaderFrozen,this.getElementDir(this.m_colEndHeader,"top"),r,this.getElementHeight(this.m_colEndHeader),h),this.m_databodyFrozenCorner&&this._setElementDimension(this.m_databodyFrozenCorner,this.getElementDir(this.m_databodyFrozenRow,"top"),this.getElementDir(this.m_databodyFrozenRow,o),this.getElementHeight(this.m_databodyFrozenRow),h)):(this.setElementWidth(this.m_databodyFrozenCol,h),this.setElementWidth(this.m_colHeaderFrozen,h),this.m_colEndHeaderFrozen&&this.setElementWidth(this.m_colEndHeaderFrozen,h),this.m_databodyFrozenCorner&&this.setElementWidth(this.m_databodyFrozenCorner,h)),this.m_databodyFrozenRow&&this._setElementDimension(this.m_databodyFrozenRow,null,w,null,H),this._addFrozenIndicator(n,0,o,r+h,c),this.m_frozenColIndex=c},z.prototype._appendCellsToFrozenRowContainer=function(e,t,i){const s=this.m_frozenRowIndex,n="row",o=this.getResources().isRTLMode()?"right":"left";let l=this.getElementHeight(this.m_databodyFrozenRow),r=this.getElementDir(this.m_databodyFrozenRow,"top");i&&(r=this.getElementDir(this.m_databody,"top"));let a=this.getElementHeight(this.m_databody);this.m_databodyFrozenCol&&(a=this.getElementHeight(this.m_databodyFrozenCol));let h=l,d=e+1,m=0;null!==s&&(m=s+1);let c=e,u=e+1,_=e+1;null!==s&&-1!==s||(u=this.m_rowHeaderLevelCount>1?e+1:0,_=this.m_rowEndHeaderLevelCount>1?e+1:0),d-=m;let p=[],{cells:g,cellsDimensionToAdjust:C}=this._getCellsToFreeze(m,c,n),f=!1;0===C&&(f=!0);let{headers:y,endHeaders:E}=this._getRowHeadersToFreeze(t,e,c,m);if(this.m_databodyFrozenCorner){p=this._getFrozenAxisCells(n,c);for(let e=0;e<p.length;e++)this.setElementDir(p[e],h,"top"),this.m_databodyFrozenCorner.firstChild.appendChild(p[e]),e%(this.m_frozenColIndex+1)===this.m_frozenColIndex&&(h+=this.getElementHeight(p[e]),f&&(C+=this.getElementHeight(p[e])))}let v=l;g.length&&(h=this._appendElementsToFrozenContainer(n,g,this.m_databodyFrozenRow,v,"top",this.getMappedStyle("frozenCell"),d)),this._appendElementsToFrozenContainer(n,y,this.m_rowHeaderFrozen,v,"top",this.getMappedStyle("frozenHeader"),d),E.length&&this._appendElementsToFrozenContainer(n,E,this.m_rowEndHeaderFrozen,v,"top",this.getMappedStyle("frozenHeader"),d),c+1<=this.m_endRow&&(this._shiftCellsAlongAxis(n,-C,c+1,!0),this.m_databodyFrozenCol&&this._hasFrozenColumns()&&this._shiftFrozenCellsAlongAxis(n,-C,c+1,!0),this._shiftHeadersAlongAxisInContainer(this.m_rowHeader.firstChild,u,-C,"top",this.getMappedStyle("rowheadercell")),this._shiftHeadersAlongAxisInContainer(this.m_rowEndHeader.firstChild,_,-C,"top",this.getMappedStyle("rowendheadercell"))),this.m_endRowPixel-=C,this.m_endRowHeaderPixel-=C,this.m_endRowEndHeaderPixel-=C;let w=r+h,H=a-C;if(H=H<0?0:H,this.m_endColEndHeader){const e=this.getElementDir(this.m_colEndHeader,"top");h=h>e?e-r:h,w=r+h}this._setElementDimension(this.m_databody,w,null,H,null),this._setElementDimension(this.m_rowHeader,w,null,H,null),this.m_rowEndHeader&&this._setElementDimension(this.m_rowEndHeader,w,null,H,null),i?(this._setElementDimension(this.m_databodyFrozenRow,r,this.getElementDir(this.m_databody,o),h,this.getElementWidth(this.m_databody)),this._setElementDimension(this.m_rowHeaderFrozen,r,this.getElementDir(this.m_rowHeader,o),h,this.getElementWidth(this.m_rowHeader)),this.m_rowEndHeader&&this._setElementDimension(this.m_rowEndHeaderFrozen,r,this.getElementDir(this.m_rowEndHeader,o),h,this.getElementWidth(this.m_rowEndHeader)),this.m_databodyFrozenCorner&&this._setElementDimension(this.m_databodyFrozenCorner,r,this.getElementDir(this.m_databodyFrozenCol,o),h,this.getElementWidth(this.m_databodyFrozenCol))):(this.setElementHeight(this.m_databodyFrozenRow,h),this.setElementHeight(this.m_rowHeaderFrozen,h),this.m_rowEndHeaderFrozen&&this.setElementHeight(this.m_rowEndHeaderFrozen,h),this.m_databodyFrozenCorner&&this.setElementHeight(this.m_databodyFrozenCorner,h)),this.m_databodyFrozenCol&&this._setElementDimension(this.m_databodyFrozenCol,w,null,H,null),this._addFrozenIndicator(n,w,o,0,c),this.m_frozenRowIndex=c},z.prototype._getCellsToFreeze=function(e,t,i){const s="row"===i?this.getElementHeight.bind(this):this.getElementWidth.bind(this);let n=0,o=[];for(let l=e,r=0;l<=t;l+=1,r+=1){let e=this._getAxisCellsByIndex(l,i);e=e.filter(e=>!e.classList.contains(this.getMappedStyle("frozenCell"))),e.length&&(n+=s(e[0]),o.push(...e))}return{cells:o,cellsDimensionToAdjust:n}},z.prototype._getColumnHeadersToFreeze=function(e,t,i,s){let n=[],o=[];if(-1!==this.m_endColHeader)if(1===this.m_columnHeaderLevelCount)for(let e=s;e<=i;e++){let t=this._getHeaderCellsByIndex(e,"column");n.push(...t)}else{let i=!1,o=s,l=e;for(this.m_utils.containsCSSClassName(l,this.getMappedStyle("headercell"))||(l=this._getHeaderCellByIndex(t,"column",0));!i;){let e=this._getHeaderContainer(o,0,0,null,this.m_colHeader,this.m_columnHeaderLevelCount);e.querySelector(`#${l.id}`)?i=!0:o+=this._getAttribute(e,"extent",!0),n.push(e)}}if(-1!==this.m_endColEndHeader)if(1===this.m_columnEndHeaderLevelCount)for(let e=s;e<=i;e++){let t=this._getHeaderCellsByIndex(e,"columnEnd");o.push(...t)}else{let i=!1,n=s;let l=e;for(this.m_utils.containsCSSClassName(e,this.getMappedStyle("endheadercell"))||(l=this._getHeaderCellByIndex(t,"columnEnd",0));!i;){let e=this._getHeaderContainer(n,0,0,null,this.m_colEndHeader,this.m_columnEndHeaderLevelCount);e.querySelector(`#${l.id}`)?i=!0:n+=this._getAttribute(e,"extent",!0),o.push(e)}}return{headers:n,endHeaders:o}},z.prototype._getRowHeadersToFreeze=function(e,t,i,s){let n=[],o=[];if(-1!==this.m_endRowHeader)if(1===this.m_rowHeaderLevelCount)for(let e=s;e<=i;e++){let t=this._getHeaderCellsByIndex(e,"row");n.push(...t)}else{let i=!1,o=s,l=e;for(this.m_utils.containsCSSClassName(l,this.getMappedStyle("headercell"))||(l=this._getHeaderCellByIndex(t,"row",0));!i;){let e=this._getHeaderContainer(o,0,0,null,this.m_rowHeader,this.m_rowHeaderLevelCount);e.querySelector(`#${l.id}`)?i=!0:o+=this._getAttribute(e,"extent",!0),n.push(e)}}if(-1!==this.m_endRowEndHeader)if(1===this.m_rowEndHeaderLevelCount)for(let e=s;e<=i;e++){let t=this._getHeaderCellsByIndex(e,"rowEnd");o.push(...t)}else{let i=!1,n=s;let l=e;for(this.m_utils.containsCSSClassName(e,this.getMappedStyle("endheadercell"))||(l=this._getHeaderCellByIndex(t,"rowEnd",0));!i;){let e=this._getHeaderContainer(n,0,0,null,this.m_rowEndHeader,this.m_rowEndHeaderLevelCount);e.querySelector(`#${l.id}`)?i=!0:n+=this._getAttribute(e,"extent",!0),o.push(e)}}return{headers:n,endHeaders:o}},z.prototype._removeCellsFromFrozenColumnContainer=function(e){const t=this.m_frozenColIndex,i="column",s=this.getResources().isRTLMode()?"right":"left";let n=this.getElementWidth(this.m_databodyFrozenCol),o=this.getElementWidth(this.m_databody);this.m_databodyFrozenRow&&(o=this.getElementWidth(this.m_databodyFrozenRow));const l=this.getElementDir(this.m_databodyFrozenCol,s);let r=-1===e?t+1:t-e,a=0,h=[],d=[],m=this.m_columnHeaderLevelCount>1?t+1:e+1,c=this.m_columnEndHeaderLevelCount>1?t+1:e+1,{headers:u,endHeaders:_}=this._getColumnHeadersToUnFreeze(e+1),p=0;null!==this.m_frozenRowIndex&&(p=this.m_frozenRowIndex+1);for(let t=p;t<=this.m_endRow;t++)for(let i=e+1;i<=this.m_frozenColIndex;i++){let e=this._getFrozenCellByIndex(this.createIndex(t,i),"row");t===p&&(a+=this.getElementWidth(e)),h.push(e)}let g=a;for(let t=p,i=0;i<=e;i++){let e=this._getFrozenCellByIndex(this.createIndex(t,i),"row");g+=this.getElementWidth(e)}if(!g)for(let t=0,i=0;t<=e;t++){let e=this._getFrozenCellByIndex(this.createIndex(t,i),"row",!0);e&&(g+=this.getElementWidth(e))}let C=0;if(this.m_databodyFrozenCorner){let t=this.m_databodyFrozenRow.firstChild.firstChild;d=this._getFrozenAxisCells(i,e+1,!0);for(let e=0;e<d.length;e++)this.setElementDir(d[e],C,s),this.m_databodyFrozenRow.firstChild.insertBefore(d[e],t),e%r==r-1?C=0:C+=this.getElementWidth(d[e])}if(!h.length&&d.length){let e=d[d.length-1];a=this.getElementWidth(e)+this.getElementDir(e,s),g+=a}C=0;let f=this.m_databody.firstChild.firstChild;for(let e=0;e<h.length;e++)this.setElementDir(h[e],C,s),this.m_utils.removeCSSClassName(h[e],this.getMappedStyle("frozenCell")),this.m_databody.firstChild.insertBefore(h[e],f),e%r==r-1?C=0:C+=this.getElementWidth(h[e]);let y=this.m_colHeader.firstChild.firstChild;const E=this.getMappedStyle("frozenHeader");C=-a,n=g;let v=n-a;if(this.m_columnHeaderLevelCount>1&&(C=-v),this._insertFrozenElementsToContainer(i,u,this.m_colHeader,y,C,s,E,r),this.m_colEndHeader){C=-a,this.m_columnEndHeaderLevelCount>1&&(C=-v);let e=this.m_colEndHeader.firstChild.firstChild;this._insertFrozenElementsToContainer(i,_,this.m_colEndHeader,e,C,s,E,r)}t+1<=this.m_endCol&&(this._shiftCellsAlongAxis(i,a,t+1,!0),this.m_databodyFrozenRow&&this._shiftFrozenCellsAlongAxis(i,a,t+1,!0)),this._shiftHeadersAlongAxisInContainer(this.m_colHeader.firstChild,m,a,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colheadercell")),this._shiftHeadersAlongAxisInContainer(this.m_colEndHeader.firstChild,c,a,this.getResources().isRTLMode()?"right":"left",this.getMappedStyle("colendheadercell")),this.m_endColPixel+=a,this.m_endColHeaderPixel+=a,this.m_endColEndHeaderPixel+=a;let w=v+l,H=o+a;if(this.m_endRowEndHeader){const e=this.getElementDir(this.m_rowEndHeader,s);H=w+H>e?e-w:H}this._setElementDimension(this.m_databody,null,w,null,H),this._setElementDimension(this.m_colHeader,null,w,null,H),this.m_colEndHeader&&this._setElementDimension(this.m_colEndHeader,null,w,null,H),this.setElementWidth(this.m_databodyFrozenCol,v),this.setElementWidth(this.m_colHeaderFrozen,v),this.m_colEndHeaderFrozen&&this.setElementWidth(this.m_colEndHeaderFrozen,v),this.m_databodyFrozenRow&&this._setElementDimension(this.m_databodyFrozenRow,null,w,null,H),this.m_databodyFrozenCorner&&this.setElementWidth(this.m_databodyFrozenCorner,v),-1===e?this._removeFrozenIndicator(i):this._addFrozenIndicator(i,0,s,w,e),this.m_frozenColIndex=e},z.prototype._removeCellsFromFrozenRowContainer=function(e){const t=this.m_frozenRowIndex,i="row",s=this.getResources().isRTLMode()?"right":"left";let n=this.getElementHeight(this.m_databodyFrozenRow),o=this.getElementDir(this.m_databodyFrozenRow,"top"),l=this.getElementHeight(this.m_databody);this.m_databodyFrozenCol&&(l=this.getElementHeight(this.m_databodyFrozenCol));let r=-1===e?t+1:t-e,a=0,h=[],d=[],{headers:m,endHeaders:c}=this._getRowHeadersToUnFreeze(e+1),u=this.m_columnHeaderLevelCount>1?t+1:e+1,_=this.m_columnEndHeaderLevelCount>1?t+1:e+1,p=0;this._hasFrozenColumns()&&(p=this.m_frozenColIndex+1);for(let t=e+1;t<=this.m_frozenRowIndex;t++)for(let e=p;e<=this.m_endCol;e++){let i=this._getFrozenCellByIndex(this.createIndex(t,e),"column");e===p&&(a+=this.getElementHeight(i)),h.push(i)}let g=a;for(let t=0,i=p;t<=e;t++){let e=this._getFrozenCellByIndex(this.createIndex(t,i),"column");e&&(g+=this.getElementHeight(e))}if(!g)for(let t=0,i=0;t<=e;t++){let e=this._getFrozenCellByIndex(this.createIndex(t,i),"column",!0);e&&(g+=this.getElementHeight(e))}let C=0;if(this.m_databodyFrozenCorner){let t=this.m_databodyFrozenCol.firstChild.firstChild;d=this._getFrozenAxisCells(i,e+1,!0);for(let e=0;e<d.length;e++)this.setElementDir(d[e],C,"top"),this.m_databodyFrozenCol.firstChild.insertBefore(d[e],t),(e+1)%(this.m_frozenColIndex+1)==0&&(C+=this.getElementHeight(d[e]))}if(!h.length&&d.length){let e=d[d.length-1];a=this.getElementHeight(e)+this.getElementDir(e,"top"),g+=a}C=0;let f=this.m_databody.firstChild.firstChild;for(let e=0;e<h.length;e++)this.setElementDir(h[e],C,"top"),this.m_utils.removeCSSClassName(h[e],this.getMappedStyle("frozenCell")),this.m_databody.firstChild.insertBefore(h[e],f),(e+1)%Math.floor(h.length/r)==0&&(C+=this.getElementHeight(h[e]));let y=this.m_rowHeader.firstChild.firstChild;const E=this.getMappedStyle("frozenHeader");n=g;let v=n-a;if(C=-a,this.m_rowHeaderLevelCount>1&&(C=-v),this._insertFrozenElementsToContainer(i,m,this.m_rowHeader,y,C,"top",E,r),this.m_rowEndHeader){C=-a,this.m_rowEndHeaderLevelCount>1&&(C=-v);let e=this.m_rowEndHeader.firstChild.firstChild;this._insertFrozenElementsToContainer(i,c,this.m_rowEndHeader,e,C,"top",E,r)}t+1<=this.m_endRow&&(this._shiftCellsAlongAxis(i,a,t+1,!0),this.m_databodyFrozenCol&&this._shiftFrozenCellsAlongAxis(i,a,t+1,!0)),this._shiftHeadersAlongAxisInContainer(this.m_rowHeader.firstChild,u,a,"top",this.getMappedStyle("rowheadercell")),this._shiftHeadersAlongAxisInContainer(this.m_rowEndHeader.firstChild,_,a,"top",this.getMappedStyle("rowendheadercell"));let w=v+o,H=l+a;if(this.m_endColEndHeader){const e=this.getElementDir(this.m_colEndHeader,"top");H=w+H>e?e-w:H}this.m_endRowPixel+=a,this.m_endRowHeaderPixel+=a,this.m_endRowEndHeaderPixel+=a,this._setElementDimension(this.m_databody,w,null,H,null),this._setElementDimension(this.m_rowHeader,w,null,H,null),this.m_rowEndHeader&&this._setElementDimension(this.m_rowEndHeader,w,null,H,null),this.setElementHeight(this.m_databodyFrozenRow,v),this.setElementHeight(this.m_rowHeaderFrozen,v),this.m_rowEndHeaderFrozen&&this.setElementHeight(this.m_rowEndHeaderFrozen,v),this.m_databodyFrozenCol&&this._setElementDimension(this.m_databodyFrozenCol,w,null,H,null),this.m_databodyFrozenCorner&&this.setElementHeight(this.m_databodyFrozenCorner,v),-1===e?this._removeFrozenIndicator(i):this._addFrozenIndicator(i,w,s,0,e),this.m_frozenRowIndex=e},z.prototype._getColumnHeadersToUnFreeze=function(e){let t=[],i=[];if(this.m_colHeaderFrozen&&-1!==this.m_endColHeader)if(1===this.m_columnHeaderLevelCount)for(let i=e;i<=this.m_frozenColIndex;i++){let e=this._getHeaderCellsByIndex(i,"column");t.push(...e)}else for(let i=e;i<this.m_frozenColIndex;){let e=this._getHeaderContainer(i,0,0,null,this.m_colHeaderFrozen,this.m_columnHeaderLevelCount);t.push(e);i+=this._getAttribute(e,"extent",!0)}if(this.m_colEndHeaderFrozen&&-1!==this.m_endColEndHeader)if(1===this.m_columnEndHeaderLevelCount)for(let t=e;t<=this.m_frozenColIndex;t++){let e=this._getHeaderCellsByIndex(t,"columnEnd");i.push(...e)}else for(let t=e;t<this.m_frozenColIndex;){let e=this._getHeaderContainer(t,0,0,null,this.m_colEndHeaderFrozen,this.m_columnEndHeaderLevelCount);i.push(e);t+=this._getAttribute(e,"extent",!0)}return{headers:t,endHeaders:i}},z.prototype._getRowHeadersToUnFreeze=function(e){let t=[],i=[];if(this.m_rowHeaderFrozen&&-1!==this.m_endRowHeader)if(1===this.m_rowHeaderLevelCount)for(let i=e;i<=this.m_frozenRowIndex;i++){let e=this._getHeaderCellsByIndex(i,"row");t.push(...e)}else for(let i=e;i<this.m_frozenRowIndex;){let e=this._getHeaderContainer(i,0,0,null,this.m_rowHeaderFrozen,this.m_rowHeaderLevelCount);t.push(e);i+=this._getAttribute(e,"extent",!0)}if(this.m_rowEndHeaderFrozen&&-1!==this.m_endRowEndHeader)if(1===this.m_rowEndHeaderLevelCount)for(let t=e;t<=this.m_frozenRowIndex;t++){let e=this._getHeaderCellsByIndex(t,"rowEnd");i.push(...e)}else for(let t=e;t<this.m_frozenRowIndex;){let e=this._getHeaderContainer(t,0,0,null,this.m_rowEndHeaderFrozen,this.m_rowEndHeaderLevelCount);i.push(e);t+=this._getAttribute(e,"extent",!0)}return{headers:t,endHeaders:i}},z.prototype._appendElementsToFrozenContainer=function(e,t,i,s,n,o,l){let r=this.getElementHeight.bind(this);"column"===e&&(r=this.getElementWidth.bind(this));for(let e=0;e<t.length;e++)o===this.getMappedStyle("frozenHeader")&&t[e].classList.contains(this.getMappedStyle("groupingcontainer"))?(this._adjustContainerElementsDirValue(t[e],s,n,o,!1),i.firstChild.appendChild(t[e])):(this.setElementDir(t[e],s,n),this.m_utils.addCSSClassName(t[e],o),i.firstChild.appendChild(t[e]),(e+1)%Math.floor(t.length/l)==0&&(s+=r(t[e])));return s},z.prototype._adjustContainerElementsDirValue=function(e,t,i,s,n){let o=e.childNodes;for(let e=0;e<o.length;e++)if(o[e].classList&&(o[e].classList.contains(this.getMappedStyle("headercell"))||o[e].classList.contains(this.getMappedStyle("endheadercell")))){let l=this.getElementDir(o[e],i)+t;n?this.m_utils.removeCSSClassName(o[e],s):this.m_utils.addCSSClassName(o[e],s),this.setElementDir(o[e],l,i)}else this._adjustContainerElementsDirValue(o[e],t,i,s,n);return t},z.prototype._insertFrozenElementsToContainer=function(e,t,i,s,n,o,l,r){let a=this.getElementHeight.bind(this);"column"===e&&(a=this.getElementWidth.bind(this));for(let e=0;e<t.length;e++)l===this.getMappedStyle("frozenHeader")&&t[e].classList.contains(this.getMappedStyle("groupingcontainer"))?(this._adjustContainerElementsDirValue(t[e],n,o,l,!0),i.firstChild.insertBefore(t[e],s)):(this.setElementDir(t[e],n,o),this.m_utils.removeCSSClassName(t[e],l),i.firstChild.insertBefore(t[e],s),(e+1)%(t.length/r)==0&&(n+=a(t[e])))},z.prototype._getFrozenAxisCells=function(e,t,i){const s=this.m_frozenRowIndex,n=this.m_frozenColIndex;let o=0,l=s,r=n+1,a=t,h=[];null===n&&(r=0),"row"!==e||i||(s&&(o=s+1),l=t,r=0,a=n),i&&(o="row"===e?t:0,r="row"===e?0:t,a=n,l=s);for(let t=o;t<=l;t++)for(let s=r;s<=a;s++){let n=this._getFrozenCellByIndex(this.createIndex(t,s),e,i);n&&h.push(n)}return h},z.prototype._createFrozenHeaderElements=function(e,t,i){const s=this.getMappedStyle("scroller")+(this.m_utils.isTouchDeviceNotIOS()?" "+this.getMappedStyle("scroller-mobile"):"");let n;n="column"===e?"frozenColumn":"frozenRow";const o=this._createHeaderElement(n,t,s,!1);if(this.m_root.insertBefore(o,this.m_status),"column"===e?this.m_colHeaderFrozen=o:this.m_rowHeaderFrozen=o,"column"===e&&this.m_colEndHeader||"row"===e&&this.m_rowEndHeader){const t=this._createHeaderElement(n,i,s,!0);this.m_root.insertBefore(t,this.m_status),"column"===e?this.m_colEndHeaderFrozen=t:this.m_rowEndHeaderFrozen=t}},z.prototype._handleUnFreeze=function(e,t){if("column"===e&&-1!==this.m_frozenColIndex){if(this._removeCellsFromFrozenColumnContainer(-1),this.m_root.removeChild(this.m_databodyFrozenCol),this._hasFrozenColumns()&&this._hasFrozenRows()&&this.m_root.removeChild(this.m_databodyFrozenCorner),this.m_colHeaderFrozen&&this.m_root.removeChild(this.m_colHeaderFrozen),this.m_colEndHeaderFrozen&&this.m_root.removeChild(this.m_colEndHeaderFrozen),this.deleteAndApplyHiddenIndicators(),t){let e={event:t,ui:{frozenCount:0}};this.fireEvent("columnFreeze",e)}}else if("row"===e&&-1!==this.m_frozenRowIndex&&(this._removeCellsFromFrozenRowContainer(-1),this.m_root.removeChild(this.m_databodyFrozenRow),this._hasFrozenColumns()&&this._hasFrozenRows()&&this.m_root.removeChild(this.m_databodyFrozenCorner),this.m_rowHeaderFrozen&&this.m_root.removeChild(this.m_rowHeaderFrozen),this.m_rowEndHeaderFrozen&&this.m_root.removeChild(this.m_rowEndHeaderFrozen),this.deleteAndApplyHiddenIndicators(),t)){let e={event:t,ui:{frozenCount:0}};this.fireEvent("rowFreeze",e)}},z.prototype._hasFrozenRows=function(){let e=!1;return null!==this.m_frozenRowIndex&&-1!==this.m_frozenRowIndex&&(e=!0),e},z.prototype._hasFrozenColumns=function(){let e=!1;return null!==this.m_frozenColIndex&&-1!==this.m_frozenColIndex&&(e=!0),e},z.prototype.showStatusText=function(e){const t=this;"block"===this.m_status.style.display||this.m_showStatusTimeout||(this.m_showStatusTimeout=setTimeout(function(){const i=t.getResources().getTranslatedText("msgFetchingData");let s,n;if(t.m_status.setAttribute("aria-label",i),t.m_status.style.display="block",e){const e=document.createElement("div");e.className=t.getMappedStyle("loadingicon"),t.m_status.appendChild(e),s=t.getWidth()/2-t.m_status.offsetWidth/2,n=t.getHeight()/2-t.m_status.offsetHeight/2}else{s=0,n=0;const e=document.createDocumentFragment();t.buildSkeletonGrid(e),t.m_status.appendChild(e)}t.m_status.style.left=s+"px",t.m_status.style.top=n+"px",t.m_showStatusTimeout=null},this.getShowStatusDelay()))},z.prototype.buildSkeletonGrid=function(e){const t=this.getWidth(),i=this.getHeight(),s=this.getDefaultColumnWidth(),n=this.getDefaultRowHeight(),o=Math.max(1,Math.ceil(i/n)),l=Math.max(1,Math.ceil(t/s));let r=0;for(let t=0;t<o;t++){let i=0;for(let a=0;a<l;a++){const h=this.createSkeletonCell(s,n,i,r);a===l-1&&h.classList.add(this.getMappedStyle("borderVerticalNone")),t===o-1&&h.classList.add(this.getMappedStyle("borderHorizontalNone")),e.appendChild(h),i+=s}r+=n}},z.prototype.isSkeletonSupport=function(){return"skeleton"===this.getResources().getDefaultOption("loadIndicator")},z.prototype.getShowStatusDelay=function(){const e=_.getCSSTimeUnitAsMillis(this.getResources().getDefaultOption("showIndicatorDelay"));return isNaN(e)?0:e},z.prototype.hideStatusText=function(){this.m_showStatusTimeout&&(clearTimeout(this.m_showStatusTimeout),this.m_showStatusTimeout=null),this.m_status.style.display="none",this.m_utils.empty(this.m_status),this.isSkeletonSupport()&&this._removeAllSkeletons()},z.prototype._removeAllSkeletons=function(){this._resetSkeletonProperties();const e=this._getAllSkeletonContainers(this.m_root);if(e.length>0)for(let t=0;t<e.length;t++)this._remove(e[t])},z.prototype.addSkeletonCells=function(e,t,i,s,n,o,l,r,a,h){const d=this.getDefaultColumnWidth(),m=this.getDefaultRowHeight(),c=document.createDocumentFragment(),u=document.createDocumentFragment(),_=document.createDocumentFragment(),p=[],g=[];let C,f,y=o,E=l;const v=this.m_databody.firstChild;let w,H;this._hasFrozenRows()&&(w=this.m_databodyFrozenRow.firstChild),this._hasFrozenColumns()&&(H=this.m_databodyFrozenCol.firstChild);for(let o=0;o<t;o++){E=l,C=a?s+o:s+(t-1-o),"column"===e&&this._hasFrozenRows()&&C===this.m_frozenRowIndex+1&&(y-=m*(this.m_frozenRowIndex+1));for(let s=0;s<i;s++){if(f=h?n+s:n+(i-1-s),null==g[o]||null==p[s]){const e=this._getCellOrHeaderByIndex(C,"row"),t=this._getCellOrHeaderByIndex(f,"column");if(e){const t=e[this.getResources().getMappedAttribute("context")];t&&(g[o]=this._getCellDimension(null,C,t.keys?t.keys.row:t.key,"row","height"))}if(t){const e=t[this.getResources().getMappedAttribute("context")];e&&(p[s]=this._getCellDimension(null,f,e.keys?e.keys.column:e.key,"column","width"))}null==g[o]&&(g[o]=m),null==p[s]&&(p[s]=d)}"row"===e&&this._hasFrozenColumns()&&f===this.m_frozenColIndex+1&&(E-=d*(this.m_frozenColIndex+1));const l=this.createIndex(C,f);if(r||!this._skeletonSetHas(l)){const e=this.createSkeletonCell(p[s],g[o],h?E:E-p[s],a?y:y-g[o]);this._addIndexToSkeletonSet(l),s===i-1&&this.m_utils.addCSSClassName(e,this.getMappedStyle("borderVerticalNone")),o===t-1&&this.m_utils.addCSSClassName(e,this.getMappedStyle("borderHorizontalNone")),this._hasFrozenColumns()&&f<this.m_frozenColIndex+1?_.appendChild(e):this._hasFrozenRows()&&C<this.m_frozenRowIndex+1?u.appendChild(e):c.appendChild(e)}E=h?E+p[s]:E-p[s]}y=a?y+g[o]:y-g[o]}if(this.m_skeletonRowStart=s,this.m_skeletonRowEnd=s+t-1,this.m_skeletonColStart=n,this.m_skeletonColEnd=n+i-1,this.m_skeletonColStartPixel=h?l:E,this.m_skeletonColEndPixel=h?E:l,this.m_skeletonRowStartPixel=a?o:y,this.m_skeletonRowEndPixel=a?y:o,c.childElementCount>0){let e=this._getAllSkeletonContainers(v);e=0===e.length?this._createSkeletonContainer():e[0],e.appendChild(c),v.appendChild(e)}if(_.childElementCount>0){let e=this._getAllSkeletonContainers(H);e=0===e.length?this._createSkeletonContainer():e[0],e.appendChild(_),H.appendChild(e)}if(u.childElementCount>0){let e=this._getAllSkeletonContainers(w);e=0===e.length?this._createSkeletonContainer():e[0],e.appendChild(u),w.appendChild(e)}r||("row"===e?(this.m_hasRowHeader&&this.createHeaderSkeletonCells(this.m_rowHeader,"row",t,this.m_rowHeaderLevelWidths,0,o,a),this.m_hasRowEndHeader&&this.createHeaderSkeletonCells(this.m_rowEndHeader,"row",t,this.m_rowEndHeaderLevelWidths,0,o,a)):"column"===e&&(this.m_hasColHeader&&this.createHeaderSkeletonCells(this.m_colHeader,"column",i,this.m_columnHeaderLevelHeights,l,0,h),this.m_hasColEndHeader&&this.createHeaderSkeletonCells(this.m_colEndHeader,"column",i,this.m_columnEndHeaderLevelHeights,l,0,h)))},z.prototype.createSkeletonCell=function(e,t,i,s){const n=this.getResources().isRTLMode()?"right":"left",o=document.createElement("div");o.className=this.getMappedStyle("skeletonCell");const l=document.createElement("div");return l.classList.add(this.getMappedStyle("skeleton"),this.getMappedStyle("skeletonAnimation")),o.appendChild(l),this.setElementHeight(o,t),this.setElementWidth(o,e),this.setElementDir(o,s,"top"),this.setElementDir(o,i,n),o},z.prototype.createHeaderSkeletonCells=function(e,t,i,s,n,o,l){let r=i,a=s.length,h=this.getDefaultColumnWidth(),d=this.getDefaultRowHeight();"column"===t&&(r=s.length,a=i);const m=document.createDocumentFragment();let c=o;for(let e=0;e<r;e++){let i=n;for(let n=0;n<a;n++){let o;"row"===t?h=s[n]:d=s[e],l?(o=this.createSkeletonCell(h,d,i,c),i+=h):"row"===t?(o=this.createSkeletonCell(h,d,i,c-d),i+=h):(o=this.createSkeletonCell(h,d,i-h,c),i-=h),m.appendChild(o)}l||"column"===t?c+=d:c-=d}if(m.childElementCount>0){let t=this._getAllSkeletonContainers(e);t=0===t.length?this._createSkeletonContainer():t[0],t.appendChild(m),e.firstChild.appendChild(t)}},z.prototype.loadSkeletons=function(e,t,i,s,n,o){let l,r,a,h,d,m=this.getFetchSize("row"),c=this.getFetchSize("column"),u=!0,_=!0;const p=this._getViewportLeft(),g=this._getViewportRight(),C=this._getViewportTop()<0?0:this._getViewportTop(),f=this._getViewportBottom(),y=null!=this.m_skeletonRowStart?this.m_skeletonRowStart:this.m_startRow,E=null!=this.m_skeletonRowStartPixel?this.m_skeletonRowStartPixel:this.m_startRowPixel,v=null!=this.m_skeletonRowEnd?this.m_skeletonRowEnd:this.m_endRow,w=null!=this.m_skeletonRowEndPixel?this.m_skeletonRowEndPixel:this.m_endRowPixel,H=null!=this.m_skeletonColStart?this.m_skeletonColStart:this.m_startCol,x=null!=this.m_skeletonColStartPixel?this.m_skeletonColStartPixel:this.m_startColPixel,S=null!=this.m_skeletonColEnd?this.m_skeletonColEnd:this.m_endCol,b=null!=this.m_skeletonColEndPixel?this.m_skeletonColEndPixel:this.m_endColPixel;if(this.m_prevScrollLeft>t&&x>p)l=i,h=n,m=Math.max(this.getFetchCount("row",l),this.m_endRow-l),r=Math.min(H-c,s),a=Math.min(x,o+c*this.getDefaultColumnWidth()),_=!1,d="column";else if(!(this.m_prevScrollLeft<t&&b<=g)||this.m_stopColumnHeaderFetch&&this.m_stopColumnEndHeaderFetch&&this.m_stopColumnFetch)if(this.m_prevScrollTop>e&&E>C)r=s,a=o,c=Math.max(this.getFetchCount("column",r),this.m_endCol-r),l=Math.min(y-m,i),h=Math.min(E,n+m*this.getDefaultRowHeight()),u=!1,d="row";else{if(!(this.m_prevScrollTop<e&&w<=f)||this.m_stopRowHeaderFetch&&this.m_stopRowEndHeaderFetch&&this.m_stopRowFetch)return;this._isHighWatermarkScrolling()?(l=this.m_endRow+1,r=this.m_startCol,u=i>=this.m_startRow,h=u?this.m_endRowPixel:this.m_startRowPixel,a=this.m_startColPixel,m=z.SKELETON_DEFAULT_COUNT,c=this.m_endCol-this.m_startCol+1):(r=s,a=o,c=Math.max(this.getFetchCount("column",r),this.m_endCol-r),l=Math.max(v+1,i),h=Math.max(w,n),m=this.getFetchCount("row",l)),d="row"}else this._isHighWatermarkScrolling()?(m=this.m_endRow-this.m_startRow+1,c=z.SKELETON_DEFAULT_COUNT,l=this.m_startRow,r=this.m_endCol+1,_=r>=this.m_startCol,h=this.m_startRowPixel,a=_?this.m_endColPixel:this.m_startColPixel):(l=i,h=n,m=Math.max(this.getFetchCount("row",l),this.m_endRow-l),r=Math.max(S+1,s),a=Math.max(b,o),c=this.getFetchCount("column",r)),d="column";this._isHighWatermarkScrolling()&&!this.isFetchComplete()||this.addSkeletonCells(d,m,c,l,r,h,a,!1,u,_)},z.prototype.loadSkeletonsOnHeaderLoad=function(e,t,i,s){let n=i&&i.getCount()||s&&s.getCount();if(0===n||!this.isSkeletonSupport())return;let o=n,l=this.isLongScroll()?this.getFetchSize("column"):this.m_endCol-this.m_startCol+1,r=t,a=this.m_startCol,h=r>=this.m_startRow,d=!0,m=!this.isLongScroll()&&h?this.m_endRowPixel:this.m_startRowPixel,c=this.m_startColPixel;"column"===e&&(o=this.isLongScroll()?this.getFetchSize("row"):this.m_endRow-this.m_startRow+1,l=n,r=this.m_startRow,a=t,h=!0,d=a>=this.m_startCol,m=this.m_startRowPixel,c=!this.isLongScroll()&&d?this.m_endColPixel:this.m_startColPixel),this.isLongScroll()&&(h=!0,d=!0),this.isHeaderFetchComplete()&&!this.m_headerInvalid&&(this.hideStatusText(),this.addSkeletonCells(e,o,l,r,a,m,c,!0,h,d))},z.prototype._addIndexToSkeletonSet=function(e){const t="r"+e.row+"c"+e.column;this.m_skeletonSet.add(t)},z.prototype._skeletonSetHas=function(e){const t="r"+e.row+"c"+e.column;return this.m_skeletonSet.has(t)},z.prototype._getAllNonSkeletonContainerNodes=function(e){return e.querySelectorAll(`:scope > div:not(.${this.getMappedStyle("skeletonContainer")})`)},z.prototype._removeAllNonSkeletonContainerNodes=function(e){this._getAllNonSkeletonContainerNodes(e).forEach(e=>{this._remove(e)})},z.prototype._getAllSkeletonContainers=function(e){return e.querySelectorAll(`.${this.getMappedStyle("skeletonContainer")}`)},z.prototype._createSkeletonContainer=function(){const e=document.createElement("div");return e.classList.add(this.getMappedStyle("skeletonContainer")),e},z.prototype._scrollSkeletonHeadersIntoViewport=function(e,t,i,s){const n={index:s?e+z.SKELETON_DEFAULT_COUNT:Math.max(0,e-z.SKELETON_DEFAULT_COUNT),axis:t,level:i};this.scrollToHeader(n),n.index=s?e+1:e-1,this.m_scrollHeaderAfterFetch=n},z.prototype._scrollSkeletonCellsIntoViewport=function(e,t,i,s){let n=e,o=t;"column"===i?(o=s?t+z.SKELETON_DEFAULT_COUNT:Math.max(0,t-z.SKELETON_DEFAULT_COUNT),t=s?t+1:t-1):(n=s?e+z.SKELETON_DEFAULT_COUNT:Math.max(0,e-z.SKELETON_DEFAULT_COUNT),e=s?e+1:e-1),this.scrollToIndex(this.createIndex(n,o),!1),this.m_scrollIndexAfterFetch=this.createIndex(e,t)},z.prototype._resetSkeletonProperties=function(){this.m_skeletonRowStart=null,this.m_skeletonRowEnd=null,this.m_skeletonColStart=null,this.m_skeletonColEnd=null,this.m_skeletonColStartPixel=null,this.m_skeletonColEndPixel=null,this.m_skeletonRowStartPixel=null,this.m_skeletonRowEndPixel=null,this.m_skeletonSet=new Set},z.prototype.setHiddenColumns=function(e){void 0!==e&&(this.m_hiddenColumns=null===e?[]:e)},z.prototype.getHiddenIndicatorByIndex=function(e,t,i){let s;if(s=i?t.querySelectorAll(`.${this.getResources().getMappedStyle("headerHiddenIndicator")}`):t.querySelectorAll(`.${this.getResources().getMappedStyle("databodyHiddenIndicator")}`),s=Array.from(s),s.length>0){const t=s.find(t=>this._getAttribute(t,"hiddenIndicatorIndex",!0)===e);if(t)return t}return null},z.prototype.getActiveDatabodyIndicators=function(){let e=[];if(this._hasFrozenColumns()){this.m_databodyFrozenCol.firstChild.querySelectorAll(`.${this.getResources().getMappedStyle("databodyHiddenIndicator")}`).forEach(t=>e.push(this._getAttribute(t,"hiddenIndicatorIndex",!0)))}if(this._hasFrozenRows()){this.m_databodyFrozenRow.firstChild.querySelectorAll(`.${this.getResources().getMappedStyle("databodyHiddenIndicator")}`).forEach(t=>e.push(this._getAttribute(t,"hiddenIndicatorIndex",!0)))}if(this._hasFrozenColumns()&&this._hasFrozenRows()){this.m_databodyFrozenCorner.firstChild.querySelectorAll(`.${this.getResources().getMappedStyle("databodyHiddenIndicator")}`).forEach(t=>e.push(this._getAttribute(t,"hiddenIndicatorIndex",!0)))}return this.m_databody.firstChild.querySelectorAll(`.${this.getResources().getMappedStyle("databodyHiddenIndicator")}`).forEach(t=>e.push(this._getAttribute(t,"hiddenIndicatorIndex",!0))),e.length>0?[...new Set(e)]:null},z.prototype.getIndexesByHeader=function(e){let t=e[this.getResources().getMappedAttribute("context")],i=[],s=t.index,n=t.extent;for(let e=s;e<s+n;e++)i.push(e);return i},z.prototype.applyHiddenIndicatorToRange=function(e,t,i){const s=this.getResources().isRTLMode()?"right":"left";let n,o=this.m_hiddenColumns;o.sort((e,t)=>e-t);let l=this.m_columnHeaderLevelCount,r=this.m_startColHeader;for(let a=e;a<=t;a++)if(this.m_hiddenColumns.includes(a)){let e,t=-1===a?0:a;if(1===l&&(this.m_hasColHeader||this.m_hasColEndHeader)){let e=this._getHeaderCellByIndex(t,"column",0);if(e){let n=this.getElementDir(e,s);n+=-1===a?0:this.getElementWidth(e),this.renderHiddenColumnVisualIndicator("column",0,s,n,t,i)}}else{n=this._hasFrozenColumns()&&a<=this.m_frozenColIndex?this.m_colHeaderFrozen:this.m_colHeader;let h,d=this._getHeadersByIndex(a,n,l,r);for(let n=d.length-1;n>=0;n--)if(e=d[n],h=this.getIndexesByHeader(e),this.isArraySubset(h,o)){let l=this.getElementDir(e,"top"),r=this.getElementDir(e,s);r+=-1===n?0:this.getElementWidth(e),this.renderHiddenColumnVisualIndicator("column",l,s,r,t,i),o=o.filter(e=>!h.includes(e))}}}},z.prototype.renderHiddenColumnVisualIndicator=function(e,t,i,s,n,o){let l,r,a,h,d;this._hasFrozenColumns()&&n<=this.m_frozenColIndex?(r=this.m_colHeaderFrozen,a=this.m_colEndHeaderFrozen,l=this.m_databodyFrozenCol):(r=this.m_colHeader,a=this.m_colEndHeader,l=this.m_databody),"row"===e?(h="width",d="width"):"column"===e&&(h="height",d="height");let m=0,c=0,u=0;u=this.getElementDir(this.m_databody.firstChild,h),m=this.getElementDir(r.firstChild,d)-t,c=this.getElementDir(a.firstChild,d)-t;let _=0,p=0;this.isFirstOrFirstNonHiddenIndex(n+1)?(_=2,p=1):this.isLastOrLastNonHiddenIndex(n-1)&&(_=-2,p=-1);let g="headerHiddenIndicator",C="databodyHiddenIndicator";if("column"===e||"columnEnd"===e){if(this.m_hasColHeader){let e=document.createElement("div");this._setAttribute(e,"hiddenIndicatorIndex",n),this._setVisualIndicatorStyle(e,g,t,i,s+_-2,m,d),r.firstChild.appendChild(e)}if(this.m_hasColEndHeader){let e=document.createElement("div");this._setAttribute(e,"hiddenIndicatorIndex",n),this._setVisualIndicatorStyle(e,g,0,i,s+_-2,c,d),a.firstChild.appendChild(e)}if(o&&o.includes(n)){let e=document.createElement("div");if(this._setAttribute(e,"hiddenIndicatorIndex",n),this._setVisualIndicatorStyle(e,C,0,i,s+p-1,u,h),l.firstChild.appendChild(e),this._hasFrozenRows())if(this._hasFrozenColumns()&&n<=this.m_frozenColIndex){let e=document.createElement("div"),t=0,o=this.m_databodyFrozenCorner;t=this.getElementDir(o.firstChild,h),this._setAttribute(e,"hiddenIndicatorIndex",n),this._setVisualIndicatorStyle(e,C,0,i,s+p-1,t,h),o.firstChild.appendChild(e)}else{let e=document.createElement("div"),t=0,o=this.m_databodyFrozenRow;t=this.getElementDir(o.firstChild,h),this._setAttribute(e,"hiddenIndicatorIndex",n),this._setVisualIndicatorStyle(e,C,0,i,s+p-1,t,h),o.firstChild.appendChild(e)}}}},z.prototype.isHidden=function(e,t){return!("column"!==e&&"columnEnd"!==e||!this.m_hiddenColumns.includes(t))},z.prototype.isHeaderHidden=function(e){let t,i,s,n,o=[];if(e&&(t=e[this.getResources().getMappedAttribute("context")],i=t.extent,n=t.axis,s=t.index),"column"===n||"columnEnd"===n)if(1===i){if(this.m_hiddenColumns.includes(s))return!0}else if(o=this.getIndexesByHeader(e),this.isArraySubset(o,this.m_hiddenColumns))return!0;return!1},z.prototype.arrayIndices=function(e,t){let i;i=this._isCountUnknownOrHighwatermark("column")?this._getMaxRight():Math.max(0,this.getDataSource().getCount("column")-1);let s=[];if(t.left)for(let t=0;t<=e;t++)s.push(t);else if(t.right)for(let t=e;t<=i;t++)s.push(t);return s},z.prototype.isArraySubset=function(e,t){return e.every(e=>t.includes(e))},z.prototype.hiddenColumnsInDirection=function(e,t){let i=new Set(this.arrayIndices(e,t));return this.m_hiddenColumns.filter(e=>i.has(e))},z.prototype.isFirstOrFirstNonHiddenIndex=function(e){if(e>=0){for(let t=0;t<=e-1;t++)if(!this.m_hiddenColumns.includes(t))return!1;return!0}return!1},z.prototype.isLastOrLastNonHiddenIndex=function(e){if(e>=0){let t;t=this._isCountUnknownOrHighwatermark("column")?this._getMaxRight():Math.max(0,this.getDataSource().getCount("column")-1);for(let i=t;i>=e+1;i--)if(!this.m_hiddenColumns.includes(i))return!1;return!0}return!1},z.prototype.getVisibleCellIndexInDirection=function(e,t,i){let s=t;if("column"===e||"columnEnd"===e)if(i.right||i.down)for(;this.m_hiddenColumns.includes(s);)s+=1;else if(i.left||i.up)for(;this.m_hiddenColumns.includes(s);)s-=1;return s},z.prototype._handleHideColumn=function(e){let t=this.findHeader(e.target),i=this.findCell(e.target),s=this.m_selection,n=this.m_options.options.selectionMode,o=n.cell,l=n.row,r=[];if(s.length&&"multiple"===o)for(let e=0;e<s.length;e++){let t=s[e].startIndex.column,i=s[e].endIndex.column;for(let e=t;e<=i;e++)r.push(e)}else if("single"===o)s.length?r.push(s[0].startIndex.column):t&&(r=this.getIndexesByHeader(t));else if("none"===o&&"none"===l)t?r=this.getIndexesByHeader(t):i&&r.push(this._getIndex(i,"column"));else{if("multiple"!==l&&"single"!==l)return;if(!t)return;r=this.getIndexesByHeader(t)}for(let e=0;e<r.length;e++){let t=r[e];this.m_hiddenColumns.includes(t)||this.m_hiddenColumns.push(t),this.shiftCellsForHidability(t,!0)}this.focusNextVisibleColumn(t,i,e),this.deleteAndApplyHiddenIndicators(r),this.fillViewport();let a={event:e,ui:{hiddenColumns:new Set(this.m_hiddenColumns)}};this.fireEvent("columnHide",a)},z.prototype.focusNextVisibleColumn=function(e,t,i){let s,n;if(e)s=this._getIndex(e,"column");else{if(!t)return;s=this._getIndex(t,"column")}if(n=this.isLastOrLastNonHiddenIndex(s)?this.getVisibleCellIndexInDirection("column",s,{left:!0}):this.getVisibleCellIndexInDirection("column",s,{right:!0}),e){let t=e[this.getResources().getMappedAttribute("context")],i=t.level,s=t.axis;var o=this._getHeaderCellByIndex(n,s,i);this._setActive(o,{type:"header",index:n,level:i,axis:s})}else if(t){let e=t[this.getResources().getMappedAttribute("context")].indexes.row,s=this.createIndex(e,n);this._setActiveByIndex(s,i)}},z.prototype._updateHiddenSection=function(e){const t=this.m_hiddenColumns.filter(t=>!e.includes(t));let i=e.filter(e=>!this.m_hiddenColumns.includes(e));this.m_hiddenColumns=e;for(let e=0;e<i.length;e++){let t=i[e];this.shiftCellsForHidability(t,!0)}for(let e=0;e<t.length;e++){let i=t[e];this.shiftCellsForHidability(i)}this.deleteAndApplyHiddenIndicators(i),this.fillViewport()},z.prototype.containsHiddenItems=function(e){let t=e.filter(e=>this.m_hiddenColumns.includes(e));return t.sort((e,t)=>e-t),t},z.prototype._handleUnhideColumn=function(e){let t=this.findHeader(e.target),i=this.findCell(e.target),s=this.m_selection,n=this.getColumnSelectionIndexArray(),o=this.m_options.options.selectionMode,l=o.cell,r=o.row,a=this.containsHiddenItems(n),h=[];const d=e=>{let t=[],i=[];for(let s=0;s<e.length;s++){let n=0;for(;this.m_hiddenColumns.includes(e[s]-1-n);)t.push(e[s]-1-n),n+=1;let o=0;for(;this.m_hiddenColumns.includes(e[s]+1+o);)i.push(e[s]+1+o),o+=1}return[...t,...i]};if(this.areAllColumnsSelectedViaRowSelection())h=[...this.m_hiddenColumns];else if(s.length&&"multiple"===l)for(let e=0;e<n.length;e++){let t=n[e];if(a.length){h=a;break}if(this.isFirstOrFirstNonHiddenIndex(t)&&this.isLastOrLastNonHiddenIndex(t))h=d([t]);else if(this.isFirstOrFirstNonHiddenIndex(t)){let e=[];for(let i=0;i<=t-1;i++)e.push(i);h=e}else if(this.isLastOrLastNonHiddenIndex(t)){let e=[];for(let i=t+1;i<=this._getMaxRight();i++)e.push(i);h=e}}else if("single"===l)s.length?h=d(n):t&&(n=this.getIndexesByHeader(t),h=d(n));else if("none"===l&&"none"===r)t?(n=this.getIndexesByHeader(t),h=d(n)):i&&(n.push(this._getIndex(i,"column")),h=d(n));else{if("multiple"!==r&&"single"!==r)return;if(!t)return;n=this.getIndexesByHeader(t),h=d(n)}this.unhighlightSelection();for(let e=0;e<h.length;e++){let t=h[e],i=this.m_hiddenColumns.indexOf(t);-1!==i&&this.m_hiddenColumns.splice(i,1),this.shiftCellsForHidability(t)}this.deleteAndApplyHiddenIndicators(),this.applySelection(),this._resetHeaderHighLight(),this.resizeGrid();let m={event:e,ui:{hiddenColumns:new Set(this.m_hiddenColumns)}};this.fireEvent("columnHide",m)},z.prototype.shiftCellsForHidability=function(e,t){var i=this.getResources().isRTLMode()?"right":"left";const s=this.getMappedStyle("colheadercell"),n=this.getMappedStyle("colendheadercell");let o,l,r,a,h,d,m,c,u,_,p=this.m_startRow,g=e,C=this.createIndex(p,g);if(o=this._getCellByIndex(C),r=o[this.getResources().getMappedAttribute("context")],l=r.keys.column,a=this.getElementWidth(o),d=this.m_sizingManager.getSize("column",l),h=t?0:d,c=h-a,0!==c){let o=!1;if(this._hasFrozenColumns()&&e<=this.m_frozenColIndex?(o=!0,u=this.m_colHeaderFrozen,_=this.m_colEndHeaderFrozen):(u=this.m_colHeader,_=this.m_colEndHeader),null==this.m_databody.firstChild||o){if(o&&this.m_databodyFrozenCol){let e=this.getElementWidth(this.m_databodyFrozenCol),t=this.getElementDir(this.m_databodyFrozenCol,i);if(-1!==this.m_endRowEndHeader){let s=this.getElementDir(this.m_rowEndHeader,i);c=t+e+c>s?s-(t+e):c}m=e+c,this.setElementWidth(this.m_databodyFrozenCol,m),this.setElementWidth(this.m_databodyFrozenCol,m),this.m_databodyFrozenCorner&&(this.setElementWidth(this.m_databodyFrozenCorner,m),this.setElementWidth(this.m_databodyFrozenCorner,m))}}else{m=this.getElementWidth(this.m_databody.firstChild)+c,this.setElementWidth(this.m_databody.firstChild,m),this.m_databodyFrozenRow&&this.setElementWidth(this.m_databodyFrozenRow.firstChild,m)}let l=!1;this.m_hasColHeader&&(this._shiftHeadersAlongAxisInContainer(u.firstChild,g,c,i,s,"column",!0,t),o||(this.m_endColHeaderPixel+=c)),this.m_hasColEndHeader&&(this._shiftHeadersAlongAxisInContainer(_.firstChild,g,c,i,n,"column",!0,t),o||(this.m_endColEndHeaderPixel+=c)),o?(this.m_databodyFrozenRow&&(l=!0),this._shiftCellsAlongAxis("column",c,g,null,this.m_frozenColIndex,l,!0)):(this._shiftCellsAlongAxis("column",c,g,!1,void 0,void 0,!0),this.m_databodyFrozenRow&&this._shiftFrozenCellsAlongAxis("column",c,g,!1,!0),this.m_endColPixel+=c),this.manageResizeScrollbars()}},z.prototype.deleteAndApplyHiddenIndicators=function(e){let t=this.m_startCol,i=this.m_endCol;this.deleteAllHiddenVisualIndicators(),this.applyHiddenIndicatorToRange(t,i,e)},z.prototype.deleteAllHiddenVisualIndicators=function(){let e=this.m_colHeader.firstChild,t=this.m_colEndHeader.firstChild;if(this.deleteDatabodyHiddenVisualIndicators(),e.querySelectorAll(`.${this.getResources().getMappedStyle("headerHiddenIndicator")}`).forEach(e=>this._remove(e)),t.querySelectorAll(`.${this.getResources().getMappedStyle("headerHiddenIndicator")}`).forEach(e=>this._remove(e)),this._hasFrozenColumns()){let e=this.m_colHeaderFrozen.firstChild,t=this.m_colEndHeaderFrozen.firstChild;e.querySelectorAll(`.${this.getResources().getMappedStyle("headerHiddenIndicator")}`).forEach(e=>this._remove(e)),t.querySelectorAll(`.${this.getResources().getMappedStyle("headerHiddenIndicator")}`).forEach(e=>this._remove(e))}},z.prototype.deleteDatabodyHiddenVisualIndicators=function(){if(this.m_databody.firstChild.querySelectorAll(`.${this.getResources().getMappedStyle("databodyHiddenIndicator")}`).forEach(e=>this._remove(e)),this._hasFrozenColumns()){this.m_databodyFrozenCol.firstChild.querySelectorAll(`.${this.getResources().getMappedStyle("databodyHiddenIndicator")}`).forEach(e=>this._remove(e))}if(this._hasFrozenRows()){this.m_databodyFrozenRow.firstChild.querySelectorAll(`.${this.getResources().getMappedStyle("databodyHiddenIndicator")}`).forEach(e=>this._remove(e))}if(this._hasFrozenColumns()&&this._hasFrozenRows()){this.m_databodyFrozenCorner.firstChild.querySelectorAll(`.${this.getResources().getMappedStyle("databodyHiddenIndicator")}`).forEach(e=>this._remove(e))}},z.prototype.updateHiddenColumnsForInsertion=function(e,t){let i=!1;for(let s=0;s<this.m_hiddenColumns.length;s++)this.m_hiddenColumns[s]>=e&&(this.m_hiddenColumns[s]+=t,i=!0);if(i){let e={event:null,ui:{hiddenColumns:new Set(this.m_hiddenColumns)}};this.fireEvent("columnHide",e)}},z.prototype.updateHiddenColumnsForDeletion=function(e){let t=!1;if(e.forEach(e=>{let i=this.m_hiddenColumns.indexOf(t=>t===e);-1!==i&&(t=!0,this.m_hiddenColumns.splice(i,1)),this.m_hiddenColumns=this.m_hiddenColumns.map(i=>i>e?(t=!0,i-1):i)}),t){let e={event:null,ui:{hiddenColumns:new Set(this.m_hiddenColumns)}};this.fireEvent("columnHide",e)}},z.prototype.canHide=function(){let e,t,i=this.m_selection,s=this.m_endCol-this.m_startCol+1,n=this.m_hiddenColumns.length,o=[];if(i.length&&this.isMultipleSelection()){if(this.areAllColumnsSelectedViaRowSelection())return!1;for(let e=0;e<i.length;e++){let t=i[e].startIndex.column,s=i[e].endIndex.column;for(let e=t;e<=s;e++)this.m_hiddenColumns.includes(e)||o.push(e)}e=o.length}else e=1;return t=s-n-e,t>0},z.prototype.isHiddenAdjacent=function(e){let t=e.cell,i=e.header,s=e.index;if(t){let e=s-1,t=s+1;return!!this.m_hiddenColumns.includes(e)||!!this.m_hiddenColumns.includes(t)}if(i){let e=[],t=[];for(let i=0;i<s.length;i++){let n=0;for(;this.m_hiddenColumns.includes(s[i]-1-n);)e.push(s[i]-1-n),n+=1;let o=0;for(;this.m_hiddenColumns.includes(s[i]+1+o);)t.push(s[i]+1+o),o+=1}return e.length>0||t.length>0}return!1},z.prototype.getColumnSelectionIndexArray=function(){let e=this.m_selection,t=[];if(e.length&&!this.areAllColumnsSelectedViaRowSelection()){for(let i=0;i<e.length;i++){let s=e[i].startIndex.column,n=e[i].endIndex.column;for(let e=s;e<=n;e++)t.push(e)}t.sort((e,t)=>e-t)}return t},z.prototype.areAllColumnsSelectedViaRowSelection=function(){let e=this.m_selection,t=this.m_options.options.selectionMode,i=t.cell,s=t.row,n="multiple"===s||"single"===s;if(e.length&&("multiple"===i||n))for(let t=0;t<e.length;t++){let i=e[t].startIndex.column,s=e[t].endIndex.column;if(0===i&&-1===s||null==i&&null==s)return!0}return!1},z.prototype._getCellHidabilityContextMenuCapability=function(e){let t=this.m_options.options.selectionMode,i=t.cell,s=t.row,n=!1,o=!1,l=this.getColumnSelectionIndexArray();const r=this.getResources().getMappedAttribute("context");if(this._isSelectionEnabled())if(this.isMultipleSelection())if("multiple"===i){if(this.canHide()&&(n=!0),l.length>0){let e=l[0],t=l[l.length-1];(this.containsHiddenItems(l).length>0||this.isFirstOrFirstNonHiddenIndex(e)||this.isLastOrLastNonHiddenIndex(t))&&(o=!0)}}else"multiple"===s&&this.m_hiddenColumns.length>0&&(o=!0);else"single"===i?(this.canHide()&&(n=!0),this.isHiddenAdjacent({cell:!0,index:l[0]})&&(o=!0)):"single"===s&&this.m_hiddenColumns.length>0&&(o=!0);else if("none"===i&&"none"===s){this.canHide()&&(n=!0);let t=e[r].indexes.column;this.isHiddenAdjacent({cell:!0,index:t})&&(o=!0)}return{canHide:n,canUnhide:o}},z.prototype._getHeaderHidabilityContextMenuCapability=function(e,t){let i=this.m_options.options.selectionMode,s=i.cell,n=i.row;var o=this.getHeaderCellAxis(e);let l=!1,r=!1,a=this.getColumnSelectionIndexArray(),h=this.m_utils.containsCSSClassName(e,this.getMappedStyle("selected"));if(this._isSelectionEnabled()&&"multiple"===s)if(h&&this.canHide()&&(l=!0),a.length>0){let e=a[0],t=a[a.length-1];(this.containsHiddenItems(a).length>0||this.isFirstOrFirstNonHiddenIndex(e)||this.isLastOrLastNonHiddenIndex(t))&&(r=!0)}else this.areAllColumnsSelectedViaRowSelection()&&this.m_hiddenColumns.length>0&&(r=!0);else if(("multiple"===n||"single"===s||"single"===n||"none"===s&&"none"===n)&&(this.m_hiddenColumns.length>0&&(r=!0),("column"===o||"columnEnd"===o)&&!t)){l=!0;let t=this.getIndexesByHeader(e);r=!!this.isHiddenAdjacent({header:!0,index:t})}return{canHide:l,canUnhide:r}}});
|
|
9
9
|
//# sourceMappingURL=ojdatagrid.js.map
|